@malloy-publisher/sdk 0.9.9 → 0.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/{RenderedResult-Bw7EQc42.cjs.js → RenderedResult-BcgYjkZ0.cjs.js} +1 -1
  2. package/dist/{RenderedResult-BHuJpdSn.es.js → RenderedResult-Dp1Qdajz.es.js} +1 -1
  3. package/dist/builder/index.cjs.js +61 -61
  4. package/dist/builder/index.es.js +782 -793
  5. package/dist/components/Dashboard/DashboardView.d.ts +11 -0
  6. package/dist/components/Dashboard/useStuck.d.ts +14 -0
  7. package/dist/components/DocumentCreate/newNotebook.d.ts +9 -5
  8. package/dist/components/ReportBuilder/FilterStrip.d.ts +3 -1
  9. package/dist/components/ReportBuilder/TileMenu.d.ts +7 -2
  10. package/dist/index.cjs.js +1 -1
  11. package/dist/index.es.js +3 -3
  12. package/dist/{useCompiledDocument-1dgF5CC9.es.js → useCompiledDocument-BMPDvdFx.es.js} +2348 -2310
  13. package/dist/{useCompiledDocument-BKyRnXmA.cjs.js → useCompiledDocument-UY28ITET.cjs.js} +34 -34
  14. package/package.json +1 -1
  15. package/src/components/Dashboard/DashboardView.tsx +62 -13
  16. package/src/components/Dashboard/useStuck.ts +38 -0
  17. package/src/components/DocumentCreate/newNotebook.spec.ts +8 -6
  18. package/src/components/DocumentCreate/newNotebook.ts +26 -12
  19. package/src/components/ReportBuilder/BuilderDialogs.tsx +5 -3
  20. package/src/components/ReportBuilder/BuilderGrid.tsx +13 -3
  21. package/src/components/ReportBuilder/FilterStrip.tsx +118 -118
  22. package/src/components/ReportBuilder/ReportBuilder.inline.spec.tsx +0 -1
  23. package/src/components/ReportBuilder/ReportBuilder.spec.tsx +5 -6
  24. package/src/components/ReportBuilder/ReportBuilder.tsx +1 -0
  25. package/src/components/ReportBuilder/TileMenu.tsx +8 -3
  26. package/src/components/ReportBuilder/newDashboard.spec.ts +2 -3
@@ -1,6 +1,6 @@
1
1
  import { jsx as _, jsxs as K, Fragment as Be } from "react/jsx-runtime";
2
- import { A as ds, f as Sc, g as Oc, h as Vr, U as nh, i as Gt, M as mt, j as Yo, l as Xo, k as Qt, P as rh, T as us, t as ih, B as Tc, G as Pn, n as Ur, N as Ec, o as Cc, p as sh, q as oh, s as Zo, S as ah, C as lh, u as ch, v as dh, w as Nt, x as uh, y as fh, z as hh, E as ph, F as gh, H as Qo, I as mh, J as vh, K as yh, L as bh, O as Ic, Q as wh, R as xh, V as _h, W as kh, X as $h, Y as Dc, Z as Ac, _ as Pc, $ as Sh, a0 as Mc, a1 as Oh, a2 as Th, a3 as Eh, a4 as Ch, a5 as Ih, a6 as Dh, a7 as Ah, a8 as Ph, a9 as Mh, aa as Rh, ab as Lh, ac as Nh, ad as zh } from "../useCompiledDocument-1dgF5CC9.es.js";
3
- import { ae as Q0, af as J0, ag as ew, ah as tw, ai as nw, aj as rw, ak as iw, al as sw, am as ow, an as aw, ao as lw } from "../useCompiledDocument-1dgF5CC9.es.js";
2
+ import { A as ds, f as Sc, g as Oc, h as Vr, U as nh, i as Gt, M as mt, j as Yo, l as Xo, k as Qt, P as rh, T as us, t as ih, B as Tc, G as Pn, n as Ur, N as Ec, o as Cc, p as sh, q as oh, s as Zo, S as ah, C as lh, u as ch, v as dh, w as Nt, x as uh, y as fh, z as hh, E as ph, F as gh, H as Qo, I as mh, J as vh, K as yh, L as bh, O as Ic, Q as wh, R as xh, V as _h, W as kh, X as $h, Y as Dc, Z as Ac, _ as Pc, $ as Sh, a0 as Mc, a1 as Oh, a2 as Th, a3 as Eh, a4 as Ch, a5 as Ih, a6 as Dh, a7 as Ah, a8 as Ph, a9 as Mh, aa as Rh, ab as Lh, ac as Nh, ad as zh } from "../useCompiledDocument-BMPDvdFx.es.js";
3
+ import { ae as Q0, af as J0, ag as ew, ah as tw, ai as nw, aj as rw, ak as iw, al as sw, am as ow, an as aw, ao as lw } from "../useCompiledDocument-BMPDvdFx.es.js";
4
4
  import { TextField as st, MenuItem as qt, ListItemText as Jo, Typography as ve, Box as ze, List as Wh, ListItemButton as Fh, Chip as to, Stack as Se, ToggleButtonGroup as ea, ToggleButton as zn, Button as Pe, Checkbox as no, Tooltip as zt, Autocomplete as Bh, Popover as jh, InputBase as Gh, IconButton as Wi, SvgIcon as qh, Divider as Is, Alert as ht } from "@mui/material";
5
5
  import { useId as Rc, useMemo as ue, useState as U, useEffect as ye, useRef as J, createElement as Kh, useLayoutEffect as Fi, useCallback as he, useInsertionEffect as Vh, createContext as Lc, memo as Uh, forwardRef as Hh, startTransition as Yh, useImperativeHandle as Xh, useContext as Nc } from "react";
6
6
  import { b4 as rt, b5 as ta } from "../ServerProvider-CQy4jVYK.es.js";
@@ -66,16 +66,16 @@ function ro({
66
66
  label: "Viz type",
67
67
  value: e,
68
68
  disabled: i !== void 0,
69
- onChange: (d) => {
70
- const c = d.target.value;
71
- l.find((f) => f.value === c)?.disabled || o(c);
69
+ onChange: (c) => {
70
+ const d = c.target.value;
71
+ l.find((f) => f.value === d)?.disabled || o(d);
72
72
  },
73
73
  helperText: i,
74
74
  FormHelperTextProps: { id: u },
75
75
  SelectProps: {
76
76
  ...s ? { onOpen: s } : {},
77
77
  // The menu items carry a reason line; the closed field shows the label alone.
78
- renderValue: (d) => l.find((c) => c.value === d)?.label ?? String(d),
78
+ renderValue: (c) => l.find((d) => d.value === c)?.label ?? String(c),
79
79
  // A disabled choice stays focusable so a keyboard user reaches its reason.
80
80
  MenuProps: { MenuListProps: { disabledItemsFocusable: !0 } },
81
81
  SelectDisplayProps: {
@@ -85,20 +85,20 @@ function ro({
85
85
  }
86
86
  },
87
87
  sx: { minWidth: 140 },
88
- children: l.map((d) => /* @__PURE__ */ _(
88
+ children: l.map((c) => /* @__PURE__ */ _(
89
89
  qt,
90
90
  {
91
- value: d.value,
92
- disabled: d.value === "custom" || d.disabled === !0,
91
+ value: c.value,
92
+ disabled: c.value === "custom" || c.disabled === !0,
93
93
  children: /* @__PURE__ */ _(
94
94
  Jo,
95
95
  {
96
- primary: d.label,
97
- ...d.reason ? { secondary: d.reason } : {}
96
+ primary: c.label,
97
+ ...c.reason ? { secondary: c.reason } : {}
98
98
  }
99
99
  )
100
100
  },
101
- d.value
101
+ c.value
102
102
  ))
103
103
  }
104
104
  );
@@ -220,20 +220,20 @@ function up({
220
220
  onAdd: s,
221
221
  onAddText: o
222
222
  }) {
223
- const { theme: a } = rt(), l = ue(() => n?.sources ?? [], [n]), [u, d] = U("query"), [c, f] = U(""), [h, p] = U(""), [m, b] = U(""), [w, v] = U(
223
+ const { theme: a } = rt(), l = ue(() => n?.sources ?? [], [n]), [u, c] = U("query"), [d, f] = U(""), [h, p] = U(""), [m, b] = U(""), [w, v] = U(
224
224
  "default"
225
225
  ), [g, y] = U(Math.ceil(r / 2));
226
226
  ye(() => {
227
227
  if (!e) return;
228
- d("query");
228
+ c("query");
229
229
  const $ = (E) => l.some((B) => B.name === E && B.views.length > 0);
230
230
  f(
231
231
  t.sources.map((E) => E.base).find($) ?? l.find((E) => E.views.length > 0)?.name ?? ""
232
232
  ), p(""), b(""), v("default"), y(Math.ceil(r / 2));
233
233
  }, [e, t, l, r]);
234
- const x = c !== "" && h !== "", k = [c, h].filter(($) => $ !== "" && !na($)).map(
234
+ const x = d !== "" && h !== "", k = [d, h].filter(($) => $ !== "" && !na($)).map(
235
235
  ($) => `"${$}" is not a plain Malloy name, so a tile cannot be written for it.`
236
- )[0], S = l.find(($) => $.name === c), C = S?.views.find(
236
+ )[0], S = l.find(($) => $.name === d), C = S?.views.find(
237
237
  ($) => $.name === h
238
238
  );
239
239
  return /* @__PURE__ */ _(
@@ -251,7 +251,7 @@ function up({
251
251
  variant: "contained",
252
252
  disabled: u === "query" && (!x || k !== void 0),
253
253
  onClick: () => u === "text" ? o() : s({
254
- base: c,
254
+ base: d,
255
255
  modelPath: S?.modelPath ?? "",
256
256
  ...S?.exporters ? { exporters: S.exporters } : {},
257
257
  view: h,
@@ -277,7 +277,7 @@ function up({
277
277
  value: u,
278
278
  "aria-label": "Tile type",
279
279
  onChange: ($, E) => {
280
- E !== null && d(E);
280
+ E !== null && c(E);
281
281
  },
282
282
  children: [
283
283
  /* @__PURE__ */ _(zn, { value: "query", sx: { px: 1.5 }, children: "Query" }),
@@ -290,7 +290,7 @@ function up({
290
290
  dp,
291
291
  {
292
292
  sources: l,
293
- source: c,
293
+ source: d,
294
294
  view: h,
295
295
  onSource: ($) => {
296
296
  f($), p("");
@@ -359,13 +359,13 @@ function fp({
359
359
  })
360
360
  );
361
361
  }, [e, n, t]);
362
- const d = (p, m) => u(
362
+ const c = (p, m) => u(
363
363
  (b) => b.map((w, v) => {
364
364
  if (v !== p) return w;
365
365
  const g = { ...w };
366
366
  return m(g), g;
367
367
  })
368
- ), c = [Ds, ...i.filter((p) => p !== Ds)], f = (p) => p === Ds ? "This report" : p;
368
+ ), d = [Ds, ...i.filter((p) => p !== Ds)], f = (p) => p === Ds ? "This report" : p;
369
369
  return /* @__PURE__ */ _(
370
370
  ds,
371
371
  {
@@ -461,11 +461,11 @@ function fp({
461
461
  displayEmpty: !0
462
462
  },
463
463
  InputLabelProps: { shrink: !0 },
464
- onChange: (b) => d(m, (w) => {
464
+ onChange: (b) => c(m, (w) => {
465
465
  const v = b.target.value;
466
466
  w.to = Array.isArray(v) ? v : String(v).split(",").filter(Boolean);
467
467
  }),
468
- children: c.map((b) => /* @__PURE__ */ K(qt, { value: b, children: [
468
+ children: d.map((b) => /* @__PURE__ */ K(qt, { value: b, children: [
469
469
  /* @__PURE__ */ _(
470
470
  no,
471
471
  {
@@ -492,7 +492,7 @@ function fp({
492
492
  SelectProps: { displayEmpty: !0 },
493
493
  InputLabelProps: { shrink: !0 },
494
494
  helperText: p.given === "" ? `Named ${p.name}, like the dimension` : void 0,
495
- onChange: (b) => d(m, (w) => {
495
+ onChange: (b) => c(m, (w) => {
496
496
  w.given = b.target.value;
497
497
  }),
498
498
  children: [
@@ -704,11 +704,11 @@ function _p({
704
704
  }) {
705
705
  const o = J(n);
706
706
  e && (o.current = n);
707
- const a = e ? n : o.current, l = a !== void 0, [u, d] = U({ kind: "new" }), [c, f] = U(""), [h, p] = U("select"), [m, b] = U(""), [w, v] = U(""), [g, y] = U([]), [x, k] = U(!1), [S, C] = U(!1), $ = (P) => t.sources.find((L) => L.name === P.source)?.base ?? P.source;
707
+ const a = e ? n : o.current, l = a !== void 0, [u, c] = U({ kind: "new" }), [d, f] = U(""), [h, p] = U("select"), [m, b] = U(""), [w, v] = U(""), [g, y] = U([]), [x, k] = U(!1), [S, C] = U(!1), $ = (P) => t.sources.find((L) => L.name === P.source)?.base ?? P.source;
708
708
  ye(() => {
709
709
  if (e)
710
710
  if (C(n !== void 0), n) {
711
- d({ kind: "existing", name: n.name }), f(n.label ?? "");
711
+ c({ kind: "existing", name: n.name }), f(n.label ?? "");
712
712
  const P = yp(t, n);
713
713
  y(P);
714
714
  const L = P.filter((de) => de.include), re = new Set(L.map((de) => de.field));
@@ -716,7 +716,7 @@ function _p({
716
716
  re.size === 1 ? L[0].field : n.field ?? ""
717
717
  ), k(re.size > 1);
718
718
  } else
719
- d({ kind: "new" }), f(""), p("select"), v(""), b((/* @__PURE__ */ new Date()).toISOString().slice(0, 10)), y(
719
+ c({ kind: "new" }), f(""), p("select"), v(""), b((/* @__PURE__ */ new Date()).toISOString().slice(0, 10)), y(
720
720
  t.tiles.map((P) => ({
721
721
  include: io(P),
722
722
  field: ""
@@ -734,7 +734,7 @@ function _p({
734
734
  [w, E]
735
735
  ), D = u.kind === "existing" ? n ?? r.find((P) => P.name === u.name) : B ? {
736
736
  name: B,
737
- type: ci({ name: B, label: c, kind: h, field: w }).type
737
+ type: ci({ name: B, label: d, kind: h, field: w }).type
738
738
  } : void 0, N = D?.type !== void 0 && !D.type.startsWith("filter<"), q = g.find((P) => P.include)?.op ?? Bi(D?.type), j = (P, L) => {
739
739
  C(!0), y(
740
740
  (re) => re.map((de, Ge) => Ge === P ? { ...de, ...L } : de)
@@ -747,9 +747,9 @@ function _p({
747
747
  (re) => re.map(({ op: de, ...Ge }) => L ? { ...Ge, op: L } : Ge)
748
748
  );
749
749
  }, se = (P) => {
750
- C(!0), d({ kind: "existing", name: P.name }), v(P.field ?? ""), Q(P.type);
750
+ C(!0), c({ kind: "existing", name: P.name }), v(P.field ?? ""), Q(P.type);
751
751
  }, fe = (P) => {
752
- C(!0), p(P), Q(ci({ name: "X", label: c, kind: P, field: w }).type);
752
+ C(!0), p(P), Q(ci({ name: "X", label: d, kind: P, field: w }).type);
753
753
  }, T = t.tiles.map(io), G = T.filter(Boolean).length, W = g.filter((P, L) => P.include && T[L]).length, A = t.tiles.filter(
754
754
  (P, L) => (g[L]?.include ?? !1) && T[L] && ke(P)
755
755
  ), F = A.length > 0 ? A : t.tiles.filter(
@@ -803,7 +803,7 @@ function _p({
803
803
  if (C(!0), v(P), l || u.kind !== "new") return;
804
804
  const L = O(P), re = ci({
805
805
  name: "X",
806
- label: c,
806
+ label: d,
807
807
  kind: h,
808
808
  field: P
809
809
  }).type;
@@ -824,7 +824,7 @@ function _p({
824
824
  name: D.name,
825
825
  // Untyped, the label is what the placeholder promised — `Status`
826
826
  // for `$STATUS` — not the shouted name.
827
- label: c.trim() || qc(D.name),
827
+ label: d.trim() || qc(D.name),
828
828
  kind: h,
829
829
  field: w.trim(),
830
830
  ...Y ? { source: Y } : {},
@@ -832,7 +832,7 @@ function _p({
832
832
  })
833
833
  );
834
834
  else if (n?.origin === "dashboard" && n.local) {
835
- const P = c.trim(), L = P !== (n.local.label ?? "");
835
+ const P = d.trim(), L = P !== (n.local.label ?? "");
836
836
  s(
837
837
  D.name,
838
838
  M,
@@ -846,8 +846,8 @@ function _p({
846
846
  shown: a,
847
847
  fromModel: te,
848
848
  source: u,
849
- setSource: d,
850
- label: c,
849
+ setSource: c,
850
+ label: d,
851
851
  setLabel: f,
852
852
  kind: h,
853
853
  dateDefault: m,
@@ -889,8 +889,8 @@ function ml({
889
889
  helperText: a,
890
890
  disabled: l,
891
891
  autoFocus: u,
892
- placeholder: d,
893
- sx: c
892
+ placeholder: c,
893
+ sx: d
894
894
  }) {
895
895
  const f = ue(
896
896
  () => (n ?? []).filter((p) => r?.(p) ?? !0).map((p) => p.name),
@@ -917,14 +917,14 @@ function ml({
917
917
  {
918
918
  ...p,
919
919
  label: i,
920
- placeholder: d,
920
+ placeholder: c,
921
921
  autoFocus: u,
922
922
  error: o,
923
923
  helperText: a,
924
924
  inputProps: { ...p.inputProps, "aria-label": s }
925
925
  }
926
926
  ),
927
- sx: c
927
+ sx: d
928
928
  }
929
929
  );
930
930
  }
@@ -947,8 +947,8 @@ function kp({
947
947
  }) {
948
948
  const { theme: l } = rt(), {
949
949
  editing: u,
950
- shown: d,
951
- fromModel: c,
950
+ shown: c,
951
+ fromModel: d,
952
952
  source: f,
953
953
  setSource: h,
954
954
  label: p,
@@ -1005,7 +1005,7 @@ function kp({
1005
1005
  {
1006
1006
  open: e,
1007
1007
  onClose: s,
1008
- title: u ? d.label ?? d.name : "Add a filter",
1008
+ title: u ? c.label ?? c.name : "Add a filter",
1009
1009
  description: u ? /* @__PURE__ */ K(Be, { children: [
1010
1010
  /* @__PURE__ */ K(
1011
1011
  ze,
@@ -1014,11 +1014,11 @@ function kp({
1014
1014
  sx: { fontFamily: "ui-monospace, monospace" },
1015
1015
  children: [
1016
1016
  "$",
1017
- d.name
1017
+ c.name
1018
1018
  ]
1019
1019
  }
1020
1020
  ),
1021
- c ? " · declared in the model, so its label and options are set there" : " · declared in this report"
1021
+ d ? " · declared in the model, so its label and options are set there" : " · declared in this report"
1022
1022
  ] }) : "A filter on the page, and the tiles it filters.",
1023
1023
  actions: /* @__PURE__ */ K(Be, { children: [
1024
1024
  u && /* @__PURE__ */ _(
@@ -1026,7 +1026,7 @@ function kp({
1026
1026
  {
1027
1027
  color: "error",
1028
1028
  startIcon: /* @__PURE__ */ _(Oc, {}),
1029
- onClick: () => a(d.name),
1029
+ onClick: () => a(c.name),
1030
1030
  sx: (M) => ({
1031
1031
  mr: "auto",
1032
1032
  color: Sc(M)
@@ -1115,7 +1115,7 @@ function kp({
1115
1115
  sx: { flex: 1, minWidth: 200 }
1116
1116
  }
1117
1117
  ),
1118
- !c && /* @__PURE__ */ _(
1118
+ !d && /* @__PURE__ */ _(
1119
1119
  st,
1120
1120
  {
1121
1121
  size: "small",
@@ -1305,14 +1305,14 @@ function Kc(e, t, n, r) {
1305
1305
  const [i, s] = U(void 0);
1306
1306
  return ye(() => {
1307
1307
  t && e !== void 0 && s(structuredClone(e));
1308
- }, [t, e]), { draft: i, patch: (d) => s((c) => {
1309
- if (c === void 0) return c;
1310
- const f = structuredClone(c);
1311
- return d(f), f;
1312
- }), apply: (d) => {
1308
+ }, [t, e]), { draft: i, patch: (c) => s((d) => {
1309
+ if (d === void 0) return d;
1310
+ const f = structuredClone(d);
1311
+ return c(f), f;
1312
+ }), apply: (c) => {
1313
1313
  if (i === void 0) return;
1314
- const c = structuredClone(i);
1315
- d(c), s(c), JSON.stringify(c) !== JSON.stringify(e) && n(c);
1314
+ const d = structuredClone(i);
1315
+ c(d), s(d), JSON.stringify(d) !== JSON.stringify(e) && n(d);
1316
1316
  }, close: () => {
1317
1317
  i !== void 0 && e !== void 0 && JSON.stringify(i) !== JSON.stringify(e) && n(i), r();
1318
1318
  }, discard: () => s(void 0) };
@@ -1328,12 +1328,12 @@ function Tp({
1328
1328
  onDrills: o,
1329
1329
  view: a
1330
1330
  }) {
1331
- const l = Rc(), { theme: u } = rt(), { draft: d, apply: c, close: f, discard: h } = Kc(
1331
+ const l = Rc(), { theme: u } = rt(), { draft: c, apply: d, close: f, discard: h } = Kc(
1332
1332
  t,
1333
1333
  e !== null,
1334
1334
  r,
1335
1335
  n
1336
- ), p = d !== void 0 && ke(d) ? d : void 0, m = p !== void 0 && p.declaration.kind !== "inherited", b = (g) => c((y) => {
1336
+ ), p = c !== void 0 && ke(c) ? c : void 0, m = p !== void 0 && p.declaration.kind !== "inherited", b = (g) => d((y) => {
1337
1337
  ke(y) && g(y);
1338
1338
  }), w = J(void 0), v = e !== null;
1339
1339
  return ye(() => {
@@ -1341,19 +1341,19 @@ function Tp({
1341
1341
  }, [v]), /* @__PURE__ */ _(
1342
1342
  jh,
1343
1343
  {
1344
- open: e !== null && d !== void 0,
1344
+ open: e !== null && c !== void 0,
1345
1345
  anchorEl: e,
1346
1346
  onClose: f,
1347
1347
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
1348
1348
  transformOrigin: { vertical: "top", horizontal: "right" },
1349
1349
  slotProps: { paper: { sx: { width: 320, p: 2 } } },
1350
- children: d && /* @__PURE__ */ K(Se, { sx: { gap: 1.5 }, children: [
1350
+ children: c && /* @__PURE__ */ K(Se, { sx: { gap: 1.5 }, children: [
1351
1351
  /* @__PURE__ */ _(
1352
1352
  ve,
1353
1353
  {
1354
1354
  variant: "overline",
1355
1355
  sx: { color: u.tileTitle, lineHeight: 1.5 },
1356
- children: p ? `${p.source} → ${p.name}` : `Text · ${d.name}`
1356
+ children: p ? `${p.source} → ${p.name}` : `Text · ${c.name}`
1357
1357
  }
1358
1358
  ),
1359
1359
  p && m && /* @__PURE__ */ _(Be, { children: /* @__PURE__ */ _(
@@ -1396,7 +1396,7 @@ function Tp({
1396
1396
  ", so a filter has no single place to go. Everything else here is editable."
1397
1397
  ] }),
1398
1398
  /* @__PURE__ */ K(Se, { direction: "row", sx: { justifyContent: "space-between" }, children: [
1399
- m ? /* @__PURE__ */ _(
1399
+ m && o ? /* @__PURE__ */ _(
1400
1400
  Pe,
1401
1401
  {
1402
1402
  size: "small",
@@ -1455,7 +1455,7 @@ function Ep({
1455
1455
  confirmConversion: l,
1456
1456
  exitDialog: u
1457
1457
  }) {
1458
- const { filterDialog: d, setFilterDialog: c } = i, { menu: f, setMenu: h } = s, p = f === void 0 ? void 0 : e.document.tiles[f.index], m = p && ke(p) ? p : void 0, b = (() => {
1458
+ const { filterDialog: c, setFilterDialog: d } = i, { menu: f, setMenu: h } = s, p = f === void 0 ? void 0 : e.document.tiles[f.index], m = p && ke(p) ? p : void 0, b = (() => {
1459
1459
  if (!m || !t) return;
1460
1460
  const w = e.document.sources.find((g) => g.name === m.source)?.base ?? m.source, v = m.declaration.kind === "reference" ? m.declaration.from : m.name;
1461
1461
  return t.sources.find((g) => g.name === w)?.views.find((g) => g.name === v);
@@ -1464,12 +1464,12 @@ function Ep({
1464
1464
  /* @__PURE__ */ _(
1465
1465
  kp,
1466
1466
  {
1467
- open: d !== void 0,
1467
+ open: c !== void 0,
1468
1468
  document: e.document,
1469
- ...d?.control ? { control: d.control } : {},
1469
+ ...c?.control ? { control: c.control } : {},
1470
1470
  available: i.available,
1471
1471
  ...t ? { fieldsFor: i.fieldsFor } : {},
1472
- onClose: () => c(void 0),
1472
+ onClose: () => d(void 0),
1473
1473
  onApply: i.applyFilter,
1474
1474
  onRemove: i.dropControl
1475
1475
  }
@@ -1493,9 +1493,9 @@ function Ep({
1493
1493
  removeBlocked: "A saved report needs at least one tile."
1494
1494
  } : {},
1495
1495
  view: b,
1496
- onDrills: () => {
1497
- a(m?.source);
1498
- }
1496
+ ...(e.document.sources.find(
1497
+ (w) => w.name === m?.source
1498
+ )?.dimensions?.length ?? 0) > 0 ? { onDrills: () => a(m?.source) } : {}
1499
1499
  }
1500
1500
  ),
1501
1501
  /* @__PURE__ */ _(
@@ -1819,15 +1819,15 @@ var Ap = Object.create, sa = Object.defineProperty, Pp = Object.defineProperties
1819
1819
  for (var i = 0, s = e[t >> 1], o = s && s.length; i < o; i++) t & 1 ? s[i].call(n) : r = s[i].call(n, r);
1820
1820
  return r;
1821
1821
  }, Hn = (e, t, n, r, i, s) => {
1822
- var o, a, l, u, d, c = t & 7, f = !!(t & 8), h = !!(t & 16), p = c > 3 ? e.length + 1 : c ? f ? 1 : 2 : 0, m = Zc[c + 5], b = c > 3 && (e[p - 1] = []), w = e[p] || (e[p] = []), v = c && (!h && !f && (i = i.prototype), c < 5 && (c > 3 || !h) && Mp(c < 4 ? i : { get [n]() {
1822
+ var o, a, l, u, c, d = t & 7, f = !!(t & 8), h = !!(t & 16), p = d > 3 ? e.length + 1 : d ? f ? 1 : 2 : 0, m = Zc[d + 5], b = d > 3 && (e[p - 1] = []), w = e[p] || (e[p] = []), v = d && (!h && !f && (i = i.prototype), d < 5 && (d > 3 || !h) && Mp(d < 4 ? i : { get [n]() {
1823
1823
  return ot(this, s);
1824
1824
  }, set [n](y) {
1825
1825
  return Lt(this, s, y);
1826
1826
  } }, n));
1827
- c ? h && c < 4 && wl(s, (c > 2 ? "set " : c > 1 ? "get " : "") + n) : wl(i, n);
1827
+ d ? h && d < 4 && wl(s, (d > 2 ? "set " : d > 1 ? "get " : "") + n) : wl(i, n);
1828
1828
  for (var g = r.length - 1; g >= 0; g--)
1829
- u = jp(c, n, l = {}, e[3], w), c && (u.static = f, u.private = h, d = u.access = { has: h ? (y) => Gp(i, y) : (y) => n in y }, c ^ 3 && (d.get = h ? (y) => (c ^ 1 ? ot : qp)(y, i, c ^ 4 ? s : v.get) : (y) => y[n]), c > 2 && (d.set = h ? (y, x) => Lt(y, i, x, c ^ 4 ? s : v.set) : (y, x) => y[n] = x)), a = (0, r[g])(c ? c < 4 ? h ? s : v[m] : c > 4 ? void 0 : { get: v.get, set: v.set } : i, u), l._ = 1, c ^ 4 || a === void 0 ? ur(a) && (c > 4 ? b.unshift(a) : c ? h ? s = a : v[m] = a : i = a) : typeof a != "object" || a === null ? Un("Object expected") : (ur(o = a.get) && (v.get = o), ur(o = a.set) && (v.set = o), ur(o = a.init) && b.unshift(o));
1830
- return c || Qc(e, i), v && sa(i, n, v), h ? c ^ 4 ? s : v : i;
1829
+ u = jp(d, n, l = {}, e[3], w), d && (u.static = f, u.private = h, c = u.access = { has: h ? (y) => Gp(i, y) : (y) => n in y }, d ^ 3 && (c.get = h ? (y) => (d ^ 1 ? ot : qp)(y, i, d ^ 4 ? s : v.get) : (y) => y[n]), d > 2 && (c.set = h ? (y, x) => Lt(y, i, x, d ^ 4 ? s : v.set) : (y, x) => y[n] = x)), a = (0, r[g])(d ? d < 4 ? h ? s : v[m] : d > 4 ? void 0 : { get: v.get, set: v.set } : i, u), l._ = 1, d ^ 4 || a === void 0 ? ur(a) && (d > 4 ? b.unshift(a) : d ? h ? s = a : v[m] = a : i = a) : typeof a != "object" || a === null ? Un("Object expected") : (ur(o = a.get) && (v.get = o), ur(o = a.set) && (v.set = o), ur(o = a.init) && b.unshift(o));
1830
+ return d || Qc(e, i), v && sa(i, n, v), h ? d ^ 4 ? s : v : i;
1831
1831
  }, oa = (e, t, n) => t.has(e) || Un("Cannot " + n), Gp = (e, t) => Object(t) !== t ? Un('Cannot use the "in" operator on this value') : e.has(t), ot = (e, t, n) => (oa(e, t, "read from private field"), n ? n.call(e) : t.get(e)), fr = (e, t, n) => t.has(e) ? Un("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Lt = (e, t, n, r) => (oa(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), qp = (e, t, n) => (oa(e, t, "access private method"), n);
1832
1832
  function ao(e, t) {
1833
1833
  if (t) {
@@ -1982,8 +1982,8 @@ var Vp = Object.create, od = Object.defineProperty, Up = Object.getOwnPropertyDe
1982
1982
  for (var i = 0, s = e[t >> 1], o = s && s.length; i < o; i++) s[i].call(n);
1983
1983
  return r;
1984
1984
  }, dd = (e, t, n, r, i, s) => {
1985
- for (var o, a, l, u, d = t & 7, c = !1, f = !1, h = 2, p = ld[d + 5], m = e[h] || (e[h] = []), b = (i = i.prototype, Up(i, n)), w = r.length - 1; w >= 0; w--)
1986
- l = Qp(d, n, a = {}, e[3], m), l.static = c, l.private = f, u = l.access = { has: (v) => n in v }, u.get = (v) => v[n], o = (0, r[w])(b[p], l), a._ = 1, cd(o) && (b[p] = o);
1985
+ for (var o, a, l, u, c = t & 7, d = !1, f = !1, h = 2, p = ld[c + 5], m = e[h] || (e[h] = []), b = (i = i.prototype, Up(i, n)), w = r.length - 1; w >= 0; w--)
1986
+ l = Qp(c, n, a = {}, e[3], m), l.static = d, l.private = f, u = l.access = { has: (v) => n in v }, u.get = (v) => v[n], o = (0, r[w])(b[p], l), a._ = 1, cd(o) && (b[p] = o);
1987
1987
  return b && od(i, n, b), i;
1988
1988
  }, ud = (e, t, n) => t.has(e) || ps("Cannot " + n), tg = (e, t, n) => (ud(e, t, "read from private field"), t.get(e)), ng = (e, t, n) => t.has(e) ? ps("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), rg = (e, t, n, r) => (ud(e, t, "write to private field"), t.set(e, n), n), at = class go {
1989
1989
  /**
@@ -2179,15 +2179,15 @@ var pd = /* @__PURE__ */ ((e) => (e.Horizontal = "x", e.Vertical = "y", e))(pd |
2179
2179
  for (var i = 0, s = e[t >> 1], o = s && s.length; i < o; i++) t & 1 ? s[i].call(n) : r = s[i].call(n, r);
2180
2180
  return r;
2181
2181
  }, me = (e, t, n, r, i, s) => {
2182
- var o, a, l, u, d, c = t & 7, f = !!(t & 8), h = !!(t & 16), p = c > 3 ? e.length + 1 : c ? f ? 1 : 2 : 0, m = wd[c + 5], b = c > 3 && (e[p - 1] = []), w = e[p] || (e[p] = []), v = c && (!h && !f && (i = i.prototype), c < 5 && (c > 3 || !h) && ag(c < 4 ? i : { get [n]() {
2182
+ var o, a, l, u, c, d = t & 7, f = !!(t & 8), h = !!(t & 16), p = d > 3 ? e.length + 1 : d ? f ? 1 : 2 : 0, m = wd[d + 5], b = d > 3 && (e[p - 1] = []), w = e[p] || (e[p] = []), v = d && (!h && !f && (i = i.prototype), d < 5 && (d > 3 || !h) && ag(d < 4 ? i : { get [n]() {
2183
2183
  return De(this, s);
2184
2184
  }, set [n](y) {
2185
2185
  return nt(this, s, y);
2186
2186
  } }, n));
2187
- c ? h && c < 4 && kl(s, (c > 2 ? "set " : c > 1 ? "get " : "") + n) : kl(i, n);
2187
+ d ? h && d < 4 && kl(s, (d > 2 ? "set " : d > 1 ? "get " : "") + n) : kl(i, n);
2188
2188
  for (var g = r.length - 1; g >= 0; g--)
2189
- u = cg(c, n, l = {}, e[3], w), c && (u.static = f, u.private = h, d = u.access = { has: h ? (y) => dg(i, y) : (y) => n in y }, c ^ 3 && (d.get = h ? (y) => (c ^ 1 ? De : xd)(y, i, c ^ 4 ? s : v.get) : (y) => y[n]), c > 2 && (d.set = h ? (y, x) => nt(y, i, x, c ^ 4 ? s : v.set) : (y, x) => y[n] = x)), a = (0, r[g])(c ? c < 4 ? h ? s : v[m] : c > 4 ? void 0 : { get: v.get, set: v.set } : i, u), l._ = 1, c ^ 4 || a === void 0 ? hr(a) && (c > 4 ? b.unshift(a) : c ? h ? s = a : v[m] = a : i = a) : typeof a != "object" || a === null ? Yn("Object expected") : (hr(o = a.get) && (v.get = o), hr(o = a.set) && (v.set = o), hr(o = a.init) && b.unshift(o));
2190
- return c || pn(e, i), v && da(i, n, v), h ? c ^ 4 ? s : v : i;
2189
+ u = cg(d, n, l = {}, e[3], w), d && (u.static = f, u.private = h, c = u.access = { has: h ? (y) => dg(i, y) : (y) => n in y }, d ^ 3 && (c.get = h ? (y) => (d ^ 1 ? De : xd)(y, i, d ^ 4 ? s : v.get) : (y) => y[n]), d > 2 && (c.set = h ? (y, x) => nt(y, i, x, d ^ 4 ? s : v.set) : (y, x) => y[n] = x)), a = (0, r[g])(d ? d < 4 ? h ? s : v[m] : d > 4 ? void 0 : { get: v.get, set: v.set } : i, u), l._ = 1, d ^ 4 || a === void 0 ? hr(a) && (d > 4 ? b.unshift(a) : d ? h ? s = a : v[m] = a : i = a) : typeof a != "object" || a === null ? Yn("Object expected") : (hr(o = a.get) && (v.get = o), hr(o = a.set) && (v.set = o), hr(o = a.init) && b.unshift(o));
2190
+ return d || pn(e, i), v && da(i, n, v), h ? d ^ 4 ? s : v : i;
2191
2191
  }, ha = (e, t, n) => t.has(e) || Yn("Cannot " + n), dg = (e, t) => Object(t) !== t ? Yn('Cannot use the "in" operator on this value') : e.has(t), De = (e, t, n) => (ha(e, t, "read from private field"), n ? n.call(e) : t.get(e)), we = (e, t, n) => t.has(e) ? Yn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), nt = (e, t, n, r) => (ha(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), xd = (e, t, n) => (ha(e, t, "access private method"), n);
2192
2192
  function _d(e, t) {
2193
2193
  return {
@@ -2443,17 +2443,17 @@ var di = [], $n, Sn, fg = class extends He {
2443
2443
  for (const u of e ?? n.droppables) {
2444
2444
  if (u.disabled || i && !u.accepts(i))
2445
2445
  continue;
2446
- const d = t ?? u.collisionDetector;
2447
- if (!d)
2446
+ const c = t ?? u.collisionDetector;
2447
+ if (!c)
2448
2448
  continue;
2449
2449
  l.push(u), u.shape;
2450
- const c = pe(
2451
- () => d({
2450
+ const d = pe(
2451
+ () => c({
2452
2452
  droppable: u,
2453
2453
  dragOperation: r
2454
2454
  })
2455
2455
  );
2456
- c && (u.collisionPriority != null && (c.priority = u.collisionPriority), a.push(c));
2456
+ d && (u.collisionPriority != null && (d.priority = u.collisionPriority), a.push(d));
2457
2457
  }
2458
2458
  return l.length === 0 ? di : (a.sort(ug), a);
2459
2459
  }
@@ -2483,9 +2483,9 @@ var Ct = class tn {
2483
2483
  var u;
2484
2484
  return [
2485
2485
  () => {
2486
- const { id: d, manager: c } = this;
2487
- if (d !== l)
2488
- return l = d, c?.registry.register(this), () => c?.registry.unregister(this);
2486
+ const { id: c, manager: d } = this;
2487
+ if (c !== l)
2488
+ return l = c, d?.registry.register(this), () => d?.registry.unregister(this);
2489
2489
  },
2490
2490
  ...(u = r?.()) != null ? u : []
2491
2491
  ];
@@ -2618,15 +2618,15 @@ var ms = Ct, $l = class {
2618
2618
  super(
2619
2619
  fa(ua({}, u), {
2620
2620
  effects: () => {
2621
- var d;
2621
+ var c;
2622
2622
  return [
2623
- ...(d = l?.()) != null ? d : [],
2623
+ ...(c = l?.()) != null ? c : [],
2624
2624
  () => {
2625
- const { manager: c, plugins: f } = this;
2626
- if (!(!c || !f))
2625
+ const { manager: d, plugins: f } = this;
2626
+ if (!(!d || !f))
2627
2627
  for (const h of f) {
2628
2628
  const { plugin: p } = Mr(h);
2629
- c.registry.plugins.register(p);
2629
+ d.registry.plugins.register(p);
2630
2630
  }
2631
2631
  }
2632
2632
  ];
@@ -2959,12 +2959,12 @@ var mg = class {
2959
2959
  (t = e.cancelable) != null ? t : !0
2960
2960
  );
2961
2961
  ((n = e.propagate) == null || n) && this.manager.monitor.dispatch("dragmove", o), queueMicrotask(() => {
2962
- var a, l, u, d, c;
2962
+ var a, l, u, c, d;
2963
2963
  if (o.defaultPrevented)
2964
2964
  return;
2965
- const f = (c = e.to) != null ? c : {
2965
+ const f = (d = e.to) != null ? d : {
2966
2966
  x: r.position.current.x + ((l = (a = e.by) == null ? void 0 : a.x) != null ? l : 0),
2967
- y: r.position.current.y + ((d = (u = e.by) == null ? void 0 : u.y) != null ? d : 0)
2967
+ y: r.position.current.y + ((c = (u = e.by) == null ? void 0 : u.y) != null ? c : 0)
2968
2968
  };
2969
2969
  r.position.current = f;
2970
2970
  });
@@ -2995,8 +2995,8 @@ var mg = class {
2995
2995
  abort: () => {
2996
2996
  }
2997
2997
  };
2998
- return s = new Promise((u, d) => {
2999
- l.resume = u, l.abort = d;
2998
+ return s = new Promise((u, c) => {
2999
+ l.resume = u, l.abort = c;
3000
3000
  }), l;
3001
3001
  };
3002
3002
  i.abort();
@@ -3008,15 +3008,15 @@ var mg = class {
3008
3008
  );
3009
3009
  const l = pe(
3010
3010
  () => {
3011
- var d;
3012
- return ((d = r.source) == null ? void 0 : d.status) === "dropping";
3011
+ var c;
3012
+ return ((c = r.source) == null ? void 0 : c.status) === "dropping";
3013
3013
  }
3014
3014
  ), u = () => {
3015
3015
  r.controller === i && (r.controller = void 0), r.reset();
3016
3016
  };
3017
3017
  if (l) {
3018
- const { source: d } = r, c = ut(() => {
3019
- d?.status === "idle" && (c(), u());
3018
+ const { source: c } = r, d = ut(() => {
3019
+ c?.status === "idle" && (d(), u());
3020
3020
  });
3021
3021
  } else
3022
3022
  this.manager.renderer.rendering.then(u);
@@ -3271,7 +3271,7 @@ var wg = class {
3271
3271
  var n;
3272
3272
  const r = t ?? {}, i = yt(r.plugins, []), s = yt(r.sensors, []), o = yt(r.modifiers, []), a = (n = r.renderer) != null ? n : bg, l = new pg(this), u = new yg(this);
3273
3273
  this.registry = u, this.monitor = l, this.renderer = a, this.actions = new mg(this), this.dragOperation = new bt(this), this.collisionObserver = new fg(this), this.plugins = [gg, ...i], this.modifiers = o, this.sensors = s;
3274
- const { destroy: d } = this, c = Hr(() => {
3274
+ const { destroy: c } = this, d = Hr(() => {
3275
3275
  var f, h, p;
3276
3276
  const m = pe(() => this.dragOperation.modifiers), b = this.modifiers;
3277
3277
  for (const w of m)
@@ -3282,7 +3282,7 @@ var wg = class {
3282
3282
  })) != null ? p : b;
3283
3283
  });
3284
3284
  this.destroy = () => {
3285
- c(), d();
3285
+ d(), c();
3286
3286
  };
3287
3287
  }
3288
3288
  /**
@@ -3380,11 +3380,11 @@ function Jn(e) {
3380
3380
  }
3381
3381
  function xg(e) {
3382
3382
  var t, n, r, i;
3383
- const { documentElement: s } = Jn(e), o = it(e).visualViewport, a = (t = o?.width) != null ? t : s.clientWidth, l = (n = o?.height) != null ? n : s.clientHeight, u = (r = o?.offsetTop) != null ? r : 0, d = (i = o?.offsetLeft) != null ? i : 0;
3383
+ const { documentElement: s } = Jn(e), o = it(e).visualViewport, a = (t = o?.width) != null ? t : s.clientWidth, l = (n = o?.height) != null ? n : s.clientHeight, u = (r = o?.offsetTop) != null ? r : 0, c = (i = o?.offsetLeft) != null ? i : 0;
3384
3384
  return {
3385
3385
  top: u,
3386
- left: d,
3387
- right: d + a,
3386
+ left: c,
3387
+ right: c + a,
3388
3388
  bottom: u + l,
3389
3389
  width: a,
3390
3390
  height: l
@@ -3402,11 +3402,11 @@ function kg(e) {
3402
3402
  function Lr(e, t = e.getBoundingClientRect(), n = 0) {
3403
3403
  var r, i, s, o, a;
3404
3404
  let l = t;
3405
- const { ownerDocument: u } = e, d = (r = u.defaultView) != null ? r : window;
3406
- let c = e.parentElement;
3407
- for (; c && c !== u.documentElement; ) {
3408
- if (!_g(c)) {
3409
- const g = c.getBoundingClientRect(), y = n * (g.bottom - g.top), x = n * (g.right - g.left), k = n * (g.bottom - g.top), S = n * (g.right - g.left);
3405
+ const { ownerDocument: u } = e, c = (r = u.defaultView) != null ? r : window;
3406
+ let d = e.parentElement;
3407
+ for (; d && d !== u.documentElement; ) {
3408
+ if (!_g(d)) {
3409
+ const g = d.getBoundingClientRect(), y = n * (g.bottom - g.top), x = n * (g.right - g.left), k = n * (g.bottom - g.top), S = n * (g.right - g.left);
3410
3410
  l = {
3411
3411
  top: Math.max(l.top, g.top - y),
3412
3412
  right: Math.min(l.right, g.right + x),
@@ -3418,9 +3418,9 @@ function Lr(e, t = e.getBoundingClientRect(), n = 0) {
3418
3418
  // Will be calculated next
3419
3419
  }, l.width = l.right - l.left, l.height = l.bottom - l.top;
3420
3420
  }
3421
- c = c.parentElement;
3421
+ d = d.parentElement;
3422
3422
  }
3423
- const f = d.visualViewport, h = (i = f?.offsetTop) != null ? i : 0, p = (s = f?.offsetLeft) != null ? s : 0, m = (o = f?.width) != null ? o : d.innerWidth, b = (a = f?.height) != null ? a : d.innerHeight, w = n * b, v = n * m;
3423
+ const f = c.visualViewport, h = (i = f?.offsetTop) != null ? i : 0, p = (s = f?.offsetLeft) != null ? s : 0, m = (o = f?.width) != null ? o : c.innerWidth, b = (a = f?.height) != null ? a : c.innerHeight, w = n * b, v = n * m;
3424
3424
  return l = {
3425
3425
  top: Math.max(l.top, h - w),
3426
3426
  right: Math.min(
@@ -3552,14 +3552,14 @@ var du = class {
3552
3552
  const n = Array.isArray(e) ? e : [e], r = Array.isArray(t) ? t : [t], i = [];
3553
3553
  for (const o of n)
3554
3554
  for (const a of r) {
3555
- const { type: l, listener: u, options: d } = a, c = [o, a];
3556
- o.addEventListener(l, u, d), this.entries.add(c), i.push(c);
3555
+ const { type: l, listener: u, options: c } = a, d = [o, a];
3556
+ o.addEventListener(l, u, c), this.entries.add(d), i.push(d);
3557
3557
  }
3558
3558
  const s = this.entries;
3559
3559
  return function() {
3560
3560
  for (const a of i) {
3561
- const [l, { type: u, listener: d, options: c }] = a;
3562
- l.removeEventListener(u, d, c), s.delete(a);
3561
+ const [l, { type: u, listener: c, options: d }] = a;
3562
+ l.removeEventListener(u, c, d), s.delete(a);
3563
3563
  }
3564
3564
  };
3565
3565
  }
@@ -3635,7 +3635,7 @@ var El = Array.from({ length: 100 }, (e, t) => t / 100), fu = 75, nn, Ui, Mt, rn
3635
3635
  const { element: l } = this;
3636
3636
  if ((s = oe(this, rn)) == null || s.disconnect(), oe(this, Cr) || !oe(this, nn) || !l.isConnected)
3637
3637
  return;
3638
- const u = (o = l.ownerDocument) != null ? o : document, { innerHeight: d, innerWidth: c } = (a = u.defaultView) != null ? a : window, f = l.getBoundingClientRect(), h = Lr(l, f), { top: p, left: m, bottom: b, right: w } = h, v = -Math.floor(p), g = -Math.floor(m), y = -Math.floor(c - w), x = -Math.floor(d - b), k = `${v}px ${y}px ${x}px ${g}px`;
3638
+ const u = (o = l.ownerDocument) != null ? o : document, { innerHeight: c, innerWidth: d } = (a = u.defaultView) != null ? a : window, f = l.getBoundingClientRect(), h = Lr(l, f), { top: p, left: m, bottom: b, right: w } = h, v = -Math.floor(p), g = -Math.floor(m), y = -Math.floor(d - w), x = -Math.floor(c - b), k = `${v}px ${y}px ${x}px ${g}px`;
3639
3639
  this.boundingClientRect = f, tt(this, rn, new IntersectionObserver(
3640
3640
  (S) => {
3641
3641
  const [C] = S, { intersectionRect: $ } = C;
@@ -3659,8 +3659,8 @@ var El = Array.from({ length: 100 }, (e, t) => t / 100), fu = 75, nn, Ui, Mt, rn
3659
3659
  n?.debug && (tt(this, Ke, document.createElement("div")), oe(this, Ke).style.background = "rgba(0,0,0,0.15)", oe(this, Ke).style.position = "fixed", oe(this, Ke).style.pointerEvents = "none", i.body.appendChild(oe(this, Ke))), tt(this, mr, new IntersectionObserver(
3660
3660
  (s) => {
3661
3661
  var o, a;
3662
- const l = s[s.length - 1], { boundingClientRect: u, isIntersecting: d } = l, { width: c, height: f } = u, h = oe(this, nn);
3663
- tt(this, nn, d), !(!c && !f) && (h && !d ? ((o = oe(this, rn)) == null || o.disconnect(), this.callback(null), (a = oe(this, Mt)) == null || a.disconnect(), tt(this, Mt, void 0), oe(this, Ke) && (oe(this, Ke).style.visibility = "hidden")) : oe(this, vr).call(this), d && !oe(this, Mt) && (tt(this, Mt, new Ag(oe(this, vr))), oe(this, Mt).observe(e)));
3662
+ const l = s[s.length - 1], { boundingClientRect: u, isIntersecting: c } = l, { width: d, height: f } = u, h = oe(this, nn);
3663
+ tt(this, nn, c), !(!d && !f) && (h && !c ? ((o = oe(this, rn)) == null || o.disconnect(), this.callback(null), (a = oe(this, Mt)) == null || a.disconnect(), tt(this, Mt, void 0), oe(this, Ke) && (oe(this, Ke).style.visibility = "hidden")) : oe(this, vr).call(this), c && !oe(this, Mt) && (tt(this, Mt, new Ag(oe(this, vr))), oe(this, Mt).observe(e)));
3664
3664
  },
3665
3665
  {
3666
3666
  threshold: El,
@@ -3783,25 +3783,25 @@ function mu(e) {
3783
3783
  x: e.scrollWidth - o.width,
3784
3784
  y: e.scrollHeight - o.height
3785
3785
  }
3786
- }, l = a.current.y <= 0, u = a.current.x <= 0, d = a.current.y >= a.max.y, c = a.current.x >= a.max.x;
3786
+ }, l = a.current.y <= 0, u = a.current.x <= 0, c = a.current.y >= a.max.y, d = a.current.x >= a.max.x;
3787
3787
  return {
3788
3788
  rect: i,
3789
3789
  position: a,
3790
3790
  isTop: l,
3791
3791
  isLeft: u,
3792
- isBottom: d,
3793
- isRight: c
3792
+ isBottom: c,
3793
+ isRight: d
3794
3794
  };
3795
3795
  }
3796
3796
  function Ng(e, t) {
3797
- const { isTop: n, isBottom: r, isLeft: i, isRight: s, position: o } = mu(e), { x: a, y: l } = t ?? { x: 0, y: 0 }, u = !n && o.current.y + l > 0, d = !r && o.current.y + l < o.max.y, c = !i && o.current.x + a > 0, f = !s && o.current.x + a < o.max.x;
3797
+ const { isTop: n, isBottom: r, isLeft: i, isRight: s, position: o } = mu(e), { x: a, y: l } = t ?? { x: 0, y: 0 }, u = !n && o.current.y + l > 0, c = !r && o.current.y + l < o.max.y, d = !i && o.current.x + a > 0, f = !s && o.current.x + a < o.max.x;
3798
3798
  return {
3799
3799
  top: u,
3800
- bottom: d,
3801
- left: c,
3800
+ bottom: c,
3801
+ left: d,
3802
3802
  right: f,
3803
- x: c || f,
3804
- y: u || d
3803
+ x: d || f,
3804
+ y: u || c
3805
3805
  };
3806
3806
  }
3807
3807
  var Wa = class {
@@ -3916,7 +3916,7 @@ function Nr(e) {
3916
3916
  }
3917
3917
  function bs(e) {
3918
3918
  var t, n, r, i, s, o, a, l, u;
3919
- const { scale: d, transform: c, translate: f } = e, h = qg(d), p = Nr(f), m = Kg(c);
3919
+ const { scale: c, transform: d, translate: f } = e, h = qg(c), p = Nr(f), m = Kg(d);
3920
3920
  if (!m && !h && !p)
3921
3921
  return null;
3922
3922
  const b = {
@@ -3967,7 +3967,7 @@ var lt = /* @__PURE__ */ ((e) => (e[e.Idle = 0] = "Idle", e[e.Forward = 1] = "Fo
3967
3967
  y: 10
3968
3968
  };
3969
3969
  function Hg(e, t, n, r = 25, i = Vg, s = Ug) {
3970
- const { x: o, y: a } = t, { rect: l, isTop: u, isBottom: d, isLeft: c, isRight: f } = mu(e), h = jn(e), p = Ot(e, !0), m = bs(p), b = m !== null ? m?.scaleX < 0 : !1, w = m !== null ? m?.scaleY < 0 : !1, v = new kt(
3970
+ const { x: o, y: a } = t, { rect: l, isTop: u, isBottom: c, isLeft: d, isRight: f } = mu(e), h = jn(e), p = Ot(e, !0), m = bs(p), b = m !== null ? m?.scaleX < 0 : !1, w = m !== null ? m?.scaleY < 0 : !1, v = new kt(
3971
3971
  l.left * h.scaleX + h.x,
3972
3972
  l.top * h.scaleY + h.y,
3973
3973
  l.width * h.scaleX,
@@ -3983,13 +3983,13 @@ function Hg(e, t, n, r = 25, i = Vg, s = Ug) {
3983
3983
  height: v.height * i.y,
3984
3984
  width: v.width * i.x
3985
3985
  };
3986
- return x.height > 0 && (!u || w && !d) && a <= v.top + x.height && n?.y !== 1 && o >= v.left - s.x && o <= v.right + s.x ? (g.y = w ? 1 : -1, y.y = r * Math.abs(
3986
+ return x.height > 0 && (!u || w && !c) && a <= v.top + x.height && n?.y !== 1 && o >= v.left - s.x && o <= v.right + s.x ? (g.y = w ? 1 : -1, y.y = r * Math.abs(
3987
3987
  (v.top + x.height - a) / x.height
3988
- )) : x.height > 0 && (!d || w && !u) && a >= v.bottom - x.height && n?.y !== -1 && o >= v.left - s.x && o <= v.right + s.x && (g.y = w ? -1 : 1, y.y = r * Math.abs(
3988
+ )) : x.height > 0 && (!c || w && !u) && a >= v.bottom - x.height && n?.y !== -1 && o >= v.left - s.x && o <= v.right + s.x && (g.y = w ? -1 : 1, y.y = r * Math.abs(
3989
3989
  (v.bottom - x.height - a) / x.height
3990
- )), x.width > 0 && (!f || b && !c) && o >= v.right - x.width && n?.x !== -1 && a >= v.top - s.y && a <= v.bottom + s.y ? (g.x = b ? -1 : 1, y.x = r * Math.abs(
3990
+ )), x.width > 0 && (!f || b && !d) && o >= v.right - x.width && n?.x !== -1 && a >= v.top - s.y && a <= v.bottom + s.y ? (g.x = b ? -1 : 1, y.x = r * Math.abs(
3991
3991
  (v.right - x.width - o) / x.width
3992
- )) : x.width > 0 && (!c || b && !f) && o <= v.left + x.width && n?.x !== 1 && a >= v.top - s.y && a <= v.bottom + s.y && (g.x = b ? 1 : -1, y.x = r * Math.abs(
3992
+ )) : x.width > 0 && (!d || b && !f) && o <= v.left + x.width && n?.x !== 1 && a >= v.top - s.y && a <= v.bottom + s.y && (g.x = b ? 1 : -1, y.x = r * Math.abs(
3993
3993
  (v.left + x.width - o) / x.width
3994
3994
  )), {
3995
3995
  direction: g,
@@ -4005,15 +4005,15 @@ function vu(e, { block: t = "nearest", inline: n = "nearest" } = {}) {
4005
4005
  continue;
4006
4006
  const { top: o, left: a } = Yg(e, s);
4007
4007
  let l = o, u = a;
4008
- for (const d of i)
4009
- l -= d.scrollTop, u -= d.scrollLeft;
4008
+ for (const c of i)
4009
+ l -= c.scrollTop, u -= c.scrollLeft;
4010
4010
  if (t !== "none") {
4011
- const d = l < s.scrollTop, c = l + e.offsetHeight > s.scrollTop + s.clientHeight;
4012
- d !== c && (t === "center" ? s.scrollTop = l - s.clientHeight / 2 + e.offsetHeight / 2 : d ? s.scrollTop = l : s.scrollTop = l + e.offsetHeight - s.clientHeight);
4011
+ const c = l < s.scrollTop, d = l + e.offsetHeight > s.scrollTop + s.clientHeight;
4012
+ c !== d && (t === "center" ? s.scrollTop = l - s.clientHeight / 2 + e.offsetHeight / 2 : c ? s.scrollTop = l : s.scrollTop = l + e.offsetHeight - s.clientHeight);
4013
4013
  }
4014
4014
  if (n !== "none") {
4015
- const d = u < s.scrollLeft, c = u + e.offsetWidth > s.scrollLeft + s.clientWidth;
4016
- d !== c && (n === "center" ? s.scrollLeft = u - s.clientWidth / 2 + e.offsetWidth / 2 : d ? s.scrollLeft = u : s.scrollLeft = u + e.offsetWidth - s.clientWidth);
4015
+ const c = u < s.scrollLeft, d = u + e.offsetWidth > s.scrollLeft + s.clientWidth;
4016
+ c !== d && (n === "center" ? s.scrollLeft = u - s.clientWidth / 2 + e.offsetWidth / 2 : c ? s.scrollLeft = u : s.scrollLeft = u + e.offsetWidth - s.clientWidth);
4017
4017
  }
4018
4018
  i.push(s);
4019
4019
  }
@@ -4037,24 +4037,24 @@ function Yg(e, t) {
4037
4037
  };
4038
4038
  }
4039
4039
  function Xg(e, t, n) {
4040
- const { scaleX: r, scaleY: i, x: s, y: o } = t, a = e.left + s + (1 - r) * parseFloat(n), l = e.top + o + (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), u = r ? e.width * r : e.width, d = i ? e.height * i : e.height;
4040
+ const { scaleX: r, scaleY: i, x: s, y: o } = t, a = e.left + s + (1 - r) * parseFloat(n), l = e.top + o + (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), u = r ? e.width * r : e.width, c = i ? e.height * i : e.height;
4041
4041
  return {
4042
4042
  width: u,
4043
- height: d,
4043
+ height: c,
4044
4044
  top: l,
4045
4045
  right: a + u,
4046
- bottom: l + d,
4046
+ bottom: l + c,
4047
4047
  left: a
4048
4048
  };
4049
4049
  }
4050
4050
  function Zg(e, t, n) {
4051
- const { scaleX: r, scaleY: i, x: s, y: o } = t, a = e.left - s - (1 - r) * parseFloat(n), l = e.top - o - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), u = r ? e.width / r : e.width, d = i ? e.height / i : e.height;
4051
+ const { scaleX: r, scaleY: i, x: s, y: o } = t, a = e.left - s - (1 - r) * parseFloat(n), l = e.top - o - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), u = r ? e.width / r : e.width, c = i ? e.height / i : e.height;
4052
4052
  return {
4053
4053
  width: u,
4054
- height: d,
4054
+ height: c,
4055
4055
  top: l,
4056
4056
  right: a + u,
4057
- bottom: l + d,
4057
+ bottom: l + c,
4058
4058
  left: a
4059
4059
  };
4060
4060
  }
@@ -4125,17 +4125,17 @@ var _t = class extends kt {
4125
4125
  } = t, u = tm(e, {
4126
4126
  properties: ["transform", "translate", "scale", "width", "height"],
4127
4127
  isValidTarget: (x) => (x !== e || La()) && x.contains(e)
4128
- }), d = l(e);
4129
- let { top: c, left: f, width: h, height: p } = d, m;
4128
+ }), c = l(e);
4129
+ let { top: d, left: f, width: h, height: p } = c, m;
4130
4130
  const b = Ot(e), w = bs(b), v = {
4131
4131
  x: (n = w?.scaleX) != null ? n : 1,
4132
4132
  y: (r = w?.scaleY) != null ? r : 1
4133
4133
  }, g = nm(e, b);
4134
4134
  u?.(), w && (m = Zg(
4135
- d,
4135
+ c,
4136
4136
  w,
4137
4137
  b.transformOrigin
4138
- ), (a || g) && (c = m.top, f = m.left, h = m.width, p = m.height));
4138
+ ), (a || g) && (d = m.top, f = m.left, h = m.width, p = m.height));
4139
4139
  const y = {
4140
4140
  width: (i = m?.width) != null ? i : h,
4141
4141
  height: (s = m?.height) != null ? s : p
@@ -4146,9 +4146,9 @@ var _t = class extends kt {
4146
4146
  g,
4147
4147
  b.transformOrigin
4148
4148
  );
4149
- c = x.top, f = x.left, h = x.width, p = x.height, v.x = g.scaleX, v.y = g.scaleY;
4149
+ d = x.top, f = x.left, h = x.width, p = x.height, v.x = g.scaleX, v.y = g.scaleY;
4150
4150
  }
4151
- o && (a || (f *= o.scaleX, h *= o.scaleX, c *= o.scaleY, p *= o.scaleY), f += o.x, c += o.y), super(f, c, h, p), this.scale = v, this.intrinsicWidth = y.width, this.intrinsicHeight = y.height;
4151
+ o && (a || (f *= o.scaleX, h *= o.scaleX, d *= o.scaleY, p *= o.scaleY), f += o.x, d += o.y), super(f, d, h, p), this.scale = v, this.intrinsicWidth = y.width, this.intrinsicHeight = y.height;
4152
4152
  }
4153
4153
  };
4154
4154
  function nm(e, t) {
@@ -4159,8 +4159,8 @@ function nm(e, t) {
4159
4159
  if (a.playState !== "running") continue;
4160
4160
  const l = vs(a.effect) ? a.effect.getKeyframes() : [], u = l[l.length - 1];
4161
4161
  if (!u) continue;
4162
- const { transform: d, translate: c, scale: f } = u;
4163
- typeof d == "string" && d && (r = d, o = !0), typeof c == "string" && c && (i = c, o = !0), typeof f == "string" && f && (s = f, o = !0);
4162
+ const { transform: c, translate: d, scale: f } = u;
4163
+ typeof c == "string" && c && (r = c, o = !0), typeof d == "string" && d && (i = d, o = !0), typeof f == "string" && f && (s = f, o = !0);
4164
4164
  }
4165
4165
  return o ? bs({
4166
4166
  transform: r ?? t.transform,
@@ -4277,11 +4277,11 @@ var Fa = ({
4277
4277
  const s = r ? kt.from(r.current.boundingRectangle).corners : void 0, a = kt.from(
4278
4278
  n.shape.boundingRectangle
4279
4279
  ).corners.reduce(
4280
- (l, u, d) => {
4281
- var c;
4280
+ (l, u, c) => {
4281
+ var d;
4282
4282
  return l + at.distance(
4283
4283
  at.from(u),
4284
- (c = s?.[d]) != null ? c : i.current
4284
+ (d = s?.[c]) != null ? d : i.current
4285
4285
  );
4286
4286
  },
4287
4287
  0
@@ -4316,15 +4316,15 @@ var Fa = ({
4316
4316
  for (var i = 0, s = e[t >> 1], o = s && s.length; i < o; i++) t & 1 ? s[i].call(n) : r = s[i].call(n, r);
4317
4317
  return r;
4318
4318
  }, ft = (e, t, n, r, i, s) => {
4319
- var o, a, l, u, d, c = t & 7, f = !!(t & 8), h = !!(t & 16), p = c > 3 ? e.length + 1 : c ? f ? 1 : 2 : 0, m = $u[c + 5], b = c > 3 && (e[p - 1] = []), w = e[p] || (e[p] = []), v = c && (!h && !f && (i = i.prototype), c < 5 && (c > 3 || !h) && um(c < 4 ? i : { get [n]() {
4319
+ var o, a, l, u, c, d = t & 7, f = !!(t & 8), h = !!(t & 16), p = d > 3 ? e.length + 1 : d ? f ? 1 : 2 : 0, m = $u[d + 5], b = d > 3 && (e[p - 1] = []), w = e[p] || (e[p] = []), v = d && (!h && !f && (i = i.prototype), d < 5 && (d > 3 || !h) && um(d < 4 ? i : { get [n]() {
4320
4320
  return _e(this, s);
4321
4321
  }, set [n](y) {
4322
4322
  return Ze(this, s, y);
4323
4323
  } }, n));
4324
- c ? h && c < 4 && Pl(s, (c > 2 ? "set " : c > 1 ? "get " : "") + n) : Pl(i, n);
4324
+ d ? h && d < 4 && Pl(s, (d > 2 ? "set " : d > 1 ? "get " : "") + n) : Pl(i, n);
4325
4325
  for (var g = r.length - 1; g >= 0; g--)
4326
- u = hm(c, n, l = {}, e[3], w), c && (u.static = f, u.private = h, d = u.access = { has: h ? (y) => pm(i, y) : (y) => n in y }, c ^ 3 && (d.get = h ? (y) => (c ^ 1 ? _e : un)(y, i, c ^ 4 ? s : v.get) : (y) => y[n]), c > 2 && (d.set = h ? (y, x) => Ze(y, i, x, c ^ 4 ? s : v.set) : (y, x) => y[n] = x)), a = (0, r[g])(c ? c < 4 ? h ? s : v[m] : c > 4 ? void 0 : { get: v.get, set: v.set } : i, u), l._ = 1, c ^ 4 || a === void 0 ? wr(a) && (c > 4 ? b.unshift(a) : c ? h ? s = a : v[m] = a : i = a) : typeof a != "object" || a === null ? er("Object expected") : (wr(o = a.get) && (v.get = o), wr(o = a.set) && (v.set = o), wr(o = a.init) && b.unshift(o));
4327
- return c || gn(e, i), v && Ba(i, n, v), h ? c ^ 4 ? s : v : i;
4326
+ u = hm(d, n, l = {}, e[3], w), d && (u.static = f, u.private = h, c = u.access = { has: h ? (y) => pm(i, y) : (y) => n in y }, d ^ 3 && (c.get = h ? (y) => (d ^ 1 ? _e : un)(y, i, d ^ 4 ? s : v.get) : (y) => y[n]), d > 2 && (c.set = h ? (y, x) => Ze(y, i, x, d ^ 4 ? s : v.set) : (y, x) => y[n] = x)), a = (0, r[g])(d ? d < 4 ? h ? s : v[m] : d > 4 ? void 0 : { get: v.get, set: v.set } : i, u), l._ = 1, d ^ 4 || a === void 0 ? wr(a) && (d > 4 ? b.unshift(a) : d ? h ? s = a : v[m] = a : i = a) : typeof a != "object" || a === null ? er("Object expected") : (wr(o = a.get) && (v.get = o), wr(o = a.set) && (v.set = o), wr(o = a.init) && b.unshift(o));
4327
+ return d || gn(e, i), v && Ba(i, n, v), h ? d ^ 4 ? s : v : i;
4328
4328
  }, Ga = (e, t, n) => t.has(e) || er("Cannot " + n), pm = (e, t) => Object(t) !== t ? er('Cannot use the "in" operator on this value') : e.has(t), _e = (e, t, n) => (Ga(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Re = (e, t, n) => t.has(e) ? er("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Ze = (e, t, n, r) => (Ga(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), un = (e, t, n) => (Ga(e, t, "access private method"), n), Ml = {
4329
4329
  role: "button",
4330
4330
  roleDescription: "draggable"
@@ -4369,7 +4369,7 @@ var _m = ["dragover", "dragmove"], km = class extends He {
4369
4369
  screenReaderInstructions: o = vm,
4370
4370
  debounce: a = 500
4371
4371
  } = t ?? {}, l = n ? `${r}-${n}` : Oo(r), u = n ? `${i}-${n}` : Oo(i);
4372
- let d, c, f, h;
4372
+ let c, d, f, h;
4373
4373
  const p = (x = h) => {
4374
4374
  !f || !x || f?.nodeValue !== x && (f.nodeValue = x);
4375
4375
  }, m = () => Yi.schedule(p), b = $m(
@@ -4387,10 +4387,10 @@ var _m = ["dragover", "dragmove"], km = class extends He {
4387
4387
  )
4388
4388
  ), v = () => {
4389
4389
  let x = [];
4390
- d?.isConnected || (d = wm(
4390
+ c?.isConnected || (c = wm(
4391
4391
  l,
4392
4392
  o.draggable
4393
- ), x.push(d)), c?.isConnected || (c = xm(u), f = document.createTextNode(""), c.appendChild(f), x.push(c)), x.length > 0 && document.body.append(...x);
4393
+ ), x.push(c)), d?.isConnected || (d = xm(u), f = document.createTextNode(""), d.appendChild(f), x.push(d)), x.length > 0 && document.body.append(...x);
4394
4394
  }, g = /* @__PURE__ */ new Set();
4395
4395
  function y() {
4396
4396
  for (const x of g)
@@ -4402,7 +4402,7 @@ var _m = ["dragover", "dragmove"], km = class extends He {
4402
4402
  for (const k of this.manager.registry.draggables.value) {
4403
4403
  const S = (x = k.handle) != null ? x : k.element;
4404
4404
  if (S) {
4405
- (!d || !c) && g.add(v), (!bm(S) || La()) && !S.hasAttribute("tabindex") && g.add(() => S.setAttribute("tabindex", "0")), !S.hasAttribute("role") && S.tagName.toLowerCase() !== "button" && g.add(
4405
+ (!c || !d) && g.add(v), (!bm(S) || La()) && !S.hasAttribute("tabindex") && g.add(() => S.setAttribute("tabindex", "0")), !S.hasAttribute("role") && S.tagName.toLowerCase() !== "button" && g.add(
4406
4406
  () => S.setAttribute("role", Ml.role)
4407
4407
  ), S.hasAttribute("aria-roledescription") || g.add(
4408
4408
  () => S.setAttribute(
@@ -4424,7 +4424,7 @@ var _m = ["dragover", "dragmove"], km = class extends He {
4424
4424
  }
4425
4425
  g.size > 0 && Yi.schedule(y);
4426
4426
  }), this.destroy = () => {
4427
- super.destroy(), d?.remove(), c?.remove(), w.forEach((x) => x());
4427
+ super.destroy(), c?.remove(), d?.remove(), w.forEach((x) => x());
4428
4428
  };
4429
4429
  }
4430
4430
  };
@@ -4705,13 +4705,13 @@ function Pm(e, t, n) {
4705
4705
  if (a === "style") {
4706
4706
  if (Dr(e) && Dr(t)) {
4707
4707
  const u = e.style;
4708
- for (const d of Array.from(t.style))
4709
- u.getPropertyValue(d) === "" && t.style.removeProperty(d);
4710
- for (const d of Array.from(u)) {
4711
- if (Tm.includes(d) || d.startsWith(qe))
4708
+ for (const c of Array.from(t.style))
4709
+ u.getPropertyValue(c) === "" && t.style.removeProperty(c);
4710
+ for (const c of Array.from(u)) {
4711
+ if (Tm.includes(c) || c.startsWith(qe))
4712
4712
  continue;
4713
- const c = u.getPropertyValue(d);
4714
- t.style.setProperty(d, c);
4713
+ const d = u.getPropertyValue(c);
4714
+ t.style.setProperty(c, d);
4715
4715
  }
4716
4716
  }
4717
4717
  } else l !== null ? t.setAttribute(a, l) : t.removeAttribute(a);
@@ -4768,10 +4768,10 @@ function Rm(e) {
4768
4768
  v.style.width = `${g.getBoundingClientRect().width}px`;
4769
4769
  }
4770
4770
  }
4771
- const u = (r = e.getTranslate()) != null ? r : { x: 0, y: 0 }, d = e.left + o + l.x + u.x, c = e.top + a + l.y + u.y, f = i.width - e.widthOffset, h = i.height - e.heightOffset, p = e.frameTransform;
4771
+ const u = (r = e.getTranslate()) != null ? r : { x: 0, y: 0 }, c = e.left + o + l.x + u.x, d = e.top + a + l.y + u.y, f = i.width - e.widthOffset, h = i.height - e.heightOffset, p = e.frameTransform;
4772
4772
  e.dragOperation.shape = new kt(
4773
- d * p.scaleX + p.x,
4774
- c * p.scaleY + p.y,
4773
+ c * p.scaleX + p.x,
4774
+ d * p.scaleY + p.y,
4775
4775
  f * p.scaleX,
4776
4776
  h * p.scaleY
4777
4777
  );
@@ -4805,27 +4805,27 @@ function zm(e) {
4805
4805
  (v) => "translate" in v
4806
4806
  )) != null ? t : [];
4807
4807
  l?.pause();
4808
- const u = (n = e.placeholder) != null ? n : e.element, d = {
4808
+ const u = (n = e.placeholder) != null ? n : e.element, c = {
4809
4809
  frameTransform: Pu(e.feedbackElement, u) ? null : void 0
4810
- }, c = new _t(e.feedbackElement, d), f = (r = Nr(Ot(e.feedbackElement).translate)) != null ? r : e.translate, h = new _t(u, d), p = kt.delta(c, h, e.alignment), m = {
4810
+ }, d = new _t(e.feedbackElement, c), f = (r = Nr(Ot(e.feedbackElement).translate)) != null ? r : e.translate, h = new _t(u, c), p = kt.delta(d, h, e.alignment), m = {
4811
4811
  x: f.x - p.x,
4812
4812
  y: f.y - p.y
4813
- }, b = Math.round(c.intrinsicHeight) !== Math.round(h.intrinsicHeight) ? {
4813
+ }, b = Math.round(d.intrinsicHeight) !== Math.round(h.intrinsicHeight) ? {
4814
4814
  minHeight: [
4815
- `${c.intrinsicHeight}px`,
4815
+ `${d.intrinsicHeight}px`,
4816
4816
  `${h.intrinsicHeight}px`
4817
4817
  ],
4818
4818
  maxHeight: [
4819
- `${c.intrinsicHeight}px`,
4819
+ `${d.intrinsicHeight}px`,
4820
4820
  `${h.intrinsicHeight}px`
4821
4821
  ]
4822
- } : {}, w = Math.round(c.intrinsicWidth) !== Math.round(h.intrinsicWidth) ? {
4822
+ } : {}, w = Math.round(d.intrinsicWidth) !== Math.round(h.intrinsicWidth) ? {
4823
4823
  minWidth: [
4824
- `${c.intrinsicWidth}px`,
4824
+ `${d.intrinsicWidth}px`,
4825
4825
  `${h.intrinsicWidth}px`
4826
4826
  ],
4827
4827
  maxWidth: [
4828
- `${c.intrinsicWidth}px`,
4828
+ `${d.intrinsicWidth}px`,
4829
4829
  `${h.intrinsicWidth}px`
4830
4830
  ]
4831
4831
  } : {};
@@ -4873,7 +4873,7 @@ Ru = function(e) {
4873
4873
  };
4874
4874
  Lu = function() {
4875
4875
  var e, t, n, r, i, s, o;
4876
- const { state: a, manager: l, options: u } = this, { dragOperation: d } = l, { position: c, source: f, status: h } = d;
4876
+ const { state: a, manager: l, options: u } = this, { dragOperation: c } = l, { position: d, source: f, status: h } = c;
4877
4877
  if (h.idle) {
4878
4878
  a.current = {}, a.initial = {};
4879
4879
  return;
@@ -4915,7 +4915,7 @@ Lu = function() {
4915
4915
  }
4916
4916
  }
4917
4917
  if (!v.transformOrigin) {
4918
- const xe = pe(() => c.current), Le = D + ((r = V?.x) != null ? r : 0), et = B + ((i = V?.y) != null ? i : 0);
4918
+ const xe = pe(() => d.current), Le = D + ((r = V?.x) != null ? r : 0), et = B + ((i = V?.y) != null ? i : 0);
4919
4919
  v.transformOrigin = {
4920
4920
  x: (xe.x - Le * y.scaleX - y.x) / ($ * y.scaleX),
4921
4921
  y: (xe.y - et * y.scaleY - y.y) / (E * y.scaleY)
@@ -4944,7 +4944,7 @@ Lu = function() {
4944
4944
  top: B + te.y
4945
4945
  };
4946
4946
  g.setAttribute(xt, "true");
4947
- const L = pe(() => d.transform), re = (s = v.translate) != null ? s : { x: 0, y: 0 }, de = L.x * y.scaleX + re.x, Ge = L.y * y.scaleY + re.y, Yt = lu();
4947
+ const L = pe(() => c.transform), re = (s = v.translate) != null ? s : { x: 0, y: 0 }, de = L.x * y.scaleX + re.x, Ge = L.y * y.scaleY + re.y, Yt = lu();
4948
4948
  N.set(
4949
4949
  {
4950
4950
  width: $ - I,
@@ -4974,7 +4974,7 @@ Lu = function() {
4974
4974
  heightOffset: ee,
4975
4975
  delta: te,
4976
4976
  styles: N,
4977
- dragOperation: d,
4977
+ dragOperation: c,
4978
4978
  getTranslate: () => a.current.translate,
4979
4979
  getElementMutationObserver: () => wt,
4980
4980
  getSavedCellWidths: () => At,
@@ -4982,7 +4982,7 @@ Lu = function() {
4982
4982
  At = xe;
4983
4983
  }
4984
4984
  }), oi = new _t(g);
4985
- pe(() => d.shape = oi);
4985
+ pe(() => c.shape = oi);
4986
4986
  const sr = it(g), Xt = (xe) => {
4987
4987
  this.manager.actions.stop({ event: xe });
4988
4988
  }, Zf = za(sr);
@@ -5013,7 +5013,7 @@ Lu = function() {
5013
5013
  vn.style.width = (Le = At[ai]) != null ? Le : "";
5014
5014
  }
5015
5015
  f.status = "idle";
5016
- const et = a.current.translate != null, Pt = d.status.dragging;
5016
+ const et = a.current.translate != null, Pt = c.status.dragging;
5017
5017
  H && (!Pt && et || H.parentElement !== g.parentElement) && g.isConnected && H.replaceWith(g), H?.remove();
5018
5018
  };
5019
5019
  g === this.overlay ? setTimeout(xe, 0) : xe();
@@ -5021,14 +5021,14 @@ Lu = function() {
5021
5021
  // Update transform on move
5022
5022
  () => {
5023
5023
  var xe, Le, et;
5024
- const { transform: Pt, status: Es } = d;
5024
+ const { transform: Pt, status: Es } = c;
5025
5025
  if (!(!Pt.x && !Pt.y && !a.current.translate) && Es.dragging) {
5026
5026
  const ai = (xe = v.translate) != null ? xe : { x: 0, y: 0 }, vn = {
5027
5027
  x: Pt.x / y.scaleX + ai.x,
5028
5028
  y: Pt.y / y.scaleY + ai.y
5029
- }, ul = a.current.translate, th = pe(() => d.modifiers), Cs = pe(() => {
5029
+ }, ul = a.current.translate, th = pe(() => c.modifiers), Cs = pe(() => {
5030
5030
  var ar;
5031
- return (ar = d.shape) == null ? void 0 : ar.current;
5031
+ return (ar = c.shape) == null ? void 0 : ar.current;
5032
5032
  }), or = u?.keyboardTransition, fl = le && !Zf && or !== null ? `${(Le = or?.duration) != null ? Le : 250}ms ${(et = or?.easing) != null ? et : "cubic-bezier(0.25, 1, 0.5, 1)"}` : "0ms linear";
5033
5033
  if (N.set(
5034
5034
  {
@@ -5038,20 +5038,20 @@ Lu = function() {
5038
5038
  qe
5039
5039
  ), wt?.takeRecords(), Cs && Cs !== oi && ul && !th.length) {
5040
5040
  const ar = at.delta(vn, ul);
5041
- d.shape = kt.from(
5041
+ c.shape = kt.from(
5042
5042
  Cs.boundingRectangle
5043
5043
  ).translate(
5044
5044
  ar.x * y.scaleX,
5045
5045
  ar.y * y.scaleY
5046
5046
  );
5047
5047
  } else
5048
- d.shape = new _t(g);
5048
+ c.shape = new _t(g);
5049
5049
  a.current.translate = vn;
5050
5050
  }
5051
5051
  },
5052
5052
  // Drop animation
5053
5053
  function() {
5054
- if (d.status.dropped) {
5054
+ if (c.status.dropped) {
5055
5055
  this.dispose(), f.status = "dropping";
5056
5056
  const xe = m?.dropAnimation !== void 0 ? m.dropAnimation : dl.dropAnimation !== void 0 ? dl.dropAnimation : Jf;
5057
5057
  let Le = a.current.translate;
@@ -5161,20 +5161,20 @@ var Bu, Ao, jr, Ya, Rt, Po, ei = class extends (Ao = Zr, Bu = [ge], Ao) {
5161
5161
  const l = this.getScrollableElements();
5162
5162
  if (!l)
5163
5163
  return Ze(this, Rt, void 0), !1;
5164
- const { position: u } = this.manager.dragOperation, d = u?.current;
5165
- if (d) {
5166
- const { by: c } = s ?? {}, f = c ? {
5167
- x: zl(c.x),
5168
- y: zl(c.y)
5164
+ const { position: u } = this.manager.dragOperation, c = u?.current;
5165
+ if (c) {
5166
+ const { by: d } = s ?? {}, f = d ? {
5167
+ x: zl(d.x),
5168
+ y: zl(d.y)
5169
5169
  } : void 0, h = f ? void 0 : this.scrollIntentTracker.current;
5170
5170
  if (h?.isLocked())
5171
5171
  return !1;
5172
5172
  for (const p of l) {
5173
- const m = Ng(p, c);
5173
+ const m = Ng(p, d);
5174
5174
  if (m.x || m.y) {
5175
5175
  const { speed: b, direction: w } = Hg(
5176
5176
  p,
5177
- d,
5177
+ c,
5178
5178
  f,
5179
5179
  o?.acceleration,
5180
5180
  o?.threshold
@@ -5183,7 +5183,7 @@ var Bu, Ao, jr, Ya, Rt, Po, ei = class extends (Ao = Zr, Bu = [ge], Ao) {
5183
5183
  for (const v of gd)
5184
5184
  h[v].isLocked(w[v]) && (b[v] = 0, w[v] = 0);
5185
5185
  if (w.x || w.y) {
5186
- const { x: v, y: g } = c ?? w, y = v * b.x, x = g * b.y;
5186
+ const { x: v, y: g } = d ?? w, y = v * b.x, x = g * b.y;
5187
5187
  if (y || x) {
5188
5188
  const k = (a = _e(this, Rt)) == null ? void 0 : a.by;
5189
5189
  if (this.autoScrolling && k && (k.x && !y || k.y && !x))
@@ -5279,14 +5279,14 @@ var jm = class {
5279
5279
  };
5280
5280
  if (r.scroll(void 0, u)) {
5281
5281
  r.autoScrolling = !0;
5282
- const c = setInterval(
5282
+ const d = setInterval(
5283
5283
  () => Gm.schedule(
5284
5284
  () => r.scroll(void 0, u)
5285
5285
  ),
5286
5286
  qm
5287
5287
  );
5288
5288
  return () => {
5289
- clearInterval(c);
5289
+ clearInterval(d);
5290
5290
  };
5291
5291
  } else
5292
5292
  r.autoScrolling = !1;
@@ -5605,13 +5605,13 @@ var Ro = Object.freeze({
5605
5605
  x: l * a.scaleX + a.x,
5606
5606
  y: u * a.scaleY + a.y
5607
5607
  };
5608
- const d = this.activationConstraints(t, n, r);
5608
+ const c = this.activationConstraints(t, n, r);
5609
5609
  t.sensor = this;
5610
- const c = new vg(
5611
- d,
5610
+ const d = new vg(
5611
+ c,
5612
5612
  (m) => this.handleStart(n, m)
5613
5613
  );
5614
- c.signal.onabort = () => this.handleCancel(t), c.onEvent(t), this.controller = c;
5614
+ d.signal.onabort = () => this.handleCancel(t), d.onEvent(t), this.controller = d;
5615
5615
  const f = xo(), h = this.listeners.bind(f, [
5616
5616
  {
5617
5617
  type: "pointermove",
@@ -5775,14 +5775,14 @@ var Rn = {
5775
5775
  var a, l;
5776
5776
  const { manager: u } = this;
5777
5777
  if (!u) return;
5778
- const c = ((l = (a = this.sensors) == null ? void 0 : a.map(Mr)) != null ? l : [
5778
+ const d = ((l = (a = this.sensors) == null ? void 0 : a.map(Mr)) != null ? l : [
5779
5779
  ...u.sensors
5780
5780
  ]).map((f) => {
5781
5781
  const h = f instanceof Wn ? f : u.registry.register(f.plugin), p = f instanceof Wn ? void 0 : f.options;
5782
5782
  return h.bind(this, p);
5783
5783
  });
5784
5784
  return function() {
5785
- c.forEach((h) => h());
5785
+ d.forEach((h) => h());
5786
5786
  };
5787
5787
  }
5788
5788
  ]
@@ -5801,13 +5801,13 @@ var Uu, Hu, zo, Bt, Qa, Fs, Yu, Xu, Pr, Ja, _s = class extends (zo = St, Hu = [g
5801
5801
  constructor(e, t) {
5802
5802
  var n = e, { element: r, effects: i = () => [] } = n, s = ku(n, ["element", "effects"]);
5803
5803
  const { collisionDetector: o = bu } = s, a = (u) => {
5804
- const { manager: d, element: c } = this;
5805
- if (!c || u === null) {
5804
+ const { manager: c, element: d } = this;
5805
+ if (!d || u === null) {
5806
5806
  this.shape = void 0;
5807
5807
  return;
5808
5808
  }
5809
- if (!d) return;
5810
- const f = new _t(c), h = pe(() => this.shape);
5809
+ if (!c) return;
5810
+ const f = new _t(d), h = pe(() => this.shape);
5811
5811
  return f && h?.equals(f) ? h : (this.shape = f, f);
5812
5812
  }, l = Kn(!1);
5813
5813
  super(
@@ -5816,20 +5816,20 @@ var Uu, Hu, zo, Bt, Qa, Fs, Yu, Xu, Pr, Ja, _s = class extends (zo = St, Hu = [g
5816
5816
  effects: () => [
5817
5817
  ...i(),
5818
5818
  () => {
5819
- const { element: u, manager: d } = this;
5820
- if (!d) return;
5821
- const { dragOperation: c } = d, { source: f } = c;
5822
- l.value = !!(f && c.status.initialized && u && !this.disabled && this.accepts(f));
5819
+ const { element: u, manager: c } = this;
5820
+ if (!c) return;
5821
+ const { dragOperation: d } = c, { source: f } = d;
5822
+ l.value = !!(f && d.status.initialized && u && !this.disabled && this.accepts(f));
5823
5823
  },
5824
5824
  () => {
5825
5825
  const { element: u } = this;
5826
5826
  if (l.value && u) {
5827
- const d = new Lg(
5827
+ const c = new Lg(
5828
5828
  u,
5829
5829
  a
5830
5830
  );
5831
5831
  return () => {
5832
- d.disconnect(), this.shape = void 0;
5832
+ c.disconnect(), this.shape = void 0;
5833
5833
  };
5834
5834
  }
5835
5835
  },
@@ -5886,8 +5886,8 @@ function Zu(e, t) {
5886
5886
  var i;
5887
5887
  let s = !1, o = !1;
5888
5888
  for (const a of n.current) {
5889
- const [l] = a, u = pe(() => a[1]), d = e[l];
5890
- u !== d && (s = !0, n.current.set(l, d), o = (i = t?.(l, u, d)) != null ? i : !1);
5889
+ const [l] = a, u = pe(() => a[1]), c = e[l];
5890
+ u !== c && (s = !0, n.current.set(l, c), o = (i = t?.(l, u, c)) != null ? i : !1);
5891
5891
  }
5892
5892
  s && (o ? queueMicrotask(() => ip(r)) : r());
5893
5893
  });
@@ -5985,11 +5985,11 @@ function uv(e) {
5985
5985
  "onDragOver",
5986
5986
  "onDragEnd"
5987
5987
  ]);
5988
- const d = J(null), {
5989
- plugins: c,
5988
+ const c = J(null), {
5989
+ plugins: d,
5990
5990
  modifiers: f,
5991
5991
  sensors: h
5992
- } = u, p = yt(c, Rn.plugins), m = yt(h, Rn.sensors), b = yt(
5992
+ } = u, p = yt(d, Rn.plugins), m = yt(h, Rn.sensors), b = yt(
5993
5993
  f,
5994
5994
  Rn.modifiers
5995
5995
  ), w = bn(i), v = bn(s), g = bn(a), y = bn(o), x = bn(l), k = bn(r), S = fv(() => {
@@ -5997,8 +5997,8 @@ function uv(e) {
5997
5997
  return (C = u.manager) != null ? C : new qu(u);
5998
5998
  });
5999
5999
  return ye(() => {
6000
- if (!d.current) throw new Error("Renderer not found");
6001
- const { renderer: C, trackRendering: $ } = d.current, { monitor: E } = S;
6000
+ if (!c.current) throw new Error("Renderer not found");
6001
+ const { renderer: C, trackRendering: $ } = c.current, { monitor: E } = S;
6002
6002
  S.renderer = C;
6003
6003
  const B = [
6004
6004
  E.addEventListener("beforedragstart", (D) => {
@@ -6046,7 +6046,7 @@ function uv(e) {
6046
6046
  () => S && (S.modifiers = b),
6047
6047
  ...Bs
6048
6048
  ), /* @__PURE__ */ K(ef.Provider, { value: S, children: [
6049
- /* @__PURE__ */ _(dv, { ref: d, children: n }),
6049
+ /* @__PURE__ */ _(dv, { ref: c, children: n }),
6050
6050
  n
6051
6051
  ] });
6052
6052
  }
@@ -6074,8 +6074,8 @@ var pv = Object.create, nf = Object.defineProperty, gv = Object.getOwnPropertyDe
6074
6074
  for (var i = 0, s = e[t >> 1], o = s && s.length; i < o; i++) s[i].call(n);
6075
6075
  return r;
6076
6076
  }, af = (e, t, n, r, i, s) => {
6077
- for (var o, a, l, u, d = t & 7, c = !1, f = !1, h = 2, p = sf[d + 5], m = e[h] || (e[h] = []), b = (i = i.prototype, gv(i, n)), w = r.length - 1; w >= 0; w--)
6078
- l = yv(d, n, a = {}, e[3], m), l.static = c, l.private = f, u = l.access = { has: (v) => n in v }, u.get = (v) => v[n], o = (0, r[w])(b[p], l), a._ = 1, of(o) && (b[p] = o);
6077
+ for (var o, a, l, u, c = t & 7, d = !1, f = !1, h = 2, p = sf[c + 5], m = e[h] || (e[h] = []), b = (i = i.prototype, gv(i, n)), w = r.length - 1; w >= 0; w--)
6078
+ l = yv(c, n, a = {}, e[3], m), l.static = d, l.private = f, u = l.access = { has: (v) => n in v }, u.get = (v) => v[n], o = (0, r[w])(b[p], l), a._ = 1, of(o) && (b[p] = o);
6079
6079
  return b && nf(i, n, b), i;
6080
6080
  }, lf = (e, t, n) => t.has(e) || ks("Cannot " + n), xv = (e, t, n) => (lf(e, t, "read from private field"), t.get(e)), _v = (e, t, n) => t.has(e) ? ks("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), kv = (e, t, n, r) => (lf(e, t, "write to private field"), t.set(e, n), n), ln = class Wo {
6081
6081
  /**
@@ -6202,15 +6202,15 @@ var $v = ({
6202
6202
  };
6203
6203
  function Tv(e) {
6204
6204
  const { collisionDetector: t, data: n, disabled: r, element: i, id: s, accept: o, type: a } = e, l = tf(
6205
- (d) => new _s(
6205
+ (c) => new _s(
6206
6206
  av(ov({}, e), {
6207
6207
  register: !1,
6208
6208
  element: Ln(i)
6209
6209
  }),
6210
- d
6210
+ c
6211
6211
  )
6212
6212
  ), u = Zu(l);
6213
- return Ee(s, () => l.id = s), Mi(i, (d) => l.element = d), Ee(
6213
+ return Ee(s, () => l.id = s), Mi(i, (c) => l.element = c), Ee(
6214
6214
  o,
6215
6215
  () => l.accept = o,
6216
6216
  void 0,
@@ -6224,9 +6224,9 @@ function Tv(e) {
6224
6224
  return u.isDropTarget;
6225
6225
  },
6226
6226
  ref: he(
6227
- (d) => {
6228
- var c, f;
6229
- !d && ((c = l.element) != null && c.isConnected) && !((f = l.manager) != null && f.dragOperation.status.idle) || (l.element = d ?? void 0);
6227
+ (c) => {
6228
+ var d, f;
6229
+ !c && ((d = l.element) != null && d.isConnected) && !((f = l.manager) != null && f.dragOperation.status.idle) || (l.element = c ?? void 0);
6230
6230
  },
6231
6231
  [l]
6232
6232
  )
@@ -6302,20 +6302,20 @@ function Bo({
6302
6302
  l.current || o === void 0 || (a(void 0), o !== e && r(o));
6303
6303
  };
6304
6304
  pf(o !== void 0 && o !== e, () => (u(), !0));
6305
- const d = () => {
6305
+ const c = () => {
6306
6306
  l.current = !1, a(e);
6307
6307
  };
6308
6308
  if (o === void 0) {
6309
- const c = e === "", f = c && i;
6309
+ const d = e === "", f = d && i;
6310
6310
  return /* @__PURE__ */ _(
6311
6311
  ze,
6312
6312
  {
6313
6313
  component: "button",
6314
6314
  type: "button",
6315
6315
  className: f ? "builder-affordance" : void 0,
6316
- onClick: d,
6316
+ onClick: c,
6317
6317
  onKeyDown: (h) => {
6318
- h.key !== "Enter" && h.key !== " " || (h.preventDefault(), d());
6318
+ h.key !== "Enter" && h.key !== " " || (h.preventDefault(), c());
6319
6319
  },
6320
6320
  sx: [
6321
6321
  {
@@ -6327,14 +6327,14 @@ function Bo({
6327
6327
  maxWidth: "100%",
6328
6328
  // An empty slot says what it is for, faintly; a tile's
6329
6329
  // own slot shows only while that tile is hovered.
6330
- ...c && {
6330
+ ...d && {
6331
6331
  fontStyle: "italic",
6332
6332
  opacity: f ? 0 : 0.6
6333
6333
  }
6334
6334
  },
6335
6335
  ff(s)
6336
6336
  ],
6337
- children: c ? t : e
6337
+ children: d ? t : e
6338
6338
  }
6339
6339
  );
6340
6340
  }
@@ -6346,10 +6346,10 @@ function Bo({
6346
6346
  value: o,
6347
6347
  placeholder: t,
6348
6348
  inputProps: { "aria-label": n },
6349
- onFocus: (c) => c.target.select(),
6350
- onChange: (c) => a(c.target.value),
6351
- onKeyDown: (c) => {
6352
- c.key === "Enter" && !c.nativeEvent.isComposing ? u() : c.key === "Escape" && (l.current = !0, a(void 0));
6349
+ onFocus: (d) => d.target.select(),
6350
+ onChange: (d) => a(d.target.value),
6351
+ onKeyDown: (d) => {
6352
+ d.key === "Enter" && !d.nativeEvent.isComposing ? u() : d.key === "Escape" && (l.current = !0, a(void 0));
6353
6353
  },
6354
6354
  onBlur: u,
6355
6355
  sx: { font: "inherit", color: "inherit", p: 0, "& input": { p: 0 } }
@@ -6416,12 +6416,12 @@ var Dv = Object.create, vf = Object.defineProperty, Av = Object.defineProperties
6416
6416
  for (var i = 0, s = e[t >> 1], o = s && s.length; i < o; i++) t & 1 ? s[i].call(n) : r = s[i].call(n, r);
6417
6417
  return r;
6418
6418
  }, xf = (e, t, n, r, i, s) => {
6419
- for (var o, a, l, u, d, c = t & 7, f = !1, h = !1, p = e.length + 1, m = wf[c + 5], b = e[p - 1] = [], w = e[p] || (e[p] = []), v = (i = i.prototype, Pv({ get [n]() {
6419
+ for (var o, a, l, u, c, d = t & 7, f = !1, h = !1, p = e.length + 1, m = wf[d + 5], b = e[p - 1] = [], w = e[p] || (e[p] = []), v = (i = i.prototype, Pv({ get [n]() {
6420
6420
  return $r(this, s);
6421
6421
  }, set [n](y) {
6422
6422
  return an(this, s, y);
6423
6423
  } }, n)), g = r.length - 1; g >= 0; g--)
6424
- u = zv(c, n, l = {}, e[3], w), u.static = f, u.private = h, d = u.access = { has: (y) => n in y }, d.get = (y) => y[n], d.set = (y, x) => y[n] = x, a = (0, r[g])({ get: v.get, set: v.set }, u), l._ = 1, a === void 0 ? kr(a) && (v[m] = a) : typeof a != "object" || a === null ? ni("Object expected") : (kr(o = a.get) && (v.get = o), kr(o = a.set) && (v.set = o), kr(o = a.init) && b.unshift(o));
6424
+ u = zv(d, n, l = {}, e[3], w), u.static = f, u.private = h, c = u.access = { has: (y) => n in y }, c.get = (y) => y[n], c.set = (y, x) => y[n] = x, a = (0, r[g])({ get: v.get, set: v.set }, u), l._ = 1, a === void 0 ? kr(a) && (v[m] = a) : typeof a != "object" || a === null ? ni("Object expected") : (kr(o = a.get) && (v.get = o), kr(o = a.set) && (v.set = o), kr(o = a.init) && b.unshift(o));
6425
6425
  return v && vf(i, n, v), i;
6426
6426
  }, _f = (e, t, n) => t.has(e) || ni("Cannot " + n), $r = (e, t, n) => (_f(e, t, "read from private field"), t.get(e)), cr = (e, t, n) => t.has(e) ? ni("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), an = (e, t, n, r) => (_f(e, t, "write to private field"), t.set(e, n), n);
6427
6427
  function cn(e) {
@@ -6449,17 +6449,17 @@ var gi = 10, Fv = class extends He {
6449
6449
  const { actions: o, collisionObserver: a, registry: l } = i, { by: u } = r;
6450
6450
  if (!u)
6451
6451
  return;
6452
- const d = Bv(u), { source: c, target: f } = s, { center: h } = s.shape.current, p = [], m = [];
6452
+ const c = Bv(u), { source: d, target: f } = s, { center: h } = s.shape.current, p = [], m = [];
6453
6453
  Ie(() => {
6454
6454
  for (const x of l.droppables) {
6455
6455
  const { id: k } = x;
6456
- if (!x.accepts(c) || k === f?.id && cn(x) || !x.element)
6456
+ if (!x.accepts(d) || k === f?.id && cn(x) || !x.element)
6457
6457
  continue;
6458
6458
  let S = x.shape;
6459
6459
  const C = new _t(x.element, {
6460
6460
  getBoundingClientRect: ($) => Lr($, void 0, 0.2)
6461
6461
  });
6462
- !C.height || !C.width || (d == "down" && h.y + gi < C.center.y || d == "up" && h.y - gi > C.center.y || d == "left" && h.x - gi > C.center.x || d == "right" && h.x + gi < C.center.x) && (p.push(x), x.shape = C, m.push(() => x.shape = S));
6462
+ !C.height || !C.width || (c == "down" && h.y + gi < C.center.y || c == "up" && h.y - gi > C.center.y || c == "left" && h.x - gi > C.center.x || c == "right" && h.x + gi < C.center.x) && (p.push(x), x.shape = C, m.push(() => x.shape = S));
6463
6463
  }
6464
6464
  }), r.preventDefault(), a.disable();
6465
6465
  const b = a.computeCollisions(
@@ -6470,7 +6470,7 @@ var gi = 10, Fv = class extends He {
6470
6470
  const [w] = b;
6471
6471
  if (!w)
6472
6472
  return;
6473
- const { id: v } = w, { index: g, group: y } = c.sortable;
6473
+ const { id: v } = w, { index: g, group: y } = d.sortable;
6474
6474
  o.setDropTarget(v).then(() => {
6475
6475
  const { source: x, target: k, shape: S } = s;
6476
6476
  if (!x || !cn(x) || !S)
@@ -6557,11 +6557,11 @@ function Hv(e, t, n) {
6557
6557
  return n(e, g, y);
6558
6558
  }
6559
6559
  const u = Object.entries(e);
6560
- let d = -1, c, f = -1, h;
6560
+ let c = -1, d, f = -1, h;
6561
6561
  for (const [g, y] of u)
6562
- if (d === -1 && (d = y.findIndex((x) => l(x, s.id)), d !== -1 && (c = g)), f === -1 && (f = y.findIndex((x) => l(x, o.id)), f !== -1 && (h = g)), d !== -1 && f !== -1)
6562
+ if (c === -1 && (c = y.findIndex((x) => l(x, s.id)), c !== -1 && (d = g)), f === -1 && (f = y.findIndex((x) => l(x, o.id)), f !== -1 && (h = g)), c !== -1 && f !== -1)
6563
6563
  break;
6564
- if (d === -1 && qs(s)) {
6564
+ if (c === -1 && qs(s)) {
6565
6565
  const g = s.initialGroup == null ? void 0 : mi(e, s.initialGroup), y = s.initialIndex, x = s.group == null ? void 0 : mi(e, s.group), k = s.index;
6566
6566
  if (g == null || x == null || g === x && y === k)
6567
6567
  return "preventDefault" in t && t.preventDefault(), e;
@@ -6591,25 +6591,25 @@ function Hv(e, t, n) {
6591
6591
  h = g, f = y;
6592
6592
  }
6593
6593
  }
6594
- if (c == null || h == null || c === h && d === f) {
6595
- if (c != null && c === h && d === f && qs(s)) {
6596
- const g = s.group == null ? void 0 : mi(e, s.group), y = s.group != null && g !== c, x = s.index !== d;
6594
+ if (d == null || h == null || d === h && c === f) {
6595
+ if (d != null && d === h && c === f && qs(s)) {
6596
+ const g = s.group == null ? void 0 : mi(e, s.group), y = s.group != null && g !== d, x = s.index !== c;
6597
6597
  if (y || x) {
6598
- const k = s.group == null ? c : g;
6598
+ const k = s.group == null ? d : g;
6599
6599
  if (k != null) {
6600
- if (c === k)
6600
+ if (d === k)
6601
6601
  return xn(wn({}, e), {
6602
- [c]: n(
6603
- e[c],
6604
- d,
6602
+ [d]: n(
6603
+ e[d],
6604
+ c,
6605
6605
  s.index
6606
6606
  )
6607
6607
  });
6608
- const S = e[c][d];
6608
+ const S = e[d][c];
6609
6609
  return xn(wn({}, e), {
6610
- [c]: [
6611
- ...e[c].slice(0, d),
6612
- ...e[c].slice(d + 1)
6610
+ [d]: [
6611
+ ...e[d].slice(0, c),
6612
+ ...e[d].slice(c + 1)
6613
6613
  ],
6614
6614
  [k]: [
6615
6615
  ...e[k].slice(0, s.index),
@@ -6622,15 +6622,15 @@ function Hv(e, t, n) {
6622
6622
  }
6623
6623
  return "preventDefault" in t && t.preventDefault(), e;
6624
6624
  }
6625
- if (c === h)
6625
+ if (d === h)
6626
6626
  return xn(wn({}, e), {
6627
- [c]: n(e[c], d, f)
6627
+ [d]: n(e[d], c, f)
6628
6628
  });
6629
- const w = o.shape && Math.round(m.y) > Math.round(o.shape.center.y) ? 1 : 0, v = e[c][d];
6629
+ const w = o.shape && Math.round(m.y) > Math.round(o.shape.center.y) ? 1 : 0, v = e[d][c];
6630
6630
  return xn(wn({}, e), {
6631
- [c]: [
6632
- ...e[c].slice(0, d),
6633
- ...e[c].slice(d + 1)
6631
+ [d]: [
6632
+ ...e[d].slice(0, c),
6633
+ ...e[d].slice(c + 1)
6634
6634
  ],
6635
6635
  [h]: [
6636
6636
  ...e[h].slice(0, f + w),
@@ -6678,17 +6678,17 @@ var Ul = "__default__", Xv = class extends He {
6678
6678
  const { dragOperation: s } = i, { source: o, target: a } = s;
6679
6679
  if (!cn(o) || !cn(a) || o.sortable === a.sortable)
6680
6680
  return;
6681
- const l = t(), u = Kl(l), d = o.sortable.group === a.sortable.group, c = l.get(o.sortable.group), f = d ? c : l.get(a.sortable.group);
6682
- !c || !f || queueMicrotask(() => {
6681
+ const l = t(), u = Kl(l), c = o.sortable.group === a.sortable.group, d = l.get(o.sortable.group), f = c ? d : l.get(a.sortable.group);
6682
+ !d || !f || queueMicrotask(() => {
6683
6683
  r.defaultPrevented || i.renderer.rendering.then(() => {
6684
6684
  var h, p;
6685
6685
  const m = t();
6686
6686
  if (Vl(u, l, m))
6687
6687
  return;
6688
6688
  const b = o.sortable.element, w = a.sortable.element;
6689
- if (!w || !b || !d && a.id === o.sortable.group)
6689
+ if (!w || !b || !c && a.id === o.sortable.group)
6690
6690
  return;
6691
- const v = vi(c), g = d ? v : vi(f), y = (h = o.sortable.group) != null ? h : Ul, x = (p = a.sortable.group) != null ? p : Ul, k = {
6691
+ const v = vi(d), g = c ? v : vi(f), y = (h = o.sortable.group) != null ? h : Ul, x = (p = a.sortable.group) != null ? p : Ul, k = {
6692
6692
  [y]: v,
6693
6693
  [x]: g
6694
6694
  }, S = Yv(k, r);
@@ -6697,7 +6697,7 @@ var Ul = "__default__", Xv = class extends He {
6697
6697
  i.collisionObserver.disable(), Hl(b, C, w, $), Ie(() => {
6698
6698
  for (const [E, B] of S[y].entries())
6699
6699
  B.index = E;
6700
- if (!d)
6700
+ if (!c)
6701
6701
  for (const [E, B] of S[x].entries())
6702
6702
  B.group = a.sortable.group, B.index = E;
6703
6703
  }), i.actions.setDropTarget(o.id).then(() => i.collisionObserver.enable());
@@ -6713,13 +6713,13 @@ var Ul = "__default__", Xv = class extends He {
6713
6713
  o.sortable.initialGroup
6714
6714
  );
6715
6715
  u && i.renderer.rendering.then(() => {
6716
- const d = t();
6717
- if (Vl(l, a, d))
6716
+ const c = t();
6717
+ if (Vl(l, a, c))
6718
6718
  return;
6719
- const c = vi(u), f = vi(
6719
+ const d = vi(u), f = vi(
6720
6720
  u,
6721
6721
  Qv
6722
- ), h = o.sortable.element, p = f.indexOf(o.sortable), m = c[p], b = m?.element;
6722
+ ), h = o.sortable.element, p = f.indexOf(o.sortable), m = d[p], b = m?.element;
6723
6723
  !m || !b || !h || (Hl(h, m.index, b, o.index), Ie(() => {
6724
6724
  for (const w of a.values()) {
6725
6725
  const v = Array.from(w).values();
@@ -6793,8 +6793,8 @@ var $s = class {
6793
6793
  sensors: a,
6794
6794
  type: l,
6795
6795
  transition: u = kf,
6796
- plugins: d
6797
- } = n, c = Lv(n, [
6796
+ plugins: c
6797
+ } = n, d = Lv(n, [
6798
6798
  "effects",
6799
6799
  "disabled",
6800
6800
  "group",
@@ -6804,13 +6804,13 @@ var $s = class {
6804
6804
  "transition",
6805
6805
  "plugins"
6806
6806
  ]);
6807
- const f = yt(d, Yl), h = Xl(i);
6807
+ const f = yt(c, Yl), h = Xl(i);
6808
6808
  this.droppable = new rl(
6809
- Gs(js({}, c), { disabled: h.droppable }),
6809
+ Gs(js({}, d), { disabled: h.droppable }),
6810
6810
  t,
6811
6811
  this
6812
6812
  ), this.draggable = new Of(
6813
- Gs(js({}, c), {
6813
+ Gs(js({}, d), {
6814
6814
  disabled: h.draggable,
6815
6815
  plugins: f,
6816
6816
  effects: () => [
@@ -6842,7 +6842,7 @@ var $s = class {
6842
6842
  }),
6843
6843
  t,
6844
6844
  this
6845
- ), an(this, In, c.element), this.manager = t, this.index = o, an(this, Or, o), this.group = s, an(this, Sr, s), this.type = l, this.transition = u;
6845
+ ), an(this, In, d.element), this.manager = t, this.index = o, an(this, Or, o), this.group = s, an(this, Sr, s), this.type = l, this.transition = u;
6846
6846
  }
6847
6847
  get initialIndex() {
6848
6848
  var e, t;
@@ -6861,8 +6861,8 @@ var $s = class {
6861
6861
  const { element: i } = this;
6862
6862
  if (!i)
6863
6863
  return;
6864
- for (const d of i.getAnimations())
6865
- "transitionProperty" in d && (d.transitionProperty === "transform" || d.transitionProperty === "translate" || d.transitionProperty === "scale") && d.cancel();
6864
+ for (const c of i.getAnimations())
6865
+ "transitionProperty" in c && (c.transitionProperty === "transform" || c.transitionProperty === "translate" || c.transitionProperty === "scale") && c.cancel();
6866
6866
  const s = this.refreshShape();
6867
6867
  if (!s)
6868
6868
  return;
@@ -6871,7 +6871,7 @@ var $s = class {
6871
6871
  y: n.boundingRectangle.top - s.boundingRectangle.top
6872
6872
  }, { translate: a } = Ot(i), l = Al(i, a, !1), u = Al(i, a);
6873
6873
  if (o.x || o.y) {
6874
- const d = za(it(i)) ? Gs(js({}, t), { duration: 0 }) : t;
6874
+ const c = za(it(i)) ? Gs(js({}, t), { duration: 0 }) : t;
6875
6875
  yu({
6876
6876
  element: i,
6877
6877
  keyframes: {
@@ -6880,7 +6880,7 @@ var $s = class {
6880
6880
  `${u.x}px ${u.y}px ${u.z}`
6881
6881
  ]
6882
6882
  },
6883
- options: d
6883
+ options: c
6884
6884
  }).then(() => {
6885
6885
  e.dragOperation.status.dragging || (this.droppable.shape = void 0);
6886
6886
  });
@@ -7064,8 +7064,8 @@ function sy(e) {
7064
7064
  handle: a,
7065
7065
  index: l,
7066
7066
  group: u,
7067
- disabled: d,
7068
- modifiers: c,
7067
+ disabled: c,
7068
+ modifiers: d,
7069
7069
  sensors: f,
7070
7070
  target: h,
7071
7071
  type: p,
@@ -7097,8 +7097,8 @@ function sy(e) {
7097
7097
  },
7098
7098
  nv
7099
7099
  ), Mi(a, (g) => w.handle = g), Mi(o, (g) => w.element = g), Mi(h, (g) => w.target = g), Ee(
7100
- d,
7101
- () => w.disabled = d ?? !1,
7100
+ c,
7101
+ () => w.disabled = c ?? !1,
7102
7102
  void 0,
7103
7103
  pt
7104
7104
  ), Ee(
@@ -7123,8 +7123,8 @@ function sy(e) {
7123
7123
  void 0,
7124
7124
  pt
7125
7125
  ), Ee(
7126
- c,
7127
- () => w.modifiers = c,
7126
+ d,
7127
+ () => w.modifiers = d,
7128
7128
  void 0,
7129
7129
  pt
7130
7130
  ), Ee(
@@ -7450,11 +7450,11 @@ function Ko(e, t) {
7450
7450
  if (!n) return;
7451
7451
  const r = [], i = [];
7452
7452
  for (const u of qr(t, Te.queryStatement)) {
7453
- const d = e.positioned(u);
7454
- d && r.push(d);
7455
- const c = Me(u, "whereStatement");
7456
- if (c && Te.whereStatement(c)) {
7457
- const f = Pf(e, c);
7453
+ const c = e.positioned(u);
7454
+ c && r.push(c);
7455
+ const d = Me(u, "whereStatement");
7456
+ if (d && Te.whereStatement(d)) {
7457
+ const f = Pf(e, d);
7458
7458
  f && i.push(f);
7459
7459
  }
7460
7460
  }
@@ -7516,8 +7516,8 @@ function by(e, t) {
7516
7516
  fromSpan: f
7517
7517
  } : { kind: "unsupported", why: "an unreadable refinement" };
7518
7518
  }
7519
- const u = e.text.slice(l.start, l.end), d = Me(o, "queryProperties"), c = d && Ko(e, d);
7520
- return c ? { kind: "reference", from: u, fromSpan: l, refinement: c } : { kind: "reference", from: u, fromSpan: l };
7519
+ const u = e.text.slice(l.start, l.end), c = Me(o, "queryProperties"), d = c && Ko(e, c);
7520
+ return d ? { kind: "reference", from: u, fromSpan: l, refinement: d } : { kind: "reference", from: u, fromSpan: l };
7521
7521
  }
7522
7522
  return { kind: "unsupported", why: "a parenthesized expression" };
7523
7523
  }
@@ -7528,9 +7528,9 @@ function wy(e, t) {
7528
7528
  if (!i || !s) continue;
7529
7529
  const o = Ht(s, "exploreQueryDef").filter(Te.exploreQueryDef), a = e.terminal(Me(r, "VIEW"));
7530
7530
  for (const l of o) {
7531
- const u = e.span(l), d = Me(l, "exploreQueryNameDef"), c = e.text_(d), f = Me(l, "vExpr");
7532
- !u || !c || !f || n.push({
7533
- name: c,
7531
+ const u = e.span(l), c = Me(l, "exploreQueryNameDef"), d = e.text_(c), f = Me(l, "vExpr");
7532
+ !u || !d || !f || n.push({
7533
+ name: d,
7534
7534
  span: u,
7535
7535
  line: e.line(u.start),
7536
7536
  statement: i,
@@ -7549,10 +7549,10 @@ function xy(e, t) {
7549
7549
  if (!i || !s) continue;
7550
7550
  const o = e.terminal(Me(r, "DIMENSION"));
7551
7551
  for (const a of Ht(s, "fieldDef")) {
7552
- const l = e.span(a), u = e.text_(Me(a, "fieldNameDef"))?.trim(), d = e.text_(Me(a, "fieldExpr"))?.trim();
7553
- !l || !u || d === void 0 || n.push({
7552
+ const l = e.span(a), u = e.text_(Me(a, "fieldNameDef"))?.trim(), c = e.text_(Me(a, "fieldExpr"))?.trim();
7553
+ !l || !u || c === void 0 || n.push({
7554
7554
  name: u,
7555
- expression: d,
7555
+ expression: c,
7556
7556
  span: l,
7557
7557
  line: e.line(l.start),
7558
7558
  statement: i,
@@ -7567,12 +7567,12 @@ function _y(e, t) {
7567
7567
  for (const r of ri(t, Te.sourceDefinition)) {
7568
7568
  const i = e.span(r), s = e.text_(Me(r, "sourceNameDef")), o = Me(r, "sqExplore");
7569
7569
  if (!i || !s || !o) continue;
7570
- const a = e.span(o), l = a ? e.text.slice(a.start, a.end) : "", u = (/^\s*(`[^`]*`|[A-Za-z_][A-Za-z0-9_.]*)/.exec(l)?.[1] ?? "").trim(), d = qr(o, Te.exploreProperties)[0], c = d && Ko(e, d), f = {
7570
+ const a = e.span(o), l = a ? e.text.slice(a.start, a.end) : "", u = (/^\s*(`[^`]*`|[A-Za-z_][A-Za-z0-9_.]*)/.exec(l)?.[1] ?? "").trim(), c = qr(o, Te.exploreProperties)[0], d = c && Ko(e, c), f = {
7571
7571
  start: e.lineStarts[e.line(i.start)],
7572
7572
  end: i.end
7573
7573
  }, h = [];
7574
- if (d)
7575
- for (const p of qr(d, Te.whereStatement)) {
7574
+ if (c)
7575
+ for (const p of qr(c, Te.whereStatement)) {
7576
7576
  const m = Pf(e, p);
7577
7577
  m && h.push(m);
7578
7578
  }
@@ -7582,9 +7582,9 @@ function _y(e, t) {
7582
7582
  span: i,
7583
7583
  line: e.line(i.start),
7584
7584
  statement: f,
7585
- ...c ? { properties: c } : {},
7586
- views: d ? wy(e, d) : [],
7587
- dimensions: d ? xy(e, d) : [],
7585
+ ...d ? { properties: d } : {},
7586
+ views: c ? wy(e, c) : [],
7587
+ dimensions: c ? xy(e, c) : [],
7588
7588
  wheres: h
7589
7589
  });
7590
7590
  }
@@ -7595,16 +7595,16 @@ function ky(e, t) {
7595
7595
  for (const r of ri(t, Te.givenStatement)) {
7596
7596
  const i = e.terminal(Me(r, "GIVEN")), s = Me(r, "givenDefList"), o = i ? e.line(i.start) : void 0;
7597
7597
  for (const a of s ? Ht(s, "givenDef") : []) {
7598
- const l = e.span(a), u = e.span(Me(a, "givenNameDef")), d = u && e.text.slice(u.start, u.end);
7599
- if (!l || !u || !d) continue;
7600
- const c = { start: u.start, end: l.end }, f = e.line(c.start);
7598
+ const l = e.span(a), u = e.span(Me(a, "givenNameDef")), c = u && e.text.slice(u.start, u.end);
7599
+ if (!l || !u || !c) continue;
7600
+ const d = { start: u.start, end: l.end }, f = e.line(d.start);
7601
7601
  n.push({
7602
- name: d,
7603
- declaration: e.text.slice(c.start, c.end),
7604
- span: c,
7602
+ name: c,
7603
+ declaration: e.text.slice(d.start, d.end),
7604
+ span: d,
7605
7605
  line: f,
7606
- statement: { start: e.lineStarts[f], end: c.end },
7607
- tags: il(e, l, c.start),
7606
+ statement: { start: e.lineStarts[f], end: d.end },
7607
+ tags: il(e, l, d.start),
7608
7608
  ...o !== void 0 && o !== f ? { blockHeader: o } : {}
7609
7609
  });
7610
7610
  }
@@ -7655,12 +7655,12 @@ async function Mf(e) {
7655
7655
  const a = new Os(e), l = sl(a, s);
7656
7656
  a.commentLines = l.lines;
7657
7657
  const u = e.split(`
7658
- `), d = (f) => l.lines.has(f);
7659
- a.proseLines = Zh(u, d), a.blocks = Qh(u, d).filter(
7658
+ `), c = (f) => l.lines.has(f);
7659
+ a.proseLines = Zh(u, c), a.blocks = Qh(u, c).filter(
7660
7660
  ([f]) => !u[f].trimStart().startsWith("##")
7661
7661
  );
7662
- const c = _y(a, i);
7663
- return c.length === 0 && /^\s*source:/m.test(e) ? {
7662
+ const d = _y(a, i);
7663
+ return d.length === 0 && /^\s*source:/m.test(e) ? {
7664
7664
  ok: !1,
7665
7665
  reason: `The builder could not locate this file's sources in Malloy's parse tree (malloy ${r?.malloyVersion ?? "unknown"}), so editing is off.`
7666
7666
  } : {
@@ -7669,7 +7669,7 @@ async function Mf(e) {
7669
7669
  text: e,
7670
7670
  lineStarts: a.lineStarts,
7671
7671
  imports: $y(a, i),
7672
- sources: c,
7672
+ sources: d,
7673
7673
  givens: ky(a, i),
7674
7674
  textBlocks: Oy(a, s),
7675
7675
  modelNotes: Af(a, i),
@@ -7695,11 +7695,11 @@ async function ii(e, t) {
7695
7695
  }
7696
7696
  function sl(e, t) {
7697
7697
  const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = [], s = t.tokenSource?.vocabulary;
7698
- for (const d of t.getTokens?.() ?? []) {
7699
- const c = s?.getSymbolicName(d.type);
7700
- if (c !== "COMMENT_TO_EOL" && c !== "BLOCK_COMMENT") continue;
7701
- const f = e.utf16(d.startIndex);
7702
- let h = e.utf16(d.stopIndex + 1);
7698
+ for (const c of t.getTokens?.() ?? []) {
7699
+ const d = s?.getSymbolicName(c.type);
7700
+ if (d !== "COMMENT_TO_EOL" && d !== "BLOCK_COMMENT") continue;
7701
+ const f = e.utf16(c.startIndex);
7702
+ let h = e.utf16(c.stopIndex + 1);
7703
7703
  if (!(f === void 0 || h === void 0 || h < f)) {
7704
7704
  for (; h > f && (e.text[h - 1] === `
7705
7705
  ` || e.text[h - 1] === "\r"); )
@@ -7707,18 +7707,18 @@ function sl(e, t) {
7707
7707
  i.push({ start: f, end: h });
7708
7708
  }
7709
7709
  }
7710
- const o = [...i].sort((d, c) => d.start - c.start);
7710
+ const o = [...i].sort((c, d) => c.start - d.start);
7711
7711
  let a = "", l = 0;
7712
- for (const d of o)
7713
- a += e.text.slice(l, Math.max(l, d.start)), a += e.text.slice(Math.max(l, d.start), Math.max(l, d.end)).replace(/[^\n\r]/g, " "), l = Math.max(l, d.end);
7712
+ for (const c of o)
7713
+ a += e.text.slice(l, Math.max(l, c.start)), a += e.text.slice(Math.max(l, c.start), Math.max(l, c.end)).replace(/[^\n\r]/g, " "), l = Math.max(l, c.end);
7714
7714
  a += e.text.slice(l);
7715
- const u = (d) => a.slice(e.lineStarts[d], e.lineStarts[d + 1] ?? a.length);
7716
- for (const d of i) {
7717
- const c = e.line(d.start), f = e.line(d.end - 1);
7718
- for (let m = c; m <= f; m++)
7715
+ const u = (c) => a.slice(e.lineStarts[c], e.lineStarts[c + 1] ?? a.length);
7716
+ for (const c of i) {
7717
+ const d = e.line(c.start), f = e.line(c.end - 1);
7718
+ for (let m = d; m <= f; m++)
7719
7719
  u(m).trim() === "" && r.add(m);
7720
- const h = a.slice(e.lineStarts[c], d.start).trim(), p = a.slice(d.end, e.lineStarts[f + 1] ?? a.length).trim();
7721
- h !== "" && p === "" && n.set(f, d);
7720
+ const h = a.slice(e.lineStarts[d], c.start).trim(), p = a.slice(c.end, e.lineStarts[f + 1] ?? a.length).trim();
7721
+ h !== "" && p === "" && n.set(f, c);
7722
7722
  }
7723
7723
  return { trailing: n, lines: r, all: i };
7724
7724
  }
@@ -7749,12 +7749,12 @@ function Oy(e, t) {
7749
7749
  );
7750
7750
  if (!l) continue;
7751
7751
  const u = [];
7752
- let d = a + 1;
7753
- for (; i(n[d] ?? n[a]) === "BLOCK_ANNOTATION_TEXT"; d++)
7754
- u.push(s(n[d]));
7755
- const c = n[d];
7756
- if (!c || i(c) !== "BLOCK_ANNOTATION_END") continue;
7757
- const f = e.line(e.utf16(n[a].startIndex) ?? 0), h = e.utf16(c.stopIndex + 1) ?? e.text.length, p = l.name === void 0 && l.rest ? [`${l.rest}
7752
+ let c = a + 1;
7753
+ for (; i(n[c] ?? n[a]) === "BLOCK_ANNOTATION_TEXT"; c++)
7754
+ u.push(s(n[c]));
7755
+ const d = n[c];
7756
+ if (!d || i(d) !== "BLOCK_ANNOTATION_END") continue;
7757
+ const f = e.line(e.utf16(n[a].startIndex) ?? 0), h = e.utf16(d.stopIndex + 1) ?? e.text.length, p = l.name === void 0 && l.rest ? [`${l.rest}
7758
7758
  `] : [];
7759
7759
  o.push({
7760
7760
  ...l.name === void 0 ? {} : { name: l.name },
@@ -7763,7 +7763,7 @@ function Oy(e, t) {
7763
7763
  `).replace(/\n$/, ""),
7764
7764
  span: { start: e.lineStarts[f], end: h },
7765
7765
  line: f
7766
- }), a = d;
7766
+ }), a = c;
7767
7767
  }
7768
7768
  return o;
7769
7769
  }
@@ -8029,13 +8029,13 @@ async function Ny(e) {
8029
8029
  reason: Gc,
8030
8030
  line: l.from + 1
8031
8031
  };
8032
- const { tag: u, errors: d } = al(t, [
8032
+ const { tag: u, errors: c } = al(t, [
8033
8033
  Wc(l.text)
8034
- ]), c = u?.tag("artifact"), f = ol(l.text);
8034
+ ]), d = u?.tag("artifact"), f = ol(l.text);
8035
8035
  if (f === void 0)
8036
- return d.length > 0 ? {
8036
+ return c.length > 0 ? {
8037
8037
  ok: !1,
8038
- reason: `The \`## artifact\` tag does not parse: ${d[0]}`
8038
+ reason: `The \`## artifact\` tag does not parse: ${c[0]}`
8039
8039
  } : a === "linear" ? {
8040
8040
  ok: !1,
8041
8041
  legacyNotebook: !0,
@@ -8152,20 +8152,20 @@ async function Ny(e) {
8152
8152
  ...q?.has("borderless") ? { borderless: !0 } : {}
8153
8153
  });
8154
8154
  }
8155
- const v = Py(i, n, t), g = {}, y = c?.tag("givens");
8155
+ const v = Py(i, n, t), g = {}, y = d?.tag("givens");
8156
8156
  for (const k of Object.keys(y?.dict ?? {})) {
8157
8157
  const S = y?.text(k);
8158
8158
  S !== void 0 && (g[k] = S);
8159
8159
  }
8160
- const x = u?.tag("dashboard")?.has("columns") ? Vs(u.tag("dashboard"), "columns") : c?.array("tiles") ? Vs(c, "dashboard_columns") : void 0;
8160
+ const x = u?.tag("dashboard")?.has("columns") ? Vs(u.tag("dashboard"), "columns") : d?.array("tiles") ? Vs(d, "dashboard_columns") : void 0;
8161
8161
  return {
8162
8162
  ok: !0,
8163
8163
  document: {
8164
8164
  layout: a,
8165
- title: c?.text("title") ?? "",
8165
+ title: d?.text("title") ?? "",
8166
8166
  ...s ? { description: s } : {},
8167
8167
  ...x === void 0 ? {} : { columns: x },
8168
- ...c?.has("autorun") ? { autorun: c.isTrue("autorun") } : {},
8168
+ ...d?.has("autorun") ? { autorun: d.isTrue("autorun") } : {},
8169
8169
  imports: h,
8170
8170
  sources: p,
8171
8171
  ...v ? { localGivens: v } : {},
@@ -8264,11 +8264,11 @@ function Gy(e, t, n) {
8264
8264
  ok: !1,
8265
8265
  reason: `A new tile names a view of a source; \`${h.name}\` is ${h.declaration.kind === "inline" ? "an inline query" : "not declared here"}, which the builder cannot write.`
8266
8266
  };
8267
- const u = new Map(e.sources.map((h) => [h.name, h])), d = new Set(
8267
+ const u = new Map(e.sources.map((h) => [h.name, h])), c = new Set(
8268
8268
  t.imports.flatMap((h) => h.kind === "names" ? h.names : [])
8269
8269
  );
8270
- for (const h of e.sources) d.add(h.base);
8271
- const c = t.imports.some((h) => h.kind === "all"), f = t.sources.filter((h) => !u.has(h.name));
8270
+ for (const h of e.sources) c.add(h.base);
8271
+ const d = t.imports.some((h) => h.kind === "all"), f = t.sources.filter((h) => !u.has(h.name));
8272
8272
  for (const h of e.sources) {
8273
8273
  const p = t.sources.find((m) => m.name === h.name);
8274
8274
  if (!p || p.base !== h.base)
@@ -8283,7 +8283,7 @@ function Gy(e, t, n) {
8283
8283
  ok: !1,
8284
8284
  reason: `A new source \`${h.name}\` needs a tile on it.`
8285
8285
  };
8286
- if (!d.has(h.base) && !c && !n?.includes(h.base))
8286
+ if (!c.has(h.base) && !d && !n?.includes(h.base))
8287
8287
  return {
8288
8288
  ok: !1,
8289
8289
  reason: `\`${h.base}\` is not imported in this file, so a tile cannot be put on it.`
@@ -8318,8 +8318,8 @@ function ac(e, t) {
8318
8318
  const n = qy(t), r = n.indexOf("{"), i = n.lastIndexOf("}");
8319
8319
  let s = t.slice(r + 1, i), o = n.slice(r + 1, i);
8320
8320
  const a = (u) => {
8321
- const d = u.exec(o);
8322
- d && (s = s.slice(0, d.index) + s.slice(d.index + d[0].length), o = o.slice(0, d.index) + o.slice(d.index + d[0].length));
8321
+ const c = u.exec(o);
8322
+ c && (s = s.slice(0, c.index) + s.slice(c.index + c[0].length), o = o.slice(0, c.index) + o.slice(c.index + c[0].length));
8323
8323
  };
8324
8324
  a(/\s*\bcolspan\s*=\s*[^\s}]+/), a(/\s*\bbreak\b(?!\s*=)/);
8325
8325
  const l = [
@@ -8341,18 +8341,18 @@ function Ky(e) {
8341
8341
  edits: l
8342
8342
  } = e, u = new Map(
8343
8343
  r.tiles.filter(je).map((v) => [v.name, v])
8344
- ), d = i.tiles.filter(je).some((v) => {
8344
+ ), c = i.tiles.filter(je).some((v) => {
8345
8345
  const g = u.get(v.name);
8346
8346
  return g !== void 0 && oc(g, v);
8347
8347
  });
8348
- if (!s && !d) return;
8349
- const c = fs(t);
8350
- if (!c)
8348
+ if (!s && !c) return;
8349
+ const d = fs(t);
8350
+ if (!d)
8351
8351
  return {
8352
8352
  ok: !1,
8353
8353
  reason: "Could not find the `## artifact` tag to reorder."
8354
8354
  };
8355
- const f = c.text, h = ol(f);
8355
+ const f = d.text, h = ol(f);
8356
8356
  if (!h)
8357
8357
  return {
8358
8358
  ok: !1,
@@ -8388,7 +8388,7 @@ function Ky(e) {
8388
8388
  reason: "A tile in the new order is not one the `## artifact` tag names."
8389
8389
  };
8390
8390
  const b = f.slice(0, h.open).search(/tiles\s*=\s*$/), w = `${f.slice(0, b)}tiles=[${Vy(f, h, m)}]${f.slice(h.close + 1)}`;
8391
- w !== f && l.push({ ...Ff(n, c), text: `${w}
8391
+ w !== f && l.push({ ...Ff(n, d), text: `${w}
8392
8392
  ` });
8393
8393
  }
8394
8394
  function Ff(e, t) {
@@ -8463,7 +8463,7 @@ function Yy(e) {
8463
8463
  (g) => g.start === a.start && g.end === a.end
8464
8464
  );
8465
8465
  let u = l ? l.text.replace(/\n$/, "") : o.text;
8466
- const d = r.layout !== i.layout, c = u.indexOf("artifact"), f = u.indexOf("{", c);
8466
+ const c = r.layout !== i.layout, d = u.indexOf("artifact"), f = u.indexOf("{", d);
8467
8467
  let h = 0, p = -1;
8468
8468
  for (let g = f; g < u.length; g++)
8469
8469
  if (u[g] === "{") h++;
@@ -8493,7 +8493,7 @@ ${x.source}[ \\t]*(?=
8493
8493
  (k) => `${o.block ? k.slice(0, k.length - k.trimStart().length) : " "}${g}=${y}`
8494
8494
  ) : m = w(`${g}=${y}`);
8495
8495
  };
8496
- if (d && v("layout", i.layout), r.title !== i.title && v("title", i.title ? vt(i.title) : void 0), r.autorun !== i.autorun && v(
8496
+ if (c && v("layout", i.layout), r.title !== i.title && v("title", i.title ? vt(i.title) : void 0), r.autorun !== i.autorun && v(
8497
8497
  "autorun",
8498
8498
  i.autorun === void 0 ? void 0 : String(i.autorun)
8499
8499
  ), Oe(r.startingGivens) !== Oe(i.startingGivens)) {
@@ -8508,25 +8508,25 @@ ${x.source}[ \\t]*(?=
8508
8508
  ` });
8509
8509
  }
8510
8510
  if (r.description !== i.description) {
8511
- const { read: o, blankAbove: a, below: l, belowBlock: u, inBlock: d } = Bc(t);
8512
- if (d || i.description === void 0 && u)
8511
+ const { read: o, blankAbove: a, below: l, belowBlock: u, inBlock: c } = Bc(t);
8512
+ if (c || i.description === void 0 && u)
8513
8513
  return {
8514
8514
  ok: !1,
8515
8515
  reason: "The description is written in a `##|\"` block, which the builder cannot edit in place. Change it in the file's text."
8516
8516
  };
8517
- const c = Nf(i.description ?? "").split(`
8517
+ const d = Nf(i.description ?? "").split(`
8518
8518
  `).map((m) => m.trim() === "" ? '##"' : `##" ${m.trim()}`).join(`
8519
8519
  `), f = o.length > 0 && o[0] < hl(t), h = i.description === void 0, p = f ? [...o.slice(1), ...h ? l : []] : [...o, ...a];
8520
8520
  for (const m of p) s.push({ ...n(m), text: "" });
8521
8521
  if (f)
8522
8522
  s.push({
8523
8523
  ...n(o[0]),
8524
- text: i.description === void 0 ? "" : `${c}
8524
+ text: i.description === void 0 ? "" : `${d}
8525
8525
  `
8526
8526
  });
8527
8527
  else if (i.description !== void 0) {
8528
8528
  const m = n(hl(t)).start;
8529
- s.push({ start: m, end: m, text: `${c}
8529
+ s.push({ start: m, end: m, text: `${d}
8530
8530
  ` });
8531
8531
  }
8532
8532
  }
@@ -8536,13 +8536,13 @@ function Xy(e) {
8536
8536
  (i.localGivens ?? []).map((h) => [h.name, h])
8537
8537
  ), u = new Map(
8538
8538
  (s.localGivens ?? []).map((h) => [h.name, h])
8539
- ), d = new Map(
8539
+ ), c = new Map(
8540
8540
  a.givens.map((h) => [h.name, h])
8541
- ), c = /* @__PURE__ */ new Set();
8541
+ ), d = /* @__PURE__ */ new Set();
8542
8542
  for (const [h, p] of l) {
8543
8543
  const m = u.get(h);
8544
8544
  if (m !== void 0 && Oe(m) === Oe(p)) continue;
8545
- const b = d.get(h);
8545
+ const b = c.get(h);
8546
8546
  if (b === void 0)
8547
8547
  return {
8548
8548
  ok: !1,
@@ -8556,7 +8556,7 @@ function Xy(e) {
8556
8556
  ...m === void 0 ? v : []
8557
8557
  ];
8558
8558
  for (const E of y)
8559
- o.push({ ...n(E), text: "" }), c.add(E);
8559
+ o.push({ ...n(E), text: "" }), d.add(E);
8560
8560
  const x = It(a, b.span.end - 1);
8561
8561
  if (m === void 0) {
8562
8562
  o.push({
@@ -8564,15 +8564,15 @@ function Xy(e) {
8564
8564
  end: n(x).end,
8565
8565
  text: ""
8566
8566
  });
8567
- for (let j = b.line; j <= x; j++) c.add(j);
8568
- const E = Math.min(b.line, ...y), B = b.blockHeader ?? E, D = (t[x + 1] ?? "x").trim() === "", N = B === 0 || t[B - 1].trim() === "", q = b.blockHeader === void 0 || ![...d.values()].some(
8567
+ for (let j = b.line; j <= x; j++) d.add(j);
8568
+ const E = Math.min(b.line, ...y), B = b.blockHeader ?? E, D = (t[x + 1] ?? "x").trim() === "", N = B === 0 || t[B - 1].trim() === "", q = b.blockHeader === void 0 || ![...c.values()].some(
8569
8569
  (j) => j.blockHeader === b.blockHeader && j.line > b.line && u.has(
8570
- [...d.entries()].find(
8570
+ [...c.entries()].find(
8571
8571
  ([, X]) => X === j
8572
8572
  )?.[0] ?? ""
8573
8573
  )
8574
8574
  );
8575
- D && N && q && !c.has(x + 1) && (o.push({ ...n(x + 1), text: "" }), c.add(x + 1));
8575
+ D && N && q && !d.has(x + 1) && (o.push({ ...n(x + 1), text: "" }), d.add(x + 1));
8576
8576
  continue;
8577
8577
  }
8578
8578
  const k = r(b.line), S = nc(m), $ = m.type !== p.type || m.default !== p.default ? b.blockHeader === void 0 ? rc(m) : `${m.name} :: ${m.type} is ${m.default}` : t.slice(b.line, x + 1).join(`
@@ -8585,11 +8585,11 @@ function Xy(e) {
8585
8585
  `
8586
8586
  });
8587
8587
  }
8588
- for (const [h, p] of d) {
8588
+ for (const [h, p] of c) {
8589
8589
  if (p.blockHeader === void 0 || u.has(h)) continue;
8590
- ![...d.values()].some(
8591
- (b) => b.blockHeader === p.blockHeader && !c.has(b.line)
8592
- ) && !c.has(p.blockHeader) && (o.push({ ...n(p.blockHeader), text: "" }), c.add(p.blockHeader));
8590
+ ![...c.values()].some(
8591
+ (b) => b.blockHeader === p.blockHeader && !d.has(b.line)
8592
+ ) && !d.has(p.blockHeader) && (o.push({ ...n(p.blockHeader), text: "" }), d.add(p.blockHeader));
8593
8593
  }
8594
8594
  const f = [...u.values()].filter(
8595
8595
  (h) => !l.has(h.name)
@@ -8597,7 +8597,7 @@ function Xy(e) {
8597
8597
  if (f.length > 0) {
8598
8598
  const h = Math.max(
8599
8599
  -1,
8600
- ...[...d.values()].map((g) => g.line)
8600
+ ...[...c.values()].map((g) => g.line)
8601
8601
  ), p = (() => {
8602
8602
  let g = -1;
8603
8603
  for (let y = 0; y < t.length; y++) {
@@ -8621,8 +8621,8 @@ ${b}` }), t.some(
8621
8621
  }
8622
8622
  const lc = (e, t) => `import { ${e.join(", ")} } from ${vt(t)}`;
8623
8623
  function Zy(e) {
8624
- const { parsed: t, current: n, next: r, edits: i, wholeLine: s } = e, o = (c) => Oe(
8625
- c.imports.flatMap((f) => f.kind === "all" ? [f.from] : []).sort()
8624
+ const { parsed: t, current: n, next: r, edits: i, wholeLine: s } = e, o = (d) => Oe(
8625
+ d.imports.flatMap((f) => f.kind === "all" ? [f.from] : []).sort()
8626
8626
  );
8627
8627
  if (o(n) !== o(r))
8628
8628
  return {
@@ -8631,15 +8631,15 @@ function Zy(e) {
8631
8631
  };
8632
8632
  if (Oe(n.imports) === Oe(r.imports)) return;
8633
8633
  const a = r.imports.flatMap(
8634
- (c) => c.kind === "names" ? [{ ...c, claimed: !1 }] : []
8634
+ (d) => d.kind === "names" ? [{ ...d, claimed: !1 }] : []
8635
8635
  ), l = /* @__PURE__ */ new Set([
8636
- ...r.sources.map((c) => c.base),
8637
- ...r.tiles.filter(ke).map((c) => c.source)
8638
- ]), u = t.imports.map((c, f) => ({
8639
- statement: c,
8636
+ ...r.sources.map((d) => d.base),
8637
+ ...r.tiles.filter(ke).map((d) => d.source)
8638
+ ]), u = t.imports.map((d, f) => ({
8639
+ statement: d,
8640
8640
  entry: n.imports[f]
8641
8641
  }));
8642
- for (const { statement: c, entry: f } of u) {
8642
+ for (const { statement: d, entry: f } of u) {
8643
8643
  if (!f || f.kind !== "names") continue;
8644
8644
  const h = a.find((g) => !g.claimed && g.from === f.from);
8645
8645
  h && (h.claimed = !0);
@@ -8650,7 +8650,7 @@ function Zy(e) {
8650
8650
  reason: `\`${b}\` is still read by a tile, so its import cannot be removed.`
8651
8651
  };
8652
8652
  if (Oe(p) === Oe(f.names)) continue;
8653
- const w = p.length === 0 ? ll(t, c.statement) : c.statement, v = t.commentIn(w);
8653
+ const w = p.length === 0 ? ll(t, d.statement) : d.statement, v = t.commentIn(w);
8654
8654
  if (v)
8655
8655
  return {
8656
8656
  ok: !1,
@@ -8661,37 +8661,37 @@ function Zy(e) {
8661
8661
  text: p.length === 0 ? "" : lc(p, f.from)
8662
8662
  });
8663
8663
  }
8664
- const d = a.filter((c) => !c.claimed);
8665
- if (d.length > 0) {
8666
- const c = t.imports.at(-1);
8667
- if (!c)
8664
+ const c = a.filter((d) => !d.claimed);
8665
+ if (c.length > 0) {
8666
+ const d = t.imports.at(-1);
8667
+ if (!d)
8668
8668
  return {
8669
8669
  ok: !1,
8670
8670
  reason: "This file has no `import` to put a source beside. Import its first source in the file."
8671
8671
  };
8672
- const f = s(It(t, c.statement.end - 1)).end;
8672
+ const f = s(It(t, d.statement.end - 1)).end;
8673
8673
  i.push({
8674
8674
  start: f,
8675
8675
  end: f,
8676
- text: d.map((h) => `${lc(h.names, h.from)}
8676
+ text: c.map((h) => `${lc(h.names, h.from)}
8677
8677
  `).join("")
8678
8678
  });
8679
8679
  }
8680
8680
  }
8681
8681
  function Qy(e) {
8682
8682
  const { lines: t, wholeLine: n, indentOf: r, current: i, next: s, edits: o, parsed: a } = e, l = new Map(
8683
- (i.drills ?? []).map((d) => [as(d), d])
8683
+ (i.drills ?? []).map((c) => [as(c), c])
8684
8684
  ), u = new Map(
8685
- (s.drills ?? []).map((d) => [as(d), d])
8685
+ (s.drills ?? []).map((c) => [as(c), c])
8686
8686
  );
8687
- for (const d of /* @__PURE__ */ new Set([...l.keys(), ...u.keys()])) {
8688
- const c = l.get(d), f = u.get(d);
8689
- if (c && f && Oe(c) === Oe(f)) continue;
8690
- const h = f ?? c;
8687
+ for (const c of /* @__PURE__ */ new Set([...l.keys(), ...u.keys()])) {
8688
+ const d = l.get(c), f = u.get(c);
8689
+ if (d && f && Oe(d) === Oe(f)) continue;
8690
+ const h = f ?? d;
8691
8691
  if (f && f.to.length === 0)
8692
8692
  return {
8693
8693
  ok: !1,
8694
- reason: `The drill on \`${d}\` names no destination.`
8694
+ reason: `The drill on \`${c}\` names no destination.`
8695
8695
  };
8696
8696
  const p = a.sources.find((v) => v.name === h.source)?.dimensions.find((v) => v.name === h.name);
8697
8697
  if (p === void 0)
@@ -8734,8 +8734,8 @@ function Jy(e) {
8734
8734
  ok: !1,
8735
8735
  reason: `\`${o.name}\` is one of several views declared by a single \`view:\` statement, which the builder does not restructure.`
8736
8736
  };
8737
- const l = It(s, a.statement.start), u = It(s, a.statement.end - 1), d = s.trailingComment(u), c = d && d.start >= a.statement.end ? d.end : a.statement.end;
8738
- if (s.text.slice(s.lineStarts[l], a.statement.start).trim() !== "" || s.text.slice(c, n(u).end).trim() !== "") {
8737
+ const l = It(s, a.statement.start), u = It(s, a.statement.end - 1), c = s.trailingComment(u), d = c && c.start >= a.statement.end ? c.end : a.statement.end;
8738
+ if (s.text.slice(s.lineStarts[l], a.statement.start).trim() !== "" || s.text.slice(d, n(u).end).trim() !== "") {
8739
8739
  i.push({ ...ll(s, a.statement), text: "" });
8740
8740
  continue;
8741
8741
  }
@@ -8764,7 +8764,7 @@ function eb(e) {
8764
8764
  const h = u.get(f.source) ?? [];
8765
8765
  h.push(f), u.set(f.source, h);
8766
8766
  }
8767
- const d = (f, h) => {
8767
+ const c = (f, h) => {
8768
8768
  const p = f.declaration.kind === "reference" ? f.declaration.from : f.name, m = (f.filters ?? []).map((b) => `where: ${ra(b.field)} ${b.op ?? "~"} $${b.given}`).join(", ");
8769
8769
  return [
8770
8770
  ...Wf(f).map((b) => `${h}${b}`),
@@ -8772,10 +8772,10 @@ function eb(e) {
8772
8772
  ].join(`
8773
8773
  `);
8774
8774
  };
8775
- let c = -1;
8775
+ let d = -1;
8776
8776
  for (const f of l.sources)
8777
- c = Math.max(
8778
- c,
8777
+ d = Math.max(
8778
+ d,
8779
8779
  It(l, f.span.end - 1)
8780
8780
  );
8781
8781
  for (const [f, h] of u)
@@ -8805,7 +8805,7 @@ function eb(e) {
8805
8805
  start: v,
8806
8806
  end: v,
8807
8807
  text: (g ? "" : `
8808
- `) + h.map((y) => d(y, w)).join(`
8808
+ `) + h.map((y) => c(y, w)).join(`
8809
8809
 
8810
8810
  `) + `
8811
8811
  `
@@ -8819,12 +8819,12 @@ function eb(e) {
8819
8819
  };
8820
8820
  const m = `
8821
8821
  source: ${p.name} is ${p.base} extend {
8822
- ` + h.map((g) => d(g, " ")).join(`
8822
+ ` + h.map((g) => c(g, " ")).join(`
8823
8823
 
8824
8824
  `) + `
8825
8825
  }
8826
8826
  `;
8827
- let b = c;
8827
+ let b = d;
8828
8828
  if (b < 0)
8829
8829
  for (let g = 0; g < n.length; g++) {
8830
8830
  const y = n[g].trim();
@@ -8833,45 +8833,45 @@ source: ${p.name} is ${p.base} extend {
8833
8833
  const w = b >= 0 ? r(b).end : t.length, v = w === t.length && !t.endsWith(`
8834
8834
  `) ? `
8835
8835
  ` : "";
8836
- a.push({ start: w, end: w, text: v + m }), c = b;
8836
+ a.push({ start: w, end: w, text: v + m }), d = b;
8837
8837
  }
8838
8838
  }
8839
8839
  function tb(e) {
8840
- const { lines: t, starts: n, wholeLine: r, indentOf: i, current: s, next: o, edits: a, parsed: l } = e, u = new Map(s.tiles.map((d) => [ct(d), d]));
8841
- for (const d of o.tiles) {
8842
- const c = u.get(ct(d));
8843
- if (c === void 0 || je(d) || je(c) || Oe(ls(c)) === Oe(ls(d)))
8840
+ const { lines: t, starts: n, wholeLine: r, indentOf: i, current: s, next: o, edits: a, parsed: l } = e, u = new Map(s.tiles.map((c) => [ct(c), c]));
8841
+ for (const c of o.tiles) {
8842
+ const d = u.get(ct(c));
8843
+ if (d === void 0 || je(c) || je(d) || Oe(ls(d)) === Oe(ls(c)))
8844
8844
  continue;
8845
- if (d.declaration.kind === "inherited")
8845
+ if (c.declaration.kind === "inherited")
8846
8846
  return {
8847
8847
  ok: !1,
8848
- reason: `\`${d.source} -> ${d.name}\` is declared on its source, not in this report, so its presentation cannot be changed here.`
8848
+ reason: `\`${c.source} -> ${c.name}\` is declared on its source, not in this report, so its presentation cannot be changed here.`
8849
8849
  };
8850
- const f = jy(l, d.source, d.name);
8850
+ const f = jy(l, c.source, c.name);
8851
8851
  if (f < 0)
8852
8852
  return {
8853
8853
  ok: !1,
8854
- reason: `Could not find where \`${d.name}\` is declared inside \`${d.source}\`.`
8854
+ reason: `Could not find where \`${c.name}\` is declared inside \`${c.source}\`.`
8855
8855
  };
8856
- const { tags: h } = si(l, t, f), p = i(f), m = Wf(d, !1), b = new Map(
8856
+ const { tags: h } = si(l, t, f), p = i(f), m = Wf(c, !1), b = new Map(
8857
8857
  m.map(($) => [Li($) ?? $, $])
8858
- ), w = /* @__PURE__ */ new Set(), v = zf(d.chart), g = cc(c) !== cc(d);
8858
+ ), w = /* @__PURE__ */ new Set(), v = zf(c.chart), g = cc(d) !== cc(c);
8859
8859
  if (g) {
8860
- const $ = h.filter((D) => Gr(D.text)), E = h.filter((D) => Kt(D.text)), B = c.chart === "custom" ? h.filter(
8860
+ const $ = h.filter((D) => Gr(D.text)), E = h.filter((D) => Kt(D.text)), B = d.chart === "custom" ? h.filter(
8861
8861
  (D) => Kt(D.text) || Gr(D.text)
8862
8862
  ) : $.length > 0 ? $ : E.length > 1 ? E : [];
8863
8863
  if (B.length > 0)
8864
8864
  return {
8865
8865
  ok: !1,
8866
- reason: `\`${d.source} -> ${d.name}\` has a chart line the builder does not model (${B.map((D) => D.text).join(" and ")}), so its chart cannot be changed here.`
8866
+ reason: `\`${c.source} -> ${c.name}\` has a chart line the builder does not model (${B.map((D) => D.text).join(" and ")}), so its chart cannot be changed here.`
8867
8867
  };
8868
8868
  }
8869
8869
  let y = !1;
8870
8870
  for (const $ of h) {
8871
8871
  if (g && Kt($.text)) {
8872
- v === void 0 ? a.push({ ...r($.line), text: "" }) : $.text !== Nn(v, d.chartCarried) && a.push({
8872
+ v === void 0 ? a.push({ ...r($.line), text: "" }) : $.text !== Nn(v, c.chartCarried) && a.push({
8873
8873
  ...r($.line),
8874
- text: `${p}${Nn(v, d.chartCarried)}
8874
+ text: `${p}${Nn(v, c.chartCarried)}
8875
8875
  `
8876
8876
  }), y = !0;
8877
8877
  continue;
@@ -8887,7 +8887,7 @@ function tb(e) {
8887
8887
  ` });
8888
8888
  }
8889
8889
  const x = m.filter(($) => !w.has(Li($) ?? $));
8890
- if (g && v !== void 0 && !y && x.push(Nn(v, d.chartCarried)), x.length > 0) {
8890
+ if (g && v !== void 0 && !y && x.push(Nn(v, c.chartCarried)), x.length > 0) {
8891
8891
  const $ = n[f];
8892
8892
  a.push({
8893
8893
  start: $,
@@ -8896,26 +8896,26 @@ function tb(e) {
8896
8896
  `).join("")
8897
8897
  });
8898
8898
  }
8899
- if (Oe(c.filters) === Oe(d.filters)) continue;
8900
- const k = Bf(e, d);
8899
+ if (Oe(d.filters) === Oe(c.filters)) continue;
8900
+ const k = Bf(e, c);
8901
8901
  if (!k)
8902
8902
  return {
8903
8903
  ok: !1,
8904
- reason: `Could not find \`${d.name}\`'s declaration to filter it.`
8904
+ reason: `Could not find \`${c.name}\`'s declaration to filter it.`
8905
8905
  };
8906
8906
  if (k.body.kind === "reference") {
8907
- const $ = lb(e, d, k);
8907
+ const $ = lb(e, c, k);
8908
8908
  if ($) return $;
8909
8909
  continue;
8910
8910
  }
8911
8911
  if (k.body.kind !== "inline")
8912
8912
  return {
8913
8913
  ok: !1,
8914
- reason: `\`${d.name}\`'s body is ${k.body.why}, so there is no single first stage to write its filter into.`
8914
+ reason: `\`${c.name}\`'s body is ${k.body.why}, so there is no single first stage to write its filter into.`
8915
8915
  };
8916
- const S = jf(d.filters, k.body.stage);
8917
- if (S) return Gf(d.name, S.given);
8918
- const C = qf(e, d, k.body.stage);
8916
+ const S = jf(c.filters, k.body.stage);
8917
+ if (S) return Gf(c.name, S.given);
8918
+ const C = qf(e, c, k.body.stage);
8919
8919
  if (C) return C;
8920
8920
  }
8921
8921
  }
@@ -8960,9 +8960,9 @@ ${e.markdown === "" ? "" : `${e.markdown}
8960
8960
  function ib(e) {
8961
8961
  const { sourceText: t, lines: n, wholeLine: r, current: i, next: s, parsed: o, edits: a } = e, l = new Map(
8962
8962
  i.tiles.filter(je).map((h) => [h.name, h])
8963
- ), u = s.tiles.filter(je), d = (h) => o.textBlocks.find((p) => p.name === h), c = new Set(u.map((h) => h.name));
8963
+ ), u = s.tiles.filter(je), c = (h) => o.textBlocks.find((p) => p.name === h), d = new Set(u.map((h) => h.name));
8964
8964
  for (const h of l.keys()) {
8965
- const p = c.has(h) ? void 0 : d(h);
8965
+ const p = d.has(h) ? void 0 : c(h);
8966
8966
  if (!p) continue;
8967
8967
  const m = It(o, p.span.end - 1);
8968
8968
  a.push({ ...p.span, text: "" });
@@ -8971,7 +8971,7 @@ function ib(e) {
8971
8971
  }
8972
8972
  const f = [];
8973
8973
  for (const h of u) {
8974
- const p = l.get(h.name), m = d(h.name);
8974
+ const p = l.get(h.name), m = c(h.name);
8975
8975
  if (p === void 0) {
8976
8976
  if (m)
8977
8977
  return {
@@ -8983,7 +8983,7 @@ function ib(e) {
8983
8983
  }
8984
8984
  if (f.length > 0) {
8985
8985
  const h = o.textBlocks.filter(
8986
- (v) => v.name === void 0 || c.has(v.name)
8986
+ (v) => v.name === void 0 || d.has(v.name)
8987
8987
  ), p = h[h.length - 1], m = o.sources.find((v) => v.name.endsWith("_tiles"));
8988
8988
  if (p) {
8989
8989
  const v = p.span.end, g = t.slice(v);
@@ -9032,12 +9032,12 @@ function sb(e, t) {
9032
9032
  for (const o of t.tiles) {
9033
9033
  const a = n.get(ct(o));
9034
9034
  if (je(o)) {
9035
- const c = rb(
9035
+ const d = rb(
9036
9036
  o,
9037
9037
  a && je(a) ? a : void 0,
9038
9038
  r
9039
9039
  );
9040
- if (c) return c;
9040
+ if (d) return d;
9041
9041
  continue;
9042
9042
  }
9043
9043
  const l = a && ke(a) ? a : void 0;
@@ -9045,22 +9045,22 @@ function sb(e, t) {
9045
9045
  const u = o.chart;
9046
9046
  if (u !== void 0 && u !== "default" && u !== "none" && !Ss(u) && !(u === "custom" && l?.chart === "custom"))
9047
9047
  return `"${String(u)}" is not a chart this editor writes.`;
9048
- const d = new Set(l?.filters?.map((c) => c.field));
9049
- for (const c of o.filters ?? [])
9050
- if (!d.has(c.field) && /[\r\n]/.test(c.field))
9048
+ const c = new Set(l?.filters?.map((d) => d.field));
9049
+ for (const d of o.filters ?? [])
9050
+ if (!c.has(d.field) && /[\r\n]/.test(d.field))
9051
9051
  return "A filter field is one line.";
9052
9052
  if (a === void 0) {
9053
- const c = [o.name, o.source];
9054
- o.declaration.kind === "reference" && c.push(o.declaration.from);
9055
- for (const f of c) {
9053
+ const d = [o.name, o.source];
9054
+ o.declaration.kind === "reference" && d.push(o.declaration.from);
9055
+ for (const f of d) {
9056
9056
  const h = bi(f);
9057
9057
  if (h) return h;
9058
9058
  }
9059
9059
  }
9060
- for (const c of ["label", "subtitle"]) {
9061
- const f = o[c];
9062
- if (f === void 0 || f === l?.[c]) continue;
9063
- const h = Qt(`tile ${c}`, f);
9060
+ for (const d of ["label", "subtitle"]) {
9061
+ const f = o[d];
9062
+ if (f === void 0 || f === l?.[d]) continue;
9063
+ const h = Qt(`tile ${d}`, f);
9064
9064
  if (h) return h;
9065
9065
  }
9066
9066
  }
@@ -9093,17 +9093,17 @@ function sb(e, t) {
9093
9093
  if (u) return `The suggest source is not a name. ${u}`;
9094
9094
  }
9095
9095
  for (const u of ["query", "dimension"]) {
9096
- const d = o.suggest?.[u];
9097
- if (d === void 0 || d === a?.suggest?.[u]) continue;
9098
- const c = Qt(`suggest ${u}`, d);
9099
- if (c) return c;
9096
+ const c = o.suggest?.[u];
9097
+ if (c === void 0 || c === a?.suggest?.[u]) continue;
9098
+ const d = Qt(`suggest ${u}`, c);
9099
+ if (d) return d;
9100
9100
  }
9101
9101
  for (const u of ["label", "description"]) {
9102
- const d = o[u];
9103
- if (d === void 0 || d === s.get(o.name)?.[u])
9102
+ const c = o[u];
9103
+ if (c === void 0 || c === s.get(o.name)?.[u])
9104
9104
  continue;
9105
- const c = Qt(`given ${u}`, d);
9106
- if (c) return c;
9105
+ const d = Qt(`given ${u}`, c);
9106
+ if (d) return d;
9107
9107
  }
9108
9108
  }
9109
9109
  for (const [o, a] of Object.entries(t.startingGivens ?? {})) {
@@ -9201,9 +9201,9 @@ function qf(e, t, n) {
9201
9201
  const f = r.trailingComment(It(r, u));
9202
9202
  f && f.start >= u && (u = f.end);
9203
9203
  }
9204
- const d = a !== void 0 && !/,\s*$/.test(r.text.slice(0, u)) ? ", " : " ", c = n.oneLine ? `${d}${l.map(zi).join(", ")}` : l.map((f) => `
9204
+ const c = a !== void 0 && !/,\s*$/.test(r.text.slice(0, u)) ? ", " : " ", d = n.oneLine ? `${c}${l.map(zi).join(", ")}` : l.map((f) => `
9205
9205
  ${n.indent}${zi(f)}`).join("");
9206
- i.push({ start: u, end: u, text: c });
9206
+ i.push({ start: u, end: u, text: d });
9207
9207
  }
9208
9208
  function lb(e, t, n) {
9209
9209
  if (n.body.kind !== "reference") return;
@@ -9212,23 +9212,23 @@ function lb(e, t, n) {
9212
9212
  const a = t.filters ?? [];
9213
9213
  if (!s) {
9214
9214
  if (a.length === 0) return;
9215
- const d = ` + { ${a.map(zi).join(", ")} }`;
9216
- r.push({ start: i.end, end: i.end, text: d });
9215
+ const c = ` + { ${a.map(zi).join(", ")} }`;
9216
+ r.push({ start: i.end, end: i.end, text: c });
9217
9217
  return;
9218
9218
  }
9219
9219
  const l = s.wheres.some(
9220
- (d) => d.clauses.some((c) => !c.binding)
9220
+ (c) => c.clauses.some((d) => !d.binding)
9221
9221
  ), u = s.statements.some(
9222
- (d) => !s.wheres.some((c) => c.span.start === d.span.start)
9222
+ (c) => !s.wheres.some((d) => d.span.start === c.span.start)
9223
9223
  );
9224
9224
  if (a.length === 0 && !l && !u) {
9225
- const d = { start: i.end, end: s.span.end }, c = e.parsed.commentIn(d);
9226
- if (c)
9225
+ const c = { start: i.end, end: s.span.end }, d = e.parsed.commentIn(c);
9226
+ if (d)
9227
9227
  return {
9228
9228
  ok: !1,
9229
- reason: `Removing the last filter from \`${t.name}\` would also remove the comment beside its refinement (\`${e.parsed.text.slice(c.start, c.end).trim()}\`), so nothing was written. Delete it in the file first, or edit the refinement there.`
9229
+ reason: `Removing the last filter from \`${t.name}\` would also remove the comment beside its refinement (\`${e.parsed.text.slice(d.start, d.end).trim()}\`), so nothing was written. Delete it in the file first, or edit the refinement there.`
9230
9230
  };
9231
- r.push({ ...d, text: "" });
9231
+ r.push({ ...c, text: "" });
9232
9232
  return;
9233
9233
  }
9234
9234
  return qf(e, t, s);
@@ -9263,16 +9263,16 @@ async function uc(e, t, n) {
9263
9263
  reason: `Cannot edit a file that will not open: ${l.reason}`
9264
9264
  };
9265
9265
  const u = e.split(`
9266
- `), d = zy(e), c = (v) => ({
9267
- start: d[v],
9268
- end: v + 1 < d.length ? d[v + 1] : e.length
9266
+ `), c = zy(e), d = (v) => ({
9267
+ start: c[v],
9268
+ end: v + 1 < c.length ? c[v + 1] : e.length
9269
9269
  }), f = (v) => /^\s*/.exec(u[v])?.[0] ?? "", h = [], p = {
9270
9270
  ...o,
9271
9271
  sourceText: e,
9272
9272
  parsed: l.parsed,
9273
9273
  lines: u,
9274
- starts: d,
9275
- wholeLine: c,
9274
+ starts: c,
9275
+ wholeLine: d,
9276
9276
  indentOf: f,
9277
9277
  current: i,
9278
9278
  next: s,
@@ -9343,13 +9343,13 @@ function Kf({
9343
9343
  const { theme: i } = rt(), [s, o] = U(!1), a = ue(
9344
9344
  () => s ? { text: e } : void 0,
9345
9345
  [s, e]
9346
- ), { draft: l, patch: u, close: d, discard: c } = Kc(
9346
+ ), { draft: l, patch: u, close: c, discard: d } = Kc(
9347
9347
  a,
9348
9348
  s,
9349
9349
  (g) => n(g.text),
9350
9350
  () => o(!1)
9351
9351
  ), f = s && l !== void 0 && l.text !== e, h = l !== void 0 && l.text !== e ? Ni(l.text) : void 0;
9352
- pf(f, () => h !== void 0 ? !1 : (d(), !0));
9352
+ pf(f, () => h !== void 0 ? !1 : (c(), !0));
9353
9353
  const p = J(null), m = J(!1);
9354
9354
  ye(() => {
9355
9355
  s || (m.current = !1);
@@ -9390,7 +9390,7 @@ function Kf({
9390
9390
  );
9391
9391
  }
9392
9392
  const w = l.text !== e ? Ni(l.text) : void 0, v = () => {
9393
- w === void 0 && d();
9393
+ w === void 0 && c();
9394
9394
  };
9395
9395
  return /* @__PURE__ */ K(Se, { spacing: 1, children: [
9396
9396
  /* @__PURE__ */ _(
@@ -9414,7 +9414,7 @@ function Kf({
9414
9414
  g.key === "Escape" ? v() : g.key === "Enter" && (g.metaKey || g.ctrlKey) && (g.preventDefault(), v());
9415
9415
  },
9416
9416
  onBlur: (g) => {
9417
- g.relatedTarget instanceof Node && p.current?.contains(g.relatedTarget) || d();
9417
+ g.relatedTarget instanceof Node && p.current?.contains(g.relatedTarget) || c();
9418
9418
  }
9419
9419
  }
9420
9420
  ),
@@ -9435,7 +9435,7 @@ function Kf({
9435
9435
  size: "small",
9436
9436
  onMouseDown: (g) => g.preventDefault(),
9437
9437
  onClick: () => {
9438
- c(), o(!1);
9438
+ d(), o(!1);
9439
9439
  },
9440
9440
  children: "Cancel"
9441
9441
  }
@@ -9470,8 +9470,8 @@ function fb({
9470
9470
  onSelect: a,
9471
9471
  onOpenMenu: l,
9472
9472
  resizing: u = !1,
9473
- width: d,
9474
- onResizeStart: c,
9473
+ width: c,
9474
+ onResizeStart: d,
9475
9475
  onResizeMove: f,
9476
9476
  onResizeEnd: h,
9477
9477
  children: p
@@ -9601,27 +9601,27 @@ function fb({
9601
9601
  children: /* @__PURE__ */ _(mb, {})
9602
9602
  }
9603
9603
  ),
9604
- c && /* @__PURE__ */ _(
9604
+ d && /* @__PURE__ */ _(
9605
9605
  ze,
9606
9606
  {
9607
9607
  className: "builder-affordance",
9608
9608
  [Ef]: "",
9609
9609
  role: "separator",
9610
- tabIndex: d ? 0 : -1,
9610
+ tabIndex: c ? 0 : -1,
9611
9611
  "aria-orientation": "vertical",
9612
9612
  "aria-label": `Width of ${li(e)}`,
9613
- ...d ? {
9614
- "aria-valuenow": d.span,
9613
+ ...c ? {
9614
+ "aria-valuenow": c.span,
9615
9615
  "aria-valuemin": 1,
9616
- "aria-valuemax": d.columns,
9617
- "aria-valuetext": `${d.span} of ${d.columns} columns`
9616
+ "aria-valuemax": c.columns,
9617
+ "aria-valuetext": `${c.span} of ${c.columns} columns`
9618
9618
  } : {},
9619
9619
  onKeyDown: (v) => {
9620
- if (!d) return;
9621
- const g = v.key === "ArrowRight" ? d.span + 1 : v.key === "ArrowLeft" ? d.span - 1 : v.key === "Home" ? 1 : v.key === "End" ? d.columns : void 0;
9622
- g !== void 0 && (v.preventDefault(), v.stopPropagation(), d.onStep(Math.min(Math.max(g, 1), d.columns)));
9620
+ if (!c) return;
9621
+ const g = v.key === "ArrowRight" ? c.span + 1 : v.key === "ArrowLeft" ? c.span - 1 : v.key === "Home" ? 1 : v.key === "End" ? c.columns : void 0;
9622
+ g !== void 0 && (v.preventDefault(), v.stopPropagation(), c.onStep(Math.min(Math.max(g, 1), c.columns)));
9623
9623
  },
9624
- onPointerDown: c,
9624
+ onPointerDown: d,
9625
9625
  onPointerMove: f,
9626
9626
  onPointerUp: h,
9627
9627
  onPointerCancel: h,
@@ -9836,8 +9836,8 @@ function vb({
9836
9836
  canAdd: a,
9837
9837
  selected: l,
9838
9838
  flash: u,
9839
- menuIndex: d,
9840
- onSelect: c,
9839
+ menuIndex: c,
9840
+ onSelect: d,
9841
9841
  onOpenMenu: f,
9842
9842
  openAdd: h,
9843
9843
  editTile: p,
@@ -9845,7 +9845,7 @@ function vb({
9845
9845
  }) {
9846
9846
  const { dragging: b, preview: w, onDragStart: v, onDragOver: g, onDragEnd: y } = t, { resize: x, startResize: k, onResize: S, endResize: C } = n, $ = x !== void 0 ? e.document.tiles.map(
9847
9847
  (N, q) => q === x.index ? { ...N, colspan: x.span } : N
9848
- ) : w ?? e.document.tiles, E = e.document.tiles.length === 0, B = b ? Iv($, i) : $.map(gf), D = (N) => yb(N, cs(N), p);
9848
+ ) : w ?? e.document.tiles, E = e.document.tiles.length === 0, B = b || x !== void 0 ? Iv($, i) : $.map(gf), D = (N) => yb(N, cs(N), p);
9849
9849
  return /* @__PURE__ */ K(Be, { children: [
9850
9850
  /* @__PURE__ */ _(
9851
9851
  uv,
@@ -9874,9 +9874,9 @@ function vb({
9874
9874
  index: j,
9875
9875
  selected: j === l,
9876
9876
  flash: Ve(q) === u,
9877
- menuOpen: d === j,
9877
+ menuOpen: c === j,
9878
9878
  bare: o === "none",
9879
- ...s && a ? {
9879
+ ...s && a && j < e.document.tiles.length - 1 ? {
9880
9880
  onInsertAfter: () => h(j + 1)
9881
9881
  } : {},
9882
9882
  ...i > 1 && bb(q) ? {
@@ -9895,7 +9895,7 @@ function vb({
9895
9895
  onResizeMove: S,
9896
9896
  onResizeEnd: C
9897
9897
  } : {},
9898
- onSelect: () => c(j),
9898
+ onSelect: () => d(j),
9899
9899
  onOpenMenu: (X) => f(X, j),
9900
9900
  children: je(q) ? /* @__PURE__ */ _(
9901
9901
  ub,
@@ -10141,8 +10141,8 @@ function Sb({
10141
10141
  savesTo: a = "package",
10142
10142
  saveLabel: l,
10143
10143
  saveButton: u,
10144
- actions: d,
10145
- onAddTile: c,
10144
+ actions: c,
10145
+ onAddTile: d,
10146
10146
  onExit: f,
10147
10147
  layout: h,
10148
10148
  onLayoutChange: p
@@ -10181,16 +10181,16 @@ function Sb({
10181
10181
  ) }),
10182
10182
  /* @__PURE__ */ _(Is, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5 } })
10183
10183
  ] }),
10184
- c && /* @__PURE__ */ _(
10184
+ d && /* @__PURE__ */ _(
10185
10185
  Pe,
10186
10186
  {
10187
10187
  startIcon: /* @__PURE__ */ _(Ur, {}),
10188
- onClick: c,
10188
+ onClick: d,
10189
10189
  "aria-label": "Add tile",
10190
10190
  children: "Tile"
10191
10191
  }
10192
10192
  ),
10193
- c && /* @__PURE__ */ _(Is, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5 } }),
10193
+ d && /* @__PURE__ */ _(Is, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5 } }),
10194
10194
  /* @__PURE__ */ _(zt, { title: `Undo (${Ys}Z)`, children: /* @__PURE__ */ _("span", { children: /* @__PURE__ */ _(
10195
10195
  Wi,
10196
10196
  {
@@ -10211,8 +10211,8 @@ function Sb({
10211
10211
  children: /* @__PURE__ */ _(_b, { fontSize: "small" })
10212
10212
  }
10213
10213
  ) }) }),
10214
- (d || o || f) && /* @__PURE__ */ _(Is, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5 } }),
10215
- d,
10214
+ (c || o || f) && /* @__PURE__ */ _(Is, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5 } }),
10215
+ c,
10216
10216
  o ? /* @__PURE__ */ _(
10217
10217
  zt,
10218
10218
  {
@@ -10273,137 +10273,125 @@ function Eb({
10273
10273
  onAdd: i,
10274
10274
  addDisabledReason: s,
10275
10275
  onRemove: o,
10276
- children: a
10276
+ sticky: a = !0,
10277
+ children: l
10277
10278
  }) {
10278
- const { theme: l } = rt();
10279
- return /* @__PURE__ */ _(Be, { children: /* @__PURE__ */ K(
10280
- Se,
10281
- {
10282
- sx: {
10283
- gap: 1,
10284
- position: "sticky",
10285
- // Pinned at the top of the scroller, so the controls stay in
10286
- // reach on a long page.
10287
- top: 0,
10288
- // The page's ground, as the reader's sticky control row uses:
10289
- // this bar is page chrome, not the chart canvas.
10290
- zIndex: ch,
10291
- bgcolor: "background.default",
10292
- pb: 1
10293
- },
10294
- children: [
10295
- /* @__PURE__ */ _(
10279
+ const { theme: u } = rt();
10280
+ return /* @__PURE__ */ _(Be, { children: /* @__PURE__ */ _(ch, { sticky: a, children: /* @__PURE__ */ K(Se, { sx: { gap: 1 }, children: [
10281
+ /* @__PURE__ */ _(
10282
+ Se,
10283
+ {
10284
+ direction: "row",
10285
+ sx: { gap: 2, alignItems: "center", minHeight: 32 },
10286
+ children: /* @__PURE__ */ K(
10296
10287
  Se,
10297
10288
  {
10298
10289
  direction: "row",
10299
- sx: { gap: 2, alignItems: "center", minHeight: 32 },
10300
- children: /* @__PURE__ */ K(
10301
- Se,
10302
- {
10303
- direction: "row",
10304
- role: "group",
10305
- "aria-label": "Filters",
10306
- sx: {
10307
- gap: 1,
10308
- alignItems: "center",
10309
- flexWrap: "wrap",
10310
- flex: 1,
10311
- minWidth: 0
10312
- },
10313
- children: [
10314
- /* @__PURE__ */ _(
10315
- Tb,
10316
- {
10317
- sx: { fontSize: 18, color: l.tileTitle, opacity: 0.7 }
10318
- }
10319
- ),
10320
- /* @__PURE__ */ _(
10321
- ve,
10322
- {
10323
- variant: "subtitle2",
10324
- sx: { color: l.tileTitle, mr: 0.5 },
10325
- children: "Filters"
10326
- }
10327
- ),
10328
- e.length === 0 && /* @__PURE__ */ _(
10329
- ve,
10330
- {
10331
- variant: "body2",
10332
- sx: { color: l.tileTitle, opacity: 0.8 },
10333
- children: "None yet."
10334
- }
10335
- ),
10336
- e.map((u) => {
10337
- const d = n(
10338
- u.name,
10339
- u.type
10340
- );
10341
- return /* @__PURE__ */ _(
10342
- zt,
10290
+ role: "group",
10291
+ "aria-label": "Filters",
10292
+ sx: {
10293
+ gap: 1,
10294
+ alignItems: "center",
10295
+ flexWrap: "wrap",
10296
+ flex: 1,
10297
+ minWidth: 0
10298
+ },
10299
+ children: [
10300
+ /* @__PURE__ */ _(
10301
+ Tb,
10302
+ {
10303
+ sx: {
10304
+ fontSize: 18,
10305
+ color: u.tileTitle,
10306
+ opacity: 0.7
10307
+ }
10308
+ }
10309
+ ),
10310
+ /* @__PURE__ */ _(
10311
+ ve,
10312
+ {
10313
+ variant: "subtitle2",
10314
+ sx: { color: u.tileTitle, mr: 0.5 },
10315
+ children: "Filters"
10316
+ }
10317
+ ),
10318
+ e.length === 0 && /* @__PURE__ */ _(
10319
+ ve,
10320
+ {
10321
+ variant: "body2",
10322
+ sx: { color: u.tileTitle, opacity: 0.8 },
10323
+ children: "None yet."
10324
+ }
10325
+ ),
10326
+ e.map((c) => {
10327
+ const d = n(
10328
+ c.name,
10329
+ c.type
10330
+ );
10331
+ return /* @__PURE__ */ _(
10332
+ zt,
10333
+ {
10334
+ title: d.length > 0 ? `$${c.name} · cannot filter on: ${d.join(", ")}` : `$${c.name} · ${c.origin === "dashboard" ? "declared here" : "from the model"} · ${c.boundTiles} of ${t} tiles`,
10335
+ children: /* @__PURE__ */ _(
10336
+ to,
10343
10337
  {
10344
- title: d.length > 0 ? `$${u.name} · cannot filter on: ${d.join(", ")}` : `$${u.name} · ${u.origin === "dashboard" ? "declared here" : "from the model"} · ${u.boundTiles} of ${t} tiles`,
10345
- children: /* @__PURE__ */ _(
10346
- to,
10338
+ size: "small",
10339
+ label: `${c.label ?? c.name}${c.boundTiles === 0 ? " · unused" : ""}`,
10340
+ "aria-label": `Edit filter ${c.name}`,
10341
+ color: d.length > 0 ? "warning" : "default",
10342
+ variant: c.origin === "dashboard" ? "filled" : "outlined",
10343
+ onClick: () => r(c),
10344
+ onDelete: () => o(c.name),
10345
+ deleteIcon: /* @__PURE__ */ _(
10346
+ Ob,
10347
10347
  {
10348
- size: "small",
10349
- label: `${u.label ?? u.name}${u.boundTiles === 0 ? " · unused" : ""}`,
10350
- "aria-label": `Edit filter ${u.name}`,
10351
- color: d.length > 0 ? "warning" : "default",
10352
- variant: u.origin === "dashboard" ? "filled" : "outlined",
10353
- onClick: () => r(u),
10354
- onDelete: () => o(u.name),
10355
- deleteIcon: /* @__PURE__ */ _(
10356
- Ob,
10357
- {
10358
- "aria-label": `Remove filter ${u.name}`
10359
- }
10360
- ),
10361
- sx: {
10362
- // Faint when nothing binds it: declared, but not yet a
10363
- // control a reader would see.
10364
- opacity: u.boundTiles === 0 ? 0.6 : 1,
10365
- cursor: "pointer",
10366
- transition: `opacity ${mt}`,
10367
- ...Gt
10368
- }
10348
+ "aria-label": `Remove filter ${c.name}`
10369
10349
  }
10370
- )
10371
- },
10372
- u.name
10373
- );
10374
- }),
10375
- /* @__PURE__ */ _(zt, { title: s ?? "", children: /* @__PURE__ */ _("span", { children: /* @__PURE__ */ _(
10376
- to,
10377
- {
10378
- component: "button",
10379
- size: "small",
10380
- variant: "outlined",
10381
- icon: /* @__PURE__ */ _(Ur, {}),
10382
- label: "Filter",
10383
- "aria-label": "Add filter",
10384
- "aria-haspopup": "dialog",
10385
- disabled: s !== void 0,
10386
- onClick: () => i(),
10387
- sx: {
10388
- cursor: "pointer",
10389
- color: l.tileTitle,
10390
- borderStyle: "dashed",
10391
- "& .MuiChip-icon": {
10392
- color: "inherit",
10393
- fontSize: 16
10350
+ ),
10351
+ sx: {
10352
+ // Faint when nothing binds it: declared, but not yet a
10353
+ // control a reader would see.
10354
+ opacity: c.boundTiles === 0 ? 0.6 : 1,
10355
+ cursor: "pointer",
10356
+ transition: `opacity ${mt}`,
10357
+ ...Gt
10394
10358
  }
10395
10359
  }
10360
+ )
10361
+ },
10362
+ c.name
10363
+ );
10364
+ }),
10365
+ /* @__PURE__ */ _(zt, { title: s ?? "", children: /* @__PURE__ */ _("span", { children: /* @__PURE__ */ _(
10366
+ to,
10367
+ {
10368
+ component: "button",
10369
+ size: "small",
10370
+ variant: "outlined",
10371
+ icon: /* @__PURE__ */ _(Ur, {}),
10372
+ label: "Filter",
10373
+ "aria-label": "Add filter",
10374
+ "aria-haspopup": "dialog",
10375
+ disabled: s !== void 0,
10376
+ onClick: () => i(),
10377
+ sx: {
10378
+ cursor: "pointer",
10379
+ color: u.tileTitle,
10380
+ borderStyle: "dashed",
10381
+ "& .MuiChip-icon": {
10382
+ color: "inherit",
10383
+ fontSize: 16
10396
10384
  }
10397
- ) }) })
10398
- ]
10399
- }
10400
- )
10385
+ }
10386
+ }
10387
+ ) }) })
10388
+ ]
10401
10389
  }
10402
- ),
10403
- a
10404
- ]
10405
- }
10406
- ) });
10390
+ )
10391
+ }
10392
+ ),
10393
+ l
10394
+ ] }) }) });
10407
10395
  }
10408
10396
  function Cb(e, t) {
10409
10397
  const n = new Map(
@@ -10429,24 +10417,24 @@ function Ib({
10429
10417
  (m) => m === "description" ? m : void 0
10430
10418
  ),
10431
10419
  []
10432
- ), l = he(() => r("description"), []), u = he(() => r(void 0), []), [d, c] = U(void 0), f = J(!1), h = J(e.document);
10420
+ ), l = he(() => r("description"), []), u = he(() => r(void 0), []), [c, d] = U(void 0), f = J(!1), h = J(e.document);
10433
10421
  ye(() => {
10434
10422
  const m = h.current;
10435
10423
  if (h.current = e.document, !f.current) return;
10436
10424
  f.current = !1;
10437
10425
  const b = Cb(m, e.document);
10438
10426
  if (b === void 0) return;
10439
- c(b), Array.from(
10427
+ d(b), Array.from(
10440
10428
  t.current?.querySelectorAll("[data-tile-key]") ?? []
10441
10429
  ).find((v) => v.dataset.tileKey === b)?.scrollIntoView?.({
10442
10430
  block: "nearest",
10443
10431
  behavior: dh()
10444
10432
  });
10445
10433
  }, [e.document, t]), ye(() => {
10446
- if (d === void 0) return;
10447
- const m = setTimeout(() => c(void 0), 1500);
10434
+ if (c === void 0) return;
10435
+ const m = setTimeout(() => d(void 0), 1500);
10448
10436
  return () => clearTimeout(m);
10449
- }, [d]);
10437
+ }, [c]);
10450
10438
  const p = ue(
10451
10439
  () => ({
10452
10440
  ...e,
@@ -10466,7 +10454,7 @@ function Ib({
10466
10454
  deselectTile: a,
10467
10455
  selectDescription: l,
10468
10456
  clearSelection: u,
10469
- flash: d,
10457
+ flash: c,
10470
10458
  stepEditor: p
10471
10459
  };
10472
10460
  }
@@ -10479,30 +10467,30 @@ function Db({
10479
10467
  }) {
10480
10468
  const [s, o] = U("idle"), [a, l] = U(!1), u = J(r);
10481
10469
  u.current = r;
10482
- const d = J(i);
10483
- d.current = i;
10484
- const c = J(0), f = he(async () => {
10485
- const p = ++c.current;
10470
+ const c = J(i);
10471
+ c.current = i;
10472
+ const d = J(0), f = he(async () => {
10473
+ const p = ++d.current;
10486
10474
  l(!1), o("saving");
10487
10475
  try {
10488
10476
  await u.current();
10489
10477
  } catch {
10490
- c.current === p && o("idle");
10478
+ d.current === p && o("idle");
10491
10479
  return;
10492
10480
  }
10493
- c.current === p && l(!0);
10481
+ d.current === p && l(!0);
10494
10482
  }, []);
10495
10483
  return ye(() => {
10496
10484
  if (s === "waiting") {
10497
10485
  if (t) return;
10498
- e ? f() : (o("idle"), d.current());
10486
+ e ? f() : (o("idle"), c.current());
10499
10487
  } else if (s === "saving") {
10500
10488
  if (!a || t) return;
10501
- o("idle"), e || d.current();
10489
+ o("idle"), e || c.current();
10502
10490
  }
10503
10491
  }, [s, a, t, e, f]), {
10504
10492
  requestExit: he(() => {
10505
- s === "idle" && (e ? o("asking") : d.current());
10493
+ s === "idle" && (e ? o("asking") : c.current());
10506
10494
  }, [s, e]),
10507
10495
  dialog: {
10508
10496
  open: s === "asking",
@@ -10511,7 +10499,7 @@ function Db({
10511
10499
  s === "asking" && o("idle");
10512
10500
  },
10513
10501
  onDiscard: () => {
10514
- s === "asking" && (o("idle"), d.current());
10502
+ s === "asking" && (o("idle"), c.current());
10515
10503
  },
10516
10504
  onSaveAndExit: () => {
10517
10505
  s === "asking" && (t ? o("waiting") : f());
@@ -10531,7 +10519,7 @@ function Ab({
10531
10519
  prepare: l,
10532
10520
  shortcuts: u
10533
10521
  }) {
10534
- const [d, c] = U(!1), [f, h] = U(!1), p = J(null), m = J(o);
10522
+ const [c, d] = U(!1), [f, h] = U(!1), p = J(null), m = J(o);
10535
10523
  m.current = o;
10536
10524
  const b = e.dirty || s, w = (e.edited ?? e.dirty) || s;
10537
10525
  ye(() => {
@@ -10546,7 +10534,7 @@ function Ab({
10546
10534
  h(!1);
10547
10535
  }, [e.document]);
10548
10536
  const y = he(() => {
10549
- c(!0), h(!1);
10537
+ d(!0), h(!1);
10550
10538
  const j = Nt(), { structural: X } = e, Q = e.pendingOpen ?? !1, se = m.current.size;
10551
10539
  return e.save().then((fe) => {
10552
10540
  fe.ok === !0 ? m.current.saved({
@@ -10555,15 +10543,15 @@ function Ab({
10555
10543
  fromOpen: Q,
10556
10544
  durationMs: Nt() - j
10557
10545
  }) : m.current.refused(fe.reason);
10558
- }).finally(() => c(!1));
10546
+ }).finally(() => d(!1));
10559
10547
  }, [e]), x = J(!1), k = J(!1);
10560
10548
  ye(() => {
10561
- !k.current || d || (k.current = !1, p.current?.focus());
10562
- }, [f, d]);
10549
+ !k.current || c || (k.current = !1, p.current?.focus());
10550
+ }, [f, c]);
10563
10551
  const S = he(() => {
10564
- if (!t || d || x.current || !e.canUndoSave)
10552
+ if (!t || c || x.current || !e.canUndoSave)
10565
10553
  return;
10566
- x.current = !0, c(!0);
10554
+ x.current = !0, d(!0);
10567
10555
  const j = Nt(), X = e.lastSave?.structural ?? !1, Q = m.current.size;
10568
10556
  return e.undoSave().then((se) => {
10569
10557
  se.ok === !0 ? (k.current = !0, h(!0), m.current.undone({
@@ -10573,19 +10561,19 @@ function Ab({
10573
10561
  durationMs: Nt() - j
10574
10562
  })) : m.current.undoRefused(se.reason);
10575
10563
  }).finally(() => {
10576
- x.current = !1, c(!1);
10564
+ x.current = !1, d(!1);
10577
10565
  });
10578
- }, [t, d, e]), C = he(() => {
10579
- if (!(!t || !e.dirty || d))
10566
+ }, [t, c, e]), C = he(() => {
10567
+ if (!(!t || !e.dirty || c))
10580
10568
  return y();
10581
- }, [t, e, d, y]), $ = J(C);
10569
+ }, [t, e, c, y]), $ = J(C);
10582
10570
  $.current = C;
10583
10571
  const E = he(() => {
10584
10572
  const j = () => $.current();
10585
10573
  return l ? l(j) : j();
10586
10574
  }, [l]), B = Db({
10587
10575
  dirty: w,
10588
- saving: d,
10576
+ saving: c,
10589
10577
  canSave: !!t,
10590
10578
  save: E,
10591
10579
  onExit: () => r?.()
@@ -10603,19 +10591,19 @@ function Ab({
10603
10591
  [u, e, t, E, B.dialog.open]
10604
10592
  )
10605
10593
  );
10606
- const D = !!t && !d && e.canUndoSave, N = e.lastSave, q = {
10594
+ const D = !!t && !c && e.canUndoSave, N = e.lastSave, q = {
10607
10595
  canUndo: e.canUndo,
10608
10596
  canRedo: e.canRedo,
10609
10597
  onUndo: e.undo,
10610
10598
  onRedo: e.redo,
10611
10599
  dirty: b,
10612
- saving: d,
10600
+ saving: c,
10613
10601
  saveButton: p,
10614
10602
  ...t ? { onSave: E } : {},
10615
10603
  ...r ? { onExit: B.requestExit } : {}
10616
10604
  };
10617
10605
  return {
10618
- saving: d,
10606
+ saving: c,
10619
10607
  save: E,
10620
10608
  exitGuard: B,
10621
10609
  /** Write the file back as it was before the last save, and put the edits back unsaved. */
@@ -10702,31 +10690,31 @@ function Nb(e, t = /* @__PURE__ */ new Set()) {
10702
10690
  if (mc(l, t)) continue;
10703
10691
  const u = uh(a.modelInfo);
10704
10692
  s.set(a, u);
10705
- for (const { name: d } of a.sources ?? [])
10706
- d && o.set(d, [...o.get(d) ?? [], l]);
10707
- for (const d of u)
10708
- i.set(d, [...i.get(d) ?? [], l]);
10693
+ for (const { name: c } of a.sources ?? [])
10694
+ c && o.set(c, [...o.get(c) ?? [], l]);
10695
+ for (const c of u)
10696
+ i.set(c, [...i.get(c) ?? [], l]);
10709
10697
  }
10710
10698
  for (const a of e) {
10711
10699
  const l = vc(a);
10712
10700
  if (mc(l, t)) continue;
10713
- const u = Mb(a), d = Lb(a);
10714
- for (const c of a.sources ?? []) {
10715
- const f = c.name;
10701
+ const u = Mb(a), c = Lb(a);
10702
+ for (const d of a.sources ?? []) {
10703
+ const f = d.name;
10716
10704
  if (!f || !s.get(a)?.has(f) || r.has(f)) continue;
10717
10705
  r.add(f);
10718
- const h = (c.givens ?? []).map((p) => p.name).filter((p) => typeof p == "string");
10706
+ const h = (d.givens ?? []).map((p) => p.name).filter((p) => typeof p == "string");
10719
10707
  n.push({
10720
10708
  name: f,
10721
10709
  modelPath: l,
10722
10710
  exporters: i.get(f) ?? [l],
10723
10711
  visibleIn: o.get(f) ?? [l],
10724
- ...wi(c.annotations) ? { description: wi(c.annotations) } : {},
10725
- views: (c.views ?? []).filter((p) => typeof p.name == "string").map((p) => ({
10712
+ ...wi(d.annotations) ? { description: wi(d.annotations) } : {},
10713
+ views: (d.views ?? []).filter((p) => typeof p.name == "string").map((p) => ({
10726
10714
  name: p.name,
10727
10715
  ...wi(p.annotations) ? { description: wi(p.annotations) } : {},
10728
10716
  ...pc(p.annotations) ? { chart: pc(p.annotations) } : {},
10729
- ...d.get(f)?.has(p.name) ? { aggregateOnly: !0 } : {}
10717
+ ...c.get(f)?.has(p.name) ? { aggregateOnly: !0 } : {}
10730
10718
  })),
10731
10719
  givens: h,
10732
10720
  fields: u.get(f) ?? []
@@ -10762,7 +10750,7 @@ function zb({
10762
10750
  // source IS a model source, and may be in the catalog directly.
10763
10751
  gc(r, p.source),
10764
10752
  [l, r]
10765
- ), d = (p, m) => {
10753
+ ), c = (p, m) => {
10766
10754
  const b = [];
10767
10755
  for (const w of e.document.tiles) {
10768
10756
  if (!ke(w)) continue;
@@ -10775,7 +10763,7 @@ function zb({
10775
10763
  );
10776
10764
  }
10777
10765
  return b;
10778
- }, c = ue(
10766
+ }, d = ue(
10779
10767
  () => a.filter((p) => p.origin === "model" && p.boundTiles === 0),
10780
10768
  [a]
10781
10769
  );
@@ -10784,8 +10772,8 @@ function zb({
10784
10772
  setFilterDialog: s,
10785
10773
  controlList: a,
10786
10774
  fieldsFor: u,
10787
- unknownFieldsOf: d,
10788
- available: c,
10775
+ unknownFieldsOf: c,
10776
+ available: d,
10789
10777
  applyFilter: (p, m, b) => {
10790
10778
  s(void 0), e.update((w) => {
10791
10779
  b && wp(w, b), bp(w, p, m);
@@ -10827,12 +10815,12 @@ function Fb(e) {
10827
10815
  } = e, [o, a] = U({
10828
10816
  stack: [e.document],
10829
10817
  index: 0
10830
- }), [l, u] = U(e.source), [d, c] = U(void 0), [f, h] = U(e.document), [p, m] = U(s), [b, w] = U(e.replaces), [v, g] = U(!1), y = o.stack[o.index], x = J(o);
10818
+ }), [l, u] = U(e.source), [c, d] = U(void 0), [f, h] = U(e.document), [p, m] = U(s), [b, w] = U(e.replaces), [v, g] = U(!1), y = o.stack[o.index], x = J(o);
10831
10819
  x.current = o;
10832
10820
  const k = J(!1), [S, C] = U(!1), $ = (A) => {
10833
10821
  k.current = A, C(A);
10834
10822
  }, [E, B] = U(void 0), D = he((A) => {
10835
- c(void 0), a((F) => {
10823
+ d(void 0), a((F) => {
10836
10824
  const ne = structuredClone(F.stack[F.index]);
10837
10825
  if (A(ne), JSON.stringify(ne) === JSON.stringify(F.stack[F.index]))
10838
10826
  return F;
@@ -10840,11 +10828,11 @@ function Fb(e) {
10840
10828
  return { stack: V, index: V.length - 1 };
10841
10829
  });
10842
10830
  }, []), N = he(() => {
10843
- c(void 0), a(
10831
+ d(void 0), a(
10844
10832
  (A) => A.index > 0 ? { ...A, index: A.index - 1 } : A
10845
10833
  );
10846
10834
  }, []), q = he(() => {
10847
- c(void 0), a(
10835
+ d(void 0), a(
10848
10836
  (A) => A.index < A.stack.length - 1 ? { ...A, index: A.index + 1 } : A
10849
10837
  );
10850
10838
  }, []), j = he(
@@ -10874,12 +10862,12 @@ function Fb(e) {
10874
10862
  try {
10875
10863
  const Y = await j(l, y);
10876
10864
  if (Vo(Y))
10877
- return c(Y.reason), { ok: !1, reason: Y.reason };
10865
+ return d(Y.reason), { ok: !1, reason: Y.reason };
10878
10866
  try {
10879
10867
  await n?.(Y.source, { purpose: "save", document: y });
10880
10868
  } catch (M) {
10881
10869
  const O = `Could not save: ${M instanceof Error ? M.message : String(M)}`;
10882
- return c(O), { ok: !1, reason: O };
10870
+ return d(O), { ok: !1, reason: O };
10883
10871
  }
10884
10872
  u(Y.source), h(y), m(!1), w(void 0), g(!1);
10885
10873
  const V = F ? { stack: [y], index: 0 } : A.history;
@@ -10896,7 +10884,7 @@ function Fb(e) {
10896
10884
  clearsHistory: F
10897
10885
  }
10898
10886
  } : void 0
10899
- ), c(void 0), { ok: !0 };
10887
+ ), d(void 0), { ok: !0 };
10900
10888
  } finally {
10901
10889
  $(!1);
10902
10890
  }
@@ -10925,11 +10913,11 @@ function Fb(e) {
10925
10913
  });
10926
10914
  } catch (F) {
10927
10915
  const ne = `Could not undo the save: ${F instanceof Error ? F.message : String(F)}`;
10928
- return c(ne), { ok: !1, reason: ne };
10916
+ return d(ne), { ok: !1, reason: ne };
10929
10917
  } finally {
10930
10918
  $(!1);
10931
10919
  }
10932
- return u(A.source), h(A.saved), m(A.pendingOpen), w(A.replacing), g(A.unwritten || A.replacing !== void 0), a((F) => F === E.after ? A.history : F), B(void 0), c(void 0), { ok: !0 };
10920
+ return u(A.source), h(A.saved), m(A.pendingOpen), w(A.replacing), g(A.unwritten || A.replacing !== void 0), a((F) => F === E.after ? A.history : F), B(void 0), d(void 0), { ok: !0 };
10933
10921
  }, [n, E]), se = ue(
10934
10922
  () => v || JSON.stringify(y) !== JSON.stringify(f),
10935
10923
  [y, f, v]
@@ -10952,7 +10940,7 @@ function Fb(e) {
10952
10940
  dirty: se || p,
10953
10941
  edited: se,
10954
10942
  pendingOpen: p,
10955
- ...d === void 0 ? {} : { error: d },
10943
+ ...c === void 0 ? {} : { error: c },
10956
10944
  update: D,
10957
10945
  undo: N,
10958
10946
  redo: q,
@@ -11017,10 +11005,10 @@ function qb(e, t, { modelPath: n, textHeld: r, notebook: i, insertAt: s }) {
11017
11005
  ));
11018
11006
  let o = e.sources.find((u) => u.base === t.base);
11019
11007
  if (!o) {
11020
- const u = new Set(e.sources.map((c) => c.name));
11021
- let d = `${t.base}_tiles`;
11022
- for (let c = 2; u.has(d); c++) d = `${t.base}_tiles_${c}`;
11023
- o = { name: d, base: t.base }, e.sources.push(o);
11008
+ const u = new Set(e.sources.map((d) => d.name));
11009
+ let c = `${t.base}_tiles`;
11010
+ for (let d = 2; u.has(c); d++) c = `${t.base}_tiles_${d}`;
11011
+ o = { name: c, base: t.base }, e.sources.push(o);
11024
11012
  }
11025
11013
  const a = new Set(
11026
11014
  e.tiles.filter(ke).filter((u) => u.source === o.name).map((u) => u.name)
@@ -11046,39 +11034,39 @@ function Kb({
11046
11034
  selectTile: s,
11047
11035
  deselectTile: o
11048
11036
  }) {
11049
- const [a, l] = U(void 0), [u, d] = U(!1), [c, f] = U(void 0);
11037
+ const [a, l] = U(void 0), [u, c] = U(!1), [d, f] = U(void 0);
11050
11038
  return {
11051
11039
  menu: a,
11052
11040
  setMenu: l,
11053
11041
  addingTile: u,
11054
11042
  openAdd: (g) => {
11055
- f(g), d(!0);
11043
+ f(g), c(!0);
11056
11044
  },
11057
- closeAdd: () => d(!1),
11045
+ closeAdd: () => c(!1),
11058
11046
  addTile: (g) => {
11059
- d(!1), e.update(
11047
+ c(!1), e.update(
11060
11048
  (y) => qb(y, g, {
11061
11049
  modelPath: r,
11062
11050
  textHeld: i,
11063
11051
  notebook: t,
11064
- insertAt: c
11052
+ insertAt: d
11065
11053
  })
11066
- ), s(c ?? e.document.tiles.length);
11054
+ ), s(d ?? e.document.tiles.length);
11067
11055
  },
11068
11056
  addText: () => {
11069
- d(!1), e.update((g) => {
11057
+ c(!1), e.update((g) => {
11070
11058
  const y = new Set(
11071
11059
  g.tiles.filter(je).map((k) => k.name)
11072
11060
  );
11073
11061
  let x = 1;
11074
11062
  for (; y.has(`text_${x}`); ) x++;
11075
- g.tiles.splice(c ?? g.tiles.length, 0, {
11063
+ g.tiles.splice(d ?? g.tiles.length, 0, {
11076
11064
  kind: "text",
11077
11065
  name: `text_${x}`,
11078
11066
  markdown: "",
11079
11067
  ...t ? {} : { colspan: n }
11080
11068
  });
11081
- }), s(c ?? e.document.tiles.length);
11069
+ }), s(d ?? e.document.tiles.length);
11082
11070
  },
11083
11071
  editTile: (g, y) => e.update((x) => {
11084
11072
  const k = x.tiles.find((S) => Ve(S) === g);
@@ -11135,11 +11123,11 @@ function Qb(e, t, n) {
11135
11123
  return n(e, g, y);
11136
11124
  }
11137
11125
  const u = Object.entries(e);
11138
- let d = -1, c, f = -1, h;
11126
+ let c = -1, d, f = -1, h;
11139
11127
  for (const [g, y] of u)
11140
- if (d === -1 && (d = y.findIndex((x) => l(x, s.id)), d !== -1 && (c = g)), f === -1 && (f = y.findIndex((x) => l(x, o.id)), f !== -1 && (h = g)), d !== -1 && f !== -1)
11128
+ if (c === -1 && (c = y.findIndex((x) => l(x, s.id)), c !== -1 && (d = g)), f === -1 && (f = y.findIndex((x) => l(x, o.id)), f !== -1 && (h = g)), c !== -1 && f !== -1)
11141
11129
  break;
11142
- if (d === -1 && Zs(s)) {
11130
+ if (c === -1 && Zs(s)) {
11143
11131
  const g = s.initialGroup == null ? void 0 : xi(e, s.initialGroup), y = s.initialIndex, x = s.group == null ? void 0 : xi(e, s.group), k = s.index;
11144
11132
  if (g == null || x == null || g === x && y === k)
11145
11133
  return "preventDefault" in t && t.preventDefault(), e;
@@ -11169,25 +11157,25 @@ function Qb(e, t, n) {
11169
11157
  h = g, f = y;
11170
11158
  }
11171
11159
  }
11172
- if (c == null || h == null || c === h && d === f) {
11173
- if (c != null && c === h && d === f && Zs(s)) {
11174
- const g = s.group == null ? void 0 : xi(e, s.group), y = s.group != null && g !== c, x = s.index !== d;
11160
+ if (d == null || h == null || d === h && c === f) {
11161
+ if (d != null && d === h && c === f && Zs(s)) {
11162
+ const g = s.group == null ? void 0 : xi(e, s.group), y = s.group != null && g !== d, x = s.index !== c;
11175
11163
  if (y || x) {
11176
- const k = s.group == null ? c : g;
11164
+ const k = s.group == null ? d : g;
11177
11165
  if (k != null) {
11178
- if (c === k)
11166
+ if (d === k)
11179
11167
  return kn(_n({}, e), {
11180
- [c]: n(
11181
- e[c],
11182
- d,
11168
+ [d]: n(
11169
+ e[d],
11170
+ c,
11183
11171
  s.index
11184
11172
  )
11185
11173
  });
11186
- const S = e[c][d];
11174
+ const S = e[d][c];
11187
11175
  return kn(_n({}, e), {
11188
- [c]: [
11189
- ...e[c].slice(0, d),
11190
- ...e[c].slice(d + 1)
11176
+ [d]: [
11177
+ ...e[d].slice(0, c),
11178
+ ...e[d].slice(c + 1)
11191
11179
  ],
11192
11180
  [k]: [
11193
11181
  ...e[k].slice(0, s.index),
@@ -11200,15 +11188,15 @@ function Qb(e, t, n) {
11200
11188
  }
11201
11189
  return "preventDefault" in t && t.preventDefault(), e;
11202
11190
  }
11203
- if (c === h)
11191
+ if (d === h)
11204
11192
  return kn(_n({}, e), {
11205
- [c]: n(e[c], d, f)
11193
+ [d]: n(e[d], c, f)
11206
11194
  });
11207
- const w = o.shape && Math.round(m.y) > Math.round(o.shape.center.y) ? 1 : 0, v = e[c][d];
11195
+ const w = o.shape && Math.round(m.y) > Math.round(o.shape.center.y) ? 1 : 0, v = e[d][c];
11208
11196
  return kn(_n({}, e), {
11209
- [c]: [
11210
- ...e[c].slice(0, d),
11211
- ...e[c].slice(d + 1)
11197
+ [d]: [
11198
+ ...e[d].slice(0, c),
11199
+ ...e[d].slice(c + 1)
11212
11200
  ],
11213
11201
  [h]: [
11214
11202
  ...e[h].slice(0, f + w),
@@ -11230,8 +11218,8 @@ function e0({
11230
11218
  ), s = J(void 0), [o, a] = U(!1);
11231
11219
  return { dragging: o, preview: r, onDragStart: () => {
11232
11220
  a(!0), s.current = e;
11233
- }, onDragOver: (c) => {
11234
- const { source: f, target: h } = c.operation;
11221
+ }, onDragOver: (d) => {
11222
+ const { source: f, target: h } = d.operation;
11235
11223
  if (!f || !h) return;
11236
11224
  const p = s.current ?? e;
11237
11225
  let m;
@@ -11241,7 +11229,7 @@ function e0({
11241
11229
  const g = p.filter((y, x) => x !== w).findIndex((y) => Ve(y) === b) + 1;
11242
11230
  m = Cv(p, w, g);
11243
11231
  } else {
11244
- const b = p.map(Ve), w = Jb(b, c);
11232
+ const b = p.map(Ve), w = Jb(b, d);
11245
11233
  if (w.every((g, y) => g === b[y])) return;
11246
11234
  const v = new Map(p.map((g) => [Ve(g), g]));
11247
11235
  m = Ev(
@@ -11250,13 +11238,13 @@ function e0({
11250
11238
  );
11251
11239
  }
11252
11240
  s.current = m, i(m);
11253
- }, onDragEnd: (c) => {
11241
+ }, onDragEnd: (d) => {
11254
11242
  a(!1);
11255
11243
  const f = s.current;
11256
- if (s.current = void 0, i(void 0), c.canceled || !f) return;
11244
+ if (s.current = void 0, i(void 0), d.canceled || !f) return;
11257
11245
  t(f);
11258
11246
  const h = f.findIndex(
11259
- (p) => Ve(p) === c.operation.source?.id
11247
+ (p) => Ve(p) === d.operation.source?.id
11260
11248
  );
11261
11249
  h >= 0 && n(h);
11262
11250
  } };
@@ -11316,8 +11304,8 @@ function Yf({
11316
11304
  renderTile: a,
11317
11305
  controls: l,
11318
11306
  givens: u,
11319
- catalog: d,
11320
- toolbar: c,
11307
+ catalog: c,
11308
+ toolbar: d,
11321
11309
  dashboards: f,
11322
11310
  onEvent: h,
11323
11311
  conversion: p,
@@ -11371,7 +11359,7 @@ function Yf({
11371
11359
  editor: x,
11372
11360
  opened: t,
11373
11361
  givens: u,
11374
- catalog: d
11362
+ catalog: c
11375
11363
  }), { filterDialog: V, setFilterDialog: M } = Y, [O, z] = U(
11376
11364
  void 0
11377
11365
  ), { draftDirty: I, openDraft: ee, prepare: H } = Gb({
@@ -11430,8 +11418,8 @@ function Yf({
11430
11418
  Sb,
11431
11419
  {
11432
11420
  ...Z.toolbarProps,
11433
- ...c ? { actions: c } : {},
11434
- ...d ? { onAddTile: () => ne() } : {},
11421
+ ...d ? { actions: d } : {},
11422
+ ...c ? { onAddTile: () => ne() } : {},
11435
11423
  savesTo: m,
11436
11424
  ...b ? { saveLabel: b } : {},
11437
11425
  ...g === void 0 && o ? {
@@ -11496,7 +11484,7 @@ function Yf({
11496
11484
  },
11497
11485
  children: [
11498
11486
  /* @__PURE__ */ _(ve, { variant: "body2", children: "This report is not served until it has a tile." }),
11499
- d && /* @__PURE__ */ _(
11487
+ c && /* @__PURE__ */ _(
11500
11488
  Pe,
11501
11489
  {
11502
11490
  size: "small",
@@ -11510,6 +11498,7 @@ function Yf({
11510
11498
  ) }) : /* @__PURE__ */ _(
11511
11499
  Eb,
11512
11500
  {
11501
+ sticky: !j,
11513
11502
  controls: Y.controlList,
11514
11503
  tileCount: x.document.tiles.length,
11515
11504
  unknownFieldsOf: Y.unknownFieldsOf,
@@ -11533,7 +11522,7 @@ function Yf({
11533
11522
  columns: X,
11534
11523
  notebook: j,
11535
11524
  chrome: Q,
11536
- canAdd: !!d,
11525
+ canAdd: !!c,
11537
11526
  selected: S,
11538
11527
  flash: N,
11539
11528
  menuIndex: A?.index,
@@ -11550,7 +11539,7 @@ function Yf({
11550
11539
  Ep,
11551
11540
  {
11552
11541
  editor: x,
11553
- catalog: d,
11542
+ catalog: c,
11554
11543
  columns: X,
11555
11544
  dashboards: f,
11556
11545
  bindings: Y,
@@ -11620,29 +11609,29 @@ function o0(e, t, n, r = /* @__PURE__ */ new Map(), i) {
11620
11609
  (e.localGivens ?? []).map((m) => [m.name, m.type])
11621
11610
  ), l = e.sources.find((m) => m.name === s)?.scopedBy ?? [], u = new Set(
11622
11611
  [...l, ...i ?? []].filter((m) => n.has(m))
11623
- ), d = /* @__PURE__ */ new Set([...l, ...i ?? []]), c = [];
11612
+ ), c = /* @__PURE__ */ new Set([...l, ...i ?? []]), d = [];
11624
11613
  for (const m of t.filters ?? []) {
11625
11614
  const b = `where: ${ra(m.field)} ${m.op ?? "~"}`;
11626
11615
  if (n.has(m.given)) {
11627
- u.add(m.given), d.add(m.given), c.push(`${b} $${m.given}`);
11616
+ u.add(m.given), c.add(m.given), d.push(`${b} $${m.given}`);
11628
11617
  continue;
11629
11618
  }
11630
11619
  if (!a.has(m.given)) continue;
11631
- d.add(m.given);
11620
+ c.add(m.given);
11632
11621
  const w = gh(
11633
11622
  r.get(m.given),
11634
11623
  a.get(m.given)
11635
11624
  );
11636
- w !== void 0 && c.push(`${b} ${w}`);
11625
+ w !== void 0 && d.push(`${b} ${w}`);
11637
11626
  }
11638
- const f = c.join(", "), h = t.chart, p = h === "none" || Ss(h) ? Nn(h, t.chartCarried) : h === "custom" && t.chartLines?.length ? t.chartLines.join(`
11627
+ const f = d.join(", "), h = t.chart, p = h === "none" || Ss(h) ? Nn(h, t.chartCarried) : h === "custom" && t.chartLines?.length ? t.chartLines.join(`
11639
11628
  `) : h === "default" && s0(t.declaration) ? Nn("none") : void 0;
11640
11629
  return {
11641
11630
  ...p ? { annotation: p } : {},
11642
11631
  expression: `${s} -> ${o}` + (f ? ` + { ${f} }` : ""),
11643
11632
  givenNames: Array.from(u),
11644
11633
  // No served entry and nothing from the document: the model may still scope it, so say nothing.
11645
- reads: i || d.size > 0 ? Array.from(d) : void 0
11634
+ reads: i || c.size > 0 ? Array.from(c) : void 0
11646
11635
  };
11647
11636
  }
11648
11637
  function a0({
@@ -11671,11 +11660,11 @@ function a0({
11671
11660
  ...i.flatMap((p) => p.path ? [p.path] : [])
11672
11661
  ]),
11673
11662
  [i, r]
11674
- ), d = ue(
11663
+ ), c = ue(
11675
11664
  () => s ? (l ?? []).filter((p) => !u.has(p)) : [],
11676
11665
  [l, u, s]
11677
- ), c = op({
11678
- queries: d.map((p) => ({
11666
+ ), d = op({
11667
+ queries: c.map((p) => ({
11679
11668
  // `useQueries` bypasses `useQueryWithApiError`, so the server is added here to keep two servers' caches apart.
11680
11669
  queryKey: [
11681
11670
  "report-editor-model",
@@ -11693,17 +11682,17 @@ function a0({
11693
11682
  )).data,
11694
11683
  retry: !1
11695
11684
  }))
11696
- }), f = l !== void 0 && s && c.every((p) => p.isSuccess || p.isError), h = c.map((p) => p.dataUpdatedAt).join();
11685
+ }), f = l !== void 0 && s && d.every((p) => p.isSuccess || p.isError), h = d.map((p) => p.dataUpdatedAt).join();
11697
11686
  return ue(
11698
11687
  () => f ? Nb(
11699
- c.flatMap(
11688
+ d.flatMap(
11700
11689
  (p) => p.data ? [p.data] : []
11701
11690
  ),
11702
11691
  u
11703
11692
  ) : void 0,
11704
11693
  // `results` is read through `wanted` and `version`, which change when the set of models or any one's data does.
11705
11694
  // eslint-disable-next-line react-hooks/exhaustive-deps
11706
- [f, d, h, u]
11695
+ [f, c, h, u]
11707
11696
  );
11708
11697
  }
11709
11698
  const l0 = {};
@@ -11718,8 +11707,8 @@ function c0({
11718
11707
  replaces: a,
11719
11708
  onSave: l,
11720
11709
  onDirtyChange: u,
11721
- onExit: d,
11722
- allowLayoutChange: c,
11710
+ onExit: c,
11711
+ allowLayoutChange: d,
11723
11712
  onEvent: f,
11724
11713
  savesTo: h,
11725
11714
  saveLabel: p,
@@ -11953,8 +11942,8 @@ function c0({
11953
11942
  })),
11954
11943
  onChange: F,
11955
11944
  onDirtyChange: u,
11956
- ...d ? { onExit: d } : {},
11957
- ...c !== void 0 ? { allowLayoutChange: c } : {},
11945
+ ...c ? { onExit: c } : {},
11946
+ ...d !== void 0 ? { allowLayoutChange: d } : {},
11958
11947
  ...o.conversion ? { conversion: o.conversion } : {},
11959
11948
  ...W ? { catalog: W } : {},
11960
11949
  dashboards: fe,
@@ -11988,7 +11977,7 @@ function d0({
11988
11977
  packageName: i,
11989
11978
  modelPath: s
11990
11979
  }) {
11991
- const [o, a] = U(void 0), [l, u] = U(void 0), [d, c] = U(e === void 0), [f, h] = U(!1), [p, m] = U(
11980
+ const [o, a] = U(void 0), [l, u] = U(void 0), [c, d] = U(e === void 0), [f, h] = U(!1), [p, m] = U(
11992
11981
  void 0
11993
11982
  );
11994
11983
  return ye(() => {
@@ -12018,7 +12007,7 @@ function d0({
12018
12007
  if (b) return;
12019
12008
  m(Pc(w));
12020
12009
  }
12021
- b || c(!0);
12010
+ b || d(!0);
12022
12011
  })(), () => {
12023
12012
  b = !0;
12024
12013
  };
@@ -12026,7 +12015,7 @@ function d0({
12026
12015
  workspace: o,
12027
12016
  draft: l,
12028
12017
  setDraft: u,
12029
- draftChecked: d,
12018
+ draftChecked: c,
12030
12019
  offered: f,
12031
12020
  setOffered: h,
12032
12021
  readFailure: p
@@ -12076,8 +12065,8 @@ async function g0(e) {
12076
12065
  ok: !1,
12077
12066
  refused: "This build of Malloy does not expose a parse tree and token stream the notebook builder can read, so editing is off."
12078
12067
  };
12079
- const d = (T) => l.getSymbolicName(T.type), c = (T) => i.routeOf({ value: T.trimStart() }), f = (T) => i.payloadOf({ value: T }), h = (T) => T === "markdown" || T === '"' || T === "text", p = (T) => ki(f(T)).replace(/\n$/, ""), m = (T, G) => {
12080
- const W = f(T).trim(), A = c(T) !== '"' && h0.test(W) ? "" : W;
12068
+ const c = (T) => l.getSymbolicName(T.type), d = (T) => i.routeOf({ value: T.trimStart() }), f = (T) => i.payloadOf({ value: T }), h = (T) => T === "markdown" || T === '"' || T === "text", p = (T) => ki(f(T)).replace(/\n$/, ""), m = (T, G) => {
12069
+ const W = f(T).trim(), A = d(T) !== '"' && h0.test(W) ? "" : W;
12081
12070
  return ki(
12082
12071
  [A && `${A}
12083
12072
  `, ...G].join("")
@@ -12111,18 +12100,18 @@ async function g0(e) {
12111
12100
  const V = u[Y];
12112
12101
  if (V.startIndex > G) break;
12113
12102
  if (V.channel !== 0) continue;
12114
- const M = d(V);
12103
+ const M = c(V);
12115
12104
  if (M !== "ANNOTATION" && M !== "BLOCK_ANNOTATION_BEGIN") {
12116
12105
  F.insertAt = b.lineStarts[b.line(b.utf16(V.startIndex))];
12117
12106
  break;
12118
12107
  }
12119
12108
  const O = ki(v(V)), z = [];
12120
12109
  if (M === "BLOCK_ANNOTATION_BEGIN") {
12121
- for (; d(u[Y + 1] ?? V) === "BLOCK_ANNOTATION_TEXT"; )
12110
+ for (; c(u[Y + 1] ?? V) === "BLOCK_ANNOTATION_TEXT"; )
12122
12111
  z.push(v(u[++Y]));
12123
- d(u[Y + 1] ?? V) === "BLOCK_ANNOTATION_END" && Y++;
12112
+ c(u[Y + 1] ?? V) === "BLOCK_ANNOTATION_END" && Y++;
12124
12113
  }
12125
- if (h(c(O))) {
12114
+ if (h(d(O))) {
12126
12115
  const I = b.utf16(V.startIndex), ee = b.lineStarts[b.line(I)], H = /^[ \t]*$/.test(e.slice(ee, I));
12127
12116
  A.push({
12128
12117
  start: H ? ee : I,
@@ -12142,7 +12131,7 @@ async function g0(e) {
12142
12131
  });
12143
12132
  } else Gr(I) && F.unmodelled === void 0 && (F.unmodelled = I.trim());
12144
12133
  }
12145
- if (c(O) !== "markdown")
12134
+ if (d(O) !== "markdown")
12146
12135
  ne = -2;
12147
12136
  else if (M === "BLOCK_ANNOTATION_BEGIN")
12148
12137
  W.push(m(O, z)), ne = -2;
@@ -12166,7 +12155,7 @@ ${I}` : W.push(I), ne = V.line;
12166
12155
  for (let T = 0; T < (o.childCount ?? 0); T++) {
12167
12156
  const G = o.getChild(T);
12168
12157
  if (!mn(G)) {
12169
- const V = G?.symbol, M = V ? d(V) : void 0;
12158
+ const V = G?.symbol, M = V ? c(V) : void 0;
12170
12159
  if (V && M === "EOF") continue;
12171
12160
  if (V && M === "SEMI") {
12172
12161
  k.push([V.startIndex, V.stopIndex]);
@@ -12222,10 +12211,10 @@ ${I}` : W.push(I), ne = V.line;
12222
12211
  const O = dr(V, "docBlockAnnotation") !== void 0, z = u.filter(
12223
12212
  (R) => R.startIndex >= M.startCp && R.stopIndex <= M.stopCp
12224
12213
  ), I = z.filter(
12225
- (R) => d(R) === "BLOCK_ANNOTATION_TEXT"
12214
+ (R) => c(R) === "BLOCK_ANNOTATION_TEXT"
12226
12215
  ), ee = I[I.length - 1] ?? z[0], H = ki(
12227
12216
  O && ee ? e.slice(M.start, b.utf16(ee.stopIndex + 1)).replace(/\r?\n$/, "") : e.slice(M.start, M.end)
12228
- ), le = c(H), ce = h(le) ? O ? m(H.split(`
12217
+ ), le = d(H), ce = h(le) ? O ? m(H.split(`
12229
12218
  `, 1)[0], I.map(v)) : p(H) : void 0;
12230
12219
  S.push({
12231
12220
  kind: "note",
@@ -12241,7 +12230,7 @@ ${I}` : W.push(I), ne = V.line;
12241
12230
  }
12242
12231
  }
12243
12232
  for (const T of u) {
12244
- if (d(T) !== "BLOCK_ANNOTATION_END") continue;
12233
+ if (c(T) !== "BLOCK_ANNOTATION_END") continue;
12245
12234
  const G = v(T).trimStart().replace(/^\|#{1,2}/, "").trim();
12246
12235
  if (G)
12247
12236
  return t(
@@ -12251,7 +12240,7 @@ ${I}` : W.push(I), ne = V.line;
12251
12240
  }
12252
12241
  let $ = 0;
12253
12242
  for (const T of u) {
12254
- if (T.channel !== 0 || d(T) === "EOF") continue;
12243
+ if (T.channel !== 0 || c(T) === "EOF") continue;
12255
12244
  for (; $ < k.length && k[$][1] < T.startIndex; )
12256
12245
  $++;
12257
12246
  const [G, W] = k[$] ?? [1 / 0, -1 / 0];
@@ -12418,16 +12407,16 @@ async function w0(e) {
12418
12407
  const l = (await ii(
12419
12408
  e,
12420
12409
  "file:///publisher-notebook-builder/convert.malloy"
12421
- )).parse?.tokenStream, u = l?.tokenSource?.vocabulary, d = l?.getTokens?.() ?? [];
12410
+ )).parse?.tokenStream, u = l?.tokenSource?.vocabulary, c = l?.getTokens?.() ?? [];
12422
12411
  if (typeof u?.getSymbolicName != "function")
12423
12412
  return i(0, "Malloy's token stream is not available.");
12424
- const c = await Yo(), { parseAnnotation: f } = await Xo(), h = (O) => u.getSymbolicName(O.type), p = new Os(e), m = sl(p, l), b = (O) => e.slice(p.utf16(O.startIndex), p.utf16(O.stopIndex + 1)), w = (O) => c.routeOf({ value: O.trimStart() }), v = (O) => c.payloadOf({ value: O }), g = (O) => O.replace(/\r\n?/g, `
12413
+ const d = await Yo(), { parseAnnotation: f } = await Xo(), h = (O) => u.getSymbolicName(O.type), p = new Os(e), m = sl(p, l), b = (O) => e.slice(p.utf16(O.startIndex), p.utf16(O.stopIndex + 1)), w = (O) => d.routeOf({ value: O.trimStart() }), v = (O) => d.payloadOf({ value: O }), g = (O) => O.replace(/\r\n?/g, `
12425
12414
  `), y = new Set(e.match(/[A-Za-z_][A-Za-z0-9_]*/g)), x = (O) => {
12426
12415
  let z = O;
12427
12416
  for (let I = 2; y.has(z); I++) z = `${O}_${I}`;
12428
12417
  return y.add(z), z;
12429
12418
  }, k = (O) => {
12430
- const z = d.filter(
12419
+ const z = c.filter(
12431
12420
  (Z) => Z.channel === 0 && p.utf16(Z.startIndex) >= O.span.start && p.utf16(Z.stopIndex + 1) <= O.span.end
12432
12421
  ), I = [], ee = [], H = [];
12433
12422
  let le;
@@ -12697,8 +12686,8 @@ function $0({
12697
12686
  modelPath: a,
12698
12687
  layout: l,
12699
12688
  notebook: u,
12700
- noun: d,
12701
- legacyFormat: c,
12689
+ noun: c,
12690
+ legacyFormat: d,
12702
12691
  textHeld: f,
12703
12692
  startedAt: h,
12704
12693
  onEventRef: p
@@ -12716,7 +12705,7 @@ function $0({
12716
12705
  } catch {
12717
12706
  }
12718
12707
  }), w = e?.authoritative === !0, v = w && r !== void 0, [g, y] = U(void 0), x = (w || g === !0) && t !== void 0, [k, S] = U(void 0), [C, $] = U(
12719
- c ? _0 : void 0
12708
+ d ? _0 : void 0
12720
12709
  ), E = J(void 0), B = J(void 0), [D, N] = U(void 0), q = J(s);
12721
12710
  q.current = s;
12722
12711
  const j = D !== void 0 && D.onFetch === s ? D.text : i, X = J(j);
@@ -12759,7 +12748,7 @@ function $0({
12759
12748
  }
12760
12749
  }).catch((ie) => {
12761
12750
  if (R) return;
12762
- const te = `Could not read the ${d}: ${ie instanceof Error ? ie.message : String(ie)}`;
12751
+ const te = `Could not read the ${c}: ${ie instanceof Error ? ie.message : String(ie)}`;
12763
12752
  $(te), b.current({
12764
12753
  type: "report.load_failed",
12765
12754
  surface: "edit",
@@ -12774,17 +12763,17 @@ function $0({
12774
12763
  n,
12775
12764
  v,
12776
12765
  u,
12777
- d,
12766
+ c,
12778
12767
  f,
12779
12768
  // Refs, stable: read when the open lands, never a reason to open again.
12780
12769
  h
12781
12770
  ]), ye(() => {
12782
- c && b.current({
12771
+ d && b.current({
12783
12772
  type: "report.load_failed",
12784
12773
  surface: "edit",
12785
12774
  category: "unsupported"
12786
12775
  });
12787
- }, [c]), ye(() => {
12776
+ }, [d]), ye(() => {
12788
12777
  !f || !n || k || r !== void 0 || (w ? t === void 0 && $("the host's storage has no document at this location.") : $(
12789
12778
  "a document held as text needs a storage whose workspace is authoritative. Fix: mark the workspace that keeps it `authoritative`."
12790
12779
  ));
@@ -12831,8 +12820,8 @@ function S0({
12831
12820
  versionId: a,
12832
12821
  apiClients: l,
12833
12822
  queryClient: u,
12834
- mutable: d,
12835
- textHeld: c,
12823
+ mutable: c,
12824
+ textHeld: d,
12836
12825
  readFailure: f,
12837
12826
  authoritative: h,
12838
12827
  resume: p,
@@ -12952,7 +12941,7 @@ function S0({
12952
12941
  v,
12953
12942
  m
12954
12943
  ]
12955
- ), q = t?.writeable === !0, j = d === !0 && !c, { savesTo: X, pinnedPackageSave: Q, writer: se } = Ch({
12944
+ ), q = t?.writeable === !0, j = c === !0 && !d, { savesTo: X, pinnedPackageSave: Q, writer: se } = Ch({
12956
12945
  authoritative: h,
12957
12946
  mutable: j,
12958
12947
  ...a !== void 0 ? { versionId: a } : {},
@@ -12978,8 +12967,8 @@ function Xf(e) {
12978
12967
  path: s,
12979
12968
  textSource: o,
12980
12969
  allowLayoutChange: a
12981
- } = e, l = e.layout ?? (i ? Dh(i) : "grid"), u = l === "linear", d = o !== void 0, {
12982
- environmentName: c,
12970
+ } = e, l = e.layout ?? (i ? Dh(i) : "grid"), u = l === "linear", c = o !== void 0, {
12971
+ environmentName: d,
12983
12972
  packageName: f,
12984
12973
  versionId: h,
12985
12974
  namesBoth: p
@@ -12990,7 +12979,7 @@ function Xf(e) {
12990
12979
  const $ = Mh()?.documentStorage, E = s ?? zh(i ?? "dashboard", b), B = /\.malloynb$/i.test(E) || u && /\.malloynb$/i.test(b), D = Qo({
12991
12980
  queryKey: [
12992
12981
  "dashboard-editor-model",
12993
- c,
12982
+ d,
12994
12983
  f,
12995
12984
  E,
12996
12985
  h,
@@ -12998,13 +12987,13 @@ function Xf(e) {
12998
12987
  ],
12999
12988
  // A curated package otherwise withholds the text of a notebook reading an off-surface source.
13000
12989
  queryFn: () => v.models.getModel(
13001
- c,
12990
+ d,
13002
12991
  f,
13003
12992
  E,
13004
12993
  h,
13005
12994
  u ? !0 : void 0
13006
12995
  ),
13007
- enabled: p && !B && !d
12996
+ enabled: p && !B && !c
13008
12997
  }), N = D.data?.data?.sourceText, {
13009
12998
  workspace: q,
13010
12999
  draft: j,
@@ -13017,7 +13006,7 @@ function Xf(e) {
13017
13006
  storage: $,
13018
13007
  layout: l,
13019
13008
  notebook: u,
13020
- environmentName: c,
13009
+ environmentName: d,
13021
13010
  packageName: f,
13022
13011
  modelPath: E
13023
13012
  }), {
@@ -13051,7 +13040,7 @@ function Xf(e) {
13051
13040
  notebook: u,
13052
13041
  noun: w,
13053
13042
  legacyFormat: B,
13054
- textHeld: d,
13043
+ textHeld: c,
13055
13044
  startedAt: k,
13056
13045
  onEventRef: S
13057
13046
  }), {
@@ -13066,14 +13055,14 @@ function Xf(e) {
13066
13055
  workspace: q,
13067
13056
  layout: l,
13068
13057
  notebook: u,
13069
- environmentName: c,
13058
+ environmentName: d,
13070
13059
  packageName: f,
13071
13060
  modelPath: E,
13072
13061
  versionId: h,
13073
13062
  apiClients: v,
13074
13063
  queryClient: x,
13075
13064
  mutable: g,
13076
- textHeld: d,
13065
+ textHeld: c,
13077
13066
  readFailure: T,
13078
13067
  authoritative: G,
13079
13068
  resume: A,
@@ -13104,7 +13093,7 @@ function Xf(e) {
13104
13093
  H(Xt), C.current?.(Xt);
13105
13094
  },
13106
13095
  [H]
13107
- ), At = ie === "host" && q?.description ? q.description : void 0, ir = !G && !d && g === void 0 ? y ? "Checking whether this server takes writes." : "This server did not say whether it takes writes, so Save is off." : Lh({
13096
+ ), At = ie === "host" && q?.description ? q.description : void 0, ir = !G && !c && g === void 0 ? y ? "Checking whether this server takes writes." : "This server did not say whether it takes writes, so Save is off." : Lh({
13108
13097
  authoritative: G,
13109
13098
  mutable: L,
13110
13099
  pinnedPackageSave: P,
@@ -13134,7 +13123,7 @@ function Xf(e) {
13134
13123
  context: `Opening the ${w}`
13135
13124
  }
13136
13125
  );
13137
- if (!Y && (!(d || N) || !Q))
13126
+ if (!Y && (!(c || N) || !Q))
13138
13127
  return /* @__PURE__ */ _(Ic, { text: `Opening the ${w}…` });
13139
13128
  if (W)
13140
13129
  return /* @__PURE__ */ K(ht, { severity: "error", sx: { m: 2 }, children: [
@@ -13180,7 +13169,7 @@ function Xf(e) {
13180
13169
  Y && /* @__PURE__ */ _(
13181
13170
  c0,
13182
13171
  {
13183
- environmentName: c,
13172
+ environmentName: d,
13184
13173
  packageName: f,
13185
13174
  modelPath: E,
13186
13175
  ...o ? { textSource: o } : {},