@pygmalionjs/pygmalion 0.6.10 → 0.6.12

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.
@@ -2,8 +2,8 @@ var dm = Object.defineProperty;
2
2
  var um = (e, t, n) => t in e ? dm(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var vn = (e, t, n) => um(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsx as a, jsxs as g, Fragment as He } from "react/jsx-runtime";
5
- import { R as hi, u as fm, b as hm, c as Ya, d as Gd, g as ut, f as mm, m as Dt, e as f, h as Lt, r as hn, i as Ws, j as er, k as Ga, l as In, n as Xd, o as Ir, p as pm, q as Yn, t as We, v as gm, w as bm, x as xm, y as vm, z as ym, A as wm, B as Sm, C as Hs, D as Nm, E as Im, G as Cm, H as Pm, I as $m, J as Mm, S as Em, K as km, L as Jd, M as Am, O as Us, P as Rm, Q as Tm, T as Fm, U as Lm, V as _m, W as sl, X as al, Y as Qd, Z as Zd, _ as zm, $ as cl, a0 as Dm, a1 as eu, a2 as Om, a3 as jm, a4 as Bm, a5 as Wm, a6 as Hm, a7 as Um, a8 as tu, a9 as Vm, aa as Km, ab as ee, ac as ll, ad as dl, ae as qm, af as ps, ag as Ym, ah as Qo, ai as Vs, aj as Gm, ak as nu, al as Xm, am as Jm, an as Qm, s as Zm, ao as ep, ap as ru, aq as mi, ar as tp, as as np, at as ou, au as iu, av as Ks, aw as su, ax as rp, ay as op, az as ul, aA as ip, aB as sp, aC as fl, aD as ap, aE as cp, aF as lp, aG as dp, aH as gs, aI as up, aJ as fp, aK as hp, aL as mp, aM as pp, aN as gp, aO as bp, aP as xp, a as vp, aQ as yp, aR as wp, aS as Sp, aT as Np, aU as Ip, aV as Cp, aW as Pp, aX as $p, aY as Mp, aZ as Ep, a_ as kp, a$ as Ap, b0 as Rp, b1 as qr, b2 as hl, b3 as Tp, b4 as Fp, b5 as Lp, b6 as _p, b7 as ml } from "./FrozenRoutePreview-CPnB5j1D.js";
6
- import { b8 as hN, b9 as mN, ba as pN, bb as gN, bc as bN, bd as xN, be as vN, bf as yN, bg as wN, bh as SN, bi as NN, bj as IN, bk as CN, bl as PN, bm as $N, bn as MN, bo as EN } from "./FrozenRoutePreview-CPnB5j1D.js";
5
+ import { R as hi, u as fm, b as hm, c as Ya, d as Gd, g as ut, f as mm, m as Dt, e as f, h as Lt, r as hn, i as Ws, j as er, k as Ga, l as In, n as Xd, o as Ir, p as pm, q as Yn, t as We, v as gm, w as bm, x as xm, y as vm, z as ym, A as wm, B as Sm, C as Hs, D as Nm, E as Im, G as Cm, H as Pm, I as $m, J as Mm, S as Em, K as km, L as Jd, M as Am, O as Us, P as Rm, Q as Tm, T as Fm, U as Lm, V as _m, W as sl, X as al, Y as Qd, Z as Zd, _ as zm, $ as cl, a0 as Dm, a1 as eu, a2 as Om, a3 as jm, a4 as Bm, a5 as Wm, a6 as Hm, a7 as Um, a8 as tu, a9 as Vm, aa as Km, ab as ee, ac as ll, ad as dl, ae as qm, af as ps, ag as Ym, ah as Qo, ai as Vs, aj as Gm, ak as nu, al as Xm, am as Jm, an as Qm, s as Zm, ao as ep, ap as ru, aq as mi, ar as tp, as as np, at as ou, au as iu, av as Ks, aw as su, ax as rp, ay as op, az as ul, aA as ip, aB as sp, aC as fl, aD as ap, aE as cp, aF as lp, aG as dp, aH as gs, aI as up, aJ as fp, aK as hp, aL as mp, aM as pp, aN as gp, aO as bp, aP as xp, a as vp, aQ as yp, aR as wp, aS as Sp, aT as Np, aU as Ip, aV as Cp, aW as Pp, aX as $p, aY as Mp, aZ as Ep, a_ as kp, a$ as Ap, b0 as Rp, b1 as qr, b2 as hl, b3 as Tp, b4 as Fp, b5 as Lp, b6 as _p, b7 as ml } from "./FrozenRoutePreview-CGxN_gIm.js";
6
+ import { b8 as mN, b9 as pN, ba as gN, bb as bN, bc as xN, bd as vN, be as yN, bf as wN, bg as SN, bh as NN, bi as IN, bj as CN, bk as PN, bl as $N, bm as MN, bn as EN, bo as kN } from "./FrozenRoutePreview-CGxN_gIm.js";
7
7
  import { useRef as ke, useLayoutEffect as Cr, useSyncExternalStore as qe, useCallback as kt, useReducer as au, useEffect as ie, memo as cu, createElement as ho, useState as Q, useMemo as wt } from "react";
8
8
  import { createPortal as zp } from "react-dom";
9
9
  const Xa = {
@@ -572,7 +572,7 @@ function qi(e) {
572
572
  c.has(l) || t.push(`Screenshot asset "${l}" is unreferenced.`);
573
573
  return { valid: t.length === 0, errors: t, bytes: n };
574
574
  }
575
- function RS(e, t) {
575
+ function TS(e, t) {
576
576
  var o;
577
577
  const n = qi(e);
578
578
  if (!n.valid)
@@ -585,7 +585,7 @@ function RS(e, t) {
585
585
  t
586
586
  ) : null;
587
587
  }
588
- function TS(e, t) {
588
+ function FS(e, t) {
589
589
  var s;
590
590
  const n = qi(e);
591
591
  if (!n.valid)
@@ -2496,7 +2496,7 @@ function Sb(e, t) {
2496
2496
  );
2497
2497
  nr.get(e) !== t && (nr.set(e, t), yc());
2498
2498
  }
2499
- function FS() {
2499
+ function LS() {
2500
2500
  nr.size && (nr.clear(), yc());
2501
2501
  }
2502
2502
  function Nb() {
@@ -2633,7 +2633,7 @@ function kb(e, t) {
2633
2633
  (Ht == null ? void 0 : Ht.adapter) === t && Ci(!0);
2634
2634
  };
2635
2635
  }
2636
- function LS(e) {
2636
+ function _S(e) {
2637
2637
  const t = Ht;
2638
2638
  if (!t || yt.phase !== "interacting" || !yt.scroll)
2639
2639
  return !1;
@@ -3295,45 +3295,45 @@ function Zi(e = {}) {
3295
3295
  }
3296
3296
  async function k(_, D) {
3297
3297
  if (e.prepare) return e.prepare(_, D);
3298
- const { getDesignImportController: B } = await import("./FrozenRoutePreview-CPnB5j1D.js").then((I) => I.bq), C = B();
3298
+ const { getDesignImportController: j } = await import("./FrozenRoutePreview-CGxN_gIm.js").then((I) => I.bq), C = j();
3299
3299
  if (!C)
3300
3300
  throw new Error("The design import controller is not available.");
3301
3301
  return C.prepareScreenCapture(_, D);
3302
3302
  }
3303
3303
  async function L(_, D) {
3304
3304
  if (e.settle) return e.settle(_, D);
3305
- const { settleScreen: B } = await import("./FrozenRoutePreview-CPnB5j1D.js").then((C) => C.bp);
3306
- return B(_, D);
3305
+ const { settleScreen: j } = await import("./FrozenRoutePreview-CGxN_gIm.js").then((C) => C.bp);
3306
+ return j(_, D);
3307
3307
  }
3308
3308
  async function P(_, D) {
3309
3309
  if (e.serialize) return e.serialize(_, D);
3310
- const { serializeRoutePreview: B } = await Promise.resolve().then(() => ga);
3311
- return B(_, D);
3310
+ const { serializeRoutePreview: j } = await Promise.resolve().then(() => ga);
3311
+ return j(_, D);
3312
3312
  }
3313
3313
  async function R(_, D) {
3314
3314
  if (e.publish) return e.publish(_, D);
3315
- const { setRoutePreviewSnapshot: B } = await Promise.resolve().then(() => ga);
3316
- return B(_, D);
3315
+ const { setRoutePreviewSnapshot: j } = await Promise.resolve().then(() => ga);
3316
+ return j(_, D);
3317
3317
  }
3318
- function N(_, D, B) {
3318
+ function N(_, D, j) {
3319
3319
  for (let C = D; C < _.waypoints.length; C += 1)
3320
3320
  _.waypoints[C].cacheKey && E(_.waypoints[C].screenId, {
3321
3321
  status: "failed",
3322
3322
  pathId: _.id,
3323
- reason: B
3323
+ reason: j
3324
3324
  });
3325
3325
  }
3326
3326
  async function T(_, D) {
3327
3327
  var Pe, U, se, ae;
3328
- const B = o();
3329
- if (!B) {
3328
+ const j = o();
3329
+ if (!j) {
3330
3330
  N(_, 0, "flow session container unavailable");
3331
3331
  return;
3332
3332
  }
3333
3333
  const C = sx(_), I = C != null, A = (C == null ? void 0 : C.iframe) ?? r();
3334
3334
  let X = (C == null ? void 0 : C.skip) ?? 0, ge = !1;
3335
3335
  const _e = l(), te = _.waypoints[0];
3336
- A.style.width = `${Math.round(te.width)}px`, A.style.height = `${Math.round(te.height)}px`, I || B.appendChild(A);
3336
+ A.style.width = `${Math.round(te.width)}px`, A.style.height = `${Math.round(te.height)}px`, I || j.appendChild(A);
3337
3337
  try {
3338
3338
  I || (await d(A, _.url), Jn.boots += 1, Jn.bootsByRunner[n] = (Jn.bootsByRunner[n] ?? 0) + 1);
3339
3339
  for (let K = 0; K < _.waypoints.length; K += 1) {
@@ -3417,17 +3417,17 @@ function Zi(e = {}) {
3417
3417
  */
3418
3418
  materialize(_) {
3419
3419
  let D = 0;
3420
- for (const B of _)
3421
- if (!(h.has(B.id) || (B.waypoints.some((A) => A.cacheKey) ? B.waypoints.filter(
3420
+ for (const j of _)
3421
+ if (!(h.has(j.id) || (j.waypoints.some((A) => A.cacheKey) ? j.waypoints.filter(
3422
3422
  (A) => A.cacheKey && !u.has(A.screenId)
3423
- ) : B.waypoints).length === 0)) {
3424
- h.add(B.id);
3425
- for (const A of B.waypoints)
3423
+ ) : j.waypoints).length === 0)) {
3424
+ h.add(j.id);
3425
+ for (const A of j.waypoints)
3426
3426
  A.cacheKey && !u.has(A.screenId) && E(A.screenId, {
3427
3427
  status: "pending",
3428
- pathId: B.id
3428
+ pathId: j.id
3429
3429
  });
3430
- x.push(B), D += 1;
3430
+ x.push(j), D += 1;
3431
3431
  }
3432
3432
  return D > 0 && (y(), W()), D;
3433
3433
  },
@@ -3440,10 +3440,10 @@ function Zi(e = {}) {
3440
3440
  */
3441
3441
  pruneQueue(_) {
3442
3442
  let D = 0;
3443
- for (let B = x.length - 1; B >= 0; B -= 1) {
3444
- const C = x[B];
3443
+ for (let j = x.length - 1; j >= 0; j -= 1) {
3444
+ const C = x[j];
3445
3445
  if (!_(C)) {
3446
- x.splice(B, 1), h.delete(C.id);
3446
+ x.splice(j, 1), h.delete(C.id);
3447
3447
  for (const I of C.waypoints) {
3448
3448
  if (!I.cacheKey) continue;
3449
3449
  const A = u.get(I.screenId);
@@ -4386,7 +4386,7 @@ function Ai(e, t, n) {
4386
4386
  }
4387
4387
  );
4388
4388
  }
4389
- function _S({
4389
+ function zS({
4390
4390
  sourceRevision: e,
4391
4391
  recipes: t,
4392
4392
  recipeVersion: n,
@@ -4718,7 +4718,7 @@ function cv(e) {
4718
4718
  t.has(r) && n.add(r), t.add(r);
4719
4719
  return [...n];
4720
4720
  }
4721
- function zS(e, t) {
4721
+ function DS(e, t) {
4722
4722
  var s;
4723
4723
  const n = [], r = new Map(e.map((c) => [c.id, c])), o = /* @__PURE__ */ new Map();
4724
4724
  for (const c of e)
@@ -4793,7 +4793,7 @@ function dv(e, t) {
4793
4793
  const n = e.split("/"), r = t.split("/");
4794
4794
  return n.length !== r.length ? !1 : n.every((o, i) => o.startsWith(":") || o === "*" ? r[i].length > 0 : o === r[i]);
4795
4795
  }
4796
- function DS(e) {
4796
+ function OS(e) {
4797
4797
  const t = e.declaredScreens.map((o) => o.route).filter((o) => typeof o == "string").map(Fl), n = /* @__PURE__ */ new Set(), r = [];
4798
4798
  for (const o of e.routes) {
4799
4799
  const i = o.path ?? o.id;
@@ -6692,7 +6692,7 @@ function ny(e, t, n = Zv) {
6692
6692
  c,
6693
6693
  t.interactions ?? []
6694
6694
  ), D = null;
6695
- const B = () => {
6695
+ const j = () => {
6696
6696
  if (D == null || D.remove(), D = null, h.length === 0) return;
6697
6697
  const te = [];
6698
6698
  for (const Pe of u) {
@@ -6712,7 +6712,7 @@ function ny(e, t, n = Zv) {
6712
6712
  te.length !== 0 && (D = i.createElement("style"), D.dataset.pygmalionHeldPseudoStyle = "", D.textContent = te.join(`
6713
6713
  `), o.append(D));
6714
6714
  };
6715
- B();
6715
+ j();
6716
6716
  let C = !1, I = {
6717
6717
  mode: "frozen",
6718
6718
  seekRevision: 0
@@ -6725,7 +6725,7 @@ function ny(e, t, n = Zv) {
6725
6725
  get heldPseudoIssues() {
6726
6726
  return [...W.issues, ..._];
6727
6727
  },
6728
- refreshLinkedHeldPseudoCss: B,
6728
+ refreshLinkedHeldPseudoCss: j,
6729
6729
  restoreScrollInteractions: () => (C || (_ = $s(
6730
6730
  o,
6731
6731
  c,
@@ -6845,15 +6845,15 @@ const oy = We(function({
6845
6845
  }), v = ke(d);
6846
6846
  v.current = d;
6847
6847
  const [y, E] = Q(0), [k, L] = Q([]), P = f.frozenPreviewOverrideCss(t), R = f.frozenPreviewMutations(), N = JSON.stringify(R), T = f.previewMotionState(t.id), W = T.targetId ? Qd(t).find(
6848
- (B) => B.id === T.targetId
6848
+ (j) => j.id === T.targetId
6849
6849
  ) : void 0, _ = `${mc()}:${s}:shared-overrides`, D = ke(l);
6850
6850
  return D.current = l, ie(() => {
6851
- const B = m.current;
6852
- if (!B) return;
6851
+ const j = m.current;
6852
+ if (!j) return;
6853
6853
  let C = null;
6854
6854
  const I = Lx(() => {
6855
6855
  try {
6856
- C = ny(B, {
6856
+ C = ny(j, {
6857
6857
  ...r ? {
6858
6858
  bodyHtml: r.bodyHtml,
6859
6859
  bodyAttributes: r.bodyAttributes,
@@ -6880,13 +6880,13 @@ const oy = We(function({
6880
6880
  }, C == null || C.teardown(), h.current === C && (h.current = null);
6881
6881
  };
6882
6882
  }, [r, i, _, n]), ie(() => {
6883
- const B = h.current;
6884
- if (!B) return;
6883
+ const j = h.current;
6884
+ if (!j) return;
6885
6885
  let C = !1, I = null;
6886
6886
  return (async () => {
6887
6887
  var X;
6888
6888
  const A = Array.from(
6889
- B.root.querySelectorAll('link[rel~="stylesheet"]')
6889
+ j.root.querySelectorAll('link[rel~="stylesheet"]')
6890
6890
  );
6891
6891
  await Promise.all(
6892
6892
  A.map(
@@ -6894,14 +6894,14 @@ const oy = We(function({
6894
6894
  ge.addEventListener("load", () => _e(), { once: !0 }), ge.addEventListener("error", () => _e(), { once: !0 });
6895
6895
  })
6896
6896
  )
6897
- ), B.refreshLinkedHeldPseudoCss();
6897
+ ), j.refreshLinkedHeldPseudoCss();
6898
6898
  try {
6899
6899
  await ((X = document.fonts) == null ? void 0 : X.ready);
6900
6900
  } catch {
6901
6901
  }
6902
6902
  requestAnimationFrame(() => {
6903
6903
  requestAnimationFrame(() => {
6904
- C || (B.restoreScrollInteractions(), I = zm(t.id, B, {
6904
+ C || (j.restoreScrollInteractions(), I = zm(t.id, j, {
6905
6905
  stale: c || k.length > 0
6906
6906
  }), f.promoteFrozenLayerImportIfPending(t.id));
6907
6907
  });
@@ -6910,16 +6910,16 @@ const oy = We(function({
6910
6910
  C = !0, I == null || I();
6911
6911
  };
6912
6912
  }, [y, t.id, k, c]), ie(() => {
6913
- var B;
6914
- (B = h.current) == null || B.updateOverrideCss(P);
6913
+ var j;
6914
+ (j = h.current) == null || j.updateOverrideCss(P);
6915
6915
  }, [y, P]), ie(() => {
6916
- const B = h.current;
6917
- if (!B) return;
6916
+ const j = h.current;
6917
+ if (!j) return;
6918
6918
  b.current();
6919
6919
  let C = !1;
6920
- const I = Xv(B.root, R, {
6920
+ const I = Xv(j.root, R, {
6921
6921
  baseUrl: i
6922
- }), A = [I.cleanup], X = [...B.heldPseudoIssues, ...I.issues], ge = B.root.host.ownerDocument, _e = () => {
6922
+ }), A = [I.cleanup], X = [...j.heldPseudoIssues, ...I.issues], ge = j.root.host.ownerDocument, _e = () => {
6923
6923
  const se = [...new Set(X)];
6924
6924
  L(
6925
6925
  (ae) => JSON.stringify(ae) === JSON.stringify(se) ? ae : se
@@ -6930,7 +6930,7 @@ const oy = We(function({
6930
6930
  if (!se.component || se.staleReason) return [];
6931
6931
  let ae;
6932
6932
  try {
6933
- ae = [...B.root.querySelectorAll(se.selector)];
6933
+ ae = [...j.root.querySelectorAll(se.selector)];
6934
6934
  } catch {
6935
6935
  return X.push(`DOM selector cannot be applied:${se.key}`), [];
6936
6936
  }
@@ -6973,8 +6973,8 @@ const oy = We(function({
6973
6973
  });
6974
6974
  };
6975
6975
  }, [i, y, N, s]), ie(() => {
6976
- var B;
6977
- (B = h.current) == null || B.updateMotion({
6976
+ var j;
6977
+ (j = h.current) == null || j.updateMotion({
6978
6978
  mode: T.mode,
6979
6979
  progress: T.progress,
6980
6980
  seekRevision: T.seekRevision,
@@ -7154,7 +7154,7 @@ const py = We(function({
7154
7154
  const { appOrigin: l, previewRevision: d } = Jb(), u = ke(null), m = ke(null), h = ke(null), b = ke(null), x = ke(null), v = ke(!1), y = ke(Xb()), E = ke(
7155
7155
  () => {
7156
7156
  }
7157
- ), k = ke(null), L = ke(!1), P = ke(null), R = ke(0), N = ke(null), T = ke(null), [W, _] = Q(null), [D, B] = Q(!1), C = (W == null ? void 0 : W.width) ?? t.width ?? 390, I = (W == null ? void 0 : W.height) ?? hn(t), A = (W == null ? void 0 : W.x) ?? t.x ?? 0, X = (W == null ? void 0 : W.y) ?? t.y ?? 0, ge = c !== "idle", _e = c === "interacting", te = f.editMode ? n : _e, Pe = Dt(
7157
+ ), k = ke(null), L = ke(!1), P = ke(null), R = ke(0), N = ke(null), T = ke(null), [W, _] = Q(null), [D, j] = Q(!1), C = (W == null ? void 0 : W.width) ?? t.width ?? 390, I = (W == null ? void 0 : W.height) ?? hn(t), A = (W == null ? void 0 : W.x) ?? t.x ?? 0, X = (W == null ? void 0 : W.y) ?? t.y ?? 0, ge = c !== "idle", _e = c === "interacting", te = f.editMode ? n : _e, Pe = Dt(
7158
7158
  Lt(),
7159
7159
  an(t, n)
7160
7160
  ), U = Ut(
@@ -7293,12 +7293,12 @@ const py = We(function({
7293
7293
  ]), ie(() => {
7294
7294
  const Y = u.current;
7295
7295
  if (!Y || typeof IntersectionObserver > "u") {
7296
- B(!0);
7296
+ j(!0);
7297
7297
  return;
7298
7298
  }
7299
7299
  const de = new IntersectionObserver(
7300
7300
  ([Re]) => {
7301
- B(Re.isIntersecting);
7301
+ j(Re.isIntersecting);
7302
7302
  },
7303
7303
  { rootMargin: "600px" }
7304
7304
  );
@@ -8438,10 +8438,10 @@ ${o.join(`
8438
8438
  Jl = i;
8439
8439
  }
8440
8440
  }
8441
- function OS() {
8441
+ function jS() {
8442
8442
  return [...Tr.values()].map(rs);
8443
8443
  }
8444
- function jS(e) {
8444
+ function BS(e) {
8445
8445
  const t = Tr.get(e);
8446
8446
  return t ? rs(t) : void 0;
8447
8447
  }
@@ -8501,7 +8501,7 @@ function lh() {
8501
8501
  )
8502
8502
  );
8503
8503
  }
8504
- function BS(e, t = {}) {
8504
+ function WS(e, t = {}) {
8505
8505
  const n = Tr.get(e);
8506
8506
  if (!n)
8507
8507
  throw new Error(`Unknown component connection "${e}".`);
@@ -8818,12 +8818,12 @@ function Ty(e) {
8818
8818
  function ph() {
8819
8819
  return [...Di.entries()].map(([e, t]) => ({ name: e, value: t }));
8820
8820
  }
8821
- function WS(e, t) {
8821
+ function HS(e, t) {
8822
8822
  Di.set(e, t), document.documentElement.style.setProperty(e, t);
8823
8823
  const n = ph();
8824
8824
  Zn == null || Zn(n), fh(n);
8825
8825
  }
8826
- function HS() {
8826
+ function US() {
8827
8827
  for (const e of Di.keys()) document.documentElement.style.removeProperty(e);
8828
8828
  Di.clear(), Zn == null || Zn([]), fh([]);
8829
8829
  }
@@ -9286,7 +9286,7 @@ function cd({
9286
9286
  affectedFrames: n = []
9287
9287
  }) {
9288
9288
  var tl, nl, rl, ol, il;
9289
- const r = ke(null), [o, i] = Q(null), [s, c] = Q(null), [l, d] = Q(null), [u, m] = Q("cases"), [h, b] = Q(!1), [x, v] = Q(Uy), [y, E] = Q(null), [k, L] = Q("original"), [P, R] = Q("default"), [N, T] = Q("item"), [W, _] = Q("base"), [D, B] = Q({ minWidth: 768 }), [C, I] = Q(null), [A, X] = Q(!0), [ge, _e] = Q(!1), [te, Pe] = Q(!1), [U, se] = Q(null), [ae, K] = Q(""), [q, $e] = Q(!1), [Ie, Ae] = Q(""), [fe, me] = Q(!1), [ue, ot] = Q(""), [S, $] = Q(null), [F, G] = Q(""), [O, ce] = Q(""), [le, J] = Q(0), [Se, he] = au((p) => p + 1, 0), H = ke(""), Ce = ke(null), ye = ke(null);
9289
+ const r = ke(null), [o, i] = Q(null), [s, c] = Q(null), [l, d] = Q(null), [u, m] = Q("cases"), [h, b] = Q(!1), [x, v] = Q(Uy), [y, E] = Q(null), [k, L] = Q("original"), [P, R] = Q("default"), [N, T] = Q("item"), [W, _] = Q("base"), [D, j] = Q({ minWidth: 768 }), [C, I] = Q(null), [A, X] = Q(!0), [ge, _e] = Q(!1), [te, Pe] = Q(!1), [U, se] = Q(null), [ae, K] = Q(""), [q, $e] = Q(!1), [Ie, Ae] = Q(""), [fe, me] = Q(!1), [ue, ot] = Q(""), [S, $] = Q(null), [F, G] = Q(""), [O, ce] = Q(""), [le, J] = Q(0), [Se, he] = au((p) => p + 1, 0), H = ke(""), Ce = ke(null), ye = ke(null);
9290
9290
  ye.current = s;
9291
9291
  const Ne = ke(null);
9292
9292
  Ne.current = l;
@@ -9305,7 +9305,7 @@ function cd({
9305
9305
  ), Le = wt(() => {
9306
9306
  const p = mh(), w = {};
9307
9307
  for (const [M, V] of Object.entries(_y))
9308
- w[M] = p.filter((j) => V.test(j.name));
9308
+ w[M] = p.filter((B) => V.test(B.name));
9309
9309
  return w;
9310
9310
  }, []);
9311
9311
  if (ie(() => he(), []), ie(() => {
@@ -9333,13 +9333,13 @@ function cd({
9333
9333
  let w = !1;
9334
9334
  return me(!0), ot(""), p(Ye).then((M) => {
9335
9335
  if (w) return;
9336
- const V = [.../* @__PURE__ */ new Set([...Ye, ...M.files])], j = f.pages.filter(
9336
+ const V = [.../* @__PURE__ */ new Set([...Ye, ...M.files])], B = f.pages.filter(
9337
9337
  (we) => (we.sourcePaths ?? []).some(
9338
9338
  (Be) => V.some((Nt) => Wy(Be, Nt))
9339
9339
  )
9340
9340
  ).map((we) => ({ id: Vs(we), name: we.name })), ve = [
9341
9341
  ...ne.current,
9342
- ...j.filter(
9342
+ ...B.filter(
9343
9343
  (we) => !ne.current.some((Be) => Be.id === we.id)
9344
9344
  )
9345
9345
  ];
@@ -9376,17 +9376,17 @@ function cd({
9376
9376
  }, [Ve, Ge]), ie(() => {
9377
9377
  const p = [window];
9378
9378
  Ge && Ve && Ve !== window && p.push(Ve);
9379
- const w = (j) => {
9380
- if (j.key === "Alt" && _e(!0), Ne.current) return;
9381
- (j.metaKey || j.ctrlKey) && j.key.toLowerCase() === "z" ? (j.preventDefault(), j.stopPropagation(), j.shiftKey ? ee.redo() : ee.undo()) : j.key === "Escape" && ye.current && (j.stopPropagation(), c(null));
9382
- }, M = (j) => {
9383
- j.key === "Alt" && _e(!1);
9379
+ const w = (B) => {
9380
+ if (B.key === "Alt" && _e(!0), Ne.current) return;
9381
+ (B.metaKey || B.ctrlKey) && B.key.toLowerCase() === "z" ? (B.preventDefault(), B.stopPropagation(), B.shiftKey ? ee.redo() : ee.undo()) : B.key === "Escape" && ye.current && (B.stopPropagation(), c(null));
9382
+ }, M = (B) => {
9383
+ B.key === "Alt" && _e(!1);
9384
9384
  }, V = () => _e(!1);
9385
- for (const j of p)
9386
- j.addEventListener("keydown", w, !0), j.addEventListener("keyup", M, !0), j.addEventListener("blur", V);
9385
+ for (const B of p)
9386
+ B.addEventListener("keydown", w, !0), B.addEventListener("keyup", M, !0), B.addEventListener("blur", V);
9387
9387
  return () => {
9388
- for (const j of p)
9389
- j.removeEventListener("keydown", w, !0), j.removeEventListener("keyup", M, !0), j.removeEventListener("blur", V);
9388
+ for (const B of p)
9389
+ B.removeEventListener("keydown", w, !0), B.removeEventListener("keyup", M, !0), B.removeEventListener("blur", V);
9390
9390
  };
9391
9391
  }, [Ve, Ge]), ie(() => {
9392
9392
  const p = l;
@@ -9399,9 +9399,9 @@ function cd({
9399
9399
  p.textContent = H.current, ve && we !== H.current && (ee.recordText(p, we, Qe(p), ne.current), ee.toast("change text")), d(null);
9400
9400
  }, V = (ve) => {
9401
9401
  ve.stopPropagation(), ve.key === "Enter" ? (ve.preventDefault(), M(!0)) : ve.key === "Escape" && M(!1);
9402
- }, j = () => M(!0);
9403
- return p.addEventListener("keydown", V), p.addEventListener("blur", j), () => {
9404
- p.removeEventListener("keydown", V), p.removeEventListener("blur", j);
9402
+ }, B = () => M(!0);
9403
+ return p.addEventListener("keydown", V), p.addEventListener("blur", B), () => {
9404
+ p.removeEventListener("keydown", V), p.removeEventListener("blur", B);
9405
9405
  };
9406
9406
  }, [l]), ie(() => {
9407
9407
  if (ee.toastSeq === 0) return;
@@ -9416,7 +9416,7 @@ function cd({
9416
9416
  if (!M) return null;
9417
9417
  const V = M.contentDocument;
9418
9418
  if (!V) return null;
9419
- const j = M.getBoundingClientRect(), ve = V.elementFromPoint(p.clientX - j.left, p.clientY - j.top);
9419
+ const B = M.getBoundingClientRect(), ve = V.elementFromPoint(p.clientX - B.left, p.clientY - B.top);
9420
9420
  return !ve || ve.nodeType !== 1 || ve === V.body || ve === V.documentElement ? null : ve;
9421
9421
  }
9422
9422
  const w = t == null ? void 0 : t.current;
@@ -9493,12 +9493,12 @@ function cd({
9493
9493
  return;
9494
9494
  }
9495
9495
  try {
9496
- const j = await p(M);
9497
- ee.clearApplied(), $((j == null ? void 0 : j.qa) ?? null), se(null), K(""), Ae("");
9498
- const ve = j != null && j.qa ? j.qa.complete ? ` · ${j.qa.frames.length} affected frames checked` : ` · ${j.qa.failures.length} QA failures` : "";
9499
- ee.toast(`${(j == null ? void 0 : j.message) ?? `Applied ${(j == null ? void 0 : j.applied) ?? V} changes`}${ve}`);
9500
- } catch (j) {
9501
- ee.toast(`Apply failed:${String(j).slice(0, 80)}`);
9496
+ const B = await p(M);
9497
+ ee.clearApplied(), $((B == null ? void 0 : B.qa) ?? null), se(null), K(""), Ae("");
9498
+ const ve = B != null && B.qa ? B.qa.complete ? ` · ${B.qa.frames.length} affected frames checked` : ` · ${B.qa.failures.length} QA failures` : "";
9499
+ ee.toast(`${(B == null ? void 0 : B.message) ?? `Applied ${(B == null ? void 0 : B.applied) ?? V} changes`}${ve}`);
9500
+ } catch (B) {
9501
+ ee.toast(`Apply failed:${String(B).slice(0, 80)}`);
9502
9502
  }
9503
9503
  }, z = s != null && s.isConnected ? s : null, jt = o != null && o.isConnected ? o : null, be = z != null && z.parentElement && z.parentElement !== Me ? z.parentElement : null, St = N === "container" && be ? be : z, oe = z ? ze(z.getBoundingClientRect()) : null, Z = be ? ze(be.getBoundingClientRect()) : null, rr = N === "container" && St && St !== z ? ze(St.getBoundingClientRect()) : null, Fn = jt && jt !== z ? ze(jt.getBoundingClientRect()) : null, at = z ? Ve.getComputedStyle(z) : null, Xe = be ? Ve.getComputedStyle(be) : null, Io = St ? Ve.getComputedStyle(St) : null, Mt = z ? Qe(z) : "", pt = z ? At(z) : null, dn = z ? qm(z) : null, un = z ? ee.structuralEditKind(z) : null, is = z ? ee.hasPendingValueEdit(z) : !1, Co = z ? ee.structuralBlockReason(z, "insert") : "No elements are selected.", ss = z ? ee.structuralBlockReason(z, "remove") : "No elements are selected.", Cn = z ? ee.structuralBlockReason(z, "move") : "No elements are selected.", or = z && z.parentElement ? Array.from(z.parentElement.children).indexOf(z) : -1, Po = ((rl = z == null ? void 0 : z.parentElement) == null ? void 0 : rl.children.length) ?? 0, _r = pt ? ut()[pt.name] ?? null : null, ir = dn && /^[A-Z]/.test(dn.elementName) ? (pt == null ? void 0 : pt.name) ?? null : null, zr = z ? ee.componentInsertBlockReason(z, ir) : "No elements are selected.", $o = F.trim().toLocaleLowerCase(), Ln = st.filter(
9504
9504
  ([p, w]) => !$o || p.toLocaleLowerCase().includes($o) || w.importPath.toLocaleLowerCase().includes($o)
@@ -9512,7 +9512,7 @@ function cd({
9512
9512
  ...D.maxWidth != null ? { maxWidth: Math.max(0, Math.round(D.maxWidth)) } : {}
9513
9513
  } : null : ((ol = od.find((p) => p.id === W)) == null ? void 0 : ol.media) ?? null, Or = Dr.filter((p) => p.isConnected && Ve.getComputedStyle(p).getPropertyValue("display") !== "none").map((p, w) => ({ el: p, index: w, rect: ze(p.getBoundingClientRect()) })).filter(({ rect: p }) => p.width > 0 && p.height > 0), jr = Or.slice().sort((p, w) => p.rect.top - w.rect.top || p.rect.left - w.rect.left).reduce((p, w) => {
9514
9514
  const M = p.find((V) => Math.abs(V.top - w.rect.top) < 6);
9515
- return M ? (M.top = Math.min(M.top, w.rect.top), M.bottom = Math.max(M.bottom, w.rect.top + w.rect.height), M.left = Math.min(M.left, w.rect.left), M.right = Math.max(M.right, w.rect.left + w.rect.width), M.items.push(w), M.items.sort((V, j) => V.rect.left - j.rect.left)) : p.push({
9515
+ return M ? (M.top = Math.min(M.top, w.rect.top), M.bottom = Math.max(M.bottom, w.rect.top + w.rect.height), M.left = Math.min(M.left, w.rect.left), M.right = Math.max(M.right, w.rect.left + w.rect.width), M.items.push(w), M.items.sort((V, B) => V.rect.left - B.rect.left)) : p.push({
9516
9516
  top: w.rect.top,
9517
9517
  bottom: w.rect.top + w.rect.height,
9518
9518
  left: w.rect.left,
@@ -9521,7 +9521,7 @@ function cd({
9521
9521
  }), p;
9522
9522
  }, []).sort((p, w) => p.top - w.top), cs = jr.flatMap(
9523
9523
  (p, w) => p.items.slice(0, -1).map((M, V) => {
9524
- const j = p.items[V + 1], ve = M.rect.left + M.rect.width, we = j.rect.left, Be = Math.max(M.rect.top, j.rect.top), Nt = Math.min(M.rect.top + M.rect.height, j.rect.top + j.rect.height);
9524
+ const B = p.items[V + 1], ve = M.rect.left + M.rect.width, we = B.rect.left, Be = Math.max(M.rect.top, B.rect.top), Nt = Math.min(M.rect.top + M.rect.height, B.rect.top + B.rect.height);
9525
9525
  return { key: `${w}-${V}`, left: ve, top: Be, width: Math.max(0, we - ve), height: Math.max(16, Nt - Be) };
9526
9526
  })
9527
9527
  ), Wh = jr.slice(0, -1).map((p, w) => {
@@ -9568,10 +9568,10 @@ function cd({
9568
9568
  }, Ro = (p, w, M, V) => {
9569
9569
  if (p.button !== 0) return;
9570
9570
  p.preventDefault(), p.stopPropagation();
9571
- const j = p.clientX, ve = p.clientY, we = document.body.style.cursor, Be = document.body.style.userSelect;
9571
+ const B = p.clientX, ve = p.clientY, we = document.body.style.cursor, Be = document.body.style.userSelect;
9572
9572
  document.body.style.cursor = w, document.body.style.userSelect = "none";
9573
9573
  const Nt = (Mn) => {
9574
- M(Mn.clientX - j, Mn.clientY - ve), he();
9574
+ M(Mn.clientX - B, Mn.clientY - ve), he();
9575
9575
  }, $n = () => {
9576
9576
  window.removeEventListener("pointermove", Nt), window.removeEventListener("pointerup", $n), document.body.style.cursor = we, document.body.style.userSelect = Be, V(), he();
9577
9577
  };
@@ -9622,44 +9622,44 @@ function cd({
9622
9622
  }, hs = (p, w) => {
9623
9623
  if (!be) return;
9624
9624
  const M = be.style.getPropertyValue(p), V = p === "column-gap" ? xn : p === "row-gap" ? Br : Rt[p.replace("padding-", "")];
9625
- let j = V;
9625
+ let B = V;
9626
9626
  const ve = p === "column-gap" || p === "padding-left" || p === "padding-right", we = p === "padding-right" || p === "padding-bottom" ? -1 : 1;
9627
9627
  I(p), p.startsWith("padding-") && X(!1), Ro(
9628
9628
  w,
9629
9629
  ve ? "ew-resize" : "ns-resize",
9630
9630
  (Be, Nt) => {
9631
- j = Math.max(0, Math.min(256, Math.round(V + (ve ? Be : Nt) * we))), be.style.setProperty(p, `${j}px`);
9631
+ B = Math.max(0, Math.min(256, Math.round(V + (ve ? Be : Nt) * we))), be.style.setProperty(p, `${B}px`);
9632
9632
  },
9633
9633
  () => {
9634
- Dn(be, p, M), nt(p, `${j}px`), I(null), ee.toast(
9635
- `${p === "column-gap" ? "column spacing" : p === "row-gap" ? "row spacing" : p.replace("padding-", "padding")} ${j}px`
9634
+ Dn(be, p, M), nt(p, `${B}px`), I(null), ee.toast(
9635
+ `${p === "column-gap" ? "column spacing" : p === "row-gap" ? "row spacing" : p.replace("padding-", "padding")} ${B}px`
9636
9636
  );
9637
9637
  }
9638
9638
  );
9639
9639
  }, Fo = (p, w) => {
9640
9640
  if (!be || !Z) return;
9641
9641
  const M = be.style.getPropertyValue("width"), V = be.style.getPropertyValue("height");
9642
- let j = Math.round(Z.width), ve = Math.round(Z.height);
9642
+ let B = Math.round(Z.width), ve = Math.round(Z.height);
9643
9643
  Ro(
9644
9644
  w,
9645
9645
  p === "width" ? "ew-resize" : p === "height" ? "ns-resize" : "nwse-resize",
9646
9646
  (we, Be) => {
9647
- p !== "height" && (j = Math.max(200, Math.min(1920, Math.round(Z.width + we))), be.style.setProperty("width", `${j}px`)), p !== "width" && (ve = Math.max(80, Math.min(1600, Math.round(Z.height + Be))), be.style.setProperty("height", `${ve}px`));
9647
+ p !== "height" && (B = Math.max(200, Math.min(1920, Math.round(Z.width + we))), be.style.setProperty("width", `${B}px`)), p !== "width" && (ve = Math.max(80, Math.min(1600, Math.round(Z.height + Be))), be.style.setProperty("height", `${ve}px`));
9648
9648
  },
9649
9649
  () => {
9650
- Dn(be, "width", M), Dn(be, "height", V), p !== "height" && nt("width", `${j}px`), p !== "width" && nt("height", `${ve}px`), ee.toast(`container${j} × ${ve}px`);
9650
+ Dn(be, "width", M), Dn(be, "height", V), p !== "height" && nt("width", `${B}px`), p !== "width" && nt("height", `${ve}px`), ee.toast(`container${B} × ${ve}px`);
9651
9651
  }
9652
9652
  );
9653
9653
  }, rm = (p) => {
9654
9654
  if (!be || !z) return;
9655
- const w = be.style.getPropertyValue("display"), M = be.style.getPropertyValue("grid-template-columns"), V = z.style.getPropertyValue("min-width"), j = As(be, (oe == null ? void 0 : oe.width) ?? 240);
9656
- let ve = j;
9655
+ const w = be.style.getPropertyValue("display"), M = be.style.getPropertyValue("grid-template-columns"), V = z.style.getPropertyValue("min-width"), B = As(be, (oe == null ? void 0 : oe.width) ?? 240);
9656
+ let ve = B;
9657
9657
  Ro(
9658
9658
  p,
9659
9659
  "ew-resize",
9660
9660
  (we) => {
9661
9661
  var Be;
9662
- ve = Math.max(80, Math.min(600, Math.round(j + we))), be.style.setProperty("display", "grid"), be.style.setProperty(
9662
+ ve = Math.max(80, Math.min(600, Math.round(B + we))), be.style.setProperty("display", "grid"), be.style.setProperty(
9663
9663
  "grid-template-columns",
9664
9664
  `repeat(auto-fit, minmax(min(${ve}px, 100%), 1fr))`
9665
9665
  ), z.style.setProperty("min-width", "0"), (Be = Ce.current) == null || Be.mirrorStyle(z, "min-width", "0");
@@ -9675,7 +9675,7 @@ function cd({
9675
9675
  Ro(
9676
9676
  p,
9677
9677
  "ns-resize",
9678
- (j, ve) => {
9678
+ (B, ve) => {
9679
9679
  var we;
9680
9680
  V = Math.max(40, Math.min(1200, Math.round(M + ve))), z.style.setProperty("height", `${V}px`), (we = Ce.current) == null || we.mirrorStyle(z, "height", `${V}px`);
9681
9681
  },
@@ -9686,8 +9686,8 @@ function cd({
9686
9686
  }, Lo = (p, w, M) => {
9687
9687
  const V = p === "container" ? Z : oe;
9688
9688
  if (!V) return;
9689
- const j = M === "fill" ? "100%" : M === "hug" ? w === "width" ? "fit-content" : "auto" : `${Math.round(V[w])}px`;
9690
- p === "container" ? nt(w, j) : (ct(w, j), w === "width" && ct("flex", M === "fill" ? "1 1 0" : "0 0 auto")), ee.toast(`${p === "container" ? "container" : "item"} ${w === "width" ? "width" : "height"} ${M}`);
9689
+ const B = M === "fill" ? "100%" : M === "hug" ? w === "width" ? "fit-content" : "auto" : `${Math.round(V[w])}px`;
9690
+ p === "container" ? nt(w, B) : (ct(w, B), w === "width" && ct("flex", M === "fill" ? "1 1 0" : "0 0 auto")), ee.toast(`${p === "container" ? "container" : "item"} ${w === "width" ? "width" : "height"} ${M}`);
9691
9691
  }, ms = (p, w) => {
9692
9692
  const M = A ? p === "left" || p === "right" ? ["left", "right"] : ["top", "bottom"] : [p];
9693
9693
  for (const V of M) nt(`padding-${V}`, `${Math.max(0, w)}px`);
@@ -9712,15 +9712,15 @@ function cd({
9712
9712
  "text-overflow": "ellipsis",
9713
9713
  "overflow-wrap": "normal"
9714
9714
  };
9715
- for (const [j, ve] of Object.entries(M))
9715
+ for (const [B, ve] of Object.entries(M))
9716
9716
  ee.recordStyle(
9717
9717
  w,
9718
- j,
9718
+ B,
9719
9719
  ve,
9720
9720
  Qe(w),
9721
9721
  nn,
9722
9722
  ne.current
9723
- ), (V = Ce.current) == null || V.mirrorStyle(w, j, ve);
9723
+ ), (V = Ce.current) == null || V.mirrorStyle(w, B, ve);
9724
9724
  ee.toast(p === "wrap" ? "Change to multi-line content" : "Change to one line abbreviation");
9725
9725
  }, Vr = h ? Oy : Dy, sm = u === "cases" && Z && Z.left + Z.width > window.innerWidth - Vr - 32 || oe && oe.left + oe.width / 2 > window.innerWidth / 2 ? 16 : Math.max(16, window.innerWidth - Vr - 16), am = Ge ? 54 : 64, Zc = Math.max(8, Math.min((x == null ? void 0 : x.x) ?? sm, window.innerWidth - Vr - 8)), el = Math.max(8, Math.min((x == null ? void 0 : x.y) ?? am, window.innerHeight - 80)), cm = (p) => {
9726
9726
  if (p.button !== 0) return;
@@ -9732,10 +9732,10 @@ function cd({
9732
9732
  x: Math.max(8, Math.min(w.left + ve.clientX - w.x, window.innerWidth - Vr - 8)),
9733
9733
  y: Math.max(8, Math.min(w.top + ve.clientY - w.y, window.innerHeight - 80))
9734
9734
  }, v(M);
9735
- }, j = () => {
9736
- id(M), window.removeEventListener("mousemove", V), window.removeEventListener("mouseup", j);
9735
+ }, B = () => {
9736
+ id(M), window.removeEventListener("mousemove", V), window.removeEventListener("mouseup", B);
9737
9737
  };
9738
- window.addEventListener("mousemove", V), window.addEventListener("mouseup", j);
9738
+ window.addEventListener("mousemove", V), window.addEventListener("mouseup", B);
9739
9739
  }, _o = (p, w, M = !1) => ({
9740
9740
  position: "absolute",
9741
9741
  left: p.left,
@@ -9747,13 +9747,13 @@ function cd({
9747
9747
  pointerEvents: "none"
9748
9748
  }), lr = { lines: [], labels: [] };
9749
9749
  if (de) {
9750
- const p = ze(de[0].getBoundingClientRect()), w = ze(de[1].getBoundingClientRect()), M = p.left + p.width, V = p.top + p.height, j = w.left + w.width, ve = w.top + w.height, we = M <= w.left ? { from: M, to: w.left } : j <= p.left ? { from: j, to: p.left } : null, Be = V <= w.top ? { from: V, to: w.top } : ve <= p.top ? { from: ve, to: p.top } : null;
9750
+ const p = ze(de[0].getBoundingClientRect()), w = ze(de[1].getBoundingClientRect()), M = p.left + p.width, V = p.top + p.height, B = w.left + w.width, ve = w.top + w.height, we = M <= w.left ? { from: M, to: w.left } : B <= p.left ? { from: B, to: p.left } : null, Be = V <= w.top ? { from: V, to: w.top } : ve <= p.top ? { from: ve, to: p.top } : null;
9751
9751
  if (we && we.to - we.from > 0.5) {
9752
9752
  const Nt = we.to - we.from, $n = Math.max(p.top, w.top), Mn = Math.min(V, ve), Kr = Mn > $n ? ($n + Mn) / 2 : (p.top + V + w.top + ve) / 4;
9753
9753
  lr.lines.push({ left: we.from, top: Kr - 0.5, width: Nt, height: 1 }), lr.labels.push({ x: we.from + Nt / 2, y: Kr, text: `${Math.round(Nt)}px` });
9754
9754
  }
9755
9755
  if (Be && Be.to - Be.from > 0.5) {
9756
- const Nt = Be.to - Be.from, $n = Math.max(p.left, w.left), Mn = Math.min(M, j), Kr = Mn > $n ? ($n + Mn) / 2 : (p.left + M + w.left + j) / 4;
9756
+ const Nt = Be.to - Be.from, $n = Math.max(p.left, w.left), Mn = Math.min(M, B), Kr = Mn > $n ? ($n + Mn) / 2 : (p.left + M + w.left + B) / 4;
9757
9757
  lr.lines.push({ left: Kr - 0.5, top: Be.from, width: 1, height: Nt }), lr.labels.push({ x: Kr, y: Be.from + Nt / 2, text: `${Math.round(Nt)}px` });
9758
9758
  }
9759
9759
  }
@@ -10445,7 +10445,7 @@ function cd({
10445
10445
  {
10446
10446
  label: "Min",
10447
10447
  value: D.minWidth ?? 0,
10448
- onCommit: (p) => B((w) => ({
10448
+ onCommit: (p) => j((w) => ({
10449
10449
  minWidth: p || void 0,
10450
10450
  maxWidth: p > 0 && w.maxWidth != null && w.maxWidth < p ? p : w.maxWidth
10451
10451
  }))
@@ -10456,7 +10456,7 @@ function cd({
10456
10456
  {
10457
10457
  label: "Max",
10458
10458
  value: D.maxWidth ?? 0,
10459
- onCommit: (p) => B((w) => ({
10459
+ onCommit: (p) => j((w) => ({
10460
10460
  minWidth: p > 0 && w.minWidth != null && w.minWidth > p ? p : w.minWidth,
10461
10461
  maxWidth: p || void 0
10462
10462
  }))
@@ -11140,11 +11140,11 @@ function cd({
11140
11140
  "aria-label": `${w} value`,
11141
11141
  defaultValue: Io.getPropertyValue(w),
11142
11142
  className: "h-7 min-w-0 rounded-md bg-[#f4f4f5] px-2 text-[11px] text-[#18181b] outline-none focus:ring-1 focus:ring-inset focus:ring-[#0d99ff]",
11143
- onKeyDown: (j) => {
11144
- j.key === "Enter" && Ot(w, j.target.value);
11143
+ onKeyDown: (B) => {
11144
+ B.key === "Enter" && Ot(w, B.target.value);
11145
11145
  },
11146
- onBlur: (j) => {
11147
- j.currentTarget.value !== Io.getPropertyValue(w) && Ot(w, j.currentTarget.value);
11146
+ onBlur: (B) => {
11147
+ B.currentTarget.value !== Io.getPropertyValue(w) && Ot(w, B.currentTarget.value);
11148
11148
  }
11149
11149
  },
11150
11150
  `${Se}-${N}-${w}`
@@ -11155,16 +11155,16 @@ function cd({
11155
11155
  "aria-label": `${w} token`,
11156
11156
  value: "",
11157
11157
  className: "h-7 min-w-0 rounded-md bg-[#f4f4f5] px-1.5 text-[10px] text-[#52525b] outline-none focus:ring-1 focus:ring-inset focus:ring-[#0d99ff]",
11158
- onChange: (j) => {
11159
- j.target.value && Ot(w, `var(${j.target.value})`);
11158
+ onChange: (B) => {
11159
+ B.target.value && Ot(w, `var(${B.target.value})`);
11160
11160
  },
11161
11161
  children: [
11162
11162
  /* @__PURE__ */ a("option", { value: "", children: "Token" }),
11163
- V.map((j) => /* @__PURE__ */ g("option", { value: j.name, children: [
11164
- j.name.replace(/^--/, ""),
11163
+ V.map((B) => /* @__PURE__ */ g("option", { value: B.name, children: [
11164
+ B.name.replace(/^--/, ""),
11165
11165
  " · ",
11166
- j.value
11167
- ] }, j.name))
11166
+ B.value
11167
+ ] }, B.name))
11168
11168
  ]
11169
11169
  }
11170
11170
  ) : /* @__PURE__ */ a("span", { className: "h-7 rounded-md bg-[#fafafa] px-1.5 py-1.5 text-center text-[10px] text-[#c4c4c8]", children: "Direct" })
@@ -11186,7 +11186,7 @@ function cd({
11186
11186
  /* @__PURE__ */ a("div", { className: "flex flex-col gap-1.5", children: je.map(([p, w]) => {
11187
11187
  const M = Re.find(
11188
11188
  (we) => we.kind === "prop" && we.el === z && we.prop === p
11189
- ), V = M ? typeof w == "boolean" ? M.to === "true" : typeof w == "number" ? Number(M.to) : M.to : w, j = Ym(z, p), ve = (we) => {
11189
+ ), V = M ? typeof w == "boolean" ? M.to === "true" : typeof w == "number" ? Number(M.to) : M.to : w, B = Ym(z, p), ve = (we) => {
11190
11190
  const Be = typeof w == "number" ? Number(we) : we;
11191
11191
  typeof Be == "number" && !Number.isFinite(Be) || Be !== V && ee.recordProp(
11192
11192
  z,
@@ -11243,9 +11243,9 @@ function cd({
11243
11243
  /* @__PURE__ */ a(
11244
11244
  "span",
11245
11245
  {
11246
- className: `truncate rounded px-1 py-1 text-center text-[8px] font-semibold ${j ? "bg-[#dcfce7] text-[#15803d]" : "bg-[#f3e8ff] text-[#7c3aed]"}`,
11247
- title: j ? "Previewed immediately in the DOM" : "Visible after applying the source change and HMR",
11248
- children: j ? "immediately" : "HMR"
11246
+ className: `truncate rounded px-1 py-1 text-center text-[8px] font-semibold ${B ? "bg-[#dcfce7] text-[#15803d]" : "bg-[#f3e8ff] text-[#7c3aed]"}`,
11247
+ title: B ? "Previewed immediately in the DOM" : "Visible after applying the source change and HMR",
11248
+ children: B ? "immediately" : "HMR"
11249
11249
  }
11250
11250
  )
11251
11251
  ]
@@ -11389,10 +11389,10 @@ function cd({
11389
11389
  ),
11390
11390
  children: /* @__PURE__ */ g("div", { className: "flex flex-col gap-1.5", children: [
11391
11391
  S.frames.map((p) => {
11392
- var j, ve;
11392
+ var B, ve;
11393
11393
  const w = p.domChanged === !0, M = p.screenshotChanged === !0, V = [
11394
11394
  ["Before change", p.before.screenshotUrl],
11395
- ["After change", (j = p.after) == null ? void 0 : j.screenshotUrl],
11395
+ ["After change", (B = p.after) == null ? void 0 : B.screenshotUrl],
11396
11396
  ["Diff", ((ve = p.pixelDiff) == null ? void 0 : ve.heatmapUrl) ?? void 0]
11397
11397
  ].filter((we) => typeof we[1] == "string");
11398
11398
  return /* @__PURE__ */ g(
@@ -11500,10 +11500,10 @@ function cd({
11500
11500
  "@media ",
11501
11501
  jn(p.media)
11502
11502
  ] }),
11503
- /* @__PURE__ */ a("div", { className: "mt-1 flex flex-col gap-0.5 font-mono text-[10px] text-[#52525b]", children: Object.entries(p.declarations).map(([V, j]) => /* @__PURE__ */ g("div", { className: "truncate", children: [
11503
+ /* @__PURE__ */ a("div", { className: "mt-1 flex flex-col gap-0.5 font-mono text-[10px] text-[#52525b]", children: Object.entries(p.declarations).map(([V, B]) => /* @__PURE__ */ g("div", { className: "truncate", children: [
11504
11504
  V,
11505
11505
  ": ",
11506
- /* @__PURE__ */ a("b", { children: j })
11506
+ /* @__PURE__ */ a("b", { children: B })
11507
11507
  ] }, V)) })
11508
11508
  ]
11509
11509
  },
@@ -11526,7 +11526,7 @@ function cd({
11526
11526
  ] })
11527
11527
  ] }, `${p.componentFile}-${p.oldText}`)),
11528
11528
  Ee.operations.map((p) => {
11529
- const w = Hy(p), M = p.scope === "instance" ? "This screen" : "Shared source", V = p.affectedFrames.length > 0 ? p.affectedFrames.map((j) => j.name).join(", ") : "current element";
11529
+ const w = Hy(p), M = p.scope === "instance" ? "This screen" : "Shared source", V = p.affectedFrames.length > 0 ? p.affectedFrames.map((B) => B.name).join(", ") : "current element";
11530
11530
  return /* @__PURE__ */ g(
11531
11531
  "div",
11532
11532
  {
@@ -12364,10 +12364,10 @@ function Sw(e, t = {}) {
12364
12364
  l.length === 0 && d.length === 0 && u === 0 && m === 0 && v.size === 0 && (x = h === 0 ? "idle" : "done"), E();
12365
12365
  }
12366
12366
  function L(N, T, W) {
12367
- var B;
12367
+ var j;
12368
12368
  const _ = o[Math.min(N.attempt, o.length - 1)];
12369
12369
  if (_ == null || N.attempt >= o.length) {
12370
- b += N.frames.length, (B = e.release) == null || B.call(e, N.frames, "The capture runtime did not become ready.");
12370
+ b += N.frames.length, (j = e.release) == null || j.call(e, N.frames, "The capture runtime did not become ready.");
12371
12371
  return;
12372
12372
  }
12373
12373
  const D = i(() => {
@@ -12389,16 +12389,16 @@ function Sw(e, t = {}) {
12389
12389
  }
12390
12390
  T ? m += 1 : u += 1, E(), _.then(
12391
12391
  (D) => {
12392
- var B;
12393
- T ? m -= 1 : u -= 1, W === c && (h += 1, D.status === "error" && (D.reason === "not-prepared" ? L(N, T, W) : (b += N.frames.length, (B = e.release) == null || B.call(
12392
+ var j;
12393
+ T ? m -= 1 : u -= 1, W === c && (h += 1, D.status === "error" && (D.reason === "not-prepared" ? L(N, T, W) : (b += N.frames.length, (j = e.release) == null || j.call(
12394
12394
  e,
12395
12395
  N.frames,
12396
12396
  D.message ?? "The capture endpoint could not answer."
12397
12397
  )))), R(c);
12398
12398
  },
12399
12399
  (D) => {
12400
- var B, C;
12401
- T ? m -= 1 : u -= 1, W === c && (h += 1, b += N.frames.length, (B = e.release) == null || B.call(
12400
+ var j, C;
12401
+ T ? m -= 1 : u -= 1, W === c && (h += 1, b += N.frames.length, (j = e.release) == null || j.call(
12402
12402
  e,
12403
12403
  N.frames,
12404
12404
  D instanceof Error ? D.message : String(D)
@@ -12550,7 +12550,7 @@ function Aw(e, t, n) {
12550
12550
  state: i
12551
12551
  };
12552
12552
  }
12553
- function US(e) {
12553
+ function VS(e) {
12554
12554
  const [t, n] = Q(
12555
12555
  ui
12556
12556
  ), r = qe(
@@ -12833,7 +12833,7 @@ function jw(e) {
12833
12833
  );
12834
12834
  return t;
12835
12835
  }
12836
- function VS(e, t) {
12836
+ function KS(e, t) {
12837
12837
  return Ih(e, t).document;
12838
12838
  }
12839
12839
  function Ih(e, t) {
@@ -13143,13 +13143,16 @@ const Vw = We(function() {
13143
13143
  )
13144
13144
  ] });
13145
13145
  });
13146
- function qw(e, t) {
13146
+ function qw(e) {
13147
+ return e.loose.reduce((t, n) => t + n.declared, 0) + e.groups.reduce((t, n) => t + n.declared, 0);
13148
+ }
13149
+ function Yw(e, t) {
13147
13150
  const n = ` · ${t}`, r = e.indexOf(n);
13148
13151
  if (r < 0) return e;
13149
13152
  const o = e.slice(r + n.length);
13150
13153
  return o.startsWith(" · ") ? o.slice(3) : t;
13151
13154
  }
13152
- function Yw(e, t, n = () => !0, r = () => !0) {
13155
+ function Gw(e, t, n = () => !0, r = () => !0) {
13153
13156
  const o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
13154
13157
  for (const m of e) {
13155
13158
  const h = m.canvas ?? "default";
@@ -13164,7 +13167,7 @@ function Yw(e, t, n = () => !0, r = () => !0) {
13164
13167
  l.push({ canvas: m, label: m, frames: h, declared: b });
13165
13168
  continue;
13166
13169
  }
13167
- const v = { canvas: m, label: qw(m, x), frames: h, declared: b }, y = u.get(x);
13170
+ const v = { canvas: m, label: Yw(m, x), frames: h, declared: b }, y = u.get(x);
13168
13171
  if (y === void 0) {
13169
13172
  u.set(x, d.length), d.push({ section: x, canvases: [v], frames: h, declared: b, single: !0 });
13170
13173
  continue;
@@ -13191,21 +13194,21 @@ function Rn(e) {
13191
13194
  function Wa() {
13192
13195
  return ja;
13193
13196
  }
13194
- function Gw(e) {
13197
+ function Xw(e) {
13195
13198
  return Ba.add(e), () => Ba.delete(e);
13196
13199
  }
13197
- const Xw = "data-pygmalion-source", Jw = "/__pygmalion-storyboard/source-usage", Qw = 4e3;
13200
+ const Jw = "data-pygmalion-source", Qw = "/__pygmalion-storyboard/source-usage", Zw = 4e3;
13198
13201
  function Bc(e) {
13199
13202
  if (!e) return null;
13200
13203
  const t = e.replaceAll("\\", "/").trim();
13201
13204
  return !t || t.startsWith("/") || t.includes("\0") || t.split("/").includes("..") || t.length > 1200 ? null : t;
13202
13205
  }
13203
- function Zw(e) {
13206
+ function e0(e) {
13204
13207
  if (!e) return null;
13205
13208
  const t = e.lastIndexOf("#");
13206
13209
  return t <= 0 ? null : Bc(e.slice(0, t));
13207
13210
  }
13208
- function e0(e) {
13211
+ function t0(e) {
13209
13212
  if (!e) return null;
13210
13213
  const t = e.indexOf("|");
13211
13214
  return Bc(t > 0 ? e.slice(0, t) : e);
@@ -13215,12 +13218,12 @@ function Ha(e) {
13215
13218
  let r = 0;
13216
13219
  const o = (i) => {
13217
13220
  var l;
13218
- if (!i || r >= Qw) return;
13221
+ if (!i || r >= Zw) return;
13219
13222
  r += 1, i.componentName && n.add(i.componentName);
13220
- const s = Zw(i.sourceStyle);
13223
+ const s = e0(i.sourceStyle);
13221
13224
  s && t.add(s);
13222
- const c = e0(
13223
- (l = i.domAttributes) == null ? void 0 : l[Xw]
13225
+ const c = t0(
13226
+ (l = i.domAttributes) == null ? void 0 : l[Jw]
13224
13227
  );
13225
13228
  c && t.add(c);
13226
13229
  for (const d of i.children ?? []) o(d);
@@ -13230,13 +13233,13 @@ function Ha(e) {
13230
13233
  componentNames: [...n].sort()
13231
13234
  };
13232
13235
  }
13233
- function t0(e) {
13236
+ function n0(e) {
13234
13237
  if (!e) return;
13235
13238
  if (e.componentName) return e.componentName;
13236
13239
  const { componentNames: t } = Ha(e);
13237
13240
  return t.length === 1 ? t[0] : void 0;
13238
13241
  }
13239
- function n0(e) {
13242
+ function r0(e) {
13240
13243
  const t = e.slice(e.lastIndexOf("/") + 1), n = t.indexOf(".");
13241
13244
  return n === -1 ? t : t.slice(0, n);
13242
13245
  }
@@ -13246,7 +13249,7 @@ function Ch(e) {
13246
13249
  const i = [...new Set(o.map(Bc).filter(Boolean))].sort();
13247
13250
  if (i.length !== 0) {
13248
13251
  if (t) {
13249
- const s = i.find((c) => n0(c) === t);
13252
+ const s = i.find((c) => r0(c) === t);
13250
13253
  if (s) return s;
13251
13254
  }
13252
13255
  return i[0];
@@ -13254,7 +13257,7 @@ function Ch(e) {
13254
13257
  };
13255
13258
  return n(e.declaredFiles ?? []) ?? n(e.sourceFiles);
13256
13259
  }
13257
- function r0(e) {
13260
+ function o0(e) {
13258
13261
  var s;
13259
13262
  const t = e.usageByFile ?? {}, n = e.usageRequested ?? !1, r = new Map(
13260
13263
  e.consumers.map((c) => [c.frameId, c])
@@ -13292,7 +13295,7 @@ function r0(e) {
13292
13295
  unplacedFrameIds: i.sort()
13293
13296
  };
13294
13297
  }
13295
- function o0(e = []) {
13298
+ function i0(e = []) {
13296
13299
  return {
13297
13300
  frames: [],
13298
13301
  canonicalGroups: [],
@@ -13324,7 +13327,7 @@ function o0(e = []) {
13324
13327
  })).sort((t, n) => t.frameId.localeCompare(n.frameId))
13325
13328
  };
13326
13329
  }
13327
- function i0(e) {
13330
+ function s0(e) {
13328
13331
  const t = /* @__PURE__ */ new Set([
13329
13332
  ...e.startFrameIds,
13330
13333
  ...e.branchFrameIds
@@ -13344,7 +13347,7 @@ function Bn(e) {
13344
13347
  (t, n) => t.localeCompare(n)
13345
13348
  );
13346
13349
  }
13347
- function s0(e, t) {
13350
+ function a0(e, t) {
13348
13351
  const n = [...t].filter((I) => I.frameId.trim()).map((I) => ({
13349
13352
  ...I,
13350
13353
  frameId: I.frameId.trim(),
@@ -13521,7 +13524,7 @@ function s0(e, t) {
13521
13524
  return (A = l.get(I.nodeId)) == null ? void 0 : A.frameId;
13522
13525
  }
13523
13526
  )
13524
- ), B = i0({
13527
+ ), j = s0({
13525
13528
  frames: R,
13526
13529
  canonicalGroups: N,
13527
13530
  sharedSources: T,
@@ -13529,7 +13532,7 @@ function s0(e, t) {
13529
13532
  branchFrameIds: D
13530
13533
  }), C = [
13531
13534
  ...o,
13532
- ...R.filter((I) => !B.has(I.frameId)).map((I) => ({
13535
+ ...R.filter((I) => !j.has(I.frameId)).map((I) => ({
13533
13536
  frameId: I.frameId,
13534
13537
  screenId: I.screenId,
13535
13538
  name: I.name,
@@ -13567,7 +13570,7 @@ function Ph(e) {
13567
13570
  }
13568
13571
  return n;
13569
13572
  }
13570
- function a0(e) {
13573
+ function c0(e) {
13571
13574
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = (o) => {
13572
13575
  const i = t.get(o);
13573
13576
  if (i) return { path: i, cyclic: !1 };
@@ -13584,9 +13587,9 @@ function a0(e) {
13584
13587
  };
13585
13588
  return (o) => r(o).path;
13586
13589
  }
13587
- function c0(e) {
13590
+ function l0(e) {
13588
13591
  if (e.frames.length === 0) return md;
13589
- const t = Ph(e), n = a0(t), r = e.startFrameIds.length ? e.startFrameIds : e.frames.filter((d) => d.incomingTransitions.length === 0).map((d) => d.frameId);
13592
+ const t = Ph(e), n = c0(t), r = e.startFrameIds.length ? e.startFrameIds : e.frames.filter((d) => d.incomingTransitions.length === 0).map((d) => d.frameId);
13590
13593
  let o = [];
13591
13594
  for (const d of r) {
13592
13595
  const u = n(d);
@@ -13605,15 +13608,15 @@ function c0(e) {
13605
13608
  const l = e.frames.map((d) => d.frameId).filter((d) => !i.has(d) && !c.has(d));
13606
13609
  return { spine: o, detours: s, detourParent: c, offJourney: l };
13607
13610
  }
13608
- function l0(e, t) {
13611
+ function d0(e, t) {
13609
13612
  return t ? e.spine.includes(t) ? t : e.detourParent.get(t) ?? null : null;
13610
13613
  }
13611
- function d0(e) {
13614
+ function u0(e) {
13612
13615
  const t = Ph(e);
13613
13616
  return e.frames.filter((n) => (t.get(n.frameId) ?? []).length === 0);
13614
13617
  }
13615
- function u0(e) {
13616
- return e.endDeclarationsEnabled === !0 || e.frames.some((n) => n.isEnd !== void 0) ? d0(e).filter((n) => n.isEnd !== !0) : [];
13618
+ function f0(e) {
13619
+ return e.endDeclarationsEnabled === !0 || e.frames.some((n) => n.isEnd !== void 0) ? u0(e).filter((n) => n.isEnd !== !0) : [];
13617
13620
  }
13618
13621
  function Wc(e) {
13619
13622
  const t = "source-route:";
@@ -13625,7 +13628,7 @@ function Wc(e) {
13625
13628
  return e;
13626
13629
  }
13627
13630
  }
13628
- const f0 = {
13631
+ const h0 = {
13629
13632
  screen: "Screen name",
13630
13633
  flow: "Flow",
13631
13634
  scenario: "Scenario",
@@ -13634,7 +13637,7 @@ const f0 = {
13634
13637
  function pd(e, t) {
13635
13638
  return e.find((n) => n.toLowerCase().includes(t));
13636
13639
  }
13637
- function h0(e, t) {
13640
+ function m0(e, t) {
13638
13641
  const n = t.trim().toLowerCase();
13639
13642
  return n ? e.flatMap((r) => {
13640
13643
  if (r.name.toLowerCase().includes(n))
@@ -13651,7 +13654,7 @@ function h0(e, t) {
13651
13654
  (r, o) => +(o.matchKind === "screen") - +(r.matchKind === "screen") || r.name.localeCompare(o.name)
13652
13655
  ) : [];
13653
13656
  }
13654
- function m0({
13657
+ function p0({
13655
13658
  results: e,
13656
13659
  activeFrameId: t,
13657
13660
  onSelectFrame: n
@@ -13674,7 +13677,7 @@ function m0({
13674
13677
  children: [
13675
13678
  /* @__PURE__ */ a("span", { className: `block truncate text-[11px] ${o ? "font-semibold" : "font-medium"}`, title: r.name, children: r.name }),
13676
13679
  r.matchKind !== "screen" ? /* @__PURE__ */ g("span", { className: "mt-0.5 block truncate text-[9px] text-[#8b95a1]", children: [
13677
- f0[r.matchKind],
13680
+ h0[r.matchKind],
13678
13681
  i ? ` · ${i}` : ""
13679
13682
  ] }) : null
13680
13683
  ]
@@ -13723,7 +13726,7 @@ function br({
13723
13726
  }
13724
13727
  );
13725
13728
  }
13726
- const p0 = {
13729
+ const g0 = {
13727
13730
  observed: "Frames observed rendering this piece",
13728
13731
  direct: "Files that name this piece; barrels are followed through",
13729
13732
  transitive: "Nothing names it directly. This is the dependency closure, which a barrel inflates — not a usage count.",
@@ -13731,10 +13734,10 @@ const p0 = {
13731
13734
  unused: "The source scan found nothing that uses it",
13732
13735
  "not-traced": "No source file to trace, or no scan available"
13733
13736
  };
13734
- function g0(e) {
13737
+ function b0(e) {
13735
13738
  return e.evidence === "observed" ? `${e.usedByFrames.length} frames` : e.evidence === "direct" ? `${e.usedByFiles.length} files` : e.evidence === "transitive" ? `${e.transitiveCount ?? 0} indirect` : e.evidence === "pending" ? "checking…" : e.evidence === "unused" ? "unused" : "not traced";
13736
13739
  }
13737
- function b0({
13740
+ function x0({
13738
13741
  children: e,
13739
13742
  count: t
13740
13743
  }) {
@@ -13772,7 +13775,7 @@ function pn({
13772
13775
  children: "›"
13773
13776
  }
13774
13777
  ),
13775
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ a(b0, { count: t, children: e }) })
13778
+ /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ a(x0, { count: t, children: e }) })
13776
13779
  ]
13777
13780
  }
13778
13781
  ),
@@ -13781,7 +13784,7 @@ function pn({
13781
13784
  }
13782
13785
  );
13783
13786
  }
13784
- function x0({ model: e }) {
13787
+ function v0({ model: e }) {
13785
13788
  var b;
13786
13789
  const t = e.coverage.canonicalNodes, n = e.coverage.connectedNodes, r = e.coverage.nonVisualScenarios ?? (e.coverage.complete ? Math.max(
13787
13790
  0,
@@ -13881,7 +13884,7 @@ function x0({ model: e }) {
13881
13884
  }
13882
13885
  );
13883
13886
  }
13884
- function v0(e) {
13887
+ function y0(e) {
13885
13888
  const t = /* @__PURE__ */ new Map();
13886
13889
  for (const n of e.frames) {
13887
13890
  const r = n.routes[0] ? `route:${n.routes[0]}` : n.nodeId, o = t.get(r);
@@ -13903,12 +13906,12 @@ function v0(e) {
13903
13906
  }
13904
13907
  );
13905
13908
  }
13906
- function y0({
13909
+ function w0({
13907
13910
  model: e,
13908
13911
  activeFrameId: t,
13909
13912
  onSelectFrame: n
13910
13913
  }) {
13911
- const r = wt(() => v0(e), [e]);
13914
+ const r = wt(() => y0(e), [e]);
13912
13915
  return /* @__PURE__ */ g("section", { className: "mt-2.5", "data-storyboard-stateboard": !0, children: [
13913
13916
  /* @__PURE__ */ a("p", { className: "mb-2 px-1 text-[10px] leading-relaxed text-[#6b7684]", children: "Compare saved visual states of the same screen." }),
13914
13917
  /* @__PURE__ */ a("div", { className: "flex flex-col gap-1", children: r.map((o, i) => {
@@ -13949,7 +13952,7 @@ function y0({
13949
13952
  }) })
13950
13953
  ] });
13951
13954
  }
13952
- function w0({
13955
+ function S0({
13953
13956
  model: e,
13954
13957
  frameById: t,
13955
13958
  activeFrameId: n,
@@ -13957,7 +13960,7 @@ function w0({
13957
13960
  }) {
13958
13961
  const o = new Set(
13959
13962
  e.coverage.undeclaredEndScreens ?? []
13960
- ), i = u0(e).filter(
13963
+ ), i = f0(e).filter(
13961
13964
  (h) => o.size === 0 ? !1 : o.has(h.canonicalScreenId) || o.has(h.screenId)
13962
13965
  ), s = f.canvasPages.filter((h) => h.route != null), c = s.filter(
13963
13966
  (h) => ep(h).length === 0
@@ -14095,7 +14098,7 @@ function gd({ frameId: e }) {
14095
14098
  }
14096
14099
  );
14097
14100
  }
14098
- function S0(e, t, n) {
14101
+ function N0(e, t, n) {
14099
14102
  var s;
14100
14103
  const r = (s = e == null ? void 0 : e.label) == null ? void 0 : s.trim();
14101
14104
  if (!e || !r || !n || e.labelScope === "path" || e.kind === "authored-path")
@@ -14108,12 +14111,12 @@ function S0(e, t, n) {
14108
14111
  ...n.routes.flatMap((c) => [c, `Route ${c}`])
14109
14112
  ].map(o).includes(o(r)) ? void 0 : r;
14110
14113
  }
14111
- function N0({
14114
+ function I0({
14112
14115
  model: e,
14113
14116
  activeFrameId: t,
14114
14117
  onSelectFrame: n
14115
14118
  }) {
14116
- const r = new Map(e.frames.map((b) => [b.frameId, b])), o = wt(() => c0(e), [e]), i = l0(o, t), [s, c] = Q({}), [l, d] = Q(!0), u = t ? r.get(t) : void 0, m = t != null && (o.spine.includes(t) || o.detourParent.has(t)), h = i ? o.spine.indexOf(i) + 1 : 0;
14119
+ const r = new Map(e.frames.map((b) => [b.frameId, b])), o = wt(() => l0(e), [e]), i = d0(o, t), [s, c] = Q({}), [l, d] = Q(!0), u = t ? r.get(t) : void 0, m = t != null && (o.spine.includes(t) || o.detourParent.has(t)), h = i ? o.spine.indexOf(i) + 1 : 0;
14117
14120
  return o.spine.length === 0 ? null : /* @__PURE__ */ g(
14118
14121
  "section",
14119
14122
  {
@@ -14163,8 +14166,8 @@ function N0({
14163
14166
  const v = r.get(b);
14164
14167
  if (!v) return null;
14165
14168
  const y = x > 0 ? r.get(o.spine[x - 1]) : void 0, E = v.flows[0], k = E != null && (y == null ? void 0 : y.flows[0]) !== E, L = o.detours.get(b) ?? [], P = o.spine[x + 1], R = v.outgoingTransitions.find(
14166
- (B) => B.targetFrameId === P
14167
- ), N = P ? r.get(P) : void 0, T = S0(
14169
+ (j) => j.targetFrameId === P
14170
+ ), N = P ? r.get(P) : void 0, T = N0(
14168
14171
  R,
14169
14172
  v,
14170
14173
  N
@@ -14207,8 +14210,8 @@ function N0({
14207
14210
  "aria-expanded": _,
14208
14211
  "aria-label": `${_ ? "Collapse" : "Expand"} ${v.name}`,
14209
14212
  className: `flex h-5 w-5 shrink-0 items-center justify-center rounded text-[10px] text-[#8b95a1] transition-transform hover:bg-[#f2f4f6] focus-visible:ring-2 focus-visible:ring-[#90c2ff] ${_ ? "rotate-90" : ""}`,
14210
- onClick: () => c((B) => ({
14211
- ...B,
14213
+ onClick: () => c((j) => ({
14214
+ ...j,
14212
14215
  [b]: !_
14213
14216
  })),
14214
14217
  children: "›"
@@ -14237,25 +14240,25 @@ function N0({
14237
14240
  "Other paths · ",
14238
14241
  L.length
14239
14242
  ] }),
14240
- /* @__PURE__ */ a("div", { className: "mt-0.5 flex flex-col gap-0.5", children: L.map((B) => {
14241
- const C = r.get(B);
14243
+ /* @__PURE__ */ a("div", { className: "mt-0.5 flex flex-col gap-0.5", children: L.map((j) => {
14244
+ const C = r.get(j);
14242
14245
  return C ? /* @__PURE__ */ g(
14243
14246
  "button",
14244
14247
  {
14245
14248
  type: "button",
14246
- "data-journey-detour": B,
14247
- "data-storyboard-frame-id": B,
14248
- "aria-current": B === t ? "step" : void 0,
14249
- className: `flex min-h-7 min-w-0 items-center gap-1 rounded-md px-1.5 py-1 text-left text-[10px] outline-none focus-visible:ring-2 focus-visible:ring-[#90c2ff] ${B === t ? "bg-[#e8f3ff] font-semibold text-[#1b64da]" : "text-[#6b7684] hover:bg-white"}`,
14249
+ "data-journey-detour": j,
14250
+ "data-storyboard-frame-id": j,
14251
+ "aria-current": j === t ? "step" : void 0,
14252
+ className: `flex min-h-7 min-w-0 items-center gap-1 rounded-md px-1.5 py-1 text-left text-[10px] outline-none focus-visible:ring-2 focus-visible:ring-[#90c2ff] ${j === t ? "bg-[#e8f3ff] font-semibold text-[#1b64da]" : "text-[#6b7684] hover:bg-white"}`,
14250
14253
  title: C.name,
14251
- onClick: () => n(B),
14254
+ onClick: () => n(j),
14252
14255
  children: [
14253
14256
  /* @__PURE__ */ a("span", { className: "text-[#8b95a1]", children: "↳" }),
14254
14257
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate", children: C.name }),
14255
- C.isEnd ? /* @__PURE__ */ a(gd, { frameId: B }) : null
14258
+ C.isEnd ? /* @__PURE__ */ a(gd, { frameId: j }) : null
14256
14259
  ]
14257
14260
  },
14258
- B
14261
+ j
14259
14262
  ) : null;
14260
14263
  }) })
14261
14264
  ] }) : null
@@ -14269,7 +14272,7 @@ function N0({
14269
14272
  }
14270
14273
  );
14271
14274
  }
14272
- function I0({
14275
+ function C0({
14273
14276
  model: e,
14274
14277
  onSelectFrame: t,
14275
14278
  activeFrameId: n,
@@ -14319,7 +14322,7 @@ function I0({
14319
14322
  e.frames,
14320
14323
  e.unplacedFrames
14321
14324
  ]), v = wt(
14322
- () => h0(x, d),
14325
+ () => m0(x, d),
14323
14326
  [x, d]
14324
14327
  ), y = d.trim().length > 0, E = (/* @__PURE__ */ new Set([
14325
14328
  ...e.frames.map((P) => P.frameId),
@@ -14386,7 +14389,7 @@ function I0({
14386
14389
  ) : null
14387
14390
  ] }),
14388
14391
  y ? /* @__PURE__ */ a(
14389
- m0,
14392
+ p0,
14390
14393
  {
14391
14394
  results: v,
14392
14395
  activeFrameId: n,
@@ -14416,9 +14419,9 @@ function I0({
14416
14419
  ))
14417
14420
  }
14418
14421
  ) : null,
14419
- y ? null : /* @__PURE__ */ a(x0, { model: e }),
14422
+ y ? null : /* @__PURE__ */ a(v0, { model: e }),
14420
14423
  !y && c === "stateboard" && k ? /* @__PURE__ */ a(
14421
- y0,
14424
+ w0,
14422
14425
  {
14423
14426
  model: e,
14424
14427
  activeFrameId: n,
@@ -14426,7 +14429,7 @@ function I0({
14426
14429
  }
14427
14430
  ) : null,
14428
14431
  !y && (c === "journey" || !k) ? /* @__PURE__ */ a(
14429
- N0,
14432
+ I0,
14430
14433
  {
14431
14434
  model: e,
14432
14435
  activeFrameId: n,
@@ -14435,7 +14438,7 @@ function I0({
14435
14438
  ) : null,
14436
14439
  /* @__PURE__ */ g("div", { className: "mt-2 flex flex-col gap-2", hidden: y, children: [
14437
14440
  c === "journey" || !k ? /* @__PURE__ */ a(He, { children: /* @__PURE__ */ a(
14438
- w0,
14441
+ S0,
14439
14442
  {
14440
14443
  model: e,
14441
14444
  frameById: s,
@@ -14470,8 +14473,8 @@ function I0({
14470
14473
  "span",
14471
14474
  {
14472
14475
  className: "shrink-0 text-[9px] text-[#999]",
14473
- title: p0[P.evidence],
14474
- children: g0(P)
14476
+ title: g0[P.evidence],
14477
+ children: b0(P)
14475
14478
  }
14476
14479
  )
14477
14480
  ] }),
@@ -14563,10 +14566,10 @@ function I0({
14563
14566
  )
14564
14567
  ) : null;
14565
14568
  }
14566
- function C0({ type: e }) {
14569
+ function P0({ type: e }) {
14567
14570
  return /* @__PURE__ */ a("span", { className: `shrink-0 ${e === "component" ? "text-[#9747ff]" : "text-[#999]"}`, children: e === "text" ? /* @__PURE__ */ a(Kf, { size: 10 }) : e === "columns" ? /* @__PURE__ */ a(Rc, { size: 10 }) : e === "component" ? /* @__PURE__ */ a(Li, { size: 10 }) : /* @__PURE__ */ a(Ti, { size: 10 }) });
14568
14571
  }
14569
- const P0 = cu(function e({ node: t, depth: n }) {
14572
+ const $0 = cu(function e({ node: t, depth: n }) {
14570
14573
  return Wf(() => {
14571
14574
  const r = f.isSelected(t.id), o = f.collapsed.has(t.id), i = t.children.length > 0, s = f.renamingId === t.id, c = t.type === "text" ? t.text : t.name, l = (d) => {
14572
14575
  const u = d.trim();
@@ -14603,7 +14606,7 @@ const P0 = cu(function e({ node: t, depth: n }) {
14603
14606
  children: /* @__PURE__ */ a(ci, { open: !o })
14604
14607
  }
14605
14608
  ),
14606
- /* @__PURE__ */ a(C0, { type: t.type }),
14609
+ /* @__PURE__ */ a(P0, { type: t.type }),
14607
14610
  s ? /* @__PURE__ */ a(
14608
14611
  "input",
14609
14612
  {
@@ -14663,7 +14666,7 @@ const P0 = cu(function e({ node: t, depth: n }) {
14663
14666
  ] });
14664
14667
  });
14665
14668
  });
14666
- function $0({
14669
+ function M0({
14667
14670
  id: e,
14668
14671
  name: t,
14669
14672
  active: n,
@@ -14709,7 +14712,7 @@ function bd() {
14709
14712
  return {};
14710
14713
  }
14711
14714
  }
14712
- function M0(e, t) {
14715
+ function E0(e, t) {
14713
14716
  const [n, r] = Q(() => {
14714
14717
  const i = bd()[e];
14715
14718
  return typeof i == "number" && Number.isFinite(i) ? i : t;
@@ -14725,7 +14728,7 @@ function M0(e, t) {
14725
14728
  }
14726
14729
  }];
14727
14730
  }
14728
- function E0({
14731
+ function k0({
14729
14732
  label: e,
14730
14733
  height: t,
14731
14734
  onResize: n,
@@ -14755,12 +14758,17 @@ function Mh({
14755
14758
  declared: t,
14756
14759
  active: n = !1
14757
14760
  }) {
14758
- return t === 0 ? null : /* @__PURE__ */ a(
14761
+ if (t === 0) return null;
14762
+ const r = Math.max(0, t - e), o = t === 1 ? "page" : "pages", s = r ? `${t} ${o}. ${e} are on the canvas; ${r} alternate ${r === 1 ? "state is" : "states are"} available in the right panel.` : void 0;
14763
+ return /* @__PURE__ */ a(
14759
14764
  "span",
14760
14765
  {
14766
+ "data-frame-count": t,
14767
+ "data-folded-state-count": r || void 0,
14768
+ "aria-label": s ?? `${t} ${o}`,
14761
14769
  className: `shrink-0 rounded-full px-1.5 py-0.5 text-[9px] tabular-nums ${n ? "bg-white/80 text-[#1b64da]" : "bg-[#f2f4f6] text-[#8b95a1]"}`,
14762
- title: e === t ? void 0 : `${t - e} more in this lane, held back by a screen state`,
14763
- children: e === t ? e : `${e}/${t}`
14770
+ title: s,
14771
+ children: t
14764
14772
  }
14765
14773
  );
14766
14774
  }
@@ -14798,7 +14806,7 @@ const _s = We(function({
14798
14806
  ]
14799
14807
  }
14800
14808
  );
14801
- }), k0 = We(function() {
14809
+ }), A0 = We(function() {
14802
14810
  const t = qe(
14803
14811
  ru,
14804
14812
  mi,
@@ -14825,7 +14833,7 @@ const _s = We(function({
14825
14833
  );
14826
14834
  }) })
14827
14835
  ] });
14828
- }), A0 = We(function({
14836
+ }), R0 = We(function({
14829
14837
  view: t = "story",
14830
14838
  onFrameFocus: n = (o) => f.selectFrame(o),
14831
14839
  storyboardReady: r = !0
@@ -14835,13 +14843,13 @@ const _s = We(function({
14835
14843
  mi,
14836
14844
  mi
14837
14845
  );
14838
- const [o, i] = M0("frames", 176), [s, c] = Q({}), l = Yw(
14846
+ const [o, i] = E0("frames", 176), [s, c] = Q({}), l = Gw(
14839
14847
  f.pages,
14840
14848
  f.canvasNames,
14841
14849
  (C) => f.isScreenStateShown(C),
14842
14850
  (C) => f.isInSelectedRuntime(C)
14843
14851
  ), d = (C) => C.canvases.some((I) => I.canvas === f.activeCanvas), u = qe(
14844
- Gw,
14852
+ Xw,
14845
14853
  Wa,
14846
14854
  Wa
14847
14855
  ), m = f.canvasPages, h = m.length > 0 && m.every((C) => C.route == null), b = (C) => ({
@@ -14853,10 +14861,10 @@ const _s = We(function({
14853
14861
  ), v = new Set(x.map((C) => C.id)), y = [
14854
14862
  ...x.map(b),
14855
14863
  ...h ? [] : m.filter((C) => !v.has(C.id)).map(b)
14856
- ], E = r ? u ? s0(u, y) : o0(y) : null, k = m.map((C) => ({
14864
+ ], E = r ? u ? a0(u, y) : i0(y) : null, k = m.map((C) => ({
14857
14865
  frameId: C.id,
14858
14866
  name: C.name,
14859
- componentName: t0(C.root),
14867
+ componentName: n0(C.root),
14860
14868
  declaredFiles: C.sourcePaths ?? [],
14861
14869
  ...Ha(C.root)
14862
14870
  })), [L, P] = Q({}), [R, N] = Q(!1), W = (h ? [...new Set(k.map(Ch).filter(Boolean))].sort() : []).join(",");
@@ -14866,7 +14874,7 @@ const _s = We(function({
14866
14874
  return N(!0), (async () => {
14867
14875
  try {
14868
14876
  const I = await fetch(
14869
- `${Jw}?files=${encodeURIComponent(W)}`
14877
+ `${Qw}?files=${encodeURIComponent(W)}`
14870
14878
  );
14871
14879
  if (C || !I.ok) return;
14872
14880
  const A = await I.json();
@@ -14879,7 +14887,7 @@ const _s = We(function({
14879
14887
  C = !0;
14880
14888
  };
14881
14889
  }, [W]);
14882
- const _ = h ? r0({
14890
+ const _ = h ? o0({
14883
14891
  usageByFile: L,
14884
14892
  usageRequested: R,
14885
14893
  catalog: k,
@@ -14890,9 +14898,9 @@ const _s = We(function({
14890
14898
  }))
14891
14899
  }) : null, D = new Map(
14892
14900
  f.pages.map((C) => [C.id, C.name])
14893
- ), B = l.loose.length + l.groups.reduce((C, I) => C + I.canvases.length, 0);
14901
+ ), j = qw(l);
14894
14902
  return /* @__PURE__ */ g("div", { className: "flex min-h-0 flex-1 flex-col", children: [
14895
- /* @__PURE__ */ a(k0, {}),
14903
+ /* @__PURE__ */ a(A0, {}),
14896
14904
  t === "story" && /* @__PURE__ */ g(He, { children: [
14897
14905
  /* @__PURE__ */ g(
14898
14906
  "section",
@@ -14903,7 +14911,14 @@ const _s = We(function({
14903
14911
  children: [
14904
14912
  /* @__PURE__ */ g("div", { className: "flex items-center justify-between px-0.5", children: [
14905
14913
  /* @__PURE__ */ a("div", { className: "text-[12px] font-semibold text-[#191f28]", children: "Pages" }),
14906
- /* @__PURE__ */ a("span", { className: "rounded-full bg-[#f2f4f6] px-2 py-0.5 text-[9px] tabular-nums text-[#6b7684]", children: B })
14914
+ /* @__PURE__ */ a(
14915
+ "span",
14916
+ {
14917
+ "data-page-count": j,
14918
+ className: "rounded-full bg-[#f2f4f6] px-2 py-0.5 text-[9px] tabular-nums text-[#6b7684]",
14919
+ children: j
14920
+ }
14921
+ )
14907
14922
  ] }),
14908
14923
  /* @__PURE__ */ g("div", { className: "mt-2 flex max-h-[224px] flex-col gap-0.5 overflow-y-auto", children: [
14909
14924
  l.loose.map((C) => /* @__PURE__ */ a(
@@ -14988,7 +15003,7 @@ const _s = We(function({
14988
15003
  }) })
14989
15004
  ] }),
14990
15005
  E && /* @__PURE__ */ a("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ a(
14991
- I0,
15006
+ C0,
14992
15007
  {
14993
15008
  model: E,
14994
15009
  onSelectFrame: n,
@@ -15010,7 +15025,7 @@ const _s = We(function({
15010
15025
  /* @__PURE__ */ a("span", { className: "h-px flex-1 bg-[#e6e6e6]" })
15011
15026
  ] }),
15012
15027
  /* @__PURE__ */ a(
15013
- $0,
15028
+ M0,
15014
15029
  {
15015
15030
  id: C.id,
15016
15031
  name: C.name,
@@ -15023,7 +15038,7 @@ const _s = We(function({
15023
15038
  }) })
15024
15039
  ] }),
15025
15040
  /* @__PURE__ */ a(
15026
- E0,
15041
+ k0,
15027
15042
  {
15028
15043
  label: "Frames height",
15029
15044
  height: o,
@@ -15031,7 +15046,7 @@ const _s = We(function({
15031
15046
  }
15032
15047
  ),
15033
15048
  /* @__PURE__ */ a("div", { className: "px-3 pb-1 pt-1 text-[11px] font-semibold text-[#333]", children: "Layers" }),
15034
- /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-auto pb-2", children: /* @__PURE__ */ a(P0, { node: f.root, depth: 0 }) })
15049
+ /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-auto pb-2", children: /* @__PURE__ */ a($0, { node: f.root, depth: 0 }) })
15035
15050
  ] })
15036
15051
  ] });
15037
15052
  });
@@ -15043,7 +15058,7 @@ function xd(e, t, n) {
15043
15058
  );
15044
15059
  return Math.round(e);
15045
15060
  }
15046
- function R0(e) {
15061
+ function T0(e) {
15047
15062
  Eh = e.map((t) => {
15048
15063
  const n = String(t.label ?? "").trim();
15049
15064
  if (!n) throw new Error("Viewport preset is missing a label.");
@@ -15058,16 +15073,16 @@ function R0(e) {
15058
15073
  function kh() {
15059
15074
  return Eh;
15060
15075
  }
15061
- function T0(e, t) {
15076
+ function F0(e, t) {
15062
15077
  return Math.round(t.width) !== e.width ? !1 : e.height == null || Math.round(t.height) === e.height;
15063
15078
  }
15064
- function F0(e, t) {
15079
+ function L0(e, t) {
15065
15080
  return Object.entries((t == null ? void 0 : t.props) ?? {}).filter(
15066
15081
  ([n, r]) => Object.hasOwn(e.sourceProps, n) && r.some((o) => typeof o == typeof e.sourceProps[n])
15067
15082
  ).map(([n]) => n);
15068
15083
  }
15069
- const L0 = 10;
15070
- function KS(e, t) {
15084
+ const _0 = 10;
15085
+ function qS(e, t) {
15071
15086
  var c, l;
15072
15087
  const n = [], r = new Set(t.scenarios.map((d) => d.id)), o = new Map(t.screens.map((d) => [d.id, d])), i = /* @__PURE__ */ new Map();
15073
15088
  for (const d of t.screens)
@@ -15083,7 +15098,7 @@ function KS(e, t) {
15083
15098
  continue;
15084
15099
  }
15085
15100
  if (d.kind === "behavior" || d.kind === "todo") {
15086
- d.reason.trim().length < L0 && n.push({
15101
+ d.reason.trim().length < _0 && n.push({
15087
15102
  severity: "error",
15088
15103
  scenarioId: d.scenarioId,
15089
15104
  message: `${d.kind} claim needs a substantive reason`
@@ -15203,7 +15218,7 @@ function KS(e, t) {
15203
15218
  });
15204
15219
  return n;
15205
15220
  }
15206
- function _0(e) {
15221
+ function z0(e) {
15207
15222
  return f.pages.find(
15208
15223
  (t) => (t.importPageId ?? t.id) === e
15209
15224
  ) ?? null;
@@ -15216,13 +15231,13 @@ function Ah(e, t) {
15216
15231
  }
15217
15232
  return null;
15218
15233
  }
15219
- function z0(e) {
15234
+ function D0(e) {
15220
15235
  if (e.kind === "behavior" || e.kind === "todo")
15221
15236
  return {
15222
15237
  status: "failed",
15223
15238
  message: "behavior/todo claims have no editor state to reproduce"
15224
15239
  };
15225
- const t = _0(e.screenId);
15240
+ const t = z0(e.screenId);
15226
15241
  if (!t)
15227
15242
  return { status: "failed", message: `screen "${e.screenId}" is not loaded` };
15228
15243
  if (f.selectFrame(t.id), e.kind === "frame" || e.kind === "screen-state" || e.kind === "catalog")
@@ -15289,7 +15304,7 @@ function z0(e) {
15289
15304
  };
15290
15305
  }
15291
15306
  const fo = /* @__PURE__ */ new Map();
15292
- function D0(e) {
15307
+ function O0(e) {
15293
15308
  fo.clear();
15294
15309
  for (const t of e) {
15295
15310
  if (t.kind === "behavior" || t.kind === "todo") continue;
@@ -15297,10 +15312,10 @@ function D0(e) {
15297
15312
  n.push(t), fo.set(t.screenId, n);
15298
15313
  }
15299
15314
  }
15300
- function O0(e) {
15315
+ function j0(e) {
15301
15316
  return fo.get(e) ?? [];
15302
15317
  }
15303
- function j0(e, t, n) {
15318
+ function B0(e, t, n) {
15304
15319
  const r = [];
15305
15320
  for (const o of fo.get(e) ?? [])
15306
15321
  o.kind === "component-state" && o.componentName === t && o.prop === n && r.push(o.scenarioId);
@@ -15344,13 +15359,13 @@ function xo({
15344
15359
  }
15345
15360
  );
15346
15361
  }
15347
- function B0(e, t, n, r) {
15362
+ function W0(e, t, n, r) {
15348
15363
  return Object.hasOwn(e.componentProps, t) ? e.componentProps[t] : r ?? n[0];
15349
15364
  }
15350
15365
  function vd(e) {
15351
15366
  return typeof e == "boolean" ? e ? "On" : "Off" : String(e);
15352
15367
  }
15353
- function W0({
15368
+ function H0({
15354
15369
  node: e,
15355
15370
  entry: t,
15356
15371
  sourceWritableProps: n = null,
@@ -15359,7 +15374,7 @@ function W0({
15359
15374
  }) {
15360
15375
  return /* @__PURE__ */ a(He, { children: Object.entries(t.props ?? {}).map(([i, s]) => {
15361
15376
  var m, h;
15362
- const c = ((m = t.propLabels) == null ? void 0 : m[i]) ?? i, l = B0(
15377
+ const c = ((m = t.propLabels) == null ? void 0 : m[i]) ?? i, l = W0(
15363
15378
  e,
15364
15379
  i,
15365
15380
  s,
@@ -15449,8 +15464,9 @@ const wd = We(function({
15449
15464
  page: t
15450
15465
  }) {
15451
15466
  if (!t.scenario || t.route == null) return null;
15452
- const n = f.pages.filter(
15453
- (i) => i.route != null && i.importLayers === !0 && i.scenario === t.scenario
15467
+ const n = f.screenStateGroup(
15468
+ t.scenario,
15469
+ t.canvas ?? "default"
15454
15470
  );
15455
15471
  if (n.length < 2) return null;
15456
15472
  const r = n[0], o = n.length === 2 && r.stateKind == null && n[1].stateKind != null ? n[1] : null;
@@ -15544,7 +15560,7 @@ const wd = We(function({
15544
15560
  )
15545
15561
  }
15546
15562
  );
15547
- }), H0 = {
15563
+ }), U0 = {
15548
15564
  frame: "FRAME",
15549
15565
  "screen-state": "STATE",
15550
15566
  "component-state": "TOGGLE",
@@ -15553,7 +15569,7 @@ const wd = We(function({
15553
15569
  "interactive-state": "AXIS",
15554
15570
  "card-slot": "SLOT",
15555
15571
  "list-length": "LIST"
15556
- }, U0 = /* @__PURE__ */ new Set([
15572
+ }, V0 = /* @__PURE__ */ new Set([
15557
15573
  "component-state",
15558
15574
  "card-slot",
15559
15575
  "list-length"
@@ -15581,9 +15597,9 @@ function Sd(e) {
15581
15597
  const Nd = We(function({
15582
15598
  page: t
15583
15599
  }) {
15584
- const n = O0(t.importPageId ?? t.id);
15600
+ const n = j0(t.importPageId ?? t.id);
15585
15601
  return n.length === 0 ? null : /* @__PURE__ */ a(De, { title: "Scenario coverage", children: n.map((r) => {
15586
- const o = !f.editMode && U0.has(r.kind);
15602
+ const o = !f.editMode && V0.has(r.kind);
15587
15603
  return /* @__PURE__ */ g(
15588
15604
  "button",
15589
15605
  {
@@ -15594,33 +15610,33 @@ const Nd = We(function({
15594
15610
  title: o ? Vn : r.reason ?? Sd(r),
15595
15611
  className: "flex h-7 items-center justify-between gap-2 rounded-md bg-[#fafafa] px-2 text-left ring-1 ring-inset ring-[#ececec] hover:bg-[#f0f7ff] disabled:cursor-not-allowed disabled:opacity-45 disabled:hover:bg-[#fafafa]",
15596
15612
  onClick: () => {
15597
- z0(r);
15613
+ D0(r);
15598
15614
  },
15599
15615
  children: [
15600
15616
  /* @__PURE__ */ a("span", { className: "truncate text-[11px] font-semibold text-[#333]", children: r.scenarioId }),
15601
15617
  /* @__PURE__ */ g("span", { className: "flex shrink-0 items-center gap-1", children: [
15602
15618
  /* @__PURE__ */ a("span", { className: "max-w-40 truncate text-[9px] text-[#999]", children: Sd(r) }),
15603
- /* @__PURE__ */ a("span", { className: "rounded bg-[#f0f0f0] px-1 py-0.5 text-[8px] font-semibold tracking-wide text-[#666]", children: H0[r.kind] ?? r.kind })
15619
+ /* @__PURE__ */ a("span", { className: "rounded bg-[#f0f0f0] px-1 py-0.5 text-[8px] font-semibold tracking-wide text-[#666]", children: U0[r.kind] ?? r.kind })
15604
15620
  ] })
15605
15621
  ]
15606
15622
  },
15607
15623
  r.scenarioId
15608
15624
  );
15609
15625
  }) });
15610
- }), V0 = "/__pygmalion-storyboard/component-branches", Id = /* @__PURE__ */ new Map();
15611
- function K0(e) {
15626
+ }), K0 = "/__pygmalion-storyboard/component-branches", Id = /* @__PURE__ */ new Map();
15627
+ function q0(e) {
15612
15628
  const t = Id.get(e);
15613
15629
  if (t) return t;
15614
15630
  const n = fetch(
15615
- `${V0}?source=${encodeURIComponent(e)}`
15631
+ `${K0}?source=${encodeURIComponent(e)}`
15616
15632
  ).then((r) => r.ok ? r.json() : { branches: [] }).then((r) => r.branches ?? []).catch(() => []);
15617
15633
  return Id.set(e, n), n;
15618
15634
  }
15619
- function q0(e) {
15635
+ function Y0(e) {
15620
15636
  var t, n;
15621
15637
  return e.prop ? (((n = (t = ut()[e.component]) == null ? void 0 : t.props) == null ? void 0 : n[e.prop]) ?? []).filter((o) => typeof o == "string") : (e.options ?? []).map((r) => r.label);
15622
15638
  }
15623
- function Y0({
15639
+ function G0({
15624
15640
  label: e,
15625
15641
  title: t,
15626
15642
  ariaLabel: n,
@@ -15645,7 +15661,7 @@ function Y0({
15645
15661
  )
15646
15662
  ] });
15647
15663
  }
15648
- const G0 = We(function({
15664
+ const X0 = We(function({
15649
15665
  page: t
15650
15666
  }) {
15651
15667
  const n = sp(), [r, o] = Q({}), i = n.filter(
@@ -15654,7 +15670,7 @@ const G0 = We(function({
15654
15670
  return ie(() => {
15655
15671
  let c = !0;
15656
15672
  for (const l of s)
15657
- K0(l).then((d) => {
15673
+ q0(l).then((d) => {
15658
15674
  c && o(
15659
15675
  (u) => u[l] ? u : { ...u, [l]: d }
15660
15676
  );
@@ -15665,7 +15681,7 @@ const G0 = We(function({
15665
15681
  }, [s.join("|")]), i.length === 0 ? null : /* @__PURE__ */ a(De, { title: "Screen dimensions", children: i.map((c) => {
15666
15682
  const l = [ul(t, c)].filter(
15667
15683
  Boolean
15668
- ), d = q0(c), u = new Set(d), h = (c.sourcePath ? r[c.sourcePath] ?? [] : []).filter((b) => {
15684
+ ), d = Y0(c), u = new Set(d), h = (c.sourcePath ? r[c.sourcePath] ?? [] : []).filter((b) => {
15669
15685
  const x = [b.renders, ...b.values ?? []].filter(
15670
15686
  (v) => !!v
15671
15687
  );
@@ -15678,7 +15694,7 @@ const G0 = We(function({
15678
15694
  className: "flex flex-col gap-1",
15679
15695
  children: [
15680
15696
  l.map((b) => /* @__PURE__ */ a(
15681
- Y0,
15697
+ G0,
15682
15698
  {
15683
15699
  label: c.label,
15684
15700
  title: c.component,
@@ -15718,7 +15734,7 @@ const G0 = We(function({
15718
15734
  c.id
15719
15735
  );
15720
15736
  }) });
15721
- }), X0 = We(function({
15737
+ }), J0 = We(function({
15722
15738
  page: t
15723
15739
  }) {
15724
15740
  const n = su().filter(
@@ -15770,7 +15786,7 @@ const G0 = We(function({
15770
15786
  r.id
15771
15787
  );
15772
15788
  }) });
15773
- }), J0 = We(function({
15789
+ }), Q0 = We(function({
15774
15790
  page: t
15775
15791
  }) {
15776
15792
  const n = iu().filter(
@@ -15816,7 +15832,7 @@ const G0 = We(function({
15816
15832
  })
15817
15833
  ] }, o.id)) }, r.id)) });
15818
15834
  });
15819
- function Q0({ pageId: e }) {
15835
+ function Z0({ pageId: e }) {
15820
15836
  const t = qe(
15821
15837
  nf,
15822
15838
  Pi,
@@ -16200,7 +16216,7 @@ const Cd = We(function({
16200
16216
  r.id
16201
16217
  ))
16202
16218
  ] });
16203
- }), Z0 = [
16219
+ }), e1 = [
16204
16220
  { v: "fill", label: "Fill" },
16205
16221
  { v: "fit", label: "Hug" },
16206
16222
  { v: "fixed", label: "Fixed" }
@@ -16211,7 +16227,7 @@ function on({ label: e, value: t }) {
16211
16227
  /* @__PURE__ */ a("span", { className: "min-w-0 truncate text-right text-[#333]", title: t, children: t })
16212
16228
  ] });
16213
16229
  }
16214
- function e1({
16230
+ function t1({
16215
16231
  group: e,
16216
16232
  title: t,
16217
16233
  description: n
@@ -16284,7 +16300,7 @@ function Md({
16284
16300
  }
16285
16301
  );
16286
16302
  }
16287
- function t1({ page: e }) {
16303
+ function n1({ page: e }) {
16288
16304
  return /* @__PURE__ */ g(
16289
16305
  "div",
16290
16306
  {
@@ -16324,7 +16340,7 @@ function t1({ page: e }) {
16324
16340
  function Ed(e, t) {
16325
16341
  return e === "fixed" ? `${Math.round(t ?? 0)}px` : e;
16326
16342
  }
16327
- const n1 = We(function({
16343
+ const r1 = We(function({
16328
16344
  node: t
16329
16345
  }) {
16330
16346
  const n = t.type === "component" ? ut()[t.componentName] : void 0, r = Object.entries(t.componentProps ?? {});
@@ -16342,7 +16358,7 @@ const n1 = We(function({
16342
16358
  ] }),
16343
16359
  t.sourceComponent && /* @__PURE__ */ a(De, { title: "Source", children: /* @__PURE__ */ a(on, { label: "Component", value: t.sourceComponent }) })
16344
16360
  ] });
16345
- }), r1 = We(function({
16361
+ }), o1 = We(function({
16346
16362
  section: t,
16347
16363
  members: n
16348
16364
  }) {
@@ -16358,7 +16374,7 @@ const n1 = We(function({
16358
16374
  /* @__PURE__ */ a(on, { label: "Frames", value: String(n) })
16359
16375
  ] }) });
16360
16376
  });
16361
- function o1({ node: e }) {
16377
+ function i1({ node: e }) {
16362
16378
  const t = f.sharedSourceImpactFor(e);
16363
16379
  if (t.frames.length < 2) return null;
16364
16380
  const n = f.sharedSourceEditScopeFor(e), r = t.frames.slice(0, 3).map((s) => s.name), o = t.frames.length - r.length, i = `${r.join(" · ")}${o > 0 ? ` · ${o} more` : ""}`;
@@ -16393,7 +16409,7 @@ function o1({ node: e }) {
16393
16409
  /* @__PURE__ */ a("div", { className: "text-[10px] leading-relaxed text-[#999]", children: "Unsupported source operations remain limited to the selected frame." })
16394
16410
  ] });
16395
16411
  }
16396
- function i1({ node: e }) {
16412
+ function s1({ node: e }) {
16397
16413
  var i;
16398
16414
  const t = e.type === "component" ? (i = ut()[e.componentName]) == null ? void 0 : i.props : void 0, n = Object.entries(e.sourceProps).filter(
16399
16415
  ([s]) => !t || !Object.hasOwn(t, s)
@@ -16528,7 +16544,7 @@ function Ad({ value: e, onChange: t }) {
16528
16544
  className: "h-7 min-w-0 flex-1 rounded-md bg-[#f5f5f5] px-1.5 text-[11px] text-[#333] outline-none hover:ring-1 hover:ring-inset hover:ring-[#e6e6e6]",
16529
16545
  value: e,
16530
16546
  onChange: (n) => t(n.target.value),
16531
- children: Z0.map((n) => /* @__PURE__ */ a("option", { value: n.v, children: n.label }, n.v))
16547
+ children: e1.map((n) => /* @__PURE__ */ a("option", { value: n.v, children: n.label }, n.v))
16532
16548
  }
16533
16549
  );
16534
16550
  }
@@ -16642,7 +16658,7 @@ function Rd({
16642
16658
  )) });
16643
16659
  }
16644
16660
  const Td = ["start", "center", "end"];
16645
- function s1({ node: e }) {
16661
+ function a1({ node: e }) {
16646
16662
  const t = e.type === "rows", n = (o, i) => f.patch(
16647
16663
  e,
16648
16664
  t ? { justify: o, alignItems: i } : { justify: i, alignItems: o }
@@ -16678,14 +16694,14 @@ function s1({ node: e }) {
16678
16694
  )
16679
16695
  ] });
16680
16696
  }
16681
- function a1(e) {
16697
+ function c1(e) {
16682
16698
  const t = e.root.domStyle.display;
16683
16699
  if (t === "grid" || t === "inline-grid") return "grid";
16684
16700
  if (t === "block" || t === "contents") return "free";
16685
16701
  const n = e.root.domStyle.flexDirection;
16686
16702
  return n != null && n.startsWith("row") ? "horizontal" : n != null && n.startsWith("column") ? "vertical" : e.root.type === "columns" ? "horizontal" : "vertical";
16687
16703
  }
16688
- function c1({ mode: e }) {
16704
+ function l1({ mode: e }) {
16689
16705
  return e === "grid" ? /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "grid h-4 w-4 grid-cols-2 gap-[3px]", children: [0, 1, 2, 3].map((t) => /* @__PURE__ */ a("i", { className: "rounded-[2px] border border-current" }, t)) }) : e === "vertical" || e === "horizontal" ? /* @__PURE__ */ g("span", { "aria-hidden": "true", className: `flex items-center gap-[3px] ${e === "vertical" ? "flex-col" : ""}`, children: [
16690
16706
  /* @__PURE__ */ a("i", { className: "h-[5px] w-[5px] rounded-[2px] border border-current" }),
16691
16707
  /* @__PURE__ */ a("i", { className: "h-[5px] w-[5px] rounded-[2px] border border-current" }),
@@ -16696,13 +16712,13 @@ function c1({ mode: e }) {
16696
16712
  /* @__PURE__ */ a("i", { className: "absolute bottom-0 left-[4px] h-[5px] w-[5px] rounded-[2px] border border-current" })
16697
16713
  ] });
16698
16714
  }
16699
- const l1 = We(function({ page: t }) {
16715
+ const d1 = We(function({ page: t }) {
16700
16716
  qe(
16701
16717
  wc,
16702
16718
  Ar,
16703
16719
  Ar
16704
16720
  );
16705
- const n = t.route == null, r = (v) => f.patchPage(t.id, v), o = a1(t), i = (v) => {
16721
+ const n = t.route == null, r = (v) => f.patchPage(t.id, v), o = c1(t), i = (v) => {
16706
16722
  const y = { ...t.root.domStyle };
16707
16723
  v === "free" ? (y.display = "block", y.position = "relative", delete y.flexDirection, delete y.gridTemplateColumns) : v === "grid" ? (y.display = "grid", y.gridTemplateColumns || (y.gridTemplateColumns = "repeat(2, minmax(0, 1fr))"), y.gap || (y.gap = `${t.root.gap}px`), delete y.flexDirection) : (y.display = "flex", y.flexDirection = v === "horizontal" ? "row" : "column", delete y.gridTemplateColumns), f.patch(t.root, {
16708
16724
  type: v === "horizontal" ? "columns" : "rows",
@@ -16763,7 +16779,7 @@ const l1 = We(function({ page: t }) {
16763
16779
  className: "flex gap-0.5 rounded-lg bg-[#f2f4f6] p-0.5",
16764
16780
  children: [
16765
16781
  d.map((v) => {
16766
- const y = (!m || h) && T0(v, {
16782
+ const y = (!m || h) && F0(v, {
16767
16783
  width: t.width ?? 390,
16768
16784
  height: t.height ?? 600
16769
16785
  });
@@ -16865,7 +16881,7 @@ const l1 = We(function({ page: t }) {
16865
16881
  value: t.name,
16866
16882
  onChange: (v) => r({ name: v.target.value })
16867
16883
  }
16868
- ) }) : /* @__PURE__ */ a(t1, { page: t }),
16884
+ ) }) : /* @__PURE__ */ a(n1, { page: t }),
16869
16885
  b,
16870
16886
  f.editMode ? /* @__PURE__ */ g(He, { children: [
16871
16887
  /* @__PURE__ */ a(wd, { page: t }),
@@ -16873,20 +16889,20 @@ const l1 = We(function({ page: t }) {
16873
16889
  /* @__PURE__ */ a(Cd, { page: t }),
16874
16890
  /* @__PURE__ */ a(Pd, { page: t }),
16875
16891
  /* @__PURE__ */ a($d, { page: t }),
16876
- /* @__PURE__ */ a(G0, { page: t }),
16877
- /* @__PURE__ */ a(J0, { page: t }),
16878
16892
  /* @__PURE__ */ a(X0, { page: t }),
16893
+ /* @__PURE__ */ a(Q0, { page: t }),
16894
+ /* @__PURE__ */ a(J0, { page: t }),
16879
16895
  /* @__PURE__ */ a(Nd, { page: t })
16880
16896
  ] }) : /* @__PURE__ */ g(He, { children: [
16881
16897
  /* @__PURE__ */ a(
16882
- e1,
16898
+ t1,
16883
16899
  {
16884
16900
  group: "screen-state",
16885
16901
  title: "Screen state",
16886
16902
  description: "Choose a reproducible state or use the running screen directly."
16887
16903
  }
16888
16904
  ),
16889
- t.route ? /* @__PURE__ */ a(Q0, { pageId: t.id }) : null,
16905
+ t.route ? /* @__PURE__ */ a(Z0, { pageId: t.id }) : null,
16890
16906
  /* @__PURE__ */ a(wd, { page: t }),
16891
16907
  /* @__PURE__ */ a(Cd, { page: t }),
16892
16908
  /* @__PURE__ */ g(
@@ -16977,7 +16993,7 @@ const l1 = We(function({ page: t }) {
16977
16993
  "aria-pressed": o === v,
16978
16994
  className: `flex h-8 items-center justify-center rounded-md ${o === v ? "bg-white text-[#18181b] shadow-sm ring-1 ring-inset ring-[#dedee3]" : "text-[#777] hover:text-[#333]"}`,
16979
16995
  onClick: () => i(v),
16980
- children: /* @__PURE__ */ a(c1, { mode: v })
16996
+ children: /* @__PURE__ */ a(l1, { mode: v })
16981
16997
  },
16982
16998
  v
16983
16999
  )) }),
@@ -17058,7 +17074,7 @@ const l1 = We(function({ page: t }) {
17058
17074
  ] })
17059
17075
  ] })
17060
17076
  ] });
17061
- }), d1 = We(function({ section: t }) {
17077
+ }), u1 = We(function({ section: t }) {
17062
17078
  const n = f.canvasPages.filter((r) => r.section === t.name).length;
17063
17079
  return f.editMode ? /* @__PURE__ */ g("div", { "data-object-props": "section", className: "min-h-0 flex-1 overflow-auto", children: [
17064
17080
  /* @__PURE__ */ g(De, { title: "Section", children: [
@@ -17134,16 +17150,16 @@ const l1 = We(function({ page: t }) {
17134
17150
  ]
17135
17151
  }
17136
17152
  ) })
17137
- ] }) : /* @__PURE__ */ a(r1, { section: t, members: n });
17138
- }), u1 = We(function() {
17153
+ ] }) : /* @__PURE__ */ a(o1, { section: t, members: n });
17154
+ }), f1 = We(function() {
17139
17155
  var l, d;
17140
17156
  if (((l = f.selectedCanvasObject) == null ? void 0 : l.kind) === "frame") {
17141
17157
  const u = f.selectedFrame;
17142
- return u ? /* @__PURE__ */ a(l1, { page: u }) : null;
17158
+ return u ? /* @__PURE__ */ a(d1, { page: u }) : null;
17143
17159
  }
17144
17160
  if (((d = f.selectedCanvasObject) == null ? void 0 : d.kind) === "section") {
17145
17161
  const u = f.selectedSection;
17146
- return u ? /* @__PURE__ */ a(d1, { section: u }) : null;
17162
+ return u ? /* @__PURE__ */ a(u1, { section: u }) : null;
17147
17163
  }
17148
17164
  const t = f.selected;
17149
17165
  if (!t)
@@ -17158,8 +17174,8 @@ const l1 = We(function({ page: t }) {
17158
17174
  f.selectedIds.length,
17159
17175
  " selected · Property edits use the primary selection"
17160
17176
  ] }),
17161
- /* @__PURE__ */ a(o1, { node: t }),
17162
17177
  /* @__PURE__ */ a(i1, { node: t }),
17178
+ /* @__PURE__ */ a(s1, { node: t }),
17163
17179
  /* @__PURE__ */ a(De, { title: t.name, children: /* @__PURE__ */ a(
17164
17180
  "input",
17165
17181
  {
@@ -17187,15 +17203,15 @@ const l1 = We(function({ page: t }) {
17187
17203
  t.componentName
17188
17204
  ] }),
17189
17205
  s && /* @__PURE__ */ a(
17190
- W0,
17206
+ H0,
17191
17207
  {
17192
17208
  node: t,
17193
17209
  entry: s,
17194
- sourceWritableProps: t.sourceComponent ? F0(t, s) : null,
17210
+ sourceWritableProps: t.sourceComponent ? L0(t, s) : null,
17195
17211
  propBadges: Object.fromEntries(
17196
17212
  Object.keys(s.props ?? {}).map((u) => [
17197
17213
  u,
17198
- j0(
17214
+ B0(
17199
17215
  f.activePage.importPageId ?? f.activePage.id,
17200
17216
  t.componentName,
17201
17217
  u
@@ -17228,7 +17244,7 @@ const l1 = We(function({ page: t }) {
17228
17244
  onChange: (u) => n({ type: u })
17229
17245
  }
17230
17246
  ),
17231
- /* @__PURE__ */ a(s1, { node: t }),
17247
+ /* @__PURE__ */ a(a1, { node: t }),
17232
17248
  /* @__PURE__ */ g("div", { className: "flex gap-1.5", children: [
17233
17249
  /* @__PURE__ */ a(xt, { label: "Gap", value: t.gap, onChange: (u) => n({ gap: u }) }),
17234
17250
  /* @__PURE__ */ a(xt, { label: "Padding", value: t.padding, onChange: (u) => n({ padding: u }) })
@@ -17343,8 +17359,8 @@ const l1 = We(function({ page: t }) {
17343
17359
  ),
17344
17360
  /* @__PURE__ */ a(fi, { value: t.color, onChange: (u) => n({ color: u }) })
17345
17361
  ] })
17346
- ] }) : /* @__PURE__ */ a(n1, { node: t });
17347
- }), f1 = We(function() {
17362
+ ] }) : /* @__PURE__ */ a(r1, { node: t });
17363
+ }), h1 = We(function() {
17348
17364
  return /* @__PURE__ */ g(He, { children: [
17349
17365
  /* @__PURE__ */ a(
17350
17366
  "button",
@@ -17398,7 +17414,7 @@ We(function() {
17398
17414
  )
17399
17415
  ] });
17400
17416
  });
17401
- function h1(e) {
17417
+ function m1(e) {
17402
17418
  return [...new Set(e)].sort().join(`
17403
17419
  `);
17404
17420
  }
@@ -17409,10 +17425,10 @@ function Fd(e, t) {
17409
17425
  r - t.viewportHeight / 2
17410
17426
  );
17411
17427
  }
17412
- function m1(e, t) {
17428
+ function p1(e, t) {
17413
17429
  return e === t ? 0 : e < t ? -1 : 1;
17414
17430
  }
17415
- function p1(e, t = {}) {
17431
+ function g1(e, t = {}) {
17416
17432
  const n = t.hasSnapshot ?? (() => !1), r = [], o = [], i = /* @__PURE__ */ new Set();
17417
17433
  for (const m of e)
17418
17434
  if (!n(m.key)) {
@@ -17423,7 +17439,7 @@ function p1(e, t = {}) {
17423
17439
  i.has(m.key) || (i.add(m.key), o.push(m));
17424
17440
  }
17425
17441
  const s = o.map((m, h) => ({ candidate: m, order: h })).sort(
17426
- (m, h) => m1(m.candidate.distance, h.candidate.distance) || m.order - h.order
17442
+ (m, h) => p1(m.candidate.distance, h.candidate.distance) || m.order - h.order
17427
17443
  ).map((m) => m.candidate), c = /* @__PURE__ */ new Map();
17428
17444
  for (const m of s) {
17429
17445
  if (m.groupKey == null) continue;
@@ -17452,33 +17468,33 @@ function p1(e, t = {}) {
17452
17468
  }
17453
17469
  return { units: l, interactionFrames: r };
17454
17470
  }
17455
- const g1 = 250, b1 = 8, x1 = 32, v1 = /* @__PURE__ */ new Set();
17471
+ const b1 = 250, x1 = 8, v1 = 32, y1 = /* @__PURE__ */ new Set();
17456
17472
  let Ld = {
17457
17473
  phase: "idle",
17458
17474
  total: 0,
17459
17475
  completed: 0,
17460
17476
  failed: 0
17461
17477
  };
17462
- function y1(e) {
17478
+ function w1(e) {
17463
17479
  const t = Ld;
17464
17480
  if (!(t.phase === e.phase && t.total === e.total && t.completed === e.completed && t.failed === e.failed)) {
17465
17481
  Ld = e;
17466
- for (const n of v1) n();
17482
+ for (const n of y1) n();
17467
17483
  }
17468
17484
  }
17469
- function w1(e, t = {}) {
17485
+ function S1(e, t = {}) {
17470
17486
  const n = Math.max(
17471
17487
  1,
17472
- t.pauseBackoffMs ?? g1
17488
+ t.pauseBackoffMs ?? b1
17473
17489
  ), r = Math.max(
17474
17490
  1,
17475
- t.interactionChunkSize ?? b1
17491
+ t.interactionChunkSize ?? x1
17476
17492
  ), o = Math.max(
17477
17493
  0,
17478
- t.interactionRequestCap ?? x1
17494
+ t.interactionRequestCap ?? v1
17479
17495
  );
17480
17496
  let i = 0, s = !1, c = null, l = 0, d = 0, u = 0;
17481
- const m = (E) => new Promise((k) => setTimeout(k, E)), h = (E) => y1({ phase: E, total: l, completed: d, failed: u }), b = (E, k) => {
17497
+ const m = (E) => new Promise((k) => setTimeout(k, E)), h = (E) => w1({ phase: E, total: l, completed: d, failed: u }), b = (E, k) => {
17482
17498
  if (E)
17483
17499
  try {
17484
17500
  k ? E.discard() : E.release();
@@ -17502,20 +17518,20 @@ function w1(e, t = {}) {
17502
17518
  }
17503
17519
  if (k !== i) return;
17504
17520
  h("running");
17505
- let B = null;
17521
+ let j = null;
17506
17522
  try {
17507
- if (B = await e.leaseInstance(D), k !== i) {
17508
- b(B, !1);
17523
+ if (j = await e.leaseInstance(D), k !== i) {
17524
+ b(j, !1);
17509
17525
  return;
17510
17526
  }
17511
- if (c = B, await e.produce(D, B, () => k !== i), k !== i) {
17512
- c === B && x(!1);
17527
+ if (c = j, await e.produce(D, j, () => k !== i), k !== i) {
17528
+ c === j && x(!1);
17513
17529
  return;
17514
17530
  }
17515
17531
  d += 1, x(!1);
17516
17532
  } catch (C) {
17517
17533
  if (k !== i) return;
17518
- c = B, x(!0), u += 1, (N = e.log) == null || N.call(
17534
+ c = j, x(!0), u += 1, (N = e.log) == null || N.call(
17519
17535
  e,
17520
17536
  `Preview sweep unit failed for ${D.pageId}: ${C instanceof Error ? C.message : String(C)}`
17521
17537
  );
@@ -17528,10 +17544,10 @@ function w1(e, t = {}) {
17528
17544
  if (k !== i) return;
17529
17545
  try {
17530
17546
  e.requestArtifactFrames(P.slice(D, D + r));
17531
- } catch (B) {
17547
+ } catch (j) {
17532
17548
  (T = e.log) == null || T.call(
17533
17549
  e,
17534
- `Preview sweep delegation failed: ${B instanceof Error ? B.message : String(B)}`
17550
+ `Preview sweep delegation failed: ${j instanceof Error ? j.message : String(j)}`
17535
17551
  );
17536
17552
  }
17537
17553
  }
@@ -17545,7 +17561,7 @@ function w1(e, t = {}) {
17545
17561
  }
17546
17562
  return { run: v, cancel: y };
17547
17563
  }
17548
- const _d = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", S1 = 600, N1 = 200, zd = 280, I1 = 480, zs = "absolute bottom-11 left-1/2 z-40 w-44 -translate-x-1/2 rounded-xl bg-[#1e1e1e] p-1.5 text-[12px] shadow-[0_4px_20px_rgba(0,0,0,.25)]", to = (e) => `flex h-9 w-9 items-center justify-center rounded-lg ${e ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
17564
+ const _d = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", N1 = 600, I1 = 200, zd = 280, C1 = 480, zs = "absolute bottom-11 left-1/2 z-40 w-44 -translate-x-1/2 rounded-xl bg-[#1e1e1e] p-1.5 text-[12px] shadow-[0_4px_20px_rgba(0,0,0,.25)]", to = (e) => `flex h-9 w-9 items-center justify-center rounded-lg ${e ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
17549
17565
  function Wn({
17550
17566
  icon: e,
17551
17567
  label: t,
@@ -17573,7 +17589,7 @@ function Wn({
17573
17589
  )
17574
17590
  );
17575
17591
  }
17576
- const C1 = We(function({
17592
+ const P1 = We(function({
17577
17593
  previewIdentityReady: t = !0
17578
17594
  } = {}) {
17579
17595
  var ot;
@@ -17622,7 +17638,7 @@ const C1 = We(function({
17622
17638
  )
17623
17639
  ])
17624
17640
  )
17625
- ], h = h1(m), [b, x] = Q("");
17641
+ ], h = m1(m), [b, x] = Q("");
17626
17642
  ie(() => {
17627
17643
  let S = !0;
17628
17644
  return x(""), t ? (bc(m).then(() => {
@@ -17686,9 +17702,9 @@ const C1 = We(function({
17686
17702
  ...ne && re ? { frame: { id: xe, fingerprint: re } } : {}
17687
17703
  });
17688
17704
  }
17689
- const le = p1(ce, {
17705
+ const le = g1(ce, {
17690
17706
  hasSnapshot: tr
17691
- }), J = $c(), Se = w1({
17707
+ }), J = $c(), Se = S1({
17692
17708
  leaseInstance: async (H) => {
17693
17709
  const Ce = O.get(H.pageId);
17694
17710
  if (!Ce || Ce.route == null) return null;
@@ -17938,7 +17954,7 @@ const C1 = We(function({
17938
17954
  (F) => F.id === R
17939
17955
  );
17940
17956
  $ && Sf($, s);
17941
- }, S1);
17957
+ }, N1);
17942
17958
  return () => clearTimeout(S);
17943
17959
  }, [
17944
17960
  N,
@@ -17947,7 +17963,7 @@ const C1 = We(function({
17947
17963
  t,
17948
17964
  s
17949
17965
  ]);
17950
- const [W, _] = Q(!1), [D, B] = Q(null), [C, I] = Q("story"), [A, X] = Q(null), ge = Object.keys(ut()), _e = f.canAddFrame, te = f.editMode, Pe = (S) => {
17966
+ const [W, _] = Q(!1), [D, j] = Q(null), [C, I] = Q("story"), [A, X] = Q(null), ge = Object.keys(ut()), _e = f.canAddFrame, te = f.editMode, Pe = (S) => {
17951
17967
  f.setTool(S), X(null);
17952
17968
  }, [U, se] = Q(!0), [ae, K] = Q(!0), [q, $e] = Q(zd), [Ie, Ae] = Q(zd), fe = ke(!1), me = (S) => {
17953
17969
  const $ = f.pages.find((le) => le.id === S), F = n.current;
@@ -18197,8 +18213,8 @@ const C1 = We(function({
18197
18213
  $.preventDefault();
18198
18214
  const F = $.clientX, G = S === "left" ? q : Ie, O = (le) => {
18199
18215
  const J = S === "left" ? le.clientX - F : F - le.clientX, Se = Math.max(
18200
- N1,
18201
- Math.min(I1, G + J)
18216
+ I1,
18217
+ Math.min(C1, G + J)
18202
18218
  );
18203
18219
  S === "left" ? $e(Se) : Ae(Se);
18204
18220
  }, ce = () => {
@@ -18303,10 +18319,10 @@ const C1 = We(function({
18303
18319
  if (f.tool === "section") {
18304
18320
  if (!f.editMode) return;
18305
18321
  const J = { x: S.clientX, y: S.clientY }, Se = (H) => {
18306
- fe.current = !0, B({ x0: J.x, y0: J.y, x1: H.clientX, y1: H.clientY });
18322
+ fe.current = !0, j({ x0: J.x, y0: J.y, x1: H.clientX, y1: H.clientY });
18307
18323
  }, he = (H) => {
18308
18324
  var ne;
18309
- window.removeEventListener("mousemove", Se), window.removeEventListener("mouseup", he), B(null);
18325
+ window.removeEventListener("mousemove", Se), window.removeEventListener("mouseup", he), j(null);
18310
18326
  const Ce = (ne = n.current) == null ? void 0 : ne.getBoundingClientRect();
18311
18327
  if (!Ce) return;
18312
18328
  const ye = (xe) => (xe - Ce.left - f.panX) / f.zoom, Ne = (xe) => (xe - Ce.top - f.panY) / f.zoom;
@@ -18320,7 +18336,7 @@ const C1 = We(function({
18320
18336
  let G = !1;
18321
18337
  const O = (J) => {
18322
18338
  if (!G && Math.hypot(J.clientX - F.x, J.clientY - F.y) < 4) return;
18323
- G = !0, fe.current = !0, B({ x0: F.x, y0: F.y, x1: J.clientX, y1: J.clientY });
18339
+ G = !0, fe.current = !0, j({ x0: F.x, y0: F.y, x1: J.clientX, y1: J.clientY });
18324
18340
  const Se = Math.min(F.x, J.clientX), he = Math.max(F.x, J.clientX), H = Math.min(F.y, J.clientY), Ce = Math.max(F.y, J.clientY), ye = f.root.children.filter((Ne) => {
18325
18341
  if (Ne.hidden || Ne.locked) return !1;
18326
18342
  const ne = document.querySelector(`[data-node-id="${Ne.id}"]`);
@@ -18330,7 +18346,7 @@ const C1 = We(function({
18330
18346
  }).map((Ne) => Ne.id);
18331
18347
  f.setSelection(ye);
18332
18348
  }, ce = () => {
18333
- window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", ce), B(null);
18349
+ window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", ce), j(null);
18334
18350
  };
18335
18351
  window.addEventListener("mousemove", O), window.addEventListener("mouseup", ce);
18336
18352
  },
@@ -18442,7 +18458,7 @@ const C1 = We(function({
18442
18458
  )) })
18443
18459
  ] }),
18444
18460
  /* @__PURE__ */ a(
18445
- A0,
18461
+ R0,
18446
18462
  {
18447
18463
  view: C,
18448
18464
  onFrameFocus: me,
@@ -18593,9 +18609,9 @@ const C1 = We(function({
18593
18609
  ] }),
18594
18610
  /* @__PURE__ */ g("header", { className: "flex h-10 items-center gap-3 border-b border-[#e6e6e6] px-3", children: [
18595
18611
  /* @__PURE__ */ a("span", { className: "text-[11px] font-semibold text-[#333]", children: ((ot = f.selectedCanvasObject) == null ? void 0 : ot.kind) === "frame" ? "Preview" : "Design" }),
18596
- /* @__PURE__ */ a("span", { className: "ml-auto flex items-center gap-1 text-[11px] text-[#666]", children: /* @__PURE__ */ a(f1, {}) })
18612
+ /* @__PURE__ */ a("span", { className: "ml-auto flex items-center gap-1 text-[11px] text-[#666]", children: /* @__PURE__ */ a(h1, {}) })
18597
18613
  ] }),
18598
- /* @__PURE__ */ a(u1, {}),
18614
+ /* @__PURE__ */ a(f1, {}),
18599
18615
  /* @__PURE__ */ a(Vw, {}),
18600
18616
  /* @__PURE__ */ a(
18601
18617
  "div",
@@ -18845,12 +18861,12 @@ const C1 = We(function({
18845
18861
  ]
18846
18862
  }
18847
18863
  );
18848
- }), P1 = 1, $1 = 4;
18849
- function M1() {
18864
+ }), $1 = 1, M1 = 4;
18865
+ function E1() {
18850
18866
  if (!(typeof navigator > "u"))
18851
18867
  return navigator.deviceMemory;
18852
18868
  }
18853
- function E1(e, t, n, r = P1) {
18869
+ function k1(e, t, n, r = $1) {
18854
18870
  const o = /* @__PURE__ */ new Map();
18855
18871
  return e.forEach((i, s) => {
18856
18872
  if (!Pc(i)) return;
@@ -18881,7 +18897,7 @@ function E1(e, t, n, r = P1) {
18881
18897
  });
18882
18898
  }), [...o.values()].sort((i, s) => s.members - i.members || i.order - s.order).slice(0, Math.max(0, r)).map((i) => i.target);
18883
18899
  }
18884
- function k1(e, t, n) {
18900
+ function A1(e, t, n) {
18885
18901
  if (!e) return [];
18886
18902
  const r = (m) => m.importPageId ?? m.id, o = t.find((m) => m.id === n);
18887
18903
  if (!o) return [];
@@ -18914,13 +18930,13 @@ function k1(e, t, n) {
18914
18930
  }
18915
18931
  return d;
18916
18932
  }
18917
- function A1(e) {
18918
- const t = e.deviceMemoryGb ?? M1();
18919
- if (t != null && t < $1)
18933
+ function R1(e) {
18934
+ const t = e.deviceMemoryGb ?? E1();
18935
+ if (t != null && t < M1)
18920
18936
  return () => {
18921
18937
  };
18922
18938
  const n = e.instances ?? $c(), r = e.getGraph ?? Wa;
18923
- for (const o of E1(
18939
+ for (const o of k1(
18924
18940
  e.getPages(),
18925
18941
  e.appOrigin,
18926
18942
  e.baselineEnvironment
@@ -18931,7 +18947,7 @@ function A1(e) {
18931
18947
  () => e.editor.activePageId,
18932
18948
  (o) => {
18933
18949
  if (!o) return;
18934
- const i = k1(
18950
+ const i = A1(
18935
18951
  r(),
18936
18952
  e.getPages(),
18937
18953
  o
@@ -18943,7 +18959,7 @@ function A1(e) {
18943
18959
  }
18944
18960
  );
18945
18961
  }
18946
- function R1(e) {
18962
+ function T1(e) {
18947
18963
  return e.flatMap((t, n) => {
18948
18964
  const r = t.id.trim() || `path:${n + 1}`, o = t.screenIds.map((i) => i.trim()).filter(Boolean);
18949
18965
  return o.slice(1).map((i, s) => {
@@ -18975,7 +18991,7 @@ function Va(e, t = /* @__PURE__ */ new Set()) {
18975
18991
  }
18976
18992
  return t.delete(e), n;
18977
18993
  }
18978
- function T1(e) {
18994
+ function F1(e) {
18979
18995
  return JSON.stringify(
18980
18996
  Va({
18981
18997
  version: 1,
@@ -18999,11 +19015,11 @@ function T1(e) {
18999
19015
  function mt(e) {
19000
19016
  return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, n) => t.localeCompare(n));
19001
19017
  }
19002
- function F1(e, t) {
19018
+ function L1(e, t) {
19003
19019
  var r;
19004
19020
  return ((r = e.id) == null ? void 0 : r.trim()) || `edge:${t + 1}`;
19005
19021
  }
19006
- function L1(e) {
19022
+ function _1(e) {
19007
19023
  const t = [...e.screens].sort((r, o) => r.id.localeCompare(o.id)), n = t[0].id;
19008
19024
  return {
19009
19025
  id: `story:${n}`,
@@ -19032,7 +19048,7 @@ function Dd(e) {
19032
19048
  e.scenarioId
19033
19049
  ].join(":");
19034
19050
  }
19035
- function _1(e) {
19051
+ function z1(e) {
19036
19052
  var fe, me, ue, ot;
19037
19053
  const t = [], n = [], r = /* @__PURE__ */ new Map();
19038
19054
  for (const S of e.screens) {
@@ -19053,7 +19069,7 @@ function _1(e) {
19053
19069
  for (const S of n) {
19054
19070
  let $;
19055
19071
  try {
19056
- if ($ = (e.recipeKey ?? T1)(S), !$.trim()) throw new Error("Recipe keys cannot be empty.");
19072
+ if ($ = (e.recipeKey ?? F1)(S), !$.trim()) throw new Error("Recipe keys cannot be empty.");
19057
19073
  } catch (G) {
19058
19074
  i.add(S.id), t.push({
19059
19075
  code: "invalid-recipe",
@@ -19065,7 +19081,7 @@ function _1(e) {
19065
19081
  const F = o.get($);
19066
19082
  F ? F.screens.push(S) : o.set($, { recipeKey: $, screens: [S] });
19067
19083
  }
19068
- const s = [...o.values()].map(L1).sort((S, $) => S.id.localeCompare($.id)), c = {};
19084
+ const s = [...o.values()].map(_1).sort((S, $) => S.id.localeCompare($.id)), c = {};
19069
19085
  for (const S of s)
19070
19086
  for (const $ of S.screenIds) c[$] = S.id;
19071
19087
  const l = new Map(s.map((S) => [S.id, S])), d = (S, $) => mt([
@@ -19124,7 +19140,7 @@ function _1(e) {
19124
19140
  let E = 0;
19125
19141
  for (const [S, $] of y)
19126
19142
  for (const F of $) {
19127
- const G = F1(F, E);
19143
+ const G = L1(F, E);
19128
19144
  E += 1;
19129
19145
  const O = b(F.from, G, "source"), ce = b(F.to, G, "target");
19130
19146
  if (!O || !ce || O === ce) continue;
@@ -19219,8 +19235,8 @@ function _1(e) {
19219
19235
  }
19220
19236
  D.push(F);
19221
19237
  }
19222
- const B = mt(D);
19223
- for (const S of B) {
19238
+ const j = mt(D);
19239
+ for (const S of j) {
19224
19240
  if ((((ot = R.get(S)) == null ? void 0 : ot.length) ?? 0) === 0) continue;
19225
19241
  const $ = l.get(S);
19226
19242
  t.push({
@@ -19300,7 +19316,7 @@ function _1(e) {
19300
19316
  );
19301
19317
  const ae = mt(
19302
19318
  A.flatMap((S) => S.screenIds)
19303
- ), K = new Set(A.map((S) => S.id)), q = new Set(B), $e = _ ? m.filter(
19319
+ ), K = new Set(A.map((S) => S.id)), q = new Set(j), $e = _ ? m.filter(
19304
19320
  (S) => {
19305
19321
  var $;
19306
19322
  return !K.has(S.id) && !q.has(S.id) && ((($ = R.get(S.id)) == null ? void 0 : $.length) ?? 0) === 0;
@@ -19333,13 +19349,13 @@ function _1(e) {
19333
19349
  sourceGroups: ge,
19334
19350
  startNodeIds: W,
19335
19351
  endDeclarationsEnabled: _,
19336
- endNodeIds: B,
19352
+ endNodeIds: j,
19337
19353
  branches: _e,
19338
19354
  warnings: t,
19339
19355
  coverage: Ae
19340
19356
  };
19341
19357
  }
19342
- function z1(e) {
19358
+ function D1(e) {
19343
19359
  return e ? JSON.parse(JSON.stringify(e)) : void 0;
19344
19360
  }
19345
19361
  function Bi(e) {
@@ -19353,7 +19369,7 @@ function Bi(e) {
19353
19369
  function Od(e) {
19354
19370
  return JSON.stringify(Bi(e ?? null));
19355
19371
  }
19356
- function D1(e) {
19372
+ function O1(e) {
19357
19373
  return !!(e && typeof e == "object" && !Array.isArray(e));
19358
19374
  }
19359
19375
  function Kt(e) {
@@ -19401,7 +19417,7 @@ function jd(e, t, n) {
19401
19417
  screenIds: n.get(i) ?? [s]
19402
19418
  })).sort((i, s) => i.representativeId.localeCompare(s.representativeId));
19403
19419
  }
19404
- function O1(e) {
19420
+ function j1(e) {
19405
19421
  var n;
19406
19422
  const t = /* @__PURE__ */ new Map();
19407
19423
  for (const r of e ?? []) {
@@ -19415,7 +19431,7 @@ function O1(e) {
19415
19431
  }
19416
19432
  return [...t.values()].sort((r, o) => r.id.localeCompare(o.id));
19417
19433
  }
19418
- function j1(e, t, n, r) {
19434
+ function B1(e, t, n, r) {
19419
19435
  return (e ?? []).flatMap((o, i) => {
19420
19436
  var m, h, b;
19421
19437
  const s = (m = o.from) == null ? void 0 : m.trim(), c = (h = o.to) == null ? void 0 : h.trim();
@@ -19439,7 +19455,7 @@ function j1(e, t, n, r) {
19439
19455
  );
19440
19456
  });
19441
19457
  }
19442
- function B1(e, t, n) {
19458
+ function W1(e, t, n) {
19443
19459
  const r = Kt(e.route);
19444
19460
  if (!r) return [];
19445
19461
  const o = t.filter(
@@ -19463,7 +19479,7 @@ function B1(e, t, n) {
19463
19479
  )
19464
19480
  ].sort((c, l) => c.localeCompare(l));
19465
19481
  }
19466
- function W1(e, t) {
19482
+ function H1(e, t) {
19467
19483
  const n = e.some((i) => i.importKind != null), r = t.candidates ?? [], o = Fh(t);
19468
19484
  return e.filter(
19469
19485
  (i) => n ? i.importKind === "screens" : !!i.route
@@ -19485,7 +19501,7 @@ function W1(e, t) {
19485
19501
  scenario: i.scenario,
19486
19502
  state: i.state,
19487
19503
  scenarioId: i.scenarioId,
19488
- scenarioIds: B1(i, r, o),
19504
+ scenarioIds: W1(i, r, o),
19489
19505
  interactions: i.interactions,
19490
19506
  environment: i.environment,
19491
19507
  preset: i.preset,
@@ -19502,7 +19518,7 @@ function os(e, t) {
19502
19518
  const i = !e.environment && !e.preset ? 0 : 1, s = !t.environment && !t.preset ? 0 : 1;
19503
19519
  return i !== s ? i - s : e.id.localeCompare(t.id);
19504
19520
  }
19505
- function H1(e) {
19521
+ function U1(e) {
19506
19522
  const t = /* @__PURE__ */ new Map();
19507
19523
  for (const n of e) {
19508
19524
  const r = Kt(n.route);
@@ -19517,7 +19533,7 @@ function H1(e) {
19517
19533
  })
19518
19534
  );
19519
19535
  }
19520
- function U1(e) {
19536
+ function V1(e) {
19521
19537
  const t = /* @__PURE__ */ new Map();
19522
19538
  for (const n of e) {
19523
19539
  const r = Kt(n.route);
@@ -19532,7 +19548,7 @@ function U1(e) {
19532
19548
  ])
19533
19549
  );
19534
19550
  }
19535
- function V1(e) {
19551
+ function K1(e) {
19536
19552
  return e.action === "wait" ? null : JSON.stringify(
19537
19553
  Bi({
19538
19554
  action: e.action,
@@ -19549,12 +19565,12 @@ function V1(e) {
19549
19565
  );
19550
19566
  }
19551
19567
  function Th(e) {
19552
- return (e.interactions ?? []).map(V1).filter((t) => t != null);
19568
+ return (e.interactions ?? []).map(K1).filter((t) => t != null);
19553
19569
  }
19554
- function K1(e, t) {
19570
+ function q1(e, t) {
19555
19571
  return e.length < t.length && e.every((n, r) => n === t[r]);
19556
19572
  }
19557
- function q1(e, t) {
19573
+ function Y1(e, t) {
19558
19574
  const n = /* @__PURE__ */ new Map();
19559
19575
  for (const r of e) {
19560
19576
  const o = Kt(r.route);
@@ -19573,7 +19589,7 @@ function q1(e, t) {
19573
19589
  }));
19574
19590
  });
19575
19591
  }
19576
- function Y1(e, t) {
19592
+ function G1(e, t) {
19577
19593
  const n = /* @__PURE__ */ new Map();
19578
19594
  for (const r of e) {
19579
19595
  const o = Kt(r.route);
@@ -19591,7 +19607,7 @@ function Y1(e, t) {
19591
19607
  const d = i.get(l.id);
19592
19608
  if (!d.length) return [];
19593
19609
  const m = o.filter(
19594
- (h) => K1(
19610
+ (h) => q1(
19595
19611
  i.get(h.id),
19596
19612
  d
19597
19613
  )
@@ -19623,7 +19639,7 @@ function Y1(e, t) {
19623
19639
  });
19624
19640
  });
19625
19641
  }
19626
- function G1(e) {
19642
+ function X1(e) {
19627
19643
  var n;
19628
19644
  const t = /* @__PURE__ */ new Map();
19629
19645
  for (const r of e) {
@@ -19655,7 +19671,7 @@ function G1(e) {
19655
19671
  });
19656
19672
  });
19657
19673
  }
19658
- function X1(e, t, n) {
19674
+ function J1(e, t, n) {
19659
19675
  const r = new Set(
19660
19676
  (t.routes ?? []).map((o) => Kt(o.path)).filter((o) => !!o)
19661
19677
  );
@@ -19677,7 +19693,7 @@ function X1(e, t, n) {
19677
19693
  } : o;
19678
19694
  });
19679
19695
  }
19680
- function J1(e, t) {
19696
+ function Q1(e, t) {
19681
19697
  var d, u, m, h, b;
19682
19698
  const n = new Set(e.map((x) => x.id)), r = new Map(
19683
19699
  e.map((x, v) => [x.id, v])
@@ -19742,42 +19758,42 @@ function J1(e, t) {
19742
19758
  }
19743
19759
  function Fh(e) {
19744
19760
  var t, n;
19745
- return z1(
19761
+ return D1(
19746
19762
  (n = (t = e.scenarios) == null ? void 0 : t.find(
19747
19763
  (r) => r.id === "environment:baseline"
19748
19764
  )) == null ? void 0 : n.environment
19749
19765
  );
19750
19766
  }
19751
- function Q1(e) {
19767
+ function Z1(e) {
19752
19768
  var l, d, u, m, h, b;
19753
- const t = W1(
19769
+ const t = H1(
19754
19770
  e.pages,
19755
19771
  e.manifest
19756
- ), n = H1(t), r = U1(t), o = X1(
19772
+ ), n = U1(t), r = V1(t), o = J1(
19757
19773
  t,
19758
19774
  e.manifest,
19759
19775
  n
19760
19776
  ), s = [
19761
- ...j1(
19777
+ ...B1(
19762
19778
  e.manifest.edges,
19763
19779
  n,
19764
19780
  r,
19765
19781
  new Set(o.map((x) => x.id))
19766
19782
  ),
19767
- ...q1(o, n),
19768
19783
  ...Y1(o, n),
19769
- ...G1(o)
19784
+ ...G1(o, n),
19785
+ ...X1(o)
19770
19786
  ], c = [
19771
19787
  ...((l = e.storyboard) == null ? void 0 : l.edges) ?? [],
19772
- ...R1(((d = e.storyboard) == null ? void 0 : d.paths) ?? [])
19788
+ ...T1(((d = e.storyboard) == null ? void 0 : d.paths) ?? [])
19773
19789
  ];
19774
- return _1({
19790
+ return z1({
19775
19791
  screens: o,
19776
19792
  assets: e.assets,
19777
- scenarios: O1(e.manifest.routes),
19793
+ scenarios: j1(e.manifest.routes),
19778
19794
  explicitEdges: c,
19779
19795
  inferredEdges: s,
19780
- startScreenIds: (m = (u = e.storyboard) == null ? void 0 : u.startScreenIds) != null && m.length ? e.storyboard.startScreenIds : J1(o, [...c, ...s]),
19796
+ startScreenIds: (m = (u = e.storyboard) == null ? void 0 : u.startScreenIds) != null && m.length ? e.storyboard.startScreenIds : Q1(o, [...c, ...s]),
19781
19797
  endScreenIds: (h = e.storyboard) == null ? void 0 : h.endScreenIds,
19782
19798
  nonVisualScenarioIds: (b = e.storyboard) == null ? void 0 : b.nonVisualScenarioIds
19783
19799
  });
@@ -19791,12 +19807,12 @@ async function Lh(e) {
19791
19807
  if (!n.ok)
19792
19808
  throw new Error(`Storyboard discovery failed (${n.status})`);
19793
19809
  const r = await n.json();
19794
- if (!D1(r))
19810
+ if (!O1(r))
19795
19811
  throw new Error("Storyboard discovery returned an invalid manifest.");
19796
19812
  return {
19797
19813
  manifest: r,
19798
19814
  baselineEnvironment: Fh(r),
19799
- graph: Q1({
19815
+ graph: Z1({
19800
19816
  manifest: r,
19801
19817
  pages: e.pages,
19802
19818
  assets: e.assets,
@@ -19804,7 +19820,7 @@ async function Lh(e) {
19804
19820
  })
19805
19821
  };
19806
19822
  }
19807
- async function qS(e) {
19823
+ async function YS(e) {
19808
19824
  Rn(null);
19809
19825
  try {
19810
19826
  const t = await Lh(e);
@@ -19813,15 +19829,15 @@ async function qS(e) {
19813
19829
  throw Rn(null), t;
19814
19830
  }
19815
19831
  }
19816
- const Wi = "var(--pygmalion-catalog-surface, #ffffff)", Hi = "var(--pygmalion-catalog-canvas, #f5f5f5)", Ka = "var(--pygmalion-catalog-border, #e5e7eb)", Ui = "var(--pygmalion-catalog-text, #202124)", Vt = "var(--pygmalion-catalog-muted, #6b7280)", Z1 = "var(--pygmalion-catalog-header, #11182f)", eS = "var(--pygmalion-catalog-accent, #7c6cf2)";
19817
- function YS({
19832
+ const Wi = "var(--pygmalion-catalog-surface, #ffffff)", Hi = "var(--pygmalion-catalog-canvas, #f5f5f5)", Ka = "var(--pygmalion-catalog-border, #e5e7eb)", Ui = "var(--pygmalion-catalog-text, #202124)", Vt = "var(--pygmalion-catalog-muted, #6b7280)", eS = "var(--pygmalion-catalog-header, #11182f)", tS = "var(--pygmalion-catalog-accent, #7c6cf2)";
19833
+ function GS({
19818
19834
  title: e,
19819
19835
  eyebrow: t,
19820
19836
  description: n,
19821
19837
  version: r,
19822
19838
  meta: o,
19823
19839
  children: i,
19824
- headerBackground: s = Z1,
19840
+ headerBackground: s = eS,
19825
19841
  headerColor: c = "#ffffff",
19826
19842
  bodyBackground: l = Wi,
19827
19843
  bodyGap: d = 40
@@ -19938,7 +19954,7 @@ function YS({
19938
19954
  }
19939
19955
  );
19940
19956
  }
19941
- function GS({
19957
+ function XS({
19942
19958
  title: e,
19943
19959
  itemId: t,
19944
19960
  count: n,
@@ -19983,7 +19999,7 @@ function GS({
19983
19999
  }
19984
20000
  );
19985
20001
  }
19986
- function XS({
20002
+ function JS({
19987
20003
  rows: e,
19988
20004
  columns: t,
19989
20005
  cornerLabel: n,
@@ -20002,7 +20018,7 @@ function XS({
20002
20018
  display: "inline-block",
20003
20019
  width: "max-content",
20004
20020
  padding: s ? 16 : 0,
20005
- border: s ? `1px dashed ${eS}` : void 0,
20021
+ border: s ? `1px dashed ${tS}` : void 0,
20006
20022
  borderRadius: s ? 4 : void 0
20007
20023
  },
20008
20024
  children: /* @__PURE__ */ g(
@@ -20080,11 +20096,11 @@ function XS({
20080
20096
  }
20081
20097
  );
20082
20098
  }
20083
- function tS(e) {
20099
+ function nS(e) {
20084
20100
  return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
20085
20101
  }
20086
20102
  function _h(e, t, n = "PygmalionCatalog") {
20087
- const r = (o) => tS(o).replace(/-/g, "_");
20103
+ const r = (o) => nS(o).replace(/-/g, "_");
20088
20104
  return `${n}_${r(e)}_${r(t)}`;
20089
20105
  }
20090
20106
  function zh(e, t) {
@@ -20106,10 +20122,10 @@ function Dh(e) {
20106
20122
  t.add(n.id);
20107
20123
  }
20108
20124
  }
20109
- function nS(e, t, n) {
20125
+ function rS(e, t, n) {
20110
20126
  return typeof e == "function" ? e(t, n) : e;
20111
20127
  }
20112
- function rS({
20128
+ function oS({
20113
20129
  page: e,
20114
20130
  items: t,
20115
20131
  renderPreview: n,
@@ -20213,7 +20229,7 @@ function rS({
20213
20229
  }
20214
20230
  );
20215
20231
  }
20216
- function JS(e) {
20232
+ function QS(e) {
20217
20233
  Dh(e.items);
20218
20234
  const t = /* @__PURE__ */ new Map();
20219
20235
  for (const o of e.items) {
@@ -20237,7 +20253,7 @@ function JS(e) {
20237
20253
  const n = {}, r = [];
20238
20254
  for (const o of t.values()) {
20239
20255
  const i = () => /* @__PURE__ */ a(
20240
- rS,
20256
+ oS,
20241
20257
  {
20242
20258
  page: o.page,
20243
20259
  items: o.items,
@@ -20250,7 +20266,7 @@ function JS(e) {
20250
20266
  component: i,
20251
20267
  children: "none"
20252
20268
  };
20253
- const s = nS(e.frame, o.page, o.items);
20269
+ const s = rS(e.frame, o.page, o.items);
20254
20270
  r.push({
20255
20271
  ...o.page,
20256
20272
  componentName: o.registryName,
@@ -20268,7 +20284,7 @@ function JS(e) {
20268
20284
  }
20269
20285
  };
20270
20286
  }
20271
- function oS(e, t = 60) {
20287
+ function iS(e, t = 60) {
20272
20288
  const n = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, c]) => c.length > 0).sort(([c, l], [d, u]) => u.length - l.length || c.localeCompare(d)), r = n[0], o = n[1], i = Math.max(1, (r == null ? void 0 : r[1].length) ?? 1), s = o == null ? void 0 : o[1].slice(0, Math.max(1, Math.floor(t / i)));
20273
20289
  return {
20274
20290
  row: r,
@@ -20277,7 +20293,7 @@ function oS(e, t = 60) {
20277
20293
  additional: n.slice(2)
20278
20294
  };
20279
20295
  }
20280
- function iS(e, t, n, r) {
20296
+ function sS(e, t, n, r) {
20281
20297
  return {
20282
20298
  ...e.defaultProps,
20283
20299
  ...Object.fromEntries(t.fixed),
@@ -20285,7 +20301,7 @@ function iS(e, t, n, r) {
20285
20301
  ...t.column && r !== void 0 ? { [t.column[0]]: r } : {}
20286
20302
  };
20287
20303
  }
20288
- function sS({
20304
+ function aS({
20289
20305
  item: e,
20290
20306
  entry: t,
20291
20307
  maxVariantCells: n
@@ -20311,7 +20327,7 @@ function sS({
20311
20327
  ]
20312
20328
  }
20313
20329
  );
20314
- const r = oS(t, n), o = ((c = r.row) == null ? void 0 : c[1]) ?? [void 0], i = ((l = r.column) == null ? void 0 : l[1]) ?? [void 0], s = t.component;
20330
+ const r = iS(t, n), o = ((c = r.row) == null ? void 0 : c[1]) ?? [void 0], i = ((l = r.column) == null ? void 0 : l[1]) ?? [void 0], s = t.component;
20315
20331
  return /* @__PURE__ */ g(
20316
20332
  "section",
20317
20333
  {
@@ -20342,7 +20358,7 @@ function sS({
20342
20358
  children: o.flatMap(
20343
20359
  (d) => i.map((u) => {
20344
20360
  var b, x;
20345
- const m = iS(t, r, d, u), h = [
20361
+ const m = sS(t, r, d, u), h = [
20346
20362
  r.row && d !== void 0 ? `${((b = t.propLabels) == null ? void 0 : b[r.row[0]]) ?? r.row[0]}=${String(d)}` : "",
20347
20363
  r.column && u !== void 0 ? `${((x = t.propLabels) == null ? void 0 : x[r.column[0]]) ?? r.column[0]}=${String(u)}` : ""
20348
20364
  ].filter(Boolean).join(" · ");
@@ -20401,7 +20417,7 @@ function sS({
20401
20417
  }
20402
20418
  );
20403
20419
  }
20404
- function QS(e) {
20420
+ function ZS(e) {
20405
20421
  Dh(e.items);
20406
20422
  const t = {}, n = [], r = [], o = e.maxVariantCells ?? 60;
20407
20423
  for (const i of e.items) {
@@ -20410,7 +20426,7 @@ function QS(e) {
20410
20426
  i.id,
20411
20427
  e.registryPrefix
20412
20428
  ), c = e.registry[i.name], l = () => /* @__PURE__ */ a(
20413
- sS,
20429
+ aS,
20414
20430
  {
20415
20431
  item: i,
20416
20432
  entry: c,
@@ -20438,7 +20454,7 @@ function QS(e) {
20438
20454
  }
20439
20455
  };
20440
20456
  }
20441
- const Ds = (e) => e.map((t) => `"${t.name}"`).join(", "), Bd = (e) => `${e.width ?? "?"}x${e.height ?? "?"}`, aS = (e) => e.state ?? "default", cS = (e) => e === void 0 ? "(no canvas)" : `"${e}"`, Xo = (e, t) => {
20457
+ const Ds = (e) => e.map((t) => `"${t.name}"`).join(", "), Bd = (e) => `${e.width ?? "?"}x${e.height ?? "?"}`, cS = (e) => e.state ?? "default", lS = (e) => e === void 0 ? "(no canvas)" : `"${e}"`, Xo = (e, t) => {
20442
20458
  const n = /* @__PURE__ */ new Map();
20443
20459
  for (const r of e) {
20444
20460
  const o = n.get(t(r));
@@ -20446,7 +20462,7 @@ const Ds = (e) => e.map((t) => `"${t.name}"`).join(", "), Bd = (e) => `${e.width
20446
20462
  }
20447
20463
  return n;
20448
20464
  };
20449
- function ZS(e) {
20465
+ function eN(e) {
20450
20466
  const t = Xo(
20451
20467
  e.filter((r) => !!r.scenario && r.route != null),
20452
20468
  (r) => r.scenario
@@ -20463,7 +20479,7 @@ function ZS(e) {
20463
20479
  }
20464
20480
  const i = Xo(o, (s) => s.canvas);
20465
20481
  if (i.size > 1) {
20466
- const s = [...i.entries()].map(([c, l]) => `${cS(c)}: ${Ds(l)}`).join("; ");
20482
+ const s = [...i.entries()].map(([c, l]) => `${lS(c)}: ${Ds(l)}`).join("; ");
20467
20483
  n.push({
20468
20484
  severity: "warning",
20469
20485
  code: "cross-canvas",
@@ -20481,7 +20497,7 @@ function ZS(e) {
20481
20497
  message: `Scenario "${r}" mixes viewports: ${d}; sibling states should share one viewport so flipping between them compares like with like.`
20482
20498
  });
20483
20499
  }
20484
- const l = Xo(s, aS);
20500
+ const l = Xo(s, cS);
20485
20501
  for (const [d, u] of l)
20486
20502
  u.length < 2 || n.push({
20487
20503
  severity: "warning",
@@ -20493,23 +20509,23 @@ function ZS(e) {
20493
20509
  }
20494
20510
  return n.sort((r, o) => r.severity !== o.severity ? r.severity === "warning" ? -1 : 1 : r.scenario < o.scenario ? -1 : r.scenario > o.scenario ? 1 : 0);
20495
20511
  }
20496
- const Oh = 42e4, lS = 2e3, dS = 500, uS = 5e3, fS = 3e4;
20497
- function hS(e) {
20498
- const t = uS * 2 ** Math.max(0, e);
20499
- return Math.min(t, fS);
20500
- }
20512
+ const Oh = 42e4, dS = 2e3, uS = 500, fS = 5e3, hS = 3e4;
20501
20513
  function mS(e) {
20514
+ const t = fS * 2 ** Math.max(0, e);
20515
+ return Math.min(t, hS);
20516
+ }
20517
+ function pS(e) {
20502
20518
  return new Promise((t) => setTimeout(t, e));
20503
20519
  }
20504
- async function pS(e) {
20520
+ async function gS(e) {
20505
20521
  const {
20506
20522
  initial: t,
20507
20523
  fetchStatus: n,
20508
20524
  requestResync: r,
20509
20525
  timeoutMs: o = Oh,
20510
- intervalMs: i = dS,
20526
+ intervalMs: i = uS,
20511
20527
  now: s = Date.now,
20512
- sleep: c = mS
20528
+ sleep: c = pS
20513
20529
  } = e;
20514
20530
  let l = t, d = !1;
20515
20531
  const u = s();
@@ -20526,9 +20542,9 @@ async function pS(e) {
20526
20542
  }
20527
20543
  return l;
20528
20544
  }
20529
- const Wd = /^[a-f0-9]{64}$/, gS = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, bS = /^p\d+$/;
20545
+ const Wd = /^[a-f0-9]{64}$/, bS = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, xS = /^p\d+$/;
20530
20546
  function qa(e) {
20531
- return typeof e == "string" && gS.test(e) ? e : void 0;
20547
+ return typeof e == "string" && bS.test(e) ? e : void 0;
20532
20548
  }
20533
20549
  function Hd(e, t) {
20534
20550
  const n = new URL(e, t);
@@ -20548,7 +20564,7 @@ function Ud(e) {
20548
20564
  const t = e;
20549
20565
  return !Number.isSafeInteger(t.width) || !Number.isSafeInteger(t.height) || Number(t.width) < 1 || Number(t.height) < 1 || Number(t.width) > 65536 || Number(t.height) > 65536 ? null : { width: Number(t.width), height: Number(t.height) };
20550
20566
  }
20551
- function xS(e) {
20567
+ function vS(e) {
20552
20568
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
20553
20569
  const t = e, n = Ud(t.before), r = Ud(t.after);
20554
20570
  if (!n || !r || !Number.isSafeInteger(t.changedPixels) || !Number.isSafeInteger(t.totalPixels) || Number(t.changedPixels) < 0 || Number(t.totalPixels) < 1 || Number(t.changedPixels) > Number(t.totalPixels) || typeof t.threshold != "number" || !Number.isFinite(t.threshold) || t.threshold < 0 || t.threshold > 1)
@@ -20565,7 +20581,7 @@ function xS(e) {
20565
20581
  heatmapUrl: o
20566
20582
  };
20567
20583
  }
20568
- function vS(e, t) {
20584
+ function yS(e, t) {
20569
20585
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
20570
20586
  const n = e;
20571
20587
  if (typeof n.id != "string" || !n.id) return null;
@@ -20573,7 +20589,7 @@ function vS(e, t) {
20573
20589
  if (!o) return null;
20574
20590
  const i = Os(n.after);
20575
20591
  if (t === "changed" && !i) return null;
20576
- const s = i ? xS(n.pixelDiff) : null;
20592
+ const s = i ? vS(n.pixelDiff) : null;
20577
20593
  return {
20578
20594
  id: n.id,
20579
20595
  before: o,
@@ -20585,7 +20601,7 @@ function vS(e, t) {
20585
20601
  ...s ? { pixelDiff: s } : {}
20586
20602
  };
20587
20603
  }
20588
- function yS(e, t = []) {
20604
+ function wS(e, t = []) {
20589
20605
  const n = new Set(t), r = n.size > 0, o = /* @__PURE__ */ new Set(), i = [
20590
20606
  ...e.styles.map((s) => s.affectedFrames ?? []),
20591
20607
  ...e.texts.map((s) => s.affectedFrames ?? []),
@@ -20593,7 +20609,7 @@ function yS(e, t = []) {
20593
20609
  ];
20594
20610
  for (const s of i)
20595
20611
  for (const c of s) {
20596
- if (r && bS.test(c.id) && !n.has(c.id))
20612
+ if (r && xS.test(c.id) && !n.has(c.id))
20597
20613
  throw new Error(
20598
20614
  `"Impact Screen"${c.name}"This internal editor ID (${c.id}) is used. A canonical screen ID is required.`
20599
20615
  );
@@ -20613,7 +20629,7 @@ async function Vd(e, t, n) {
20613
20629
  );
20614
20630
  if (typeof o.baselineId != "string" || !o.baselineId)
20615
20631
  throw new Error("Pygmalion visual QA response has no baselineId");
20616
- const i = Array.isArray(o.frames) ? o.frames.map((u) => vS(u, n.phase)).filter((u) => u != null) : [], s = Array.isArray(o.failures) ? o.failures.map((u) => {
20632
+ const i = Array.isArray(o.frames) ? o.frames.map((u) => yS(u, n.phase)).filter((u) => u != null) : [], s = Array.isArray(o.failures) ? o.failures.map((u) => {
20617
20633
  if (!u || typeof u != "object" || Array.isArray(u)) return null;
20618
20634
  const m = u;
20619
20635
  return typeof m.id == "string" && typeof m.error == "string" ? { id: m.id, error: m.error } : null;
@@ -20630,12 +20646,12 @@ const js = {
20630
20646
  mirror: "/__pygmalion-dev-control",
20631
20647
  sessions: "/__pygmalion-design-session",
20632
20648
  inspect: "/__pygmalion-inspect"
20633
- }, wS = "pygmalion.designSessionId", SS = "/__pygmalion-qa", Jo = /* @__PURE__ */ new Map();
20649
+ }, SS = "pygmalion.designSessionId", NS = "/__pygmalion-qa", Jo = /* @__PURE__ */ new Map();
20634
20650
  function Kd() {
20635
20651
  var e;
20636
20652
  return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
20637
20653
  }
20638
- function NS(e, t) {
20654
+ function IS(e, t) {
20639
20655
  if (e) return e;
20640
20656
  const n = Jo.get(t);
20641
20657
  if (n) return n;
@@ -20655,23 +20671,23 @@ async function rn(e) {
20655
20671
  if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
20656
20672
  return t;
20657
20673
  }
20658
- const IS = 3e4;
20659
- function Bs(e = IS) {
20674
+ const CS = 3e4;
20675
+ function Bs(e = CS) {
20660
20676
  return typeof AbortSignal > "u" || typeof AbortSignal.timeout != "function" ? {} : { signal: AbortSignal.timeout(e) };
20661
20677
  }
20662
- function eN(e = {}) {
20678
+ function tN(e = {}) {
20663
20679
  var te, Pe, U, se, ae;
20664
20680
  const {
20665
20681
  sessionId: t,
20666
- sessionStorageKey: n = wS,
20682
+ sessionStorageKey: n = SS,
20667
20683
  autoStart: r = !0,
20668
20684
  fetcher: o = fetch,
20669
20685
  formatApplyMessage: i
20670
- } = e, s = ((te = e.endpoints) == null ? void 0 : te.mirror) ?? js.mirror, c = ((Pe = e.endpoints) == null ? void 0 : Pe.sessions) ?? js.sessions, l = ((U = e.endpoints) == null ? void 0 : U.inspect) ?? js.inspect, d = e.visualQa != null, u = ((se = e.visualQa) == null ? void 0 : se.endpoint) ?? SS, m = JSON.stringify(((ae = e.visualQa) == null ? void 0 : ae.eligibleFrameIds) ?? []), h = wt(
20686
+ } = e, s = ((te = e.endpoints) == null ? void 0 : te.mirror) ?? js.mirror, c = ((Pe = e.endpoints) == null ? void 0 : Pe.sessions) ?? js.sessions, l = ((U = e.endpoints) == null ? void 0 : U.inspect) ?? js.inspect, d = e.visualQa != null, u = ((se = e.visualQa) == null ? void 0 : se.endpoint) ?? NS, m = JSON.stringify(((ae = e.visualQa) == null ? void 0 : ae.eligibleFrameIds) ?? []), h = wt(
20671
20687
  () => JSON.parse(m),
20672
20688
  [m]
20673
20689
  ), b = wt(
20674
- () => NS(t, n),
20690
+ () => IS(t, n),
20675
20691
  [t, n]
20676
20692
  ), [x, v] = Q({
20677
20693
  state: "idle",
@@ -20703,7 +20719,7 @@ function eN(e = {}) {
20703
20719
  ...K || Ie ? {} : Bs()
20704
20720
  });
20705
20721
  let fe = await rn(Ae);
20706
- if (K || (fe = await pS({
20722
+ if (K || (fe = await gS({
20707
20723
  initial: fe,
20708
20724
  fetchStatus: async () => rn(
20709
20725
  await o(`${s}/status`, Bs())
@@ -20781,7 +20797,7 @@ function eN(e = {}) {
20781
20797
  await W(!0, K), await _();
20782
20798
  },
20783
20799
  [_, W, y == null ? void 0 : y.branchName]
20784
- ), B = kt(
20800
+ ), j = kt(
20785
20801
  async (K) => {
20786
20802
  var fe;
20787
20803
  if (!y) throw new Error("Pygmalion design session is not ready");
@@ -20852,7 +20868,7 @@ function eN(e = {}) {
20852
20868
  );
20853
20869
  if (!q.ok || !Number.isSafeInteger(q.revision))
20854
20870
  throw new Error(q.error ?? "Pygmalion could not preview the visual changes");
20855
- const $e = d ? yS(K, h) : [];
20871
+ const $e = d ? wS(K, h) : [];
20856
20872
  let Ie;
20857
20873
  const Ae = y.appOrigin ?? x.appOrigin;
20858
20874
  if ($e.length > 0) {
@@ -20940,7 +20956,7 @@ function eN(e = {}) {
20940
20956
  if (x.state !== "error") return;
20941
20957
  const K = window.setTimeout(() => {
20942
20958
  W(!1);
20943
- }, hS(X.current++));
20959
+ }, mS(X.current++));
20944
20960
  return () => window.clearTimeout(K);
20945
20961
  }, [r, k, x.state, W]), ie(() => {
20946
20962
  if (!r || x.state !== "idle") return;
@@ -20956,7 +20972,7 @@ function eN(e = {}) {
20956
20972
  } catch {
20957
20973
  }
20958
20974
  })();
20959
- }, lS);
20975
+ }, dS);
20960
20976
  return () => {
20961
20977
  K = !0, window.clearInterval(q);
20962
20978
  };
@@ -20977,11 +20993,11 @@ function eN(e = {}) {
20977
20993
  loadSourceRefs: _,
20978
20994
  previewVisual: C,
20979
20995
  inspectImpact: I,
20980
- applyVisual: B,
20996
+ applyVisual: j,
20981
20997
  revertLastVisual: A
20982
20998
  };
20983
20999
  }
20984
- function tN({
21000
+ function nN({
20985
21001
  value: e,
20986
21002
  currentCommit: t = null,
20987
21003
  refs: n,
@@ -21075,15 +21091,15 @@ function tN({
21075
21091
  }
21076
21092
  );
21077
21093
  }
21078
- const qd = 10, CS = 0.5;
21094
+ const qd = 10, PS = 0.5;
21079
21095
  function Yd(e) {
21080
21096
  const t = (e.selector ?? "").trim(), n = (e.text ?? "").trim(), r = e.attribute ? `${e.attribute.name ?? ""}=${e.attribute.value ?? ""}` : "";
21081
21097
  return `${t}|${n}|${r}`;
21082
21098
  }
21083
- function nN(e, t) {
21099
+ function rN(e, t) {
21084
21100
  const n = [];
21085
21101
  if (e.length === 0) return n;
21086
- const r = (t == null ? void 0 : t.genericShare) ?? CS, o = /* @__PURE__ */ new Map();
21102
+ const r = (t == null ? void 0 : t.genericShare) ?? PS, o = /* @__PURE__ */ new Map();
21087
21103
  for (const s of e)
21088
21104
  for (const c of new Set(
21089
21105
  (s.assertions ?? []).map((l) => Yd(l))
@@ -21124,15 +21140,15 @@ function nN(e, t) {
21124
21140
  }
21125
21141
  return n;
21126
21142
  }
21127
- function PS(e) {
21143
+ function $S(e) {
21128
21144
  const t = [], n = /\[data-testid=["']([^"']+)["']\]/g;
21129
21145
  let r = n.exec(e);
21130
21146
  for (; r; )
21131
21147
  t.push(r[1]), r = n.exec(e);
21132
21148
  return t;
21133
21149
  }
21134
- function rN(e) {
21135
- const t = new Set(e.hooks), n = new Set(e.answered ?? []), r = new Set(e.targets.flatMap((i) => PS(i))), o = [];
21150
+ function oN(e) {
21151
+ const t = new Set(e.hooks), n = new Set(e.answered ?? []), r = new Set(e.targets.flatMap((i) => $S(i))), o = [];
21136
21152
  for (const i of e.hooks)
21137
21153
  r.has(i) || n.has(i) || o.push({
21138
21154
  severity: "error",
@@ -21151,7 +21167,7 @@ function rN(e) {
21151
21167
  });
21152
21168
  return o;
21153
21169
  }
21154
- function oN(e) {
21170
+ function iN(e) {
21155
21171
  const t = /* @__PURE__ */ new Map();
21156
21172
  for (const r of e) {
21157
21173
  if (!r.route || !r.scenario || !r.state || r.stateKind) continue;
@@ -21172,7 +21188,7 @@ function oN(e) {
21172
21188
  }
21173
21189
  return n;
21174
21190
  }
21175
- function iN(e) {
21191
+ function sN(e) {
21176
21192
  const t = /* @__PURE__ */ new Map();
21177
21193
  for (const n of e) {
21178
21194
  if (!n.route) continue;
@@ -21186,7 +21202,7 @@ function iN(e) {
21186
21202
  return [...t.values()].sort((n, r) => r.screens - n.screens);
21187
21203
  }
21188
21204
  let jh = !1, Bh = "";
21189
- const sN = {
21205
+ const aN = {
21190
21206
  editor: f,
21191
21207
  getObserverTree: gp,
21192
21208
  isObservableProp: pp,
@@ -21196,8 +21212,8 @@ const sN = {
21196
21212
  Promise.resolve().then(() => ga),
21197
21213
  Promise.resolve().then(() => Ib),
21198
21214
  Promise.resolve().then(() => Zp),
21199
- import("./FrozenRoutePreview-CPnB5j1D.js").then((u) => u.bs),
21200
- import("./FrozenRoutePreview-CPnB5j1D.js").then((u) => u.br)
21215
+ import("./FrozenRoutePreview-CGxN_gIm.js").then((u) => u.bs),
21216
+ import("./FrozenRoutePreview-CGxN_gIm.js").then((u) => u.br)
21201
21217
  ]), s = i.getMountedShadowPreviewHandle(e), c = f.pages.find(
21202
21218
  (u) => u.id === e
21203
21219
  );
@@ -21297,17 +21313,17 @@ const sN = {
21297
21313
  };
21298
21314
  }
21299
21315
  };
21300
- function aN(e) {
21316
+ function cN(e) {
21301
21317
  f.navigateToPageByName(e);
21302
21318
  }
21303
- function cN() {
21319
+ function lN() {
21304
21320
  f.openPreview();
21305
21321
  }
21306
- function lN() {
21322
+ function dN() {
21307
21323
  const e = ee.entries.length > 0;
21308
21324
  return e && ee.discardPending(), f.resetCurrentEdits() || e;
21309
21325
  }
21310
- function dN({
21326
+ function uN({
21311
21327
  registry: e,
21312
21328
  tokens: t,
21313
21329
  initialPages: n,
@@ -21335,7 +21351,7 @@ function dN({
21335
21351
  scenarioCoverage: W,
21336
21352
  screenDimensions: _,
21337
21353
  screenLists: D,
21338
- sectionHeaders: B,
21354
+ sectionHeaders: j,
21339
21355
  sectionHeaderLabels: C,
21340
21356
  screenLanes: I,
21341
21357
  frameBranchKinds: A,
@@ -21368,7 +21384,7 @@ function dN({
21368
21384
  const [$, F] = Q();
21369
21385
  d && (d.assertComplete(), xp(d));
21370
21386
  const G = e ?? (d == null ? void 0 : d.getRegistry()), O = t ?? (d == null ? void 0 : d.getTokens()), ce = n ?? (d == null ? void 0 : d.getInitialPages());
21371
- G && vp(G), by(i ?? []), O && Ry(O), R0(s ?? []), yp(c ?? []), Ty(u ?? null), Ku(b), Wu(
21387
+ G && vp(G), by(i ?? []), O && Ry(O), T0(s ?? []), yp(c ?? []), Ty(u ?? null), Ku(b), Wu(
21372
21388
  !!(v != null && v.trim())
21373
21389
  );
21374
21390
  const le = $ ?? x, J = wt(
@@ -21424,7 +21440,7 @@ function dN({
21424
21440
  interactions: re.interactions,
21425
21441
  assertions: re.assertions
21426
21442
  })
21427
- ), y != null && Xu(y), Tp(k ?? null), L != null && wp(L), P != null && Sp(P), hw(R), f.initEditMode(o !== "view-only"), yf(N ?? []), bf(T ?? 1), D0(W ?? []), Np(_ ?? []), Ip(D ?? []), Cp(B ?? [], C), Pp(I ?? []), $p(A ?? [], X), Mp(ge ?? []), vx(_e ?? 0), Ep(te ?? Pe ?? []), vv(U ?? []), Fp(se ?? null), Lp(K ?? null), kp(q ?? null), _p($e ?? null), ce && f.initPagesFromComponents(ce, { initialCanvas: r }), Cr(() => {
21443
+ ), y != null && Xu(y), Tp(k ?? null), L != null && wp(L), P != null && Sp(P), hw(R), f.initEditMode(o !== "view-only"), yf(N ?? []), bf(T ?? 1), O0(W ?? []), Np(_ ?? []), Ip(D ?? []), Cp(j ?? [], C), Pp(I ?? []), $p(A ?? [], X), Mp(ge ?? []), vx(_e ?? 0), Ep(te ?? Pe ?? []), vv(U ?? []), Fp(se ?? null), Lp(K ?? null), kp(q ?? null), _p($e ?? null), ce && f.initPagesFromComponents(ce, { initialCanvas: r }), Cr(() => {
21428
21444
  m != null && Ap(m), h != null && Rp(h), vb(l ?? []);
21429
21445
  }, [m, l, h]), Cr(() => {
21430
21446
  !le || !ce || !S || ma(le, {
@@ -21711,72 +21727,72 @@ function dN({
21711
21727
  const re = m ?? In();
21712
21728
  if (!re) return;
21713
21729
  const Ye = `${re}|${h ?? er()}`;
21714
- return xe.current != null && xe.current !== Ye && kx(), xe.current = Ye, A1({
21730
+ return xe.current != null && xe.current !== Ye && kx(), xe.current = Ye, R1({
21715
21731
  editor: f,
21716
21732
  getPages: () => f.pages,
21717
21733
  appOrigin: re,
21718
21734
  baselineEnvironment: Lt()
21719
21735
  });
21720
- }, [m, S, h]), /* @__PURE__ */ a(C1, { previewIdentityReady: S });
21736
+ }, [m, S, h]), /* @__PURE__ */ a(P1, { previewIdentityReady: S });
21721
21737
  }
21722
21738
  export {
21723
21739
  Lw as DEFAULT_DESIGN_COMPILE_LIMITS,
21724
- hN as DESIGN_IMPORT_KINDS,
21740
+ mN as DESIGN_IMPORT_KINDS,
21725
21741
  Tw as DESIGN_IR_SCHEMA,
21726
21742
  Fw as DESIGN_IR_VERSION,
21727
- CS as GENERIC_ASSERTION_SHARE,
21743
+ PS as GENERIC_ASSERTION_SHARE,
21728
21744
  Tl as MIN_SURFACE_REASON_LENGTH,
21729
21745
  qd as MIN_UNVERIFIED_REASON_LENGTH,
21730
21746
  Nw as PYGMALION_PREVIEW_CAPTURE_PROGRESS_SUFFIX,
21731
21747
  Vx as PYGMALION_PREVIEW_CAPTURE_SCHEMA_VERSION,
21732
- YS as PygmalionCatalogDocument,
21733
- XS as PygmalionCatalogMatrix,
21734
- GS as PygmalionCatalogSection,
21735
- dN as PygmalionEditor,
21748
+ GS as PygmalionCatalogDocument,
21749
+ JS as PygmalionCatalogMatrix,
21750
+ XS as PygmalionCatalogSection,
21751
+ uN as PygmalionEditor,
21736
21752
  bp as STORYBOARD_ENVIRONMENT_CONTROL,
21737
- mN as STORYBOARD_ENVIRONMENT_QUERY,
21738
- tN as SourceRefControl,
21739
- sN as __debug,
21740
- z0 as applyScenarioCoverageClaim,
21741
- WS as applyTokenOverride,
21753
+ pN as STORYBOARD_ENVIRONMENT_QUERY,
21754
+ nN as SourceRefControl,
21755
+ aN as __debug,
21756
+ D0 as applyScenarioCoverageClaim,
21757
+ HS as applyTokenOverride,
21742
21758
  Mb as beginFrameInteraction,
21743
21759
  av as bootstrapPreviewArtifact,
21744
- FS as clearPreviewEnvironmentControlValues,
21760
+ LS as clearPreviewEnvironmentControlValues,
21745
21761
  lb as clearPygmalionPreviewCache,
21746
21762
  Hw as compileDesignDocument,
21747
- QS as createDesignComponentCatalog,
21748
- oS as createDesignComponentVariantMatrix,
21749
- JS as createDesignGalleryCatalog,
21750
- pN as createDesignImportController,
21751
- VS as createDesignIntermediateDocument,
21752
- gN as createDesignScreenCollection,
21763
+ ZS as createDesignComponentCatalog,
21764
+ iS as createDesignComponentVariantMatrix,
21765
+ QS as createDesignGalleryCatalog,
21766
+ gN as createDesignImportController,
21767
+ KS as createDesignIntermediateDocument,
21768
+ bN as createDesignScreenCollection,
21753
21769
  Zx as createPreviewArtifactHttpTransport,
21754
- _S as createPreviewCacheNamespace,
21770
+ zS as createPreviewCacheNamespace,
21755
21771
  qx as createPreviewFrameFingerprint,
21756
21772
  Rf as createPreviewRecipeFingerprint,
21757
21773
  Qx as createStoryboardCaptureRecipeIdentity,
21758
- _1 as createStoryboardGraph,
21759
- Q1 as createStoryboardGraphFromDiscovery,
21760
- s0 as createStoryboardGraphViewModel,
21761
- R1 as createStoryboardPathEdges,
21774
+ z1 as createStoryboardGraph,
21775
+ Z1 as createStoryboardGraphFromDiscovery,
21776
+ a0 as createStoryboardGraphViewModel,
21777
+ T1 as createStoryboardPathEdges,
21762
21778
  Rh as createStoryboardRouteScenarioId,
21763
21779
  Ir as createStoryboardRouteUrl,
21764
- tS as designCatalogKey,
21780
+ nS as designCatalogKey,
21765
21781
  _h as designCatalogRegistryName,
21766
- oN as detectStateGroupCandidates,
21782
+ iN as detectStateGroupCandidates,
21767
21783
  gv as enumerateControlCandidates,
21768
- BS as enumerateDesignComponentConnectionCases,
21784
+ WS as enumerateDesignComponentConnectionCases,
21769
21785
  xv as enumerateRequestCandidates,
21770
- DS as enumerateRouteCandidates,
21786
+ OS as enumerateRouteCandidates,
21771
21787
  Qi as exitFrameInteraction,
21772
- bN as expandDesignScreenCasesViewports,
21773
- xN as expandDesignScreenCollectionViewports,
21788
+ xN as expandDesignScreenCasesViewports,
21789
+ vN as expandDesignScreenCollectionViewports,
21774
21790
  Of as frameSurfaceDemands,
21775
- vN as framesMissingScenario,
21791
+ yN as framesMissingScenario,
21776
21792
  Ww as getDesignCodegenAdapters,
21777
- jS as getDesignComponentConnection,
21793
+ BS as getDesignComponentConnection,
21778
21794
  Ra as getDesignComponentConnectionForComponent,
21779
- OS as getDesignComponentConnections,
21795
+ jS as getDesignComponentConnections,
21780
21796
  Pi as getFrameInteractionSnapshot,
21781
21797
  Sv as getObservedRequests,
21782
21798
  wb as getPreviewEnvironmentControlValue,
@@ -21790,31 +21806,31 @@ export {
21790
21806
  Wa as getStoryboardGraph,
21791
21807
  yv as getSurfaceClassifications,
21792
21808
  kh as getViewportPresets,
21793
- PS as hooksInSelector,
21809
+ $S as hooksInSelector,
21794
21810
  Lh as loadStoryboardDiscovery,
21795
- yN as mergeScreenPresets,
21811
+ wN as mergeScreenPresets,
21796
21812
  Dt as mergeStoryboardEnvironment,
21797
21813
  Mw as previewCaptureProgressEndpoint,
21798
- qS as publishStoryboardDiscovery,
21799
- aN as pygmalionNavigate,
21800
- cN as pygmalionOpenPreview,
21801
- lN as pygmalionResetCurrentEdits,
21802
- TS as reconstructRoutePreviewArtifactScreenshotV3,
21803
- RS as reconstructRoutePreviewArtifactSnapshotV3,
21814
+ YS as publishStoryboardDiscovery,
21815
+ cN as pygmalionNavigate,
21816
+ lN as pygmalionOpenPreview,
21817
+ dN as pygmalionResetCurrentEdits,
21818
+ FS as reconstructRoutePreviewArtifactScreenshotV3,
21819
+ TS as reconstructRoutePreviewArtifactSnapshotV3,
21804
21820
  Bw as registerDesignCodegenAdapter,
21805
21821
  bv as requestEndpointShape,
21806
- HS as resetTokenOverrides,
21822
+ US as resetTokenOverrides,
21807
21823
  sv as resolvePreviewArtifactFrames,
21808
- W1 as resolveStoryboardScreenCases,
21824
+ H1 as resolveStoryboardScreenCases,
21809
21825
  tp as selectSessionPreset,
21810
21826
  vp as setComponentRegistry,
21811
21827
  by as setDesignComponentConnections,
21812
- LS as setFrameInteractionScroll,
21828
+ _S as setFrameInteractionScroll,
21813
21829
  wv as setObservedRequests,
21814
21830
  Sb as setPreviewEnvironmentControlValue,
21815
21831
  vb as setPreviewEnvironmentControls,
21816
21832
  Ap as setPygmalionAppOrigin,
21817
- wN as setPygmalionArtifactOrigin,
21833
+ SN as setPygmalionArtifactOrigin,
21818
21834
  Xu as setPygmalionPreviewConcurrency,
21819
21835
  Rp as setPygmalionPreviewRevision,
21820
21836
  yp as setSessionPresets,
@@ -21822,31 +21838,31 @@ export {
21822
21838
  Rn as setStoryboardGraph,
21823
21839
  vv as setSurfaceClassifications,
21824
21840
  Ry as setTokens,
21825
- R0 as setViewportPresets,
21826
- T1 as storyboardScreenRecipeKey,
21841
+ T0 as setViewportPresets,
21842
+ F1 as storyboardScreenRecipeKey,
21827
21843
  nf as subscribeFrameInteraction,
21828
21844
  wc as subscribePreviewEnvironmentControls,
21829
21845
  ru as subscribeSessionPresets,
21830
- Gw as subscribeStoryboardGraph,
21831
- iN as summarizeConditionCoverage,
21846
+ Xw as subscribeStoryboardGraph,
21847
+ sN as summarizeConditionCoverage,
21832
21848
  lv as unclassifiedSurfaces,
21833
- US as usePygmalionPreviewCaptureProgress,
21834
- eN as usePygmalionProject,
21849
+ VS as usePygmalionPreviewCaptureProgress,
21850
+ tN as usePygmalionProject,
21835
21851
  lh as validateDesignComponentConnections,
21836
- SN as validateFrameBranchKinds,
21837
- rN as validateHookTargeting,
21838
- NN as validateInteractiveStates,
21852
+ NN as validateFrameBranchKinds,
21853
+ oN as validateHookTargeting,
21854
+ IN as validateInteractiveStates,
21839
21855
  iv as validatePreviewArtifactBundle,
21840
21856
  qi as validateRoutePreviewArtifactV3Browser,
21841
- KS as validateScenarioCoverage,
21842
- IN as validateScreenCards,
21843
- nN as validateScreenConformance,
21844
- CN as validateScreenDimensions,
21857
+ qS as validateScenarioCoverage,
21858
+ CN as validateScreenCards,
21859
+ rN as validateScreenConformance,
21860
+ PN as validateScreenDimensions,
21845
21861
  hx as validateScreenFlows,
21846
- PN as validateScreenLanes,
21847
- $N as validateScreenLists,
21848
- MN as validateScreenStateAxes,
21849
- ZS as validateScreenStateGroups,
21850
- EN as validateSectionHeaders,
21851
- zS as validateSurfaceDemands
21862
+ $N as validateScreenLanes,
21863
+ MN as validateScreenLists,
21864
+ EN as validateScreenStateAxes,
21865
+ eN as validateScreenStateGroups,
21866
+ kN as validateSectionHeaders,
21867
+ DS as validateSurfaceDemands
21852
21868
  };