sliccy 6.154.6 → 6.154.7

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.
Files changed (137) hide show
  1. package/README.md +1 -1
  2. package/dist/ui/.vite/manifest.json +174 -174
  3. package/dist/ui/assets/GELATIERE-CRe0rWjK.js +1 -0
  4. package/dist/ui/assets/{SKILL-Cc0Ep86w.js → SKILL-C3909YTo.js} +1 -1
  5. package/dist/ui/assets/SKILL-CLKK9YsR.js +1 -0
  6. package/dist/ui/assets/{account-store-6WG1S7Pm.js → account-store-Bv7LV6_A.js} +1 -1
  7. package/dist/ui/assets/{account-store-DZSDFGiY.js → account-store-CuTDBQ6V.js} +1 -1
  8. package/dist/ui/assets/{adobe-DqY2BLDZ.js → adobe-Bld04yf4.js} +1 -1
  9. package/dist/ui/assets/{adobe-CSD_HLUo.js → adobe-yrm9KfZU.js} +1 -1
  10. package/dist/ui/assets/{agent-bridge-D50e_bCg.js → agent-bridge-BOK0bK1-.js} +1 -1
  11. package/dist/ui/assets/{agent-panels-CQCFuU0F.js → agent-panels-JSKGPWny.js} +1 -1
  12. package/dist/ui/assets/{apply-layout-DpwYWyCv.js → apply-layout-Dol4QpYX.js} +1 -1
  13. package/dist/ui/assets/{approver-agent-BA3dC9Lg.js → approver-agent-CCkU0PVa.js} +1 -1
  14. package/dist/ui/assets/{apps-Cvv2F8Zd.js → apps-DdAoo50J.js} +1 -1
  15. package/dist/ui/assets/{azure-openai-BMHNq52P.js → azure-openai-CROWb3eo.js} +1 -1
  16. package/dist/ui/assets/{azure-openai-BoKUNg3s.js → azure-openai-D16OgVVX.js} +1 -1
  17. package/dist/ui/assets/{budget-usage-source-CxT001UE.js → budget-usage-source-CiFTPdLG.js} +1 -1
  18. package/dist/ui/assets/{cdp-DyVyxM9p.js → cdp-ChTjN36Y.js} +1 -1
  19. package/dist/ui/assets/{cerebras-BGCRJNZL.js → cerebras-BGd53Y6O.js} +1 -1
  20. package/dist/ui/assets/{cerebras-Bvb3XQZL.js → cerebras-DEjugWgo.js} +1 -1
  21. package/dist/ui/assets/{composer-speech-CpHom6zE.js → composer-speech-BvDGMHRN.js} +1 -1
  22. package/dist/ui/assets/{connect-surface-CPqNKSpt.js → connect-surface-BxeM6wzG.js} +1 -1
  23. package/dist/ui/assets/{directed-approval-Ce8FHRYj.js → directed-approval-DAIXE0nO.js} +1 -1
  24. package/dist/ui/assets/{fs-BV6duUqj.js → fs-BEbWmRDq.js} +2 -2
  25. package/dist/ui/assets/{fs-DixtpMlv.js → fs-CjgMvwqK.js} +1 -1
  26. package/dist/ui/assets/gelatiere-store-DA2wk9nw.js +1 -0
  27. package/dist/ui/assets/{gelatiere-unit-Dem3bPJm.js → gelatiere-unit-DnbLwJqw.js} +1 -1
  28. package/dist/ui/assets/{github-J67ogl3l.js → github-Bc1z9Z3b.js} +1 -1
  29. package/dist/ui/assets/{github-BK9qY3Dp.js → github-D6e0X_mv.js} +2 -2
  30. package/dist/ui/assets/{github-auth-DFK3fTyP.js → github-auth-BPlvszS_.js} +1 -1
  31. package/dist/ui/assets/{github-copilot-utdlw5T2.js → github-copilot-BQU9xIRH.js} +1 -1
  32. package/dist/ui/assets/{github-copilot-BD3tCMhs.js → github-copilot-CtFddSBT.js} +1 -1
  33. package/dist/ui/assets/{github-install-CG84acvy.js → github-install-BUmd5jOm.js} +1 -1
  34. package/dist/ui/assets/{github-zip-Dei-4lGa.js → github-zip-BbIUjzA4.js} +1 -1
  35. package/dist/ui/assets/{hear-gYxFkxil.js → hear-CYy8tVN1.js} +1 -1
  36. package/dist/ui/assets/{help-dNszPyQ5.js → help-C1vcRsvu.js} +1 -1
  37. package/dist/ui/assets/icons-Ce7Vz89o.js +1 -0
  38. package/dist/ui/assets/{js-realm-worker-Bnl_qf6X.js → js-realm-worker-JtICkZ9q.js} +1 -1
  39. package/dist/ui/assets/{kernel-worker-XuXyPE5D.js → kernel-worker-JOBY7Wxs.js} +587 -584
  40. package/dist/ui/assets/{local-llm-BHYcxEqH.js → local-llm-CJWLILc_.js} +1 -1
  41. package/dist/ui/assets/{local-llm-55U-3pMU.js → local-llm-_OhXJtNu.js} +1 -1
  42. package/dist/ui/assets/{main-DyuWfD9Q.js → main-CpKPiVl7.js} +3 -3
  43. package/dist/ui/assets/{main-cherry-BzM_BqPA.js → main-cherry-D8WCpwBV.js} +1 -1
  44. package/dist/ui/assets/{memory-curation-seam-gS_uRoYt.js → memory-curation-seam-BxXS_BMa.js} +1 -1
  45. package/dist/ui/assets/migrate-scoop-sudoers-PBnz9AA3.js +1 -0
  46. package/dist/ui/assets/{mount-Drfr_j4Q.js → mount-B-qjx7RD.js} +1 -1
  47. package/dist/ui/assets/{mount-CvjPMVSw.js → mount-CIGA8r4q.js} +3 -3
  48. package/dist/ui/assets/{mount-recovery-Be7iHZMh.js → mount-recovery-DNUbi0Ni.js} +1 -1
  49. package/dist/ui/assets/{new-session-BiudxW5x.js → new-session-Bat4OTXx.js} +2 -2
  50. package/dist/ui/assets/{oauth-bootstrap-Ls8bbNTd.js → oauth-bootstrap-D2j6OHaC.js} +2 -2
  51. package/dist/ui/assets/{onboarding-orchestrator-BjNAi3ha.js → onboarding-orchestrator-Za4dEXZ8.js} +1 -1
  52. package/dist/ui/assets/{openai-codex-BqHcjWDm.js → openai-codex-CcJ89ggy.js} +1 -1
  53. package/dist/ui/assets/{openai-codex-DCoZhGOn.js → openai-codex-f1f3Poo1.js} +1 -1
  54. package/dist/ui/assets/{openrouter-XQsjur8s.js → openrouter-B52C9XuH.js} +1 -1
  55. package/dist/ui/assets/{openrouter-LWCIZWrE.js → openrouter-DN9cM8UA.js} +1 -1
  56. package/dist/ui/assets/{openrouter-free-W8i93TBB.js → openrouter-free--eNgGfax.js} +1 -1
  57. package/dist/ui/assets/{openrouter-free-CiD2N3nW.js → openrouter-free-CiLvReDo.js} +1 -1
  58. package/dist/ui/assets/{openrouter-oauth-DUHOu5QH.js → openrouter-oauth-DOQfi9TX.js} +1 -1
  59. package/dist/ui/assets/{openrouter-oauth-C2jnsYYB.js → openrouter-oauth-Iv8iz92e.js} +1 -1
  60. package/dist/ui/assets/{panel-rpc-handlers-DokKsJYg.js → panel-rpc-handlers-DtxsALXP.js} +2 -2
  61. package/dist/ui/assets/{panelize-shell-DbP4SDhf.js → panelize-shell-Dk8A0fzt.js} +1 -1
  62. package/dist/ui/assets/{pi-edit-execution-DYRoRikS.js → pi-edit-execution-BVNON_7G.js} +1 -1
  63. package/dist/ui/assets/{provider-el781haf.js → provider-BEV4Nyb0.js} +2 -2
  64. package/dist/ui/assets/{provider-B5DqJTXt.js → provider-jRSVQQyi.js} +1 -1
  65. package/dist/ui/assets/provider-settings-Dc0Uksht.js +1 -0
  66. package/dist/ui/assets/provider-store-access-BYCBOZrX.js +1 -0
  67. package/dist/ui/assets/provider-store-access-CcCQNG5q.js +1 -0
  68. package/dist/ui/assets/{providers-BHgR4i3z.js → providers-CkE3X7zj.js} +2 -2
  69. package/dist/ui/assets/{providers-DuCgei7-.js → providers-DsDlOFZz.js} +1 -1
  70. package/dist/ui/assets/{quick-llm-BxSQl3MP.js → quick-llm-hedJ8LEL.js} +1 -1
  71. package/dist/ui/assets/{recovery-screen-zniAEHuE.js → recovery-screen-DU8WFnpT.js} +1 -1
  72. package/dist/ui/assets/{run-Dckyjx6-.js → run-C-InHvWx.js} +2 -2
  73. package/dist/ui/assets/{run-C5mIkEGQ.js → run-DTXbRzQ6.js} +1 -1
  74. package/dist/ui/assets/run-FqXwpBiQ.js +54 -0
  75. package/dist/ui/assets/{run-DnO5hH4e.js → run-dk5KyxT2.js} +1 -1
  76. package/dist/ui/assets/{session-jsonl-CWhJWPOK.js → session-jsonl-CpQqgq2a.js} +1 -1
  77. package/dist/ui/assets/{setup-feature-flags-remote-qB-mSMUq.js → setup-feature-flags-remote-DJTSDAP-.js} +1 -1
  78. package/dist/ui/assets/sidecar-repair-CPDaW6WS.js +1 -0
  79. package/dist/ui/assets/{silent-renew-backoff-C251JX1S.js → silent-renew-backoff-pEjTpf6Y.js} +1 -1
  80. package/dist/ui/assets/skills-D1r_dXXN.js +5 -0
  81. package/dist/ui/assets/slicc-version-Do_Qzxe9.js +1 -0
  82. package/dist/ui/assets/{snapshot-features-ChEbT7az.js → snapshot-features-Bn7BtW7K.js} +1 -1
  83. package/dist/ui/assets/{snapshot-C2775cOf.js → snapshot-jBfySyLF.js} +1 -1
  84. package/dist/ui/assets/{soundscape-dXwPqTJ-.js → soundscape-gtJZ30qF.js} +1 -1
  85. package/dist/ui/assets/{speak-cpgcfooI.js → speak-D6N7JGfl.js} +1 -1
  86. package/dist/ui/assets/{sprinkle-manager-jd6a2IYN.js → sprinkle-manager-Bgirnz_O.js} +1 -1
  87. package/dist/ui/assets/{sprinkle-renderer-Br7gWsny.js → sprinkle-renderer-CpbS9Pze.js} +1 -1
  88. package/dist/ui/assets/{state-C1XZTzHt.js → state-gI8eLPCJ.js} +1 -1
  89. package/dist/ui/assets/{store-CxD6rJNd.js → store-CJoMqbUo.js} +1 -1
  90. package/dist/ui/assets/{store-D0akwt8a.js → store-CoFkhkC_.js} +1 -1
  91. package/dist/ui/assets/{sudo-Ng9MeLFC.js → sudo-CdUi7Bt1.js} +1 -1
  92. package/dist/ui/assets/sudoers-BdBYQPUn.js +3 -0
  93. package/dist/ui/assets/{suggestions-CFQTt8oo.js → suggestions-B34zKgsF.js} +151 -33
  94. package/dist/ui/assets/{sync-dialog-g9D5_IF8.js → sync-dialog-uCJmhtr8.js} +1 -1
  95. package/dist/ui/assets/{transformers-env-ClNwGCkj.js → transformers-env-GrfzOgRv.js} +1 -1
  96. package/dist/ui/assets/{tray-sidecar-B0K5KzF-.js → tray-sidecar-B_1w3n4t.js} +1 -1
  97. package/dist/ui/assets/{upgrade-detection-Cz-hPWu6.js → upgrade-detection-L60JNTNb.js} +1 -1
  98. package/dist/ui/assets/{upskill-lick-skip-Coa1zDvD.js → upskill-lick-skip-Jcllnh6l.js} +1 -1
  99. package/dist/ui/assets/{voice-reply-BTnXYrYT.js → voice-reply-DqNiHN6M.js} +1 -1
  100. package/dist/ui/assets/{wc-attach-CjRJwFv_.js → wc-attach-8_xsR0qy.js} +2 -2
  101. package/dist/ui/assets/{wc-extension-zyJvXHK3.js → wc-extension-oYf2HrE6.js} +2 -2
  102. package/dist/ui/assets/{wc-follower-Dm1EanME.js → wc-follower-BYsj_5x0.js} +3 -3
  103. package/dist/ui/assets/{wc-follower-oauth-CIiFOuDi.js → wc-follower-oauth-CljtR185.js} +1 -1
  104. package/dist/ui/assets/{wc-gelatiere-Cy9jod1J.js → wc-gelatiere-CP4serB8.js} +1 -1
  105. package/dist/ui/assets/{wc-live-JCXonoSm.js → wc-live-CkxSC9Ez.js} +5 -5
  106. package/dist/ui/assets/{wc-nav-CRD8N4xt.js → wc-nav-XvRTYo98.js} +2 -2
  107. package/dist/ui/assets/{wc-onboarding-BXeb4TbL.js → wc-onboarding-iCoaOIma.js} +2 -2
  108. package/dist/ui/assets/{wc-placeholder-BY85O4B6.js → wc-placeholder-em6OiHpb.js} +3 -3
  109. package/dist/ui/assets/{wc-secret-request-yPyZt78A.js → wc-secret-request-BjM8NPKG.js} +1 -1
  110. package/dist/ui/assets/{wc-settings-BHJBZGEl.js → wc-settings-BtBwNeN8.js} +3 -3
  111. package/dist/ui/assets/{wc-shell-CfRSHqBD.js → wc-shell-DC9WMYcH.js} +3 -3
  112. package/dist/ui/assets/{wc-shortcut-config-cEwRH43m.js → wc-shortcut-config-BEsAGNLx.js} +1 -1
  113. package/dist/ui/assets/{wc-shortcuts-C6T4EYNZ.js → wc-shortcuts-CETptwt9.js} +172 -172
  114. package/dist/ui/assets/{wc-sprinkles-6kq8ChrP.js → wc-sprinkles-DLNH0Ist.js} +2 -2
  115. package/dist/ui/assets/{wc-transcript-export-vCgK8B1Y.js → wc-transcript-export-CidB32Dc.js} +2 -2
  116. package/dist/ui/assets/{wc-tray-GsvwH8iN.js → wc-tray-BbFFd7U-.js} +4 -4
  117. package/dist/ui/assets/welcome-detection-DW2ROqam.js +1 -0
  118. package/dist/ui/assets/{whisper-session-C6BRUKHG.js → whisper-session-BvALr1gE.js} +2 -2
  119. package/dist/ui/assets/{xai-grok-DlnOMaxU.js → xai-grok-DWDEwZSo.js} +1 -1
  120. package/dist/ui/assets/{xai-grok-Bpe_qjy3.js → xai-grok-Ht4qQwUs.js} +1 -1
  121. package/dist/ui/index.html +3 -3
  122. package/dist/ui/lucide-icons.js +182 -179
  123. package/dist/ui/packages/webapp/index.html +3 -3
  124. package/package.json +1 -1
  125. package/dist/ui/assets/GELATIERE-CDj3aVTD.js +0 -1
  126. package/dist/ui/assets/SKILL-DvHAkJSI.js +0 -117
  127. package/dist/ui/assets/gelatiere-store-CcLPnD5F.js +0 -1
  128. package/dist/ui/assets/icons-D5_bMrnB.js +0 -1
  129. package/dist/ui/assets/provider-settings-D8F77Xhh.js +0 -1
  130. package/dist/ui/assets/provider-store-access-Bbm8UQlA.js +0 -1
  131. package/dist/ui/assets/provider-store-access-DP_iz1Q0.js +0 -1
  132. package/dist/ui/assets/run-CHF9lHjk.js +0 -46
  133. package/dist/ui/assets/sidecar-repair-dj57y-8O.js +0 -1
  134. package/dist/ui/assets/skills-BtA0WqTn.js +0 -5
  135. package/dist/ui/assets/slicc-version-42Jn19Ww.js +0 -1
  136. package/dist/ui/assets/sudoers-KgJRnN4b.js +0 -3
  137. package/dist/ui/assets/welcome-detection-BAEGrqo6.js +0 -1
@@ -1,8 +1,8 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-kBT87Ea7.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/preload-helper-Czpn1I53.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFGiY.js";import{t}from"./preload-helper-Czpn1I53.js";import{t as n}from"./logger-DDBAeTLF.js";import{n as r}from"./runtime-env-Dlaokqg1.js";import{n as i,t as a}from"./icons-D5_bMrnB.js";function o(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n>=10||r===0?Math.round(n):Math.round(n*10)/10} ${t[r]}`}function s(e){let t=e.mimeType||`application/octet-stream`;return`${e.name} (${t}, ${o(e.size)})`}function c(e,t=`The original file lives on a remote runtime and is not accessible here.`){return e?.length?e.map(e=>{if(!e.path)return{...e};let{path:n,...r}=e;return e.kind===`image`&&e.data||e.kind===`text`&&e.text!==void 0?r:{...r,error:r.error??t}}):[]}var l='---\nintervalHours: 24\nnightly: \'0 3 * * *\'\nmaxSuggestions: 5\n# allowedCommands adds to the built-in set a pass may run without asking you\n# for approval; it never replaces it. Bare command names only:\n# allowedCommands: [tree, xxd]\n---\n\n# Gelatiere pass\n\nYou are the gelatiere, SLICC\'s resident advisor. A lick just asked you for a pass: a nightly `[Cron Event: gelatiere-nightly]`, a `[Sprinkle Event: gelatiere]` because a session ended or someone ran `gelatiere run`, or a direct request. Your job is to look at how this person actually uses SLICC and come back with a handful of concrete, well-grounded suggestions — skills to install, use cases they have not tried, habits that would make their sessions go better — then hand them to the cones.\n\n**Work fast: a pass should take a few minutes, not many.** Mine the signals below, cross them with what is available, write the candidates file, and finish with the two commands at the end. Never install anything, never edit memory files yourself (the nightly\'s `memory dream` delegates that to sandboxed dreamer scoops), never message a cone by any other means than `gelatiere deliver`.\n\n## Nightly only: start the dreaming pass\n\nWhen this pass is the nightly (`[Cron Event: gelatiere-nightly]`), start the memory-dreaming pass first, before anything else, and do not wait for it:\n\n```bash\nmemory dream --all\n```\n\nThat spawns one sandboxed memory-dreamer per cone to consolidate its memory file — merge duplicates, drop superseded facts, land under budget. It runs detached; carry on with your own pass immediately and never read or edit the memory files it is working on beyond the signal-mining below. Skip this step entirely on session-end and on-demand passes.\n\n## What the user has done\n\nRead these in order; each one is cheap. Start with `date -u +%Y-%m-%d` so your evidence carries today\'s date.\n\n1. **Profile** — who they said they are on first run: `cat /home/*/.welcome.json 2>/dev/null` (`purpose`, `role`, `tasks`, `apps`, `company`).\n2. **Durable memory** — what earlier sessions already established (preferences, projects, pitfalls): `cat /workspace/CLAUDE.md`, and `cat /cones/*/CLAUDE.md 2>/dev/null` for the other cones.\n3. **Session index** — titles, dates, cones: `jq -r \'.[] | "\\(.frozenAt[0:10]) \\(.cone // "cone") \\(.title)"\' /sessions/index.json | tail -30`.\n4. **Recent archives** — the newest few sessions: `ls -t /sessions/*.md | grep -v agent- | head -5`.\n5. **Your own notes** — what you concluded last time: `cat /shared/.gelatiere/notes.md 2>/dev/null`.\n\n**Never `cat` an archive.** They reach several megabytes and the `<!-- slicc:session-data ... -->` block is one JSON line holding the whole session. Pull the three signals separately, each on the prose half only:\n\n```bash\n# What the user asked for, in their words.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | awk \'/^## User/{p=1;next} /^## (Assistant|Summary)/{p=0} /^### Tool/{p=0} p\' | head -80\n\n# Which commands and tools the sessions lean on.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -o \'^### Tool: [a-z_]*\' | sort | uniq -c | sort -rn\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -oE \'^\\$? ?[a-z][a-z0-9-]+ \' | sort | uniq -c | sort -rn | head -20\n\n# What broke — the strongest signal for a missing skill.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -B4 \'^Result:.*\\(rror\\|not found\\|failed\\|denied\\|ENOENT\\)\' | cut -c1-160 | head -60\n```\n\n6. **What is already installed** — never suggest a duplicate: `upskill list`.\n7. **What you already suggested** — `/shared/.gelatiere/suggestions.json` holds every earlier suggestion with its `dismissedAt`. Do not repeat an id that is still open, and do not resurrect a dismissed one unless the sessions show a new, strong reason: `jq -r \'.[] | "\\(.id)\\t\\(.kind)\\t\\(.dismissedAt // "open")\\t\\(.title)"\' /shared/.gelatiere/suggestions.json 2>/dev/null`.\n\n## What is available\n\nCross the signals above with what SLICC can offer. Spend one command on each; do not browse further.\n\n```bash\n# The skill catalog: name, description, the tasks / roles / apps each skill fits, and WHERE it\n# lives (repo, path, skill, installAll) — the install command is built from those last four.\ngelatiere catalog | jq -r \'.data[] | "\\(.name)\\t\\(.description)\\ttasks=\\(.tasks) role=\\(.role) apps=\\(.apps)\\trepo=\\(.repo) path=\\(.path) skill=\\(.skill) installAll=\\(.installAll)"\'\n\n# Every shell command SLICC ships, one man page each — the use-case surface.\ngelatiere commands\n\n# The community skills repo, when the catalog looks thin for this user.\nupskill ai-ecoverse/skills\n```\n\nRead a man page only when you are about to recommend that command and need to be sure it does what you think: `gelatiere man <command> | head -60`. You have no `curl` and need none — `gelatiere catalog`, `gelatiere commands` and `gelatiere man` are your whole web surface.\n\n## What to suggest\n\nAt most the `maxSuggestions` from the config block above, best first. Fewer, sharper suggestions beat a full list; an empty list is a fine outcome when nothing is genuinely worth the user\'s attention. Every suggestion must be traceable to something you saw:\n\n| kind | when | required fields |\n| ---------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| `skill` | a catalog or repo skill matches a recurring task, app, or failure in the sessions | `skill`, and `install` — the exact `upskill` command (see below) |\n| `use-case` | a SLICC capability (shell command, scoops, sprinkles, mounts, automation) fits work the user does by hand or not at all | `prompt` — a message the user could send verbatim |\n| `tip` | a habit that would have avoided a failure or a repeated detour in the sessions | `body` explains what to do differently |\n\nThe `install` command is built from the catalog row, never from the bare name — `upskill <name>` alone searches the public registries and does not find catalog skills:\n\n| catalog row | `install` |\n| ------------------------------------------------- | -------------------------------------------- |\n| `repo=o/r skill=x` (path empty) | `upskill o/r --skill x` |\n| `repo=o/r path=skills/ skill=x` | `upskill o/r --path skills/ --skill x` |\n| `repo=o/r path=skills/migration/ installAll=true` | `upskill o/r --path skills/migration/ --all` |\n| a skill from `upskill ai-ecoverse/skills` output | `upskill ai-ecoverse/skills --skill <name>` |\n\nRules:\n\n- `id` is a stable slug (`skill-github`, `use-case-fswatch-deploy`, `tip-mount-once`) so a repeat pass recognises it.\n- Speak to the user as "you" in every field — never about them in the third person ("Lars builds…" is wrong; "You build…" is right).\n- The card shows exactly two things — WHAT to do and WHY — so write the fields that way:\n - `title` is the WHAT: a short imperative, eight words or fewer, sentence case — "Install the GitHub skill", "Script your build–serve–screenshot loop". No benefit clause bolted on ("…to manage repos and pull requests from chat" belongs in the why, if anywhere).\n - `body` is the WHY: one or two sentences, grounded in what you actually saw, that tell the story of the change — what you watched the user do by hand, and what gets better. "You ran the build–serve–screenshot loop 80+ times by hand in your bakery session; a workflow file replays it as one command." It must not restate the title, list features, or repeat `evidence` word for word.\n- `evidence` is one friendly sentence, spoken to the user, saying what you saw that led here — "You told the welcome wizard you\'re a developer who lives in GitHub". It rides the lick for the cones; the card does not render it, so do not lean on it to justify the suggestion — the why lives in `body`. Never a field dump like `role=developer, tasks=[…]`.\n- `url` is optional: the skill page or the man page.\n- Never suggest what `upskill list` already shows installed, and never invent a skill or command that is not in the catalog, the repo listing, or the sitemap.\n\n## Finish\n\nWrite the candidates as JSON — `{ "suggestions": [ { "id", "kind", "title", "body", "skill", "install", "prompt", "url", "evidence" } ] }` — to `$TMPDIR/candidates.json`, then run exactly:\n\n```bash\ngelatiere suggest "$TMPDIR/candidates.json" && gelatiere deliver\n```\n\n`suggest` validates and folds the candidates into the store (known ids are kept, dismissed ones stay dismissed); `deliver` licks every other cone with what is new. Then update `/shared/.gelatiere/notes.md` with two or three lines on what you looked at and what you decided against — that file, not your reply, is your memory across passes. Reply with one short line.\n\n<!-- How to customize\nAdd instructions above, for example: prefer skills from a company repo, or always check a team\nwiki at /mnt/kb before suggesting. The config block sets `intervalHours` (minimum hours between\nsession-end passes; the nightly pass ignores it), `nightly` (a 5-field cron expression, registered\nby `gelatiere init` as the `gelatiere-nightly` crontask), `maxSuggestions` (capped at 10) and\n`allowedCommands`.\n\n`allowedCommands` is the gelatiere\'s half of what `MEMORY.md` gives the memory curator: extra shell\ncommands a pass may run without escalating. It is ADDITIVE — the built-in set (the read-only text\nutilities, `jq`, `rg`, `upskill`, `gelatiere`, `memory`) always stands, and the file only extends\nit; entries are bare command names, so `tree` is valid and `tree -L 2` is not. `gelatiere status`\nprints the list actually in force and flags an edit that has not been applied yet. The unit is\nregistered once and then persists, so an edit here takes effect on the next boot or the next\n`gelatiere init` — and never mid-pass: applying it rebuilds the unit, which would cancel a pass in\nflight, so `gelatiere init` leaves a busy gelatiere alone and asks to be re-run when it is idle.\n\nAdding a command grants it to an UNATTENDED agent that can read `/sessions/` and every cone\'s\nmemory, so weigh a network command (`curl`, `wget`, `ssh`) against that: the pass reads third-party\ncatalog and repo content, and general egress would make one injected line enough to exfiltrate an\narchive. That is why the built-in set has none, and why leaving them out is the right default.\n\nThe gelatiere is a persistent scoop no cone owns (folder `gelatiere`); its own conversation is\ncompacted while it idles. Dismissed suggestions are kept with a dismissedAt stamp so the next pass does not\nrepeat them. `gelatiere run` from any cone\'s shell asks for a pass now.\n-->\n';function u(e,t){let n=e.replace(/^\uFEFF/,``).replace(/\r\n?/g,`
2
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-CuTDBQ6V.js";import{t}from"./preload-helper-Czpn1I53.js";import{t as n}from"./logger-DDBAeTLF.js";import{n as r}from"./runtime-env-Dlaokqg1.js";import{n as i,t as a}from"./icons-Ce7Vz89o.js";function o(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n>=10||r===0?Math.round(n):Math.round(n*10)/10} ${t[r]}`}function s(e){let t=e.mimeType||`application/octet-stream`;return`${e.name} (${t}, ${o(e.size)})`}function c(e,t=`The original file lives on a remote runtime and is not accessible here.`){return e?.length?e.map(e=>{if(!e.path)return{...e};let{path:n,...r}=e;return e.kind===`image`&&e.data||e.kind===`text`&&e.text!==void 0?r:{...r,error:r.error??t}}):[]}var l='---\nintervalHours: 24\nnightly: \'0 3 * * *\'\nmaxSuggestions: 5\n# allowedCommands adds to the built-in set a pass may run without asking you\n# for approval; it never replaces it. Bare command names only:\n# allowedCommands: [tree, xxd]\n---\n\n# Gelatiere pass\n\nYou are the gelatiere, SLICC\'s resident advisor. A lick just asked you for a pass: a nightly `[Cron Event: gelatiere-nightly]`, a `[Sprinkle Event: gelatiere]` because a session ended or someone ran `gelatiere run`, or a direct request. Your job is to look at how this person actually uses SLICC and come back with a handful of concrete, well-grounded suggestions — skills to install, use cases they have not tried, habits that would make their sessions go better, a skill worth writing when none exists, a bug worth reporting when SLICC itself is what got in the way — then hand them to the cones.\n\n**Work fast: a pass should take a few minutes, not many.** Mine the signals below, cross them with what is available, write the candidates file, and finish with the two commands at the end. Never install anything, never edit memory files yourself (the nightly\'s `memory dream` delegates that to sandboxed dreamer scoops), never message a cone by any other means than `gelatiere deliver`.\n\n## Nightly only: start the dreaming pass\n\nWhen this pass is the nightly (`[Cron Event: gelatiere-nightly]`), start the memory-dreaming pass first, before anything else, and do not wait for it:\n\n```bash\nmemory dream --all\n```\n\nThat spawns one sandboxed memory-dreamer per cone to consolidate its memory file — merge duplicates, drop superseded facts, land under budget. It runs detached; carry on with your own pass immediately and never read or edit the memory files it is working on beyond the signal-mining below. Skip this step entirely on session-end and on-demand passes.\n\n## What the user has done\n\nRead these in order; each one is cheap. Start with `date -u +%Y-%m-%d` so your evidence carries today\'s date.\n\n1. **Profile** — who they said they are on first run: `cat /home/*/.welcome.json 2>/dev/null` (`purpose`, `role`, `tasks`, `apps`, `company`).\n2. **Durable memory** — what earlier sessions already established (preferences, projects, pitfalls): `cat /workspace/CLAUDE.md`, and `cat /cones/*/CLAUDE.md 2>/dev/null` for the other cones. A long-lived install\'s memory files run to a thousand lines each; on those, read the shape first (`grep -n \'^## \' FILE`) and `sed -n` only the sections that look relevant.\n3. **Session index** — titles, dates, cones: `jq -r \'.[] | "\\(.frozenAt[0:10]) \\(.cone // "cone") \\(.title)"\' /sessions/index.json | tail -30`.\n4. **Recent archives** — the newest few sessions: `ls -t /sessions/*.md | grep -v agent- | head -5`.\n `/sessions/live-*.md` in that list is a chat still in progress — usually the newest and largest\n signal there is, and the easiest to skip. Check `ls -lt /sessions/live-*.md` too.\n5. **Your own notes** — what you concluded last time: `cat /shared/.gelatiere/notes.md 2>/dev/null`.\n\n**Never `cat` an archive.** They reach several megabytes and the `<!-- slicc:session-data ... -->` block is one JSON line holding the whole session. Pull the three signals separately, each on the prose half only:\n\n```bash\n# What the user asked for, in their words.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | awk \'/^## User/{p=1;next} /^## (Assistant|Summary)/{p=0} /^### Tool/{p=0} p\' | head -80\n\n# Which commands and tools the sessions lean on.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -o \'^### Tool: [a-z_]*\' | sort | uniq -c | sort -rn\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -oE \'^\\$? ?[a-z][a-z0-9-]+ \' | sort | uniq -c | sort -rn | head -20\n\n# What broke — the strongest signal for a missing skill.\nsed \'/^<!-- slicc:session-data$/,/^-->$/d\' ARCHIVE | grep -B4 \'^Result:.*\\(rror\\|not found\\|failed\\|denied\\|ENOENT\\)\' | cut -c1-160 | head -60\n```\n\n6. **What is already installed** — never suggest a duplicate: `upskill list`.\n7. **What you already suggested** — `/shared/.gelatiere/suggestions.json` holds every earlier suggestion with its `dismissedAt`. Do not repeat an id that is still open, and do not resurrect a dismissed one unless the sessions show a new, strong reason: `jq -r \'.[] | "\\(.id)\\t\\(.kind)\\t\\(.dismissedAt // "open")\\t\\(.title)"\' /shared/.gelatiere/suggestions.json 2>/dev/null`.\n\n## What is available\n\nCross the signals above with what SLICC can offer. Spend one command on each; do not browse further.\n\n```bash\n# The skill catalog: name, description, the tasks / roles / apps each skill fits, and WHERE it\n# lives (repo, path, skill, installAll) — the install command is built from those last four.\ngelatiere catalog | jq -r \'.data[] | "\\(.name)\\t\\(.description)\\ttasks=\\(.tasks) role=\\(.role) apps=\\(.apps)\\trepo=\\(.repo) path=\\(.path) skill=\\(.skill) installAll=\\(.installAll)"\'\n\n# Every documented shell command, one man page each. This is what the WEBSITE documents,\n# not everything SLICC ships — never tell the user a command is absent on this alone.\ngelatiere commands\n\n# What SLICC is FOR, in the site\'s own words: title, summary and the skills each use case\n# wants. Where a `use-case` suggestion for untried territory comes from.\ngelatiere use-cases\n\n# The community skills repo, when the catalog looks thin for this user.\nupskill ai-ecoverse/skills\n```\n\nRead a man page only when you are about to recommend that command and need to be sure it does what you think: `gelatiere man <command> | head -60`. You have no `curl` and need none — `gelatiere catalog`, `gelatiere commands`, `gelatiere use-cases` and `gelatiere man` are your whole web surface.\n\n## What to suggest\n\nAt most the `maxSuggestions` from the config block above, best first. Fewer, sharper suggestions beat a full list; an empty list is a fine outcome when nothing is genuinely worth the user\'s attention. Every suggestion must be traceable to something you saw:\n\n| kind | when | required fields |\n| ------------ | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| `skill` | a catalog or repo skill matches a recurring task, app, or failure in the sessions | `skill`, and `install` — the exact `upskill` command (see below) |\n| `use-case` | a SLICC capability (shell command, scoops, sprinkles, mounts, automation) fits work the user does by hand or not at all | `prompt` — a message the user could send verbatim |\n| `tip` | a habit that would have avoided a failure or a repeated detour in the sessions | `body` explains what to do differently |\n| `skill-idea` | the sessions repeat a routine no installable skill covers — write one instead of installing one | `prompt` — what to ask a cone to author |\n| `issue` | SLICC ITSELF is what got in the way: a command that broke, a surface that lied, a capability that is simply missing | `prompt` — what to ask a cone to file |\n\n### `skill-idea` and `issue` — the two that point away from the catalog\n\nThe catalog is small and mostly already installed, so do not expect a `skill` every pass. When the\nsame multi-step routine shows up in two or more sessions — the same command sequence, the same\nprompt retyped, the same checklist rebuilt from memory — and neither `upskill list` nor `gelatiere\ncatalog` covers it, the honest answer is **write one**. Name the routine you watched, not a\ncategory; the `prompt` asks a cone to author it (what it does, when it triggers, the steps you saw)\nand points at `skill-creator` when `upskill list` shows it installed.\n\n> "You rebuilt the same release checklist by hand in three sessions — tag, changelog, TestFlight\n> notes, then the smoke run." `prompt`: "Write a skill for my release checklist: …"\n\n`issue` is for the failures nobody reports: the command that exited 1 and got worked around, the\nflag that silently did nothing, the panel that showed stale state. Only when the friction is\nSLICC\'s own AND reproducible from what you read — a named failure with session evidence, not a\nwish. One per pass at the very most: a pass that files speculative bugs teaches the user to ignore\nthe card. The `prompt` asks a cone to open it against `ai-ecoverse/slicc` with your reproduction.\n\n> "`chmod +x` reports success and leaves the mode unchanged, so `./script.sh` fails with\n> `Permission denied`." `prompt`: "File an issue against ai-ecoverse/slicc: chmod appears to …"\n\nNeither fits when the user simply did something the hard way (that is a `tip`), when the capability\nalready exists and they missed it (`use-case`), or when the evidence is one ambiguous error.\n\n### The `install` command\n\nIt is built from the catalog row, never from the bare name — `upskill <name>` alone searches the public registries and does not find catalog skills:\n\n| catalog row | `install` |\n| ------------------------------------------------- | -------------------------------------------- |\n| `repo=o/r skill=x` (path empty) | `upskill o/r --skill x` |\n| `repo=o/r path=skills/ skill=x` | `upskill o/r --path skills/ --skill x` |\n| `repo=o/r path=skills/migration/ installAll=true` | `upskill o/r --path skills/migration/ --all` |\n| a skill from `upskill ai-ecoverse/skills` output | `upskill ai-ecoverse/skills --skill <name>` |\n\n### Rules for every kind\n\n- `id` is a stable slug (`skill-github`, `use-case-fswatch-deploy`, `tip-mount-once`, `skill-idea-release-checklist`, `issue-chmod-noop`) so a repeat pass recognises it.\n- Speak to the user as "you" in every field — never about them in the third person ("Lars builds…" is wrong; "You build…" is right).\n- The card shows exactly two things — WHAT to do and WHY — so write the fields that way:\n - `title` is the WHAT: a short imperative, eight words or fewer, sentence case — "Install the GitHub skill", "Script your build–serve–screenshot loop", "Write a release-checklist skill", "Report the chmod no-op". No benefit clause bolted on ("…to manage repos and pull requests from chat" belongs in the why, if anywhere).\n - `body` is the WHY: one or two sentences, grounded in what you actually saw, that tell the story of the change — what you watched the user do by hand, and what gets better. "You ran the build–serve–screenshot loop 80+ times by hand in your bakery session; a workflow file replays it as one command." It must not restate the title, list features, or repeat `evidence` word for word.\n- `evidence` is one friendly sentence, spoken to the user, saying what you saw that led here — "You told the welcome wizard you\'re a developer who lives in GitHub". It rides the lick for the cones; the card does not render it, so do not lean on it to justify the suggestion — the why lives in `body`. Never a field dump like `role=developer, tasks=[…]`.\n- `url` is optional: the skill page or the man page.\n- Never suggest what `upskill list` already shows installed, and never invent a skill or command that is not in the catalog, the repo listing, or the sitemap. A `skill-idea` is the one exception — it names a skill that does NOT exist yet, which is the point; check first that no installable one covers it.\n\n## Finish\n\nWrite the candidates as JSON — `{ "suggestions": [ { "id", "kind", "title", "body", "skill", "install", "prompt", "url", "evidence" } ] }` — to `$TMPDIR/candidates.json`, then run exactly:\n\n```bash\ngelatiere suggest "$TMPDIR/candidates.json" && gelatiere deliver\n```\n\n`suggest` validates and folds the candidates into the store (known ids are kept, dismissed ones stay dismissed); `deliver` licks every other cone with what is new. Then update `/shared/.gelatiere/notes.md` with two or three lines on what you looked at and what you decided against — that file, not your reply, is your memory across passes. Reply with one short line.\n\n<!-- How to customize\nAdd instructions above, for example: prefer skills from a company repo, or always check a team\nwiki at /mnt/kb before suggesting. The config block sets `intervalHours` (minimum hours between\nsession-end passes; the nightly pass ignores it), `nightly` (a 5-field cron expression, registered\nby `gelatiere init` as the `gelatiere-nightly` crontask), `maxSuggestions` (capped at 10) and\n`allowedCommands`.\n\n`allowedCommands` is the gelatiere\'s half of what `MEMORY.md` gives the memory curator: extra shell\ncommands a pass may run without escalating. It is ADDITIVE — the built-in set (the read-only text\nutilities, `jq`, `rg`, `upskill`, `gelatiere`, `memory`) always stands, and the file only extends\nit; entries are bare command names, so `tree` is valid and `tree -L 2` is not. `gelatiere status`\nprints the list actually in force and flags an edit that has not been applied yet. The unit is\nregistered once and then persists, so an edit here takes effect on the next boot or the next\n`gelatiere init` — and never mid-pass: applying it rebuilds the unit, which would cancel a pass in\nflight, so `gelatiere init` leaves a busy gelatiere alone and asks to be re-run when it is idle.\n\nAdding a command grants it to an UNATTENDED agent that can read `/sessions/` and every cone\'s\nmemory, so weigh a network command (`curl`, `wget`, `ssh`) against that: the pass reads third-party\ncatalog and repo content, and general egress would make one injected line enough to exfiltrate an\narchive. That is why the built-in set has none, and why leaving them out is the right default.\n\nThe gelatiere is a persistent scoop no cone owns (folder `gelatiere`); its own conversation is\ncompacted while it idles. Dismissed suggestions are kept with a dismissedAt stamp so the next pass does not\nrepeat them. `gelatiere run` from any cone\'s shell asks for a pass now.\n-->\n';function u(e,t){let n=e.replace(/^\uFEFF/,``).replace(/\r\n?/g,`
3
3
  `).match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);if(!n?.[2].trim())throw Error(`${t} requires frontmatter and a prompt`);return{frontmatter:n[1],body:n[2].trim()}}function d(e,t){let n={},r=e.split(`
4
- `);for(let e=0;e<r.length;e+=1){let i=r[e];if(!i.trim()||i.trimStart().startsWith(`#`))continue;let a=i.match(/^([A-Za-z][A-Za-z0-9]*):\s*(.*)$/);if(!a)throw Error(`Invalid frontmatter line: ${i}`);let[,o,s]=a;if(t.arrayKeys.has(o)){let t=f(r,e,s);n[o]=t.value,e=t.lastIndex}else if(t.scalarKeys.has(o)&&s.trim())n[o]=h(s);else throw Error(`Unsupported or empty frontmatter field: ${o}`)}return n}function f(e,t,n){if(n.trim()){let e=n.trim();if(!e.startsWith(`[`)||!e.endsWith(`]`))throw Error(`Expected an array`);let r=e.slice(1,-1).trim();return{value:r?p(r):[],lastIndex:t}}let r=[],i=t;for(let n=t+1;n<e.length;n+=1){let t=e[n].match(/^\s+-\s+(.+)$/);if(!t)break;r.push(h(m(t[1]))),i=n}return{value:r,lastIndex:i}}function p(e){let t=[],n=0,r;for(let i=0;i<e.length;i+=1){let a=e[i];a===`"`||a===`'`?r=r===a?void 0:r??a:a===`,`&&!r&&(t.push(h(e.slice(n,i))),n=i+1)}if(r)throw Error(`Unclosed quoted value`);return t.push(h(e.slice(n))),t}function m(e){let t;for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`"`||r===`'`)t=t===r?void 0:t??r;else if(r===`#`&&!t&&(n===0||/\s/.test(e[n-1])))return e.slice(0,n).trimEnd()}return e}function h(e){let t=e.trim();if(!t)throw Error(`Empty frontmatter value`);let n=t[0];if((n===`"`||n===`'`)&&t.at(-1)===n)return t.slice(1,-1);if(n===`"`||n===`'`)throw Error(`Unclosed quoted value`);return t}function g(e,t,n){let r=e[t];if(r===void 0)return[...n];if(!Array.isArray(r)||r.some(e=>!e))throw Error(`${t} is invalid`);return[...r]}function _(e,t){if(e!==void 0){if(typeof e!=`string`||!e)throw Error(`${t} is invalid`);return e}}function v(e,t,n){if(e===void 0)return t;if(typeof e!=`string`)throw Error(`timeoutSeconds is invalid`);let r=Number(e);if(!Number.isFinite(r)||r<=0)throw Error(`timeoutSeconds must be positive`);return Math.min(r,n)}function y(e,t){if(e.some(e=>!e.startsWith(`/`)||e.includes(`\0`)||t===`writablePaths`&&e===`/`))throw Error(`${t} must contain absolute VFS paths`)}var b=`gelatiere`,x=`gelatiere`,S=`gelatiere-nightly`,C=`system:gelatiere`;function ee(e){return e.parentJid===`system:gelatiere`&&e.folder===`gelatiere`}var te=e({DEFAULT_GELATIERE_INTERVAL_HOURS:()=>24,DEFAULT_GELATIERE_MD:()=>l,DEFAULT_GELATIERE_NIGHTLY_CRON:()=>oe,DEFAULT_MAX_SUGGESTIONS:()=>5,GELATIERE_BASE_ALLOWED_COMMANDS:()=>se,GELATIERE_DIR:()=>T,GELATIERE_FOLDER:()=>b,GELATIERE_INSTRUCTIONS_PATH:()=>w,GELATIERE_NIGHTLY_CRON_NAME:()=>S,GELATIERE_OWNER_JID:()=>C,GELATIERE_SKILL_PATH:()=>E,GELATIERE_SPRINKLE_NAME:()=>x,GELATIERE_STATE_PATH:()=>ie,GELATIERE_SUGGESTIONS_ACTION:()=>ae,GELATIERE_SUGGESTIONS_PATH:()=>re,LICK_SUGGESTION_LIMIT:()=>5,MAX_STORED_SUGGESTIONS:()=>40,MAX_SUGGESTIONS_PER_PASS:()=>10,buildGelatiereLickBody:()=>Le,coerceSuggestions:()=>Ne,describeGelatiereLick:()=>ze,dismissGelatiereSuggestion:()=>we,isGelatiereUnit:()=>ee,isPassDue:()=>ye,loadGelatiereConfig:()=>pe,mergeSuggestions:()=>Pe,openSuggestions:()=>xe,parseGelatiereDocument:()=>ue,readGelatiereState:()=>O,readGelatiereSuggestions:()=>ge,recordGelatiereTrigger:()=>be,recordPass:()=>Ie,suggestionsSince:()=>Ce,takeGelatiereSuggestion:()=>Te,takenSuggestions:()=>Se,writeGelatiereState:()=>ve,writeGelatiereSuggestions:()=>_e}),ne=n(`gelatiere-store`),w=`/shared/GELATIERE.md`,T=`/shared/.gelatiere`,re=`${T}/suggestions.json`,ie=`${T}/state.json`,ae=`gelatiere-suggestions`,E=`/workspace/skills/gelatiere/SKILL.md`,oe=`0 3 * * *`,D={arrayKeys:new Set([`allowedCommands`]),scalarKeys:new Set([`intervalHours`,`nightly`,`maxSuggestions`])},se=`awk.basename.cat.column.cut.date.dirname.echo.expr.false.file.find.fold.gelatiere.grep.head.jq.ls.man.memory.mkdir.nl.paste.printf.realpath.rg.sed.seq.sort.stat.tail.tee.test.touch.tr.true.uniq.upskill.wc`.split(`.`),ce=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,le=new Set([`skill`,`use-case`,`tip`]);function ue(e){let t=u(e,`GELATIERE.md`),n=d(t.frontmatter,D),r=_(n.nightly,`nightly`)??`0 3 * * *`;if(r.trim().split(/\s+/).length!==5)throw Error(`nightly must be a 5-field cron expression`);return{allowedCommands:de(n),intervalHours:fe(n.intervalHours,`intervalHours`,24),nightly:r.trim(),maxSuggestions:Math.min(10,fe(n.maxSuggestions,`maxSuggestions`,5)),instructions:t.body}}function de(e){let t=g(e,`allowedCommands`,[]),n=t.find(e=>!ce.test(e));if(n!==void 0)throw Error(`allowedCommands must contain bare command names, not "${n}"`);return[...new Set([...se,...t])]}function fe(e,t,n){if(e===void 0)return n;if(typeof e!=`string`)throw Error(`${t} is invalid`);let r=Number(e);if(!Number.isFinite(r)||r<=0)throw Error(`${t} must be positive`);return r}async function pe(e){try{return ue(await me(e,w))}catch(e){return ne.warn(`Could not load valid GELATIERE.md; using built-in default`,{error:Re(e)}),ue(l)}}async function me(e,t){let n=await e.readFile(t,{encoding:`utf-8`});return typeof n==`string`?n:new TextDecoder().decode(n)}async function he(e,t){try{return JSON.parse(await me(e,t))}catch{return}}async function ge(e){let t=await he(e,re);if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=Me(e,null);if(!t)continue;let{dismissedAt:r,takenAt:i}=e;typeof r==`string`&&r&&(t.dismissedAt=r),typeof i==`string`&&i&&(t.takenAt=i),n.push(t)}return n}async function _e(e,t){await e.mkdir(T,{recursive:!0}),await e.writeFile(re,`${JSON.stringify(t,null,2)}\n`)}async function O(e){let t=await he(e,ie);if(!t||typeof t!=`object`)return{passes:0};let n=t;return{passes:typeof n.passes==`number`&&n.passes>=0?n.passes:0,...typeof n.lastPassAt==`string`?{lastPassAt:n.lastPassAt}:{},...typeof n.lastTriggeredAt==`string`?{lastTriggeredAt:n.lastTriggeredAt}:{},...typeof n.lastDeliveredAt==`string`?{lastDeliveredAt:n.lastDeliveredAt}:{}}}async function ve(e,t){await e.mkdir(T,{recursive:!0}),await e.writeFile(ie,`${JSON.stringify(t,null,2)}\n`)}function ye(e,t,n){let r=Math.max(...[e.lastPassAt,e.lastTriggeredAt].map(e=>e?Date.parse(e):NaN).filter(e=>!Number.isNaN(e)));return!Number.isFinite(r)||t.getTime()-r>=n*36e5}async function be(e,t=new Date){await ve(e,{...await O(e),lastTriggeredAt:t.toISOString()})}function xe(e){return e.filter(e=>!e.dismissedAt&&!e.takenAt)}function Se(e){return e.filter(e=>!!e.takenAt)}function Ce(e,t){let n=xe(e);if(!t)return n;let r=Date.parse(t);return Number.isNaN(r)?n:n.filter(e=>{let t=Date.parse(e.createdAt);return Number.isNaN(t)||t>r})}async function we(e,t,n=new Date){return De(e,t,`dismissedAt`,n)}async function Te(e,t,n=new Date){return De(e,t,`takenAt`,n)}var Ee=Promise.resolve();function De(e,t,n,r){let i=async()=>{let i=await ge(e),a=i.find(e=>e.id===t&&!e.dismissedAt&&!e.takenAt);return a?(a[n]=r.toISOString(),await _e(e,i),!0):!1},a=Ee.then(i,i);return Ee=a.catch(()=>!1),a}var Oe=/[^a-z0-9]+/g;function ke(e){return e.toLowerCase().replace(Oe,`-`).replace(/^-+|-+$/g,``).slice(0,60)}function k(e,t){if(typeof e!=`string`)return;let n=e.trim();return n?n.slice(0,t):void 0}function Ae(e){if(e)try{let t=new URL(e).protocol;return t===`http:`||t===`https:`?e:void 0}catch{return}}var je=/^[A-Za-z0-9@._/:=-]+$/;function A(e){if(!e)return;let t=e.split(/\s+/);if(!(t[0]!==`upskill`||t.length<2))return t.slice(1).every(e=>je.test(e))?e:void 0}function Me(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=typeof n.kind==`string`?n.kind:``,i=k(n.title,200),a=k(n.body,1e3);if(!le.has(r)||!i||!a)return null;let o=ke(k(n.id,80)??`${r}-${i}`)||ke(`${r}-${i}`);if(!o)return null;let s=t??k(n.createdAt,40)??``,c=n.skill===void 0?void 0:k(n.skill,120),l=n.install===void 0?void 0:A(k(n.install,300)),u=n.prompt===void 0?void 0:k(n.prompt,1e3);return r===`skill`&&(!c||!l)||r===`use-case`&&!u?null:{id:o,kind:r,title:i,body:a,...n.skill===void 0?{}:{skill:c},...n.install===void 0?{}:{install:l},...n.prompt===void 0?{}:{prompt:u},...n.url===void 0?{}:{url:Ae(k(n.url,500))},...n.evidence===void 0?{}:{evidence:k(n.evidence,500)},createdAt:s}}function Ne(e,t,n=10){let r=Array.isArray(e)?e:e&&typeof e==`object`&&Array.isArray(e.suggestions)?e.suggestions??[]:[],i=new Set,a=[];for(let e of r){let r=Me(e,t);if(!(!r||i.has(r.id))&&(i.add(r.id),a.push(r),a.length>=n))break}return a}function Pe(e,t,n=40){let r=new Set(e.map(e=>e.id)),i=t.filter(e=>!r.has(e.id)),a=[...i,...e];for(;a.length>n;){let e=Fe(a,e=>!!e.dismissedAt),t=e>=0?e:Fe(a,e=>!!e.takenAt);a.splice(t>=0?t:a.length-1,1)}return{merged:a,added:i}}function Fe(e,t){for(let n=e.length-1;n>=0;--n)if(t(e[n]))return n;return-1}async function Ie(e,t,n=new Date){let r=await pe(e),i=Ne(t,n.toISOString(),r.maxSuggestions),{merged:a,added:o}=Pe(await ge(e),i);await _e(e,a);let s=await O(e);return await ve(e,{...s,passes:s.passes+1,lastPassAt:n.toISOString()}),{added:o,open:xe(a)}}function Le(e,t){return{action:ae,data:{added:e.length,open:t.length,suggestions:t.slice(0,5),path:re,skill:E}}}function Re(e){return e instanceof Error?e.message:String(e)}function ze(e){let t=Be(e);if(!t)return null;let{action:n,bag:r}=t;return n===`gelatiere-suggestions`?Ve(n,r):n===`session-settled`?Ue(n,r):n===`run`?We(n,r):{action:n,headline:`gelatiere: ${n}`,titles:[]}}function Be(e){let t=e.indexOf(`{`),n=e.lastIndexOf(`}`);if(t<0||n<=t)return null;let r;try{r=JSON.parse(e.slice(t,n+1))}catch{return null}if(!r||typeof r!=`object`)return null;let{action:i,data:a}=r;return typeof i==`string`?{action:i,bag:a&&typeof a==`object`?a:{}}:null}function Ve(e,t){let n=He(t.suggestions),r=typeof t.added==`number`?t.added:n.length,i=typeof t.open==`number`?t.open:n.length;return{action:e,headline:r===0?`Nothing new — ${i} open ${i===1?`suggestion`:`suggestions`} in the suggestions card.`:`${r} new ${r===1?`suggestion`:`suggestions`} (${i} open) — the cards are in the suggestions sprinkle.`,titles:n}}function He(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?e.title:void 0).filter(e=>typeof e==`string`&&e.length>0):[]}function Ue(e,t){let n=typeof t.cone==`string`?t.cone:void 0;return{action:e,headline:n?`A session ended in ${n} — time for a pass.`:`A session ended — time for a pass.`,titles:[]}}function We(e,t){let n=typeof t.requestedBy==`string`?t.requestedBy:void 0;return{action:e,headline:n?`${n} asked for a pass now.`:`Someone asked for a pass now.`,titles:[]}}function Ge(e,t){let n=r(),i=`/preview${e}${t?`?projectRoot=${encodeURIComponent(t)}`:``}`;if(n){let e=globalThis.chrome?.runtime?.getURL;if(e)return e(i)}let a=`http://localhost:5710`;return typeof window<`u`&&window.location?.origin?a=window.location.origin:typeof self<`u`&&self.location?.origin&&(a=self.location.origin),`${a}${i}`}var Ke={camera:`Camera`,microphone:`Microphone`};function qe(e,t,n){return(e??``).trim()||`${Ke[n]} ${t+1}`}function Je(e,t){return e.map((e,n)=>({deviceId:e.deviceId,label:qe(e.label,n,t)}))}function Ye(e){return e.length>=2}function Xe(e){if(e.length===0)return null;let t=e.find(e=>e.deviceId==="default");if(t)return t.deviceId;let n=e.find(e=>(e.label??``).trim().toLowerCase().startsWith(`default`));return n?n.deviceId:e[0].deviceId}function Ze(){if(typeof window>`u`)return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var Qe=3e3,$e={engine:`builtin`,state:`idle`};function et(){return{async permission(){try{return(await navigator.permissions.query({name:`microphone`})).state}catch{return`prompt`}},async requestPermission(){if(!navigator.mediaDevices?.getUserMedia)return!1;try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop();return!0}catch{return!1}},async microphones(){if(!navigator.mediaDevices?.enumerateDevices)return[];try{return Je((await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`),`microphone`)}catch{return[]}},async start(e){let t=Ze();if(!t)throw Error(`Speech recognition is not supported in this browser.`);let n=new t;n.continuous=!0,n.interimResults=!0,e.lang&&(n.lang=e.lang);let r=``,i=``,a=!1,o=[],s=()=>{a=!0;let e=o;o=[];for(let t of e)t()};n.onresult=t=>{i=``;for(let e=t.resultIndex;e<t.results.length;e++){let n=t.results[e];n.isFinal?r+=n[0].transcript:i+=n[0].transcript}let n=`${r}${i}`.trim();n&&e.onPartial?.(n)},n.onerror=t=>{t.error!==`no-speech`&&t.error!==`aborted`&&e.onError?.(`Speech recognition error: ${t.error}`)},n.onend=s,n.start();let c=()=>`${r}${i}`.trim();return{stop(){return a?Promise.resolve(c()):new Promise(e=>{let t=setTimeout(()=>e(c()),Qe);o.push(()=>{clearTimeout(t),e(c())});try{n.stop()}catch{clearTimeout(t),e(c())}})},cancel(){n.onresult=null,n.onerror=null,n.onend=null;try{(n.abort??n.stop).call(n)}catch{}s()}}},status(){return $e},onStatus(e){return e($e),()=>{}},warmup(){}}}var tt=e({applyDictationMarkers:()=>ct,consumeDictationFirst:()=>ft,parseReplyLang:()=>ut,resetDictationPriming:()=>pt,stripDictationMarkers:()=>lt,stripReplyLangMarker:()=>dt}),nt=`◁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▷`,rt=/\uD83C\uDF99\uFE0F?/g,it=/\u25C1[\s\S]*?\u25B7/g,at=/<!--\s*lang:\s*([A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*)\s*-->/i,ot=/<!--\s*lang:\s*[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*\s*-->/gi,st=!0;function ct(e,t){let n=e.endsWith(` `)?e:`${e} `;return t?`${n}\uD83C\uDF99\uFE0F${nt}`:`${n}\uD83C\uDF99\uFE0F`}function lt(e){return e.replace(it,``).replace(rt,``).replace(/[ \t]+$/g,``).trimEnd()}function ut(e){return at.exec(e)?.[1]}function dt(e){return e.replace(ot,``)}function ft(){return st?(st=!1,!0):!1}function pt(){st=!0}var j={sent:{freq:660,freqSlideTo:990,duration:.12,peakGain:.06,type:`sine`},"tool-start":{freq:520,freq2:780,duration:.07,peakGain:.04,type:`triangle`},"tool-finish":{freq:880,freq2:1320,duration:.07,peakGain:.04,type:`sine`}};function M(e,t){let n=j[t],r=e.currentTime,i=r+n.duration,a=e.createGain();a.gain.setValueAtTime(1e-4,r),a.gain.exponentialRampToValueAtTime(n.peakGain,r+n.duration*.2),a.gain.exponentialRampToValueAtTime(1e-4,i),a.connect(e.destination);let o=e.createOscillator();if(o.type=n.type,o.frequency.setValueAtTime(n.freq,r),n.freqSlideTo!==void 0&&o.frequency.linearRampToValueAtTime(n.freqSlideTo,i),o.connect(a),o.start(r),o.stop(i),n.freq2!==void 0){let t=e.createOscillator();t.type=n.type,t.frequency.setValueAtTime(n.freq2,r),t.connect(a),t.start(r),t.stop(i)}}function mt(e){let t=/^\[@[^\]\s]+ (completed|idle)\]/.exec(e);return t?t[1]===`idle`?`scoop-idle`:`scoop-notify`:/^\[@[^\]\s]+ sudo-request\]/.test(e)?`sudo-request`:/^\[scoop_wait [^\]]+\]/.test(e)?`scoop-wait`:e.startsWith(`[Session Reload]`)?`session-reload`:null}var ht=e({applyTimestampVisibility:()=>N,formatMessageTimestamp:()=>P,getShowTimestamps:()=>xt,initTimestampPreference:()=>Ct,setShowTimestamps:()=>St}),gt=`slicc_show_timestamps`,_t=`slicc-show-timestamps`,vt=`slicc-timestamp-visibility`,yt=!1;function bt(e){if(e.getElementById(vt))return;let t=e.createElement(`style`);t.id=vt,t.textContent=[`slicc-user-message::part(timestamp),`,`slicc-agent-message .msg-ts {`,` display: none;`,`}`,`.${_t} slicc-user-message::part(timestamp),`,`.${_t} slicc-agent-message .msg-ts {`,` display: block;`,`}`].join(`
5
- `),e.head.appendChild(t)}function xt(){if(typeof localStorage>`u`||typeof localStorage?.getItem!=`function`)return!0;let e=localStorage.getItem(gt);return e===null||e===`true`}function St(e){typeof localStorage<`u`&&typeof localStorage?.setItem==`function`&&localStorage.setItem(gt,String(e)),N()}function N(e){if(typeof document>`u`)return;bt(document);let t=e===void 0?xt():e;document.documentElement.classList.toggle(_t,t),yt=!0}function Ct(){yt||N()}function P(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):null}var wt=[`top`,`right`,`bottom`,`left`,`center`];function Tt(e){return e!=null&&wt.includes(e)}function Et(e){let t=e?.panelMeta;return t&&typeof t.id==`string`?t:void 0}var Dt=new Map,Ot=new EventTarget;function kt(e,t){Ot.dispatchEvent(new CustomEvent(`panel-registry-change`,{detail:{id:e,change:t}}))}function At(e){let{id:t}=e.meta,n=Dt.has(t);return Dt.set(t,e),kt(t,`registered`),!n}function jt(e){return Dt.delete(e)?(kt(e,`unregistered`),!0):!1}function Mt(){return[...Dt.values()]}function Nt(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}var Pt=`.dock-tree__parking, .slicc-layout__parking`;function Ft(e,t){let n=e.querySelector(`[surface-id="${Nt(t)}"]`);return!n||n.closest(Pt)?!1:(n.requestFullscreen?.()?.catch(()=>{}),!0)}var It=e({DEFAULT_ZONE_AXIS:()=>zt,LAYOUT_SCHEMA_VERSION:()=>1,ZONE_NAMES:()=>Rt,cloneLayout:()=>F,emptyLayout:()=>Vt,isPanelLocked:()=>Zt,isSplitNode:()=>Ht,layoutPanelIds:()=>Wt,moveToZone:()=>Kt,parseLayoutDocument:()=>en,removeFromZones:()=>qt,resolveLayout:()=>Xt,sizeToFlex:()=>$t,variantMatches:()=>Ut,walkCenter:()=>Yt,zoneAxis:()=>Bt,zoneOfPanel:()=>Gt,zonesFromCenter:()=>Jt}),Lt=1,Rt=[`top`,`left`,`center`,`right`,`bottom`],zt={top:`row`,bottom:`row`,left:`col`,right:`col`,center:`col`};function Bt(e,t){return e.axes?.[t]??zt[t]}function Vt(e=`empty`){return{version:1,id:e,base:{}}}function F(e){return JSON.parse(JSON.stringify(e))}function Ht(e){return`split`in e}function Ut(e,t){return!(e.minWidth!=null&&t.width<e.minWidth||e.maxWidth!=null&&t.width>e.maxWidth||e.minHeight!=null&&t.height<e.minHeight||e.maxHeight!=null&&t.height>e.maxHeight||e.orientation!=null&&(t.width>=t.height?`landscape`:`portrait`)!==e.orientation||e.platform!=null&&t.platform!=null&&e.platform!==t.platform)}function Wt(e){let t=[],n=new Set,r=e=>{n.has(e)||(n.add(e),t.push(e))};for(let t of e.docks)for(let e of t.panels)r(e);if(e.zones)for(let t of Rt)for(let n of e.zones[t]??[])r(n);else e.center&&Yt(e.center,e=>r(e.panel));for(let t of e.floating)r(t.panel);return t}function Gt(e,t){for(let n of Rt)if((e[n]??[]).includes(t))return n;return null}function Kt(e,t,n){if(Gt(e,t)===n)return e;let r=F(e);for(let e of Rt){let n=r[e];n&&(r[e]=n.filter(e=>e!==t))}return r[n]=[...r[n]??[],t],r}function qt(e,t){let n=F(e);for(let e of Rt){let r=n[e];r&&(n[e]=r.filter(e=>e!==t))}return n}function Jt(e){let t=[];return e&&Yt(e,e=>t.push(e.panel)),{center:t}}function Yt(e,t){if(!Ht(e)){t(e);return}for(let n of e.children)Yt(n,t)}function Xt(e,t){let n={id:e.id,locked:e.locked===!0,docks:F(e.base.docks??[]),zones:F(e.base.zones??null),center:F(e.base.center??null),floating:F(e.base.floating??[]),panels:F(e.panels??{}),appliedVariants:[]};return(e.variants??[]).forEach((e,r)=>{if(Ut(e.when,t)){n.appliedVariants.push(r),e.docks!==void 0&&(n.docks=F(e.docks)),e.zones!==void 0&&(n.zones=F(e.zones)),e.center!==void 0&&(n.center=F(e.center)),e.floating!==void 0&&(n.floating=F(e.floating));for(let[t,r]of Object.entries(e.panels??{}))n.panels[t]={...n.panels[t],...r}}}),n}function Zt(e,t){if(e.locked||e.panels[t]?.locked===!0)return!0;for(let n of e.docks)if(n.panels.includes(t))return n.locked===!0;for(let n of e.floating)if(n.panel===t)return n.locked===!0;if(e.zones){let n=Gt(e.zones,t);return n?(e.zones.locked??[]).includes(n):!1}return e.center?Qt(e.center,t,!1):!1}function Qt(e,t,n){let r=n||e.locked===!0;return Ht(e)?e.children.some(e=>Qt(e,t,r)):e.panel===t&&r}function $t(e){if(e==null)return`1 1 auto`;if(typeof e==`number`)return`${e} 1 0`;let t=e.trim(),n=/^([\d.]+)fr$/.exec(t);return n?`${n[1]} 1 0`:/^[\d.]+$/.test(t)?`${t} 1 0`:`0 0 ${t}`}function en(e){if(!e||typeof e!=`object`)return{error:`layout must be an object`};let t=e;if(typeof t.id!=`string`||t.id.trim()===``)return{error:`layout.id must be a non-empty string`};if(typeof t.version!=`number`)return{error:`layout.version must be a number`};if(t.version>1)return{error:`layout.version ${t.version} is newer than supported (1)`};if(!t.base||typeof t.base!=`object`)return{error:`layout.base must be an object`};for(let e of t.base.docks??[]){if(!tn(e?.edge))return{error:`invalid dock edge: ${String(e?.edge)}`};if(!Array.isArray(e.panels))return{error:`dock.${e.edge}.panels must be an array`}}if(t.base.center!=null){let e=nn(t.base.center);if(e)return{error:e}}return t}function tn(e){return e===`top`||e===`right`||e===`bottom`||e===`left`}function nn(e){if(!e||typeof e!=`object`)return`center node must be an object`;let t=e;if(typeof t.panel==`string`)return null;if(t.split!==`row`&&t.split!==`col`)return'center node needs a `panel` string or a `split` of "row"/"col"';if(!Array.isArray(t.children)||t.children.length===0)return"a split node needs a non-empty `children` array";for(let e of t.children){let t=nn(e);if(t)return t}return null}var rn=[`top-left`,`top-right`,`bottom-left`,`bottom-right`,`top`,`right`,`bottom`,`left`],an=`top-right`,on=`slicc-launcher-corner`,sn=[`disconnected`,`connected`,`error`],cn=`disconnected`,ln=`follower-status`,un=new Set(rn),dn=new Set(sn);function fn(e,t=an){return e&&un.has(e)?e:t}function pn(e,t=cn){return e&&dn.has(e)?e:t}function mn(e){return e>=6}function hn({clientX:e,clientY:t,viewportWidth:n,viewportHeight:r,velocityXPxPerMs:i=0,velocityYPxPerMs:a=0,flickProjectionMs:o=180}){let s=gn(e+i*o,0,n),c=gn(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 gn(e,t,n){return Math.min(Math.max(e,t),n)}var _n=`<?xml version="1.0" encoding="UTF-8"?>
4
+ `);for(let e=0;e<r.length;e+=1){let i=r[e];if(!i.trim()||i.trimStart().startsWith(`#`))continue;let a=i.match(/^([A-Za-z][A-Za-z0-9]*):\s*(.*)$/);if(!a)throw Error(`Invalid frontmatter line: ${i}`);let[,o,s]=a;if(t.arrayKeys.has(o)){let t=f(r,e,s);n[o]=t.value,e=t.lastIndex}else if(t.scalarKeys.has(o)&&s.trim())n[o]=h(s);else throw Error(`Unsupported or empty frontmatter field: ${o}`)}return n}function f(e,t,n){if(n.trim()){let e=n.trim();if(!e.startsWith(`[`)||!e.endsWith(`]`))throw Error(`Expected an array`);let r=e.slice(1,-1).trim();return{value:r?p(r):[],lastIndex:t}}let r=[],i=t;for(let n=t+1;n<e.length;n+=1){let t=e[n].match(/^\s+-\s+(.+)$/);if(!t)break;r.push(h(m(t[1]))),i=n}return{value:r,lastIndex:i}}function p(e){let t=[],n=0,r;for(let i=0;i<e.length;i+=1){let a=e[i];a===`"`||a===`'`?r=r===a?void 0:r??a:a===`,`&&!r&&(t.push(h(e.slice(n,i))),n=i+1)}if(r)throw Error(`Unclosed quoted value`);return t.push(h(e.slice(n))),t}function m(e){let t;for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`"`||r===`'`)t=t===r?void 0:t??r;else if(r===`#`&&!t&&(n===0||/\s/.test(e[n-1])))return e.slice(0,n).trimEnd()}return e}function h(e){let t=e.trim();if(!t)throw Error(`Empty frontmatter value`);let n=t[0];if((n===`"`||n===`'`)&&t.at(-1)===n)return t.slice(1,-1);if(n===`"`||n===`'`)throw Error(`Unclosed quoted value`);return t}function g(e,t,n){let r=e[t];if(r===void 0)return[...n];if(!Array.isArray(r)||r.some(e=>!e))throw Error(`${t} is invalid`);return[...r]}function _(e,t){if(e!==void 0){if(typeof e!=`string`||!e)throw Error(`${t} is invalid`);return e}}function v(e,t,n){if(e===void 0)return t;if(typeof e!=`string`)throw Error(`timeoutSeconds is invalid`);let r=Number(e);if(!Number.isFinite(r)||r<=0)throw Error(`timeoutSeconds must be positive`);return Math.min(r,n)}function y(e,t){if(e.some(e=>!e.startsWith(`/`)||e.includes(`\0`)||t===`writablePaths`&&e===`/`))throw Error(`${t} must contain absolute VFS paths`)}var b=`gelatiere`,x=`gelatiere`,S=`gelatiere-nightly`,C=`system:gelatiere`;function ee(e){return e.parentJid===`system:gelatiere`&&e.folder===`gelatiere`}var te=e({DEFAULT_GELATIERE_INTERVAL_HOURS:()=>24,DEFAULT_GELATIERE_MD:()=>l,DEFAULT_GELATIERE_NIGHTLY_CRON:()=>ae,DEFAULT_MAX_SUGGESTIONS:()=>5,GELATIERE_BASE_ALLOWED_COMMANDS:()=>oe,GELATIERE_DIR:()=>T,GELATIERE_FOLDER:()=>b,GELATIERE_INSTRUCTIONS_PATH:()=>w,GELATIERE_NIGHTLY_CRON_NAME:()=>S,GELATIERE_OWNER_JID:()=>C,GELATIERE_SKILL_PATH:()=>D,GELATIERE_SPRINKLE_NAME:()=>x,GELATIERE_STATE_PATH:()=>E,GELATIERE_SUGGESTIONS_ACTION:()=>ie,GELATIERE_SUGGESTIONS_PATH:()=>re,LICK_SUGGESTION_LIMIT:()=>5,MAX_STORED_SUGGESTIONS:()=>40,MAX_SUGGESTIONS_PER_PASS:()=>10,buildGelatiereLickBody:()=>ze,coerceSuggestions:()=>Fe,describeGelatiereLick:()=>Ve,dismissGelatiereSuggestion:()=>Te,isGelatiereUnit:()=>ee,isPassDue:()=>be,loadGelatiereConfig:()=>pe,mergeSuggestions:()=>Ie,openSuggestions:()=>Se,parseGelatiereDocument:()=>ue,readGelatiereState:()=>ve,readGelatiereSuggestions:()=>ge,recordGelatiereTrigger:()=>xe,recordPass:()=>Re,suggestionsSince:()=>we,takeGelatiereSuggestion:()=>Ee,takenSuggestions:()=>Ce,writeGelatiereState:()=>ye,writeGelatiereSuggestions:()=>_e}),ne=n(`gelatiere-store`),w=`/shared/GELATIERE.md`,T=`/shared/.gelatiere`,re=`${T}/suggestions.json`,E=`${T}/state.json`,ie=`gelatiere-suggestions`,D=`/workspace/skills/gelatiere/SKILL.md`,ae=`0 3 * * *`,O={arrayKeys:new Set([`allowedCommands`]),scalarKeys:new Set([`intervalHours`,`nightly`,`maxSuggestions`])},oe=`awk.basename.cat.column.cut.date.dirname.echo.expr.false.file.find.fold.gelatiere.grep.head.jq.ls.man.memory.mkdir.nl.paste.printf.realpath.rg.sed.seq.sort.stat.tail.tee.test.touch.tr.true.uniq.upskill.wc`.split(`.`),se=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,ce=new Set([`skill`,`use-case`,`tip`,`skill-idea`,`issue`]),le=new Set([`use-case`,`skill-idea`,`issue`]);function ue(e){let t=u(e,`GELATIERE.md`),n=d(t.frontmatter,O),r=_(n.nightly,`nightly`)??`0 3 * * *`;if(r.trim().split(/\s+/).length!==5)throw Error(`nightly must be a 5-field cron expression`);return{allowedCommands:de(n),intervalHours:fe(n.intervalHours,`intervalHours`,24),nightly:r.trim(),maxSuggestions:Math.min(10,fe(n.maxSuggestions,`maxSuggestions`,5)),instructions:t.body}}function de(e){let t=g(e,`allowedCommands`,[]),n=t.find(e=>!se.test(e));if(n!==void 0)throw Error(`allowedCommands must contain bare command names, not "${n}"`);return[...new Set([...oe,...t])]}function fe(e,t,n){if(e===void 0)return n;if(typeof e!=`string`)throw Error(`${t} is invalid`);let r=Number(e);if(!Number.isFinite(r)||r<=0)throw Error(`${t} must be positive`);return r}async function pe(e){try{return ue(await me(e,w))}catch(e){return ne.warn(`Could not load valid GELATIERE.md; using built-in default`,{error:Be(e)}),ue(l)}}async function me(e,t){let n=await e.readFile(t,{encoding:`utf-8`});return typeof n==`string`?n:new TextDecoder().decode(n)}async function he(e,t){try{return JSON.parse(await me(e,t))}catch{return}}async function ge(e){let t=await he(e,re);if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=Pe(e,null);if(!t)continue;let{dismissedAt:r,takenAt:i}=e;typeof r==`string`&&r&&(t.dismissedAt=r),typeof i==`string`&&i&&(t.takenAt=i),n.push(t)}return n}async function _e(e,t){await e.mkdir(T,{recursive:!0}),await e.writeFile(re,`${JSON.stringify(t,null,2)}\n`)}async function ve(e){let t=await he(e,E);if(!t||typeof t!=`object`)return{passes:0};let n=t;return{passes:typeof n.passes==`number`&&n.passes>=0?n.passes:0,...typeof n.lastPassAt==`string`?{lastPassAt:n.lastPassAt}:{},...typeof n.lastTriggeredAt==`string`?{lastTriggeredAt:n.lastTriggeredAt}:{},...typeof n.lastDeliveredAt==`string`?{lastDeliveredAt:n.lastDeliveredAt}:{}}}async function ye(e,t){await e.mkdir(T,{recursive:!0}),await e.writeFile(E,`${JSON.stringify(t,null,2)}\n`)}function be(e,t,n){let r=Math.max(...[e.lastPassAt,e.lastTriggeredAt].map(e=>e?Date.parse(e):NaN).filter(e=>!Number.isNaN(e)));return!Number.isFinite(r)||t.getTime()-r>=n*36e5}async function xe(e,t=new Date){await ye(e,{...await ve(e),lastTriggeredAt:t.toISOString()})}function Se(e){return e.filter(e=>!e.dismissedAt&&!e.takenAt)}function Ce(e){return e.filter(e=>!!e.takenAt)}function we(e,t){let n=Se(e);if(!t)return n;let r=Date.parse(t);return Number.isNaN(r)?n:n.filter(e=>{let t=Date.parse(e.createdAt);return Number.isNaN(t)||t>r})}async function Te(e,t,n=new Date){return Oe(e,t,`dismissedAt`,n)}async function Ee(e,t,n=new Date){return Oe(e,t,`takenAt`,n)}var De=Promise.resolve();function Oe(e,t,n,r){let i=async()=>{let i=await ge(e),a=i.find(e=>e.id===t&&!e.dismissedAt&&!e.takenAt);return a?(a[n]=r.toISOString(),await _e(e,i),!0):!1},a=De.then(i,i);return De=a.catch(()=>!1),a}var ke=/[^a-z0-9]+/g;function Ae(e){return e.toLowerCase().replace(ke,`-`).replace(/^-+|-+$/g,``).slice(0,60)}function je(e,t){if(typeof e!=`string`)return;let n=e.trim();return n?n.slice(0,t):void 0}function Me(e){if(e)try{let t=new URL(e).protocol;return t===`http:`||t===`https:`?e:void 0}catch{return}}var k=/^[A-Za-z0-9@._/:=-]+$/;function Ne(e){if(!e)return;let t=e.split(/\s+/);if(!(t[0]!==`upskill`||t.length<2))return t.slice(1).every(e=>k.test(e))?e:void 0}function Pe(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=typeof n.kind==`string`?n.kind:``,i=je(n.title,200),a=je(n.body,1e3);if(!ce.has(r)||!i||!a)return null;let o=Ae(je(n.id,80)??`${r}-${i}`)||Ae(`${r}-${i}`);if(!o)return null;let s=t??je(n.createdAt,40)??``,c=n.skill===void 0?void 0:je(n.skill,120),l=n.install===void 0?void 0:Ne(je(n.install,300)),u=n.prompt===void 0?void 0:je(n.prompt,1e3);return r===`skill`&&(!c||!l)||le.has(r)&&!u?null:{id:o,kind:r,title:i,body:a,...n.skill===void 0?{}:{skill:c},...n.install===void 0?{}:{install:l},...n.prompt===void 0?{}:{prompt:u},...n.url===void 0?{}:{url:Me(je(n.url,500))},...n.evidence===void 0?{}:{evidence:je(n.evidence,500)},createdAt:s}}function Fe(e,t,n=10){let r=Array.isArray(e)?e:e&&typeof e==`object`&&Array.isArray(e.suggestions)?e.suggestions??[]:[],i=new Set,a=[];for(let e of r){let r=Pe(e,t);if(!(!r||i.has(r.id))&&(i.add(r.id),a.push(r),a.length>=n))break}return a}function Ie(e,t,n=40){let r=new Set(e.map(e=>e.id)),i=t.filter(e=>!r.has(e.id)),a=[...i,...e];for(;a.length>n;){let e=Le(a,e=>!!e.dismissedAt),t=e>=0?e:Le(a,e=>!!e.takenAt);a.splice(t>=0?t:a.length-1,1)}return{merged:a,added:i}}function Le(e,t){for(let n=e.length-1;n>=0;--n)if(t(e[n]))return n;return-1}async function Re(e,t,n=new Date){let r=await pe(e),i=Fe(t,n.toISOString(),r.maxSuggestions),{merged:a,added:o}=Ie(await ge(e),i);await _e(e,a);let s=await ve(e);return await ye(e,{...s,passes:s.passes+1,lastPassAt:n.toISOString()}),{added:o,open:Se(a)}}function ze(e,t){return{action:ie,data:{added:e.length,open:t.length,suggestions:t.slice(0,5),path:re,skill:D}}}function Be(e){return e instanceof Error?e.message:String(e)}function Ve(e){let t=He(e);if(!t)return null;let{action:n,bag:r}=t;return n===`gelatiere-suggestions`?Ue(n,r):n===`session-settled`?Ge(n,r):n===`run`?Ke(n,r):{action:n,headline:`gelatiere: ${n}`,titles:[]}}function He(e){let t=e.indexOf(`{`),n=e.lastIndexOf(`}`);if(t<0||n<=t)return null;let r;try{r=JSON.parse(e.slice(t,n+1))}catch{return null}if(!r||typeof r!=`object`)return null;let{action:i,data:a}=r;return typeof i==`string`?{action:i,bag:a&&typeof a==`object`?a:{}}:null}function Ue(e,t){let n=We(t.suggestions),r=typeof t.added==`number`?t.added:n.length,i=typeof t.open==`number`?t.open:n.length;return{action:e,headline:r===0?`Nothing new — ${i} open ${i===1?`suggestion`:`suggestions`} in the suggestions card.`:`${r} new ${r===1?`suggestion`:`suggestions`} (${i} open) — the cards are in the suggestions sprinkle.`,titles:n}}function We(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?e.title:void 0).filter(e=>typeof e==`string`&&e.length>0):[]}function Ge(e,t){let n=typeof t.cone==`string`?t.cone:void 0;return{action:e,headline:n?`A session ended in ${n} — time for a pass.`:`A session ended — time for a pass.`,titles:[]}}function Ke(e,t){let n=typeof t.requestedBy==`string`?t.requestedBy:void 0;return{action:e,headline:n?`${n} asked for a pass now.`:`Someone asked for a pass now.`,titles:[]}}function qe(e,t){let n=r(),i=`/preview${e}${t?`?projectRoot=${encodeURIComponent(t)}`:``}`;if(n){let e=globalThis.chrome?.runtime?.getURL;if(e)return e(i)}let a=`http://localhost:5710`;return typeof window<`u`&&window.location?.origin?a=window.location.origin:typeof self<`u`&&self.location?.origin&&(a=self.location.origin),`${a}${i}`}var Je={camera:`Camera`,microphone:`Microphone`};function Ye(e,t,n){return(e??``).trim()||`${Je[n]} ${t+1}`}function Xe(e,t){return e.map((e,n)=>({deviceId:e.deviceId,label:Ye(e.label,n,t)}))}function Ze(e){return e.length>=2}function Qe(e){if(e.length===0)return null;let t=e.find(e=>e.deviceId==="default");if(t)return t.deviceId;let n=e.find(e=>(e.label??``).trim().toLowerCase().startsWith(`default`));return n?n.deviceId:e[0].deviceId}function $e(){if(typeof window>`u`)return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var et=3e3,tt={engine:`builtin`,state:`idle`};function nt(){return{async permission(){try{return(await navigator.permissions.query({name:`microphone`})).state}catch{return`prompt`}},async requestPermission(){if(!navigator.mediaDevices?.getUserMedia)return!1;try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop();return!0}catch{return!1}},async microphones(){if(!navigator.mediaDevices?.enumerateDevices)return[];try{return Xe((await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`),`microphone`)}catch{return[]}},async start(e){let t=$e();if(!t)throw Error(`Speech recognition is not supported in this browser.`);let n=new t;n.continuous=!0,n.interimResults=!0,e.lang&&(n.lang=e.lang);let r=``,i=``,a=!1,o=[],s=()=>{a=!0;let e=o;o=[];for(let t of e)t()};n.onresult=t=>{i=``;for(let e=t.resultIndex;e<t.results.length;e++){let n=t.results[e];n.isFinal?r+=n[0].transcript:i+=n[0].transcript}let n=`${r}${i}`.trim();n&&e.onPartial?.(n)},n.onerror=t=>{t.error!==`no-speech`&&t.error!==`aborted`&&e.onError?.(`Speech recognition error: ${t.error}`)},n.onend=s,n.start();let c=()=>`${r}${i}`.trim();return{stop(){return a?Promise.resolve(c()):new Promise(e=>{let t=setTimeout(()=>e(c()),et);o.push(()=>{clearTimeout(t),e(c())});try{n.stop()}catch{clearTimeout(t),e(c())}})},cancel(){n.onresult=null,n.onerror=null,n.onend=null;try{(n.abort??n.stop).call(n)}catch{}s()}}},status(){return tt},onStatus(e){return e(tt),()=>{}},warmup(){}}}var rt=e({applyDictationMarkers:()=>ut,consumeDictationFirst:()=>mt,parseReplyLang:()=>ft,resetDictationPriming:()=>A,stripDictationMarkers:()=>dt,stripReplyLangMarker:()=>pt}),it=`◁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▷`,at=/\uD83C\uDF99\uFE0F?/g,ot=/\u25C1[\s\S]*?\u25B7/g,st=/<!--\s*lang:\s*([A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*)\s*-->/i,ct=/<!--\s*lang:\s*[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*\s*-->/gi,lt=!0;function ut(e,t){let n=e.endsWith(` `)?e:`${e} `;return t?`${n}\uD83C\uDF99\uFE0F${it}`:`${n}\uD83C\uDF99\uFE0F`}function dt(e){return e.replace(ot,``).replace(at,``).replace(/[ \t]+$/g,``).trimEnd()}function ft(e){return st.exec(e)?.[1]}function pt(e){return e.replace(ct,``)}function mt(){return lt?(lt=!1,!0):!1}function A(){lt=!0}var j={sent:{freq:660,freqSlideTo:990,duration:.12,peakGain:.06,type:`sine`},"tool-start":{freq:520,freq2:780,duration:.07,peakGain:.04,type:`triangle`},"tool-finish":{freq:880,freq2:1320,duration:.07,peakGain:.04,type:`sine`}};function ht(e,t){let n=j[t],r=e.currentTime,i=r+n.duration,a=e.createGain();a.gain.setValueAtTime(1e-4,r),a.gain.exponentialRampToValueAtTime(n.peakGain,r+n.duration*.2),a.gain.exponentialRampToValueAtTime(1e-4,i),a.connect(e.destination);let o=e.createOscillator();if(o.type=n.type,o.frequency.setValueAtTime(n.freq,r),n.freqSlideTo!==void 0&&o.frequency.linearRampToValueAtTime(n.freqSlideTo,i),o.connect(a),o.start(r),o.stop(i),n.freq2!==void 0){let t=e.createOscillator();t.type=n.type,t.frequency.setValueAtTime(n.freq2,r),t.connect(a),t.start(r),t.stop(i)}}function gt(e){let t=/^\[@[^\]\s]+ (completed|idle)\]/.exec(e);return t?t[1]===`idle`?`scoop-idle`:`scoop-notify`:/^\[@[^\]\s]+ sudo-request\]/.test(e)?`sudo-request`:/^\[scoop_wait [^\]]+\]/.test(e)?`scoop-wait`:e.startsWith(`[Session Reload]`)?`session-reload`:null}var _t=e({applyTimestampVisibility:()=>wt,formatMessageTimestamp:()=>Tt,getShowTimestamps:()=>Ct,initTimestampPreference:()=>N,setShowTimestamps:()=>M}),vt=`slicc_show_timestamps`,yt=`slicc-show-timestamps`,bt=`slicc-timestamp-visibility`,xt=!1;function St(e){if(e.getElementById(bt))return;let t=e.createElement(`style`);t.id=bt,t.textContent=[`slicc-user-message::part(timestamp),`,`slicc-agent-message .msg-ts {`,` display: none;`,`}`,`.${yt} slicc-user-message::part(timestamp),`,`.${yt} slicc-agent-message .msg-ts {`,` display: block;`,`}`].join(`
5
+ `),e.head.appendChild(t)}function Ct(){if(typeof localStorage>`u`||typeof localStorage?.getItem!=`function`)return!0;let e=localStorage.getItem(vt);return e===null||e===`true`}function M(e){typeof localStorage<`u`&&typeof localStorage?.setItem==`function`&&localStorage.setItem(vt,String(e)),wt()}function wt(e){if(typeof document>`u`)return;St(document);let t=e===void 0?Ct():e;document.documentElement.classList.toggle(yt,t),xt=!0}function N(){xt||wt()}function Tt(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):null}var Et=[`top`,`right`,`bottom`,`left`,`center`];function Dt(e){return e!=null&&Et.includes(e)}function Ot(e){let t=e?.panelMeta;return t&&typeof t.id==`string`?t:void 0}var kt=new Map,At=new EventTarget;function jt(e,t){At.dispatchEvent(new CustomEvent(`panel-registry-change`,{detail:{id:e,change:t}}))}function Mt(e){let{id:t}=e.meta,n=kt.has(t);return kt.set(t,e),jt(t,`registered`),!n}function Nt(e){return kt.delete(e)?(jt(e,`unregistered`),!0):!1}function Pt(){return[...kt.values()]}function Ft(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}var It=`.dock-tree__parking, .slicc-layout__parking`;function Lt(e,t){let n=e.querySelector(`[surface-id="${Ft(t)}"]`);return!n||n.closest(It)?!1:(n.requestFullscreen?.()?.catch(()=>{}),!0)}var Rt=e({DEFAULT_ZONE_AXIS:()=>Vt,LAYOUT_SCHEMA_VERSION:()=>1,ZONE_NAMES:()=>Bt,cloneLayout:()=>P,emptyLayout:()=>Ut,isPanelLocked:()=>$t,isSplitNode:()=>Wt,layoutPanelIds:()=>Kt,moveToZone:()=>Jt,parseLayoutDocument:()=>nn,removeFromZones:()=>Yt,resolveLayout:()=>Qt,sizeToFlex:()=>tn,variantMatches:()=>Gt,walkCenter:()=>Zt,zoneAxis:()=>Ht,zoneOfPanel:()=>qt,zonesFromCenter:()=>Xt}),zt=1,Bt=[`top`,`left`,`center`,`right`,`bottom`],Vt={top:`row`,bottom:`row`,left:`col`,right:`col`,center:`col`};function Ht(e,t){return e.axes?.[t]??Vt[t]}function Ut(e=`empty`){return{version:1,id:e,base:{}}}function P(e){return JSON.parse(JSON.stringify(e))}function Wt(e){return`split`in e}function Gt(e,t){return!(e.minWidth!=null&&t.width<e.minWidth||e.maxWidth!=null&&t.width>e.maxWidth||e.minHeight!=null&&t.height<e.minHeight||e.maxHeight!=null&&t.height>e.maxHeight||e.orientation!=null&&(t.width>=t.height?`landscape`:`portrait`)!==e.orientation||e.platform!=null&&t.platform!=null&&e.platform!==t.platform)}function Kt(e){let t=[],n=new Set,r=e=>{n.has(e)||(n.add(e),t.push(e))};for(let t of e.docks)for(let e of t.panels)r(e);if(e.zones)for(let t of Bt)for(let n of e.zones[t]??[])r(n);else e.center&&Zt(e.center,e=>r(e.panel));for(let t of e.floating)r(t.panel);return t}function qt(e,t){for(let n of Bt)if((e[n]??[]).includes(t))return n;return null}function Jt(e,t,n){if(qt(e,t)===n)return e;let r=P(e);for(let e of Bt){let n=r[e];n&&(r[e]=n.filter(e=>e!==t))}return r[n]=[...r[n]??[],t],r}function Yt(e,t){let n=P(e);for(let e of Bt){let r=n[e];r&&(n[e]=r.filter(e=>e!==t))}return n}function Xt(e){let t=[];return e&&Zt(e,e=>t.push(e.panel)),{center:t}}function Zt(e,t){if(!Wt(e)){t(e);return}for(let n of e.children)Zt(n,t)}function Qt(e,t){let n={id:e.id,locked:e.locked===!0,docks:P(e.base.docks??[]),zones:P(e.base.zones??null),center:P(e.base.center??null),floating:P(e.base.floating??[]),panels:P(e.panels??{}),appliedVariants:[]};return(e.variants??[]).forEach((e,r)=>{if(Gt(e.when,t)){n.appliedVariants.push(r),e.docks!==void 0&&(n.docks=P(e.docks)),e.zones!==void 0&&(n.zones=P(e.zones)),e.center!==void 0&&(n.center=P(e.center)),e.floating!==void 0&&(n.floating=P(e.floating));for(let[t,r]of Object.entries(e.panels??{}))n.panels[t]={...n.panels[t],...r}}}),n}function $t(e,t){if(e.locked||e.panels[t]?.locked===!0)return!0;for(let n of e.docks)if(n.panels.includes(t))return n.locked===!0;for(let n of e.floating)if(n.panel===t)return n.locked===!0;if(e.zones){let n=qt(e.zones,t);return n?(e.zones.locked??[]).includes(n):!1}return e.center?en(e.center,t,!1):!1}function en(e,t,n){let r=n||e.locked===!0;return Wt(e)?e.children.some(e=>en(e,t,r)):e.panel===t&&r}function tn(e){if(e==null)return`1 1 auto`;if(typeof e==`number`)return`${e} 1 0`;let t=e.trim(),n=/^([\d.]+)fr$/.exec(t);return n?`${n[1]} 1 0`:/^[\d.]+$/.test(t)?`${t} 1 0`:`0 0 ${t}`}function nn(e){if(!e||typeof e!=`object`)return{error:`layout must be an object`};let t=e;if(typeof t.id!=`string`||t.id.trim()===``)return{error:`layout.id must be a non-empty string`};if(typeof t.version!=`number`)return{error:`layout.version must be a number`};if(t.version>1)return{error:`layout.version ${t.version} is newer than supported (1)`};if(!t.base||typeof t.base!=`object`)return{error:`layout.base must be an object`};for(let e of t.base.docks??[]){if(!rn(e?.edge))return{error:`invalid dock edge: ${String(e?.edge)}`};if(!Array.isArray(e.panels))return{error:`dock.${e.edge}.panels must be an array`}}if(t.base.center!=null){let e=an(t.base.center);if(e)return{error:e}}return t}function rn(e){return e===`top`||e===`right`||e===`bottom`||e===`left`}function an(e){if(!e||typeof e!=`object`)return`center node must be an object`;let t=e;if(typeof t.panel==`string`)return null;if(t.split!==`row`&&t.split!==`col`)return'center node needs a `panel` string or a `split` of "row"/"col"';if(!Array.isArray(t.children)||t.children.length===0)return"a split node needs a non-empty `children` array";for(let e of t.children){let t=an(e);if(t)return t}return null}var on=[`top-left`,`top-right`,`bottom-left`,`bottom-right`,`top`,`right`,`bottom`,`left`],sn=`top-right`,cn=`slicc-launcher-corner`,ln=[`disconnected`,`connected`,`error`],un=`disconnected`,F=`follower-status`,dn=new Set(on),fn=new Set(ln);function pn(e,t=sn){return e&&dn.has(e)?e:t}function mn(e,t=un){return e&&fn.has(e)?e:t}function hn(e){return e>=6}function gn({clientX:e,clientY:t,viewportWidth:n,viewportHeight:r,velocityXPxPerMs:i=0,velocityYPxPerMs:a=0,flickProjectionMs:o=180}){let s=_n(e+i*o,0,n),c=_n(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 _n(e,t,n){return Math.min(Math.max(e,t),n)}var vn=`<?xml version="1.0" encoding="UTF-8"?>
6
6
  <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">
7
7
  <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>
8
8
  <g id="Waffle_Cross-Hatch" data-name="Waffle Cross-Hatch">
@@ -29,7 +29,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
29
29
  <circle id="Right_Eye_Outline" data-name="Right Eye Outline" cx="175.1" cy="250.34" r="64.78" style="fill: rgb(0, 0, 0); stroke: rgb(255, 255, 255); stroke-miterlimit: 10; stroke-width: 6px;"></circle>
30
30
 
31
31
  </g><g><line x1="351.01" y1="183.73000000000002" x2="415.78999999999996" y2="248.51" stroke="#fff" stroke-width="15" stroke-linecap="round"></line><line x1="351.01" y1="248.51" x2="415.78999999999996" y2="183.73000000000002" stroke="#fff" stroke-width="15" stroke-linecap="round"></line></g><g><line x1="142.70999999999998" y1="217.95" x2="207.49" y2="282.73" stroke="#fff" stroke-width="15" stroke-linecap="round"></line><line x1="142.70999999999998" y1="282.73" x2="207.49" y2="217.95" stroke="#fff" stroke-width="15" stroke-linecap="round"></line></g></g></g></svg>
32
- `,vn=`<?xml version="1.0" encoding="UTF-8"?>
32
+ `,yn=`<?xml version="1.0" encoding="UTF-8"?>
33
33
  <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">
34
34
  <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: #fff; stroke: #000; stroke-linejoin: round; stroke-width: 20px;"></path>
35
35
  <g id="Waffle_Cross-Hatch" data-name="Waffle Cross-Hatch">
@@ -56,7 +56,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
56
56
  <circle id="Right_Eye_Outline" data-name="Right Eye Outline" cx="175.1" cy="250.34" r="64.78" style="fill: #fff; stroke: #000; stroke-miterlimit: 10; stroke-width: 6px;"></circle>
57
57
 
58
58
  </g><g><line x1="351.01" y1="183.73000000000002" x2="415.78999999999996" y2="248.51" stroke="#000" stroke-width="15" stroke-linecap="round"></line><line x1="351.01" y1="248.51" x2="415.78999999999996" y2="183.73000000000002" stroke="#000" stroke-width="15" stroke-linecap="round"></line></g><g><line x1="142.70999999999998" y1="217.95" x2="207.49" y2="282.73" stroke="#000" stroke-width="15" stroke-linecap="round"></line><line x1="142.70999999999998" y1="282.73" x2="207.49" y2="217.95" stroke="#000" stroke-width="15" stroke-linecap="round"></line></g></g></g></svg>
59
- `,yn=`<?xml version="1.0" encoding="UTF-8"?>
59
+ `,bn=`<?xml version="1.0" encoding="UTF-8"?>
60
60
  <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">
61
61
  <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;"/>
62
62
  <g id="Waffle_Cross-Hatch" data-name="Waffle Cross-Hatch">
@@ -82,7 +82,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
82
82
  </g><g id="Left_Eye" data-name="Left Eye">
83
83
  <circle id="Right_Eye_Outline" data-name="Right Eye Outline" cx="175.1" cy="250.34" r="64.78" style="fill: rgb(0, 0, 0); stroke: rgb(255, 255, 255); stroke-miterlimit: 10; stroke-width: 6px;"/>
84
84
  <path id="Left_Pupil" data-name="Left Pupil" d="M213.74,233.23c-.13,1.98-.7,3.97-1.76,5.81-3.71,6.43-11.93,8.63-18.36,4.92-6.43-3.71-8.63-11.93-4.92-18.36,2.32-4.02,6.4-6.38,10.7-6.69-3.8-1.78-8.03-2.8-12.51-2.8-16.37,0-29.64,13.27-29.64,29.64s13.27,29.64,29.64,29.64,29.64-13.27,29.64-29.64c0-4.48-1.02-8.72-2.81-12.53Z" style="fill: rgb(255, 255, 255);"/>
85
- </g></g></g></svg>`,bn=`<?xml version="1.0" encoding="UTF-8"?>
85
+ </g></g></g></svg>`,xn=`<?xml version="1.0" encoding="UTF-8"?>
86
86
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="100%" height="100%"><g transform="translate(191.47118749999993, 12.583024999999978) scale(1.1115000000000002)"><g transform="translate(0, 0)"><g id="Cone">
87
87
  <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;"/>
88
88
  <g id="Waffle_Cross-Hatch" data-name="Waffle Cross-Hatch">
@@ -108,7 +108,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
108
108
  </g><g id="Left_Eye" data-name="Left Eye">
109
109
  <circle id="Right_Eye_Outline" data-name="Right Eye Outline" cx="175.1" cy="250.34" r="64.78" style="fill: rgb(0, 0, 0); stroke: rgb(255, 255, 255); stroke-miterlimit: 10; stroke-width: 6px;"/>
110
110
  <path id="Left_Pupil" data-name="Left Pupil" d="M213.74,233.23c-.13,1.98-.7,3.97-1.76,5.81-3.71,6.43-11.93,8.63-18.36,4.92-6.43-3.71-8.63-11.93-4.92-18.36,2.32-4.02,6.4-6.38,10.7-6.69-3.8-1.78-8.03-2.8-12.51-2.8-16.37,0-29.64,13.27-29.64,29.64s13.27,29.64,29.64,29.64,29.64-13.27,29.64-29.64c0-4.48-1.02-8.72-2.81-12.53Z" style="fill: rgb(255, 255, 255);"/>
111
- </g></g></g></svg>`,xn=`<?xml version="1.0" encoding="UTF-8"?>
111
+ </g></g></g></svg>`,Sn=`<?xml version="1.0" encoding="UTF-8"?>
112
112
  <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">
113
113
  <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: #fff; stroke: #000; stroke-linejoin: round; stroke-width: 20px;"/>
114
114
  <g id="Waffle_Cross-Hatch" data-name="Waffle Cross-Hatch">
@@ -134,7 +134,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
134
134
  </g><g id="Left_Eye" data-name="Left Eye">
135
135
  <circle id="Right_Eye_Outline" data-name="Right Eye Outline" cx="175.1" cy="250.34" r="64.78" style="fill: #fff; stroke: #000; stroke-miterlimit: 10; stroke-width: 6px;"/>
136
136
  <path id="Left_Pupil" data-name="Left Pupil" d="M213.74,233.23c-.13,1.98-.7,3.97-1.76,5.81-3.71,6.43-11.93,8.63-18.36,4.92-6.43-3.71-8.63-11.93-4.92-18.36,2.32-4.02,6.4-6.38,10.7-6.69-3.8-1.78-8.03-2.8-12.51-2.8-16.37,0-29.64,13.27-29.64,29.64s13.27,29.64,29.64,29.64,29.64-13.27,29.64-29.64c0-4.48-1.02-8.72-2.81-12.53Z" style="fill: rgb(0, 0, 0);"/>
137
- </g></g></g></svg>`,Sn=`<?xml version="1.0" encoding="UTF-8"?>
137
+ </g></g></g></svg>`,Cn=`<?xml version="1.0" encoding="UTF-8"?>
138
138
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="100%" height="100%"><g transform="translate(191.47118749999993, 12.583024999999978) scale(1.1115000000000002)"><g transform="translate(0, 0)"><g id="Cone">
139
139
  <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: #fff; stroke: #000; stroke-linejoin: round; stroke-width: 20px;"/>
140
140
  <g id="Waffle_Cross-Hatch" data-name="Waffle Cross-Hatch">
@@ -160,7 +160,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
160
160
  </g><g id="Left_Eye" data-name="Left Eye">
161
161
  <circle id="Right_Eye_Outline" data-name="Right Eye Outline" cx="175.1" cy="250.34" r="64.78" style="fill: #fff; stroke: #000; stroke-miterlimit: 10; stroke-width: 6px;"/>
162
162
  <path id="Left_Pupil" data-name="Left Pupil" d="M213.74,233.23c-.13,1.98-.7,3.97-1.76,5.81-3.71,6.43-11.93,8.63-18.36,4.92-6.43-3.71-8.63-11.93-4.92-18.36,2.32-4.02,6.4-6.38,10.7-6.69-3.8-1.78-8.03-2.8-12.51-2.8-16.37,0-29.64,13.27-29.64,29.64s13.27,29.64,29.64,29.64,29.64-13.27,29.64-29.64c0-4.48-1.02-8.72-2.81-12.53Z" style="fill: rgb(0, 0, 0);"/>
163
- </g></g></g></svg>`;function Cn(e,t){typeof customElements>`u`||customElements==null||customElements.get(e)||customElements.define(e,t)}function wn(e,t){for(let n of t)n!=null&&n!==!1&&e.append(typeof n==`string`||typeof n==`number`?document.createTextNode(String(n)):n)}function Tn(e,t,...n){let r=document.createElement(e);if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&(e===`class`?r.className=String(n):r.setAttribute(e,n===!0?``:String(n)));return wn(r,n),r}function En(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var Dn=En(`
163
+ </g></g></g></svg>`;function wn(e,t){typeof customElements>`u`||customElements==null||customElements.get(e)||customElements.define(e,t)}function Tn(e,t){for(let n of t)n!=null&&n!==!1&&e.append(typeof n==`string`||typeof n==`number`?document.createTextNode(String(n)):n)}function En(e,t,...n){let r=document.createElement(e);if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&(e===`class`?r.className=String(n):r.setAttribute(e,n===!0?``:String(n)));return Tn(r,n),r}function Dn(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var On=Dn(`
164
164
  :host {
165
165
  all: initial;
166
166
  position: fixed;
@@ -217,10 +217,10 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
217
217
  .logo-icon { width: 32px; height: 32px; display: block; }
218
218
  .logo-icon svg { width: 100%; height: 100%; display: block; }
219
219
  .logo-state { display: none; }
220
- :host(:not([${ln}])) .logo-state-disconnected,
221
- :host([${ln}="disconnected"]) .logo-state-disconnected,
222
- :host([${ln}="connected"]) .logo-state-connected,
223
- :host([${ln}="error"]) .logo-state-error { display: contents; }
220
+ :host(:not([${F}])) .logo-state-disconnected,
221
+ :host([${F}="disconnected"]) .logo-state-disconnected,
222
+ :host([${F}="connected"]) .logo-state-connected,
223
+ :host([${F}="error"]) .logo-state-error { display: contents; }
224
224
  .logo-for-dark { display: block; }
225
225
  .logo-for-light { display: none; }
226
226
  @media (prefers-color-scheme: light) {
@@ -323,7 +323,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
323
323
  @media (prefers-reduced-motion: reduce) {
324
324
  .launcher, .sidebar, .backdrop { transition: none; }
325
325
  }
326
- `);function On(e){let t=e.replace(/<\?xml[^?]*\?>\s*/i,``),n=new DOMParser().parseFromString(t,`image/svg+xml`);return document.importNode(n.documentElement,!0)}var kn=[{state:`disconnected`,darkSvg:yn,lightSvg:xn},{state:`connected`,darkSvg:bn,lightSvg:Sn},{state:`error`,darkSvg:_n,lightSvg:vn}];function An(){let e=Tn(`span`,{class:`logo`,part:`logo`});for(let{state:t,darkSvg:n,lightSvg:r}of kn){let i=Tn(`div`,{class:`logo-icon logo-for-dark`});i.appendChild(On(n));let a=Tn(`div`,{class:`logo-icon logo-for-light`});a.appendChild(On(r));let o=Tn(`span`,{class:`logo-state logo-state-${t}`,"aria-hidden":`true`},i,a);e.appendChild(o)}return e}function jn(e,t,n){return Math.min(Math.max(e,t),n)}function Mn(e,t){try{e.setPointerCapture(t)}catch{}}function Nn(e,t){try{e.hasPointerCapture(t)&&e.releasePointerCapture(t)}catch{}}function Pn(e){try{return fn(e?.localStorage.getItem(on))}catch{return an}}function Fn(e,t){try{e?.localStorage.setItem(on,t)}catch{}}var In=`Set the app-url attribute to load SLICC.`;Cn(`slicc-launcher`,class extends HTMLElement{static observedAttributes=[`open`,`corner`,`app-url`,`status-message`,ln];#e;#t;#n;#r;#i;#a;#o=``;#s=null;#c=!1;#l=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Dn],this.#u()}connectedCallback(){if(!this.hasAttribute(`corner`)){let e=Pn(this.ownerDocument.defaultView);this.#l=!0,this.setAttribute(`corner`,e),this.#l=!1}this.#f(),this.#p()}attributeChangedCallback(e){if(!this.#l&&(e===`app-url`&&this.#f(),e===`status-message`&&this.#p(),e===`corner`&&Fn(this.ownerDocument.defaultView,this.corner),e===`follower-status`)){let e=this.getAttribute(ln);if(e!==null){let t=pn(e);t!==e&&(this.#l=!0,this.setAttribute(ln,t),this.#l=!1)}}}get open(){return this.hasAttribute(`open`)}set open(e){this.open!==e&&(this.toggleAttribute(`open`,e),this.#d())}get corner(){return fn(this.getAttribute(`corner`))}set corner(e){let t=fn(e);this.corner===t&&this.hasAttribute(`corner`)||this.setAttribute(`corner`,t)}get appUrl(){return this.getAttribute(`app-url`)?.trim()??``}set appUrl(e){let t=(e??``).trim();t?this.setAttribute(`app-url`,t):this.removeAttribute(`app-url`)}get statusMessage(){return this.getAttribute(`status-message`)??``}set statusMessage(e){let t=e??``;t?this.setAttribute(`status-message`,t):this.removeAttribute(`status-message`)}get followerStatus(){return pn(this.getAttribute(ln))}set followerStatus(e){if(e==null){this.removeAttribute(ln);return}let t=pn(e);this.getAttribute(`follower-status`)!==t&&this.setAttribute(ln,t)}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}#u(){this.#t=Tn(`button`,{class:`launcher`,part:`launcher`,type:`button`,"aria-label":`Toggle SLICC`},An(),Tn(`span`,{class:`tab-label`,part:`tab-label`},`SLICC`)),this.#t.addEventListener(`click`,e=>{if(this.#c){this.#c=!1,e.preventDefault(),e.stopImmediatePropagation();return}this.toggle()}),this.#t.addEventListener(`dblclick`,e=>{e.preventDefault(),this.dispatchEvent(new CustomEvent(`slicc-launcher-focus`,{bubbles:!0,composed:!0}))}),this.#t.addEventListener(`pointerdown`,this.#m),this.#t.addEventListener(`pointermove`,this.#h),this.#t.addEventListener(`pointerup`,this.#g),this.#t.addEventListener(`pointercancel`,this.#_),this.#n=Tn(`div`,{class:`backdrop`,part:`backdrop`}),this.#n.addEventListener(`click`,()=>this.hide()),this.#i=Tn(`iframe`,{title:`SLICC overlay`}),this.#a=Tn(`div`,{class:`empty`},In);let e=Tn(`div`,{class:`viewport`},this.#i,this.#a);this.#r=Tn(`aside`,{class:`sidebar`,part:`sidebar`,"aria-label":`SLICC launcher sidebar`},e),this.#e.replaceChildren(this.#n,this.#r,this.#t)}#d(){this.dispatchEvent(new CustomEvent(`slicc-launcher-toggle`,{detail:{open:this.open},bubbles:!0,composed:!0}))}#f(){let e=this.appUrl;if(this.#a.toggleAttribute(`hidden`,!!e),!e){this.#o&&(this.#o=``,this.#i.removeAttribute(`src`));return}e!==this.#o&&(this.#o=e,this.#i.src=e)}#p(){this.#a.textContent=this.statusMessage||In}#m=e=>{if(!e.isPrimary||e.button!==0)return;let t=this.#t.getBoundingClientRect();this.#s={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startLeft:t.left,startTop:t.top,width:t.width,height:t.height,lastX:e.clientX,lastY:e.clientY,lastTimestamp:e.timeStamp,velocityX:0,velocityY:0,dragging:!1},this.#c=!1,e.preventDefault(),Mn(this.#t,e.pointerId)};#h=e=>{let t=this.#s;if(!t||e.pointerId!==t.pointerId)return;let n=e.clientX-t.startX,r=e.clientY-t.startY,i=Math.hypot(n,r);!t.dragging&&mn(i)&&(t.dragging=!0,this.setAttribute(`dragging`,``));let a=Math.max(e.timeStamp-t.lastTimestamp,1),o=(e.clientX-t.lastX)/a,s=(e.clientY-t.lastY)/a;if(t.velocityX=t.velocityX===0?o:t.velocityX*.35+o*.65,t.velocityY=t.velocityY===0?s:t.velocityY*.35+s*.65,t.lastX=e.clientX,t.lastY=e.clientY,t.lastTimestamp=e.timeStamp,!t.dragging)return;let c=Math.max(18,window.innerWidth-t.width-18),l=Math.max(18,window.innerHeight-t.height-18),u=jn(t.startLeft+n,18,c),d=jn(t.startTop+r,18,l);this.#t.style.left=`${u}px`,this.#t.style.top=`${d}px`,this.#t.style.right=`auto`,this.#t.style.bottom=`auto`,e.preventDefault()};#g=e=>{this.#v(e,!0)};#_=e=>{this.#v(e,!1)};#v(e,t){let n=this.#s;if(!n||e.pointerId!==n.pointerId)return;let r=Math.hypot(e.clientX-n.startX,e.clientY-n.startY);if(t&&(n.dragging||mn(r))){let t=hn({clientX:e.clientX,clientY:e.clientY,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,velocityXPxPerMs:n.velocityX,velocityYPxPerMs:n.velocityY});this.corner=t,this.dispatchEvent(new CustomEvent(`slicc-launcher-move`,{detail:{corner:t},bubbles:!0,composed:!0})),this.#c=!0,e.preventDefault()}Nn(this.#t,e.pointerId),this.#s=null,this.removeAttribute(`dragging`),this.#t.style.left=``,this.#t.style.top=``,this.#t.style.right=``,this.#t.style.bottom=``}});function I(e,t){typeof customElements>`u`||customElements==null||customElements.get(e)||customElements.define(e,t)}function Ln(e,t){for(let n of t)n!=null&&n!==!1&&e.append(typeof n==`string`||typeof n==`number`?document.createTextNode(String(n)):n)}function L(e,t,...n){let r=document.createElement(e);if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&(e===`class`?r.className=String(n):r.setAttribute(e,n===!0?``:String(n)));return Ln(r,n),r}function R(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var Rn=20,zn=16,Bn=18,Vn=R(`
326
+ `);function kn(e){let t=e.replace(/<\?xml[^?]*\?>\s*/i,``),n=new DOMParser().parseFromString(t,`image/svg+xml`);return document.importNode(n.documentElement,!0)}var An=[{state:`disconnected`,darkSvg:bn,lightSvg:Sn},{state:`connected`,darkSvg:xn,lightSvg:Cn},{state:`error`,darkSvg:vn,lightSvg:yn}];function jn(){let e=En(`span`,{class:`logo`,part:`logo`});for(let{state:t,darkSvg:n,lightSvg:r}of An){let i=En(`div`,{class:`logo-icon logo-for-dark`});i.appendChild(kn(n));let a=En(`div`,{class:`logo-icon logo-for-light`});a.appendChild(kn(r));let o=En(`span`,{class:`logo-state logo-state-${t}`,"aria-hidden":`true`},i,a);e.appendChild(o)}return e}function Mn(e,t,n){return Math.min(Math.max(e,t),n)}function Nn(e,t){try{e.setPointerCapture(t)}catch{}}function Pn(e,t){try{e.hasPointerCapture(t)&&e.releasePointerCapture(t)}catch{}}function Fn(e){try{return pn(e?.localStorage.getItem(cn))}catch{return sn}}function In(e,t){try{e?.localStorage.setItem(cn,t)}catch{}}var Ln=`Set the app-url attribute to load SLICC.`;wn(`slicc-launcher`,class extends HTMLElement{static observedAttributes=[`open`,`corner`,`app-url`,`status-message`,F];#e;#t;#n;#r;#i;#a;#o=``;#s=null;#c=!1;#l=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[On],this.#u()}connectedCallback(){if(!this.hasAttribute(`corner`)){let e=Fn(this.ownerDocument.defaultView);this.#l=!0,this.setAttribute(`corner`,e),this.#l=!1}this.#f(),this.#p()}attributeChangedCallback(e){if(!this.#l&&(e===`app-url`&&this.#f(),e===`status-message`&&this.#p(),e===`corner`&&In(this.ownerDocument.defaultView,this.corner),e===`follower-status`)){let e=this.getAttribute(F);if(e!==null){let t=mn(e);t!==e&&(this.#l=!0,this.setAttribute(F,t),this.#l=!1)}}}get open(){return this.hasAttribute(`open`)}set open(e){this.open!==e&&(this.toggleAttribute(`open`,e),this.#d())}get corner(){return pn(this.getAttribute(`corner`))}set corner(e){let t=pn(e);this.corner===t&&this.hasAttribute(`corner`)||this.setAttribute(`corner`,t)}get appUrl(){return this.getAttribute(`app-url`)?.trim()??``}set appUrl(e){let t=(e??``).trim();t?this.setAttribute(`app-url`,t):this.removeAttribute(`app-url`)}get statusMessage(){return this.getAttribute(`status-message`)??``}set statusMessage(e){let t=e??``;t?this.setAttribute(`status-message`,t):this.removeAttribute(`status-message`)}get followerStatus(){return mn(this.getAttribute(F))}set followerStatus(e){if(e==null){this.removeAttribute(F);return}let t=mn(e);this.getAttribute(`follower-status`)!==t&&this.setAttribute(F,t)}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}#u(){this.#t=En(`button`,{class:`launcher`,part:`launcher`,type:`button`,"aria-label":`Toggle SLICC`},jn(),En(`span`,{class:`tab-label`,part:`tab-label`},`SLICC`)),this.#t.addEventListener(`click`,e=>{if(this.#c){this.#c=!1,e.preventDefault(),e.stopImmediatePropagation();return}this.toggle()}),this.#t.addEventListener(`dblclick`,e=>{e.preventDefault(),this.dispatchEvent(new CustomEvent(`slicc-launcher-focus`,{bubbles:!0,composed:!0}))}),this.#t.addEventListener(`pointerdown`,this.#m),this.#t.addEventListener(`pointermove`,this.#h),this.#t.addEventListener(`pointerup`,this.#g),this.#t.addEventListener(`pointercancel`,this.#_),this.#n=En(`div`,{class:`backdrop`,part:`backdrop`}),this.#n.addEventListener(`click`,()=>this.hide()),this.#i=En(`iframe`,{title:`SLICC overlay`}),this.#a=En(`div`,{class:`empty`},Ln);let e=En(`div`,{class:`viewport`},this.#i,this.#a);this.#r=En(`aside`,{class:`sidebar`,part:`sidebar`,"aria-label":`SLICC launcher sidebar`},e),this.#e.replaceChildren(this.#n,this.#r,this.#t)}#d(){this.dispatchEvent(new CustomEvent(`slicc-launcher-toggle`,{detail:{open:this.open},bubbles:!0,composed:!0}))}#f(){let e=this.appUrl;if(this.#a.toggleAttribute(`hidden`,!!e),!e){this.#o&&(this.#o=``,this.#i.removeAttribute(`src`));return}e!==this.#o&&(this.#o=e,this.#i.src=e)}#p(){this.#a.textContent=this.statusMessage||Ln}#m=e=>{if(!e.isPrimary||e.button!==0)return;let t=this.#t.getBoundingClientRect();this.#s={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startLeft:t.left,startTop:t.top,width:t.width,height:t.height,lastX:e.clientX,lastY:e.clientY,lastTimestamp:e.timeStamp,velocityX:0,velocityY:0,dragging:!1},this.#c=!1,e.preventDefault(),Nn(this.#t,e.pointerId)};#h=e=>{let t=this.#s;if(!t||e.pointerId!==t.pointerId)return;let n=e.clientX-t.startX,r=e.clientY-t.startY,i=Math.hypot(n,r);!t.dragging&&hn(i)&&(t.dragging=!0,this.setAttribute(`dragging`,``));let a=Math.max(e.timeStamp-t.lastTimestamp,1),o=(e.clientX-t.lastX)/a,s=(e.clientY-t.lastY)/a;if(t.velocityX=t.velocityX===0?o:t.velocityX*.35+o*.65,t.velocityY=t.velocityY===0?s:t.velocityY*.35+s*.65,t.lastX=e.clientX,t.lastY=e.clientY,t.lastTimestamp=e.timeStamp,!t.dragging)return;let c=Math.max(18,window.innerWidth-t.width-18),l=Math.max(18,window.innerHeight-t.height-18),u=Mn(t.startLeft+n,18,c),d=Mn(t.startTop+r,18,l);this.#t.style.left=`${u}px`,this.#t.style.top=`${d}px`,this.#t.style.right=`auto`,this.#t.style.bottom=`auto`,e.preventDefault()};#g=e=>{this.#v(e,!0)};#_=e=>{this.#v(e,!1)};#v(e,t){let n=this.#s;if(!n||e.pointerId!==n.pointerId)return;let r=Math.hypot(e.clientX-n.startX,e.clientY-n.startY);if(t&&(n.dragging||hn(r))){let t=gn({clientX:e.clientX,clientY:e.clientY,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,velocityXPxPerMs:n.velocityX,velocityYPxPerMs:n.velocityY});this.corner=t,this.dispatchEvent(new CustomEvent(`slicc-launcher-move`,{detail:{corner:t},bubbles:!0,composed:!0})),this.#c=!0,e.preventDefault()}Pn(this.#t,e.pointerId),this.#s=null,this.removeAttribute(`dragging`),this.#t.style.left=``,this.#t.style.top=``,this.#t.style.right=``,this.#t.style.bottom=``}});function I(e,t){typeof customElements>`u`||customElements==null||customElements.get(e)||customElements.define(e,t)}function Rn(e,t){for(let n of t)n!=null&&n!==!1&&e.append(typeof n==`string`||typeof n==`number`?document.createTextNode(String(n)):n)}function L(e,t,...n){let r=document.createElement(e);if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&(e===`class`?r.className=String(n):r.setAttribute(e,n===!0?``:String(n)));return Rn(r,n),r}function R(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var zn=20,Bn=16,Vn=18,Hn=R(`
327
327
  :host{display:block;width:100%;
328
328
  --am-accent:var(--accent,#3b63fb);
329
329
  --am-accent-subtle:color-mix(in oklab,var(--am-accent) 12%,var(--canvas,#fff));
@@ -379,7 +379,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
379
379
  .sep{height:1px;background:var(--line,#e1e1e1);margin:6px 4px;}
380
380
  .drop{position:absolute;inset:0;border-radius:10px;display:none;align-items:center;justify-content:center;text-align:center;background:var(--am-accent-subtle);border:2px dashed var(--am-accent);color:var(--am-accent);font-size:13px;font-weight:600;pointer-events:none;}
381
381
  :host([data-dropping]) .drop{display:flex;}
382
- `),Hn=[{kind:`file`,label:`Files`,icon:`file`,entries:[{id:`/workspace/README.md`,label:`README.md`,sub:`/workspace`},{id:`/workspace/src/main.ts`,label:`main.ts`,sub:`/workspace/src`},{id:`/workspace/src/orchestrator.ts`,label:`orchestrator.ts`,sub:`/workspace/src`},{id:`/workspace/notes/launch-plan.md`,label:`launch-plan.md`,sub:`/workspace/notes`},{id:`/shared/CLAUDE.md`,label:`CLAUDE.md`,sub:`/shared`},{id:`/tmp/screenshot-3.png`,label:`screenshot-3.png`,sub:`/tmp`}]},{kind:`skill`,label:`Skills`,icon:`sparkles`,entries:[{id:`slicc-handoff`,label:`slicc-handoff`,sub:`Continue work in the SLICC browser agent`},{id:`playwright-cli`,label:`playwright-cli`,sub:`Automate browser interactions`},{id:`mixtape`,label:`mixtape`,sub:`Curate themed music playlists`},{id:`wavespeed`,label:`wavespeed`,sub:`Generate images, video and speech`},{id:`save-the-cat`,label:`save-the-cat`,sub:`Screenwriting beat sheets`}]},{kind:`conversation`,label:`Conversations`,icon:`message-square`,entries:[{id:`c1`,label:`Dark mode toggle`,sub:`Frozen · 2h ago`},{id:`c2`,label:`Refactor the mount backend`,sub:`Frozen · yesterday`},{id:`c3`,label:`Add slash menu (declined)`,sub:`Frozen · 3 days ago`},{id:`c4`,label:`WebGL shader walkthrough`,sub:`Frozen · last week`}]}],Un=[{kind:`upload`,icon:`upload`,label:`Upload from this computer`,sub:`Drag & drop or click to browse`,quick:!0},{kind:`capture`,mode:`photo`,icon:`image`,label:`Take a photo`,quick:!0},{kind:`capture`,mode:`screenshot`,icon:`monitor`,label:`Take a screenshot`,quick:!0}],Wn={kind:`secret`,icon:`key-round`,label:`Share secret securely`,sub:`The agent only sees a masked value`,quick:!0};function Gn(e){return e.kind===`upload`?{kind:`upload`,name:``,size:0}:e.kind===`secret`?{kind:`secret`,label:e.label}:{kind:`capture`,mode:e.mode??`photo`,label:e.label}}I(`slicc-add-menu`,class extends HTMLElement{static observedAttributes=[`theme`,`global-drop`,`no-camera`,`secret-action`];#e;#t=null;#n=null;#r=!1;#i=``;#a=0;#o=[];#s=0;#c;#l;#u;#d;#f;#p;#m=e=>{this.#r&&!this.contains(e.target)&&this.close()};#h=!1;#g=0;#_=!1;#v(e){let t=e.dataTransfer?.types;return!!t&&Array.from(t).includes(`Files`)}#y(){this.#r||(this.#_=!0,this.open()),this.setAttribute(`data-dropping`,``)}#b(){this.#g=0,this.removeAttribute(`data-dropping`),this.#_&&(this.#_=!1,this.close())}#x=e=>{this.#v(e)&&(e.preventDefault(),this.#g++,!e.composedPath().includes(this.#u)&&this.#y())};#S=e=>{this.#v(e)&&e.preventDefault()};#C=e=>{this.#v(e)&&(this.#g=Math.max(0,this.#g-1),this.#g===0&&this.#b())};#w=e=>{if(!this.#v(e))return;if(e.preventDefault(),this.#g=0,e.composedPath().includes(this.#u)){this.#_=!1;return}this.removeAttribute(`data-dropping`),this.#_=!1;let t=e.dataTransfer?.files;if(t?.length)for(let e of Array.from(t))this.#B({kind:`upload`,name:e.name,size:e.size,file:e});this.close()};#T(){this.isConnected&&this.hasAttribute(`global-drop`)?this.#E():this.#D()}#E(){if(this.#h)return;this.#h=!0;let e=this.ownerDocument;e.addEventListener(`dragenter`,this.#x),e.addEventListener(`dragover`,this.#S),e.addEventListener(`dragleave`,this.#C),e.addEventListener(`drop`,this.#w)}#D(){if(!this.#h)return;this.#h=!1;let e=this.ownerDocument;e.removeEventListener(`dragenter`,this.#x),e.removeEventListener(`dragover`,this.#S),e.removeEventListener(`dragleave`,this.#C),e.removeEventListener(`drop`,this.#w),this.#g=0,this.#_=!1}constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Vn]}connectedCallback(){this.#k(),this.#T()}disconnectedCallback(){document.removeEventListener(`mousedown`,this.#m),this.#D()}attributeChangedCallback(e){e===`global-drop`?this.#T():(e===`no-camera`||e===`secret-action`)&&this.#r&&this.#P()}#O(){let e=this.hasAttribute(`no-camera`)?Un.filter(e=>e.kind!==`capture`||e.mode!==`photo`):Un;return this.hasAttribute(`secret-action`)?[...e,Wn]:e}get results(){return this.#t}set results(e){this.#t=e,this.#r&&this.#P()}get provider(){return this.#n}set provider(e){this.#n=e,this.#r&&this.#P()}get isOpen(){return this.#r}#k(){let e=L(`input`,{type:`file`,multiple:!0,hidden:!0}),t=L(`div`,{class:`body`}),n=L(`div`,{class:`results`,part:`results`,role:`listbox`},t,L(`div`,{class:`drop`},`Drop files to add`)),r=L(`span`,{class:`ti`},i(`plus`,{size:Rn})),a=L(`button`,{class:`trigger`,part:`trigger`,"aria-haspopup":`true`,"aria-expanded":`false`,title:`Add to prompt`},r),o=L(`input`,{type:`text`,placeholder:`Search files, skills, conversations…`}),s=L(`div`,{class:`wrap`,part:`wrap`},n,L(`div`,{class:`row`},a,L(`div`,{class:`searchbox`},L(`span`,{class:`si`},i(`search`,{size:zn})),o)));this.#e.replaceChildren(e,s),this.#c=a,this.#l=r,this.#u=s,this.#d=o,this.#f=t,this.#p=e,this.#A(),this.#P()}#A(){this.#c.addEventListener(`click`,()=>this.toggle()),this.#d.addEventListener(`input`,()=>{this.#i=this.#d.value,this.#a=0,this.#P()}),this.#d.addEventListener(`keydown`,e=>this.#R(e)),this.#p.addEventListener(`change`,()=>{for(let e of Array.from(this.#p.files??[]))this.#B({kind:`upload`,name:e.name,size:e.size,file:e});this.#p.value=``,this.close()});for(let e of[`dragenter`,`dragover`])this.#u.addEventListener(e,e=>{e.preventDefault(),this.#r||this.open(),this.setAttribute(`data-dropping`,``)});for(let e of[`dragleave`,`drop`])this.#u.addEventListener(e,t=>{t.preventDefault();let n=t;e===`dragleave`&&this.#u.contains(n.relatedTarget)||this.removeAttribute(`data-dropping`)});this.#u.addEventListener(`drop`,e=>{let t=e.dataTransfer?.files;if(t?.length){for(let e of Array.from(t))this.#B({kind:`upload`,name:e.name,size:e.size,file:e});this.close()}})}toggle(){this.#r?this.close():this.open()}#j(e){this.#l.replaceChildren(i(e?`x`:`plus`,{size:Rn}))}open(){this.#r||(this.#r=!0,this.setAttribute(`data-open`,``),this.#c.setAttribute(`aria-expanded`,`true`),this.#j(!0),document.addEventListener(`mousedown`,this.#m),this.#i=``,this.#d.value=``,this.#a=0,this.#P(),requestAnimationFrame(()=>this.#d.focus()))}close(){this.#r&&(this.#r=!1,this.removeAttribute(`data-open`),this.removeAttribute(`data-dropping`),this.#c.setAttribute(`aria-expanded`,`false`),this.#j(!1),document.removeEventListener(`mousedown`,this.#m))}async#M(e){if(this.#n){let t=await this.#n(e);if(t)return t}return this.#t??Hn}#N(e){let t=this.#i.trim().toLowerCase(),n=e=>!t||`${e.label} ${e.sub??``}`.toLowerCase().includes(t),r=[],i=this.#O();if(!t)for(let e of i)r.push({type:`quick`,data:e});else if(`upload take a photo screenshot share secret securely`.includes(t))for(let e of i)e.label.toLowerCase().includes(t)&&r.push({type:`quick`,data:e});for(let i of e){let e=i.entries.filter(n).slice(0,t?8:4);if(e.length){r.push({type:`sec`,label:i.label});for(let t of e)r.push({type:`row`,section:i,data:t})}}return r}async#P(){let e=++this.#s,t=await this.#M(this.#i.trim().toLowerCase());if(e!==this.#s)return;let n=this.#N(t);this.#o=[];let r=[],a=!1;for(let e of n)if(e.type===`sec`)a&&r.push(L(`div`,{class:`sep`})),r.push(L(`div`,{class:`sec`},e.label)),a=!1;else if(e.type===`quick`){let t=this.#o.length;this.#o.push(Gn(e.data));let n=L(`span`,{class:`tx`},L(`div`,{class:`lb`},e.data.label));e.data.sub&&n.append(L(`div`,{class:`sb`},e.data.sub)),r.push(L(`div`,{class:`item quick`,"data-i":t},L(`span`,{class:`ic`},i(e.data.icon,{size:Bn})),n)),a=!0}else{let t=this.#o.length;this.#o.push({kind:e.section.kind,id:e.data.id,label:e.data.label}),r.push(L(`div`,{class:`item`,"data-i":t},L(`span`,{class:`ic`},i(e.section.icon,{size:Bn})),L(`span`,{class:`tx`},L(`div`,{class:`lb`},e.data.label),L(`div`,{class:`sb`},e.data.sub??``))))}r.length?this.#f.replaceChildren(...r):this.#f.replaceChildren(L(`div`,{class:`empty`},`No matches for “${this.#i}”.`));for(let e of Array.from(this.#f.querySelectorAll(`.item`))){let t=Number(e.dataset.i);e.addEventListener(`mouseenter`,()=>this.#I(t)),e.addEventListener(`click`,()=>this.#z(t))}this.#a>=this.#o.length&&(this.#a=0),this.#F()}#F(){for(let e of Array.from(this.#f.querySelectorAll(`.item`)))e.classList.toggle(`active`,Number(e.dataset.i)===this.#a)}#I(e){this.#a=e,this.#F()}#L(e){if(!this.#o.length)return;this.#a=(this.#a+e+this.#o.length)%this.#o.length,this.#F();let t=this.#f.querySelector(`.item[data-i="${this.#a}"]`);t&&t.scrollIntoView({block:`nearest`})}#R(e){e.key===`ArrowDown`?(e.preventDefault(),this.#L(1)):e.key===`ArrowUp`?(e.preventDefault(),this.#L(-1)):e.key===`Enter`?(e.preventDefault(),this.#z(this.#a)):e.key===`Escape`&&(e.preventDefault(),this.close(),this.#c.focus())}#z(e){let t=this.#o[e];if(t){if(t.kind===`upload`){this.#p.click();return}this.#B(t),this.close()}}#B(e){this.dispatchEvent(new CustomEvent(`slicc-add`,{detail:e,bubbles:!0,composed:!0}))}});var Kn=R(`
382
+ `),Un=[{kind:`file`,label:`Files`,icon:`file`,entries:[{id:`/workspace/README.md`,label:`README.md`,sub:`/workspace`},{id:`/workspace/src/main.ts`,label:`main.ts`,sub:`/workspace/src`},{id:`/workspace/src/orchestrator.ts`,label:`orchestrator.ts`,sub:`/workspace/src`},{id:`/workspace/notes/launch-plan.md`,label:`launch-plan.md`,sub:`/workspace/notes`},{id:`/shared/CLAUDE.md`,label:`CLAUDE.md`,sub:`/shared`},{id:`/tmp/screenshot-3.png`,label:`screenshot-3.png`,sub:`/tmp`}]},{kind:`skill`,label:`Skills`,icon:`sparkles`,entries:[{id:`slicc-handoff`,label:`slicc-handoff`,sub:`Continue work in the SLICC browser agent`},{id:`playwright-cli`,label:`playwright-cli`,sub:`Automate browser interactions`},{id:`mixtape`,label:`mixtape`,sub:`Curate themed music playlists`},{id:`wavespeed`,label:`wavespeed`,sub:`Generate images, video and speech`},{id:`save-the-cat`,label:`save-the-cat`,sub:`Screenwriting beat sheets`}]},{kind:`conversation`,label:`Conversations`,icon:`message-square`,entries:[{id:`c1`,label:`Dark mode toggle`,sub:`Frozen · 2h ago`},{id:`c2`,label:`Refactor the mount backend`,sub:`Frozen · yesterday`},{id:`c3`,label:`Add slash menu (declined)`,sub:`Frozen · 3 days ago`},{id:`c4`,label:`WebGL shader walkthrough`,sub:`Frozen · last week`}]}],Wn=[{kind:`upload`,icon:`upload`,label:`Upload from this computer`,sub:`Drag & drop or click to browse`,quick:!0},{kind:`capture`,mode:`photo`,icon:`image`,label:`Take a photo`,quick:!0},{kind:`capture`,mode:`screenshot`,icon:`monitor`,label:`Take a screenshot`,quick:!0}],Gn={kind:`secret`,icon:`key-round`,label:`Share secret securely`,sub:`The agent only sees a masked value`,quick:!0};function Kn(e){return e.kind===`upload`?{kind:`upload`,name:``,size:0}:e.kind===`secret`?{kind:`secret`,label:e.label}:{kind:`capture`,mode:e.mode??`photo`,label:e.label}}I(`slicc-add-menu`,class extends HTMLElement{static observedAttributes=[`theme`,`global-drop`,`no-camera`,`secret-action`];#e;#t=null;#n=null;#r=!1;#i=``;#a=0;#o=[];#s=0;#c;#l;#u;#d;#f;#p;#m=e=>{this.#r&&!this.contains(e.target)&&this.close()};#h=!1;#g=0;#_=!1;#v(e){let t=e.dataTransfer?.types;return!!t&&Array.from(t).includes(`Files`)}#y(){this.#r||(this.#_=!0,this.open()),this.setAttribute(`data-dropping`,``)}#b(){this.#g=0,this.removeAttribute(`data-dropping`),this.#_&&(this.#_=!1,this.close())}#x=e=>{this.#v(e)&&(e.preventDefault(),this.#g++,!e.composedPath().includes(this.#u)&&this.#y())};#S=e=>{this.#v(e)&&e.preventDefault()};#C=e=>{this.#v(e)&&(this.#g=Math.max(0,this.#g-1),this.#g===0&&this.#b())};#w=e=>{if(!this.#v(e))return;if(e.preventDefault(),this.#g=0,e.composedPath().includes(this.#u)){this.#_=!1;return}this.removeAttribute(`data-dropping`),this.#_=!1;let t=e.dataTransfer?.files;if(t?.length)for(let e of Array.from(t))this.#B({kind:`upload`,name:e.name,size:e.size,file:e});this.close()};#T(){this.isConnected&&this.hasAttribute(`global-drop`)?this.#E():this.#D()}#E(){if(this.#h)return;this.#h=!0;let e=this.ownerDocument;e.addEventListener(`dragenter`,this.#x),e.addEventListener(`dragover`,this.#S),e.addEventListener(`dragleave`,this.#C),e.addEventListener(`drop`,this.#w)}#D(){if(!this.#h)return;this.#h=!1;let e=this.ownerDocument;e.removeEventListener(`dragenter`,this.#x),e.removeEventListener(`dragover`,this.#S),e.removeEventListener(`dragleave`,this.#C),e.removeEventListener(`drop`,this.#w),this.#g=0,this.#_=!1}constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Hn]}connectedCallback(){this.#k(),this.#T()}disconnectedCallback(){document.removeEventListener(`mousedown`,this.#m),this.#D()}attributeChangedCallback(e){e===`global-drop`?this.#T():(e===`no-camera`||e===`secret-action`)&&this.#r&&this.#P()}#O(){let e=this.hasAttribute(`no-camera`)?Wn.filter(e=>e.kind!==`capture`||e.mode!==`photo`):Wn;return this.hasAttribute(`secret-action`)?[...e,Gn]:e}get results(){return this.#t}set results(e){this.#t=e,this.#r&&this.#P()}get provider(){return this.#n}set provider(e){this.#n=e,this.#r&&this.#P()}get isOpen(){return this.#r}#k(){let e=L(`input`,{type:`file`,multiple:!0,hidden:!0}),t=L(`div`,{class:`body`}),n=L(`div`,{class:`results`,part:`results`,role:`listbox`},t,L(`div`,{class:`drop`},`Drop files to add`)),r=L(`span`,{class:`ti`},i(`plus`,{size:zn})),a=L(`button`,{class:`trigger`,part:`trigger`,"aria-haspopup":`true`,"aria-expanded":`false`,title:`Add to prompt`},r),o=L(`input`,{type:`text`,placeholder:`Search files, skills, conversations…`}),s=L(`div`,{class:`wrap`,part:`wrap`},n,L(`div`,{class:`row`},a,L(`div`,{class:`searchbox`},L(`span`,{class:`si`},i(`search`,{size:Bn})),o)));this.#e.replaceChildren(e,s),this.#c=a,this.#l=r,this.#u=s,this.#d=o,this.#f=t,this.#p=e,this.#A(),this.#P()}#A(){this.#c.addEventListener(`click`,()=>this.toggle()),this.#d.addEventListener(`input`,()=>{this.#i=this.#d.value,this.#a=0,this.#P()}),this.#d.addEventListener(`keydown`,e=>this.#R(e)),this.#p.addEventListener(`change`,()=>{for(let e of Array.from(this.#p.files??[]))this.#B({kind:`upload`,name:e.name,size:e.size,file:e});this.#p.value=``,this.close()});for(let e of[`dragenter`,`dragover`])this.#u.addEventListener(e,e=>{e.preventDefault(),this.#r||this.open(),this.setAttribute(`data-dropping`,``)});for(let e of[`dragleave`,`drop`])this.#u.addEventListener(e,t=>{t.preventDefault();let n=t;e===`dragleave`&&this.#u.contains(n.relatedTarget)||this.removeAttribute(`data-dropping`)});this.#u.addEventListener(`drop`,e=>{let t=e.dataTransfer?.files;if(t?.length){for(let e of Array.from(t))this.#B({kind:`upload`,name:e.name,size:e.size,file:e});this.close()}})}toggle(){this.#r?this.close():this.open()}#j(e){this.#l.replaceChildren(i(e?`x`:`plus`,{size:zn}))}open(){this.#r||(this.#r=!0,this.setAttribute(`data-open`,``),this.#c.setAttribute(`aria-expanded`,`true`),this.#j(!0),document.addEventListener(`mousedown`,this.#m),this.#i=``,this.#d.value=``,this.#a=0,this.#P(),requestAnimationFrame(()=>this.#d.focus()))}close(){this.#r&&(this.#r=!1,this.removeAttribute(`data-open`),this.removeAttribute(`data-dropping`),this.#c.setAttribute(`aria-expanded`,`false`),this.#j(!1),document.removeEventListener(`mousedown`,this.#m))}async#M(e){if(this.#n){let t=await this.#n(e);if(t)return t}return this.#t??Un}#N(e){let t=this.#i.trim().toLowerCase(),n=e=>!t||`${e.label} ${e.sub??``}`.toLowerCase().includes(t),r=[],i=this.#O();if(!t)for(let e of i)r.push({type:`quick`,data:e});else if(`upload take a photo screenshot share secret securely`.includes(t))for(let e of i)e.label.toLowerCase().includes(t)&&r.push({type:`quick`,data:e});for(let i of e){let e=i.entries.filter(n).slice(0,t?8:4);if(e.length){r.push({type:`sec`,label:i.label});for(let t of e)r.push({type:`row`,section:i,data:t})}}return r}async#P(){let e=++this.#s,t=await this.#M(this.#i.trim().toLowerCase());if(e!==this.#s)return;let n=this.#N(t);this.#o=[];let r=[],a=!1;for(let e of n)if(e.type===`sec`)a&&r.push(L(`div`,{class:`sep`})),r.push(L(`div`,{class:`sec`},e.label)),a=!1;else if(e.type===`quick`){let t=this.#o.length;this.#o.push(Kn(e.data));let n=L(`span`,{class:`tx`},L(`div`,{class:`lb`},e.data.label));e.data.sub&&n.append(L(`div`,{class:`sb`},e.data.sub)),r.push(L(`div`,{class:`item quick`,"data-i":t},L(`span`,{class:`ic`},i(e.data.icon,{size:Vn})),n)),a=!0}else{let t=this.#o.length;this.#o.push({kind:e.section.kind,id:e.data.id,label:e.data.label}),r.push(L(`div`,{class:`item`,"data-i":t},L(`span`,{class:`ic`},i(e.section.icon,{size:Vn})),L(`span`,{class:`tx`},L(`div`,{class:`lb`},e.data.label),L(`div`,{class:`sb`},e.data.sub??``))))}r.length?this.#f.replaceChildren(...r):this.#f.replaceChildren(L(`div`,{class:`empty`},`No matches for “${this.#i}”.`));for(let e of Array.from(this.#f.querySelectorAll(`.item`))){let t=Number(e.dataset.i);e.addEventListener(`mouseenter`,()=>this.#I(t)),e.addEventListener(`click`,()=>this.#z(t))}this.#a>=this.#o.length&&(this.#a=0),this.#F()}#F(){for(let e of Array.from(this.#f.querySelectorAll(`.item`)))e.classList.toggle(`active`,Number(e.dataset.i)===this.#a)}#I(e){this.#a=e,this.#F()}#L(e){if(!this.#o.length)return;this.#a=(this.#a+e+this.#o.length)%this.#o.length,this.#F();let t=this.#f.querySelector(`.item[data-i="${this.#a}"]`);t&&t.scrollIntoView({block:`nearest`})}#R(e){e.key===`ArrowDown`?(e.preventDefault(),this.#L(1)):e.key===`ArrowUp`?(e.preventDefault(),this.#L(-1)):e.key===`Enter`?(e.preventDefault(),this.#z(this.#a)):e.key===`Escape`&&(e.preventDefault(),this.close(),this.#c.focus())}#z(e){let t=this.#o[e];if(t){if(t.kind===`upload`){this.#p.click();return}this.#B(t),this.close()}}#B(e){this.dispatchEvent(new CustomEvent(`slicc-add`,{detail:e,bubbles:!0,composed:!0}))}});var qn=R(`
383
383
  :host {
384
384
  display: inline-grid;
385
385
  grid-auto-flow: column;
@@ -413,7 +413,7 @@ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./account-store-DZSDFG
413
413
  .glyph { display: grid; place-items: center; pointer-events: none; }
414
414
  .glyph svg { display: block; }
415
415
  .label { pointer-events: none; }
416
- `),qn=[{cue:`sent`,label:`Sent`,icon:`send`},{cue:`tool-start`,label:`Tool start`,icon:`play`},{cue:`tool-finish`,label:`Tool finish`,icon:`check`}],Jn=14;I(`slicc-soundboard`,class extends HTMLElement{#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Kn]}connectedCallback(){this.#i()}get audioContext(){return this.#t}#n(){return typeof AudioContext>`u`?null:((!this.#t||this.#t.state===`closed`)&&(this.#t=new AudioContext),this.#t)}#r(e){let t=this.#n();t&&(t.state===`suspended`&&t.resume(),M(t,e))}#i(){let e=qn.map(({cue:e,label:t,icon:n})=>{let r=i(n,{size:Jn,part:`icon`}),a=L(`button`,{type:`button`,class:`cue`,part:`button`,"data-cue":e,"aria-label":`Play ${t} cue`,title:`Play ${t} cue`},L(`span`,{class:`glyph`},r),L(`span`,{class:`label`,part:`label`},t));return a.addEventListener(`click`,()=>this.#r(e)),a});this.#e.replaceChildren(...e)}});var Yn=`
416
+ `),Jn=[{cue:`sent`,label:`Sent`,icon:`send`},{cue:`tool-start`,label:`Tool start`,icon:`play`},{cue:`tool-finish`,label:`Tool finish`,icon:`check`}],Yn=14;I(`slicc-soundboard`,class extends HTMLElement{#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[qn]}connectedCallback(){this.#i()}get audioContext(){return this.#t}#n(){return typeof AudioContext>`u`?null:((!this.#t||this.#t.state===`closed`)&&(this.#t=new AudioContext),this.#t)}#r(e){let t=this.#n();t&&(t.state===`suspended`&&t.resume(),ht(t,e))}#i(){let e=Jn.map(({cue:e,label:t,icon:n})=>{let r=i(n,{size:Yn,part:`icon`}),a=L(`button`,{type:`button`,class:`cue`,part:`button`,"data-cue":e,"aria-label":`Play ${t} cue`,title:`Play ${t} cue`},L(`span`,{class:`glyph`},r),L(`span`,{class:`label`,part:`label`},t));return a.addEventListener(`click`,()=>this.#r(e)),a});this.#e.replaceChildren(...e)}});var Xn=`
417
417
  slicc-action-card { display: block; }
418
418
 
419
419
  /* in-chat tool / terminal / git card (.tcard) */
@@ -531,7 +531,7 @@ slicc-action-card .prcard .pmeta {
531
531
  slicc-action-card .prcard .pmeta b { color: var(--ink); }
532
532
  slicc-action-card .prcard .pmeta .add { color: #1a7f37; }
533
533
  slicc-action-card .prcard .pmeta .del { color: #cf222e; }
534
- `,Xn=`slicc-action-card-style`;function Zn(e){if(e.getElementById(Xn))return;let t=e.createElement(`style`);t.id=Xn,t.textContent=Yn,(e.head??e.documentElement).appendChild(t)}var Qn=new Set([`tool`,`light`,`pr`]),$n=new Set([`ink`,`cy`,`vi`,`am`,`gh`]);I(`slicc-action-card`,class extends HTMLElement{static observedAttributes=[`variant`,`glyph`,`tone`,`title`,`badge`,`number`,`status`,`branch`,`files`,`add`,`del`,`checks`];#e=[];#t=!1;connectedCallback(){Zn(this.ownerDocument),this.classList.add(`slicc-action-card`),this.#a(),this.#n()}attributeChangedCallback(e,t,n){!this.isConnected||t===n||(this.#n(),e===`variant`&&this.dispatchEvent(new CustomEvent(`slicc-action-card-change`,{bubbles:!0,composed:!0,detail:{variant:this.variant}})))}get variant(){let e=this.getAttribute(`variant`);return e&&Qn.has(e)?e:`tool`}set variant(e){this.setAttribute(`variant`,Qn.has(e)?e:`tool`)}get glyph(){return this.getAttribute(`glyph`)}set glyph(e){e==null?this.removeAttribute(`glyph`):this.setAttribute(`glyph`,e)}get tone(){let e=this.getAttribute(`tone`);return e&&$n.has(e)?e:`ink`}set tone(e){this.setAttribute(`tone`,$n.has(e)?e:`ink`)}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get badge(){return this.getAttribute(`badge`)}set badge(e){e==null?this.removeAttribute(`badge`):this.setAttribute(`badge`,e)}get number(){return this.getAttribute(`number`)}set number(e){e==null?this.removeAttribute(`number`):this.setAttribute(`number`,e)}get status(){return this.getAttribute(`status`)}set status(e){e==null?this.removeAttribute(`status`):this.setAttribute(`status`,e)}get branch(){return this.getAttribute(`branch`)}set branch(e){e==null?this.removeAttribute(`branch`):this.setAttribute(`branch`,e)}get files(){return this.getAttribute(`files`)}set files(e){e==null?this.removeAttribute(`files`):this.setAttribute(`files`,e)}get add(){return this.getAttribute(`add`)}set add(e){e==null?this.removeAttribute(`add`):this.setAttribute(`add`,e)}get del(){return this.getAttribute(`del`)}set del(e){e==null?this.removeAttribute(`del`):this.setAttribute(`del`,e)}get checks(){return this.getAttribute(`checks`)}set checks(e){e==null?this.removeAttribute(`checks`):this.setAttribute(`checks`,e)}#n(){let e=this.variant;e===`pr`?this.#i():this.#r(e===`light`)}#r(e){let t=this.glyph,n=this.tone,r=this.title,i=this.badge,a=n===`ink`?`ic`:`ic ${n}`,o=L(`div`,{class:`th`,part:`header`});Ln(o,[L(`span`,{class:a,part:`icon`},t??null),` `,L(`span`,{class:`nm`,part:`title`},r),i==null?null:L(`span`,{class:`badge`,part:`badge`},i)]);let s=L(`div`,{class:`tb`,part:`body`});s.append(...this.#e);let c=L(`div`,{class:e?`tcard light`:`tcard`,part:`card`},o,s);this.replaceChildren(c)}#i(){let e=this.title,t=this.number,n=this.status??`Open`,r=this.branch,i=this.files,a=this.add,o=this.del,s=this.checks,c=L(`div`,{class:`ph`,part:`header`});Ln(c,[L(`span`,{class:`gi`,part:`icon`},`⎇`),L(`span`,{class:`pt`,part:`title`},e),t==null?null:L(`span`,{class:`pn`,part:`number`},t),L(`span`,{class:`open`,part:`status`},n)]);let l=L(`div`,{class:`pmeta`,part:`meta`}),u=this.#e.filter(e=>e instanceof HTMLElement&&e.getAttribute(`slot`)===`meta`);u.length>0?l.append(...u):Ln(l,[r==null?null:L(`span`,null,r),i==null?null:L(`span`,null,L(`b`,null,i),` files`),a==null?null:L(`span`,{class:`add`},`+${a}`),o==null?null:L(`span`,{class:`del`},`−${o}`),s==null?null:L(`span`,null,`checks `,L(`b`,{style:`color:#1a7f37`},s))]);let d=L(`div`,{class:`prcard`,part:`card`},c,l);this.replaceChildren(d)}#a(){this.#t||(this.#t=!0,this.#e=Array.from(this.childNodes))}});var er=`
534
+ `,Zn=`slicc-action-card-style`;function Qn(e){if(e.getElementById(Zn))return;let t=e.createElement(`style`);t.id=Zn,t.textContent=Xn,(e.head??e.documentElement).appendChild(t)}var $n=new Set([`tool`,`light`,`pr`]),er=new Set([`ink`,`cy`,`vi`,`am`,`gh`]);I(`slicc-action-card`,class extends HTMLElement{static observedAttributes=[`variant`,`glyph`,`tone`,`title`,`badge`,`number`,`status`,`branch`,`files`,`add`,`del`,`checks`];#e=[];#t=!1;connectedCallback(){Qn(this.ownerDocument),this.classList.add(`slicc-action-card`),this.#a(),this.#n()}attributeChangedCallback(e,t,n){!this.isConnected||t===n||(this.#n(),e===`variant`&&this.dispatchEvent(new CustomEvent(`slicc-action-card-change`,{bubbles:!0,composed:!0,detail:{variant:this.variant}})))}get variant(){let e=this.getAttribute(`variant`);return e&&$n.has(e)?e:`tool`}set variant(e){this.setAttribute(`variant`,$n.has(e)?e:`tool`)}get glyph(){return this.getAttribute(`glyph`)}set glyph(e){e==null?this.removeAttribute(`glyph`):this.setAttribute(`glyph`,e)}get tone(){let e=this.getAttribute(`tone`);return e&&er.has(e)?e:`ink`}set tone(e){this.setAttribute(`tone`,er.has(e)?e:`ink`)}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get badge(){return this.getAttribute(`badge`)}set badge(e){e==null?this.removeAttribute(`badge`):this.setAttribute(`badge`,e)}get number(){return this.getAttribute(`number`)}set number(e){e==null?this.removeAttribute(`number`):this.setAttribute(`number`,e)}get status(){return this.getAttribute(`status`)}set status(e){e==null?this.removeAttribute(`status`):this.setAttribute(`status`,e)}get branch(){return this.getAttribute(`branch`)}set branch(e){e==null?this.removeAttribute(`branch`):this.setAttribute(`branch`,e)}get files(){return this.getAttribute(`files`)}set files(e){e==null?this.removeAttribute(`files`):this.setAttribute(`files`,e)}get add(){return this.getAttribute(`add`)}set add(e){e==null?this.removeAttribute(`add`):this.setAttribute(`add`,e)}get del(){return this.getAttribute(`del`)}set del(e){e==null?this.removeAttribute(`del`):this.setAttribute(`del`,e)}get checks(){return this.getAttribute(`checks`)}set checks(e){e==null?this.removeAttribute(`checks`):this.setAttribute(`checks`,e)}#n(){let e=this.variant;e===`pr`?this.#i():this.#r(e===`light`)}#r(e){let t=this.glyph,n=this.tone,r=this.title,i=this.badge,a=n===`ink`?`ic`:`ic ${n}`,o=L(`div`,{class:`th`,part:`header`});Rn(o,[L(`span`,{class:a,part:`icon`},t??null),` `,L(`span`,{class:`nm`,part:`title`},r),i==null?null:L(`span`,{class:`badge`,part:`badge`},i)]);let s=L(`div`,{class:`tb`,part:`body`});s.append(...this.#e);let c=L(`div`,{class:e?`tcard light`:`tcard`,part:`card`},o,s);this.replaceChildren(c)}#i(){let e=this.title,t=this.number,n=this.status??`Open`,r=this.branch,i=this.files,a=this.add,o=this.del,s=this.checks,c=L(`div`,{class:`ph`,part:`header`});Rn(c,[L(`span`,{class:`gi`,part:`icon`},`⎇`),L(`span`,{class:`pt`,part:`title`},e),t==null?null:L(`span`,{class:`pn`,part:`number`},t),L(`span`,{class:`open`,part:`status`},n)]);let l=L(`div`,{class:`pmeta`,part:`meta`}),u=this.#e.filter(e=>e instanceof HTMLElement&&e.getAttribute(`slot`)===`meta`);u.length>0?l.append(...u):Rn(l,[r==null?null:L(`span`,null,r),i==null?null:L(`span`,null,L(`b`,null,i),` files`),a==null?null:L(`span`,{class:`add`},`+${a}`),o==null?null:L(`span`,{class:`del`},`−${o}`),s==null?null:L(`span`,null,`checks `,L(`b`,{style:`color:#1a7f37`},s))]);let d=L(`div`,{class:`prcard`,part:`card`},c,l);this.replaceChildren(d)}#a(){this.#t||(this.#t=!0,this.#e=Array.from(this.childNodes))}});var tr=`
535
535
  slicc-action-row {
536
536
  display: block;
537
537
  margin: -2px 0 16px;
@@ -631,7 +631,7 @@ slicc-action-row .vlink {
631
631
  slicc-action-row .vlink:hover {
632
632
  border-bottom-style: solid;
633
633
  }
634
- `,tr=`slicc-action-row-style`;function nr(e){if(e.getElementById(tr))return;let t=e.createElement(`style`);t.id=tr,t.textContent=er,(e.head??e.documentElement).appendChild(t)}var rr=new Set([`ink`,`vi`,`am`,`cy`,`gh`]);I(`slicc-action-row`,class extends HTMLElement{static observedAttributes=[`open`,`icon`,`tone`,`label`,`result`];#e;#t;#n;#r;#i;#a=!1;#o=()=>this.#s();connectedCallback(){nr(this.ownerDocument),this.#c(),this.#l(),this.#e?.addEventListener(`click`,this.#o)}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#o)}attributeChangedCallback(e,t,n){t===n||!this.#a||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-action-row-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#l())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get icon(){return this.getAttribute(`icon`)}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get tone(){let e=this.getAttribute(`tone`);return e&&rr.has(e)?e:`ink`}set tone(e){this.setAttribute(`tone`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get result(){return this.getAttribute(`result`)}set result(e){e==null?this.removeAttribute(`result`):this.setAttribute(`result`,e)}#s(){this.open=!this.open}#c(){if(this.#a)return;this.#a=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-act__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-act__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-act__head`,this.#e.setAttribute(`part`,`head`),this.#t=L(`span`,{class:`slicc-act__ic`,part:`icon`}),this.#n=L(`span`,{class:`slicc-act__label`,part:`label`}),this.#r=L(`span`,{class:`slicc-act__badge`,part:`badge`}),Ln(this.#e,[this.#t,this.#n,this.#r,L(`span`,{class:`slicc-act__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#i=this.ownerDocument.createElement(`div`),this.#i.className=`slicc-act__body`,this.#i.setAttribute(`part`,`body`);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`body`?this.#i.appendChild(t):this.#n.appendChild(t);this.replaceChildren(this.#e,this.#i),this.#e.addEventListener(`click`,this.#o)}#l(){if(!this.#a)return;let e=this.tone;this.#t.className=`slicc-act__ic${e===`ink`?``:` ${e}`}`;let t=this.icon??``;t&&a(t)?this.#t.replaceChildren(i(t,{size:12})):this.#t.textContent=t;let n=this.label;n!=null&&(this.#n.textContent=n),this.#e.setAttribute(`aria-expanded`,String(this.open)),this.#r.textContent=this.result??``}});var ir=`
634
+ `,nr=`slicc-action-row-style`;function rr(e){if(e.getElementById(nr))return;let t=e.createElement(`style`);t.id=nr,t.textContent=tr,(e.head??e.documentElement).appendChild(t)}var ir=new Set([`ink`,`vi`,`am`,`cy`,`gh`]);I(`slicc-action-row`,class extends HTMLElement{static observedAttributes=[`open`,`icon`,`tone`,`label`,`result`];#e;#t;#n;#r;#i;#a=!1;#o=()=>this.#s();connectedCallback(){rr(this.ownerDocument),this.#c(),this.#l(),this.#e?.addEventListener(`click`,this.#o)}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#o)}attributeChangedCallback(e,t,n){t===n||!this.#a||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-action-row-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#l())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get icon(){return this.getAttribute(`icon`)}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get tone(){let e=this.getAttribute(`tone`);return e&&ir.has(e)?e:`ink`}set tone(e){this.setAttribute(`tone`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get result(){return this.getAttribute(`result`)}set result(e){e==null?this.removeAttribute(`result`):this.setAttribute(`result`,e)}#s(){this.open=!this.open}#c(){if(this.#a)return;this.#a=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-act__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-act__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-act__head`,this.#e.setAttribute(`part`,`head`),this.#t=L(`span`,{class:`slicc-act__ic`,part:`icon`}),this.#n=L(`span`,{class:`slicc-act__label`,part:`label`}),this.#r=L(`span`,{class:`slicc-act__badge`,part:`badge`}),Rn(this.#e,[this.#t,this.#n,this.#r,L(`span`,{class:`slicc-act__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#i=this.ownerDocument.createElement(`div`),this.#i.className=`slicc-act__body`,this.#i.setAttribute(`part`,`body`);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`body`?this.#i.appendChild(t):this.#n.appendChild(t);this.replaceChildren(this.#e,this.#i),this.#e.addEventListener(`click`,this.#o)}#l(){if(!this.#a)return;let e=this.tone;this.#t.className=`slicc-act__ic${e===`ink`?``:` ${e}`}`;let t=this.icon??``;t&&a(t)?this.#t.replaceChildren(i(t,{size:12})):this.#t.textContent=t;let n=this.label;n!=null&&(this.#n.textContent=n),this.#e.setAttribute(`aria-expanded`,String(this.open)),this.#r.textContent=this.result??``}});var ar=`
635
635
  slicc-agent-message { display: block; margin-bottom: 18px; font-size: 15px; line-height: 1.5; --accent: color-mix(in srgb, var(--ctx) 55%, var(--ink)); }
636
636
  slicc-agent-message .msg-ts { font-family: var(--ui); font-size: 10px; color: var(--txt-3); opacity: .7; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
637
637
  /* Same containment the user bubble needs, for the same reason: an unbroken run
@@ -730,7 +730,7 @@ slicc-agent-message .dots i:nth-child(3) { animation-delay: .32s; }
730
730
  @keyframes slicc-am-bdot { 0%, 75%, 100% { transform: translateY(0); opacity: .45; } 38% { transform: translateY(-8px); opacity: 1; } }
731
731
  slicc-agent-message .tw-caret { display: inline-block; width: 2px; height: 1.05em; vertical-align: -2px; margin-left: 1px; background: var(--ink); animation: slicc-am-cblink .9s steps(1) infinite; }
732
732
  @keyframes slicc-am-cblink { 50% { opacity: 0; } }
733
- `,ar=`slicc-agent-message-style`;function or(e){if(e.getElementById(ar))return;let t=e.createElement(`style`);t.id=ar,t.textContent=ir,(e.head??e.documentElement).appendChild(t)}var sr=[`#f43f5e`,`#06b6d4`,`#8b5cf6`],cr=new Set([``,`r`,`cy`,`vi`,`am`]);function lr(){let e=L(`div`,{class:`dots`,part:`dots`,"aria-hidden":`true`});for(let t of sr)e.append(L(`i`,{style:`--d:${t}`}));return e}function ur(e){let t=L(`ul`,{class:`plan`,part:`plan`});for(let n of e)t.append(L(`li`,null,n));return t}function dr(e){let t=L(`ul`,{class:`check`,part:`check`});for(let n of e){let e=n.variant&&cr.has(n.variant)?n.variant:``,r=e?`ck ${e}`:`ck`,i=n.glyph??`✓`;t.append(L(`li`,null,L(`span`,{class:r},i),L(`span`,{class:`ctext`},n.text)))}return t}I(`slicc-agent-message`,class extends HTMLElement{static observedAttributes=[`thinking`,`streaming`,`progress`,`timestamp`];#e;#t=null;#n=null;#r=null;#i=!1;connectedCallback(){or(this.ownerDocument),this.#o(),this.#s(),this.#l()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||(e===`thinking`?(this.#s(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-thinking`,{bubbles:!0,composed:!0,detail:{thinking:n!==null}}))):e===`progress`?this.#c():e===`streaming`?(this.#l(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-streaming`,{bubbles:!0,composed:!0,detail:{streaming:n!==null}}))):e===`timestamp`&&this.#u())}get thinking(){return this.hasAttribute(`thinking`)}set thinking(e){e?this.setAttribute(`thinking`,``):this.removeAttribute(`thinking`)}get streaming(){return this.hasAttribute(`streaming`)}set streaming(e){e?this.setAttribute(`streaming`,``):this.removeAttribute(`streaming`)}get progress(){return this.getAttribute(`progress`)}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,e)}get body(){return this.#o(),this.#e}setBodyHtml(e){this.#o();let t=this.ownerDocument.createRange();t.selectNodeContents(this.#e),this.#a(t.createContextualFragment(e))}setPlan(e){this.#a(ur(e))}setCheck(e){this.#a(dr(e))}#a(e){this.#o(),this.#e.replaceChildren(e),this.#l()}#o(){if(this.#i)return;this.#i=!0,this.classList.add(`msg`,`bot`);let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`body`))),t=this.getAttribute(`timestamp`);if(t){let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.appendChild(e)}this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`body`,this.#e.setAttribute(`part`,`body`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}#s(){let e=this.thinking;this.classList.toggle(`thinkrow`,e),e?(this.#e.style.display=`none`,this.#t||(this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`thinkrow-row`,this.#t.appendChild(lr()),this.insertBefore(this.#t,this.#e)),this.#c()):(this.#e.style.removeProperty(`display`),this.#t&&(this.#t.remove(),this.#t=null,this.#n=null))}#c(){if(!this.#t)return;let e=this.progress;e?(this.#n||(this.#n=this.ownerDocument.createElement(`span`),this.#n.className=`progress`,this.#n.setAttribute(`part`,`progress`),this.#n.setAttribute(`aria-live`,`polite`),this.#t.appendChild(this.#n)),this.#n.textContent=e):this.#n&&=(this.#n.remove(),null)}#l(){this.streaming?this.#r?.isConnected?this.#e.appendChild(this.#r):(this.#r=this.ownerDocument.createElement(`span`),this.#r.className=`tw-caret`,this.#r.setAttribute(`part`,`caret`),this.#r.setAttribute(`aria-hidden`,`true`),this.#e.appendChild(this.#r)):this.#r&&=(this.#r.remove(),null)}#u(){let e=this.querySelector(`.msg-ts`),t=this.getAttribute(`timestamp`);if(t){if(e)e.textContent=t;else{let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.insertBefore(e,this.#e)}}else e?.remove()}});var fr=`
733
+ `,or=`slicc-agent-message-style`;function sr(e){if(e.getElementById(or))return;let t=e.createElement(`style`);t.id=or,t.textContent=ar,(e.head??e.documentElement).appendChild(t)}var cr=[`#f43f5e`,`#06b6d4`,`#8b5cf6`],lr=new Set([``,`r`,`cy`,`vi`,`am`]);function ur(){let e=L(`div`,{class:`dots`,part:`dots`,"aria-hidden":`true`});for(let t of cr)e.append(L(`i`,{style:`--d:${t}`}));return e}function dr(e){let t=L(`ul`,{class:`plan`,part:`plan`});for(let n of e)t.append(L(`li`,null,n));return t}function fr(e){let t=L(`ul`,{class:`check`,part:`check`});for(let n of e){let e=n.variant&&lr.has(n.variant)?n.variant:``,r=e?`ck ${e}`:`ck`,i=n.glyph??`✓`;t.append(L(`li`,null,L(`span`,{class:r},i),L(`span`,{class:`ctext`},n.text)))}return t}I(`slicc-agent-message`,class extends HTMLElement{static observedAttributes=[`thinking`,`streaming`,`progress`,`timestamp`];#e;#t=null;#n=null;#r=null;#i=!1;connectedCallback(){sr(this.ownerDocument),this.#o(),this.#s(),this.#l()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||(e===`thinking`?(this.#s(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-thinking`,{bubbles:!0,composed:!0,detail:{thinking:n!==null}}))):e===`progress`?this.#c():e===`streaming`?(this.#l(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-streaming`,{bubbles:!0,composed:!0,detail:{streaming:n!==null}}))):e===`timestamp`&&this.#u())}get thinking(){return this.hasAttribute(`thinking`)}set thinking(e){e?this.setAttribute(`thinking`,``):this.removeAttribute(`thinking`)}get streaming(){return this.hasAttribute(`streaming`)}set streaming(e){e?this.setAttribute(`streaming`,``):this.removeAttribute(`streaming`)}get progress(){return this.getAttribute(`progress`)}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,e)}get body(){return this.#o(),this.#e}setBodyHtml(e){this.#o();let t=this.ownerDocument.createRange();t.selectNodeContents(this.#e),this.#a(t.createContextualFragment(e))}setPlan(e){this.#a(dr(e))}setCheck(e){this.#a(fr(e))}#a(e){this.#o(),this.#e.replaceChildren(e),this.#l()}#o(){if(this.#i)return;this.#i=!0,this.classList.add(`msg`,`bot`);let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`body`))),t=this.getAttribute(`timestamp`);if(t){let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.appendChild(e)}this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`body`,this.#e.setAttribute(`part`,`body`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}#s(){let e=this.thinking;this.classList.toggle(`thinkrow`,e),e?(this.#e.style.display=`none`,this.#t||(this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`thinkrow-row`,this.#t.appendChild(ur()),this.insertBefore(this.#t,this.#e)),this.#c()):(this.#e.style.removeProperty(`display`),this.#t&&(this.#t.remove(),this.#t=null,this.#n=null))}#c(){if(!this.#t)return;let e=this.progress;e?(this.#n||(this.#n=this.ownerDocument.createElement(`span`),this.#n.className=`progress`,this.#n.setAttribute(`part`,`progress`),this.#n.setAttribute(`aria-live`,`polite`),this.#t.appendChild(this.#n)),this.#n.textContent=e):this.#n&&=(this.#n.remove(),null)}#l(){this.streaming?this.#r?.isConnected?this.#e.appendChild(this.#r):(this.#r=this.ownerDocument.createElement(`span`),this.#r.className=`tw-caret`,this.#r.setAttribute(`part`,`caret`),this.#r.setAttribute(`aria-hidden`,`true`),this.#e.appendChild(this.#r)):this.#r&&=(this.#r.remove(),null)}#u(){let e=this.querySelector(`.msg-ts`),t=this.getAttribute(`timestamp`);if(t){if(e)e.textContent=t;else{let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.insertBefore(e,this.#e)}}else e?.remove()}});var pr=`
734
734
  slicc-chat-table { display: block; }
735
735
  slicc-chat-table > .ctable {
736
736
  width: 100%;
@@ -771,7 +771,7 @@ slicc-chat-table > .ctable code {
771
771
  overflow-wrap: anywhere;
772
772
  word-break: break-word;
773
773
  }
774
- `,pr=`slicc-chat-table-style`;function mr(e){if(e.getElementById(pr))return;let t=e.createElement(`style`);t.id=pr,t.textContent=fr,(e.head??e.documentElement).appendChild(t)}function hr(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}I(`slicc-chat-table`,class extends HTMLElement{static observedAttributes=[`headers`];#e;#t;#n;#r=!1;connectedCallback(){mr(this.ownerDocument),this.#i()}attributeChangedCallback(e,t,n){e===`headers`&&t!==n&&(this.#r&&this.#a(),this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-chat-table-change`,{bubbles:!0,composed:!0,detail:{headers:this.headers}})))}get headers(){let e=this.getAttribute(`headers`);return e?hr(e):[]}set headers(e){e==null?this.removeAttribute(`headers`):Array.isArray(e)?this.setAttribute(`headers`,e.join(`,`)):this.setAttribute(`headers`,e)}#i(){if(this.#r)return;this.#r=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLTableElement&&e.classList.contains(`ctable`)));this.#e=this.ownerDocument.createElement(`table`),this.#e.className=`ctable`,this.#e.setAttribute(`part`,`table`),this.#t=this.ownerDocument.createElement(`thead`),this.#t.setAttribute(`part`,`head`),this.#n=this.ownerDocument.createElement(`tbody`),this.#n.setAttribute(`part`,`body`),this.#e.append(this.#t,this.#n);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`head`?this.#t.appendChild(t):this.#n.appendChild(t);this.#a(),this.appendChild(this.#e)}#a(){if(!this.#r)return;let e=this.#t.querySelector(`tr`);if(e&&!e.hasAttribute(`data-slicc-generated`))return;let t=this.headers;if(t.length===0){this.#t.replaceChildren();return}let n=L(`tr`,{"data-slicc-generated":``});for(let e of t)n.append(L(`th`,null,e));this.#t.replaceChildren(n)}});function gr(e){if(typeof window>`u`||!window.location)return null;try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function _r(e,t,n={}){if(!(typeof window>`u`||!window.history?.replaceState))try{let r=new URL(window.location.href),i=r.searchParams.get(e);if(i===t||i===null&&(t===null||t===``))return;t==null||t===``?r.searchParams.delete(e):r.searchParams.set(e,t),n.push?window.history.pushState(window.history.state,``,r):window.history.replaceState(window.history.state,``,r)}catch{}}var vr=`
774
+ `,mr=`slicc-chat-table-style`;function hr(e){if(e.getElementById(mr))return;let t=e.createElement(`style`);t.id=mr,t.textContent=pr,(e.head??e.documentElement).appendChild(t)}function gr(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}I(`slicc-chat-table`,class extends HTMLElement{static observedAttributes=[`headers`];#e;#t;#n;#r=!1;connectedCallback(){hr(this.ownerDocument),this.#i()}attributeChangedCallback(e,t,n){e===`headers`&&t!==n&&(this.#r&&this.#a(),this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-chat-table-change`,{bubbles:!0,composed:!0,detail:{headers:this.headers}})))}get headers(){let e=this.getAttribute(`headers`);return e?gr(e):[]}set headers(e){e==null?this.removeAttribute(`headers`):Array.isArray(e)?this.setAttribute(`headers`,e.join(`,`)):this.setAttribute(`headers`,e)}#i(){if(this.#r)return;this.#r=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLTableElement&&e.classList.contains(`ctable`)));this.#e=this.ownerDocument.createElement(`table`),this.#e.className=`ctable`,this.#e.setAttribute(`part`,`table`),this.#t=this.ownerDocument.createElement(`thead`),this.#t.setAttribute(`part`,`head`),this.#n=this.ownerDocument.createElement(`tbody`),this.#n.setAttribute(`part`,`body`),this.#e.append(this.#t,this.#n);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`head`?this.#t.appendChild(t):this.#n.appendChild(t);this.#a(),this.appendChild(this.#e)}#a(){if(!this.#r)return;let e=this.#t.querySelector(`tr`);if(e&&!e.hasAttribute(`data-slicc-generated`))return;let t=this.headers;if(t.length===0){this.#t.replaceChildren();return}let n=L(`tr`,{"data-slicc-generated":``});for(let e of t)n.append(L(`th`,null,e));this.#t.replaceChildren(n)}});function _r(e){if(typeof window>`u`||!window.location)return null;try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function vr(e,t,n={}){if(!(typeof window>`u`||!window.history?.replaceState))try{let r=new URL(window.location.href),i=r.searchParams.get(e);if(i===t||i===null&&(t===null||t===``))return;t==null||t===``?r.searchParams.delete(e):r.searchParams.set(e,t),n.push?window.history.pushState(window.history.state,``,r):window.history.replaceState(window.history.state,``,r)}catch{}}var yr=`
775
775
  slicc-chat-thread {
776
776
  flex: 1 1 auto;
777
777
  display: block;
@@ -869,7 +869,7 @@ slicc-chat-thread[open] > .slicc-thread__inner {
869
869
  padding: 16px 14px;
870
870
  }
871
871
  }
872
- `,yr=`slicc-chat-thread-style`,br=120;function xr(e){if(e.getElementById(yr))return;let t=e.createElement(`style`);t.id=yr,t.textContent=vr,(e.head??e.documentElement).appendChild(t)}I(`slicc-chat-thread`,class e extends HTMLElement{static observedAttributes=[`open`,`context`,`accent`,`url-state`];#e;#t=!1;#n=null;#r=null;#i=null;#a=!1;#o=!1;#s=0;#c=null;#l=null;#u=null;#d=null;#f=null;#p=()=>{this.#d=null,this.#f=performance.now(),_r(`at`,String(Math.round(this.scrollTop)))};#m=()=>{if(!this.urlState)return;let e=this.#f==null?br:performance.now()-this.#f;if(e>=br){this.#d!=null&&clearTimeout(this.#d),this.#p();return}this.#d??=setTimeout(this.#p,br-e)};#h=()=>{if(!this.urlState)return;let e=gr(`ctx`);if(e&&e!==this.context)this.dispatchEvent(new CustomEvent(`slicc-url-context`,{bubbles:!0,composed:!0,detail:{context:e}}));else{let e=gr(`at`);e!=null&&(this.scrollTop=Number.parseInt(e,10)||0)}};#g=null;#_=new Map;connectedCallback(){xr(this.ownerDocument),this.#E(),this.#T(),this.#b(),this.scrollToBottom(),this.urlState&&(this.#r=gr(`at`),this.#i=gr(`ctx`),this.addEventListener(`scroll`,this.#m,{passive:!0}),window.addEventListener(`popstate`,this.#h))}disconnectedCallback(){this.#n&&=(this.#e?.removeEventListener(`click`,this.#n),null),this.removeEventListener(`scroll`,this.#m),window.removeEventListener(`popstate`,this.#h),this.#d!=null&&(clearTimeout(this.#d),this.#d=null),this.#f=null,this.#u?.disconnect(),this.#u=null,this.#C()}attributeChangedCallback(e,t,n){t!==n&&(e===`accent`&&this.#t&&this.#T(),e===`open`&&this.#t&&this.isConnected&&this.#x(),e===`context`&&this.urlState&&n!=null&&this.isConnected&&(n!==this.#i&&(this.#r=null),_r(`ctx`,n,{push:!0})))}get urlState(){return this.hasAttribute(`url-state`)}set urlState(e){this.toggleAttribute(`url-state`,e)}get urlContext(){return this.urlState?gr(`ctx`):null}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get context(){return this.getAttribute(`context`)}set context(e){e==null?this.removeAttribute(`context`):this.setAttribute(`context`,e)}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get inner(){return this.#E(),this.#e}switchContext(e){this.#E();let t=this.context;if(e===t)return;t!=null&&this.#_.set(t,this.#w());let n=this.#_.get(e);this.#e.replaceChildren(...n?Array.from(n.cloneNode(!0).childNodes):[]),this.context=e,this.removeAttribute(`has-new`),this.dispatchEvent(new CustomEvent(`slicc-context-change`,{bubbles:!0,composed:!0,detail:{context:e,previous:t}})),this.scrollToBottom()}append(...e){this.#E(),e.length>0&&(this.#r=null),this.#e.append(...e),this.requestFollow()}static FOLLOW_SLACK=80;#v(){return this.scrollHeight-this.scrollTop-this.clientHeight<=e.FOLLOW_SLACK}requestFollow(){this.#E(),this.#a?(this.#S(this.scrollHeight),this.removeAttribute(`has-new`)):this.setAttribute(`has-new`,``)}#y=()=>{if(this.#o&&Math.abs(this.scrollTop-this.#s)<=1){this.#C();return}this.#C(),this.#a=this.#v(),this.#a&&this.removeAttribute(`has-new`)};replaceContent(...e){this.#E(),this.#e.replaceChildren(...e),this.removeAttribute(`has-new`),this.scrollToBottom();let t=this.#r;t!=null&&e.length>0&&requestAnimationFrame(()=>{this.#r===t&&(this.#a=!1,this.#S(Number.parseInt(t,10)||0),this.#a=this.#v())})}scrollToBottom(){this.#a=!0,this.removeAttribute(`has-new`),this.#S(this.scrollHeight)}#b(){this.#u?.disconnect(),typeof ResizeObserver==`function`&&(this.#u=new ResizeObserver(()=>this.#x()),this.#u.observe(this.#e))}#x(){if(!this.#a)return;let t=this.#s-this.scrollTop;this.#o&&t>e.FOLLOW_SLACK||this.#S(this.scrollHeight)}#S(e){this.#o=!0,this.scrollTop=e,this.#s=this.scrollTop,this.#c!=null&&cancelAnimationFrame(this.#c),this.#l!=null&&clearTimeout(this.#l),`onscrollend`in HTMLElement.prototype?this.#l=setTimeout(()=>this.#C(),100):this.#c=requestAnimationFrame(()=>this.#C())}#C(){this.#o=!1,this.#c!=null&&cancelAnimationFrame(this.#c),this.#c=null,this.#l!=null&&clearTimeout(this.#l),this.#l=null}#w(){let e=this.ownerDocument.createDocumentFragment();for(let t of Array.from(this.#e.childNodes))e.appendChild(t.cloneNode(!0));return e}#T(){let e=this.accent;e?this.style.setProperty(`--ctx`,e):this.style.removeProperty(`--ctx`)}#E(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-thread__inner`);if(e instanceof HTMLElement)this.#e=e;else{let e=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-thread__inner`,this.#e.setAttribute(`part`,`inner`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}this.#g=this.ownerDocument.createElement(`div`),this.#g.className=`slicc-thread__follow`;let t=this.ownerDocument.createElement(`button`);t.type=`button`;let n=i(`chevron-down`,{size:14,strokeWidth:2});t.append(`New messages`,n),t.addEventListener(`click`,()=>{this.scrollToBottom()}),this.#g.append(t),this.appendChild(this.#g),this.addEventListener(`scroll`,this.#y,{passive:!0}),this.addEventListener(`scrollend`,()=>this.#C(),{passive:!0}),this.#n=e=>{let t=e.target;t instanceof HTMLElement&&this.dispatchEvent(new CustomEvent(`slicc-thread-action`,{bubbles:!0,composed:!0,detail:{target:t}}))},this.#e.addEventListener(`click`,this.#n)}});var Sr=R(`
872
+ `,br=`slicc-chat-thread-style`,xr=120;function Sr(e){if(e.getElementById(br))return;let t=e.createElement(`style`);t.id=br,t.textContent=yr,(e.head??e.documentElement).appendChild(t)}I(`slicc-chat-thread`,class e extends HTMLElement{static observedAttributes=[`open`,`context`,`accent`,`url-state`];#e;#t=!1;#n=null;#r=null;#i=null;#a=!1;#o=!1;#s=0;#c=null;#l=null;#u=null;#d=null;#f=null;#p=()=>{this.#d=null,this.#f=performance.now(),vr(`at`,String(Math.round(this.scrollTop)))};#m=()=>{if(!this.urlState)return;let e=this.#f==null?xr:performance.now()-this.#f;if(e>=xr){this.#d!=null&&clearTimeout(this.#d),this.#p();return}this.#d??=setTimeout(this.#p,xr-e)};#h=()=>{if(!this.urlState)return;let e=_r(`ctx`);if(e&&e!==this.context)this.dispatchEvent(new CustomEvent(`slicc-url-context`,{bubbles:!0,composed:!0,detail:{context:e}}));else{let e=_r(`at`);e!=null&&(this.scrollTop=Number.parseInt(e,10)||0)}};#g=null;#_=new Map;connectedCallback(){Sr(this.ownerDocument),this.#E(),this.#T(),this.#b(),this.scrollToBottom(),this.urlState&&(this.#r=_r(`at`),this.#i=_r(`ctx`),this.addEventListener(`scroll`,this.#m,{passive:!0}),window.addEventListener(`popstate`,this.#h))}disconnectedCallback(){this.#n&&=(this.#e?.removeEventListener(`click`,this.#n),null),this.removeEventListener(`scroll`,this.#m),window.removeEventListener(`popstate`,this.#h),this.#d!=null&&(clearTimeout(this.#d),this.#d=null),this.#f=null,this.#u?.disconnect(),this.#u=null,this.#C()}attributeChangedCallback(e,t,n){t!==n&&(e===`accent`&&this.#t&&this.#T(),e===`open`&&this.#t&&this.isConnected&&this.#x(),e===`context`&&this.urlState&&n!=null&&this.isConnected&&(n!==this.#i&&(this.#r=null),vr(`ctx`,n,{push:!0})))}get urlState(){return this.hasAttribute(`url-state`)}set urlState(e){this.toggleAttribute(`url-state`,e)}get urlContext(){return this.urlState?_r(`ctx`):null}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get context(){return this.getAttribute(`context`)}set context(e){e==null?this.removeAttribute(`context`):this.setAttribute(`context`,e)}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get inner(){return this.#E(),this.#e}switchContext(e){this.#E();let t=this.context;if(e===t)return;t!=null&&this.#_.set(t,this.#w());let n=this.#_.get(e);this.#e.replaceChildren(...n?Array.from(n.cloneNode(!0).childNodes):[]),this.context=e,this.removeAttribute(`has-new`),this.dispatchEvent(new CustomEvent(`slicc-context-change`,{bubbles:!0,composed:!0,detail:{context:e,previous:t}})),this.scrollToBottom()}append(...e){this.#E(),e.length>0&&(this.#r=null),this.#e.append(...e),this.requestFollow()}static FOLLOW_SLACK=80;#v(){return this.scrollHeight-this.scrollTop-this.clientHeight<=e.FOLLOW_SLACK}requestFollow(){this.#E(),this.#a?(this.#S(this.scrollHeight),this.removeAttribute(`has-new`)):this.setAttribute(`has-new`,``)}#y=()=>{if(this.#o&&Math.abs(this.scrollTop-this.#s)<=1){this.#C();return}this.#C(),this.#a=this.#v(),this.#a&&this.removeAttribute(`has-new`)};replaceContent(...e){this.#E(),this.#e.replaceChildren(...e),this.removeAttribute(`has-new`),this.scrollToBottom();let t=this.#r;t!=null&&e.length>0&&requestAnimationFrame(()=>{this.#r===t&&(this.#a=!1,this.#S(Number.parseInt(t,10)||0),this.#a=this.#v())})}scrollToBottom(){this.#a=!0,this.removeAttribute(`has-new`),this.#S(this.scrollHeight)}#b(){this.#u?.disconnect(),typeof ResizeObserver==`function`&&(this.#u=new ResizeObserver(()=>this.#x()),this.#u.observe(this.#e))}#x(){if(!this.#a)return;let t=this.#s-this.scrollTop;this.#o&&t>e.FOLLOW_SLACK||this.#S(this.scrollHeight)}#S(e){this.#o=!0,this.scrollTop=e,this.#s=this.scrollTop,this.#c!=null&&cancelAnimationFrame(this.#c),this.#l!=null&&clearTimeout(this.#l),`onscrollend`in HTMLElement.prototype?this.#l=setTimeout(()=>this.#C(),100):this.#c=requestAnimationFrame(()=>this.#C())}#C(){this.#o=!1,this.#c!=null&&cancelAnimationFrame(this.#c),this.#c=null,this.#l!=null&&clearTimeout(this.#l),this.#l=null}#w(){let e=this.ownerDocument.createDocumentFragment();for(let t of Array.from(this.#e.childNodes))e.appendChild(t.cloneNode(!0));return e}#T(){let e=this.accent;e?this.style.setProperty(`--ctx`,e):this.style.removeProperty(`--ctx`)}#E(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-thread__inner`);if(e instanceof HTMLElement)this.#e=e;else{let e=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-thread__inner`,this.#e.setAttribute(`part`,`inner`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}this.#g=this.ownerDocument.createElement(`div`),this.#g.className=`slicc-thread__follow`;let t=this.ownerDocument.createElement(`button`);t.type=`button`;let n=i(`chevron-down`,{size:14,strokeWidth:2});t.append(`New messages`,n),t.addEventListener(`click`,()=>{this.scrollToBottom()}),this.#g.append(t),this.appendChild(this.#g),this.addEventListener(`scroll`,this.#y,{passive:!0}),this.addEventListener(`scrollend`,()=>this.#C(),{passive:!0}),this.#n=e=>{let t=e.target;t instanceof HTMLElement&&this.dispatchEvent(new CustomEvent(`slicc-thread-action`,{bubbles:!0,composed:!0,detail:{target:t}}))},this.#e.addEventListener(`click`,this.#n)}});var Cr=R(`
873
873
  :host {
874
874
  display: flex;
875
875
  align-items: center;
@@ -958,7 +958,7 @@ slicc-chat-thread[open] > .slicc-thread__inner {
958
958
  opacity: .8;
959
959
  }
960
960
  .path:hover, .path:focus-visible { opacity: 1; }
961
- `),Cr=[`threshold`,`overflow`,`idle`],wr=[`summarizing`,`summarized`,`fallback`],Tr={summarizing:`loader`,summarized:`archive`,fallback:`triangle-alert`},Er={summarizing:{idle:`Idle — compacting history in the background`,threshold:`Context filling up — compacting history`,overflow:`Context overflowed — compacting history`},summarized:{idle:`Compacted while idle`,threshold:`History compacted`,overflow:`Context overflowed — history compacted`},fallback:{idle:`Summary unavailable — older messages truncated`,threshold:`Summary unavailable — older messages truncated`,overflow:`Summary unavailable — older messages truncated`}};function Dr(e){return Cr.includes(e??``)?e:`threshold`}function Or(e){return wr.includes(e??``)?e:`summarized`}function kr(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}I(`slicc-compaction-marker`,class extends HTMLElement{static observedAttributes=[`trigger`,`state`,`transcript`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Sr]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get trigger(){return Dr(this.getAttribute(`trigger`))}set trigger(e){this.setAttribute(`trigger`,Dr(e))}get state(){return Or(this.getAttribute(`state`))}set state(e){this.setAttribute(`state`,Or(e))}get transcript(){return this.getAttribute(`transcript`)}set transcript(e){e==null?this.removeAttribute(`transcript`):this.setAttribute(`transcript`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.state,t=this.trigger;this.getAttribute(`state`)!==e&&this.setAttribute(`state`,e),this.getAttribute(`trigger`)!==t&&this.setAttribute(`trigger`,t);let n=this.label??Er[e][t],r=L(`span`,{class:`chip`,part:`chip`},L(`span`,{class:`glyph`,part:`glyph`},i(Tr[e],{size:12})),L(`span`,{class:`label`,part:`label`},n)),a=this.transcript;if(a){let e=L(`button`,{class:`path`,part:`path`,type:`button`,title:a,"aria-label":`Open the pre-compaction transcript ${a}`},kr(a));e.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`slicc-compaction-transcript`,{detail:{path:a},bubbles:!0,composed:!0}))}),r.append(e)}this.#e.replaceChildren(r),this.hasAttribute(`role`)||this.setAttribute(`role`,`status`)}});var Ar=R(`
961
+ `),wr=[`threshold`,`overflow`,`idle`],Tr=[`summarizing`,`summarized`,`fallback`],Er={summarizing:`loader`,summarized:`archive`,fallback:`triangle-alert`},Dr={summarizing:{idle:`Idle — compacting history in the background`,threshold:`Context filling up — compacting history`,overflow:`Context overflowed — compacting history`},summarized:{idle:`Compacted while idle`,threshold:`History compacted`,overflow:`Context overflowed — history compacted`},fallback:{idle:`Summary unavailable — older messages truncated`,threshold:`Summary unavailable — older messages truncated`,overflow:`Summary unavailable — older messages truncated`}};function Or(e){return wr.includes(e??``)?e:`threshold`}function kr(e){return Tr.includes(e??``)?e:`summarized`}function Ar(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}I(`slicc-compaction-marker`,class extends HTMLElement{static observedAttributes=[`trigger`,`state`,`transcript`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Cr]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get trigger(){return Or(this.getAttribute(`trigger`))}set trigger(e){this.setAttribute(`trigger`,Or(e))}get state(){return kr(this.getAttribute(`state`))}set state(e){this.setAttribute(`state`,kr(e))}get transcript(){return this.getAttribute(`transcript`)}set transcript(e){e==null?this.removeAttribute(`transcript`):this.setAttribute(`transcript`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.state,t=this.trigger;this.getAttribute(`state`)!==e&&this.setAttribute(`state`,e),this.getAttribute(`trigger`)!==t&&this.setAttribute(`trigger`,t);let n=this.label??Dr[e][t],r=L(`span`,{class:`chip`,part:`chip`},L(`span`,{class:`glyph`,part:`glyph`},i(Er[e],{size:12})),L(`span`,{class:`label`,part:`label`},n)),a=this.transcript;if(a){let e=L(`button`,{class:`path`,part:`path`,type:`button`,title:a,"aria-label":`Open the pre-compaction transcript ${a}`},Ar(a));e.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`slicc-compaction-transcript`,{detail:{path:a},bubbles:!0,composed:!0}))}),r.append(e)}this.#e.replaceChildren(r),this.hasAttribute(`role`)||this.setAttribute(`role`,`status`)}});var jr=R(`
962
962
  :host {
963
963
  display: flex;
964
964
  align-items: center;
@@ -996,7 +996,7 @@ code {
996
996
  overflow-wrap: anywhere;
997
997
  word-break: break-word;
998
998
  }
999
- `),jr=[`feed`,`scoop`,`drop`,`sprinkle`],Mr={feed:`arrow-right`,scoop:`circle-plus`,drop:`circle-check`,sprinkle:`sparkles`},Nr={feed:`Delegated to`,scoop:`Spun up`,drop:`Wrapped up`,sprinkle:``},Pr={feed_scoop:`Delegated to`,scoop_scoop:`Spun up`,drop_scoop:`Wrapped up`,"sprinkle-opened":`Opened`};function Fr(e){return Pr[e]??e}function Ir(e){return jr.includes(e??``)?e:`feed`}function Lr(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}I(`slicc-delegation-line`,class extends HTMLElement{static observedAttributes=[`kind`,`hue`,`verb`,`scoop`,`label`,`args`,`source`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ar]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get kind(){return Ir(this.getAttribute(`kind`))}set kind(e){this.setAttribute(`kind`,Ir(e))}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get verb(){return this.getAttribute(`verb`)}set verb(e){e==null?this.removeAttribute(`verb`):this.setAttribute(`verb`,e)}get scoop(){return this.getAttribute(`scoop`)}set scoop(e){e==null?this.removeAttribute(`scoop`):this.setAttribute(`scoop`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get args(){return this.getAttribute(`args`)}set args(e){e==null?this.removeAttribute(`args`):this.setAttribute(`args`,e)}get source(){return this.hasAttribute(`source`)}set source(e){this.toggleAttribute(`source`,e)}#t(){let e=this.kind,t=this.hue,n=this.verb,r=n==null?Nr[e]:Fr(n),a=this.scoop,o=this.label,s=this.args?Lr(this.args):[];t?this.style.setProperty(`--c`,t):this.style.removeProperty(`--c`);let c=L(`span`,{class:`darrow`,part:`arrow`},L(`slot`,{name:`arrow`},i(Mr[e],{size:13}))),l=L(`slot`,{name:`label`});r&&l.append(L(`span`,{class:`verb`},r)),a&&l.append(L(`b`,{class:`scoop`,part:`scoop`,style:t?`color:${t}`:void 0},a)),o&&l.append(L(`span`,{class:`prose`},o));let u=L(`span`,{class:`label`,part:`label`},l),d=L(`slot`,{name:`args`});for(let e of s)d.append(L(`code`,{part:`code`},e));this.#e.replaceChildren(c,u,d)}});var Rr=R(`
999
+ `),Mr=[`feed`,`scoop`,`drop`,`sprinkle`],Nr={feed:`arrow-right`,scoop:`circle-plus`,drop:`circle-check`,sprinkle:`sparkles`},Pr={feed:`Delegated to`,scoop:`Spun up`,drop:`Wrapped up`,sprinkle:``},Fr={feed_scoop:`Delegated to`,scoop_scoop:`Spun up`,drop_scoop:`Wrapped up`,"sprinkle-opened":`Opened`};function Ir(e){return Fr[e]??e}function Lr(e){return Mr.includes(e??``)?e:`feed`}function Rr(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}I(`slicc-delegation-line`,class extends HTMLElement{static observedAttributes=[`kind`,`hue`,`verb`,`scoop`,`label`,`args`,`source`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[jr]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get kind(){return Lr(this.getAttribute(`kind`))}set kind(e){this.setAttribute(`kind`,Lr(e))}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get verb(){return this.getAttribute(`verb`)}set verb(e){e==null?this.removeAttribute(`verb`):this.setAttribute(`verb`,e)}get scoop(){return this.getAttribute(`scoop`)}set scoop(e){e==null?this.removeAttribute(`scoop`):this.setAttribute(`scoop`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get args(){return this.getAttribute(`args`)}set args(e){e==null?this.removeAttribute(`args`):this.setAttribute(`args`,e)}get source(){return this.hasAttribute(`source`)}set source(e){this.toggleAttribute(`source`,e)}#t(){let e=this.kind,t=this.hue,n=this.verb,r=n==null?Pr[e]:Ir(n),a=this.scoop,o=this.label,s=this.args?Rr(this.args):[];t?this.style.setProperty(`--c`,t):this.style.removeProperty(`--c`);let c=L(`span`,{class:`darrow`,part:`arrow`},L(`slot`,{name:`arrow`},i(Nr[e],{size:13}))),l=L(`slot`,{name:`label`});r&&l.append(L(`span`,{class:`verb`},r)),a&&l.append(L(`b`,{class:`scoop`,part:`scoop`,style:t?`color:${t}`:void 0},a)),o&&l.append(L(`span`,{class:`prose`},o));let u=L(`span`,{class:`label`,part:`label`},l),d=L(`slot`,{name:`args`});for(let e of s)d.append(L(`code`,{part:`code`},e));this.#e.replaceChildren(c,u,d)}});var zr=R(`
1000
1000
  :host {
1001
1001
  display: block;
1002
1002
  border: 1px solid var(--line);
@@ -1022,7 +1022,7 @@ code {
1022
1022
  /* palette chips carry inline-style light backgrounds — tone them down for dark mode */
1023
1023
  :host-context(.dark) .ch,
1024
1024
  :host-context([data-theme="dark"]) .ch { filter: brightness(.55) saturate(.85); }
1025
- `);I(`slicc-palette-cell`,class extends HTMLElement{static observedAttributes=[`color`,`label`,`group`,`selected`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Rr]}connectedCallback(){this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.setAttribute(`role`,`button`),this.#o(),this.#i()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#o()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get group(){return this.getAttribute(`group`)}set group(e){e==null?this.removeAttribute(`group`):this.setAttribute(`group`,e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,e)}select(){this.#r(),this.selected=!0,this.dispatchEvent(new CustomEvent(`palette-select`,{bubbles:!0,composed:!0,detail:{color:this.color,label:this.label,group:this.group}}))}#r(){let e=this.group;if(!e)return;let t=this.getRootNode().querySelectorAll(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);for(let e of t)e!==this&&(e.selected=!1)}#i(){this.#t||(this.#t=()=>this.select(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.select())},this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n))}#a(){this.#t&&this.removeEventListener(`click`,this.#t),this.#n&&this.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}#o(){this.setAttribute(`aria-pressed`,this.selected?`true`:`false`);let e=this.color??`transparent`,t=this.label,n=L(`div`,{class:`ch`,part:`chip`,style:`background:${e}`}),r=L(`div`,{class:`cl`,part:`label`},t??L(`slot`));this.#e.replaceChildren(n,r)}});var zr=[`#f43f5e`,`#f59e0b`,`#06b6d4`,`#8b5cf6`,`#ec4899`,`#22c55e`],Br=46,Vr=72,Hr=6.283185;function Ur(e,t){return e+Math.random()*(t-e)}var Wr=[{color:`#faf6f1`,label:`paper`},{color:`#fff7ed`,label:`cream`},{color:`#f5f3ff`,label:`lilac`},{color:`#fef2f2`,label:`blush`}],Gr=[{color:`#8b5cf6`,label:`violet`},{color:`#f43f5e`,label:`rose`},{color:`#06b6d4`,label:`cyan`},{color:`#ef7000`,label:`cone`}],Kr=0,qr=R(`
1025
+ `);I(`slicc-palette-cell`,class extends HTMLElement{static observedAttributes=[`color`,`label`,`group`,`selected`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[zr]}connectedCallback(){this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.setAttribute(`role`,`button`),this.#o(),this.#i()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#o()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get group(){return this.getAttribute(`group`)}set group(e){e==null?this.removeAttribute(`group`):this.setAttribute(`group`,e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,e)}select(){this.#r(),this.selected=!0,this.dispatchEvent(new CustomEvent(`palette-select`,{bubbles:!0,composed:!0,detail:{color:this.color,label:this.label,group:this.group}}))}#r(){let e=this.group;if(!e)return;let t=this.getRootNode().querySelectorAll(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);for(let e of t)e!==this&&(e.selected=!1)}#i(){this.#t||(this.#t=()=>this.select(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.select())},this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n))}#a(){this.#t&&this.removeEventListener(`click`,this.#t),this.#n&&this.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}#o(){this.setAttribute(`aria-pressed`,this.selected?`true`:`false`);let e=this.color??`transparent`,t=this.label,n=L(`div`,{class:`ch`,part:`chip`,style:`background:${e}`}),r=L(`div`,{class:`cl`,part:`label`},t??L(`slot`));this.#e.replaceChildren(n,r)}});var Br=[`#f43f5e`,`#f59e0b`,`#06b6d4`,`#8b5cf6`,`#ec4899`,`#22c55e`],Vr=46,Hr=72,Ur=6.283185;function Wr(e,t){return e+Math.random()*(t-e)}var Gr=[{color:`#faf6f1`,label:`paper`},{color:`#fff7ed`,label:`cream`},{color:`#f5f3ff`,label:`lilac`},{color:`#fef2f2`,label:`blush`}],Kr=[{color:`#8b5cf6`,label:`violet`},{color:`#f43f5e`,label:`rose`},{color:`#06b6d4`,label:`cyan`},{color:`#ef7000`,label:`cone`}],qr=0,Jr=R(`
1026
1026
  :host {
1027
1027
  position: relative;
1028
1028
  display: block;
@@ -1109,7 +1109,7 @@ canvas.sprk {
1109
1109
  @media (prefers-reduced-motion: reduce) {
1110
1110
  canvas.sprk { display: none; }
1111
1111
  }
1112
- `);I(`slicc-dip`,class extends HTMLElement{static observedAttributes=[`name`,`hue`,`prompt`];#e;#t=`d${++Kr}`;#n=null;#r=null;#i=0;#a=null;#o=[];#s=0;#c=0;#l=-999;#u=-999;#d=null;#f=null;#p=null;#m=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[qr]}connectedCallback(){this.#v(),this.#b(),this.#w()}disconnectedCallback(){this.#T(),this.#x()}attributeChangedCallback(){this.isConnected&&(this.#v(),this.#b(),this.#w())}get name(){return this.getAttribute(`name`)??`palette.shtml`}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get prompt(){return this.getAttribute(`prompt`)}set prompt(e){e==null?this.removeAttribute(`prompt`):this.setAttribute(`prompt`,e)}get selectedCanvas(){return this.#h(`canvas:${this.#t}`)}get selectedAccent(){return this.#h(`accent:${this.#t}`)}#h(e){let t=this.querySelector(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);return t?{color:t.getAttribute(`color`)??``,label:t.getAttribute(`label`)??``}:null}#g(e,t,n){let r=e.startsWith(`canvas`)?`canvas`:`accent`;if(!this.querySelector(`slicc-palette-cell[slot="${r}"]`))for(let i of t){let t=this.ownerDocument.createElement(`slicc-palette-cell`);t.setAttribute(`slot`,r),t.setAttribute(`color`,i.color),t.setAttribute(`label`,i.label),t.setAttribute(`group`,e),i.label===n&&t.setAttribute(`selected`,``),this.appendChild(t)}}#_(){return[document.createTextNode(`Tune the hero’s `),L(`b`,null,`canvas`),document.createTextNode(` & `),L(`b`,null,`accent`),document.createTextNode(`, then apply:`)]}#v(){let e=this.hue,t=e?`--c:${e}`:void 0,n=L(`slot`,{name:`prompt`});this.prompt?n.append(this.prompt):n.append(...this.#_()),this.#e.replaceChildren(L(`canvas`,{class:`sprk`,part:`field`,"aria-hidden":`true`}),L(`div`,{class:`dh`,part:`header`,style:t},L(`span`,{class:`sg`,part:`glyph`},i(`sparkles`,{size:12})),L(`span`,{class:`nm`,part:`name`},this.name),L(`span`,{class:`tag`,part:`tag`},`sprinkle · dip`)),L(`div`,{class:`dbody`,part:`body`,style:t},L(`p`,{class:`dprompt`,part:`prompt`},n),L(`div`,{class:`pgrid canvas`,part:`grid-canvas`},L(`slot`,{name:`canvas`})),L(`div`,{class:`pgrid accent`,part:`grid-accent`},L(`slot`,{name:`accent`})),L(`div`,{class:`dfoot`},L(`button`,{class:`dapply`,part:`apply`,type:`button`},`Apply to hero →`),L(`span`,{class:`dnote`,part:`note`})))),this.#g(`canvas:${this.#t}`,Wr,`paper`),this.#g(`accent:${this.#t}`,Gr,`cone`),this.#y()}#y(){let e=this.#e.querySelector(`.dnote`);e&&(e.textContent=`${this.selectedCanvas?.label??`paper`} · ${this.selectedAccent?.label??`violet`}`)}#b(){this.#p||(this.#p=()=>this.#y(),this.addEventListener(`palette-select`,this.#p)),this.#m||=()=>this.#S(),this.#e.querySelector(`.dapply`)?.addEventListener(`click`,this.#m)}#x(){this.#p&&=(this.removeEventListener(`palette-select`,this.#p),null),this.#m=null}#S(){this.#y(),this.dispatchEvent(new CustomEvent(`slicc-dip-apply`,{bubbles:!0,composed:!0,detail:{canvas:this.selectedCanvas,accent:this.selectedAccent}}))}#C(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}#w(){if(this.#T(),this.#C())return;let e=this.#e.querySelector(`canvas.sprk`),t=e?.getContext(`2d`)??null;!e||!t||(this.#n=e,this.#r=t,this.#o=[],this.#E(),typeof ResizeObserver==`function`&&(this.#a=new ResizeObserver(()=>this.#E()),this.#a.observe(this)),this.#d=e=>{let t=this.getBoundingClientRect();this.#l=e.clientX-t.left,this.#u=e.clientY-t.top},this.#f=()=>{this.#l=-999,this.#u=-999},this.addEventListener(`pointermove`,this.#d),this.addEventListener(`pointerleave`,this.#f),this.#i=requestAnimationFrame(()=>this.#O()))}#T(){this.#i&&cancelAnimationFrame(this.#i),this.#i=0,this.#a?.disconnect(),this.#a=null,this.#d&&this.removeEventListener(`pointermove`,this.#d),this.#f&&this.removeEventListener(`pointerleave`,this.#f),this.#d=null,this.#f=null}#E(){let e=this.#n,t=this.#r;if(!e||!t)return;let n=this.getBoundingClientRect(),r=Math.min(typeof devicePixelRatio==`number`?devicePixelRatio:1,2);if(this.#s=n.width,this.#c=n.height||90,e.width=Math.max(1,Math.round(this.#s*r)),e.height=Math.max(1,Math.round(this.#c*r)),t.setTransform(r,0,0,r,0,0),!this.#o.length)for(let e=0;e<Br;e++)this.#o.push({x:Ur(0,this.#s),y:Ur(0,this.#c),vx:Ur(-.1,.1),vy:Ur(-.08,.08),rot:Ur(0,Hr),rv:Ur(-.014,.014),s:Ur(1.2,2.2),col:zr[e%zr.length]})}#D(e,t,n,r,i){let a=this.#r;a&&(a.roundRect?(a.beginPath(),a.roundRect(e,t,n,r,i)):(a.beginPath(),a.moveTo(e+i,t),a.arcTo(e+n,t,e+n,t+r,i),a.arcTo(e+n,t+r,e,t+r,i),a.arcTo(e,t+r,e,t,i),a.arcTo(e,t,e+n,t,i),a.closePath()))}#O(){let e=this.#r;if(e){e.clearRect(0,0,this.#s,this.#c);for(let t of this.#o){let n=t.x-this.#l,r=t.y-this.#u,i=n*n+r*r;if(i<5184){let e=Math.sqrt(i)||1,a=(Vr-e)/Vr*.5;t.vx+=n/e*a,t.vy+=r/e*a}t.vx*=.95,t.vy*=.95,t.x+=t.vx+.04,t.y+=t.vy,t.rot+=t.rv,t.x<-6&&(t.x=this.#s+6),t.x>this.#s+6&&(t.x=-6),t.y<-6&&(t.y=this.#c+6),t.y>this.#c+6&&(t.y=-6);let a=t.s*4,o=t.s*1.55;e.save(),e.translate(t.x,t.y),e.rotate(t.rot),e.globalAlpha=.5,e.fillStyle=t.col,this.#D(-a/2,-o/2,a,o,o/2),e.fill(),e.globalAlpha=.85,e.fillStyle=`#fff`,this.#D(-a/2+o*.3,-o*.34,a-o*.6,o*.3,o*.15),e.fill(),e.restore(),e.globalAlpha=1}this.#i=requestAnimationFrame(()=>this.#O())}}});var Jr=14,Yr=12,Xr=`Something went wrong`,Zr={retry:`Try again`,settings:`Open Settings`,"change-model":`Change model`,login:`Log in again`},Qr={retry:`rotate-ccw`,settings:`settings`,"change-model":`sparkles`,login:`log-in`},$r=R(`
1112
+ `);I(`slicc-dip`,class extends HTMLElement{static observedAttributes=[`name`,`hue`,`prompt`];#e;#t=`d${++qr}`;#n=null;#r=null;#i=0;#a=null;#o=[];#s=0;#c=0;#l=-999;#u=-999;#d=null;#f=null;#p=null;#m=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Jr]}connectedCallback(){this.#v(),this.#b(),this.#w()}disconnectedCallback(){this.#T(),this.#x()}attributeChangedCallback(){this.isConnected&&(this.#v(),this.#b(),this.#w())}get name(){return this.getAttribute(`name`)??`palette.shtml`}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get prompt(){return this.getAttribute(`prompt`)}set prompt(e){e==null?this.removeAttribute(`prompt`):this.setAttribute(`prompt`,e)}get selectedCanvas(){return this.#h(`canvas:${this.#t}`)}get selectedAccent(){return this.#h(`accent:${this.#t}`)}#h(e){let t=this.querySelector(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);return t?{color:t.getAttribute(`color`)??``,label:t.getAttribute(`label`)??``}:null}#g(e,t,n){let r=e.startsWith(`canvas`)?`canvas`:`accent`;if(!this.querySelector(`slicc-palette-cell[slot="${r}"]`))for(let i of t){let t=this.ownerDocument.createElement(`slicc-palette-cell`);t.setAttribute(`slot`,r),t.setAttribute(`color`,i.color),t.setAttribute(`label`,i.label),t.setAttribute(`group`,e),i.label===n&&t.setAttribute(`selected`,``),this.appendChild(t)}}#_(){return[document.createTextNode(`Tune the hero’s `),L(`b`,null,`canvas`),document.createTextNode(` & `),L(`b`,null,`accent`),document.createTextNode(`, then apply:`)]}#v(){let e=this.hue,t=e?`--c:${e}`:void 0,n=L(`slot`,{name:`prompt`});this.prompt?n.append(this.prompt):n.append(...this.#_()),this.#e.replaceChildren(L(`canvas`,{class:`sprk`,part:`field`,"aria-hidden":`true`}),L(`div`,{class:`dh`,part:`header`,style:t},L(`span`,{class:`sg`,part:`glyph`},i(`sparkles`,{size:12})),L(`span`,{class:`nm`,part:`name`},this.name),L(`span`,{class:`tag`,part:`tag`},`sprinkle · dip`)),L(`div`,{class:`dbody`,part:`body`,style:t},L(`p`,{class:`dprompt`,part:`prompt`},n),L(`div`,{class:`pgrid canvas`,part:`grid-canvas`},L(`slot`,{name:`canvas`})),L(`div`,{class:`pgrid accent`,part:`grid-accent`},L(`slot`,{name:`accent`})),L(`div`,{class:`dfoot`},L(`button`,{class:`dapply`,part:`apply`,type:`button`},`Apply to hero →`),L(`span`,{class:`dnote`,part:`note`})))),this.#g(`canvas:${this.#t}`,Gr,`paper`),this.#g(`accent:${this.#t}`,Kr,`cone`),this.#y()}#y(){let e=this.#e.querySelector(`.dnote`);e&&(e.textContent=`${this.selectedCanvas?.label??`paper`} · ${this.selectedAccent?.label??`violet`}`)}#b(){this.#p||(this.#p=()=>this.#y(),this.addEventListener(`palette-select`,this.#p)),this.#m||=()=>this.#S(),this.#e.querySelector(`.dapply`)?.addEventListener(`click`,this.#m)}#x(){this.#p&&=(this.removeEventListener(`palette-select`,this.#p),null),this.#m=null}#S(){this.#y(),this.dispatchEvent(new CustomEvent(`slicc-dip-apply`,{bubbles:!0,composed:!0,detail:{canvas:this.selectedCanvas,accent:this.selectedAccent}}))}#C(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}#w(){if(this.#T(),this.#C())return;let e=this.#e.querySelector(`canvas.sprk`),t=e?.getContext(`2d`)??null;!e||!t||(this.#n=e,this.#r=t,this.#o=[],this.#E(),typeof ResizeObserver==`function`&&(this.#a=new ResizeObserver(()=>this.#E()),this.#a.observe(this)),this.#d=e=>{let t=this.getBoundingClientRect();this.#l=e.clientX-t.left,this.#u=e.clientY-t.top},this.#f=()=>{this.#l=-999,this.#u=-999},this.addEventListener(`pointermove`,this.#d),this.addEventListener(`pointerleave`,this.#f),this.#i=requestAnimationFrame(()=>this.#O()))}#T(){this.#i&&cancelAnimationFrame(this.#i),this.#i=0,this.#a?.disconnect(),this.#a=null,this.#d&&this.removeEventListener(`pointermove`,this.#d),this.#f&&this.removeEventListener(`pointerleave`,this.#f),this.#d=null,this.#f=null}#E(){let e=this.#n,t=this.#r;if(!e||!t)return;let n=this.getBoundingClientRect(),r=Math.min(typeof devicePixelRatio==`number`?devicePixelRatio:1,2);if(this.#s=n.width,this.#c=n.height||90,e.width=Math.max(1,Math.round(this.#s*r)),e.height=Math.max(1,Math.round(this.#c*r)),t.setTransform(r,0,0,r,0,0),!this.#o.length)for(let e=0;e<Vr;e++)this.#o.push({x:Wr(0,this.#s),y:Wr(0,this.#c),vx:Wr(-.1,.1),vy:Wr(-.08,.08),rot:Wr(0,Ur),rv:Wr(-.014,.014),s:Wr(1.2,2.2),col:Br[e%Br.length]})}#D(e,t,n,r,i){let a=this.#r;a&&(a.roundRect?(a.beginPath(),a.roundRect(e,t,n,r,i)):(a.beginPath(),a.moveTo(e+i,t),a.arcTo(e+n,t,e+n,t+r,i),a.arcTo(e+n,t+r,e,t+r,i),a.arcTo(e,t+r,e,t,i),a.arcTo(e,t,e+n,t,i),a.closePath()))}#O(){let e=this.#r;if(e){e.clearRect(0,0,this.#s,this.#c);for(let t of this.#o){let n=t.x-this.#l,r=t.y-this.#u,i=n*n+r*r;if(i<5184){let e=Math.sqrt(i)||1,a=(Hr-e)/Hr*.5;t.vx+=n/e*a,t.vy+=r/e*a}t.vx*=.95,t.vy*=.95,t.x+=t.vx+.04,t.y+=t.vy,t.rot+=t.rv,t.x<-6&&(t.x=this.#s+6),t.x>this.#s+6&&(t.x=-6),t.y<-6&&(t.y=this.#c+6),t.y>this.#c+6&&(t.y=-6);let a=t.s*4,o=t.s*1.55;e.save(),e.translate(t.x,t.y),e.rotate(t.rot),e.globalAlpha=.5,e.fillStyle=t.col,this.#D(-a/2,-o/2,a,o,o/2),e.fill(),e.globalAlpha=.85,e.fillStyle=`#fff`,this.#D(-a/2+o*.3,-o*.34,a-o*.6,o*.3,o*.15),e.fill(),e.restore(),e.globalAlpha=1}this.#i=requestAnimationFrame(()=>this.#O())}}});var Yr=14,Xr=12,Zr=`Something went wrong`,Qr={retry:`Try again`,settings:`Open Settings`,"change-model":`Change model`,login:`Log in again`},$r={retry:`rotate-ccw`,settings:`settings`,"change-model":`sparkles`,login:`log-in`},ei=R(`
1113
1113
  :host{
1114
1114
  /* Error cards sit in the assistant column (left-aligned). Tokens default to
1115
1115
  the light palette and flip in dark mode via the library's outer scopes
@@ -1184,7 +1184,7 @@ canvas.sprk {
1184
1184
  .retry.ghost:focus-visible{outline-color:var(--err-head);}
1185
1185
  .retry:focus-visible{outline:2px solid color-mix(in srgb,var(--err-btn-bg) 60%,var(--ink));outline-offset:2px;}
1186
1186
  .retry svg{display:block;}
1187
- `);I(`slicc-error-card`,class extends HTMLElement{static observedAttributes=[`label`,`message`,`button-label`,`secondary-button-label`,`message-id`,`action`,`secondary-action`,`no-action`,`theme`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[$r]}connectedCallback(){this.#i()}disconnectedCallback(){this.#o()}attributeChangedCallback(){this.isConnected&&this.#i()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get message(){return this.getAttribute(`message`)}set message(e){e==null?this.removeAttribute(`message`):this.setAttribute(`message`,e)}get buttonLabel(){return this.getAttribute(`button-label`)}set buttonLabel(e){e==null?this.removeAttribute(`button-label`):this.setAttribute(`button-label`,e)}get secondaryButtonLabel(){return this.getAttribute(`secondary-button-label`)}set secondaryButtonLabel(e){e==null?this.removeAttribute(`secondary-button-label`):this.setAttribute(`secondary-button-label`,e)}get messageId(){return this.getAttribute(`message-id`)}set messageId(e){e==null?this.removeAttribute(`message-id`):this.setAttribute(`message-id`,e)}get action(){let e=this.getAttribute(`action`);return e===`settings`||e===`change-model`||e===`login`?e:`retry`}set action(e){e==null?this.removeAttribute(`action`):this.setAttribute(`action`,e)}get secondaryAction(){let e=this.getAttribute(`secondary-action`);return e===`settings`||e===`change-model`||e===`login`||e===`retry`?e:null}set secondaryAction(e){e==null?this.removeAttribute(`secondary-action`):this.setAttribute(`secondary-action`,e)}get noAction(){return this.hasAttribute(`no-action`)}set noAction(e){this.toggleAttribute(`no-action`,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)}retry(){this.dispatchEvent(new CustomEvent(`slicc-error-retry`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}openSettings(){this.dispatchEvent(new CustomEvent(`slicc-error-open-settings`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}changeModel(){this.dispatchEvent(new CustomEvent(`slicc-error-change-model`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}login(){this.dispatchEvent(new CustomEvent(`slicc-error-login`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}#r(e){e===`settings`?this.openSettings():e===`change-model`?this.changeModel():e===`login`?this.login():this.retry()}#i(){let e=this.action,t=this.label??Xr,n=this.message,r=this.buttonLabel??Zr[e],a=Qr[e],o=L(`span`,{class:`ic`,part:`icon`,"aria-hidden":!0});o.append(i(`triangle-alert`,{size:Jr}));let s=L(`div`,{class:`eh`,part:`header`},o,L(`span`,{class:`lbl`,part:`label`},t)),c=L(`div`,{class:`eb`,part:`body`},n??L(`slot`)),l=L(`button`,{type:`button`,class:`retry`,part:`button`,"aria-label":r},i(a,{size:Yr}),r),u=this.secondaryAction,d=u?this.secondaryButtonLabel??Zr[u]:null,f=u&&d!=null?L(`button`,{type:`button`,class:`retry ghost`,part:`secondary-button`,"aria-label":d},i(Qr[u],{size:Yr}),d):null,p=[s,c];if(!this.noAction){let e=L(`div`,{class:`foot`});f&&e.append(f),e.append(l),p.push(e)}let m=L(`div`,{class:`err`,part:`card`},...p);this.#e.replaceChildren(m),this.#a()}#a(){this.#o();let e=this.#e.querySelector(`.retry:not(.ghost)`);if(e){let t=this.action;this.#t=()=>this.#r(t),e.addEventListener(`click`,this.#t)}let t=this.#e.querySelector(`.retry.ghost`),n=this.secondaryAction;t&&n&&(this.#n=()=>this.#r(n),t.addEventListener(`click`,this.#n))}#o(){let e=this.#e.querySelector(`.retry:not(.ghost)`);e&&this.#t&&e.removeEventListener(`click`,this.#t),this.#t=null;let t=this.#e.querySelector(`.retry.ghost`);t&&this.#n&&t.removeEventListener(`click`,this.#n),this.#n=null}});var ei=9,ti=3,ni=45,ri=R(`
1187
+ `);I(`slicc-error-card`,class extends HTMLElement{static observedAttributes=[`label`,`message`,`button-label`,`secondary-button-label`,`message-id`,`action`,`secondary-action`,`no-action`,`theme`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ei]}connectedCallback(){this.#i()}disconnectedCallback(){this.#o()}attributeChangedCallback(){this.isConnected&&this.#i()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get message(){return this.getAttribute(`message`)}set message(e){e==null?this.removeAttribute(`message`):this.setAttribute(`message`,e)}get buttonLabel(){return this.getAttribute(`button-label`)}set buttonLabel(e){e==null?this.removeAttribute(`button-label`):this.setAttribute(`button-label`,e)}get secondaryButtonLabel(){return this.getAttribute(`secondary-button-label`)}set secondaryButtonLabel(e){e==null?this.removeAttribute(`secondary-button-label`):this.setAttribute(`secondary-button-label`,e)}get messageId(){return this.getAttribute(`message-id`)}set messageId(e){e==null?this.removeAttribute(`message-id`):this.setAttribute(`message-id`,e)}get action(){let e=this.getAttribute(`action`);return e===`settings`||e===`change-model`||e===`login`?e:`retry`}set action(e){e==null?this.removeAttribute(`action`):this.setAttribute(`action`,e)}get secondaryAction(){let e=this.getAttribute(`secondary-action`);return e===`settings`||e===`change-model`||e===`login`||e===`retry`?e:null}set secondaryAction(e){e==null?this.removeAttribute(`secondary-action`):this.setAttribute(`secondary-action`,e)}get noAction(){return this.hasAttribute(`no-action`)}set noAction(e){this.toggleAttribute(`no-action`,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)}retry(){this.dispatchEvent(new CustomEvent(`slicc-error-retry`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}openSettings(){this.dispatchEvent(new CustomEvent(`slicc-error-open-settings`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}changeModel(){this.dispatchEvent(new CustomEvent(`slicc-error-change-model`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}login(){this.dispatchEvent(new CustomEvent(`slicc-error-login`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}#r(e){e===`settings`?this.openSettings():e===`change-model`?this.changeModel():e===`login`?this.login():this.retry()}#i(){let e=this.action,t=this.label??Zr,n=this.message,r=this.buttonLabel??Qr[e],a=$r[e],o=L(`span`,{class:`ic`,part:`icon`,"aria-hidden":!0});o.append(i(`triangle-alert`,{size:Yr}));let s=L(`div`,{class:`eh`,part:`header`},o,L(`span`,{class:`lbl`,part:`label`},t)),c=L(`div`,{class:`eb`,part:`body`},n??L(`slot`)),l=L(`button`,{type:`button`,class:`retry`,part:`button`,"aria-label":r},i(a,{size:Xr}),r),u=this.secondaryAction,d=u?this.secondaryButtonLabel??Qr[u]:null,f=u&&d!=null?L(`button`,{type:`button`,class:`retry ghost`,part:`secondary-button`,"aria-label":d},i($r[u],{size:Xr}),d):null,p=[s,c];if(!this.noAction){let e=L(`div`,{class:`foot`});f&&e.append(f),e.append(l),p.push(e)}let m=L(`div`,{class:`err`,part:`card`},...p);this.#e.replaceChildren(m),this.#a()}#a(){this.#o();let e=this.#e.querySelector(`.retry:not(.ghost)`);if(e){let t=this.action;this.#t=()=>this.#r(t),e.addEventListener(`click`,this.#t)}let t=this.#e.querySelector(`.retry.ghost`),n=this.secondaryAction;t&&n&&(this.#n=()=>this.#r(n),t.addEventListener(`click`,this.#n))}#o(){let e=this.#e.querySelector(`.retry:not(.ghost)`);e&&this.#t&&e.removeEventListener(`click`,this.#t),this.#t=null;let t=this.#e.querySelector(`.retry.ghost`);t&&this.#n&&t.removeEventListener(`click`,this.#n),this.#n=null}});var ti=9,ni=3,ri=45,ii=R(`
1188
1188
  :host {
1189
1189
  display: inline-flex;
1190
1190
  align-items: center;
@@ -1265,7 +1265,7 @@ canvas.sprk {
1265
1265
  @media (prefers-reduced-motion: reduce) {
1266
1266
  :host([blink]) .eye { animation: none; }
1267
1267
  }
1268
- `);I(`slicc-googly-eyes`,class extends HTMLElement{static observedAttributes=[`inverted`,`tracking`,`blink`,`eyes`,`size`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ri]}connectedCallback(){this.#r(),this.#i()}disconnectedCallback(){this.#o()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`size`||e===`eyes`?(this.#r(),this.#i()):e===`tracking`&&this.#i())}get inverted(){return this.hasAttribute(`inverted`)}set inverted(e){this.toggleAttribute(`inverted`,e)}get tracking(){return this.getAttribute(`tracking`)!==`off`}set tracking(e){e?this.setAttribute(`tracking`,`on`):this.setAttribute(`tracking`,`off`)}get blink(){return this.hasAttribute(`blink`)}set blink(e){this.toggleAttribute(`blink`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}get size(){let e=Number.parseFloat(this.getAttribute(`size`)??``);return Number.isFinite(e)&&e>0?e:ei}set size(e){this.setAttribute(`size`,String(e))}#r(){let e=this.size,t=1.3/ei*e,n=this.eyes===`dead`,r=e=>L(`span`,{class:`eye`,part:e},n?L(`span`,{class:`x`,"aria-hidden":`true`},`×`):null),i=L(`span`,{class:`eyes`,part:`eyes`,style:`--_eye:${e}px;--_border:${t}px`,role:`img`,"aria-label":n?`dead eyes`:`googly eyes`},r(`eye eye-left`),L(`slot`),r(`eye eye-right`));this.#e.replaceChildren(i),this.#t=Array.from(this.#e.querySelectorAll(`.eye`)),this.#s()}#i(){this.tracking&&this.eyes===`open`?this.#a():(this.#o(),this.#s())}#a(){this.#n||(this.#n=e=>this.#c(e),document.addEventListener(`mousemove`,this.#n))}#o(){this.#n&&=(document.removeEventListener(`mousemove`,this.#n),null)}#s(){for(let e of this.#t)e.style.setProperty(`--px`,`0px`),e.style.setProperty(`--py`,`0px`)}#c(e){for(let t of this.#t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,a=Math.atan2(e.clientY-i,e.clientX-r),o=Math.min(ti,Math.hypot(e.clientX-r,e.clientY-i)/ni);t.style.setProperty(`--px`,`${(Math.cos(a)*o).toFixed(2)}px`),t.style.setProperty(`--py`,`${(Math.sin(a)*o).toFixed(2)}px`)}}});var ii=R(`
1268
+ `);I(`slicc-googly-eyes`,class extends HTMLElement{static observedAttributes=[`inverted`,`tracking`,`blink`,`eyes`,`size`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ii]}connectedCallback(){this.#r(),this.#i()}disconnectedCallback(){this.#o()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`size`||e===`eyes`?(this.#r(),this.#i()):e===`tracking`&&this.#i())}get inverted(){return this.hasAttribute(`inverted`)}set inverted(e){this.toggleAttribute(`inverted`,e)}get tracking(){return this.getAttribute(`tracking`)!==`off`}set tracking(e){e?this.setAttribute(`tracking`,`on`):this.setAttribute(`tracking`,`off`)}get blink(){return this.hasAttribute(`blink`)}set blink(e){this.toggleAttribute(`blink`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}get size(){let e=Number.parseFloat(this.getAttribute(`size`)??``);return Number.isFinite(e)&&e>0?e:ti}set size(e){this.setAttribute(`size`,String(e))}#r(){let e=this.size,t=1.3/ti*e,n=this.eyes===`dead`,r=e=>L(`span`,{class:`eye`,part:e},n?L(`span`,{class:`x`,"aria-hidden":`true`},`×`):null),i=L(`span`,{class:`eyes`,part:`eyes`,style:`--_eye:${e}px;--_border:${t}px`,role:`img`,"aria-label":n?`dead eyes`:`googly eyes`},r(`eye eye-left`),L(`slot`),r(`eye eye-right`));this.#e.replaceChildren(i),this.#t=Array.from(this.#e.querySelectorAll(`.eye`)),this.#s()}#i(){this.tracking&&this.eyes===`open`?this.#a():(this.#o(),this.#s())}#a(){this.#n||(this.#n=e=>this.#c(e),document.addEventListener(`mousemove`,this.#n))}#o(){this.#n&&=(document.removeEventListener(`mousemove`,this.#n),null)}#s(){for(let e of this.#t)e.style.setProperty(`--px`,`0px`),e.style.setProperty(`--py`,`0px`)}#c(e){for(let t of this.#t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,a=Math.atan2(e.clientY-i,e.clientX-r),o=Math.min(ni,Math.hypot(e.clientX-r,e.clientY-i)/ri);t.style.setProperty(`--px`,`${(Math.cos(a)*o).toFixed(2)}px`),t.style.setProperty(`--py`,`${(Math.sin(a)*o).toFixed(2)}px`)}}});var ai=R(`
1269
1269
  :host{display:block;font-family:var(--ui);}
1270
1270
  :host([hidden]){display:none;}
1271
1271
  .handoff{border:1px solid var(--line);border-radius:13px;padding:13px 15px;margin:2px 0 18px;}
@@ -1285,7 +1285,7 @@ canvas.sprk {
1285
1285
  .opened .sg{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;color:#fff;background:var(--rainbow);flex:0 0 auto;}
1286
1286
  .opened .sg svg{display:block;}
1287
1287
  .opened b{color:var(--ink);font-weight:600;}
1288
- `),ai=`Handoff request from`;I(`slicc-handoff-card`,class extends HTMLElement{static observedAttributes=[`variant`,`name`,`pre`,`text`,`eyes`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ii]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get variant(){return this.getAttribute(`variant`)===`opened`?`opened`:`handoff`}set variant(e){this.setAttribute(`variant`,e===`opened`?`opened`:`handoff`)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get pre(){return this.getAttribute(`pre`)}set pre(e){e==null?this.removeAttribute(`pre`):this.setAttribute(`pre`,e)}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}#t(){this.variant===`opened`?this.#i():this.#r()}#n(){let e=this.text;return e==null?L(`slot`):document.createTextNode(e)}#r(){let e=this.pre??ai,t=this.name,n=L(`slicc-googly-eyes`,{class:`eyes`});this.eyes===`dead`&&n.setAttribute(`eyes`,`dead`);let r=L(`div`,{class:`top`,part:`top`},L(`span`,{class:`av`,part:`avatar`},n),L(`span`,{class:`lbl2`,part:`label`},L(`span`,{class:`hand`,part:`hand`,"aria-hidden":`true`},i(`hand`,{size:13})),L(`span`,{class:`pre`},e),` `,t==null?null:L(`b`,{part:`name`},t))),a=L(`p`,{part:`text`},this.#n());this.#e.replaceChildren(L(`div`,{class:`handoff`,part:`card`},r,a))}#i(){let e=this.name,t=L(`span`,{class:`sg`,part:`glyph`,"aria-hidden":`true`},i(`sparkles`,{size:12})),n=L(`span`,{part:`text`},e==null?null:L(`b`,{part:`name`},e),e==null?null:` `,this.#n());this.#e.replaceChildren(L(`div`,{class:`opened`,part:`card`},t,n))}});var oi=14,si=`event`,ci={webhook:`webhook`,cron:`clock`,workflow:`workflow`,bash:`square-terminal`,"session-reload":`rotate-ccw`,navigate:`compass`,discovery:`radar`,upgrade:`circle-arrow-up`,sprinkle:`sparkles`,gelatiere:`ice-cream-cone`,fswatch:`eye`,"scoop-notify":`bell-ring`,"scoop-idle":`moon`,"scoop-wait":`hourglass`,"sudo-request":`key-round`},li=`bell`;function ui(e){return e&&ci[e.toLowerCase()]||li}var di={confirmed:`circle-check`,dismissed:`circle-x`},fi=R(`
1288
+ `),oi=`Handoff request from`;I(`slicc-handoff-card`,class extends HTMLElement{static observedAttributes=[`variant`,`name`,`pre`,`text`,`eyes`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ai]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get variant(){return this.getAttribute(`variant`)===`opened`?`opened`:`handoff`}set variant(e){this.setAttribute(`variant`,e===`opened`?`opened`:`handoff`)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get pre(){return this.getAttribute(`pre`)}set pre(e){e==null?this.removeAttribute(`pre`):this.setAttribute(`pre`,e)}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}#t(){this.variant===`opened`?this.#i():this.#r()}#n(){let e=this.text;return e==null?L(`slot`):document.createTextNode(e)}#r(){let e=this.pre??oi,t=this.name,n=L(`slicc-googly-eyes`,{class:`eyes`});this.eyes===`dead`&&n.setAttribute(`eyes`,`dead`);let r=L(`div`,{class:`top`,part:`top`},L(`span`,{class:`av`,part:`avatar`},n),L(`span`,{class:`lbl2`,part:`label`},L(`span`,{class:`hand`,part:`hand`,"aria-hidden":`true`},i(`hand`,{size:13})),L(`span`,{class:`pre`},e),` `,t==null?null:L(`b`,{part:`name`},t))),a=L(`p`,{part:`text`},this.#n());this.#e.replaceChildren(L(`div`,{class:`handoff`,part:`card`},r,a))}#i(){let e=this.name,t=L(`span`,{class:`sg`,part:`glyph`,"aria-hidden":`true`},i(`sparkles`,{size:12})),n=L(`span`,{part:`text`},e==null?null:L(`b`,{part:`name`},e),e==null?null:` `,this.#n());this.#e.replaceChildren(L(`div`,{class:`opened`,part:`card`},t,n))}});var si=14,ci=`event`,li={webhook:`webhook`,cron:`clock`,workflow:`workflow`,bash:`square-terminal`,"session-reload":`rotate-ccw`,navigate:`compass`,discovery:`radar`,upgrade:`circle-arrow-up`,sprinkle:`sparkles`,gelatiere:`ice-cream-cone`,fswatch:`eye`,"scoop-notify":`bell-ring`,"scoop-idle":`moon`,"scoop-wait":`hourglass`,"sudo-request":`key-round`},ui=`bell`;function di(e){return e&&li[e.toLowerCase()]||ui}var fi={confirmed:`circle-check`,dismissed:`circle-x`},pi=R(`
1289
1289
  :host{
1290
1290
  /* Licks are right-aligned in the chat column (mirroring the lickIn slide-in
1291
1291
  from the right): the host is a full-width flex row that pushes the card to
@@ -1392,7 +1392,7 @@ canvas.sprk {
1392
1392
  :host([collapsed]) .lb{display:none;}
1393
1393
 
1394
1394
  @keyframes lickIn{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
1395
- `),pi=`
1395
+ `),mi=`
1396
1396
  slicc-lick-card pre{
1397
1397
  white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;
1398
1398
  max-width:100%;overflow-x:auto;margin:6px 0;
@@ -1403,7 +1403,7 @@ slicc-lick-card a{overflow-wrap:anywhere;}
1403
1403
  slicc-lick-card img{max-width:100%;height:auto;}
1404
1404
  slicc-lick-card table{display:block;max-width:100%;width:fit-content;overflow-x:auto;}
1405
1405
  slicc-lick-card > *{min-width:0;max-width:100%;}
1406
- `,mi=`slicc-lick-card-slotted-style`;function hi(e){if(e.getElementById(mi))return;let t=e.createElement(`style`);t.id=mi,t.textContent=pi,(e.head??e.documentElement).appendChild(t)}var gi=`·`;I(`slicc-lick-card`,class extends HTMLElement{static observedAttributes=[`kind`,`event-label`,`body`,`count`,`no-animate`,`collapsible`,`collapsed`,`theme`,`hue`,`state`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[fi]}connectedCallback(){hi(this.ownerDocument),this.#r()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#r()}get kind(){return this.getAttribute(`kind`)}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}get eventLabel(){return this.getAttribute(`event-label`)}set eventLabel(e){e==null?this.removeAttribute(`event-label`):this.setAttribute(`event-label`,e)}get body(){return this.getAttribute(`body`)}set body(e){e==null?this.removeAttribute(`body`):this.setAttribute(`body`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:1}set count(e){e>1?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get noAnimate(){return this.hasAttribute(`no-animate`)}set noAnimate(e){this.toggleAttribute(`no-animate`,e)}get collapsible(){return this.hasAttribute(`collapsible`)}set collapsible(e){this.toggleAttribute(`collapsible`,e)}get collapsed(){return this.hasAttribute(`collapsed`)}set collapsed(e){this.toggleAttribute(`collapsed`,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 state(){let e=this.getAttribute(`state`);return e===`confirmed`||e===`dismissed`?e:`pending`}set state(e){e==null||e===`pending`?this.removeAttribute(`state`):this.setAttribute(`state`,e)}toggle(){this.collapsible&&(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent(`slicc-lick-toggle`,{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}#r(){let e=this.kind??``,t=this.count,n=this.getAttribute(`hue`);n?(this.style.setProperty(`--lick-pill`,n),this.style.setProperty(`--lick-pill-ink`,`#fff`)):(this.style.removeProperty(`--lick-pill`),this.style.removeProperty(`--lick-pill-ink`));let r=this.eventLabel??si,a=t>1?`${r} ×${t}`:r,o=this.body,s=this.collapsible,c=e?`lick ${gi} ${e}`:`lick ${gi}`,l=L(`span`,{class:`bell`,part:`bell`,"aria-hidden":!0});l.append(i(ui(e),{size:oi}));let u={class:`lh`,part:`header`};s&&(u.tabindex=`0`,u.role=`button`,u[`aria-expanded`]=this.collapsed?`false`:`true`);let d=L(`div`,u,l,` `,L(`span`,{class:`kind`,part:`kind`},`${c} `),L(`span`,{class:`lk`,part:`event`},a)),f=this.state;if(f!==`pending`){let e=L(`span`,{class:`status`,part:`status`,"aria-hidden":!0});e.append(i(di[f],{size:oi})),d.append(e)}let p=L(`div`,{class:`lick`,part:`card`},d,L(`div`,{class:`lb`,part:`body`},o??L(`slot`)));this.#e.replaceChildren(p),this.#i()}#i(){if(this.#a(),!this.collapsible)return;let e=this.#e.querySelector(`.lh`);e&&(this.#t=()=>this.toggle(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggle())},e.addEventListener(`click`,this.#t),e.addEventListener(`keydown`,this.#n))}#a(){let e=this.#e.querySelector(`.lh`);e&&this.#t&&e.removeEventListener(`click`,this.#t),e&&this.#n&&e.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}});var _i=`
1406
+ `,hi=`slicc-lick-card-slotted-style`;function gi(e){if(e.getElementById(hi))return;let t=e.createElement(`style`);t.id=hi,t.textContent=mi,(e.head??e.documentElement).appendChild(t)}var _i=`·`;I(`slicc-lick-card`,class extends HTMLElement{static observedAttributes=[`kind`,`event-label`,`body`,`count`,`no-animate`,`collapsible`,`collapsed`,`theme`,`hue`,`state`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[pi]}connectedCallback(){gi(this.ownerDocument),this.#r()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#r()}get kind(){return this.getAttribute(`kind`)}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}get eventLabel(){return this.getAttribute(`event-label`)}set eventLabel(e){e==null?this.removeAttribute(`event-label`):this.setAttribute(`event-label`,e)}get body(){return this.getAttribute(`body`)}set body(e){e==null?this.removeAttribute(`body`):this.setAttribute(`body`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:1}set count(e){e>1?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get noAnimate(){return this.hasAttribute(`no-animate`)}set noAnimate(e){this.toggleAttribute(`no-animate`,e)}get collapsible(){return this.hasAttribute(`collapsible`)}set collapsible(e){this.toggleAttribute(`collapsible`,e)}get collapsed(){return this.hasAttribute(`collapsed`)}set collapsed(e){this.toggleAttribute(`collapsed`,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 state(){let e=this.getAttribute(`state`);return e===`confirmed`||e===`dismissed`?e:`pending`}set state(e){e==null||e===`pending`?this.removeAttribute(`state`):this.setAttribute(`state`,e)}toggle(){this.collapsible&&(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent(`slicc-lick-toggle`,{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}#r(){let e=this.kind??``,t=this.count,n=this.getAttribute(`hue`);n?(this.style.setProperty(`--lick-pill`,n),this.style.setProperty(`--lick-pill-ink`,`#fff`)):(this.style.removeProperty(`--lick-pill`),this.style.removeProperty(`--lick-pill-ink`));let r=this.eventLabel??ci,a=t>1?`${r} ×${t}`:r,o=this.body,s=this.collapsible,c=e?`lick ${_i} ${e}`:`lick ${_i}`,l=L(`span`,{class:`bell`,part:`bell`,"aria-hidden":!0});l.append(i(di(e),{size:si}));let u={class:`lh`,part:`header`};s&&(u.tabindex=`0`,u.role=`button`,u[`aria-expanded`]=this.collapsed?`false`:`true`);let d=L(`div`,u,l,` `,L(`span`,{class:`kind`,part:`kind`},`${c} `),L(`span`,{class:`lk`,part:`event`},a)),f=this.state;if(f!==`pending`){let e=L(`span`,{class:`status`,part:`status`,"aria-hidden":!0});e.append(i(fi[f],{size:si})),d.append(e)}let p=L(`div`,{class:`lick`,part:`card`},d,L(`div`,{class:`lb`,part:`body`},o??L(`slot`)));this.#e.replaceChildren(p),this.#i()}#i(){if(this.#a(),!this.collapsible)return;let e=this.#e.querySelector(`.lh`);e&&(this.#t=()=>this.toggle(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggle())},e.addEventListener(`click`,this.#t),e.addEventListener(`keydown`,this.#n))}#a(){let e=this.#e.querySelector(`.lh`);e&&this.#t&&e.removeEventListener(`click`,this.#t),e&&this.#n&&e.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}});var vi=`
1407
1407
  slicc-tool-cluster {
1408
1408
  display: block;
1409
1409
  margin: -2px 0 16px;
@@ -1479,7 +1479,7 @@ slicc-tool-cluster[open] .slicc-cluster__body {
1479
1479
  slicc-tool-cluster .slicc-cluster__body slicc-action-row {
1480
1480
  margin-bottom: 4px;
1481
1481
  }
1482
- `,vi=`slicc-tool-cluster-style`;function yi(e){if(e.getElementById(vi))return;let t=e.createElement(`style`);t.id=vi,t.textContent=_i,(e.head??e.documentElement).appendChild(t)}var bi=`A few quick steps`;I(`slicc-tool-cluster`,class extends HTMLElement{static observedAttributes=[`open`,`label`,`count`];#e;#t;#n;#r;#i=!1;#a=()=>{this.open=!this.open};connectedCallback(){yi(this.ownerDocument),this.#o(),this.#s(),this.#e?.addEventListener(`click`,this.#a)}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#a)}attributeChangedCallback(e,t,n){t===n||!this.#i||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-tool-cluster-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get label(){return this.getAttribute(`label`)??bi}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:0}set count(e){e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get body(){return this.#o(),this.#r}append(...e){this.#o(),this.#r.append(...e),this.#s()}#o(){if(this.#i)return;this.#i=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-cluster__head`,this.#e.setAttribute(`part`,`head`),this.#t=L(`span`,{class:`slicc-cluster__label`,part:`label`}),this.#n=L(`span`,{class:`slicc-cluster__count`,part:`count`}),Ln(this.#e,[L(`span`,{class:`slicc-cluster__ic`,part:`icon`},i(`layers`,{size:12})),this.#t,this.#n,L(`span`,{class:`slicc-cluster__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#r=this.ownerDocument.createElement(`div`),this.#r.className=`slicc-cluster__body`,this.#r.setAttribute(`part`,`body`);for(let t of e)this.#r.appendChild(t);this.replaceChildren(this.#e,this.#r),this.#e.addEventListener(`click`,this.#a)}#s(){if(!this.#i)return;this.#t.textContent=this.label;let e=this.count||this.#r.children.length;this.#n.textContent=e>0?`${e} steps`:``,this.#e.setAttribute(`aria-expanded`,String(this.open))}});var xi=400,Si=R(`
1482
+ `,yi=`slicc-tool-cluster-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=`A few quick steps`;I(`slicc-tool-cluster`,class extends HTMLElement{static observedAttributes=[`open`,`label`,`count`];#e;#t;#n;#r;#i=!1;#a=()=>{this.open=!this.open};connectedCallback(){bi(this.ownerDocument),this.#o(),this.#s(),this.#e?.addEventListener(`click`,this.#a)}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#a)}attributeChangedCallback(e,t,n){t===n||!this.#i||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-tool-cluster-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get label(){return this.getAttribute(`label`)??xi}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:0}set count(e){e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get body(){return this.#o(),this.#r}append(...e){this.#o(),this.#r.append(...e),this.#s()}#o(){if(this.#i)return;this.#i=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-cluster__head`,this.#e.setAttribute(`part`,`head`),this.#t=L(`span`,{class:`slicc-cluster__label`,part:`label`}),this.#n=L(`span`,{class:`slicc-cluster__count`,part:`count`}),Rn(this.#e,[L(`span`,{class:`slicc-cluster__ic`,part:`icon`},i(`layers`,{size:12})),this.#t,this.#n,L(`span`,{class:`slicc-cluster__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#r=this.ownerDocument.createElement(`div`),this.#r.className=`slicc-cluster__body`,this.#r.setAttribute(`part`,`body`);for(let t of e)this.#r.appendChild(t);this.replaceChildren(this.#e,this.#r),this.#e.addEventListener(`click`,this.#a)}#s(){if(!this.#i)return;this.#t.textContent=this.label;let e=this.count||this.#r.children.length;this.#n.textContent=e>0?`${e} steps`:``,this.#e.setAttribute(`aria-expanded`,String(this.open))}});var Si=400,Ci=R(`
1483
1483
  :host{position:fixed;inset:0;z-index:1000;display:none;}
1484
1484
  :host([open]){display:block;}
1485
1485
  .overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;cursor:pointer;}
@@ -1487,7 +1487,7 @@ slicc-tool-cluster .slicc-cluster__body slicc-action-row {
1487
1487
  .overlay.visible .backdrop{opacity:1;}
1488
1488
  .overlay.closing .backdrop{opacity:0;}
1489
1489
  .image{position:absolute;border-radius:6px;box-shadow:0 20px 60px rgba(0,0,0,.4),0 8px 20px rgba(0,0,0,.3);max-width:90vw;max-height:90vh;object-fit:contain;transform-origin:center center;will-change:transform;transition:transform .35s cubic-bezier(.2,0,.13,1),border-radius .35s cubic-bezier(.2,0,.13,1);}
1490
- `),Ci=null,wi=class extends HTMLElement{#e;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Si]}disconnectedCallback(){this.#l(),Ci===this&&(Ci=null)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get isOpen(){return this.hasAttribute(`open`)}open(e,t){Ci&&Ci!==this&&Ci.#s(),this.#l(),this.#a=!1,this.src=e,this.setAttribute(`open`,``),Ci=this,this.#r=t??this;let n=document.createElement(`div`);n.className=`overlay`,n.setAttribute(`part`,`overlay`);let r=document.createElement(`div`);r.className=`backdrop`,r.setAttribute(`part`,`backdrop`),n.appendChild(r);let i=document.createElement(`img`);i.className=`image`,i.setAttribute(`part`,`image`),i.src=e,i.alt=`Image preview`,n.appendChild(i),this.#e.appendChild(n),this.#t=n,this.#n=i;let a=this.#r.getBoundingClientRect(),o=()=>{let e=window.innerWidth,t=window.innerHeight,r=e*.9,o=t*.9,s=i.naturalWidth||a.width*4,c=i.naturalHeight||a.height*4,l=Math.min(r/s,o/c,1),u=s*l,d=c*l,f=(e-u)/2,p=(t-d)/2,m=a.width/u,h=a.height/d,g=a.left+a.width/2,_=a.top+a.height/2,v=f+u/2,y=p+d/2,b=g-v,x=_-y;i.style.position=`absolute`,i.style.width=`${u}px`,i.style.height=`${d}px`,i.style.left=`${f}px`,i.style.top=`${p}px`,i.style.transform=`translate(${b}px, ${x}px) scale(${m}, ${h})`,i.style.borderRadius=`${6/Math.min(m,h)}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.style.transform=`translate(0, 0) scale(1, 1)`,i.style.borderRadius=`6px`,n.classList.add(`visible`)})})};i.complete&&i.naturalWidth>0?o():(i.onload=()=>o(),i.onerror=()=>this.#s()),this.#i=e=>{e.key===`Escape`&&this.close()},n.addEventListener(`click`,()=>this.close()),document.addEventListener(`keydown`,this.#i),this.dispatchEvent(new CustomEvent(`slicc-image-preview-open`,{bubbles:!0,composed:!0,detail:{src:e}}))}close(){let e=this.#t,t=this.#n;if(this.#a||!e||!t||Ci!==this)return;this.#a=!0,e.classList.add(`closing`),e.classList.remove(`visible`);let n=this.#r,r=n?n.getBoundingClientRect():null;if(r&&r.width>0&&r.height>0){let e=t.getBoundingClientRect(),n=r.width/e.width,i=r.height/e.height,a=r.left+r.width/2,o=r.top+r.height/2,s=e.left+e.width/2,c=e.top+e.height/2,l=a-s,u=o-c;t.style.transform=`translate(${l}px, ${u}px) scale(${n}, ${i})`,t.style.borderRadius=`${6/Math.min(n,i)}px`}this.dispatchEvent(new CustomEvent(`slicc-image-preview-close`,{bubbles:!0,composed:!0,detail:{src:this.src}}));let i=()=>this.#c();this.#o=setTimeout(i,xi),e.addEventListener(`transitionend`,e=>{e.propertyName===`transform`&&(this.#o&&clearTimeout(this.#o),i())})}#s(){this.#l()}#c(){this.#l()}#l(){this.#o&&=(clearTimeout(this.#o),null),this.#i&&=(document.removeEventListener(`keydown`,this.#i),null),this.#t&&=(this.#t.remove(),null),this.#n=null,this.#r=null,this.removeAttribute(`open`),this.removeAttribute(`src`),Ci===this&&(Ci=null)}static show(e,t){let n=document.querySelector(`slicc-image-preview[data-shared]`);return n||(n=document.createElement(`slicc-image-preview`),n.setAttribute(`data-shared`,``),document.body.appendChild(n)),n.open(e,t),()=>n.close()}};I(`slicc-image-preview`,wi);var Ti=R(`
1490
+ `),wi=null,Ti=class extends HTMLElement{#e;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ci]}disconnectedCallback(){this.#l(),wi===this&&(wi=null)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get isOpen(){return this.hasAttribute(`open`)}open(e,t){wi&&wi!==this&&wi.#s(),this.#l(),this.#a=!1,this.src=e,this.setAttribute(`open`,``),wi=this,this.#r=t??this;let n=document.createElement(`div`);n.className=`overlay`,n.setAttribute(`part`,`overlay`);let r=document.createElement(`div`);r.className=`backdrop`,r.setAttribute(`part`,`backdrop`),n.appendChild(r);let i=document.createElement(`img`);i.className=`image`,i.setAttribute(`part`,`image`),i.src=e,i.alt=`Image preview`,n.appendChild(i),this.#e.appendChild(n),this.#t=n,this.#n=i;let a=this.#r.getBoundingClientRect(),o=()=>{let e=window.innerWidth,t=window.innerHeight,r=e*.9,o=t*.9,s=i.naturalWidth||a.width*4,c=i.naturalHeight||a.height*4,l=Math.min(r/s,o/c,1),u=s*l,d=c*l,f=(e-u)/2,p=(t-d)/2,m=a.width/u,h=a.height/d,g=a.left+a.width/2,_=a.top+a.height/2,v=f+u/2,y=p+d/2,b=g-v,x=_-y;i.style.position=`absolute`,i.style.width=`${u}px`,i.style.height=`${d}px`,i.style.left=`${f}px`,i.style.top=`${p}px`,i.style.transform=`translate(${b}px, ${x}px) scale(${m}, ${h})`,i.style.borderRadius=`${6/Math.min(m,h)}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.style.transform=`translate(0, 0) scale(1, 1)`,i.style.borderRadius=`6px`,n.classList.add(`visible`)})})};i.complete&&i.naturalWidth>0?o():(i.onload=()=>o(),i.onerror=()=>this.#s()),this.#i=e=>{e.key===`Escape`&&this.close()},n.addEventListener(`click`,()=>this.close()),document.addEventListener(`keydown`,this.#i),this.dispatchEvent(new CustomEvent(`slicc-image-preview-open`,{bubbles:!0,composed:!0,detail:{src:e}}))}close(){let e=this.#t,t=this.#n;if(this.#a||!e||!t||wi!==this)return;this.#a=!0,e.classList.add(`closing`),e.classList.remove(`visible`);let n=this.#r,r=n?n.getBoundingClientRect():null;if(r&&r.width>0&&r.height>0){let e=t.getBoundingClientRect(),n=r.width/e.width,i=r.height/e.height,a=r.left+r.width/2,o=r.top+r.height/2,s=e.left+e.width/2,c=e.top+e.height/2,l=a-s,u=o-c;t.style.transform=`translate(${l}px, ${u}px) scale(${n}, ${i})`,t.style.borderRadius=`${6/Math.min(n,i)}px`}this.dispatchEvent(new CustomEvent(`slicc-image-preview-close`,{bubbles:!0,composed:!0,detail:{src:this.src}}));let i=()=>this.#c();this.#o=setTimeout(i,Si),e.addEventListener(`transitionend`,e=>{e.propertyName===`transform`&&(this.#o&&clearTimeout(this.#o),i())})}#s(){this.#l()}#c(){this.#l()}#l(){this.#o&&=(clearTimeout(this.#o),null),this.#i&&=(document.removeEventListener(`keydown`,this.#i),null),this.#t&&=(this.#t.remove(),null),this.#n=null,this.#r=null,this.removeAttribute(`open`),this.removeAttribute(`src`),wi===this&&(wi=null)}static show(e,t){let n=document.querySelector(`slicc-image-preview[data-shared]`);return n||(n=document.createElement(`slicc-image-preview`),n.setAttribute(`data-shared`,``),document.body.appendChild(n)),n.open(e,t),()=>n.close()}};I(`slicc-image-preview`,Ti);var Ei=R(`
1491
1491
  :host{display:block;margin-bottom:18px;font-family:var(--ui);font-size:15px;line-height:1.5;}
1492
1492
  :host([hidden]){display:none;}
1493
1493
  .msg{display:flex;justify-content:flex-end;}
@@ -1535,7 +1535,7 @@ slicc-tool-cluster .slicc-cluster__body slicc-action-row {
1535
1535
  :host([queued]) .b{opacity:.62;}
1536
1536
  .queued-tag{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;color:var(--txt-3);}
1537
1537
  .queued-tag svg{display:block;}
1538
- `),Ei={image:`image`,text:`file-text`,file:`file`};function Di(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}I(`slicc-user-message`,class extends HTMLElement{static observedAttributes=[`text`,`queued`,`timestamp`];#e;#t=null;#n=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ti]}connectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#a()}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get queued(){return this.hasAttribute(`queued`)}set queued(e){this.toggleAttribute(`queued`,e)}setBodyHtml(e){this.#t=e,this.#a()}setAttachments(e){this.#n=e.slice(),this.#a()}#r(){if(this.#t!=null)return this.ownerDocument.createRange().createContextualFragment(this.#t);let e=this.text;return e==null?L(`slot`):this.ownerDocument.createTextNode(e)}#i(e){let t=e.kind??`file`,n=L(`span`,{class:`attachment-chip__visual`});if(t===`image`&&e.src){let t=L(`img`,{src:e.src,alt:e.name||`Attached image`});t.addEventListener(`click`,n=>{n.stopPropagation(),wi.show(e.src,t)}),n.append(t)}else n.append(i(Ei[t],{size:16}));let r=e.size==null?e.mime:`${e.mime||`file`} · ${Di(e.size)}`,a=L(`span`,{class:`attachment-chip__body`},L(`span`,{class:`attachment-chip__name`},e.name),r?L(`span`,{class:`attachment-chip__meta`},r):null);return L(`div`,{class:`attachment-chip attachment-chip--${t}`},n,a)}#a(){let e=this.#n.length>0,t=this.text!=null||this.#t!=null,n=this.childNodes.length>0,r=t||n||!e,a=L(`div`,{class:`stack`,part:`stack`}),o=this.getAttribute(`timestamp`);if(o&&a.append(L(`span`,{class:`ts`,part:`timestamp`},o)),e){let e=L(`div`,{class:`attachments`,part:`attachments`});for(let t of this.#n)e.append(this.#i(t));a.append(e)}r&&a.append(L(`div`,{class:`b`,part:`bubble`},this.#r())),this.queued&&a.append(L(`span`,{class:`queued-tag`,part:`queued`},i(`clock`,{size:11}),`queued`));let s=L(`div`,{class:`msg user`,part:`message`},a);this.#e.replaceChildren(s)}});var Oi=`
1538
+ `),Di={image:`image`,text:`file-text`,file:`file`};function Oi(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}I(`slicc-user-message`,class extends HTMLElement{static observedAttributes=[`text`,`queued`,`timestamp`];#e;#t=null;#n=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ei]}connectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#a()}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get queued(){return this.hasAttribute(`queued`)}set queued(e){this.toggleAttribute(`queued`,e)}setBodyHtml(e){this.#t=e,this.#a()}setAttachments(e){this.#n=e.slice(),this.#a()}#r(){if(this.#t!=null)return this.ownerDocument.createRange().createContextualFragment(this.#t);let e=this.text;return e==null?L(`slot`):this.ownerDocument.createTextNode(e)}#i(e){let t=e.kind??`file`,n=L(`span`,{class:`attachment-chip__visual`});if(t===`image`&&e.src){let t=L(`img`,{src:e.src,alt:e.name||`Attached image`});t.addEventListener(`click`,n=>{n.stopPropagation(),Ti.show(e.src,t)}),n.append(t)}else n.append(i(Di[t],{size:16}));let r=e.size==null?e.mime:`${e.mime||`file`} · ${Oi(e.size)}`,a=L(`span`,{class:`attachment-chip__body`},L(`span`,{class:`attachment-chip__name`},e.name),r?L(`span`,{class:`attachment-chip__meta`},r):null);return L(`div`,{class:`attachment-chip attachment-chip--${t}`},n,a)}#a(){let e=this.#n.length>0,t=this.text!=null||this.#t!=null,n=this.childNodes.length>0,r=t||n||!e,a=L(`div`,{class:`stack`,part:`stack`}),o=this.getAttribute(`timestamp`);if(o&&a.append(L(`span`,{class:`ts`,part:`timestamp`},o)),e){let e=L(`div`,{class:`attachments`,part:`attachments`});for(let t of this.#n)e.append(this.#i(t));a.append(e)}r&&a.append(L(`div`,{class:`b`,part:`bubble`},this.#r())),this.queued&&a.append(L(`span`,{class:`queued-tag`,part:`queued`},i(`clock`,{size:11}),`queued`));let s=L(`div`,{class:`msg user`,part:`message`},a);this.#e.replaceChildren(s)}});var ki=`
1539
1539
  slicc-composer {
1540
1540
  flex: 0 0 auto;
1541
1541
  display: block;
@@ -1889,7 +1889,7 @@ slicc-composer .slicc-composer__ptt.is-picking {
1889
1889
  animation-name: none;
1890
1890
  }
1891
1891
  }
1892
- `,ki=`slicc-composer-style`;function Ai(e){if(e.getElementById(ki))return;let t=e.createElement(`style`);t.id=ki,t.textContent=Oi,(e.head??e.documentElement).appendChild(t)}var ji=1e3,Mi=60,Ni=1e4,Pi=45e3,Fi=1500;function Ii(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 Li=`slicc-composer:mic-device`;function Ri(){try{return typeof localStorage>`u`?null:localStorage.getItem(Li)}catch{return null}}function zi(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(Li,e):localStorage.removeItem(Li)}catch{}}function Bi(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`}I(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=!1;#l=null;#u=null;#d=null;#f=`unknown`;#p=Ri();#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=null;#w=null;#T=[];connectedCallback(){Ai(this.ownerDocument),this.#E(),this.addEventListener(`pointerdown`,this.#D)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#D),this.#l?.cancel(),this.#l=null,this.#N(),this.#i=!1,this.#o=null,this.#a++,this.#V(),this.#z(),this.#h&&clearTimeout(this.#h),this.#h=null,this.#B(),this.#q(),this.#ne()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#d??=et(),this.#d}set speech(e){this.#d=e,this.#f=`unknown`}get device(){return this.#p}set device(e){this.#p=e,zi(e)}get inner(){return this.#E(),this.#e}append(...e){this.#E(),this.#e.append(...e)}#E(){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)}#D=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t)||t.value!==``)return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}let n=this.ownerDocument;n.addEventListener(`pointerup`,this.#P),this.addEventListener(`pointercancel`,this.#F),n.addEventListener(`selectionchange`,this.#k);let r=this.#a;this.#g=setTimeout(()=>{this.#z(),this.#A(this.speech,r)},400)};toggleHandsFree(){return this.#i?(this.#c&&this.#I(!0),!1):this.#O()}#O(){if(!this.hasAttribute(`ptt`)||this.#r===`finalizing`||this.#r===`picking`)return!1;let e=this.querySelector(`textarea`);return!(e instanceof HTMLTextAreaElement)||e.value!==``?!1:(this.#i=!0,this.#c=!0,this.#a++,this.#o=e,this.#A(this.speech,this.#a),!0)}#k=()=>{if(!this.#g)return;let e=this.ownerDocument.getSelection();!e||e.isCollapsed||e.toString()===``||(this.#i=!1,this.#a++,this.#o=null,this.#z(),this.#V(),this.#B())};async#A(e,t){let n=await Promise.race([e.permission().then(e=>(this.#f=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),Mi))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#M(e,t);return}if(n===`denied`){this.#Y(`denied`);return}this.#Y(`enable`),this.#h=setTimeout(()=>{this.#h=null,this.#j(e,t)},ji),n===`pending`&&e.permission().then(n=>{this.#f=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#R(),this.#M(e,t)):n===`denied`&&(this.#R(),this.#Y(`denied`)))})}}#j(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#y=null,this.#Y(`prompting`),Ii(e.requestPermission(),Ni,Error(`Microphone didn't respond. Check your mic, then hold again.`)).then(n=>{this.#f=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#M(e,t):n?this.#ne():this.#i?this.#Y(`denied`):this.#ne())}).catch(e=>{this.#f=`denied`,t===this.#a&&(this.#i?(this.#y=e instanceof Error?e.message:String(e),this.#Y(`denied`)):this.#ne())}))}#M(e,t){this.#r=`recording`,this.#Y(`recording`),e.warmup(),this.#_?.(),this.#_=e.onStatus(e=>{this.#v=e,this.#ee()});let n=e.microphones();n.then(e=>{t===this.#a&&(this.#p??(this.#m=Xe(e)),Ye(e)&&this.#te(e))}).catch(()=>{});let r=(this.#p==null?Ii(n,Fi,Error(`microphone enumeration timed out`)).then(e=>Xe(e)).catch(()=>null):Promise.resolve(this.#p)).then(n=>e.start({deviceId:n??void 0,onPartial:e=>{t===this.#a&&this.#$(e)},onError:e=>{t===this.#a&&this.#$(e,!0)}}));this.#u=r,r.then(e=>{if(this.#u===r){if(this.#u=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#l=e}}).catch(e=>{this.#u===r&&(this.#u=null,t===this.#a&&this.#$(e instanceof Error?e.message:String(e),!0))})}#N(){let e=this.#u;this.#u=null,e!==null&&e.then(e=>e.cancel(),()=>{})}#P=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#C,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.#V(),this.#B(),this.#l?.cancel(),this.#l=null,this.#N(),this.#o=null,this.#H();return}this.#I(!0)};#F=e=>{(this.#s==null||e.pointerId===this.#s)&&this.#I(!1)};#I(e){if(!this.#i)return;switch(this.#i=!1,this.#c=!1,this.#z(),this.#V(),this.#B(),this.#r){case`enable`:this.#R(),this.#o=null,this.#ne();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#ne();return;case`recording`:break;default:this.#o=null,this.#ne();return}let t=this.#l;this.#l=null;let n=this.#u;if(this.#u=null,!e){t?.cancel(),n!==null&&n.then(e=>e.cancel(),()=>{}),this.#o=null,this.#ne();return}if(!t&&n===null){this.#o=null,this.#ne();return}this.#r=`finalizing`,this.#$(`Transcribing…`);let r=this.#a;Ii((t?Promise.resolve(t):n).then(e=>e.stop()),Pi,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#ne(),this.#L(e))}).catch(()=>{r===this.#a&&(this.#ne(),this.#o=null)})}#L(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`}}))}#R(){this.#h&&clearTimeout(this.#h),this.#h=null}#z(){this.#g&&clearTimeout(this.#g),this.#g=null,this.ownerDocument.removeEventListener(`selectionchange`,this.#k)}#B(){this.ownerDocument.removeEventListener(`pointerup`,this.#P),this.removeEventListener(`pointercancel`,this.#F)}#V(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#H(){this.#r=`picking`,this.#Q(`picking`),this.#b&&(this.#b.textContent=`Choose a microphone`),this.#x&&(this.#x.hidden=!0),this.#U();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#G,!0),e.addEventListener(`keydown`,this.#K,!0)}#U(){let e=this.#C;if(!e||this.#w)return;let t=L(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),n=null,r=this.#p??this.#m;for(let e of this.#T){let a=e.deviceId===r,o=L(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":a?`true`:`false`,"data-device-id":e.deviceId},e.label,L(`span`,{class:`tick`},i(`check`,{size:14})));o.addEventListener(`click`,()=>{this.device=e.deviceId,this.#J()}),(a||!n)&&(n=o),t.appendChild(o)}this.#w=t,e.appendChild(t),this.#W(t,e),n?.focus()}#W(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`}#G=e=>{this.#C&&e.composedPath().includes(this.#C)||this.#J()};#K=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#J())};#q(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#G,!0),e.removeEventListener(`keydown`,this.#K,!0)}#J(){this.#q(),this.#ne()}#Y(e){switch(this.#r=e,this.#n||(this.#n=L(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#Q(e),e){case`enable`:{let e=this.#c?`Enabling push to talk`:`Hold to enable push to talk`;this.#X(i(`mic`,{size:28}),e,this.#Z(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,e);break}case`prompting`:this.#X(i(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#Z(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#y?`Microphone unavailable`:`Microphone access is blocked`,t=this.#y??`Enable the microphone for this site in your browser settings, then hold again.`;this.#X(i(`mic-off`,{size:28}),e,L(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#C=L(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#x=L(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#S=L(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=L(`div`,{class:`slicc-composer__ptt-microw`},L(`div`,{class:`slicc-composer__ptt-mic`},i(`mic`,{size:28})),this.#C),t=this.#c?`Listening — press again to send`:`Listening — release to send`;this.#b=L(`div`,{class:`slicc-composer__ptt-label`},t),this.#n.replaceChildren(e,this.#b,this.#x,this.#S),this.#n.setAttribute(`aria-label`,t),this.#ee();break}}}#X(e,t,n){this.#n&&(this.#b=L(`div`,{class:`slicc-composer__ptt-label`},t),this.#x=null,this.#S=null,this.#C=null,this.#w=null,this.#T=[],this.#n.replaceChildren(L(`div`,{class:`slicc-composer__ptt-mic`},e),this.#b,n))}#Z(e){return L(`div`,{class:`slicc-composer__ptt-load`},L(`span`,{class:`slicc-composer__ptt-load-text`},e),L(`div`,{class:`slicc-composer__ptt-bar`},L(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#Q(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}`))}#$(e,t=!1){let n=this.#x;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}#ee(){let e=this.#S;if(!e)return;let t=this.#v;if(t?.state===`downloading`){if(t.download){let n=Bi(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)}#te(e){let t=this.#C;if(!t)return;this.#T=e;let n=L(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},i(`chevron-down`,{size:12}));n.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(n),t.hidden=!1}#ne(){this.#_?.(),this.#_=null,this.#n?.remove(),this.#n=null,this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=null,this.#T=[],this.#m=null,this.#y=null,this.#r=`idle`}});var Vi=`
1892
+ `,Ai=`slicc-composer-style`;function ji(e){if(e.getElementById(Ai))return;let t=e.createElement(`style`);t.id=Ai,t.textContent=ki,(e.head??e.documentElement).appendChild(t)}var Mi=1e3,Ni=60,Pi=1e4,Fi=45e3,Ii=1500;function Li(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 Ri=`slicc-composer:mic-device`;function zi(){try{return typeof localStorage>`u`?null:localStorage.getItem(Ri)}catch{return null}}function Bi(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(Ri,e):localStorage.removeItem(Ri)}catch{}}function Vi(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`}I(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=!1;#l=null;#u=null;#d=null;#f=`unknown`;#p=zi();#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=null;#w=null;#T=[];connectedCallback(){ji(this.ownerDocument),this.#E(),this.addEventListener(`pointerdown`,this.#D)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#D),this.#l?.cancel(),this.#l=null,this.#N(),this.#i=!1,this.#o=null,this.#a++,this.#V(),this.#z(),this.#h&&clearTimeout(this.#h),this.#h=null,this.#B(),this.#q(),this.#ne()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#d??=nt(),this.#d}set speech(e){this.#d=e,this.#f=`unknown`}get device(){return this.#p}set device(e){this.#p=e,Bi(e)}get inner(){return this.#E(),this.#e}append(...e){this.#E(),this.#e.append(...e)}#E(){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)}#D=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t)||t.value!==``)return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}let n=this.ownerDocument;n.addEventListener(`pointerup`,this.#P),this.addEventListener(`pointercancel`,this.#F),n.addEventListener(`selectionchange`,this.#k);let r=this.#a;this.#g=setTimeout(()=>{this.#z(),this.#A(this.speech,r)},400)};toggleHandsFree(){return this.#i?(this.#c&&this.#I(!0),!1):this.#O()}#O(){if(!this.hasAttribute(`ptt`)||this.#r===`finalizing`||this.#r===`picking`)return!1;let e=this.querySelector(`textarea`);return!(e instanceof HTMLTextAreaElement)||e.value!==``?!1:(this.#i=!0,this.#c=!0,this.#a++,this.#o=e,this.#A(this.speech,this.#a),!0)}#k=()=>{if(!this.#g)return;let e=this.ownerDocument.getSelection();!e||e.isCollapsed||e.toString()===``||(this.#i=!1,this.#a++,this.#o=null,this.#z(),this.#V(),this.#B())};async#A(e,t){let n=await Promise.race([e.permission().then(e=>(this.#f=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),Ni))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#M(e,t);return}if(n===`denied`){this.#Y(`denied`);return}this.#Y(`enable`),this.#h=setTimeout(()=>{this.#h=null,this.#j(e,t)},Mi),n===`pending`&&e.permission().then(n=>{this.#f=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#R(),this.#M(e,t)):n===`denied`&&(this.#R(),this.#Y(`denied`)))})}}#j(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#y=null,this.#Y(`prompting`),Li(e.requestPermission(),Pi,Error(`Microphone didn't respond. Check your mic, then hold again.`)).then(n=>{this.#f=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#M(e,t):n?this.#ne():this.#i?this.#Y(`denied`):this.#ne())}).catch(e=>{this.#f=`denied`,t===this.#a&&(this.#i?(this.#y=e instanceof Error?e.message:String(e),this.#Y(`denied`)):this.#ne())}))}#M(e,t){this.#r=`recording`,this.#Y(`recording`),e.warmup(),this.#_?.(),this.#_=e.onStatus(e=>{this.#v=e,this.#ee()});let n=e.microphones();n.then(e=>{t===this.#a&&(this.#p??(this.#m=Qe(e)),Ze(e)&&this.#te(e))}).catch(()=>{});let r=(this.#p==null?Li(n,Ii,Error(`microphone enumeration timed out`)).then(e=>Qe(e)).catch(()=>null):Promise.resolve(this.#p)).then(n=>e.start({deviceId:n??void 0,onPartial:e=>{t===this.#a&&this.#$(e)},onError:e=>{t===this.#a&&this.#$(e,!0)}}));this.#u=r,r.then(e=>{if(this.#u===r){if(this.#u=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#l=e}}).catch(e=>{this.#u===r&&(this.#u=null,t===this.#a&&this.#$(e instanceof Error?e.message:String(e),!0))})}#N(){let e=this.#u;this.#u=null,e!==null&&e.then(e=>e.cancel(),()=>{})}#P=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#C,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.#V(),this.#B(),this.#l?.cancel(),this.#l=null,this.#N(),this.#o=null,this.#H();return}this.#I(!0)};#F=e=>{(this.#s==null||e.pointerId===this.#s)&&this.#I(!1)};#I(e){if(!this.#i)return;switch(this.#i=!1,this.#c=!1,this.#z(),this.#V(),this.#B(),this.#r){case`enable`:this.#R(),this.#o=null,this.#ne();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#ne();return;case`recording`:break;default:this.#o=null,this.#ne();return}let t=this.#l;this.#l=null;let n=this.#u;if(this.#u=null,!e){t?.cancel(),n!==null&&n.then(e=>e.cancel(),()=>{}),this.#o=null,this.#ne();return}if(!t&&n===null){this.#o=null,this.#ne();return}this.#r=`finalizing`,this.#$(`Transcribing…`);let r=this.#a;Li((t?Promise.resolve(t):n).then(e=>e.stop()),Fi,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#ne(),this.#L(e))}).catch(()=>{r===this.#a&&(this.#ne(),this.#o=null)})}#L(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`}}))}#R(){this.#h&&clearTimeout(this.#h),this.#h=null}#z(){this.#g&&clearTimeout(this.#g),this.#g=null,this.ownerDocument.removeEventListener(`selectionchange`,this.#k)}#B(){this.ownerDocument.removeEventListener(`pointerup`,this.#P),this.removeEventListener(`pointercancel`,this.#F)}#V(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#H(){this.#r=`picking`,this.#Q(`picking`),this.#b&&(this.#b.textContent=`Choose a microphone`),this.#x&&(this.#x.hidden=!0),this.#U();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#G,!0),e.addEventListener(`keydown`,this.#K,!0)}#U(){let e=this.#C;if(!e||this.#w)return;let t=L(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),n=null,r=this.#p??this.#m;for(let e of this.#T){let a=e.deviceId===r,o=L(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":a?`true`:`false`,"data-device-id":e.deviceId},e.label,L(`span`,{class:`tick`},i(`check`,{size:14})));o.addEventListener(`click`,()=>{this.device=e.deviceId,this.#J()}),(a||!n)&&(n=o),t.appendChild(o)}this.#w=t,e.appendChild(t),this.#W(t,e),n?.focus()}#W(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`}#G=e=>{this.#C&&e.composedPath().includes(this.#C)||this.#J()};#K=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#J())};#q(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#G,!0),e.removeEventListener(`keydown`,this.#K,!0)}#J(){this.#q(),this.#ne()}#Y(e){switch(this.#r=e,this.#n||(this.#n=L(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#Q(e),e){case`enable`:{let e=this.#c?`Enabling push to talk`:`Hold to enable push to talk`;this.#X(i(`mic`,{size:28}),e,this.#Z(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,e);break}case`prompting`:this.#X(i(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#Z(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#y?`Microphone unavailable`:`Microphone access is blocked`,t=this.#y??`Enable the microphone for this site in your browser settings, then hold again.`;this.#X(i(`mic-off`,{size:28}),e,L(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#C=L(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#x=L(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#S=L(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=L(`div`,{class:`slicc-composer__ptt-microw`},L(`div`,{class:`slicc-composer__ptt-mic`},i(`mic`,{size:28})),this.#C),t=this.#c?`Listening — press again to send`:`Listening — release to send`;this.#b=L(`div`,{class:`slicc-composer__ptt-label`},t),this.#n.replaceChildren(e,this.#b,this.#x,this.#S),this.#n.setAttribute(`aria-label`,t),this.#ee();break}}}#X(e,t,n){this.#n&&(this.#b=L(`div`,{class:`slicc-composer__ptt-label`},t),this.#x=null,this.#S=null,this.#C=null,this.#w=null,this.#T=[],this.#n.replaceChildren(L(`div`,{class:`slicc-composer__ptt-mic`},e),this.#b,n))}#Z(e){return L(`div`,{class:`slicc-composer__ptt-load`},L(`span`,{class:`slicc-composer__ptt-load-text`},e),L(`div`,{class:`slicc-composer__ptt-bar`},L(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#Q(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}`))}#$(e,t=!1){let n=this.#x;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}#ee(){let e=this.#S;if(!e)return;let t=this.#v;if(t?.state===`downloading`){if(t.download){let n=Vi(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)}#te(e){let t=this.#C;if(!t)return;this.#T=e;let n=L(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},i(`chevron-down`,{size:12}));n.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(n),t.hidden=!1}#ne(){this.#_?.(),this.#_=null,this.#n?.remove(),this.#n=null,this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=null,this.#T=[],this.#m=null,this.#y=null,this.#r=`idle`}});var Hi=`
1893
1893
  slicc-composer-capture {
1894
1894
  position: relative;
1895
1895
  display: block;
@@ -2093,7 +2093,7 @@ slicc-composer-capture .slicc-capture__timer {
2093
2093
  slicc-composer-capture .slicc-capture__timer[hidden] {
2094
2094
  display: none;
2095
2095
  }
2096
- `,Hi=`slicc-composer-capture-style`;function Ui(e){if(e.getElementById(Hi))return;let t=e.createElement(`style`);t.id=Hi,t.textContent=Vi,(e.head??e.documentElement).appendChild(t)}var Wi=`photo`,Gi=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`];function Ki(){if(typeof MediaRecorder>`u`)return`video/webm`;for(let e of Gi)if(MediaRecorder.isTypeSupported?.(e))return e;return`video/webm`}function qi(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}I(`slicc-composer-capture`,class extends HTMLElement{static observedAttributes=[`mode`,`preferred-device`,`preferred-audio-device`];media=null;recorderFactory=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=null;#d=null;#f=null;#p=[];#m=0;#h=null;#g=null;#_=e=>{e.key===`Escape`&&this.#g&&this.#L()};connectedCallback(){Ui(this.ownerDocument),this.#H(),this.ownerDocument.addEventListener(`keydown`,this.#_)}disconnectedCallback(){if(this.ownerDocument.removeEventListener(`keydown`,this.#_),this.#N(),this.#P(),this.#I(),this.#g){let e=this.#g;this.#g=null,e(null)}}attributeChangedCallback(e,t,n){e===`mode`&&this.#l&&this.#z(n??Wi)}get mode(){return this.getAttribute(`mode`)===`video`?`video`:`photo`}set mode(e){e==null?this.removeAttribute(`mode`):this.setAttribute(`mode`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}get preferredAudioDevice(){return this.getAttribute(`preferred-audio-device`)}set preferredAudioDevice(e){e==null?this.removeAttribute(`preferred-audio-device`):this.setAttribute(`preferred-audio-device`,e)}#v(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}#y(e,t){return this.recorderFactory?this.recorderFactory(e,t):new MediaRecorder(e,t)}async open(e){this.#H(),e&&(this.mode=e),this.#z(this.mode);let t=this.#v();if(!t)return null;try{this.#u=await this.#b(t,this.preferredDevice,this.preferredAudioDevice,this.mode)}catch{return null}return this.#S(),this.#C(this.#u),await this.#w(t),await this.#T(t),this.hidden=!1,new Promise(e=>{this.#g=e})}async#b(e,t,n,r){let i=await this.#x(e,n,r);if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}},audio:i})}catch{}try{return await e.getUserMedia({video:!0,audio:i})}catch(t){if(i===!1)throw t;return this.#r.textContent=`Microphone unavailable — recording video only.`,e.getUserMedia({video:!0,audio:!1})}}async#x(e,t,n){if(n!==`video`)return!1;if(t)return{deviceId:{exact:t}};let r=[];try{r=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{r=[]}let i=Xe(Je(r,`microphone`));return!i||{deviceId:{exact:i}}}#S(){this.#d=this.#u?.getAudioTracks()[0]??null}#C(e){this.#e.srcObject=e,this.#e.muted=!0,this.#e.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#e.toggleAttribute(`data-mirrored`,t!==`environment`)}async#w(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}let n=Je(t,`camera`);this.#t.replaceChildren(...n.map(e=>L(`option`,{value:e.deviceId},e.label)));let r=this.#u?.getVideoTracks()[0]?.getSettings?.().deviceId;r&&(this.#t.value=r),this.#t.toggleAttribute(`hidden`,!Ye(n))}async#T(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{t=[]}let n=Je(t,`microphone`);this.#n.replaceChildren(...n.map(e=>L(`option`,{value:e.deviceId},e.label)));let r=this.#d?.getSettings?.().deviceId??this.preferredAudioDevice??Xe(n);r&&n.some(e=>e.deviceId===r)&&(this.#n.value=r),this.#E()}#E(){if(!this.#n)return;let e=this.#n.options.length>=2,t=this.mode===`video`&&e;this.#n.toggleAttribute(`hidden`,!t)}async#D(e){let t=this.#v();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#F();let r=n;if(this.mode===`video`&&this.#d&&this.#d.readyState===`live`)r.addTrack(this.#d);else if(this.mode===`video`)try{let e=await t.getUserMedia({audio:await this.#x(t,this.preferredAudioDevice,`video`)});for(let t of e.getAudioTracks())this.#d=t,r.addTrack(t)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}this.#u=r,this.#C(r),this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`camera`},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}async#O(e){let t=this.#v();if(!t||!this.#u)return;this.#r.textContent=``;let n;try{n=await t.getUserMedia({audio:{deviceId:{exact:e}}})}catch{this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}let r=n.getAudioTracks()[0];if(!r){this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}if(this.#d){try{this.#u.removeTrack(this.#d)}catch{}this.#d.stop()}this.#u.addTrack(r),this.#d=r,this.preferredAudioDevice=e,this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`microphone`},bubbles:!0,composed:!0}))}#k(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#e.videoWidth,e.height=this.#e.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#e,0,0);let t=`image/png`,n=e.toDataURL(t);this.#R({kind:`image`,dataUrl:n,mimeType:t,width:e.width,height:e.height})}#A(){if(!this.#u||this.#f)return;this.#p=[];let e=Ki(),t;try{t=this.#y(this.#u,{mimeType:e})}catch{this.#r.textContent=`Recording is not supported in this browser.`;return}t.ondataavailable=e=>{e.data&&e.data.size>0&&this.#p.push(e.data)},t.onstop=()=>this.#M(e);try{t.start()}catch{this.#r.textContent=`Could not start recording.`;return}this.#f=t,this.#m=Date.now(),this.#n.disabled=!0,this.#t.disabled=!0,this.#i.hidden=!1,this.#i.textContent=qi(0),this.#h=setInterval(()=>{this.#i.textContent=qi(Date.now()-this.#m)},250),this.#B()}#j(){let e=this.#f;if(e)try{e.state!==`inactive`&&e.stop()}catch{this.#M(e.mimeType||`video/webm`)}}#M(e){let t=this.#m?Date.now()-this.#m:0;this.#N();let n=this.#f?.mimeType||e||`video/webm`,r=new Blob(this.#p,{type:n});this.#p=[],this.#f=null,this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1);let i=typeof URL<`u`?URL.createObjectURL(r):void 0;this.#R({kind:`video`,blob:r,dataUrl:i,mimeType:n,width:this.#e.videoWidth,height:this.#e.videoHeight,durationMs:t})}#N(){this.#h!=null&&(clearInterval(this.#h),this.#h=null),this.#i.hidden=!0,this.#i.textContent=``,this.#m=0}#P(){let e=this.#f;if(this.#f=null,this.#p=[],this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1),e){e.ondataavailable=null,e.onstop=null;try{e.state!==`inactive`&&e.stop()}catch{}}}#F(){for(let e of this.#u?.getVideoTracks()??[])e.stop()}#I(){for(let e of this.#u?.getTracks()??[])e.stop();this.#u=null,this.#d=null,this.#e&&(this.#e.srcObject=null)}#L(){this.dispatchEvent(new CustomEvent(`slicc-capture-cancel`,{bubbles:!0,composed:!0})),this.#R(null)}#R(e){e&&this.dispatchEvent(new CustomEvent(`slicc-capture`,{detail:e,bubbles:!0,composed:!0})),this.#N(),this.#P(),this.#I();let t=this.#g;this.#g=null,this.hidden=!0,t?.(e)}#z(e){let t=e===`video`;this.#s.setAttribute(`aria-pressed`,String(!t)),this.#c.setAttribute(`aria-pressed`,String(t)),this.#r.textContent=t?`Mic on — video will record audio.`:``,this.#B(),this.#E()}#B(){let e=this.#a;if(e.replaceChildren(),this.mode===`photo`){e.className=`slicc-capture__btn slicc-capture__btn--primary`,e.setAttribute(`part`,`snap`),e.setAttribute(`aria-label`,`Snap photo`),e.append(i(`camera`,{size:14}),document.createTextNode(` Snap`));return}this.#f?(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`stop`),e.setAttribute(`aria-label`,`Stop recording`),e.append(L(`span`,{class:`slicc-capture__square`}),document.createTextNode(` Stop`))):(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`record`),e.setAttribute(`aria-label`,`Start recording`),e.append(L(`span`,{class:`slicc-capture__dot`}),document.createTextNode(` Record`)))}#V(){if(this.mode===`photo`){this.#k();return}this.#f?this.#j():this.#A()}#H(){if(this.#l)return;this.#l=!0,this.#e=L(`video`,{class:`slicc-capture__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#e.muted=!0,this.#r=L(`div`,{class:`slicc-capture__status`}),this.#t=L(`select`,{class:`slicc-capture__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#t.addEventListener(`change`,()=>{this.#D(this.#t.value)}),this.#n=L(`select`,{class:`slicc-capture__select`,part:`audio-picker`,"aria-label":`Microphone`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#O(this.#n.value)}),this.#s=L(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`true`,"aria-label":`Photo`},i(`image`,{size:14})),this.#s.addEventListener(`click`,()=>{this.mode=`photo`}),this.#c=L(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`false`,"aria-label":`Video`},i(`video`,{size:14})),this.#c.addEventListener(`click`,()=>{this.#U()});let e=L(`div`,{class:`slicc-capture__mode`,role:`group`,"aria-label":`Capture mode`},this.#s,this.#c);this.#i=L(`span`,{class:`slicc-capture__timer`,hidden:!0}),this.#o=L(`button`,{type:`button`,class:`slicc-capture__close`,part:`cancel`,"aria-label":`Cancel`},i(`x`,{size:14})),this.#o.addEventListener(`click`,()=>this.#L()),this.#a=L(`button`,{type:`button`,class:`slicc-capture__btn slicc-capture__btn--primary`,part:`snap`,"aria-label":`Snap photo`}),this.#a.addEventListener(`click`,()=>this.#V());let t=L(`div`,{class:`slicc-capture__bar`},this.#t,this.#n,L(`span`,{class:`slicc-capture__spacer`}),this.#i,this.#a,e);this.replaceChildren(this.#e,this.#r,t,this.#o),this.#z(this.mode)}async#U(){if(this.mode=`video`,!this.#u||this.#u.getAudioTracks().length>0)return;let e=this.#v();if(!e)return;let t=this.#u.getVideoTracks()[0]?.getSettings?.().deviceId??this.preferredDevice??null,n=await this.#x(e,this.preferredAudioDevice,`video`);try{let r=t?await e.getUserMedia({video:{deviceId:{exact:t}},audio:n}):await e.getUserMedia({video:!0,audio:n});this.#I(),this.#u=r,this.#S(),this.#C(r),await this.#T(e)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}}});var Ji=[`off`,`low`,`medium`,`high`,`xhigh`,`max`],Yi={off:{label:`Secco`,gloss:`bone dry — not a drop (ask any prosecco)`,tint:`var(--txt-3)`},low:{label:`Goccia`,gloss:`one drop — bar-speak: «macchiato, solo una goccia»`,tint:`color-mix(in srgb, var(--violet) 20%, var(--txt-3))`},medium:{label:`Bagnato`,gloss:`properly wet`,tint:`color-mix(in srgb, var(--violet) 40%, var(--txt-3))`},high:{label:`Affogato`,gloss:`drowned — the menu item itself`,tint:`color-mix(in srgb, var(--violet) 60%, var(--txt-3))`},xhigh:{label:`Inzuppato`,gloss:`soaked through, biscotto-style`,tint:`color-mix(in srgb, var(--violet) 80%, var(--txt-3))`},max:{label:`Sprofondato`,gloss:`sunk to the bottom`,tint:`var(--violet)`}},Xi=`max`,Zi=`Opus 4.8`,Qi=[{name:`Opus 4.8`,provider:`Anthropic`,id:`claude-opus-4-8`},{name:`Sonnet 4.6`,provider:`Anthropic`,id:`claude-sonnet-4-6`},{name:`Haiku 4.5`,provider:`Anthropic`,id:`claude-haiku-4-5`}],$i=8;function ea(e){let t=typeof e==`string`?{name:e}:e;return{...t,name:t.name,id:t.id??t.name}}var ta=`max`,na=13;function ra(){return i(`sparkles`,{size:na,class:`ic`,part:`model-icon`})}function ia(){return i(`brain`,{size:na,class:`brain`,part:`brain`})}function aa(){return i(`chevron-down`,{size:11,part:`caret`})}var oa=`http://www.w3.org/2000/svg`;function sa(){let e=document.createElementNS(oa,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`style`,`position:absolute`);let t=document.createElementNS(oa,`defs`),n=document.createElementNS(oa,`linearGradient`);n.setAttribute(`id`,`meta-rainbow`),n.setAttribute(`x1`,`0`),n.setAttribute(`y1`,`0`),n.setAttribute(`x2`,`1`),n.setAttribute(`y2`,`0`);for(let[e,t]of[[`0%`,`#f43f5e`],[`28%`,`#f59e0b`],[`64%`,`#06b6d4`],[`100%`,`#8b5cf6`]]){let r=document.createElementNS(oa,`stop`);r.setAttribute(`offset`,e),r.setAttribute(`stop-color`,t),n.appendChild(r)}return t.appendChild(n),e.appendChild(t),e}var ca=R(`
2096
+ `,Ui=`slicc-composer-capture-style`;function Wi(e){if(e.getElementById(Ui))return;let t=e.createElement(`style`);t.id=Ui,t.textContent=Hi,(e.head??e.documentElement).appendChild(t)}var Gi=`photo`,Ki=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`];function qi(){if(typeof MediaRecorder>`u`)return`video/webm`;for(let e of Ki)if(MediaRecorder.isTypeSupported?.(e))return e;return`video/webm`}function Ji(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}I(`slicc-composer-capture`,class extends HTMLElement{static observedAttributes=[`mode`,`preferred-device`,`preferred-audio-device`];media=null;recorderFactory=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=null;#d=null;#f=null;#p=[];#m=0;#h=null;#g=null;#_=e=>{e.key===`Escape`&&this.#g&&this.#L()};connectedCallback(){Wi(this.ownerDocument),this.#H(),this.ownerDocument.addEventListener(`keydown`,this.#_)}disconnectedCallback(){if(this.ownerDocument.removeEventListener(`keydown`,this.#_),this.#N(),this.#P(),this.#I(),this.#g){let e=this.#g;this.#g=null,e(null)}}attributeChangedCallback(e,t,n){e===`mode`&&this.#l&&this.#z(n??Gi)}get mode(){return this.getAttribute(`mode`)===`video`?`video`:`photo`}set mode(e){e==null?this.removeAttribute(`mode`):this.setAttribute(`mode`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}get preferredAudioDevice(){return this.getAttribute(`preferred-audio-device`)}set preferredAudioDevice(e){e==null?this.removeAttribute(`preferred-audio-device`):this.setAttribute(`preferred-audio-device`,e)}#v(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}#y(e,t){return this.recorderFactory?this.recorderFactory(e,t):new MediaRecorder(e,t)}async open(e){this.#H(),e&&(this.mode=e),this.#z(this.mode);let t=this.#v();if(!t)return null;try{this.#u=await this.#b(t,this.preferredDevice,this.preferredAudioDevice,this.mode)}catch{return null}return this.#S(),this.#C(this.#u),await this.#w(t),await this.#T(t),this.hidden=!1,new Promise(e=>{this.#g=e})}async#b(e,t,n,r){let i=await this.#x(e,n,r);if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}},audio:i})}catch{}try{return await e.getUserMedia({video:!0,audio:i})}catch(t){if(i===!1)throw t;return this.#r.textContent=`Microphone unavailable — recording video only.`,e.getUserMedia({video:!0,audio:!1})}}async#x(e,t,n){if(n!==`video`)return!1;if(t)return{deviceId:{exact:t}};let r=[];try{r=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{r=[]}let i=Qe(Xe(r,`microphone`));return!i||{deviceId:{exact:i}}}#S(){this.#d=this.#u?.getAudioTracks()[0]??null}#C(e){this.#e.srcObject=e,this.#e.muted=!0,this.#e.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#e.toggleAttribute(`data-mirrored`,t!==`environment`)}async#w(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}let n=Xe(t,`camera`);this.#t.replaceChildren(...n.map(e=>L(`option`,{value:e.deviceId},e.label)));let r=this.#u?.getVideoTracks()[0]?.getSettings?.().deviceId;r&&(this.#t.value=r),this.#t.toggleAttribute(`hidden`,!Ze(n))}async#T(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{t=[]}let n=Xe(t,`microphone`);this.#n.replaceChildren(...n.map(e=>L(`option`,{value:e.deviceId},e.label)));let r=this.#d?.getSettings?.().deviceId??this.preferredAudioDevice??Qe(n);r&&n.some(e=>e.deviceId===r)&&(this.#n.value=r),this.#E()}#E(){if(!this.#n)return;let e=this.#n.options.length>=2,t=this.mode===`video`&&e;this.#n.toggleAttribute(`hidden`,!t)}async#D(e){let t=this.#v();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#F();let r=n;if(this.mode===`video`&&this.#d&&this.#d.readyState===`live`)r.addTrack(this.#d);else if(this.mode===`video`)try{let e=await t.getUserMedia({audio:await this.#x(t,this.preferredAudioDevice,`video`)});for(let t of e.getAudioTracks())this.#d=t,r.addTrack(t)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}this.#u=r,this.#C(r),this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`camera`},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}async#O(e){let t=this.#v();if(!t||!this.#u)return;this.#r.textContent=``;let n;try{n=await t.getUserMedia({audio:{deviceId:{exact:e}}})}catch{this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}let r=n.getAudioTracks()[0];if(!r){this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}if(this.#d){try{this.#u.removeTrack(this.#d)}catch{}this.#d.stop()}this.#u.addTrack(r),this.#d=r,this.preferredAudioDevice=e,this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`microphone`},bubbles:!0,composed:!0}))}#k(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#e.videoWidth,e.height=this.#e.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#e,0,0);let t=`image/png`,n=e.toDataURL(t);this.#R({kind:`image`,dataUrl:n,mimeType:t,width:e.width,height:e.height})}#A(){if(!this.#u||this.#f)return;this.#p=[];let e=qi(),t;try{t=this.#y(this.#u,{mimeType:e})}catch{this.#r.textContent=`Recording is not supported in this browser.`;return}t.ondataavailable=e=>{e.data&&e.data.size>0&&this.#p.push(e.data)},t.onstop=()=>this.#M(e);try{t.start()}catch{this.#r.textContent=`Could not start recording.`;return}this.#f=t,this.#m=Date.now(),this.#n.disabled=!0,this.#t.disabled=!0,this.#i.hidden=!1,this.#i.textContent=Ji(0),this.#h=setInterval(()=>{this.#i.textContent=Ji(Date.now()-this.#m)},250),this.#B()}#j(){let e=this.#f;if(e)try{e.state!==`inactive`&&e.stop()}catch{this.#M(e.mimeType||`video/webm`)}}#M(e){let t=this.#m?Date.now()-this.#m:0;this.#N();let n=this.#f?.mimeType||e||`video/webm`,r=new Blob(this.#p,{type:n});this.#p=[],this.#f=null,this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1);let i=typeof URL<`u`?URL.createObjectURL(r):void 0;this.#R({kind:`video`,blob:r,dataUrl:i,mimeType:n,width:this.#e.videoWidth,height:this.#e.videoHeight,durationMs:t})}#N(){this.#h!=null&&(clearInterval(this.#h),this.#h=null),this.#i.hidden=!0,this.#i.textContent=``,this.#m=0}#P(){let e=this.#f;if(this.#f=null,this.#p=[],this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1),e){e.ondataavailable=null,e.onstop=null;try{e.state!==`inactive`&&e.stop()}catch{}}}#F(){for(let e of this.#u?.getVideoTracks()??[])e.stop()}#I(){for(let e of this.#u?.getTracks()??[])e.stop();this.#u=null,this.#d=null,this.#e&&(this.#e.srcObject=null)}#L(){this.dispatchEvent(new CustomEvent(`slicc-capture-cancel`,{bubbles:!0,composed:!0})),this.#R(null)}#R(e){e&&this.dispatchEvent(new CustomEvent(`slicc-capture`,{detail:e,bubbles:!0,composed:!0})),this.#N(),this.#P(),this.#I();let t=this.#g;this.#g=null,this.hidden=!0,t?.(e)}#z(e){let t=e===`video`;this.#s.setAttribute(`aria-pressed`,String(!t)),this.#c.setAttribute(`aria-pressed`,String(t)),this.#r.textContent=t?`Mic on — video will record audio.`:``,this.#B(),this.#E()}#B(){let e=this.#a;if(e.replaceChildren(),this.mode===`photo`){e.className=`slicc-capture__btn slicc-capture__btn--primary`,e.setAttribute(`part`,`snap`),e.setAttribute(`aria-label`,`Snap photo`),e.append(i(`camera`,{size:14}),document.createTextNode(` Snap`));return}this.#f?(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`stop`),e.setAttribute(`aria-label`,`Stop recording`),e.append(L(`span`,{class:`slicc-capture__square`}),document.createTextNode(` Stop`))):(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`record`),e.setAttribute(`aria-label`,`Start recording`),e.append(L(`span`,{class:`slicc-capture__dot`}),document.createTextNode(` Record`)))}#V(){if(this.mode===`photo`){this.#k();return}this.#f?this.#j():this.#A()}#H(){if(this.#l)return;this.#l=!0,this.#e=L(`video`,{class:`slicc-capture__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#e.muted=!0,this.#r=L(`div`,{class:`slicc-capture__status`}),this.#t=L(`select`,{class:`slicc-capture__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#t.addEventListener(`change`,()=>{this.#D(this.#t.value)}),this.#n=L(`select`,{class:`slicc-capture__select`,part:`audio-picker`,"aria-label":`Microphone`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#O(this.#n.value)}),this.#s=L(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`true`,"aria-label":`Photo`},i(`image`,{size:14})),this.#s.addEventListener(`click`,()=>{this.mode=`photo`}),this.#c=L(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`false`,"aria-label":`Video`},i(`video`,{size:14})),this.#c.addEventListener(`click`,()=>{this.#U()});let e=L(`div`,{class:`slicc-capture__mode`,role:`group`,"aria-label":`Capture mode`},this.#s,this.#c);this.#i=L(`span`,{class:`slicc-capture__timer`,hidden:!0}),this.#o=L(`button`,{type:`button`,class:`slicc-capture__close`,part:`cancel`,"aria-label":`Cancel`},i(`x`,{size:14})),this.#o.addEventListener(`click`,()=>this.#L()),this.#a=L(`button`,{type:`button`,class:`slicc-capture__btn slicc-capture__btn--primary`,part:`snap`,"aria-label":`Snap photo`}),this.#a.addEventListener(`click`,()=>this.#V());let t=L(`div`,{class:`slicc-capture__bar`},this.#t,this.#n,L(`span`,{class:`slicc-capture__spacer`}),this.#i,this.#a,e);this.replaceChildren(this.#e,this.#r,t,this.#o),this.#z(this.mode)}async#U(){if(this.mode=`video`,!this.#u||this.#u.getAudioTracks().length>0)return;let e=this.#v();if(!e)return;let t=this.#u.getVideoTracks()[0]?.getSettings?.().deviceId??this.preferredDevice??null,n=await this.#x(e,this.preferredAudioDevice,`video`);try{let r=t?await e.getUserMedia({video:{deviceId:{exact:t}},audio:n}):await e.getUserMedia({video:!0,audio:n});this.#I(),this.#u=r,this.#S(),this.#C(r),await this.#T(e)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}}});var Yi=[`off`,`low`,`medium`,`high`,`xhigh`,`max`],Xi={off:{label:`Secco`,gloss:`bone dry — not a drop (ask any prosecco)`,tint:`var(--txt-3)`},low:{label:`Goccia`,gloss:`one drop — bar-speak: «macchiato, solo una goccia»`,tint:`color-mix(in srgb, var(--violet) 20%, var(--txt-3))`},medium:{label:`Bagnato`,gloss:`properly wet`,tint:`color-mix(in srgb, var(--violet) 40%, var(--txt-3))`},high:{label:`Affogato`,gloss:`drowned — the menu item itself`,tint:`color-mix(in srgb, var(--violet) 60%, var(--txt-3))`},xhigh:{label:`Inzuppato`,gloss:`soaked through, biscotto-style`,tint:`color-mix(in srgb, var(--violet) 80%, var(--txt-3))`},max:{label:`Sprofondato`,gloss:`sunk to the bottom`,tint:`var(--violet)`}},Zi=`max`,Qi=`Opus 4.8`,$i=[{name:`Opus 4.8`,provider:`Anthropic`,id:`claude-opus-4-8`},{name:`Sonnet 4.6`,provider:`Anthropic`,id:`claude-sonnet-4-6`},{name:`Haiku 4.5`,provider:`Anthropic`,id:`claude-haiku-4-5`}],ea=8;function ta(e){let t=typeof e==`string`?{name:e}:e;return{...t,name:t.name,id:t.id??t.name}}var na=`max`,ra=13;function ia(){return i(`sparkles`,{size:ra,class:`ic`,part:`model-icon`})}function aa(){return i(`brain`,{size:ra,class:`brain`,part:`brain`})}function oa(){return i(`chevron-down`,{size:11,part:`caret`})}var sa=`http://www.w3.org/2000/svg`;function ca(){let e=document.createElementNS(sa,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`style`,`position:absolute`);let t=document.createElementNS(sa,`defs`),n=document.createElementNS(sa,`linearGradient`);n.setAttribute(`id`,`meta-rainbow`),n.setAttribute(`x1`,`0`),n.setAttribute(`y1`,`0`),n.setAttribute(`x2`,`1`),n.setAttribute(`y2`,`0`);for(let[e,t]of[[`0%`,`#f43f5e`],[`28%`,`#f59e0b`],[`64%`,`#06b6d4`],[`100%`,`#8b5cf6`]]){let r=document.createElementNS(sa,`stop`);r.setAttribute(`offset`,e),r.setAttribute(`stop-color`,t),n.appendChild(r)}return t.appendChild(n),e.appendChild(t),e}var la=R(`
2097
2097
  :host{display:block;}
2098
2098
  *{box-sizing:border-box;}
2099
2099
  .meta{display:flex;align-items:center;gap:8px;max-width:680px;margin:11px auto 0;font-family:var(--ui);}
@@ -2150,7 +2150,7 @@ slicc-composer-capture .slicc-capture__timer[hidden] {
2150
2150
  /* Narrow / extension-sidebar: the ⏎ / ⇧⏎ keyboard hints don't fit (and touch
2151
2151
  users have no keyboard) — drop them regardless of the narrow-chat attribute. */
2152
2152
  @media (max-width: 560px){ .hint{display:none;} }
2153
- `);I(`slicc-composer-meta`,class extends HTMLElement{static observedAttributes=[`model`,`thinking`,`narrow`,`no-thinking`];#e;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=null;#u=!1;#d=!1;#f=``;#p=e=>{let t=e.composedPath();this.#u&&!t.includes(this)&&this.#C(),this.#d&&!t.includes(this)&&this.#O()};#m=e=>{e.key===`Escape`&&(this.#u&&(e.stopPropagation(),this.#C(),this.#r?.focus()),this.#d&&(e.stopPropagation(),this.#O(),this.#i?.focus()))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ca]}connectedCallback(){this.#_()}disconnectedCallback(){this.#b(),document.removeEventListener(`mousedown`,this.#p),document.removeEventListener(`keydown`,this.#m,!0)}attributeChangedCallback(){this.isConnected&&this.#_()}get model(){return this.getAttribute(`model`)??Zi}set model(e){e==null?this.removeAttribute(`model`):this.setAttribute(`model`,e)}get selectedModelId(){return this.#l}set selectedModelId(e){this.#l=e??null}get models(){return(this.#c??[...Qi]).map(e=>typeof e==`string`?e:{...e})}set models(e){this.#c=Array.isArray(e)?e.slice():null,this.isConnected&&this.#_()}get#h(){return(this.#c??Qi).map(ea)}get#g(){return this.#c!==null&&this.#c.length===0}get thinking(){let e=this.getAttribute(`thinking`);return Ji.includes(e??``)?e:ta}set thinking(e){this.setAttribute(`thinking`,e)}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){this.toggleAttribute(`narrow`,e)}get noThinking(){return this.hasAttribute(`no-thinking`)}set noThinking(e){this.toggleAttribute(`no-thinking`,e)}get accented(){return this.thinking===Xi}#_(){this.#b();let e=this.model,t=this.thinking,n=Yi[t],r=t===Xi,a=this.#g,o=a?L(`button`,{type:`button`,class:`ctl msel`,part:`model`},ra(),` `,`Add AI`):L(`button`,{type:`button`,class:`ctl msel`,part:`model`,"aria-haspopup":`menu`,"aria-expanded":`false`},ra(),` `,e,` `,L(`span`,{class:`cx`},aa())),s=L(`div`,{class:`menu`,part:`model-menu`,role:`menu`});if(this.#h.length>$i){let e=L(`input`,{class:`msearch`,part:`model-search`,type:`text`,placeholder:`Search models…`,"aria-label":`Search models`});e.value=this.#f,e.addEventListener(`input`,()=>{this.#f=e.value,this.#v()}),e.addEventListener(`click`,e=>e.stopPropagation()),s.append(e)}this.#s=L(`div`,{class:`mlist`,role:`none`}),s.append(this.#s);let c=L(`div`,{class:`mwrap`},o,s),l=!this.noThinking&&!a,u=null;if(l){let e=ia();e.style.color=n.tint;let a=L(`button`,{type:`button`,class:`ctl tsel${r?` x`:``}`,part:`thinking`,title:n.gloss,"aria-haspopup":`menu`,"aria-expanded":`false`},e,` `,L(`span`,{class:`tlabel`},n.label),` `,L(`span`,{class:`cx`},aa()));a.style.setProperty(`--tw`,n.tint);let o=L(`div`,{class:`menu tmenu`,part:`thinking-menu`,role:`menu`}),s=L(`div`,{class:`mlist`,role:`none`});for(let e of Ji){let n=Yi[e],r=L(`button`,{type:`button`,class:`mitem titem`,role:`menuitemradio`,"data-level":e,"aria-selected":e===t?`true`:`false`,title:n.gloss},L(`span`,{class:`mname`},n.label),L(`span`,{class:`tick`},i(`check`,{size:14})));r.addEventListener(`click`,()=>this.#A(e)),s.append(r)}o.append(s),u=L(`div`,{class:`twrap`},a,o)}let d=L(`slot`,{name:`hint`});Ln(d,[L(`span`,{class:`kbd`},`⏎`),` send `,L(`span`,{class:`sep`}),` `,L(`span`,{class:`kbd`},`⇧⏎`),` newline`]);let f=L(`div`,{class:`meta`,part:`meta`},c,u??!1,L(`div`,{class:`mspacer`}),L(`span`,{class:`hint`,part:`hint`},d));this.#e.replaceChildren(sa(),f),this.#a=c,this.#o=this.#e.querySelector(`.twrap`),this.#r=this.#e.querySelector(`.msel`),this.#i=this.#e.querySelector(`.tsel`),this.#v(),this.#w(),this.#k(),this.#y()}#v(){let e=this.#s;if(!e)return;let t=this.#f.trim().toLowerCase(),n=this.#h.filter(e=>!t||`${e.name} ${e.provider??``}`.toLowerCase().includes(t)),r=this.model,a=[];for(let e of n){let t=this.#l?e.id===this.#l:e.name===r,n=L(`button`,{type:`button`,class:`mitem`,role:`menuitemradio`,"data-id":e.id,"aria-selected":t?`true`:`false`},L(`span`,{class:`mname`},e.name),e.provider?L(`span`,{class:`mprov`},e.provider):!1,L(`span`,{class:`tick`},i(`check`,{size:14})));n.addEventListener(`click`,()=>this.#T(e.id)),a.push(n)}e.replaceChildren(...a.length?a:[L(`div`,{class:`mempty`},`No models match.`)])}#y(){this.#r&&(this.#t=e=>{if(e.stopPropagation(),this.#g){this.dispatchEvent(new CustomEvent(`add-ai`,{bubbles:!0,composed:!0}));return}this.#x()},this.#r.addEventListener(`click`,this.#t)),this.#i&&(this.#n=()=>this.#E(),this.#i.addEventListener(`click`,this.#n))}#b(){this.#r&&this.#t&&this.#r.removeEventListener(`click`,this.#t),this.#i&&this.#n&&this.#i.removeEventListener(`click`,this.#n),this.#t=null,this.#n=null,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#s=null}get menuOpen(){return this.#u}openMenu(){this.#g||this.#S()}cycleModel(){if(this.#g)return;let e=this.#h;if(e.length===0)return;let t=this.#l?e.findIndex(e=>e.id===this.#l):-1;t<0&&(t=e.findIndex(e=>e.name===this.model));let n=e[(t+1)%e.length];n&&this.#T(n.id)}cycleThinking(){if(this.noThinking)return;let e=Ji[(Ji.indexOf(this.thinking)+1)%Ji.length];e&&this.#A(e)}#x(){this.#u?this.#C():this.#S()}#S(){if(this.#u)return;this.#O(),this.#u=!0,this.#f=``,this.#v(),this.#w();let e=this.#e.querySelector(`.msearch`);e&&(e.value=``,requestAnimationFrame(()=>e.focus())),document.addEventListener(`mousedown`,this.#p),document.addEventListener(`keydown`,this.#m,!0)}#C(){this.#u&&(this.#u=!1,this.#w(),this.#d||(document.removeEventListener(`mousedown`,this.#p),document.removeEventListener(`keydown`,this.#m,!0)))}#w(){this.#a?.classList.toggle(`open`,this.#u),this.#r?.setAttribute(`aria-expanded`,this.#u?`true`:`false`)}#T(e){let t=this.#h.find(t=>t.id===e)??{name:e,id:e,provider:void 0};this.#l=t.id,this.#C(),t.name!==this.model&&(this.model=t.name),this.dispatchEvent(new CustomEvent(`model-change`,{detail:{model:t.name,provider:t.provider,id:t.id},bubbles:!0,composed:!0}))}#E(){this.#d?this.#O():this.#D()}#D(){this.#d||(this.#C(),this.#d=!0,this.#k(),document.addEventListener(`mousedown`,this.#p),document.addEventListener(`keydown`,this.#m,!0))}#O(){this.#d&&(this.#d=!1,this.#k(),this.#u||(document.removeEventListener(`mousedown`,this.#p),document.removeEventListener(`keydown`,this.#m,!0)))}#k(){this.#o?.classList.toggle(`open`,this.#d),this.#i?.setAttribute(`aria-expanded`,this.#d?`true`:`false`)}#A(e){this.#O(),this.thinking=e,this.dispatchEvent(new CustomEvent(`thinking-change`,{detail:{thinking:e,label:Yi[e].label,accented:e===Xi},bubbles:!0,composed:!0}))}});async function la(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(``)}async function ua(e,t={}){let n=(e??``).trim().toLowerCase();if(n===``)return null;let r=await la(n),i=t.size??80,a=t.fallback??`mp`;return`https://www.gravatar.com/avatar/${r}?s=${i}&d=${encodeURIComponent(a)}`}var da=R(`
2153
+ `);I(`slicc-composer-meta`,class extends HTMLElement{static observedAttributes=[`model`,`thinking`,`narrow`,`no-thinking`];#e;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=null;#u=!1;#d=!1;#f=``;#p=e=>{let t=e.composedPath();this.#u&&!t.includes(this)&&this.#C(),this.#d&&!t.includes(this)&&this.#O()};#m=e=>{e.key===`Escape`&&(this.#u&&(e.stopPropagation(),this.#C(),this.#r?.focus()),this.#d&&(e.stopPropagation(),this.#O(),this.#i?.focus()))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[la]}connectedCallback(){this.#_()}disconnectedCallback(){this.#b(),document.removeEventListener(`mousedown`,this.#p),document.removeEventListener(`keydown`,this.#m,!0)}attributeChangedCallback(){this.isConnected&&this.#_()}get model(){return this.getAttribute(`model`)??Qi}set model(e){e==null?this.removeAttribute(`model`):this.setAttribute(`model`,e)}get selectedModelId(){return this.#l}set selectedModelId(e){this.#l=e??null}get models(){return(this.#c??[...$i]).map(e=>typeof e==`string`?e:{...e})}set models(e){this.#c=Array.isArray(e)?e.slice():null,this.isConnected&&this.#_()}get#h(){return(this.#c??$i).map(ta)}get#g(){return this.#c!==null&&this.#c.length===0}get thinking(){let e=this.getAttribute(`thinking`);return Yi.includes(e??``)?e:na}set thinking(e){this.setAttribute(`thinking`,e)}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){this.toggleAttribute(`narrow`,e)}get noThinking(){return this.hasAttribute(`no-thinking`)}set noThinking(e){this.toggleAttribute(`no-thinking`,e)}get accented(){return this.thinking===Zi}#_(){this.#b();let e=this.model,t=this.thinking,n=Xi[t],r=t===Zi,a=this.#g,o=a?L(`button`,{type:`button`,class:`ctl msel`,part:`model`},ia(),` `,`Add AI`):L(`button`,{type:`button`,class:`ctl msel`,part:`model`,"aria-haspopup":`menu`,"aria-expanded":`false`},ia(),` `,e,` `,L(`span`,{class:`cx`},oa())),s=L(`div`,{class:`menu`,part:`model-menu`,role:`menu`});if(this.#h.length>ea){let e=L(`input`,{class:`msearch`,part:`model-search`,type:`text`,placeholder:`Search models…`,"aria-label":`Search models`});e.value=this.#f,e.addEventListener(`input`,()=>{this.#f=e.value,this.#v()}),e.addEventListener(`click`,e=>e.stopPropagation()),s.append(e)}this.#s=L(`div`,{class:`mlist`,role:`none`}),s.append(this.#s);let c=L(`div`,{class:`mwrap`},o,s),l=!this.noThinking&&!a,u=null;if(l){let e=aa();e.style.color=n.tint;let a=L(`button`,{type:`button`,class:`ctl tsel${r?` x`:``}`,part:`thinking`,title:n.gloss,"aria-haspopup":`menu`,"aria-expanded":`false`},e,` `,L(`span`,{class:`tlabel`},n.label),` `,L(`span`,{class:`cx`},oa()));a.style.setProperty(`--tw`,n.tint);let o=L(`div`,{class:`menu tmenu`,part:`thinking-menu`,role:`menu`}),s=L(`div`,{class:`mlist`,role:`none`});for(let e of Yi){let n=Xi[e],r=L(`button`,{type:`button`,class:`mitem titem`,role:`menuitemradio`,"data-level":e,"aria-selected":e===t?`true`:`false`,title:n.gloss},L(`span`,{class:`mname`},n.label),L(`span`,{class:`tick`},i(`check`,{size:14})));r.addEventListener(`click`,()=>this.#A(e)),s.append(r)}o.append(s),u=L(`div`,{class:`twrap`},a,o)}let d=L(`slot`,{name:`hint`});Rn(d,[L(`span`,{class:`kbd`},`⏎`),` send `,L(`span`,{class:`sep`}),` `,L(`span`,{class:`kbd`},`⇧⏎`),` newline`]);let f=L(`div`,{class:`meta`,part:`meta`},c,u??!1,L(`div`,{class:`mspacer`}),L(`span`,{class:`hint`,part:`hint`},d));this.#e.replaceChildren(ca(),f),this.#a=c,this.#o=this.#e.querySelector(`.twrap`),this.#r=this.#e.querySelector(`.msel`),this.#i=this.#e.querySelector(`.tsel`),this.#v(),this.#w(),this.#k(),this.#y()}#v(){let e=this.#s;if(!e)return;let t=this.#f.trim().toLowerCase(),n=this.#h.filter(e=>!t||`${e.name} ${e.provider??``}`.toLowerCase().includes(t)),r=this.model,a=[];for(let e of n){let t=this.#l?e.id===this.#l:e.name===r,n=L(`button`,{type:`button`,class:`mitem`,role:`menuitemradio`,"data-id":e.id,"aria-selected":t?`true`:`false`},L(`span`,{class:`mname`},e.name),e.provider?L(`span`,{class:`mprov`},e.provider):!1,L(`span`,{class:`tick`},i(`check`,{size:14})));n.addEventListener(`click`,()=>this.#T(e.id)),a.push(n)}e.replaceChildren(...a.length?a:[L(`div`,{class:`mempty`},`No models match.`)])}#y(){this.#r&&(this.#t=e=>{if(e.stopPropagation(),this.#g){this.dispatchEvent(new CustomEvent(`add-ai`,{bubbles:!0,composed:!0}));return}this.#x()},this.#r.addEventListener(`click`,this.#t)),this.#i&&(this.#n=()=>this.#E(),this.#i.addEventListener(`click`,this.#n))}#b(){this.#r&&this.#t&&this.#r.removeEventListener(`click`,this.#t),this.#i&&this.#n&&this.#i.removeEventListener(`click`,this.#n),this.#t=null,this.#n=null,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#s=null}get menuOpen(){return this.#u}openMenu(){this.#g||this.#S()}cycleModel(){if(this.#g)return;let e=this.#h;if(e.length===0)return;let t=this.#l?e.findIndex(e=>e.id===this.#l):-1;t<0&&(t=e.findIndex(e=>e.name===this.model));let n=e[(t+1)%e.length];n&&this.#T(n.id)}cycleThinking(){if(this.noThinking)return;let e=Yi[(Yi.indexOf(this.thinking)+1)%Yi.length];e&&this.#A(e)}#x(){this.#u?this.#C():this.#S()}#S(){if(this.#u)return;this.#O(),this.#u=!0,this.#f=``,this.#v(),this.#w();let e=this.#e.querySelector(`.msearch`);e&&(e.value=``,requestAnimationFrame(()=>e.focus())),document.addEventListener(`mousedown`,this.#p),document.addEventListener(`keydown`,this.#m,!0)}#C(){this.#u&&(this.#u=!1,this.#w(),this.#d||(document.removeEventListener(`mousedown`,this.#p),document.removeEventListener(`keydown`,this.#m,!0)))}#w(){this.#a?.classList.toggle(`open`,this.#u),this.#r?.setAttribute(`aria-expanded`,this.#u?`true`:`false`)}#T(e){let t=this.#h.find(t=>t.id===e)??{name:e,id:e,provider:void 0};this.#l=t.id,this.#C(),t.name!==this.model&&(this.model=t.name),this.dispatchEvent(new CustomEvent(`model-change`,{detail:{model:t.name,provider:t.provider,id:t.id},bubbles:!0,composed:!0}))}#E(){this.#d?this.#O():this.#D()}#D(){this.#d||(this.#C(),this.#d=!0,this.#k(),document.addEventListener(`mousedown`,this.#p),document.addEventListener(`keydown`,this.#m,!0))}#O(){this.#d&&(this.#d=!1,this.#k(),this.#u||(document.removeEventListener(`mousedown`,this.#p),document.removeEventListener(`keydown`,this.#m,!0)))}#k(){this.#o?.classList.toggle(`open`,this.#d),this.#i?.setAttribute(`aria-expanded`,this.#d?`true`:`false`)}#A(e){this.#O(),this.thinking=e,this.dispatchEvent(new CustomEvent(`thinking-change`,{detail:{thinking:e,label:Xi[e].label,accented:e===Zi},bubbles:!0,composed:!0}))}});async function ua(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(``)}async function da(e,t={}){let n=(e??``).trim().toLowerCase();if(n===``)return null;let r=await ua(n),i=t.size??80,a=t.fallback??`mp`;return`https://www.gravatar.com/avatar/${r}?s=${i}&d=${encodeURIComponent(a)}`}var fa=R(`
2154
2154
  :host { display: inline-flex; }
2155
2155
  :host([hidden]) { display: none; }
2156
2156
 
@@ -2353,7 +2353,7 @@ slicc-composer-capture .slicc-capture__timer[hidden] {
2353
2353
  }
2354
2354
  .glyph.is-press { transform: none; }
2355
2355
  }
2356
- `),fa=18,pa=72,ma=`http://www.w3.org/2000/svg`,ha=15,ga=.25;function _a(e){let t=document.createElementNS(ma,`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*ha,r=e=>{let t=document.createElementNS(ma,`circle`);return t.setAttribute(`cx`,`18`),t.setAttribute(`cy`,`18`),t.setAttribute(`r`,String(ha)),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?ga: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 va(e){return e===`tool`?`tool`:`thinking`}function ya(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}I(`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=[da]}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 va(this.getAttribute(`phase`))}set phase(e){this.setAttribute(`phase`,va(e))}get progress(){return ya(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),ua(r,{size:pa}).then(t).catch(()=>t(null))}#d(){let e=this.busy,t=this.disabled,n=e&&this.phase===`tool`,r=this.label??(e?`Stop`:`Send`),a;if(n){let e=this.progress,t=e==null;a=L(`slot`,{name:`busy`},L(`span`,{class:`stop`,part:`stop`},i(`square`,{size:fa})),L(`span`,{class:`spinner${t?` is-indeterminate`:``}`,part:`spinner`},_a(e)))}else a=e?L(`slot`,{name:`busy`},L(`span`,{class:`stop`,part:`stop`},i(`square`,{size:fa}),L(`span`,{class:`stop-fill`},i(`square`,{size:fa})))):L(`slot`,null,L(`span`,{class:`glyph`,part:`glyph`},i(`arrow-up`,{size:fa})));let o=L(`button`,{part:`button`,class:`send${e?` is-busy`:``}${n?` is-tool`:``}`,type:`button`,title:r,"aria-label":r,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 ba=`
2356
+ `),pa=18,ma=72,ha=`http://www.w3.org/2000/svg`,ga=15,_a=.25;function va(e){let t=document.createElementNS(ha,`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*ga,r=e=>{let t=document.createElementNS(ha,`circle`);return t.setAttribute(`cx`,`18`),t.setAttribute(`cy`,`18`),t.setAttribute(`r`,String(ga)),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?_a: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 ya(e){return e===`tool`?`tool`:`thinking`}function ba(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}I(`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=[fa]}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 ya(this.getAttribute(`phase`))}set phase(e){this.setAttribute(`phase`,ya(e))}get progress(){return ba(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),da(r,{size:ma}).then(t).catch(()=>t(null))}#d(){let e=this.busy,t=this.disabled,n=e&&this.phase===`tool`,r=this.label??(e?`Stop`:`Send`),a;if(n){let e=this.progress,t=e==null;a=L(`slot`,{name:`busy`},L(`span`,{class:`stop`,part:`stop`},i(`square`,{size:pa})),L(`span`,{class:`spinner${t?` is-indeterminate`:``}`,part:`spinner`},va(e)))}else a=e?L(`slot`,{name:`busy`},L(`span`,{class:`stop`,part:`stop`},i(`square`,{size:pa}),L(`span`,{class:`stop-fill`},i(`square`,{size:pa})))):L(`slot`,null,L(`span`,{class:`glyph`,part:`glyph`},i(`arrow-up`,{size:pa})));let o=L(`button`,{part:`button`,class:`send${e?` is-busy`:``}${n?` is-tool`:``}`,type:`button`,title:r,"aria-label":r,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 xa=`
2357
2357
  slicc-input-card {
2358
2358
  display: block;
2359
2359
  }
@@ -2407,7 +2407,7 @@ slicc-input-card .toolbar slicc-add-menu {
2407
2407
  flex: 1;
2408
2408
  min-width: 0;
2409
2409
  }
2410
- `,xa=`slicc-input-card-style`;function Sa(e){if(e.getElementById(xa))return;let t=e.createElement(`style`);t.id=xa,t.textContent=ba,(e.head??e.documentElement).appendChild(t)}var Ca=`Ask sliccy, or describe a change…`;I(`slicc-input-card`,class extends HTMLElement{static observedAttributes=[`value`,`placeholder`,`suggestion`,`disabled`];#e;#t;#n;#r=!1;connectedCallback(){Sa(this.ownerDocument),this.#i(),this.#a(),this.#u()}attributeChangedCallback(e,t,n){!this.#r||t===n||(this.#a(),e===`value`&&this.#u())}get value(){return this.#r?this.#t.value:this.getAttribute(`value`)??``}set value(e){let t=e??``;this.#r&&(this.#t.value=t,this.#u()),t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t)}get placeholder(){return this.getAttribute(`placeholder`)??Ca}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)}focus(e){this.#i(),this.#t.focus(e)}clear(){this.value=``}#i(){if(this.#r)return;this.#r=!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(L(`slicc-add-menu`),L(`slicc-send-button`));this.#e.append(this.#t,this.#n),this.appendChild(this.#e),this.#t.addEventListener(`input`,this.#o),this.#t.addEventListener(`keydown`,this.#s),this.#n.addEventListener(`send`,this.#c)}#a(){if(!this.#r)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)}#o=e=>{e.stopPropagation();let t=this.#t.value;t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t),this.#u(),this.dispatchEvent(new CustomEvent(`input`,{bubbles:!0,composed:!0,detail:{value:t}}))};#s=e=>{if(e.isComposing)return;if(e.key===`Enter`&&!e.shiftKey&&!e.altKey){e.preventDefault(),this.#l(void 0,e.ctrlKey||e.metaKey);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}))};#c=e=>{e.stopPropagation(),this.#l()};submit(e){this.#i(),this.#l(e)}focusEnd(){if(!this.#r)return;let e=this.#t;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}#l(e,t){if(this.disabled)return;let n=this.#t.value;n.trim()!==``&&(this.removeAttribute(`suggestion`),this.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:n,...e?{source:e}:{},...t?{steer:!0}:{}}})))}#u(){if(!this.#r)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 wa={"⏎":`corner-down-left`,"↵":`corner-down-left`,Enter:`corner-down-left`,"←":`arrow-left`,"→":`arrow-right`,"↑":`arrow-up`,"↓":`arrow-down`,"⇥":`arrow-right-to-line`},Ta=`slicc-key-hud`,Ea=4,Da=1600,Oa=`[?] help · [i] or [⏎] to type`;function ka(e,t){let n=wa[e],r=L(`kbd`,{class:t?`cap cap-hint`:`cap`,part:`cap`,...n?{"aria-label":e}:{}});return n&&a(n)?r.append(i(n,{size:t?11:12,strokeWidth:2.2})):r.textContent=e,r}function Aa(e){return e.split(/(\[[^\]]+\])/).filter(e=>e!==``).map(e=>e.startsWith(`[`)&&e.endsWith(`]`)?ka(e.slice(1,-1),!0):e)}var ja=R(`
2410
+ `,Sa=`slicc-input-card-style`;function Ca(e){if(e.getElementById(Sa))return;let t=e.createElement(`style`);t.id=Sa,t.textContent=xa,(e.head??e.documentElement).appendChild(t)}var wa=`Ask sliccy, or describe a change…`;I(`slicc-input-card`,class extends HTMLElement{static observedAttributes=[`value`,`placeholder`,`suggestion`,`disabled`];#e;#t;#n;#r=!1;connectedCallback(){Ca(this.ownerDocument),this.#i(),this.#a(),this.#u()}attributeChangedCallback(e,t,n){!this.#r||t===n||(this.#a(),e===`value`&&this.#u())}get value(){return this.#r?this.#t.value:this.getAttribute(`value`)??``}set value(e){let t=e??``;this.#r&&(this.#t.value=t,this.#u()),t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t)}get placeholder(){return this.getAttribute(`placeholder`)??wa}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)}focus(e){this.#i(),this.#t.focus(e)}clear(){this.value=``}#i(){if(this.#r)return;this.#r=!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(L(`slicc-add-menu`),L(`slicc-send-button`));this.#e.append(this.#t,this.#n),this.appendChild(this.#e),this.#t.addEventListener(`input`,this.#o),this.#t.addEventListener(`keydown`,this.#s),this.#n.addEventListener(`send`,this.#c)}#a(){if(!this.#r)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)}#o=e=>{e.stopPropagation();let t=this.#t.value;t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t),this.#u(),this.dispatchEvent(new CustomEvent(`input`,{bubbles:!0,composed:!0,detail:{value:t}}))};#s=e=>{if(e.isComposing)return;if(e.key===`Enter`&&!e.shiftKey&&!e.altKey){e.preventDefault(),this.#l(void 0,e.ctrlKey||e.metaKey);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}))};#c=e=>{e.stopPropagation(),this.#l()};submit(e){this.#i(),this.#l(e)}focusEnd(){if(!this.#r)return;let e=this.#t;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}#l(e,t){if(this.disabled)return;let n=this.#t.value;n.trim()!==``&&(this.removeAttribute(`suggestion`),this.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:n,...e?{source:e}:{},...t?{steer:!0}:{}}})))}#u(){if(!this.#r)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 Ta={"⏎":`corner-down-left`,"↵":`corner-down-left`,Enter:`corner-down-left`,"←":`arrow-left`,"→":`arrow-right`,"↑":`arrow-up`,"↓":`arrow-down`,"⇥":`arrow-right-to-line`},Ea=`slicc-key-hud`,Da=4,Oa=1600,ka=`[?] help · [i] or [⏎] to type`;function Aa(e,t){let n=Ta[e],r=L(`kbd`,{class:t?`cap cap-hint`:`cap`,part:`cap`,...n?{"aria-label":e}:{}});return n&&a(n)?r.append(i(n,{size:t?11:12,strokeWidth:2.2})):r.textContent=e,r}function ja(e){return e.split(/(\[[^\]]+\])/).filter(e=>e!==``).map(e=>e.startsWith(`[`)&&e.endsWith(`]`)?Aa(e.slice(1,-1),!0):e)}var Ma=R(`
2411
2411
  :host{display:block;font-family:var(--ui);color:var(--ink);}
2412
2412
  :host([hidden]){display:none;}
2413
2413
  .hud{display:flex;align-items:center;gap:8px;font:600 11.5px/1 var(--ui);}
@@ -2457,9 +2457,9 @@ slicc-input-card .toolbar slicc-add-menu {
2457
2457
  .pressanimation:$PREFIX-press-in .12s ease-out;
2458
2458
  .hudanimation:$PREFIX-band-in .14s ease-out;
2459
2459
  }
2460
- @keyframes ${Ta}-press-in{from{opacity:0;transform:translateY(2px) scale(.94);}to{opacity:1;transform:none;}}
2461
- @keyframes ${Ta}-band-in{from{opacity:0;}to{opacity:1;}}
2462
- `);I(Ta,class extends HTMLElement{static observedAttributes=[`label`,`hint`];#e;#t=[];#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ja]}connectedCallback(){this.hasAttribute(`role`)||this.setAttribute(`role`,`status`),this.hasAttribute(`aria-live`)||this.setAttribute(`aria-live`,`polite`),this.#f(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#i&&this.#p()}get label(){return this.getAttribute(`label`)??`Keyboard mode`}set label(e){this.setAttribute(`label`,e)}get hint(){return this.getAttribute(`hint`)??Oa}set hint(e){this.setAttribute(`hint`,e)}get depth(){let e=Number.parseInt(this.getAttribute(`depth`)??``,10);return Number.isFinite(e)&&e>0?e:Ea}set depth(e){this.setAttribute(`depth`,String(e))}get linger(){let e=Number.parseInt(this.getAttribute(`linger`)??``,10);return Number.isFinite(e)&&e>0?e:Da}set linger(e){this.setAttribute(`linger`,String(e))}get presses(){return this.#t.map(e=>({...e,caps:[...e.caps]}))}set presses(e){this.#t=(Array.isArray(e)?e:[]).filter(e=>Array.isArray(e?.caps)).map(e=>({bound:e.bound!==!1,caps:[...e.caps]})),this.#u(),this.#r=null,this.#d(),this.#p()}record(e,t=!0){this.#t.push({caps:[...e],bound:t}),this.#d(),this.#p(),this.#c(this.linger)}clear(){this.#u(),this.#r=null,this.#t=[],this.#p()}#c(e){this.#u(),this.#r=Date.now()+e,this.#n=setTimeout(()=>{this.#n=null,this.clear()},e)}#l(){if(this.#r===null||this.#t.length===0)return;let e=this.#r-Date.now();e<=0?this.clear():this.#c(e)}#u(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#d(){let e=this.#t.length-this.depth;e>0&&this.#t.splice(0,e)}#f(){this.#a=L(`span`,{class:`label`,part:`label`}),this.#o=L(`span`,{class:`hint`,part:`hint`}),this.#s=L(`div`,{class:`keys`,part:`keys`,"aria-hidden":`true`}),this.#i=L(`div`,{class:`hud`,part:`hud`},i(`keyboard`,{size:15,strokeWidth:1.9,class:`icon`,part:`icon`}),this.#a,this.#o,this.#s),this.#e.replaceChildren(this.#i),this.#p()}#p(){!this.#a||!this.#o||!this.#s||(this.#a.textContent=this.label,this.#o.replaceChildren(),Ln(this.#o,Aa(this.hint)),this.#o.hidden=this.hint===``||this.#t.length>0,this.#s.replaceChildren(...this.#t.map((e,t)=>L(`span`,{class:`press`,"data-bound":String(e.bound!==!1),...t<this.#t.length-1?{"data-age":`stale`}:{}},...e.caps.map(e=>ka(e,!1))))))}});var Ma=R(`
2460
+ @keyframes ${Ea}-press-in{from{opacity:0;transform:translateY(2px) scale(.94);}to{opacity:1;transform:none;}}
2461
+ @keyframes ${Ea}-band-in{from{opacity:0;}to{opacity:1;}}
2462
+ `);I(Ea,class extends HTMLElement{static observedAttributes=[`label`,`hint`];#e;#t=[];#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ma]}connectedCallback(){this.hasAttribute(`role`)||this.setAttribute(`role`,`status`),this.hasAttribute(`aria-live`)||this.setAttribute(`aria-live`,`polite`),this.#f(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#i&&this.#p()}get label(){return this.getAttribute(`label`)??`Keyboard mode`}set label(e){this.setAttribute(`label`,e)}get hint(){return this.getAttribute(`hint`)??ka}set hint(e){this.setAttribute(`hint`,e)}get depth(){let e=Number.parseInt(this.getAttribute(`depth`)??``,10);return Number.isFinite(e)&&e>0?e:Da}set depth(e){this.setAttribute(`depth`,String(e))}get linger(){let e=Number.parseInt(this.getAttribute(`linger`)??``,10);return Number.isFinite(e)&&e>0?e:Oa}set linger(e){this.setAttribute(`linger`,String(e))}get presses(){return this.#t.map(e=>({...e,caps:[...e.caps]}))}set presses(e){this.#t=(Array.isArray(e)?e:[]).filter(e=>Array.isArray(e?.caps)).map(e=>({bound:e.bound!==!1,caps:[...e.caps]})),this.#u(),this.#r=null,this.#d(),this.#p()}record(e,t=!0){this.#t.push({caps:[...e],bound:t}),this.#d(),this.#p(),this.#c(this.linger)}clear(){this.#u(),this.#r=null,this.#t=[],this.#p()}#c(e){this.#u(),this.#r=Date.now()+e,this.#n=setTimeout(()=>{this.#n=null,this.clear()},e)}#l(){if(this.#r===null||this.#t.length===0)return;let e=this.#r-Date.now();e<=0?this.clear():this.#c(e)}#u(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#d(){let e=this.#t.length-this.depth;e>0&&this.#t.splice(0,e)}#f(){this.#a=L(`span`,{class:`label`,part:`label`}),this.#o=L(`span`,{class:`hint`,part:`hint`}),this.#s=L(`div`,{class:`keys`,part:`keys`,"aria-hidden":`true`}),this.#i=L(`div`,{class:`hud`,part:`hud`},i(`keyboard`,{size:15,strokeWidth:1.9,class:`icon`,part:`icon`}),this.#a,this.#o,this.#s),this.#e.replaceChildren(this.#i),this.#p()}#p(){!this.#a||!this.#o||!this.#s||(this.#a.textContent=this.label,this.#o.replaceChildren(),Rn(this.#o,ja(this.hint)),this.#o.hidden=this.hint===``||this.#t.length>0,this.#s.replaceChildren(...this.#t.map((e,t)=>L(`span`,{class:`press`,"data-bound":String(e.bound!==!1),...t<this.#t.length-1?{"data-age":`stale`}:{}},...e.caps.map(e=>Aa(e,!1))))))}});var Na=R(`
2463
2463
  :host{display:block;font-family:var(--ui);}
2464
2464
  :host(:not([count])),:host([count="0"]),:host([count="-0"]){display:none;}
2465
2465
  .wrap{display:flex;flex-direction:column;align-items:stretch;gap:6px;}
@@ -2480,7 +2480,7 @@ slicc-input-card .toolbar slicc-add-menu {
2480
2480
  :host-context(body.dark) .dismiss:hover,:host-context(body.dark) .dismiss:focus-visible,
2481
2481
  :host-context(.dark) .dismiss:hover,:host-context(.dark) .dismiss:focus-visible,
2482
2482
  :host-context([data-theme="dark"]) .dismiss:hover,:host-context([data-theme="dark"]) .dismiss:focus-visible{background:color-mix(in srgb,#0a0a0a 14%,transparent);}
2483
- `),Na=[{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 Pa(e){return Na[Math.min(e,Na.length-1)]??Na[0]}I(`slicc-queued-stack`,class extends HTMLElement{#e;#t=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ma]}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,r){let{rot:a,x:o,y:s}=Pa(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:${r};`,f=[L(`span`,{class:`bubble`},e.text)];if(e.attachments&&e.attachments>0&&f.push(L(`span`,{class:`attach`},`+${e.attachments}`)),n){let t=L(`button`,{type:`button`,class:`dismiss`,part:`dismiss`,"aria-label":`Remove queued message`},i(`x`,{size:14}));t.addEventListener(`click`,t=>{t.stopPropagation(),this.#n(e.id)}),f.push(t)}return L(`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=L(`div`,{class:`stack`,part:`stack`},...t),r=L(`div`,{class:`wrap`},L(`span`,{class:`badge`,part:`badge`},i(`clock`,{size:11}),`${e} queued`),n);this.#e.replaceChildren(r)}});var Fa=1e3;function Ia(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 La=R(`
2483
+ `),Pa=[{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 Fa(e){return Pa[Math.min(e,Pa.length-1)]??Pa[0]}I(`slicc-queued-stack`,class extends HTMLElement{#e;#t=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Na]}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,r){let{rot:a,x:o,y:s}=Fa(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:${r};`,f=[L(`span`,{class:`bubble`},e.text)];if(e.attachments&&e.attachments>0&&f.push(L(`span`,{class:`attach`},`+${e.attachments}`)),n){let t=L(`button`,{type:`button`,class:`dismiss`,part:`dismiss`,"aria-label":`Remove queued message`},i(`x`,{size:14}));t.addEventListener(`click`,t=>{t.stopPropagation(),this.#n(e.id)}),f.push(t)}return L(`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=L(`div`,{class:`stack`,part:`stack`},...t),r=L(`div`,{class:`wrap`},L(`span`,{class:`badge`,part:`badge`},i(`clock`,{size:11}),`${e} queued`),n);this.#e.replaceChildren(r)}});var Ia=1e3;function La(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 Ra=R(`
2484
2484
  :host { display: inline-grid; }
2485
2485
  :host([hidden]) { display: none; }
2486
2486
 
@@ -2562,7 +2562,7 @@ slicc-input-card .toolbar slicc-add-menu {
2562
2562
 
2563
2563
  .glyph { display: grid; place-items: center; line-height: 1; }
2564
2564
  .glyph svg { display: block; }
2565
- `),Ra=`square`,za=18;I(`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=[La]}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`)??Ra}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=i(this.icon,{size:za,part:`icon`}),r=t??this.itemId??`dock item`,a=L(`button`,{type:`button`,part:`button`,class:e.join(` `),"aria-label":r,"aria-pressed":this.active?`true`:`false`},L(`span`,{class:`glyph`,part:`glyph`},L(`slot`,null,n)),t?L(`span`,{class:`tip`,part:`tip`},t):null),o=this.hue;o&&a.style.setProperty(`--h`,o),this.#t?.destroy(),this.#t=Ia(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 Ba=[{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`},{id:`monitor`,icon:`activity`,label:`Monitor`,kind:`tool`}],Va=`
2565
+ `),za=`square`,Ba=18;I(`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=[Ra]}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`)??za}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=i(this.icon,{size:Ba,part:`icon`}),r=t??this.itemId??`dock item`,a=L(`button`,{type:`button`,part:`button`,class:e.join(` `),"aria-label":r,"aria-pressed":this.active?`true`:`false`},L(`span`,{class:`glyph`,part:`glyph`},L(`slot`,null,n)),t?L(`span`,{class:`tip`,part:`tip`},t):null),o=this.hue;o&&a.style.setProperty(`--h`,o),this.#t?.destroy(),this.#t=La(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 Va=[{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`},{id:`monitor`,icon:`activity`,label:`Monitor`,kind:`tool`}],Ha=`
2566
2566
  .slicc-dock {
2567
2567
  flex: 0 0 48px;
2568
2568
  box-sizing: border-box;
@@ -2583,7 +2583,7 @@ slicc-input-card .toolbar slicc-add-menu {
2583
2583
  margin: 2px 0;
2584
2584
  }
2585
2585
  .slicc-dock .grow { flex: 1; }
2586
- `,Ha=`slicc-dock-style`;function Ua(e){if(e.getElementById(Ha))return;let t=e.createElement(`style`);t.id=Ha,t.textContent=Va,(e.head??e.documentElement).appendChild(t)}function Wa(e){return e===`sprinkle`?`sprinkle`:`tool`}I(`slicc-dock`,class extends HTMLElement{static get observedAttributes(){return[`active`,`system-tools`]}#e=[];#t=null;#n=null;#r=null;#i=!1;connectedCallback(){Ua(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=Wa(n.getAttribute(`kind`)),r=n.getAttribute(`item-id`)??n.dataset.t??n.getAttribute(`tip`)??``;e!==`tool`&&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 Ba.some(t=>t.id===e)?`tool`:this.#e.find(t=>t.id===e)?.kind??`tool`}#s(e,t){let n=e.id,r=Wa(e.kind),i=e.icon??``,a=e.label??n,o=t!=null&&t===n,s=e.hue;return L(`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)Wa(n.kind)===`sprinkle`&&t.push(this.#s(n,e));if(t.push(L(`div`,{class:`grow`})),this.systemTools){t.push(L(`div`,{class:`div`}));for(let n of Ba)t.push(this.#s(n,e))}this.replaceChildren(),Ln(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 Ga=R(`
2586
+ `,Ua=`slicc-dock-style`;function Wa(e){if(e.getElementById(Ua))return;let t=e.createElement(`style`);t.id=Ua,t.textContent=Ha,(e.head??e.documentElement).appendChild(t)}function Ga(e){return e===`sprinkle`?`sprinkle`:`tool`}I(`slicc-dock`,class extends HTMLElement{static get observedAttributes(){return[`active`,`system-tools`]}#e=[];#t=null;#n=null;#r=null;#i=!1;connectedCallback(){Wa(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=Ga(n.getAttribute(`kind`)),r=n.getAttribute(`item-id`)??n.dataset.t??n.getAttribute(`tip`)??``;e!==`tool`&&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 Va.some(t=>t.id===e)?`tool`:this.#e.find(t=>t.id===e)?.kind??`tool`}#s(e,t){let n=e.id,r=Ga(e.kind),i=e.icon??``,a=e.label??n,o=t!=null&&t===n,s=e.hue;return L(`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)Ga(n.kind)===`sprinkle`&&t.push(this.#s(n,e));if(t.push(L(`div`,{class:`grow`})),this.systemTools){t.push(L(`div`,{class:`div`}));for(let n of Va)t.push(this.#s(n,e))}this.replaceChildren(),Rn(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 Ka=R(`
2587
2587
  :host { display: none; }
2588
2588
  :host([open]) { display: block; }
2589
2589
  .overlay {
@@ -2687,7 +2687,7 @@ slicc-input-card .toolbar slicc-add-menu {
2687
2687
  color: rgba(255,255,255,.7); font-family: var(--ui); font-size: 14px;
2688
2688
  }
2689
2689
  @media (prefers-reduced-motion: reduce) { .overlay, .card { transition: none; } }
2690
- `);function Ka(e,t){let n=e===t-1?9:e<8?e+1:null;return n===null?null:L(`span`,{class:`num`,part:`number`},String(n))}var qa=3e3,Ja=`Open tabs`;I(`slicc-tab-overlay`,class extends HTMLElement{static observedAttributes=[`open`,`heading`];#e;#t=[];#n=null;#r=null;#i=!1;#a=null;#o=null;#s=e=>{if(!this.open)return;if(e.key===`Escape`){e.stopPropagation(),this.#_(`escape`);return}if(e.ctrlKey||e.metaKey||e.altKey||e.isComposing)return;let t=/^Digit([1-9])$/.exec(e.code??``)?.[1]??/^[1-9]$/.exec(e.key)?.[0];if(t){e.stopPropagation(),e.preventDefault(),this.#c(Number(t));return}(e.key===`p`||e.key===`P`)&&!this.hasAttribute(`no-peek`)&&(e.stopPropagation(),e.preventDefault(),this.peeking=!this.#i)};#c(e){if(this.#t.length===0){this.#l(e);return}let t=e===9?this.#t.length-1:e-1,n=t>=0?this.#t[t]:void 0;n&&this.#d(n.id)}#l(e){this.#u(),this.#a=e,this.#o=setTimeout(()=>this.#u(),qa)}#u(){this.#o&&clearTimeout(this.#o),this.#o=null,this.#a=null}constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ga]}connectedCallback(){this.#m(),this.#h()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#s,!0)}attributeChangedCallback(e){this.isConnected&&(e===`open`?this.#h():this.#m())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get heading(){return this.getAttribute(`heading`)??Ja}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.#m();let t=this.#a;t!==null&&this.#t.length>0&&(this.#u(),this.#c(t))}show(){this.open||=!0}get peeking(){return this.#i}set peeking(e){this.#i=e&&!this.hasAttribute(`no-peek`),this.toggleAttribute(`data-peek`,this.#i)}#d(e){this.#g(this.#i?`tab-peek`:`tab-activate`,e)}hide(){this.open&&this.#_(`api`)}#f(){let e=L(`button`,{class:`close`,part:`close`,type:`button`,"aria-label":`Close tabs overlay`},i(`x`,{size:18}));return e.addEventListener(`click`,()=>this.#_(`close-button`)),e}#p(e,t){let n=e.title??e.id,r=e.screenshot?L(`img`,{class:`shot`,part:`shot`,src:e.screenshot,alt:n,loading:`lazy`}):L(`div`,{class:`shot ph`,part:`shot`},i(`globe`,{size:28})),a=L(`button`,{class:`x`,part:`card-close`,type:`button`,"aria-label":`Close ${n}`},i(`x`,{size:14}));a.addEventListener(`click`,t=>{t.stopPropagation(),this.#g(`tab-close`,e.id)});let o=L(`div`,{class:`label`},L(`span`,{class:`name`,part:`title`},n),e.url?L(`span`,{class:`url`},e.url):null),s=L(`div`,{class:e.active?`card on`:`card`,part:`card`,role:`button`,tabindex:`0`,"data-tab-id":e.id,"aria-label":n,"aria-current":e.active?`true`:!1},Ka(t,this.#t.length),r,L(`div`,{class:`meta`},o,a));return s.addEventListener(`click`,()=>this.#d(e.id)),s.addEventListener(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this.#d(e.id))}),s}#m(){let e=L(`div`,{class:`bar`,part:`bar`},L(`span`,{class:`title`},this.heading),L(`span`,{class:`count`},String(this.#t.length)),L(`span`,{class:`peek`},`Peek · comes back`),L(`span`,{class:`grow`}),this.#f()),t;this.#t.length===0?t=L(`div`,{class:`empty`},`No open tabs.`):(t=L(`div`,{class:`grid`,part:`grid`,role:`list`}),this.#t.forEach((e,n)=>{t.appendChild(this.#p(e,n))})),this.#n=L(`div`,{class:`overlay`,part:`overlay`},e,t),this.#n.addEventListener(`mousedown`,e=>{e.target===this.#n&&this.#_(`backdrop`)}),this.#e.replaceChildren(this.#n)}#h(){this.open||(this.peeking=!1,this.#u()),this.open?(this.#r=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#s,!0),requestAnimationFrame(()=>this.#n?.querySelector(`.close`)?.focus())):(document.removeEventListener(`keydown`,this.#s,!0),this.#r?.focus?.(),this.#r=null)}#g(e,t){this.dispatchEvent(new CustomEvent(e,{detail:{id:t},bubbles:!0,composed:!0}))}#_(e){this.open=!1,this.dispatchEvent(new CustomEvent(`overlay-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}});var Ya=`#3b6cb2`,Xa=`
2690
+ `);function qa(e,t){let n=e===t-1?9:e<8?e+1:null;return n===null?null:L(`span`,{class:`num`,part:`number`},String(n))}var Ja=3e3,Ya=`Open tabs`;I(`slicc-tab-overlay`,class extends HTMLElement{static observedAttributes=[`open`,`heading`];#e;#t=[];#n=null;#r=null;#i=!1;#a=null;#o=null;#s=e=>{if(!this.open)return;if(e.key===`Escape`){e.stopPropagation(),this.#_(`escape`);return}if(e.ctrlKey||e.metaKey||e.altKey||e.isComposing)return;let t=/^Digit([1-9])$/.exec(e.code??``)?.[1]??/^[1-9]$/.exec(e.key)?.[0];if(t){e.stopPropagation(),e.preventDefault(),this.#c(Number(t));return}(e.key===`p`||e.key===`P`)&&!this.hasAttribute(`no-peek`)&&(e.stopPropagation(),e.preventDefault(),this.peeking=!this.#i)};#c(e){if(this.#t.length===0){this.#l(e);return}let t=e===9?this.#t.length-1:e-1,n=t>=0?this.#t[t]:void 0;n&&this.#d(n.id)}#l(e){this.#u(),this.#a=e,this.#o=setTimeout(()=>this.#u(),Ja)}#u(){this.#o&&clearTimeout(this.#o),this.#o=null,this.#a=null}constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ka]}connectedCallback(){this.#m(),this.#h()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#s,!0)}attributeChangedCallback(e){this.isConnected&&(e===`open`?this.#h():this.#m())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get heading(){return this.getAttribute(`heading`)??Ya}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.#m();let t=this.#a;t!==null&&this.#t.length>0&&(this.#u(),this.#c(t))}show(){this.open||=!0}get peeking(){return this.#i}set peeking(e){this.#i=e&&!this.hasAttribute(`no-peek`),this.toggleAttribute(`data-peek`,this.#i)}#d(e){this.#g(this.#i?`tab-peek`:`tab-activate`,e)}hide(){this.open&&this.#_(`api`)}#f(){let e=L(`button`,{class:`close`,part:`close`,type:`button`,"aria-label":`Close tabs overlay`},i(`x`,{size:18}));return e.addEventListener(`click`,()=>this.#_(`close-button`)),e}#p(e,t){let n=e.title??e.id,r=e.screenshot?L(`img`,{class:`shot`,part:`shot`,src:e.screenshot,alt:n,loading:`lazy`}):L(`div`,{class:`shot ph`,part:`shot`},i(`globe`,{size:28})),a=L(`button`,{class:`x`,part:`card-close`,type:`button`,"aria-label":`Close ${n}`},i(`x`,{size:14}));a.addEventListener(`click`,t=>{t.stopPropagation(),this.#g(`tab-close`,e.id)});let o=L(`div`,{class:`label`},L(`span`,{class:`name`,part:`title`},n),e.url?L(`span`,{class:`url`},e.url):null),s=L(`div`,{class:e.active?`card on`:`card`,part:`card`,role:`button`,tabindex:`0`,"data-tab-id":e.id,"aria-label":n,"aria-current":e.active?`true`:!1},qa(t,this.#t.length),r,L(`div`,{class:`meta`},o,a));return s.addEventListener(`click`,()=>this.#d(e.id)),s.addEventListener(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this.#d(e.id))}),s}#m(){let e=L(`div`,{class:`bar`,part:`bar`},L(`span`,{class:`title`},this.heading),L(`span`,{class:`count`},String(this.#t.length)),L(`span`,{class:`peek`},`Peek · comes back`),L(`span`,{class:`grow`}),this.#f()),t;this.#t.length===0?t=L(`div`,{class:`empty`},`No open tabs.`):(t=L(`div`,{class:`grid`,part:`grid`,role:`list`}),this.#t.forEach((e,n)=>{t.appendChild(this.#p(e,n))})),this.#n=L(`div`,{class:`overlay`,part:`overlay`},e,t),this.#n.addEventListener(`mousedown`,e=>{e.target===this.#n&&this.#_(`backdrop`)}),this.#e.replaceChildren(this.#n)}#h(){this.open||(this.peeking=!1,this.#u()),this.open?(this.#r=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#s,!0),requestAnimationFrame(()=>this.#n?.querySelector(`.close`)?.focus())):(document.removeEventListener(`keydown`,this.#s,!0),this.#r?.focus?.(),this.#r=null)}#g(e,t){this.dispatchEvent(new CustomEvent(e,{detail:{id:t},bubbles:!0,composed:!0}))}#_(e){this.open=!1,this.dispatchEvent(new CustomEvent(`overlay-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}});var Xa=`#3b6cb2`,Za=`
2691
2691
  .slicc-freezer {
2692
2692
  position: fixed;
2693
2693
  left: 0;
@@ -2789,12 +2789,12 @@ slicc-input-card .toolbar slicc-add-menu {
2789
2789
 
2790
2790
  /* ice-blue accent while a freezer context is active (prototype _ctxAccent) —
2791
2791
  tints the toggle + the new-chat icon; cards keep their snow palette. */
2792
- .slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${Ya}); border-color: color-mix(in srgb, var(--fz-ctx, ${Ya}) 40%, var(--line)); }
2792
+ .slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${Xa}); border-color: color-mix(in srgb, var(--fz-ctx, ${Xa}) 40%, var(--line)); }
2793
2793
  .slicc-freezer[ctx] ::part(new-icon),
2794
2794
  .slicc-freezer[ctx] slicc-freezer-new::part(new-icon) {
2795
- background: color-mix(in srgb, var(--fz-ctx, ${Ya}) 14%, var(--canvas));
2796
- border-color: color-mix(in srgb, var(--fz-ctx, ${Ya}) 40%, var(--line));
2797
- color: var(--fz-ctx, ${Ya});
2795
+ background: color-mix(in srgb, var(--fz-ctx, ${Xa}) 14%, var(--canvas));
2796
+ border-color: color-mix(in srgb, var(--fz-ctx, ${Xa}) 40%, var(--line));
2797
+ color: var(--fz-ctx, ${Xa});
2798
2798
  }
2799
2799
 
2800
2800
  /* match-hidden: search filtered a session row out (only meaningful when open,
@@ -2802,7 +2802,7 @@ slicc-input-card .toolbar slicc-add-menu {
2802
2802
  prototype .fzcard row. */
2803
2803
  .slicc-freezer[open] slicc-freezer-card.match-hidden,
2804
2804
  .slicc-freezer[open] .fzcard.match-hidden { display: none; }
2805
- `,Za=`slicc-freezer-style`;function Qa(e){if(e.getElementById(Za))return;let t=e.createElement(`style`);t.id=Za,t.textContent=Xa,(e.head??e.documentElement).appendChild(t)}var $a=`http://www.w3.org/2000/svg`;function eo(){let e=document.createElementNS($a,`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($a,`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($a,`line`);for(let[e,t]of[[`x1`,`6`],[`y1`,`3.5`],[`x2`,`6`],[`y2`,`12.5`]])n.setAttribute(e,t);let r=document.createElementNS($a,`polyline`);return r.setAttribute(`points`,`9,6.5 10.5,8 9,9.5`),e.append(t,n,r),e}I(`slicc-freezer`,class extends HTMLElement{static observedAttributes=[`open`,`ctx`,`search-placeholder`];#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){Qa(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(eo());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 to=14,no=R(`
2805
+ `,Qa=`slicc-freezer-style`;function $a(e){if(e.getElementById(Qa))return;let t=e.createElement(`style`);t.id=Qa,t.textContent=Za,(e.head??e.documentElement).appendChild(t)}var eo=`http://www.w3.org/2000/svg`;function to(){let e=document.createElementNS(eo,`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(eo,`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(eo,`line`);for(let[e,t]of[[`x1`,`6`],[`y1`,`3.5`],[`x2`,`6`],[`y2`,`12.5`]])n.setAttribute(e,t);let r=document.createElementNS(eo,`polyline`);return r.setAttribute(`points`,`9,6.5 10.5,8 9,9.5`),e.append(t,n,r),e}I(`slicc-freezer`,class extends HTMLElement{static observedAttributes=[`open`,`ctx`,`search-placeholder`];#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){$a(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(to());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 no=14,ro=R(`
2806
2806
  :host {
2807
2807
  display: inline-grid;
2808
2808
  place-items: center;
@@ -2838,7 +2838,7 @@ slicc-input-card .toolbar slicc-add-menu {
2838
2838
  nothing is slotted */
2839
2839
  ::slotted(*), .ic { line-height: 1; }
2840
2840
  .ic { display: block; }
2841
- `);I(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[no];let e=L(`span`,{class:`snow`,part:`badge`},L(`slot`,null,i(`snowflake`,{size:to,part:`glyph`,class:`ic`})));this.#e.replaceChildren(e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}});var ro=`
2841
+ `);I(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ro];let e=L(`span`,{class:`snow`,part:`badge`},L(`slot`,null,i(`snowflake`,{size:no,part:`glyph`,class:`ic`})));this.#e.replaceChildren(e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}});var io=`
2842
2842
  slicc-freezer-card {
2843
2843
  position: relative;
2844
2844
  display: flex;
@@ -2931,7 +2931,7 @@ slicc-freezer-card .slicc-fzcard__meta {
2931
2931
  slicc-freezer-card[thawed] {
2932
2932
  background: color-mix(in srgb, var(--rose) 12%, transparent);
2933
2933
  }
2934
- `,io=`slicc-freezer-card-style`;function ao(e){if(e.getElementById(io))return;let t=e.createElement(`style`);t.id=io,t.textContent=ro,(e.head??e.documentElement).appendChild(t)}var oo=1400,so=14;I(`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(){ao(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=oo){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=L(`div`,{class:`slicc-fzcard__title`,part:`title`}),this.#r=L(`div`,{class:`slicc-fzcard__meta`,part:`meta`}),this.#t=L(`div`,{class:`slicc-fzcard__text`,part:`text`},this.#n,this.#r);for(let e of t)this.#n.appendChild(e);this.#i=L(`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=i(e,{size:so,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 co=`square-pen`,lo=`loader-circle`,uo=16,fo=`New chat`,po=350,mo=[[`new-chat-save`,`square-pen`,`New chat — save & extract memories`],[`new-chat-skip`,`fast-forward`,`New chat, fast — memories extracted later`],[`new-chat-erase`,`trash-2`,`Discard this chat — no freezer, no memories`],[`new-cone`,`plus`,`New cone — keep this chat, start another cone`],[`drop-cone`,`circle-minus`,`Drop this cone — freeze its chat, no memories`]],ho=R(`
2934
+ `,ao=`slicc-freezer-card-style`;function oo(e){if(e.getElementById(ao))return;let t=e.createElement(`style`);t.id=ao,t.textContent=io,(e.head??e.documentElement).appendChild(t)}var so=1400,co=14;I(`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(){oo(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=so){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=L(`div`,{class:`slicc-fzcard__title`,part:`title`}),this.#r=L(`div`,{class:`slicc-fzcard__meta`,part:`meta`}),this.#t=L(`div`,{class:`slicc-fzcard__text`,part:`text`},this.#n,this.#r);for(let e of t)this.#n.appendChild(e);this.#i=L(`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=i(e,{size:co,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 lo=`square-pen`,uo=`loader-circle`,fo=16,po=`New chat`,mo=350,ho=[[`new-chat-save`,`square-pen`,`New chat — save & extract memories`],[`new-chat-skip`,`fast-forward`,`New chat, fast — memories extracted later`],[`new-chat-erase`,`trash-2`,`Discard this chat — no freezer, no memories`],[`new-cone`,`plus`,`New cone — keep this chat, start another cone`],[`drop-cone`,`circle-minus`,`Drop this cone — freeze its chat, no memories`]],go=R(`
2935
2935
  :host { display: block; }
2936
2936
  :host([hidden]) { display: none; }
2937
2937
  *{ box-sizing: border-box; }
@@ -3077,18 +3077,18 @@ slicc-freezer-card[thawed] {
3077
3077
  .fznew, .nlbl { transition: none; }
3078
3078
  .fznew-spinner svg { animation: none; }
3079
3079
  }
3080
- `);I(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`,`no-skip`,`cones`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ho]}connectedCallback(){this.#a()}disconnectedCallback(){this.#n?.destroy(),this.#n=null,this.#l()}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`)??fo}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get noSkip(){return this.hasAttribute(`no-skip`)}set noSkip(e){this.toggleAttribute(`no-skip`,e)}get cones(){let e=this.getAttribute(`cones`);if(e==null)return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:null}set cones(e){e==null?this.removeAttribute(`cones`):this.setAttribute(`cones`,String(Math.max(0,Math.floor(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`),r=L(`span`,{class:`nico`,part:`badge`},t?L(`span`,{class:`fznew-spinner`,part:`spinner`},n?L(`span`,{class:`fznew-ring`,part:`ring`,style:`--fznew-progress:${this.progress??0}`}):null,i(lo,{size:uo,part:`icon`})):L(`slot`,{name:`icon`},i(co,{size:uo,part:`icon`}))),a=L(`span`,{class:`nlbl`,part:`label`},L(`slot`,null,e)),o=L(`button`,{class:`fznew`,part:`button`,type:`button`,"aria-label":e,title:e,"aria-busy":t?`true`:void 0},r,a);this.#t=o,this.#c(o),this.#e.replaceChildren(o,this.#o(t,n))}#o(e,t){let n=L(`div`,{class:`fznew-row`,part:`row`,role:`group`,"aria-label":this.label});for(let[r,a,o]of this.#s()){let s=r===`new-chat-save`,c=s&&e?L(`span`,{class:`fznew-spinner`},t?L(`span`,{class:`fznew-ring`,style:`--fznew-progress:${this.progress??0}`}):null,i(lo,{size:uo})):i(a,{size:uo}),l=L(`button`,{class:`fznew-act fznew-act--${r}`,part:`action-${r}`,type:`button`,title:o,"aria-label":o,"aria-busy":s&&e?`true`:void 0},c);l.disabled=e,l.addEventListener(`click`,()=>{this.busy||this.#u(r)}),n.appendChild(l)}return n}#s(){let e=this.cones;return mo.filter(([t])=>t===`new-chat-skip`?!this.noSkip:t===`new-cone`?e!==null:t!==`drop-cone`||e!==null&&e>1)}#c(e){this.#n?.destroy(),this.#l(),this.#n=Ia(e,{onLongPress:()=>{if(this.#r!==null){this.#l(),this.#u(`new-chat-skip`);return}this.#u(`new-chat-erase`)},onShortClick:()=>{if(this.noSkip){this.#u(`new-chat-save`);return}if(this.#r!==null){this.#l(),this.#u(`new-chat-skip`);return}this.#r=setTimeout(()=>{this.#r=null,this.#u(`new-chat-save`)},po)}})}#l(){this.#r!==null&&(clearTimeout(this.#r),this.#r=null)}#u(e){e===`new-chat-save`&&(this.busy=!0),this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))}});var go=1e3/15;function _o(e,t,n){return n?!0:e-t>=62.66666666666667}function vo(e,t,n){if(n||!Number.isFinite(t))return e;let r=t+go;return e-r>66.66666666666667?e:r}var yo=`attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }`,bo=`precision highp float;
3080
+ `);I(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`,`no-skip`,`cones`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[go]}connectedCallback(){this.#a()}disconnectedCallback(){this.#n?.destroy(),this.#n=null,this.#l()}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`)??po}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get noSkip(){return this.hasAttribute(`no-skip`)}set noSkip(e){this.toggleAttribute(`no-skip`,e)}get cones(){let e=this.getAttribute(`cones`);if(e==null)return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:null}set cones(e){e==null?this.removeAttribute(`cones`):this.setAttribute(`cones`,String(Math.max(0,Math.floor(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`),r=L(`span`,{class:`nico`,part:`badge`},t?L(`span`,{class:`fznew-spinner`,part:`spinner`},n?L(`span`,{class:`fznew-ring`,part:`ring`,style:`--fznew-progress:${this.progress??0}`}):null,i(uo,{size:fo,part:`icon`})):L(`slot`,{name:`icon`},i(lo,{size:fo,part:`icon`}))),a=L(`span`,{class:`nlbl`,part:`label`},L(`slot`,null,e)),o=L(`button`,{class:`fznew`,part:`button`,type:`button`,"aria-label":e,title:e,"aria-busy":t?`true`:void 0},r,a);this.#t=o,this.#c(o),this.#e.replaceChildren(o,this.#o(t,n))}#o(e,t){let n=L(`div`,{class:`fznew-row`,part:`row`,role:`group`,"aria-label":this.label});for(let[r,a,o]of this.#s()){let s=r===`new-chat-save`,c=s&&e?L(`span`,{class:`fznew-spinner`},t?L(`span`,{class:`fznew-ring`,style:`--fznew-progress:${this.progress??0}`}):null,i(uo,{size:fo})):i(a,{size:fo}),l=L(`button`,{class:`fznew-act fznew-act--${r}`,part:`action-${r}`,type:`button`,title:o,"aria-label":o,"aria-busy":s&&e?`true`:void 0},c);l.disabled=e,l.addEventListener(`click`,()=>{this.busy||this.#u(r)}),n.appendChild(l)}return n}#s(){let e=this.cones;return ho.filter(([t])=>t===`new-chat-skip`?!this.noSkip:t===`new-cone`?e!==null:t!==`drop-cone`||e!==null&&e>1)}#c(e){this.#n?.destroy(),this.#l(),this.#n=La(e,{onLongPress:()=>{if(this.#r!==null){this.#l(),this.#u(`new-chat-skip`);return}this.#u(`new-chat-erase`)},onShortClick:()=>{if(this.noSkip){this.#u(`new-chat-save`);return}if(this.#r!==null){this.#l(),this.#u(`new-chat-skip`);return}this.#r=setTimeout(()=>{this.#r=null,this.#u(`new-chat-save`)},mo)}})}#l(){this.#r!==null&&(clearTimeout(this.#r),this.#r=null)}#u(e){e===`new-chat-save`&&(this.busy=!0),this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))}});var _o=1e3/15;function vo(e,t,n){return n?!0:e-t>=62.66666666666667}function yo(e,t,n){if(n||!Number.isFinite(t))return e;let r=t+_o;return e-r>66.66666666666667?e:r}var bo=`attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }`,xo=`precision highp float;
3081
3081
  uniform vec2 u_res; uniform float u_time; uniform float u_energy;
3082
3082
  uniform vec2 u_center; uniform vec3 u_evt; uniform float u_freeze; uniform float u_dark;
3083
3083
  uniform float u_falloff; uniform float u_life; uniform vec3 u_tint; uniform float u_scroll;
3084
3084
  uniform float u_brightness; uniform float u_contrast; uniform float u_noise; uniform float u_blur;
3085
- vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,xo=`
3085
+ vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,So=`
3086
3086
  float hash21(vec2 p){ p=fract(p*vec2(123.34,456.21)); p+=dot(p,p+45.32); return fract(p.x*p.y); }
3087
3087
  float vnoise(vec2 p){ vec2 i=floor(p),f=fract(p);
3088
3088
  float a=hash21(i),b=hash21(i+vec2(1.,0.)),c=hash21(i+vec2(0.,1.)),d=hash21(i+vec2(1.,1.));
3089
3089
  vec2 u=f*f*(3.-2.*f); return mix(mix(a,b,u.x),mix(c,d,u.x),u.y); }
3090
3090
  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; }
3091
- 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); }`,So=`${bo}${xo}
3091
+ 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); }`,Co=`${xo}${So}
3092
3092
  vec3 pal(float t){ vec3 strawberry=vec3(1.0,0.45,0.62); vec3 vanilla=vec3(1.0,0.95,0.82);
3093
3093
  vec3 pistachio=vec3(0.60,0.86,0.52);
3094
3094
  vec3 col=mix(strawberry,vanilla,smoothstep(0.0,0.5,t)); col=mix(col,pistachio,smoothstep(0.5,1.0,t)); return col; }
@@ -3107,7 +3107,7 @@ void main(){
3107
3107
  ice*=0.95+0.08*sin(u_time*0.4); float mask=smoothstep(0.62,0.0,r);
3108
3108
  vec3 col=mix(bg,ice,clamp(mask,0.0,1.0)*0.80); col+=ice*mask*hl*0.12;
3109
3109
  gl_FragColor=vec4(col,1.0);
3110
- }`,Co=`${bo}${xo}
3110
+ }`,wo=`${xo}${So}
3111
3111
  /* Inside-of-a-freezer ground: icy WHITE in light mode (never the warm theme
3112
3112
  canvas — blue-on-beige read as sand, not frost), cold blue-black in dark. */
3113
3113
  vec3 freezerBg(){ return mix(vec3(0.965,0.98,1.0), vec3(0.05,0.08,0.13), u_dark); }
@@ -3134,7 +3134,7 @@ void main(){
3134
3134
  deviation budget the cone glass uses. */
3135
3135
  col=mix(freezerBg(),col,0.22);
3136
3136
  gl_FragColor=vec4(col,1.0);
3137
- }`,wo=`${bo}${xo}
3137
+ }`,To=`${xo}${So}
3138
3138
  uniform float u_speed;
3139
3139
  vec2 sugarHash(vec2 p){ p=vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))); return fract(sin(p)*43758.5453123); }
3140
3140
  vec3 sugarVoronoi(vec2 p,float t){
@@ -3213,19 +3213,19 @@ void main(){
3213
3213
  col+=u_noise*grain; col=(col-0.5)*u_contrast+0.5; col*=u_brightness; col=clamp(col,0.0,1.0);
3214
3214
  col=clamp(col,max(bg-vec3(0.20),vec3(0.0)),min(bg+vec3(0.20),vec3(1.0)));
3215
3215
  gl_FragColor=vec4(col,1.0);
3216
- }`,To={caramel:{mode:`cone`,tint:`#d08a3c`,brightness:1.1,contrast:1.1,noise:.025,blur:.14,coverage:.28,speed:.0625},"caramel-soft":{mode:`cone`,tint:`#d08a3c`,brightness:1.2,contrast:.75,noise:.025,blur:.14,coverage:.28,speed:1},frosted:{mode:`cone`,tint:`#ead9bd`,brightness:1,contrast:.55,noise:.005,blur:.9,coverage:.08,speed:1},brittle:{mode:`cone`,tint:`#ffd089`,brightness:.96,contrast:1.2,noise:.055,blur:.02,coverage:.68,speed:1},"waffle-glass":{mode:`cone`,tint:`#d3a15f`,brightness:1,contrast:.9,noise:.02,blur:.08,coverage:.9,speed:1}},Eo={cone:wo,scoop:So,freezer:Co},Do=new Set([`cone`,`scoop`,`freezer`]),Oo={cone:`radial-gradient(120% 120% at 35% 45%, color-mix(in srgb,#d08a3c 20%,var(--bg)) 0%, var(--bg) 70%)`,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%)`},ko=R(`
3216
+ }`,Eo={caramel:{mode:`cone`,tint:`#d08a3c`,brightness:1.1,contrast:1.1,noise:.025,blur:.14,coverage:.28,speed:.0625},"caramel-soft":{mode:`cone`,tint:`#d08a3c`,brightness:1.2,contrast:.75,noise:.025,blur:.14,coverage:.28,speed:1},frosted:{mode:`cone`,tint:`#ead9bd`,brightness:1,contrast:.55,noise:.005,blur:.9,coverage:.08,speed:1},brittle:{mode:`cone`,tint:`#ffd089`,brightness:.96,contrast:1.2,noise:.055,blur:.02,coverage:.68,speed:1},"waffle-glass":{mode:`cone`,tint:`#d3a15f`,brightness:1,contrast:.9,noise:.02,blur:.08,coverage:.9,speed:1}},Do={cone:To,scoop:Co,freezer:wo},Oo=new Set([`cone`,`scoop`,`freezer`]),ko={cone:`radial-gradient(120% 120% at 35% 45%, color-mix(in srgb,#d08a3c 20%,var(--bg)) 0%, var(--bg) 70%)`,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%)`},Ao=R(`
3217
3217
  :host { position: relative; display: block; pointer-events: none; }
3218
3218
  .canvas, .fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
3219
3219
  .fallback { display: none; }
3220
3220
  :host([no-webgl]) .canvas { display: none; }
3221
- :host([no-webgl]) .fallback { display: block; }`),Ao=1,jo=.5,Mo=2,No=.35,Po=3e3,Fo=[`u_res`,`u_scroll`,`u_time`,`u_energy`,`u_center`,`u_evt`,`u_freeze`,`u_dark`,`u_falloff`,`u_life`,`u_tint`,`u_brightness`,`u_contrast`,`u_noise`,`u_blur`,`u_speed`];function Io(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function Lo(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 Ro=class extends HTMLElement{static observedAttributes=[`mode`,`tint`,`coverage`,`intensity`,`scroll`,`brightness`,`contrast`,`noise`,`blur`,`speed`,`dpr`];#e;#t=null;#n=null;#r=null;#i={};#a=null;#o={};#s=-1;#c=0;#l=0;#u=0;#d=-1/0;#f=0;#p=!1;#m=0;#h=null;#g=!1;#_=[.816,.541,.235];#v=[.957,.247,.369];#y=0;#b=null;#x=null;#S=null;#C=null;#w=null;#T=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ko];let e=L(`canvas`,{class:`canvas`,part:`canvas`}),t=L(`div`,{class:`fallback`,part:`fallback`,"aria-hidden":`true`});this.#e.replaceChildren(e,t),this.#t=e}connectedCallback(){if(this.#g=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.#E(),!this.#P()){this.setAttribute(`no-webgl`,``);return}if(this.removeAttribute(`no-webgl`),typeof ResizeObserver<`u`){let e=!0;this.#h=new ResizeObserver(()=>{let t=e;e=!1,this.#G({burst:!t})}),this.#h.observe(this)}this.#D(),this.#O(),this.#l=performance.now()/1e3,this.#d=-1/0,this.#p=!1,this.#z(),this.#G()}disconnectedCallback(){this.#q(),this.#h?.disconnect(),this.#h=null,this.#b?.disconnect(),this.#b=null,this.#x&&this.#S&&this.#x.removeEventListener(`change`,this.#S),this.#x=null,this.#S=null,this.#J()}attributeChangedCallback(e){if(this.isConnected){if((e===`tint`||e===`mode`)&&this.#D(),e===`mode`&&this.#n&&this.mode!==this.#C){if(this.#j()){this.#U(),this.#d=performance.now(),this.#E(),this.#G();return}console.error(`[slicc-shader] mode switch failed to link program`)}this.#E(),this.#G({burst:!0})}}get mode(){let e=this.getAttribute(`mode`);return e&&Do.has(e)?e:`cone`}set mode(e){this.setAttribute(`mode`,e)}get coverage(){let e=this.mode===`cone`?To.caramel.coverage:.66;return Io(Number.parseFloat(this.getAttribute(`coverage`)??``),0,1,e)}set coverage(e){this.setAttribute(`coverage`,String(e))}get intensity(){return Io(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 Io(Number.parseFloat(this.getAttribute(`brightness`)??``),.5,1.5,To.caramel.brightness)}set brightness(e){this.setAttribute(`brightness`,String(e))}get contrast(){return Io(Number.parseFloat(this.getAttribute(`contrast`)??``),.5,2,To.caramel.contrast)}set contrast(e){this.setAttribute(`contrast`,String(e))}get noise(){return Io(Number.parseFloat(this.getAttribute(`noise`)??``),0,.3,To.caramel.noise)}set noise(e){this.setAttribute(`noise`,String(e))}get blurAmount(){return Io(Number.parseFloat(this.getAttribute(`blur`)??``),0,1,To.caramel.blur)}set blurAmount(e){this.setAttribute(`blur`,String(e))}get speed(){return Io(Number.parseFloat(this.getAttribute(`speed`)??``),0,2,To.caramel.speed)}set speed(e){this.setAttribute(`speed`,String(e))}get dpr(){return Io(Number.parseFloat(this.getAttribute(`dpr`)??``),jo,Mo,Ao)}set dpr(e){this.setAttribute(`dpr`,String(e))}get noWebgl(){return this.hasAttribute(`no-webgl`)}pulse(e=1){Number.isFinite(e)&&(this.#u=Math.min(1.4,Math.max(0,this.#u+e)),this.#G({burst:!0}))}#E(){let e=this.#e.querySelector(`.fallback`);e&&(e.style.background=Oo[this.mode])}#D(){let e=this.getAttribute(`tint`)??(this.mode===`cone`?To.caramel.tint:``);this.#_=Lo(e,[.545,.361,.965]),this.#v=Lo(e,[.957,.247,.369]),this.#y=this.#H()}#O(){let e=()=>{this.#D(),this.#G({burst:!0})};if(typeof MutationObserver<`u`){this.#b=new MutationObserver(e);for(let e of[document.documentElement,document.body])e&&this.#b.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme`]})}typeof matchMedia==`function`&&(this.#x=matchMedia(`(prefers-color-scheme: dark)`),this.#S=e,this.#x.addEventListener(`change`,this.#S))}#k(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}#A(e){let t=this.#n;if(!t)return null;let n=this.#k(t,t.VERTEX_SHADER,yo),r=this.#k(t,t.FRAGMENT_SHADER,Eo[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 Fo)o[e]=t.getUniformLocation(i,e);return{program:i,vs:n,fs:r,aPos:a,loc:o}}#j(){let e=this.#n;if(!e)return!1;let t=this.mode,n=this.#i[t];if(!n){let e=this.#A(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.#C=t,!0}#M(e){let t={premultipliedAlpha:!0,alpha:!0,antialias:!0};try{return e.getContext(`webgl`,t)??e.getContext(`experimental-webgl`,t)}catch{return null}}#N(e){this.#L(e);let t=L(`canvas`,{class:`canvas`,part:`canvas`});return e.parentNode?e.replaceWith(t):this.#e.prepend(t),this.#t=t,t}#P(){let e=this.#t;if(!e)return!1;let t=this.#M(e);return t?.isContextLost()&&(e=this.#N(e),t=this.#M(e)),!t||t.isContextLost()?!1:(this.#n=t,this.#I(e),this.#F()?!0:(this.#J(),!1))}#F(){let e=this.#n;if(!e||!this.#j())return!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):!1}#I(e){this.#L(e),this.#w=e=>{e.preventDefault(),this.#p=!0,this.#q(),this.#i={},this.#r=null,this.#C=null,this.#o={},this.#a=null,console.warn(`[slicc-shader] WebGL context lost; waiting for restore`),this.#R()},this.#T=()=>{if(this.#z(),!(!this.isConnected||!this.#n)){if(this.#i={},!this.#F()){this.#B(`GL restore failed; falling back to CSS gradient`);return}this.#p=!1,this.#l=performance.now()/1e3,this.#d=-1/0,this.#G()}},e.addEventListener(`webglcontextlost`,this.#w,!1),e.addEventListener(`webglcontextrestored`,this.#T,!1)}#L(e){this.#w&&e.removeEventListener(`webglcontextlost`,this.#w),this.#T&&e.removeEventListener(`webglcontextrestored`,this.#T),this.#w=null,this.#T=null}#R(){this.#z(),this.#m=window.setTimeout(()=>{this.#m=0,!(!this.isConnected||!this.#p)&&this.#B(`WebGL context not restored; falling back to CSS gradient`)},Po)}#z(){this.#m&&=(clearTimeout(this.#m),0)}#B(e){this.#z(),this.#p=!1,console.error(`[slicc-shader] ${e}`),this.setAttribute(`no-webgl`,``);let t=this.#t;t&&this.#N(t),this.#J()}#V(){let e=this.#t;if(!e)return;let t=Math.min(this.dpr,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)}#H(){if(typeof getComputedStyle!=`function`)return 0;let e=getComputedStyle(this).getPropertyValue(`--ink`).trim();if(!e)return 0;let[t,n,r]=Lo(e,[0,0,0]);return+(.2126*t+.7152*n+.0722*r>.5)}#U(){let e=this.#n,t=this.#t,n=this.#r;if(!e||!t||!n||!this.#a)return;this.#V();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.#y,l=this.#_,u=this.#v;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,Io(this.coverage*this.intensity,0,1,.66)*2.2),e.uniform1f(d.u_dark??null,c),e.uniform1f(d.u_scroll??null,this.scrollOffset*No/Math.max(1,t.clientHeight||t.height)),e.uniform1f(d.u_falloff??null,.3),e.uniform1f(d.u_life??null,.35),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.uniform1f(d.u_speed??null,this.speed),e.drawArrays(e.TRIANGLES,0,3),this.#u*=.95,this.#u<.001&&(this.#u=0)}#W(){return!(this.#g||this.mode===`cone`&&this.speed===0)}#G(e={}){e.burst&&(this.#f=performance.now()+800),!(this.#c||!this.#n||this.#p)&&(this.#c=requestAnimationFrame(this.#K))}#K=e=>{this.#c=0;let t=e<this.#f||this.#u>0;_o(e,this.#d,t)&&(this.#d=vo(e,this.#d,t),this.#U()),!(this.#g||!this.#W()&&this.#u===0)&&(this.#c=requestAnimationFrame(this.#K))};#q(){this.#c&&cancelAnimationFrame(this.#c),this.#c=0}#J(){this.#z();let e=this.#n,t=this.#t;if(t&&this.#L(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.#C=null}};I(`slicc-shader`,Ro),I(`slicc-frost-shader`,class extends Ro{connectedCallback(){this.getAttribute(`mode`)!==`freezer`&&this.setAttribute(`mode`,`freezer`),super.connectedCallback()}});var zo=`# Memory
3221
+ :host([no-webgl]) .fallback { display: block; }`),jo=1,Mo=.5,No=2,Po=.35,Fo=3e3,Io=[`u_res`,`u_scroll`,`u_time`,`u_energy`,`u_center`,`u_evt`,`u_freeze`,`u_dark`,`u_falloff`,`u_life`,`u_tint`,`u_brightness`,`u_contrast`,`u_noise`,`u_blur`,`u_speed`];function Lo(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function Ro(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 zo=class extends HTMLElement{static observedAttributes=[`mode`,`tint`,`coverage`,`intensity`,`scroll`,`brightness`,`contrast`,`noise`,`blur`,`speed`,`dpr`];#e;#t=null;#n=null;#r=null;#i={};#a=null;#o={};#s=-1;#c=0;#l=0;#u=0;#d=-1/0;#f=0;#p=!1;#m=0;#h=null;#g=!1;#_=[.816,.541,.235];#v=[.957,.247,.369];#y=0;#b=null;#x=null;#S=null;#C=null;#w=null;#T=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ao];let e=L(`canvas`,{class:`canvas`,part:`canvas`}),t=L(`div`,{class:`fallback`,part:`fallback`,"aria-hidden":`true`});this.#e.replaceChildren(e,t),this.#t=e}connectedCallback(){if(this.#g=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.#E(),!this.#P()){this.setAttribute(`no-webgl`,``);return}if(this.removeAttribute(`no-webgl`),typeof ResizeObserver<`u`){let e=!0;this.#h=new ResizeObserver(()=>{let t=e;e=!1,this.#G({burst:!t})}),this.#h.observe(this)}this.#D(),this.#O(),this.#l=performance.now()/1e3,this.#d=-1/0,this.#p=!1,this.#z(),this.#G()}disconnectedCallback(){this.#q(),this.#h?.disconnect(),this.#h=null,this.#b?.disconnect(),this.#b=null,this.#x&&this.#S&&this.#x.removeEventListener(`change`,this.#S),this.#x=null,this.#S=null,this.#J()}attributeChangedCallback(e){if(this.isConnected){if((e===`tint`||e===`mode`)&&this.#D(),e===`mode`&&this.#n&&this.mode!==this.#C){if(this.#j()){this.#U(),this.#d=performance.now(),this.#E(),this.#G();return}console.error(`[slicc-shader] mode switch failed to link program`)}this.#E(),this.#G({burst:!0})}}get mode(){let e=this.getAttribute(`mode`);return e&&Oo.has(e)?e:`cone`}set mode(e){this.setAttribute(`mode`,e)}get coverage(){let e=this.mode===`cone`?Eo.caramel.coverage:.66;return Lo(Number.parseFloat(this.getAttribute(`coverage`)??``),0,1,e)}set coverage(e){this.setAttribute(`coverage`,String(e))}get intensity(){return Lo(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 Lo(Number.parseFloat(this.getAttribute(`brightness`)??``),.5,1.5,Eo.caramel.brightness)}set brightness(e){this.setAttribute(`brightness`,String(e))}get contrast(){return Lo(Number.parseFloat(this.getAttribute(`contrast`)??``),.5,2,Eo.caramel.contrast)}set contrast(e){this.setAttribute(`contrast`,String(e))}get noise(){return Lo(Number.parseFloat(this.getAttribute(`noise`)??``),0,.3,Eo.caramel.noise)}set noise(e){this.setAttribute(`noise`,String(e))}get blurAmount(){return Lo(Number.parseFloat(this.getAttribute(`blur`)??``),0,1,Eo.caramel.blur)}set blurAmount(e){this.setAttribute(`blur`,String(e))}get speed(){return Lo(Number.parseFloat(this.getAttribute(`speed`)??``),0,2,Eo.caramel.speed)}set speed(e){this.setAttribute(`speed`,String(e))}get dpr(){return Lo(Number.parseFloat(this.getAttribute(`dpr`)??``),Mo,No,jo)}set dpr(e){this.setAttribute(`dpr`,String(e))}get noWebgl(){return this.hasAttribute(`no-webgl`)}pulse(e=1){Number.isFinite(e)&&(this.#u=Math.min(1.4,Math.max(0,this.#u+e)),this.#G({burst:!0}))}#E(){let e=this.#e.querySelector(`.fallback`);e&&(e.style.background=ko[this.mode])}#D(){let e=this.getAttribute(`tint`)??(this.mode===`cone`?Eo.caramel.tint:``);this.#_=Ro(e,[.545,.361,.965]),this.#v=Ro(e,[.957,.247,.369]),this.#y=this.#H()}#O(){let e=()=>{this.#D(),this.#G({burst:!0})};if(typeof MutationObserver<`u`){this.#b=new MutationObserver(e);for(let e of[document.documentElement,document.body])e&&this.#b.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme`]})}typeof matchMedia==`function`&&(this.#x=matchMedia(`(prefers-color-scheme: dark)`),this.#S=e,this.#x.addEventListener(`change`,this.#S))}#k(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}#A(e){let t=this.#n;if(!t)return null;let n=this.#k(t,t.VERTEX_SHADER,bo),r=this.#k(t,t.FRAGMENT_SHADER,Do[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 Io)o[e]=t.getUniformLocation(i,e);return{program:i,vs:n,fs:r,aPos:a,loc:o}}#j(){let e=this.#n;if(!e)return!1;let t=this.mode,n=this.#i[t];if(!n){let e=this.#A(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.#C=t,!0}#M(e){let t={premultipliedAlpha:!0,alpha:!0,antialias:!0};try{return e.getContext(`webgl`,t)??e.getContext(`experimental-webgl`,t)}catch{return null}}#N(e){this.#L(e);let t=L(`canvas`,{class:`canvas`,part:`canvas`});return e.parentNode?e.replaceWith(t):this.#e.prepend(t),this.#t=t,t}#P(){let e=this.#t;if(!e)return!1;let t=this.#M(e);return t?.isContextLost()&&(e=this.#N(e),t=this.#M(e)),!t||t.isContextLost()?!1:(this.#n=t,this.#I(e),this.#F()?!0:(this.#J(),!1))}#F(){let e=this.#n;if(!e||!this.#j())return!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):!1}#I(e){this.#L(e),this.#w=e=>{e.preventDefault(),this.#p=!0,this.#q(),this.#i={},this.#r=null,this.#C=null,this.#o={},this.#a=null,console.warn(`[slicc-shader] WebGL context lost; waiting for restore`),this.#R()},this.#T=()=>{if(this.#z(),!(!this.isConnected||!this.#n)){if(this.#i={},!this.#F()){this.#B(`GL restore failed; falling back to CSS gradient`);return}this.#p=!1,this.#l=performance.now()/1e3,this.#d=-1/0,this.#G()}},e.addEventListener(`webglcontextlost`,this.#w,!1),e.addEventListener(`webglcontextrestored`,this.#T,!1)}#L(e){this.#w&&e.removeEventListener(`webglcontextlost`,this.#w),this.#T&&e.removeEventListener(`webglcontextrestored`,this.#T),this.#w=null,this.#T=null}#R(){this.#z(),this.#m=window.setTimeout(()=>{this.#m=0,!(!this.isConnected||!this.#p)&&this.#B(`WebGL context not restored; falling back to CSS gradient`)},Fo)}#z(){this.#m&&=(clearTimeout(this.#m),0)}#B(e){this.#z(),this.#p=!1,console.error(`[slicc-shader] ${e}`),this.setAttribute(`no-webgl`,``);let t=this.#t;t&&this.#N(t),this.#J()}#V(){let e=this.#t;if(!e)return;let t=Math.min(this.dpr,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)}#H(){if(typeof getComputedStyle!=`function`)return 0;let e=getComputedStyle(this).getPropertyValue(`--ink`).trim();if(!e)return 0;let[t,n,r]=Ro(e,[0,0,0]);return+(.2126*t+.7152*n+.0722*r>.5)}#U(){let e=this.#n,t=this.#t,n=this.#r;if(!e||!t||!n||!this.#a)return;this.#V();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.#y,l=this.#_,u=this.#v;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,Lo(this.coverage*this.intensity,0,1,.66)*2.2),e.uniform1f(d.u_dark??null,c),e.uniform1f(d.u_scroll??null,this.scrollOffset*Po/Math.max(1,t.clientHeight||t.height)),e.uniform1f(d.u_falloff??null,.3),e.uniform1f(d.u_life??null,.35),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.uniform1f(d.u_speed??null,this.speed),e.drawArrays(e.TRIANGLES,0,3),this.#u*=.95,this.#u<.001&&(this.#u=0)}#W(){return!(this.#g||this.mode===`cone`&&this.speed===0)}#G(e={}){e.burst&&(this.#f=performance.now()+800),!(this.#c||!this.#n||this.#p)&&(this.#c=requestAnimationFrame(this.#K))}#K=e=>{this.#c=0;let t=e<this.#f||this.#u>0;vo(e,this.#d,t)&&(this.#d=yo(e,this.#d,t),this.#U()),!(this.#g||!this.#W()&&this.#u===0)&&(this.#c=requestAnimationFrame(this.#K))};#q(){this.#c&&cancelAnimationFrame(this.#c),this.#c=0}#J(){this.#z();let e=this.#n,t=this.#t;if(t&&this.#L(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.#C=null}};I(`slicc-shader`,zo),I(`slicc-frost-shader`,class extends zo{connectedCallback(){this.getAttribute(`mode`)!==`freezer`&&this.setAttribute(`mode`,`freezer`),super.connectedCallback()}});var Bo=`# Memory
3222
3222
 
3223
- `,Bo=[`**Evidence first:** inspect the smallest relevant surface before editing and record the observed state.`,`**Narrow plans:** keep one measurable outcome, one implementation pass, and one verification pass.`,`**Runtime state:** prefer browser-owned storage and keep the relay stateless whenever practical.`,`**Failure boundaries:** external work needs a timeout, a useful error category, and an explicit retry decision.`,"**Keyboard parity:** interactive rows remain focusable and respond to both `Enter` and `Space`.",`**Memory rendering:** preserve Markdown meaning while sanitizing untrusted tags at the DOM boundary.`,`**Cross-runtime parity:** shared events need matching page, worker, extension, and follower handling.`,`**Verification records:** report the exact command, outcome, and scope instead of writing only “tests pass”.`,`**Synthetic data:** use neutral paths, reserved domains, and conspicuously invented identifiers in fixtures.`,`**Collaboration:** coordinate public-barrel edits before overlapping with another active implementation.`],Vo=["Keep the durable rule beside `packages/example.ts` so later work can reproduce the decision without a transcript.",`Preserve selection, expansion, and scroll state when a refresh replaces visible children.`,`Run the focused regression first; broaden to package and repository gates only after the hypothesis holds.`,'Treat A & B, “quoted labels”, arrows →, and `<preview mode="safe">` as text rather than executable markup.',`Prefer a reversible patch over a destructive command when the target was inferred rather than supplied.`,`Stop exploring when another read no longer changes the hypothesis; switch to a test or focused question.`,`Document the invalidation trigger when cached data can become stale, and retain a correctness bypass.`,`Release every listener, timer, observer, channel, and object URL during the matching teardown path.`,`Keep logs to operation name, duration, status, and a synthetic correlation label; omit payload contents.`],Ho=Bo.flatMap(e=>Vo.map(t=>`- ${e} ${t}`)),Uo=[`- Keep diffs small.`,`- Prefer native APIs.`,`- Ship docs with code.`,`- No surprise deploys.`,"- **Continuation stress:** preserve one logical memory across source lines,\n carrying `inline-code`, emphasis, and an arrow → without creating another row.",'- **Escaping stress:** render `<preview mode="safe">`, A & B, “quotes”, and `score > threshold` as inert content.',`- **Reserved link:** [the synthetic reference](https://example.invalid/memory) exists only to exercise link rendering.`,`- **Medium tail:** before rebuilding a filtered collection, capture the query, focused control, selected row, group expansion, and scroll anchor; restore only state that still refers to surviving items.`,`- **Long tail:** ${`A long-lived panel decision was reviewed in sequence: a compact sample initially hid scale problems; a larger dataset exposed discarded provenance and summaries cut mid-phrase; Markdown stress then revealed literal markers; keyboard review found pointer-only activation; narrow layouts showed metadata competing with the primary text; refresh testing exposed lost search, focus, expansion, and scroll state; cross-runtime review found a missing follower path; failure testing identified an unbounded request; cleanup testing found a retained observer; and final verification required the focused test, package suite, coverage gate, and build. `.repeat(2).trim()}`,`- **Folded long tail:** a remote action keeps one event contract and preserves error categories across serialization,
3223
+ `,Vo=[`**Evidence first:** inspect the smallest relevant surface before editing and record the observed state.`,`**Narrow plans:** keep one measurable outcome, one implementation pass, and one verification pass.`,`**Runtime state:** prefer browser-owned storage and keep the relay stateless whenever practical.`,`**Failure boundaries:** external work needs a timeout, a useful error category, and an explicit retry decision.`,"**Keyboard parity:** interactive rows remain focusable and respond to both `Enter` and `Space`.",`**Memory rendering:** preserve Markdown meaning while sanitizing untrusted tags at the DOM boundary.`,`**Cross-runtime parity:** shared events need matching page, worker, extension, and follower handling.`,`**Verification records:** report the exact command, outcome, and scope instead of writing only “tests pass”.`,`**Synthetic data:** use neutral paths, reserved domains, and conspicuously invented identifiers in fixtures.`,`**Collaboration:** coordinate public-barrel edits before overlapping with another active implementation.`],Ho=["Keep the durable rule beside `packages/example.ts` so later work can reproduce the decision without a transcript.",`Preserve selection, expansion, and scroll state when a refresh replaces visible children.`,`Run the focused regression first; broaden to package and repository gates only after the hypothesis holds.`,'Treat A & B, “quoted labels”, arrows →, and `<preview mode="safe">` as text rather than executable markup.',`Prefer a reversible patch over a destructive command when the target was inferred rather than supplied.`,`Stop exploring when another read no longer changes the hypothesis; switch to a test or focused question.`,`Document the invalidation trigger when cached data can become stale, and retain a correctness bypass.`,`Release every listener, timer, observer, channel, and object URL during the matching teardown path.`,`Keep logs to operation name, duration, status, and a synthetic correlation label; omit payload contents.`],Uo=Vo.flatMap(e=>Ho.map(t=>`- ${e} ${t}`)),Wo=[`- Keep diffs small.`,`- Prefer native APIs.`,`- Ship docs with code.`,`- No surprise deploys.`,"- **Continuation stress:** preserve one logical memory across source lines,\n carrying `inline-code`, emphasis, and an arrow → without creating another row.",'- **Escaping stress:** render `<preview mode="safe">`, A & B, “quotes”, and `score > threshold` as inert content.',`- **Reserved link:** [the synthetic reference](https://example.invalid/memory) exists only to exercise link rendering.`,`- **Medium tail:** before rebuilding a filtered collection, capture the query, focused control, selected row, group expansion, and scroll anchor; restore only state that still refers to surviving items.`,`- **Long tail:** ${`A long-lived panel decision was reviewed in sequence: a compact sample initially hid scale problems; a larger dataset exposed discarded provenance and summaries cut mid-phrase; Markdown stress then revealed literal markers; keyboard review found pointer-only activation; narrow layouts showed metadata competing with the primary text; refresh testing exposed lost search, focus, expansion, and scroll state; cross-runtime review found a missing follower path; failure testing identified an unbounded request; cleanup testing found a retained observer; and final verification required the focused test, package suite, coverage gate, and build. `.repeat(2).trim()}`,`- **Folded long tail:** a remote action keeps one event contract and preserves error categories across serialization,
3224
3224
  terminates pending requests on disconnect, and verifies timeout plus malformed-response behavior,
3225
- while this third source line remains part of the same bullet and contains “quotes”, A & B, and <angle brackets>.`],Wo=[...Ho,...Uo],Go=[[`2099-01-03`,`compaction`],[`2099-01-10`,`new-session`],[`2099-01-18`,`compaction`],[`2099-02-02`,`pending-enrichment`],[`2099-02-14`,`new-session`],[`2099-03-01`,`compaction`],[`2099-03-21`,`pending-enrichment`],[`2099-04-05`,`compaction`],[`2099-04-19`,`new-session`],[`2099-05-07`,`compaction`]];function Ko(e,t,n){return`## Auto-extracted (${e}, ${t})\n\n${n.join(`
3226
- `)}\n`}zo+Go.map(([e,t],n)=>Ko(e,t,Wo.slice(n*10,n*10+10))).join(`
3227
- `),`${zo}${Wo.join(`
3228
- `)}`;var qo=new Set([`user`,`feedback`,`project`]),Jo={user:{hue:`--rose`,label:`user`},feedback:{hue:`--cyan`,label:`feedback`},project:{hue:`--violet`,label:`project`}};function Yo(e){return e===`feedback`||e===`project`?e:`user`}var Xo=R(`
3225
+ while this third source line remains part of the same bullet and contains “quotes”, A & B, and <angle brackets>.`],Go=[...Uo,...Wo],Ko=[[`2099-01-03`,`compaction`],[`2099-01-10`,`new-session`],[`2099-01-18`,`compaction`],[`2099-02-02`,`pending-enrichment`],[`2099-02-14`,`new-session`],[`2099-03-01`,`compaction`],[`2099-03-21`,`pending-enrichment`],[`2099-04-05`,`compaction`],[`2099-04-19`,`new-session`],[`2099-05-07`,`compaction`]];function qo(e,t,n){return`## Auto-extracted (${e}, ${t})\n\n${n.join(`
3226
+ `)}\n`}Bo+Ko.map(([e,t],n)=>qo(e,t,Go.slice(n*10,n*10+10))).join(`
3227
+ `),`${Bo}${Go.join(`
3228
+ `)}`;var Jo=new Set([`user`,`feedback`,`project`]),Yo={user:{hue:`--rose`,label:`user`},feedback:{hue:`--cyan`,label:`feedback`},project:{hue:`--violet`,label:`project`}};function Xo(e){return e===`feedback`||e===`project`?e:`user`}var Zo=R(`
3229
3229
  :host {
3230
3230
  display: inline-flex;
3231
3231
  vertical-align: middle;
@@ -3247,13 +3247,13 @@ void main(){
3247
3247
  background: color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-fill), var(--canvas));
3248
3248
  border: 1px solid color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-border), var(--line));
3249
3249
  }
3250
- `),Zo=`slicc-memtag-dark`,Qo=`
3250
+ `),Qo=`slicc-memtag-dark`,$o=`
3251
3251
  .dark slicc-memtag,
3252
3252
  [data-theme="dark"] slicc-memtag {
3253
3253
  --mtag-fill: 22%;
3254
3254
  --mtag-border: 38%;
3255
3255
  }
3256
- `;function $o(e){if(e.getElementById(Zo))return;let t=e.createElement(`style`);t.id=Zo,t.textContent=Qo,(e.head??e.documentElement).appendChild(t)}I(`slicc-memtag`,class extends HTMLElement{static observedAttributes=[`type`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Xo]}connectedCallback(){$o(this.ownerDocument),this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get type(){return Yo(this.getAttribute(`type`))}set type(e){this.setAttribute(`type`,qo.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}=Jo[this.type],n=this.label??L(`slot`,null,t),r=L(`span`,{class:`mtag`,part:`tag`,style:`--mtag-hue:var(${e})`},n);this.#e.replaceChildren(r)}});var es=`
3256
+ `;function es(e){if(e.getElementById(Qo))return;let t=e.createElement(`style`);t.id=Qo,t.textContent=$o,(e.head??e.documentElement).appendChild(t)}I(`slicc-memtag`,class extends HTMLElement{static observedAttributes=[`type`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Zo]}connectedCallback(){es(this.ownerDocument),this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get type(){return Xo(this.getAttribute(`type`))}set type(e){this.setAttribute(`type`,Jo.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}=Yo[this.type],n=this.label??L(`slot`,null,t),r=L(`span`,{class:`mtag`,part:`tag`,style:`--mtag-hue:var(${e})`},n);this.#e.replaceChildren(r)}});var ts=`
3257
3257
  slicc-memrow {
3258
3258
  display: block;
3259
3259
  border: 1px solid var(--line);
@@ -3360,9 +3360,9 @@ slicc-memrow.fresh {
3360
3360
  background: color-mix(in srgb, var(--violet) 22%, var(--canvas));
3361
3361
  border-color: color-mix(in srgb, var(--violet) 38%, var(--line));
3362
3362
  }
3363
- `,ts=`slicc-memrow-style`,ns=96,rs=12;function is(e,t){if(e.length<=ns)return{heading:e,summary:t};let n=e.slice(0,97).lastIndexOf(` `),r=n>=rs?n:ns,i=e.slice(r).trim();return{heading:e.slice(0,r).trim(),summary:[i,t].filter(Boolean).join(` `)}}function as(e){if(e.getElementById(ts))return;let t=e.createElement(`style`);t.id=ts,t.textContent=es,(e.head??e.documentElement).appendChild(t)}function os(e){return e===`feedback`||e===`project`?e:`user`}I(`slicc-memrow`,class extends HTMLElement{static get observedAttributes(){return[`heading`,`summary`,`tag`,`fresh`,`expanded`]}#e=!1;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=0;#c=!1;#l=!1;#u=null;#d=null;#f=null;connectedCallback(){as(this.ownerDocument),this.#e||this.#p(),this.#m(),this.#y(),this.#h()}disconnectedCallback(){this.#b(),this.#o?.disconnect(),this.#o=null,this.#s&&cancelAnimationFrame(this.#s),this.#s=0}attributeChangedCallback(){this.#e&&this.#m()}get heading(){return this.getAttribute(`heading`)??``}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get summary(){return this.getAttribute(`summary`)??``}set summary(e){e==null?this.removeAttribute(`summary`):this.setAttribute(`summary`,e)}get tag(){return os(this.getAttribute(`tag`))}set tag(e){this.setAttribute(`tag`,e)}get fresh(){return this.hasAttribute(`fresh`)}set fresh(e){this.toggleAttribute(`fresh`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}setHeadingContent(e){this.#c=!0,this.#n?this.#n.replaceChildren(e):this.#u=e}setBodyContent(e){this.#l=!0,this.#i?this.#i.replaceChildren(e):this.#d=e,this.#g()}#p(){this.#e=!0;let e=this.ownerDocument.createElement(`button`);e.className=`mt`,e.type=`button`;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.#u&&t.replaceChildren(this.#u),this.#d&&r.replaceChildren(this.#d),this.#u=null,this.#d=null,this.append(e,r),this.#t=e,this.#n=t,this.#r=n,this.#i=r}#m(){let e=this.#n,t=this.#r,n=this.#i;if(!e||!t||!n)return;let r=is(this.heading,this.summary);this.#c||(e.textContent=r.heading);let i=this.tag;if(t.className=``,t.hidden=!this.hasAttribute(`tag`),t.setAttribute(`type`,i),t.textContent=``,!this.#l){let e=n.firstChild,t=r.summary;e&&e.nodeType===Node.TEXT_NODE?e.textContent=t:t&&n.insertBefore(this.ownerDocument.createTextNode(t),e)}this.classList.toggle(`fresh`,this.fresh),this.#v(),this.#g()}#h(){let e=this.#i;!e||this.#o||(this.#o=new ResizeObserver(()=>this.#g()),this.#o.observe(e),this.#g())}#g(){!this.isConnected||this.expanded||(this.#s&&cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>{this.#s=0;let e=this.#i;!e||this.expanded||(e.scrollHeight>e.clientHeight+1?this.#_():this.#a?.remove(),this.#v())}))}#_(){if(!this.#a){let e=this.ownerDocument.createElement(`button`);e.className=`mexpand`,e.type=`button`,e.addEventListener(`click`,e=>{e.stopPropagation(),this.expanded=!this.expanded}),this.#a=e}this.#a.isConnected||this.append(this.#a)}#v(){let e=this.#a;if(!e?.isConnected)return;let t=this.expanded;e.textContent=t?`Show less`:`Show more`,e.setAttribute(`aria-expanded`,String(t))}#y(){this.#f||(this.#f=e=>this.#x(e),this.addEventListener(`click`,this.#f))}#b(){this.#f&&=(this.removeEventListener(`click`,this.#f),null)}#x(e){this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{heading:this.heading,summary:this.summary,tag:this.tag,sourceEvent:e}}))}});var ss=64,cs=12,ls=/\b(feedback|reviews?|corrections?|learnings?|observations?|testing|verification)\b/i,us=/\b(user|preferences?|identit(?:y|ies)|accounts?|personal|interface|working rhythm|keyboard|accessibility)\b/i,ds=/^Auto-extracted \(/;function fs(e){let t=document.createRange();return t.selectNodeContents(document.body),t.createContextualFragment(e)}function ps(e,t){return(fs(t(e)).textContent??``).replace(/\s+/g,` `).trim()}function ms(e,t){let n=ps(e,t);if(n.length<=ss)return{title:n,summary:``,titleEnd:n.length,summaryStart:n.length};let r=[];for(let e of n.matchAll(/[.!?](?:[*_`'")\]]*)\s+|\s+[—–]\s+|[:;](?:[*_`]*)\s+|,\s+(?=(?:and|but|because|while|when|then|so)\b)/g)){let t=/^\s+[—–]|^[:;]/.test(e[0]),i=e.index+(t?0:e[0].trimEnd().length),a=e.index+e[0].length;n.slice(0,i).trim().length>=cs&&i<=96&&n.slice(a).trim()&&r.push({titleEnd:i,summaryStart:a})}let i=r.sort((e,t)=>Math.abs(e.titleEnd-ss)-Math.abs(t.titleEnd-ss))[0];if(i)return{title:n.slice(0,i.titleEnd).trim(),summary:n.slice(i.summaryStart).trim(),titleEnd:i.titleEnd,summaryStart:i.summaryStart};let a=n.slice(0,97).lastIndexOf(` `),o=a>=cs?a:96,s=n.slice(o).trim();return{title:n.slice(0,o).trim(),summary:s,titleEnd:o,summaryStart:n.indexOf(s,o)}}function hs(e,t,n){let r=ps(e,n),i=ds.test(t),a=i?r:`${t} ${r}`;return ls.test(a)?`feedback`:us.test(a)?`user`:i?null:`project`}function gs(e,t,n){let r=ms(e,n);return{title:r.title,summary:r.summary,section:t,tag:hs(e,t,n),bodyHtml:n(e),titleEnd:r.titleEnd,summaryStart:r.summaryStart}}function _s(e,t){let n=[],r=`Memory`,i=``,a=``,o=null,s=()=>[i||r,a].filter(Boolean).join(` / `),c=()=>{if(!o)return;let e=o.lines.join(` `).trim();e&&n.push(gs(e,o.section,t)),o=null};for(let n of e.split(`
3364
- `)){let e=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(n.trim());if(e){c();let n=ps(e[2],t);e[1].length===1?(r=n||r,i=``,a=``):e[1].length===2?(i=n,a=``):e[1].length===3&&(a=n);continue}let l=/^\s*[-*]\s+(.*)$/.exec(n);l?(c(),o={lines:[l[1]],section:s()}):n.trim()?o?o.lines.push(n.trim()):o={lines:[n.trim()],section:s()}:c()}return c(),n}function vs(e,t){let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=0,i=!1,a=!1,o=null,s=n.nextNode();for(;s;){for(let e=0;e<s.data.length;e+=1){if(/\s/.test(s.data[e])){i&&!a&&(a=!0,o={node:s,offset:e});continue}if(a){if(r===t)return o;r+=1}if(a=!1,o=null,r===t)return{node:s,offset:e};r+=1,i=!0}s=n.nextNode()}return r===t?{node:e,offset:e.childNodes.length}:null}function ys(e,t,n){let r=fs(e),i=vs(r,t),a=n==null?{node:r,offset:r.childNodes.length}:vs(r,n);if(!i||!a)return document.createDocumentFragment();let o=document.createRange();o.setStart(i.node,i.offset),o.setEnd(a.node,a.offset);let s=o.cloneContents();for(let e of[...s.childNodes])e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()&&e.remove();let c=s.childNodes.length===1?s.firstChild:null;if(!(c instanceof HTMLParagraphElement))return s;let l=document.createDocumentFragment();return l.append(...c.childNodes),l}function bs(e,t){return _s(e,t).map(e=>{let t=document.createElement(`slicc-memrow`);return t.setAttribute(`heading`,e.title),e.summary&&t.setAttribute(`summary`,e.summary),t.setAttribute(`section`,e.section),e.tag&&t.setAttribute(`tag`,e.tag),t.setHeadingContent(ys(e.bodyHtml,0,e.titleEnd)),e.summary&&t.setBodyContent(ys(e.bodyHtml,e.summaryStart,null)),t})}[`# Project Northstar`,``,`Role: Kestrel (primary engineering agent)`,`Workspace: /workspaces/northstar`,`Snapshot: 2032-04-18T14:15:51.712Z`,``,`## Operating agreements`,"- **Keep Northstar changes reviewable:** issue #501 requires one concern per branch in `packages/northstar-shell/src/` with fixtures under `/workspaces/northstar/testdata/`; run `keel verify --scope shell` before asking Mina Kestrel for `review_ready` status. The branch note in `packages/northstar-shell/reviews/` explains the user-visible outcome, the measured baseline, and the exact rollback point so another engineer can judge the change without reconstructing the session.","- **Prefer evidence before edits:** issue #502 starts with traces from `packages/telemetry/src/` and a reproduction in `/workspaces/northstar/repros/`; record the failing `trace_id` and the smallest useful `fixture_seed` before changing code. The supporting report in `packages/telemetry/reports/` separates observed behavior from a proposed cause and includes the command, expected result, actual result, and environment assumptions.","- **Use the native release path:** issue #503 sends text-only patches through `packages/release-tools/src/` and stores large binary fixtures in `/workspaces/northstar/artifacts/`; invoke `keel publish --dry-run` and confirm `release_manifest_v3` before upload. The release record in `packages/release-tools/records/` names every artifact, its content digest, the verification run that produced it, and the person who approved promotion.","- **Never merge on assumption:** issue #504 leaves the candidate in `packages/change-gate/src/` until `/workspaces/northstar/reviews/` contains an explicit approval; use `keel review status` and preserve the requested `merge_strategy`. The decision log in `packages/change-gate/decisions/` states whether history must remain linear and whether a reviewer requested a merge commit for audit context.",``,`## Repository and release workflow`,"- **Branch from the verified base:** issue #505 creates work in `packages/release-tools/branches/` and writes the base proof to `/workspaces/northstar/checkpoints/`; `keel branch create` must report the expected `base_oid`. The branch receipt in `packages/release-tools/receipts/` also captures the remote name and fetch time, which makes stale-base failures obvious during review.","- **Rebase only when linear history is required:** issue #506 keeps merge-preserving work in `packages/change-gate/policies/` and conflict notes in `/workspaces/northstar/reviews/`; choose `merge_commit` or `linear_rebase` from the recorded policy, never from habit. Guidance under packages/change-gate/guides/rebase/ requires a fresh verification run after conflict resolution because a clean textual rebase does not prove unchanged behavior.","- **Treat remote deletion as a gated operation:** issue #507 resolves the exact ref through `packages/release-tools/refs/` and snapshots it in `/workspaces/northstar/checkpoints/`; call `keel ref delete --confirm` only after `ref_guard` matches. The recovery note under packages/release-tools/guides/restore/ retains the deleted object identifier and a tested restore command until the review window closes.",``,`## Aurora renderer bootstrap — desktop preview (Session April 02)`,"- **Create the preview shell:** issue #508 keeps the host in `packages/aurora-preview/src/` and its deterministic scene data in `/workspaces/northstar/fixtures/aurora/`; start `keel preview aurora` with `scene_seed_2048`. A walkthrough under packages/aurora-preview/guides/startup/ lists the expected loading, ready, degraded, and failed states so reviewers know whether the shell or renderer owns a defect.","- **Load the renderer through its public package:** issue #509 imports `@northstar/aurora` from `/workspaces/northstar/apps/desktop/` and pins `aurora_protocol_v6`; the preview must not reach the private `renderer_singleton`. Contract notes under packages/aurora-preview/guides/contracts/ describe the mount lifecycle and require the host to release observers, workers, and object URLs during teardown.","- **Keep browser and desktop entry points equivalent:** issue #510 compares `packages/aurora-preview/browser/` with `/workspaces/northstar/apps/desktop/`; both expose `mountAuroraPreview` and accept `preview_transport`. Parity evidence under packages/aurora-preview/reviews/parity/ records the same scene, viewport, theme, keyboard path, and frame checksum for each host.","- **Pass viewer identity without personal data:** issue #511 reads `packages/aurora-preview/config/` and `/workspaces/northstar/fixtures/viewers/`; use `viewer_alpha` plus `tenant_sandbox`, never an account copied from production. The fixture catalog under packages/aurora-preview/fixtures/viewers/ explains each synthetic role and deliberately omits names, credentials, message history, and customer content.","- **Document the development-only compositor:** the guide in `packages/aurora-preview/docs/` points to `/workspaces/northstar/examples/compositor/`; `keel preview --inspect` exposes `frame_budget_ms` for local diagnosis. The inspector reports dropped frames, long tasks, active workers, and selected fallback mode without changing the scheduling decisions being measured.","- **Bundle Aurora without runtime network fetches:** build `packages/aurora-preview/bundle/` into `/workspaces/northstar/artifacts/aurora/` with `rook bundle --target desktop`; the output registers `aurora_bundle_hash` and embeds shader tables, icon atlases, locale data, fallback fonts, protocol schemas, worker bootstrap code, source labels, feature defaults, accessibility metadata, safe demo accounts, and the exact scene seed used by review. The host imports one local module, validates the manifest before evaluation, rejects unknown capabilities, records a structured startup trace, and keeps every optional adapter behind a capability check. When the packager rewrites an external import, inspect the emitted dependency map rather than adding a global shim. The accepted bundle must boot with the network disabled, survive a renderer restart, restore the selected scene, preserve focus order, report missing GPU features as a visible diagnostic, and produce the same frame checksum in Chromium and the desktop shell. Store the checksum beside the manifest, not in application code, so a fixture update is reviewable without touching runtime behavior.","- **Aurora offline recovery drill for the desktop preview** uses `packages/aurora-preview/fallback/` and `/workspaces/northstar/apps/desktop/assets/` with `aurora_fallback_entry` after `gpu_probe_result` records unsupported adapter evidence then the host verifies the local manifest restores the selected scene preserves keyboard focus retains the review viewport loads bundled fonts rejects network requests emits a visible diagnostic stores the frame checksum beside the artifact compares browser and desktop output keeps the original trace identifier and leaves the normal renderer untouched for the next controlled restart",``,`## Signal audio service — capture and transcription pipeline`,"- **Keep voice fixtures synthetic:** write generated samples to `packages/signal-audio/fixtures/` and metadata to `/workspaces/northstar/testdata/audio/`; select `signal_voice_cedar` with `sample_rate_24000`. The catalog under packages/signal-audio/guides/fixtures/ states how each sample was generated and which timing, silence, overlap, and clipping cases it is meant to exercise.","- **Resolve credentials through the fixture broker:** configure `packages/signal-audio/auth/` from `/workspaces/northstar/config/local/`; `keel secret lease signal` returns `signal_lease_ref` without exposing token material. The runbook under packages/signal-audio/guides/auth/ distinguishes a missing lease, an expired lease, provider denial, and an unavailable broker so recovery remains specific.","- **Use the streaming endpoint for long utterances:** send chunks from `packages/signal-audio/stream/` through `/workspaces/northstar/repros/audio/`; the client tracks `utterance_seq` and rejects a stale `transcript_epoch`. Evidence under packages/signal-audio/reviews/streaming/ includes chunk timing and final ordering, making dropped, duplicated, and late frames visible without retaining spoken content.","- **Preserve binary audio until decoding succeeds:** `packages/signal-audio/codecs/` writes to `/workspaces/northstar/artifacts/audio/`; `signal_decode_pcm` returns `decoded_frame_count` before text normalization. Notes under packages/signal-audio/guides/codecs/ require the original byte length, channel count, sample rate, and decoder warning before any waveform is discarded.",``,`## Harbor control-plane CLI (Session April 05, #401)`,"- **Define Harbor as a thin API client:** keep commands in `packages/harbor-cli/src/` and contract fixtures in `/workspaces/northstar/testdata/harbor/`; `harbor project list` emits `harbor_result_v2`. This boundary keeps command behavior easy to inspect, lets the service remain the source of truth, and gives every failure one clear place for diagnosis.","- **Store only a broker reference:** `packages/harbor-cli/auth/` reads `/workspaces/northstar/config/local/`; `harbor auth login` persists `credential_handle`, never a bearer value. A later command can ask the broker for a short lease while the terminal, history, trace, and saved configuration remain free of secret material.","- **Normalize boolean flags at the boundary:** `packages/harbor-cli/args/` tests `/workspaces/northstar/repros/harbor/`; `--include-paused=false` becomes `include_paused` rather than a truthy string. The same rule covers an omitted flag, an explicit true value, and a false value so script behavior does not depend on parser accident.","- **Do not edit remote files with shell redirection:** fetch through `packages/harbor-cli/files/` into `/workspaces/northstar/checkpoints/`; `harbor file replace` validates `remote_etag` before committing. The client first writes a complete local draft, shows a compact difference, and sends the whole document only after the expected revision still matches.","- **Read structured responses before printing:** `packages/harbor-cli/output/` stores schemas under `/workspaces/northstar/testdata/schemas/`; `harbor --format json` preserves `error_code` and nested causes. Human output may become shorter, but machine output must retain every field needed for retry, support, audit, and a later automated decision.","- **Refresh expired leases once:** `packages/harbor-cli/retry/` records attempts in `/workspaces/northstar/traces/`; `harbor_lease_expired` may trigger one `credential_refresh`, not a loop. A second denial is returned with the first request identity and lease age so the operator sees a stable failure rather than repeated login work.","- **Map provider failures to actionable hints:** `packages/harbor-cli/errors/` uses `/workspaces/northstar/docs/runbooks/`; `deployment_policy_denied` points to `harbor deployment inspect`. Each hint names the blocked resource, the required capability, and a safe read-only command that can confirm policy state before any new request.",``,`## Atlas runtime and plugin packaging (Session April 07, #418)`,"- **Build Atlas from a readable entry module:** `packages/atlas-runtime/src/` produces `/workspaces/northstar/artifacts/atlas/`; `rook build atlas` keeps `atlas_entrypoint` stable. The entry names each adapter and capability in one visible table, which makes bundle review possible without following generated glue across many small files.","- **Install plugins into an isolated sandbox:** `packages/atlas-runtime/plugins/` expands under `/workspaces/northstar/sandboxes/atlas/`; `atlas plugin inspect` verifies `plugin_manifest_v4`. Extraction rejects parent traversal, absolute names, duplicate entries, and unsupported links before any plugin code can observe the host or write outside its assigned directory.","- **Share filesystem adapters across hosts:** `packages/atlas-runtime/adapters/` is tested against `/workspaces/northstar/testdata/files/`; `atlas_read_bytes` and `atlas_write_atomic` retain binary data. Browser and desktop implementations must agree on path normalization, missing file behavior, atomic replacement, permission denial, and the byte count returned after a write.","- **Externalize host-owned modules:** `packages/atlas-runtime/build/` writes `/workspaces/northstar/artifacts/maps/`; `rook bundle --external host` marks `host_module_table` in the manifest. The loader resolves only names declared by that table and reports an absent host module before plugin startup rather than after partial state has changed.","- **Preserve integer field types during schema conversion:** `packages/atlas-runtime/schema/` compares `/workspaces/northstar/testdata/events/`; `packet_sequence` stays numeric in `atlas_event_v3`. The conversion test also covers zero, the largest safe value, a missing optional field, and an invalid string so type loss cannot hide in ordinary data.","- **Treat unknown extensions as data:** `packages/atlas-runtime/loader/` copies `/workspaces/northstar/fixtures/plugins/`; `atlas_load_module` uses `declared_media_type` instead of filename guessing. This permits a host to choose the correct evaluator while an untrusted plugin cannot change execution mode by selecting a familiar suffix.","- **Verify large artifacts through content hashes:** `packages/atlas-runtime/cache/` indexes `/workspaces/northstar/artifacts/atlas/`; `atlas artifact verify` checks `sha256_digest` before activation. Size and digest are checked after download and again before load, with one clear error that names which step observed an unexpected value.","- **Detect build drift against one canonical artifact:** `packages/atlas-runtime/ci/` reads `/workspaces/northstar/checkpoints/builds/`; `keel drift atlas` compares `canonical_bundle_id` rather than tool banners. A green result means the committed artifact matches the verified build output, not merely that two tools printed a similar version name.",``,`## Relay deployment automation (Session April 09, #433)`,"- **Acquire deployment credentials per operation:** `packages/relay-deploy/auth/` resolves `/workspaces/northstar/config/relay/`; `relay credential lease` returns `relay_lease_id`. The lease is bound to one provider and action, expires quickly, and can be revoked without changing local configuration or any unrelated deployment session.","- **Use immutable release descriptors:** `packages/relay-deploy/manifests/` publishes `/workspaces/northstar/artifacts/releases/`; `relay deploy plan` pins `release_descriptor_sha`. Review therefore covers the exact image, configuration, migration, and rollback input that promotion will consume rather than a mutable branch or floating tag.","- **Model provider capabilities explicitly:** `packages/relay-deploy/providers/` tests `/workspaces/northstar/testdata/providers/`; `provider_capability_set` prevents unsupported preview creation. A plan can explain which feature is absent and offer a compatible path before it asks a remote service to begin work.","- **Write remote documents atomically:** `packages/relay-deploy/files/` stages `/workspaces/northstar/checkpoints/remote/`; `relay file put` requires `expected_revision`. This prevents a short replacement from leaving stale tail content and prevents a concurrent operator from losing a newer remote change.","- **Keep retry policy narrow:** `packages/relay-deploy/retry/` reads `/workspaces/northstar/docs/runbooks/`; `relay_retryable_error` excludes policy denials and invalid manifests. Delay includes a firm attempt limit and a stable request identity so a temporary transport fault cannot become duplicate provider work.","- **Promote the artifact already tested:** `packages/relay-deploy/promote/` selects `/workspaces/northstar/artifacts/releases/`; `relay promote` verifies `tested_artifact_sha`. The command refuses a rebuild during promotion because even an equivalent source revision can yield a different dependency graph or bundle digest.",``,`## Orbit browser collaboration (Session April 11, #447)`,"- **Represent each shared tab as an Orbit room:** `packages/orbit-collab/rooms/` persists `/workspaces/northstar/testdata/orbit/`; `orbit room create` returns `room_epoch` and `participant_slot`. Room identity stays stable across transport replacement, while a new epoch makes every participant reject late state from a connection that no longer owns the session.","- **Send cursor updates as replaceable state:** `packages/orbit-collab/presence/` replays `/workspaces/northstar/fixtures/presence/`; `orbit_presence_v5` coalesces superseded coordinates. Presence may be lost without harming the document because the next update replaces it, which keeps interaction smooth under delay without building an unbounded queue.","- **Keep durable messages separate from presence:** `packages/orbit-collab/messages/` writes `/workspaces/northstar/checkpoints/orbit/`; `orbit message append` assigns `message_sequence`. A message is acknowledged only after durable storage, and replay begins after the highest sequence already seen so reconnect cannot create a duplicate conversation entry.","- **Recover from a stale browser execution context:** `packages/orbit-collab/browser/` logs `/workspaces/northstar/traces/orbit/`; `orbit context renew` increments `context_generation`. The old context is detached before a new observer is added, preventing both generations from sending navigation and focus events for the same visible tab.","- **Capture collaboration evidence through the public surface:** `packages/orbit-collab/qa/` stores `/workspaces/northstar/artifacts/screens/`; `keel orbit snapshot` records `active_room_id`. Review uses the same controls available to a person, then records visible member state, selected room, pending draft, and transport health beside the image.","- **Preserve pending input during reconnect:** `packages/orbit-collab/drafts/` tests `/workspaces/northstar/repros/reconnect/`; `draft_revision` survives one `transport_rebind`. The draft remains local until send succeeds, and a successful acknowledgement clears only the revision that was actually delivered rather than newer text still being edited.",``,`## Incident review — reconnect storm (Session April 12)`,"- **Root cause was competing transport owners:** `packages/orbit-collab/transport/` and `/workspaces/northstar/repros/reconnect/` both advanced `room_epoch`; the fix elects one `transport_owner`. The incident began when a browser wake event and a network return event each created a connection before either could observe the other.","- **The retry loop hid the first useful error:** `packages/orbit-collab/retry/` now records `/workspaces/northstar/traces/incidents/`; `first_failure_code` is retained in `reconnect_report`. Later timeout noise remains available in the trace, but the summary leads with the event that first moved the room away from healthy state.","- **Recovery must preserve the draft and selected room:** `packages/orbit-collab/state/` replays `/workspaces/northstar/fixtures/recovery/`; `orbit_recover_state` restores `active_room_id`. The acceptance check covers unsent text, keyboard focus, scroll position, participant order, and exactly one successful delivery after transport recovery.",``,`## Mobile companion sync (Session April 14, #462)`,"- **Pair the companion with an ephemeral code:** `packages/mobile-sync/pairing/` verifies `/workspaces/northstar/testdata/pairing/`; `mobile_pair_code` expires with `pairing_epoch`. Approval shows the synthetic device name and requested capability before either side accepts, and cancellation invalidates the code immediately rather than waiting for normal expiry.","- `packages/mobile-sync/outbox/` mirrors `/workspaces/northstar/fixtures/offline/`; `mobile_outbox_flush` preserves ordering after a network transition. Each item carries a local sequence and stable identity, so a retry can continue after the last acknowledgement without losing or repeating an action.","- `packages/mobile-sync/media/` writes `/workspaces/northstar/artifacts/mobile/`; `mobile_media_chunk` carries a checksum before upload. The receiver verifies every chunk before assembly and reports the first damaged range, which permits a narrow retry instead of sending the complete recording again.","- `packages/mobile-sync/notifications/` reads `/workspaces/northstar/testdata/push/`; `notification_dedupe_key` prevents duplicate alerts after resume. Foreground delivery updates visible state without another banner, while background delivery presents one alert that opens the exact room named by the event.","- `packages/mobile-sync/state/` compares `/workspaces/northstar/checkpoints/mobile/`; `mobile_state_merge` rejects an older `device_epoch`. Merge keeps local draft content, accepts newer durable state, and records a conflict when both sides changed the same preference after their common revision.","- `packages/mobile-sync/diagnostics/` exports `/workspaces/northstar/traces/mobile/`; `mobile_diag_bundle` removes payload text but keeps timing. The bundle includes version, platform, connection change, queue depth, retry count, and state generation so support can reason about order without reading user content.","- `packages/mobile-sync/accessibility/` tests `/workspaces/northstar/fixtures/a11y/`; `focus_restore_target` survives a view rebuild. The check follows pairing, room choice, draft entry, send, background, and resume with a keyboard so focus order is verified through a complete task.","- `packages/mobile-sync/release/` stages `/workspaces/northstar/artifacts/mobile/`; `mobile_release_channel` defaults to the review track. Promotion requires the same signed archive that passed device smoke review, with no rebuild or configuration change between approval and publication.","- `packages/mobile-sync/qa/` records `/workspaces/northstar/reviews/mobile/`; `mobile_smoke_matrix` covers offline launch, resume, and re-pairing. Each case states the initial network and account state, the exact action, the visible result, and the durable state expected after another launch.",``,`## Release readiness (Session April 16)`,"- `packages/release-checks/lint/` scans `/workspaces/northstar/checkpoints/release/`; `keel verify lint` writes `lint_run_id` for the candidate. Review links that identity rather than a copied summary so any warning, formatter change, or excluded file remains visible in its original context.","- `packages/release-checks/types/` scans `/workspaces/northstar/checkpoints/release/`; `keel verify types` records `type_graph_hash`. A later source or dependency change invalidates that graph and requires another check before the candidate can share the earlier result.","- `packages/release-checks/tests/` reads `/workspaces/northstar/testdata/`; `keel verify tests` stores `test_matrix_id`. The matrix names every package, host, browser, and fixture group that ran, making an omitted surface as visible as a failed assertion.","- `packages/release-checks/coverage/` reads `/workspaces/northstar/artifacts/coverage/`; `keel verify coverage` compares `coverage_floor_set`.","- `packages/release-checks/build/` emits `/workspaces/northstar/artifacts/builds/`; `keel verify build` stamps `bundle_manifest_sha`.","- `packages/release-checks/smoke/` stores `/workspaces/northstar/reviews/smoke/`; `keel verify smoke` requires `reviewer_ack`.",``,`## Durable project reference`,``,`### People and product context`,"- Mina Kestrel leads Northstar product engineering; the synthetic team directory lives in `packages/project-context/people/` and uses `mina_kestrel` plus `product_lead`.","- Oren Vale owns the Aurora renderer; notes in `packages/project-context/people/` use `oren_vale` and `rendering_owner`.","- Jules Rowan owns Harbor and Relay; entries in `packages/project-context/people/` use `jules_rowan` and `control_plane_owner`.","- Nia Ember owns Signal audio; records in `packages/project-context/people/` use `nia_ember` and `audio_owner`.","- Kestrel is the primary engineering agent; `/workspaces/northstar/agents/` maps `agent_kestrel` to `northstar_generalist`.","- Northstar is a fictional collaborative desktop environment; `/workspaces/northstar/docs/` defines `northstar_product` and `desktop_collaboration`.","- Aurora renders local workspaces and review scenes; `/workspaces/northstar/docs/` defines `aurora_renderer` and `scene_protocol_v6`.","- Atlas hosts sandboxed extensions; `/workspaces/northstar/docs/` defines `atlas_runtime` and `plugin_manifest_v4`.","- Harbor manages control-plane resources; `/workspaces/northstar/docs/` defines `harbor_cli` and `harbor_result_v2`.","- Relay promotes verified artifacts; `/workspaces/northstar/docs/` defines `relay_deploy` and `release_descriptor_sha`.","- Orbit synchronizes shared browser state; `/workspaces/northstar/docs/` defines `orbit_collab` and `room_epoch`.","- Signal captures and transcribes synthetic audio; `/workspaces/northstar/docs/` defines `signal_audio` and `utterance_seq`.","- Keel is the repository and verification CLI; `/workspaces/northstar/docs/` defines `keel_cli` and `verification_run`.","- Rook is the deterministic package builder; `/workspaces/northstar/docs/` defines `rook_builder` and `bundle_manifest`.","- The demo tenant is always synthetic; `/workspaces/northstar/fixtures/` uses `tenant_sandbox` and `viewer_alpha`.","- Review accounts use the reserved invalid domain; `/workspaces/northstar/fixtures/` stores `mina@example.invalid` and `oren@example.invalid`.","- Dates and identifiers describe an invented future project; `/workspaces/northstar/docs/` labels `fixture_provenance` and `synthetic_only`.","- Product decisions favor understandable failure states; `/workspaces/northstar/docs/` records `visible_diagnostics` and `recoverable_actions`.",``,`### Engineering preferences`,"- Keep each review branch narrow; `/workspaces/northstar/reviews/` records `change_scope` and `review_owner`.","- Prefer native text patches for source changes; `/workspaces/northstar/checkpoints/` records `patch_digest` and `base_oid`.","- Wait on CI through the supported command; `/workspaces/northstar/checkpoints/` stores `verification_run` and `final_status`.","- Never commit credential material; `/workspaces/northstar/config/` contains `credential_handle` and `lease_expiry` only.","- Require explicit confirmation before production promotion; `/workspaces/northstar/reviews/` stores `promotion_approval` and `rollback_plan`.","- Reproduce failures before changing a workaround; `/workspaces/northstar/repros/` stores `fixture_seed` and `first_failure_code`.","- Diagnose invisible failures with traffic and state metrics; `/workspaces/northstar/traces/` tracks `request_count` and `state_generation`.","- Use exact units instead of ambiguous shorthand; `/workspaces/northstar/docs/` prefers `approximately` and `milliseconds`.","- Keep secrets inside the broker boundary; `/workspaces/northstar/config/` exposes `credential_handle` and `provider_scope`.","- Report regressions with measured before and after values; `/workspaces/northstar/reviews/` records `baseline_metric` and `candidate_metric`.",``,`### Repository and verification map`,"- The monorepo root is `/workspaces/northstar/`; `packages/northstar-shell` contains the desktop host and `keel verify shell` is its focused gate.","- Aurora lives in `/workspaces/northstar/packages/`; `@northstar/aurora` is the public package and `aurora_protocol_v6` is the renderer contract.","- Atlas lives in `/workspaces/northstar/packages/`; `@northstar/atlas-runtime` owns plugin loading and `plugin_manifest_v4` is its schema.","- Harbor and Relay live in `/workspaces/northstar/packages/`; `@northstar/harbor-cli` owns commands and `release_descriptor_sha` identifies promotion input.","- Orbit and Signal live in `/workspaces/northstar/packages/`; `@northstar/orbit-collab` owns shared state and `utterance_seq` orders audio text.","- All synthetic fixtures live in `/workspaces/northstar/testdata/`; `keel verify fixtures` checks privacy and `fixture_provenance` marks their source.",``,`### Infrastructure and operations`,"- The local control plane uses `/workspaces/northstar/config/`; `harbor_local_profile` selects the sandbox and `credential_handle` references broker state.","- Preview artifacts use `/workspaces/northstar/artifacts/`; `aurora_bundle_hash` identifies the renderer and `canonical_bundle_id` drives drift checks.","- Deployment manifests use `/workspaces/northstar/artifacts/`; `release_descriptor_sha` pins content and `tested_artifact_sha` gates promotion.","- Collaboration traces use `/workspaces/northstar/traces/`; `room_epoch` identifies a session and `context_generation` identifies browser renewal.","- Mobile diagnostics use `/workspaces/northstar/traces/`; `mobile_diag_bundle` strips content and `device_epoch` orders state.","- Incident runbooks use `/workspaces/northstar/docs/`; `first_failure_code` names the initiating fault and `rollback_plan` names recovery.","- Review evidence uses `/workspaces/northstar/reviews/`; `baseline_metric` and `candidate_metric` keep UI judgments quantitative.","- Production promotion remains disabled in this fixture; `/workspaces/northstar/config/` sets `production_enabled` false and `tenant_sandbox` as the only tenant."].join(`
3365
- `)+``;var xs=`
3363
+ `,ns=`slicc-memrow-style`,rs=96,is=12;function as(e,t){if(e.length<=rs)return{heading:e,summary:t};let n=e.slice(0,97).lastIndexOf(` `),r=n>=is?n:rs,i=e.slice(r).trim();return{heading:e.slice(0,r).trim(),summary:[i,t].filter(Boolean).join(` `)}}function os(e){if(e.getElementById(ns))return;let t=e.createElement(`style`);t.id=ns,t.textContent=ts,(e.head??e.documentElement).appendChild(t)}function ss(e){return e===`feedback`||e===`project`?e:`user`}I(`slicc-memrow`,class extends HTMLElement{static get observedAttributes(){return[`heading`,`summary`,`tag`,`fresh`,`expanded`]}#e=!1;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=0;#c=!1;#l=!1;#u=null;#d=null;#f=null;connectedCallback(){os(this.ownerDocument),this.#e||this.#p(),this.#m(),this.#y(),this.#h()}disconnectedCallback(){this.#b(),this.#o?.disconnect(),this.#o=null,this.#s&&cancelAnimationFrame(this.#s),this.#s=0}attributeChangedCallback(){this.#e&&this.#m()}get heading(){return this.getAttribute(`heading`)??``}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get summary(){return this.getAttribute(`summary`)??``}set summary(e){e==null?this.removeAttribute(`summary`):this.setAttribute(`summary`,e)}get tag(){return ss(this.getAttribute(`tag`))}set tag(e){this.setAttribute(`tag`,e)}get fresh(){return this.hasAttribute(`fresh`)}set fresh(e){this.toggleAttribute(`fresh`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}setHeadingContent(e){this.#c=!0,this.#n?this.#n.replaceChildren(e):this.#u=e}setBodyContent(e){this.#l=!0,this.#i?this.#i.replaceChildren(e):this.#d=e,this.#g()}#p(){this.#e=!0;let e=this.ownerDocument.createElement(`button`);e.className=`mt`,e.type=`button`;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.#u&&t.replaceChildren(this.#u),this.#d&&r.replaceChildren(this.#d),this.#u=null,this.#d=null,this.append(e,r),this.#t=e,this.#n=t,this.#r=n,this.#i=r}#m(){let e=this.#n,t=this.#r,n=this.#i;if(!e||!t||!n)return;let r=as(this.heading,this.summary);this.#c||(e.textContent=r.heading);let i=this.tag;if(t.className=``,t.hidden=!this.hasAttribute(`tag`),t.setAttribute(`type`,i),t.textContent=``,!this.#l){let e=n.firstChild,t=r.summary;e&&e.nodeType===Node.TEXT_NODE?e.textContent=t:t&&n.insertBefore(this.ownerDocument.createTextNode(t),e)}this.classList.toggle(`fresh`,this.fresh),this.#v(),this.#g()}#h(){let e=this.#i;!e||this.#o||(this.#o=new ResizeObserver(()=>this.#g()),this.#o.observe(e),this.#g())}#g(){!this.isConnected||this.expanded||(this.#s&&cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>{this.#s=0;let e=this.#i;!e||this.expanded||(e.scrollHeight>e.clientHeight+1?this.#_():this.#a?.remove(),this.#v())}))}#_(){if(!this.#a){let e=this.ownerDocument.createElement(`button`);e.className=`mexpand`,e.type=`button`,e.addEventListener(`click`,e=>{e.stopPropagation(),this.expanded=!this.expanded}),this.#a=e}this.#a.isConnected||this.append(this.#a)}#v(){let e=this.#a;if(!e?.isConnected)return;let t=this.expanded;e.textContent=t?`Show less`:`Show more`,e.setAttribute(`aria-expanded`,String(t))}#y(){this.#f||(this.#f=e=>this.#x(e),this.addEventListener(`click`,this.#f))}#b(){this.#f&&=(this.removeEventListener(`click`,this.#f),null)}#x(e){this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{heading:this.heading,summary:this.summary,tag:this.tag,sourceEvent:e}}))}});var cs=64,ls=12,us=/\b(feedback|reviews?|corrections?|learnings?|observations?|testing|verification)\b/i,ds=/\b(user|preferences?|identit(?:y|ies)|accounts?|personal|interface|working rhythm|keyboard|accessibility)\b/i,fs=/^Auto-extracted \(/;function ps(e){let t=document.createRange();return t.selectNodeContents(document.body),t.createContextualFragment(e)}function ms(e,t){return(ps(t(e)).textContent??``).replace(/\s+/g,` `).trim()}function hs(e,t){let n=ms(e,t);if(n.length<=cs)return{title:n,summary:``,titleEnd:n.length,summaryStart:n.length};let r=[];for(let e of n.matchAll(/[.!?](?:[*_`'")\]]*)\s+|\s+[—–]\s+|[:;](?:[*_`]*)\s+|,\s+(?=(?:and|but|because|while|when|then|so)\b)/g)){let t=/^\s+[—–]|^[:;]/.test(e[0]),i=e.index+(t?0:e[0].trimEnd().length),a=e.index+e[0].length;n.slice(0,i).trim().length>=ls&&i<=96&&n.slice(a).trim()&&r.push({titleEnd:i,summaryStart:a})}let i=r.sort((e,t)=>Math.abs(e.titleEnd-cs)-Math.abs(t.titleEnd-cs))[0];if(i)return{title:n.slice(0,i.titleEnd).trim(),summary:n.slice(i.summaryStart).trim(),titleEnd:i.titleEnd,summaryStart:i.summaryStart};let a=n.slice(0,97).lastIndexOf(` `),o=a>=ls?a:96,s=n.slice(o).trim();return{title:n.slice(0,o).trim(),summary:s,titleEnd:o,summaryStart:n.indexOf(s,o)}}function gs(e,t,n){let r=ms(e,n),i=fs.test(t),a=i?r:`${t} ${r}`;return us.test(a)?`feedback`:ds.test(a)?`user`:i?null:`project`}function _s(e,t,n){let r=hs(e,n);return{title:r.title,summary:r.summary,section:t,tag:gs(e,t,n),bodyHtml:n(e),titleEnd:r.titleEnd,summaryStart:r.summaryStart}}function vs(e,t){let n=[],r=`Memory`,i=``,a=``,o=null,s=()=>[i||r,a].filter(Boolean).join(` / `),c=()=>{if(!o)return;let e=o.lines.join(` `).trim();e&&n.push(_s(e,o.section,t)),o=null};for(let n of e.split(`
3364
+ `)){let e=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(n.trim());if(e){c();let n=ms(e[2],t);e[1].length===1?(r=n||r,i=``,a=``):e[1].length===2?(i=n,a=``):e[1].length===3&&(a=n);continue}let l=/^\s*[-*]\s+(.*)$/.exec(n);l?(c(),o={lines:[l[1]],section:s()}):n.trim()?o?o.lines.push(n.trim()):o={lines:[n.trim()],section:s()}:c()}return c(),n}function ys(e,t){let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=0,i=!1,a=!1,o=null,s=n.nextNode();for(;s;){for(let e=0;e<s.data.length;e+=1){if(/\s/.test(s.data[e])){i&&!a&&(a=!0,o={node:s,offset:e});continue}if(a){if(r===t)return o;r+=1}if(a=!1,o=null,r===t)return{node:s,offset:e};r+=1,i=!0}s=n.nextNode()}return r===t?{node:e,offset:e.childNodes.length}:null}function bs(e,t,n){let r=ps(e),i=ys(r,t),a=n==null?{node:r,offset:r.childNodes.length}:ys(r,n);if(!i||!a)return document.createDocumentFragment();let o=document.createRange();o.setStart(i.node,i.offset),o.setEnd(a.node,a.offset);let s=o.cloneContents();for(let e of[...s.childNodes])e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()&&e.remove();let c=s.childNodes.length===1?s.firstChild:null;if(!(c instanceof HTMLParagraphElement))return s;let l=document.createDocumentFragment();return l.append(...c.childNodes),l}function xs(e,t){return vs(e,t).map(e=>{let t=document.createElement(`slicc-memrow`);return t.setAttribute(`heading`,e.title),e.summary&&t.setAttribute(`summary`,e.summary),t.setAttribute(`section`,e.section),e.tag&&t.setAttribute(`tag`,e.tag),t.setHeadingContent(bs(e.bodyHtml,0,e.titleEnd)),e.summary&&t.setBodyContent(bs(e.bodyHtml,e.summaryStart,null)),t})}[`# Project Northstar`,``,`Role: Kestrel (primary engineering agent)`,`Workspace: /workspaces/northstar`,`Snapshot: 2032-04-18T14:15:51.712Z`,``,`## Operating agreements`,"- **Keep Northstar changes reviewable:** issue #501 requires one concern per branch in `packages/northstar-shell/src/` with fixtures under `/workspaces/northstar/testdata/`; run `keel verify --scope shell` before asking Mina Kestrel for `review_ready` status. The branch note in `packages/northstar-shell/reviews/` explains the user-visible outcome, the measured baseline, and the exact rollback point so another engineer can judge the change without reconstructing the session.","- **Prefer evidence before edits:** issue #502 starts with traces from `packages/telemetry/src/` and a reproduction in `/workspaces/northstar/repros/`; record the failing `trace_id` and the smallest useful `fixture_seed` before changing code. The supporting report in `packages/telemetry/reports/` separates observed behavior from a proposed cause and includes the command, expected result, actual result, and environment assumptions.","- **Use the native release path:** issue #503 sends text-only patches through `packages/release-tools/src/` and stores large binary fixtures in `/workspaces/northstar/artifacts/`; invoke `keel publish --dry-run` and confirm `release_manifest_v3` before upload. The release record in `packages/release-tools/records/` names every artifact, its content digest, the verification run that produced it, and the person who approved promotion.","- **Never merge on assumption:** issue #504 leaves the candidate in `packages/change-gate/src/` until `/workspaces/northstar/reviews/` contains an explicit approval; use `keel review status` and preserve the requested `merge_strategy`. The decision log in `packages/change-gate/decisions/` states whether history must remain linear and whether a reviewer requested a merge commit for audit context.",``,`## Repository and release workflow`,"- **Branch from the verified base:** issue #505 creates work in `packages/release-tools/branches/` and writes the base proof to `/workspaces/northstar/checkpoints/`; `keel branch create` must report the expected `base_oid`. The branch receipt in `packages/release-tools/receipts/` also captures the remote name and fetch time, which makes stale-base failures obvious during review.","- **Rebase only when linear history is required:** issue #506 keeps merge-preserving work in `packages/change-gate/policies/` and conflict notes in `/workspaces/northstar/reviews/`; choose `merge_commit` or `linear_rebase` from the recorded policy, never from habit. Guidance under packages/change-gate/guides/rebase/ requires a fresh verification run after conflict resolution because a clean textual rebase does not prove unchanged behavior.","- **Treat remote deletion as a gated operation:** issue #507 resolves the exact ref through `packages/release-tools/refs/` and snapshots it in `/workspaces/northstar/checkpoints/`; call `keel ref delete --confirm` only after `ref_guard` matches. The recovery note under packages/release-tools/guides/restore/ retains the deleted object identifier and a tested restore command until the review window closes.",``,`## Aurora renderer bootstrap — desktop preview (Session April 02)`,"- **Create the preview shell:** issue #508 keeps the host in `packages/aurora-preview/src/` and its deterministic scene data in `/workspaces/northstar/fixtures/aurora/`; start `keel preview aurora` with `scene_seed_2048`. A walkthrough under packages/aurora-preview/guides/startup/ lists the expected loading, ready, degraded, and failed states so reviewers know whether the shell or renderer owns a defect.","- **Load the renderer through its public package:** issue #509 imports `@northstar/aurora` from `/workspaces/northstar/apps/desktop/` and pins `aurora_protocol_v6`; the preview must not reach the private `renderer_singleton`. Contract notes under packages/aurora-preview/guides/contracts/ describe the mount lifecycle and require the host to release observers, workers, and object URLs during teardown.","- **Keep browser and desktop entry points equivalent:** issue #510 compares `packages/aurora-preview/browser/` with `/workspaces/northstar/apps/desktop/`; both expose `mountAuroraPreview` and accept `preview_transport`. Parity evidence under packages/aurora-preview/reviews/parity/ records the same scene, viewport, theme, keyboard path, and frame checksum for each host.","- **Pass viewer identity without personal data:** issue #511 reads `packages/aurora-preview/config/` and `/workspaces/northstar/fixtures/viewers/`; use `viewer_alpha` plus `tenant_sandbox`, never an account copied from production. The fixture catalog under packages/aurora-preview/fixtures/viewers/ explains each synthetic role and deliberately omits names, credentials, message history, and customer content.","- **Document the development-only compositor:** the guide in `packages/aurora-preview/docs/` points to `/workspaces/northstar/examples/compositor/`; `keel preview --inspect` exposes `frame_budget_ms` for local diagnosis. The inspector reports dropped frames, long tasks, active workers, and selected fallback mode without changing the scheduling decisions being measured.","- **Bundle Aurora without runtime network fetches:** build `packages/aurora-preview/bundle/` into `/workspaces/northstar/artifacts/aurora/` with `rook bundle --target desktop`; the output registers `aurora_bundle_hash` and embeds shader tables, icon atlases, locale data, fallback fonts, protocol schemas, worker bootstrap code, source labels, feature defaults, accessibility metadata, safe demo accounts, and the exact scene seed used by review. The host imports one local module, validates the manifest before evaluation, rejects unknown capabilities, records a structured startup trace, and keeps every optional adapter behind a capability check. When the packager rewrites an external import, inspect the emitted dependency map rather than adding a global shim. The accepted bundle must boot with the network disabled, survive a renderer restart, restore the selected scene, preserve focus order, report missing GPU features as a visible diagnostic, and produce the same frame checksum in Chromium and the desktop shell. Store the checksum beside the manifest, not in application code, so a fixture update is reviewable without touching runtime behavior.","- **Aurora offline recovery drill for the desktop preview** uses `packages/aurora-preview/fallback/` and `/workspaces/northstar/apps/desktop/assets/` with `aurora_fallback_entry` after `gpu_probe_result` records unsupported adapter evidence then the host verifies the local manifest restores the selected scene preserves keyboard focus retains the review viewport loads bundled fonts rejects network requests emits a visible diagnostic stores the frame checksum beside the artifact compares browser and desktop output keeps the original trace identifier and leaves the normal renderer untouched for the next controlled restart",``,`## Signal audio service — capture and transcription pipeline`,"- **Keep voice fixtures synthetic:** write generated samples to `packages/signal-audio/fixtures/` and metadata to `/workspaces/northstar/testdata/audio/`; select `signal_voice_cedar` with `sample_rate_24000`. The catalog under packages/signal-audio/guides/fixtures/ states how each sample was generated and which timing, silence, overlap, and clipping cases it is meant to exercise.","- **Resolve credentials through the fixture broker:** configure `packages/signal-audio/auth/` from `/workspaces/northstar/config/local/`; `keel secret lease signal` returns `signal_lease_ref` without exposing token material. The runbook under packages/signal-audio/guides/auth/ distinguishes a missing lease, an expired lease, provider denial, and an unavailable broker so recovery remains specific.","- **Use the streaming endpoint for long utterances:** send chunks from `packages/signal-audio/stream/` through `/workspaces/northstar/repros/audio/`; the client tracks `utterance_seq` and rejects a stale `transcript_epoch`. Evidence under packages/signal-audio/reviews/streaming/ includes chunk timing and final ordering, making dropped, duplicated, and late frames visible without retaining spoken content.","- **Preserve binary audio until decoding succeeds:** `packages/signal-audio/codecs/` writes to `/workspaces/northstar/artifacts/audio/`; `signal_decode_pcm` returns `decoded_frame_count` before text normalization. Notes under packages/signal-audio/guides/codecs/ require the original byte length, channel count, sample rate, and decoder warning before any waveform is discarded.",``,`## Harbor control-plane CLI (Session April 05, #401)`,"- **Define Harbor as a thin API client:** keep commands in `packages/harbor-cli/src/` and contract fixtures in `/workspaces/northstar/testdata/harbor/`; `harbor project list` emits `harbor_result_v2`. This boundary keeps command behavior easy to inspect, lets the service remain the source of truth, and gives every failure one clear place for diagnosis.","- **Store only a broker reference:** `packages/harbor-cli/auth/` reads `/workspaces/northstar/config/local/`; `harbor auth login` persists `credential_handle`, never a bearer value. A later command can ask the broker for a short lease while the terminal, history, trace, and saved configuration remain free of secret material.","- **Normalize boolean flags at the boundary:** `packages/harbor-cli/args/` tests `/workspaces/northstar/repros/harbor/`; `--include-paused=false` becomes `include_paused` rather than a truthy string. The same rule covers an omitted flag, an explicit true value, and a false value so script behavior does not depend on parser accident.","- **Do not edit remote files with shell redirection:** fetch through `packages/harbor-cli/files/` into `/workspaces/northstar/checkpoints/`; `harbor file replace` validates `remote_etag` before committing. The client first writes a complete local draft, shows a compact difference, and sends the whole document only after the expected revision still matches.","- **Read structured responses before printing:** `packages/harbor-cli/output/` stores schemas under `/workspaces/northstar/testdata/schemas/`; `harbor --format json` preserves `error_code` and nested causes. Human output may become shorter, but machine output must retain every field needed for retry, support, audit, and a later automated decision.","- **Refresh expired leases once:** `packages/harbor-cli/retry/` records attempts in `/workspaces/northstar/traces/`; `harbor_lease_expired` may trigger one `credential_refresh`, not a loop. A second denial is returned with the first request identity and lease age so the operator sees a stable failure rather than repeated login work.","- **Map provider failures to actionable hints:** `packages/harbor-cli/errors/` uses `/workspaces/northstar/docs/runbooks/`; `deployment_policy_denied` points to `harbor deployment inspect`. Each hint names the blocked resource, the required capability, and a safe read-only command that can confirm policy state before any new request.",``,`## Atlas runtime and plugin packaging (Session April 07, #418)`,"- **Build Atlas from a readable entry module:** `packages/atlas-runtime/src/` produces `/workspaces/northstar/artifacts/atlas/`; `rook build atlas` keeps `atlas_entrypoint` stable. The entry names each adapter and capability in one visible table, which makes bundle review possible without following generated glue across many small files.","- **Install plugins into an isolated sandbox:** `packages/atlas-runtime/plugins/` expands under `/workspaces/northstar/sandboxes/atlas/`; `atlas plugin inspect` verifies `plugin_manifest_v4`. Extraction rejects parent traversal, absolute names, duplicate entries, and unsupported links before any plugin code can observe the host or write outside its assigned directory.","- **Share filesystem adapters across hosts:** `packages/atlas-runtime/adapters/` is tested against `/workspaces/northstar/testdata/files/`; `atlas_read_bytes` and `atlas_write_atomic` retain binary data. Browser and desktop implementations must agree on path normalization, missing file behavior, atomic replacement, permission denial, and the byte count returned after a write.","- **Externalize host-owned modules:** `packages/atlas-runtime/build/` writes `/workspaces/northstar/artifacts/maps/`; `rook bundle --external host` marks `host_module_table` in the manifest. The loader resolves only names declared by that table and reports an absent host module before plugin startup rather than after partial state has changed.","- **Preserve integer field types during schema conversion:** `packages/atlas-runtime/schema/` compares `/workspaces/northstar/testdata/events/`; `packet_sequence` stays numeric in `atlas_event_v3`. The conversion test also covers zero, the largest safe value, a missing optional field, and an invalid string so type loss cannot hide in ordinary data.","- **Treat unknown extensions as data:** `packages/atlas-runtime/loader/` copies `/workspaces/northstar/fixtures/plugins/`; `atlas_load_module` uses `declared_media_type` instead of filename guessing. This permits a host to choose the correct evaluator while an untrusted plugin cannot change execution mode by selecting a familiar suffix.","- **Verify large artifacts through content hashes:** `packages/atlas-runtime/cache/` indexes `/workspaces/northstar/artifacts/atlas/`; `atlas artifact verify` checks `sha256_digest` before activation. Size and digest are checked after download and again before load, with one clear error that names which step observed an unexpected value.","- **Detect build drift against one canonical artifact:** `packages/atlas-runtime/ci/` reads `/workspaces/northstar/checkpoints/builds/`; `keel drift atlas` compares `canonical_bundle_id` rather than tool banners. A green result means the committed artifact matches the verified build output, not merely that two tools printed a similar version name.",``,`## Relay deployment automation (Session April 09, #433)`,"- **Acquire deployment credentials per operation:** `packages/relay-deploy/auth/` resolves `/workspaces/northstar/config/relay/`; `relay credential lease` returns `relay_lease_id`. The lease is bound to one provider and action, expires quickly, and can be revoked without changing local configuration or any unrelated deployment session.","- **Use immutable release descriptors:** `packages/relay-deploy/manifests/` publishes `/workspaces/northstar/artifacts/releases/`; `relay deploy plan` pins `release_descriptor_sha`. Review therefore covers the exact image, configuration, migration, and rollback input that promotion will consume rather than a mutable branch or floating tag.","- **Model provider capabilities explicitly:** `packages/relay-deploy/providers/` tests `/workspaces/northstar/testdata/providers/`; `provider_capability_set` prevents unsupported preview creation. A plan can explain which feature is absent and offer a compatible path before it asks a remote service to begin work.","- **Write remote documents atomically:** `packages/relay-deploy/files/` stages `/workspaces/northstar/checkpoints/remote/`; `relay file put` requires `expected_revision`. This prevents a short replacement from leaving stale tail content and prevents a concurrent operator from losing a newer remote change.","- **Keep retry policy narrow:** `packages/relay-deploy/retry/` reads `/workspaces/northstar/docs/runbooks/`; `relay_retryable_error` excludes policy denials and invalid manifests. Delay includes a firm attempt limit and a stable request identity so a temporary transport fault cannot become duplicate provider work.","- **Promote the artifact already tested:** `packages/relay-deploy/promote/` selects `/workspaces/northstar/artifacts/releases/`; `relay promote` verifies `tested_artifact_sha`. The command refuses a rebuild during promotion because even an equivalent source revision can yield a different dependency graph or bundle digest.",``,`## Orbit browser collaboration (Session April 11, #447)`,"- **Represent each shared tab as an Orbit room:** `packages/orbit-collab/rooms/` persists `/workspaces/northstar/testdata/orbit/`; `orbit room create` returns `room_epoch` and `participant_slot`. Room identity stays stable across transport replacement, while a new epoch makes every participant reject late state from a connection that no longer owns the session.","- **Send cursor updates as replaceable state:** `packages/orbit-collab/presence/` replays `/workspaces/northstar/fixtures/presence/`; `orbit_presence_v5` coalesces superseded coordinates. Presence may be lost without harming the document because the next update replaces it, which keeps interaction smooth under delay without building an unbounded queue.","- **Keep durable messages separate from presence:** `packages/orbit-collab/messages/` writes `/workspaces/northstar/checkpoints/orbit/`; `orbit message append` assigns `message_sequence`. A message is acknowledged only after durable storage, and replay begins after the highest sequence already seen so reconnect cannot create a duplicate conversation entry.","- **Recover from a stale browser execution context:** `packages/orbit-collab/browser/` logs `/workspaces/northstar/traces/orbit/`; `orbit context renew` increments `context_generation`. The old context is detached before a new observer is added, preventing both generations from sending navigation and focus events for the same visible tab.","- **Capture collaboration evidence through the public surface:** `packages/orbit-collab/qa/` stores `/workspaces/northstar/artifacts/screens/`; `keel orbit snapshot` records `active_room_id`. Review uses the same controls available to a person, then records visible member state, selected room, pending draft, and transport health beside the image.","- **Preserve pending input during reconnect:** `packages/orbit-collab/drafts/` tests `/workspaces/northstar/repros/reconnect/`; `draft_revision` survives one `transport_rebind`. The draft remains local until send succeeds, and a successful acknowledgement clears only the revision that was actually delivered rather than newer text still being edited.",``,`## Incident review — reconnect storm (Session April 12)`,"- **Root cause was competing transport owners:** `packages/orbit-collab/transport/` and `/workspaces/northstar/repros/reconnect/` both advanced `room_epoch`; the fix elects one `transport_owner`. The incident began when a browser wake event and a network return event each created a connection before either could observe the other.","- **The retry loop hid the first useful error:** `packages/orbit-collab/retry/` now records `/workspaces/northstar/traces/incidents/`; `first_failure_code` is retained in `reconnect_report`. Later timeout noise remains available in the trace, but the summary leads with the event that first moved the room away from healthy state.","- **Recovery must preserve the draft and selected room:** `packages/orbit-collab/state/` replays `/workspaces/northstar/fixtures/recovery/`; `orbit_recover_state` restores `active_room_id`. The acceptance check covers unsent text, keyboard focus, scroll position, participant order, and exactly one successful delivery after transport recovery.",``,`## Mobile companion sync (Session April 14, #462)`,"- **Pair the companion with an ephemeral code:** `packages/mobile-sync/pairing/` verifies `/workspaces/northstar/testdata/pairing/`; `mobile_pair_code` expires with `pairing_epoch`. Approval shows the synthetic device name and requested capability before either side accepts, and cancellation invalidates the code immediately rather than waiting for normal expiry.","- `packages/mobile-sync/outbox/` mirrors `/workspaces/northstar/fixtures/offline/`; `mobile_outbox_flush` preserves ordering after a network transition. Each item carries a local sequence and stable identity, so a retry can continue after the last acknowledgement without losing or repeating an action.","- `packages/mobile-sync/media/` writes `/workspaces/northstar/artifacts/mobile/`; `mobile_media_chunk` carries a checksum before upload. The receiver verifies every chunk before assembly and reports the first damaged range, which permits a narrow retry instead of sending the complete recording again.","- `packages/mobile-sync/notifications/` reads `/workspaces/northstar/testdata/push/`; `notification_dedupe_key` prevents duplicate alerts after resume. Foreground delivery updates visible state without another banner, while background delivery presents one alert that opens the exact room named by the event.","- `packages/mobile-sync/state/` compares `/workspaces/northstar/checkpoints/mobile/`; `mobile_state_merge` rejects an older `device_epoch`. Merge keeps local draft content, accepts newer durable state, and records a conflict when both sides changed the same preference after their common revision.","- `packages/mobile-sync/diagnostics/` exports `/workspaces/northstar/traces/mobile/`; `mobile_diag_bundle` removes payload text but keeps timing. The bundle includes version, platform, connection change, queue depth, retry count, and state generation so support can reason about order without reading user content.","- `packages/mobile-sync/accessibility/` tests `/workspaces/northstar/fixtures/a11y/`; `focus_restore_target` survives a view rebuild. The check follows pairing, room choice, draft entry, send, background, and resume with a keyboard so focus order is verified through a complete task.","- `packages/mobile-sync/release/` stages `/workspaces/northstar/artifacts/mobile/`; `mobile_release_channel` defaults to the review track. Promotion requires the same signed archive that passed device smoke review, with no rebuild or configuration change between approval and publication.","- `packages/mobile-sync/qa/` records `/workspaces/northstar/reviews/mobile/`; `mobile_smoke_matrix` covers offline launch, resume, and re-pairing. Each case states the initial network and account state, the exact action, the visible result, and the durable state expected after another launch.",``,`## Release readiness (Session April 16)`,"- `packages/release-checks/lint/` scans `/workspaces/northstar/checkpoints/release/`; `keel verify lint` writes `lint_run_id` for the candidate. Review links that identity rather than a copied summary so any warning, formatter change, or excluded file remains visible in its original context.","- `packages/release-checks/types/` scans `/workspaces/northstar/checkpoints/release/`; `keel verify types` records `type_graph_hash`. A later source or dependency change invalidates that graph and requires another check before the candidate can share the earlier result.","- `packages/release-checks/tests/` reads `/workspaces/northstar/testdata/`; `keel verify tests` stores `test_matrix_id`. The matrix names every package, host, browser, and fixture group that ran, making an omitted surface as visible as a failed assertion.","- `packages/release-checks/coverage/` reads `/workspaces/northstar/artifacts/coverage/`; `keel verify coverage` compares `coverage_floor_set`.","- `packages/release-checks/build/` emits `/workspaces/northstar/artifacts/builds/`; `keel verify build` stamps `bundle_manifest_sha`.","- `packages/release-checks/smoke/` stores `/workspaces/northstar/reviews/smoke/`; `keel verify smoke` requires `reviewer_ack`.",``,`## Durable project reference`,``,`### People and product context`,"- Mina Kestrel leads Northstar product engineering; the synthetic team directory lives in `packages/project-context/people/` and uses `mina_kestrel` plus `product_lead`.","- Oren Vale owns the Aurora renderer; notes in `packages/project-context/people/` use `oren_vale` and `rendering_owner`.","- Jules Rowan owns Harbor and Relay; entries in `packages/project-context/people/` use `jules_rowan` and `control_plane_owner`.","- Nia Ember owns Signal audio; records in `packages/project-context/people/` use `nia_ember` and `audio_owner`.","- Kestrel is the primary engineering agent; `/workspaces/northstar/agents/` maps `agent_kestrel` to `northstar_generalist`.","- Northstar is a fictional collaborative desktop environment; `/workspaces/northstar/docs/` defines `northstar_product` and `desktop_collaboration`.","- Aurora renders local workspaces and review scenes; `/workspaces/northstar/docs/` defines `aurora_renderer` and `scene_protocol_v6`.","- Atlas hosts sandboxed extensions; `/workspaces/northstar/docs/` defines `atlas_runtime` and `plugin_manifest_v4`.","- Harbor manages control-plane resources; `/workspaces/northstar/docs/` defines `harbor_cli` and `harbor_result_v2`.","- Relay promotes verified artifacts; `/workspaces/northstar/docs/` defines `relay_deploy` and `release_descriptor_sha`.","- Orbit synchronizes shared browser state; `/workspaces/northstar/docs/` defines `orbit_collab` and `room_epoch`.","- Signal captures and transcribes synthetic audio; `/workspaces/northstar/docs/` defines `signal_audio` and `utterance_seq`.","- Keel is the repository and verification CLI; `/workspaces/northstar/docs/` defines `keel_cli` and `verification_run`.","- Rook is the deterministic package builder; `/workspaces/northstar/docs/` defines `rook_builder` and `bundle_manifest`.","- The demo tenant is always synthetic; `/workspaces/northstar/fixtures/` uses `tenant_sandbox` and `viewer_alpha`.","- Review accounts use the reserved invalid domain; `/workspaces/northstar/fixtures/` stores `mina@example.invalid` and `oren@example.invalid`.","- Dates and identifiers describe an invented future project; `/workspaces/northstar/docs/` labels `fixture_provenance` and `synthetic_only`.","- Product decisions favor understandable failure states; `/workspaces/northstar/docs/` records `visible_diagnostics` and `recoverable_actions`.",``,`### Engineering preferences`,"- Keep each review branch narrow; `/workspaces/northstar/reviews/` records `change_scope` and `review_owner`.","- Prefer native text patches for source changes; `/workspaces/northstar/checkpoints/` records `patch_digest` and `base_oid`.","- Wait on CI through the supported command; `/workspaces/northstar/checkpoints/` stores `verification_run` and `final_status`.","- Never commit credential material; `/workspaces/northstar/config/` contains `credential_handle` and `lease_expiry` only.","- Require explicit confirmation before production promotion; `/workspaces/northstar/reviews/` stores `promotion_approval` and `rollback_plan`.","- Reproduce failures before changing a workaround; `/workspaces/northstar/repros/` stores `fixture_seed` and `first_failure_code`.","- Diagnose invisible failures with traffic and state metrics; `/workspaces/northstar/traces/` tracks `request_count` and `state_generation`.","- Use exact units instead of ambiguous shorthand; `/workspaces/northstar/docs/` prefers `approximately` and `milliseconds`.","- Keep secrets inside the broker boundary; `/workspaces/northstar/config/` exposes `credential_handle` and `provider_scope`.","- Report regressions with measured before and after values; `/workspaces/northstar/reviews/` records `baseline_metric` and `candidate_metric`.",``,`### Repository and verification map`,"- The monorepo root is `/workspaces/northstar/`; `packages/northstar-shell` contains the desktop host and `keel verify shell` is its focused gate.","- Aurora lives in `/workspaces/northstar/packages/`; `@northstar/aurora` is the public package and `aurora_protocol_v6` is the renderer contract.","- Atlas lives in `/workspaces/northstar/packages/`; `@northstar/atlas-runtime` owns plugin loading and `plugin_manifest_v4` is its schema.","- Harbor and Relay live in `/workspaces/northstar/packages/`; `@northstar/harbor-cli` owns commands and `release_descriptor_sha` identifies promotion input.","- Orbit and Signal live in `/workspaces/northstar/packages/`; `@northstar/orbit-collab` owns shared state and `utterance_seq` orders audio text.","- All synthetic fixtures live in `/workspaces/northstar/testdata/`; `keel verify fixtures` checks privacy and `fixture_provenance` marks their source.",``,`### Infrastructure and operations`,"- The local control plane uses `/workspaces/northstar/config/`; `harbor_local_profile` selects the sandbox and `credential_handle` references broker state.","- Preview artifacts use `/workspaces/northstar/artifacts/`; `aurora_bundle_hash` identifies the renderer and `canonical_bundle_id` drives drift checks.","- Deployment manifests use `/workspaces/northstar/artifacts/`; `release_descriptor_sha` pins content and `tested_artifact_sha` gates promotion.","- Collaboration traces use `/workspaces/northstar/traces/`; `room_epoch` identifies a session and `context_generation` identifies browser renewal.","- Mobile diagnostics use `/workspaces/northstar/traces/`; `mobile_diag_bundle` strips content and `device_epoch` orders state.","- Incident runbooks use `/workspaces/northstar/docs/`; `first_failure_code` names the initiating fault and `rollback_plan` names recovery.","- Review evidence uses `/workspaces/northstar/reviews/`; `baseline_metric` and `candidate_metric` keep UI judgments quantitative.","- Production promotion remains disabled in this fixture; `/workspaces/northstar/config/` sets `production_enabled` false and `tenant_sandbox` as the only tenant."].join(`
3365
+ `)+``;var Ss=`
3366
3366
  slicc-memory-panel{display:flex;flex-direction:column;min-height:0;overflow:hidden;background:var(--canvas);color:var(--ink);font-family:var(--ui)}
3367
3367
  slicc-memory-panel .mp-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--canvas) 94%,var(--violet))}
3368
3368
  slicc-memory-panel .mp-search{display:flex;align-items:center;min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--canvas);padding:0 10px}
@@ -3395,7 +3395,7 @@ slicc-memory-panel .mp-rows{padding:0;border-top:0}
3395
3395
  slicc-memory-panel slicc-memrow{border:0;border-radius:0;border-top:1px solid var(--line);margin:0;padding:7px 12px}
3396
3396
  slicc-memory-panel slicc-memrow .mt b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
3397
3397
  slicc-memory-panel slicc-memrow .ms{-webkit-line-clamp:1;margin-top:2px;font-size:11px}
3398
- `,Ss=`slicc-memory-panel-style`;function Cs(e){if(e.getElementById(Ss))return;let t=e.createElement(`style`);t.id=Ss,t.textContent=xs,(e.head??e.documentElement).append(t)}function ws(e){return e.getAttribute(`section`)?.trim()||`General`}function Ts(e){let t=new Map;for(let n of e){let e=ws(n),r=t.get(e)??[];r.push(n),t.set(e,r)}return t}var Es=2,Ds=[`user`,`feedback`,`project`];function Os(e){for(let t of Ds)if(e.filter(e=>e.getAttribute(`tag`)===t).length*2>e.length)return t;return null}function ks(e,t){let n=Os(t);n&&e.setAttribute(`data-suppress-${n}`,``)}function As(e){let t=/^Auto-extracted \((?:(\d{4})-(\d{2})-(\d{2}),\s*)?([^)]+)\)$/.exec(e);if(!t){let t=/\(([^)]*\bsessions?\b[^)]*)\)/i.exec(e);return t?{name:`${e.slice(0,t.index)} ${e.slice(t.index+t[0].length)}`.replace(/\s+[—–-]\s*$/,``).replace(/\s+/g,` `).trim()||`Session memory`,source:t[1]}:{name:e,source:``}}let[,n,r,i,a]=t;if(!n||!r||!i)return{name:`Auto-extracted`,source:a};let o=new Date(Date.UTC(Number(n),Number(r)-1,Number(i)));return{name:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}).format(o),source:a.replaceAll(`-`,` `)}}I(`slicc-memory-panel`,class extends HTMLElement{#e=[];#t=null;#n=null;#r=null;#i=null;#a=``;#o=`all`;#s=new Set;#c=!1;connectedCallback(){Cs(this.ownerDocument),this.#c||this.#u(),this.#h()}setRows(e){let t=new Set(Ts(this.#e).keys());this.#e=e.filter(e=>e.matches(`slicc-memrow`)),this.#l();let n=[...Ts(this.#e).keys()],r=new Set;for(let e of n)(!t.has(e)||this.#s.has(e))&&r.add(e);this.#s=r,this.#c&&this.#h()}#l(){let e=this.#i;if(e){for(let t of e.options){if(t.value===`all`)continue;let e=!this.#e.some(e=>e.getAttribute(`tag`)===t.value);t.hidden=e,t.disabled=e}e.value=this.#o}}#u(){this.#c=!0;let e=L(`input`,{type:`search`,placeholder:`Search memories…`,"aria-label":`Search memories`}),t=L(`select`,{class:`mp-filter`,"aria-label":`Filter memories by tag`},L(`option`,{value:`all`},`All tags`),L(`option`,{value:`user`},`User`),L(`option`,{value:`feedback`},`Feedback`),L(`option`,{value:`project`},`Project`)),n=L(`div`,{class:`mp-count`,role:`status`,"aria-live":`polite`}),r=L(`div`,{class:`mp-toolbar`},L(`label`,{class:`mp-search`},e),t,n),i=L(`div`,{class:`mp-body`});e.addEventListener(`input`,()=>{this.#a=e.value.trim().toLowerCase(),this.#h()}),t.addEventListener(`change`,()=>{this.#o=t.value,this.#h()}),this.replaceChildren(r,i),this.#t=i,this.#n=n,this.#r=e,this.#i=t,this.#l()}#d(){return this.#e.filter(e=>this.#o!==`all`&&e.getAttribute(`tag`)!==this.#o?!1:!this.#a||[e.getAttribute(`heading`),e.getAttribute(`summary`),e.getAttribute(`section`),e.getAttribute(`tag`),e.textContent].filter(Boolean).join(` `).toLowerCase().includes(this.#a))}#f(e){return L(`div`,{class:`mp-empty`},L(`strong`,null,e?`No matching memories`:`No memories yet`),L(`span`,null,e?`Try a different search or tag.`:`Memories extracted from conversations will appear here.`))}#p(e,t){let n=As(e),r=L(`details`,{class:`mp-group`},L(`summary`,{class:`mp-section`},L(`span`,{class:`mp-section-name`},n.name),...n.source?[L(`span`,{class:`mp-section-source`},n.source)]:[],L(`span`,{class:`mp-section-count`},`${t.length}`)),L(`div`,{class:`mp-rows`},...t));return r.open=this.#a?!0:this.#s.has(e),r.addEventListener(`toggle`,()=>{r.open?this.#s.add(e):this.#s.delete(e)}),ks(r,t),r}#m(e){let t=L(`div`,{class:`mp-flat`},...e);return ks(t,e),t}#h(){let e=this.#t;if(!e)return;let t=this.#d();if(this.#r&&(this.#r.placeholder=`Search ${this.#e.length} memories…`),this.#n&&(this.#n.textContent=`${t.length} of ${this.#e.length} memories`),this.#e.length===0){e.replaceChildren(this.#f(!1));return}if(t.length===0){e.replaceChildren(this.#f(!0));return}let n=Ts(t);if(n.size<Es){e.replaceChildren(this.#m(t));return}e.replaceChildren(...[...n].map(([e,t])=>this.#p(e,t)))}});var js=`
3398
+ `,Cs=`slicc-memory-panel-style`;function ws(e){if(e.getElementById(Cs))return;let t=e.createElement(`style`);t.id=Cs,t.textContent=Ss,(e.head??e.documentElement).append(t)}function Ts(e){return e.getAttribute(`section`)?.trim()||`General`}function Es(e){let t=new Map;for(let n of e){let e=Ts(n),r=t.get(e)??[];r.push(n),t.set(e,r)}return t}var Ds=2,Os=[`user`,`feedback`,`project`];function ks(e){for(let t of Os)if(e.filter(e=>e.getAttribute(`tag`)===t).length*2>e.length)return t;return null}function As(e,t){let n=ks(t);n&&e.setAttribute(`data-suppress-${n}`,``)}function js(e){let t=/^Auto-extracted \((?:(\d{4})-(\d{2})-(\d{2}),\s*)?([^)]+)\)$/.exec(e);if(!t){let t=/\(([^)]*\bsessions?\b[^)]*)\)/i.exec(e);return t?{name:`${e.slice(0,t.index)} ${e.slice(t.index+t[0].length)}`.replace(/\s+[—–-]\s*$/,``).replace(/\s+/g,` `).trim()||`Session memory`,source:t[1]}:{name:e,source:``}}let[,n,r,i,a]=t;if(!n||!r||!i)return{name:`Auto-extracted`,source:a};let o=new Date(Date.UTC(Number(n),Number(r)-1,Number(i)));return{name:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}).format(o),source:a.replaceAll(`-`,` `)}}I(`slicc-memory-panel`,class extends HTMLElement{#e=[];#t=null;#n=null;#r=null;#i=null;#a=``;#o=`all`;#s=new Set;#c=!1;connectedCallback(){ws(this.ownerDocument),this.#c||this.#u(),this.#h()}setRows(e){let t=new Set(Es(this.#e).keys());this.#e=e.filter(e=>e.matches(`slicc-memrow`)),this.#l();let n=[...Es(this.#e).keys()],r=new Set;for(let e of n)(!t.has(e)||this.#s.has(e))&&r.add(e);this.#s=r,this.#c&&this.#h()}#l(){let e=this.#i;if(e){for(let t of e.options){if(t.value===`all`)continue;let e=!this.#e.some(e=>e.getAttribute(`tag`)===t.value);t.hidden=e,t.disabled=e}e.value=this.#o}}#u(){this.#c=!0;let e=L(`input`,{type:`search`,placeholder:`Search memories…`,"aria-label":`Search memories`}),t=L(`select`,{class:`mp-filter`,"aria-label":`Filter memories by tag`},L(`option`,{value:`all`},`All tags`),L(`option`,{value:`user`},`User`),L(`option`,{value:`feedback`},`Feedback`),L(`option`,{value:`project`},`Project`)),n=L(`div`,{class:`mp-count`,role:`status`,"aria-live":`polite`}),r=L(`div`,{class:`mp-toolbar`},L(`label`,{class:`mp-search`},e),t,n),i=L(`div`,{class:`mp-body`});e.addEventListener(`input`,()=>{this.#a=e.value.trim().toLowerCase(),this.#h()}),t.addEventListener(`change`,()=>{this.#o=t.value,this.#h()}),this.replaceChildren(r,i),this.#t=i,this.#n=n,this.#r=e,this.#i=t,this.#l()}#d(){return this.#e.filter(e=>this.#o!==`all`&&e.getAttribute(`tag`)!==this.#o?!1:!this.#a||[e.getAttribute(`heading`),e.getAttribute(`summary`),e.getAttribute(`section`),e.getAttribute(`tag`),e.textContent].filter(Boolean).join(` `).toLowerCase().includes(this.#a))}#f(e){return L(`div`,{class:`mp-empty`},L(`strong`,null,e?`No matching memories`:`No memories yet`),L(`span`,null,e?`Try a different search or tag.`:`Memories extracted from conversations will appear here.`))}#p(e,t){let n=js(e),r=L(`details`,{class:`mp-group`},L(`summary`,{class:`mp-section`},L(`span`,{class:`mp-section-name`},n.name),...n.source?[L(`span`,{class:`mp-section-source`},n.source)]:[],L(`span`,{class:`mp-section-count`},`${t.length}`)),L(`div`,{class:`mp-rows`},...t));return r.open=this.#a?!0:this.#s.has(e),r.addEventListener(`toggle`,()=>{r.open?this.#s.add(e):this.#s.delete(e)}),As(r,t),r}#m(e){let t=L(`div`,{class:`mp-flat`},...e);return As(t,e),t}#h(){let e=this.#t;if(!e)return;let t=this.#d();if(this.#r&&(this.#r.placeholder=`Search ${this.#e.length} memories…`),this.#n&&(this.#n.textContent=`${t.length} of ${this.#e.length} memories`),this.#e.length===0){e.replaceChildren(this.#f(!1));return}if(t.length===0){e.replaceChildren(this.#f(!0));return}let n=Es(t);if(n.size<Ds){e.replaceChildren(this.#m(t));return}e.replaceChildren(...[...n].map(([e,t])=>this.#p(e,t)))}});var Ms=`
3399
3399
  slicc-palette-grid {
3400
3400
  display: block;
3401
3401
  flex: 1;
@@ -3414,7 +3414,7 @@ slicc-palette-grid .palgrid {
3414
3414
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
3415
3415
  gap: 10px;
3416
3416
  }
3417
- `,Ms=`slicc-palette-grid-style`;function Ns(e){if(e.getElementById(Ms))return;let t=e.createElement(`style`);t.id=Ms,t.textContent=js,(e.head??e.documentElement).appendChild(t)}var Ps=[{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`}],Fs=`brand palette · tokens`;I(`slicc-palette-grid`,class extends HTMLElement{static get observedAttributes(){return[`heading`]}#e=!1;#t=null;#n=null;#r=[];#i=null;#a=null;connectedCallback(){Ns(this.ownerDocument),this.#e||this.#o(),this.#s(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#s()}get heading(){return this.getAttribute(`heading`)??Fs}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tokens(){return(this.#i??Ps).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 Is=R(`
3417
+ `,Ns=`slicc-palette-grid-style`;function Ps(e){if(e.getElementById(Ns))return;let t=e.createElement(`style`);t.id=Ns,t.textContent=Ms,(e.head??e.documentElement).appendChild(t)}var Fs=[{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`}],Is=`brand palette · tokens`;I(`slicc-palette-grid`,class extends HTMLElement{static get observedAttributes(){return[`heading`]}#e=!1;#t=null;#n=null;#r=[];#i=null;#a=null;connectedCallback(){Ps(this.ownerDocument),this.#e||this.#o(),this.#s(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#s()}get heading(){return this.getAttribute(`heading`)??Is}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tokens(){return(this.#i??Fs).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 Ls=R(`
3418
3418
  :host { display: inline-block; position: relative; font-family: var(--ui); }
3419
3419
  .trigger {
3420
3420
  display: inline-flex; align-items: center; justify-content: center;
@@ -3455,7 +3455,7 @@ slicc-palette-grid .palgrid {
3455
3455
  .item .ic { flex: 0 0 auto; display: flex; color: var(--txt-2, #505050); }
3456
3456
  .item.danger .ic { color: var(--rose, #f43f5e); }
3457
3457
  @media (prefers-reduced-motion: reduce) { .pop { transition: none; } }
3458
- `);I(`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=[Is],this.#t=L(`button`,{class:`trigger`,part:`trigger`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":`false`},L(`slot`)),this.#n=L(`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=L(`div`,{class:`user`},L(`div`,{class:`name`},this.#i.name));this.#i.provider&&t.append(L(`div`,{class:`prov`},this.#i.provider)),e.push(t)}for(let t of this.#r)if(t.kind===`separator`)e.push(L(`div`,{class:`sep`,role:`separator`}));else if(t.kind===`caption`)e.push(L(`div`,{class:`cap`},t.label??``));else{let n=L(`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(L(`span`,{class:`ic`},i(t.icon,{size:16}))),n.append(L(`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 Ls=`
3458
+ `);I(`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=[Ls],this.#t=L(`button`,{class:`trigger`,part:`trigger`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":`false`},L(`slot`)),this.#n=L(`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=L(`div`,{class:`user`},L(`div`,{class:`name`},this.#i.name));this.#i.provider&&t.append(L(`div`,{class:`prov`},this.#i.provider)),e.push(t)}for(let t of this.#r)if(t.kind===`separator`)e.push(L(`div`,{class:`sep`,role:`separator`}));else if(t.kind===`caption`)e.push(L(`div`,{class:`cap`},t.label??``));else{let n=L(`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(L(`span`,{class:`ic`},i(t.icon,{size:16}))),n.append(L(`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 Rs=`
3459
3459
  .slicc-nav {
3460
3460
  display: flex;
3461
3461
  align-items: center;
@@ -3485,7 +3485,7 @@ slicc-palette-grid .palgrid {
3485
3485
  width, not the viewport, so embedded and Storybook frames behave like the
3486
3486
  real sidebar. */
3487
3487
  .slicc-nav[data-narrow] { gap: 8px; padding: 0 10px; }
3488
- `,Rs=`slicc-nav-style`;function zs(e){if(e.getElementById(Rs))return;let t=e.createElement(`style`);t.id=Rs,t.textContent=Ls,(e.head??e.documentElement).appendChild(t)}I(`slicc-nav`,class extends HTMLElement{static observedAttributes=[`accent`];#e=!1;#t=null;connectedCallback(){zs(this.ownerDocument),this.classList.add(`slicc-nav`),this.setAttribute(`part`,`bar`),this.#n(),this.#r(this.getAttribute(`accent`)),typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#i()),this.#t.observe(this)),this.#i()}disconnectedCallback(){this.#t?.disconnect(),this.#t=null}attributeChangedCallback(e,t,n){e===`accent`&&t!==n&&this.isConnected&&(this.#r(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.#n(),this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)}#n(){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)}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--ctx`):this.style.setProperty(`--ctx`,e)}#i(){this.toggleAttribute(`data-narrow`,this.getBoundingClientRect().width<=560)}});var Bs=R(`
3488
+ `,zs=`slicc-nav-style`;function Bs(e){if(e.getElementById(zs))return;let t=e.createElement(`style`);t.id=zs,t.textContent=Rs,(e.head??e.documentElement).appendChild(t)}I(`slicc-nav`,class extends HTMLElement{static observedAttributes=[`accent`];#e=!1;#t=null;connectedCallback(){Bs(this.ownerDocument),this.classList.add(`slicc-nav`),this.setAttribute(`part`,`bar`),this.#n(),this.#r(this.getAttribute(`accent`)),typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#i()),this.#t.observe(this)),this.#i()}disconnectedCallback(){this.#t?.disconnect(),this.#t=null}attributeChangedCallback(e,t,n){e===`accent`&&t!==n&&this.isConnected&&(this.#r(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.#n(),this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)}#n(){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)}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--ctx`):this.style.setProperty(`--ctx`,e)}#i(){this.toggleAttribute(`data-narrow`,this.getBoundingClientRect().width<=560)}});var Vs=R(`
3489
3489
  :host {
3490
3490
  position: fixed;
3491
3491
  z-index: 110;
@@ -3523,7 +3523,7 @@ slicc-palette-grid .palgrid {
3523
3523
  .item.destructive {
3524
3524
  color: var(--red, #e53e3e);
3525
3525
  }
3526
- `),Vs=null,Hs=null,Us=null,Ws=class e extends HTMLElement{#e;#t=void 0;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Bs]}connectedCallback(){this.#e.addEventListener(`click`,this.#i)}disconnectedCallback(){this.#e.removeEventListener(`click`,this.#i)}#i=t=>{let n=t.target.closest(`[data-action]`);if(!n)return;let r=n.dataset.action;(this.#r??this.#n??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,n.#n=t.anchor,n.#r=t.dispatchTarget??null;let r=t.items.filter(e=>e.visible!==!1),a=L(`div`,{class:`menu`});for(let e of r){let t=e.destructive?`item destructive`:`item`,n=[];e.icon&&n.push(i(e.icon,{size:14})),n.push(e.label);let r=L(`button`,{class:t,"data-action":e.id},...n);a.appendChild(r)}n.#e.appendChild(a),document.body.appendChild(n),Vs=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`,Hs=t=>{t.key===`Escape`&&e.hide()},Us=r=>{let i=r.composedPath();!i.includes(n)&&!i.includes(t.anchor)&&e.hide()},document.addEventListener(`keydown`,Hs),document.addEventListener(`pointerdown`,Us,{capture:!0})}static hide(){Vs&&=(Vs.remove(),null),Hs&&=(document.removeEventListener(`keydown`,Hs),null),Us&&=(document.removeEventListener(`pointerdown`,Us,{capture:!0}),null)}};I(`slicc-overflow-menu`,Ws);var Gs=R(`
3526
+ `),Hs=null,Us=null,Ws=null,Gs=class e extends HTMLElement{#e;#t=void 0;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Vs]}connectedCallback(){this.#e.addEventListener(`click`,this.#i)}disconnectedCallback(){this.#e.removeEventListener(`click`,this.#i)}#i=t=>{let n=t.target.closest(`[data-action]`);if(!n)return;let r=n.dataset.action;(this.#r??this.#n??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,n.#n=t.anchor,n.#r=t.dispatchTarget??null;let r=t.items.filter(e=>e.visible!==!1),a=L(`div`,{class:`menu`});for(let e of r){let t=e.destructive?`item destructive`:`item`,n=[];e.icon&&n.push(i(e.icon,{size:14})),n.push(e.label);let r=L(`button`,{class:t,"data-action":e.id},...n);a.appendChild(r)}n.#e.appendChild(a),document.body.appendChild(n),Hs=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`,Us=t=>{t.key===`Escape`&&e.hide()},Ws=r=>{let i=r.composedPath();!i.includes(n)&&!i.includes(t.anchor)&&e.hide()},document.addEventListener(`keydown`,Us),document.addEventListener(`pointerdown`,Ws,{capture:!0})}static hide(){Hs&&=(Hs.remove(),null),Us&&=(document.removeEventListener(`keydown`,Us),null),Ws&&=(document.removeEventListener(`pointerdown`,Ws,{capture:!0}),null)}};I(`slicc-overflow-menu`,Gs);var Ks=R(`
3527
3527
  :host { display: none; }
3528
3528
  :host([open]) { display: block; }
3529
3529
  .overlay {
@@ -3570,7 +3570,7 @@ slicc-palette-grid .palgrid {
3570
3570
  @media (prefers-reduced-motion: reduce) {
3571
3571
  .overlay, .dialog { transition: none; }
3572
3572
  }
3573
- `);I(`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=[Gs],this.#r=L(`div`,{class:`title`,part:`title`,id:`slicc-dialog-title`}),this.#i=L(`div`,{class:`desc`,part:`description`}),this.#a=L(`button`,{class:`x`,part:`close`,type:`button`,"aria-label":`Close`},i(`x`,{size:18}));let e=L(`div`,{class:`body`},L(`slot`)),t=L(`div`,{class:`footer`},L(`slot`,{name:`footer`}));this.#n=L(`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=L(`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 Ks=`
3573
+ `);I(`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=[Ks],this.#r=L(`div`,{class:`title`,part:`title`,id:`slicc-dialog-title`}),this.#i=L(`div`,{class:`desc`,part:`description`}),this.#a=L(`button`,{class:`x`,part:`close`,type:`button`,"aria-label":`Close`},i(`x`,{size:18}));let e=L(`div`,{class:`body`},L(`slot`)),t=L(`div`,{class:`footer`},L(`slot`,{name:`footer`}));this.#n=L(`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=L(`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 qs=`
3574
3574
  slicc-camera-dialog slicc-dialog::part(dialog) {
3575
3575
  width: min(560px, 92vw);
3576
3576
  }
@@ -3637,7 +3637,7 @@ slicc-camera-dialog .slicc-camera__btn--snap {
3637
3637
  slicc-camera-dialog .slicc-camera__btn--snap:hover {
3638
3638
  background: color-mix(in srgb, var(--ink) 85%, var(--canvas));
3639
3639
  }
3640
- `,qs=`slicc-camera-dialog-style`;function Js(e){if(e.getElementById(qs))return;let t=e.createElement(`style`);t.id=qs,t.textContent=Ks,(e.head??e.documentElement).appendChild(t)}var Ys=`Take a photo`;I(`slicc-camera-dialog`,class extends HTMLElement{static observedAttributes=[`heading`,`preferred-device`];media=null;#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){Js(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`)??Ys}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)=>L(`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=L(`video`,{class:`slicc-camera__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#n=L(`select`,{class:`slicc-camera__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#d(this.#n.value)}),this.#r=L(`div`,{class:`slicc-camera__status`});let e=L(`button`,{type:`button`,class:`slicc-camera__btn`,part:`cancel`,slot:`footer`},`Cancel`);e.addEventListener(`click`,()=>this.#p(null));let t=L(`button`,{type:`button`,class:`slicc-camera__btn slicc-camera__btn--snap`,part:`snap`,slot:`footer`},i(`camera`,{size:14}),` Snap`);t.addEventListener(`click`,()=>this.#f());let n=L(`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 Xs={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)}},Zs=new Set([`microphone`,`camera`]);function Qs(e){return typeof navigator>`u`||!navigator.permissions?.query?Promise.resolve(`prompt`):navigator.permissions.query({name:e}).then(e=>e.state)}var $s=`
3640
+ `,Js=`slicc-camera-dialog-style`;function Ys(e){if(e.getElementById(Js))return;let t=e.createElement(`style`);t.id=Js,t.textContent=qs,(e.head??e.documentElement).appendChild(t)}var Xs=`Take a photo`;I(`slicc-camera-dialog`,class extends HTMLElement{static observedAttributes=[`heading`,`preferred-device`];media=null;#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){Ys(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`)??Xs}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)=>L(`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=L(`video`,{class:`slicc-camera__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#n=L(`select`,{class:`slicc-camera__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#d(this.#n.value)}),this.#r=L(`div`,{class:`slicc-camera__status`});let e=L(`button`,{type:`button`,class:`slicc-camera__btn`,part:`cancel`,slot:`footer`},`Cancel`);e.addEventListener(`click`,()=>this.#p(null));let t=L(`button`,{type:`button`,class:`slicc-camera__btn slicc-camera__btn--snap`,part:`snap`,slot:`footer`},i(`camera`,{size:14}),` Snap`);t.addEventListener(`click`,()=>this.#f());let n=L(`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 Zs={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)}},Qs=new Set([`microphone`,`camera`]);function $s(e){return typeof navigator>`u`||!navigator.permissions?.query?Promise.resolve(`prompt`):navigator.permissions.query({name:e}).then(e=>e.state)}var ec=`
3641
3641
  slicc-permissions {
3642
3642
  /* Invisible host by default — only the drop overlay paints, and only
3643
3643
  while a folder drag is in flight. Hosts can give the element a fixed
@@ -3808,7 +3808,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
3808
3808
  transform: translateX(-50%) translateY(0);
3809
3809
  }
3810
3810
  }
3811
- `,ec=`slicc-permissions-style`;function tc(e){if(e.getElementById(ec))return;let t=e.createElement(`style`);t.id=ec,t.textContent=$s,(e.head??e.documentElement).appendChild(t)}function nc(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 rc=class extends HTMLElement{providers={};permissionQuery=null;#e;#t=!1;#n=0;#r=null;connectedCallback(){tc(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=>Zs.has(e)))return Xs.debug(`prompt: showing dialog (a gesture-bound kind was requested)`,{kinds:e.kinds}),null;let t=this.permissionQuery??Qs,n;try{n=await Promise.all(e.kinds.map(e=>t(e)))}catch(e){return Xs.error(`prompt: permission query threw; showing dialog`,e),null}if(Xs.debug(`prompt: queried permission state`,{kinds:e.kinds,states:n}),!n.every(e=>e===`granted`))return Xs.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 Xs.error(`prompt: acquisition failed after granted state`,{kind:t}),{status:`error`,grants:r,reason:`error`};r.push(n)}return Xs.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=>{nc(e)&&(e.preventDefault(),this.#n++,this.setAttribute(`data-dropping`,``))};#y=e=>{nc(e)&&e.preventDefault()};#b=e=>{nc(e)&&(this.#n=Math.max(0,this.#n-1),this.#n===0&&this.removeAttribute(`data-dropping`))};#x=e=>{if(!nc(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=L(`div`,{class:`slicc-permissions__drop-inner`},i(`folder-up`,{size:32}),L(`div`,null,`Drop a folder to mount it (read-write)`));this.#e=L(`div`,{class:`slicc-permissions__drop`,part:`drop`,"aria-hidden":`true`},e),this.append(this.#e)}#w(e,t){let n=e.heading??oc(e.kinds),r=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=L(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`ghost`,part:`prompt-cancel`},a),l=L(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`primary`,part:`prompt-grant`},r),u=L(`div`,{class:`slicc-permissions__prompt-icons`,"aria-hidden":`true`},...e.kinds.map(e=>L(`span`,{class:`slicc-permissions__prompt-icon`},i(ic(e),{size:22})))),d=L(`div`,{class:`slicc-permissions__prompt`,part:`prompt`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o,"aria-describedby":s,tabindex:`-1`,popover:`manual`},u,L(`h2`,{class:`slicc-permissions__prompt-heading`,id:o},n),L(`p`,{class:`slicc-permissions__prompt-desc`,id:s},e.description),L(`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`,_),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})}},_=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`,_),this.#r={cancel:()=>g(`cancelled`)},requestAnimationFrame(()=>{d.setAttribute(`data-open`,``),l.focus()})}};function ic(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 ac(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 oc(e){if(e.length===1)return`Allow access to your ${ac(e[0])}?`;let t=e.map(ac),n=t.pop();return`Allow access to your ${t.join(`, `)} and ${n}?`}I(`slicc-permissions`,rc);var sc=`*`,cc=`Share a secret securely`,lc=`the model`;function uc(e){return`Secure secrets cannot be read by ${e}, and work only on the domains you specify.`}var dc=/^[A-Za-z_][A-Za-z0-9_]*$/,fc=/^[A-Za-z0-9_.-]+$/,pc=`
3811
+ `,tc=`slicc-permissions-style`;function nc(e){if(e.getElementById(tc))return;let t=e.createElement(`style`);t.id=tc,t.textContent=ec,(e.head??e.documentElement).appendChild(t)}function rc(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 ic=class extends HTMLElement{providers={};permissionQuery=null;#e;#t=!1;#n=0;#r=null;connectedCallback(){nc(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=>Qs.has(e)))return Zs.debug(`prompt: showing dialog (a gesture-bound kind was requested)`,{kinds:e.kinds}),null;let t=this.permissionQuery??$s,n;try{n=await Promise.all(e.kinds.map(e=>t(e)))}catch(e){return Zs.error(`prompt: permission query threw; showing dialog`,e),null}if(Zs.debug(`prompt: queried permission state`,{kinds:e.kinds,states:n}),!n.every(e=>e===`granted`))return Zs.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 Zs.error(`prompt: acquisition failed after granted state`,{kind:t}),{status:`error`,grants:r,reason:`error`};r.push(n)}return Zs.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=>{rc(e)&&(e.preventDefault(),this.#n++,this.setAttribute(`data-dropping`,``))};#y=e=>{rc(e)&&e.preventDefault()};#b=e=>{rc(e)&&(this.#n=Math.max(0,this.#n-1),this.#n===0&&this.removeAttribute(`data-dropping`))};#x=e=>{if(!rc(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=L(`div`,{class:`slicc-permissions__drop-inner`},i(`folder-up`,{size:32}),L(`div`,null,`Drop a folder to mount it (read-write)`));this.#e=L(`div`,{class:`slicc-permissions__drop`,part:`drop`,"aria-hidden":`true`},e),this.append(this.#e)}#w(e,t){let n=e.heading??sc(e.kinds),r=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=L(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`ghost`,part:`prompt-cancel`},a),l=L(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`primary`,part:`prompt-grant`},r),u=L(`div`,{class:`slicc-permissions__prompt-icons`,"aria-hidden":`true`},...e.kinds.map(e=>L(`span`,{class:`slicc-permissions__prompt-icon`},i(ac(e),{size:22})))),d=L(`div`,{class:`slicc-permissions__prompt`,part:`prompt`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o,"aria-describedby":s,tabindex:`-1`,popover:`manual`},u,L(`h2`,{class:`slicc-permissions__prompt-heading`,id:o},n),L(`p`,{class:`slicc-permissions__prompt-desc`,id:s},e.description),L(`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`,_),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})}},_=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`,_),this.#r={cancel:()=>g(`cancelled`)},requestAnimationFrame(()=>{d.setAttribute(`data-open`,``),l.focus()})}};function ac(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 oc(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 sc(e){if(e.length===1)return`Allow access to your ${oc(e[0])}?`;let t=e.map(oc),n=t.pop();return`Allow access to your ${t.join(`, `)} and ${n}?`}I(`slicc-permissions`,ic);var cc=`*`,lc=`Share a secret securely`,uc=`the model`;function dc(e){return`Secure secrets cannot be read by ${e}, and work only on the domains you specify.`}var fc=/^[A-Za-z_][A-Za-z0-9_]*$/,pc=/^[A-Za-z0-9_.-]+$/,mc=`
3812
3812
  slicc-secret-dialog slicc-dialog::part(dialog) {
3813
3813
  width: min(480px, 92vw);
3814
3814
  }
@@ -3981,7 +3981,7 @@ slicc-secret-dialog .slicc-secret__btn[disabled] {
3981
3981
  opacity: .55;
3982
3982
  cursor: default;
3983
3983
  }
3984
- `,mc=`slicc-secret-dialog-style`;function hc(e){if(e.getElementById(mc))return;let t=e.createElement(`style`);t.id=mc,t.textContent=pc,(e.head??e.documentElement).appendChild(t)}function gc(e){return e.split(/[,\s]+/).map(e=>e.trim()).filter(e=>e.length>0)}var _c=class extends HTMLElement{static observedAttributes=[`heading`,`secret-name`,`domain`,`provider`,`persist-default`];submitHandler=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f=!1;#p=!1;#m=null;connectedCallback(){this.#O()}attributeChangedCallback(e){this.#f&&(e===`heading`?this.#e.setAttribute(`heading`,this.heading):e===`secret-name`?this.#t.value=this.getAttribute(`secret-name`)??``:e===`domain`?this.#b(gc(this.getAttribute(`domain`)??``)):e===`provider`?this.#e.setAttribute(`description`,uc(this.provider)):e===`persist-default`&&(this.#a.checked=this.persistDefault))}get provider(){return this.getAttribute(`provider`)||lc}set provider(e){e==null?this.removeAttribute(`provider`):this.setAttribute(`provider`,e)}get heading(){return this.getAttribute(`heading`)??cc}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get persistDefault(){return this.hasAttribute(`persist-default`)}set persistDefault(e){this.toggleAttribute(`persist-default`,e)}open(e={}){return this.#O(),e.heading&&(this.heading=e.heading),e.provider&&(this.provider=e.provider),this.#e.setAttribute(`heading`,this.heading),this.#e.setAttribute(`description`,vc(e,this.provider)),this.#t.value=e.name??this.getAttribute(`secret-name`)??``,this.#b(e.domains??gc(this.getAttribute(`domain`)??``)),this.#a.checked=e.persist??this.persistDefault,this.#n.value=``,this.#g(!1),this.#l.textContent=``,this.#h(!1),this.#c.open=!0,this.#_(),this.#e.show?.(),requestAnimationFrame(()=>(this.#t.value?this.#n:this.#t).focus()),new Promise(e=>{this.#m=e})}setError(e){this.#O(),this.#l.textContent=e,this.#h(!1)}#h(e){this.#p=e,this.#o.disabled=e,this.#o.textContent=e?`Storing…`:`Store secret`,this.#s.disabled=e}#g(e){this.#n.type=e?`text`:`password`,this.#r.setAttribute(`aria-pressed`,String(e)),this.#r.setAttribute(`aria-label`,e?`Hide secret`:`Show secret`),this.#r.replaceChildren(i(e?`eye-off`:`eye`,{size:16}))}#_(){let e=this.#t.value.trim(),t=!e||dc.test(e);this.#u.textContent=t?``:`Not a shell name — no $${e} in the shell.`,this.#u.toggleAttribute(`hidden`,t);let n=this.#v().includes(sc);this.#d.textContent=n?`* allows any domain. Narrow it to the API host.`:``,this.#d.toggleAttribute(`hidden`,!n)}#v(){return this.#y().flatMap(e=>gc(e.value))}#y(){return Array.from(this.#i.querySelectorAll(`[part="domain"]`))}#b(e){let t=e.length>0?e:[``];this.#i.replaceChildren(...t.map(e=>this.#x(e))),this.#C()}#x(e){let t=L(`input`,{type:`text`,class:`slicc-secret__input`,part:`domain`,spellcheck:`false`,autocomplete:`off`,placeholder:`api.github.com`,"aria-label":`Allowed domain`});t.value=e,t.addEventListener(`input`,()=>this.#_());let n=L(`div`,{class:`slicc-secret__row`},t,this.#S(`minus`,`Remove this domain`,`domain-remove`,()=>{n.remove(),this.#C(),this.#_()}),this.#S(`plus`,`Add another domain`,`domain-add`,()=>{let e=this.#x(``);n.after(e),this.#C(),e.querySelector(`[part="domain"]`)?.focus()}));return n}#S(e,t,n,r){let a=L(`button`,{type:`button`,class:`slicc-secret__row-btn`,part:n,"aria-label":t,title:t},i(e,{size:14}));return a.addEventListener(`click`,r),a}#C(){let e=Array.from(this.#i.children);for(let t of e){let n=t.querySelector(`[part="domain-remove"]`);n&&(n.disabled=e.length===1)}}#w(){let e=this.#t.value.trim();if(!e)return`Give the secret a name.`;if(!fc.test(e))return`Use letters, digits, and . _ - in the name.`;let t=this.#n.value;if(!t)return`Paste the secret value.`;let n=this.#v();return n.length===0?`Every secret needs at least one allowed domain.`:{name:e,value:t,domains:n,persist:this.#a.checked}}async#T(){if(this.#p)return;let e=this.#w();if(typeof e==`string`){this.#l.textContent=e;return}if(this.#l.textContent=``,this.submitHandler){this.#h(!0);let t;try{t=await this.submitHandler(e)}catch(e){t=e instanceof Error?e.message:String(e)}if(t){this.setError(t);return}this.#h(!1)}let{name:t,domains:n,persist:r}=e;this.dispatchEvent(new CustomEvent(`slicc-secret-submit`,{detail:{name:t,domains:n,persist:r},bubbles:!0,composed:!0})),this.#E(e)}#E(e){if(this.#p&&!e)return;let t=this.#m;this.#m=null,this.#e.hide?.(),this.#n.value=``,this.#g(!1),this.#h(!1),e||this.dispatchEvent(new CustomEvent(`slicc-secret-cancel`,{bubbles:!0,composed:!0})),t?.(e)}#D(){this.#i=L(`div`,{class:`slicc-secret__rows`}),this.#b(gc(this.getAttribute(`domain`)??``)),this.#a=L(`input`,{type:`checkbox`,part:`persist`}),this.#a.checked=this.persistDefault,this.#c=L(`details`,{class:`slicc-secret__options`},L(`summary`,{class:`slicc-secret__summary`},i(`sliders-horizontal`,{size:14}),`Additional options`),L(`div`,{class:`slicc-secret__opts-body`},L(`div`,{class:`slicc-secret__field`},L(`label`,{class:`slicc-secret__label`},`Domains`),this.#i,L(`div`,{class:`slicc-secret__hint`},`Globs allowed: *.github.com`),this.#d),L(`label`,{class:`slicc-secret__check`},this.#a,L(`span`,{},`Keep after this session ends`,L(`div`,{class:`slicc-secret__hint`},`Off: this session only.`)))))}#O(){if(this.#f)return;this.#f=!0,hc(this.ownerDocument),this.#t=L(`input`,{type:`text`,class:`slicc-secret__input`,part:`name`,spellcheck:`false`,autocomplete:`off`,placeholder:`GITHUB_TOKEN`,"aria-label":`Secret name`}),this.#t.value=this.getAttribute(`secret-name`)??``,this.#t.addEventListener(`input`,()=>this.#_()),this.#n=L(`input`,{type:`password`,class:`slicc-secret__input slicc-secret__input--value`,part:`value`,spellcheck:`false`,autocomplete:`off`,placeholder:`Paste the value`,"aria-label":`Secret value`}),this.#n.addEventListener(`paste`,e=>{let t=e.clipboardData?.getData(`text`)??``;/[\r\n]/.test(t.trim())&&(this.#l.textContent=`That value spans multiple lines and was joined into one. Secrets must be single-line — base64-encode it first (base64 -w0 key.pem).`)}),this.#n.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),this.#T())}),this.#r=L(`button`,{type:`button`,class:`slicc-secret__reveal`,part:`reveal`}),this.#r.addEventListener(`click`,()=>this.#g(this.#n.type===`password`)),this.#u=L(`div`,{class:`slicc-secret__hint`,hidden:!0}),this.#d=L(`div`,{class:`slicc-secret__hint`,hidden:!0}),this.#D(),this.#l=L(`div`,{class:`slicc-secret__error`,role:`alert`,"aria-live":`polite`}),this.#s=L(`button`,{type:`button`,class:`slicc-secret__btn`,part:`cancel`,slot:`footer`},`Cancel`),this.#s.addEventListener(`click`,()=>this.#E(null)),this.#o=L(`button`,{type:`button`,class:`slicc-secret__btn slicc-secret__btn--save`,part:`save`,slot:`footer`},`Store secret`),this.#o.addEventListener(`click`,()=>void this.#T());let e=L(`div`,{class:`slicc-secret__body`},L(`div`,{class:`slicc-secret__field`},L(`label`,{class:`slicc-secret__label`},`Name`),this.#t,this.#u),L(`div`,{class:`slicc-secret__field`},L(`label`,{class:`slicc-secret__label`},`Value`),L(`div`,{class:`slicc-secret__value-wrap`},this.#n,this.#r),L(`div`,{class:`slicc-secret__hint`},`Single line. Stays in this tab.`)),this.#c,this.#l);this.#g(!1),this.#e=this.ownerDocument.createElement(`slicc-dialog`),this.#e.setAttribute(`heading`,this.heading),this.#e.setAttribute(`description`,uc(this.provider)),this.#e.setAttribute(`persistent`,``),this.#e.append(e,this.#s,this.#o),this.#e.addEventListener(`slicc-dialog-close`,()=>{this.#m&&this.#E(null)}),this.append(this.#e),this.#_()}};function vc(e,t){let n=uc(t);return e.reason?`${e.requester?`${e.requester}: `:``}${/[.!?]$/.test(e.reason.trim())?e.reason.trim():`${e.reason.trim()}.`} ${n}`:n}I(`slicc-secret-dialog`,_c);var yc=new Set([`top`,`bottom`,`left`,`right`]),bc=R(`
3984
+ `,hc=`slicc-secret-dialog-style`;function gc(e){if(e.getElementById(hc))return;let t=e.createElement(`style`);t.id=hc,t.textContent=mc,(e.head??e.documentElement).appendChild(t)}function _c(e){return e.split(/[,\s]+/).map(e=>e.trim()).filter(e=>e.length>0)}var vc=class extends HTMLElement{static observedAttributes=[`heading`,`secret-name`,`domain`,`provider`,`persist-default`];submitHandler=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f=!1;#p=!1;#m=null;connectedCallback(){this.#O()}attributeChangedCallback(e){this.#f&&(e===`heading`?this.#e.setAttribute(`heading`,this.heading):e===`secret-name`?this.#t.value=this.getAttribute(`secret-name`)??``:e===`domain`?this.#b(_c(this.getAttribute(`domain`)??``)):e===`provider`?this.#e.setAttribute(`description`,dc(this.provider)):e===`persist-default`&&(this.#a.checked=this.persistDefault))}get provider(){return this.getAttribute(`provider`)||uc}set provider(e){e==null?this.removeAttribute(`provider`):this.setAttribute(`provider`,e)}get heading(){return this.getAttribute(`heading`)??lc}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get persistDefault(){return this.hasAttribute(`persist-default`)}set persistDefault(e){this.toggleAttribute(`persist-default`,e)}open(e={}){return this.#O(),e.heading&&(this.heading=e.heading),e.provider&&(this.provider=e.provider),this.#e.setAttribute(`heading`,this.heading),this.#e.setAttribute(`description`,yc(e,this.provider)),this.#t.value=e.name??this.getAttribute(`secret-name`)??``,this.#b(e.domains??_c(this.getAttribute(`domain`)??``)),this.#a.checked=e.persist??this.persistDefault,this.#n.value=``,this.#g(!1),this.#l.textContent=``,this.#h(!1),this.#c.open=!0,this.#_(),this.#e.show?.(),requestAnimationFrame(()=>(this.#t.value?this.#n:this.#t).focus()),new Promise(e=>{this.#m=e})}setError(e){this.#O(),this.#l.textContent=e,this.#h(!1)}#h(e){this.#p=e,this.#o.disabled=e,this.#o.textContent=e?`Storing…`:`Store secret`,this.#s.disabled=e}#g(e){this.#n.type=e?`text`:`password`,this.#r.setAttribute(`aria-pressed`,String(e)),this.#r.setAttribute(`aria-label`,e?`Hide secret`:`Show secret`),this.#r.replaceChildren(i(e?`eye-off`:`eye`,{size:16}))}#_(){let e=this.#t.value.trim(),t=!e||fc.test(e);this.#u.textContent=t?``:`Not a shell name — no $${e} in the shell.`,this.#u.toggleAttribute(`hidden`,t);let n=this.#v().includes(cc);this.#d.textContent=n?`* allows any domain. Narrow it to the API host.`:``,this.#d.toggleAttribute(`hidden`,!n)}#v(){return this.#y().flatMap(e=>_c(e.value))}#y(){return Array.from(this.#i.querySelectorAll(`[part="domain"]`))}#b(e){let t=e.length>0?e:[``];this.#i.replaceChildren(...t.map(e=>this.#x(e))),this.#C()}#x(e){let t=L(`input`,{type:`text`,class:`slicc-secret__input`,part:`domain`,spellcheck:`false`,autocomplete:`off`,placeholder:`api.github.com`,"aria-label":`Allowed domain`});t.value=e,t.addEventListener(`input`,()=>this.#_());let n=L(`div`,{class:`slicc-secret__row`},t,this.#S(`minus`,`Remove this domain`,`domain-remove`,()=>{n.remove(),this.#C(),this.#_()}),this.#S(`plus`,`Add another domain`,`domain-add`,()=>{let e=this.#x(``);n.after(e),this.#C(),e.querySelector(`[part="domain"]`)?.focus()}));return n}#S(e,t,n,r){let a=L(`button`,{type:`button`,class:`slicc-secret__row-btn`,part:n,"aria-label":t,title:t},i(e,{size:14}));return a.addEventListener(`click`,r),a}#C(){let e=Array.from(this.#i.children);for(let t of e){let n=t.querySelector(`[part="domain-remove"]`);n&&(n.disabled=e.length===1)}}#w(){let e=this.#t.value.trim();if(!e)return`Give the secret a name.`;if(!pc.test(e))return`Use letters, digits, and . _ - in the name.`;let t=this.#n.value;if(!t)return`Paste the secret value.`;let n=this.#v();return n.length===0?`Every secret needs at least one allowed domain.`:{name:e,value:t,domains:n,persist:this.#a.checked}}async#T(){if(this.#p)return;let e=this.#w();if(typeof e==`string`){this.#l.textContent=e;return}if(this.#l.textContent=``,this.submitHandler){this.#h(!0);let t;try{t=await this.submitHandler(e)}catch(e){t=e instanceof Error?e.message:String(e)}if(t){this.setError(t);return}this.#h(!1)}let{name:t,domains:n,persist:r}=e;this.dispatchEvent(new CustomEvent(`slicc-secret-submit`,{detail:{name:t,domains:n,persist:r},bubbles:!0,composed:!0})),this.#E(e)}#E(e){if(this.#p&&!e)return;let t=this.#m;this.#m=null,this.#e.hide?.(),this.#n.value=``,this.#g(!1),this.#h(!1),e||this.dispatchEvent(new CustomEvent(`slicc-secret-cancel`,{bubbles:!0,composed:!0})),t?.(e)}#D(){this.#i=L(`div`,{class:`slicc-secret__rows`}),this.#b(_c(this.getAttribute(`domain`)??``)),this.#a=L(`input`,{type:`checkbox`,part:`persist`}),this.#a.checked=this.persistDefault,this.#c=L(`details`,{class:`slicc-secret__options`},L(`summary`,{class:`slicc-secret__summary`},i(`sliders-horizontal`,{size:14}),`Additional options`),L(`div`,{class:`slicc-secret__opts-body`},L(`div`,{class:`slicc-secret__field`},L(`label`,{class:`slicc-secret__label`},`Domains`),this.#i,L(`div`,{class:`slicc-secret__hint`},`Globs allowed: *.github.com`),this.#d),L(`label`,{class:`slicc-secret__check`},this.#a,L(`span`,{},`Keep after this session ends`,L(`div`,{class:`slicc-secret__hint`},`Off: this session only.`)))))}#O(){if(this.#f)return;this.#f=!0,gc(this.ownerDocument),this.#t=L(`input`,{type:`text`,class:`slicc-secret__input`,part:`name`,spellcheck:`false`,autocomplete:`off`,placeholder:`GITHUB_TOKEN`,"aria-label":`Secret name`}),this.#t.value=this.getAttribute(`secret-name`)??``,this.#t.addEventListener(`input`,()=>this.#_()),this.#n=L(`input`,{type:`password`,class:`slicc-secret__input slicc-secret__input--value`,part:`value`,spellcheck:`false`,autocomplete:`off`,placeholder:`Paste the value`,"aria-label":`Secret value`}),this.#n.addEventListener(`paste`,e=>{let t=e.clipboardData?.getData(`text`)??``;/[\r\n]/.test(t.trim())&&(this.#l.textContent=`That value spans multiple lines and was joined into one. Secrets must be single-line — base64-encode it first (base64 -w0 key.pem).`)}),this.#n.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),this.#T())}),this.#r=L(`button`,{type:`button`,class:`slicc-secret__reveal`,part:`reveal`}),this.#r.addEventListener(`click`,()=>this.#g(this.#n.type===`password`)),this.#u=L(`div`,{class:`slicc-secret__hint`,hidden:!0}),this.#d=L(`div`,{class:`slicc-secret__hint`,hidden:!0}),this.#D(),this.#l=L(`div`,{class:`slicc-secret__error`,role:`alert`,"aria-live":`polite`}),this.#s=L(`button`,{type:`button`,class:`slicc-secret__btn`,part:`cancel`,slot:`footer`},`Cancel`),this.#s.addEventListener(`click`,()=>this.#E(null)),this.#o=L(`button`,{type:`button`,class:`slicc-secret__btn slicc-secret__btn--save`,part:`save`,slot:`footer`},`Store secret`),this.#o.addEventListener(`click`,()=>void this.#T());let e=L(`div`,{class:`slicc-secret__body`},L(`div`,{class:`slicc-secret__field`},L(`label`,{class:`slicc-secret__label`},`Name`),this.#t,this.#u),L(`div`,{class:`slicc-secret__field`},L(`label`,{class:`slicc-secret__label`},`Value`),L(`div`,{class:`slicc-secret__value-wrap`},this.#n,this.#r),L(`div`,{class:`slicc-secret__hint`},`Single line. Stays in this tab.`)),this.#c,this.#l);this.#g(!1),this.#e=this.ownerDocument.createElement(`slicc-dialog`),this.#e.setAttribute(`heading`,this.heading),this.#e.setAttribute(`description`,dc(this.provider)),this.#e.setAttribute(`persistent`,``),this.#e.append(e,this.#s,this.#o),this.#e.addEventListener(`slicc-dialog-close`,()=>{this.#m&&this.#E(null)}),this.append(this.#e),this.#_()}};function yc(e,t){let n=dc(t);return e.reason?`${e.requester?`${e.requester}: `:``}${/[.!?]$/.test(e.reason.trim())?e.reason.trim():`${e.reason.trim()}.`} ${n}`:n}I(`slicc-secret-dialog`,vc);var bc=new Set([`top`,`bottom`,`left`,`right`]),xc=R(`
3985
3985
  :host { position: relative; display: inline-flex; }
3986
3986
  :host([hidden]) { display: none; }
3987
3987
  .tip {
@@ -4006,7 +4006,7 @@ slicc-secret-dialog .slicc-secret__btn[disabled] {
4006
4006
  :host(:hover) .tip[data-p="right"], :host(:focus-within) .tip[data-p="right"], :host([open]) .tip[data-p="right"] { transform: translate(0, -50%); }
4007
4007
  .tip:empty { display: none; }
4008
4008
  @media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
4009
- `);I(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[bc],this.#t=L(`span`,{class:`tip`,part:`tip`,role:`tooltip`,"aria-hidden":`true`}),this.#e.replaceChildren(L(`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&&yc.has(e)?e:`top`}set placement(e){this.setAttribute(`placement`,e)}#n(){this.#t.textContent=this.label,this.#t.setAttribute(`data-p`,this.placement)}});function xc(e,t){let n=e.base;for(let r of e.variants??[])Ut(r.when,t)&&(r.zones!==void 0||r.center!==void 0)&&(n=r);return n}var Sc=.02,Cc=48,wc={top:`Top`,left:`Left`,center:`Center`,right:`Right`,bottom:`Bottom`},Tc=class{#e;#t;#n;#r=null;constructor(e){this.#e=e,this.#t=Ec(`slicc-layout__ghost`),this.#n=Ec(`slicc-layout__targets`)}overlays(){return[this.#n,this.#t]}cancel(){window.removeEventListener(`pointermove`,this.#l),window.removeEventListener(`pointerup`,this.#d),this.#r=null,this.#t.classList.remove(`slicc-layout__ghost--active`),this.#n.replaceChildren(),this.#n.classList.remove(`slicc-layout__targets--active`)}decorateSlot(e,t){if(this.#e.isLocked(t))return;let n=document.createElement(`button`);n.type=`button`,n.className=`slicc-layout__move`,n.title=`Move ${t}`,n.setAttribute(`aria-label`,`Move ${t}`),n.dataset.panelId=t,n.appendChild(i(`grip-vertical`,{size:13})),n.addEventListener(`pointerdown`,e=>this.#a(e,t)),e.appendChild(n)}buildZonePanelDivider(e,t,n,r){if(r)return null;let i=t===`row`,a=Ec(`slicc-layout__divider slicc-layout__divider--${i?`h`:`v`}`);return a.dataset.zone=e,a.addEventListener(`pointerdown`,t=>{this.#f(t,e,i,n)}),a}buildZoneDivider(e,t,n,r,i){if(i)return null;let a=Ec(`slicc-layout__divider slicc-layout__divider--zone slicc-layout__divider--${n?`h`:`v`}`);return a.dataset.zoneBefore=e,a.dataset.zoneAfter=t,a.addEventListener(`pointerdown`,i=>{this.#i(i,e,t,n,r)}),a}#i(e,t,n,r,i){e.preventDefault();let a=t===`center`?n:t,o=a===t?1:-1,s=i.querySelector(`:scope > [data-zone="${a}"]`);if(!(s instanceof HTMLElement))return;this.#e.setPointerCapture(e.pointerId);let c=s.getBoundingClientRect(),l=r?c.width:c.height,u=r?e.clientX:e.clientY,d=i.getBoundingClientRect(),f=r?d.width:d.height,p=0;for(let e of Array.from(i.children)){if(!(e instanceof HTMLElement)||e===s)continue;let t=e.getBoundingClientRect(),n=r?t.width:t.height,i=e.dataset.zone===`center`||e.classList.contains(`slicc-layout__work-row`);p+=i?Cc:n}let m=Math.max(Cc,f-p),h=l,g=e=>{let t=r?e.clientX:e.clientY;h=Math.max(Cc,Math.min(m,l+(t-u)*o)),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.rerender()},_=()=>{window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.commitResize()};window.addEventListener(`pointermove`,g),window.addEventListener(`pointerup`,_),window.addEventListener(`pointercancel`,_)}#a(e,t){this.#e.isLocked(t)||(e.preventDefault(),this.#r={panelId:t,zone:null},this.#t.textContent=t,this.#t.classList.add(`slicc-layout__ghost--active`),this.#c(e),this.#o(),window.addEventListener(`pointermove`,this.#l),window.addEventListener(`pointerup`,this.#d))}#o(){let e=this.#e.querySelector(`.slicc-layout__work`);if(!(e instanceof HTMLElement))return;let t=e.getBoundingClientRect();for(let e of Rt)this.#n.appendChild(Ac(e,t));this.#n.classList.add(`slicc-layout__targets--active`)}#s(e){for(let t of Array.from(this.#n.children))t.classList.toggle(`slicc-layout__target--hot`,t===e)}#c(e){this.#t.style.left=`${e.clientX}px`,this.#t.style.top=`${e.clientY}px`}#l=e=>{let t=this.#r;if(!t)return;this.#c(e),t.zone=null;let n=document.elementFromPoint(e.clientX,e.clientY),r=n?.closest(`.slicc-layout__target`);if(r instanceof HTMLElement){let e=r.dataset.zone;if(e){t.zone=e,this.#s(r);return}}let i=n?.closest(`.slicc-layout__zone`),a=i instanceof HTMLElement?i.dataset.zone:null;t.zone=a,this.#s(a?this.#u(a):null)};#u(e){return this.#n.querySelector(`.slicc-layout__target[data-zone="${e}"]`)}#d=()=>{let e=this.#r;this.cancel(),e?.zone&&this.#e.applyMove(e.panelId,e.zone)};#f(e,t,n,r){e.preventDefault();let i=e.currentTarget,a=Array.from(r.querySelectorAll(`:scope > .slicc-layout__slot`)),o=Array.from(r.children).slice(0,Array.from(r.children).indexOf(i)).filter(e=>e.classList.contains(`slicc-layout__slot`)).length;if(o<1||o>=a.length)return;this.#e.setPointerCapture(e.pointerId);let s=a.map(e=>{let t=e.getBoundingClientRect();return Math.max(1,n?t.width:t.height)}),c=s.reduce((e,t)=>e+t,0),l=s.map(e=>e/c*s.length),u=r.getBoundingClientRect(),d=n?u.width:u.height,f=n?e.clientX:e.clientY,p=l.reduce((e,t)=>e+t,0),m=l[o-1]+l[o],h=m*Sc,g=l[o-1],_=l,v=e=>{let r=n?e.clientX:e.clientY,i=d>0?(r-f)/d*p:0,a=Math.max(h,Math.min(m-h,g+i));_=[...l],_[o-1]=a,_[o]=m-a,this.#e.applyResize(t,_),this.#e.rerender()},y=()=>{window.removeEventListener(`pointermove`,v),window.removeEventListener(`pointerup`,y),window.removeEventListener(`pointercancel`,y),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyResize(t,_),this.#e.commitResize()};window.addEventListener(`pointermove`,v),window.addEventListener(`pointerup`,y),window.addEventListener(`pointercancel`,y)}};function Ec(e){let t=document.createElement(`div`);return t.className=e,t}var Dc={top:`arrow-up`,bottom:`arrow-down`,left:`arrow-left`,right:`arrow-right`,center:`square`},Oc=56,kc=16;function Ac(e,t){let n=Ec(`slicc-layout__target slicc-layout__target--${e}`);n.dataset.zone=e,n.title=`Move to ${wc[e]}`,n.appendChild(i(Dc[e],{size:20}));let r=Ec(`slicc-layout__target-label`);r.textContent=wc[e],n.appendChild(r);let a=t.left+t.width/2-Oc/2,o=t.top+t.height/2-Oc/2,[s,c]={center:[a,o],top:[a,t.top+kc],bottom:[a,t.bottom-Oc-kc],left:[t.left+kc,o],right:[t.right-Oc-kc,o]}[e];return n.style.left=`${s}px`,n.style.top=`${c}px`,n}var jc=`
4009
+ `);I(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[xc],this.#t=L(`span`,{class:`tip`,part:`tip`,role:`tooltip`,"aria-hidden":`true`}),this.#e.replaceChildren(L(`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&&bc.has(e)?e:`top`}set placement(e){this.setAttribute(`placement`,e)}#n(){this.#t.textContent=this.label,this.#t.setAttribute(`data-p`,this.placement)}});function Sc(e,t){let n=e.base;for(let r of e.variants??[])Gt(r.when,t)&&(r.zones!==void 0||r.center!==void 0)&&(n=r);return n}var Cc=.02,wc=48,Tc={top:`Top`,left:`Left`,center:`Center`,right:`Right`,bottom:`Bottom`},Ec=class{#e;#t;#n;#r=null;constructor(e){this.#e=e,this.#t=Dc(`slicc-layout__ghost`),this.#n=Dc(`slicc-layout__targets`)}overlays(){return[this.#n,this.#t]}cancel(){window.removeEventListener(`pointermove`,this.#l),window.removeEventListener(`pointerup`,this.#d),this.#r=null,this.#t.classList.remove(`slicc-layout__ghost--active`),this.#n.replaceChildren(),this.#n.classList.remove(`slicc-layout__targets--active`)}decorateSlot(e,t){if(this.#e.isLocked(t))return;let n=document.createElement(`button`);n.type=`button`,n.className=`slicc-layout__move`,n.title=`Move ${t}`,n.setAttribute(`aria-label`,`Move ${t}`),n.dataset.panelId=t,n.appendChild(i(`grip-vertical`,{size:13})),n.addEventListener(`pointerdown`,e=>this.#a(e,t)),e.appendChild(n)}buildZonePanelDivider(e,t,n,r){if(r)return null;let i=t===`row`,a=Dc(`slicc-layout__divider slicc-layout__divider--${i?`h`:`v`}`);return a.dataset.zone=e,a.addEventListener(`pointerdown`,t=>{this.#f(t,e,i,n)}),a}buildZoneDivider(e,t,n,r,i){if(i)return null;let a=Dc(`slicc-layout__divider slicc-layout__divider--zone slicc-layout__divider--${n?`h`:`v`}`);return a.dataset.zoneBefore=e,a.dataset.zoneAfter=t,a.addEventListener(`pointerdown`,i=>{this.#i(i,e,t,n,r)}),a}#i(e,t,n,r,i){e.preventDefault();let a=t===`center`?n:t,o=a===t?1:-1,s=i.querySelector(`:scope > [data-zone="${a}"]`);if(!(s instanceof HTMLElement))return;this.#e.setPointerCapture(e.pointerId);let c=s.getBoundingClientRect(),l=r?c.width:c.height,u=r?e.clientX:e.clientY,d=i.getBoundingClientRect(),f=r?d.width:d.height,p=0;for(let e of Array.from(i.children)){if(!(e instanceof HTMLElement)||e===s)continue;let t=e.getBoundingClientRect(),n=r?t.width:t.height,i=e.dataset.zone===`center`||e.classList.contains(`slicc-layout__work-row`);p+=i?wc:n}let m=Math.max(wc,f-p),h=l,g=e=>{let t=r?e.clientX:e.clientY;h=Math.max(wc,Math.min(m,l+(t-u)*o)),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.rerender()},_=()=>{window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.commitResize()};window.addEventListener(`pointermove`,g),window.addEventListener(`pointerup`,_),window.addEventListener(`pointercancel`,_)}#a(e,t){this.#e.isLocked(t)||(e.preventDefault(),this.#r={panelId:t,zone:null},this.#t.textContent=t,this.#t.classList.add(`slicc-layout__ghost--active`),this.#c(e),this.#o(),window.addEventListener(`pointermove`,this.#l),window.addEventListener(`pointerup`,this.#d))}#o(){let e=this.#e.querySelector(`.slicc-layout__work`);if(!(e instanceof HTMLElement))return;let t=e.getBoundingClientRect();for(let e of Bt)this.#n.appendChild(jc(e,t));this.#n.classList.add(`slicc-layout__targets--active`)}#s(e){for(let t of Array.from(this.#n.children))t.classList.toggle(`slicc-layout__target--hot`,t===e)}#c(e){this.#t.style.left=`${e.clientX}px`,this.#t.style.top=`${e.clientY}px`}#l=e=>{let t=this.#r;if(!t)return;this.#c(e),t.zone=null;let n=document.elementFromPoint(e.clientX,e.clientY),r=n?.closest(`.slicc-layout__target`);if(r instanceof HTMLElement){let e=r.dataset.zone;if(e){t.zone=e,this.#s(r);return}}let i=n?.closest(`.slicc-layout__zone`),a=i instanceof HTMLElement?i.dataset.zone:null;t.zone=a,this.#s(a?this.#u(a):null)};#u(e){return this.#n.querySelector(`.slicc-layout__target[data-zone="${e}"]`)}#d=()=>{let e=this.#r;this.cancel(),e?.zone&&this.#e.applyMove(e.panelId,e.zone)};#f(e,t,n,r){e.preventDefault();let i=e.currentTarget,a=Array.from(r.querySelectorAll(`:scope > .slicc-layout__slot`)),o=Array.from(r.children).slice(0,Array.from(r.children).indexOf(i)).filter(e=>e.classList.contains(`slicc-layout__slot`)).length;if(o<1||o>=a.length)return;this.#e.setPointerCapture(e.pointerId);let s=a.map(e=>{let t=e.getBoundingClientRect();return Math.max(1,n?t.width:t.height)}),c=s.reduce((e,t)=>e+t,0),l=s.map(e=>e/c*s.length),u=r.getBoundingClientRect(),d=n?u.width:u.height,f=n?e.clientX:e.clientY,p=l.reduce((e,t)=>e+t,0),m=l[o-1]+l[o],h=m*Cc,g=l[o-1],_=l,v=e=>{let r=n?e.clientX:e.clientY,i=d>0?(r-f)/d*p:0,a=Math.max(h,Math.min(m-h,g+i));_=[...l],_[o-1]=a,_[o]=m-a,this.#e.applyResize(t,_),this.#e.rerender()},y=()=>{window.removeEventListener(`pointermove`,v),window.removeEventListener(`pointerup`,y),window.removeEventListener(`pointercancel`,y),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyResize(t,_),this.#e.commitResize()};window.addEventListener(`pointermove`,v),window.addEventListener(`pointerup`,y),window.addEventListener(`pointercancel`,y)}};function Dc(e){let t=document.createElement(`div`);return t.className=e,t}var Oc={top:`arrow-up`,bottom:`arrow-down`,left:`arrow-left`,right:`arrow-right`,center:`square`},kc=56,Ac=16;function jc(e,t){let n=Dc(`slicc-layout__target slicc-layout__target--${e}`);n.dataset.zone=e,n.title=`Move to ${Tc[e]}`,n.appendChild(i(Oc[e],{size:20}));let r=Dc(`slicc-layout__target-label`);r.textContent=Tc[e],n.appendChild(r);let a=t.left+t.width/2-kc/2,o=t.top+t.height/2-kc/2,[s,c]={center:[a,o],top:[a,t.top+Ac],bottom:[a,t.bottom-kc-Ac],left:[t.left+Ac,o],right:[t.right-kc-Ac,o]}[e];return n.style.left=`${s}px`,n.style.top=`${c}px`,n}var Mc=`
4010
4010
  /* The corner grip: hidden until the slot is hovered, mirroring the dock-tree's
4011
4011
  (and slicc-file-tree's) hover-reveal action pattern — a persistent title bar on
4012
4012
  every panel was the thing the redesign set out to remove. */
@@ -4112,7 +4112,7 @@ slicc-layout .slicc-layout__target--hot {
4112
4112
  color: #fff;
4113
4113
  transform: scale(1.12);
4114
4114
  }
4115
- `,Mc=`
4115
+ `,Nc=`
4116
4116
  [data-slicc-panel] {
4117
4117
  display: flex;
4118
4118
  flex-direction: column;
@@ -4151,7 +4151,7 @@ slicc-layout .slicc-layout__target--hot {
4151
4151
  [data-slicc-panel][presentation="floating"][anchor="center"] {
4152
4152
  top: 50%; left: 50%; transform: translate(-50%, -50%);
4153
4153
  }
4154
- `,Nc=`slicc-panel-style`;function Pc(e){if(e.getElementById(Nc))return;let t=e.createElement(`style`);t.id=Nc,t.textContent=Mc,(e.head??e.documentElement).appendChild(t)}var Fc=`data-slicc-panel`;I(`slicc-panel`,class extends HTMLElement{static observedAttributes=[`panel-id`,`hidden`,`locked`,`presentation`,`anchor`];static panelMeta;#e=null;connectedCallback(){Pc(this.ownerDocument),this.setAttribute(Fc,``),this.setAttribute(`part`,`panel`),this.hasAttribute(`presentation`)||this.setAttribute(`presentation`,this.presentation),!this.hasAttribute(`anchor`)&&this.anchor&&this.setAttribute(`anchor`,this.anchor),this.#t(),this.visible&&this.onPanelShow?.()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){if(!this.isConnected||t===n||e!==`hidden`)return;let r=this.visible;r?this.onPanelShow?.():this.onPanelHide?.(),this.dispatchEvent(new CustomEvent(`slicc-panel-visibility`,{bubbles:!0,composed:!0,detail:{panelId:this.panelId,visible:r}}))}get panelId(){return this.getAttribute(`panel-id`)??Et(this.constructor)?.id??null}set panelId(e){e==null?this.removeAttribute(`panel-id`):this.setAttribute(`panel-id`,e)}get visible(){return!this.hasAttribute(`hidden`)}set visible(e){this.toggleAttribute(`hidden`,!e)}get locked(){return this.hasAttribute(`locked`)}set locked(e){this.toggleAttribute(`locked`,e)}get presentation(){let e=this.getAttribute(`presentation`);return e===`floating`||e===`docked`?e:Et(this.constructor)?.presentation??`docked`}set presentation(e){this.setAttribute(`presentation`,e)}get anchor(){let e=this.getAttribute(`anchor`);return Tt(e)?e:Et(this.constructor)?.anchor??null}set anchor(e){e==null?this.removeAttribute(`anchor`):this.setAttribute(`anchor`,e)}get meta(){return Et(this.constructor)}#t(){!this.onPanelResize||typeof ResizeObserver>`u`||(this.#e=new ResizeObserver(e=>{let t=e[0]?.contentRect;t&&this.onPanelResize?.(t)}),this.#e.observe(this))}});var Ic=`
4154
+ `,Pc=`slicc-panel-style`;function Fc(e){if(e.getElementById(Pc))return;let t=e.createElement(`style`);t.id=Pc,t.textContent=Nc,(e.head??e.documentElement).appendChild(t)}var Ic=`data-slicc-panel`;I(`slicc-panel`,class extends HTMLElement{static observedAttributes=[`panel-id`,`hidden`,`locked`,`presentation`,`anchor`];static panelMeta;#e=null;connectedCallback(){Fc(this.ownerDocument),this.setAttribute(Ic,``),this.setAttribute(`part`,`panel`),this.hasAttribute(`presentation`)||this.setAttribute(`presentation`,this.presentation),!this.hasAttribute(`anchor`)&&this.anchor&&this.setAttribute(`anchor`,this.anchor),this.#t(),this.visible&&this.onPanelShow?.()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){if(!this.isConnected||t===n||e!==`hidden`)return;let r=this.visible;r?this.onPanelShow?.():this.onPanelHide?.(),this.dispatchEvent(new CustomEvent(`slicc-panel-visibility`,{bubbles:!0,composed:!0,detail:{panelId:this.panelId,visible:r}}))}get panelId(){return this.getAttribute(`panel-id`)??Ot(this.constructor)?.id??null}set panelId(e){e==null?this.removeAttribute(`panel-id`):this.setAttribute(`panel-id`,e)}get visible(){return!this.hasAttribute(`hidden`)}set visible(e){this.toggleAttribute(`hidden`,!e)}get locked(){return this.hasAttribute(`locked`)}set locked(e){this.toggleAttribute(`locked`,e)}get presentation(){let e=this.getAttribute(`presentation`);return e===`floating`||e===`docked`?e:Ot(this.constructor)?.presentation??`docked`}set presentation(e){this.setAttribute(`presentation`,e)}get anchor(){let e=this.getAttribute(`anchor`);return Dt(e)?e:Ot(this.constructor)?.anchor??null}set anchor(e){e==null?this.removeAttribute(`anchor`):this.setAttribute(`anchor`,e)}get meta(){return Ot(this.constructor)}#t(){!this.onPanelResize||typeof ResizeObserver>`u`||(this.#e=new ResizeObserver(e=>{let t=e[0]?.contentRect;t&&this.onPanelResize?.(t)}),this.#e.observe(this))}});var Lc=`
4155
4155
  slicc-layout {
4156
4156
  display: flex;
4157
4157
  flex-direction: column;
@@ -4250,7 +4250,7 @@ slicc-layout .slicc-layout__zone {
4250
4250
  sit side by side or stacked — see zoneAxis(). */
4251
4251
  slicc-layout .slicc-layout__zone[data-axis='row'] { flex-direction: row; }
4252
4252
  slicc-layout .slicc-layout__zone[data-axis='col'] { flex-direction: column; }
4253
- ${jc}`,Lc=`slicc-layout-style`;function Rc(e){if(e.getElementById(Lc))return;let t=e.createElement(`style`);t.id=Lc,t.textContent=Ic,(e.head??e.documentElement).appendChild(t)}function zc(e,t){let n=document.createElement(e);return n.className=t,n}var Bc=class extends HTMLElement{static observedAttributes=[`platform`];#e=Vt();#t=null;#n=!1;#r=zc(`div`,`slicc-layout__root`);#i=zc(`div`,`slicc-layout__parking`);#a=new Set;#o=null;#s=null;#c=0;#l=new MutationObserver(()=>this.#f());#u=new Tc(this);connectedCallback(){Rc(this.ownerDocument),this.#n=!0,this.#r.parentElement!==this&&this.append(this.#r),this.#i.parentElement!==this&&this.append(this.#i);for(let e of this.#u.overlays())e.parentElement!==this&&this.append(e);this.#v(),this.#f(),this.#l.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#l.disconnect(),this.#u.cancel(),this.#s?.disconnect(),this.#s=null,this.#c&&cancelAnimationFrame(this.#c),this.#c=0}attributeChangedCallback(e,t,n){e!==`platform`||t===n||!this.#n||this.#f(`environment`)}setLayout(e){this.#e=e?F(e):Vt(),this.#n&&this.#f(`set`)}getLayout(){return F(this.#e)}getResolved(){return this.#t?F(this.#t):null}getPlacedPanelIds(){return this.#t?Wt(this.#t).filter(e=>this.#a.has(e)):[]}isLocked(e){let t=this.#o??this.#t;return t?Zt(t,e):!1}environment(){let e=this.getBoundingClientRect(),t=this.getAttribute(`platform`);return{width:e.width,height:e.height,platform:t===`web`||t===`extension`||t===`electron`?t:void 0}}#d(){let e=new Map;for(let t of Array.from(this.querySelectorAll(`[${Fc}]`))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(`[data-slicc-panel]`))continue;let n=t.getAttribute(`panel-id`);n&&e.set(n,t)}return e}#f(e=`set`,t){let n=Xt(this.#e,this.environment());this.#o=n;let r=this.#d(),i=new Set,a=e=>this.#p(n,e,r,i),o=zc(`div`,`slicc-layout__row`),s=a(`left`),c=a(`right`);s&&o.appendChild(s);let l=this.#m(n,r,i);l.style.flex=`1 1 0`,o.appendChild(l),c&&o.appendChild(c);let u=[],d=a(`top`);d&&u.push(d),u.push(o);let f=a(`bottom`);f&&u.push(f);let p=this.#g(n,r,i);p&&u.push(p);for(let[e,t]of r)i.has(e)||t.parentElement!==this.#i&&this.#i.appendChild(t);this.#r.replaceChildren(...u),this.#l.takeRecords(),this.#t=n,this.#a=i,this.#o=null,!t?.silent&&this.dispatchEvent(new CustomEvent(`slicc-layout-change`,{bubbles:!0,composed:!0,detail:{layout:F(n),reason:e}}))}#p(e,t,n,r){let i=e.docks.filter(e=>e.edge===t);if(i.length===0)return null;let a=[];for(let o of i){let i=zc(`div`,`slicc-layout__dock slicc-layout__dock--${t}`);i.dataset.edge=t;let s=!1;for(let t of o.panels){let a=n.get(t);!a||e.panels[t]?.visible===!1||(this.#_(a,e,t),i.appendChild(a),r.add(t),s=!0)}s&&(i.style.flex=o.size==null?`0 0 auto`:$t(o.size),a.push(i))}if(a.length===0)return null;if(a.length===1)return a[0];let o=zc(`div`,`slicc-layout__dockstack slicc-layout__dockstack--${t}`);return o.dataset.edge=t,o.append(...a),o.style.flex=`0 0 auto`,o}#m(e,t,n){let r=e.zones??(e.center?Jt(e.center):{}),i=zc(`div`,`slicc-layout__work`),a=i=>{let a=e.locked||(r.locked??[]).includes(i),o=(r[i]??[]).map(r=>this.#h(r,i,e,t,n)).filter(e=>e!==null);if(o.length===0)return null;let s=zc(`div`,`slicc-layout__zone slicc-layout__zone--${i}`);s.dataset.zone=i;let c=Bt(r,i);s.dataset.axis=c,o.forEach((e,t)=>{if(t>0){let e=this.#u.buildZonePanelDivider(i,c,s,a);e&&s.appendChild(e)}s.appendChild(e)});let l=r.sizes?.[i];return s.style.flex=i===`center`?`1 1 0`:$t(l??void 0),s},o=(t,n,i)=>{let o=n.map(e=>({zone:e,element:a(e)})).filter(e=>!!e.element);o.forEach((n,a)=>{if(a>0){let s=o[a-1].zone,c=e.locked||(r.locked??[]).includes(s)||(r.locked??[]).includes(n.zone),l=this.#u.buildZoneDivider(s,n.zone,i,t,c);l&&t.appendChild(l)}t.appendChild(n.element)})},s=zc(`div`,`slicc-layout__work-row`);o(s,[`left`,`center`,`right`],!0);let c=a(`top`),l=a(`bottom`),u=[];return c&&u.push({zone:`top`,element:c}),u.push({zone:`center`,element:s}),l&&u.push({zone:`bottom`,element:l}),u.forEach((t,n)=>{if(n>0){let a=u[n-1].zone,o=e.locked||(r.locked??[]).includes(a)||(r.locked??[]).includes(t.zone),s=this.#u.buildZoneDivider(a,t.zone,!1,i,o);s&&i.appendChild(s)}i.appendChild(t.element)}),i}#h(e,t,n,r,i){let a=r.get(e);if(!a||n.panels[e]?.visible===!1)return null;let o=zc(`div`,`slicc-layout__slot`);return o.dataset.panelId=e,o.dataset.zone=t,o.style.flex=$t(n.panels[e]?.size??void 0),this.#_(a,n,e),o.appendChild(a),this.#u.decorateSlot(o,e),i.add(e),o}applyMove(e,t){if(this.isLocked(e))return;let n=xc(this.#e,this.environment()),r=n.zones??Jt(n.center??null),i=Kt(r,e,t);i===r&&n.zones||(n.zones=i,n.center=null,this.#f(`rearrange`))}applyResize(e,t){let n=xc(this.#e,this.environment()).zones,r=n?.[e];if(!n||!r||r.length!==t.length)return;let i={...this.#e.panels??{}};r.forEach((e,n)=>{i[e]={...i[e],size:t[n]}}),this.#e.panels=i}applyZoneResize(e,t){let n=xc(this.#e,this.environment());n.zones&&(n.zones.sizes={...n.zones.sizes,[e]:t})}rerender(){this.#f(`resize`,{silent:!0})}commitResize(){this.#f(`resize`)}#g(e,t,n){if(e.floating.length===0)return null;let r=zc(`div`,`slicc-layout__floating`),i=!1;for(let a of e.floating){let o=t.get(a.panel);!o||e.panels[a.panel]?.visible===!1||(this.#_(o,e,a.panel),o.setAttribute(`presentation`,`floating`),a.anchor&&o.setAttribute(`anchor`,a.anchor),a.width!=null&&(o.style.width=Vc(a.width)),a.height!=null&&(o.style.height=Vc(a.height)),r.appendChild(o),n.add(a.panel),i=!0)}return i?r:null}#_(e,t,n){e.toggleAttribute(`locked`,Zt(t,n)),e.removeAttribute(`hidden`),e.setAttribute(`presentation`,`docked`),e.removeAttribute(`anchor`),e.style.removeProperty(`width`),e.style.removeProperty(`height`)}#v(){typeof ResizeObserver>`u`||(this.#s=new ResizeObserver(()=>{this.#e.variants?.length&&(this.#c||=requestAnimationFrame(()=>{this.#c=0;let e=Xt(this.#e,this.environment()),t=this.#t?.appliedVariants.join(`,`)??``;e.appliedVariants.join(`,`)!==t&&this.#f(`viewport`)}))}),this.#s.observe(this))}};function Vc(e){return typeof e==`number`?`${e}px`:e}I(`slicc-layout`,Bc);var Hc=`weekly`;function Uc(e){return e.status===`rate-limited`||e.percent>=95?`critical`:e.percent>=80?`warn`:`ok`}function Wc(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e/100)):0}function Gc(e){if(!Number.isFinite(e))return`0`;let t=Math.max(0,e);return String(t<10?Number(t.toFixed(1)):Math.round(t))}function Kc(e){return`${Gc(e)}%`}function qc(e){return`${e.window??Hc} budget`}function Jc(e){let t=[`${Kc(e.percent)} of ${qc(e)} used`];return e.status===`rate-limited`&&t.push(`rate-limited`),e.resets&&t.push(e.resets),t}function Yc(e){return e===`critical`?`var(--rose)`:e===`warn`?`var(--waffle)`:`var(--green)`}var Xc={offline:`#94a3b8`,connecting:`#f59e0b`,live:`#22c55e`,stalled:`#eab308`,reconnecting:`#f97316`,error:`#ef4444`},Zc={offline:`color-mix(in srgb, #94a3b8 18%, transparent)`,connecting:`color-mix(in srgb, #f59e0b 28%, transparent)`,live:`color-mix(in srgb, #22c55e 22%, transparent)`,stalled:`color-mix(in srgb, #eab308 26%, transparent)`,reconnecting:`color-mix(in srgb, #f97316 28%, transparent)`,error:`color-mix(in srgb, #ef4444 24%, transparent)`},Qc={offline:`offline`,connecting:`connecting`,live:`live`,stalled:`leader busy`,reconnecting:`reconnecting`,error:`connection error`},$c={npx:`terminal`,sliccstart:`monitor`,extension:`blocks`,standalone:`monitor`,cherry:`frame`,electron:`laptop`,hosted:`cloud`},el={npx:`npx`,sliccstart:`sliccstart`,extension:`extension`,standalone:`standalone`,cherry:`cherry`,electron:`electron`,hosted:`hosted`},tl={leader:`crown`,follower:`radio`},nl={none:`local`,leader:`leading tray`,follower:`following tray`};function rl(e){return $c[e]}function il(e){return el[e]}function al(e){return Xc[e]}function ol(e){return Zc[e]}function sl(e){return Qc[e]}function cl(e){return e===`none`?null:tl[e]}function ll(e){return nl[e]}function ul(e){return e===`connecting`||e===`reconnecting`}function dl(){return{connection:`offline`,floatKind:`standalone`,trayRole:`none`}}function fl(e){return[il(e.floatKind),ll(e.trayRole),sl(e.connection)].join(` · `)}var pl=R(`
4253
+ ${Mc}`,Rc=`slicc-layout-style`;function zc(e){if(e.getElementById(Rc))return;let t=e.createElement(`style`);t.id=Rc,t.textContent=Lc,(e.head??e.documentElement).appendChild(t)}function Bc(e,t){let n=document.createElement(e);return n.className=t,n}var Vc=class extends HTMLElement{static observedAttributes=[`platform`];#e=Ut();#t=null;#n=!1;#r=Bc(`div`,`slicc-layout__root`);#i=Bc(`div`,`slicc-layout__parking`);#a=new Set;#o=null;#s=null;#c=0;#l=new MutationObserver(()=>this.#f());#u=new Ec(this);connectedCallback(){zc(this.ownerDocument),this.#n=!0,this.#r.parentElement!==this&&this.append(this.#r),this.#i.parentElement!==this&&this.append(this.#i);for(let e of this.#u.overlays())e.parentElement!==this&&this.append(e);this.#v(),this.#f(),this.#l.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#l.disconnect(),this.#u.cancel(),this.#s?.disconnect(),this.#s=null,this.#c&&cancelAnimationFrame(this.#c),this.#c=0}attributeChangedCallback(e,t,n){e!==`platform`||t===n||!this.#n||this.#f(`environment`)}setLayout(e){this.#e=e?P(e):Ut(),this.#n&&this.#f(`set`)}getLayout(){return P(this.#e)}getResolved(){return this.#t?P(this.#t):null}getPlacedPanelIds(){return this.#t?Kt(this.#t).filter(e=>this.#a.has(e)):[]}isLocked(e){let t=this.#o??this.#t;return t?$t(t,e):!1}environment(){let e=this.getBoundingClientRect(),t=this.getAttribute(`platform`);return{width:e.width,height:e.height,platform:t===`web`||t===`extension`||t===`electron`?t:void 0}}#d(){let e=new Map;for(let t of Array.from(this.querySelectorAll(`[${Ic}]`))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(`[data-slicc-panel]`))continue;let n=t.getAttribute(`panel-id`);n&&e.set(n,t)}return e}#f(e=`set`,t){let n=Qt(this.#e,this.environment());this.#o=n;let r=this.#d(),i=new Set,a=e=>this.#p(n,e,r,i),o=Bc(`div`,`slicc-layout__row`),s=a(`left`),c=a(`right`);s&&o.appendChild(s);let l=this.#m(n,r,i);l.style.flex=`1 1 0`,o.appendChild(l),c&&o.appendChild(c);let u=[],d=a(`top`);d&&u.push(d),u.push(o);let f=a(`bottom`);f&&u.push(f);let p=this.#g(n,r,i);p&&u.push(p);for(let[e,t]of r)i.has(e)||t.parentElement!==this.#i&&this.#i.appendChild(t);this.#r.replaceChildren(...u),this.#l.takeRecords(),this.#t=n,this.#a=i,this.#o=null,!t?.silent&&this.dispatchEvent(new CustomEvent(`slicc-layout-change`,{bubbles:!0,composed:!0,detail:{layout:P(n),reason:e}}))}#p(e,t,n,r){let i=e.docks.filter(e=>e.edge===t);if(i.length===0)return null;let a=[];for(let o of i){let i=Bc(`div`,`slicc-layout__dock slicc-layout__dock--${t}`);i.dataset.edge=t;let s=!1;for(let t of o.panels){let a=n.get(t);!a||e.panels[t]?.visible===!1||(this.#_(a,e,t),i.appendChild(a),r.add(t),s=!0)}s&&(i.style.flex=o.size==null?`0 0 auto`:tn(o.size),a.push(i))}if(a.length===0)return null;if(a.length===1)return a[0];let o=Bc(`div`,`slicc-layout__dockstack slicc-layout__dockstack--${t}`);return o.dataset.edge=t,o.append(...a),o.style.flex=`0 0 auto`,o}#m(e,t,n){let r=e.zones??(e.center?Xt(e.center):{}),i=Bc(`div`,`slicc-layout__work`),a=i=>{let a=e.locked||(r.locked??[]).includes(i),o=(r[i]??[]).map(r=>this.#h(r,i,e,t,n)).filter(e=>e!==null);if(o.length===0)return null;let s=Bc(`div`,`slicc-layout__zone slicc-layout__zone--${i}`);s.dataset.zone=i;let c=Ht(r,i);s.dataset.axis=c,o.forEach((e,t)=>{if(t>0){let e=this.#u.buildZonePanelDivider(i,c,s,a);e&&s.appendChild(e)}s.appendChild(e)});let l=r.sizes?.[i];return s.style.flex=i===`center`?`1 1 0`:tn(l??void 0),s},o=(t,n,i)=>{let o=n.map(e=>({zone:e,element:a(e)})).filter(e=>!!e.element);o.forEach((n,a)=>{if(a>0){let s=o[a-1].zone,c=e.locked||(r.locked??[]).includes(s)||(r.locked??[]).includes(n.zone),l=this.#u.buildZoneDivider(s,n.zone,i,t,c);l&&t.appendChild(l)}t.appendChild(n.element)})},s=Bc(`div`,`slicc-layout__work-row`);o(s,[`left`,`center`,`right`],!0);let c=a(`top`),l=a(`bottom`),u=[];return c&&u.push({zone:`top`,element:c}),u.push({zone:`center`,element:s}),l&&u.push({zone:`bottom`,element:l}),u.forEach((t,n)=>{if(n>0){let a=u[n-1].zone,o=e.locked||(r.locked??[]).includes(a)||(r.locked??[]).includes(t.zone),s=this.#u.buildZoneDivider(a,t.zone,!1,i,o);s&&i.appendChild(s)}i.appendChild(t.element)}),i}#h(e,t,n,r,i){let a=r.get(e);if(!a||n.panels[e]?.visible===!1)return null;let o=Bc(`div`,`slicc-layout__slot`);return o.dataset.panelId=e,o.dataset.zone=t,o.style.flex=tn(n.panels[e]?.size??void 0),this.#_(a,n,e),o.appendChild(a),this.#u.decorateSlot(o,e),i.add(e),o}applyMove(e,t){if(this.isLocked(e))return;let n=Sc(this.#e,this.environment()),r=n.zones??Xt(n.center??null),i=Jt(r,e,t);i===r&&n.zones||(n.zones=i,n.center=null,this.#f(`rearrange`))}applyResize(e,t){let n=Sc(this.#e,this.environment()).zones,r=n?.[e];if(!n||!r||r.length!==t.length)return;let i={...this.#e.panels??{}};r.forEach((e,n)=>{i[e]={...i[e],size:t[n]}}),this.#e.panels=i}applyZoneResize(e,t){let n=Sc(this.#e,this.environment());n.zones&&(n.zones.sizes={...n.zones.sizes,[e]:t})}rerender(){this.#f(`resize`,{silent:!0})}commitResize(){this.#f(`resize`)}#g(e,t,n){if(e.floating.length===0)return null;let r=Bc(`div`,`slicc-layout__floating`),i=!1;for(let a of e.floating){let o=t.get(a.panel);!o||e.panels[a.panel]?.visible===!1||(this.#_(o,e,a.panel),o.setAttribute(`presentation`,`floating`),a.anchor&&o.setAttribute(`anchor`,a.anchor),a.width!=null&&(o.style.width=Hc(a.width)),a.height!=null&&(o.style.height=Hc(a.height)),r.appendChild(o),n.add(a.panel),i=!0)}return i?r:null}#_(e,t,n){e.toggleAttribute(`locked`,$t(t,n)),e.removeAttribute(`hidden`),e.setAttribute(`presentation`,`docked`),e.removeAttribute(`anchor`),e.style.removeProperty(`width`),e.style.removeProperty(`height`)}#v(){typeof ResizeObserver>`u`||(this.#s=new ResizeObserver(()=>{this.#e.variants?.length&&(this.#c||=requestAnimationFrame(()=>{this.#c=0;let e=Qt(this.#e,this.environment()),t=this.#t?.appliedVariants.join(`,`)??``;e.appliedVariants.join(`,`)!==t&&this.#f(`viewport`)}))}),this.#s.observe(this))}};function Hc(e){return typeof e==`number`?`${e}px`:e}I(`slicc-layout`,Vc);var Uc=`weekly`;function Wc(e){return e.status===`rate-limited`||e.percent>=95?`critical`:e.percent>=80?`warn`:`ok`}function Gc(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e/100)):0}function Kc(e){if(!Number.isFinite(e))return`0`;let t=Math.max(0,e);return String(t<10?Number(t.toFixed(1)):Math.round(t))}function qc(e){return`${Kc(e)}%`}function Jc(e){return`${e.window??Uc} budget`}function Yc(e){let t=[`${qc(e.percent)} of ${Jc(e)} used`];return e.status===`rate-limited`&&t.push(`rate-limited`),e.resets&&t.push(e.resets),t}function Xc(e){return e===`critical`?`var(--rose)`:e===`warn`?`var(--waffle)`:`var(--green)`}var Zc={offline:`#94a3b8`,connecting:`#f59e0b`,live:`#22c55e`,stalled:`#eab308`,reconnecting:`#f97316`,error:`#ef4444`},Qc={offline:`color-mix(in srgb, #94a3b8 18%, transparent)`,connecting:`color-mix(in srgb, #f59e0b 28%, transparent)`,live:`color-mix(in srgb, #22c55e 22%, transparent)`,stalled:`color-mix(in srgb, #eab308 26%, transparent)`,reconnecting:`color-mix(in srgb, #f97316 28%, transparent)`,error:`color-mix(in srgb, #ef4444 24%, transparent)`},$c={offline:`offline`,connecting:`connecting`,live:`live`,stalled:`leader busy`,reconnecting:`reconnecting`,error:`connection error`},el={npx:`terminal`,sliccstart:`monitor`,extension:`blocks`,standalone:`monitor`,cherry:`frame`,electron:`laptop`,hosted:`cloud`},tl={npx:`npx`,sliccstart:`sliccstart`,extension:`extension`,standalone:`standalone`,cherry:`cherry`,electron:`electron`,hosted:`hosted`},nl={leader:`crown`,follower:`radio`},rl={none:`local`,leader:`leading tray`,follower:`following tray`};function il(e){return el[e]}function al(e){return tl[e]}function ol(e){return Zc[e]}function sl(e){return Qc[e]}function cl(e){return $c[e]}function ll(e){return e===`none`?null:nl[e]}function ul(e){return rl[e]}function dl(e){return e===`connecting`||e===`reconnecting`}function fl(){return{connection:`offline`,floatKind:`standalone`,trayRole:`none`}}function pl(e){return[al(e.floatKind),ul(e.trayRole),cl(e.connection)].join(` · `)}var ml=R(`
4254
4254
  :host {
4255
4255
  display: inline-grid;
4256
4256
  place-items: center;
@@ -4297,7 +4297,7 @@ ${jc}`,Lc=`slicc-layout-style`;function Rc(e){if(e.getElementById(Lc))return;let
4297
4297
  object-fit: cover;
4298
4298
  display: block;
4299
4299
  }
4300
- `),ml=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=[pl],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():gl(this.name)||`?`}async gravatarUrl(e=this.email){let t=e?.trim().toLowerCase();return t?`https://www.gravatar.com/avatar/${await hl(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=[L(`span`,{class:`ini`,part:`initials`},r)];if(t){let n=L(`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=L(`div`,{class:`me`,part:`avatar`},L(`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 hl(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 gl(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()}I(`slicc-avatar`,ml);var _l=R(`
4300
+ `),hl=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=[ml],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():_l(this.name)||`?`}async gravatarUrl(e=this.email){let t=e?.trim().toLowerCase();return t?`https://www.gravatar.com/avatar/${await gl(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=[L(`span`,{class:`ini`,part:`initials`},r)];if(t){let n=L(`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=L(`div`,{class:`me`,part:`avatar`},L(`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 gl(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 _l(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()}I(`slicc-avatar`,hl);var vl=R(`
4301
4301
  :host{display:inline-flex;vertical-align:baseline;max-width:100%;}
4302
4302
  :host([hidden]){display:none;}
4303
4303
  button{
@@ -4325,7 +4325,7 @@ button:active{background:color-mix(in srgb,currentColor 26%,transparent);}
4325
4325
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
4326
4326
  font-variant-numeric:tabular-nums;
4327
4327
  }
4328
- `),vl=`file`;I(`slicc-blob-chip`,class extends HTMLElement{static observedAttributes=[`label`,`icon`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[_l]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get label(){return this.getAttribute(`label`)??``}set label(e){this.setAttribute(`label`,e)}get icon(){return this.getAttribute(`icon`)??vl}set icon(e){this.setAttribute(`icon`,e)}#t(){let e=L(`button`,{class:`chip`,part:`chip`});e.type=`button`,e.append(i(this.icon,{size:13,class:`icon`,part:`icon`}),L(`span`,{class:`label`,part:`label`},this.label)),this.#e.replaceChildren(e)}});var yl=5,bl=1;function xl(e){return e.replace(`claude-`,``)}function Sl(e){return e==null||e===0?``:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function Cl(e){if(e.length<=yl)return{individuals:e,buckets:[]};let t=[...e].sort((e,t)=>t.cost-e.cost),n=t.slice(0,yl),r=[],i={count:0,cost:0};for(let e of t.slice(yl))i.count+=1,i.cost+=e.cost,i.cost>=bl&&(r.push(i),i={count:0,cost:0});if(i.count>0){let e=r.at(-1);e?(e.count+=i.count,e.cost+=i.cost):r.push(i)}return{individuals:n,buckets:r}}var wl=R(`
4328
+ `),yl=`file`;I(`slicc-blob-chip`,class extends HTMLElement{static observedAttributes=[`label`,`icon`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[vl]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get label(){return this.getAttribute(`label`)??``}set label(e){this.setAttribute(`label`,e)}get icon(){return this.getAttribute(`icon`)??yl}set icon(e){this.setAttribute(`icon`,e)}#t(){let e=L(`button`,{class:`chip`,part:`chip`});e.type=`button`,e.append(i(this.icon,{size:13,class:`icon`,part:`icon`}),L(`span`,{class:`label`,part:`label`},this.label)),this.#e.replaceChildren(e)}});var bl=5,xl=1;function Sl(e){return e.replace(`claude-`,``)}function Cl(e){return e==null||e===0?``:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function wl(e){if(e.length<=bl)return{individuals:e,buckets:[]};let t=[...e].sort((e,t)=>t.cost-e.cost),n=t.slice(0,bl),r=[],i={count:0,cost:0};for(let e of t.slice(bl))i.count+=1,i.cost+=e.cost,i.cost>=xl&&(r.push(i),i={count:0,cost:0});if(i.count>0){let e=r.at(-1);e?(e.count+=i.count,e.cost+=i.cost):r.push(i)}return{individuals:n,buckets:r}}var Tl=R(`
4329
4329
  :host {
4330
4330
  position: absolute;
4331
4331
  top: calc(100% + 8px);
@@ -4514,7 +4514,7 @@ button:active{background:color-mix(in srgb,currentColor 26%,transparent);}
4514
4514
  font-variant-numeric: tabular-nums;
4515
4515
  color: var(--ink);
4516
4516
  }
4517
- `);I(`slicc-cost-overlay`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=[];#r=null;#i=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[wl]}connectedCallback(){this.#o()}attributeChangedCallback(){this.isConnected&&this.#o()}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.#o()}get scoops(){return this.#n}set scoops(e){this.#n=e,this.isConnected&&this.#o()}get total(){return this.#r}set total(e){this.#r=e!=null&&Number.isFinite(e)?e:null,this.isConnected&&this.#o()}get budget(){return this.#i}set budget(e){this.#i=e&&Number.isFinite(e.percent)?e:null,this.isConnected&&this.#o()}#a(e){let t=Uc(e),n=Yc(t),r=e.status===`rate-limited`;return L(`div`,{class:`section budget`,part:`budget`,"data-budget-level":t,"data-budget-status":e.status??`ok`,style:`--budget-hue:${n}`},L(`div`,{class:`section-title`},qc(e).toUpperCase()),L(`div`,{class:`budget-head`},L(`span`,{class:`budget-figure`},Kc(e.percent)),L(`span`,{class:`budget-used`},`used`)),L(`span`,{class:`budget-meter`},L(`span`,{class:`budget-meter__fill`,style:`width:${(Wc(e.percent)*100).toFixed(1)}%`})),L(`div`,{class:`budget-foot`},L(`span`,{class:`budget-resets`},e.resets??``),r?L(`span`,{class:`budget-flag`},i(`octagon-alert`,{size:11}),`rate-limited`):!1))}#o(){let e=[];if(this.#i&&e.push(this.#a(this.#i)),this.#t.length>0){let t=this.#t.map(e=>{let t=Sl(e.tokens);return L(`div`,{class:`model-row`},L(`span`,{class:`model-name`},xl(e.model)),t?L(`span`,{class:`model-tokens`},t):!1,L(`span`,{class:`model-cost`},`$${e.cost.toFixed(2)}`))});e.push(L(`div`,{class:`section section--models`},L(`div`,{class:`section-title`},`BY MODEL`),...t))}if(this.#n.length>0){let t=Cl(this.#n),n=t.individuals.map(e=>L(`div`,{class:`scoop-row`},L(`span`,{class:`scoop-name`},e.name),L(`span`,{class:`scoop-cost`},`$${e.cost.toFixed(2)}`))),r=t.buckets.map(e=>L(`div`,{class:`bucket-row`,part:`bucket`},`${e.count} ${e.count===1?`agent`:`agents`} · $${e.cost.toFixed(2)}`));e.push(L(`div`,{class:`section section--scoops`},L(`div`,{class:`section-title`},`BY AGENT`),...n,...r))}let t=this.#r??this.#t.reduce((e,t)=>e+t.cost,0);e.push(L(`div`,{class:`total-row`},L(`span`,{class:`total-label`},this.#i?`This session`:`Total`),L(`span`,{class:`total-cost`},`$${t.toFixed(2)}`)));let n=L(`div`,{class:`card`},...e);this.#e.replaceChildren(n)}});var Tl=R(`
4517
+ `);I(`slicc-cost-overlay`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=[];#r=null;#i=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Tl]}connectedCallback(){this.#o()}attributeChangedCallback(){this.isConnected&&this.#o()}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.#o()}get scoops(){return this.#n}set scoops(e){this.#n=e,this.isConnected&&this.#o()}get total(){return this.#r}set total(e){this.#r=e!=null&&Number.isFinite(e)?e:null,this.isConnected&&this.#o()}get budget(){return this.#i}set budget(e){this.#i=e&&Number.isFinite(e.percent)?e:null,this.isConnected&&this.#o()}#a(e){let t=Wc(e),n=Xc(t),r=e.status===`rate-limited`;return L(`div`,{class:`section budget`,part:`budget`,"data-budget-level":t,"data-budget-status":e.status??`ok`,style:`--budget-hue:${n}`},L(`div`,{class:`section-title`},Jc(e).toUpperCase()),L(`div`,{class:`budget-head`},L(`span`,{class:`budget-figure`},qc(e.percent)),L(`span`,{class:`budget-used`},`used`)),L(`span`,{class:`budget-meter`},L(`span`,{class:`budget-meter__fill`,style:`width:${(Gc(e.percent)*100).toFixed(1)}%`})),L(`div`,{class:`budget-foot`},L(`span`,{class:`budget-resets`},e.resets??``),r?L(`span`,{class:`budget-flag`},i(`octagon-alert`,{size:11}),`rate-limited`):!1))}#o(){let e=[];if(this.#i&&e.push(this.#a(this.#i)),this.#t.length>0){let t=this.#t.map(e=>{let t=Cl(e.tokens);return L(`div`,{class:`model-row`},L(`span`,{class:`model-name`},Sl(e.model)),t?L(`span`,{class:`model-tokens`},t):!1,L(`span`,{class:`model-cost`},`$${e.cost.toFixed(2)}`))});e.push(L(`div`,{class:`section section--models`},L(`div`,{class:`section-title`},`BY MODEL`),...t))}if(this.#n.length>0){let t=wl(this.#n),n=t.individuals.map(e=>L(`div`,{class:`scoop-row`},L(`span`,{class:`scoop-name`},e.name),L(`span`,{class:`scoop-cost`},`$${e.cost.toFixed(2)}`))),r=t.buckets.map(e=>L(`div`,{class:`bucket-row`,part:`bucket`},`${e.count} ${e.count===1?`agent`:`agents`} · $${e.cost.toFixed(2)}`));e.push(L(`div`,{class:`section section--scoops`},L(`div`,{class:`section-title`},`BY AGENT`),...n,...r))}let t=this.#r??this.#t.reduce((e,t)=>e+t.cost,0);e.push(L(`div`,{class:`total-row`},L(`span`,{class:`total-label`},this.#i?`This session`:`Total`),L(`span`,{class:`total-cost`},`$${t.toFixed(2)}`)));let n=L(`div`,{class:`card`},...e);this.#e.replaceChildren(n)}});var El=R(`
4518
4518
  :host {
4519
4519
  display: flex;
4520
4520
  align-items: center;
@@ -4543,7 +4543,7 @@ button:active{background:color-mix(in srgb,currentColor 26%,transparent);}
4543
4543
  min-width: 0;
4544
4544
  background: var(--line, #e5e5e5);
4545
4545
  }
4546
- `);I(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Tl]}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??L(`slot`);this.#e.replaceChildren(L(`span`,{class:`label`,part:`label`},e))}});var El=R(`
4546
+ `);I(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[El]}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??L(`slot`);this.#e.replaceChildren(L(`span`,{class:`label`,part:`label`},e))}});var Dl=R(`
4547
4547
  :host {
4548
4548
  position: absolute;
4549
4549
  top: calc(100% + 8px);
@@ -4661,7 +4661,7 @@ button:active{background:color-mix(in srgb,currentColor 26%,transparent);}
4661
4661
  color: var(--txt-2);
4662
4662
  font-size: 11px;
4663
4663
  }
4664
- `);I(`slicc-follower-hud`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[El]}connectedCallback(){this.#r()}attributeChangedCallback(){this.isConnected&&this.#r()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get rows(){return this.#t}set rows(e){this.#t=e,this.isConnected&&this.#r()}get hint(){return this.#n}set hint(e){this.#n=e&&e.trim()!==``?e:null,this.isConnected&&this.#r()}#r(){let e=this.#t.length,t=[];if(e===0)t.push(L(`div`,{class:`empty`},`No followers connected.`));else{let n=this.#t.map(e=>L(`div`,{class:`row`,part:`row`},i(e.icon,{size:14}),L(`div`,{class:`row-main`},L(`span`,{class:`row-title`},e.title),e.detail?L(`span`,{class:`row-detail`},e.detail):!1,e.chips&&e.chips.length>0?L(`div`,{class:`chips`},...e.chips.map(e=>L(`span`,{class:`chip`},e))):!1),L(`div`,{class:`row-state`},L(`span`,{class:`sdot`,"data-state":e.state}),e.stateText)));t.push(L(`div`,{class:`section`},L(`div`,{class:`section-title`},`${e} ${e===1?`follower`:`followers`}`),...n))}this.#n&&t.push(L(`div`,{class:`hint`},this.#n)),this.#e.replaceChildren(L(`div`,{class:`card`,part:`card`},...t))}});var Dl=`CLI float`;function Ol(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:null}function kl(e){let t=Ol(e);return t==null?null:`$${t.toFixed(2)}`}function Al(e){return`${kl(e)??`$0.00`}/h`}var jl=720,Ml=R(`
4664
+ `);I(`slicc-follower-hud`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Dl]}connectedCallback(){this.#r()}attributeChangedCallback(){this.isConnected&&this.#r()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get rows(){return this.#t}set rows(e){this.#t=e,this.isConnected&&this.#r()}get hint(){return this.#n}set hint(e){this.#n=e&&e.trim()!==``?e:null,this.isConnected&&this.#r()}#r(){let e=this.#t.length,t=[];if(e===0)t.push(L(`div`,{class:`empty`},`No followers connected.`));else{let n=this.#t.map(e=>L(`div`,{class:`row`,part:`row`},i(e.icon,{size:14}),L(`div`,{class:`row-main`},L(`span`,{class:`row-title`},e.title),e.detail?L(`span`,{class:`row-detail`},e.detail):!1,e.chips&&e.chips.length>0?L(`div`,{class:`chips`},...e.chips.map(e=>L(`span`,{class:`chip`},e))):!1),L(`div`,{class:`row-state`},L(`span`,{class:`sdot`,"data-state":e.state}),e.stateText)));t.push(L(`div`,{class:`section`},L(`div`,{class:`section-title`},`${e} ${e===1?`follower`:`followers`}`),...n))}this.#n&&t.push(L(`div`,{class:`hint`},this.#n)),this.#e.replaceChildren(L(`div`,{class:`card`,part:`card`},...t))}});var Ol=`CLI float`;function kl(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:null}function Al(e){let t=kl(e);return t==null?null:`$${t.toFixed(2)}`}function jl(e){return`${Al(e)??`$0.00`}/h`}var Ml=720,Nl=R(`
4665
4665
  :host {
4666
4666
  position: relative;
4667
4667
  display: inline-flex;
@@ -4881,7 +4881,7 @@ button:active{background:color-mix(in srgb,currentColor 26%,transparent);}
4881
4881
  .tip { transition: none; }
4882
4882
  .beacon[data-pulse] .beacon__ring { animation: none; }
4883
4883
  }
4884
- `);I(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`connection`,`float-kind`,`tray-role`,`rate`,`spent`,`budget-percent`,`budget-status`,`budget-window`,`budget-resets`];#e;#t=null;#n=null;#r=[];#i=[];#a;#o=[];#s=null;#c;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ml]}connectedCallback(){this.#p();let e=this.closest(`slicc-nav`);e&&typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#f()),this.#t.observe(e))}disconnectedCallback(){this.#t?.disconnect(),this.#t=null,clearTimeout(this.#a),clearTimeout(this.#c)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.#p()}get label(){return this.getAttribute(`label`)??Dl}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 connection(){let e=this.getAttribute(`connection`);return e===`connecting`||e===`live`||e===`stalled`||e===`reconnecting`||e===`error`?e:`offline`}set connection(e){e==null?this.removeAttribute(`connection`):this.setAttribute(`connection`,e)}get floatKind(){let e=this.getAttribute(`float-kind`);return e===`npx`||e===`sliccstart`||e===`extension`||e===`standalone`||e===`cherry`||e===`electron`||e===`hosted`?e:dl().floatKind}set floatKind(e){e==null?this.removeAttribute(`float-kind`):this.setAttribute(`float-kind`,e)}get trayRole(){let e=this.getAttribute(`tray-role`);return e===`leader`||e===`follower`?e:`none`}set trayRole(e){e==null||e===`none`?this.removeAttribute(`tray-role`):this.setAttribute(`tray-role`,e)}get status(){return{connection:this.connection,floatKind:this.floatKind,trayRole:this.trayRole}}set status(e){this.connection=e.connection,this.floatKind=e.floatKind,this.trayRole=e.trayRole}get spent(){return this.getAttribute(`spent`)}set spent(e){e==null?this.removeAttribute(`spent`):this.setAttribute(`spent`,String(e))}get rate(){return this.getAttribute(`rate`)}set rate(e){e==null?this.removeAttribute(`rate`):this.setAttribute(`rate`,String(e))}get budgetPercent(){let e=this.getAttribute(`budget-percent`);if(e==null||e.trim()===``)return null;let t=Number.parseFloat(e.replace(/%$/,``));return Number.isFinite(t)?t:null}set budgetPercent(e){e==null?this.removeAttribute(`budget-percent`):this.setAttribute(`budget-percent`,String(e))}get budgetStatus(){return this.getAttribute(`budget-status`)===`rate-limited`?`rate-limited`:`ok`}set budgetStatus(e){e==null||e===`ok`?this.removeAttribute(`budget-status`):this.setAttribute(`budget-status`,e)}get budgetWindow(){return this.getAttribute(`budget-window`)}set budgetWindow(e){e==null?this.removeAttribute(`budget-window`):this.setAttribute(`budget-window`,e)}get budgetResets(){return this.getAttribute(`budget-resets`)}set budgetResets(e){e==null?this.removeAttribute(`budget-resets`):this.setAttribute(`budget-resets`,e)}get budget(){let e=this.budgetPercent;if(e==null)return null;let t={percent:e,status:this.budgetStatus},n=this.budgetWindow;n&&(t.window=n);let r=this.budgetResets;return r&&(t.resets=r),t}set budget(e){this.budgetPercent=e?e.percent:null,this.budgetStatus=e?.status??null,this.budgetWindow=e?.window??null,this.budgetResets=e?.resets??null}get costModels(){return this.#r}set costModels(e){this.#r=e,this.#n&&(this.#n.models=e)}get followers(){return this.#o}set followers(e){this.#o=e,e.length>0?this.setAttribute(`follower-count`,String(e.length)):this.removeAttribute(`follower-count`),this.isConnected?this.#p():this.#s&&(this.#s.rows=e)}get costScoops(){return this.#i}set costScoops(e){this.#i=e,this.#n&&(this.#n.scoops=e)}#l(){let e=[this.label,fl(this.status)],t=this.#o.length;t>0&&e.push(`${t} ${t===1?`follower`:`followers`}`);let n=this.budget;if(n){e.push(...Jc(n));let t=kl(this.spent);t&&e.push(`${t} this session`)}else e.push(Al(this.rate)),e.push(`recency-weighted session avg`);return e.join(` · `)}#u(e){let t=Uc(e),n=e.status===`rate-limited`?`octagon-alert`:`gauge`;return L(`span`,{class:`spent spent--budget`,part:`spent rate budget`,"data-budget-level":t,"data-budget-status":e.status??`ok`,"aria-label":Jc(e).join(` · `)},i(n,{size:12}),L(`span`,{class:`amount`},Kc(e.percent)))}#d(e){let{connection:t,floatKind:n,trayRole:r}=e,a=L(`span`,{class:`beacon__ring`,part:`beacon-ring`,style:`--beacon-fill:${al(t)};--beacon-glow:${ol(t)}`}),o=L(`span`,{class:`beacon__icon`,part:`beacon-icon`},i(rl(n),{size:9,strokeWidth:2.25})),s={class:`beacon`,part:`beacon dot`,"data-connection":t,"data-float-kind":n,"aria-label":fl({connection:t,floatKind:n,trayRole:r})};r!==`none`&&(s[`data-tray-role`]=r),ul(t)&&(s[`data-pulse`]=``);let c=[a,o],l=cl(r);return l&&c.push(L(`span`,{class:`beacon__role`,part:`beacon-role`,"aria-hidden":`true`},i(l,{size:5,strokeWidth:2.5}))),L(`span`,s,...c)}#f(){let e=this.closest(`slicc-nav`),t=e?getComputedStyle(e):null;(e?e.clientWidth-Number.parseFloat(t?.paddingLeft??`0`)-Number.parseFloat(t?.paddingRight??`0`):1/0)<=jl?this.setAttribute(`title`,this.#l()):this.removeAttribute(`title`)}#p(){let e=[];e.push(this.#d(this.status));let[t,...n]=this.label.split(` · `),r=[L(`span`,{class:`runtime`},t)];n.length>0&&r.push(L(`span`,{class:`detail`},` · ${n.join(` · `)}`)),e.push(L(`span`,{class:`label`,part:`label`},L(`slot`,null,...r))),this.#o.length>0&&(e.push(L(`span`,{class:`sep sep--followers`,part:`sep`})),e.push(this.#m(this.#o.length))),e.push(L(`span`,{class:`sep sep--spent`,part:`sep`}));let a=this.budget,o=a?this.#u(a):L(`span`,{class:`spent`,part:`spent rate`},i(`circle-dollar-sign`,{size:12}),L(`span`,{class:`amount`},Al(this.rate)));o.addEventListener(`mouseenter`,()=>this.#v()),o.addEventListener(`mouseleave`,()=>this.#y()),e.push(o),e.push(L(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},this.#l()));let s=this.#s?.hasAttribute(`open`)&&this.#o.length>0?this.#s:null;this.#n=null,this.#s=s,this.#e.replaceChildren(...e),s&&(s.rows=this.#o,this.#e.appendChild(s)),this.#f()}#m(e){let t=L(`button`,{class:`followers`,part:`followers`,type:`button`,"aria-haspopup":`dialog`,"aria-label":`${`${e} ${e===1?`follower`:`followers`}`} connected — open session sharing`},i(`users`,{size:12}),L(`span`,{class:`follower-count`},String(e)));return t.addEventListener(`mouseenter`,()=>this.#h()),t.addEventListener(`mouseleave`,()=>this.#g()),t.addEventListener(`focus`,()=>this.#h()),t.addEventListener(`blur`,()=>this.#g()),t.addEventListener(`keydown`,e=>{e.key===`Escape`&&this.#_()}),t.addEventListener(`click`,()=>{this.#_(),this.dispatchEvent(new CustomEvent(`slicc-followers-click`,{bubbles:!0,composed:!0}))}),t}#h(){if(clearTimeout(this.#c),!this.#s){let e=document.createElement(`slicc-follower-hud`);e.rows=this.#o,e.hint=`Click for sharing options.`,e.addEventListener(`mouseenter`,()=>this.#h()),e.addEventListener(`mouseleave`,()=>this.#g()),this.#e.appendChild(e),this.#s=e}this.#s.toggleAttribute(`open`,!0)}#g(){this.#c=setTimeout(()=>this.#_(),150)}#_(){clearTimeout(this.#c),this.#s?.removeAttribute(`open`)}#v(){if(clearTimeout(this.#a),!this.#n){let e=document.createElement(`slicc-cost-overlay`);e.models=this.#r,e.scoops=this.#i,e.total=Ol(this.spent),e.budget=this.budget,e.addEventListener(`mouseenter`,()=>this.#v()),e.addEventListener(`mouseleave`,()=>this.#y()),this.#e.appendChild(e),this.#n=e}this.#n.toggleAttribute(`open`,!0)}#y(){this.#a=setTimeout(()=>{this.#n&&this.#n.removeAttribute(`open`)},150)}});var Nl=R(`
4884
+ `);I(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`connection`,`float-kind`,`tray-role`,`rate`,`spent`,`budget-percent`,`budget-status`,`budget-window`,`budget-resets`];#e;#t=null;#n=null;#r=[];#i=[];#a;#o=[];#s=null;#c;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Nl]}connectedCallback(){this.#p();let e=this.closest(`slicc-nav`);e&&typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#f()),this.#t.observe(e))}disconnectedCallback(){this.#t?.disconnect(),this.#t=null,clearTimeout(this.#a),clearTimeout(this.#c)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.#p()}get label(){return this.getAttribute(`label`)??Ol}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 connection(){let e=this.getAttribute(`connection`);return e===`connecting`||e===`live`||e===`stalled`||e===`reconnecting`||e===`error`?e:`offline`}set connection(e){e==null?this.removeAttribute(`connection`):this.setAttribute(`connection`,e)}get floatKind(){let e=this.getAttribute(`float-kind`);return e===`npx`||e===`sliccstart`||e===`extension`||e===`standalone`||e===`cherry`||e===`electron`||e===`hosted`?e:fl().floatKind}set floatKind(e){e==null?this.removeAttribute(`float-kind`):this.setAttribute(`float-kind`,e)}get trayRole(){let e=this.getAttribute(`tray-role`);return e===`leader`||e===`follower`?e:`none`}set trayRole(e){e==null||e===`none`?this.removeAttribute(`tray-role`):this.setAttribute(`tray-role`,e)}get status(){return{connection:this.connection,floatKind:this.floatKind,trayRole:this.trayRole}}set status(e){this.connection=e.connection,this.floatKind=e.floatKind,this.trayRole=e.trayRole}get spent(){return this.getAttribute(`spent`)}set spent(e){e==null?this.removeAttribute(`spent`):this.setAttribute(`spent`,String(e))}get rate(){return this.getAttribute(`rate`)}set rate(e){e==null?this.removeAttribute(`rate`):this.setAttribute(`rate`,String(e))}get budgetPercent(){let e=this.getAttribute(`budget-percent`);if(e==null||e.trim()===``)return null;let t=Number.parseFloat(e.replace(/%$/,``));return Number.isFinite(t)?t:null}set budgetPercent(e){e==null?this.removeAttribute(`budget-percent`):this.setAttribute(`budget-percent`,String(e))}get budgetStatus(){return this.getAttribute(`budget-status`)===`rate-limited`?`rate-limited`:`ok`}set budgetStatus(e){e==null||e===`ok`?this.removeAttribute(`budget-status`):this.setAttribute(`budget-status`,e)}get budgetWindow(){return this.getAttribute(`budget-window`)}set budgetWindow(e){e==null?this.removeAttribute(`budget-window`):this.setAttribute(`budget-window`,e)}get budgetResets(){return this.getAttribute(`budget-resets`)}set budgetResets(e){e==null?this.removeAttribute(`budget-resets`):this.setAttribute(`budget-resets`,e)}get budget(){let e=this.budgetPercent;if(e==null)return null;let t={percent:e,status:this.budgetStatus},n=this.budgetWindow;n&&(t.window=n);let r=this.budgetResets;return r&&(t.resets=r),t}set budget(e){this.budgetPercent=e?e.percent:null,this.budgetStatus=e?.status??null,this.budgetWindow=e?.window??null,this.budgetResets=e?.resets??null}get costModels(){return this.#r}set costModels(e){this.#r=e,this.#n&&(this.#n.models=e)}get followers(){return this.#o}set followers(e){this.#o=e,e.length>0?this.setAttribute(`follower-count`,String(e.length)):this.removeAttribute(`follower-count`),this.isConnected?this.#p():this.#s&&(this.#s.rows=e)}get costScoops(){return this.#i}set costScoops(e){this.#i=e,this.#n&&(this.#n.scoops=e)}#l(){let e=[this.label,pl(this.status)],t=this.#o.length;t>0&&e.push(`${t} ${t===1?`follower`:`followers`}`);let n=this.budget;if(n){e.push(...Yc(n));let t=Al(this.spent);t&&e.push(`${t} this session`)}else e.push(jl(this.rate)),e.push(`recency-weighted session avg`);return e.join(` · `)}#u(e){let t=Wc(e),n=e.status===`rate-limited`?`octagon-alert`:`gauge`;return L(`span`,{class:`spent spent--budget`,part:`spent rate budget`,"data-budget-level":t,"data-budget-status":e.status??`ok`,"aria-label":Yc(e).join(` · `)},i(n,{size:12}),L(`span`,{class:`amount`},qc(e.percent)))}#d(e){let{connection:t,floatKind:n,trayRole:r}=e,a=L(`span`,{class:`beacon__ring`,part:`beacon-ring`,style:`--beacon-fill:${ol(t)};--beacon-glow:${sl(t)}`}),o=L(`span`,{class:`beacon__icon`,part:`beacon-icon`},i(il(n),{size:9,strokeWidth:2.25})),s={class:`beacon`,part:`beacon dot`,"data-connection":t,"data-float-kind":n,"aria-label":pl({connection:t,floatKind:n,trayRole:r})};r!==`none`&&(s[`data-tray-role`]=r),dl(t)&&(s[`data-pulse`]=``);let c=[a,o],l=ll(r);return l&&c.push(L(`span`,{class:`beacon__role`,part:`beacon-role`,"aria-hidden":`true`},i(l,{size:5,strokeWidth:2.5}))),L(`span`,s,...c)}#f(){let e=this.closest(`slicc-nav`),t=e?getComputedStyle(e):null;(e?e.clientWidth-Number.parseFloat(t?.paddingLeft??`0`)-Number.parseFloat(t?.paddingRight??`0`):1/0)<=Ml?this.setAttribute(`title`,this.#l()):this.removeAttribute(`title`)}#p(){let e=[];e.push(this.#d(this.status));let[t,...n]=this.label.split(` · `),r=[L(`span`,{class:`runtime`},t)];n.length>0&&r.push(L(`span`,{class:`detail`},` · ${n.join(` · `)}`)),e.push(L(`span`,{class:`label`,part:`label`},L(`slot`,null,...r))),this.#o.length>0&&(e.push(L(`span`,{class:`sep sep--followers`,part:`sep`})),e.push(this.#m(this.#o.length))),e.push(L(`span`,{class:`sep sep--spent`,part:`sep`}));let a=this.budget,o=a?this.#u(a):L(`span`,{class:`spent`,part:`spent rate`},i(`circle-dollar-sign`,{size:12}),L(`span`,{class:`amount`},jl(this.rate)));o.addEventListener(`mouseenter`,()=>this.#v()),o.addEventListener(`mouseleave`,()=>this.#y()),e.push(o),e.push(L(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},this.#l()));let s=this.#s?.hasAttribute(`open`)&&this.#o.length>0?this.#s:null;this.#n=null,this.#s=s,this.#e.replaceChildren(...e),s&&(s.rows=this.#o,this.#e.appendChild(s)),this.#f()}#m(e){let t=L(`button`,{class:`followers`,part:`followers`,type:`button`,"aria-haspopup":`dialog`,"aria-label":`${`${e} ${e===1?`follower`:`followers`}`} connected — open session sharing`},i(`users`,{size:12}),L(`span`,{class:`follower-count`},String(e)));return t.addEventListener(`mouseenter`,()=>this.#h()),t.addEventListener(`mouseleave`,()=>this.#g()),t.addEventListener(`focus`,()=>this.#h()),t.addEventListener(`blur`,()=>this.#g()),t.addEventListener(`keydown`,e=>{e.key===`Escape`&&this.#_()}),t.addEventListener(`click`,()=>{this.#_(),this.dispatchEvent(new CustomEvent(`slicc-followers-click`,{bubbles:!0,composed:!0}))}),t}#h(){if(clearTimeout(this.#c),!this.#s){let e=document.createElement(`slicc-follower-hud`);e.rows=this.#o,e.hint=`Click for sharing options.`,e.addEventListener(`mouseenter`,()=>this.#h()),e.addEventListener(`mouseleave`,()=>this.#g()),this.#e.appendChild(e),this.#s=e}this.#s.toggleAttribute(`open`,!0)}#g(){this.#c=setTimeout(()=>this.#_(),150)}#_(){clearTimeout(this.#c),this.#s?.removeAttribute(`open`)}#v(){if(clearTimeout(this.#a),!this.#n){let e=document.createElement(`slicc-cost-overlay`);e.models=this.#r,e.scoops=this.#i,e.total=kl(this.spent),e.budget=this.budget,e.addEventListener(`mouseenter`,()=>this.#v()),e.addEventListener(`mouseleave`,()=>this.#y()),this.#e.appendChild(e),this.#n=e}this.#n.toggleAttribute(`open`,!0)}#y(){this.#a=setTimeout(()=>{this.#n&&this.#n.removeAttribute(`open`)},150)}});var Pl=R(`
4885
4885
  :host { display: inline-grid; }
4886
4886
  :host([hidden]) { display: none; }
4887
4887
  .iconbtn {
@@ -4910,7 +4910,7 @@ button:active{background:color-mix(in srgb,currentColor 26%,transparent);}
4910
4910
  .iconbtn:disabled:hover { background: var(--canvas); color: var(--txt-2); }
4911
4911
  .icon { display: grid; place-items: center; pointer-events: none; }
4912
4912
  .icon svg { display: block; }
4913
- `),Pl=`plus`,Fl=16;I(`slicc-icon-button`,class extends HTMLElement{static observedAttributes=[`icon`,`disabled`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Nl]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get icon(){return this.getAttribute(`icon`)??Pl}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=L(`slot`,null,L(`span`,{class:`icon`},i(this.icon,{size:Fl,part:`icon`}))),n=L(`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 Il=new Set([`chiclet`,`deck`,`holo`]),Ll=new Set([`top-end`,`top-start`,`bottom-end`,`bottom-start`,`end`,`start`]),z=`slicc-keycap`,Rl=R(`
4913
+ `),Fl=`plus`,Il=16;I(`slicc-icon-button`,class extends HTMLElement{static observedAttributes=[`icon`,`disabled`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Pl]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get icon(){return this.getAttribute(`icon`)??Fl}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=L(`slot`,null,L(`span`,{class:`icon`},i(this.icon,{size:Il,part:`icon`}))),n=L(`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 Ll=new Set([`chiclet`,`deck`,`holo`]),Rl=new Set([`top-end`,`top-start`,`bottom-end`,`bottom-start`,`end`,`start`]),z=`slicc-keycap`,zl=R(`
4914
4914
  /*
4915
4915
  * The cap floats OVER its target: it pins to the nearest positioned ancestor,
4916
4916
  * which the host makes the target's own box (dock item, tab, toolbar button)
@@ -5256,7 +5256,7 @@ button:active{background:color-mix(in srgb,currentColor 26%,transparent);}
5256
5256
  40%{transform:rotateY(-2deg) scale(1.09);}
5257
5257
  100%{transform:rotateY(-16deg) scale(1);}
5258
5258
  }
5259
- `);function zl(e){let t=e.trim();return t===``?e===``?[]:[e]:t.split(/\s+/)}I(`slicc-keycap`,class extends HTMLElement{static observedAttributes=[`cap`,`variant`,`placement`,`stagger`];#e;#t=null;#n=null;#r=()=>{this.toggleAttribute(`hot`,!0)};#i=()=>{this.toggleAttribute(`hot`,!1)};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Rl]}connectedCallback(){this.hasAttribute(`aria-hidden`)||this.setAttribute(`aria-hidden`,`true`),this.#s(),this.#a()}disconnectedCallback(){this.#o(),this.removeAttribute(`hot`)}attributeChangedCallback(){this.isConnected&&this.#s()}#a(){let e=this.#n??this.parentElement;!e||e===this.#t||(this.#o(),this.#t=e,e.addEventListener(`pointerenter`,this.#r),e.addEventListener(`pointerleave`,this.#i))}#o(){this.#t?.removeEventListener(`pointerenter`,this.#r),this.#t?.removeEventListener(`pointerleave`,this.#i),this.#t=null}get cap(){return this.getAttribute(`cap`)??``}set cap(e){this.setAttribute(`cap`,e)}get variant(){let e=this.getAttribute(`variant`);return e&&Il.has(e)?e:`chiclet`}set variant(e){this.setAttribute(`variant`,e)}get placement(){let e=this.getAttribute(`placement`);return e&&Ll.has(e)?e:`top-end`}set placement(e){this.setAttribute(`placement`,e)}get dim(){return this.hasAttribute(`dim`)}set dim(e){this.toggleAttribute(`dim`,e)}get anchor(){return this.#n}set anchor(e){e!==this.#n&&(this.#n=e,this.#o(),this.removeAttribute(`hot`),this.isConnected&&this.#a())}#s(){let e=Number.parseInt(this.getAttribute(`stagger`)??``,10);this.style.setProperty(`--i`,String(Number.isFinite(e)?e:0));let t=L(`span`,{class:`cap`,part:`cap`});for(let e of zl(this.cap)){let n=L(`kbd`,{class:`key`,part:`key`}),r=wa[e];r&&a(r)?n.append(i(r,{size:12,strokeWidth:2.4})):n.textContent=e,t.append(n)}this.#e.replaceChildren(t)}});var Bl=`
5259
+ `);function Bl(e){let t=e.trim();return t===``?e===``?[]:[e]:t.split(/\s+/)}I(`slicc-keycap`,class extends HTMLElement{static observedAttributes=[`cap`,`variant`,`placement`,`stagger`];#e;#t=null;#n=null;#r=()=>{this.toggleAttribute(`hot`,!0)};#i=()=>{this.toggleAttribute(`hot`,!1)};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[zl]}connectedCallback(){this.hasAttribute(`aria-hidden`)||this.setAttribute(`aria-hidden`,`true`),this.#s(),this.#a()}disconnectedCallback(){this.#o(),this.removeAttribute(`hot`)}attributeChangedCallback(){this.isConnected&&this.#s()}#a(){let e=this.#n??this.parentElement;!e||e===this.#t||(this.#o(),this.#t=e,e.addEventListener(`pointerenter`,this.#r),e.addEventListener(`pointerleave`,this.#i))}#o(){this.#t?.removeEventListener(`pointerenter`,this.#r),this.#t?.removeEventListener(`pointerleave`,this.#i),this.#t=null}get cap(){return this.getAttribute(`cap`)??``}set cap(e){this.setAttribute(`cap`,e)}get variant(){let e=this.getAttribute(`variant`);return e&&Ll.has(e)?e:`chiclet`}set variant(e){this.setAttribute(`variant`,e)}get placement(){let e=this.getAttribute(`placement`);return e&&Rl.has(e)?e:`top-end`}set placement(e){this.setAttribute(`placement`,e)}get dim(){return this.hasAttribute(`dim`)}set dim(e){this.toggleAttribute(`dim`,e)}get anchor(){return this.#n}set anchor(e){e!==this.#n&&(this.#n=e,this.#o(),this.removeAttribute(`hot`),this.isConnected&&this.#a())}#s(){let e=Number.parseInt(this.getAttribute(`stagger`)??``,10);this.style.setProperty(`--i`,String(Number.isFinite(e)?e:0));let t=L(`span`,{class:`cap`,part:`cap`});for(let e of Bl(this.cap)){let n=L(`kbd`,{class:`key`,part:`key`}),r=Ta[e];r&&a(r)?n.append(i(r,{size:12,strokeWidth:2.4})):n.textContent=e,t.append(n)}this.#e.replaceChildren(t)}});var Vl=`
5260
5260
  slicc-pane {
5261
5261
  display: flex;
5262
5262
  flex-direction: column;
@@ -5295,7 +5295,7 @@ slicc-pane .slicc-pane__body {
5295
5295
  min-height: 0;
5296
5296
  overflow: auto;
5297
5297
  }
5298
- `,Vl=`slicc-pane-style`;function Hl(e){if(e.getElementById(Vl))return;let t=e.createElement(`style`);t.id=Vl,t.textContent=Bl,(e.head??e.documentElement).appendChild(t)}I(`slicc-pane`,class extends HTMLElement{static observedAttributes=[`elevated`];#e;#t;#n=!1;connectedCallback(){Hl(this.ownerDocument),this.#r()}attributeChangedCallback(e,t,n){e===`elevated`&&t!==n&&this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-pane-change`,{bubbles:!0,composed:!0,detail:{elevated:n!==null}}))}get elevated(){return this.hasAttribute(`elevated`)}set elevated(e){e?this.setAttribute(`elevated`,``):this.removeAttribute(`elevated`)}#r(){if(this.#n)return;this.#n=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-pane__surface`))),t=this.ownerDocument.createElement(`div`);t.className=`slicc-pane__surface`,t.setAttribute(`part`,`surface`),this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-pane__header`,this.#e.setAttribute(`part`,`header`),this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`slicc-pane__body`,this.#t.setAttribute(`part`,`body`),t.append(this.#e,this.#t);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`header`?this.#e.appendChild(t):this.#t.appendChild(t);this.appendChild(t)}});var Ul=`
5298
+ `,Hl=`slicc-pane-style`;function Ul(e){if(e.getElementById(Hl))return;let t=e.createElement(`style`);t.id=Hl,t.textContent=Vl,(e.head??e.documentElement).appendChild(t)}I(`slicc-pane`,class extends HTMLElement{static observedAttributes=[`elevated`];#e;#t;#n=!1;connectedCallback(){Ul(this.ownerDocument),this.#r()}attributeChangedCallback(e,t,n){e===`elevated`&&t!==n&&this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-pane-change`,{bubbles:!0,composed:!0,detail:{elevated:n!==null}}))}get elevated(){return this.hasAttribute(`elevated`)}set elevated(e){e?this.setAttribute(`elevated`,``):this.removeAttribute(`elevated`)}#r(){if(this.#n)return;this.#n=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-pane__surface`))),t=this.ownerDocument.createElement(`div`);t.className=`slicc-pane__surface`,t.setAttribute(`part`,`surface`),this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-pane__header`,this.#e.setAttribute(`part`,`header`),this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`slicc-pane__body`,this.#t.setAttribute(`part`,`body`),t.append(this.#e,this.#t);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`header`?this.#e.appendChild(t):this.#t.appendChild(t);this.appendChild(t)}});var Wl=`
5299
5299
  slicc-press-button {
5300
5300
  display: inline-flex;
5301
5301
  }
@@ -5387,7 +5387,7 @@ slicc-press-button {
5387
5387
  animation: none;
5388
5388
  }
5389
5389
  }
5390
- `,Wl=`slicc-press-button-style`;function Gl(e){if(e.getElementById(Wl))return;let t=e.createElement(`style`);t.id=Wl,t.textContent=Ul,(e.head??e.documentElement).appendChild(t)}var Kl=`slicc-press-btn`,ql=`is-squish`,Jl=`is-wobble`;I(`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(){Gl(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=L(`span`,{class:`${Kl}__press-layer`,part:`press-layer`}),t=L(`button`,{type:`button`,class:`${Kl}__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 Fa;let t=Number(e);return Number.isFinite(t)&&t>0?t:Fa}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(ql):e===`double-click`&&this.playAnimation(Jl);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(ql,Jl))}clearPendingShort(){this.pendingShortTimer!==null&&(clearTimeout(this.pendingShortTimer),this.pendingShortTimer=null),this.pendingShortEvent=null}attachGesture(){this.handle=Ia(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=`${Kl}__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 Yl=R(`
5390
+ `,Gl=`slicc-press-button-style`;function Kl(e){if(e.getElementById(Gl))return;let t=e.createElement(`style`);t.id=Gl,t.textContent=Wl,(e.head??e.documentElement).appendChild(t)}var ql=`slicc-press-btn`,Jl=`is-squish`,Yl=`is-wobble`;I(`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(){Kl(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=L(`span`,{class:`${ql}__press-layer`,part:`press-layer`}),t=L(`button`,{type:`button`,class:`${ql}__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 Ia;let t=Number(e);return Number.isFinite(t)&&t>0?t:Ia}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(Jl):e===`double-click`&&this.playAnimation(Yl);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(Jl,Yl))}clearPendingShort(){this.pendingShortTimer!==null&&(clearTimeout(this.pendingShortTimer),this.pendingShortTimer=null),this.pendingShortEvent=null}attachGesture(){this.handle=La(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=`${ql}__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 Xl=R(`
5391
5391
  :host { display: inline-flex; }
5392
5392
  :host([hidden]) { display: none; }
5393
5393
 
@@ -5417,7 +5417,7 @@ slicc-press-button {
5417
5417
  outline: 2px solid var(--violet);
5418
5418
  outline-offset: 2px;
5419
5419
  }
5420
- `);I(`slicc-swatch`,class extends HTMLElement{static observedAttributes=[`color`,`hue`,`selected`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Yl]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get hue(){return this.hasAttribute(`hue`)}set hue(e){this.toggleAttribute(`hue`,!!e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,!!e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.color,t=[`sw`];this.hue&&t.push(`hue`),this.selected&&t.push(`on`);let n=L(`button`,{type:`button`,part:`button`,class:t.join(` `),"aria-pressed":this.selected?`true`:`false`,"aria-label":this.label??e??`color swatch`},L(`slot`));e&&n.style.setProperty(`--swatch-color`,e),n.addEventListener(`click`,this.#n),this.#e.replaceChildren(n)}#n=()=>{this.selected=!0,this.dispatchEvent(new CustomEvent(`select`,{detail:{color:this.color},bubbles:!0,composed:!0}))}});var Xl=new Set([`rose`,`cyan`,`violet`,`amber`,`waffle`,`green`]),Zl=R(`
5420
+ `);I(`slicc-swatch`,class extends HTMLElement{static observedAttributes=[`color`,`hue`,`selected`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Xl]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get hue(){return this.hasAttribute(`hue`)}set hue(e){this.toggleAttribute(`hue`,!!e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,!!e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.color,t=[`sw`];this.hue&&t.push(`hue`),this.selected&&t.push(`on`);let n=L(`button`,{type:`button`,part:`button`,class:t.join(` `),"aria-pressed":this.selected?`true`:`false`,"aria-label":this.label??e??`color swatch`},L(`slot`));e&&n.style.setProperty(`--swatch-color`,e),n.addEventListener(`click`,this.#n),this.#e.replaceChildren(n)}#n=()=>{this.selected=!0,this.dispatchEvent(new CustomEvent(`select`,{detail:{color:this.color},bubbles:!0,composed:!0}))}});var Zl=new Set([`rose`,`cyan`,`violet`,`amber`,`waffle`,`green`]),Ql=R(`
5421
5421
  :host {
5422
5422
  display: inline-flex;
5423
5423
  vertical-align: middle;
@@ -5477,7 +5477,7 @@ slicc-press-button {
5477
5477
  :host-context(.dark)[hue="amber"] .tag, :host-context([data-theme="dark"])[hue="amber"] .tag { background: color-mix(in srgb, var(--amber) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--amber) 38%, var(--line)); }
5478
5478
  :host-context(.dark)[hue="waffle"] .tag, :host-context([data-theme="dark"])[hue="waffle"] .tag { background: color-mix(in srgb, var(--waffle) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--waffle) 38%, var(--line)); }
5479
5479
  :host-context(.dark)[hue="green"] .tag, :host-context([data-theme="dark"])[hue="green"] .tag { background: color-mix(in srgb, var(--green) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--green) 38%, var(--line)); }
5480
- `);I(`slicc-tag`,class extends HTMLElement{static observedAttributes=[`hue`,`label`,`dot`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Zl]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get hue(){let e=this.getAttribute(`hue`);return e&&Xl.has(e)?e:null}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get dot(){return this.hasAttribute(`dot`)}set dot(e){e?this.setAttribute(`dot`,``):this.removeAttribute(`dot`)}#t(){let e=this.label??L(`slot`),t=L(`span`,{class:`tag`,part:`tag`},this.dot?L(`span`,{class:`dot`,part:`dot`}):null,L(`span`,{class:`label`,part:`label`},e));this.#e.replaceChildren(t)}});var Ql=`binary`;function $l(e){let t=e.split(`;`,1)[0]?.trim()??e;return t===`application/octet-stream`||t.length===0?Ql:t.slice(t.indexOf(`/`)+1).replace(/^x-/,``).replace(/\+.*$/,``)}var eu=R(`
5480
+ `);I(`slicc-tag`,class extends HTMLElement{static observedAttributes=[`hue`,`label`,`dot`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ql]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get hue(){let e=this.getAttribute(`hue`);return e&&Zl.has(e)?e:null}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get dot(){return this.hasAttribute(`dot`)}set dot(e){e?this.setAttribute(`dot`,``):this.removeAttribute(`dot`)}#t(){let e=this.label??L(`slot`),t=L(`span`,{class:`tag`,part:`tag`},this.dot?L(`span`,{class:`dot`,part:`dot`}):null,L(`span`,{class:`label`,part:`label`},e));this.#e.replaceChildren(t)}});var $l=`binary`;function eu(e){let t=e.split(`;`,1)[0]?.trim()??e;return t===`application/octet-stream`||t.length===0?$l:t.slice(t.indexOf(`/`)+1).replace(/^x-/,``).replace(/\+.*$/,``)}var tu=R(`
5481
5481
  :host {
5482
5482
  position: fixed;
5483
5483
  inset: 0;
@@ -5665,7 +5665,7 @@ iframe {
5665
5665
  font-size: 13px;
5666
5666
  }
5667
5667
  .fallback code { font-family: var(--mono, monospace); font-size: 12px; }
5668
- `),tu={rendered:`Preview`,file:`Source`,diff:`Diff`};function nu(e){let t=[];return e.rendered&&t.push(`rendered`),ou(e)&&t.push(`file`),e.baseContent!==void 0&&t.push(`diff`),t}function ru(e){return e.rendered?`rendered`:e.baseContent===void 0?`file`:`diff`}var iu=null,au=null;function ou(e){if(e.text===!0)return!0;let t=e.mimeType.split(`;`,1)[0]?.trim()??e.mimeType;return t.startsWith(`text/`)?!0:t===`application/json`||t===`application/xml`||t===`application/javascript`||t===`image/svg+xml`||t.endsWith(`+json`)||t.endsWith(`+xml`)}function su(e){return typeof e==`string`?e:new TextDecoder().decode(e)}function cu(e,t){let n=typeof e==`string`?new TextEncoder().encode(e):e;return new Blob([n],{type:t})}var lu=!1;function uu(e){if(!lu){lu=!0;for(let t of[`jsh`,`bsh`])try{e.setCustomExtension(t,`zsh`)}catch{}}}function du(e,t){let n=`<style>:root{color-scheme:${t};}html{background:Canvas;color:CanvasText;}</style>`,r=/^\s*<!doctype[^>]*>/i.exec(e);return r?e.slice(0,r[0].length)+n+e.slice(r[0].length):n+e}function fu(){let e=document.documentElement,t=e.dataset.theme??e.getAttribute(`data-theme`)??``;return t.includes(`dark`)?`dark`:t.includes(`light`)?`light`:globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var pu=class e extends HTMLElement{#e;#t=[];#n=0;#r=null;#i=null;#a=`file`;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[eu]}disconnectedCallback(){for(let e of this.#t)URL.revokeObjectURL(e);this.#t.length=0,iu===this&&(iu=null)}static open(t){e.close();let n=document.createElement(`slicc-quick-look`);n.#r=t,n.#n+=1,n.#a=ru(t);let r=t.path.split(`/`).pop()||t.path,a=t.path.slice(0,t.path.length-r.length),o=L(`div`,{class:`backdrop`}),s=L(`button`,{class:`x`});s.setAttribute(`aria-label`,`Close preview`),s.appendChild(i(`x`,{size:14}));let c=L(`div`,{class:`header`},L(`div`,{class:`name`},L(`span`,{class:`dir`},a),r));c.appendChild(L(`span`,{class:`chip`},$l(t.mimeType))),t.gitStatus&&c.appendChild(L(`span`,{class:`chip chip--git`},t.gitStatus));let l=nu(t);l.length>1&&c.appendChild(n.#o(l)),c.appendChild(s);let u=L(`div`,{class:`content`});n.#i=u,n.#s();let d=L(`div`,{class:`panel`},c,u);d.tabIndex=-1,n.#e.append(o,d),document.body.appendChild(n),iu=n,d.focus(),o.addEventListener(`click`,()=>n.#l(`backdrop`)),s.addEventListener(`click`,()=>n.#l(`close-button`)),au&&document.removeEventListener(`keydown`,au),au=e=>{e.key===`Escape`&&n.#l(`escape`)},document.addEventListener(`keydown`,au)}static close(){if(iu){for(let e of iu.#t)URL.revokeObjectURL(e);iu.remove(),iu=null}au&&=(document.removeEventListener(`keydown`,au),null)}#o(e){let t=e.map(e=>L(`button`,{type:`button`},tu[e])),n=()=>{for(let[n,r]of e.entries())t[n]?.setAttribute(`aria-pressed`,String(this.#a===r))};n();for(let[r,i]of e.entries())t[r]?.addEventListener(`click`,()=>{this.#a!==i&&(this.#a=i,n(),this.#s())});return L(`div`,{class:`toggle`},...t)}#s(){let e=this.#r,t=this.#i;!e||!t||(t.replaceChildren(this.#d(e)),t.classList.toggle(`content--rich`,this.#a===`rendered`&&e.rendered?.mount===`sandbox`),this.#a!==`rendered`&&ou(e)&&this.#u(this.#n))}#c(e){let t=e.rendered;if(!t)return L(`pre`,null,su(e.content));if(t.mount===`sandbox`){let n=document.createElement(`iframe`);return n.setAttribute(`sandbox`,``),n.srcdoc=du(t.html,fu()),n.title=`${e.path.split(`/`).pop()||e.path} preview`,n.className=`rendered-frame`,n}let n=L(`div`,{class:`rendered`}),r=this.ownerDocument.createRange();return r.selectNodeContents(n),n.appendChild(r.createContextualFragment(t.html)),n}#l(t){this.dispatchEvent(new CustomEvent(`quick-look-close`,{bubbles:!0,composed:!0,detail:{reason:t}})),e.close()}async#u(e){let n=this.#r,r=this.#i;if(!n||!r)return;let i;try{i=await t(()=>import(`./dist-kBT87Ea7.js`).then(e=>e.t),__vite__mapDeps([0,1,2]))}catch{return}if(uu(i),e!==this.#n||!this.isConnected)return;let a=n.path.split(`/`).pop()||n.path,o=su(n.content),s={themeType:fu(),theme:{dark:`github-dark`,light:`github-light`},stickyHeader:!1,disableFileHeader:!0},c=L(`div`);try{if(this.#a===`diff`&&n.baseContent!==void 0){let e=new i.FileDiff({...s,diffStyle:`unified`});e.render({oldFile:{name:a,contents:n.baseContent},newFile:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line,side:`additions`})}else{let e=new i.File(s);e.render({file:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line})}}catch{return}e!==this.#n||!this.isConnected||(r.classList.add(`content--rich`),r.replaceChildren(c))}#d(e){let t=e.mimeType;if(this.#a===`rendered`)return this.#c(e);if(ou(e))return L(`pre`,null,su(e.content));if(t.startsWith(`image/`)){let n=document.createElement(`img`);return n.src=this.#f(e.content,t),n.alt=e.path.split(`/`).pop()||``,n}if(t.startsWith(`audio/`)){let n=document.createElement(`audio`);return n.controls=!0,n.src=this.#f(e.content,t),n}if(t.startsWith(`video/`)){let n=document.createElement(`video`);return n.controls=!0,n.src=this.#f(e.content,t),n}if(t===`application/pdf`){let n=document.createElement(`iframe`);return n.src=this.#f(e.content,t),n.title=e.path.split(`/`).pop()||`PDF preview`,n}return L(`div`,{class:`fallback`},L(`div`,null,`Preview not available for this file type (${mu(typeof e.content==`string`?e.content.length:e.content.byteLength)})`),L(`div`,{style:`margin-top:6px;`},L(`code`,null,t)))}#f(e,t){let n=URL.createObjectURL(cu(e,t));return this.#t.push(n),n}};function mu(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}I(`slicc-quick-look`,pu);var hu=`
5668
+ `),nu={rendered:`Preview`,file:`Source`,diff:`Diff`};function ru(e){let t=[];return e.rendered&&t.push(`rendered`),su(e)&&t.push(`file`),e.baseContent!==void 0&&t.push(`diff`),t}function iu(e){return e.rendered?`rendered`:e.baseContent===void 0?`file`:`diff`}var au=null,ou=null;function su(e){if(e.text===!0)return!0;let t=e.mimeType.split(`;`,1)[0]?.trim()??e.mimeType;return t.startsWith(`text/`)?!0:t===`application/json`||t===`application/xml`||t===`application/javascript`||t===`image/svg+xml`||t.endsWith(`+json`)||t.endsWith(`+xml`)}function cu(e){return typeof e==`string`?e:new TextDecoder().decode(e)}function lu(e,t){let n=typeof e==`string`?new TextEncoder().encode(e):e;return new Blob([n],{type:t})}var uu=!1;function du(e){if(!uu){uu=!0;for(let t of[`jsh`,`bsh`])try{e.setCustomExtension(t,`zsh`)}catch{}}}function fu(e,t){let n=`<style>:root{color-scheme:${t};}html{background:Canvas;color:CanvasText;}</style>`,r=/^\s*<!doctype[^>]*>/i.exec(e);return r?e.slice(0,r[0].length)+n+e.slice(r[0].length):n+e}function pu(){let e=document.documentElement,t=e.dataset.theme??e.getAttribute(`data-theme`)??``;return t.includes(`dark`)?`dark`:t.includes(`light`)?`light`:globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var mu=class e extends HTMLElement{#e;#t=[];#n=0;#r=null;#i=null;#a=`file`;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[tu]}disconnectedCallback(){for(let e of this.#t)URL.revokeObjectURL(e);this.#t.length=0,au===this&&(au=null)}static open(t){e.close();let n=document.createElement(`slicc-quick-look`);n.#r=t,n.#n+=1,n.#a=iu(t);let r=t.path.split(`/`).pop()||t.path,a=t.path.slice(0,t.path.length-r.length),o=L(`div`,{class:`backdrop`}),s=L(`button`,{class:`x`});s.setAttribute(`aria-label`,`Close preview`),s.appendChild(i(`x`,{size:14}));let c=L(`div`,{class:`header`},L(`div`,{class:`name`},L(`span`,{class:`dir`},a),r));c.appendChild(L(`span`,{class:`chip`},eu(t.mimeType))),t.gitStatus&&c.appendChild(L(`span`,{class:`chip chip--git`},t.gitStatus));let l=ru(t);l.length>1&&c.appendChild(n.#o(l)),c.appendChild(s);let u=L(`div`,{class:`content`});n.#i=u,n.#s();let d=L(`div`,{class:`panel`},c,u);d.tabIndex=-1,n.#e.append(o,d),document.body.appendChild(n),au=n,d.focus(),o.addEventListener(`click`,()=>n.#l(`backdrop`)),s.addEventListener(`click`,()=>n.#l(`close-button`)),ou&&document.removeEventListener(`keydown`,ou),ou=e=>{e.key===`Escape`&&n.#l(`escape`)},document.addEventListener(`keydown`,ou)}static close(){if(au){for(let e of au.#t)URL.revokeObjectURL(e);au.remove(),au=null}ou&&=(document.removeEventListener(`keydown`,ou),null)}#o(e){let t=e.map(e=>L(`button`,{type:`button`},nu[e])),n=()=>{for(let[n,r]of e.entries())t[n]?.setAttribute(`aria-pressed`,String(this.#a===r))};n();for(let[r,i]of e.entries())t[r]?.addEventListener(`click`,()=>{this.#a!==i&&(this.#a=i,n(),this.#s())});return L(`div`,{class:`toggle`},...t)}#s(){let e=this.#r,t=this.#i;!e||!t||(t.replaceChildren(this.#d(e)),t.classList.toggle(`content--rich`,this.#a===`rendered`&&e.rendered?.mount===`sandbox`),this.#a!==`rendered`&&su(e)&&this.#u(this.#n))}#c(e){let t=e.rendered;if(!t)return L(`pre`,null,cu(e.content));if(t.mount===`sandbox`){let n=document.createElement(`iframe`);return n.setAttribute(`sandbox`,``),n.srcdoc=fu(t.html,pu()),n.title=`${e.path.split(`/`).pop()||e.path} preview`,n.className=`rendered-frame`,n}let n=L(`div`,{class:`rendered`}),r=this.ownerDocument.createRange();return r.selectNodeContents(n),n.appendChild(r.createContextualFragment(t.html)),n}#l(t){this.dispatchEvent(new CustomEvent(`quick-look-close`,{bubbles:!0,composed:!0,detail:{reason:t}})),e.close()}async#u(e){let n=this.#r,r=this.#i;if(!n||!r)return;let i;try{i=await t(()=>import(`./dist-kBT87Ea7.js`).then(e=>e.t),__vite__mapDeps([0,1,2]))}catch{return}if(du(i),e!==this.#n||!this.isConnected)return;let a=n.path.split(`/`).pop()||n.path,o=cu(n.content),s={themeType:pu(),theme:{dark:`github-dark`,light:`github-light`},stickyHeader:!1,disableFileHeader:!0},c=L(`div`);try{if(this.#a===`diff`&&n.baseContent!==void 0){let e=new i.FileDiff({...s,diffStyle:`unified`});e.render({oldFile:{name:a,contents:n.baseContent},newFile:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line,side:`additions`})}else{let e=new i.File(s);e.render({file:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line})}}catch{return}e!==this.#n||!this.isConnected||(r.classList.add(`content--rich`),r.replaceChildren(c))}#d(e){let t=e.mimeType;if(this.#a===`rendered`)return this.#c(e);if(su(e))return L(`pre`,null,cu(e.content));if(t.startsWith(`image/`)){let n=document.createElement(`img`);return n.src=this.#f(e.content,t),n.alt=e.path.split(`/`).pop()||``,n}if(t.startsWith(`audio/`)){let n=document.createElement(`audio`);return n.controls=!0,n.src=this.#f(e.content,t),n}if(t.startsWith(`video/`)){let n=document.createElement(`video`);return n.controls=!0,n.src=this.#f(e.content,t),n}if(t===`application/pdf`){let n=document.createElement(`iframe`);return n.src=this.#f(e.content,t),n.title=e.path.split(`/`).pop()||`PDF preview`,n}return L(`div`,{class:`fallback`},L(`div`,null,`Preview not available for this file type (${hu(typeof e.content==`string`?e.content.length:e.content.byteLength)})`),L(`div`,{style:`margin-top:6px;`},L(`code`,null,t)))}#f(e,t){let n=URL.createObjectURL(lu(e,t));return this.#t.push(n),n}};function hu(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}I(`slicc-quick-look`,mu);var gu=`
5669
5669
  .slicc-chatpane {
5670
5670
  flex: 1 1 0;
5671
5671
  width: 100%;
@@ -5712,7 +5712,7 @@ iframe {
5712
5712
  -webkit-mask-image: none;
5713
5713
  mask-image: none;
5714
5714
  }
5715
- `,gu=`slicc-chatpane-style`;function _u(e){if(e.getElementById(gu))return;let t=e.createElement(`style`);t.id=gu,t.textContent=hu,(e.head??e.documentElement).appendChild(t)}var vu=[`slicc-chat-thread`,`slicc-composer`];I(`slicc-chatpane`,class extends HTMLElement{static observedAttributes=[`narrow`];#e=null;#t=!1;connectedCallback(){_u(this.ownerDocument),this.classList.add(`slicc-chatpane`),this.setAttribute(`part`,`pane`),this.#t=!0,this.#n(),this.#r()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){e===`narrow`&&t!==n&&this.isConnected&&(this.#n(),this.dispatchEvent(new CustomEvent(`slicc-chatpane-narrow-change`,{detail:{narrow:this.narrow},bubbles:!0,composed:!0})))}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){e?this.setAttribute(`narrow`,``):this.removeAttribute(`narrow`)}get nav(){return this.querySelector(`:scope > slicc-nav`)}get thread(){return this.querySelector(`:scope > slicc-chat-thread`)}get composer(){return this.querySelector(`:scope > slicc-composer`)}#n(){if(!this.#t)return;let e=this.narrow;for(let t of vu)for(let n of this.querySelectorAll(`:scope > ${t}`))e?n.setAttribute(`open`,``):n.removeAttribute(`open`)}#r(){this.#e||(this.#e=new MutationObserver(()=>this.#n()),this.#e.observe(this,{childList:!0}))}});var yu=`
5715
+ `,_u=`slicc-chatpane-style`;function vu(e){if(e.getElementById(_u))return;let t=e.createElement(`style`);t.id=_u,t.textContent=gu,(e.head??e.documentElement).appendChild(t)}var yu=[`slicc-chat-thread`,`slicc-composer`];I(`slicc-chatpane`,class extends HTMLElement{static observedAttributes=[`narrow`];#e=null;#t=!1;connectedCallback(){vu(this.ownerDocument),this.classList.add(`slicc-chatpane`),this.setAttribute(`part`,`pane`),this.#t=!0,this.#n(),this.#r()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){e===`narrow`&&t!==n&&this.isConnected&&(this.#n(),this.dispatchEvent(new CustomEvent(`slicc-chatpane-narrow-change`,{detail:{narrow:this.narrow},bubbles:!0,composed:!0})))}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){e?this.setAttribute(`narrow`,``):this.removeAttribute(`narrow`)}get nav(){return this.querySelector(`:scope > slicc-nav`)}get thread(){return this.querySelector(`:scope > slicc-chat-thread`)}get composer(){return this.querySelector(`:scope > slicc-composer`)}#n(){if(!this.#t)return;let e=this.narrow;for(let t of yu)for(let n of this.querySelectorAll(`:scope > ${t}`))e?n.setAttribute(`open`,``):n.removeAttribute(`open`)}#r(){this.#e||(this.#e=new MutationObserver(()=>this.#n()),this.#e.observe(this,{childList:!0}))}});var bu=`
5716
5716
  .slicc-shell { display: flex; flex: 1; min-height: 0; }
5717
5717
  .slicc-shell > slicc-dock-tree,
5718
5718
  .slicc-shell > .dock-tree {
@@ -5728,7 +5728,7 @@ iframe {
5728
5728
  and blur the rail's own opaque strip. */
5729
5729
  .slicc-shell > slicc-dock,
5730
5730
  .slicc-shell > .dock { flex: 0 0 48px; position: relative; z-index: 3; }
5731
- `,bu=`slicc-shell-style`;function xu(e){if(e.getElementById(bu))return;let t=e.createElement(`style`);t.id=bu,t.textContent=yu,(e.head??e.documentElement).appendChild(t)}var Su=`chat`;I(`slicc-shell`,class extends HTMLElement{#e=e=>{let t=e.detail?.placed;if(!Array.isArray(t))return;let n=t.some(e=>e!==Su);this.querySelector(`slicc-chatpane`)?.toggleAttribute(`narrow`,n)};connectedCallback(){xu(this.ownerDocument),this.classList.add(`slicc-shell`),this.setAttribute(`part`,`shell`),this.addEventListener(`dock-tree-render`,this.#e)}disconnectedCallback(){this.removeEventListener(`dock-tree-render`,this.#e)}get dockTree(){return this.querySelector(`:scope > slicc-dock-tree, :scope > .dock-tree`)}get dock(){return this.querySelector(`:scope > slicc-dock, :scope > .dock`)}});var Cu=[`idle`,`thinking`,`working`,`awaiting`],wu=.22,Tu=.08,Eu=3400,Du=4600,Ou=.38,ku=2600,Au=.22,ju=1e3,Mu=.1,Nu=.55,Pu=.16,Fu={left:{raise:-9,tilt:-10},right:{raise:2,tilt:6}},Iu=[{x:45,y:-15},{x:150,y:-10},{x:95,y:-25},{x:160,y:-30},{x:40,y:-28}],Lu=1300,Ru=[{x:70,y:60},{x:130,y:40},{x:100,y:72},{x:55,y:30},{x:148,y:62}],zu=4100,Bu=2.2,Vu={x:100,y:66};function Hu(e,t,n){return e+(t-e)*n}function Uu(e,t,n,r){return e+(t-e)*Math.min(1,n*r)}function Wu(e){return e===null?null:Cu.includes(e)?e:`idle`}function Gu(e){let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:90}function Ku(e){return+(e===`working`)}function qu(e){return Hu(38,10,e)}function Ju(e,t){return Hu(e,e*wu,t)}function Yu(e){return e<=50?1:e>=85?2.2:1+(e-50)/35*1.2}function Xu(e){return e<=0?1:1+Pu*Math.min(1,e/350)}function Zu(e){return Math.max(2,Math.min(16,38-e-4))}function Qu(e){return e>.001?12+e*2*38:9}function $u(e){return e>.001?88-e*2*38:91}function ed(e,t){let n=e-50;return Hu(Math.sqrt(Math.max(0,1444-n*n)),36,t)}function td(e,t){return e<=t?Mu:Hu(Mu,Nu,Math.min(1,(e-t)/12))}function nd(e){return e.left.raise<0}function rd(e,t=Math.random){let n=t()<.65?!nd(e):nd(e),r={raise:-(7+t()*5),tilt:7+t()*5},i={raise:1+t()*2,tilt:4+t()*3};return n?{left:{raise:r.raise,tilt:-r.tilt},right:i}:{left:{raise:i.raise,tilt:-i.tilt},right:r}}function id(e,t,n){return t<2?0:(e+1+Math.floor(n()*(t-1)))%t}var ad=`http://www.w3.org/2000/svg`,od={cx:55,cy:50,r:38},sd={cx:145,cy:50,r:38},cd=1,ld=12,ud=.72,dd=[.08,.36,.68,.94],fd=1372365086,pd=2654435769,md=2246822507,hd=Date.UTC(2001,0,1),gd=500,_d={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}},vd={cone:`#D2691E`,scoop:`#FFB6C1`},yd=R(`
5731
+ `,xu=`slicc-shell-style`;function Su(e){if(e.getElementById(xu))return;let t=e.createElement(`style`);t.id=xu,t.textContent=bu,(e.head??e.documentElement).appendChild(t)}var Cu=`chat`;I(`slicc-shell`,class extends HTMLElement{#e=e=>{let t=e.detail?.placed;if(!Array.isArray(t))return;let n=t.some(e=>e!==Cu);this.querySelector(`slicc-chatpane`)?.toggleAttribute(`narrow`,n)};connectedCallback(){Su(this.ownerDocument),this.classList.add(`slicc-shell`),this.setAttribute(`part`,`shell`),this.addEventListener(`dock-tree-render`,this.#e)}disconnectedCallback(){this.removeEventListener(`dock-tree-render`,this.#e)}get dockTree(){return this.querySelector(`:scope > slicc-dock-tree, :scope > .dock-tree`)}get dock(){return this.querySelector(`:scope > slicc-dock, :scope > .dock`)}});var wu=[`idle`,`thinking`,`working`,`awaiting`],Tu=.22,Eu=.08,Du=3400,Ou=4600,ku=.38,Au=2600,ju=.22,Mu=1e3,Nu=.1,Pu=.55,Fu=.16,Iu={left:{raise:-9,tilt:-10},right:{raise:2,tilt:6}},Lu=[{x:45,y:-15},{x:150,y:-10},{x:95,y:-25},{x:160,y:-30},{x:40,y:-28}],Ru=1300,zu=[{x:70,y:60},{x:130,y:40},{x:100,y:72},{x:55,y:30},{x:148,y:62}],Bu=4100,Vu=2.2,Hu={x:100,y:66};function Uu(e,t,n){return e+(t-e)*n}function Wu(e,t,n,r){return e+(t-e)*Math.min(1,n*r)}function Gu(e){return e===null?null:wu.includes(e)?e:`idle`}function Ku(e){let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:90}function qu(e){return+(e===`working`)}function Ju(e){return Uu(38,10,e)}function Yu(e,t){return Uu(e,e*Tu,t)}function Xu(e){return e<=50?1:e>=85?2.2:1+(e-50)/35*1.2}function Zu(e){return e<=0?1:1+Fu*Math.min(1,e/350)}function Qu(e){return Math.max(2,Math.min(16,38-e-4))}function $u(e){return e>.001?12+e*2*38:9}function ed(e){return e>.001?88-e*2*38:91}function td(e,t){let n=e-50;return Uu(Math.sqrt(Math.max(0,1444-n*n)),36,t)}function nd(e,t){return e<=t?Nu:Uu(Nu,Pu,Math.min(1,(e-t)/12))}function rd(e){return e.left.raise<0}function id(e,t=Math.random){let n=t()<.65?!rd(e):rd(e),r={raise:-(7+t()*5),tilt:7+t()*5},i={raise:1+t()*2,tilt:4+t()*3};return n?{left:{raise:r.raise,tilt:-r.tilt},right:i}:{left:{raise:i.raise,tilt:-i.tilt},right:r}}function ad(e,t,n){return t<2?0:(e+1+Math.floor(n()*(t-1)))%t}var od=`http://www.w3.org/2000/svg`,sd={cx:55,cy:50,r:38},cd={cx:145,cy:50,r:38},ld=1,ud=12,dd=.72,fd=[.08,.36,.68,.94],pd=1372365086,md=2654435769,hd=2246822507,gd=Date.UTC(2001,0,1),_d=500,vd={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}},yd={cone:`#D2691E`,scoop:`#FFB6C1`},bd=R(`
5732
5732
  :host{display:block;width:26px;height:26px;pointer-events:none;}
5733
5733
  /* The tile itself no longer clips: .crop owns the roundrect so the brows can
5734
5734
  break out of it (see .brow-layer). Everything else still paints inside. */
@@ -5743,14 +5743,14 @@ iframe {
5743
5743
  .eyes{position:absolute;pointer-events:none;}
5744
5744
  .eyes-svg,.brows-svg{display:block;overflow:visible;}
5745
5745
  .eye-blink,.eye-frozen{transform-box:view-box;}
5746
- @keyframes slicc-agent-avatar-blink{0%,92%,100%{transform:scaleY(1);}96%{transform:scaleY(${Tu});}}
5746
+ @keyframes slicc-agent-avatar-blink{0%,92%,100%{transform:scaleY(1);}96%{transform:scaleY(${Eu});}}
5747
5747
  :host([blink]) .eye-blink{animation:slicc-agent-avatar-blink 3.4s ease-in-out infinite;}
5748
5748
  :host([blink]) .eye-r{animation-duration:4.6s;}
5749
5749
  /* The engine drives blinks itself so it can commit shape changes at the apex. */
5750
5750
  .avatar[data-expressive] .eye-blink{animation:none;}
5751
5751
  .brow{transition:opacity 350ms ease,transform 350ms ease;}
5752
5752
  @media (prefers-reduced-motion:reduce){:host([blink]) .eye-blink{animation:none;}.brow{transition:none;}}
5753
- `);function B(e,t,...n){let r=document.createElementNS(ad,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function bd(e,t,n){e&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function xd(e,t,n){bd(e,t,n.toFixed(2))}function Sd(e,t){let n=e.replace(`#`,``),r=n.length===3?[...n].map(e=>`${e}${e}`).join(``):n,i=Number.parseInt(r,16);if(!Number.isFinite(i))return e;let a=t<0?0:255,o=e=>Math.round(e+(a-e)*Math.abs(t)).toString(16).padStart(2,`0`);return`#${o(i>>16&255)}${o(i>>8&255)}${o(i&255)}`}function Cd(e,t,n){let r=[[`path`,{d:`M108.22,414.88l189.84,460.03c1.36,3.3,6.09,3.16,7.25-.22l159.34-463.34c.87-2.53-1.03-5.16-3.7-5.13l-349.18,3.32c-2.74.03-4.59,2.82-3.55,5.35Z`,fill:e,stroke:t,"stroke-linejoin":`round`,"stroke-width":20}],[`path`,{d:`M261.93,482.48h0c15.03-15.03,4.46-40.72-16.79-40.83h0c-21.37-.11-32.14,25.72-17.03,40.83h0c9.34,9.34,24.48,9.34,33.82,0Z`,fill:n}],[`path`,{d:`M384.85,527.49l-51.82,51.82c-2.24,2.24-2.24,5.86,0,8.1l55.71,55.71c2.24,2.24,5.86,2.24,8.1,0h0c.62-.62,1.08-1.36,1.37-2.19l26.52-77.11c.71-2.07.18-4.36-1.37-5.91l-30.41-30.41c-2.24-2.24-5.86-2.24-8.1,0Z`,fill:n}],[`path`,{d:`M371.7,684.58l-25.94,25.94c-2.24,2.24-2.24,5.86,0,8.1l12.67,12.67c2.99,2.99,8.09,1.82,9.46-2.19l13.28-38.61c1.97-5.74-5.17-10.2-9.46-5.91Z`,fill:n}],[`path`,{d:`M159.42,564.14l2.73,6.83c1.52,3.82,6.46,4.83,9.37,1.93l2.05-2.05c2.24-2.24,2.24-5.86,0-8.1l-4.78-4.78c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}],[`path`,{d:`M243.92,633.11l-48.65-48.65c-5.24-5.24-13.74-5.24-18.99,0h0c-3.8,3.8-4.97,9.49-2.98,14.47l27.77,69.54c3.58,8.95,15.14,11.33,21.96,4.51l20.89-20.89c5.24-5.24,5.24-13.74,0-18.99Z`,fill:n}],[`path`,{d:`M211.32,533.1h0c14.11-14.11,14.11-36.98,0-51.08l-34.94-34.94c-.72-.72-.72-1.89,0-2.62h0c1.16-1.16.34-3.15-1.3-3.16l-11.23-.06c-25.62-.13-43.23,25.72-33.73,49.51l5.37,13.45c1.82,4.55,4.54,8.68,8,12.15l16.74,16.74c14.11,14.11,36.98,14.11,51.08,0Z`,fill:n}],[`path`,{d:`M263.74,792.53h0c-5.69,5.69-7.45,14.23-4.46,21.71l22.5,56.36c6.92,17.34,31.68,16.74,37.75-.92l8.66-25.2c2.5-7.28.64-15.35-4.8-20.79l-31.17-31.17c-7.87-7.87-20.62-7.87-28.48,0Z`,fill:n}],[`path`,{d:`M392.94,503.07l40.81-40.81c2.24-2.24,5.86-2.24,8.1,0l.06.06c2.24,2.24,2.24,5.86,0,8.1l-40.81,40.81c-2.24,2.24-2.24,5.86,0,8.1l22.48,22.48c2.99,2.99,8.09,1.82,9.46-2.19l30.71-89.32c1.27-3.71-1.47-7.57-5.39-7.59l-120.63-.6c-5.11-.03-7.69,6.16-4.08,9.77l51.18,51.18c2.24,2.24,5.86,2.24,8.1,0Z`,fill:n}]],i=[[274.59,463.59,84.73,95.66,42.36,`translate(-268.79 373.91) rotate(-45)`],[291.06,603.84,72.24,90.24,36.12,`translate(-363.06 421.43) rotate(-45)`],[217.18,527.25,72.24,95.66,36.12,`translate(-332.45 347.55) rotate(-45)`],[236.26,661.25,67.04,90.24,33.52,`translate(-420.46 397.65) rotate(-45)`]],a=r.map(([e,t])=>B(e,t));return a.push(...i.map(([e,t,r,i,a,o])=>B(`rect`,{x:e,y:t,width:r,height:i,rx:a,ry:a,transform:o,fill:n})),B(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})),a}function wd(e,t){return[B(`path`,{d:`M566.75,340.67c0-29.85-12.97-56.87-33.96-76.47,4.8-9.98,7.44-20.71,7.44-31.9,0-38.29-30.62-71.33-74.92-86.77.33-3.07.51-6.17.51-9.3,0-69.72-84.29-126.24-188.26-126.24s-188.26,56.52-188.26,126.24c0,4,.29,7.95.83,11.86-34.94,15.4-58.48,44.25-58.48,77.34,0,18.21,7.15,34.25,19.39,49.26-25.1,19.88-41.05,49.47-41.05,82.54,0,59.85,52.15,108.37,116.49,108.37,10.83,0,21.3-1.4,31.26-3.98,31.42,41.91,83.55,69.34,142.55,69.34,64.73,0,121.2-33,151.11-81.94,63.8-.57,115.34-48.85,115.34-108.34Z`,fill:e,stroke:t,"stroke-width":20})]}function Td(e,t,n,r){return B(`rect`,{x:e-t,y:50-t,width:t*2,height:t*2,rx:n,...r})}function Ed(e,t,n,r){return B(`g`,{class:`pupil pupil-${t}`},Td(e,n,Ju(n,r),{fill:`#000`}),B(`circle`,{cx:e-n*.3,cy:50-n*.35,r:n*.4,fill:`#fff`}))}function Dd(e,t){return B(`line`,{class:`lid-line lid-${t}`,x1:e-38,y1:50,x2:e+38,y2:50,stroke:`#000`,"stroke-width":4,"stroke-linecap":`round`,display:`none`})}function Od(e,t){let n=B(`line`,{class:`brow brow-${t}`,x1:e-22,y1:2,x2:e+22,y2:2,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`,opacity:0});return n.style.transformBox=`fill-box`,n.style.transformOrigin=`center`,n}function kd(e){return L(`span`,{class:`eyes`,style:`top:${e.eyes.top}%;left:${e.eyes.left}%;width:${e.eyes.width}%;height:${e.eyes.height}%`})}function Ad(e,t,n){let r=B(`g`,{class:`${n} eye-${t}`});return r.style.transformOrigin=`${e}px 50px`,r}function jd(e,t,n){let r=`slicc-agent-avatar-noise-${t}`;return B(`g`,{class:`eye-static eye-body-${t}`},B(`defs`,{},B(`clipPath`,{id:r},Td(e,38,n,{class:`noise-clip`}))),Td(e,38,n,{class:`socket`,fill:`#fff`}),B(`g`,{class:`noise noise-${t}`,"clip-path":`url(#${r})`,"data-cell-size":cd}),Td(e,38,n,{class:`eye-outline`,fill:`none`,stroke:`#000`,"stroke-width":4}))}function Md(e){return e^=e<<13,e^=e>>>17,e^=e<<5,e>>>0}function Nd(e){return(fd^Math.imul(e,md))>>>0}function Pd(e,t){return(Nd(e)^Math.imul(t,pd))>>>0}function Fd(){return Math.floor((Date.now()-hd)/1e3*ld)>>>0}function Id(e){return[B(`circle`,{cx:e,cy:50,r:38,fill:`#fff`,stroke:`#000`,"stroke-width":4}),B(`line`,{x1:e-15,y1:35,x2:e+15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),B(`line`,{x1:e+15,y1:35,x2:e-15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function Ld(e,t,n,r,i){let a=n-t,o=r-50,s=Math.hypot(a,o),c=Math.min(s,i),l=s>0?a/s*c:0,u=s>0?o/s*c:0;e.setAttribute(`transform`,`translate(${l.toFixed(2)},${u.toFixed(2)})`)}var Rd={now:()=>performance.now(),requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),delay:(e,t)=>window.setTimeout(e,t),cancelDelay:e=>window.clearTimeout(e),repeat:(e,t)=>window.setInterval(e,t),cancelRepeat:e=>window.clearInterval(e)};I(`slicc-agent-avatar`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`fill`,`connection`,`activity`,`gaze-target`,`drowse-delay`];#e;#t=e=>this.#ke(e);#n=()=>{this.#V(),this.#q(),this.#U()===`static`&&this.#we()};#r=null;#i=null;#a=null;#o=null;#s=[];#c=null;#l=16;#u=!1;#d=null;#f=!1;#p=!1;#m=0;#h=0;#g=!1;#_=0;#v=0;#y=Fu;#b={x:100,y:50};#x=0;#S=0;#C=18;#w=null;#T=0;#E=0;#D=0;#O=null;#k=0;#A=[];#j=null;#M=[];#N=Vu;#P=null;#F=Rd;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[yd]}connectedCallback(){this.#r=window.matchMedia(`(prefers-reduced-motion: reduce)`),this.#r.addEventListener(`change`,this.#n),this.#L(),this.#V(),this.#q()}disconnectedCallback(){this.#H(),this.#De(),this.#Q(),this.#r?.removeEventListener(`change`,this.#n),this.#r=null,this.#p=!1}attributeChangedCallback(e){if(this.isConnected){if(e===`activity`||e===`gaze-target`||e===`drowse-delay`){this.#K();return}this.#L(),this.#V(),this.#q()}}get activity(){return Wu(this.getAttribute(`activity`))}set activity(e){e===null?this.removeAttribute(`activity`):this.setAttribute(`activity`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e===null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get drowseDelay(){return Gu(this.getAttribute(`drowse-delay`))}set drowseDelay(e){this.setAttribute(`drowse-delay`,String(e))}get clock(){return this.#F}set clock(e){if(e===this.#F)return;this.#Q(),this.#F=e;let t=e.now();this.#k=t,this.#w!==null&&(this.#w=t),this.#T=0,this.#E=0,this.#D=0,this.#P=null,this.isConnected&&this.#q()}get expression(){return Object.freeze({activity:this.#d,shape:this.#m,lidTop:this.#_,lidBottom:this.#v,pupilRadius:this.#C,gaze:{...this.#b},brows:this.#y,browsVisible:this.#_e()})}wake(){let e=this.#F.now();this.#w=e,this.#W()||(this.#D=e+350,this.#ce()),this.#Y()}scrutinize(){this.#E=this.#F.now()+ju,this.#Y()}glower(){this.#T=this.#F.now()+ku,this.#Y()}resetExpression(){this.#se();let e=this.#F.now();this.#T=0,this.#E=0,this.#D=0,this.#_=0,this.#v=0,this.#y=Fu,this.#N=Vu,this.#P=null,this.#S=0,this.#w=this.#d===`awaiting`?e:null,this.#g=!1,this.#h=Ku(this.#d),this.#m=this.#h,this.#k=e,this.#I()&&this.isConnected&&(this.#ve(),this.#q())}#I(){return this.hasAttribute(`activity`)||this.#f}#L(){this.#De(),this.#s=[];let e=this.getAttribute(`type`)===`cone`?`cone`:`scoop`,t=_d[e],n=this.getAttribute(`color`)??vd[e],r=this.#I();this.#d=Wu(this.getAttribute(`activity`)),this.#d===`awaiting`&&this.#w===null&&(this.#w=this.#F.now()),this.#p||=(this.#m=this.#h=Ku(this.#d),!0);let i=B(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...e===`cone`?Cd(n,Sd(n,-.38),Sd(n,.3)):wd(n,Sd(n,-.32)));this.#o=B(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...this.#R(r));let a=kd(t);a.append(this.#o);let o=`--tx:${((.5-t.zoom*((t.eyes.left+t.eyes.width/2)/100))*100).toFixed(2)}%;--ty:${((.5-t.zoom*((t.eyes.top+t.eyes.height/2)/100))*100).toFixed(2)}%;--zoom:${t.zoom}`,s=L(`span`,{class:`icon-inner`,style:o},i,a),c=this.#z(r),l=null;if(c){let e=kd(t);e.append(c),l=L(`span`,{class:`icon-inner brow-layer`,style:o},e)}this.#e.replaceChildren(L(`span`,{class:`avatar`,"aria-hidden":`true`,"data-expressive":r||null},L(`span`,{class:`crop`},s),l)),this.#i=this.#e.querySelector(`.pupil-l`),this.#a=this.#e.querySelector(`.pupil-r`),this.#U()===`static`&&this.#we(),r&&this.#ve()}#R(e){let t=this.#U();if(t===`none`)return[];if(t===`dead`)return[...Id(od.cx),...Id(sd.cx)];this.#C=this.#B(),this.#l=Zu(this.#C);let n=qu(this.#m);return[od.cx,sd.cx].map((r,i)=>{let a=i===0?`l`:`r`,o=t===`static`,s=Ad(r,a,o?`eye-frozen`:`eye-blink`),c=o?jd(r,a,n):B(`g`,{class:`eye-body eye-body-${a}`},Td(r,38,n,{class:`socket`,fill:`#fff`,stroke:`#000`,"stroke-width":4}),Ed(r,a,this.#C,this.#m));if(s.append(c),!e)return s;let l=`slicc-agent-avatar-lid-${a}`;return s.append(B(`defs`,{},B(`clipPath`,{id:l},B(`rect`,{class:`lid-clip`,x:r-38-3,y:9,width:82,height:82}))),Dd(r,`top`),Dd(r,`bottom`)),c.setAttribute(`clip-path`,`url(#${l})`),s})}#z(e){let t=this.#U();return!e||t===`none`||t===`dead`?null:B(`svg`,{class:`brows-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...[od.cx,sd.cx].map((e,t)=>{let n=t===0?`l`:`r`,r=B(`g`,{class:`brow-group brow-group-${n}`});return r.style.transformBox=`view-box`,r.style.transformOrigin=`${e}px 50px`,r.append(Od(e,n)),r}))}#B(){return 18*Yu(Math.max(0,Math.min(100,Number.parseFloat(this.getAttribute(`fill`)??`0`)||0)))}#V(){let e=this.#U()===`open`&&!this.#r?.matches&&(this.#d===null||this.#d===`working`);e&&!this.#u?(this.ownerDocument.addEventListener(`pointermove`,this.#t),this.#u=!0):e||(this.#H(),(this.#d===null||this.#d===`working`)&&this.#Oe())}#H(){this.#u&&=(this.ownerDocument.removeEventListener(`pointermove`,this.#t),!1)}#U(){let e=this.getAttribute(`connection`);if(e!==null&&e!==`connected`)return`static`;let t=this.getAttribute(`eyes`);return t===`dead`||t===`none`||t===`static`?t:`open`}#W(){return this.#r?.matches===!0||this.#U()!==`open`||!this.isConnected||!this.#p}#G(){return this.#U()!==`open`}#K(){let e=Wu(this.getAttribute(`activity`)),t=this.#e.querySelector(`.avatar[data-expressive]`)!==null;e===`awaiting`&&this.#d!==`awaiting`?this.#w=this.#F.now():e!==`awaiting`&&(this.#w=null),this.#P=null,this.#d=e,this.#I()!==t&&this.#L(),this.#V(),this.#q()}#q(){if(!this.#I()||!this.isConnected){this.#Q();return}if(this.#G()||this.#r?.matches){this.#Z(),this.#J(),this.#te();return}this.#ue(),this.#X()}#J(){for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#Y(){this.#I()||(this.#f=!0,this.isConnected&&this.#L()),this.#q()}#X(){this.#O===null&&(this.#k=this.#F.now(),this.#O=this.#F.requestFrame(this.#$))}#Z(){this.#O!==null&&(this.#F.cancelFrame(this.#O),this.#O=null)}#Q(){this.#Z();for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[],this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null;for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#$=e=>{this.#O=this.#F.requestFrame(this.#$);let t=Math.min(.05,Math.max(0,(e-this.#k)/1e3));this.#k=e,this.#ee(e,t),this.#ve()};#ee(e,t){let n=Ku(this.#d);n!==this.#h&&!this.#g&&this.#ae(n),this.#m=Uu(this.#m,this.#h,6,t),this.#_=Uu(this.#_,this.#re(e,!1),5,t),this.#v=Uu(this.#v,this.#ie(e),5,t),this.#pe(e,t)}#te(){let e=this.#F.now();this.#G()||(this.#h=this.#m=Ku(this.#d),this.#_=this.#re(e,!0),this.#v=this.#ie(e),this.#me()),this.#ve(),this.#ne(e)}#ne(e){if(this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null,this.#G())return;let t=this.#d===`awaiting`&&this.#w!==null?this.#w+this.drowseDelay*1e3:1/0,n=Math.min(this.#T>e?this.#T:1/0,this.#E>e?this.#E:1/0,t>e?t:1/0);Number.isFinite(n)&&(this.#j=this.#F.delay(()=>this.#te(),Math.max(0,n-e)+1))}#re(e,t){let n=this.#T>e?Ou:0;if(this.#d!==`awaiting`)return n;let r=this.#w===null?0:(e-this.#w)/1e3,i=this.drowseDelay;return Math.max(n,td(t&&r>i?i+12:r,i))}#ie(e){return this.#E>e?Au:0}#ae(e){if(this.#W()){this.#h=this.#m=e;return}this.#g=!0,this.#ce(()=>{this.#h=this.#m=e,this.#g=!1})}#oe(){return[...this.#e.querySelectorAll(`.eye-blink`)]}#se(){for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[];for(let e of this.#oe())e.style.transition=`none`,e.style.transform=`scaleY(1)`}#ce(e){let t=this.#oe();if(t.length===0){e?.();return}t.forEach((t,n)=>{this.#le(t,n===0?e:void 0)})}#le(e,t){e.style.transition=`transform 110ms ease-in`,e.style.transform=`scaleY(${Tu})`,this.#A.push(this.#F.delay(()=>{t?.(),this.#d===`thinking`&&!this.#G()&&(this.#y=rd(this.#y)),e.style.transition=`transform 130ms ease-out`,e.style.transform=`scaleY(1)`},120))}#ue(){this.#M.length>0||this.#W()||this.#G()||[Eu,Du].forEach((e,t)=>{this.#M.push(this.#F.repeat(()=>{let e=this.#oe()[t];e&&this.hasAttribute(`blink`)&&!this.#G()&&this.#le(e)},e))})}#de(e){return this.#d===`thinking`?{target:this.#fe(e,Iu,Lu),rate:9}:this.#d===`idle`?{target:this.#fe(e,Ru,zu),rate:Bu}:this.#d===`awaiting`?{target:this.#ge(e),rate:6}:null}#fe(e,t,n){return e-this.#S>n&&(this.#S=e,this.#x=id(this.#x,t.length,Math.random)),t[this.#x]??Vu}#pe(e,t){let n=this.#de(e);n&&(this.#b={x:Uu(this.#b.x,n.target.x,n.rate,t),y:Uu(this.#b.y,n.target.y,n.rate,t)},this.#he())}#me(){this.#d===`awaiting`?(this.#b=this.#ge(this.#F.now()),this.#he()):(this.#d===`thinking`||this.#d===`idle`)&&this.#Oe()}#he(){this.#i&&Ld(this.#i,od.cx,this.#b.x,this.#b.y,this.#l),this.#a&&Ld(this.#a,sd.cx,this.#b.x,this.#b.y,this.#l)}#ge(e){if(this.#P!==null&&e-this.#P<gd)return this.#N;this.#P=e;let t=this.getAttribute(`gaze-target`),n=t?this.ownerDocument.querySelector(t):null,r=this.#o?.getBoundingClientRect();if(!n||!r?.width||!r.height)return this.#N=Vu,this.#N;let i=n.getBoundingClientRect();return this.#N={x:(i.left+i.width/2-r.left)*(200/r.width),y:(i.top+i.height/2-r.top)*(100/r.height)},this.#N}#_e(){return this.#d===`thinking`}#ve(){let e=this.#F.now(),t=this.#m,n=qu(t),r=this.#B()*Xu(this.#D-e);this.#C=r,this.#l=Zu(r);for(let[e,i]of[`l`,`r`].entries()){let a=e===0?od.cx:sd.cx;this.#ye(i,n),this.#be(i,a,r,t),this.#xe(i,a,t),this.#Ce(i)}}#ye(e,t){for(let n of this.#e.querySelectorAll(`.eye-body-${e} .socket, .eye-body-${e} .eye-outline, .eye-body-${e} .noise-clip`))xd(n,`rx`,t)}#be(e,t,n,r){let i=this.#e.querySelector(`.pupil-${e} rect`);if(!i)return;xd(i,`x`,t-n),xd(i,`y`,50-n),xd(i,`width`,n*2),xd(i,`height`,n*2),xd(i,`rx`,Ju(n,r));let a=this.#e.querySelector(`.pupil-${e} circle`);xd(a,`cx`,t-n*.3),xd(a,`cy`,50-n*.35),xd(a,`r`,n*.4)}#xe(e,t,n){let r=this.#e.querySelector(`.eye-${e} .lid-clip`);if(!r)return;let i=Qu(this.#_),a=$u(this.#v);xd(r,`y`,i),xd(r,`height`,Math.max(0,a-i)),this.#Se(`.eye-${e} .lid-top`,t,i,n,this.#_),this.#Se(`.eye-${e} .lid-bottom`,t,a,n,this.#v)}#Se(e,t,n,r,i){let a=this.#e.querySelector(e);if(!a)return;let o=ed(n,r);xd(a,`x1`,t-o),xd(a,`x2`,t+o),xd(a,`y1`,n),xd(a,`y2`,n),bd(a,`display`,i>.02?`inline`:`none`)}#Ce(e){let t=this.#e.querySelector(`.brow-${e}`);if(!t)return;let n=this.#_e(),r=e===`l`?this.#y.left:this.#y.right;bd(t,`opacity`,n?`1`:`0`),t.style.transform=n?`translateY(${r.raise.toFixed(2)}px) rotate(${r.tilt.toFixed(2)}deg)`:`translateY(6px)`}#we(){if(this.#De(),this.#s.length===0&&this.#Te(),this.#r?.matches){this.#Ee(null);return}this.#Ee(Fd()),this.#c=window.setInterval(()=>{this.#Ee(Fd())},1e3/ld)}#Te(){let e=this.#o?.getBoundingClientRect(),t=e?Math.min(e.width/200,e.height/100):0,n=cd/(t>0?t:.25);this.#s=[...this.#e.querySelectorAll(`.noise`)].map((e,t)=>{let r=t===0?od.cx:sd.cx,i=[],a=r-od.r,o=r+od.r,s=50-od.r,c=50+od.r;for(let e=s;e<c;e+=n)for(let t=a;t<o;t+=n){let r=B(`rect`,{x:t,y:e,width:Math.min(n,o-t),height:Math.min(n,c-e),opacity:ud});i.push(r)}return e.replaceChildren(...i),i})}#Ee(e){this.#s.forEach((t,n)=>{let r=e===null?Nd(n):Pd(n,e),i=r===0?fd:r;(t[0]?.parentElement)?.setAttribute(`data-seed`,String(i));for(let e of t){i=Md(i);let t=`${dd[i%dd.length]*100}%`;e.setAttribute(`fill`,`rgb(${t} ${t} ${t})`)}})}#De(){this.#c!==null&&(window.clearInterval(this.#c),this.#c=null)}#Oe(){this.#i?.setAttribute(`transform`,`translate(0,0)`),this.#a?.setAttribute(`transform`,`translate(0,0)`)}#ke(e){if(!this.#o||!this.#i||!this.#a)return;let t=this.#o.getBoundingClientRect();!t.width||!t.height||(this.#b={x:(e.clientX-t.left)*(200/t.width),y:(e.clientY-t.top)*(100/t.height)},this.#he())}});var zd=R(`
5753
+ `);function B(e,t,...n){let r=document.createElementNS(od,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function xd(e,t,n){e&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Sd(e,t,n){xd(e,t,n.toFixed(2))}function Cd(e,t){let n=e.replace(`#`,``),r=n.length===3?[...n].map(e=>`${e}${e}`).join(``):n,i=Number.parseInt(r,16);if(!Number.isFinite(i))return e;let a=t<0?0:255,o=e=>Math.round(e+(a-e)*Math.abs(t)).toString(16).padStart(2,`0`);return`#${o(i>>16&255)}${o(i>>8&255)}${o(i&255)}`}function wd(e,t,n){let r=[[`path`,{d:`M108.22,414.88l189.84,460.03c1.36,3.3,6.09,3.16,7.25-.22l159.34-463.34c.87-2.53-1.03-5.16-3.7-5.13l-349.18,3.32c-2.74.03-4.59,2.82-3.55,5.35Z`,fill:e,stroke:t,"stroke-linejoin":`round`,"stroke-width":20}],[`path`,{d:`M261.93,482.48h0c15.03-15.03,4.46-40.72-16.79-40.83h0c-21.37-.11-32.14,25.72-17.03,40.83h0c9.34,9.34,24.48,9.34,33.82,0Z`,fill:n}],[`path`,{d:`M384.85,527.49l-51.82,51.82c-2.24,2.24-2.24,5.86,0,8.1l55.71,55.71c2.24,2.24,5.86,2.24,8.1,0h0c.62-.62,1.08-1.36,1.37-2.19l26.52-77.11c.71-2.07.18-4.36-1.37-5.91l-30.41-30.41c-2.24-2.24-5.86-2.24-8.1,0Z`,fill:n}],[`path`,{d:`M371.7,684.58l-25.94,25.94c-2.24,2.24-2.24,5.86,0,8.1l12.67,12.67c2.99,2.99,8.09,1.82,9.46-2.19l13.28-38.61c1.97-5.74-5.17-10.2-9.46-5.91Z`,fill:n}],[`path`,{d:`M159.42,564.14l2.73,6.83c1.52,3.82,6.46,4.83,9.37,1.93l2.05-2.05c2.24-2.24,2.24-5.86,0-8.1l-4.78-4.78c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}],[`path`,{d:`M243.92,633.11l-48.65-48.65c-5.24-5.24-13.74-5.24-18.99,0h0c-3.8,3.8-4.97,9.49-2.98,14.47l27.77,69.54c3.58,8.95,15.14,11.33,21.96,4.51l20.89-20.89c5.24-5.24,5.24-13.74,0-18.99Z`,fill:n}],[`path`,{d:`M211.32,533.1h0c14.11-14.11,14.11-36.98,0-51.08l-34.94-34.94c-.72-.72-.72-1.89,0-2.62h0c1.16-1.16.34-3.15-1.3-3.16l-11.23-.06c-25.62-.13-43.23,25.72-33.73,49.51l5.37,13.45c1.82,4.55,4.54,8.68,8,12.15l16.74,16.74c14.11,14.11,36.98,14.11,51.08,0Z`,fill:n}],[`path`,{d:`M263.74,792.53h0c-5.69,5.69-7.45,14.23-4.46,21.71l22.5,56.36c6.92,17.34,31.68,16.74,37.75-.92l8.66-25.2c2.5-7.28.64-15.35-4.8-20.79l-31.17-31.17c-7.87-7.87-20.62-7.87-28.48,0Z`,fill:n}],[`path`,{d:`M392.94,503.07l40.81-40.81c2.24-2.24,5.86-2.24,8.1,0l.06.06c2.24,2.24,2.24,5.86,0,8.1l-40.81,40.81c-2.24,2.24-2.24,5.86,0,8.1l22.48,22.48c2.99,2.99,8.09,1.82,9.46-2.19l30.71-89.32c1.27-3.71-1.47-7.57-5.39-7.59l-120.63-.6c-5.11-.03-7.69,6.16-4.08,9.77l51.18,51.18c2.24,2.24,5.86,2.24,8.1,0Z`,fill:n}]],i=[[274.59,463.59,84.73,95.66,42.36,`translate(-268.79 373.91) rotate(-45)`],[291.06,603.84,72.24,90.24,36.12,`translate(-363.06 421.43) rotate(-45)`],[217.18,527.25,72.24,95.66,36.12,`translate(-332.45 347.55) rotate(-45)`],[236.26,661.25,67.04,90.24,33.52,`translate(-420.46 397.65) rotate(-45)`]],a=r.map(([e,t])=>B(e,t));return a.push(...i.map(([e,t,r,i,a,o])=>B(`rect`,{x:e,y:t,width:r,height:i,rx:a,ry:a,transform:o,fill:n})),B(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})),a}function Td(e,t){return[B(`path`,{d:`M566.75,340.67c0-29.85-12.97-56.87-33.96-76.47,4.8-9.98,7.44-20.71,7.44-31.9,0-38.29-30.62-71.33-74.92-86.77.33-3.07.51-6.17.51-9.3,0-69.72-84.29-126.24-188.26-126.24s-188.26,56.52-188.26,126.24c0,4,.29,7.95.83,11.86-34.94,15.4-58.48,44.25-58.48,77.34,0,18.21,7.15,34.25,19.39,49.26-25.1,19.88-41.05,49.47-41.05,82.54,0,59.85,52.15,108.37,116.49,108.37,10.83,0,21.3-1.4,31.26-3.98,31.42,41.91,83.55,69.34,142.55,69.34,64.73,0,121.2-33,151.11-81.94,63.8-.57,115.34-48.85,115.34-108.34Z`,fill:e,stroke:t,"stroke-width":20})]}function Ed(e,t,n,r){return B(`rect`,{x:e-t,y:50-t,width:t*2,height:t*2,rx:n,...r})}function Dd(e,t,n,r){return B(`g`,{class:`pupil pupil-${t}`},Ed(e,n,Yu(n,r),{fill:`#000`}),B(`circle`,{cx:e-n*.3,cy:50-n*.35,r:n*.4,fill:`#fff`}))}function Od(e,t){return B(`line`,{class:`lid-line lid-${t}`,x1:e-38,y1:50,x2:e+38,y2:50,stroke:`#000`,"stroke-width":4,"stroke-linecap":`round`,display:`none`})}function kd(e,t){let n=B(`line`,{class:`brow brow-${t}`,x1:e-22,y1:2,x2:e+22,y2:2,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`,opacity:0});return n.style.transformBox=`fill-box`,n.style.transformOrigin=`center`,n}function Ad(e){return L(`span`,{class:`eyes`,style:`top:${e.eyes.top}%;left:${e.eyes.left}%;width:${e.eyes.width}%;height:${e.eyes.height}%`})}function jd(e,t,n){let r=B(`g`,{class:`${n} eye-${t}`});return r.style.transformOrigin=`${e}px 50px`,r}function Md(e,t,n){let r=`slicc-agent-avatar-noise-${t}`;return B(`g`,{class:`eye-static eye-body-${t}`},B(`defs`,{},B(`clipPath`,{id:r},Ed(e,38,n,{class:`noise-clip`}))),Ed(e,38,n,{class:`socket`,fill:`#fff`}),B(`g`,{class:`noise noise-${t}`,"clip-path":`url(#${r})`,"data-cell-size":ld}),Ed(e,38,n,{class:`eye-outline`,fill:`none`,stroke:`#000`,"stroke-width":4}))}function Nd(e){return e^=e<<13,e^=e>>>17,e^=e<<5,e>>>0}function Pd(e){return(pd^Math.imul(e,hd))>>>0}function Fd(e,t){return(Pd(e)^Math.imul(t,md))>>>0}function Id(){return Math.floor((Date.now()-gd)/1e3*ud)>>>0}function Ld(e){return[B(`circle`,{cx:e,cy:50,r:38,fill:`#fff`,stroke:`#000`,"stroke-width":4}),B(`line`,{x1:e-15,y1:35,x2:e+15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),B(`line`,{x1:e+15,y1:35,x2:e-15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function Rd(e,t,n,r,i){let a=n-t,o=r-50,s=Math.hypot(a,o),c=Math.min(s,i),l=s>0?a/s*c:0,u=s>0?o/s*c:0;e.setAttribute(`transform`,`translate(${l.toFixed(2)},${u.toFixed(2)})`)}var zd={now:()=>performance.now(),requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),delay:(e,t)=>window.setTimeout(e,t),cancelDelay:e=>window.clearTimeout(e),repeat:(e,t)=>window.setInterval(e,t),cancelRepeat:e=>window.clearInterval(e)};I(`slicc-agent-avatar`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`fill`,`connection`,`activity`,`gaze-target`,`drowse-delay`];#e;#t=e=>this.#ke(e);#n=()=>{this.#V(),this.#q(),this.#U()===`static`&&this.#we()};#r=null;#i=null;#a=null;#o=null;#s=[];#c=null;#l=16;#u=!1;#d=null;#f=!1;#p=!1;#m=0;#h=0;#g=!1;#_=0;#v=0;#y=Iu;#b={x:100,y:50};#x=0;#S=0;#C=18;#w=null;#T=0;#E=0;#D=0;#O=null;#k=0;#A=[];#j=null;#M=[];#N=Hu;#P=null;#F=zd;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[bd]}connectedCallback(){this.#r=window.matchMedia(`(prefers-reduced-motion: reduce)`),this.#r.addEventListener(`change`,this.#n),this.#L(),this.#V(),this.#q()}disconnectedCallback(){this.#H(),this.#De(),this.#Q(),this.#r?.removeEventListener(`change`,this.#n),this.#r=null,this.#p=!1}attributeChangedCallback(e){if(this.isConnected){if(e===`activity`||e===`gaze-target`||e===`drowse-delay`){this.#K();return}this.#L(),this.#V(),this.#q()}}get activity(){return Gu(this.getAttribute(`activity`))}set activity(e){e===null?this.removeAttribute(`activity`):this.setAttribute(`activity`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e===null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get drowseDelay(){return Ku(this.getAttribute(`drowse-delay`))}set drowseDelay(e){this.setAttribute(`drowse-delay`,String(e))}get clock(){return this.#F}set clock(e){if(e===this.#F)return;this.#Q(),this.#F=e;let t=e.now();this.#k=t,this.#w!==null&&(this.#w=t),this.#T=0,this.#E=0,this.#D=0,this.#P=null,this.isConnected&&this.#q()}get expression(){return Object.freeze({activity:this.#d,shape:this.#m,lidTop:this.#_,lidBottom:this.#v,pupilRadius:this.#C,gaze:{...this.#b},brows:this.#y,browsVisible:this.#_e()})}wake(){let e=this.#F.now();this.#w=e,this.#W()||(this.#D=e+350,this.#ce()),this.#Y()}scrutinize(){this.#E=this.#F.now()+Mu,this.#Y()}glower(){this.#T=this.#F.now()+Au,this.#Y()}resetExpression(){this.#se();let e=this.#F.now();this.#T=0,this.#E=0,this.#D=0,this.#_=0,this.#v=0,this.#y=Iu,this.#N=Hu,this.#P=null,this.#S=0,this.#w=this.#d===`awaiting`?e:null,this.#g=!1,this.#h=qu(this.#d),this.#m=this.#h,this.#k=e,this.#I()&&this.isConnected&&(this.#ve(),this.#q())}#I(){return this.hasAttribute(`activity`)||this.#f}#L(){this.#De(),this.#s=[];let e=this.getAttribute(`type`)===`cone`?`cone`:`scoop`,t=vd[e],n=this.getAttribute(`color`)??yd[e],r=this.#I();this.#d=Gu(this.getAttribute(`activity`)),this.#d===`awaiting`&&this.#w===null&&(this.#w=this.#F.now()),this.#p||=(this.#m=this.#h=qu(this.#d),!0);let i=B(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...e===`cone`?wd(n,Cd(n,-.38),Cd(n,.3)):Td(n,Cd(n,-.32)));this.#o=B(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...this.#R(r));let a=Ad(t);a.append(this.#o);let o=`--tx:${((.5-t.zoom*((t.eyes.left+t.eyes.width/2)/100))*100).toFixed(2)}%;--ty:${((.5-t.zoom*((t.eyes.top+t.eyes.height/2)/100))*100).toFixed(2)}%;--zoom:${t.zoom}`,s=L(`span`,{class:`icon-inner`,style:o},i,a),c=this.#z(r),l=null;if(c){let e=Ad(t);e.append(c),l=L(`span`,{class:`icon-inner brow-layer`,style:o},e)}this.#e.replaceChildren(L(`span`,{class:`avatar`,"aria-hidden":`true`,"data-expressive":r||null},L(`span`,{class:`crop`},s),l)),this.#i=this.#e.querySelector(`.pupil-l`),this.#a=this.#e.querySelector(`.pupil-r`),this.#U()===`static`&&this.#we(),r&&this.#ve()}#R(e){let t=this.#U();if(t===`none`)return[];if(t===`dead`)return[...Ld(sd.cx),...Ld(cd.cx)];this.#C=this.#B(),this.#l=Qu(this.#C);let n=Ju(this.#m);return[sd.cx,cd.cx].map((r,i)=>{let a=i===0?`l`:`r`,o=t===`static`,s=jd(r,a,o?`eye-frozen`:`eye-blink`),c=o?Md(r,a,n):B(`g`,{class:`eye-body eye-body-${a}`},Ed(r,38,n,{class:`socket`,fill:`#fff`,stroke:`#000`,"stroke-width":4}),Dd(r,a,this.#C,this.#m));if(s.append(c),!e)return s;let l=`slicc-agent-avatar-lid-${a}`;return s.append(B(`defs`,{},B(`clipPath`,{id:l},B(`rect`,{class:`lid-clip`,x:r-38-3,y:9,width:82,height:82}))),Od(r,`top`),Od(r,`bottom`)),c.setAttribute(`clip-path`,`url(#${l})`),s})}#z(e){let t=this.#U();return!e||t===`none`||t===`dead`?null:B(`svg`,{class:`brows-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...[sd.cx,cd.cx].map((e,t)=>{let n=t===0?`l`:`r`,r=B(`g`,{class:`brow-group brow-group-${n}`});return r.style.transformBox=`view-box`,r.style.transformOrigin=`${e}px 50px`,r.append(kd(e,n)),r}))}#B(){return 18*Xu(Math.max(0,Math.min(100,Number.parseFloat(this.getAttribute(`fill`)??`0`)||0)))}#V(){let e=this.#U()===`open`&&!this.#r?.matches&&(this.#d===null||this.#d===`working`);e&&!this.#u?(this.ownerDocument.addEventListener(`pointermove`,this.#t),this.#u=!0):e||(this.#H(),(this.#d===null||this.#d===`working`)&&this.#Oe())}#H(){this.#u&&=(this.ownerDocument.removeEventListener(`pointermove`,this.#t),!1)}#U(){let e=this.getAttribute(`connection`);if(e!==null&&e!==`connected`)return`static`;let t=this.getAttribute(`eyes`);return t===`dead`||t===`none`||t===`static`?t:`open`}#W(){return this.#r?.matches===!0||this.#U()!==`open`||!this.isConnected||!this.#p}#G(){return this.#U()!==`open`}#K(){let e=Gu(this.getAttribute(`activity`)),t=this.#e.querySelector(`.avatar[data-expressive]`)!==null;e===`awaiting`&&this.#d!==`awaiting`?this.#w=this.#F.now():e!==`awaiting`&&(this.#w=null),this.#P=null,this.#d=e,this.#I()!==t&&this.#L(),this.#V(),this.#q()}#q(){if(!this.#I()||!this.isConnected){this.#Q();return}if(this.#G()||this.#r?.matches){this.#Z(),this.#J(),this.#te();return}this.#ue(),this.#X()}#J(){for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#Y(){this.#I()||(this.#f=!0,this.isConnected&&this.#L()),this.#q()}#X(){this.#O===null&&(this.#k=this.#F.now(),this.#O=this.#F.requestFrame(this.#$))}#Z(){this.#O!==null&&(this.#F.cancelFrame(this.#O),this.#O=null)}#Q(){this.#Z();for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[],this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null;for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#$=e=>{this.#O=this.#F.requestFrame(this.#$);let t=Math.min(.05,Math.max(0,(e-this.#k)/1e3));this.#k=e,this.#ee(e,t),this.#ve()};#ee(e,t){let n=qu(this.#d);n!==this.#h&&!this.#g&&this.#ae(n),this.#m=Wu(this.#m,this.#h,6,t),this.#_=Wu(this.#_,this.#re(e,!1),5,t),this.#v=Wu(this.#v,this.#ie(e),5,t),this.#pe(e,t)}#te(){let e=this.#F.now();this.#G()||(this.#h=this.#m=qu(this.#d),this.#_=this.#re(e,!0),this.#v=this.#ie(e),this.#me()),this.#ve(),this.#ne(e)}#ne(e){if(this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null,this.#G())return;let t=this.#d===`awaiting`&&this.#w!==null?this.#w+this.drowseDelay*1e3:1/0,n=Math.min(this.#T>e?this.#T:1/0,this.#E>e?this.#E:1/0,t>e?t:1/0);Number.isFinite(n)&&(this.#j=this.#F.delay(()=>this.#te(),Math.max(0,n-e)+1))}#re(e,t){let n=this.#T>e?ku:0;if(this.#d!==`awaiting`)return n;let r=this.#w===null?0:(e-this.#w)/1e3,i=this.drowseDelay;return Math.max(n,nd(t&&r>i?i+12:r,i))}#ie(e){return this.#E>e?ju:0}#ae(e){if(this.#W()){this.#h=this.#m=e;return}this.#g=!0,this.#ce(()=>{this.#h=this.#m=e,this.#g=!1})}#oe(){return[...this.#e.querySelectorAll(`.eye-blink`)]}#se(){for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[];for(let e of this.#oe())e.style.transition=`none`,e.style.transform=`scaleY(1)`}#ce(e){let t=this.#oe();if(t.length===0){e?.();return}t.forEach((t,n)=>{this.#le(t,n===0?e:void 0)})}#le(e,t){e.style.transition=`transform 110ms ease-in`,e.style.transform=`scaleY(${Eu})`,this.#A.push(this.#F.delay(()=>{t?.(),this.#d===`thinking`&&!this.#G()&&(this.#y=id(this.#y)),e.style.transition=`transform 130ms ease-out`,e.style.transform=`scaleY(1)`},120))}#ue(){this.#M.length>0||this.#W()||this.#G()||[Du,Ou].forEach((e,t)=>{this.#M.push(this.#F.repeat(()=>{let e=this.#oe()[t];e&&this.hasAttribute(`blink`)&&!this.#G()&&this.#le(e)},e))})}#de(e){return this.#d===`thinking`?{target:this.#fe(e,Lu,Ru),rate:9}:this.#d===`idle`?{target:this.#fe(e,zu,Bu),rate:Vu}:this.#d===`awaiting`?{target:this.#ge(e),rate:6}:null}#fe(e,t,n){return e-this.#S>n&&(this.#S=e,this.#x=ad(this.#x,t.length,Math.random)),t[this.#x]??Hu}#pe(e,t){let n=this.#de(e);n&&(this.#b={x:Wu(this.#b.x,n.target.x,n.rate,t),y:Wu(this.#b.y,n.target.y,n.rate,t)},this.#he())}#me(){this.#d===`awaiting`?(this.#b=this.#ge(this.#F.now()),this.#he()):(this.#d===`thinking`||this.#d===`idle`)&&this.#Oe()}#he(){this.#i&&Rd(this.#i,sd.cx,this.#b.x,this.#b.y,this.#l),this.#a&&Rd(this.#a,cd.cx,this.#b.x,this.#b.y,this.#l)}#ge(e){if(this.#P!==null&&e-this.#P<_d)return this.#N;this.#P=e;let t=this.getAttribute(`gaze-target`),n=t?this.ownerDocument.querySelector(t):null,r=this.#o?.getBoundingClientRect();if(!n||!r?.width||!r.height)return this.#N=Hu,this.#N;let i=n.getBoundingClientRect();return this.#N={x:(i.left+i.width/2-r.left)*(200/r.width),y:(i.top+i.height/2-r.top)*(100/r.height)},this.#N}#_e(){return this.#d===`thinking`}#ve(){let e=this.#F.now(),t=this.#m,n=Ju(t),r=this.#B()*Zu(this.#D-e);this.#C=r,this.#l=Qu(r);for(let[e,i]of[`l`,`r`].entries()){let a=e===0?sd.cx:cd.cx;this.#ye(i,n),this.#be(i,a,r,t),this.#xe(i,a,t),this.#Ce(i)}}#ye(e,t){for(let n of this.#e.querySelectorAll(`.eye-body-${e} .socket, .eye-body-${e} .eye-outline, .eye-body-${e} .noise-clip`))Sd(n,`rx`,t)}#be(e,t,n,r){let i=this.#e.querySelector(`.pupil-${e} rect`);if(!i)return;Sd(i,`x`,t-n),Sd(i,`y`,50-n),Sd(i,`width`,n*2),Sd(i,`height`,n*2),Sd(i,`rx`,Yu(n,r));let a=this.#e.querySelector(`.pupil-${e} circle`);Sd(a,`cx`,t-n*.3),Sd(a,`cy`,50-n*.35),Sd(a,`r`,n*.4)}#xe(e,t,n){let r=this.#e.querySelector(`.eye-${e} .lid-clip`);if(!r)return;let i=$u(this.#_),a=ed(this.#v);Sd(r,`y`,i),Sd(r,`height`,Math.max(0,a-i)),this.#Se(`.eye-${e} .lid-top`,t,i,n,this.#_),this.#Se(`.eye-${e} .lid-bottom`,t,a,n,this.#v)}#Se(e,t,n,r,i){let a=this.#e.querySelector(e);if(!a)return;let o=td(n,r);Sd(a,`x1`,t-o),Sd(a,`x2`,t+o),Sd(a,`y1`,n),Sd(a,`y2`,n),xd(a,`display`,i>.02?`inline`:`none`)}#Ce(e){let t=this.#e.querySelector(`.brow-${e}`);if(!t)return;let n=this.#_e(),r=e===`l`?this.#y.left:this.#y.right;xd(t,`opacity`,n?`1`:`0`),t.style.transform=n?`translateY(${r.raise.toFixed(2)}px) rotate(${r.tilt.toFixed(2)}deg)`:`translateY(6px)`}#we(){if(this.#De(),this.#s.length===0&&this.#Te(),this.#r?.matches){this.#Ee(null);return}this.#Ee(Id()),this.#c=window.setInterval(()=>{this.#Ee(Id())},1e3/ud)}#Te(){let e=this.#o?.getBoundingClientRect(),t=e?Math.min(e.width/200,e.height/100):0,n=ld/(t>0?t:.25);this.#s=[...this.#e.querySelectorAll(`.noise`)].map((e,t)=>{let r=t===0?sd.cx:cd.cx,i=[],a=r-sd.r,o=r+sd.r,s=50-sd.r,c=50+sd.r;for(let e=s;e<c;e+=n)for(let t=a;t<o;t+=n){let r=B(`rect`,{x:t,y:e,width:Math.min(n,o-t),height:Math.min(n,c-e),opacity:dd});i.push(r)}return e.replaceChildren(...i),i})}#Ee(e){this.#s.forEach((t,n)=>{let r=e===null?Pd(n):Fd(n,e),i=r===0?pd:r;(t[0]?.parentElement)?.setAttribute(`data-seed`,String(i));for(let e of t){i=Nd(i);let t=`${fd[i%fd.length]*100}%`;e.setAttribute(`fill`,`rgb(${t} ${t} ${t})`)}})}#De(){this.#c!==null&&(window.clearInterval(this.#c),this.#c=null)}#Oe(){this.#i?.setAttribute(`transform`,`translate(0,0)`),this.#a?.setAttribute(`transform`,`translate(0,0)`)}#ke(e){if(!this.#o||!this.#i||!this.#a)return;let t=this.#o.getBoundingClientRect();!t.width||!t.height||(this.#b={x:(e.clientX-t.left)*(200/t.width),y:(e.clientY-t.top)*(100/t.height)},this.#he())}});var Bd=R(`
5754
5754
  :host{display:inline-block;}
5755
5755
  .switcher-more{position:relative;}
5756
5756
  .morebtn{position:relative;display:none;font:inherit;font-size:13px;font-weight:600;color:var(--txt-2);background:transparent;border:1px solid var(--line);border-radius:9999px;height:var(--ctl-h,30px);padding:0 11px;cursor:pointer;line-height:1;align-items:center;}
@@ -5789,14 +5789,14 @@ iframe {
5789
5789
  @keyframes scoopReveal{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:none;}}
5790
5790
  @keyframes scoopArc{from{transform:rotate(-90deg);}to{transform:rotate(270deg);}}
5791
5791
  @media (prefers-reduced-motion:reduce){.popup-row{animation:none;}.popup-row[data-state="working"] .glyph-arc{animation:none;transform:rotate(-90deg);}}
5792
- `),Bd=[4,5,3,7,1,6,2,0,8],Vd=`http://www.w3.org/2000/svg`,Hd=5,Ud=2*Math.PI*Hd;function Wd(e,t,...n){let r=document.createElementNS(Vd,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Gd(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function Kd(e){return e.state??`idle`}function qd(e){return(90+Gd(e)*2.7)/360*Ud}function Jd(e,t,n=0){let r=[];return e===`initializing`?r.push(Wd(`circle`,{class:`initializing-ring`,cx:7,cy:7,r:Hd,"stroke-width":1.7})):r.push(Wd(`circle`,{class:`glyph-base`,cx:7,cy:7,r:Hd,"stroke-width":1.5})),(e===`working`||e===`idle`)&&r.push(Wd(`circle`,{class:`glyph-arc`,cx:7,cy:7,r:Hd,"stroke-width":2,"stroke-dasharray":`${qd(t).toFixed(3)} ${Ud.toFixed(3)}`,"stroke-dashoffset":0})),e===`working`&&r.push(Wd(`circle`,{class:`glyph-pin`,cx:7,cy:7,r:1.25})),e===`broken`&&r.push(Wd(`line`,{class:`broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),Wd(`line`,{class:`broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8})),n>0&&r.push(Wd(`circle`,{class:`glyph-unread`,cx:10.89,cy:3.11,r:2.4,"stroke-width":1.5})),Wd(`svg`,{class:`status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...r)}function Yd(e){return typeof e.unread==`number`&&Number.isFinite(e.unread)?Math.max(0,Math.floor(e.unread)):0}function Xd(e){return e.state===`broken`?`broken`:(e.fill??0)>=75?`near-limit`:e.state===`working`?`working`:`idle`}function Zd(e){return e===`broken`?3:e===`near-limit`?2:+(e===`working`)}function Qd(e){let t=e.reduce((e,t)=>{let n=Xd(t);return Zd(n)>Zd(e)?n:e},`idle`),n=t===`near-limit`?`near context limit`:t,r=e.reduce((e,t)=>e+Yd(t),0),i=r>0?`; ${r} unread message${r===1?``:`s`}`:``;return`${e.length} hidden scoop${e.length===1?``:`s`}; worst state ${n}${i}`}function $d(e,t=!1){if(t)return L(`span`,{class:`overflow-grid-cell overflow-grid-cell--plus`,"aria-hidden":`true`},L(`span`,{class:`overflow-plus-bar overflow-plus-bar--horizontal`}),L(`span`,{class:`overflow-plus-bar overflow-plus-bar--vertical`}));let n={class:`overflow-grid-cell`,"aria-hidden":`true`};return e&&(n[`data-dot-state`]=e),L(`span`,n)}function ef(e){let t=e.map((e,t)=>({order:t,state:Xd(e)})).sort((e,t)=>Zd(t.state)-Zd(e.state)||e.order-t.order).slice(0,e.length>9?8:9),n=Array.from({length:Bd.length},()=>$d());return t.forEach((e,t)=>{n[Bd[t]]=$d(e.state)}),e.length>9&&(n[Bd.at(-1)]=$d(void 0,!0)),L(`span`,{class:`overflow-grid`,role:`img`,"aria-label":Qd(e),"data-hidden-count":String(e.length)},...n)}I(`slicc-scoop-overflow`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n;#r;#i;#a;#o=e=>{this.open&&!this.contains(e.target)&&this.close()};#s=e=>{!this.open||e.key!==`Escape`||(e.preventDefault(),this.close(),this.#r.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[zd]}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s)}attributeChangedCallback(e){e===`open`&&this.#n&&this.#u()}get items(){return this.#t}set items(e){this.#t=Array.isArray(e)?e:[],this.isConnected&&this.#l()}get count(){return this.#t.length}get hasOverflow(){return this.#t.length>0}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}show(){this.open||=!0}close(){this.open&&=!1}toggle(){this.open=!this.open}#c(){this.#i=L(`slot`,{name:`more`},ef(this.#t)),this.#r=L(`button`,{class:`morebtn`,part:`more`,type:`button`,title:`More scoops`,"aria-haspopup":`true`,"aria-expanded":`false`},this.#i),this.#a=L(`div`,{class:`pop`,part:`pop`,role:`menu`}),this.#n=L(`div`,{class:`switcher-more`,part:`wrap`},this.#r,this.#a),this.#r.addEventListener(`click`,e=>{e.stopPropagation(),this.toggle()}),this.#e.replaceChildren(this.#n),this.#l(),this.#u()}#l(){let e=this.#t.length;e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`),this.#n.classList.toggle(`has-overflow`,e>0),this.#r.setAttribute(`aria-haspopup`,`true`);let t=Qd(this.#t);this.#r.setAttribute(`aria-label`,`${t}. Show hidden scoops`);let n=this.#t.reduce((e,t)=>e+Yd(t),0);if(n>0?this.#r.setAttribute(`data-unread`,String(n)):this.#r.removeAttribute(`data-unread`),this.#i.replaceChildren(ef(this.#t)),e===0){this.#a.replaceChildren(L(`slot`,{name:`empty`})),this.open&&this.close();return}let r=[];this.#t.forEach((e,t)=>{let n=e.id,i=e.label??e.id,a=Kd(e),o=Gd(e.fill),s=Yd(e),c=L(`button`,{class:`popup-row`,part:`row`,type:`button`,role:`menuitem`,"aria-label":`${i}: ${a}, ${o}% context fill${s>0?`, ${s} unread message${s===1?``:`s`}`:``}`,"data-state":a,"data-k":n,...s>0?{"data-unread":String(s)}:{},style:`--hue:${e.color??`var(--rose)`};--i:${t}`},Jd(a,o,s),L(`span`,{class:`popup-label`},i),L(`span`,{class:`popup-state`},`${a} · ${o}%`));c.addEventListener(`click`,()=>{let e=c.dataset.k??``,t=this.#t.find(t=>t.id===e);this.#d(e,t?.label??e)}),r.push(c)}),this.#a.replaceChildren(...r)}#u(){let e=this.open;this.#n.classList.toggle(`open`,e),this.#r.setAttribute(`aria-expanded`,e?`true`:`false`),document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s),e&&(document.addEventListener(`click`,this.#o),document.addEventListener(`keydown`,this.#s))}#d(e,t){this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0})),this.close()}});var tf={cx:10.89,cy:3.11,r:2.4,halo:1.5},V=`slicc-agent-tabs`,nf=`${V}-style`,rf=`http://www.w3.org/2000/svg`,af=5,of=2*Math.PI*af,sf=26,cf=8,lf=6,uf=39,df=`sliccy`,ff=14,pf=5,mf=16,hf=4,gf=65,_f={cone:`var(--waffle)`,researcher:`var(--cyan)`,designer:`var(--violet)`,tester:`var(--amber)`,triage:`var(--green)`},vf=`
5793
- .slicc-agent-tabs{display:flex;align-items:center;gap:${cf}px;min-width:0;overflow:visible;color:var(--ink);font-family:var(--ui);}
5792
+ `),Vd=[4,5,3,7,1,6,2,0,8],Hd=`http://www.w3.org/2000/svg`,Ud=5,Wd=2*Math.PI*Ud;function Gd(e,t,...n){let r=document.createElementNS(Hd,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Kd(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function qd(e){return e.state??`idle`}function Jd(e){return(90+Kd(e)*2.7)/360*Wd}function Yd(e,t,n=0){let r=[];return e===`initializing`?r.push(Gd(`circle`,{class:`initializing-ring`,cx:7,cy:7,r:Ud,"stroke-width":1.7})):r.push(Gd(`circle`,{class:`glyph-base`,cx:7,cy:7,r:Ud,"stroke-width":1.5})),(e===`working`||e===`idle`)&&r.push(Gd(`circle`,{class:`glyph-arc`,cx:7,cy:7,r:Ud,"stroke-width":2,"stroke-dasharray":`${Jd(t).toFixed(3)} ${Wd.toFixed(3)}`,"stroke-dashoffset":0})),e===`working`&&r.push(Gd(`circle`,{class:`glyph-pin`,cx:7,cy:7,r:1.25})),e===`broken`&&r.push(Gd(`line`,{class:`broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),Gd(`line`,{class:`broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8})),n>0&&r.push(Gd(`circle`,{class:`glyph-unread`,cx:10.89,cy:3.11,r:2.4,"stroke-width":1.5})),Gd(`svg`,{class:`status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...r)}function Xd(e){return typeof e.unread==`number`&&Number.isFinite(e.unread)?Math.max(0,Math.floor(e.unread)):0}function Zd(e){return e.state===`broken`?`broken`:(e.fill??0)>=75?`near-limit`:e.state===`working`?`working`:`idle`}function Qd(e){return e===`broken`?3:e===`near-limit`?2:+(e===`working`)}function $d(e){let t=e.reduce((e,t)=>{let n=Zd(t);return Qd(n)>Qd(e)?n:e},`idle`),n=t===`near-limit`?`near context limit`:t,r=e.reduce((e,t)=>e+Xd(t),0),i=r>0?`; ${r} unread message${r===1?``:`s`}`:``;return`${e.length} hidden scoop${e.length===1?``:`s`}; worst state ${n}${i}`}function ef(e,t=!1){if(t)return L(`span`,{class:`overflow-grid-cell overflow-grid-cell--plus`,"aria-hidden":`true`},L(`span`,{class:`overflow-plus-bar overflow-plus-bar--horizontal`}),L(`span`,{class:`overflow-plus-bar overflow-plus-bar--vertical`}));let n={class:`overflow-grid-cell`,"aria-hidden":`true`};return e&&(n[`data-dot-state`]=e),L(`span`,n)}function tf(e){let t=e.map((e,t)=>({order:t,state:Zd(e)})).sort((e,t)=>Qd(t.state)-Qd(e.state)||e.order-t.order).slice(0,e.length>9?8:9),n=Array.from({length:Vd.length},()=>ef());return t.forEach((e,t)=>{n[Vd[t]]=ef(e.state)}),e.length>9&&(n[Vd.at(-1)]=ef(void 0,!0)),L(`span`,{class:`overflow-grid`,role:`img`,"aria-label":$d(e),"data-hidden-count":String(e.length)},...n)}I(`slicc-scoop-overflow`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n;#r;#i;#a;#o=e=>{this.open&&!this.contains(e.target)&&this.close()};#s=e=>{!this.open||e.key!==`Escape`||(e.preventDefault(),this.close(),this.#r.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Bd]}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s)}attributeChangedCallback(e){e===`open`&&this.#n&&this.#u()}get items(){return this.#t}set items(e){this.#t=Array.isArray(e)?e:[],this.isConnected&&this.#l()}get count(){return this.#t.length}get hasOverflow(){return this.#t.length>0}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}show(){this.open||=!0}close(){this.open&&=!1}toggle(){this.open=!this.open}#c(){this.#i=L(`slot`,{name:`more`},tf(this.#t)),this.#r=L(`button`,{class:`morebtn`,part:`more`,type:`button`,title:`More scoops`,"aria-haspopup":`true`,"aria-expanded":`false`},this.#i),this.#a=L(`div`,{class:`pop`,part:`pop`,role:`menu`}),this.#n=L(`div`,{class:`switcher-more`,part:`wrap`},this.#r,this.#a),this.#r.addEventListener(`click`,e=>{e.stopPropagation(),this.toggle()}),this.#e.replaceChildren(this.#n),this.#l(),this.#u()}#l(){let e=this.#t.length;e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`),this.#n.classList.toggle(`has-overflow`,e>0),this.#r.setAttribute(`aria-haspopup`,`true`);let t=$d(this.#t);this.#r.setAttribute(`aria-label`,`${t}. Show hidden scoops`);let n=this.#t.reduce((e,t)=>e+Xd(t),0);if(n>0?this.#r.setAttribute(`data-unread`,String(n)):this.#r.removeAttribute(`data-unread`),this.#i.replaceChildren(tf(this.#t)),e===0){this.#a.replaceChildren(L(`slot`,{name:`empty`})),this.open&&this.close();return}let r=[];this.#t.forEach((e,t)=>{let n=e.id,i=e.label??e.id,a=qd(e),o=Kd(e.fill),s=Xd(e),c=L(`button`,{class:`popup-row`,part:`row`,type:`button`,role:`menuitem`,"aria-label":`${i}: ${a}, ${o}% context fill${s>0?`, ${s} unread message${s===1?``:`s`}`:``}`,"data-state":a,"data-k":n,...s>0?{"data-unread":String(s)}:{},style:`--hue:${e.color??`var(--rose)`};--i:${t}`},Yd(a,o,s),L(`span`,{class:`popup-label`},i),L(`span`,{class:`popup-state`},`${a} · ${o}%`));c.addEventListener(`click`,()=>{let e=c.dataset.k??``,t=this.#t.find(t=>t.id===e);this.#d(e,t?.label??e)}),r.push(c)}),this.#a.replaceChildren(...r)}#u(){let e=this.open;this.#n.classList.toggle(`open`,e),this.#r.setAttribute(`aria-expanded`,e?`true`:`false`),document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s),e&&(document.addEventListener(`click`,this.#o),document.addEventListener(`keydown`,this.#s))}#d(e,t){this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0})),this.close()}});var nf={cx:10.89,cy:3.11,r:2.4,halo:1.5},V=`slicc-agent-tabs`,rf=`${V}-style`,af=`http://www.w3.org/2000/svg`,of=5,sf=2*Math.PI*of,cf=26,lf=8,uf=6,df=39,ff=`sliccy`,pf=14,mf=5,hf=16,gf=4,_f=65,vf={cone:`var(--waffle)`,researcher:`var(--cyan)`,designer:`var(--violet)`,tester:`var(--amber)`,triage:`var(--green)`},yf=`
5793
+ .slicc-agent-tabs{display:flex;align-items:center;gap:${lf}px;min-width:0;overflow:visible;color:var(--ink);font-family:var(--ui);}
5794
5794
  .slicc-agent-tabs *{box-sizing:border-box;}
5795
- .slicc-agent-tabs__focus-avatar{display:block;flex:0 0 ${sf}px;width:${sf}px;height:${sf}px;pointer-events:none;}
5795
+ .slicc-agent-tabs__focus-avatar{display:block;flex:0 0 ${cf}px;width:${cf}px;height:${cf}px;pointer-events:none;}
5796
5796
  .slicc-agent-tabs__track-frame{position:relative;flex:0 1 auto;min-width:0;height:var(--ctl-h,30px);overflow:visible;border:1px solid var(--line);border-radius:9px;background:var(--ghost);}
5797
5797
  .slicc-agent-tabs__track{display:flex;align-items:center;min-width:0;height:100%;padding:2px;overflow:hidden;}
5798
5798
  .slicc-agent-tabs.has-overflow .slicc-agent-tabs__track{padding-right:41px;}
5799
- .slicc-agent-tabs__segment{position:relative;display:inline-flex;flex:0 1 auto;align-items:center;justify-content:center;gap:${pf}px;width:max-content;min-width:var(--slicc-agent-tabs-segment-floor,${gf}px);max-width:160px;height:24px;padding:0 8px;overflow:hidden;color:var(--txt-2);font:500 11px/1 var(--ui);white-space:nowrap;border:0;border-radius:6px;background:transparent;cursor:pointer;}
5799
+ .slicc-agent-tabs__segment{position:relative;display:inline-flex;flex:0 1 auto;align-items:center;justify-content:center;gap:${mf}px;width:max-content;min-width:var(--slicc-agent-tabs-segment-floor,${_f}px);max-width:160px;height:24px;padding:0 8px;overflow:hidden;color:var(--txt-2);font:500 11px/1 var(--ui);white-space:nowrap;border:0;border-radius:6px;background:transparent;cursor:pointer;}
5800
5800
  .slicc-agent-tabs__segment:hover{color:var(--ink);}
5801
5801
  .slicc-agent-tabs__segment[aria-selected='true']{color:var(--ink);background:var(--canvas);box-shadow:0 1px 3px color-mix(in srgb,var(--ink) 12%,transparent);}
5802
5802
  .slicc-agent-tabs__segment.hide{display:none;}
@@ -5833,7 +5833,7 @@ iframe {
5833
5833
  .slicc-agent-tabs slicc-scoop-overflow::part(pop){right:0;left:auto;}
5834
5834
  @keyframes slicc-agent-tabs-arc{from{transform:rotate(-90deg);}to{transform:rotate(270deg);}}
5835
5835
  @media (prefers-reduced-motion:reduce){.slicc-agent-tabs__glyph-arc{animation:none;transform:rotate(-90deg);}.slicc-agent-tabs__glyph-glow{transition:none;}}
5836
- `;function yf(e){if(e.getElementById(nf))return;let t=e.createElement(`style`);t.id=nf,t.textContent=vf,(e.head??e.documentElement).append(t)}function bf(e,t,...n){let r=document.createElementNS(rf,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function xf(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function Sf(e){let t=e.ownerDocument.createElement(`canvas`).getContext(`2d`),n=e.ownerDocument.defaultView?.getComputedStyle(e);return!t||!n?gf:(t.font=n.font,Math.ceil(t.measureText(df).width+ff+pf+mf)+hf)}function Cf(e){return(90+xf(e)*2.7)/360*of}function wf(e,t){return t===`working`?e.phase===`tool`?`tool`:`thinking`:null}function Tf(e,t){return t===`working`?wf(e,t)===`tool`?`working`:`thinking`:t===`idle`?e.awaiting?`awaiting`:`idle`:null}function Ef(e,t){return t||typeof e.unread!=`number`||!Number.isFinite(e.unread)?0:Math.max(0,Math.floor(e.unread))}function Df(e,t){return e.state?e.state:e.eyes===`dead`?`broken`:t===e.key?`working`:`idle`}function Of(e){return e.type===`cone`||e.key===`cone`?`cone`:`scoop`}function kf(e){return e.eyes??`open`}function Af(e){return _f[e.key]??e.color??`var(--rose)`}function jf(e){let t=[bf(`circle`,{class:`${V}__glyph-glow`,cx:7,cy:7,r:af,"stroke-width":1.5}),bf(`circle`,{class:`${V}__glyph-base`,cx:7,cy:7,r:af,"stroke-width":1.5}),bf(`circle`,{class:`${V}__glyph-arc`,cx:7,cy:7,r:af,"stroke-width":2,"stroke-dasharray":`${Cf(xf(e.fill)).toFixed(3)} ${of.toFixed(3)}`,"stroke-dashoffset":0}),bf(`circle`,{class:`${V}__glyph-pin`,cx:7,cy:7,r:1.25}),bf(`rect`,{class:`${V}__glyph-pin-square`,x:5.5,y:5.5,width:3,height:3,rx:.15}),bf(`line`,{class:`${V}__broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),bf(`line`,{class:`${V}__broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8}),bf(`circle`,{class:`${V}__initializing-ring`,cx:7,cy:7,r:af,"stroke-width":1.7}),bf(`circle`,{class:`${V}__glyph-unread`,cx:tf.cx,cy:tf.cy,r:tf.r,"stroke-width":tf.halo})];return bf(`svg`,{class:`${V}__status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...t)}I(`slicc-agent-tabs`,class extends HTMLElement{static observedAttributes=[`active`,`attention`,`connection`,`gaze-target`,`drowse-delay`];#e=[];#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=!1;#c=null;#l=!1;#u=null;#d=e=>this.#w(e);#f=e=>this.#T(e);connectedCallback(){yf(this.ownerDocument),this.classList.add(V),this.setAttribute(`part`,`row`),this.#l||=!0,this.addEventListener(`click`,this.#d),this.addEventListener(`keydown`,this.#f),this.#m(),this.#k(),requestAnimationFrame(()=>this.reflow())}disconnectedCallback(){this.#o?.disconnect(),this.#o=null,this.#c!==null&&cancelAnimationFrame(this.#c),this.#c=null,this.removeEventListener(`click`,this.#d),this.removeEventListener(`keydown`,this.#f)}attributeChangedCallback(e,t,n){!this.#l||!this.isConnected||(this.#m(),this.reflow(),e===`active`&&n!==null&&n!==t&&this.#E(n))}get scoops(){return this.#e.map(e=>({...e}))}set scoops(e){let t=new Map;if(Array.isArray(e))for(let n of e)t.has(n.key)||t.set(n.key,{...n});this.#e=[...t.values()],this.#l&&this.isConnected&&(this.#m(),this.reflow())}get attention(){return this.getAttribute(`attention`)}set attention(e){e==null?this.removeAttribute(`attention`):this.setAttribute(`attention`,e)}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get connection(){return this.getAttribute(`connection`)===`disconnected`?`disconnected`:`connected`}set connection(e){this.setAttribute(`connection`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e==null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get arrowKeys(){return this.getAttribute(`arrow-keys`)===`off`?`off`:`on`}set arrowKeys(e){e===`off`?this.setAttribute(`arrow-keys`,`off`):this.removeAttribute(`arrow-keys`)}get drowseDelay(){let e=this.getAttribute(`drowse-delay`);if(e===null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}set drowseDelay(e){e==null?this.removeAttribute(`drowse-delay`):this.setAttribute(`drowse-delay`,String(e))}scrutinize(){this.#t?.scrutinize()}glower(){this.#t?.glower()}wake(){this.#t?.wake()}select(e){this.active=e;let t=this.#e.find(t=>t.key===e)?.label??e;this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0}))}reflow(){if(!(!this.isConnected||this.#s)){this.#s=!0;try{this.#p()}finally{this.#s=!1}}}#p(){let e=[...this.querySelectorAll(`.${V}__segment`)];for(let t of e)t.classList.remove(`hide`);if(this.classList.remove(`has-overflow`),e.length===0){this.#C([]);return}this.#u===null&&(this.#u=Sf(e[0]),this.style.setProperty(`--slicc-agent-tabs-segment-floor`,`${this.#u}px`));let t=this.clientWidth;if(t<=0){this.#C([]),requestAnimationFrame(()=>{this.isConnected&&this.clientWidth>0&&this.reflow()});return}let n=Math.max(0,t-sf-cf-lf),r=e.map(e=>e.offsetWidth),i=r.reduce((e,t)=>e+t,0),a=e.length>1&&i>n+1;this.classList.toggle(`has-overflow`,a);let o=a?e.map(e=>e.offsetWidth):r,s=Math.max(0,n-(a?uf:0));if(!a){this.#C([]);return}let c=[],l=0;e.forEach((e,t)=>{t===0||c.length===0&&l+o[t]<=s?l+=o[t]:(e.classList.add(`hide`),c.push(e))}),this.#C(c)}#m(){let e=this.#D(),t=this.#e.find(e=>e.key===this.active)??this.#e.at(0)??null;this.#h(),this.#v(t),this.#x(t?.key??null),e!=null&&!this.#e.some(t=>t.key===e)&&this.#O(t?.key??null)?.focus()}#h(){if(this.#r&&this.#i&&this.#a&&this.contains(this.#i))return;this.#r=L(`div`,{class:`${V}__track`,part:`track`,role:`tablist`,"aria-label":`Agents`});let e=this.ownerDocument.createElement(`slicc-scoop-overflow`);e.setAttribute(`part`,`overflow`),e.addEventListener(`slicc-scoop-select`,e=>{let t=e.detail?.id;typeof t==`string`&&(e.stopPropagation(),this.select(t))}),this.#a=e,this.#i=L(`div`,{class:`${V}__track-frame`,part:`track-frame`},this.#r,e),this.replaceChildren(this.#i)}#g(e){let t=L(`slicc-agent-avatar`,{class:`${V}__focus-avatar`,part:`avatar`,role:`img`});return this.#_(t,e),t}#_(e,t){let n=Df(t,this.attention);this.#S(e,`type`,Of(t)),this.#S(e,`color`,t.color??null),this.#S(e,`eyes`,kf(t)),this.#S(e,`connection`,this.getAttribute(`connection`)),this.#S(e,`fill`,String(Math.round(xf(t.fill)))),this.#S(e,`blink`,n===`working`),this.#S(e,`activity`,Tf(t,n)),this.#S(e,`gaze-target`,this.getAttribute(`gaze-target`)),this.#S(e,`drowse-delay`,this.getAttribute(`drowse-delay`)),this.#S(e,`aria-label`,`${t.label??t.key} focused agent`),e.style.setProperty(`--slicc-agent-tabs-hue`,Af(t))}#v(e){if(!e){this.#t?.remove(),this.#t=null,this.#n=null;return}let t=this.#t??this.#g(e);this.#t=t;let n=this.#n!==null&&this.#n!==e.key;this.#n=e.key,this.#_(t,e),n&&t.resetExpression(),(t.parentElement!==this||t.nextElementSibling!==this.#i)&&this.insertBefore(t,this.#i)}#y(e,t){let n=L(`button`,{part:`segment`,type:`button`,role:`tab`},jf(e),L(`span`,{class:`${V}__label`},e.label??e.key));return this.#b(n,e,t),n}#b(e,t,n){let r=Df(t,this.attention),i=wf(t,r),a=xf(t.fill),o=this.attention===t.key,s=Ef(t,t.key===n);e.className=`${V}__segment${t.ephemeral?` ephemeral`:``}`,e.setAttribute(`aria-selected`,String(t.key===n)),e.tabIndex=t.key===n?0:-1;let c=i===`tool`?` (running a tool)`:i?` (thinking)`:``,l=s>0?`, ${s} unread message${s===1?``:`s`}`:``;e.setAttribute(`aria-label`,`${t.label??t.key}: ${r}${c}, ${Math.round(a)}% context fill${o?`, spoke most recently`:``}${l}`),e.dataset.k=t.key,e.dataset.state=r,this.#S(e,`data-phase`,i),this.#S(e,`data-attention`,o?`true`:null),e.style.setProperty(`--slicc-agent-tabs-hue`,Af(t)),this.#S(e,`data-unread`,s>0?String(s):null);let u=e.querySelector(`.${V}__label`);u&&(u.textContent=t.label??t.key),e.querySelector(`.${V}__glyph-arc`)?.setAttribute(`stroke-dasharray`,`${Cf(a).toFixed(3)} ${of.toFixed(3)}`)}#x(e){if(!this.#r)return;let t=new Map;for(let e of this.#r.querySelectorAll(`:scope > .${V}__segment`)){let n=e.dataset.k??``;t.has(n)?e.remove():t.set(n,e)}let n=this.#e.map(n=>{let r=t.get(n.key)??this.#y(n,e);return t.delete(n.key),this.#b(r,n,e),r});for(let e of t.values())e.remove();n.forEach((e,t)=>{let n=this.#r?.children.item(t)??null;n!==e&&this.#r?.insertBefore(e,n)})}#S(e,t,n){n===null||n===!1?e.hasAttribute(t)&&e.removeAttribute(t):n===!0?e.hasAttribute(t)||e.setAttribute(t,``):e.getAttribute(t)!==n&&e.setAttribute(t,n)}#C(e){if(!this.#a)return;let t=e.map(e=>{let t=e.dataset.k??``,n=this.#e.find(e=>e.key===t)??{key:t};return{id:t,label:n.label??t,type:Of(n),color:n.color,eyes:kf(n),state:Df(n,this.attention),fill:xf(n.fill),unread:Number(e.dataset.unread??0)}});this.#a.items=t}#w(e){let t=e.target?.closest(`.${V}__segment`);t&&this.contains(t)&&t.dataset.k&&this.select(t.dataset.k)}#T(e){let t=e.target?.closest(`.${V}__segment`);if(!t||!this.contains(t))return;if(e.key===`Enter`||e.key===` `){if(!t.dataset.k)return;e.preventDefault(),this.select(t.dataset.k);return}if((e.key===`ArrowLeft`||e.key===`ArrowRight`)&&this.arrowKeys===`off`)return;let n=[...this.querySelectorAll(`.${V}__segment:not(.hide)`)].filter(e=>!e.disabled),r=n.indexOf(t);if(r<0||n.length===0)return;let i;if(e.key===`ArrowLeft`)i=n[(r-1+n.length)%n.length];else if(e.key===`ArrowRight`)i=n[(r+1)%n.length];else if(e.key===`Home`)i=n[0];else if(e.key===`End`)i=n.at(-1);else return;e.preventDefault(),i?.focus()}#E(e){let t=this.#D();t!==null&&t!==e&&this.#O(e)?.focus()}#D(){let e=this.ownerDocument.activeElement;return!(e instanceof Element)||!this.contains(e)?null:e.closest(`.${V}__segment`)?.dataset.k??null}#O(e){return e==null?null:[...this.querySelectorAll(`.${V}__segment`)].find(t=>t.dataset.k===e)??null}#k(){this.#o||typeof ResizeObserver>`u`||(this.#o=new ResizeObserver(()=>{this.#c===null&&(this.#c=requestAnimationFrame(()=>{this.#c=null,this.reflow()}))}),this.#o.observe(this),this.parentElement&&this.#o.observe(this.parentElement))}});var Mf=`/**
5836
+ `;function bf(e){if(e.getElementById(rf))return;let t=e.createElement(`style`);t.id=rf,t.textContent=yf,(e.head??e.documentElement).append(t)}function xf(e,t,...n){let r=document.createElementNS(af,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Sf(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function Cf(e){let t=e.ownerDocument.createElement(`canvas`).getContext(`2d`),n=e.ownerDocument.defaultView?.getComputedStyle(e);return!t||!n?_f:(t.font=n.font,Math.ceil(t.measureText(ff).width+pf+mf+hf)+gf)}function wf(e){return(90+Sf(e)*2.7)/360*sf}function Tf(e,t){return t===`working`?e.phase===`tool`?`tool`:`thinking`:null}function Ef(e,t){return t===`working`?Tf(e,t)===`tool`?`working`:`thinking`:t===`idle`?e.awaiting?`awaiting`:`idle`:null}function Df(e,t){return t||typeof e.unread!=`number`||!Number.isFinite(e.unread)?0:Math.max(0,Math.floor(e.unread))}function Of(e,t){return e.state?e.state:e.eyes===`dead`?`broken`:t===e.key?`working`:`idle`}function kf(e){return e.type===`cone`||e.key===`cone`?`cone`:`scoop`}function Af(e){return e.eyes??`open`}function jf(e){return vf[e.key]??e.color??`var(--rose)`}function Mf(e){let t=[xf(`circle`,{class:`${V}__glyph-glow`,cx:7,cy:7,r:of,"stroke-width":1.5}),xf(`circle`,{class:`${V}__glyph-base`,cx:7,cy:7,r:of,"stroke-width":1.5}),xf(`circle`,{class:`${V}__glyph-arc`,cx:7,cy:7,r:of,"stroke-width":2,"stroke-dasharray":`${wf(Sf(e.fill)).toFixed(3)} ${sf.toFixed(3)}`,"stroke-dashoffset":0}),xf(`circle`,{class:`${V}__glyph-pin`,cx:7,cy:7,r:1.25}),xf(`rect`,{class:`${V}__glyph-pin-square`,x:5.5,y:5.5,width:3,height:3,rx:.15}),xf(`line`,{class:`${V}__broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),xf(`line`,{class:`${V}__broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8}),xf(`circle`,{class:`${V}__initializing-ring`,cx:7,cy:7,r:of,"stroke-width":1.7}),xf(`circle`,{class:`${V}__glyph-unread`,cx:nf.cx,cy:nf.cy,r:nf.r,"stroke-width":nf.halo})];return xf(`svg`,{class:`${V}__status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...t)}I(`slicc-agent-tabs`,class extends HTMLElement{static observedAttributes=[`active`,`attention`,`connection`,`gaze-target`,`drowse-delay`];#e=[];#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=!1;#c=null;#l=!1;#u=null;#d=e=>this.#w(e);#f=e=>this.#T(e);connectedCallback(){bf(this.ownerDocument),this.classList.add(V),this.setAttribute(`part`,`row`),this.#l||=!0,this.addEventListener(`click`,this.#d),this.addEventListener(`keydown`,this.#f),this.#m(),this.#k(),requestAnimationFrame(()=>this.reflow())}disconnectedCallback(){this.#o?.disconnect(),this.#o=null,this.#c!==null&&cancelAnimationFrame(this.#c),this.#c=null,this.removeEventListener(`click`,this.#d),this.removeEventListener(`keydown`,this.#f)}attributeChangedCallback(e,t,n){!this.#l||!this.isConnected||(this.#m(),this.reflow(),e===`active`&&n!==null&&n!==t&&this.#E(n))}get scoops(){return this.#e.map(e=>({...e}))}set scoops(e){let t=new Map;if(Array.isArray(e))for(let n of e)t.has(n.key)||t.set(n.key,{...n});this.#e=[...t.values()],this.#l&&this.isConnected&&(this.#m(),this.reflow())}get attention(){return this.getAttribute(`attention`)}set attention(e){e==null?this.removeAttribute(`attention`):this.setAttribute(`attention`,e)}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get connection(){return this.getAttribute(`connection`)===`disconnected`?`disconnected`:`connected`}set connection(e){this.setAttribute(`connection`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e==null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get arrowKeys(){return this.getAttribute(`arrow-keys`)===`off`?`off`:`on`}set arrowKeys(e){e===`off`?this.setAttribute(`arrow-keys`,`off`):this.removeAttribute(`arrow-keys`)}get drowseDelay(){let e=this.getAttribute(`drowse-delay`);if(e===null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}set drowseDelay(e){e==null?this.removeAttribute(`drowse-delay`):this.setAttribute(`drowse-delay`,String(e))}scrutinize(){this.#t?.scrutinize()}glower(){this.#t?.glower()}wake(){this.#t?.wake()}select(e){this.active=e;let t=this.#e.find(t=>t.key===e)?.label??e;this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0}))}reflow(){if(!(!this.isConnected||this.#s)){this.#s=!0;try{this.#p()}finally{this.#s=!1}}}#p(){let e=[...this.querySelectorAll(`.${V}__segment`)];for(let t of e)t.classList.remove(`hide`);if(this.classList.remove(`has-overflow`),e.length===0){this.#C([]);return}this.#u===null&&(this.#u=Cf(e[0]),this.style.setProperty(`--slicc-agent-tabs-segment-floor`,`${this.#u}px`));let t=this.clientWidth;if(t<=0){this.#C([]),requestAnimationFrame(()=>{this.isConnected&&this.clientWidth>0&&this.reflow()});return}let n=Math.max(0,t-cf-lf-uf),r=e.map(e=>e.offsetWidth),i=r.reduce((e,t)=>e+t,0),a=e.length>1&&i>n+1;this.classList.toggle(`has-overflow`,a);let o=a?e.map(e=>e.offsetWidth):r,s=Math.max(0,n-(a?df:0));if(!a){this.#C([]);return}let c=[],l=0;e.forEach((e,t)=>{t===0||c.length===0&&l+o[t]<=s?l+=o[t]:(e.classList.add(`hide`),c.push(e))}),this.#C(c)}#m(){let e=this.#D(),t=this.#e.find(e=>e.key===this.active)??this.#e.at(0)??null;this.#h(),this.#v(t),this.#x(t?.key??null),e!=null&&!this.#e.some(t=>t.key===e)&&this.#O(t?.key??null)?.focus()}#h(){if(this.#r&&this.#i&&this.#a&&this.contains(this.#i))return;this.#r=L(`div`,{class:`${V}__track`,part:`track`,role:`tablist`,"aria-label":`Agents`});let e=this.ownerDocument.createElement(`slicc-scoop-overflow`);e.setAttribute(`part`,`overflow`),e.addEventListener(`slicc-scoop-select`,e=>{let t=e.detail?.id;typeof t==`string`&&(e.stopPropagation(),this.select(t))}),this.#a=e,this.#i=L(`div`,{class:`${V}__track-frame`,part:`track-frame`},this.#r,e),this.replaceChildren(this.#i)}#g(e){let t=L(`slicc-agent-avatar`,{class:`${V}__focus-avatar`,part:`avatar`,role:`img`});return this.#_(t,e),t}#_(e,t){let n=Of(t,this.attention);this.#S(e,`type`,kf(t)),this.#S(e,`color`,t.color??null),this.#S(e,`eyes`,Af(t)),this.#S(e,`connection`,this.getAttribute(`connection`)),this.#S(e,`fill`,String(Math.round(Sf(t.fill)))),this.#S(e,`blink`,n===`working`),this.#S(e,`activity`,Ef(t,n)),this.#S(e,`gaze-target`,this.getAttribute(`gaze-target`)),this.#S(e,`drowse-delay`,this.getAttribute(`drowse-delay`)),this.#S(e,`aria-label`,`${t.label??t.key} focused agent`),e.style.setProperty(`--slicc-agent-tabs-hue`,jf(t))}#v(e){if(!e){this.#t?.remove(),this.#t=null,this.#n=null;return}let t=this.#t??this.#g(e);this.#t=t;let n=this.#n!==null&&this.#n!==e.key;this.#n=e.key,this.#_(t,e),n&&t.resetExpression(),(t.parentElement!==this||t.nextElementSibling!==this.#i)&&this.insertBefore(t,this.#i)}#y(e,t){let n=L(`button`,{part:`segment`,type:`button`,role:`tab`},Mf(e),L(`span`,{class:`${V}__label`},e.label??e.key));return this.#b(n,e,t),n}#b(e,t,n){let r=Of(t,this.attention),i=Tf(t,r),a=Sf(t.fill),o=this.attention===t.key,s=Df(t,t.key===n);e.className=`${V}__segment${t.ephemeral?` ephemeral`:``}`,e.setAttribute(`aria-selected`,String(t.key===n)),e.tabIndex=t.key===n?0:-1;let c=i===`tool`?` (running a tool)`:i?` (thinking)`:``,l=s>0?`, ${s} unread message${s===1?``:`s`}`:``;e.setAttribute(`aria-label`,`${t.label??t.key}: ${r}${c}, ${Math.round(a)}% context fill${o?`, spoke most recently`:``}${l}`),e.dataset.k=t.key,e.dataset.state=r,this.#S(e,`data-phase`,i),this.#S(e,`data-attention`,o?`true`:null),e.style.setProperty(`--slicc-agent-tabs-hue`,jf(t)),this.#S(e,`data-unread`,s>0?String(s):null);let u=e.querySelector(`.${V}__label`);u&&(u.textContent=t.label??t.key),e.querySelector(`.${V}__glyph-arc`)?.setAttribute(`stroke-dasharray`,`${wf(a).toFixed(3)} ${sf.toFixed(3)}`)}#x(e){if(!this.#r)return;let t=new Map;for(let e of this.#r.querySelectorAll(`:scope > .${V}__segment`)){let n=e.dataset.k??``;t.has(n)?e.remove():t.set(n,e)}let n=this.#e.map(n=>{let r=t.get(n.key)??this.#y(n,e);return t.delete(n.key),this.#b(r,n,e),r});for(let e of t.values())e.remove();n.forEach((e,t)=>{let n=this.#r?.children.item(t)??null;n!==e&&this.#r?.insertBefore(e,n)})}#S(e,t,n){n===null||n===!1?e.hasAttribute(t)&&e.removeAttribute(t):n===!0?e.hasAttribute(t)||e.setAttribute(t,``):e.getAttribute(t)!==n&&e.setAttribute(t,n)}#C(e){if(!this.#a)return;let t=e.map(e=>{let t=e.dataset.k??``,n=this.#e.find(e=>e.key===t)??{key:t};return{id:t,label:n.label??t,type:kf(n),color:n.color,eyes:Af(n),state:Of(n,this.attention),fill:Sf(n.fill),unread:Number(e.dataset.unread??0)}});this.#a.items=t}#w(e){let t=e.target?.closest(`.${V}__segment`);t&&this.contains(t)&&t.dataset.k&&this.select(t.dataset.k)}#T(e){let t=e.target?.closest(`.${V}__segment`);if(!t||!this.contains(t))return;if(e.key===`Enter`||e.key===` `){if(!t.dataset.k)return;e.preventDefault(),this.select(t.dataset.k);return}if((e.key===`ArrowLeft`||e.key===`ArrowRight`)&&this.arrowKeys===`off`)return;let n=[...this.querySelectorAll(`.${V}__segment:not(.hide)`)].filter(e=>!e.disabled),r=n.indexOf(t);if(r<0||n.length===0)return;let i;if(e.key===`ArrowLeft`)i=n[(r-1+n.length)%n.length];else if(e.key===`ArrowRight`)i=n[(r+1)%n.length];else if(e.key===`Home`)i=n[0];else if(e.key===`End`)i=n.at(-1);else return;e.preventDefault(),i?.focus()}#E(e){let t=this.#D();t!==null&&t!==e&&this.#O(e)?.focus()}#D(){let e=this.ownerDocument.activeElement;return!(e instanceof Element)||!this.contains(e)?null:e.closest(`.${V}__segment`)?.dataset.k??null}#O(e){return e==null?null:[...this.querySelectorAll(`.${V}__segment`)].find(t=>t.dataset.k===e)??null}#k(){this.#o||typeof ResizeObserver>`u`||(this.#o=new ResizeObserver(()=>{this.#c===null&&(this.#c=requestAnimationFrame(()=>{this.#c=null,this.reflow()}))}),this.#o.observe(this),this.parentElement&&this.#o.observe(this.parentElement))}});var Nf=`/**
5837
5837
  * SLICC design tokens — lifted verbatim from the prototype
5838
5838
  * (proto/StellarRubySwift.html :root + body.dark). Light is the default; dark is
5839
5839
  * opt-in. Per project decision the prototype's token vocabulary and light-default
@@ -5897,7 +5897,7 @@ iframe {
5897
5897
  --shaderbg: #171410;
5898
5898
  --shadow-pane: rgba(0, 0, 0, 0.35) 0 8px 26px -10px;
5899
5899
  }
5900
- `,Nf=`slicc-tokens`;function Pf(e=document){if(e.getElementById(Nf))return;let t=e.createElement(`style`);t.id=Nf,t.textContent=Mf,(e.head??e.documentElement).appendChild(t)}function Ff(e,t=document.body){t.classList.toggle(`dark`,e===`dark`),t.setAttribute(`data-theme`,e)}function If(e=document.body){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>Ff(t.matches?`dark`:`light`,e);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var Lf=R(`
5900
+ `,Pf=`slicc-tokens`;function Ff(e=document){if(e.getElementById(Pf))return;let t=e.createElement(`style`);t.id=Pf,t.textContent=Nf,(e.head??e.documentElement).appendChild(t)}function If(e,t=document.body){t.classList.toggle(`dark`,e===`dark`),t.setAttribute(`data-theme`,e)}function Lf(e=document.body){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>If(t.matches?`dark`:`light`,e);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var Rf=R(`
5901
5901
  :host { display: inline-flex; flex: 0 0 auto; }
5902
5902
  .themetgl {
5903
5903
  font: inherit; font-family: var(--ui); font-size: 14px; line-height: 1;
@@ -5909,7 +5909,7 @@ iframe {
5909
5909
  }
5910
5910
  .themetgl:hover { background: color-mix(in srgb, var(--ink) 8%, var(--ghost)); }
5911
5911
  .themetgl svg { display: block; }
5912
- `),Rf=16,zf={light:`moon`,dark:`sun`},Bf={light:`Switch to dark mode`,dark:`Switch to light mode`};I(`slicc-theme-toggle`,class extends HTMLElement{static observedAttributes=[`theme`];#e;#t=null;#n=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Lf];let e=L(`button`,{class:`themetgl`,part:`button`,type:`button`,"aria-pressed":`false`},L(`slot`,{name:`glyph-light`},i(zf.light,{size:Rf})),L(`slot`,{name:`glyph-dark`,hidden:!0},i(zf.dark,{size:Rf})));this.#e.replaceChildren(e),this.#t=e}connectedCallback(){this.#t?.addEventListener(`click`,this.#i),this.#a(this.theme??`light`,{silent:!0})}disconnectedCallback(){this.#t?.removeEventListener(`click`,this.#i)}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&(this.#n||this.isConnected&&this.#a(this.#r(n)??`light`,{silent:!0}))}get theme(){return this.#r(this.getAttribute(`theme`))}set theme(e){this.#a(e===`dark`?`dark`:`light`,{silent:!0})}get pressed(){return this.theme===`dark`}#r(e){return e===`dark`?`dark`:e===`light`?`light`:null}#i=()=>{this.#a(this.theme===`dark`?`light`:`dark`)};#a(e,t={}){this.#n=!0;try{if(Ff(e),this.getAttribute(`theme`)!==e&&this.setAttribute(`theme`,e),this.#t){this.#t.setAttribute(`aria-pressed`,e===`dark`?`true`:`false`),this.#t.title=Bf[e];let t=this.#e.querySelector(`slot[name="glyph-light"]`),n=this.#e.querySelector(`slot[name="glyph-dark"]`);t?.toggleAttribute(`hidden`,e===`dark`),n?.toggleAttribute(`hidden`,e===`light`)}for(let t of document.querySelectorAll(`slicc-add-menu`))t.setAttribute(`theme`,e)}finally{this.#n=!1}t.silent||this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}}),I(`slicc-theme`,class extends HTMLElement{static observedAttributes=[`theme`];connectedCallback(){Pf(this.ownerDocument),this.classList.add(`slicc-theme`),this.#e()}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&this.isConnected&&this.#e()}get theme(){return this.getAttribute(`theme`)===`dark`?`dark`:`light`}set theme(e){this.setAttribute(`theme`,e===`dark`?`dark`:`light`)}#e(){let e=this.theme;Ff(e,this),this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}});var Vf=`
5912
+ `),zf=16,Bf={light:`moon`,dark:`sun`},Vf={light:`Switch to dark mode`,dark:`Switch to light mode`};I(`slicc-theme-toggle`,class extends HTMLElement{static observedAttributes=[`theme`];#e;#t=null;#n=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Rf];let e=L(`button`,{class:`themetgl`,part:`button`,type:`button`,"aria-pressed":`false`},L(`slot`,{name:`glyph-light`},i(Bf.light,{size:zf})),L(`slot`,{name:`glyph-dark`,hidden:!0},i(Bf.dark,{size:zf})));this.#e.replaceChildren(e),this.#t=e}connectedCallback(){this.#t?.addEventListener(`click`,this.#i),this.#a(this.theme??`light`,{silent:!0})}disconnectedCallback(){this.#t?.removeEventListener(`click`,this.#i)}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&(this.#n||this.isConnected&&this.#a(this.#r(n)??`light`,{silent:!0}))}get theme(){return this.#r(this.getAttribute(`theme`))}set theme(e){this.#a(e===`dark`?`dark`:`light`,{silent:!0})}get pressed(){return this.theme===`dark`}#r(e){return e===`dark`?`dark`:e===`light`?`light`:null}#i=()=>{this.#a(this.theme===`dark`?`light`:`dark`)};#a(e,t={}){this.#n=!0;try{if(If(e),this.getAttribute(`theme`)!==e&&this.setAttribute(`theme`,e),this.#t){this.#t.setAttribute(`aria-pressed`,e===`dark`?`true`:`false`),this.#t.title=Vf[e];let t=this.#e.querySelector(`slot[name="glyph-light"]`),n=this.#e.querySelector(`slot[name="glyph-dark"]`);t?.toggleAttribute(`hidden`,e===`dark`),n?.toggleAttribute(`hidden`,e===`light`)}for(let t of document.querySelectorAll(`slicc-add-menu`))t.setAttribute(`theme`,e)}finally{this.#n=!1}t.silent||this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}}),I(`slicc-theme`,class extends HTMLElement{static observedAttributes=[`theme`];connectedCallback(){Ff(this.ownerDocument),this.classList.add(`slicc-theme`),this.#e()}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&this.isConnected&&this.#e()}get theme(){return this.getAttribute(`theme`)===`dark`?`dark`:`light`}set theme(e){this.setAttribute(`theme`,e===`dark`?`dark`:`light`)}#e(){let e=this.theme;If(e,this),this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}});var Hf=`
5913
5913
  slicc-dock-tree {
5914
5914
  display: block;
5915
5915
  /* Fill the parent shell's flex column. Without this the host collapses to
@@ -6132,7 +6132,7 @@ slicc-dock-tree .dock-tree__preview {
6132
6132
  slicc-dock-tree .dock-tree__preview--active {
6133
6133
  display: block;
6134
6134
  }
6135
- `,Hf=`slicc-dock-tree-style`;function Uf(e){if(e.getElementById(Hf))return;let t=e.createElement(`style`);t.id=Hf,t.textContent=Vf,(e.head??e.documentElement).appendChild(t)}var Wf=`slicc-surface`,Gf=`chat`,Kf=`sprinkle:`;function qf(e){return typeof e==`string`&&e.trim().toLowerCase()===`false`}function Jf(e){return e===`chat`?`Chat`:e.startsWith(Kf)?e.slice(9):e}var Yf=[`top`,`left`,`middle`,`right`,`bottom`],Xf=[`left`,`middle`,`right`],Zf=[`top`,`center`,`bottom`],Qf=.02;function $f(){return{zones:{top:null,left:null,middle:null,right:null,bottom:null},rowFr:{top:1,center:1,bottom:1},colFr:{left:1,middle:1,right:1}}}function ep(e){return JSON.parse(JSON.stringify(e))}function tp(e,t){if(e.type===`leaf`){t.push(e.surfaceId);return}for(let n of e.children)tp(n,t)}function np(e,t){if(e.type===`leaf`)return e.surfaceId===t?e:null;for(let n of e.children){let e=np(n,t);if(e)return e}return null}function rp(e,t,n){if(n)return!0;function r(e,n){let i=n||e.locked===!0;if(e===t)return i;if(e.type!==`split`)return null;for(let t of e.children){let e=r(t,i);if(e!=null)return e}return null}return r(e,!1)??!1}function ip(e){return e.locked===!0||e.type===`split`&&e.children.some(ip)}function ap(e){return e.getAttribute(`surface-id`)||e.getAttribute(`data-s`)||e.id||null}function op(e){e.style.position=`relative`,e.style.inset=`auto`,e.style.display=`flex`,e.style.flex=`1 1 auto`,e.style.minWidth=`0`,e.style.minHeight=`0`}function sp(e){e.style.removeProperty(`position`),e.style.removeProperty(`inset`),e.style.removeProperty(`flex`),e.style.removeProperty(`min-width`),e.style.removeProperty(`min-height`),e.style.display=`none`}function cp(e,t){return{type:`split`,dir:e,children:t,sizes:t.map(()=>1)}}function lp(e,t,n){e.type===`split`&&e.children.forEach((r,i)=>{r===t?n(e,i):lp(r,t,n)})}function up(e,t){if(e.type!==`split`)return null;for(let n=0;n<e.children.length;n++){let r=e.children[n];if(r===t)return{parent:e,index:n};let i=up(r,t);if(i)return i}return null}function dp(e){if(!e)return null;if(e.type!==`split`)return e;e.children=e.children.map(dp).filter(e=>e!=null);let t=[],n=[];return e.children.forEach((r,i)=>{r.type===`split`&&r.dir===e.dir?r.children.forEach((a,o)=>{t.push(a),n.push((e.sizes[i]||1)*(r.sizes[o]||1))}):(t.push(r),n.push(e.sizes[i]||1))}),e.children=t,e.sizes=n,e.children.length===0?null:e.children.length===1?e.children[0]:e}function fp(e,t,n){let r=e[t];if(r){if(r===n){e[t]=null;return}lp(r,n,(e,t)=>{e.children.splice(t,1),e.sizes.splice(t,1)}),e[t]=dp(r)}}function pp(e,t,n,r){if(e[t]===n){e[t]=r;return}let i=e[t];i&&lp(i,n,(e,t)=>{e.children[t]=r})}function mp(e,t,n){let r=t.reduce((e,t)=>e+t,0)-e;if(r<=0)return null;let i=Math.min(.98,Math.max(Qf,n));return i*r/(1-i)}function hp(e,t,n){let r=(t-e.left)/e.width,i=(n-e.top)/e.height;if(r>.34&&r<.66&&i>.34&&i<.66)return`center`;let a={n:i,s:1-i,w:r,e:1-r},o=Object.entries(a);return o.sort((e,t)=>e[1]-t[1]),o[0][0]}function gp(e){let t=document.createElement(`div`);return t.className=`dock-tree__divider dock-tree__divider--${e}`,t}function _p(){let e=document.createElement(`div`);return e.className=`dock-tree__root`,e}function vp(){let e=document.createElement(`div`);return e.className=`dock-tree__parking`,e.hidden=!0,e}function yp(){let e=document.createElement(`div`);return e.className=`dock-tree__ghost`,e}function bp(){let e=document.createElement(`div`);return e.className=`dock-tree__preview`,e}I(`slicc-dock-tree`,class extends HTMLElement{static observedAttributes=[`tiles-movable`];#e=$f();#t=!1;#n=!1;#r=new Set;#i=null;#a=null;#o=new WeakMap;#s=new Set;#c=_p();#l=vp();#u=yp();#d=bp();#f=new MutationObserver(()=>this.#x());connectedCallback(){Uf(this.ownerDocument),this.#n=!0,this.#c.parentElement!==this&&this.append(this.#c),this.#l.parentElement!==this&&this.append(this.#l),this.#u.parentElement!==this&&this.append(this.#u),this.#d.parentElement!==this&&this.append(this.#d),this.#x(),this.#f.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#f.disconnect(),this.#L()}attributeChangedCallback(e,t,n){e!==`tiles-movable`||t===n||!this.#n||(this.tilesMovable||this.#L(),this.#x())}get tilesMovable(){let e=this.getAttribute(`tiles-movable`);return e!==null&&!qf(e)}set tilesMovable(e){this.toggleAttribute(`tiles-movable`,!!e&&!qf(e))}setTree(e){this.#e=e?ep(e):$f(),this.#n&&this.#x()}getTree(){return ep(this.#e)}setPinned(e){this.#r=new Set(e)}getSurfaceIds(){let e=[];for(let t of Yf){let n=this.#e.zones[t];n&&tp(n,e)}return e}#p(e){return this.#e.zones[e]!=null||this.#t}#m(e,t){let n=this.#e.zones[t];return n?rp(n,e,this.#e.locked===!0):!1}#h(e){if(this.#e.locked===!0)return!0;let t=this.#e.zones[e];return t!=null&&ip(t)}#g(e){return this.#e.locked===!0?!0:e===`center`?Xf.some(e=>this.#h(e)):this.#h(e)}placeSurface(e,t){if(this.getSurfaceIds().includes(e))return;let n={type:`leaf`,surfaceId:e},r=this.#e.zones[t];this.#e.zones[t]=r==null?n:dp(cp(`col`,[r,n])),this.#n&&this.#x(),this.#R()}removeSurface(e){if(!this.#r.has(e))for(let t of Yf){let n=this.#e.zones[t];if(!n)continue;let r=np(n,e);if(r){if(this.#m(r,t))return;fp(this.#e.zones,t,r),this.#n&&this.#x(),this.#R();return}}}moveSurfaceToZone(e,t){let n=!1;for(let r of Yf){let i=this.#e.zones[r];if(!i)continue;let a=np(i,e);if(a){if(n=!0,this.#m(a,r)||r===t&&i===a)return;fp(this.#e.zones,r,a);break}}if(!n){this.placeSurface(e,t);return}let r={type:`leaf`,surfaceId:e};this.#e.zones[t]=r,this.#n&&this.#x(),this.#R()}setSurfaceSize(e,t){let n=this.#_(e);if(!n)return!1;let r=this.#z().get(e)??null,i=r?.getBoundingClientRect()??null,a=r?.closest(`.dock-tree__leaf`)?.getBoundingClientRect()??i,o=!1;if(n.width&&(t.widthPx!=null||t.widthPercent!=null)){let e=a&&i?Math.max(0,a.width-i.width):0;o=this.#b(n.width,t.widthPx==null?void 0:t.widthPx+e,t.widthPercent,a?.width)||o}if(n.height&&(t.heightPx!=null||t.heightPercent!=null)){let e=a&&i?Math.max(0,a.height-i.height):0;o=this.#b(n.height,t.heightPx==null?void 0:t.heightPx+e,t.heightPercent,a?.height)||o}return o&&(this.#x(),this.#k()),o}#_(e){for(let t of Yf){let n=this.#e.zones[t];if(!n)continue;let r=np(n,e);if(!r)continue;if(this.#m(r,t))return{width:null,height:null};let i=up(n,r);if(i){let{parent:e,index:t}=i,n={currentFr:e.sizes[t]??1,groupFr:e.sizes,apply:n=>{e.sizes[t]=n}};return{width:e.dir===`row`?n:null,height:e.dir===`col`?n:null}}let a=t===`left`||t===`middle`||t===`right`,o=null;if(a){let e=t,n=this.#y();o={currentFr:this.#e.colFr[e],groupFr:n.map(e=>this.#e.colFr[e]),apply:t=>{this.#e.colFr[e]=t}}}let s=a?`center`:t,c=this.#v(),l={currentFr:this.#e.rowFr[s],groupFr:c.map(e=>this.#e.rowFr[e]),apply:e=>{this.#e.rowFr[s]=e}};return{width:o,height:l}}return null}#v(){let e=[];return this.#p(`top`)&&e.push(`top`),Xf.some(e=>this.#p(e))&&e.push(`center`),this.#p(`bottom`)&&e.push(`bottom`),e}#y(){return Xf.filter(e=>this.#p(e))}#b(e,t,n,r){let i=null;if(n!=null)i=n/100;else if(t!=null&&r!=null&&r>0&&e.currentFr>0){let n=r*e.groupFr.reduce((e,t)=>e+t,0)/e.currentFr;n>0&&(i=t/n)}if(i==null)return!1;let a=mp(e.currentFr,e.groupFr,i);return a!=null&&(e.apply(a),!0)}#x(){let e=this.#e,t=this.#z(),n=new Set(this.getSurfaceIds()),r=this.#S(e,t),i=[];if(this.#p(`top`)){let n=this.#C(`top`,t);n.style.flex=`${e.rowFr.top} 1 0`,i.push({key:`top`,el:n})}if(r&&i.push({key:`center`,el:r}),this.#p(`bottom`)){let n=this.#C(`bottom`,t);n.style.flex=`${e.rowFr.bottom} 1 0`,i.push({key:`bottom`,el:n})}let a=[];i.forEach((t,n)=>{a.push(t.el),n<i.length-1&&!this.#g(t.key)&&!this.#g(i[n+1].key)&&a.push(this.#E(`v`,t.key,i[n+1].key,this.#c,e.rowFr,Zf))}),this.#c.replaceChildren(...a);for(let[e,r]of t)n.has(e)||(sp(r),r.parentElement!==this.#l&&this.#l.appendChild(r));this.#s=n,this.dispatchEvent(new CustomEvent(`dock-tree-render`,{detail:{placed:[...n]},bubbles:!0,composed:!0}))}#S(e,t){let n=Xf.filter(e=>this.#p(e));if(n.length===0)return null;let r=document.createElement(`div`);return r.className=`dock-tree__row`,r.style.flex=`${e.rowFr.center} 1 0`,n.forEach((i,a)=>{let o=this.#C(i,t);o.style.flex=`${e.colFr[i]} 1 0`,r.appendChild(o),a<n.length-1&&!this.#h(i)&&!this.#h(n[a+1])&&r.appendChild(this.#E(`h`,i,n[a+1],r,e.colFr,Xf))}),r}#C(e,t){let n=document.createElement(`div`);n.className=`dock-tree__zone`,this.#t&&n.classList.add(`dock-tree__zone--droppable`),n.dataset.zone=e;let r=this.#e.zones[e];if(r==null){let t=document.createElement(`div`);return t.className=`dock-tree__empty`,t.textContent=`${e} (drop here)`,n.appendChild(t),n}let i=this.#w(r,t,e);return i.style.flex=`1 1 0`,n.appendChild(i),n}#w(e,t,n){if(e.type===`leaf`){let r=document.createElement(`div`);r.className=`dock-tree__leaf`;let i=t.get(e.surfaceId);return i&&r.appendChild(this.#T(e,n,e.surfaceId,i)),r}let r=document.createElement(`div`);r.className=`dock-tree__split dock-tree__split--${e.dir}`;let i=this.#e.locked===!0||e.locked===!0;return e.children.forEach((a,o)=>{let s=this.#w(a,t,n);s.style.flex=`${e.sizes[o]??1} 1 0`,r.appendChild(s),o<e.children.length-1&&!i&&r.appendChild(this.#D(e,o,r))}),r}#T(e,t,n,r){let a=document.createElement(`div`);if(a.className=`dock-tree__tile`,n!==`chat`&&(a.classList.add(`dock-tree__tile--chrome`),this.#s.has(n)||a.classList.add(`dock-tree__tile--enter`)),this.tilesMovable&&!this.#m(e,t)){let r=Jf(n),o=document.createElement(`button`);o.type=`button`,o.className=`dock-tree__tile-move`,o.setAttribute(`aria-label`,`Move ${r}`),o.title=r,o.appendChild(i(`grip-vertical`,{size:13})),o.addEventListener(`pointerdown`,n=>this.#A(n,e,t)),a.appendChild(o)}let o=document.createElement(`div`);return o.className=`dock-tree__tile-body`,op(r),o.appendChild(r),a.appendChild(o),this.#o.set(a,e),a}#E(e,t,n,r,i,a){let o=gp(e);return this.#O(o,e===`h`,r,()=>i[t]??1,()=>i[n]??1,(e,r)=>{i[t]=e,i[n]=r},()=>a.reduce((e,t)=>e+(i[t]??1),0)),o}#D(e,t,n){let r=e.dir===`row`,i=gp(r?`h`:`v`);return this.#O(i,r,n,()=>e.sizes[t]??1,()=>e.sizes[t+1]??1,(n,r)=>{e.sizes[t]=n,e.sizes[t+1]=r},()=>e.sizes.reduce((e,t)=>e+(t??1),0)),i}#O(e,t,n,r,i,a,o){e.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.setPointerCapture(e.pointerId);let s=n.getBoundingClientRect(),c=r()+i(),l=c*Qf,u=o(),d=t?s.width:s.height,f=t?e.clientX:e.clientY,p=r(),m=e=>{let n=t?e.clientX:e.clientY,r=d>0?(n-f)/d*u:0,i=Math.max(l,Math.min(c-l,p+r));a(i,c-i),this.#x()},h=()=>{window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h),window.removeEventListener(`pointercancel`,h),this.hasPointerCapture(e.pointerId)&&this.releasePointerCapture(e.pointerId),this.#k()};window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h),window.addEventListener(`pointercancel`,h)})}#k(){this.dispatchEvent(new CustomEvent(`dock-tree-resize`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#A(e,t,n){!this.tilesMovable||this.#m(t,n)||(e.preventDefault(),this.#j({kind:`internal`,node:t,fromZone:n},t.type===`leaf`?t.surfaceId:`panel`),this.#M(e))}beginExternalDrag(e,t){this.tilesMovable&&this.#j({kind:`external`,surfaceId:e},e)}#j(e,t){this.#i=e,this.#a=null,this.#t=!0,this.#x(),this.#u.textContent=t,this.#u.classList.add(`dock-tree__ghost--active`),window.addEventListener(`pointermove`,this.#N),window.addEventListener(`pointerup`,this.#I)}#M(e){this.#u.style.left=`${e.clientX}px`,this.#u.style.top=`${e.clientY}px`}#N=e=>{this.#M(e),this.#a=null,this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let t=this.#i;if(!t)return;let n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return;let r=n.closest(`.dock-tree__zone`);if(!(r instanceof HTMLElement))return;let i=r.dataset.zone;if(!i)return;r.classList.add(`dock-tree__zone--hot`);let a=n.closest(`.dock-tree__tile`),o=a instanceof HTMLElement?this.#o.get(a):void 0,s=t.kind===`internal`&&o===t.node,c=!!o&&this.#m(o,i);if(a instanceof HTMLElement&&o&&!s&&!c){let t=a.getBoundingClientRect(),n=hp(t,e.clientX,e.clientY);this.#a={zone:i,leaf:o,region:n},this.#P(t,n)}else a||(this.#a={zone:i,empty:!0},this.#F(r.getBoundingClientRect()))};#P(e,t){let{left:n,top:r,width:i,height:a}=e;t===`n`?a=e.height/2:t===`s`?(r=e.top+e.height/2,a=e.height/2):t===`w`?i=e.width/2:t===`e`&&(n=e.left+e.width/2,i=e.width/2),this.#F(new DOMRect(n,r,i,a))}#F(e){this.#d.style.left=`${e.left}px`,this.#d.style.top=`${e.top}px`,this.#d.style.width=`${e.width}px`,this.#d.style.height=`${e.height}px`,this.#d.classList.add(`dock-tree__preview--active`)}#I=()=>{window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let e=this.#a,t=this.#i;this.#a=null,this.#i=null,this.#t=!1;let n=!!t&&t.kind===`internal`&&!!e&&!e.empty&&e.leaf===t.node,r=!!t&&t.kind===`external`&&this.getSurfaceIds().includes(t.surfaceId);if(!t||!e||n||r){this.#x();return}let i;if(t.kind===`internal`?(fp(this.#e.zones,t.fromZone,t.node),i=t.node):i={type:`leaf`,surfaceId:t.surfaceId},e.empty||this.#e.zones[e.zone]==null)this.#e.zones[e.zone]=i;else{let{region:t,leaf:n}=e,r=cp(t===`e`||t===`w`?`row`:`col`,t===`n`||t===`w`?[i,n]:[n,i]);pp(this.#e.zones,e.zone,n,r),this.#e.zones[e.zone]=dp(this.#e.zones[e.zone])}this.#x(),this.#R()};#L(){this.#i&&(window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#i=null,this.#a=null,this.#t=!1,this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`))}#R(){this.dispatchEvent(new CustomEvent(`dock-tree-change`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#z(){let e=new Map;for(let t of Array.from(this.querySelectorAll(Wf))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(Wf))continue;let n=ap(t);n&&e.set(n,t)}return e}});var xp=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
6135
+ `,Uf=`slicc-dock-tree-style`;function Wf(e){if(e.getElementById(Uf))return;let t=e.createElement(`style`);t.id=Uf,t.textContent=Hf,(e.head??e.documentElement).appendChild(t)}var Gf=`slicc-surface`,Kf=`chat`,qf=`sprinkle:`;function Jf(e){return typeof e==`string`&&e.trim().toLowerCase()===`false`}function Yf(e){return e===`chat`?`Chat`:e.startsWith(qf)?e.slice(9):e}var Xf=[`top`,`left`,`middle`,`right`,`bottom`],Zf=[`left`,`middle`,`right`],Qf=[`top`,`center`,`bottom`],$f=.02;function ep(){return{zones:{top:null,left:null,middle:null,right:null,bottom:null},rowFr:{top:1,center:1,bottom:1},colFr:{left:1,middle:1,right:1}}}function tp(e){return JSON.parse(JSON.stringify(e))}function np(e,t){if(e.type===`leaf`){t.push(e.surfaceId);return}for(let n of e.children)np(n,t)}function rp(e,t){if(e.type===`leaf`)return e.surfaceId===t?e:null;for(let n of e.children){let e=rp(n,t);if(e)return e}return null}function ip(e,t,n){if(n)return!0;function r(e,n){let i=n||e.locked===!0;if(e===t)return i;if(e.type!==`split`)return null;for(let t of e.children){let e=r(t,i);if(e!=null)return e}return null}return r(e,!1)??!1}function ap(e){return e.locked===!0||e.type===`split`&&e.children.some(ap)}function op(e){return e.getAttribute(`surface-id`)||e.getAttribute(`data-s`)||e.id||null}function sp(e){e.style.position=`relative`,e.style.inset=`auto`,e.style.display=`flex`,e.style.flex=`1 1 auto`,e.style.minWidth=`0`,e.style.minHeight=`0`}function cp(e){e.style.removeProperty(`position`),e.style.removeProperty(`inset`),e.style.removeProperty(`flex`),e.style.removeProperty(`min-width`),e.style.removeProperty(`min-height`),e.style.display=`none`}function lp(e,t){return{type:`split`,dir:e,children:t,sizes:t.map(()=>1)}}function up(e,t,n){e.type===`split`&&e.children.forEach((r,i)=>{r===t?n(e,i):up(r,t,n)})}function dp(e,t){if(e.type!==`split`)return null;for(let n=0;n<e.children.length;n++){let r=e.children[n];if(r===t)return{parent:e,index:n};let i=dp(r,t);if(i)return i}return null}function fp(e){if(!e)return null;if(e.type!==`split`)return e;e.children=e.children.map(fp).filter(e=>e!=null);let t=[],n=[];return e.children.forEach((r,i)=>{r.type===`split`&&r.dir===e.dir?r.children.forEach((a,o)=>{t.push(a),n.push((e.sizes[i]||1)*(r.sizes[o]||1))}):(t.push(r),n.push(e.sizes[i]||1))}),e.children=t,e.sizes=n,e.children.length===0?null:e.children.length===1?e.children[0]:e}function pp(e,t,n){let r=e[t];if(r){if(r===n){e[t]=null;return}up(r,n,(e,t)=>{e.children.splice(t,1),e.sizes.splice(t,1)}),e[t]=fp(r)}}function mp(e,t,n,r){if(e[t]===n){e[t]=r;return}let i=e[t];i&&up(i,n,(e,t)=>{e.children[t]=r})}function hp(e,t,n){let r=t.reduce((e,t)=>e+t,0)-e;if(r<=0)return null;let i=Math.min(.98,Math.max($f,n));return i*r/(1-i)}function gp(e,t,n){let r=(t-e.left)/e.width,i=(n-e.top)/e.height;if(r>.34&&r<.66&&i>.34&&i<.66)return`center`;let a={n:i,s:1-i,w:r,e:1-r},o=Object.entries(a);return o.sort((e,t)=>e[1]-t[1]),o[0][0]}function _p(e){let t=document.createElement(`div`);return t.className=`dock-tree__divider dock-tree__divider--${e}`,t}function vp(){let e=document.createElement(`div`);return e.className=`dock-tree__root`,e}function yp(){let e=document.createElement(`div`);return e.className=`dock-tree__parking`,e.hidden=!0,e}function bp(){let e=document.createElement(`div`);return e.className=`dock-tree__ghost`,e}function xp(){let e=document.createElement(`div`);return e.className=`dock-tree__preview`,e}I(`slicc-dock-tree`,class extends HTMLElement{static observedAttributes=[`tiles-movable`];#e=ep();#t=!1;#n=!1;#r=new Set;#i=null;#a=null;#o=new WeakMap;#s=new Set;#c=vp();#l=yp();#u=bp();#d=xp();#f=new MutationObserver(()=>this.#x());connectedCallback(){Wf(this.ownerDocument),this.#n=!0,this.#c.parentElement!==this&&this.append(this.#c),this.#l.parentElement!==this&&this.append(this.#l),this.#u.parentElement!==this&&this.append(this.#u),this.#d.parentElement!==this&&this.append(this.#d),this.#x(),this.#f.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#f.disconnect(),this.#L()}attributeChangedCallback(e,t,n){e!==`tiles-movable`||t===n||!this.#n||(this.tilesMovable||this.#L(),this.#x())}get tilesMovable(){let e=this.getAttribute(`tiles-movable`);return e!==null&&!Jf(e)}set tilesMovable(e){this.toggleAttribute(`tiles-movable`,!!e&&!Jf(e))}setTree(e){this.#e=e?tp(e):ep(),this.#n&&this.#x()}getTree(){return tp(this.#e)}setPinned(e){this.#r=new Set(e)}getSurfaceIds(){let e=[];for(let t of Xf){let n=this.#e.zones[t];n&&np(n,e)}return e}#p(e){return this.#e.zones[e]!=null||this.#t}#m(e,t){let n=this.#e.zones[t];return n?ip(n,e,this.#e.locked===!0):!1}#h(e){if(this.#e.locked===!0)return!0;let t=this.#e.zones[e];return t!=null&&ap(t)}#g(e){return this.#e.locked===!0?!0:e===`center`?Zf.some(e=>this.#h(e)):this.#h(e)}placeSurface(e,t){if(this.getSurfaceIds().includes(e))return;let n={type:`leaf`,surfaceId:e},r=this.#e.zones[t];this.#e.zones[t]=r==null?n:fp(lp(`col`,[r,n])),this.#n&&this.#x(),this.#R()}removeSurface(e){if(!this.#r.has(e))for(let t of Xf){let n=this.#e.zones[t];if(!n)continue;let r=rp(n,e);if(r){if(this.#m(r,t))return;pp(this.#e.zones,t,r),this.#n&&this.#x(),this.#R();return}}}moveSurfaceToZone(e,t){let n=!1;for(let r of Xf){let i=this.#e.zones[r];if(!i)continue;let a=rp(i,e);if(a){if(n=!0,this.#m(a,r)||r===t&&i===a)return;pp(this.#e.zones,r,a);break}}if(!n){this.placeSurface(e,t);return}let r={type:`leaf`,surfaceId:e};this.#e.zones[t]=r,this.#n&&this.#x(),this.#R()}setSurfaceSize(e,t){let n=this.#_(e);if(!n)return!1;let r=this.#z().get(e)??null,i=r?.getBoundingClientRect()??null,a=r?.closest(`.dock-tree__leaf`)?.getBoundingClientRect()??i,o=!1;if(n.width&&(t.widthPx!=null||t.widthPercent!=null)){let e=a&&i?Math.max(0,a.width-i.width):0;o=this.#b(n.width,t.widthPx==null?void 0:t.widthPx+e,t.widthPercent,a?.width)||o}if(n.height&&(t.heightPx!=null||t.heightPercent!=null)){let e=a&&i?Math.max(0,a.height-i.height):0;o=this.#b(n.height,t.heightPx==null?void 0:t.heightPx+e,t.heightPercent,a?.height)||o}return o&&(this.#x(),this.#k()),o}#_(e){for(let t of Xf){let n=this.#e.zones[t];if(!n)continue;let r=rp(n,e);if(!r)continue;if(this.#m(r,t))return{width:null,height:null};let i=dp(n,r);if(i){let{parent:e,index:t}=i,n={currentFr:e.sizes[t]??1,groupFr:e.sizes,apply:n=>{e.sizes[t]=n}};return{width:e.dir===`row`?n:null,height:e.dir===`col`?n:null}}let a=t===`left`||t===`middle`||t===`right`,o=null;if(a){let e=t,n=this.#y();o={currentFr:this.#e.colFr[e],groupFr:n.map(e=>this.#e.colFr[e]),apply:t=>{this.#e.colFr[e]=t}}}let s=a?`center`:t,c=this.#v(),l={currentFr:this.#e.rowFr[s],groupFr:c.map(e=>this.#e.rowFr[e]),apply:e=>{this.#e.rowFr[s]=e}};return{width:o,height:l}}return null}#v(){let e=[];return this.#p(`top`)&&e.push(`top`),Zf.some(e=>this.#p(e))&&e.push(`center`),this.#p(`bottom`)&&e.push(`bottom`),e}#y(){return Zf.filter(e=>this.#p(e))}#b(e,t,n,r){let i=null;if(n!=null)i=n/100;else if(t!=null&&r!=null&&r>0&&e.currentFr>0){let n=r*e.groupFr.reduce((e,t)=>e+t,0)/e.currentFr;n>0&&(i=t/n)}if(i==null)return!1;let a=hp(e.currentFr,e.groupFr,i);return a!=null&&(e.apply(a),!0)}#x(){let e=this.#e,t=this.#z(),n=new Set(this.getSurfaceIds()),r=this.#S(e,t),i=[];if(this.#p(`top`)){let n=this.#C(`top`,t);n.style.flex=`${e.rowFr.top} 1 0`,i.push({key:`top`,el:n})}if(r&&i.push({key:`center`,el:r}),this.#p(`bottom`)){let n=this.#C(`bottom`,t);n.style.flex=`${e.rowFr.bottom} 1 0`,i.push({key:`bottom`,el:n})}let a=[];i.forEach((t,n)=>{a.push(t.el),n<i.length-1&&!this.#g(t.key)&&!this.#g(i[n+1].key)&&a.push(this.#E(`v`,t.key,i[n+1].key,this.#c,e.rowFr,Qf))}),this.#c.replaceChildren(...a);for(let[e,r]of t)n.has(e)||(cp(r),r.parentElement!==this.#l&&this.#l.appendChild(r));this.#s=n,this.dispatchEvent(new CustomEvent(`dock-tree-render`,{detail:{placed:[...n]},bubbles:!0,composed:!0}))}#S(e,t){let n=Zf.filter(e=>this.#p(e));if(n.length===0)return null;let r=document.createElement(`div`);return r.className=`dock-tree__row`,r.style.flex=`${e.rowFr.center} 1 0`,n.forEach((i,a)=>{let o=this.#C(i,t);o.style.flex=`${e.colFr[i]} 1 0`,r.appendChild(o),a<n.length-1&&!this.#h(i)&&!this.#h(n[a+1])&&r.appendChild(this.#E(`h`,i,n[a+1],r,e.colFr,Zf))}),r}#C(e,t){let n=document.createElement(`div`);n.className=`dock-tree__zone`,this.#t&&n.classList.add(`dock-tree__zone--droppable`),n.dataset.zone=e;let r=this.#e.zones[e];if(r==null){let t=document.createElement(`div`);return t.className=`dock-tree__empty`,t.textContent=`${e} (drop here)`,n.appendChild(t),n}let i=this.#w(r,t,e);return i.style.flex=`1 1 0`,n.appendChild(i),n}#w(e,t,n){if(e.type===`leaf`){let r=document.createElement(`div`);r.className=`dock-tree__leaf`;let i=t.get(e.surfaceId);return i&&r.appendChild(this.#T(e,n,e.surfaceId,i)),r}let r=document.createElement(`div`);r.className=`dock-tree__split dock-tree__split--${e.dir}`;let i=this.#e.locked===!0||e.locked===!0;return e.children.forEach((a,o)=>{let s=this.#w(a,t,n);s.style.flex=`${e.sizes[o]??1} 1 0`,r.appendChild(s),o<e.children.length-1&&!i&&r.appendChild(this.#D(e,o,r))}),r}#T(e,t,n,r){let a=document.createElement(`div`);if(a.className=`dock-tree__tile`,n!==`chat`&&(a.classList.add(`dock-tree__tile--chrome`),this.#s.has(n)||a.classList.add(`dock-tree__tile--enter`)),this.tilesMovable&&!this.#m(e,t)){let r=Yf(n),o=document.createElement(`button`);o.type=`button`,o.className=`dock-tree__tile-move`,o.setAttribute(`aria-label`,`Move ${r}`),o.title=r,o.appendChild(i(`grip-vertical`,{size:13})),o.addEventListener(`pointerdown`,n=>this.#A(n,e,t)),a.appendChild(o)}let o=document.createElement(`div`);return o.className=`dock-tree__tile-body`,sp(r),o.appendChild(r),a.appendChild(o),this.#o.set(a,e),a}#E(e,t,n,r,i,a){let o=_p(e);return this.#O(o,e===`h`,r,()=>i[t]??1,()=>i[n]??1,(e,r)=>{i[t]=e,i[n]=r},()=>a.reduce((e,t)=>e+(i[t]??1),0)),o}#D(e,t,n){let r=e.dir===`row`,i=_p(r?`h`:`v`);return this.#O(i,r,n,()=>e.sizes[t]??1,()=>e.sizes[t+1]??1,(n,r)=>{e.sizes[t]=n,e.sizes[t+1]=r},()=>e.sizes.reduce((e,t)=>e+(t??1),0)),i}#O(e,t,n,r,i,a,o){e.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.setPointerCapture(e.pointerId);let s=n.getBoundingClientRect(),c=r()+i(),l=c*$f,u=o(),d=t?s.width:s.height,f=t?e.clientX:e.clientY,p=r(),m=e=>{let n=t?e.clientX:e.clientY,r=d>0?(n-f)/d*u:0,i=Math.max(l,Math.min(c-l,p+r));a(i,c-i),this.#x()},h=()=>{window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h),window.removeEventListener(`pointercancel`,h),this.hasPointerCapture(e.pointerId)&&this.releasePointerCapture(e.pointerId),this.#k()};window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h),window.addEventListener(`pointercancel`,h)})}#k(){this.dispatchEvent(new CustomEvent(`dock-tree-resize`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#A(e,t,n){!this.tilesMovable||this.#m(t,n)||(e.preventDefault(),this.#j({kind:`internal`,node:t,fromZone:n},t.type===`leaf`?t.surfaceId:`panel`),this.#M(e))}beginExternalDrag(e,t){this.tilesMovable&&this.#j({kind:`external`,surfaceId:e},e)}#j(e,t){this.#i=e,this.#a=null,this.#t=!0,this.#x(),this.#u.textContent=t,this.#u.classList.add(`dock-tree__ghost--active`),window.addEventListener(`pointermove`,this.#N),window.addEventListener(`pointerup`,this.#I)}#M(e){this.#u.style.left=`${e.clientX}px`,this.#u.style.top=`${e.clientY}px`}#N=e=>{this.#M(e),this.#a=null,this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let t=this.#i;if(!t)return;let n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return;let r=n.closest(`.dock-tree__zone`);if(!(r instanceof HTMLElement))return;let i=r.dataset.zone;if(!i)return;r.classList.add(`dock-tree__zone--hot`);let a=n.closest(`.dock-tree__tile`),o=a instanceof HTMLElement?this.#o.get(a):void 0,s=t.kind===`internal`&&o===t.node,c=!!o&&this.#m(o,i);if(a instanceof HTMLElement&&o&&!s&&!c){let t=a.getBoundingClientRect(),n=gp(t,e.clientX,e.clientY);this.#a={zone:i,leaf:o,region:n},this.#P(t,n)}else a||(this.#a={zone:i,empty:!0},this.#F(r.getBoundingClientRect()))};#P(e,t){let{left:n,top:r,width:i,height:a}=e;t===`n`?a=e.height/2:t===`s`?(r=e.top+e.height/2,a=e.height/2):t===`w`?i=e.width/2:t===`e`&&(n=e.left+e.width/2,i=e.width/2),this.#F(new DOMRect(n,r,i,a))}#F(e){this.#d.style.left=`${e.left}px`,this.#d.style.top=`${e.top}px`,this.#d.style.width=`${e.width}px`,this.#d.style.height=`${e.height}px`,this.#d.classList.add(`dock-tree__preview--active`)}#I=()=>{window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let e=this.#a,t=this.#i;this.#a=null,this.#i=null,this.#t=!1;let n=!!t&&t.kind===`internal`&&!!e&&!e.empty&&e.leaf===t.node,r=!!t&&t.kind===`external`&&this.getSurfaceIds().includes(t.surfaceId);if(!t||!e||n||r){this.#x();return}let i;if(t.kind===`internal`?(pp(this.#e.zones,t.fromZone,t.node),i=t.node):i={type:`leaf`,surfaceId:t.surfaceId},e.empty||this.#e.zones[e.zone]==null)this.#e.zones[e.zone]=i;else{let{region:t,leaf:n}=e,r=lp(t===`e`||t===`w`?`row`:`col`,t===`n`||t===`w`?[i,n]:[n,i]);mp(this.#e.zones,e.zone,n,r),this.#e.zones[e.zone]=fp(this.#e.zones[e.zone])}this.#x(),this.#R()};#L(){this.#i&&(window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#i=null,this.#a=null,this.#t=!1,this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`))}#R(){this.dispatchEvent(new CustomEvent(`dock-tree-change`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#z(){let e=new Map;for(let t of Array.from(this.querySelectorAll(Gf))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(Gf))continue;let n=op(t);n&&e.set(n,t)}return e}});var Sp=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
6136
6136
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
6137
6137
  <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
6138
6138
  </symbol>
@@ -6149,72 +6149,72 @@ slicc-dock-tree .dock-tree__preview--active {
6149
6149
  <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
6150
6150
  <path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
6151
6151
  </symbol>
6152
- </svg>`,Sp=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
6152
+ </svg>`,Cp=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
6153
6153
  <path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
6154
6154
  <path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
6155
- </symbol>`,Cp=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
6155
+ </symbol>`,wp=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
6156
6156
  <path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
6157
- </symbol>`,wp=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
6157
+ </symbol>`,Tp=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
6158
6158
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
6159
6159
  <path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
6160
- </symbol>`,Tp=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
6160
+ </symbol>`,Ep=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
6161
6161
  <path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
6162
- </symbol>`,Ep=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
6162
+ </symbol>`,Dp=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
6163
6163
  <path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
6164
6164
  <path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
6165
- </symbol>`,Dp=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
6165
+ </symbol>`,Op=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
6166
6166
  <path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
6167
6167
  <path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
6168
6168
  <path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
6169
- </symbol>`,Op=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
6169
+ </symbol>`,kp=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
6170
6170
  <path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
6171
- </symbol>`,kp=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
6171
+ </symbol>`,Ap=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
6172
6172
  <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
6173
- </symbol>`,Ap=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
6173
+ </symbol>`,jp=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
6174
6174
  <path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
6175
- </symbol>`,jp=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
6175
+ </symbol>`,Mp=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
6176
6176
  <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
6177
- </symbol>`,Mp=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
6177
+ </symbol>`,Np=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
6178
6178
  <path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
6179
6179
  <path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
6180
- </symbol>`,Np=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
6180
+ </symbol>`,Pp=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
6181
6181
  <path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
6182
6182
  <path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
6183
6183
  <path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
6184
- </symbol>`,Pp=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
6184
+ </symbol>`,Fp=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
6185
6185
  <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
6186
6186
  <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
6187
- </symbol>`,Fp=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
6187
+ </symbol>`,Ip=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
6188
6188
  <path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
6189
6189
  <path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
6190
- </symbol>`,Ip=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
6190
+ </symbol>`,Lp=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
6191
6191
  <path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
6192
6192
  <path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
6193
- </symbol>`,Lp=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
6193
+ </symbol>`,Rp=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
6194
6194
  <path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
6195
- </symbol>`,Rp=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
6195
+ </symbol>`,zp=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
6196
6196
  <path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
6197
- </symbol>`,zp=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
6197
+ </symbol>`,Bp=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
6198
6198
  <path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
6199
- </symbol>`,Bp=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
6199
+ </symbol>`,Vp=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
6200
6200
  <path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
6201
- </symbol>`,Vp=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
6201
+ </symbol>`,Hp=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
6202
6202
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
6203
6203
  <path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
6204
- </symbol>`,Hp=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
6204
+ </symbol>`,Up=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
6205
6205
  <path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
6206
6206
  <path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
6207
- </symbol>`,Up=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
6207
+ </symbol>`,Wp=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
6208
6208
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
6209
6209
  <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
6210
- </symbol>`,Wp=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
6210
+ </symbol>`,Gp=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
6211
6211
  <path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
6212
- </symbol>`,Gp=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
6212
+ </symbol>`,Kp=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
6213
6213
  <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
6214
- </symbol>`,Kp=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
6214
+ </symbol>`,qp=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
6215
6215
  <path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
6216
6216
  <path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
6217
- </symbol>`,qp=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
6217
+ </symbol>`,Jp=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
6218
6218
  <defs>
6219
6219
  <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
6220
6220
  <stop stop-color="currentColor"/>
@@ -6224,82 +6224,82 @@ slicc-dock-tree .dock-tree__preview--active {
6224
6224
  <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
6225
6225
  <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
6226
6226
  <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
6227
- </symbol>`,Jp=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
6227
+ </symbol>`,Yp=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
6228
6228
  <path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
6229
6229
  <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
6230
- </symbol>`,Yp=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
6230
+ </symbol>`,Xp=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
6231
6231
  <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
6232
- </symbol>`,Xp=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
6232
+ </symbol>`,Zp=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
6233
6233
  <path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
6234
- </symbol>`,Zp=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
6234
+ </symbol>`,Qp=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
6235
6235
  <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
6236
6236
  <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
6237
6237
  <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
6238
6238
  <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
6239
- </symbol>`,Qp=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
6239
+ </symbol>`,$p=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
6240
6240
  <path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
6241
6241
  <path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
6242
- </symbol>`,$p=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
6242
+ </symbol>`,em=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
6243
6243
  <path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
6244
6244
  <path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
6245
- </symbol>`,em=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
6245
+ </symbol>`,tm=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
6246
6246
  <path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
6247
- </symbol>`,tm=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
6247
+ </symbol>`,nm=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
6248
6248
  <path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
6249
- </symbol>`,nm=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
6249
+ </symbol>`,rm=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
6250
6250
  <path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
6251
- </symbol>`,rm=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
6251
+ </symbol>`,im=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
6252
6252
  <path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
6253
6253
  <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
6254
- </symbol>`,im=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
6254
+ </symbol>`,am=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
6255
6255
  <path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
6256
- </symbol>`,am=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
6256
+ </symbol>`,om=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
6257
6257
  <path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
6258
6258
  <path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
6259
- </symbol>`,om=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
6259
+ </symbol>`,sm=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
6260
6260
  <path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
6261
6261
  <path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
6262
- </symbol>`,sm=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
6262
+ </symbol>`,cm=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
6263
6263
  <path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
6264
- </symbol>`,cm=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
6264
+ </symbol>`,lm=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
6265
6265
  <path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
6266
6266
  <path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
6267
- </symbol>`,lm=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
6267
+ </symbol>`,um=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
6268
6268
  <path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
6269
- </symbol>`,um=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
6269
+ </symbol>`,dm=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
6270
6270
  <path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
6271
- </symbol>`,dm=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
6271
+ </symbol>`,fm=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
6272
6272
  <path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
6273
6273
  <path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
6274
- </symbol>`,fm=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
6274
+ </symbol>`,pm=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
6275
6275
  <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
6276
6276
  <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
6277
- </symbol>`,pm=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
6277
+ </symbol>`,mm=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
6278
6278
  <path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
6279
- </symbol>`,mm=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
6279
+ </symbol>`,hm=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
6280
6280
  <path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
6281
6281
  <path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
6282
6282
  <path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
6283
- </symbol>`,hm=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
6283
+ </symbol>`,gm=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
6284
6284
  <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
6285
6285
  <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
6286
- </symbol>`,gm=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
6286
+ </symbol>`,_m=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
6287
6287
  <path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
6288
6288
  <path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
6289
6289
  <path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
6290
- </symbol>`,_m=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
6290
+ </symbol>`,vm=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
6291
6291
  <path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
6292
6292
  <path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
6293
- </symbol>`,vm=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
6293
+ </symbol>`,ym=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
6294
6294
  <path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
6295
- </symbol>`,ym=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
6295
+ </symbol>`,bm=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
6296
6296
  <path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
6297
6297
  <path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
6298
- </symbol>`,bm=[wp,kp,jp,Mp,Np,Pp,Lp,Rp,zp,Vp,Hp,Up,Wp,Gp,Kp,Qp,em,tm,sm,cm,dm,fm,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
6298
+ </symbol>`,xm=[Tp,Ap,Mp,Np,Pp,Fp,Rp,zp,Bp,Hp,Up,Wp,Gp,Kp,qp,$p,tm,nm,cm,lm,fm,pm,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
6299
6299
  <path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
6300
6300
  <path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
6301
- </symbol>`],xm=[Sp,Cp,Tp,Ep,Dp,Op,Ap,Fp,Ip,Bp,qp,Jp,Yp,Xp,Zp,$p,nm,rm,im,am,om,lm,um,pm,mm,hm,gm,_m,vm,ym];function Sm(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
6302
- `)}\n</svg>`)}var Cm=Sm(xp,bm),wm={minimal:xp,standard:Cm,complete:Sm(Cm,xm)},Tm={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},Em={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},Dm={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},Om=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),km=new Set([`complete`]);function Am(e){return wm[e===`none`?`minimal`:e]}function jm(e){return`file-tree-builtin-${e}`}function Mm(e){return e!==`none`&&km.has(e)}function Nm(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=Tm[t.toLowerCase()];if(i!=null&&(r||Om.has(i)))return i;for(let e of n){if(r){let t=Dm[e];if(t!=null)return t}let t=Em[e];if(t!=null&&(r||Om.has(t)))return t}return`default`}var Pm=`file-tree-container`,Fm=`data-file-tree-style`,Im=`data-file-tree-unsafe-css`,Lm=`data-file-tree-scrollbar-measure`,Rm=`data-file-tree-scrollbar-gutter-measured`,zm=`--trees-scrollbar-gutter-measured`,Bm=`header`,Vm=`context-menu`,Hm=`context-menu-trigger`;function Um(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function Wm(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(Um(e)?`none`:`complete`),colored:e.colored??!0}}var Gm=e=>e.trim().toLowerCase(),Km=e=>e.split(`/`).at(-1)??e,qm=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function Jm(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function Ym(e){let t=Wm(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(Gm(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=Km(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return Jm(l,e);for(let[t,n]of a)if(c.includes(t))return Jm(n,e);let u=qm(s);for(let t of u){let n=i.get(t);if(n!=null)return Jm(n,e)}let d=Nm(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return Jm(t,e)}return{name:jm(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:Jm(s,e)}}}var Xm=5,Zm=32,Qm=128;function $m(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function eh(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function th(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function nh(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function rh(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function ih(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function ah(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,lh(e,t)}function oh(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=nh(e).get(t);if(i===void 0)return;let a=i>>Xm;e.childVisibleChunkSums[a]+=r}function sh(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=uh(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=Zm}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function ch(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>Xm;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<Xm}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function lh(e,t){if(t.childIds.length<Qm){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/Zm),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>Xm]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function uh(e,t,n,r){let i=Math.min(t.childIds.length,n+Zm),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var dh=7,fh=3,ph=8,mh=4;function hh(e,t,n=0){return e<<mh|n<<fh|t}function gh(e){return e.depthAndFlags>>>mh}function _h(e){return(e.depthAndFlags&ph)>>fh}function H(e){return(e.depthAndFlags&ph)!==0}function vh(e){return e.depthAndFlags&dh}function U(e,t){return(vh(e)&t)!==0}function yh(e,t){e.depthAndFlags|=t}function bh(e,t){e.depthAndFlags=hh(t,vh(e),_h(e))}var xh=Symbol(`benchmarkInstrumentation`);function Sh(e,t){return t==null||Object.defineProperty(e,xh,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Ch(e){return e==null?null:e[xh]??null}function W(e,t,n){return e==null?n():e.measurePhase(t,n)}function wh(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function Th(e){return e>=48&&e<=57}function Eh(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!Th(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&Th(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function Dh(e){let t=e.toLowerCase();return{lowerValue:t,tokens:Eh(t)}}function Oh(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function kh(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=Oh(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Ah(e,t,n){let r=kh(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function jh(e,t){return Ah(e,t,Dh)}function Mh(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Nh(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=Mh(e,r);return a===Mh(t,r)?jh(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Ph(e,t){return Nh(e,t)}function Fh(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Dh(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=Mh(e,n);return o===Mh(t,n)?Ah(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Ih(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Dh(r);return e.sortKeyById[t]=i,i}function Lh(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function Rh(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function zh(e){let{hasTrailingSlash:t,segments:n}=Rh(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function Bh(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=Rh(e);return{requiresDirectory:t,segments:n}}function Vh(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[Dh(``)]}}function Hh(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function Uh(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Wh=Symbol(`pathStorePreparedInputKind`);function Gh(e,t){return e[Wh]=t,e}function Kh(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function qh(e,t,n){return n==="default"?Ph(e,t):n(Kh(e),Kh(t))}function Jh(){return{depthAndFlags:hh(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Yh(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function Xh(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Zh(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Qh(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function $h(e,t={}){return ag(e,t).map(e=>e.path)}function eg(e,t={}){let n=ag(e,t);return Gh({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function tg(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return Gh({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function ng(e){let t=e,n=t.preparedPaths;if(t[Wh]===`prepared`&&n!=null)return n;if(!Zh(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function rg(e){let t=e;return t[Wh]===`presorted`&&t.presortedPaths!=null||Qh(t.presortedPaths)?t.presortedPaths:null}function ig(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function ag(e,t={}){let n=Lh(t),r=Ch(t);wh(r,`workload.inputFiles`,e.length);let i=W(r,`store.preparePathEntries.parse`,()=>e.map(e=>zh(e)));return W(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>qh(e,t,n.sort))),i}var og=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Jh()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=Vh();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Ch(e),this.options=Lh(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,$m())}appendPaths(e){return W(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>zh(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,W(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return W(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null){if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:hh(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:hh(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:hh(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=zh(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null){if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:hh(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:hh(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=zh(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(W(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||W(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?Fh(this.lastPreparedPath,e,this.segmentSortKeyCache):qh(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=Xh(e),i=n==null?0:Xh(n),a=n==null?0:Yh(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=Hh(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:hh(gh(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),rh(i,s),s}createFileChildUnchecked(e,t){let n=Hh(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:hh(gh(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),rh(r,a),a}getOrCreateDirectoryChild(e,t){let n=Hh(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!H(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:hh(gh(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),rh(r,a),this.directories.set(a,$m()),a}createDirectoryChild(e,t){let n=Hh(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:hh(gh(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),rh(r,a),this.directories.set(a,$m()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!H(n))throw Error(`Path is not a directory: "${t}"`);if(U(n,1))throw Error(`Duplicate path: "${t}"`);yh(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,eh());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(H(a)){let t=eh();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;H(n)&&this.directories.set(t,$m());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),rh(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!H(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return ah(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function sg(e,t=`closed`,n=null){let r=lg(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function cg(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function lg(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function ug(e,t){return U(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&gh(t)<=e.defaultExpansion}function dg(e,t,n=e.snapshot.nodes[t]){return n==null||!H(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:ug(e,n)}function fg(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!H(r))return;let i=ug(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function pg(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function mg(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function hg(e,t){let n=pg(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function gg(e,t){let n=pg(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function _g(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function vg(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function yg(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function bg(e,t){e.directoryLoadInfoById.delete(t)}function xg(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Sg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Cg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function wg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Tg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Eg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Dg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Og(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function kg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Ag(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function jg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Mg(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Ng(e,t,n){return{...n,visibleCountDelta:Wg(e)-t}}function Pg(e,t){let n=Wg(e),r=cg();e.transactionStack.push(r);try{t()}catch(t){throw Lg(e,r,!1),t}Lg(e,r,!0,Wg(e)-n)}function Fg(e,t){let n=e.instrumentation;if(n==null){Ig(e,t);return}W(n,`store.events.record`,()=>Ig(e,t))}function Ig(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Hg(e,t);return}n.events.push(t),Vg(n,t)}function Lg(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?Bg(i,t):W(n,`store.events.batch.merge`,()=>Bg(i,t));return}let a=Rg(t,r),o=e.instrumentation;if(o==null){Hg(e,a);return}W(o,`store.events.batch.commit`,()=>Hg(e,a))}function Rg(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function zg(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function Bg(e,t){for(let n of t.events)e.events.push(n);zg(e,t)}function Vg(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Hg(e,t){let n=e.instrumentation;if(n==null){Ug(e,t);return}W(n,`store.events.emit`,()=>Ug(e,t))}function Ug(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Wg(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Gg(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!H(n)||U(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!H(a)?null:i}function Kg(e,t){let n=t;for(;;){let t=Gg(e,n);if(t==null)return n;n=t}}function qg(e,t){let n=[t],r=t;for(;;){let t=Gg(e,r);if(t==null)return n;n.push(t),r=t}}function Jg(e,t){let n=t==null?e.snapshot.rootId:r_(e,t);return n==null?[]:a_(e,n)}function Yg(e,t){let n=zh(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=b_(e,y_(e,r)),{createdNodeIds:a,directoryId:o}=o_(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=q(e,o);if(U(n,1))throw Error(`Path already exists: "${t}"`);yh(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=c_(e,o,n.basename),s.add(c);e_(e,o);let l=b_(e,o);return Sg({affectedAncestorIds:n_(e,c),affectedNodeIds:[...s],path:t,projectionChanged:x_(i,l)})}function Xg(e,t,n){let r=r_(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=q(e,r);if(U(i,2))throw Error(`The root node cannot be removed`);if(H(i)&&K(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=b_(e,a),s=__(e,r);d_(e,a,r,i.nameId),v_(e,a),e_(e,a);let c=b_(e,a);return Cg({affectedAncestorIds:n_(e,a),affectedNodeIds:s,path:t,projectionChanged:x_(o,c),recursive:n.recursive===!0})}function Zg(e,t,n,r){let i=r_(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=q(e,i);if(U(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=h_(e,i,n),c=b_(e,a.parentId),l=b_(e,s.parentId),u=Uh(e.snapshot.segmentTable,a.nameId),d=Hh(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(H(a)&&T_(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=th(e.snapshot.nodes,K(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&g_(e,p,o,_h(a))===`skip`)return null;let m=a.parentId;d_(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),w_(e,i),u_(e,s.parentId,i),v_(e,m),e.pathCacheVersion++,e_(e,m),s.parentId!==m&&e_(e,s.parentId);let h=b_(e,m),g=b_(e,s.parentId);return wg({affectedAncestorIds:[...new Set([...n_(e,m),...n_(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:S_([c,l],[h,g]),to:G(e,i)})}function Qg(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function $g(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function G(e,t){let n=q(e,t),r=Qg(e,t);if(r!=null)return r;if(U(n,2))return $g(e,t,``);let i=G(e,n.parentId),a=Uh(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return $g(e,t,H(n)?`${o}/`:o)}function e_(e,t){let n=e.instrumentation;if(n==null){D_(e,t);return}W(n,`store.recomputeCountsUpwardFrom`,()=>D_(e,t))}function t_(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!H(o)){E_(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){E_(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function n_(e,t){let n=[],r=t;for(;r!=null;){let t=q(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function r_(e,t){if(t.length===0)return e.snapshot.rootId;let n=Bh(t);return i_(e,n.segments,n.requiresDirectory)}function i_(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=K(e,r),a=th(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=q(e,r);return n&&!H(i)?null:r}function K(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function q(e,t){let n=e.snapshot.nodes[t];if(n===void 0||U(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function a_(e,t){let n=e.snapshot.nodes[t];if(n===void 0||U(n,4))return[];if(!H(n))return[G(e,t)];if(K(e,t).childIds.length===0)return U(n,1)&&!U(n,2)?[G(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||U(n,4)){i.pop();continue}if(!H(n)){r.push(G(e,t.nodeId)),i.pop();continue}let a=K(e,t.nodeId);if(a.childIds.length===0){U(n,1)&&!U(n,2)&&r.push(G(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function o_(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Hh(e.snapshot.segmentTable,i),a=K(e,r),o=th(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!H(q(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=s_(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function s_(e,t,n){let r=q(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:hh(gh(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,$m()),u_(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function c_(e,t,n){let r=Hh(e.snapshot.segmentTable,n),i=K(e,t);if(th(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${k_(e,t,n)}"`);let a=q(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:hh(gh(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),u_(e,t,o),e.activeNodeCount++,o}function l_(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}f_(e,n,o)<0?i=a:r=a+1}return r}function u_(e,t,n){let r=K(e,t),i=q(e,n);th(e.snapshot.nodes,r).set(i.nameId,n),oh(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=l_(e,r,n);r.childIds.splice(a,0,n),ih(r,a),lh(e.snapshot.nodes,r)}function d_(e,t,n,r){let i=K(e,t),a=nh(i),o=a.get(n)??-1;th(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&oh(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),ih(i,o),lh(e.snapshot.nodes,i))}function f_(e,t,n){let r=e.snapshot.options.sort;return r==="default"?p_(e,t,n):r(m_(e,t),m_(e,n))}function p_(e,t,n){let r=q(e,t),i=q(e,n),a=H(r);if(a!==H(i))return a?-1:1;let o=kh(Ih(e.snapshot.segmentTable,r.nameId),Ih(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Uh(e.snapshot.segmentTable,r.nameId),c=Uh(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function m_(e,t){let n=q(e,t),r=G(e,t),i=H(n),a=i?r.slice(0,-1):r;return{basename:Uh(e.snapshot.segmentTable,n.nameId),depth:gh(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function h_(e,t,n){let r=q(e,t),i=r_(e,n);if(i!=null){let t=q(e,i);if(H(t))return{basename:Uh(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=Bh(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=Bh(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:i_(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function g_(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${G(e,t)}"`);let i=q(e,t);if(_h(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(H(i)&&K(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return __(e,t),d_(e,a,t,o),v_(e,a),e_(e,a),`handled`}function __(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=q(e,t.nodeId);if(t.visitedChildren||!H(i)){H(i)&&e.snapshot.directories.delete(t.nodeId),yh(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),bg(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=K(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function v_(e,t){let n=t;for(;n!=null;){let t=q(e,n);if(!H(t)||U(t,2)||K(e,n).childIds.length>0)return;yh(t,1),n=t.parentId===n?null:t.parentId}}function y_(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=th(e.snapshot.nodes,K(e,n)).get(t);if(i==null||!H(q(e,i)))break;n=i}return n}function b_(e,t){let n=C_(e,t);if(n==null)return null;let r=Kg(e,n),i=q(e,r),a=n===r?null:qg(e,n).map(t=>G(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:K(e,r).childIds.length>0,path:G(e,r),terminalKind:_h(i)})}function x_(e,t){return S_([e],[t])}function S_(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function C_(e,t){let n=t;for(;n!=null;){let t=q(e,n);if(!H(t)||U(t,2))return null;if(!dg(e,n,t))return n;n=t.parentId}return null}function w_(e,t){let n=q(e,t);if(bh(n,(t===e.snapshot.rootId?-1:gh(q(e,n.parentId)))+1),!H(n))return;let r=K(e,t);for(let t of r.childIds)w_(e,t)}function T_(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=q(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function E_(e,t,n=q(e,t),r=!1){let i=e.instrumentation;if(i==null){O_(e,t,n,r);return}W(i,`store.recomputeNodeCounts`,()=>O_(e,t,n,r))}function D_(e,t){let n=t;for(;n!=null;){let t=q(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(E_(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&oh(K(e,s),n,a,o),n=s}}function O_(e,t,n,r){if(!H(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=K(e,t);if(r){let t=e.instrumentation;t==null?ah(e.snapshot.nodes,i):W(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>ah(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,U(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Gg(e,t)==null?dg(e,t,n)?1+o:1:o}function k_(e,t,n){let r=G(e,t);return r.length===0?n:`${r}${n}`}function A_(e){return e!=null&&!U(e,4)}function j_(e,t){let n=e.snapshot.nodes[t];return!A_(n)||!H(n)||U(n,2)?null:n}function M_(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&A_(e.snapshot.nodes[n])&&(t+=1);return t}function N_(e){return Math.max(0,e.valueById.length-1)}function P_(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:M_(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:N_(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function F_(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function I_(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)j_(e,n)!=null&&t.push(G(e,n));for(let t of e.expandedDirectoryIds)j_(e,t)!=null&&n.push(G(e,t));return{collapsedPaths:t,expandedPaths:n}}function L_(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)j_(e,n)!=null&&mg(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:G(e,n)});return t}function R_(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=r_(e,n);t!=null&&fg(e,t,!0,q(e,t))}for(let n of t.collapsedPaths){let t=r_(e,n);t!=null&&fg(e,t,!1,q(e,t))}}function z_(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=r_(e,n.path);t!=null&&j_(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function B_(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function V_(e){let t=e.snapshot.segmentTable,n=Vh();for(let r of e.snapshot.nodes)if(A_(r)){if(U(r,2)){r.nameId=0;continue}r.nameId=Hh(n,Uh(t,r.nameId))}e.snapshot.segmentTable=n}function H_(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!A_(r)||!H(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return A_(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[q(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),ah(e.snapshot.nodes,n)}}function U_(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(A_(n))break;--t}e.snapshot.nodes.length=t+1}function W_(e){let t=I_(e),n=L_(e);W(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>B_(e)),W(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>V_(e)),W(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>H_(e)),W(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>U_(e)),W(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>R_(e,t)),W(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>z_(e,n)),W(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>t_(e,e.snapshot.rootId))}function G_(e){let t=I_(e),n=L_(e),r=W(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Jg(e)),i=Sh({...e.snapshot.options},e.instrumentation),a=W(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new og(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,W(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>R_(e,t)),W(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>z_(e,n)),W(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>t_(e,e.snapshot.rootId))}function K_(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function q_(e,t){let n=P_(e);t===`stable`?W(e.instrumentation,`store.cleanup.stable`,()=>W_(e)):W(e.instrumentation,`store.cleanup.aggressive`,()=>G_(e));let r=P_(e);return F_(t,t===`stable`,n,r)}var J_=64;function Y_(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function J(e){return q(e,e.snapshot.rootId).visibleSubtreeCount}function X_(e,t,n,r){let i=q(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function Z_(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:gv(e,t.cursor),setSize:t.setSize,subtreeEndIndex:X_(e,t.cursor,t.index,n)}}function Q_(e,t,n,r,i,a){let o=K(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=sh(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return $_(e,u,l,r+c,i+1,s,o.childIds.length,a)}function $_(e,t,n,r,i,a,o,s){if(!H(q(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=uv(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=q(e,c.terminalNodeId);if(!H(l)||!dg(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Q_(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function ev(e,t){let n=J(e);if(t<0||t>=n)return null;let r=Q_(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>G(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=Z_(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:gv(e,r.cursor),setSize:r.setSize,subtreeEndIndex:X_(e,r.cursor,r.index,n)}}function tv(e,t,n){let r=e.instrumentation,i=J(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return hv(e,o+1);let t=[],n=sv(e,a);for(let r=a;r<=o&&n!=null;r++){let r=gv(e,n);t.push(r),n=fv(e,n)}return t}let s=[],c=0,l=0,u=W(r,`store.getVisibleSlice.selectFirstRow`,()=>sv(e,a));for(let t=a;t<=o&&u!=null;t++){let t=W(r,`store.getVisibleSlice.materializeRow`,()=>gv(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=W(r,`store.getVisibleSlice.advanceCursor`,()=>fv(e,u))}return wh(r,`workload.visibleRowsRead`,s.length),wh(r,`workload.flattenedRowsRead`,c),wh(r,`workload.flattenedSegmentsRead`,l),s}function nv(e,t=J(e)){let n=e.instrumentation;return n==null?mv(e,t):W(n,`store.getVisibleTreeProjection`,()=>mv(e,t))}function rv(e){return pv(nv(e))}function iv(e,t){let n=r_(e,t);if(n==null||n===e.snapshot.rootId||H(q(e,n))&&Kg(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=q(e,i).parentId,n=K(e,t),s=nh(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=ch(a,n,s),t!==o){let n=q(e,t),a=Gg(e,t);if(!dg(e,t,n)&&a!==i)return null;Kg(e,t)===t&&(r+=1)}i=t}return r}function av(e,t){let n=r_(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=q(e,n);if(!H(r))throw Error(`Path is not a directory: "${t}"`);return dg(e,n,r)?null:(fg(e,n,!0,r),e_(e,n),Tg({affectedAncestorIds:n_(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function ov(e,t){let n=r_(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=q(e,n);if(!H(r))throw Error(`Path is not a directory: "${t}"`);return dg(e,n,r)?(fg(e,n,!1,r),e_(e,n),Eg({affectedAncestorIds:n_(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function sv(e,t){return t<0||t>=J(e)?null:cv(e,e.snapshot.rootId,t,-1)}function cv(e,t,n,r){let i=K(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?sh(e.snapshot.nodes,i,n):W(a,`store.getVisibleSlice.selectChildIndex`,()=>sh(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return lv(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function lv(e,t,n,r){if(!H(q(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=uv(e,t,r);if(n===0)return i;let a=q(e,i.terminalNodeId);if(!H(a)||!dg(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return cv(e,i.terminalNodeId,n-1,i.visibleDepth)}function uv(e,t,n){return H(q(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Kg(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:W(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Kg(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function dv(e,t){let n=q(e,t);if(!H(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||Gg(e,r)!==t}function fv(e,t){let n=q(e,t.terminalNodeId);if(H(n)){let r=K(e,t.terminalNodeId);if(dg(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:lv(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=q(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=K(e,n),o=nh(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return lv(e,s,0,i);dv(e,r)&&i--,r=n}}function pv(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function mv(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(J_);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=Y_(o,y);let x,S=_;if(H(v))S=f?Kg(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:G(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&H(C)&&dg(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function hv(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!H(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:G(e,f)};continue}let h=l?Kg(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=gv(e,g);let _=i[h];_!=null&&H(_)&&dg(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function gv(e,t){let n=q(e,t.terminalNodeId),r=H(n)?_v(e,t):null,i=G(e,t.terminalNodeId),a=Uh(e.snapshot.segmentTable,n.nameId),o=H(n)&&K(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?qg(e,t.headNodeId).map(n=>{let r=q(e,n);return{isTerminal:n===t.terminalNodeId,name:Uh(e.snapshot.segmentTable,r.nameId),nodeId:n,path:G(e,n)}}):W(c,`store.getVisibleSlice.flatten.collectSegments`,()=>qg(e,t.headNodeId).map(n=>{let r=q(e,n);return{isTerminal:n===t.terminalNodeId,name:Uh(e.snapshot.segmentTable,r.nameId),nodeId:n,path:G(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:H(n)&&dg(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:H(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function _v(e,t){if(t.headNodeId===t.terminalNodeId)return mg(e,t.terminalNodeId);let n=qg(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=mg(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var vv=8;function yv(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function bv(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&vv)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&vv)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function xv(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!H(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&lh(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&H(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,lh(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Sv(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=yv(e.snapshot);bv(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&lh(n,i)}}function Cv(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var wv=class e{#e;constructor(e={}){let t=Ch(e),n=W(t,`store.builder.create`,()=>new og(e));if(e.preparedInput!=null){let t=rg(e.preparedInput);t==null?n.appendPreparedPaths(ng(e.preparedInput),!1):n.appendPresortedPaths(t,ig(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(W(t,`store.preparePathEntries`,()=>ag(r,e)))}let r=W(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=W(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=W(t,`store.state.create`,()=>sg(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:W(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Cv(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&W(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?W(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>Sv(this.#e)):W(t,`store.state.initializeOpenVisibleCounts`,()=>xv(this.#e)):W(t,`store.state.recomputeCounts`,()=>t_(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return $h(e,t)}static prepareInput(e,t={}){return eg(e,t)}static preparePresortedInput(e){return tg(e)}list(e){return W(this.#e.instrumentation,`store.list`,()=>Jg(this.#e,e))}add(e){W(this.#e.instrumentation,`store.add`,()=>{let t=J(this.#e);Fg(this.#e,Ng(this.#e,t,Yg(this.#e,e)))})}remove(e,t={}){W(this.#e.instrumentation,`store.remove`,()=>{let n=J(this.#e);Fg(this.#e,Ng(this.#e,n,Xg(this.#e,e,t)))})}move(e,t,n={}){W(this.#e.instrumentation,`store.move`,()=>{let r=J(this.#e),i=Zg(this.#e,e,t,n);i!=null&&Fg(this.#e,Ng(this.#e,r,i))})}batch(e){Pg(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return W(this.#e.instrumentation,`store.getVisibleCount`,()=>J(this.#e))}getVisibleSlice(e,t){return W(this.#e.instrumentation,`store.getVisibleSlice`,()=>tv(this.#e,e,t))}getVisibleRowContext(e){return W(this.#e.instrumentation,`store.getVisibleRowContext`,()=>ev(this.#e,e))}getVisibleTreeProjection(){return rv(this.#e)}getVisibleTreeProjectionData(e){return nv(this.#e,e)}getVisibleIndex(e){return W(this.#e.instrumentation,`store.getVisibleIndex`,()=>iv(this.#e,e))}getPathInfo(e){return W(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=r_(this.#e,e);if(t==null)return null;let n=q(this.#e,t);return{depth:gh(n),kind:H(n)?`directory`:`file`,path:G(this.#e,t)}})}isExpanded(e){return W(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=q(this.#e,t);return dg(this.#e,t,n)})}expand(e){W(this.#e.instrumentation,`store.expand`,()=>{let t=J(this.#e),n=av(this.#e,e);n!=null&&Fg(this.#e,Ng(this.#e,t,n))})}collapse(e){W(this.#e.instrumentation,`store.collapse`,()=>{let t=J(this.#e),n=ov(this.#e,e);n!=null&&Fg(this.#e,Ng(this.#e,t,n))})}on(e,t){return xg(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return mg(this.#e,t)}markDirectoryUnloaded(e){W(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(K(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=J(this.#e);gg(this.#e,t),Fg(this.#e,Ng(this.#e,n,Dg({affectedAncestorIds:n_(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return W(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=J(this.#e),r=hg(this.#e,t);return Fg(this.#e,Ng(this.#e,n,Og({affectedAncestorIds:n_(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return W(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||mg(this.#e,n)!==`loading`||!vg(this.#e,n,e.attemptId))return!1;let r=G(this.#e,n);this.validateChildPatch(r,t);let i=J(this.#e),a=[];for(let e of t.operations){Tv(r,e);let t=J(this.#e);switch(e.type){case`add`:a.push(Ng(this.#e,t,Yg(this.#e,e.path)));break;case`remove`:a.push(Ng(this.#e,t,Xg(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=Zg(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Ng(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Fg(this.#e,Ng(this.#e,i,kg({affectedAncestorIds:n_(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:G(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return W(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=J(this.#e),r=_g(this.#e,t,e.attemptId);return Fg(this.#e,Ng(this.#e,n,Ag({affectedAncestorIds:n_(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:G(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return W(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=J(this.#e),i=yg(this.#e,n,e.attemptId,t);return Fg(this.#e,Ng(this.#e,r,jg({affectedAncestorIds:n_(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:G(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return W(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(K_(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=J(this.#e),n=q_(this.#e,e.mode??`stable`);return Fg(this.#e,Ng(this.#e,t,Mg({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=K(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Dh(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=kh(Ih(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!H(q(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=q(this.#e,n);dg(this.#e,n,i)||(fg(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=q(this.#e,e);if(!dg(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=r_(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!H(q(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!H(q(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=q(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=q(this.#e,e),r=Gg(this.#e,e);if(!dg(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function Tv(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}function Ev(e,t={}){return wv.prepareInput(e,t)}var Dv={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function Ov(e,t){if(typeof e==`number`)return{itemHeight:t??Dv.default.itemHeight,factor:e};let n=Dv[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var kv=Dv.default.itemHeight,Av=`@layer base {
6301
+ </symbol>`],Sm=[Cp,wp,Ep,Dp,Op,kp,jp,Ip,Lp,Vp,Jp,Yp,Xp,Zp,Qp,em,rm,im,am,om,sm,um,dm,mm,hm,gm,_m,vm,ym,bm];function Cm(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
6302
+ `)}\n</svg>`)}var wm=Cm(Sp,xm),Tm={minimal:Sp,standard:wm,complete:Cm(wm,Sm)},Em={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},Dm={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},Om={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},km=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),Am=new Set([`complete`]);function jm(e){return Tm[e===`none`?`minimal`:e]}function Mm(e){return`file-tree-builtin-${e}`}function Nm(e){return e!==`none`&&Am.has(e)}function Pm(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=Em[t.toLowerCase()];if(i!=null&&(r||km.has(i)))return i;for(let e of n){if(r){let t=Om[e];if(t!=null)return t}let t=Dm[e];if(t!=null&&(r||km.has(t)))return t}return`default`}var Fm=`file-tree-container`,Im=`data-file-tree-style`,Lm=`data-file-tree-unsafe-css`,Rm=`data-file-tree-scrollbar-measure`,zm=`data-file-tree-scrollbar-gutter-measured`,Bm=`--trees-scrollbar-gutter-measured`,Vm=`header`,Hm=`context-menu`,Um=`context-menu-trigger`;function Wm(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function Gm(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(Wm(e)?`none`:`complete`),colored:e.colored??!0}}var Km=e=>e.trim().toLowerCase(),qm=e=>e.split(`/`).at(-1)??e,Jm=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function Ym(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function Xm(e){let t=Gm(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(Km(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=qm(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return Ym(l,e);for(let[t,n]of a)if(c.includes(t))return Ym(n,e);let u=Jm(s);for(let t of u){let n=i.get(t);if(n!=null)return Ym(n,e)}let d=Pm(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return Ym(t,e)}return{name:Mm(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:Ym(s,e)}}}var Zm=5,Qm=32,$m=128;function eh(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function th(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function nh(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function rh(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function ih(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function ah(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function oh(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,uh(e,t)}function sh(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=rh(e).get(t);if(i===void 0)return;let a=i>>Zm;e.childVisibleChunkSums[a]+=r}function ch(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=dh(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=Qm}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function lh(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>Zm;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<Zm}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function uh(e,t){if(t.childIds.length<$m){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/Qm),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>Zm]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function dh(e,t,n,r){let i=Math.min(t.childIds.length,n+Qm),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var fh=7,ph=3,mh=8,hh=4;function gh(e,t,n=0){return e<<hh|n<<ph|t}function _h(e){return e.depthAndFlags>>>hh}function vh(e){return(e.depthAndFlags&mh)>>ph}function H(e){return(e.depthAndFlags&mh)!==0}function yh(e){return e.depthAndFlags&fh}function U(e,t){return(yh(e)&t)!==0}function bh(e,t){e.depthAndFlags|=t}function xh(e,t){e.depthAndFlags=gh(t,yh(e),vh(e))}var Sh=Symbol(`benchmarkInstrumentation`);function Ch(e,t){return t==null||Object.defineProperty(e,Sh,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function wh(e){return e==null?null:e[Sh]??null}function W(e,t,n){return e==null?n():e.measurePhase(t,n)}function Th(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function Eh(e){return e>=48&&e<=57}function Dh(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!Eh(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&Eh(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function Oh(e){let t=e.toLowerCase();return{lowerValue:t,tokens:Dh(t)}}function kh(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function Ah(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=kh(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function jh(e,t,n){let r=Ah(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function Mh(e,t){return jh(e,t,Oh)}function Nh(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Ph(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=Nh(e,r);return a===Nh(t,r)?Mh(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Fh(e,t){return Ph(e,t)}function Ih(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Oh(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=Nh(e,n);return o===Nh(t,n)?jh(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Lh(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Oh(r);return e.sortKeyById[t]=i,i}function Rh(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function zh(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function Bh(e){let{hasTrailingSlash:t,segments:n}=zh(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function Vh(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=zh(e);return{requiresDirectory:t,segments:n}}function Hh(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[Oh(``)]}}function Uh(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function Wh(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Gh=Symbol(`pathStorePreparedInputKind`);function Kh(e,t){return e[Gh]=t,e}function qh(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function Jh(e,t,n){return n==="default"?Fh(e,t):n(qh(e),qh(t))}function Yh(){return{depthAndFlags:gh(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Xh(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function Zh(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Qh(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function $h(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function eg(e,t={}){return og(e,t).map(e=>e.path)}function tg(e,t={}){let n=og(e,t);return Kh({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function ng(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return Kh({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function rg(e){let t=e,n=t.preparedPaths;if(t[Gh]===`prepared`&&n!=null)return n;if(!Qh(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function ig(e){let t=e;return t[Gh]===`presorted`&&t.presortedPaths!=null||$h(t.presortedPaths)?t.presortedPaths:null}function ag(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function og(e,t={}){let n=Rh(t),r=wh(t);Th(r,`workload.inputFiles`,e.length);let i=W(r,`store.preparePathEntries.parse`,()=>e.map(e=>Bh(e)));return W(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>Jh(e,t,n.sort))),i}var sg=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Yh()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=Hh();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=wh(e),this.options=Rh(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,eh())}appendPaths(e){return W(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>Bh(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,W(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return W(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null){if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:gh(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:gh(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:gh(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=Bh(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null){if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:gh(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:gh(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=Bh(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(W(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||W(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?Ih(this.lastPreparedPath,e,this.segmentSortKeyCache):Jh(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=Zh(e),i=n==null?0:Zh(n),a=n==null?0:Xh(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=Uh(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:gh(_h(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),ih(i,s),s}createFileChildUnchecked(e,t){let n=Uh(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:gh(_h(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),ih(r,a),a}getOrCreateDirectoryChild(e,t){let n=Uh(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!H(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:gh(_h(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),ih(r,a),this.directories.set(a,eh()),a}createDirectoryChild(e,t){let n=Uh(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:gh(_h(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),ih(r,a),this.directories.set(a,eh()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!H(n))throw Error(`Path is not a directory: "${t}"`);if(U(n,1))throw Error(`Duplicate path: "${t}"`);bh(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,th());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(H(a)){let t=th();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;H(n)&&this.directories.set(t,eh());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),ih(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!H(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return oh(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function cg(e,t=`closed`,n=null){let r=ug(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function lg(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function ug(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function dg(e,t){return U(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&_h(t)<=e.defaultExpansion}function fg(e,t,n=e.snapshot.nodes[t]){return n==null||!H(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:dg(e,n)}function pg(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!H(r))return;let i=dg(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function mg(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function hg(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function gg(e,t){let n=mg(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function _g(e,t){let n=mg(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function vg(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function yg(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function bg(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function xg(e,t){e.directoryLoadInfoById.delete(t)}function Sg(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Cg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function wg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Tg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Eg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Dg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Og(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function kg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Ag(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function jg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Mg(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Ng(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Pg(e,t,n){return{...n,visibleCountDelta:Gg(e)-t}}function Fg(e,t){let n=Gg(e),r=lg();e.transactionStack.push(r);try{t()}catch(t){throw Rg(e,r,!1),t}Rg(e,r,!0,Gg(e)-n)}function Ig(e,t){let n=e.instrumentation;if(n==null){Lg(e,t);return}W(n,`store.events.record`,()=>Lg(e,t))}function Lg(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Ug(e,t);return}n.events.push(t),Hg(n,t)}function Rg(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?Vg(i,t):W(n,`store.events.batch.merge`,()=>Vg(i,t));return}let a=zg(t,r),o=e.instrumentation;if(o==null){Ug(e,a);return}W(o,`store.events.batch.commit`,()=>Ug(e,a))}function zg(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function Bg(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function Vg(e,t){for(let n of t.events)e.events.push(n);Bg(e,t)}function Hg(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Ug(e,t){let n=e.instrumentation;if(n==null){Wg(e,t);return}W(n,`store.events.emit`,()=>Wg(e,t))}function Wg(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Gg(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Kg(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!H(n)||U(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!H(a)?null:i}function qg(e,t){let n=t;for(;;){let t=Kg(e,n);if(t==null)return n;n=t}}function Jg(e,t){let n=[t],r=t;for(;;){let t=Kg(e,r);if(t==null)return n;n.push(t),r=t}}function Yg(e,t){let n=t==null?e.snapshot.rootId:i_(e,t);return n==null?[]:o_(e,n)}function Xg(e,t){let n=Bh(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=x_(e,b_(e,r)),{createdNodeIds:a,directoryId:o}=s_(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=q(e,o);if(U(n,1))throw Error(`Path already exists: "${t}"`);bh(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=l_(e,o,n.basename),s.add(c);t_(e,o);let l=x_(e,o);return Cg({affectedAncestorIds:r_(e,c),affectedNodeIds:[...s],path:t,projectionChanged:S_(i,l)})}function Zg(e,t,n){let r=i_(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=q(e,r);if(U(i,2))throw Error(`The root node cannot be removed`);if(H(i)&&K(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=x_(e,a),s=v_(e,r);f_(e,a,r,i.nameId),y_(e,a),t_(e,a);let c=x_(e,a);return wg({affectedAncestorIds:r_(e,a),affectedNodeIds:s,path:t,projectionChanged:S_(o,c),recursive:n.recursive===!0})}function Qg(e,t,n,r){let i=i_(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=q(e,i);if(U(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=g_(e,i,n),c=x_(e,a.parentId),l=x_(e,s.parentId),u=Wh(e.snapshot.segmentTable,a.nameId),d=Uh(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(H(a)&&E_(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=nh(e.snapshot.nodes,K(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&__(e,p,o,vh(a))===`skip`)return null;let m=a.parentId;f_(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),T_(e,i),d_(e,s.parentId,i),y_(e,m),e.pathCacheVersion++,t_(e,m),s.parentId!==m&&t_(e,s.parentId);let h=x_(e,m),g=x_(e,s.parentId);return Tg({affectedAncestorIds:[...new Set([...r_(e,m),...r_(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:C_([c,l],[h,g]),to:G(e,i)})}function $g(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function e_(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function G(e,t){let n=q(e,t),r=$g(e,t);if(r!=null)return r;if(U(n,2))return e_(e,t,``);let i=G(e,n.parentId),a=Wh(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return e_(e,t,H(n)?`${o}/`:o)}function t_(e,t){let n=e.instrumentation;if(n==null){O_(e,t);return}W(n,`store.recomputeCountsUpwardFrom`,()=>O_(e,t))}function n_(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!H(o)){D_(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){D_(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function r_(e,t){let n=[],r=t;for(;r!=null;){let t=q(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function i_(e,t){if(t.length===0)return e.snapshot.rootId;let n=Vh(t);return a_(e,n.segments,n.requiresDirectory)}function a_(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=K(e,r),a=nh(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=q(e,r);return n&&!H(i)?null:r}function K(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function q(e,t){let n=e.snapshot.nodes[t];if(n===void 0||U(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function o_(e,t){let n=e.snapshot.nodes[t];if(n===void 0||U(n,4))return[];if(!H(n))return[G(e,t)];if(K(e,t).childIds.length===0)return U(n,1)&&!U(n,2)?[G(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||U(n,4)){i.pop();continue}if(!H(n)){r.push(G(e,t.nodeId)),i.pop();continue}let a=K(e,t.nodeId);if(a.childIds.length===0){U(n,1)&&!U(n,2)&&r.push(G(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function s_(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Uh(e.snapshot.segmentTable,i),a=K(e,r),o=nh(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!H(q(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=c_(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function c_(e,t,n){let r=q(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:gh(_h(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,eh()),d_(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function l_(e,t,n){let r=Uh(e.snapshot.segmentTable,n),i=K(e,t);if(nh(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${A_(e,t,n)}"`);let a=q(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:gh(_h(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),d_(e,t,o),e.activeNodeCount++,o}function u_(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}p_(e,n,o)<0?i=a:r=a+1}return r}function d_(e,t,n){let r=K(e,t),i=q(e,n);nh(e.snapshot.nodes,r).set(i.nameId,n),sh(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=u_(e,r,n);r.childIds.splice(a,0,n),ah(r,a),uh(e.snapshot.nodes,r)}function f_(e,t,n,r){let i=K(e,t),a=rh(i),o=a.get(n)??-1;nh(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&sh(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),ah(i,o),uh(e.snapshot.nodes,i))}function p_(e,t,n){let r=e.snapshot.options.sort;return r==="default"?m_(e,t,n):r(h_(e,t),h_(e,n))}function m_(e,t,n){let r=q(e,t),i=q(e,n),a=H(r);if(a!==H(i))return a?-1:1;let o=Ah(Lh(e.snapshot.segmentTable,r.nameId),Lh(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Wh(e.snapshot.segmentTable,r.nameId),c=Wh(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function h_(e,t){let n=q(e,t),r=G(e,t),i=H(n),a=i?r.slice(0,-1):r;return{basename:Wh(e.snapshot.segmentTable,n.nameId),depth:_h(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function g_(e,t,n){let r=q(e,t),i=i_(e,n);if(i!=null){let t=q(e,i);if(H(t))return{basename:Wh(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=Vh(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=Vh(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:a_(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function __(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${G(e,t)}"`);let i=q(e,t);if(vh(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(H(i)&&K(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return v_(e,t),f_(e,a,t,o),y_(e,a),t_(e,a),`handled`}function v_(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=q(e,t.nodeId);if(t.visitedChildren||!H(i)){H(i)&&e.snapshot.directories.delete(t.nodeId),bh(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),xg(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=K(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function y_(e,t){let n=t;for(;n!=null;){let t=q(e,n);if(!H(t)||U(t,2)||K(e,n).childIds.length>0)return;bh(t,1),n=t.parentId===n?null:t.parentId}}function b_(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=nh(e.snapshot.nodes,K(e,n)).get(t);if(i==null||!H(q(e,i)))break;n=i}return n}function x_(e,t){let n=w_(e,t);if(n==null)return null;let r=qg(e,n),i=q(e,r),a=n===r?null:Jg(e,n).map(t=>G(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:K(e,r).childIds.length>0,path:G(e,r),terminalKind:vh(i)})}function S_(e,t){return C_([e],[t])}function C_(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function w_(e,t){let n=t;for(;n!=null;){let t=q(e,n);if(!H(t)||U(t,2))return null;if(!fg(e,n,t))return n;n=t.parentId}return null}function T_(e,t){let n=q(e,t);if(xh(n,(t===e.snapshot.rootId?-1:_h(q(e,n.parentId)))+1),!H(n))return;let r=K(e,t);for(let t of r.childIds)T_(e,t)}function E_(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=q(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function D_(e,t,n=q(e,t),r=!1){let i=e.instrumentation;if(i==null){k_(e,t,n,r);return}W(i,`store.recomputeNodeCounts`,()=>k_(e,t,n,r))}function O_(e,t){let n=t;for(;n!=null;){let t=q(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(D_(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&sh(K(e,s),n,a,o),n=s}}function k_(e,t,n,r){if(!H(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=K(e,t);if(r){let t=e.instrumentation;t==null?oh(e.snapshot.nodes,i):W(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>oh(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,U(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Kg(e,t)==null?fg(e,t,n)?1+o:1:o}function A_(e,t,n){let r=G(e,t);return r.length===0?n:`${r}${n}`}function j_(e){return e!=null&&!U(e,4)}function M_(e,t){let n=e.snapshot.nodes[t];return!j_(n)||!H(n)||U(n,2)?null:n}function N_(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&j_(e.snapshot.nodes[n])&&(t+=1);return t}function P_(e){return Math.max(0,e.valueById.length-1)}function F_(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:N_(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:P_(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function I_(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function L_(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)M_(e,n)!=null&&t.push(G(e,n));for(let t of e.expandedDirectoryIds)M_(e,t)!=null&&n.push(G(e,t));return{collapsedPaths:t,expandedPaths:n}}function R_(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)M_(e,n)!=null&&hg(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:G(e,n)});return t}function z_(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=i_(e,n);t!=null&&pg(e,t,!0,q(e,t))}for(let n of t.collapsedPaths){let t=i_(e,n);t!=null&&pg(e,t,!1,q(e,t))}}function B_(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=i_(e,n.path);t!=null&&M_(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function V_(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function H_(e){let t=e.snapshot.segmentTable,n=Hh();for(let r of e.snapshot.nodes)if(j_(r)){if(U(r,2)){r.nameId=0;continue}r.nameId=Uh(n,Wh(t,r.nameId))}e.snapshot.segmentTable=n}function U_(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!j_(r)||!H(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return j_(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[q(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),oh(e.snapshot.nodes,n)}}function W_(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(j_(n))break;--t}e.snapshot.nodes.length=t+1}function G_(e){let t=L_(e),n=R_(e);W(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>V_(e)),W(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>H_(e)),W(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>U_(e)),W(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>W_(e)),W(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>z_(e,t)),W(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>B_(e,n)),W(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>n_(e,e.snapshot.rootId))}function K_(e){let t=L_(e),n=R_(e),r=W(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Yg(e)),i=Ch({...e.snapshot.options},e.instrumentation),a=W(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new sg(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,W(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>z_(e,t)),W(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>B_(e,n)),W(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>n_(e,e.snapshot.rootId))}function q_(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function J_(e,t){let n=F_(e);t===`stable`?W(e.instrumentation,`store.cleanup.stable`,()=>G_(e)):W(e.instrumentation,`store.cleanup.aggressive`,()=>K_(e));let r=F_(e);return I_(t,t===`stable`,n,r)}var Y_=64;function X_(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function J(e){return q(e,e.snapshot.rootId).visibleSubtreeCount}function Z_(e,t,n,r){let i=q(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function Q_(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:_v(e,t.cursor),setSize:t.setSize,subtreeEndIndex:Z_(e,t.cursor,t.index,n)}}function $_(e,t,n,r,i,a){let o=K(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=ch(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return ev(e,u,l,r+c,i+1,s,o.childIds.length,a)}function ev(e,t,n,r,i,a,o,s){if(!H(q(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=dv(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=q(e,c.terminalNodeId);if(!H(l)||!fg(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return $_(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function tv(e,t){let n=J(e);if(t<0||t>=n)return null;let r=$_(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>G(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=Q_(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:_v(e,r.cursor),setSize:r.setSize,subtreeEndIndex:Z_(e,r.cursor,r.index,n)}}function nv(e,t,n){let r=e.instrumentation,i=J(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return gv(e,o+1);let t=[],n=cv(e,a);for(let r=a;r<=o&&n!=null;r++){let r=_v(e,n);t.push(r),n=pv(e,n)}return t}let s=[],c=0,l=0,u=W(r,`store.getVisibleSlice.selectFirstRow`,()=>cv(e,a));for(let t=a;t<=o&&u!=null;t++){let t=W(r,`store.getVisibleSlice.materializeRow`,()=>_v(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=W(r,`store.getVisibleSlice.advanceCursor`,()=>pv(e,u))}return Th(r,`workload.visibleRowsRead`,s.length),Th(r,`workload.flattenedRowsRead`,c),Th(r,`workload.flattenedSegmentsRead`,l),s}function rv(e,t=J(e)){let n=e.instrumentation;return n==null?hv(e,t):W(n,`store.getVisibleTreeProjection`,()=>hv(e,t))}function iv(e){return mv(rv(e))}function av(e,t){let n=i_(e,t);if(n==null||n===e.snapshot.rootId||H(q(e,n))&&qg(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=q(e,i).parentId,n=K(e,t),s=rh(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=lh(a,n,s),t!==o){let n=q(e,t),a=Kg(e,t);if(!fg(e,t,n)&&a!==i)return null;qg(e,t)===t&&(r+=1)}i=t}return r}function ov(e,t){let n=i_(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=q(e,n);if(!H(r))throw Error(`Path is not a directory: "${t}"`);return fg(e,n,r)?null:(pg(e,n,!0,r),t_(e,n),Eg({affectedAncestorIds:r_(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function sv(e,t){let n=i_(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=q(e,n);if(!H(r))throw Error(`Path is not a directory: "${t}"`);return fg(e,n,r)?(pg(e,n,!1,r),t_(e,n),Dg({affectedAncestorIds:r_(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function cv(e,t){return t<0||t>=J(e)?null:lv(e,e.snapshot.rootId,t,-1)}function lv(e,t,n,r){let i=K(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?ch(e.snapshot.nodes,i,n):W(a,`store.getVisibleSlice.selectChildIndex`,()=>ch(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return uv(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function uv(e,t,n,r){if(!H(q(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=dv(e,t,r);if(n===0)return i;let a=q(e,i.terminalNodeId);if(!H(a)||!fg(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return lv(e,i.terminalNodeId,n-1,i.visibleDepth)}function dv(e,t,n){return H(q(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:qg(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:W(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>qg(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function fv(e,t){let n=q(e,t);if(!H(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||Kg(e,r)!==t}function pv(e,t){let n=q(e,t.terminalNodeId);if(H(n)){let r=K(e,t.terminalNodeId);if(fg(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:uv(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=q(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=K(e,n),o=rh(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return uv(e,s,0,i);fv(e,r)&&i--,r=n}}function mv(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function hv(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(Y_);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=X_(o,y);let x,S=_;if(H(v))S=f?qg(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:G(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&H(C)&&fg(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function gv(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!H(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:G(e,f)};continue}let h=l?qg(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=_v(e,g);let _=i[h];_!=null&&H(_)&&fg(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function _v(e,t){let n=q(e,t.terminalNodeId),r=H(n)?vv(e,t):null,i=G(e,t.terminalNodeId),a=Wh(e.snapshot.segmentTable,n.nameId),o=H(n)&&K(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?Jg(e,t.headNodeId).map(n=>{let r=q(e,n);return{isTerminal:n===t.terminalNodeId,name:Wh(e.snapshot.segmentTable,r.nameId),nodeId:n,path:G(e,n)}}):W(c,`store.getVisibleSlice.flatten.collectSegments`,()=>Jg(e,t.headNodeId).map(n=>{let r=q(e,n);return{isTerminal:n===t.terminalNodeId,name:Wh(e.snapshot.segmentTable,r.nameId),nodeId:n,path:G(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:H(n)&&fg(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:H(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function vv(e,t){if(t.headNodeId===t.terminalNodeId)return hg(e,t.terminalNodeId);let n=Jg(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=hg(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var yv=8;function bv(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function xv(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&yv)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&yv)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function Sv(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!H(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&uh(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&H(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,uh(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Cv(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=bv(e.snapshot);xv(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&uh(n,i)}}function wv(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var Tv=class e{#e;constructor(e={}){let t=wh(e),n=W(t,`store.builder.create`,()=>new sg(e));if(e.preparedInput!=null){let t=ig(e.preparedInput);t==null?n.appendPreparedPaths(rg(e.preparedInput),!1):n.appendPresortedPaths(t,ag(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(W(t,`store.preparePathEntries`,()=>og(r,e)))}let r=W(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=W(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=W(t,`store.state.create`,()=>cg(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:W(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||wv(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&W(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?W(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>Cv(this.#e)):W(t,`store.state.initializeOpenVisibleCounts`,()=>Sv(this.#e)):W(t,`store.state.recomputeCounts`,()=>n_(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return eg(e,t)}static prepareInput(e,t={}){return tg(e,t)}static preparePresortedInput(e){return ng(e)}list(e){return W(this.#e.instrumentation,`store.list`,()=>Yg(this.#e,e))}add(e){W(this.#e.instrumentation,`store.add`,()=>{let t=J(this.#e);Ig(this.#e,Pg(this.#e,t,Xg(this.#e,e)))})}remove(e,t={}){W(this.#e.instrumentation,`store.remove`,()=>{let n=J(this.#e);Ig(this.#e,Pg(this.#e,n,Zg(this.#e,e,t)))})}move(e,t,n={}){W(this.#e.instrumentation,`store.move`,()=>{let r=J(this.#e),i=Qg(this.#e,e,t,n);i!=null&&Ig(this.#e,Pg(this.#e,r,i))})}batch(e){Fg(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return W(this.#e.instrumentation,`store.getVisibleCount`,()=>J(this.#e))}getVisibleSlice(e,t){return W(this.#e.instrumentation,`store.getVisibleSlice`,()=>nv(this.#e,e,t))}getVisibleRowContext(e){return W(this.#e.instrumentation,`store.getVisibleRowContext`,()=>tv(this.#e,e))}getVisibleTreeProjection(){return iv(this.#e)}getVisibleTreeProjectionData(e){return rv(this.#e,e)}getVisibleIndex(e){return W(this.#e.instrumentation,`store.getVisibleIndex`,()=>av(this.#e,e))}getPathInfo(e){return W(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=i_(this.#e,e);if(t==null)return null;let n=q(this.#e,t);return{depth:_h(n),kind:H(n)?`directory`:`file`,path:G(this.#e,t)}})}isExpanded(e){return W(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=q(this.#e,t);return fg(this.#e,t,n)})}expand(e){W(this.#e.instrumentation,`store.expand`,()=>{let t=J(this.#e),n=ov(this.#e,e);n!=null&&Ig(this.#e,Pg(this.#e,t,n))})}collapse(e){W(this.#e.instrumentation,`store.collapse`,()=>{let t=J(this.#e),n=sv(this.#e,e);n!=null&&Ig(this.#e,Pg(this.#e,t,n))})}on(e,t){return Sg(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return hg(this.#e,t)}markDirectoryUnloaded(e){W(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(K(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=J(this.#e);_g(this.#e,t),Ig(this.#e,Pg(this.#e,n,Og({affectedAncestorIds:r_(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return W(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=J(this.#e),r=gg(this.#e,t);return Ig(this.#e,Pg(this.#e,n,kg({affectedAncestorIds:r_(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return W(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||hg(this.#e,n)!==`loading`||!yg(this.#e,n,e.attemptId))return!1;let r=G(this.#e,n);this.validateChildPatch(r,t);let i=J(this.#e),a=[];for(let e of t.operations){Ev(r,e);let t=J(this.#e);switch(e.type){case`add`:a.push(Pg(this.#e,t,Xg(this.#e,e.path)));break;case`remove`:a.push(Pg(this.#e,t,Zg(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=Qg(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Pg(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Ig(this.#e,Pg(this.#e,i,Ag({affectedAncestorIds:r_(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:G(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return W(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=J(this.#e),r=vg(this.#e,t,e.attemptId);return Ig(this.#e,Pg(this.#e,n,jg({affectedAncestorIds:r_(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:G(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return W(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=J(this.#e),i=bg(this.#e,n,e.attemptId,t);return Ig(this.#e,Pg(this.#e,r,Mg({affectedAncestorIds:r_(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:G(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return W(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(q_(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=J(this.#e),n=J_(this.#e,e.mode??`stable`);return Ig(this.#e,Pg(this.#e,t,Ng({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=K(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Oh(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=Ah(Lh(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!H(q(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=q(this.#e,n);fg(this.#e,n,i)||(pg(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=q(this.#e,e);if(!fg(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=i_(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!H(q(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!H(q(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=q(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=q(this.#e,e),r=Kg(this.#e,e);if(!fg(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function Ev(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}function Dv(e,t={}){return Tv.prepareInput(e,t)}var Ov={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function kv(e,t){if(typeof e==`number`)return{itemHeight:t??Ov.default.itemHeight,factor:e};let n=Ov[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var Av=Ov.default.itemHeight,jv=`@layer base {
6303
6303
  :host {
6304
6304
  --trees-accent: var(--trees-accent-override, #009fff);
6305
6305
  --trees-fg: var(--trees-fg-override, var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1)));
@@ -7391,13 +7391,13 @@ slicc-dock-tree .dock-tree__preview--active {
7391
7391
  }
7392
7392
 
7393
7393
  @layer theme, unsafe;
7394
- `,jv=`@layer base, unsafe;`;function Mv(e){return`${jv}
7394
+ `,Mv=`@layer base, unsafe;`;function Nv(e){return`${Mv}
7395
7395
  @layer base {
7396
7396
  ${e}
7397
- }`}function Nv(e){return`${jv}
7397
+ }`}function Pv(e){return`${Mv}
7398
7398
  @layer unsafe {
7399
7399
  ${e}
7400
- }`}var Pv=new WeakMap;function Fv(e){let t=Pv.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(Lm,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),Pv.set(e,i),i}function Iv(e,t){if(!e.isConnected)return;let n=Fv(t);if(n==null)return;let r=t.querySelector(`style[${Rm}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(Rm,``),t.appendChild(i)),i.textContent=`:host { ${zm}: ${n}px; }`}var Lv;function Rv(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Lv??(Lv=new CSSStyleSheet,Lv.replaceSync(Mv(Av)));let t=!1;try{e.adoptedStyleSheets=[Lv],t=!0}catch{}if(t){e.querySelector(`style[${Fm}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Fm,``),t.textContent=Mv(Av),e.prepend(t)}}function zv(e,t){Bv(e,t),Rv(t),Iv(e,t)}function Bv(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});zv(this,e)}}if(customElements.define(Pm,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Pm)))e instanceof HTMLElement&&zv(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Vv=e=>e.startsWith(`f::`)?e.slice(3):e;function Hv(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Uv(e,t){return e===``?t:`${e}/${t}`}function Wv({files:e,path:t,isFolder:n,nextBasename:r}){let i=Vv(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Hv(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Uv(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function Gv(e){return e.endsWith(`/`)}function Kv(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function qv(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function Jv(e,t){return t.includes(e)?qv(t):[e]}function Yv(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function Xv(e,t){return{draggedPaths:e,target:t}}function Zv(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Gv(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function Qv(e,t){return t.kind===`root`||t.directoryPath==null?Kv(e):t.directoryPath}function $v(e,t){let n=e.map(e=>{let n=Qv(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function ey(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function ty(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!ey(wv.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function ny(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function ry(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function iy(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function ay(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return iy(e,t.path)?n?e:null:e;case`move`:return ry(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=ay(r,e,n),r==null)return null;return r}}}function oy(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function sy(e){switch(e.operation){case`add`:return{...oy(e),operation:`add`,path:e.path};case`remove`:return{...oy(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...oy(e),from:e.from,operation:`move`,to:e.to}}}function cy(e){return{...oy(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>sy(e)),operation:`batch`}}function ly(e){switch(e.operation){case`add`:case`remove`:case`move`:return sy(e);case`batch`:return cy(e);default:return null}}function uy(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function dy(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function fy(e){return dy(e).at(-1)??null}function py(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function my(e){return e.endsWith(`/`)}var hy=e=>e.toLowerCase();function gy(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function _y(e){return e.endsWith(`/`)?e.slice(0,-1):e}function vy(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var yy=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},by=Symbol(`FILE_TREE_RENAME_VIEW`),xy=512,Sy=512;function Cy(e){return e===`top`||e===`center`?e:`nearest`}function wy(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=dy(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function Ty(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:wy(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Ey=class e{static{Object.defineProperty(e.prototype,by,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=ty({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=fy(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Cy(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Sy){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=Jv(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Xv(t.draggedPaths,n);(Zv(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}Yv(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=Xv(e.draggedPaths,t);if(Zv(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=$v(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=my(r),a=_y(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of dy(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=gy(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,my(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,my(e)?{recursive:!0}:void 0);return}let t=my(e),n=Wv({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:_y(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(vy(n.sourcePath,t),vy(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=ty({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!uy(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=fy(e),n=py(e,t),r=null,i=null;for(let e of this.#be()){if(fy(e)!==t)continue;let a=py(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=dy(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!uy(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new wv({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of dy(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(hy),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(hy),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of dy(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:yy(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of dy(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of dy(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Ty(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,xy)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=ay(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=ay(this.#c,e,!0),r=[...this.#B].map(t=>ay(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=ay(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return uy(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&ny(e)&&(this.#i=null);let t=ny(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=ly(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},Dy=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function Oy(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function ky(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function Ay(e,t){return t?`${e}/`:e}function jy(e,t=null){let n=Dy(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=Ny(t);e!=null&&Iy({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function My(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=Py(e);t!=null&&(c=Fy({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=Ny(e);t!=null&&(c=Iy({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:zy(i),statusByPath:i}:e}function Ny(e){return Py(e.path)}function Py(e){let t=Oy(e);if(t!=null)return{canonicalPath:Ay(t.path,t.isDirectory),isDirectory:t.isDirectory}}function Fy({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),Ry(t,n,e),!0)}function Iy({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??Ly(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function Ly(e,t,n){for(let r of ky(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function Ry(e,t,n){for(let r of ky(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function zy(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var Y,By,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy={},Xy=[],Zy=Array.isArray,Qy=Xy.slice,$y=Object.assign;function eb(e){e&&e.parentNode&&e.remove()}function tb(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?Qy.call(arguments,2):n),nb(e,o,r,i,null)}function nb(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++By,__i:-1,__u:0};return i==null&&Y.vnode!=null&&Y.vnode(a),a}function rb(e){return e.children}function ib(e,t){this.props=e,this.context=t,this.__g=0}function ab(e,t){if(t==null)return e.__?ab(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?ab(e):null}function ob(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return ob(e)}}function sb(e){(8&e.__g||!(e.__g|=8)||!Vy.push(e)||Uy++)&&Hy==Y.debounceRendering||((Hy=Y.debounceRendering)||queueMicrotask)(cb)}function cb(){for(var e,t,n,r,i,a,o,s,c=1;Vy.length;)Vy.length>c&&Vy.sort(Wy),e=Vy.shift(),c=Vy.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=$y({},r)).__v=r.__v+1,Y.vnode&&Y.vnode(n),gb(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??ab(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,vb(a,n,o),n.__e!=i&&ob(n)));Uy=0}function lb(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Xy,b=t.length;for(c=ub(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?Yy:y[m.__i]||Yy,m.__i=f,_=gb(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&xb(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=db(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function ub(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?nb(null,o,null,null,null):Zy(o)?nb(rb,{children:o},null,null,null):o.constructor==null&&o.__b>0?nb(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=fb(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=ab(s)),Sb(s,s));return r}function db(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=db(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=ab(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function fb(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function pb(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function mb(e,t,n,r,i){var a;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||pb(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||pb(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(Gy,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=Ky,e.addEventListener(t,a?Jy:qy,a)):e.removeEventListener(t,a?Jy:qy,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function hb(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=Ky++;else if(t.u<n.l)return;return n(Y.event?Y.event(t):t)}}}function gb(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,te,ne,w,T,re,ie,ae,E=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=Y.__b)&&d(t);n:if(typeof E==`function`)try{if(v=t.props,y=`prototype`in E&&E.prototype.render,b=(d=E.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new E(v,x):(t.__c=f=new ib(v,x),f.constructor=E,f.render=Cb),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&E.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=$y({},f.__s)),$y(f.__s,E.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&E.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&E.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=Y.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),te=0;te<f._sb.length;te++)f.__h.push(f._sb[te]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=$y({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),ne=d,d!=null&&d.type===rb&&d.key==null&&(ne=yb(d.props.children)),s=lb(e,Zy(ne)?ne:[ne],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null){if(e.then){for(w=0,T=!1,t.__u|=c?160:128,t.__c.__z=[],re=0;re<a.length;re++)(ie=a[re])==null||T||(ie.nodeType==8&&ie.data==`$s`?(w>0&&t.__c.__z.push(ie),w++,a[re]=null):ie.nodeType==8&&ie.data==`/$s`?(--w>0&&t.__c.__z.push(ie),T=w===0,s=a[re],a[re]=null):w>0&&(t.__c.__z.push(ie),a[re]=null));if(!T){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(ae=a.length;ae--;)eb(a[ae]);_b(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||_b(t);Y.__e(e,t,n)}else s=t.__e=bb(n.__e,t,n,r,i,a,o,c,l,u);return(d=Y.diffed)&&d(t),128&t.__u?void 0:s}function _b(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(_b)}function vb(e,t,n){for(var r=0;r<n.length;r++)xb(n[r],n[++r],n[++r]);Y.__c&&Y.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){Y.__e(e,t.__v)}})}function yb(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Zy(e)?e.map(yb):$y({},e)}function bb(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(Y.__m&&Y.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=Qy.call(e.childNodes),v=n.props||Yy,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;mb(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||mb(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),lb(b==`template`?e.content:e,Zy(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&ab(n,0),s,c,l),a!=null)for(u=a.length;u--;)eb(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||mb(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&mb(e,u,g,v[u],i))}return e}function xb(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){Y.__e(e,n)}}function Sb(e,t,n){var r,i;if(Y.unmount&&Y.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||xb(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Y.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Sb(r[i],t,n||typeof e.type!=`function`);n||eb(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function Cb(e,t,n){return this.constructor(e,n)}function wb(e,t){var n,r,i,a;t==document&&(t=document.documentElement),Y.__&&Y.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=tb(rb,null,[e]),i=[],a=[],gb(t,e,r||Yy,Yy,t.namespaceURI,r?null:t.firstChild?Qy.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),vb(i,e,a)}function Tb(e,t){e.__u|=32,wb(e,t)}Y={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw Uy=0,e}},By=0,ib.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$y({},this.state);typeof e==`function`&&(e=e($y({},n),this.props)),e&&$y(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),sb(this))},ib.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),sb(this))},ib.prototype.render=rb,Vy=[],Uy=0,Wy=function(e,t){return e.__v.__b-t.__v.__b},Gy=/(PointerCapture)$|Capture$/i,Ky=0,qy=hb(!1),Jy=hb(!0);var Eb=0;Array.isArray;function X(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Eb,__i:-1,__u:0,__source:i,__self:a};return Y.vnode&&Y.vnode(l),l}var Db=16,Ob=16,kb={};function Ab({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=kb[e]??{width:Db,height:Ob},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return X(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:X(`use`,{href:c})})}var jb=e=>e!==void 0&&/\s/.test(e),Mb=(e,t)=>{let n=t=>jb(e[t-1])||jb(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},Nb=e=>Mb(e,Math.ceil(e.length/2)),Pb=e=>{if(e.length<2)return[e,``];let t=Nb(e);return[e.slice(0,t),e.slice(t)]},Fb=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Nb(e);return[e.slice(0,r),e.slice(r)]},Ib=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},Lb=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},Rb=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},zb=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function Bb({children:e,marker:t,variant:n=`default`}){"use no memo";return X(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:X(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?X(`span`,{"data-truncate-fade":!0}):t})})}function Vb(e){"use no memo";let{mode:t,children:n}=e;return X(`div`,{children:[X(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?X(`span`,{children:n}):n}),X(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?X(`span`,{children:n}):n})]})}function Hb({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=X(Vb,{mode:t,children:e},`content`),o=X(Bb,{marker:n,mode:t,variant:r},`marker`),s=X(`div`,{"data-truncate-fill":!0},`fill`);return X(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:X(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function Ub({children:e,...t}){"use no memo";return X(Hb,{mode:`truncate`,...t,children:e})}function Wb({children:e,...t}){"use no memo";return X(Hb,{mode:`fruncate`,...t,children:e})}function Gb({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=X(Ub,{...s,children:t[0]}),l=X(Wb,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return X(`div`,{className:a,style:o});if(e.length<i)return X(n===`end`?Wb:Ub,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=Pb:r===`extension`?t=Fb:r===`leaf-path`&&(t=Ib);else if(typeof r==`number`)t=Lb,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=Rb:e===`first`&&(t=zb)}else typeof r==`function`&&(t=r);t??=Pb;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=X(Ub,{...s,..._,children:f}),l=X(Wb,{...s,...v,children:p})}return X(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[X(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),X(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var Kb={endIndex:-1,startIndex:-1};function qb(e,t,n){return Math.min(Math.max(e,t),n)}function Jb(e,t){return e<0||t<e?Kb:{endIndex:t,startIndex:e}}function Yb(e){return e.startIndex<0||e.endIndex<e.startIndex}function Xb(e,t){return Yb(e)?0:(e.endIndex-e.startIndex+1)*t}function Zb(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function Qb(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function $b(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function ex(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function tx(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function nx(e,t,n){if(e.length===0||t<=0)return[];let r=tx(e),i=$b(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=ex(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function rx(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=qb(t.scrollTop,0,o),c=t.stickyRows??nx(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=Zb(s,n,t.itemHeight),m=Zb(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?Kb:Jb(m,Qb(u+d,n,t.itemHeight)),y=g+1,b=Yb(v)?Kb:Jb(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=Xb(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:Yb(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var ix={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},ax={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},ox=`Contains git status items`;function sx(e){return e.current?!0:(e.current=!0,!1)}function cx(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function lx(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return cx({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function ux(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function dx(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function fx(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function px(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function mx(e,t){return e!=null&&e>0?e:t}function hx(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function gx(e,t,n,r,i=0){let a=cx({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function _x(e,t,n,r,i,a,o=0){let s=lx({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function vx(e,t,n,r,i,a){let o=ux({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function yx(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function bx(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function xx({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return X(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function Sx(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function Cx(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var wx,Z,Tx,Ex,Dx=Object.is,Ox=0,kx=[],Q=Y,Ax=Q.__b,jx=Q.__r,Mx=Q.diffed,Nx=Q.__c,Px=Q.unmount,Fx=Q.__;function Ix(e,t){Q.__h&&Q.__h(Z,e,Ox||t),Ox=0;var n=Z.__H||(Z.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Lx(e){return Ox=1,Rx(Yx,e)}function Rx(e,t,n){var r=Ix(wx++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Yx(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);Dx(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,Dx(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Z.__f=!0;var a=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Z.shouldComponentUpdate=i}return r.__N||r.__}function zx(e,t){var n=Ix(wx++,3);!Q.__s&&Jx(n.__H,t)&&(n.__=e,n.u=t,Z.__H.__h.push(n))}function Bx(e,t){var n=Ix(wx++,4);!Q.__s&&Jx(n.__H,t)&&(n.__=e,n.u=t,Z.__h.push(n))}function $(e){return Ox=5,Vx(function(){return{current:e}},[])}function Vx(e,t){var n=Ix(wx++,7);return Jx(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Hx(e,t){return Ox=8,Vx(function(){return e},t)}function Ux(){for(var e;e=kx.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Kx),e.__H.__h.forEach(qx),e.__H.__h=[]}catch(t){e.__H.__h=[],Q.__e(t,e.__v)}}Q.__b=function(e){Z=null,Ax&&Ax(e)},Q.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Fx&&Fx(e,t)},Q.__r=function(e){jx&&jx(e),wx=0;var t=(Z=e.__c).__H;t&&(Tx===Z?(t.__h=[],Z.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Kx),t.__h.forEach(qx),t.__h=[],wx=0)),Tx=Z},Q.diffed=function(e){Mx&&Mx(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(kx.push(t)!==1&&Ex===Q.requestAnimationFrame||((Ex=Q.requestAnimationFrame)||Gx)(Ux)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Tx=Z=null},Q.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Kx),e.__h=e.__h.filter(function(e){return!e.__||qx(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Q.__e(n,e.__v)}}),Nx&&Nx(e,t)},Q.unmount=function(e){Px&&Px(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Kx(e)}catch(e){t=e}}),n.__H=void 0,t&&Q.__e(t,n.__v))};var Wx=typeof requestAnimationFrame==`function`;function Gx(e){var t,n=function(){clearTimeout(r),Wx&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Wx&&(t=requestAnimationFrame(n))}function Kx(e){var t=Z,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Z=t}function qx(e){var t=Z;e.__c=e.__(),Z=t}function Jx(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!Dx(t,e[n])})}function Yx(e,t){return typeof t==`function`?t(e):t}function Xx(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:X(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return X(rb,{children:[X(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:X(Ub,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Zx(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Qx(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function $x(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function eS({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=rx(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:$x(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?$x(u,1,t,o):i&&r<=0&&c.length>0?nx(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var tS=400,nS=40,rS=18;function iS(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?aS(e,t,n):a instanceof HTMLElement?a:null}function aS(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function oS(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function sS(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function cS(){return navigator.vendor!==`Apple Computer, Inc.`}function lS(e,t){let n=e-t.top;if(n<nS)return-Math.ceil((nS-Math.max(0,n))/nS*rS);let r=t.bottom-e;return r<nS?Math.ceil((nS-Math.max(0,r))/nS*rS):0}function uS(e,t){if(e!=null){let t=ix[e];return t==null?null:{text:t,title:ax[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:ox}:null}function dS(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function fS(e){return e!=null&&`toggle`in e}function pS(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function mS(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function hS(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function gS(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function _S(e,t){return t&&gS(e)||(e.ctrlKey||e.metaKey)&&pS(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var vS=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function yS(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function bS(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function xS(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function SS(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function CS(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function wS(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function TS(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function ES(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function DS(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=ES(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function OS(e,t){return{kind:e.kind,name:Qx(e),path:t}}function kS(e){return e==null?void 0:`${e}__tree`}function AS(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function jS(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function MS(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?X(`span`,{title:e.title,children:e.text}):X(`span`,{title:e.title,children:e.parts.map((e,t)=>X(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?jS(e.icon)?t(e.icon):{name:e.icon}:jS(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return X(`span`,{title:e.title,children:X(Ab,{...n})})}function NS(e){e!=null&&dx(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function PS(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=Zx(e);return X(rb,{children:[e.depth>0?X(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>X(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,X(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?X(Ab,{...t(`file-tree-icon-chevron`)}):X(Ab,{...t(`file-tree-icon-file`,u)})}),X(`div`,{"data-item-section":`content`,children:e.isFlattened?Xx(e,c,a):c??X(Gb,{minimumLength:5,split:`extension`,children:e.name})}),i?X(`div`,{"data-item-section":`decoration`,children:r==null?null:MS(r,t)}):null,s?X(`div`,{"data-item-section":`git`,children:MS(o,t)}):null,n?X(`div`,{"data-item-section":`action`,children:l?X(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:X(Ab,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function FS(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:ee,contextMenuButtonVisibility:te,contextMenuRightClickEnabled:ne,registerRenameInput:w,registerButton:T,resolveIcon:re,renderDecorationForRow:ie,openContextMenuForRow:ae,onRowClick:E,onKeyDown:oe}=e,D=Zx(t),{isParked:se=!1,mode:ce=`flow`,style:le}=r,ue=ce===`sticky`,de=_?.get(D)??null??dS(t.ancestorPaths,v,y),fe=t.kind===`directory`&&(b?.has(D)??!1),pe=ie(t,D),me=uS(de,fe),he=S&&ee,ge=pe!=null||x||he,_e=he&&te===`always`,O=a.getPath()===D,ve=O?a.getValue():``,ye=ue||!O?null:X(xx,{ref:w,ariaLabel:`Rename ${Qx(t)}`,isFlattened:t.isFlattened,value:ve,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),be=PS(t,re,{actionLaneEnabled:he,customDecoration:pe,decorationLaneEnabled:ge,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:me,gitLaneActive:x,renameInput:ye,showDecorativeActionAffordance:_e}),xe={...Sx({ariaLabel:Qx(t),domId:t.isFocused?AS(h,D,se):void 0,extraStyle:le,features:{actionLaneEnabled:he,contextMenuButtonVisibility:he?te:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:se,itemHeight:g,mode:ce,row:t,state:{containsGitChange:fe,effectiveGitStatus:de,isContextHovered:s===D,isDragTarget:l?.kind===`directory`&&l.directoryPath===D,isDragging:c?.has(D)===!0,isFocusRinged:t.isFocused&&o===D},targetPath:D}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),ne&&(i.focusMountedPathFromInput(D),ae(t,D,{anchorRect:xS(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ue?void 0:()=>{i.focusMountedPathFromInput(D)},onKeyDown:ue?void 0:oe,ref:e=>{T(D,e)}};return!ue&&O?X(`div`,{...xe,children:be}):X(`button`,{...xe,type:`button`,draggable:u&&!se,onDragEnd:u&&!se?p:void 0,onDragStart:u&&!se?e=>{f(e,t,D)}:void 0,onMouseDown:e=>{if(ue){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!se?e=>{m(e,t,D)}:void 0,onClick:e=>{E(e,t,D,ce)},children:be})}function IS(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Zx(e))).map((n,r)=>FS(e,n,t.start+r))}function LS({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=kv,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=$(null),v=$(null),y=$(!1),b=$(null),x=$(null),S=$(null),C=$(null),ee=$(null),te=$(new Map),ne=$(new Map),w=$(()=>{}),T=$(null),re=$(0),ie=$(!1),ae=$(null);ae.current!==t&&(ie.current=!1,ae.current=t);let E=$(!1),oe=$(null),D=$(null),se=$(!1),ce=$(null),le=$(null),ue=$(null),de=$(null),fe=$(null),pe=$(null),me=$(null),he=$(null),ge=$(!1),_e=$(null),O=$(null),ve=$(null),ye=$(null),be=Vx(()=>new Map,[]),[,xe]=Lx(0),Se=$(!1),[Ce,we]=Lx(null),[Te,Ee]=Lx(null),[De,Oe]=Lx(null),[ke,k]=Lx(null),[Ae,je]=Lx(0),[A,Me]=Lx(null),Ne=$(A);Ne.current=A;let Pe=$(null),Fe=$(null),Ie=$(null),Le=$(null),Re=$(null),ze=$(!1),Be=()=>{Fe.current=null,Ie.current=null,Le.current=null},Ve=(e,t)=>{Fe.current=e,Ie.current=null,Le.current=t==null?null:{path:e,scrollTop:t}},He=(e,t)=>{Fe.current=null,Ie.current={path:e,viewportOffset:t},Le.current=null},Ue=$(d===`retain`&&t.isSearchOpen()),[We,Ge]=Lx(p);zx(()=>{p||Ge(!1)},[p]);let Ke=$(!1),qe=Hx(()=>{Ke.current=!0,Ge(e=>e&&!1)},[]),[Je,Ye]=Lx(()=>eS({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Xe,Ze]=Lx(!1);zx(()=>{Ze(!0)},[]);let Qe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,$e=e?.contextMenu?.triggerMode??(Qe?`right-click`:`both`),et=$e===`both`||$e===`button`,tt=e?.contextMenu?.buttonVisibility??`when-needed`,nt=$e===`both`||$e===`right-click`;Bx(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Re.current=t,Ee(t),k(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(ze.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let rt=Hx((e,t)=>{CS(te.current,e,t)},[]),it=Hx((e,t)=>{CS(ne.current,e,t)},[]),at=Hx(e=>{x.current=e},[]),ot=Hx(e=>wS(e,ne.current,te.current),[]),st=n!=null||r!=null||i!=null,{resolveIcon:ct}=Vx(()=>Ym(a),[a]),lt=t[by](),ut=lt.getPath(),dt=ut!=null,ft=t.isSearchOpen(),pt=t.getSearchValue(),j=t.getFocusedPath(),M=t.getFocusedIndex(),mt=t.getScrollRequest(),ht=t.isDragAndDropEnabled(),gt=t.getDragSession(),_t=Vx(()=>gt==null?null:new Set(gt.draggedPaths),[gt]),vt=gt?.target??null,yt=gt?.primaryPath??null,bt=kS(o),{overlayHeight:xt,overlayRows:St,snapshot:N,visibleRows:Ct}=Je,P=N.physical.viewportHeight,wt=Vx(()=>({end:N.window.endIndex,start:N.window.startIndex}),[N.window.endIndex,N.window.startIndex]),Tt=St,Et=N.sticky.rows,Dt=N.physical.totalHeight,Ot=N.sticky.height,kt=Vx(()=>new Set(Et.map(e=>Zx(e.row))),[Et]),At=M>=0&&M>=wt.start&&M<=wt.end,jt=Hx((e,t)=>u?.({item:OS(e,t),row:e})??null,[u]),Mt=Hx(e=>dx(e==null?null:te.current.get(e)??null)?!0:dx(S.current),[]),Nt=Hx(e=>{Mt(t.focusNearestPath(e))},[t,Mt]),Pt=$(Nt);Pt.current=Nt;let Ft=$(!0),It=$(()=>{}),Lt=Hx((t=!0)=>{let n=Ne.current;n!=null&&(Ft.current=Ft.current&&t,Me(null),e?.contextMenu?.onClose?.(),Ft.current&&Nt(n.path))},[e?.contextMenu,Nt]);It.current=Lt;let Rt=Hx(e=>{let t=e==null?null:SS(S.current,e);Oe(e=>e===t?e:t)},[]),zt=Hx((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=ot(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ve(n,e?.scrollTop??null),E.current=!0,we(e=>e===n?e:n)}i.focus(),Rt(a),Ft.current=!0,Me({anchorRect:r?.anchorRect??null,item:OS(e,n),path:n,source:r?.source??`keyboard`})},[t,ot,Rt]),Bt=Hx(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=px(e,P);ce.current=M<0||e==null?null:Math.max(0,Math.min(M*s-e.scrollTop,Math.max(0,t-s))),se.current=!0}t.startRenaming(e)!==!1&&(k(`focus`),xe(e=>e+1))}},[t,M,s,l,P]),Vt=Hx((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=px(i,P),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:eS({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return E.current=!0,vx(i,a,s,l,u,d),w.current(),Pe.current=n?e:null,!0},[t,s,c,P,h]),F=()=>y.current===!0||ye.current!=null||ge.current===!0,Ht=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Ut=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Wt=()=>{de.current!=null&&(clearTimeout(de.current),de.current=null),ue.current=null},Gt=()=>{pe.current?.remove(),pe.current=null},Kt=()=>{Ut(le.current),le.current=null,fe.current=null},qt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Jt=()=>{he.current?.(),he.current=null,ye.current!=null&&(clearTimeout(ye.current),ye.current=null),ge.current=!1,_e.current=null,ve.current=null,O.current!=null&&(O.current.setAttribute(`draggable`,`true`),O.current.style.removeProperty(`touch-action`),O.current=null),Gt(),Wt(),Kt(),me.current=null},Yt=(e,n)=>{let r=S.current?.getRootNode(),i=oS(iS(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Xt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Wt();return}let r=t.getItem(e.directoryPath),i=fS(r)?r:null;if(i==null||i.isExpanded()){Wt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ue.current!==a&&(Wt(),ue.current=a,de.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Zt=()=>{le.current=null;let e=fe.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=lS(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,w.current()),Xt(Yt(e.clientX,e.clientY)),le.current=Ht(Zt)},Qt=(e,t)=>{fe.current={clientX:e,clientY:t},le.current??=Ht(Zt)},$t=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Jt(),Gt(),Wt(),Kt(),t.startDrag(r)===!1){e.preventDefault();return}if(me.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),cS())){let t=sS(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),qt(t),pe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},en=()=>{Gt(),Wt(),Kt(),me.current=null,t.cancelDrag()},tn=(e,n,r)=>{if(ye.current!=null||ge.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ve.current={clientX:i.clientX,clientY:i.clientY},O.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!ge.current;ye.current!=null&&(clearTimeout(ye.current),ye.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),he.current===o&&(he.current=null),t&&(a.setAttribute(`draggable`,`true`),O.current===a&&(O.current=null),ve.current=null)},s=e=>{let t=e.touches[0],n=ve.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),he.current=o,ye.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),O.current===a&&(O.current=null),ve.current=null;return}ge.current=!0,O.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),me.current=n;let e=a.getBoundingClientRect(),s=sS(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),qt(s),pe.current=s,_e.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=_e.current;n!=null&&pe.current!=null&&(pe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Xt(Yt(t.clientX,t.clientY)),Qt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Yt(n.clientX,n.clientY),t.completeDrag(),Jt()},u=()=>{t.cancelDrag(),Jt()};he.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},tS)},nn=e=>{if(A!=null){if(e.key===`Escape`){Lt(),e.preventDefault(),e.stopPropagation();return}vS.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(lt.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)lt.cancel();else if(e.key===`Enter`)lt.commit();else return;k(`focus`),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Bt(j??void 0),e.preventDefault(),e.stopPropagation();return}if(ft){if(e.key===`Escape`)se.current=!1,ce.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=px(n,P);ce.current=M<0||n==null?null:Math.max(0,Math.min(M*s-n.scrollTop,Math.max(0,r-s))),se.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;k(`focus`),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&mS(e)){t.openSearch(e.key),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Qe&&gS(e),r=_S(e,Qe),i=r&&S.current!=null?fx(S.current):null,a=r?new Set(TS(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==j&&a.has(o)){let e=C.current;Ve(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=fS(p)?p:null,h=u!=null&&(kt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=wS(u,ne.current,te.current);e==null||n==null?y=!1:zt(e,u)}else if((e.ctrlKey||e.metaKey)&&pS(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;k(`focus`);let b=t.getFocusedPath(),x=b!=null&&(kt.has(b)||a.has(b)),ee=g&&b!==u,w=n&&c&&o===u&&b===u;if((h||w)&&b!=null&&(ee&&x||w))Ve(b,v?.scrollTop??null),E.current=!0,we(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(He(b,DS(S.current,v,i,u,s,Ot,P)),E.current=!0,we(e=>e===b?e:b)):Be()}xe(e=>e+1),e.preventDefault(),e.stopPropagation()};Bx(()=>{if(!(!f||!ft)){if(Ue.current){Ue.current=!1;return}dx(ee.current)}},[ft,f]),Bx(()=>{let e=x.current;switch(bx({hasRenderedInput:e!=null,previousRenamingPath:D.current,renamingPath:ut})){case`reset`:D.current=null;return;case`reveal-canonical`:ut!=null&&Vt(ut,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(Pe.current=null,D.current=ut,dx(e),e.select());return}},[wt.end,wt.start,ut,Vt,kt]),Bx(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=fx(e)?.dataset.itemPath??null;we(e=>e===t?e:t)},i=()=>{n(),E.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,fx(e)!=null){r();return}E.current=!1,we(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),E.current=!1,we(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;we(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),Bx(()=>{let e=S.current;e!=null&&(N.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[N.physical.scrollTop]),Bx(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;T.current=px(n,g);let a=()=>{let e=t.getVisibleCount(),r=mx(T.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ye(eS({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!ie.current){ie.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=mx(T.current,g),i=t.getVisibleRows(e,e)[0]??null;gx(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}w.current=a;let o=t.subscribe(()=>{sx(Se)&&xe(e=>e+1),a()}),l=()=>{ze.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,je(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&ze.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Ne.current!=null&&y.current&&It.current(),ze.current===!0){y.current=!1;return}Ee(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{T.current=(e[0]==null?null:hx(e[0]))??px(n,g),a()}):null;return x?.observe(n),()=>{w.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,T.current=null,x?.disconnect()}},[t,g,s,c,h]),Bx(()=>{Qe||A==null||Lt(!1)},[Lt,Qe,A]);let rn=Vx(()=>A==null?null:`${A.path}::${A.source}`,[A]);Bx(()=>{if(rn==null){m?.clearSlotContent(Vm);return}let t=Ne.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??bS(n.getBoundingClientRect()),close:e=>{It.current(e?.restoreFocus??!0)},restoreFocus:()=>{Ft.current&&Pt.current(Ne.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(Vm,i),e?.contextMenu?.onOpen?.(t.item,r),NS(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&NS(i)}),()=>{m?.clearSlotContent(Vm)}},[rn,e?.contextMenu,m]),Bx(()=>{A!=null&&t.getItem(A.path)==null&&Lt()},[Lt,A,t]),Bx(()=>{if(A==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(yS(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Lt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Lt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Lt,A]),Bx(()=>{let e=C.current,n=S.current;if(e==null||n==null){oe.current=j;return}let r=j==null?null:te.current.get(j)??null,i=fx(n),a=i?.dataset.itemPath??null,o=dt&&x.current===i,c=f&&ee.current===i,l=se.current&&!ft,u=ce.current??0,d=Pe.current,p=Fe.current,m=Ie.current,g=Le.current,_=i!=null,v=E.current||_,y=oe.current!==j,b=p!=null&&p===j&&j!=null,ne=!1,T=!1;if(mt!=null&&mt.id!==re.current){re.current=mt.id;let n=mt.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,P-s))):Ot;ne=!0,T=_x(e,n,s,P,Dt,mt.offset,t)}t.clearScrollRequest(mt.id)}let ie=!ne&&l&&vx(e,M,s,P,Dt,u),ae=!ne&&d!=null&&d===j&&vx(e,M,s,P,Dt,Ot),D=!ne&&m!=null&&m.path===j&&vx(e,M,s,P,Dt,m.viewportOffset),le=!ne&&g!=null&&g.path===j&&e.scrollTop!==g.scrollTop;if(le&&(e.scrollTop=g.scrollTop),(le||T||ae||D||ie||v&&y&&d!==j&&!b&&gx(e,M,s,P,Ot))&&w.current(),ne){oe.current=j;return}if(!v){oe.current=j;return}if(o){oe.current=j;return}if(c&&!l){oe.current=j;return}if(r==null){l&&M>=0&&(vx(e,M,s,P,Dt,u),w.current()),oe.current=j;return}(y||l||d===j||p===j||m?.path===j||g?.path===j||a==null||a!==j)&&(dx(r),d===j&&(Pe.current=null),p===j&&(Fe.current=null),m?.path===j&&(Ie.current=null),g?.path===j&&(Le.current=null),se.current=!1,ce.current=null),oe.current=j},[t,M,j,At,s,dt,ft,wt,P,f,mt,h,Ot,Dt,Ct]);let an=M>=0&&M>=N.visible.startIndex&&M<=N.visible.endIndex,on=j!=null&&Tt.some(e=>Zx(e.row)===j),sn=an||on,cn=et&&E.current===!0&&sn?j:null,ln=ke===`pointer`?Te:null,un=A?.path??Re.current??ln??cn??Te,dn=A?.source===`right-click`;Bx(()=>{y.current&&A==null||Rt(ot(un))},[A,ot,wt,P,Ae,Tt,un,Rt,Ct]);let fn=Hx(e=>{if(y.current||yS(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&k(e=>e===`pointer`?e:`pointer`),Ee(e=>e===i?e:i)},[]),pn=Hx(()=>{Ee(null)},[]);Bx(()=>{if(!ht)return;let e=()=>{Jt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Jt(),t.cancelDrag()}},[t,ht]);let mn=e=>{if(!ht||t.getDragSession()==null||ge.current)return;let n=oS(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Xt(t.getDragSession()?.target??null),Qt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},hn=e=>{if(!ht||t.getDragSession()==null||ge.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Wt(),Kt(),t.setDragTarget(null))},gn=e=>{!ht||t.getDragSession()==null||ge.current||(e.preventDefault(),Yt(e.clientX,e.clientY),t.completeDrag(),Gt(),Wt(),Kt(),me.current=null)},_n=N.window.height,vn=N.window.offsetTop,yn=Math.min(0,P-_n),bn=Math.min(0,P-_n-Ot),xn=Ce===j||se.current,Sn=j!=null&&xn&&!At&&M>=0?Ct[M]??t.getVisibleRows(M,M)[0]??null:null,Cn=Sn==null?null:yx(M,s,wt,_n),wn=me.current,Tn=yt!=null&&wn!=null&&wn.path===yt&&wn.index>=wt.start&&wn.index<=wt.end,En=yt!=null&&wn!=null&&wn.path===yt&&!Tn&&wn.path!==Sn?.path?wn:null,Dn=En==null?null:yx(En.index,s,wt,_n),On=hS((M>=0?Ct[M]??t.getVisibleRows(M,M)[0]??null:null)?.ancestorPaths.at(-1)??null),kn=ft&&j!=null?AS(o,j,!At):void 0,An=A?.path??(ft?j:Ce),jn=A?.path??Te,Mn=ot(un),Nn=Qe&&et&&!dn&&!dt&&Mn!=null&&De!=null&&un!=null,Pn=Qe&&(Nn||A!=null),Fn=A?.anchorRect,In=Fn==null&&Mn!=null&&De!=null&&(A!=null||Nn)?De:null,I=Fn==null?In==null?void 0:{top:`${In}px`}:{left:`${Fn.left}px`,position:`fixed`,right:`auto`,top:`${Fn.top}px`},Ln=dn?{opacity:`0`}:void 0,L=Hx((e,n,r,i)=>{let a=Cx({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:ft,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=N.visible.startIndex&&n.index<=N.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(E.current=!0,we(e=>e===c?e:c),k(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Vt(c,{targetOffset:`sticky-parents`})},[t,ft,N.visible.endIndex,N.visible.startIndex,Vt]),R=()=>{if(y.current||!et||un==null||Mn==null)return;let e=t.getItem(un);e!=null&&(Rt(Mn),Ft.current=!0,Me({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:Mn.getAttribute(`aria-label`)??un,path:e.getPath()},path:e.getPath(),source:`button`}))},Rn={contextHoverPath:jn,contextMenuButtonTriggerEnabled:et,contextMenuButtonVisibility:tt,contextMenuEnabled:Qe,contextMenuRightClickEnabled:nt,contextMenuTriggerMode:$e,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:ht,draggedPathSet:_t,dragTarget:vt,gitLaneActive:st,gitStatusByPath:n,handleRowDragEnd:en,handleRowDragStart:$t,handleRowTouchStart:tn,ignoredGitDirectories:r,ignoredInheritanceCache:be,instanceId:o,itemHeight:s,onKeyDown:nn,onRowClick:L,openContextMenuForRow:zt,registerButton:rt,registerRenameInput:at,renameView:lt,renderDecorationForRow:jt,resolveIcon:ct,shouldSuppressContextMenu:F,visualFocusPath:An},zn={...Rn,registerButton:it};return X(`div`,{ref:S,id:bt,"data-file-tree-context-menu-button-visibility":Qe&&et?tt:void 0,"data-file-tree-context-menu-trigger-mode":Qe?$e:void 0,"data-file-tree-has-context-menu-action-lane":Qe&&et?`true`:void 0,"data-file-tree-has-git-lane":st?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:ht?hn:void 0,onDragOver:ht?mn:void 0,onDrop:ht?gn:void 0,onKeyDown:nn,onPointerLeave:Qe?pn:void 0,onPointerOver:Qe?fn:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[X(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:On}}),X(`slot`,{name:Bm,"data-type":`header-slot`}),f?X(`div`,{"data-file-tree-search-container":!0,"data-open":ft?`true`:`false`,children:X(`input`,{ref:ee,"aria-activedescendant":kn,"aria-controls":bt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":We?`true`:void 0,value:pt,onBlur:()=>{d===`retain`&&!Ke.current||t.closeSearch()},onFocus:qe,onPointerDown:qe,onInput:e=>{qe();let n=e.currentTarget;t.setSearch(n.value)}})}):null,X(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Xe&&Tt.length>0?X(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:X(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${xt}px`},children:Tt.map((e,t)=>FS(zn,e.row,`sticky:${Zx(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${Tt.length-t}`}}))})}):null,X(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Dt}px`},children:[X(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${vn}px`}}),X(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${_n}px`,top:`${yn}px`,bottom:`${bn}px`},children:[IS(Rn,wt,kt),Sn!=null&&Cn!=null?FS(Rn,Sn,`parked:${Sn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:yt===Sn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${Cn}px`}}):null,En!=null&&Dn!=null?FS(Rn,En,`parked-drag:${En.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${Dn}px`}}):null]})]})]}),Qe?X(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Pn?`true`:`false`,style:I,children:[X(`button`,{ref:v,type:`button`,"data-type":Hm,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":A==null?`false`:`true`,"data-visible":Nn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),A!=null){Lt();return}R()},tabIndex:-1,style:Ln,children:X(Ab,{...ct(`file-tree-icon-ellipsis`)})}),A==null?null:X(`slot`,{name:Vm})]}):null,A==null?null:X(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Lt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Lt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var RS={hydrateRoot:(e,t)=>{Tb(tb(LS,t),e)},renderRoot:(e,t)=>{wb(tb(LS,t),e)},unmountRoot:e=>{wb(null,e)}};function zS(e,t){RS.renderRoot(e,t)}function BS(e,t){RS.hydrateRoot(e,t)}function VS(e){RS.unmountRoot(e)}var HS=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var US=0;function WS(e){return e!=null&&e.length>0?e:(US+=1,`pst_ft_${US}`)}function GS({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??kv)}function KS(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function qS(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function JS(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var YS=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new HS;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=WS(a),this.#p=jy(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=Ov(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Ey({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(VS(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=My(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&zS(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),zS(t.wrapper,this.#w()))}setGitStatus(e){let t=jy(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&zS(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),zS(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),BS(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),zS(r,this.#w())}#C(){return{initialViewportHeight:GS({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(Bm,e());return}this.#l.setSlotHtml(Bm,this.#e?.header?.html??null)}#k(e){let t=JS(e).find(e=>qS(e)),n=KS(Am(Wm(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=JS(e),n=t.find(e=>qS(e)),r=t.filter(e=>e!==n),i=Wm(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=KS(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=Wm(this.#m);t.colored&&Mm(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${Im}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(Im,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=Nv(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return zv(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},XS=`
7400
+ }`}var Fv=new WeakMap;function Iv(e){let t=Fv.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(Rm,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),Fv.set(e,i),i}function Lv(e,t){if(!e.isConnected)return;let n=Iv(t);if(n==null)return;let r=t.querySelector(`style[${zm}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(zm,``),t.appendChild(i)),i.textContent=`:host { ${Bm}: ${n}px; }`}var Rv;function zv(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Rv??(Rv=new CSSStyleSheet,Rv.replaceSync(Nv(jv)));let t=!1;try{e.adoptedStyleSheets=[Rv],t=!0}catch{}if(t){e.querySelector(`style[${Im}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Im,``),t.textContent=Nv(jv),e.prepend(t)}}function Bv(e,t){Vv(e,t),zv(t),Lv(e,t)}function Vv(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});Bv(this,e)}}if(customElements.define(Fm,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Fm)))e instanceof HTMLElement&&Bv(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Hv=e=>e.startsWith(`f::`)?e.slice(3):e;function Uv(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Wv(e,t){return e===``?t:`${e}/${t}`}function Gv({files:e,path:t,isFolder:n,nextBasename:r}){let i=Hv(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Uv(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Wv(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function Kv(e){return e.endsWith(`/`)}function qv(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function Jv(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function Yv(e,t){return t.includes(e)?Jv(t):[e]}function Xv(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function Zv(e,t){return{draggedPaths:e,target:t}}function Qv(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Kv(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function $v(e,t){return t.kind===`root`||t.directoryPath==null?qv(e):t.directoryPath}function ey(e,t){let n=e.map(e=>{let n=$v(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function ty(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function ny(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!ty(Tv.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function ry(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function iy(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function ay(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function oy(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return ay(e,t.path)?n?e:null:e;case`move`:return iy(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=oy(r,e,n),r==null)return null;return r}}}function sy(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function cy(e){switch(e.operation){case`add`:return{...sy(e),operation:`add`,path:e.path};case`remove`:return{...sy(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...sy(e),from:e.from,operation:`move`,to:e.to}}}function ly(e){return{...sy(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>cy(e)),operation:`batch`}}function uy(e){switch(e.operation){case`add`:case`remove`:case`move`:return cy(e);case`batch`:return ly(e);default:return null}}function dy(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function fy(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function py(e){return fy(e).at(-1)??null}function my(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function hy(e){return e.endsWith(`/`)}var gy=e=>e.toLowerCase();function _y(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function vy(e){return e.endsWith(`/`)?e.slice(0,-1):e}function yy(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var by=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},xy=Symbol(`FILE_TREE_RENAME_VIEW`),Sy=512,Cy=512;function wy(e){return e===`top`||e===`center`?e:`nearest`}function Ty(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=fy(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function Ey(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:Ty(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Dy=class e{static{Object.defineProperty(e.prototype,xy,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=ny({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=py(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:wy(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Cy){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=Yv(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Zv(t.draggedPaths,n);(Qv(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}Xv(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=Zv(e.draggedPaths,t);if(Qv(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=ey(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=hy(r),a=vy(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of fy(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=_y(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,hy(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,hy(e)?{recursive:!0}:void 0);return}let t=hy(e),n=Gv({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:vy(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(yy(n.sourcePath,t),yy(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=ny({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!dy(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=py(e),n=my(e,t),r=null,i=null;for(let e of this.#be()){if(py(e)!==t)continue;let a=my(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=fy(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!dy(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Tv({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of fy(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(gy),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(gy),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of fy(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:by(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of fy(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of fy(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Ey(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,Sy)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=oy(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=oy(this.#c,e,!0),r=[...this.#B].map(t=>oy(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=oy(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return dy(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&ry(e)&&(this.#i=null);let t=ry(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=uy(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},Oy=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function ky(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function Ay(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function jy(e,t){return t?`${e}/`:e}function My(e,t=null){let n=Oy(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=Py(t);e!=null&&Ly({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function Ny(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=Fy(e);t!=null&&(c=Iy({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=Py(e);t!=null&&(c=Ly({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:By(i),statusByPath:i}:e}function Py(e){return Fy(e.path)}function Fy(e){let t=ky(e);if(t!=null)return{canonicalPath:jy(t.path,t.isDirectory),isDirectory:t.isDirectory}}function Iy({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),zy(t,n,e),!0)}function Ly({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??Ry(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function Ry(e,t,n){for(let r of Ay(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function zy(e,t,n){for(let r of Ay(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function By(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var Y,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy={},Zy=[],Qy=Array.isArray,$y=Zy.slice,eb=Object.assign;function tb(e){e&&e.parentNode&&e.remove()}function nb(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?$y.call(arguments,2):n),rb(e,o,r,i,null)}function rb(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Vy,__i:-1,__u:0};return i==null&&Y.vnode!=null&&Y.vnode(a),a}function ib(e){return e.children}function ab(e,t){this.props=e,this.context=t,this.__g=0}function ob(e,t){if(t==null)return e.__?ob(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?ob(e):null}function sb(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return sb(e)}}function cb(e){(8&e.__g||!(e.__g|=8)||!Hy.push(e)||Wy++)&&Uy==Y.debounceRendering||((Uy=Y.debounceRendering)||queueMicrotask)(lb)}function lb(){for(var e,t,n,r,i,a,o,s,c=1;Hy.length;)Hy.length>c&&Hy.sort(Gy),e=Hy.shift(),c=Hy.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=eb({},r)).__v=r.__v+1,Y.vnode&&Y.vnode(n),_b(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??ob(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,yb(a,n,o),n.__e!=i&&sb(n)));Wy=0}function ub(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Zy,b=t.length;for(c=db(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?Xy:y[m.__i]||Xy,m.__i=f,_=_b(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Sb(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=fb(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function db(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?rb(null,o,null,null,null):Qy(o)?rb(ib,{children:o},null,null,null):o.constructor==null&&o.__b>0?rb(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=pb(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=ob(s)),Cb(s,s));return r}function fb(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=fb(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=ob(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function pb(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function mb(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function hb(e,t,n,r,i){var a;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||mb(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||mb(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(Ky,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=qy,e.addEventListener(t,a?Yy:Jy,a)):e.removeEventListener(t,a?Yy:Jy,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function gb(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=qy++;else if(t.u<n.l)return;return n(Y.event?Y.event(t):t)}}}function _b(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,te,ne,w,T,re,E,ie,D=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=Y.__b)&&d(t);n:if(typeof D==`function`)try{if(v=t.props,y=`prototype`in D&&D.prototype.render,b=(d=D.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new D(v,x):(t.__c=f=new ab(v,x),f.constructor=D,f.render=wb),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&D.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=eb({},f.__s)),eb(f.__s,D.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&D.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&D.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=Y.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),te=0;te<f._sb.length;te++)f.__h.push(f._sb[te]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=eb({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),ne=d,d!=null&&d.type===ib&&d.key==null&&(ne=bb(d.props.children)),s=ub(e,Qy(ne)?ne:[ne],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null){if(e.then){for(w=0,T=!1,t.__u|=c?160:128,t.__c.__z=[],re=0;re<a.length;re++)(E=a[re])==null||T||(E.nodeType==8&&E.data==`$s`?(w>0&&t.__c.__z.push(E),w++,a[re]=null):E.nodeType==8&&E.data==`/$s`?(--w>0&&t.__c.__z.push(E),T=w===0,s=a[re],a[re]=null):w>0&&(t.__c.__z.push(E),a[re]=null));if(!T){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(ie=a.length;ie--;)tb(a[ie]);vb(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||vb(t);Y.__e(e,t,n)}else s=t.__e=xb(n.__e,t,n,r,i,a,o,c,l,u);return(d=Y.diffed)&&d(t),128&t.__u?void 0:s}function vb(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(vb)}function yb(e,t,n){for(var r=0;r<n.length;r++)Sb(n[r],n[++r],n[++r]);Y.__c&&Y.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){Y.__e(e,t.__v)}})}function bb(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Qy(e)?e.map(bb):eb({},e)}function xb(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(Y.__m&&Y.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=$y.call(e.childNodes),v=n.props||Xy,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;hb(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||hb(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),ub(b==`template`?e.content:e,Qy(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&ob(n,0),s,c,l),a!=null)for(u=a.length;u--;)tb(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||hb(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&hb(e,u,g,v[u],i))}return e}function Sb(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){Y.__e(e,n)}}function Cb(e,t,n){var r,i;if(Y.unmount&&Y.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Sb(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Y.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Cb(r[i],t,n||typeof e.type!=`function`);n||tb(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function wb(e,t,n){return this.constructor(e,n)}function Tb(e,t){var n,r,i,a;t==document&&(t=document.documentElement),Y.__&&Y.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=nb(ib,null,[e]),i=[],a=[],_b(t,e,r||Xy,Xy,t.namespaceURI,r?null:t.firstChild?$y.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),yb(i,e,a)}function Eb(e,t){e.__u|=32,Tb(e,t)}Y={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw Wy=0,e}},Vy=0,ab.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=eb({},this.state);typeof e==`function`&&(e=e(eb({},n),this.props)),e&&eb(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),cb(this))},ab.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),cb(this))},ab.prototype.render=ib,Hy=[],Wy=0,Gy=function(e,t){return e.__v.__b-t.__v.__b},Ky=/(PointerCapture)$|Capture$/i,qy=0,Jy=gb(!1),Yy=gb(!0);var Db=0;Array.isArray;function X(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Db,__i:-1,__u:0,__source:i,__self:a};return Y.vnode&&Y.vnode(l),l}var Ob=16,kb=16,Ab={};function jb({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=Ab[e]??{width:Ob,height:kb},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return X(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:X(`use`,{href:c})})}var Mb=e=>e!==void 0&&/\s/.test(e),Nb=(e,t)=>{let n=t=>Mb(e[t-1])||Mb(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},Pb=e=>Nb(e,Math.ceil(e.length/2)),Fb=e=>{if(e.length<2)return[e,``];let t=Pb(e);return[e.slice(0,t),e.slice(t)]},Ib=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Pb(e);return[e.slice(0,r),e.slice(r)]},Lb=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},Rb=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},zb=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},Bb=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function Vb({children:e,marker:t,variant:n=`default`}){"use no memo";return X(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:X(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?X(`span`,{"data-truncate-fade":!0}):t})})}function Hb(e){"use no memo";let{mode:t,children:n}=e;return X(`div`,{children:[X(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?X(`span`,{children:n}):n}),X(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?X(`span`,{children:n}):n})]})}function Ub({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=X(Hb,{mode:t,children:e},`content`),o=X(Vb,{marker:n,mode:t,variant:r},`marker`),s=X(`div`,{"data-truncate-fill":!0},`fill`);return X(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:X(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function Wb({children:e,...t}){"use no memo";return X(Ub,{mode:`truncate`,...t,children:e})}function Gb({children:e,...t}){"use no memo";return X(Ub,{mode:`fruncate`,...t,children:e})}function Kb({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=X(Wb,{...s,children:t[0]}),l=X(Gb,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return X(`div`,{className:a,style:o});if(e.length<i)return X(n===`end`?Gb:Wb,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=Fb:r===`extension`?t=Ib:r===`leaf-path`&&(t=Lb);else if(typeof r==`number`)t=Rb,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=zb:e===`first`&&(t=Bb)}else typeof r==`function`&&(t=r);t??=Fb;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=X(Wb,{...s,..._,children:f}),l=X(Gb,{...s,...v,children:p})}return X(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[X(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),X(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var qb={endIndex:-1,startIndex:-1};function Jb(e,t,n){return Math.min(Math.max(e,t),n)}function Yb(e,t){return e<0||t<e?qb:{endIndex:t,startIndex:e}}function Xb(e){return e.startIndex<0||e.endIndex<e.startIndex}function Zb(e,t){return Xb(e)?0:(e.endIndex-e.startIndex+1)*t}function Qb(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function $b(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function ex(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function tx(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function nx(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function rx(e,t,n){if(e.length===0||t<=0)return[];let r=nx(e),i=ex(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=tx(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function ix(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=Jb(t.scrollTop,0,o),c=t.stickyRows??rx(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=Qb(s,n,t.itemHeight),m=Qb(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?qb:Yb(m,$b(u+d,n,t.itemHeight)),y=g+1,b=Xb(v)?qb:Yb(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=Zb(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:Xb(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var ax={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},ox={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},sx=`Contains git status items`;function cx(e){return e.current?!0:(e.current=!0,!1)}function lx(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function ux(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return lx({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function dx(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function fx(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function px(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function mx(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function hx(e,t){return e!=null&&e>0?e:t}function gx(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function _x(e,t,n,r,i=0){let a=lx({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function vx(e,t,n,r,i,a,o=0){let s=ux({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function yx(e,t,n,r,i,a){let o=dx({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function bx(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function xx(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function Sx({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return X(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function Cx(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function wx(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var Tx,Z,Ex,Dx,Ox=Object.is,kx=0,Ax=[],Q=Y,jx=Q.__b,Mx=Q.__r,Nx=Q.diffed,Px=Q.__c,Fx=Q.unmount,Ix=Q.__;function Lx(e,t){Q.__h&&Q.__h(Z,e,kx||t),kx=0;var n=Z.__H||(Z.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Rx(e){return kx=1,zx(Xx,e)}function zx(e,t,n){var r=Lx(Tx++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Xx(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);Ox(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,Ox(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Z.__f=!0;var a=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Z.shouldComponentUpdate=i}return r.__N||r.__}function Bx(e,t){var n=Lx(Tx++,3);!Q.__s&&Yx(n.__H,t)&&(n.__=e,n.u=t,Z.__H.__h.push(n))}function Vx(e,t){var n=Lx(Tx++,4);!Q.__s&&Yx(n.__H,t)&&(n.__=e,n.u=t,Z.__h.push(n))}function $(e){return kx=5,Hx(function(){return{current:e}},[])}function Hx(e,t){var n=Lx(Tx++,7);return Yx(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ux(e,t){return kx=8,Hx(function(){return e},t)}function Wx(){for(var e;e=Ax.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(qx),e.__H.__h.forEach(Jx),e.__H.__h=[]}catch(t){e.__H.__h=[],Q.__e(t,e.__v)}}Q.__b=function(e){Z=null,jx&&jx(e)},Q.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ix&&Ix(e,t)},Q.__r=function(e){Mx&&Mx(e),Tx=0;var t=(Z=e.__c).__H;t&&(Ex===Z?(t.__h=[],Z.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(qx),t.__h.forEach(Jx),t.__h=[],Tx=0)),Ex=Z},Q.diffed=function(e){Nx&&Nx(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ax.push(t)!==1&&Dx===Q.requestAnimationFrame||((Dx=Q.requestAnimationFrame)||Kx)(Wx)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Ex=Z=null},Q.__c=function(e,t){t.some(function(e){try{e.__h.forEach(qx),e.__h=e.__h.filter(function(e){return!e.__||Jx(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Q.__e(n,e.__v)}}),Px&&Px(e,t)},Q.unmount=function(e){Fx&&Fx(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{qx(e)}catch(e){t=e}}),n.__H=void 0,t&&Q.__e(t,n.__v))};var Gx=typeof requestAnimationFrame==`function`;function Kx(e){var t,n=function(){clearTimeout(r),Gx&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Gx&&(t=requestAnimationFrame(n))}function qx(e){var t=Z,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Z=t}function Jx(e){var t=Z;e.__c=e.__(),Z=t}function Yx(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!Ox(t,e[n])})}function Xx(e,t){return typeof t==`function`?t(e):t}function Zx(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:X(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return X(ib,{children:[X(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:X(Wb,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Qx(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function $x(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function eS(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function tS({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=ix(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:eS(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?eS(u,1,t,o):i&&r<=0&&c.length>0?rx(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var nS=400,rS=40,iS=18;function aS(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?oS(e,t,n):a instanceof HTMLElement?a:null}function oS(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function sS(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function cS(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function lS(){return navigator.vendor!==`Apple Computer, Inc.`}function uS(e,t){let n=e-t.top;if(n<rS)return-Math.ceil((rS-Math.max(0,n))/rS*iS);let r=t.bottom-e;return r<rS?Math.ceil((rS-Math.max(0,r))/rS*iS):0}function dS(e,t){if(e!=null){let t=ax[e];return t==null?null:{text:t,title:ox[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:sx}:null}function fS(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function pS(e){return e!=null&&`toggle`in e}function mS(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function hS(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function gS(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function _S(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function vS(e,t){return t&&_S(e)||(e.ctrlKey||e.metaKey)&&mS(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var yS=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function bS(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function xS(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function SS(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function CS(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function wS(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function TS(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function ES(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function DS(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function OS(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=DS(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function kS(e,t){return{kind:e.kind,name:$x(e),path:t}}function AS(e){return e==null?void 0:`${e}__tree`}function jS(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function MS(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function NS(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?X(`span`,{title:e.title,children:e.text}):X(`span`,{title:e.title,children:e.parts.map((e,t)=>X(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?MS(e.icon)?t(e.icon):{name:e.icon}:MS(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return X(`span`,{title:e.title,children:X(jb,{...n})})}function PS(e){e!=null&&fx(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function FS(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=Qx(e);return X(ib,{children:[e.depth>0?X(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>X(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,X(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?X(jb,{...t(`file-tree-icon-chevron`)}):X(jb,{...t(`file-tree-icon-file`,u)})}),X(`div`,{"data-item-section":`content`,children:e.isFlattened?Zx(e,c,a):c??X(Kb,{minimumLength:5,split:`extension`,children:e.name})}),i?X(`div`,{"data-item-section":`decoration`,children:r==null?null:NS(r,t)}):null,s?X(`div`,{"data-item-section":`git`,children:NS(o,t)}):null,n?X(`div`,{"data-item-section":`action`,children:l?X(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:X(jb,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function IS(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:ee,contextMenuButtonVisibility:te,contextMenuRightClickEnabled:ne,registerRenameInput:w,registerButton:T,resolveIcon:re,renderDecorationForRow:E,openContextMenuForRow:ie,onRowClick:D,onKeyDown:ae}=e,O=Qx(t),{isParked:oe=!1,mode:se=`flow`,style:ce}=r,le=se===`sticky`,ue=_?.get(O)??null??fS(t.ancestorPaths,v,y),de=t.kind===`directory`&&(b?.has(O)??!1),fe=E(t,O),pe=dS(ue,de),me=S&&ee,he=fe!=null||x||me,ge=me&&te===`always`,_e=a.getPath()===O,ve=_e?a.getValue():``,ye=le||!_e?null:X(Sx,{ref:w,ariaLabel:`Rename ${$x(t)}`,isFlattened:t.isFlattened,value:ve,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),be=FS(t,re,{actionLaneEnabled:me,customDecoration:fe,decorationLaneEnabled:he,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:pe,gitLaneActive:x,renameInput:ye,showDecorativeActionAffordance:ge}),xe={...Cx({ariaLabel:$x(t),domId:t.isFocused?jS(h,O,oe):void 0,extraStyle:ce,features:{actionLaneEnabled:me,contextMenuButtonVisibility:me?te:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:oe,itemHeight:g,mode:se,row:t,state:{containsGitChange:de,effectiveGitStatus:ue,isContextHovered:s===O,isDragTarget:l?.kind===`directory`&&l.directoryPath===O,isDragging:c?.has(O)===!0,isFocusRinged:t.isFocused&&o===O},targetPath:O}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),ne&&(i.focusMountedPathFromInput(O),ie(t,O,{anchorRect:SS(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:le?void 0:()=>{i.focusMountedPathFromInput(O)},onKeyDown:le?void 0:ae,ref:e=>{T(O,e)}};return!le&&_e?X(`div`,{...xe,children:be}):X(`button`,{...xe,type:`button`,draggable:u&&!oe,onDragEnd:u&&!oe?p:void 0,onDragStart:u&&!oe?e=>{f(e,t,O)}:void 0,onMouseDown:e=>{if(le){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!oe?e=>{m(e,t,O)}:void 0,onClick:e=>{D(e,t,O,se)},children:be})}function LS(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Qx(e))).map((n,r)=>IS(e,n,t.start+r))}function RS({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=Av,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=$(null),v=$(null),y=$(!1),b=$(null),x=$(null),S=$(null),C=$(null),ee=$(null),te=$(new Map),ne=$(new Map),w=$(()=>{}),T=$(null),re=$(0),E=$(!1),ie=$(null);ie.current!==t&&(E.current=!1,ie.current=t);let D=$(!1),ae=$(null),O=$(null),oe=$(!1),se=$(null),ce=$(null),le=$(null),ue=$(null),de=$(null),fe=$(null),pe=$(null),me=$(null),he=$(!1),ge=$(null),_e=$(null),ve=$(null),ye=$(null),be=Hx(()=>new Map,[]),[,xe]=Rx(0),Se=$(!1),[Ce,we]=Rx(null),[Te,Ee]=Rx(null),[De,Oe]=Rx(null),[ke,Ae]=Rx(null),[je,Me]=Rx(0),[k,Ne]=Rx(null),Pe=$(k);Pe.current=k;let Fe=$(null),Ie=$(null),Le=$(null),Re=$(null),ze=$(null),Be=$(!1),Ve=()=>{Ie.current=null,Le.current=null,Re.current=null},He=(e,t)=>{Ie.current=e,Le.current=null,Re.current=t==null?null:{path:e,scrollTop:t}},Ue=(e,t)=>{Ie.current=null,Le.current={path:e,viewportOffset:t},Re.current=null},We=$(d===`retain`&&t.isSearchOpen()),[Ge,Ke]=Rx(p);Bx(()=>{p||Ke(!1)},[p]);let qe=$(!1),Je=Ux(()=>{qe.current=!0,Ke(e=>e&&!1)},[]),[Ye,Xe]=Rx(()=>tS({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ze,Qe]=Rx(!1);Bx(()=>{Qe(!0)},[]);let $e=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,et=e?.contextMenu?.triggerMode??($e?`right-click`:`both`),tt=et===`both`||et===`button`,nt=e?.contextMenu?.buttonVisibility??`when-needed`,rt=et===`both`||et===`right-click`;Vx(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;ze.current=t,Ee(t),Ae(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Be.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let it=Ux((e,t)=>{wS(te.current,e,t)},[]),at=Ux((e,t)=>{wS(ne.current,e,t)},[]),ot=Ux(e=>{x.current=e},[]),st=Ux(e=>TS(e,ne.current,te.current),[]),ct=n!=null||r!=null||i!=null,{resolveIcon:lt}=Hx(()=>Xm(a),[a]),ut=t[xy](),dt=ut.getPath(),ft=dt!=null,pt=t.isSearchOpen(),mt=t.getSearchValue(),A=t.getFocusedPath(),j=t.getFocusedIndex(),ht=t.getScrollRequest(),gt=t.isDragAndDropEnabled(),_t=t.getDragSession(),vt=Hx(()=>_t==null?null:new Set(_t.draggedPaths),[_t]),yt=_t?.target??null,bt=_t?.primaryPath??null,xt=AS(o),{overlayHeight:St,overlayRows:Ct,snapshot:M,visibleRows:wt}=Ye,N=M.physical.viewportHeight,Tt=Hx(()=>({end:M.window.endIndex,start:M.window.startIndex}),[M.window.endIndex,M.window.startIndex]),Et=Ct,Dt=M.sticky.rows,Ot=M.physical.totalHeight,kt=M.sticky.height,At=Hx(()=>new Set(Dt.map(e=>Qx(e.row))),[Dt]),jt=j>=0&&j>=Tt.start&&j<=Tt.end,Mt=Ux((e,t)=>u?.({item:kS(e,t),row:e})??null,[u]),Nt=Ux(e=>fx(e==null?null:te.current.get(e)??null)?!0:fx(S.current),[]),Pt=Ux(e=>{Nt(t.focusNearestPath(e))},[t,Nt]),Ft=$(Pt);Ft.current=Pt;let It=$(!0),Lt=$(()=>{}),Rt=Ux((t=!0)=>{let n=Pe.current;n!=null&&(It.current=It.current&&t,Ne(null),e?.contextMenu?.onClose?.(),It.current&&Pt(n.path))},[e?.contextMenu,Pt]);Lt.current=Rt;let zt=Ux(e=>{let t=e==null?null:CS(S.current,e);Oe(e=>e===t?e:t)},[]),Bt=Ux((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=st(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;He(n,e?.scrollTop??null),D.current=!0,we(e=>e===n?e:n)}i.focus(),zt(a),It.current=!0,Ne({anchorRect:r?.anchorRect??null,item:kS(e,n),path:n,source:r?.source??`keyboard`})},[t,st,zt]),Vt=Ux(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=mx(e,N);se.current=j<0||e==null?null:Math.max(0,Math.min(j*s-e.scrollTop,Math.max(0,t-s))),oe.current=!0}t.startRenaming(e)!==!1&&(Ae(`focus`),xe(e=>e+1))}},[t,j,s,l,N]),Ht=Ux((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=mx(i,N),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:tS({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return D.current=!0,yx(i,a,s,l,u,d),w.current(),Fe.current=n?e:null,!0},[t,s,c,N,h]),Ut=()=>y.current===!0||ye.current!=null||he.current===!0,P=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Wt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Gt=()=>{ue.current!=null&&(clearTimeout(ue.current),ue.current=null),le.current=null},Kt=()=>{fe.current?.remove(),fe.current=null},qt=()=>{Wt(ce.current),ce.current=null,de.current=null},Jt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Yt=()=>{me.current?.(),me.current=null,ye.current!=null&&(clearTimeout(ye.current),ye.current=null),he.current=!1,ge.current=null,ve.current=null,_e.current!=null&&(_e.current.setAttribute(`draggable`,`true`),_e.current.style.removeProperty(`touch-action`),_e.current=null),Kt(),Gt(),qt(),pe.current=null},Xt=(e,n)=>{let r=S.current?.getRootNode(),i=sS(aS(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Zt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Gt();return}let r=t.getItem(e.directoryPath),i=pS(r)?r:null;if(i==null||i.isExpanded()){Gt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;le.current!==a&&(Gt(),le.current=a,ue.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Qt=()=>{ce.current=null;let e=de.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=uS(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,w.current()),Zt(Xt(e.clientX,e.clientY)),ce.current=P(Qt)},$t=(e,t)=>{de.current={clientX:e,clientY:t},ce.current??=P(Qt)},en=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Yt(),Kt(),Gt(),qt(),t.startDrag(r)===!1){e.preventDefault();return}if(pe.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),lS())){let t=cS(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Jt(t),fe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},tn=()=>{Kt(),Gt(),qt(),pe.current=null,t.cancelDrag()},nn=(e,n,r)=>{if(ye.current!=null||he.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ve.current={clientX:i.clientX,clientY:i.clientY},_e.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!he.current;ye.current!=null&&(clearTimeout(ye.current),ye.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),me.current===o&&(me.current=null),t&&(a.setAttribute(`draggable`,`true`),_e.current===a&&(_e.current=null),ve.current=null)},s=e=>{let t=e.touches[0],n=ve.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),me.current=o,ye.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),_e.current===a&&(_e.current=null),ve.current=null;return}he.current=!0,_e.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),pe.current=n;let e=a.getBoundingClientRect(),s=cS(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Jt(s),fe.current=s,ge.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=ge.current;n!=null&&fe.current!=null&&(fe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Zt(Xt(t.clientX,t.clientY)),$t(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Xt(n.clientX,n.clientY),t.completeDrag(),Yt()},u=()=>{t.cancelDrag(),Yt()};me.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},nS)},rn=e=>{if(k!=null){if(e.key===`Escape`){Rt(),e.preventDefault(),e.stopPropagation();return}yS.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(ut.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)ut.cancel();else if(e.key===`Enter`)ut.commit();else return;Ae(`focus`),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Vt(A??void 0),e.preventDefault(),e.stopPropagation();return}if(pt){if(e.key===`Escape`)oe.current=!1,se.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=mx(n,N);se.current=j<0||n==null?null:Math.max(0,Math.min(j*s-n.scrollTop,Math.max(0,r-s))),oe.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Ae(`focus`),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&hS(e)){t.openSearch(e.key),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=$e&&_S(e),r=vS(e,$e),i=r&&S.current!=null?px(S.current):null,a=r?new Set(ES(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==A&&a.has(o)){let e=C.current;He(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=pS(p)?p:null,h=u!=null&&(At.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=TS(u,ne.current,te.current);e==null||n==null?y=!1:Bt(e,u)}else if((e.ctrlKey||e.metaKey)&&mS(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Ae(`focus`);let b=t.getFocusedPath(),x=b!=null&&(At.has(b)||a.has(b)),ee=g&&b!==u,w=n&&c&&o===u&&b===u;if((h||w)&&b!=null&&(ee&&x||w))He(b,v?.scrollTop??null),D.current=!0,we(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Ue(b,OS(S.current,v,i,u,s,kt,N)),D.current=!0,we(e=>e===b?e:b)):Ve()}xe(e=>e+1),e.preventDefault(),e.stopPropagation()};Vx(()=>{if(!(!f||!pt)){if(We.current){We.current=!1;return}fx(ee.current)}},[pt,f]),Vx(()=>{let e=x.current;switch(xx({hasRenderedInput:e!=null,previousRenamingPath:O.current,renamingPath:dt})){case`reset`:O.current=null;return;case`reveal-canonical`:dt!=null&&Ht(dt,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(Fe.current=null,O.current=dt,fx(e),e.select());return}},[Tt.end,Tt.start,dt,Ht,At]),Vx(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=px(e)?.dataset.itemPath??null;we(e=>e===t?e:t)},i=()=>{n(),D.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,px(e)!=null){r();return}D.current=!1,we(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),D.current=!1,we(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;we(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),Vx(()=>{let e=S.current;e!=null&&(M.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[M.physical.scrollTop]),Vx(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;T.current=mx(n,g);let a=()=>{let e=t.getVisibleCount(),r=hx(T.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Xe(tS({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!E.current){E.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=hx(T.current,g),i=t.getVisibleRows(e,e)[0]??null;_x(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}w.current=a;let o=t.subscribe(()=>{cx(Se)&&xe(e=>e+1),a()}),l=()=>{Be.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,Me(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Be.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Pe.current!=null&&y.current&&Lt.current(),Be.current===!0){y.current=!1;return}Ee(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{T.current=(e[0]==null?null:gx(e[0]))??mx(n,g),a()}):null;return x?.observe(n),()=>{w.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,T.current=null,x?.disconnect()}},[t,g,s,c,h]),Vx(()=>{$e||k==null||Rt(!1)},[Rt,$e,k]);let an=Hx(()=>k==null?null:`${k.path}::${k.source}`,[k]);Vx(()=>{if(an==null){m?.clearSlotContent(Hm);return}let t=Pe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??xS(n.getBoundingClientRect()),close:e=>{Lt.current(e?.restoreFocus??!0)},restoreFocus:()=>{It.current&&Ft.current(Pe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(Hm,i),e?.contextMenu?.onOpen?.(t.item,r),PS(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&PS(i)}),()=>{m?.clearSlotContent(Hm)}},[an,e?.contextMenu,m]),Vx(()=>{k!=null&&t.getItem(k.path)==null&&Rt()},[Rt,k,t]),Vx(()=>{if(k==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(bS(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Rt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Rt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Rt,k]),Vx(()=>{let e=C.current,n=S.current;if(e==null||n==null){ae.current=A;return}let r=A==null?null:te.current.get(A)??null,i=px(n),a=i?.dataset.itemPath??null,o=ft&&x.current===i,c=f&&ee.current===i,l=oe.current&&!pt,u=se.current??0,d=Fe.current,p=Ie.current,m=Le.current,g=Re.current,_=i!=null,v=D.current||_,y=ae.current!==A,b=p!=null&&p===A&&A!=null,ne=!1,T=!1;if(ht!=null&&ht.id!==re.current){re.current=ht.id;let n=ht.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,N-s))):kt;ne=!0,T=vx(e,n,s,N,Ot,ht.offset,t)}t.clearScrollRequest(ht.id)}let E=!ne&&l&&yx(e,j,s,N,Ot,u),ie=!ne&&d!=null&&d===A&&yx(e,j,s,N,Ot,kt),O=!ne&&m!=null&&m.path===A&&yx(e,j,s,N,Ot,m.viewportOffset),ce=!ne&&g!=null&&g.path===A&&e.scrollTop!==g.scrollTop;if(ce&&(e.scrollTop=g.scrollTop),(ce||T||ie||O||E||v&&y&&d!==A&&!b&&_x(e,j,s,N,kt))&&w.current(),ne){ae.current=A;return}if(!v){ae.current=A;return}if(o){ae.current=A;return}if(c&&!l){ae.current=A;return}if(r==null){l&&j>=0&&(yx(e,j,s,N,Ot,u),w.current()),ae.current=A;return}(y||l||d===A||p===A||m?.path===A||g?.path===A||a==null||a!==A)&&(fx(r),d===A&&(Fe.current=null),p===A&&(Ie.current=null),m?.path===A&&(Le.current=null),g?.path===A&&(Re.current=null),oe.current=!1,se.current=null),ae.current=A},[t,j,A,jt,s,ft,pt,Tt,N,f,ht,h,kt,Ot,wt]);let on=j>=0&&j>=M.visible.startIndex&&j<=M.visible.endIndex,sn=A!=null&&Et.some(e=>Qx(e.row)===A),cn=on||sn,ln=tt&&D.current===!0&&cn?A:null,un=ke===`pointer`?Te:null,F=k?.path??ze.current??un??ln??Te,dn=k?.source===`right-click`;Vx(()=>{y.current&&k==null||zt(st(F))},[k,st,Tt,N,je,Et,F,zt,wt]);let fn=Ux(e=>{if(y.current||bS(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Ae(e=>e===`pointer`?e:`pointer`),Ee(e=>e===i?e:i)},[]),pn=Ux(()=>{Ee(null)},[]);Vx(()=>{if(!gt)return;let e=()=>{Yt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Yt(),t.cancelDrag()}},[t,gt]);let mn=e=>{if(!gt||t.getDragSession()==null||he.current)return;let n=sS(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Zt(t.getDragSession()?.target??null),$t(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},hn=e=>{if(!gt||t.getDragSession()==null||he.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Gt(),qt(),t.setDragTarget(null))},gn=e=>{!gt||t.getDragSession()==null||he.current||(e.preventDefault(),Xt(e.clientX,e.clientY),t.completeDrag(),Kt(),Gt(),qt(),pe.current=null)},_n=M.window.height,vn=M.window.offsetTop,yn=Math.min(0,N-_n),bn=Math.min(0,N-_n-kt),xn=Ce===A||oe.current,Sn=A!=null&&xn&&!jt&&j>=0?wt[j]??t.getVisibleRows(j,j)[0]??null:null,Cn=Sn==null?null:bx(j,s,Tt,_n),wn=pe.current,Tn=bt!=null&&wn!=null&&wn.path===bt&&wn.index>=Tt.start&&wn.index<=Tt.end,En=bt!=null&&wn!=null&&wn.path===bt&&!Tn&&wn.path!==Sn?.path?wn:null,Dn=En==null?null:bx(En.index,s,Tt,_n),On=gS((j>=0?wt[j]??t.getVisibleRows(j,j)[0]??null:null)?.ancestorPaths.at(-1)??null),kn=pt&&A!=null?jS(o,A,!jt):void 0,An=k?.path??(pt?A:Ce),jn=k?.path??Te,Mn=st(F),Nn=$e&&tt&&!dn&&!ft&&Mn!=null&&De!=null&&F!=null,Pn=$e&&(Nn||k!=null),Fn=k?.anchorRect,In=Fn==null&&Mn!=null&&De!=null&&(k!=null||Nn)?De:null,Ln=Fn==null?In==null?void 0:{top:`${In}px`}:{left:`${Fn.left}px`,position:`fixed`,right:`auto`,top:`${Fn.top}px`},I=dn?{opacity:`0`}:void 0,Rn=Ux((e,n,r,i)=>{let a=wx({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:pt,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=M.visible.startIndex&&n.index<=M.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(D.current=!0,we(e=>e===c?e:c),Ae(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Ht(c,{targetOffset:`sticky-parents`})},[t,pt,M.visible.endIndex,M.visible.startIndex,Ht]),L=()=>{if(y.current||!tt||F==null||Mn==null)return;let e=t.getItem(F);e!=null&&(zt(Mn),It.current=!0,Ne({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:Mn.getAttribute(`aria-label`)??F,path:e.getPath()},path:e.getPath(),source:`button`}))},R={contextHoverPath:jn,contextMenuButtonTriggerEnabled:tt,contextMenuButtonVisibility:nt,contextMenuEnabled:$e,contextMenuRightClickEnabled:rt,contextMenuTriggerMode:et,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:gt,draggedPathSet:vt,dragTarget:yt,gitLaneActive:ct,gitStatusByPath:n,handleRowDragEnd:tn,handleRowDragStart:en,handleRowTouchStart:nn,ignoredGitDirectories:r,ignoredInheritanceCache:be,instanceId:o,itemHeight:s,onKeyDown:rn,onRowClick:Rn,openContextMenuForRow:Bt,registerButton:it,registerRenameInput:ot,renameView:ut,renderDecorationForRow:Mt,resolveIcon:lt,shouldSuppressContextMenu:Ut,visualFocusPath:An},zn={...R,registerButton:at};return X(`div`,{ref:S,id:xt,"data-file-tree-context-menu-button-visibility":$e&&tt?nt:void 0,"data-file-tree-context-menu-trigger-mode":$e?et:void 0,"data-file-tree-has-context-menu-action-lane":$e&&tt?`true`:void 0,"data-file-tree-has-git-lane":ct?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:gt?hn:void 0,onDragOver:gt?mn:void 0,onDrop:gt?gn:void 0,onKeyDown:rn,onPointerLeave:$e?pn:void 0,onPointerOver:$e?fn:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[X(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:On}}),X(`slot`,{name:Vm,"data-type":`header-slot`}),f?X(`div`,{"data-file-tree-search-container":!0,"data-open":pt?`true`:`false`,children:X(`input`,{ref:ee,"aria-activedescendant":kn,"aria-controls":xt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ge?`true`:void 0,value:mt,onBlur:()=>{d===`retain`&&!qe.current||t.closeSearch()},onFocus:Je,onPointerDown:Je,onInput:e=>{Je();let n=e.currentTarget;t.setSearch(n.value)}})}):null,X(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ze&&Et.length>0?X(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:X(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${St}px`},children:Et.map((e,t)=>IS(zn,e.row,`sticky:${Qx(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${Et.length-t}`}}))})}):null,X(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Ot}px`},children:[X(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${vn}px`}}),X(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${_n}px`,top:`${yn}px`,bottom:`${bn}px`},children:[LS(R,Tt,At),Sn!=null&&Cn!=null?IS(R,Sn,`parked:${Sn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:bt===Sn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${Cn}px`}}):null,En!=null&&Dn!=null?IS(R,En,`parked-drag:${En.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${Dn}px`}}):null]})]})]}),$e?X(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Pn?`true`:`false`,style:Ln,children:[X(`button`,{ref:v,type:`button`,"data-type":Um,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":k==null?`false`:`true`,"data-visible":Nn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),k!=null){Rt();return}L()},tabIndex:-1,style:I,children:X(jb,{...lt(`file-tree-icon-ellipsis`)})}),k==null?null:X(`slot`,{name:Hm})]}):null,k==null?null:X(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Rt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Rt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var zS={hydrateRoot:(e,t)=>{Eb(nb(RS,t),e)},renderRoot:(e,t)=>{Tb(nb(RS,t),e)},unmountRoot:e=>{Tb(null,e)}};function BS(e,t){zS.renderRoot(e,t)}function VS(e,t){zS.hydrateRoot(e,t)}function HS(e){zS.unmountRoot(e)}var US=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var WS=0;function GS(e){return e!=null&&e.length>0?e:(WS+=1,`pst_ft_${WS}`)}function KS({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??Av)}function qS(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function JS(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function YS(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var XS=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new US;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=GS(a),this.#p=My(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=kv(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Dy({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(HS(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=Ny(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&BS(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),BS(t.wrapper,this.#w()))}setGitStatus(e){let t=My(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&BS(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),BS(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),VS(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),BS(r,this.#w())}#C(){return{initialViewportHeight:KS({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(Vm,e());return}this.#l.setSlotHtml(Vm,this.#e?.header?.html??null)}#k(e){let t=YS(e).find(e=>JS(e)),n=qS(jm(Gm(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=YS(e),n=t.find(e=>JS(e)),r=t.filter(e=>e!==n),i=Gm(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=qS(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=Gm(this.#m);t.colored&&Nm(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${Lm}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(Lm,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=Pv(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return Bv(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},ZS=`
7401
7401
  :host {
7402
7402
  --file-tree-font-family: var(--ui, system-ui, sans-serif);
7403
7403
  --file-tree-font-size: 12.5px;
@@ -7413,7 +7413,7 @@ slicc-dock-tree .dock-tree__preview--active {
7413
7413
  --file-tree-git-deleted-color: var(--rose, #d1242f);
7414
7414
  --file-tree-git-untracked-color: var(--txt-3, #717171);
7415
7415
  }
7416
- `,ZS=`
7416
+ `,QS=`
7417
7417
  slicc-file-tree {
7418
7418
  display: block;
7419
7419
  box-sizing: border-box;
@@ -7426,7 +7426,7 @@ slicc-file-tree {
7426
7426
  font-family: var(--ui);
7427
7427
  font-size: 13px;
7428
7428
  }
7429
- `,QS=`slicc-file-tree-style`;function $S(e){if(e.getElementById(QS))return;let t=e.createElement(`style`);t.id=QS,t.textContent=ZS,(e.head??e.documentElement).appendChild(t)}function eC(e){return e?.isDirectory()?e:null}function tC(e){return e.replace(/^\/+/,``)}function nC(e){return e<1024?`${e}B`:e<1048576?`${Math.round(e/1024)}K`:e<1073741824?`${(e/1048576).toFixed(1)}M`:`${(e/1073741824).toFixed(1)}G`}function rC(e){let t=[],n=new Map,r=[],i=e=>{for(let a of e){if(a.kind===`group`)continue;let e=tC(a.id);if(a.kind===`dir`){n.set(e,{id:a.id,path:a.path??a.id,kind:`directory`}),a.open&&r.push(e),a.children.length===0?t.push(e):i(a.children);continue}t.push(e),n.set(e,{id:a.id,path:a.path??a.label,kind:`file`,...a.size===void 0?{}:{size:a.size}})}};return i(e),{paths:t,meta:n,initiallyOpen:r}}I(`slicc-file-tree`,class extends HTMLElement{#e=[];#t=new Map;#n=null;#r=null;#i=[];#a=null;#o=!1;#s=null;#c=null;static get observedAttributes(){return[`selected`]}connectedCallback(){$S(this.ownerDocument),this.#r||(this.#r=document.createElement(`div`),this.#r.style.cssText=`display:flex;flex-direction:column;height:100%;min-height:0;`,this.appendChild(this.#r)),this.#f()}disconnectedCallback(){this.#n?.unmount(),this.#n=null,this.#c=null}attributeChangedCallback(e,t,n){e===`selected`&&n!==this.#a&&(this.#a=n,this.#d())}get items(){return this.#e.slice()}set items(e){this.#e=Array.isArray(e)?e.slice():[],this.#f()}get gitStatus(){return this.#i.slice()}set gitStatus(e){this.#i=Array.isArray(e)?e.slice():[],this.#f()}get selected(){return this.#a}set selected(e){e===null?this.removeAttribute(`selected`):this.setAttribute(`selected`,e)}selectFile(e){let t=this.#t.get(tC(e));if(t){this.#o=!0;try{this.selected=e}finally{this.#o=!1}this.#d(),this.#l(`file-select`,{id:e,path:t.path})}}visibleIds(){let e=this.#n;if(!e)return[];let t=e.getVisibleCount();return t===0?[]:e.getVisibleRows(0,t).map(e=>this.#t.get(e.path.replace(/\/$/,``))?.id).filter(e=>typeof e==`string`)}toggleDir(e){let t=eC(this.#n?.getItem(tC(e)));t&&(t.toggle(),this.#l(`dir-toggle`,{id:e,open:t.isExpanded()}))}isDirOpen(e){return eC(this.#n?.getItem(tC(e)))?.isExpanded()===!0}previewFile(e){let t=this.#t.get(tC(e));t?.kind===`file`&&this.#l(`file-preview`,{id:e,path:t.path})}#l(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}#u(){let e=this.#n;if(!e)return;let t=e.getVisibleCount();if(t===0)return;let n=e.getVisibleRows(0,t);this.#s=n.filter(e=>e.isExpanded).map(e=>e.path)}#d(){let e=this.#a;if(!(!e||!this.#n)){this.#o=!0;try{this.#n.getItem(tC(e))?.select()}finally{this.#o=!1}}}#f(){if(!this.isConnected||!this.#r)return;let{paths:e,meta:t,initiallyOpen:n}=rC(this.#e);this.#t=t,this.#u();let r=this.#s??n;if(this.#n&&e.length>0){this.#n.resetPaths({preparedInput:Ev(e),initialExpandedPaths:r}),this.#n.setGitStatus(this.#i),this.#p();return}if(this.#n?.unmount(),this.#r.replaceChildren(),this.#c=null,e.length===0){this.#n=null;return}let i=new YS({preparedInput:Ev(e),gitStatus:this.#i,search:!0,initialVisibleRowCount:40,renaming:!1,dragAndDrop:!1,unsafeCSS:XS,initialExpandedPaths:r,...this.#a?{initialSelectedPaths:[tC(this.#a)]}:{},onSelectionChange:e=>{if(this.#o)return;let t=e[0];if(t===void 0)return;let n=this.#t.get(t);n&&(this.#a=n.id,this.setAttribute(`selected`,n.id),this.#l(`file-select`,{id:n.id,path:n.path}))},renderRowDecoration:({row:e})=>{let t=this.#t.get(e.path);return!t||t.size===void 0?null:{text:nC(t.size)}},composition:{contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`,onOpen:(e,t)=>{let n=this.#t.get(e.path);t.close({restoreFocus:!1}),this.#l(`file-overflow`,{id:n?.id??e.path,path:n?.path??e.path,anchor:t.anchorElement,kind:e.kind})}}}});i.render({containerWrapper:this.#r}),this.#n=i,this.#p()}#p(){let e=this.#n?.getFileTreeContainer();if(!e||e===this.#c)return;this.#c=e;let t=()=>{let e=this.#n?.getFocusedPath()??this.#n?.getSelectedPaths()[0],t=e==null?null:this.#t.get(e);t&&this.previewFile(t.id)};e.addEventListener(`dblclick`,t),e.addEventListener(`keydown`,e=>{e.key===`Enter`&&t()})}});var iC=`
7429
+ `,$S=`slicc-file-tree-style`;function eC(e){if(e.getElementById($S))return;let t=e.createElement(`style`);t.id=$S,t.textContent=QS,(e.head??e.documentElement).appendChild(t)}function tC(e){return e?.isDirectory()?e:null}function nC(e){return e.replace(/^\/+/,``)}function rC(e){return e<1024?`${e}B`:e<1048576?`${Math.round(e/1024)}K`:e<1073741824?`${(e/1048576).toFixed(1)}M`:`${(e/1073741824).toFixed(1)}G`}function iC(e){let t=[],n=new Map,r=[],i=e=>{for(let a of e){if(a.kind===`group`)continue;let e=nC(a.id);if(a.kind===`dir`){n.set(e,{id:a.id,path:a.path??a.id,kind:`directory`}),a.open&&r.push(e),a.children.length===0?t.push(e):i(a.children);continue}t.push(e),n.set(e,{id:a.id,path:a.path??a.label,kind:`file`,...a.size===void 0?{}:{size:a.size}})}};return i(e),{paths:t,meta:n,initiallyOpen:r}}I(`slicc-file-tree`,class extends HTMLElement{#e=[];#t=new Map;#n=null;#r=null;#i=[];#a=null;#o=!1;#s=null;#c=null;static get observedAttributes(){return[`selected`]}connectedCallback(){eC(this.ownerDocument),this.#r||(this.#r=document.createElement(`div`),this.#r.style.cssText=`display:flex;flex-direction:column;height:100%;min-height:0;`,this.appendChild(this.#r)),this.#f()}disconnectedCallback(){this.#n?.unmount(),this.#n=null,this.#c=null}attributeChangedCallback(e,t,n){e===`selected`&&n!==this.#a&&(this.#a=n,this.#d())}get items(){return this.#e.slice()}set items(e){this.#e=Array.isArray(e)?e.slice():[],this.#f()}get gitStatus(){return this.#i.slice()}set gitStatus(e){this.#i=Array.isArray(e)?e.slice():[],this.#f()}get selected(){return this.#a}set selected(e){e===null?this.removeAttribute(`selected`):this.setAttribute(`selected`,e)}selectFile(e){let t=this.#t.get(nC(e));if(t){this.#o=!0;try{this.selected=e}finally{this.#o=!1}this.#d(),this.#l(`file-select`,{id:e,path:t.path})}}visibleIds(){let e=this.#n;if(!e)return[];let t=e.getVisibleCount();return t===0?[]:e.getVisibleRows(0,t).map(e=>this.#t.get(e.path.replace(/\/$/,``))?.id).filter(e=>typeof e==`string`)}toggleDir(e){let t=tC(this.#n?.getItem(nC(e)));t&&(t.toggle(),this.#l(`dir-toggle`,{id:e,open:t.isExpanded()}))}isDirOpen(e){return tC(this.#n?.getItem(nC(e)))?.isExpanded()===!0}previewFile(e){let t=this.#t.get(nC(e));t?.kind===`file`&&this.#l(`file-preview`,{id:e,path:t.path})}#l(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}#u(){let e=this.#n;if(!e)return;let t=e.getVisibleCount();if(t===0)return;let n=e.getVisibleRows(0,t);this.#s=n.filter(e=>e.isExpanded).map(e=>e.path)}#d(){let e=this.#a;if(!(!e||!this.#n)){this.#o=!0;try{this.#n.getItem(nC(e))?.select()}finally{this.#o=!1}}}#f(){if(!this.isConnected||!this.#r)return;let{paths:e,meta:t,initiallyOpen:n}=iC(this.#e);this.#t=t,this.#u();let r=this.#s??n;if(this.#n&&e.length>0){this.#n.resetPaths({preparedInput:Dv(e),initialExpandedPaths:r}),this.#n.setGitStatus(this.#i),this.#p();return}if(this.#n?.unmount(),this.#r.replaceChildren(),this.#c=null,e.length===0){this.#n=null;return}let i=new XS({preparedInput:Dv(e),gitStatus:this.#i,search:!0,initialVisibleRowCount:40,renaming:!1,dragAndDrop:!1,unsafeCSS:ZS,initialExpandedPaths:r,...this.#a?{initialSelectedPaths:[nC(this.#a)]}:{},onSelectionChange:e=>{if(this.#o)return;let t=e[0];if(t===void 0)return;let n=this.#t.get(t);n&&(this.#a=n.id,this.setAttribute(`selected`,n.id),this.#l(`file-select`,{id:n.id,path:n.path}))},renderRowDecoration:({row:e})=>{let t=this.#t.get(e.path);return!t||t.size===void 0?null:{text:rC(t.size)}},composition:{contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`,onOpen:(e,t)=>{let n=this.#t.get(e.path);t.close({restoreFocus:!1}),this.#l(`file-overflow`,{id:n?.id??e.path,path:n?.path??e.path,anchor:t.anchorElement,kind:e.kind})}}}});i.render({containerWrapper:this.#r}),this.#n=i,this.#p()}#p(){let e=this.#n?.getFileTreeContainer();if(!e||e===this.#c)return;this.#c=e;let t=()=>{let e=this.#n?.getFocusedPath()??this.#n?.getSelectedPaths()[0],t=e==null?null:this.#t.get(e);t&&this.previewFile(t.id)};e.addEventListener(`dblclick`,t),e.addEventListener(`keydown`,e=>{e.key===`Enter`&&t()})}});var aC=`
7430
7430
  slicc-surface {
7431
7431
  position: absolute;
7432
7432
  inset: 0;
@@ -7458,7 +7458,7 @@ slicc-surface:fullscreen {
7458
7458
  background: var(--canvas, #fff);
7459
7459
  position: fixed;
7460
7460
  }
7461
- `,aC=`slicc-surface-style`;function oC(e){if(e.getElementById(aC))return;let t=e.createElement(`style`);t.id=aC,t.textContent=iC,(e.head??e.documentElement).appendChild(t)}function sC(e){return e===`block`||e===`column`?e:`flex`}I(`slicc-surface`,class extends HTMLElement{static observedAttributes=[`surface-id`,`active`,`layout`];connectedCallback(){oC(this.ownerDocument),this.#e()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`surface-id`?this.#e():e===`active`&&t!==n&&this.dispatchEvent(new CustomEvent(`surface-toggle`,{bubbles:!0,composed:!0,detail:{surfaceId:this.surfaceId,active:this.active,layout:this.layout}})))}get surfaceId(){return this.getAttribute(`surface-id`)}set surfaceId(e){e==null?this.removeAttribute(`surface-id`):this.setAttribute(`surface-id`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get layout(){return sC(this.getAttribute(`layout`))}set layout(e){this.setAttribute(`layout`,sC(e))}#e(){let e=this.surfaceId;e==null?delete this.dataset.s:this.dataset.s=e}});var cC=`/**
7461
+ `,oC=`slicc-surface-style`;function sC(e){if(e.getElementById(oC))return;let t=e.createElement(`style`);t.id=oC,t.textContent=aC,(e.head??e.documentElement).appendChild(t)}function cC(e){return e===`block`||e===`column`?e:`flex`}I(`slicc-surface`,class extends HTMLElement{static observedAttributes=[`surface-id`,`active`,`layout`];connectedCallback(){sC(this.ownerDocument),this.#e()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`surface-id`?this.#e():e===`active`&&t!==n&&this.dispatchEvent(new CustomEvent(`surface-toggle`,{bubbles:!0,composed:!0,detail:{surfaceId:this.surfaceId,active:this.active,layout:this.layout}})))}get surfaceId(){return this.getAttribute(`surface-id`)}set surfaceId(e){e==null?this.removeAttribute(`surface-id`):this.setAttribute(`surface-id`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get layout(){return cC(this.getAttribute(`layout`))}set layout(e){this.setAttribute(`layout`,cC(e))}#e(){let e=this.surfaceId;e==null?delete this.dataset.s:this.dataset.s=e}});var lC=`/**
7462
7462
  * Copyright (c) 2014 The xterm.js authors. All rights reserved.
7463
7463
  * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
7464
7464
  * https://github.com/chjj/term.js
@@ -7743,7 +7743,7 @@ slicc-surface:fullscreen {
7743
7743
  .xterm .xterm-scrollable-element > .shadow.top.left {
7744
7744
  box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
7745
7745
  }
7746
- `,lC={background:`#0c0c0e`,foreground:`#e7e7ea`,cursor:`#e7e7ea`,cursorAccent:`#0c0c0e`,selectionBackground:`#8b5cf64d`,selectionForeground:`#ffffff`,black:`#0c0c0e`,red:`#f43f5e`,green:`#5bd17b`,yellow:`#f59e0b`,blue:`#3b82f6`,magenta:`#8b5cf6`,cyan:`#06b6d4`,white:`#e7e7ea`,brightBlack:`#8a8a93`,brightRed:`#fb7185`,brightGreen:`#86efac`,brightYellow:`#fbbf24`,brightBlue:`#60a5fa`,brightMagenta:`#a78bfa`,brightCyan:`#22d3ee`,brightWhite:`#ffffff`},uC=`
7746
+ `,uC={background:`#0c0c0e`,foreground:`#e7e7ea`,cursor:`#e7e7ea`,cursorAccent:`#0c0c0e`,selectionBackground:`#8b5cf64d`,selectionForeground:`#ffffff`,black:`#0c0c0e`,red:`#f43f5e`,green:`#5bd17b`,yellow:`#f59e0b`,blue:`#3b82f6`,magenta:`#8b5cf6`,cyan:`#06b6d4`,white:`#e7e7ea`,brightBlack:`#8a8a93`,brightRed:`#fb7185`,brightGreen:`#86efac`,brightYellow:`#fbbf24`,brightBlue:`#60a5fa`,brightMagenta:`#a78bfa`,brightCyan:`#22d3ee`,brightWhite:`#ffffff`},dC=`
7747
7747
  :host {
7748
7748
  display: flex;
7749
7749
  flex-direction: column;
@@ -7784,7 +7784,7 @@ slicc-surface:fullscreen {
7784
7784
  /* xterm.js wants its container to size the canvas; let it fill. */
7785
7785
  .host .xterm { height: 100%; }
7786
7786
  .host .xterm-viewport { overflow-y: auto; }
7787
- `,dC=null;function fC(){return dC||=[R(cC),R(uC)],dC}var pC=class extends HTMLElement{static observedAttributes=[`label`,`hide-header`];#e;#t=null;#n=null;#r=null;#i=null;#a=[];#o=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`})}connectedCallback(){this.#o=!1,this.#s(),this.#c()}disconnectedCallback(){this.#l()}attributeChangedCallback(e){if(this.isConnected&&e===`label`){let e=this.#e.querySelector(`.title`);e&&(e.textContent=this.label)}}get label(){return this.getAttribute(`label`)??`Terminal`}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get hideHeader(){return this.hasAttribute(`hide-header`)}set hideHeader(e){this.toggleAttribute(`hide-header`,e)}get terminal(){return this.#n}write(e){this.#n?this.#n.write(e):this.#a.push(e)}writeln(e){this.#n?this.#n.writeln(e):this.#a.push(`${e}\r\n`)}clear(){this.#n?this.#n.clear():this.#a.length=0}focus(){this.#n?.focus()}fit(){this.#r?.fit()}#s(){if(this.#t)return;this.#e.adoptedStyleSheets=fC();let e=L(`div`,{class:`hd`,part:`header`},i(`terminal`,{size:14}),L(`span`,{class:`title`},this.label),L(`span`,{class:`spacer`})),t=L(`div`,{class:`host`,part:`host`});this.#e.replaceChildren(e,t),this.#t=t}async#c(){if(this.#n||this.#o)return;let[{Terminal:e},{FitAddon:n}]=await Promise.all([t(()=>import(`./xterm-C3BHN0de.js`),[]),t(()=>import(`./addon-fit-DIOBYJe3.js`),[])]);if(this.#o||!this.#t)return;let r=new e({cursorBlink:!mC(),fontSize:12,lineHeight:1.25,fontFamily:`'IBM Plex Mono', 'Source Code Pro', 'JetBrains Mono', ui-monospace, monospace`,theme:lC,convertEol:!0,scrollback:2e3}),i=new n;if(r.loadAddon(i),r.open(this.#t),r.onData(e=>{this.dispatchEvent(new CustomEvent(`terminal-data`,{detail:e,bubbles:!0,composed:!0}))}),this.#n=r,this.#r=i,i.fit(),this.#a.length){for(let e of this.#a)r.write(e);this.#a.length=0}typeof ResizeObserver==`function`&&(this.#i=new ResizeObserver(()=>this.#r?.fit()),this.#i.observe(this.#t))}#l(){this.#o=!0,this.#i?.disconnect(),this.#i=null,this.#n?.dispose(),this.#n=null,this.#r=null,this.#a.length=0}};function mC(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}I(`slicc-terminal`,pC);var hC=`slicc_monitor_collapsed`;function gC(){try{let e=localStorage.getItem(hC);return new Set(e?JSON.parse(e):[])}catch{return new Set}}function _C(e){try{localStorage.setItem(hC,JSON.stringify([...e]))}catch{}}var vC=`
7787
+ `,fC=null;function pC(){return fC||=[R(lC),R(dC)],fC}var mC=class extends HTMLElement{static observedAttributes=[`label`,`hide-header`];#e;#t=null;#n=null;#r=null;#i=null;#a=[];#o=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`})}connectedCallback(){this.#o=!1,this.#s(),this.#c()}disconnectedCallback(){this.#l()}attributeChangedCallback(e){if(this.isConnected&&e===`label`){let e=this.#e.querySelector(`.title`);e&&(e.textContent=this.label)}}get label(){return this.getAttribute(`label`)??`Terminal`}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get hideHeader(){return this.hasAttribute(`hide-header`)}set hideHeader(e){this.toggleAttribute(`hide-header`,e)}get terminal(){return this.#n}write(e){this.#n?this.#n.write(e):this.#a.push(e)}writeln(e){this.#n?this.#n.writeln(e):this.#a.push(`${e}\r\n`)}clear(){this.#n?this.#n.clear():this.#a.length=0}focus(){this.#n?.focus()}fit(){this.#r?.fit()}#s(){if(this.#t)return;this.#e.adoptedStyleSheets=pC();let e=L(`div`,{class:`hd`,part:`header`},i(`terminal`,{size:14}),L(`span`,{class:`title`},this.label),L(`span`,{class:`spacer`})),t=L(`div`,{class:`host`,part:`host`});this.#e.replaceChildren(e,t),this.#t=t}async#c(){if(this.#n||this.#o)return;let[{Terminal:e},{FitAddon:n}]=await Promise.all([t(()=>import(`./xterm-C3BHN0de.js`),[]),t(()=>import(`./addon-fit-DIOBYJe3.js`),[])]);if(this.#o||!this.#t)return;let r=new e({cursorBlink:!hC(),fontSize:12,lineHeight:1.25,fontFamily:`'IBM Plex Mono', 'Source Code Pro', 'JetBrains Mono', ui-monospace, monospace`,theme:uC,convertEol:!0,scrollback:2e3}),i=new n;if(r.loadAddon(i),r.open(this.#t),r.onData(e=>{this.dispatchEvent(new CustomEvent(`terminal-data`,{detail:e,bubbles:!0,composed:!0}))}),this.#n=r,this.#r=i,i.fit(),this.#a.length){for(let e of this.#a)r.write(e);this.#a.length=0}typeof ResizeObserver==`function`&&(this.#i=new ResizeObserver(()=>this.#r?.fit()),this.#i.observe(this.#t))}#l(){this.#o=!0,this.#i?.disconnect(),this.#i=null,this.#n?.dispose(),this.#n=null,this.#r=null,this.#a.length=0}};function hC(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}I(`slicc-terminal`,mC);var gC=`slicc_monitor_collapsed`;function _C(){try{let e=localStorage.getItem(gC);return new Set(e?JSON.parse(e):[])}catch{return new Set}}function vC(e){try{localStorage.setItem(gC,JSON.stringify([...e]))}catch{}}var yC=`
7788
7788
  slicc-monitor {
7789
7789
  display: block;
7790
7790
  box-sizing: border-box;
@@ -8361,7 +8361,7 @@ slicc-monitor {
8361
8361
  .monitor-row,
8362
8362
  .monitor-btn { transition-duration: 0.01ms; }
8363
8363
  }
8364
- `,yC=`slicc-monitor-style`;function bC(e){if(e.getElementById(yC))return;let t=e.createElement(`style`);t.id=yC,t.textContent=vC,(e.head??e.documentElement).appendChild(t)}var xC={error:3,warn:2,active:1,idle:0},SC={active:`circle-check`,warn:`triangle-alert`,error:`octagon-x`,idle:`circle`},CC={active:`Healthy`,warn:`Attention`,error:`Failing`,idle:`Idle`};function wC(e){return e.status?e.status:e.error?`error`:e.active?`active`:`idle`}function TC(e){if(e.status)return e.status;let t=`idle`;for(let n of e.rows){let e=wC(n);xC[e]>xC[t]&&(t=e)}return t}function EC(e){return L(`span`,{class:`monitor-glyph monitor-glyph--${e}`},i(SC[e],{size:14}))}var DC={rose:`var(--rose)`,cyan:`var(--cyan)`,violet:`var(--violet)`,amber:`var(--amber)`,waffle:`var(--waffle)`,green:`var(--green)`};function OC(e){return e?DC[e]:`var(--ctx)`}var kC=`http://www.w3.org/2000/svg`;function AC(e,t){let n=document.createElementNS(kC,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,String(r));return n}var jC=2,MC=jC/2,NC=4,PC=5;function FC(e,t,n){let r=e.points,i=r.map(e=>e.value),a=Math.min(...i),o=Math.max(...i)-a||1,s=t-MC,c=Math.max(0,t-2),l=r[r.length-1].at,u=e.windowMs>0?e.windowMs:1,d=l-r[0].at>0;return r.map((e,t)=>({x:d?Math.max(MC,s-Math.min(1,(l-e.at)/u)*c):MC+t/(r.length-1)*c,y:n-PC-(e.value-a)/o*(n-10)}))}function IC(e,t,n,r){let i=FC(e,n,r),a=i.map(e=>`${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(` `),o=i[i.length-1],s=i[0],c=AC(`svg`,{width:n,height:r,viewBox:`0 0 ${n} ${r}`,"aria-hidden":`true`});return c.append(AC(`polygon`,{points:`${a} ${o.x.toFixed(1)},${r} ${s.x.toFixed(1)},${r}`,fill:t,"fill-opacity":`0.1`}),AC(`polyline`,{points:a,fill:`none`,stroke:t,"stroke-width":String(jC),"stroke-linejoin":`round`,"stroke-linecap":`round`}),AC(`circle`,{cx:o.x.toFixed(1),cy:o.y.toFixed(1),r:String(NC),fill:t,stroke:`var(--canvas)`,"stroke-width":String(jC)})),c}var LC={hero:{w:300,h:56},tile:{w:132,h:34}};function RC(e,t,n,r){let i=L(`div`,{class:`monitor-tile__plot`}),a=0,o=r=>{let o=Math.round(r);o<=0||o===a||(a=o,i.replaceChildren(IC(e,t,o,n.h)))};if(o(n.w),typeof ResizeObserver==`function`){let e=new ResizeObserver(e=>{for(let t of e)o(t.contentRect.width)});e.observe(i),r.push(e)}return i}function zC(e,t){let n=OC(e.accent);return e.series&&e.series.points.length>1?RC(e.series,n,e.hero?LC.hero:LC.tile,t):typeof e.ratio==`number`?L(`div`,{class:`monitor-tile__plot`},L(`span`,{class:`monitor-meter`,style:`--monitor-hue:${n}`},L(`span`,{class:`monitor-meter__track`},HC(e.ratio)),WC(e.markers))):null}function BC(e){return Math.max(0,Math.min(1,e))}function VC(e){return`${(BC(e)*100).toFixed(1)}%`}function HC(e){return L(`span`,{class:`monitor-meter__fill`,style:`width:${VC(e)}`})}function UC(e){return e.label??`${Math.round(BC(e.ratio)*100)}%`}function WC(e){if(!e||e.length===0)return null;let t=[...e].sort((e,t)=>e.ratio-t.ratio);return L(`span`,{class:`monitor-meter__marks`,role:`img`,"aria-label":[...t].reverse().map(UC).join(`, `)},...t.map(e=>L(`span`,{class:`monitor-meter__mark`,"data-mark":e.id,style:`left:${VC(e.ratio)};--mark-color:${e.color}`,title:e.label??null,"aria-hidden":`true`})))}function GC(e,t){let n=L(`section`,{class:`monitor-tile${e.hero?` monitor-tile--hero`:``}`,"data-vital":e.id});return Ln(n,[L(`span`,{class:`monitor-tile__label`},e.label),L(`div`,{class:`monitor-tile__figure`},L(`span`,{class:`monitor-tile__value`},e.value),e.unit?L(`span`,{class:`monitor-tile__unit`},e.unit):null),e.delta?L(`span`,{class:`monitor-tile__delta`},e.delta):null,zC(e,t),e.foot?L(`span`,{class:`monitor-tile__foot`},e.foot):null]),n}function KC(e,t){return L(`div`,{class:`monitor-vitals`},...e.map(e=>GC(e,t)))}function qC(e){return L(`li`,{class:`monitor-alert`,"data-severity":e.severity,"data-alert":e.id},L(`span`,{class:`monitor-alert__icon monitor-glyph--${e.severity}`},i(e.icon??SC[e.severity===`error`?`error`:`warn`],{size:16})),L(`span`,{class:`monitor-alert__copy`},L(`span`,{class:`monitor-alert__title`},e.title),e.detail?L(`span`,{class:`monitor-alert__detail`},e.detail):null),e.age?L(`span`,{class:`monitor-alert__age`},e.age):null)}function JC(){return L(`div`,{class:`monitor-clear`,role:`status`},EC(`active`),L(`span`,{class:`monitor-clear__title`},`All clear`),L(`span`,{class:`monitor-clear__text`},`Nothing is stalled, expired, or failing.`))}function YC(e){let t=e.some(e=>e.severity===`error`)?`error`:e.length>0?`warn`:`ok`;return L(`section`,{class:`monitor-block`,"data-block":`attention`},L(`div`,{class:`monitor-block__head`},L(`h3`,{class:`monitor-block__title`},`Needs attention`),L(`span`,{class:`monitor-pill monitor-pill--${t}`},String(e.length))),e.length===0?JC():L(`ul`,{class:`monitor-alerts`},...e.map(qC)))}function XC(e){let t=wC(e),n=L(`span`,{class:`monitor-child__headline`},L(`span`,{class:`monitor-child__name`},e.name));for(let t of e.badges??[])n.appendChild(L(`span`,{class:`monitor-badge`},t));let r=L(`span`,{class:`monitor-child__copy`},n);return e.sublabel&&r.appendChild(L(`span`,{class:`monitor-child__sublabel`},e.sublabel)),L(`li`,{class:`monitor-child`,"data-status":t,style:`padding-left:${28+(e.depth??0)*18}px`},EC(t),r,L(`span`,{class:`monitor-child__meta`},e.meta))}function ZC(e){return L(`div`,{class:`monitor-empty`,role:`status`},L(`span`,{class:`monitor-empty__title`},`No ${e.label.toLocaleLowerCase()} yet`),L(`span`,{class:`monitor-empty__text`},e.emptyText??`${e.label} will appear here when available.`))}function QC(e,t,n,r,a){let o=TC(e),s=o===`warn`||o===`error`,c=n.has(e.id)?!0:!t.has(e.id)&&s&&e.rows.length>0,l=L(`ul`,{class:`monitor-children`,id:a});e.rows.length===0?l.replaceChildren(ZC(e)):l.append(...e.rows.map(XC)),c||l.setAttribute(`hidden`,``);let u=L(`button`,{class:`monitor-row`,type:`button`},L(`span`,{class:`monitor-row__chev`,"aria-hidden":`true`},i(c?`chevron-down`:`chevron-right`,{size:15})),L(`span`,{class:`monitor-row__icon`},i(e.icon??`box`,{size:16})),L(`span`,{class:`monitor-row__name`},e.label),L(`span`,{class:`monitor-row__summary`},e.meta??`${e.count}`),L(`span`,{class:`monitor-row__state monitor-glyph--${o}`},EC(o),CC[o]));return u.setAttribute(`aria-expanded`,String(c)),u.setAttribute(`aria-controls`,a),u.addEventListener(`click`,()=>r(e.id,c)),L(`div`,{class:`monitor-group`,"data-section":e.id,"data-status":o,"data-accent":e.accent??`neutral`},u,l)}var $C=[`pid`,`ppid`,`state`,`started`,`elapsed`,`scoop`,`command`],ew=new Set([`R`,`S`]);function tw(e,t){if(t===`state`)return L(`td`,{class:`monitor-td monitor-td--state`},L(`span`,{class:`monitor-statcell`},L(`span`,{class:`monitor-stat-tag monitor-stat-tag--${e.state}`},e.state),L(`span`,{class:`monitor-stat-word`},e.status)));let n=e[t];return L(`td`,{class:`monitor-td monitor-td--${t}`},n==null?`—`:String(n))}function nw(e){return L(`tr`,{class:`monitor-tr`,"data-pid":String(e.pid),"data-live":String(ew.has(e.state))},...$C.map(t=>tw(e,t)))}function rw(e,t,n){return[...e].sort((e,r)=>{let i=e[t],a=r[t],o=typeof i==`number`&&typeof a==`number`?i-a:String(i??``).localeCompare(String(a??``));return n?-o:o})}function iw(e,t){return L(`tr`,null,...$C.map(n=>{let r=e.sort===n,a=L(`th`,{class:`monitor-th monitor-td--${n}`,scope:`col`},L(`span`,{class:`monitor-th__label`},n.toUpperCase()),r?i(e.descending?`chevron-down`:`chevron-up`,{size:12}):null);return a.setAttribute(`aria-sort`,r?e.descending?`descending`:`ascending`:`none`),a.addEventListener(`click`,()=>{e.descending=e.sort===n&&!e.descending,e.sort=n,t()}),a}))}function aw(e,t){return!t||e.command.toLowerCase().includes(t)||(e.scoop??``).toLowerCase().includes(t)||String(e.pid).includes(t)}function ow(e){let t={sort:`pid`,descending:!1,query:``},n=L(`input`,{class:`monitor-input`,type:`search`,"aria-label":`Filter processes`,placeholder:`Filter command, scoop, or pid…`}),r=L(`thead`),i=L(`tbody`),a=L(`span`,{class:`monitor-block__hint`}),o=()=>{let n=rw(e.rows,t.sort,t.descending).filter(e=>aw(e,t.query));if(r.replaceChildren(iw(t,o)),n.length===0){let e=L(`td`,{class:`monitor-td monitor-empty-cell`,colspan:$C.length});e.textContent=t.query?`No live process matches “${t.query}”.`:`No processes running.`,i.replaceChildren(L(`tr`,{class:`monitor-tr`},e))}else i.replaceChildren(...n.map(nw));let s=e.terminated>0?` · ${e.terminated.toLocaleString()} exited this session`:``;a.replaceChildren(document.createTextNode(`${e.rows.length} live${s}`))};return n.addEventListener(`input`,()=>{t.query=n.value.trim().toLowerCase(),o()}),o(),L(`section`,{class:`monitor-block`,"data-block":`processes`},L(`div`,{class:`monitor-block__head`},L(`h3`,{class:`monitor-block__title`},`Processes`),a),L(`div`,{class:`monitor-toolbar`},n),L(`div`,{class:`monitor-tablewrap`},L(`table`,{class:`monitor-table`},r,i)))}function sw(e){return{...e,rows:e.rows.map(e=>({...e,badges:e.badges?.slice()}))}}var cw=0;I(`slicc-monitor`,class extends HTMLElement{#e={};#t=new Set;#n=new Set;#r=!1;#i=++cw;#a=[];connectedCallback(){bC(this.ownerDocument),this.#r||=(this.#t=gC(),!0),this.#u()}disconnectedCallback(){this.#o()}#o(){for(let e of this.#a)e.disconnect();this.#a=[]}get model(){return{...this.#e,vitals:this.#e.vitals?.map(e=>({...e,series:e.series?{...e.series,points:e.series.points.map(e=>({...e}))}:e.series,markers:e.markers?e.markers.map(e=>({...e})):e.markers})),alerts:this.#e.alerts?.map(e=>({...e})),sections:this.#e.sections?.map(sw),processes:this.#e.processes?{...this.#e.processes,rows:this.#e.processes.rows.map(e=>({...e}))}:this.#e.processes}}set model(e){this.#e=e??{},this.isConnected&&this.#u()}get sections(){return(this.#e.sections??[]).map(sw)}set sections(e){this.#e={...this.#e,sections:Array.isArray(e)?e.map(sw):[]},this.isConnected&&this.#u()}#s(){let e=L(`button`,{class:`monitor-btn`,type:`button`,"aria-label":`Re-sync monitor data`},i(`refresh-cw`,{size:14}),L(`span`,null,`Re-sync`));return e.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`slicc-monitor-refresh`,{bubbles:!0,composed:!0}))}),L(`header`,{class:`monitor-head`},L(`span`,{class:`monitor-head__mark`},i(`activity`,{size:18})),L(`div`,{class:`monitor-head__copy`},L(`h2`,{class:`monitor-head__title`},`Live monitor`),L(`p`,{class:`monitor-head__sub`},this.#e.updated??`Streaming`)),e)}#c(e){let t=L(`div`,{class:`monitor-groups`});for(let n of e){let e=n.id.replace(/[^a-z0-9_-]/gi,`-`);t.appendChild(QC(n,this.#t,this.#n,(e,t)=>this.#l(e,t),`monitor-${this.#i}-${e}`))}return L(`section`,{class:`monitor-block`,"data-block":`topology`},L(`div`,{class:`monitor-block__head`},L(`h3`,{class:`monitor-block__title`},`Topology`),L(`span`,{class:`monitor-block__hint`},`healthy groups stay collapsed`)),t)}#l(e,t){t?(this.#n.delete(e),this.#t.add(e)):(this.#t.delete(e),this.#n.add(e)),_C(this.#t),this.#u()}#u(){let{vitals:e=[],alerts:t,sections:n=[],processes:r}=this.#e;this.#o();let i=L(`div`,{class:`monitor`});Ln(i,[this.#s(),e.length>0?KC(e,this.#a):null,t?YC(t):null,n.length>0?this.#c(n):null,r?ow(r):null]),this.replaceChildren(i)}});var lw=e({BUDGET_CRITICAL_PERCENT:()=>95,BUDGET_WARN_PERCENT:()=>80,CHAT_SURFACE_ID:()=>Gf,DEFAULT_LAUNCHER_CORNER:()=>an,DEFAULT_LAUNCHER_FOLLOWER_STATUS:()=>cn,HOLD_TO_ENABLE_MS:()=>ji,LAUNCHER_FOLLOWER_STATUS_ATTR:()=>ln,LAYOUT_SCHEMA_VERSION:()=>1,MACHINE_WRITTEN_MEMORY_PATH:()=>MACHINE_WRITTEN_MEMORY_PATH,MEMORY_TITLE_MAX:()=>96,PANEL_MARKER_ATTR:()=>Fc,REDACTED_REAL_WORLD_MEMORY_PATH:()=>REDACTED_REAL_WORLD_MEMORY_PATH,SYNTHETIC_MEMORY_PATH:()=>SYNTHETIC_MEMORY_PATH,SliccImagePreview:()=>wi,TOKENS_CSS:()=>Mf,ensureGlobalTokens:()=>Pf,followSystemTheme:()=>If,setTheme:()=>Ff}),uw=`wcui-panel-host`,dw=`wcui-trusted-layer`,fw=[`.${uw}{position:absolute;inset:0;isolation:isolate;`,`display:flex;flex-direction:column;min-width:0;min-height:0;}`,`.${dw}{position:absolute;inset:0;pointer-events:none;`,`display:flex;flex-direction:column;}`,`.${dw}>*{pointer-events:auto;}`].join(``);function pw(e=document){let t=e.createElement(`div`);t.className=uw;let n=e.createElement(`div`);return n.className=dw,n.setAttribute(`data-slicc-trusted`,``),{panelHost:t,trustedLayer:n}}function mw(e,t=document){let n=t.querySelector(`.${dw}`);if(!n)throw Error(`trusted layer not found — approval chrome must not fall back to document.body (it would be occludable by a panel; see trusted-layer.ts)`);n.appendChild(e)}var hw=`auto`;function gw(e){if(e===null)return null;if(e===`auto`||e===`esc`)return e}var _w=`slicc-shortcuts-style`,vw=`
8364
+ `,bC=`slicc-monitor-style`;function xC(e){if(e.getElementById(bC))return;let t=e.createElement(`style`);t.id=bC,t.textContent=yC,(e.head??e.documentElement).appendChild(t)}var SC={error:3,warn:2,active:1,idle:0},CC={active:`circle-check`,warn:`triangle-alert`,error:`octagon-x`,idle:`circle`},wC={active:`Healthy`,warn:`Attention`,error:`Failing`,idle:`Idle`};function TC(e){return e.status?e.status:e.error?`error`:e.active?`active`:`idle`}function EC(e){if(e.status)return e.status;let t=`idle`;for(let n of e.rows){let e=TC(n);SC[e]>SC[t]&&(t=e)}return t}function DC(e){return L(`span`,{class:`monitor-glyph monitor-glyph--${e}`},i(CC[e],{size:14}))}var OC={rose:`var(--rose)`,cyan:`var(--cyan)`,violet:`var(--violet)`,amber:`var(--amber)`,waffle:`var(--waffle)`,green:`var(--green)`};function kC(e){return e?OC[e]:`var(--ctx)`}var AC=`http://www.w3.org/2000/svg`;function jC(e,t){let n=document.createElementNS(AC,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,String(r));return n}var MC=2,NC=MC/2,PC=4,FC=5;function IC(e,t,n){let r=e.points,i=r.map(e=>e.value),a=Math.min(...i),o=Math.max(...i)-a||1,s=t-NC,c=Math.max(0,t-2),l=r[r.length-1].at,u=e.windowMs>0?e.windowMs:1,d=l-r[0].at>0;return r.map((e,t)=>({x:d?Math.max(NC,s-Math.min(1,(l-e.at)/u)*c):NC+t/(r.length-1)*c,y:n-FC-(e.value-a)/o*(n-10)}))}function LC(e,t,n,r){let i=IC(e,n,r),a=i.map(e=>`${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(` `),o=i[i.length-1],s=i[0],c=jC(`svg`,{width:n,height:r,viewBox:`0 0 ${n} ${r}`,"aria-hidden":`true`});return c.append(jC(`polygon`,{points:`${a} ${o.x.toFixed(1)},${r} ${s.x.toFixed(1)},${r}`,fill:t,"fill-opacity":`0.1`}),jC(`polyline`,{points:a,fill:`none`,stroke:t,"stroke-width":String(MC),"stroke-linejoin":`round`,"stroke-linecap":`round`}),jC(`circle`,{cx:o.x.toFixed(1),cy:o.y.toFixed(1),r:String(PC),fill:t,stroke:`var(--canvas)`,"stroke-width":String(MC)})),c}var RC={hero:{w:300,h:56},tile:{w:132,h:34}};function zC(e,t,n,r){let i=L(`div`,{class:`monitor-tile__plot`}),a=0,o=r=>{let o=Math.round(r);o<=0||o===a||(a=o,i.replaceChildren(LC(e,t,o,n.h)))};if(o(n.w),typeof ResizeObserver==`function`){let e=new ResizeObserver(e=>{for(let t of e)o(t.contentRect.width)});e.observe(i),r.push(e)}return i}function BC(e,t){let n=kC(e.accent);return e.series&&e.series.points.length>1?zC(e.series,n,e.hero?RC.hero:RC.tile,t):typeof e.ratio==`number`?L(`div`,{class:`monitor-tile__plot`},L(`span`,{class:`monitor-meter`,style:`--monitor-hue:${n}`},L(`span`,{class:`monitor-meter__track`},UC(e.ratio)),GC(e.markers))):null}function VC(e){return Math.max(0,Math.min(1,e))}function HC(e){return`${(VC(e)*100).toFixed(1)}%`}function UC(e){return L(`span`,{class:`monitor-meter__fill`,style:`width:${HC(e)}`})}function WC(e){return e.label??`${Math.round(VC(e.ratio)*100)}%`}function GC(e){if(!e||e.length===0)return null;let t=[...e].sort((e,t)=>e.ratio-t.ratio);return L(`span`,{class:`monitor-meter__marks`,role:`img`,"aria-label":[...t].reverse().map(WC).join(`, `)},...t.map(e=>L(`span`,{class:`monitor-meter__mark`,"data-mark":e.id,style:`left:${HC(e.ratio)};--mark-color:${e.color}`,title:e.label??null,"aria-hidden":`true`})))}function KC(e,t){let n=L(`section`,{class:`monitor-tile${e.hero?` monitor-tile--hero`:``}`,"data-vital":e.id});return Rn(n,[L(`span`,{class:`monitor-tile__label`},e.label),L(`div`,{class:`monitor-tile__figure`},L(`span`,{class:`monitor-tile__value`},e.value),e.unit?L(`span`,{class:`monitor-tile__unit`},e.unit):null),e.delta?L(`span`,{class:`monitor-tile__delta`},e.delta):null,BC(e,t),e.foot?L(`span`,{class:`monitor-tile__foot`},e.foot):null]),n}function qC(e,t){return L(`div`,{class:`monitor-vitals`},...e.map(e=>KC(e,t)))}function JC(e){return L(`li`,{class:`monitor-alert`,"data-severity":e.severity,"data-alert":e.id},L(`span`,{class:`monitor-alert__icon monitor-glyph--${e.severity}`},i(e.icon??CC[e.severity===`error`?`error`:`warn`],{size:16})),L(`span`,{class:`monitor-alert__copy`},L(`span`,{class:`monitor-alert__title`},e.title),e.detail?L(`span`,{class:`monitor-alert__detail`},e.detail):null),e.age?L(`span`,{class:`monitor-alert__age`},e.age):null)}function YC(){return L(`div`,{class:`monitor-clear`,role:`status`},DC(`active`),L(`span`,{class:`monitor-clear__title`},`All clear`),L(`span`,{class:`monitor-clear__text`},`Nothing is stalled, expired, or failing.`))}function XC(e){let t=e.some(e=>e.severity===`error`)?`error`:e.length>0?`warn`:`ok`;return L(`section`,{class:`monitor-block`,"data-block":`attention`},L(`div`,{class:`monitor-block__head`},L(`h3`,{class:`monitor-block__title`},`Needs attention`),L(`span`,{class:`monitor-pill monitor-pill--${t}`},String(e.length))),e.length===0?YC():L(`ul`,{class:`monitor-alerts`},...e.map(JC)))}function ZC(e){let t=TC(e),n=L(`span`,{class:`monitor-child__headline`},L(`span`,{class:`monitor-child__name`},e.name));for(let t of e.badges??[])n.appendChild(L(`span`,{class:`monitor-badge`},t));let r=L(`span`,{class:`monitor-child__copy`},n);return e.sublabel&&r.appendChild(L(`span`,{class:`monitor-child__sublabel`},e.sublabel)),L(`li`,{class:`monitor-child`,"data-status":t,style:`padding-left:${28+(e.depth??0)*18}px`},DC(t),r,L(`span`,{class:`monitor-child__meta`},e.meta))}function QC(e){return L(`div`,{class:`monitor-empty`,role:`status`},L(`span`,{class:`monitor-empty__title`},`No ${e.label.toLocaleLowerCase()} yet`),L(`span`,{class:`monitor-empty__text`},e.emptyText??`${e.label} will appear here when available.`))}function $C(e,t,n,r,a){let o=EC(e),s=o===`warn`||o===`error`,c=n.has(e.id)?!0:!t.has(e.id)&&s&&e.rows.length>0,l=L(`ul`,{class:`monitor-children`,id:a});e.rows.length===0?l.replaceChildren(QC(e)):l.append(...e.rows.map(ZC)),c||l.setAttribute(`hidden`,``);let u=L(`button`,{class:`monitor-row`,type:`button`},L(`span`,{class:`monitor-row__chev`,"aria-hidden":`true`},i(c?`chevron-down`:`chevron-right`,{size:15})),L(`span`,{class:`monitor-row__icon`},i(e.icon??`box`,{size:16})),L(`span`,{class:`monitor-row__name`},e.label),L(`span`,{class:`monitor-row__summary`},e.meta??`${e.count}`),L(`span`,{class:`monitor-row__state monitor-glyph--${o}`},DC(o),wC[o]));return u.setAttribute(`aria-expanded`,String(c)),u.setAttribute(`aria-controls`,a),u.addEventListener(`click`,()=>r(e.id,c)),L(`div`,{class:`monitor-group`,"data-section":e.id,"data-status":o,"data-accent":e.accent??`neutral`},u,l)}var ew=[`pid`,`ppid`,`state`,`started`,`elapsed`,`scoop`,`command`],tw=new Set([`R`,`S`]);function nw(e,t){if(t===`state`)return L(`td`,{class:`monitor-td monitor-td--state`},L(`span`,{class:`monitor-statcell`},L(`span`,{class:`monitor-stat-tag monitor-stat-tag--${e.state}`},e.state),L(`span`,{class:`monitor-stat-word`},e.status)));let n=e[t];return L(`td`,{class:`monitor-td monitor-td--${t}`},n==null?`—`:String(n))}function rw(e){return L(`tr`,{class:`monitor-tr`,"data-pid":String(e.pid),"data-live":String(tw.has(e.state))},...ew.map(t=>nw(e,t)))}function iw(e,t,n){return[...e].sort((e,r)=>{let i=e[t],a=r[t],o=typeof i==`number`&&typeof a==`number`?i-a:String(i??``).localeCompare(String(a??``));return n?-o:o})}function aw(e,t){return L(`tr`,null,...ew.map(n=>{let r=e.sort===n,a=L(`th`,{class:`monitor-th monitor-td--${n}`,scope:`col`},L(`span`,{class:`monitor-th__label`},n.toUpperCase()),r?i(e.descending?`chevron-down`:`chevron-up`,{size:12}):null);return a.setAttribute(`aria-sort`,r?e.descending?`descending`:`ascending`:`none`),a.addEventListener(`click`,()=>{e.descending=e.sort===n&&!e.descending,e.sort=n,t()}),a}))}function ow(e,t){return!t||e.command.toLowerCase().includes(t)||(e.scoop??``).toLowerCase().includes(t)||String(e.pid).includes(t)}function sw(e){let t={sort:`pid`,descending:!1,query:``},n=L(`input`,{class:`monitor-input`,type:`search`,"aria-label":`Filter processes`,placeholder:`Filter command, scoop, or pid…`}),r=L(`thead`),i=L(`tbody`),a=L(`span`,{class:`monitor-block__hint`}),o=()=>{let n=iw(e.rows,t.sort,t.descending).filter(e=>ow(e,t.query));if(r.replaceChildren(aw(t,o)),n.length===0){let e=L(`td`,{class:`monitor-td monitor-empty-cell`,colspan:ew.length});e.textContent=t.query?`No live process matches “${t.query}”.`:`No processes running.`,i.replaceChildren(L(`tr`,{class:`monitor-tr`},e))}else i.replaceChildren(...n.map(rw));let s=e.terminated>0?` · ${e.terminated.toLocaleString()} exited this session`:``;a.replaceChildren(document.createTextNode(`${e.rows.length} live${s}`))};return n.addEventListener(`input`,()=>{t.query=n.value.trim().toLowerCase(),o()}),o(),L(`section`,{class:`monitor-block`,"data-block":`processes`},L(`div`,{class:`monitor-block__head`},L(`h3`,{class:`monitor-block__title`},`Processes`),a),L(`div`,{class:`monitor-toolbar`},n),L(`div`,{class:`monitor-tablewrap`},L(`table`,{class:`monitor-table`},r,i)))}function cw(e){return{...e,rows:e.rows.map(e=>({...e,badges:e.badges?.slice()}))}}var lw=0;I(`slicc-monitor`,class extends HTMLElement{#e={};#t=new Set;#n=new Set;#r=!1;#i=++lw;#a=[];connectedCallback(){xC(this.ownerDocument),this.#r||=(this.#t=_C(),!0),this.#u()}disconnectedCallback(){this.#o()}#o(){for(let e of this.#a)e.disconnect();this.#a=[]}get model(){return{...this.#e,vitals:this.#e.vitals?.map(e=>({...e,series:e.series?{...e.series,points:e.series.points.map(e=>({...e}))}:e.series,markers:e.markers?e.markers.map(e=>({...e})):e.markers})),alerts:this.#e.alerts?.map(e=>({...e})),sections:this.#e.sections?.map(cw),processes:this.#e.processes?{...this.#e.processes,rows:this.#e.processes.rows.map(e=>({...e}))}:this.#e.processes}}set model(e){this.#e=e??{},this.isConnected&&this.#u()}get sections(){return(this.#e.sections??[]).map(cw)}set sections(e){this.#e={...this.#e,sections:Array.isArray(e)?e.map(cw):[]},this.isConnected&&this.#u()}#s(){let e=L(`button`,{class:`monitor-btn`,type:`button`,"aria-label":`Re-sync monitor data`},i(`refresh-cw`,{size:14}),L(`span`,null,`Re-sync`));return e.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`slicc-monitor-refresh`,{bubbles:!0,composed:!0}))}),L(`header`,{class:`monitor-head`},L(`span`,{class:`monitor-head__mark`},i(`activity`,{size:18})),L(`div`,{class:`monitor-head__copy`},L(`h2`,{class:`monitor-head__title`},`Live monitor`),L(`p`,{class:`monitor-head__sub`},this.#e.updated??`Streaming`)),e)}#c(e){let t=L(`div`,{class:`monitor-groups`});for(let n of e){let e=n.id.replace(/[^a-z0-9_-]/gi,`-`);t.appendChild($C(n,this.#t,this.#n,(e,t)=>this.#l(e,t),`monitor-${this.#i}-${e}`))}return L(`section`,{class:`monitor-block`,"data-block":`topology`},L(`div`,{class:`monitor-block__head`},L(`h3`,{class:`monitor-block__title`},`Topology`),L(`span`,{class:`monitor-block__hint`},`healthy groups stay collapsed`)),t)}#l(e,t){t?(this.#n.delete(e),this.#t.add(e)):(this.#t.delete(e),this.#n.add(e)),vC(this.#t),this.#u()}#u(){let{vitals:e=[],alerts:t,sections:n=[],processes:r}=this.#e;this.#o();let i=L(`div`,{class:`monitor`});Rn(i,[this.#s(),e.length>0?qC(e,this.#a):null,t?XC(t):null,n.length>0?this.#c(n):null,r?sw(r):null]),this.replaceChildren(i)}});var uw=e({BUDGET_CRITICAL_PERCENT:()=>95,BUDGET_WARN_PERCENT:()=>80,CHAT_SURFACE_ID:()=>Kf,DEFAULT_LAUNCHER_CORNER:()=>sn,DEFAULT_LAUNCHER_FOLLOWER_STATUS:()=>un,HOLD_TO_ENABLE_MS:()=>Mi,LAUNCHER_FOLLOWER_STATUS_ATTR:()=>F,LAYOUT_SCHEMA_VERSION:()=>1,MACHINE_WRITTEN_MEMORY_PATH:()=>MACHINE_WRITTEN_MEMORY_PATH,MEMORY_TITLE_MAX:()=>96,PANEL_MARKER_ATTR:()=>Ic,REDACTED_REAL_WORLD_MEMORY_PATH:()=>REDACTED_REAL_WORLD_MEMORY_PATH,SYNTHETIC_MEMORY_PATH:()=>SYNTHETIC_MEMORY_PATH,SliccImagePreview:()=>Ti,TOKENS_CSS:()=>Nf,ensureGlobalTokens:()=>Ff,followSystemTheme:()=>Lf,setTheme:()=>If}),dw=`wcui-panel-host`,fw=`wcui-trusted-layer`,pw=[`.${dw}{position:absolute;inset:0;isolation:isolate;`,`display:flex;flex-direction:column;min-width:0;min-height:0;}`,`.${fw}{position:absolute;inset:0;pointer-events:none;`,`display:flex;flex-direction:column;}`,`.${fw}>*{pointer-events:auto;}`].join(``);function mw(e=document){let t=e.createElement(`div`);t.className=dw;let n=e.createElement(`div`);return n.className=fw,n.setAttribute(`data-slicc-trusted`,``),{panelHost:t,trustedLayer:n}}function hw(e,t=document){let n=t.querySelector(`.${fw}`);if(!n)throw Error(`trusted layer not found — approval chrome must not fall back to document.body (it would be occludable by a panel; see trusted-layer.ts)`);n.appendChild(e)}var gw=`auto`;function _w(e){if(e===null)return null;if(e===`auto`||e===`esc`)return e}var vw=`slicc-shortcuts-style`,yw=`
8365
8365
  /* The sheet grows a column at a time as the viewport allows, and the dialog
8366
8366
  grows with it — one alphabetical column of thirty-odd rows is a reference
8367
8367
  you read; three short labelled ones are a cheat sheet you scan. Capped at
@@ -8401,4 +8401,4 @@ slicc-dialog.wcsc-dialog::part(dialog){width:min(460px,92vw);}
8401
8401
  .wcsc__group--yours .wcsc__title{color:color-mix(in srgb,var(--ctx) 55%,var(--ink));}
8402
8402
  .wcsc__group--yours .wcsc__row{border-bottom-color:color-mix(in srgb,var(--ctx) 16%,var(--line));}
8403
8403
  .wcsc__count{font:500 10.5px/1 var(--ui);color:var(--txt-3);flex:0 0 auto;}
8404
- `;function yw(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.tagName==`string`?t.tagName.toUpperCase():``;if(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable===!0)return!0;let r=t.closest?.(`[contenteditable]`);return!!r&&r.getAttribute(`contenteditable`)!==`false`}function bw(e){return(typeof e.composedPath==`function`?e.composedPath():[])[0]??e.target}function xw(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function Sw(e,t){if(!e||!t)return!1;let n=t;for(;n;){if(n===e)return!0;if(typeof ShadowRoot<`u`&&n instanceof ShadowRoot){n=n.host;continue}let t=n.parentNode;if(t){n=t;continue}let r=n.assignedSlot;if(r){n=r;continue}break}return!1}function Cw(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.tagName==`string`?t.tagName.toUpperCase():``;return n===`IFRAME`||n===`FRAME`||n===`OBJECT`||n===`EMBED`}function ww(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.tagName==`string`?t.tagName.toUpperCase():``;if(n===`BUTTON`||n===`SUMMARY`||n===`OPTION`||n===`A`&&t.hasAttribute?.(`href`)===!0)return!0;let r=t.getAttribute?.(`role`)??``;return[`button`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`tab`,`switch`,`checkbox`,`radio`].includes(r)}function Tw(e){return!!e.querySelector(`slicc-quick-look, slicc-dialog[open], slicc-tab-overlay[open], .slicc-permissions__prompt[data-open]`)}function Ew(e){let t=/^Digit([1-9])$/.exec(e.code??``);return t?Number(t[1]):/^[1-9]$/.test(e.key)?Number(e.key):null}function Dw(e,t){if(e<=0)return null;let n=t===9?e-1:t-1;return n<e?n:null}function Ow(e,t){let n=Dw(e.length,t);return n===null?null:e[n]??null}function kw(e,t){return Ow(e.map(e=>e.key),t)}function Aw(e,t){return e.length===0?null:e[((t===null?-1:e.indexOf(t))+1)%e.length]??null}function jw(e,t){if(e.length===0)return null;let n=t===null?-1:e.indexOf(t);return e[((n===-1?0:n)-1+e.length)%e.length]??null}function Mw(e){return e.items.filter(e=>e.kind===`sprinkle`).map(e=>e.id)}var Nw=[`Getting around`,`Agents`,`The turn`,`Panels`,`Settings`];function Pw(e,t){if(e!==`sprinkles`)return t.lists?.[e]??null;let n=t.dock;return n?{size:()=>Mw(n).length,selectAt:e=>{let t=Mw(n)[e];t&&n.selectItem(t)}}:null}function Fw(e,t,n){return{holdsMode:!!n,description:t,group:`Panels`,surfaceId:e,...n?{list:n}:{},run:({deps:t,state:n})=>{n.lastDockSurface=e,t.dock?.selectItem(e)}}}function Iw(e,t){return{holdsMode:!1,description:t,group:`Agents`,run:({deps:t})=>{t.freezer?.dispatchEvent(new CustomEvent(e,{bubbles:!0}))}}}var Lw={nextAgent:{holdsMode:!0,group:`Agents`,description:`Next agent, looping`,run:({deps:e})=>{let t=Aw(e.switcher.scoops.map(e=>e.key),e.switcher.active);t&&e.switcher.select(t)}},prevAgent:{holdsMode:!0,group:`Agents`,description:`Previous agent, looping`,run:({deps:e})=>{let t=jw(e.switcher.scoops.map(e=>e.key),e.switcher.active);t&&e.switcher.select(t)}},composer:{holdsMode:!1,group:`Getting around`,description:`Back to the composer`,run:({deps:e})=>e.focusComposer?.()},stop:{holdsMode:!0,group:`The turn`,description:`Stop the running turn`,run:({deps:e})=>e.stopTurn?.()},approvals:{holdsMode:!0,group:`The turn`,description:`Go to the pending approval`,run:({deps:e})=>e.focusApproval?.()},attach:{holdsMode:!1,group:`The turn`,description:`Attach a file or skill`,run:({deps:e})=>e.openAttachMenu?.()},copyReply:{holdsMode:!0,group:`The turn`,description:`Copy the last reply`,run:({deps:e})=>e.copyReply?.()},copyChat:{holdsMode:!0,group:`The turn`,description:`Copy the whole chat`,run:({deps:e})=>e.copyChat?.()},voice:{holdsMode:!0,group:`The turn`,description:`Dictate — again to send`,run:({deps:e})=>e.toggleVoice?.()},nextItem:{holdsMode:!0,group:`Getting around`,description:`Next message — or, after a list key, the next entry`,run:e=>hT(e,1)},prevItem:{holdsMode:!0,group:`Getting around`,description:`Previous message — or the previous entry`,run:e=>hT(e,-1)},newConversation:{holdsMode:!1,group:`Agents`,description:`New conversation`,run:({deps:e})=>{e.freezer?.dispatchEvent(new CustomEvent(`new-chat-save`,{bubbles:!0}))}},newConversationErase:Iw(`new-chat-erase`,`New conversation, erasing this one`),newCone:Iw(`new-cone`,`New cone`),dropCone:Iw(`drop-cone`,`Drop this cone`),sessions:{holdsMode:!0,group:`Agents`,description:`Archived chats (with 1-9 / j / k: restore that one)`,list:`sessions`,run:({deps:e})=>e.freezer?.toggle(!0)},leftRail:{holdsMode:!0,group:`Getting around`,description:`Toggle the left rail`,run:({deps:e})=>e.freezer?.toggle()},rightRail:{holdsMode:!0,group:`Getting around`,description:`Toggle the right panel`,run:({deps:e,state:t})=>{let n=e.dock;if(n){if(n.active){t.lastDockSurface=n.active,n.collapse();return}n.selectItem(t.lastDockSurface)}}},files:Fw(`files`,`File browser (with 1-9 / j / k: open that row)`,`files`),tabs:Fw(`browser`,`Browser tabs (then 1-9 to switch)`),peek:{holdsMode:!0,group:`Panels`,description:`Peek a tab (then 1-9: show it and come back)`,run:({deps:e})=>e.peekTabs?.()},terminal:Fw(`term`,`Terminal`),memory:Fw(`memory`,`Memory (with 1-9 / j / k: open that entry)`,`memory`),monitor:Fw(`monitor`,`Monitor`),sprinkles:{holdsMode:!0,group:`Panels`,description:`Sprinkles (with 1-9 / j / k: open that one)`,list:`sprinkles`,run:({deps:e,state:t})=>{let n=e.dock;if(!n)return;let r=Mw(n);if(r.length!==0)return t.lastDockSurface=r[0],n.selectItem(r[0]),0}},zoom:{holdsMode:!0,group:`Getting around`,description:`Full screen the open panel`,run:({deps:e})=>e.zoomSurface?.()},model:{holdsMode:!1,group:`Settings`,description:`Model picker`,run:({deps:e,actions:t})=>{let n=e.composerMeta;if(n){if(n.models.length===0){t.accounts?.();return}n.openMenu()}}},cycleModel:{holdsMode:!0,group:`Settings`,description:`Next model`,run:({deps:e,actions:t})=>{let n=e.composerMeta;if(n){if(n.models.length===0){t.accounts?.();return}n.cycleModel?.()}}},cycleThinking:{holdsMode:!0,group:`Settings`,description:`Next thinking level`,run:({deps:e})=>e.composerMeta?.cycleThinking?.()},accounts:{holdsMode:!1,group:`Settings`,description:`Accounts`,run:({actions:e})=>e.accounts?.()},help:{holdsMode:!0,group:`Getting around`,description:`This help`,run:e=>e.toggleHelp()}},Rw=Object.keys(Lw);function zw(e){return typeof e==`string`&&Object.hasOwn(Lw,e)}function Bw(e){return Lw[e].surfaceId??null}function Vw(e){return Rw.find(t=>Lw[t].surfaceId===e)??null}var Hw=[`Escape`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],Uw={i:`composer`,Enter:`composer`,"?":`help`,ArrowRight:`nextAgent`,ArrowLeft:`prevAgent`,n:`newConversation`,N:`newConversationErase`,c:`newCone`,C:`dropCone`,r:`sessions`,s:`stop`,a:`approvals`,u:`attach`,y:`copyReply`,Y:`copyChat`,v:`voice`,j:`nextItem`,k:`prevItem`,f:`files`,t:`terminal`,b:`tabs`,m:`memory`,g:`monitor`,e:`sprinkles`,p:`peek`,"[":`leftRail`,"]":`rightRail`,z:`zoom`,l:`model`,L:`cycleModel`,h:`cycleThinking`,",":`accounts`},Ww={d:`nextAgent`,c:`composer`,Enter:`composer`,n:`newConversation`,b:`leftRail`,x:`rightRail`,f:`files`,t:`tabs`,e:`terminal`,m:`memory`,s:`sprinkles`,l:`model`,a:`accounts`,h:`help`,"?":`help`,"/":`help`};function Gw(e){return aT[e]??e}function Kw(e,t){let n=Object.keys(e).find(n=>e[n]===t);return n===void 0?null:Gw(n)}function qw(e){return Kw(e,`help`)}function Jw(e){let t=qw(e),n=Object.keys(e).filter(t=>e[t]===`composer`).map(e=>`[${Gw(e)}]`);return[t===null?null:`[${t}] help`,n.length===0?null:`${n.join(` or `)} to type`].filter(e=>e!==null).join(` · `)}function Yw(e=Uw){let t=new Map;for(let[n,r]of Object.entries(e))t.set(r,[...t.get(r)??[],Gw(n)]);return[{keys:[`Esc`],description:`Leave the composer for keyboard mode (again: exit full screen)`,group:`Getting around`},{keys:[`1 – 9`],description:`Switch to that agent in the tab strip (9 = last)`,group:`Agents`},...Rw.filter(e=>t.has(e)).map(e=>({keys:t.get(e)??[],description:Lw[e].description,group:Lw[e].group,id:e}))]}function Xw(e){if(e.getElementById(_w))return;let t=e.createElement(`style`);t.id=_w,t.textContent=vw,(e.head??e.documentElement)?.append(t)}var Zw=5;function Qw(e,t){let n=e.createElement(`div`);n.className=`wcsc__keys`;for(let r of t.keys){let t=e.createElement(`kbd`);t.className=`wcsc__key`,t.textContent=r,n.append(t)}return n}function $w(e,t,n=!1){let r=e.createElement(`div`);r.className=`wcsc__row`,t.count>0&&(r.dataset.used=String(t.count));let i=e.createElement(`div`);if(i.className=`wcsc__desc`,i.textContent=t.description,r.append(i),n){let n=e.createElement(`div`);n.className=`wcsc__count`,n.textContent=`×${t.count}`,r.append(n)}return r.append(Qw(e,t)),r}function eT(e,t,n){let r=e.createElement(`div`);r.className=`wcsc__group`;let i=e.createElement(`div`);i.className=`wcsc__title`,i.textContent=t,r.append(i);for(let t of n)r.append($w(e,t));return r}function tT(e,t){let n=t.filter(e=>e.count>0).sort((e,t)=>t.count-e.count).slice(0,Zw);if(n.length===0)return null;let r=e.createElement(`div`);r.className=`wcsc__group wcsc__group--yours`;let i=e.createElement(`div`);i.className=`wcsc__title`,i.textContent=`Your frequent actions`,r.append(i);for(let t of n)r.append($w(e,t,!0));return r}function nT(e,t,n,r){let i=e.createElement(`div`);i.className=`wcsc`;let a=e.createElement(`div`);a.className=`wcsc__note`,a.textContent=n===null?`Keyboard mode is off. Turn it on in Theme settings (Esc or Auto).`:n===`esc`?`Press Esc to enter keyboard mode. Put the caret back in the composer to type — nothing is intercepted there.`:`Keyboard mode is on whenever nothing is focused for typing (and you are not clicking composer chrome), so these keys are live by default. Put the caret back in the composer to type — nothing is intercepted there.`,i.append(a);let o=new Map((r?.ranked()??[]).map(e=>[e.id,e.count])),s=t.map(e=>({...e,count:(e.id===void 0?void 0:o.get(e.id))??0})),c=e.createElement(`div`);c.className=`wcsc__cols`;let l=tT(e,s);l&&c.append(l);for(let t of Nw){let n=s.filter(e=>e.group===t);n.length>0&&c.append(eT(e,t,n))}return i.append(c),i}var rT=1600,iT=rT,aT={Escape:`Esc`,Enter:`⏎`," ":`Space`,Tab:`⇥`,Backspace:`⌫`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`};function oT(e){let t=[];return e.ctrlKey&&t.push(`⌃`),e.altKey&&t.push(`⌥`),e.metaKey&&t.push(`⌘`),e.shiftKey&&e.key.length>1&&t.push(`⇧`),t.push(aT[e.key]??e.key),t}function sT(e,t,n){let r=e.createElement(`slicc-key-hud`);return r.dataset.wcShortcuts=`hud`,r.setAttribute(`hint`,Jw(n)),r.setAttribute(`linger`,String(rT)),t.append(r),{record:(e,t)=>r.record?.(e,t),destroy:()=>r.remove()}}function cT(e,t,n,r){let i=null,a=()=>{if(!i)return;let e=i;i=null,e.hide?.(),e.remove()},o=()=>{if(i)return;Xw(e);let a=e.createElement(`slicc-dialog`);a.className=`wcsc-dialog`,a.setAttribute(`heading`,`Keyboard mode`),a.dataset.wcShortcuts=`help`,a.append(nT(e,Yw(t()),n(),r)),a.addEventListener(`slicc-dialog-close`,()=>{i=null,a.remove()}),e.body.append(a),i=a,a.show?.()};return{show:o,hide:a,toggle:()=>i?a():o(),element:()=>i}}function lT(e){let t=e.defaultView?.navigator?.keyboard;t&&(e.fullscreenElement?t.lock([`Escape`]).catch(()=>void 0):t.unlock())}function uT(e,t,n,r,i){let a=!1,o=null;return{on:()=>a,record:(e,t)=>o?.record(e,t),set:s=>{if(s===a)return;if(a=s,e.documentElement.toggleAttribute(`data-slicc-keyboard-mode`,s),i(s),!s){o?.destroy(),o=null,r?.hide();return}Xw(e),o=sT(e,n(),t()),r?.show(t());let c=e.activeElement;yw(c)&&c?.blur()}}}function dT(e){if(e.ctrlKey||e.metaKey||e.altKey)return!0;let t=bw(e);return yw(t)?!0:(e.key===`Enter`||e.key===` `)&&ww(t)}function fT(e,t,n,r,i){if(e===null){r.set(!1),n&&t&&i(`composer`);return}if(e===`esc`){t&&(r.set(!1),n&&i(`composer`));return}r.set(!t),n&&i(t?`composer`:`keyboard`)}function pT(e,t,n,r,i){let a=e.defaultView,o=a?.setTimeout.bind(a)??setTimeout,s=a?.clearTimeout.bind(a)??clearTimeout,c=n.composerAvailable??(()=>!!n.focusComposer),l,u=`composer`,d=!1,f=null,p=null,m=()=>{p?.disconnect(),p=null,f=null},h=t=>{if(f===t)return;m();let n=a?.MutationObserver??globalThis.MutationObserver;n&&(f=t,p=new n(()=>{t.isConnected||(m(),v())}),p.observe(e.documentElement,{childList:!0,subtree:!0}))},g=()=>{d||=t.on(),t.set(!1)},_=()=>{if(Tw(e)||typeof e.hasFocus==`function`&&!e.hasFocus())return;let a=xw(e);if(Cw(a)){h(a),g();return}m();let o=yw(a)||Sw(n.composerBand,a)||!!i?.();d&&(d=!1,!o&&r()===`esc`&&t.set(!0)),fT(r(),o,c(),t,e=>{u=e})},v=()=>{l===void 0&&(l=o(()=>{l=void 0,_()},0))};return{schedule:v,restore:()=>{if(Tw(e))return;let i=r();u===`composer`&&c()?(t.set(!1),n.focusComposer?.()):i===null?t.set(!1):t.set(!0),v()},choose:e=>{u=e},suspend:g,dropSuspension:()=>{d=!1},intent:()=>u,dispose:()=>{l!==void 0&&s(l),l=void 0,m()}}}function mT(e,t,n){let r=e.nodeType===1?e:null,i=t.defaultView?.MutationObserver??globalThis.MutationObserver;if(!r||!i)return()=>void 0;let a=e.active,o=new i(()=>{let t=e.active;t!==a&&(a=t,n())});return o.observe(r,{attributes:!0,attributeFilter:[`active`]}),()=>o.disconnect()}function hT(e,t){let n=e.armed;if(!n){e.deps.scrollMessage?.(t);return}let r=Pw(n.list,e.deps),i=r?.size()??0;if(!r||i===0)return;let a=n.index===null?t>0?0:i-1:(n.index+t+i)%i;return r.selectAt(a),a}function gT(e,t,n){let r=Pw(t,e),i=r?Dw(r.size(),n):null;return i===null||!r?null:(r.selectAt(i),i)}function _T(e,t,n,r,i){n.preventDefault(),i.deps.usage?.record?.(t),e.holdsMode||i.mode.set(!1);let a=e.run({deps:i.deps,actions:i.actions,state:i.state,toggleHelp:i.toggleHelp,armed:r}),o=e.list??(typeof a==`number`?r?.list:void 0);o&&i.chord.arm(o,typeof a==`number`?a:null),e.holdsMode||i.settler.schedule()}function vT(e,t,n,r,i){if(Tw(t))return;if(!n.on()){if(i===null)return;e.preventDefault(),n.set(!0),r.choose(`keyboard`),n.record(oT(e),!0);return}let a=!!t.fullscreenElement;n.record(oT(e),a),a&&t.exitFullscreen?.().catch(()=>void 0)}function yT(e,t,n){return Tw(e)&&!(t===Lw.help&&n)}function bT(e,t,n){if(t){let r=gT(e,t.list,n);return{hit:r!==null,index:r}}let r=kw(e.switcher.scoops,n);return r!==null&&e.switcher.select(r),{hit:r!==null,index:null}}function xT(e){let t=e.defaultView,n=t?.setTimeout.bind(t)??setTimeout,r=t?.clearTimeout.bind(t)??clearTimeout,i=null,a=()=>{i&&=(r(i.timer),null)};return{take:()=>{if(!i)return null;let{list:e,index:t}=i;return a(),{list:e,index:t}},arm:(e,t)=>{a(),i={list:e,index:t,timer:n(a,iT)}},clear:a}}var ST=new WeakMap;function CT(e,t){if(e.defaultPrevented||e.isComposing)return;if(e.key===`Escape`){t.chord.clear(),vT(e,t.doc,t.mode,t.settler,t.trigger);return}if(!t.mode.on()||dT(e))return;let n=t.chord.take(),r=t.commandIdFor(e.key),i=r?Lw[r]:void 0;if(yT(t.doc,i,t.helpOpen())){t.mode.record(oT(e),!1);return}let a=Ew(e);if(a!==null){let{hit:r,index:i}=bT(t.deps,n,a);if(t.mode.record(oT(e),r),!r)return;e.preventDefault(),n&&i!==null&&t.chord.arm(n.list,i);return}t.mode.record(oT(e),!!i),i&&r&&_T(i,r,e,n,t.dispatch)}function wT(e,t,n,r){let i=e.defaultView,a=i?.setTimeout.bind(i)??setTimeout,o=i?.clearTimeout.bind(i)??clearTimeout,s,c=i=>{r.value&&s===void 0&&(s=a(()=>{if(s=void 0,r.value=!1,i){let n=xw(e);!Tw(e)&&!yw(n)&&!Sw(t.composerBand,n)&&t.focusComposer?.()}n.schedule()},0))},l=e=>{if(Sw(t.composerBand,bw(e))){r.value=!0;return}r.value&&c(!1)},u=()=>c(!0),d=()=>c(!1);return e.addEventListener(`pointerdown`,l,!0),e.addEventListener(`mousedown`,l,!0),e.addEventListener(`pointerup`,u,!0),e.addEventListener(`mouseup`,u,!0),e.addEventListener(`pointercancel`,d,!0),t.composerBand?.addEventListener(`lostpointercapture`,d),i?.addEventListener(`blur`,d),()=>{e.removeEventListener(`pointerdown`,l,!0),e.removeEventListener(`mousedown`,l,!0),e.removeEventListener(`pointerup`,u,!0),e.removeEventListener(`mouseup`,u,!0),e.removeEventListener(`pointercancel`,d,!0),t.composerBand?.removeEventListener(`lostpointercapture`,d),i?.removeEventListener(`blur`,d),s!==void 0&&o(s)}}function TT(e){let t=e.doc??e.switcher?.ownerDocument;if(!t)throw Error(`wireKeyboardShortcuts: no document`);ST.get(t)?.dispose();let n={},r=Uw,i=hw,a=e.usage,o=cT(t,()=>r,()=>i,a),s=uT(t,()=>r,()=>e.hudHost??t.body,e.caps,t=>{e.switcher.arrowKeys=t?`off`:`on`,e.composerBand?.toggleAttribute(`keys`,t)}),c={lastDockSurface:`files`},l=e=>r[e],u={value:!1},d=pT(t,s,e,()=>i,()=>u.value),f=wT(t,e,d,u),p=xT(t),m={deps:e,actions:n,state:c,mode:s,settler:d,chord:p,toggleHelp:()=>o.toggle()},h=n=>CT(n,{doc:t,mode:s,settler:d,chord:p,helpOpen:()=>!!o.element(),deps:e,dispatch:m,commandIdFor:l,trigger:i}),g=t=>{let n=bw(t);s.on()&&Cw(n)?d.suspend():s.on()&&(yw(n)||Sw(e.composerBand,n))&&s.set(!1),d.schedule()},_=()=>d.schedule(),v=()=>lT(t),y=()=>d.schedule(),b=()=>d.suspend(),x=mT(e.switcher,t,d.restore),S=t.defaultView;t.addEventListener(`keydown`,h),t.addEventListener(`focusin`,g),t.addEventListener(`focusout`,_),t.addEventListener(`fullscreenchange`,v),S?.addEventListener(`focus`,y),S?.addEventListener(`blur`,b),lT(t),d.schedule();let C={dispose:()=>{t.removeEventListener(`keydown`,h),t.removeEventListener(`focusin`,g),t.removeEventListener(`focusout`,_),t.removeEventListener(`fullscreenchange`,v),S?.removeEventListener(`focus`,y),S?.removeEventListener(`blur`,b),f(),x(),d.dispose(),p.clear(),s.set(!1),o.hide(),e.caps?.destroy(),ST.get(t)===C&&ST.delete(t)},showHelp:o.show,hideHelp:o.hide,helpOverlay:o.element,active:s.on,setActive:s.set,intent:d.intent,setAction:(e,t)=>{n[e]=t},setKeymap:e=>{r={...e}},keymap:()=>r,trigger:()=>i,setTrigger:e=>{i=e,(e===null||e===`esc`)&&s.set(!1),d.dropSuspension(),d.schedule()}};return ST.set(t,C),C}export{O as $,Mt as A,M as B,Lt as C,Gt as D,en as E,xt as F,lt as G,ft as H,Ct as I,Ge as J,dt as K,St as L,At as M,jt as N,Jt as O,P,pe as Q,ht as R,bs as S,Kt as T,tt as U,ct as V,ut as W,te as X,ze as Y,ye as Z,pu as _,Vw as a,v as at,xc as b,zw as c,y as ct,fw as d,c as dt,be as et,pw as f,If as g,Pf as h,Ww as i,g as it,Ot as j,Ft as k,gw as l,o as lt,lw as m,hw as n,ee as nt,Kw as o,_ as ot,mw as p,et as q,Hw as r,d as rt,Bw as s,u as st,Uw as t,x as tt,TT as u,s as ut,$l as v,It as w,Ws as x,il as y,mt as z};
8404
+ `;function bw(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.tagName==`string`?t.tagName.toUpperCase():``;if(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable===!0)return!0;let r=t.closest?.(`[contenteditable]`);return!!r&&r.getAttribute(`contenteditable`)!==`false`}function xw(e){return(typeof e.composedPath==`function`?e.composedPath():[])[0]??e.target}function Sw(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function Cw(e,t){if(!e||!t)return!1;let n=t;for(;n;){if(n===e)return!0;if(typeof ShadowRoot<`u`&&n instanceof ShadowRoot){n=n.host;continue}let t=n.parentNode;if(t){n=t;continue}let r=n.assignedSlot;if(r){n=r;continue}break}return!1}function ww(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.tagName==`string`?t.tagName.toUpperCase():``;return n===`IFRAME`||n===`FRAME`||n===`OBJECT`||n===`EMBED`}function Tw(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.tagName==`string`?t.tagName.toUpperCase():``;if(n===`BUTTON`||n===`SUMMARY`||n===`OPTION`||n===`A`&&t.hasAttribute?.(`href`)===!0)return!0;let r=t.getAttribute?.(`role`)??``;return[`button`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`tab`,`switch`,`checkbox`,`radio`].includes(r)}function Ew(e){return!!e.querySelector(`slicc-quick-look, slicc-dialog[open], slicc-tab-overlay[open], .slicc-permissions__prompt[data-open]`)}function Dw(e){let t=/^Digit([1-9])$/.exec(e.code??``);return t?Number(t[1]):/^[1-9]$/.test(e.key)?Number(e.key):null}function Ow(e,t){if(e<=0)return null;let n=t===9?e-1:t-1;return n<e?n:null}function kw(e,t){let n=Ow(e.length,t);return n===null?null:e[n]??null}function Aw(e,t){return kw(e.map(e=>e.key),t)}function jw(e,t){return e.length===0?null:e[((t===null?-1:e.indexOf(t))+1)%e.length]??null}function Mw(e,t){if(e.length===0)return null;let n=t===null?-1:e.indexOf(t);return e[((n===-1?0:n)-1+e.length)%e.length]??null}function Nw(e){return e.items.filter(e=>e.kind===`sprinkle`).map(e=>e.id)}var Pw=[`Getting around`,`Agents`,`The turn`,`Panels`,`Settings`];function Fw(e,t){if(e!==`sprinkles`)return t.lists?.[e]??null;let n=t.dock;return n?{size:()=>Nw(n).length,selectAt:e=>{let t=Nw(n)[e];t&&n.selectItem(t)}}:null}function Iw(e,t,n){return{holdsMode:!!n,description:t,group:`Panels`,surfaceId:e,...n?{list:n}:{},run:({deps:t,state:n})=>{n.lastDockSurface=e,t.dock?.selectItem(e)}}}function Lw(e,t){return{holdsMode:!1,description:t,group:`Agents`,run:({deps:t})=>{t.freezer?.dispatchEvent(new CustomEvent(e,{bubbles:!0}))}}}var Rw={nextAgent:{holdsMode:!0,group:`Agents`,description:`Next agent, looping`,run:({deps:e})=>{let t=jw(e.switcher.scoops.map(e=>e.key),e.switcher.active);t&&e.switcher.select(t)}},prevAgent:{holdsMode:!0,group:`Agents`,description:`Previous agent, looping`,run:({deps:e})=>{let t=Mw(e.switcher.scoops.map(e=>e.key),e.switcher.active);t&&e.switcher.select(t)}},composer:{holdsMode:!1,group:`Getting around`,description:`Back to the composer`,run:({deps:e})=>e.focusComposer?.()},stop:{holdsMode:!0,group:`The turn`,description:`Stop the running turn`,run:({deps:e})=>e.stopTurn?.()},approvals:{holdsMode:!0,group:`The turn`,description:`Go to the pending approval`,run:({deps:e})=>e.focusApproval?.()},attach:{holdsMode:!1,group:`The turn`,description:`Attach a file or skill`,run:({deps:e})=>e.openAttachMenu?.()},copyReply:{holdsMode:!0,group:`The turn`,description:`Copy the last reply`,run:({deps:e})=>e.copyReply?.()},copyChat:{holdsMode:!0,group:`The turn`,description:`Copy the whole chat`,run:({deps:e})=>e.copyChat?.()},voice:{holdsMode:!0,group:`The turn`,description:`Dictate — again to send`,run:({deps:e})=>e.toggleVoice?.()},nextItem:{holdsMode:!0,group:`Getting around`,description:`Next message — or, after a list key, the next entry`,run:e=>gT(e,1)},prevItem:{holdsMode:!0,group:`Getting around`,description:`Previous message — or the previous entry`,run:e=>gT(e,-1)},newConversation:{holdsMode:!1,group:`Agents`,description:`New conversation`,run:({deps:e})=>{e.freezer?.dispatchEvent(new CustomEvent(`new-chat-save`,{bubbles:!0}))}},newConversationErase:Lw(`new-chat-erase`,`New conversation, erasing this one`),newCone:Lw(`new-cone`,`New cone`),dropCone:Lw(`drop-cone`,`Drop this cone`),sessions:{holdsMode:!0,group:`Agents`,description:`Archived chats (with 1-9 / j / k: restore that one)`,list:`sessions`,run:({deps:e})=>e.freezer?.toggle(!0)},leftRail:{holdsMode:!0,group:`Getting around`,description:`Toggle the left rail`,run:({deps:e})=>e.freezer?.toggle()},rightRail:{holdsMode:!0,group:`Getting around`,description:`Toggle the right panel`,run:({deps:e,state:t})=>{let n=e.dock;if(n){if(n.active){t.lastDockSurface=n.active,n.collapse();return}n.selectItem(t.lastDockSurface)}}},files:Iw(`files`,`File browser (with 1-9 / j / k: open that row)`,`files`),tabs:Iw(`browser`,`Browser tabs (then 1-9 to switch)`),peek:{holdsMode:!0,group:`Panels`,description:`Peek a tab (then 1-9: show it and come back)`,run:({deps:e})=>e.peekTabs?.()},terminal:Iw(`term`,`Terminal`),memory:Iw(`memory`,`Memory (with 1-9 / j / k: open that entry)`,`memory`),monitor:Iw(`monitor`,`Monitor`),sprinkles:{holdsMode:!0,group:`Panels`,description:`Sprinkles (with 1-9 / j / k: open that one)`,list:`sprinkles`,run:({deps:e,state:t})=>{let n=e.dock;if(!n)return;let r=Nw(n);if(r.length!==0)return t.lastDockSurface=r[0],n.selectItem(r[0]),0}},zoom:{holdsMode:!0,group:`Getting around`,description:`Full screen the open panel`,run:({deps:e})=>e.zoomSurface?.()},model:{holdsMode:!1,group:`Settings`,description:`Model picker`,run:({deps:e,actions:t})=>{let n=e.composerMeta;if(n){if(n.models.length===0){t.accounts?.();return}n.openMenu()}}},cycleModel:{holdsMode:!0,group:`Settings`,description:`Next model`,run:({deps:e,actions:t})=>{let n=e.composerMeta;if(n){if(n.models.length===0){t.accounts?.();return}n.cycleModel?.()}}},cycleThinking:{holdsMode:!0,group:`Settings`,description:`Next thinking level`,run:({deps:e})=>e.composerMeta?.cycleThinking?.()},accounts:{holdsMode:!1,group:`Settings`,description:`Accounts`,run:({actions:e})=>e.accounts?.()},help:{holdsMode:!0,group:`Getting around`,description:`This help`,run:e=>e.toggleHelp()}},zw=Object.keys(Rw);function Bw(e){return typeof e==`string`&&Object.hasOwn(Rw,e)}function Vw(e){return Rw[e].surfaceId??null}function Hw(e){return zw.find(t=>Rw[t].surfaceId===e)??null}var Uw=[`Escape`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],Ww={i:`composer`,Enter:`composer`,"?":`help`,ArrowRight:`nextAgent`,ArrowLeft:`prevAgent`,n:`newConversation`,N:`newConversationErase`,c:`newCone`,C:`dropCone`,r:`sessions`,s:`stop`,a:`approvals`,u:`attach`,y:`copyReply`,Y:`copyChat`,v:`voice`,j:`nextItem`,k:`prevItem`,f:`files`,t:`terminal`,b:`tabs`,m:`memory`,g:`monitor`,e:`sprinkles`,p:`peek`,"[":`leftRail`,"]":`rightRail`,z:`zoom`,l:`model`,L:`cycleModel`,h:`cycleThinking`,",":`accounts`},Gw={d:`nextAgent`,c:`composer`,Enter:`composer`,n:`newConversation`,b:`leftRail`,x:`rightRail`,f:`files`,t:`tabs`,e:`terminal`,m:`memory`,s:`sprinkles`,l:`model`,a:`accounts`,h:`help`,"?":`help`,"/":`help`};function Kw(e){return oT[e]??e}function qw(e,t){let n=Object.keys(e).find(n=>e[n]===t);return n===void 0?null:Kw(n)}function Jw(e){return qw(e,`help`)}function Yw(e){let t=Jw(e),n=Object.keys(e).filter(t=>e[t]===`composer`).map(e=>`[${Kw(e)}]`);return[t===null?null:`[${t}] help`,n.length===0?null:`${n.join(` or `)} to type`].filter(e=>e!==null).join(` · `)}function Xw(e=Ww){let t=new Map;for(let[n,r]of Object.entries(e))t.set(r,[...t.get(r)??[],Kw(n)]);return[{keys:[`Esc`],description:`Leave the composer for keyboard mode (again: exit full screen)`,group:`Getting around`},{keys:[`1 – 9`],description:`Switch to that agent in the tab strip (9 = last)`,group:`Agents`},...zw.filter(e=>t.has(e)).map(e=>({keys:t.get(e)??[],description:Rw[e].description,group:Rw[e].group,id:e}))]}function Zw(e){if(e.getElementById(vw))return;let t=e.createElement(`style`);t.id=vw,t.textContent=yw,(e.head??e.documentElement)?.append(t)}var Qw=5;function $w(e,t){let n=e.createElement(`div`);n.className=`wcsc__keys`;for(let r of t.keys){let t=e.createElement(`kbd`);t.className=`wcsc__key`,t.textContent=r,n.append(t)}return n}function eT(e,t,n=!1){let r=e.createElement(`div`);r.className=`wcsc__row`,t.count>0&&(r.dataset.used=String(t.count));let i=e.createElement(`div`);if(i.className=`wcsc__desc`,i.textContent=t.description,r.append(i),n){let n=e.createElement(`div`);n.className=`wcsc__count`,n.textContent=`×${t.count}`,r.append(n)}return r.append($w(e,t)),r}function tT(e,t,n){let r=e.createElement(`div`);r.className=`wcsc__group`;let i=e.createElement(`div`);i.className=`wcsc__title`,i.textContent=t,r.append(i);for(let t of n)r.append(eT(e,t));return r}function nT(e,t){let n=t.filter(e=>e.count>0).sort((e,t)=>t.count-e.count).slice(0,Qw);if(n.length===0)return null;let r=e.createElement(`div`);r.className=`wcsc__group wcsc__group--yours`;let i=e.createElement(`div`);i.className=`wcsc__title`,i.textContent=`Your frequent actions`,r.append(i);for(let t of n)r.append(eT(e,t,!0));return r}function rT(e,t,n,r){let i=e.createElement(`div`);i.className=`wcsc`;let a=e.createElement(`div`);a.className=`wcsc__note`,a.textContent=n===null?`Keyboard mode is off. Turn it on in Theme settings (Esc or Auto).`:n===`esc`?`Press Esc to enter keyboard mode. Put the caret back in the composer to type — nothing is intercepted there.`:`Keyboard mode is on whenever nothing is focused for typing (and you are not clicking composer chrome), so these keys are live by default. Put the caret back in the composer to type — nothing is intercepted there.`,i.append(a);let o=new Map((r?.ranked()??[]).map(e=>[e.id,e.count])),s=t.map(e=>({...e,count:(e.id===void 0?void 0:o.get(e.id))??0})),c=e.createElement(`div`);c.className=`wcsc__cols`;let l=nT(e,s);l&&c.append(l);for(let t of Pw){let n=s.filter(e=>e.group===t);n.length>0&&c.append(tT(e,t,n))}return i.append(c),i}var iT=1600,aT=iT,oT={Escape:`Esc`,Enter:`⏎`," ":`Space`,Tab:`⇥`,Backspace:`⌫`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`};function sT(e){let t=[];return e.ctrlKey&&t.push(`⌃`),e.altKey&&t.push(`⌥`),e.metaKey&&t.push(`⌘`),e.shiftKey&&e.key.length>1&&t.push(`⇧`),t.push(oT[e.key]??e.key),t}function cT(e,t,n){let r=e.createElement(`slicc-key-hud`);return r.dataset.wcShortcuts=`hud`,r.setAttribute(`hint`,Yw(n)),r.setAttribute(`linger`,String(iT)),t.append(r),{record:(e,t)=>r.record?.(e,t),destroy:()=>r.remove()}}function lT(e,t,n,r){let i=null,a=()=>{if(!i)return;let e=i;i=null,e.hide?.(),e.remove()},o=()=>{if(i)return;Zw(e);let a=e.createElement(`slicc-dialog`);a.className=`wcsc-dialog`,a.setAttribute(`heading`,`Keyboard mode`),a.dataset.wcShortcuts=`help`,a.append(rT(e,Xw(t()),n(),r)),a.addEventListener(`slicc-dialog-close`,()=>{i=null,a.remove()}),e.body.append(a),i=a,a.show?.()};return{show:o,hide:a,toggle:()=>i?a():o(),element:()=>i}}function uT(e){let t=e.defaultView?.navigator?.keyboard;t&&(e.fullscreenElement?t.lock([`Escape`]).catch(()=>void 0):t.unlock())}function dT(e,t,n,r,i){let a=!1,o=null;return{on:()=>a,record:(e,t)=>o?.record(e,t),set:s=>{if(s===a)return;if(a=s,e.documentElement.toggleAttribute(`data-slicc-keyboard-mode`,s),i(s),!s){o?.destroy(),o=null,r?.hide();return}Zw(e),o=cT(e,n(),t()),r?.show(t());let c=e.activeElement;bw(c)&&c?.blur()}}}function fT(e){if(e.ctrlKey||e.metaKey||e.altKey)return!0;let t=xw(e);return bw(t)?!0:(e.key===`Enter`||e.key===` `)&&Tw(t)}function pT(e,t,n,r,i){if(e===null){r.set(!1),n&&t&&i(`composer`);return}if(e===`esc`){t&&(r.set(!1),n&&i(`composer`));return}r.set(!t),n&&i(t?`composer`:`keyboard`)}function mT(e,t,n,r,i){let a=e.defaultView,o=a?.setTimeout.bind(a)??setTimeout,s=a?.clearTimeout.bind(a)??clearTimeout,c=n.composerAvailable??(()=>!!n.focusComposer),l,u=`composer`,d=!1,f=null,p=null,m=()=>{p?.disconnect(),p=null,f=null},h=t=>{if(f===t)return;m();let n=a?.MutationObserver??globalThis.MutationObserver;n&&(f=t,p=new n(()=>{t.isConnected||(m(),v())}),p.observe(e.documentElement,{childList:!0,subtree:!0}))},g=()=>{d||=t.on(),t.set(!1)},_=()=>{if(Ew(e)||typeof e.hasFocus==`function`&&!e.hasFocus())return;let a=Sw(e);if(ww(a)){h(a),g();return}m();let o=bw(a)||Cw(n.composerBand,a)||!!i?.();d&&(d=!1,!o&&r()===`esc`&&t.set(!0)),pT(r(),o,c(),t,e=>{u=e})},v=()=>{l===void 0&&(l=o(()=>{l=void 0,_()},0))};return{schedule:v,restore:()=>{if(Ew(e))return;let i=r();u===`composer`&&c()?(t.set(!1),n.focusComposer?.()):i===null?t.set(!1):t.set(!0),v()},choose:e=>{u=e},suspend:g,dropSuspension:()=>{d=!1},intent:()=>u,dispose:()=>{l!==void 0&&s(l),l=void 0,m()}}}function hT(e,t,n){let r=e.nodeType===1?e:null,i=t.defaultView?.MutationObserver??globalThis.MutationObserver;if(!r||!i)return()=>void 0;let a=e.active,o=new i(()=>{let t=e.active;t!==a&&(a=t,n())});return o.observe(r,{attributes:!0,attributeFilter:[`active`]}),()=>o.disconnect()}function gT(e,t){let n=e.armed;if(!n){e.deps.scrollMessage?.(t);return}let r=Fw(n.list,e.deps),i=r?.size()??0;if(!r||i===0)return;let a=n.index===null?t>0?0:i-1:(n.index+t+i)%i;return r.selectAt(a),a}function _T(e,t,n){let r=Fw(t,e),i=r?Ow(r.size(),n):null;return i===null||!r?null:(r.selectAt(i),i)}function vT(e,t,n,r,i){n.preventDefault(),i.deps.usage?.record?.(t),e.holdsMode||i.mode.set(!1);let a=e.run({deps:i.deps,actions:i.actions,state:i.state,toggleHelp:i.toggleHelp,armed:r}),o=e.list??(typeof a==`number`?r?.list:void 0);o&&i.chord.arm(o,typeof a==`number`?a:null),e.holdsMode||i.settler.schedule()}function yT(e,t,n,r,i){if(Ew(t))return;if(!n.on()){if(i===null)return;e.preventDefault(),n.set(!0),r.choose(`keyboard`),n.record(sT(e),!0);return}let a=!!t.fullscreenElement;n.record(sT(e),a),a&&t.exitFullscreen?.().catch(()=>void 0)}function bT(e,t,n){return Ew(e)&&!(t===Rw.help&&n)}function xT(e,t,n){if(t){let r=_T(e,t.list,n);return{hit:r!==null,index:r}}let r=Aw(e.switcher.scoops,n);return r!==null&&e.switcher.select(r),{hit:r!==null,index:null}}function ST(e){let t=e.defaultView,n=t?.setTimeout.bind(t)??setTimeout,r=t?.clearTimeout.bind(t)??clearTimeout,i=null,a=()=>{i&&=(r(i.timer),null)};return{take:()=>{if(!i)return null;let{list:e,index:t}=i;return a(),{list:e,index:t}},arm:(e,t)=>{a(),i={list:e,index:t,timer:n(a,aT)}},clear:a}}var CT=new WeakMap;function wT(e,t){if(e.defaultPrevented||e.isComposing)return;if(e.key===`Escape`){t.chord.clear(),yT(e,t.doc,t.mode,t.settler,t.trigger);return}if(!t.mode.on()||fT(e))return;let n=t.chord.take(),r=t.commandIdFor(e.key),i=r?Rw[r]:void 0;if(bT(t.doc,i,t.helpOpen())){t.mode.record(sT(e),!1);return}let a=Dw(e);if(a!==null){let{hit:r,index:i}=xT(t.deps,n,a);if(t.mode.record(sT(e),r),!r)return;e.preventDefault(),n&&i!==null&&t.chord.arm(n.list,i);return}t.mode.record(sT(e),!!i),i&&r&&vT(i,r,e,n,t.dispatch)}function TT(e,t,n,r){let i=e.defaultView,a=i?.setTimeout.bind(i)??setTimeout,o=i?.clearTimeout.bind(i)??clearTimeout,s,c=i=>{r.value&&s===void 0&&(s=a(()=>{if(s=void 0,r.value=!1,i){let n=Sw(e);!Ew(e)&&!bw(n)&&!Cw(t.composerBand,n)&&t.focusComposer?.()}n.schedule()},0))},l=e=>{if(Cw(t.composerBand,xw(e))){r.value=!0;return}r.value&&c(!1)},u=()=>c(!0),d=()=>c(!1);return e.addEventListener(`pointerdown`,l,!0),e.addEventListener(`mousedown`,l,!0),e.addEventListener(`pointerup`,u,!0),e.addEventListener(`mouseup`,u,!0),e.addEventListener(`pointercancel`,d,!0),t.composerBand?.addEventListener(`lostpointercapture`,d),i?.addEventListener(`blur`,d),()=>{e.removeEventListener(`pointerdown`,l,!0),e.removeEventListener(`mousedown`,l,!0),e.removeEventListener(`pointerup`,u,!0),e.removeEventListener(`mouseup`,u,!0),e.removeEventListener(`pointercancel`,d,!0),t.composerBand?.removeEventListener(`lostpointercapture`,d),i?.removeEventListener(`blur`,d),s!==void 0&&o(s)}}function ET(e){let t=e.doc??e.switcher?.ownerDocument;if(!t)throw Error(`wireKeyboardShortcuts: no document`);CT.get(t)?.dispose();let n={},r=Ww,i=gw,a=e.usage,o=lT(t,()=>r,()=>i,a),s=dT(t,()=>r,()=>e.hudHost??t.body,e.caps,t=>{e.switcher.arrowKeys=t?`off`:`on`,e.composerBand?.toggleAttribute(`keys`,t)}),c={lastDockSurface:`files`},l=e=>r[e],u={value:!1},d=mT(t,s,e,()=>i,()=>u.value),f=TT(t,e,d,u),p=ST(t),m={deps:e,actions:n,state:c,mode:s,settler:d,chord:p,toggleHelp:()=>o.toggle()},h=n=>wT(n,{doc:t,mode:s,settler:d,chord:p,helpOpen:()=>!!o.element(),deps:e,dispatch:m,commandIdFor:l,trigger:i}),g=t=>{let n=xw(t);s.on()&&ww(n)?d.suspend():s.on()&&(bw(n)||Cw(e.composerBand,n))&&s.set(!1),d.schedule()},_=()=>d.schedule(),v=()=>uT(t),y=()=>d.schedule(),b=()=>d.suspend(),x=hT(e.switcher,t,d.restore),S=t.defaultView;t.addEventListener(`keydown`,h),t.addEventListener(`focusin`,g),t.addEventListener(`focusout`,_),t.addEventListener(`fullscreenchange`,v),S?.addEventListener(`focus`,y),S?.addEventListener(`blur`,b),uT(t),d.schedule();let C={dispose:()=>{t.removeEventListener(`keydown`,h),t.removeEventListener(`focusin`,g),t.removeEventListener(`focusout`,_),t.removeEventListener(`fullscreenchange`,v),S?.removeEventListener(`focus`,y),S?.removeEventListener(`blur`,b),f(),x(),d.dispose(),p.clear(),s.set(!1),o.hide(),e.caps?.destroy(),CT.get(t)===C&&CT.delete(t)},showHelp:o.show,hideHelp:o.hide,helpOverlay:o.element,active:s.on,setActive:s.set,intent:d.intent,setAction:(e,t)=>{n[e]=t},setKeymap:e=>{r={...e}},keymap:()=>r,trigger:()=>i,setTrigger:e=>{i=e,(e===null||e===`esc`)&&s.set(!1),d.dropSuspension(),d.schedule()}};return CT.set(t,C),C}export{ve as $,Pt as A,ht as B,zt as C,qt as D,nn as E,Ct as F,dt as G,mt as H,N as I,qe as J,pt as K,M as L,Mt as M,Nt as N,Xt as O,Tt as P,pe as Q,_t as R,xs as S,Jt as T,rt as U,ut as V,ft as W,te as X,Ve as Y,be as Z,mu as _,Hw as a,v as at,Sc as b,Bw as c,y as ct,pw as d,c as dt,xe as et,mw as f,Lf as g,Ff as h,Gw as i,g as it,At as j,Lt as k,_w as l,o as lt,uw as m,gw as n,ee as nt,qw as o,_ as ot,hw as p,nt as q,Uw as r,d as rt,Vw as s,u as st,Ww as t,x as tt,ET as u,s as ut,eu as v,Rt as w,Gs as x,al as y,gt as z};