@ai-ecoverse/slicc-spectrum 1.103.0 → 1.103.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/slicc-ui.js CHANGED
@@ -6247,8 +6247,8 @@ var containRe = /paint|layout|strict|content/;
6247
6247
  var isNotNone = (value) => !!value && value !== "none";
6248
6248
  var isWebKitValue;
6249
6249
  function isContainingBlock(elementOrCss) {
6250
- const css2 = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
6251
- return isNotNone(css2.transform) || isNotNone(css2.translate) || isNotNone(css2.scale) || isNotNone(css2.rotate) || isNotNone(css2.perspective) || !isWebKit2() && (isNotNone(css2.backdropFilter) || isNotNone(css2.filter)) || willChangeRe.test(css2.willChange || "") || containRe.test(css2.contain || "");
6250
+ const css3 = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
6251
+ return isNotNone(css3.transform) || isNotNone(css3.translate) || isNotNone(css3.scale) || isNotNone(css3.rotate) || isNotNone(css3.perspective) || !isWebKit2() && (isNotNone(css3.backdropFilter) || isNotNone(css3.filter)) || willChangeRe.test(css3.willChange || "") || containRe.test(css3.contain || "");
6252
6252
  }
6253
6253
  function getContainingBlock(element3) {
6254
6254
  let currentNode = getParentNode(element3);
@@ -6333,9 +6333,9 @@ function getFrameElement(win) {
6333
6333
 
6334
6334
  // node_modules/@adobe/spectrum-wc-core/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
6335
6335
  function getCssDimensions(element3) {
6336
- const css2 = getComputedStyle2(element3);
6337
- let width = parseFloat(css2.width) || 0;
6338
- let height = parseFloat(css2.height) || 0;
6336
+ const css3 = getComputedStyle2(element3);
6337
+ let width = parseFloat(css3.width) || 0;
6338
+ let height = parseFloat(css3.height) || 0;
6339
6339
  const hasOffset = isHTMLElement(element3);
6340
6340
  const offsetWidth = hasOffset ? element3.offsetWidth : width;
6341
6341
  const offsetHeight = hasOffset ? element3.offsetHeight : height;
@@ -6429,9 +6429,9 @@ function getBoundingClientRect(element3, includeScale, isFixedStrategy, offsetPa
6429
6429
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
6430
6430
  const iframeScale = getScale(currentIFrame);
6431
6431
  const iframeRect = currentIFrame.getBoundingClientRect();
6432
- const css2 = getComputedStyle2(currentIFrame);
6433
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x;
6434
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y;
6432
+ const css3 = getComputedStyle2(currentIFrame);
6433
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css3.paddingLeft)) * iframeScale.x;
6434
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css3.paddingTop)) * iframeScale.y;
6435
6435
  x7 *= iframeScale.x;
6436
6436
  y10 *= iframeScale.y;
6437
6437
  width *= iframeScale.x;
@@ -6821,20 +6821,20 @@ function observeMove(element3, onMove) {
6821
6821
  };
6822
6822
  let isFirstUpdate = true;
6823
6823
  function handleObserve(entries) {
6824
- const ratio = entries[0].intersectionRatio;
6825
- if (ratio !== threshold) {
6824
+ const ratio2 = entries[0].intersectionRatio;
6825
+ if (ratio2 !== threshold) {
6826
6826
  if (!isFirstUpdate) {
6827
6827
  return refresh2();
6828
6828
  }
6829
- if (!ratio) {
6829
+ if (!ratio2) {
6830
6830
  timeoutId = setTimeout(() => {
6831
6831
  refresh2(false, 1e-7);
6832
6832
  }, 1e3);
6833
6833
  } else {
6834
- refresh2(false, ratio);
6834
+ refresh2(false, ratio2);
6835
6835
  }
6836
6836
  }
6837
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element3.getBoundingClientRect())) {
6837
+ if (ratio2 === 1 && !rectsAreEqual(elementRectForRootMargin, element3.getBoundingClientRect())) {
6838
6838
  refresh2();
6839
6839
  }
6840
6840
  isFirstUpdate = false;
@@ -10438,6 +10438,299 @@ e25("swc-icon-new", o55);
10438
10438
  // node_modules/@adobe/spectrum-wc/dist/link.css
10439
10439
  var link_default = '/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Standalone link presentation for native `<a href>` elements.\n *\n * Default anchor appearance inside `.swc-Typography--prose` and\n * `.swc-Typography--links` ships with `typography.css` (generated). Import this\n * stylesheet when authors need explicit BEM modifiers on anchors.\n *\n */\n\n.swc-Link {\n inline-size: -moz-fit-content;\n inline-size: fit-content;\n font-family: var(--swc-sans-font-family-stack);\n font-size: var(--swc-font-size-100);\n font-style: normal;\n font-weight: 400;\n line-height: 1.30;\n color: var(--swc-link-text-color-default, var(--swc-accent-color-900));\n -webkit-text-decoration: underline;\n text-decoration: underline;\n text-decoration-thickness: 1px;\n text-underline-offset: 1px;\n transition: color 130ms ease-in-out;\n\n &:hover {\n color: var(--swc-link-text-color-hover, var(--swc-accent-color-1000));\n }\n\n &:active {\n color: var(--swc-link-text-color-down, var(--swc-accent-color-1000));\n }\n\n &:focus-visible {\n color: var(--swc-link-text-color-focus, var(--swc-accent-color-1000));\n border-radius: 4px;\n outline: 2px solid var(--swc-link-focus-indicator-color, var(--swc-blue-800));\n outline-offset: 2px;\n }\n\n &:lang(ja),\n &:lang(zh),\n &:lang(ko) {\n line-height: 1.50;\n }\n}\n\n.swc-Link--standalone {\n font-weight: 500;\n}\n\n.swc-Link--secondary {\n --swc-link-text-color-default: var(--swc-gray-800);\n --swc-link-text-color-hover: var(--swc-gray-900);\n --swc-link-text-color-down: var(--swc-gray-900);\n --swc-link-text-color-focus: var(--swc-gray-900);\n}\n\n.swc-Link--staticWhite {\n --swc-link-text-color-default: var(--swc-white);\n --swc-link-text-color-hover: var(--swc-white);\n --swc-link-text-color-down: var(--swc-white);\n --swc-link-text-color-focus: var(--swc-white);\n --swc-link-focus-indicator-color: var(--swc-white);\n}\n\n.swc-Link--staticBlack {\n --swc-link-text-color-default: var(--swc-black);\n --swc-link-text-color-hover: var(--swc-black);\n --swc-link-text-color-down: var(--swc-black);\n --swc-link-text-color-focus: var(--swc-black);\n --swc-link-focus-indicator-color: var(--swc-black);\n}\n\n.swc-Link--quiet.swc-Link--standalone {\n -webkit-text-decoration: none;\n text-decoration: none;\n}\n\n.swc-Link--quiet.swc-Link--standalone:hover {\n -webkit-text-decoration: underline;\n text-decoration: underline;\n}\n';
10440
10440
 
10441
+ // src/app/ansi.ts
10442
+ var lightPalette = [
10443
+ "gray-800",
10444
+ "negative-color-900",
10445
+ "positive-color-900",
10446
+ "notice-color-1000",
10447
+ "informative-color-900",
10448
+ "purple-900",
10449
+ "cyan-1000",
10450
+ "gray-600",
10451
+ "gray-700",
10452
+ "negative-color-1000",
10453
+ "positive-color-1000",
10454
+ "notice-color-1100",
10455
+ "informative-color-1000",
10456
+ "purple-1000",
10457
+ "cyan-1100",
10458
+ "gray-800"
10459
+ ];
10460
+ var terminalPalette = r(
10461
+ lightPalette.map((token2, n37) => `--slicc-terminal-color-${n37}: var(--swc-${token2});`).join("\n")
10462
+ );
10463
+ var tints = [
10464
+ "gray-800",
10465
+ "negative-subtle-background-color-default",
10466
+ "positive-subtle-background-color-default",
10467
+ "notice-subtle-background-color-default",
10468
+ "informative-subtle-background-color-default",
10469
+ "purple-subtle-background-color-default",
10470
+ "cyan-subtle-background-color-default",
10471
+ "gray-subtle-background-color-default"
10472
+ ];
10473
+ var plain = {
10474
+ bold: false,
10475
+ dim: false,
10476
+ italic: false,
10477
+ underline: false,
10478
+ inverse: false,
10479
+ fg: null,
10480
+ bg: null
10481
+ };
10482
+ var levels = [0, 95, 135, 175, 215, 255];
10483
+ function indexed(n37) {
10484
+ if (!Number.isInteger(n37) || n37 < 0 || n37 > 255) return null;
10485
+ if (n37 < 16) return n37;
10486
+ if (n37 >= 232) {
10487
+ const grey = 8 + (n37 - 232) * 10;
10488
+ return `rgb(${grey}, ${grey}, ${grey})`;
10489
+ }
10490
+ const cube = n37 - 16;
10491
+ const [r40, g7, b13] = [Math.floor(cube / 36), Math.floor(cube / 6) % 6, cube % 6].map(
10492
+ (level) => levels[level]
10493
+ );
10494
+ return `rgb(${r40}, ${g7}, ${b13})`;
10495
+ }
10496
+ function channel(value) {
10497
+ return Number.isInteger(value) && value >= 0 && value <= 255 ? value : null;
10498
+ }
10499
+ function extended(params, at) {
10500
+ const mode2 = params[at + 1];
10501
+ if (mode2 === 5) return { color: indexed(params[at + 2]), used: 2 };
10502
+ if (mode2 === 2) {
10503
+ const rgb = params.slice(at + 2, at + 5).map(channel);
10504
+ const ok4 = rgb.length === 3 && rgb.every((value) => value !== null);
10505
+ return { color: ok4 ? `rgb(${rgb.join(", ")})` : null, used: 4 };
10506
+ }
10507
+ return { color: null, used: 0 };
10508
+ }
10509
+ function numbers(text5) {
10510
+ return text5.split(":").map((part2) => part2 === "" ? 0 : Number(part2));
10511
+ }
10512
+ var flags = {
10513
+ 0: plain,
10514
+ 1: { bold: true },
10515
+ 2: { dim: true },
10516
+ 3: { italic: true },
10517
+ 4: { underline: true },
10518
+ 7: { inverse: true },
10519
+ 22: { bold: false, dim: false },
10520
+ 23: { italic: false },
10521
+ 24: { underline: false },
10522
+ 27: { inverse: false },
10523
+ 39: { fg: null },
10524
+ 49: { bg: null }
10525
+ };
10526
+ var ranges = [
10527
+ [30, "fg", 0],
10528
+ [40, "bg", 0],
10529
+ [90, "fg", 8],
10530
+ [100, "bg", 8]
10531
+ ];
10532
+ function simple(code3) {
10533
+ const flag = flags[code3];
10534
+ if (flag) return flag;
10535
+ const range3 = ranges.find(([start2]) => code3 >= start2 && code3 < start2 + 8);
10536
+ return range3 ? { [range3[1]]: code3 - range3[0] + range3[2] } : null;
10537
+ }
10538
+ function wide(groups2, i26) {
10539
+ const group = groups2[i26];
10540
+ if (group.length === 1)
10541
+ return extended(
10542
+ groups2.slice(i26).map((entry) => entry[0]),
10543
+ 0
10544
+ );
10545
+ const spaced = group[1] === 2 && group.length > 5;
10546
+ return { color: extended(spaced ? [0, 2, ...group.slice(3)] : group, 0).color, used: 0 };
10547
+ }
10548
+ function sgr(style, body4) {
10549
+ const next = { ...style };
10550
+ const groups2 = body4 === "" ? [[0]] : body4.split(";").map(numbers);
10551
+ for (let i26 = 0; i26 < groups2.length; i26++) {
10552
+ const group = groups2[i26];
10553
+ const code3 = group[0];
10554
+ if (code3 === 38 || code3 === 48) {
10555
+ const { color: color2, used } = wide(groups2, i26);
10556
+ i26 += used;
10557
+ if (color2 !== null) next[code3 === 38 ? "fg" : "bg"] = color2;
10558
+ } else if (code3 === 4 && group.length > 1) next.underline = group[1] !== 0;
10559
+ else Object.assign(next, simple(code3));
10560
+ }
10561
+ return next;
10562
+ }
10563
+ function terminated(text5, from, streaming) {
10564
+ for (let i26 = from; i26 < text5.length; i26++) {
10565
+ if (text5[i26] === "\x07") return i26 + 1;
10566
+ if (text5[i26] === "\x1B" && text5[i26 + 1] === "\\") return i26 + 2;
10567
+ }
10568
+ if (streaming) return -1;
10569
+ const line = text5.indexOf("\n", from);
10570
+ return line === -1 ? text5.length : line;
10571
+ }
10572
+ function csi(text5, from) {
10573
+ for (let i26 = from; i26 < text5.length; i26++) {
10574
+ const code3 = text5.charCodeAt(i26);
10575
+ if (code3 >= 64 && code3 <= 126) {
10576
+ return { end: i26 + 1, body: text5.slice(from, i26), final: text5[i26] };
10577
+ }
10578
+ if (code3 < 32 || code3 > 63) return { end: i26, body: "", final: "" };
10579
+ }
10580
+ return null;
10581
+ }
10582
+ function escape(text5, at, style, streaming) {
10583
+ const kind = text5[at + 1];
10584
+ if (kind === void 0) return { end: -1, style };
10585
+ if (kind === "[") {
10586
+ const found = csi(text5, at + 2);
10587
+ if (!found) return { end: -1, style };
10588
+ const styled = found.final === "m" && /^[\d;:]*$/.test(found.body);
10589
+ return { end: found.end, style: styled ? sgr(style, found.body) : style };
10590
+ }
10591
+ if ("]PX^_".includes(kind)) return { end: terminated(text5, at + 2, streaming), style };
10592
+ let i26 = at + 1;
10593
+ while (i26 < text5.length && text5.charCodeAt(i26) >= 32 && text5.charCodeAt(i26) <= 47) i26++;
10594
+ if (i26 === text5.length) return { end: -1, style };
10595
+ const final = text5.charCodeAt(i26);
10596
+ return { end: final >= 48 && final <= 126 ? i26 + 1 : at + 1, style };
10597
+ }
10598
+ function parseAnsi(text5, streaming = false) {
10599
+ const runs = [];
10600
+ let style = plain;
10601
+ let start2 = 0;
10602
+ const push2 = (end) => {
10603
+ if (end <= start2) return;
10604
+ const last = runs.at(-1);
10605
+ const piece = text5.slice(start2, end);
10606
+ if (last?.style === style) last.text += piece;
10607
+ else runs.push({ text: piece, style });
10608
+ };
10609
+ let i26 = text5.indexOf("\x1B");
10610
+ while (i26 !== -1) {
10611
+ push2(i26);
10612
+ const found = escape(text5, i26, style, streaming);
10613
+ if (found.end === -1) return runs;
10614
+ style = found.style;
10615
+ start2 = found.end;
10616
+ i26 = text5.indexOf("\x1B", start2);
10617
+ }
10618
+ push2(text5.length);
10619
+ return runs;
10620
+ }
10621
+ function swatch(color2) {
10622
+ if (color2 === null) return null;
10623
+ return typeof color2 === "number" ? `var(--slicc-terminal-color-${color2}, var(--swc-${lightPalette[color2]}))` : color2;
10624
+ }
10625
+ function on(rgb) {
10626
+ const [r40, g7, b13] = rgb.match(/\d+/g).map((value) => {
10627
+ const v13 = Number(value) / 255;
10628
+ return v13 <= 0.03928 ? v13 / 12.92 : ((v13 + 0.055) / 1.055) ** 2.4;
10629
+ });
10630
+ return 0.2126 * r40 + 0.7152 * g7 + 0.0722 * b13 > 0.179 ? "var(--swc-black)" : "var(--swc-white)";
10631
+ }
10632
+ function triple(color2) {
10633
+ const found = color2.match(/^rgb\((\d+), (\d+), (\d+)\)$/);
10634
+ return found ? found.slice(1).map(Number) : null;
10635
+ }
10636
+ function readSurface(root2) {
10637
+ const read = (scheme) => {
10638
+ const probe = document.createElement("div");
10639
+ probe.className = "call run-detail";
10640
+ probe.hidden = true;
10641
+ probe.style.colorScheme = scheme;
10642
+ root2.append(probe);
10643
+ const style = getComputedStyle(probe);
10644
+ const found = [triple(style.backgroundColor), triple(style.color)];
10645
+ probe.remove();
10646
+ return found;
10647
+ };
10648
+ const [light, dark] = [read("light"), read("dark")];
10649
+ if (![...light, ...dark].every(Boolean)) return void 0;
10650
+ return {
10651
+ card: [light[0], dark[0]],
10652
+ text: [light[1], dark[1]]
10653
+ };
10654
+ }
10655
+ function luminance(rgb) {
10656
+ const [r40, g7, b13] = rgb.map((value) => {
10657
+ const v13 = value / 255;
10658
+ return v13 <= 0.03928 ? v13 / 12.92 : ((v13 + 0.055) / 1.055) ** 2.4;
10659
+ });
10660
+ return 0.2126 * r40 + 0.7152 * g7 + 0.0722 * b13;
10661
+ }
10662
+ function ratio(a23, b13) {
10663
+ const [high, low] = [luminance(a23), luminance(b13)].sort((x7, y10) => y10 - x7);
10664
+ return (high + 0.05) / (low + 0.05);
10665
+ }
10666
+ function mix(color2, base, amount) {
10667
+ return color2.map(
10668
+ (value, i26) => Math.round(base[i26] + (value - base[i26]) * amount)
10669
+ );
10670
+ }
10671
+ function floor2(color2, under) {
10672
+ const black = [0, 0, 0];
10673
+ const white = [255, 255, 255];
10674
+ const pole = ratio(black, under) >= ratio(white, under) ? black : white;
10675
+ let step2 = 0;
10676
+ while (ratio(mix(pole, color2, step2 / 20), under) < 4.5) step2++;
10677
+ return mix(pole, color2, step2 / 20);
10678
+ }
10679
+ var strength = [0.12, 0.25];
10680
+ function tint(color2, card2, text5, side) {
10681
+ const amount = strength[side];
10682
+ const tinted = mix(color2, card2, amount);
10683
+ const apart = Math.hypot(...tinted.map((value, i26) => value - card2[i26]));
10684
+ return apart < 16 ? mix(text5, card2, amount) : tinted;
10685
+ }
10686
+ var css = (rgb) => `rgb(${rgb.join(", ")})`;
10687
+ var both = (pair) => `light-dark(${pair.map(css).join(", ")})`;
10688
+ function extendedPaint(fg, bg, surface2) {
10689
+ const backs = typeof bg === "string" ? surface2.card.map(
10690
+ (card2, side) => tint(triple(bg), card2, surface2.text[side], side)
10691
+ ) : null;
10692
+ const fronts = surface2.card.map(
10693
+ (card2, side) => floor2(
10694
+ typeof fg === "string" ? triple(fg) : surface2.text[side],
10695
+ backs?.[side] ?? card2
10696
+ )
10697
+ );
10698
+ return [both(fronts), backs ? both(backs) : null];
10699
+ }
10700
+ function paint(style, surface2) {
10701
+ let { fg, bg } = style;
10702
+ if (style.inverse && fg === null && bg === null) {
10703
+ return ["var(--swc-background-layer-1-color)", "var(--swc-neutral-content-color-default)"];
10704
+ }
10705
+ if (style.inverse) [fg, bg] = [bg, fg];
10706
+ if (style.dim && typeof fg === "number" && fg >= 8) fg -= 8;
10707
+ if (style.dim && fg === null && bg === null) {
10708
+ return ["var(--swc-neutral-subdued-content-color-default)", null];
10709
+ }
10710
+ const extendedColor = typeof bg === "string" || bg === null && typeof fg === "string";
10711
+ if (surface2 && extendedColor) return extendedPaint(fg, bg, surface2);
10712
+ if (bg === null) return [swatch(fg), null];
10713
+ if (typeof bg === "string") return [typeof fg === "string" ? fg : on(bg), bg];
10714
+ const tint2 = `var(--swc-${bg === 8 ? "gray-700" : tints[bg % 8]})`;
10715
+ return [bg % 8 === 0 ? "var(--swc-gray-25)" : null, tint2];
10716
+ }
10717
+ function inline2(style, surface2) {
10718
+ const [fg, bg] = paint(style, surface2);
10719
+ return [
10720
+ fg ? `color: ${fg}` : "",
10721
+ bg ? `background: ${bg}` : "",
10722
+ style.bold ? "font-weight: var(--swc-bold-font-weight)" : "",
10723
+ style.italic ? "font-style: italic" : "",
10724
+ style.underline ? "text-decoration: underline" : ""
10725
+ ].filter(Boolean).join("; ");
10726
+ }
10727
+ function ansi(text5, streaming = false, surface2) {
10728
+ return parseAnsi(text5, streaming).map((run) => {
10729
+ const style = inline2(run.style, surface2);
10730
+ return style ? b`<span style=${style}>${run.text}</span>` : run.text;
10731
+ });
10732
+ }
10733
+
10441
10734
  // src/app/command.ts
10442
10735
  var toShow = "Show the full command to allow it.";
10443
10736
  var toScroll = "Scroll to the end of the command to allow it.";
@@ -14273,229 +14566,6 @@ var o63 = class extends a10 {
14273
14566
  };
14274
14567
  e25("swc-icon-info-circle", o63);
14275
14568
 
14276
- // src/app/ansi.ts
14277
- var lightPalette = [
14278
- "gray-800",
14279
- "negative-color-900",
14280
- "positive-color-900",
14281
- "notice-color-1000",
14282
- "informative-color-900",
14283
- "purple-900",
14284
- "cyan-1000",
14285
- "gray-600",
14286
- "gray-700",
14287
- "negative-color-1000",
14288
- "positive-color-1000",
14289
- "notice-color-1100",
14290
- "informative-color-1000",
14291
- "purple-1000",
14292
- "cyan-1100",
14293
- "gray-800"
14294
- ];
14295
- var terminalPalette = r(
14296
- lightPalette.map((token2, n37) => `--slicc-terminal-color-${n37}: var(--swc-${token2});`).join("\n")
14297
- );
14298
- var tints = [
14299
- "gray-800",
14300
- "negative-subtle-background-color-default",
14301
- "positive-subtle-background-color-default",
14302
- "notice-subtle-background-color-default",
14303
- "informative-subtle-background-color-default",
14304
- "purple-subtle-background-color-default",
14305
- "cyan-subtle-background-color-default",
14306
- "gray-subtle-background-color-default"
14307
- ];
14308
- var plain = {
14309
- bold: false,
14310
- dim: false,
14311
- italic: false,
14312
- underline: false,
14313
- inverse: false,
14314
- fg: null,
14315
- bg: null
14316
- };
14317
- var levels = [0, 95, 135, 175, 215, 255];
14318
- function indexed(n37) {
14319
- if (!Number.isInteger(n37) || n37 < 0 || n37 > 255) return null;
14320
- if (n37 < 16) return n37;
14321
- if (n37 >= 232) {
14322
- const grey = 8 + (n37 - 232) * 10;
14323
- return `rgb(${grey}, ${grey}, ${grey})`;
14324
- }
14325
- const cube = n37 - 16;
14326
- const [r40, g7, b13] = [Math.floor(cube / 36), Math.floor(cube / 6) % 6, cube % 6].map(
14327
- (level) => levels[level]
14328
- );
14329
- return `rgb(${r40}, ${g7}, ${b13})`;
14330
- }
14331
- function channel(value) {
14332
- return Number.isInteger(value) && value >= 0 && value <= 255 ? value : null;
14333
- }
14334
- function extended(params, at) {
14335
- const mode2 = params[at + 1];
14336
- if (mode2 === 5) return { color: indexed(params[at + 2]), used: 2 };
14337
- if (mode2 === 2) {
14338
- const rgb = params.slice(at + 2, at + 5).map(channel);
14339
- const ok4 = rgb.length === 3 && rgb.every((value) => value !== null);
14340
- return { color: ok4 ? `rgb(${rgb.join(", ")})` : null, used: 4 };
14341
- }
14342
- return { color: null, used: 0 };
14343
- }
14344
- function numbers(text5) {
14345
- return text5.split(":").map((part2) => part2 === "" ? 0 : Number(part2));
14346
- }
14347
- var flags = {
14348
- 0: plain,
14349
- 1: { bold: true },
14350
- 2: { dim: true },
14351
- 3: { italic: true },
14352
- 4: { underline: true },
14353
- 7: { inverse: true },
14354
- 22: { bold: false, dim: false },
14355
- 23: { italic: false },
14356
- 24: { underline: false },
14357
- 27: { inverse: false },
14358
- 39: { fg: null },
14359
- 49: { bg: null }
14360
- };
14361
- var ranges = [
14362
- [30, "fg", 0],
14363
- [40, "bg", 0],
14364
- [90, "fg", 8],
14365
- [100, "bg", 8]
14366
- ];
14367
- function simple(code3) {
14368
- const flag = flags[code3];
14369
- if (flag) return flag;
14370
- const range3 = ranges.find(([start2]) => code3 >= start2 && code3 < start2 + 8);
14371
- return range3 ? { [range3[1]]: code3 - range3[0] + range3[2] } : null;
14372
- }
14373
- function wide(groups2, i26) {
14374
- const group = groups2[i26];
14375
- if (group.length === 1)
14376
- return extended(
14377
- groups2.slice(i26).map((entry) => entry[0]),
14378
- 0
14379
- );
14380
- const spaced = group[1] === 2 && group.length > 5;
14381
- return { color: extended(spaced ? [0, 2, ...group.slice(3)] : group, 0).color, used: 0 };
14382
- }
14383
- function sgr(style, body4) {
14384
- const next = { ...style };
14385
- const groups2 = body4 === "" ? [[0]] : body4.split(";").map(numbers);
14386
- for (let i26 = 0; i26 < groups2.length; i26++) {
14387
- const group = groups2[i26];
14388
- const code3 = group[0];
14389
- if (code3 === 38 || code3 === 48) {
14390
- const { color: color2, used } = wide(groups2, i26);
14391
- i26 += used;
14392
- if (color2 !== null) next[code3 === 38 ? "fg" : "bg"] = color2;
14393
- } else if (code3 === 4 && group.length > 1) next.underline = group[1] !== 0;
14394
- else Object.assign(next, simple(code3));
14395
- }
14396
- return next;
14397
- }
14398
- function terminated(text5, from, streaming) {
14399
- for (let i26 = from; i26 < text5.length; i26++) {
14400
- if (text5[i26] === "\x07") return i26 + 1;
14401
- if (text5[i26] === "\x1B" && text5[i26 + 1] === "\\") return i26 + 2;
14402
- }
14403
- if (streaming) return -1;
14404
- const line = text5.indexOf("\n", from);
14405
- return line === -1 ? text5.length : line;
14406
- }
14407
- function csi(text5, from) {
14408
- for (let i26 = from; i26 < text5.length; i26++) {
14409
- const code3 = text5.charCodeAt(i26);
14410
- if (code3 >= 64 && code3 <= 126) {
14411
- return { end: i26 + 1, body: text5.slice(from, i26), final: text5[i26] };
14412
- }
14413
- if (code3 < 32 || code3 > 63) return { end: i26, body: "", final: "" };
14414
- }
14415
- return null;
14416
- }
14417
- function escape(text5, at, style, streaming) {
14418
- const kind = text5[at + 1];
14419
- if (kind === void 0) return { end: -1, style };
14420
- if (kind === "[") {
14421
- const found = csi(text5, at + 2);
14422
- if (!found) return { end: -1, style };
14423
- const styled = found.final === "m" && /^[\d;:]*$/.test(found.body);
14424
- return { end: found.end, style: styled ? sgr(style, found.body) : style };
14425
- }
14426
- if ("]PX^_".includes(kind)) return { end: terminated(text5, at + 2, streaming), style };
14427
- let i26 = at + 1;
14428
- while (i26 < text5.length && text5.charCodeAt(i26) >= 32 && text5.charCodeAt(i26) <= 47) i26++;
14429
- if (i26 === text5.length) return { end: -1, style };
14430
- const final = text5.charCodeAt(i26);
14431
- return { end: final >= 48 && final <= 126 ? i26 + 1 : at + 1, style };
14432
- }
14433
- function parseAnsi(text5, streaming = false) {
14434
- const runs = [];
14435
- let style = plain;
14436
- let start2 = 0;
14437
- const push2 = (end) => {
14438
- if (end <= start2) return;
14439
- const last = runs.at(-1);
14440
- const piece = text5.slice(start2, end);
14441
- if (last?.style === style) last.text += piece;
14442
- else runs.push({ text: piece, style });
14443
- };
14444
- let i26 = text5.indexOf("\x1B");
14445
- while (i26 !== -1) {
14446
- push2(i26);
14447
- const found = escape(text5, i26, style, streaming);
14448
- if (found.end === -1) return runs;
14449
- style = found.style;
14450
- start2 = found.end;
14451
- i26 = text5.indexOf("\x1B", start2);
14452
- }
14453
- push2(text5.length);
14454
- return runs;
14455
- }
14456
- function swatch(color2) {
14457
- if (color2 === null) return null;
14458
- return typeof color2 === "number" ? `var(--slicc-terminal-color-${color2}, var(--swc-${lightPalette[color2]}))` : color2;
14459
- }
14460
- function on(rgb) {
14461
- const [r40, g7, b13] = rgb.match(/\d+/g).map((value) => {
14462
- const v13 = Number(value) / 255;
14463
- return v13 <= 0.03928 ? v13 / 12.92 : ((v13 + 0.055) / 1.055) ** 2.4;
14464
- });
14465
- return 0.2126 * r40 + 0.7152 * g7 + 0.0722 * b13 > 0.179 ? "var(--swc-black)" : "var(--swc-white)";
14466
- }
14467
- function paint(style) {
14468
- let { fg, bg } = style;
14469
- if (style.inverse && fg === null && bg === null) {
14470
- return ["var(--swc-background-layer-1-color)", "var(--swc-neutral-content-color-default)"];
14471
- }
14472
- if (style.inverse) [fg, bg] = [bg, fg];
14473
- if (style.dim && typeof fg === "number" && fg >= 8) fg -= 8;
14474
- if (style.dim && fg === null && bg === null) {
14475
- return ["var(--swc-neutral-subdued-content-color-default)", null];
14476
- }
14477
- if (bg === null) return [swatch(fg), null];
14478
- if (typeof bg === "string") return [typeof fg === "string" ? fg : on(bg), bg];
14479
- const tint = `var(--swc-${bg === 8 ? "gray-700" : tints[bg % 8]})`;
14480
- return [bg % 8 === 0 ? "var(--swc-gray-25)" : null, tint];
14481
- }
14482
- function inline2(style) {
14483
- const [fg, bg] = paint(style);
14484
- return [
14485
- fg ? `color: ${fg}` : "",
14486
- bg ? `background: ${bg}` : "",
14487
- style.bold ? "font-weight: var(--swc-bold-font-weight)" : "",
14488
- style.italic ? "font-style: italic" : "",
14489
- style.underline ? "text-decoration: underline" : ""
14490
- ].filter(Boolean).join("; ");
14491
- }
14492
- function ansi(text5, streaming = false) {
14493
- return parseAnsi(text5, streaming).map((run) => {
14494
- const style = inline2(run.style);
14495
- return style ? b`<span style=${style}>${run.text}</span>` : run.text;
14496
- });
14497
- }
14498
-
14499
14569
  // src/app/guard.ts
14500
14570
  var prefixes = [
14501
14571
  "sk-",
@@ -21909,7 +21979,7 @@ function step(call, context, id) {
21909
21979
  row,
21910
21980
  b`<div class="call run-detail" id=${`detail-${call.id}`} role="listitem" aria-label=${label} data-target=${call.id} ?hidden=${!open}>
21911
21981
  ${body(call, context.color)}
21912
- ${call.output ? b`<pre class="output">${ansi(call.output, call.status === "running")}</pre>` : A}
21982
+ ${call.output ? b`<pre class="output">${ansi(call.output, call.status === "running", context.surface)}</pre>` : A}
21913
21983
  ${call.notes?.length ? notes(call.notes) : A}
21914
21984
  ${call.image ? b`<img class="shot" src=${call.image} alt=${call.title} />` : A}
21915
21985
  ${call.meta ? b`<span class="tool-meta">${call.meta}</span>` : A}
@@ -23560,6 +23630,80 @@ function owner(node2) {
23560
23630
  }
23561
23631
  return node2.ownerDocument;
23562
23632
  }
23633
+ function pageOf(key2) {
23634
+ const known = pages.get(key2);
23635
+ if (known) return known;
23636
+ const owned = /* @__PURE__ */ new Set();
23637
+ const found = {
23638
+ rows: restore(owned),
23639
+ owned,
23640
+ draft: null,
23641
+ hosts: /* @__PURE__ */ new Set(),
23642
+ watched: /* @__PURE__ */ new Map()
23643
+ };
23644
+ pages.set(key2, found);
23645
+ return found;
23646
+ }
23647
+ function settle(page, rows2) {
23648
+ page.rows = rows2;
23649
+ keep(page.owned, rows2);
23650
+ for (const host4 of [...page.hosts]) host4.requestUpdate();
23651
+ }
23652
+ function post(model, id, message) {
23653
+ const attachments = message.attachments ?? [];
23654
+ const done2 = () => retire(model.agent, id, attachments);
23655
+ model.agent.send(id, { ...message, attachments }).then(done2, done2);
23656
+ }
23657
+ function deliver(model, id, message, mode2) {
23658
+ const busy = model.agent.busy(id);
23659
+ const resolved = mode2 === "queue" ? busy ? "queue" : "send" : busy || mode2 === "steer" ? "steer" : "send";
23660
+ post(model, id, { text: message.text, attachments: message.attachments, mode: resolved });
23661
+ }
23662
+ function arrived(page, model) {
23663
+ const waiting3 = page.rows;
23664
+ const agents = model.agent.list();
23665
+ if (!(waiting3.length && agents.length) || model.agent.starting?.()) return;
23666
+ const active = model.agent.active();
23667
+ const id = agents.some((agent) => agent.id === active) ? active : agents[0].id;
23668
+ const sendable = (row) => !!(row.text || row.attachments.length) && !row.lost?.length;
23669
+ const [first2, ...rest] = waiting3.filter(sendable);
23670
+ if (!first2) return;
23671
+ const held2 = waiting3.filter((row) => !sendable(row));
23672
+ settle(page, held2);
23673
+ deliver(model, id, first2, "queue");
23674
+ for (const { text: text5, attachments } of rest) post(model, id, { text: text5, attachments, mode: "queue" });
23675
+ }
23676
+ function watch(page, model) {
23677
+ const arrive = () => arrived(page, model);
23678
+ let live = true;
23679
+ queueMicrotask(() => {
23680
+ if (live) arrive();
23681
+ });
23682
+ const known = page.watched.get(model);
23683
+ if (known) known.count++;
23684
+ else {
23685
+ const offs = [
23686
+ model.agent.on("agents", arrive),
23687
+ ...model.agent.starting ? [model.agent.on("starting", arrive)] : []
23688
+ ];
23689
+ page.watched.set(model, {
23690
+ count: 1,
23691
+ off: () => {
23692
+ for (const off of offs) off();
23693
+ }
23694
+ });
23695
+ }
23696
+ return () => {
23697
+ live = false;
23698
+ const entry = page.watched.get(model);
23699
+ if (--entry.count) return;
23700
+ entry.off();
23701
+ page.watched.delete(model);
23702
+ };
23703
+ }
23704
+ function flushStarting(node2, model) {
23705
+ return watch(pageOf(owner(node2)), model);
23706
+ }
23563
23707
  var PageQueue = class {
23564
23708
  #host;
23565
23709
  #owner = null;
@@ -23569,22 +23713,13 @@ var PageQueue = class {
23569
23713
  }
23570
23714
  #page() {
23571
23715
  this.#owner ??= this.#host.isConnected ? owner(this.#host) : null;
23572
- const page = this.#owner ?? this.#host.ownerDocument;
23573
- const known = pages.get(page);
23574
- if (known) return known;
23575
- const owned = /* @__PURE__ */ new Set();
23576
- const found = { rows: restore(owned), owned, draft: null, hosts: /* @__PURE__ */ new Set() };
23577
- pages.set(page, found);
23578
- return found;
23716
+ return pageOf(this.#owner ?? this.#host.ownerDocument);
23579
23717
  }
23580
23718
  get value() {
23581
23719
  return this.#page().rows;
23582
23720
  }
23583
23721
  set value(rows2) {
23584
- const page = this.#page();
23585
- page.rows = rows2;
23586
- keep(page.owned, rows2);
23587
- for (const host4 of [...page.hosts]) host4.requestUpdate();
23722
+ settle(this.#page(), rows2);
23588
23723
  }
23589
23724
  get draft() {
23590
23725
  return this.#page().draft;
@@ -23592,6 +23727,9 @@ var PageQueue = class {
23592
23727
  set draft(draft2) {
23593
23728
  this.#page().draft = draft2;
23594
23729
  }
23730
+ watch(model) {
23731
+ return this.#owner === this.#host.ownerDocument ? [watch(this.#page(), model)] : [];
23732
+ }
23595
23733
  hostConnected() {
23596
23734
  this.#owner = owner(this.#host);
23597
23735
  this.#page().hosts.add(this.#host);
@@ -24152,9 +24290,9 @@ var SliccComposer = class extends ThemedElement {
24152
24290
  this.#paths = entries.filter((entry) => entry.kind === "file").map((entry) => entry.path);
24153
24291
  });
24154
24292
  const update = () => this.requestUpdate();
24155
- queueMicrotask(() => this.#arrived());
24156
24293
  return [
24157
24294
  ...super.subscribe(model),
24295
+ ...this.#waiting.watch(model),
24158
24296
  model.agent.on("active", (id) => {
24159
24297
  if (!this.agent) this.#switch(id);
24160
24298
  }),
@@ -24162,15 +24300,11 @@ var SliccComposer = class extends ThemedElement {
24162
24300
  if (hold2?.reason !== "locked") this.blocked = false;
24163
24301
  update();
24164
24302
  }),
24165
- model.agent.on("agents", () => {
24166
- this.#arrived();
24167
- update();
24168
- }),
24303
+ model.agent.on("agents", update),
24169
24304
  ...model.agent.starting ? [
24170
24305
  model.agent.on("starting", () => {
24171
24306
  if (this.#starting() && this.popup?.kind !== "file" && this.popup?.kind !== "secret")
24172
24307
  this.popup = null;
24173
- this.#arrived();
24174
24308
  update();
24175
24309
  })
24176
24310
  ] : [],
@@ -24187,21 +24321,6 @@ var SliccComposer = class extends ThemedElement {
24187
24321
  #starting() {
24188
24322
  return this.model?.agent.starting?.() ?? null;
24189
24323
  }
24190
- #arrived() {
24191
- const model = this.model;
24192
- const waiting3 = this.#waiting.value;
24193
- const agents = model?.agent.list() ?? [];
24194
- if (!(model && waiting3.length && agents.length) || this.#starting()) return;
24195
- const active = model.agent.active();
24196
- const id = agents.some((agent) => agent.id === active) ? active : agents[0].id;
24197
- const sendable = (row) => !!(row.text || row.attachments.length) && !row.lost?.length;
24198
- const [first2, ...rest] = waiting3.filter(sendable);
24199
- if (!first2) return;
24200
- this.#waiting.value = waiting3.filter((row) => !sendable(row));
24201
- this.#deliver(model, id, first2, "queue");
24202
- for (const { text: text5, attachments } of rest)
24203
- this.#post(model, id, { text: text5, attachments, mode: "queue" });
24204
- }
24205
24324
  #putBack(row) {
24206
24325
  this.value = this.value.trim() ? `${this.value}
24207
24326
  ${row.text}` : row.text;
@@ -24282,17 +24401,7 @@ ${row.text}` : row.text;
24282
24401
  known.run(model, this.#agent, (command3[2] ?? "").trim());
24283
24402
  return;
24284
24403
  }
24285
- this.#deliver(model, this.#agent, { text: text5, attachments }, mode2);
24286
- }
24287
- #deliver(model, id, message, mode2) {
24288
- const busy = model.agent.busy(id);
24289
- const resolved = mode2 === "queue" ? busy ? "queue" : "send" : busy || mode2 === "steer" ? "steer" : "send";
24290
- this.#post(model, id, { text: message.text, attachments: message.attachments, mode: resolved });
24291
- }
24292
- #post(model, id, message) {
24293
- const attachments = message.attachments ?? [];
24294
- const done2 = () => retire(model.agent, id, attachments);
24295
- model.agent.send(id, { ...message, attachments }).then(done2, done2);
24404
+ deliver(model, this.#agent, { text: text5, attachments }, mode2);
24296
24405
  }
24297
24406
  #propose(model, text5) {
24298
24407
  this.value = "";
@@ -25018,12 +25127,12 @@ function settleModels(model) {
25018
25127
  if (settling.has(model) || !controls(model)) return;
25019
25128
  settling.add(model);
25020
25129
  try {
25021
- settle(model);
25130
+ settle2(model);
25022
25131
  } finally {
25023
25132
  settling.delete(model);
25024
25133
  }
25025
25134
  }
25026
- function settle(model) {
25135
+ function settle2(model) {
25027
25136
  const offered = chatModels(model.settings.models());
25028
25137
  const pick = fallbackModel(offered);
25029
25138
  if (!pick) return;
@@ -25346,8 +25455,8 @@ function dock(entries, messages, seat) {
25346
25455
  return { items, asks };
25347
25456
  }
25348
25457
  var failed = (message) => message.role === "assistant" ? message.status === "error" : message.role === "system" && message.kind === "error";
25349
- function empty3(watch, seat, name) {
25350
- if (watch) return "No messages yet.";
25458
+ function empty3(watch2, seat, name) {
25459
+ if (watch2) return "No messages yet.";
25351
25460
  return seat ? `No messages yet. Say hello to ${name}.` : `No messages yet. Ask ${name} something.`;
25352
25461
  }
25353
25462
  function carriesFiles(event2) {
@@ -25747,7 +25856,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
25747
25856
  }
25748
25857
  };
25749
25858
  subscribe(model) {
25750
- const settle2 = () => {
25859
+ const settle3 = () => {
25751
25860
  settleModels(model);
25752
25861
  this.requestUpdate();
25753
25862
  };
@@ -25762,14 +25871,14 @@ var SliccChat = class _SliccChat extends ThemedElement {
25762
25871
  return [
25763
25872
  ...super.subscribe(model),
25764
25873
  () => width.disconnect(),
25765
- model.settings.on("settings", settle2),
25766
- model.settings.on("accounts", settle2),
25874
+ model.settings.on("settings", settle3),
25875
+ model.settings.on("accounts", settle3),
25767
25876
  model.agent.on("active", () => {
25768
25877
  if (!this.agent) this.#refresh(true);
25769
25878
  }),
25770
- model.agent.on("agents", settle2),
25879
+ model.agent.on("agents", settle3),
25771
25880
  ...model.tabs ? [model.tabs.on("tabs", () => this.requestUpdate())] : [],
25772
- ...onWatch(model, settle2),
25881
+ ...onWatch(model, settle3),
25773
25882
  ...model.agent.starting ? [model.agent.on("starting", () => this.requestUpdate())] : [],
25774
25883
  model.agent.on("messages", (agentId) => {
25775
25884
  if (agentId === this.#id()) this.#refresh(this.#sent(agentId));
@@ -25971,8 +26080,8 @@ var SliccChat = class _SliccChat extends ThemedElement {
25971
26080
  this.#observe();
25972
26081
  }
25973
26082
  focus() {
25974
- if (!touched && globalThis.matchMedia("(pointer: fine)").matches)
25975
- this.focusOn("slicc-composer", ".log");
26083
+ if (touched) return;
26084
+ if (globalThis.matchMedia("(pointer: fine)").matches) this.focusOn("slicc-composer", ".log");
25976
26085
  else this.focusOn(".log");
25977
26086
  }
25978
26087
  #id() {
@@ -26237,11 +26346,12 @@ var SliccChat = class _SliccChat extends ThemedElement {
26237
26346
  render() {
26238
26347
  this.#handlers.color = this.color;
26239
26348
  this.#handlers.model = this.model ?? null;
26349
+ this.#handlers.surface ??= readSurface(this.renderRoot);
26240
26350
  const agent = this.#agent();
26241
26351
  this.#switched(agent);
26242
- const watch = watchOnly(this.model);
26352
+ const watch2 = watchOnly(this.model);
26243
26353
  const seat = this.model?.seat;
26244
- this.#handlers.readOnly = !!agent?.frozen || !!watch || !!seat;
26354
+ this.#handlers.readOnly = !!agent?.frozen || !!watch2 || !!seat;
26245
26355
  this.#handlers.agentId = agent?.id;
26246
26356
  this.#handlers.seat = seat?.label;
26247
26357
  const messages = agent ? this.model?.agent.messages(agent.id) ?? [] : [];
@@ -26274,7 +26384,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
26274
26384
  items,
26275
26385
  ([key2]) => key2,
26276
26386
  ([, item2]) => item2
26277
- )}</swc-conversation-thread>` : this.model?.tabs?.state().role === "connecting" ? b`<div class="empty" data-connecting>${connecting}</div>` : this.model?.agent.starting?.() ? A : b`<div class="empty" data-empty>${empty3(watch, seat, agent?.name ?? "the agent")}</div>`}
26387
+ )}</swc-conversation-thread>` : this.model?.tabs?.state().role === "connecting" ? b`<div class="empty" data-connecting>${connecting}</div>` : this.model?.agent.starting?.() ? A : b`<div class="empty" data-empty>${empty3(watch2, seat, agent?.name ?? "the agent")}</div>`}
26278
26388
  </div>
26279
26389
  </div>
26280
26390
  ${this.behind ? this.#latest(count2 - this.#mark) : A}
@@ -26287,7 +26397,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
26287
26397
  </swc-illustrated-message>
26288
26398
  </swc-dropzone>` : A}
26289
26399
  <p class="sr" role="status" data-announce="drop">${this.dropping ? "Drop to attach files to your message" : ""}</p>
26290
- ${watch ? watch === following(this.model)?.refused ? A : b`<p class="watch-only" role="note" data-follow="watch">${watch}</p>` : this.model && !agent?.frozen ? b`<slicc-composer .model=${this.model} .agent=${this.agent}></slicc-composer>` : A}
26400
+ ${watch2 ? watch2 === following(this.model)?.refused ? A : b`<p class="watch-only" role="note" data-follow="watch">${watch2}</p>` : this.model && !agent?.frozen ? b`<slicc-composer .model=${this.model} .agent=${this.agent}></slicc-composer>` : A}
26291
26401
  `;
26292
26402
  }
26293
26403
  };
@@ -27852,9 +27962,9 @@ function sparkline(points, width = 120, height = 28) {
27852
27962
  (value, i26) => `${(i26 / (points.length - 1) * width).toFixed(1)},${(height - (value - min2) / span * (height - 2) - 1).toFixed(1)}`
27853
27963
  ).join(" ");
27854
27964
  }
27855
- function meterVariant2(ratio) {
27856
- if (ratio >= 0.9) return "negative";
27857
- if (ratio >= 0.6) return "notice";
27965
+ function meterVariant2(ratio2) {
27966
+ if (ratio2 >= 0.9) return "negative";
27967
+ if (ratio2 >= 0.6) return "notice";
27858
27968
  return "informative";
27859
27969
  }
27860
27970
  var surfaces = {
@@ -31041,10 +31151,10 @@ var SliccNetwork = class extends ModelElement {
31041
31151
  const scroll = () => this.renderRoot.querySelector("[data-pairing]")?.scrollIntoView({ block: "nearest" });
31042
31152
  scroll();
31043
31153
  this.#settle?.disconnect();
31044
- const settle2 = new ResizeObserver(scroll);
31045
- settle2.observe(this.renderRoot.querySelector(".page"));
31046
- this.#settle = settle2;
31047
- setTimeout(() => settle2.disconnect(), 1e3);
31154
+ const settle3 = new ResizeObserver(scroll);
31155
+ settle3.observe(this.renderRoot.querySelector(".page"));
31156
+ this.#settle = settle3;
31157
+ setTimeout(() => settle3.disconnect(), 1e3);
31048
31158
  });
31049
31159
  }
31050
31160
  willUpdate(changed2) {
@@ -32784,9 +32894,9 @@ var SliccTerminalPanel = class extends ThemedElement {
32784
32894
  }
32785
32895
  #seen(panel, screen) {
32786
32896
  const sized = laid(panel.api) ? Promise.resolve() : new Promise((resolve2) => {
32787
- const watch = panel.api.onDidDimensionsChange((size4) => {
32897
+ const watch2 = panel.api.onDidDimensionsChange((size4) => {
32788
32898
  if (!laid(size4)) return;
32789
- watch.dispose();
32899
+ watch2.dispose();
32790
32900
  resolve2();
32791
32901
  });
32792
32902
  });
@@ -37049,14 +37159,14 @@ var SliccApp = class extends ThemedElement {
37049
37159
  }
37050
37160
  subscribe(model) {
37051
37161
  const update = () => this.requestUpdate();
37052
- const settle2 = () => settleModels(model);
37053
- queueMicrotask(settle2);
37162
+ const settle3 = () => settleModels(model);
37163
+ queueMicrotask(settle3);
37054
37164
  return [
37055
37165
  ...super.subscribe(model),
37056
- model.settings.on("settings", settle2),
37057
- model.settings.on("accounts", settle2),
37166
+ model.settings.on("settings", settle3),
37167
+ model.settings.on("accounts", settle3),
37058
37168
  model.agent.on("agents", () => {
37059
- settle2();
37169
+ settle3();
37060
37170
  this.#prune();
37061
37171
  update();
37062
37172
  }),
@@ -37081,17 +37191,18 @@ var SliccApp = class extends ThemedElement {
37081
37191
  ...model.tabs ? [model.tabs.on("tabs", update)] : [],
37082
37192
  ...model.agent.readOnly ? [
37083
37193
  model.agent.on("readOnly", () => {
37084
- settle2();
37194
+ settle3();
37085
37195
  update();
37086
37196
  })
37087
37197
  ] : [],
37088
37198
  ...model.follow ? [
37089
37199
  model.follow.on("follow", () => {
37090
- settle2();
37200
+ settle3();
37091
37201
  this.#followed(model);
37092
37202
  update();
37093
37203
  })
37094
- ] : []
37204
+ ] : [],
37205
+ flushStarting(this, model)
37095
37206
  ];
37096
37207
  }
37097
37208
  connectedCallback() {
@@ -37436,12 +37547,19 @@ var SliccApp = class extends ThemedElement {
37436
37547
  event2.preventDefault();
37437
37548
  this.#detach(id, null, false);
37438
37549
  }
37550
+ #railClick(event2, id) {
37551
+ if (event2.pointerType === "touch" || event2.pointerType === "pen")
37552
+ [...this.renderRoot.querySelectorAll("swc-tooltip")].find(
37553
+ (tip) => tip.getAttribute("for") === `rail-${id}`
37554
+ ).open = false;
37555
+ this.show(id);
37556
+ }
37439
37557
  #railButton(item2, side) {
37440
37558
  const changes2 = item2.id === "changes" ? this.#changes() : 0;
37441
37559
  const driven = item2.id === "browser" && !!this.model?.browser.list().some((tab) => tab.controlled);
37442
37560
  const visible2 = shown2(this.dock, item2.id);
37443
37561
  const label = `${visible2 ? `${item2.title}, shown` : `Open ${item2.title}`}${changes2 ? `, ${changeCount(changes2)}` : driven ? ", a tab is in use" : ""}`;
37444
- const button = u22`<swc-action-button id=${`rail-${item2.id}`} class=${visible2 ? "selected" : ""} quiet size="m" accessible-label=${label} data-surface=${item2.id} data-cone=${o2(item2.cone)} ?data-visible=${visible2} @click=${() => this.show(item2.id)}>${railIcon(item2.icon)}</swc-action-button>`;
37562
+ const button = u22`<swc-action-button id=${`rail-${item2.id}`} class=${visible2 ? "selected" : ""} quiet size="m" accessible-label=${label} data-surface=${item2.id} data-cone=${o2(item2.cone)} ?data-visible=${visible2} @click=${(event2) => this.#railClick(event2, item2.id)}>${railIcon(item2.icon)}</swc-action-button>`;
37445
37563
  const tooltip = b`<swc-tooltip for=${`rail-${item2.id}`} placement=${{ left: "end", right: "start", bottom: "top" }[side]}>${item2.title}</swc-tooltip>`;
37446
37564
  return changes2 ? b`<span class="badged">${button}<swc-badge size="s" variant="neutral" aria-hidden="true">${changes2}</swc-badge></span>${tooltip}` : driven ? b`<span class="badged">${button}<span class="dot" data-driven aria-hidden="true"></span></span>${tooltip}` : b`${button}${tooltip}`;
37447
37565
  }
@@ -42576,7 +42694,7 @@ var SliccSettings = class extends ThemedElement {
42576
42694
  ];
42577
42695
  subscribe(model) {
42578
42696
  const update = () => this.requestUpdate();
42579
- const settle2 = () => {
42697
+ const settle3 = () => {
42580
42698
  settleModels(model);
42581
42699
  update();
42582
42700
  };
@@ -42592,8 +42710,8 @@ var SliccSettings = class extends ThemedElement {
42592
42710
  return [
42593
42711
  ...super.subscribe(model),
42594
42712
  ...developer && model.updates ? [model.updates.on("items", update)] : [],
42595
- model.settings.on("settings", settle2),
42596
- model.settings.on("accounts", settle2),
42713
+ model.settings.on("settings", settle3),
42714
+ model.settings.on("accounts", settle3),
42597
42715
  model.settings.on("providers", update),
42598
42716
  ...model.vault ? [model.vault.on("status", update), model.vault.on("list", update)] : []
42599
42717
  ];
@@ -44063,12 +44181,12 @@ var SliccSprinkle = class extends ThemedElement {
44063
44181
  const held2 = { port, id, ready: false, value: null };
44064
44182
  this.#held = held2;
44065
44183
  this.#frame = { key: "", doc: "" };
44066
- const settle2 = (value) => {
44184
+ const settle3 = (value) => {
44067
44185
  held2.value = value ?? null;
44068
44186
  held2.ready = true;
44069
44187
  if (this.#held === held2) this.requestUpdate();
44070
44188
  };
44071
- ask.call(port, id, "getState", []).then(settle2, () => settle2(null));
44189
+ ask.call(port, id, "getState", []).then(settle3, () => settle3(null));
44072
44190
  }
44073
44191
  willUpdate(changed2) {
44074
44192
  super.willUpdate(changed2);
@@ -44142,15 +44260,15 @@ ${data.html}`;
44142
44260
  const bridged = !!this.model?.sprinkles.call;
44143
44261
  if (bridged && !this.#held.ready) return b``;
44144
44262
  const state2 = bridged ? this.#held : void 0;
44145
- const watch = !!watchOnly(this.model) || !!this.model?.seat;
44146
- const caption2 = watch ? b`<span class="view-only" data-view-only>View only on this device</span>` : A;
44263
+ const watch2 = !!watchOnly(this.model) || !!this.model?.seat;
44264
+ const caption2 = watch2 ? b`<span class="view-only" data-view-only>View only on this device</span>` : A;
44147
44265
  const style = `color-scheme:${this.color};${this.inline ? `height:${this.height}px;` : ""}`;
44148
44266
  const frame = b`${i22(
44149
44267
  this.#mounts,
44150
- b`<iframe title=${data.title} sandbox="allow-scripts" ?inert=${watch} style=${style} .srcdoc=${this.#document(data, state2)}></iframe>`
44268
+ b`<iframe title=${data.title} sandbox="allow-scripts" ?inert=${watch2} style=${style} .srcdoc=${this.#document(data, state2)}></iframe>`
44151
44269
  )}`;
44152
44270
  if (!this.inline)
44153
- return watch ? b`<div class="panel"><div class="bar">${caption2}</div>${frame}</div>` : frame;
44271
+ return watch2 ? b`<div class="panel"><div class="bar">${caption2}</div>${frame}</div>` : frame;
44154
44272
  return b`<div class="handle" draggable="true" title="Drag into the dock or a rail to open as a panel" @dragstart=${this.#drag}>
44155
44273
  ${grip}
44156
44274
  <span class="name">${data.title}</span>
@@ -53244,21 +53362,21 @@ function getTransformers(options2) {
53244
53362
  }
53245
53363
  function sortTransformersByEnforcement(transformers) {
53246
53364
  const pre = [];
53247
- const post = [];
53365
+ const post2 = [];
53248
53366
  const normal = [];
53249
53367
  for (const transformer of transformers) switch (transformer.enforce) {
53250
53368
  case "pre":
53251
53369
  pre.push(transformer);
53252
53370
  break;
53253
53371
  case "post":
53254
- post.push(transformer);
53372
+ post2.push(transformer);
53255
53373
  break;
53256
53374
  default:
53257
53375
  normal.push(transformer);
53258
53376
  }
53259
53377
  return {
53260
53378
  pre,
53261
- post,
53379
+ post: post2,
53262
53380
  normal
53263
53381
  };
53264
53382
  }
@@ -55276,8 +55394,8 @@ function recursion(pattern2, data) {
55276
55394
  numCapturesPassed
55277
55395
  );
55278
55396
  const pre = pattern2.slice(0, startPos);
55279
- const post = pattern2.slice(startPos + groupContents.length);
55280
- pattern2 = `${pre}${expansion2}${post}`;
55397
+ const post2 = pattern2.slice(startPos + groupContents.length);
55398
+ pattern2 = `${pre}${expansion2}${post2}`;
55281
55399
  token.lastIndex += expansion2.length - m16.length - groupContentsLeft.length - groupContentsRight.length;
55282
55400
  openGroups.forEach((g7) => g7.hasRecursedWithin = true);
55283
55401
  hasRecursed = true;
@@ -60186,9 +60304,9 @@ function transformerStyleToClass(options2 = {}) {
60186
60304
  return classToStyle;
60187
60305
  },
60188
60306
  getCSS() {
60189
- let css2 = "";
60190
- for (const [className, style] of classToStyle.entries()) css2 += `.${className}{${typeof style === "string" ? style : stringifyStyle(style)}}`;
60191
- return css2;
60307
+ let css3 = "";
60308
+ for (const [className, style] of classToStyle.entries()) css3 += `.${className}{${typeof style === "string" ? style : stringifyStyle(style)}}`;
60309
+ return css3;
60192
60310
  },
60193
60311
  clearRegistry() {
60194
60312
  classToStyle.clear();
@@ -95816,7 +95934,7 @@ var FileTree = class {
95816
95934
  };
95817
95935
 
95818
95936
  // src/components/file-tree.ts
95819
- var css = `
95937
+ var css2 = `
95820
95938
  :host {
95821
95939
  display: block;
95822
95940
  height: 100%;
@@ -96127,7 +96245,7 @@ ${view.focused}`;
96127
96245
  connectedCallback() {
96128
96246
  const root2 = this.shadowRoot ?? this.attachShadow({ mode: "open", delegatesFocus: true });
96129
96247
  if (!this.#mount) {
96130
- adoptStyles(root2, css);
96248
+ adoptStyles(root2, css2);
96131
96249
  this.#mount = document.createElement("div");
96132
96250
  this.#mount.className = "mount";
96133
96251
  root2.append(this.#mount);