react-semaphor 0.1.565 → 0.1.567

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 (39) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/briefings/index.js +50 -46
  3. package/dist/chunks/{assistant-chat-DNfb5fbF.js → assistant-chat-D-IuHHwh.js} +6 -6
  4. package/dist/chunks/{bookmark-impact-CHr7b1J2.js → bookmark-impact-B0estCHn.js} +9 -9
  5. package/dist/chunks/{bookmark-state-ByODVqee.js → bookmark-state-Du3s13_V.js} +333 -321
  6. package/dist/chunks/{card-filter-builder-CcEcfaYz.js → card-filter-builder-DbSmzvem.js} +46 -46
  7. package/dist/chunks/{dashboard-briefing-launcher-D3mc6peE.js → dashboard-briefing-launcher-DunvZYsU.js} +333 -333
  8. package/dist/chunks/{dashboard-controls-BFv0zdws.js → dashboard-controls-B09cN2Dz.js} +57 -57
  9. package/dist/chunks/{dashboard-CtIfxycc.js → dashboard-f8J9DHh5.js} +1 -1
  10. package/dist/chunks/{dashboard-json-CXn_3OYb.js → dashboard-json-BNNCaKEc.js} +1 -1
  11. package/dist/chunks/{dates-DcRxw17S.js → dates-BsJcyoC_.js} +5 -5
  12. package/dist/chunks/{edit-dashboard-visual-Y6HatqBd.js → edit-dashboard-visual-Cwzbpty8.js} +213 -197
  13. package/dist/chunks/{filter-reach-copy-DbggA5B7.js → filter-reach-copy-P-kDwUpY.js} +852 -858
  14. package/dist/chunks/{index-DDa_rklN.js → index-BcXw0CpM.js} +648 -574
  15. package/dist/chunks/{report-preferences-dialog-Db-b04B4.js → report-preferences-dialog-CbgmdWeZ.js} +8 -8
  16. package/dist/chunks/{resolve-dashboard-input-context-C18J-YZC.js → resolve-dashboard-input-context-DPKSF3qj.js} +3403 -3378
  17. package/dist/chunks/{saved-dashboard-context-DhC_EVus.js → saved-dashboard-context-CNudmm9U.js} +13 -13
  18. package/dist/chunks/{semaphor-ready-indicator-T6TsiBMT.js → semaphor-ready-indicator-CQd-PCCZ.js} +32568 -32581
  19. package/dist/chunks/{shelf-drop-preview-context-CNWL_b0S.js → shelf-drop-preview-context-CWS3e20y.js} +2 -2
  20. package/dist/chunks/{stored-dashboard-IdmtrNkA.js → stored-dashboard-CrQFT27O.js} +1074 -1055
  21. package/dist/chunks/{variable-draft-3xseULxR.js → variable-draft-BDxlD0dM.js} +2 -2
  22. package/dist/dashboard/index.js +2 -2
  23. package/dist/dashboard-authoring/index.js +1669 -1642
  24. package/dist/index.js +12 -12
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.js +2 -2
  27. package/dist/types/briefings/delivery-outcome.d.ts +37 -0
  28. package/dist/types/briefings/index.d.ts +2 -0
  29. package/dist/types/briefings/run-outcomes.d.ts +6 -0
  30. package/dist/types/components/briefings/briefing-author/run-model.d.ts +9 -0
  31. package/dist/types/index.js +33 -32
  32. package/dist/types/lib/dashboard-viewer/table-view.d.ts +24 -2
  33. package/dist/types/lib/dashboard-viewer/use-table-view.d.ts +15 -0
  34. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +15 -3
  35. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  36. package/dist/types/shared/dashboard-authoring/dashboard-filter-sql-subscription.d.ts +24 -0
  37. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +20 -4
  38. package/dist/types/shared/dashboard-viewer/table-settings.d.ts +9 -0
  39. package/package.json +1 -1
@@ -1,24 +1,24 @@
1
- import { gM as io, cp as so, bU as ao, aQ as lo, b9 as co, f as uo, bM as fo, M as oe, gN as po, gO as Ne, dX as Et, d_ as mo, bD as go, gP as yo, at as bo, fB as Bt, fD as Co, gQ as _t, O as ho, fF as Io, cQ as ve, s as _, fw as Fe, n as Le, gR as vo, cK as Rt, cM as Kt, cv as Fo, cP as So, cN as mt, cO as Do, b as To, cx as Mo, cJ as Vo, cH as ko, a2 as K, ga as xo, gS as Se, gT as qt, gU as Po, gV as je, go as De, gW as wo, gX as ze, gY as Oo, gZ as Ao, g_ as Eo, g$ as Bo, h0 as _o, l as Ge, h1 as Ro, k as ee, r as Ko, h as qo, h2 as $, gD as He, h3 as me, h4 as Nt, h5 as No, h6 as Lo, h7 as jo, g1 as zo, h8 as Go, h9 as Ho, e as Uo, ha as $o, hb as Lt, $ as jt, hc as Qo, hd as Wo, he as Yo, hf as zt, j as Ue, cg as Jo, a3 as Xo, o as Gt, cf as Zo, gl as er, q as tr, t as gt, C as nr, hg as or, hh as rr, ch as ir, hi as sr } from "./resolve-dashboard-input-context-C18J-YZC.js";
2
- import { av as ar, H as re, a1 as lr, R as cr, I as Oe, S as ur, am as yt, q as Ht, aa as dr, v as fr } from "./validators-wtjw0aw6.js";
3
- import { v as Ut } from "./matrix-operation-contract-Eb6elidS.js";
4
- import { S as $e } from "./analytics-base-schemas-BaIQrEzX.js";
5
- import { ZodError as pr } from "zod";
1
+ import { gP as co, cs as uo, bU as fo, aQ as po, b9 as mo, f as go, bM as yo, M as oe, gQ as bo, gR as Ne, d_ as Rt, e1 as ho, bD as Co, gS as Io, at as vo, fE as Kt, fG as Fo, gT as qt, O as So, fI as To, cT as Fe, s as _, fz as Se, n as Le, gU as Do, cN as Nt, cP as Lt, cy as Mo, cS as Vo, cQ as bt, cR as ko, b as Po, cA as xo, cM as wo, cK as Oo, a2 as q, gd as Ao, gV as Te, gW as jt, gX as Eo, gY as je, gr as De, gZ as Bo, g_ as ze, g$ as _o, h0 as Ro, h1 as Ko, h2 as qo, h3 as No, l as Ge, h4 as Lo, k as ee, r as jo, h as zo, h5 as U, gG as He, h6 as ge, h7 as zt, h8 as Go, h9 as Ho, ha as $o, g4 as Uo, hb as Qo, hc as Wo, e as Yo, hd as Jo, he as Gt, $ as Ht, hf as Zo, hg as Xo, hh as er, hi as $t, j as $e, cj as tr, a3 as nr, o as Ut, ci as or, go as rr, q as ir, t as ht, C as sr, hj as ar, hk as lr, ck as cr, hl as ur } from "./resolve-dashboard-input-context-DPKSF3qj.js";
2
+ import { av as dr, H as re, a1 as fr, R as pr, I as Oe, S as mr, am as Ct, q as Qt, aa as gr, v as yr } from "./validators-wtjw0aw6.js";
3
+ import { v as Wt } from "./matrix-operation-contract-Eb6elidS.js";
4
+ import { S as Ue } from "./analytics-base-schemas-BaIQrEzX.js";
5
+ import { ZodError as br } from "zod";
6
6
  import "./index-CuHybtft.js";
7
- import { canonicalizeSupportedCurrencyCode as $t } from "../value-format-preferences/index.js";
7
+ import { canonicalizeSupportedCurrencyCode as Yt } from "../value-format-preferences/index.js";
8
8
  import "./_commonjsHelpers-DimLPMtv.js";
9
- import { b as ge, r as mr, aW as gr, i as yr, aD as br, aA as bt } from "./temporal-input-presentation--2r9BLr0.js";
10
- import { aA as Qt, aB as Wt, aC as ke, _ as Cr, aD as Yt, aE as Jt, az as Xt, aF as Zt, n as hr, u as en, t as j, aG as tn, k as nn, C as Ae, aH as H, y as ie, i as on, l as Ir, s as vr, B as Qe, aI as Fr, ag as Sr, D as rn, A as Dr, ay as Ct, M as sn, N as an, H as ln } from "./bookmark-state-ByODVqee.js";
9
+ import { b as ye, r as hr, aW as Cr, i as Ir, aD as vr, aA as It } from "./temporal-input-presentation--2r9BLr0.js";
10
+ import { aB as Jt, aC as Zt, aD as ke, $ as Fr, aE as Xt, aF as en, aA as tn, aG as nn, n as Sr, l as Tr, v as on, t as j, aH as rn, k as sn, C as Ae, aI as H, z as ie, i as an, o as Dr, u as Mr, B as Qe, aJ as Vr, ah as kr, F as ln, D as Pr, az as vt, N as cn, O as un, I as dn } from "./bookmark-state-Du3s13_V.js";
11
11
  import "./index-RNaTnE3m.js";
12
12
  import "./context-R31TSL5V.js";
13
- import { i as We, b as cn, r as Tr } from "./matrix-card-BSUeSXpD.js";
14
- import { D as Mr } from "./report-runtime-context-DnA_PiKo.js";
15
- import { r as Q, C as Vr } from "./metric-comparison-ChXUFaZu.js";
16
- import { p as kr, d as xr } from "./pivot-result-contract-expectations-Ddh1rNz5.js";
17
- import { isPdfTableCardType as Pr, PDF_CAPACITY as wr } from "../pdf-export-policy/index.js";
18
- import { c as Or } from "./selection-filter-compiler-CUDRnUxc.js";
19
- import { a as Ar, f as Er, b as Br } from "./matrix-analytical-definition-C9xB_T84.js";
20
- import { r as _r } from "./pivot-result-identity-BlbLrqaC.js";
21
- const Rr = (e, t) => {
13
+ import { i as We, b as fn, r as xr } from "./matrix-card-BSUeSXpD.js";
14
+ import { D as wr } from "./report-runtime-context-DnA_PiKo.js";
15
+ import { r as Q, C as Or } from "./metric-comparison-ChXUFaZu.js";
16
+ import { p as Ar, d as Er } from "./pivot-result-contract-expectations-Ddh1rNz5.js";
17
+ import { isPdfTableCardType as Br, PDF_CAPACITY as _r } from "../pdf-export-policy/index.js";
18
+ import { c as Rr } from "./selection-filter-compiler-CUDRnUxc.js";
19
+ import { a as Kr, f as qr, b as Nr } from "./matrix-analytical-definition-C9xB_T84.js";
20
+ import { r as Lr } from "./pivot-result-identity-BlbLrqaC.js";
21
+ const jr = (e, t) => {
22
22
  const n = {};
23
23
  if (e === null || t === null)
24
24
  return t;
@@ -36,8 +36,8 @@ const Rr = (e, t) => {
36
36
  if (!Ee(i, s))
37
37
  if (Array.isArray(i) && Array.isArray(s))
38
38
  n[r] = s;
39
- else if (ht(i) && ht(s)) {
40
- const a = Rr(i, s);
39
+ else if (Ft(i) && Ft(s)) {
40
+ const a = jr(i, s);
41
41
  Object.keys(a).length > 0 && (n[r] = a);
42
42
  } else
43
43
  n[r] = s;
@@ -52,7 +52,7 @@ const Rr = (e, t) => {
52
52
  return n.length !== o.length ? !1 : n.every((r) => Ee(e[r], t[r]));
53
53
  }
54
54
  return !1;
55
- }, ht = (e) => e !== null && typeof e == "object" && !Array.isArray(e), ye = (e) => {
55
+ }, Ft = (e) => e !== null && typeof e == "object" && !Array.isArray(e), be = (e) => {
56
56
  if (e === null || typeof e != "object")
57
57
  return e;
58
58
  if (e instanceof Date)
@@ -60,34 +60,34 @@ const Rr = (e, t) => {
60
60
  if (e instanceof RegExp)
61
61
  return new RegExp(e);
62
62
  if (Array.isArray(e))
63
- return e.map((n) => ye(n));
63
+ return e.map((n) => be(n));
64
64
  const t = {};
65
65
  for (const n in e)
66
- Object.prototype.hasOwnProperty.call(e, n) && (t[n] = ye(e[n]));
66
+ Object.prototype.hasOwnProperty.call(e, n) && (t[n] = be(e[n]));
67
67
  return t;
68
- }, Kr = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
69
- function qr(e) {
70
- return typeof e == "string" && Kr.test(e);
68
+ }, zr = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
69
+ function Gr(e) {
70
+ return typeof e == "string" && zr.test(e);
71
71
  }
72
- function Nr(e) {
73
- if (!qr(e))
72
+ function Hr(e) {
73
+ if (!Gr(e))
74
74
  throw TypeError("Invalid UUID");
75
75
  let t;
76
76
  const n = new Uint8Array(16);
77
77
  return n[0] = (t = parseInt(e.slice(0, 8), 16)) >>> 24, n[1] = t >>> 16 & 255, n[2] = t >>> 8 & 255, n[3] = t & 255, n[4] = (t = parseInt(e.slice(9, 13), 16)) >>> 8, n[5] = t & 255, n[6] = (t = parseInt(e.slice(14, 18), 16)) >>> 8, n[7] = t & 255, n[8] = (t = parseInt(e.slice(19, 23), 16)) >>> 8, n[9] = t & 255, n[10] = (t = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, n[11] = t / 4294967296 & 255, n[12] = t >>> 24 & 255, n[13] = t >>> 16 & 255, n[14] = t >>> 8 & 255, n[15] = t & 255, n;
78
78
  }
79
- function Lr(e) {
79
+ function $r(e) {
80
80
  e = unescape(encodeURIComponent(e));
81
81
  const t = [];
82
82
  for (let n = 0; n < e.length; ++n)
83
83
  t.push(e.charCodeAt(n));
84
84
  return t;
85
85
  }
86
- const jr = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", zr = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
87
- function Gr(e, t, n) {
86
+ const Ur = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", Qr = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
87
+ function Wr(e, t, n) {
88
88
  function o(r, i, s, a) {
89
89
  var c;
90
- if (typeof r == "string" && (r = Lr(r)), typeof i == "string" && (i = Nr(i)), ((c = i) === null || c === void 0 ? void 0 : c.length) !== 16)
90
+ if (typeof r == "string" && (r = $r(r)), typeof i == "string" && (i = Hr(i)), ((c = i) === null || c === void 0 ? void 0 : c.length) !== 16)
91
91
  throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
92
92
  let l = new Uint8Array(16 + r.length);
93
93
  if (l.set(i), l.set(r, i.length), l = n(l), l[6] = l[6] & 15 | t, l[8] = l[8] & 63 | 128, s) {
@@ -96,15 +96,15 @@ function Gr(e, t, n) {
96
96
  s[a + u] = l[u];
97
97
  return s;
98
98
  }
99
- return io(l);
99
+ return co(l);
100
100
  }
101
101
  try {
102
102
  o.name = e;
103
103
  } catch {
104
104
  }
105
- return o.DNS = jr, o.URL = zr, o;
105
+ return o.DNS = Ur, o.URL = Qr, o;
106
106
  }
107
- function Hr(e, t, n, o) {
107
+ function Yr(e, t, n, o) {
108
108
  switch (e) {
109
109
  case 0:
110
110
  return t & n ^ ~t & o;
@@ -116,10 +116,10 @@ function Hr(e, t, n, o) {
116
116
  return t ^ n ^ o;
117
117
  }
118
118
  }
119
- function xe(e, t) {
119
+ function Pe(e, t) {
120
120
  return e << t | e >>> 32 - t;
121
121
  }
122
- function Ur(e) {
122
+ function Jr(e) {
123
123
  const t = [1518500249, 1859775393, 2400959708, 3395469782], n = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
124
124
  if (typeof e == "string") {
125
125
  const s = unescape(encodeURIComponent(e));
@@ -141,18 +141,18 @@ function Ur(e) {
141
141
  for (let m = 0; m < 16; ++m)
142
142
  a[m] = i[s][m];
143
143
  for (let m = 16; m < 80; ++m)
144
- a[m] = xe(a[m - 3] ^ a[m - 8] ^ a[m - 14] ^ a[m - 16], 1);
144
+ a[m] = Pe(a[m - 3] ^ a[m - 8] ^ a[m - 14] ^ a[m - 16], 1);
145
145
  let c = n[0], l = n[1], u = n[2], d = n[3], f = n[4];
146
146
  for (let m = 0; m < 80; ++m) {
147
- const g = Math.floor(m / 20), p = xe(c, 5) + Hr(g, l, u, d) + f + t[g] + a[m] >>> 0;
148
- f = d, d = u, u = xe(l, 30) >>> 0, l = c, c = p;
147
+ const g = Math.floor(m / 20), p = Pe(c, 5) + Yr(g, l, u, d) + f + t[g] + a[m] >>> 0;
148
+ f = d, d = u, u = Pe(l, 30) >>> 0, l = c, c = p;
149
149
  }
150
150
  n[0] = n[0] + c >>> 0, n[1] = n[1] + l >>> 0, n[2] = n[2] + u >>> 0, n[3] = n[3] + d >>> 0, n[4] = n[4] + f >>> 0;
151
151
  }
152
152
  return [n[0] >> 24 & 255, n[0] >> 16 & 255, n[0] >> 8 & 255, n[0] & 255, n[1] >> 24 & 255, n[1] >> 16 & 255, n[1] >> 8 & 255, n[1] & 255, n[2] >> 24 & 255, n[2] >> 16 & 255, n[2] >> 8 & 255, n[2] & 255, n[3] >> 24 & 255, n[3] >> 16 & 255, n[3] >> 8 & 255, n[3] & 255, n[4] >> 24 & 255, n[4] >> 16 & 255, n[4] >> 8 & 255, n[4] & 255];
153
153
  }
154
- const $r = Gr("v5", 80, Ur), It = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, vt = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
155
- function Qr(e) {
154
+ const Zr = Wr("v5", 80, Jr), St = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, Tt = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
155
+ function Xr(e) {
156
156
  const t = [];
157
157
  let n = 0;
158
158
  for (; n < e.length; ) {
@@ -169,18 +169,18 @@ function Qr(e) {
169
169
  }
170
170
  return t;
171
171
  }
172
- function un(e) {
172
+ function pn(e) {
173
173
  var o, r;
174
174
  if (!e)
175
175
  return [];
176
176
  const t = /* @__PURE__ */ new Set();
177
177
  let n;
178
- for (It.lastIndex = 0; (n = It.exec(e)) !== null; ) {
178
+ for (St.lastIndex = 0; (n = St.exec(e)) !== null; ) {
179
179
  const i = (o = n[1]) == null ? void 0 : o.trim();
180
180
  i && t.add(i);
181
181
  }
182
- for (const i of Qr(e))
183
- for (vt.lastIndex = 0; (n = vt.exec(i)) !== null; ) {
182
+ for (const i of Xr(e))
183
+ for (Tt.lastIndex = 0; (n = Tt.exec(i)) !== null; ) {
184
184
  const s = (r = n[2]) == null ? void 0 : r.trim();
185
185
  s && t.add(s);
186
186
  }
@@ -190,27 +190,27 @@ function Ye(e) {
190
190
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
191
191
  for (const o of e.controlBindings || [])
192
192
  t.add(o.controlId), o.target === "sql_param" && n.set(o.paramId, o.controlId);
193
- for (const o of un(e.sql))
193
+ for (const o of pn(e.sql))
194
194
  t.add(n.get(o) ?? o);
195
195
  return Array.from(t);
196
196
  }
197
- function Wr(e) {
197
+ function ei(e) {
198
198
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
199
199
  for (const o of e.controlBindings || [])
200
200
  o.target === "sql_param" && n.set(o.paramId, o.controlId);
201
- for (const o of un(e.sql))
201
+ for (const o of pn(e.sql))
202
202
  t.set(o, {
203
203
  paramId: o,
204
204
  controlId: n.get(o) ?? o
205
205
  });
206
206
  return Array.from(t.values());
207
207
  }
208
- function Yr(e, t) {
208
+ function ti(e, t) {
209
209
  var r;
210
210
  const n = (r = e.controlBindings) == null ? void 0 : r.map((i) => ({
211
211
  ...i,
212
212
  controlId: t.get(i.controlId) ?? i.controlId
213
- })), o = Wr(e).flatMap(
213
+ })), o = ei(e).flatMap(
214
214
  ({ paramId: i, controlId: s }) => {
215
215
  var c;
216
216
  const a = t.get(s);
@@ -221,7 +221,7 @@ function Yr(e, t) {
221
221
  );
222
222
  return o.length ? [...n ?? [], ...o] : n;
223
223
  }
224
- function dn(e, t) {
224
+ function mn(e, t) {
225
225
  var s, a;
226
226
  const n = ke(e) ?? e, o = n.source === "dashboardInputAlias" ? (s = t.inputAliases) == null ? void 0 : s[n.variableName] : void 0, r = n.source === "dashboardInputAlias" && o ? ke(o) ?? ke({ ...o, export: n.export ?? "label" }) ?? n : n, i = n.source === "dashboardInputAlias" && r !== n ? { ...r, export: n.export ?? "label" } : r;
227
227
  return i.source === "input" ? {
@@ -229,7 +229,7 @@ function dn(e, t) {
229
229
  inputId: ((a = t.inputIds) == null ? void 0 : a[i.inputId]) ?? i.inputId
230
230
  } : i;
231
231
  }
232
- function Jr(e, t) {
232
+ function ni(e, t) {
233
233
  var r;
234
234
  const n = {};
235
235
  for (const i of [
@@ -246,13 +246,13 @@ function Jr(e, t) {
246
246
  }
247
247
  const o = { ...t.inputAliases };
248
248
  for (const [i, s] of Object.entries((e == null ? void 0 : e.inputAliases) ?? {}))
249
- o[i] = dn(s, t);
249
+ o[i] = mn(s, t);
250
250
  return Object.keys(o).length && (n.inputAliases = o), n;
251
251
  }
252
- function Ya(e, t) {
252
+ function nl(e, t) {
253
253
  var r, i, s, a;
254
- const n = ye(Qt(e));
255
- n.controlBindings = Yr(
254
+ const n = be(Jt(e));
255
+ n.controlBindings = ti(
256
256
  e,
257
257
  new Map(Object.entries(t.controlIds ?? {}))
258
258
  );
@@ -270,9 +270,9 @@ function Ya(e, t) {
270
270
  const l = c;
271
271
  if (Object.assign(
272
272
  l,
273
- Wt(
273
+ Zt(
274
274
  l,
275
- (f) => f && typeof f == "object" ? dn(f, t) : f
275
+ (f) => f && typeof f == "object" ? mn(f, t) : f
276
276
  )
277
277
  ), typeof l.entityId == "string") {
278
278
  const f = l.entityId;
@@ -281,72 +281,72 @@ function Ya(e, t) {
281
281
  for (const [f, m] of Object.entries(l))
282
282
  f !== "linkedReferenceOverrides" && o(m);
283
283
  };
284
- o(n), n.clickToFilter && (n.clickToFilter = so(n.clickToFilter, t));
284
+ o(n), n.clickToFilter && (n.clickToFilter = uo(n.clickToFilter, t));
285
285
  for (const c of Object.values(
286
286
  ((s = n.customCardPreferences) == null ? void 0 : s.dataInputCardIds) ?? {}
287
287
  ))
288
288
  c.cardId = ((a = t.cardIds) == null ? void 0 : a[c.cardId]) ?? c.cardId;
289
289
  return n;
290
290
  }
291
- const Xr = "9677efdd-86ec-4afb-b9bb-5ead8b5442af";
292
- function Zr(e) {
291
+ const oi = "9677efdd-86ec-4afb-b9bb-5ead8b5442af";
292
+ function ri(e) {
293
293
  let t = 0;
294
- return () => $r(`${e}#${t++}`, Xr);
294
+ return () => Zr(`${e}#${t++}`, oi);
295
295
  }
296
- const ei = [
296
+ const ii = [
297
297
  { code: "matrix_definition_incomplete", label: "Matrix definition" }
298
- ], ti = [
298
+ ], si = [
299
299
  { code: "connection_type_unresolved", label: "Connection type" }
300
- ], Z = (e) => !Array.isArray(e) || e.length === 0;
301
- function ni(e) {
300
+ ], X = (e) => !Array.isArray(e) || e.length === 0;
301
+ function ai(e) {
302
302
  var i;
303
303
  const t = e.config ?? {};
304
- if ((i = e.sql) != null && i.trim() || !Z(t.pivotByColumns)) return "matrixTable";
305
- const n = !Z(t.groupByColumns), o = !Z(t.metricColumns), r = e.type === "pivotTable" && (n || o) && Z(t.rowAggregates) && Z(t.columnAggregates);
304
+ if ((i = e.sql) != null && i.trim() || !X(t.pivotByColumns)) return "matrixTable";
305
+ const n = !X(t.groupByColumns), o = !X(t.metricColumns), r = e.type === "pivotTable" && (n || o) && X(t.rowAggregates) && X(t.columnAggregates);
306
306
  return n && !o || r ? "table" : "matrixTable";
307
307
  }
308
- function oi(e) {
308
+ function li(e) {
309
309
  var r;
310
310
  const t = e.dataSource;
311
311
  if (!t || (r = t.connectionType) != null && r.trim()) return e;
312
- const n = ar(fo(t.selectedEntities));
312
+ const n = dr(yo(t.selectedEntities));
313
313
  if (!n) return e;
314
314
  const o = Array.isArray(t.selectedEntities) ? t.selectedEntities.map((i) => i && typeof i == "object" && "connectionType" in i && !String(i.connectionType ?? "").trim() ? { ...i, connectionType: n } : i) : t.selectedEntities;
315
315
  return { ...e, dataSource: { ...t, connectionType: n, selectedEntities: o } };
316
316
  }
317
- function fn(e) {
317
+ function gn(e) {
318
318
  var s, a;
319
319
  const t = e;
320
- if (!ao(t)) return { status: "not_legacy", card: e };
321
- const n = oi(t), o = ni(t) === "table" ? lo(n, "table") : co(n, "matrixTable", { createId: Zr(t.id) });
320
+ if (!fo(t)) return { status: "not_legacy", card: e };
321
+ const n = li(t), o = ai(t) === "table" ? po(n, "table") : mo(n, "matrixTable", { createId: ri(t.id) });
322
322
  if (o.status !== "changed") throw new Error(`Card ${t.id} could not leave ${t.type}.`);
323
- const r = o.card.type === "matrixTable" && uo(o.card).status !== "ready", i = !!n.dataSource && !((a = (s = n.dataSource) == null ? void 0 : s.connectionType) != null && a.trim());
323
+ const r = o.card.type === "matrixTable" && go(o.card).status !== "ready", i = !!n.dataSource && !((a = (s = n.dataSource) == null ? void 0 : s.connectionType) != null && a.trim());
324
324
  return {
325
325
  status: "routed",
326
326
  card: o.card,
327
327
  gaps: [
328
328
  ...o.gaps,
329
- ...r ? ei : [],
330
- ...i ? ti : []
329
+ ...r ? ii : [],
330
+ ...i ? si : []
331
331
  ]
332
332
  };
333
333
  }
334
- function Ja(e) {
334
+ function ol(e) {
335
335
  if (!e.cards) return e;
336
- const t = e.cards.map((n) => fn(n).card);
336
+ const t = e.cards.map((n) => gn(n).card);
337
337
  return t.every((n, o) => n === e.cards[o]) ? e : { ...e, cards: t };
338
338
  }
339
- function ri(e) {
339
+ function ci(e) {
340
340
  const t = [];
341
- return { dashboard: Cr(e, (o, r) => {
342
- const i = fn(o);
341
+ return { dashboard: Fr(e, (o, r) => {
342
+ const i = gn(o);
343
343
  return i.status === "routed" && i.gaps.length && t.push({ location: r, gaps: i.gaps }), i.card;
344
344
  }), routedWithGaps: t };
345
345
  }
346
- function ii(e, t) {
346
+ function ui(e, t) {
347
347
  return e.name === t.name && e.qualifiedEntityName === t.qualifiedEntityName;
348
348
  }
349
- function si(e, t, n) {
349
+ function di(e, t, n) {
350
350
  var r, i;
351
351
  if (n.sortPolicy === "dropUnrelatedSorts") {
352
352
  const s = new Set(
@@ -365,7 +365,7 @@ function si(e, t, n) {
365
365
  ...e,
366
366
  groupByColumns: [t],
367
367
  sortByColumns: (i = e.sortByColumns) == null ? void 0 : i.map(
368
- (s) => o && ii(s, o) ? {
368
+ (s) => o && ui(s, o) ? {
369
369
  ...t,
370
370
  role: "sortby",
371
371
  direction: s.direction
@@ -373,7 +373,7 @@ function si(e, t, n) {
373
373
  )
374
374
  };
375
375
  }
376
- function Xa(e) {
376
+ function rl(e) {
377
377
  switch (e) {
378
378
  case "previous_period":
379
379
  return "Previous";
@@ -385,21 +385,21 @@ function Xa(e) {
385
385
  return "Comparison";
386
386
  }
387
387
  }
388
- function pn(e, t, n) {
388
+ function yn(e, t, n) {
389
389
  var o;
390
390
  if (((o = n == null ? void 0 : n.output) == null ? void 0 : o.availability.status) === "available" && n.output.comparisonColumnKey)
391
391
  return n.output.comparisonColumnKey;
392
392
  }
393
- function ai(e, t) {
393
+ function fi(e, t) {
394
394
  return `${e} Δ`;
395
395
  }
396
- function Za(e, t) {
397
- return Yt(e, t);
396
+ function il(e, t) {
397
+ return Xt(e, t);
398
398
  }
399
- function li(e, t) {
399
+ function pi(e, t) {
400
400
  return e.rawKey === t.rawKey && e.outputKey === t.outputKey;
401
401
  }
402
- function mn(e) {
402
+ function bn(e) {
403
403
  var a;
404
404
  const { card: t, columnKeyMap: n, metricAlias: o, metricId: r } = e;
405
405
  if (!(t != null && t.config) || !n || !o || oe(t) !== "config")
@@ -410,14 +410,14 @@ function mn(e) {
410
410
  var u;
411
411
  if (r && c.id !== r) return !1;
412
412
  const l = (u = n.byMetricAlias) == null ? void 0 : u[Q(c)];
413
- return !!(l && li(i, l));
413
+ return !!(l && pi(i, l));
414
414
  });
415
415
  return s.length === 1 ? s[0] : void 0;
416
416
  }
417
- function el(e, t) {
417
+ function sl(e, t) {
418
418
  return t ? { ...e, config: t } : e;
419
419
  }
420
- function ci(e) {
420
+ function mi(e) {
421
421
  return [
422
422
  e.alias,
423
423
  e.name,
@@ -428,20 +428,20 @@ function ci(e) {
428
428
  function W(e) {
429
429
  return e != null && e.config ? oe(e) === "config" : !1;
430
430
  }
431
- function ui(e, t, n, o) {
431
+ function gi(e, t, n, o) {
432
432
  if (t === -1 || n === -1 || t === n)
433
433
  return null;
434
434
  const r = [...e], [i] = r.splice(t, 1), s = o === "before" ? n > t ? n - 1 : n : n > t ? n : n + 1;
435
435
  return r.splice(s, 0, i), r;
436
436
  }
437
- function Pe(e, t, n) {
437
+ function xe(e, t, n) {
438
438
  if (!(e != null && e.length)) return null;
439
439
  const o = e.findIndex(
440
440
  (i) => n(i).includes(t.draggingColumnId)
441
441
  ), r = e.findIndex(
442
442
  (i) => n(i).includes(t.targetColumnId)
443
443
  );
444
- return ui(e, o, r, t.side);
444
+ return gi(e, o, r, t.side);
445
445
  }
446
446
  function we(e, t, n) {
447
447
  return n ? {
@@ -449,43 +449,43 @@ function we(e, t, n) {
449
449
  [t]: n
450
450
  } : null;
451
451
  }
452
- function tl(e, t, n) {
452
+ function al(e, t, n) {
453
453
  if (!W(e) || !n) return null;
454
454
  const o = e.config;
455
455
  return e.type === "detailTable" ? we(
456
456
  o,
457
457
  "detailColumns",
458
- Pe(
458
+ xe(
459
459
  o == null ? void 0 : o.detailColumns,
460
460
  t,
461
- (r) => pe(r, "detail", n)
461
+ (r) => me(r, "detail", n)
462
462
  )
463
463
  ) : we(
464
464
  o,
465
465
  "groupByColumns",
466
- Pe(
466
+ xe(
467
467
  o == null ? void 0 : o.groupByColumns,
468
468
  t,
469
- (r) => pe(r, "groupby", n)
469
+ (r) => me(r, "groupby", n)
470
470
  )
471
471
  ) ?? we(
472
472
  o,
473
473
  "metricColumns",
474
- Pe(
474
+ xe(
475
475
  o == null ? void 0 : o.metricColumns,
476
476
  t,
477
- (r) => pe(r, "metric", n)
477
+ (r) => me(r, "metric", n)
478
478
  )
479
479
  );
480
480
  }
481
- function di(e) {
481
+ function yi(e) {
482
482
  var t, n, o, r, i, s;
483
483
  return W(e) ? e.type === "detailTable" ? !!((n = (t = e.config) == null ? void 0 : t.detailColumns) != null && n.length) : !!((r = (o = e.config) == null ? void 0 : o.groupByColumns) != null && r.length || (s = (i = e.config) == null ? void 0 : i.metricColumns) != null && s.length) : !1;
484
484
  }
485
- function nl(e, t) {
486
- return di(e) && !!t;
485
+ function ll(e, t) {
486
+ return yi(e) && !!t;
487
487
  }
488
- function pe(e, t, n) {
488
+ function me(e, t, n) {
489
489
  if (!n) return [];
490
490
  const o = t === "metric" ? [
491
491
  Q(e),
@@ -494,7 +494,7 @@ function pe(e, t, n) {
494
494
  var a;
495
495
  const s = (a = n.byMetricAlias) == null ? void 0 : a[i];
496
496
  return s ? [s] : [];
497
- }) : [], r = _r(
497
+ }) : [], r = Lr(
498
498
  n,
499
499
  e.id,
500
500
  t
@@ -502,18 +502,18 @@ function pe(e, t, n) {
502
502
  return [...o, r].flatMap((i) => [i == null ? void 0 : i.outputKey, i == null ? void 0 : i.rawKey]).filter((i) => !!i);
503
503
  }
504
504
  function se(e, t, n, o) {
505
- const r = pe(
505
+ const r = me(
506
506
  e,
507
507
  t,
508
508
  o
509
509
  );
510
510
  return o ? r.find(
511
511
  (i) => n.includes(i)
512
- ) : ci(e).find(
512
+ ) : mi(e).find(
513
513
  (i) => n.includes(i)
514
514
  );
515
515
  }
516
- function gn(e, t, n) {
516
+ function hn(e, t, n) {
517
517
  if (!W(t) || !n)
518
518
  return;
519
519
  const o = t.type === "detailTable" ? [{ role: "detail", fields: t.config.detailColumns }] : [
@@ -530,12 +530,12 @@ function gn(e, t, n) {
530
530
  ) === e && typeof s.label == "string" && s.label.length > 0)
531
531
  return s.label;
532
532
  }
533
- function fi(e, t) {
533
+ function bi(e, t) {
534
534
  if (!e) return;
535
535
  const n = JSON.stringify(t), o = t.every((r) => r !== null) ? t.join("__") : void 0;
536
536
  return e[n] || (o ? e[o] : void 0);
537
537
  }
538
- function pi(e, t, n) {
538
+ function hi(e, t, n) {
539
539
  if (!e) return;
540
540
  let o = e, r = !1;
541
541
  return t.forEach((i, s) => {
@@ -548,11 +548,11 @@ function pi(e, t, n) {
548
548
  });
549
549
  }), r && o.trim() ? o : void 0;
550
550
  }
551
- function mi(e) {
551
+ function Ci(e) {
552
552
  const t = (e.card.config.metricColumns || []).filter(
553
553
  (n) => n.id === e.metricId && Q(n) === e.metricAlias
554
554
  );
555
- return t.length === 1 ? t[0] : mn({
555
+ return t.length === 1 ? t[0] : bn({
556
556
  card: e.card,
557
557
  columnKeyMap: e.columnKeyMap,
558
558
  metricAlias: e.metricAlias,
@@ -569,12 +569,12 @@ function Je(e) {
569
569
  }
570
570
  ))
571
571
  return;
572
- const o = e.card.config.metricColumns || [], r = mi({
572
+ const o = e.card.config.metricColumns || [], r = Ci({
573
573
  card: e.card,
574
574
  columnKeyMap: e.columnKeyMap,
575
575
  metricId: t.metricId,
576
576
  metricAlias: t.metricAlias
577
- }), i = o.length === 0 && t.metricId === $e;
577
+ }), i = o.length === 0 && t.metricId === Ue;
578
578
  if (!(!r && !i))
579
579
  return {
580
580
  resultColumn: e.resultColumn,
@@ -584,7 +584,7 @@ function Je(e) {
584
584
  authoredMetric: r
585
585
  };
586
586
  }
587
- function gi(e) {
587
+ function Ii(e) {
588
588
  const {
589
589
  columnId: t,
590
590
  card: n,
@@ -601,11 +601,11 @@ function gi(e) {
601
601
  columnKeyMap: o
602
602
  });
603
603
  if (!a) return;
604
- const { identity: c, pivotFields: l, authoredMetrics: u, authoredMetric: d } = a, m = kr({
604
+ const { identity: c, pivotFields: l, authoredMetrics: u, authoredMetric: d } = a, m = Ar({
605
605
  members: c.members,
606
606
  resolveTemporalFormat: (I) => {
607
607
  var v;
608
- return (v = po({
608
+ return (v = bo({
609
609
  presentation: i,
610
610
  fieldId: I,
611
611
  role: "pivotby"
@@ -613,12 +613,12 @@ function gi(e) {
613
613
  }
614
614
  }).memberLabels.map(
615
615
  (I) => I || "(Blank)"
616
- ), g = c.members.map((I) => I.value), p = fi(d == null ? void 0 : d.valueAliases, g) || pi(
616
+ ), g = c.members.map((I) => I.value), p = bi(d == null ? void 0 : d.valueAliases, g) || hi(
617
617
  d == null ? void 0 : d.aliasTemplate,
618
618
  l,
619
619
  m
620
- ), y = p ? [p] : m, b = s || (u.length > 1 ? (d == null ? void 0 : d.label) || (d == null ? void 0 : d.name) : void 0);
621
- return [...y, ...b ? [b] : []].join(" / ");
620
+ ), y = p ? [p] : m, h = s || (u.length > 1 ? (d == null ? void 0 : d.label) || (d == null ? void 0 : d.name) : void 0);
621
+ return [...y, ...h ? [h] : []].join(" / ");
622
622
  }
623
623
  function L(e, t, n, o) {
624
624
  return e != null && e.length ? e.map(
@@ -630,7 +630,7 @@ function L(e, t, n, o) {
630
630
  )
631
631
  ).filter((r) => !!r) : [];
632
632
  }
633
- function Ft(e, t, n, o) {
633
+ function Dt(e, t, n, o) {
634
634
  if (!W(t) || !o) return e;
635
635
  const r = [], i = (s) => {
636
636
  s && e.includes(s) && !r.includes(s) && r.push(s);
@@ -654,7 +654,7 @@ function Ft(e, t, n, o) {
654
654
  i(s), i(n == null ? void 0 : n(s));
655
655
  })), e.forEach(i), r;
656
656
  }
657
- function yi(e, t) {
657
+ function vi(e, t) {
658
658
  var f, m, g;
659
659
  const { keys: n, card: o, columnKeyMap: r, resultColumns: i } = e;
660
660
  if (!((f = o.config.pivotByColumns) != null && f.length)) return null;
@@ -707,11 +707,11 @@ function yi(e, t) {
707
707
  d(p), d(t(p));
708
708
  }), n.forEach(d), u;
709
709
  }
710
- function bi(e) {
710
+ function Fi(e) {
711
711
  var c;
712
712
  const { keys: t, card: n, comparisonMetadata: o, columnKeyMap: r, resultColumns: i } = e;
713
713
  if ((n == null ? void 0 : n.type) !== "table")
714
- return Ft(
714
+ return Dt(
715
715
  t,
716
716
  n,
717
717
  void 0,
@@ -719,7 +719,7 @@ function bi(e) {
719
719
  );
720
720
  const s = /* @__PURE__ */ new Map();
721
721
  (((c = n.config) == null ? void 0 : c.metricColumns) || []).forEach((l) => {
722
- const { comparisonKind: u, metadata: d } = Jt(o, l);
722
+ const { comparisonKind: u, metadata: d } = en(o, l);
723
723
  if (u === "none") return;
724
724
  const f = l.label || l.name, m = se(
725
725
  l,
@@ -728,7 +728,7 @@ function bi(e) {
728
728
  r
729
729
  );
730
730
  if (!m) return;
731
- const g = pn(
731
+ const g = yn(
732
732
  f,
733
733
  u,
734
734
  d
@@ -737,20 +737,20 @@ function bi(e) {
737
737
  });
738
738
  const a = (l) => s.get(l) ?? null;
739
739
  if (W(n)) {
740
- const l = yi(
740
+ const l = vi(
741
741
  { keys: t, card: n, columnKeyMap: r, resultColumns: i },
742
742
  a
743
743
  );
744
744
  if (l) return l;
745
745
  }
746
- return Ft(
746
+ return Dt(
747
747
  t,
748
748
  n,
749
749
  a,
750
750
  r
751
751
  );
752
752
  }
753
- function be(e) {
753
+ function he(e) {
754
754
  return e == null ? void 0 : e.map(
755
755
  ({
756
756
  format: t,
@@ -771,29 +771,29 @@ function Ce(e) {
771
771
  } = e;
772
772
  return te(r);
773
773
  }
774
- function yn(e, t) {
774
+ function Cn(e, t) {
775
775
  return e == null ? void 0 : e.map(
776
- (n) => Et(te(be([n])[0]), n.format, t)
776
+ (n) => Rt(te(he([n])[0]), n.format, t)
777
777
  );
778
778
  }
779
- function Ci(e, t) {
779
+ function Si(e, t) {
780
780
  return e == null ? void 0 : e.map(
781
- (n) => mo(te(be([n])[0]), n.format, t)
781
+ (n) => ho(te(he([n])[0]), n.format, t)
782
782
  );
783
783
  }
784
- function hi(e, t) {
784
+ function Ti(e, t) {
785
785
  const { dateFormat: n, customFormat: o, ...r } = Ce(e.field);
786
786
  return {
787
787
  ...e,
788
- field: t ? r : Et(Ce(e.field), e.field.format, "raw")
788
+ field: t ? r : Rt(Ce(e.field), e.field.format, "raw")
789
789
  };
790
790
  }
791
- function Te(e, t = !1) {
791
+ function Me(e, t = !1) {
792
792
  if (e)
793
793
  return {
794
794
  ...e,
795
- conditions: e.conditions.map((n) => hi(n, t)),
796
- groups: e.groups.map((n) => Te(n, t))
795
+ conditions: e.conditions.map((n) => Ti(n, t)),
796
+ groups: e.groups.map((n) => Me(n, t))
797
797
  };
798
798
  }
799
799
  function te(e) {
@@ -806,151 +806,151 @@ function te(e) {
806
806
  )
807
807
  }), (o = t.parameters) != null && o.filters && (t.parameters = {
808
808
  ...t.parameters,
809
- filters: Te(t.parameters.filters)
809
+ filters: Me(t.parameters.filters)
810
810
  }), t;
811
811
  }
812
- function Ii(e, t) {
813
- return t.cardType === "detailTable" || !go(t.cardType) || t.temporalResultOwner !== "config" ? yn(e, "grouped") : e == null ? void 0 : e.map((n) => {
814
- const o = yo(n), r = Ce(o ?? n);
812
+ function Di(e, t) {
813
+ return t.cardType === "detailTable" || !Co(t.cardType) || t.temporalResultOwner !== "config" ? Cn(e, "grouped") : e == null ? void 0 : e.map((n) => {
814
+ const o = Io(n), r = Ce(o ?? n);
815
815
  if (!o)
816
816
  return r;
817
817
  const { dateFormat: i, customFormat: s, ...a } = r;
818
818
  return a;
819
819
  });
820
820
  }
821
- function bn(e, t) {
821
+ function In(e, t) {
822
822
  if (!e)
823
823
  return;
824
824
  const n = { type: t.cardType, config: e };
825
- return Ne(n) ? vi(n, t) : e.matrix === void 0 ? {} : { matrix: e.matrix };
825
+ return Ne(n) ? Mi(n, t) : e.matrix === void 0 ? {} : { matrix: e.matrix };
826
826
  }
827
- function vi(e, t = {}) {
827
+ function Mi(e, t = {}) {
828
828
  var i, s, a;
829
829
  const n = e.config;
830
830
  if (!n) return;
831
831
  const o = { ...t, cardType: e.type };
832
832
  return {
833
833
  ...n,
834
- groupByColumns: Ii(n.groupByColumns, o),
835
- metricColumns: (i = be(n.metricColumns)) == null ? void 0 : i.map(
834
+ groupByColumns: Di(n.groupByColumns, o),
835
+ metricColumns: (i = he(n.metricColumns)) == null ? void 0 : i.map(
836
836
  te
837
837
  ),
838
- pivotByColumns: yn(n.pivotByColumns, "grouped"),
839
- sortByColumns: (s = be(n.sortByColumns)) == null ? void 0 : s.map(
838
+ pivotByColumns: Cn(n.pivotByColumns, "grouped"),
839
+ sortByColumns: (s = he(n.sortByColumns)) == null ? void 0 : s.map(
840
840
  te
841
841
  ),
842
- detailColumns: Ci(n.detailColumns, (a = o.dataSource) == null ? void 0 : a.connectionType),
843
- filters: Te(n.filters)
842
+ detailColumns: Si(n.detailColumns, (a = o.dataSource) == null ? void 0 : a.connectionType),
843
+ filters: Me(n.filters)
844
844
  };
845
845
  }
846
- function he(e) {
846
+ function Ie(e) {
847
847
  return (e == null ? void 0 : e.type) === "number" || (e == null ? void 0 : e.type) === "currency";
848
848
  }
849
- function Fi(e) {
849
+ function Vi(e) {
850
850
  return (e == null ? void 0 : e.type) === "number";
851
851
  }
852
- function Si(e) {
852
+ function ki(e) {
853
853
  var n;
854
- if (!Fi(e))
854
+ if (!Vi(e))
855
855
  return !1;
856
856
  const t = (n = e == null ? void 0 : e.numberFormat) == null ? void 0 : n.style;
857
857
  return t === void 0 || t === "decimal" || t === "currency";
858
858
  }
859
- function Di(e, t) {
859
+ function Pi(e, t) {
860
860
  const n = t == null ? void 0 : t.type;
861
861
  if (n && n !== "none" && n !== "number")
862
862
  return { currencyBindable: !1 };
863
- const o = n === "number" ? t != null && t.numberFormat ? Co(t.numberFormat, {
863
+ const o = n === "number" ? t != null && t.numberFormat ? Fo(t.numberFormat, {
864
864
  preserveOmittedProperties: !0
865
- }) : { type: "number" } : void 0, r = ge(e.format, {
865
+ }) : { type: "number" } : void 0, r = ye(e.format, {
866
866
  preserveOmittedProperties: !0
867
867
  }), i = re(e.dataType) === "number" ? { type: "number" } : void 0, a = (t == null ? void 0 : t.inheritMetricFormat) === !1 || !!(t != null && t.numberFormat) && (t == null ? void 0 : t.inheritMetricFormat) !== !0 ? o : r || i || o;
868
868
  return {
869
869
  authoredFormat: a,
870
- currencyBindable: he(a)
870
+ currencyBindable: Ie(a)
871
871
  };
872
872
  }
873
- function Ti(e, t) {
874
- const n = ge(t.format, {
873
+ function xi(e, t) {
874
+ const n = ye(t.format, {
875
875
  preserveOmittedProperties: !0
876
876
  }), o = re(t.dataType) === "number" ? { type: "number" } : void 0, r = n || o;
877
877
  return {
878
878
  authoredFormat: r,
879
879
  source: n ? "semantic" : o ? "inferred" : void 0,
880
- currencyBindable: he(r)
880
+ currencyBindable: Ie(r)
881
881
  };
882
882
  }
883
883
  function Be(e, t = {}) {
884
884
  var c, l, u;
885
- const n = t.column ?? ((c = bo(e)) == null ? void 0 : c.value);
885
+ const n = t.column ?? ((c = vo(e)) == null ? void 0 : c.value);
886
886
  if ((n == null ? void 0 : n.kind) === "sqlKpiValue") {
887
887
  const d = t.resultColumnKey ? {
888
888
  kind: "column",
889
889
  columnKey: t.resultColumnKey
890
- } : void 0, f = ge(
891
- mr({ card: e, column: { kind: "sqlKpiValue" }, surface: "kpiValue" }).format,
890
+ } : void 0, f = ye(
891
+ hr({ card: e, column: { kind: "sqlKpiValue" }, surface: "kpiValue" }).format,
892
892
  { preserveOmittedProperties: !0 }
893
893
  );
894
894
  return {
895
895
  target: d,
896
896
  authoredFormat: f,
897
897
  ...f ? { source: "stored" } : {},
898
- currencyBindable: !!d && he(f)
898
+ currencyBindable: !!d && Ie(f)
899
899
  };
900
900
  }
901
901
  const o = n ? (u = (l = e.config) == null ? void 0 : l.metricColumns) == null ? void 0 : u.find((d) => d.id === n.fieldId) : void 0, r = o != null && o.id ? {
902
902
  kind: "metric",
903
903
  metricId: o.id
904
- } : void 0, i = ge(o == null ? void 0 : o.format, {
904
+ } : void 0, i = ye(o == null ? void 0 : o.format, {
905
905
  preserveOmittedProperties: !0
906
906
  }), s = re(o == null ? void 0 : o.dataType) === "number" ? { type: "number" } : void 0, a = i || s;
907
907
  return {
908
908
  target: r,
909
909
  authoredFormat: a,
910
910
  ...i ? { source: "stored" } : s ? { source: "inferred" } : {},
911
- currencyBindable: Bt(e.type) && !!r && he(a)
911
+ currencyBindable: Kt(e.type) && !!r && Ie(a)
912
912
  };
913
913
  }
914
- function Cn(e, t, n) {
914
+ function vn(e, t, n) {
915
915
  var r;
916
916
  const o = n(e, t);
917
917
  return ((r = e.derivedField) == null ? void 0 : r.format) ?? (o == null ? void 0 : o.format) ?? (o == null ? void 0 : o.resolvedField.format);
918
918
  }
919
- function hn(e, t, n) {
920
- return e.kind === "calculated" ? e.definition.format : Cn(e.field, t, n);
919
+ function Fn(e, t, n) {
920
+ return e.kind === "calculated" ? e.definition.format : vn(e.field, t, n);
921
921
  }
922
- function ol(e, t) {
923
- const n = _t(t), o = (r, i) => Object.fromEntries(r.flatMap((s) => {
922
+ function cl(e, t) {
923
+ const n = qt(t), o = (r, i) => Object.fromEntries(r.flatMap((s) => {
924
924
  const a = i(s);
925
925
  return a ? [[s.id, a]] : [];
926
926
  }));
927
927
  return {
928
- measureFormats: o(e.measures, (r) => hn(r, e.source, n)),
929
- levelFormats: o([...e.rows, ...e.columns], (r) => Cn(r.field, e.source, n))
928
+ measureFormats: o(e.measures, (r) => Fn(r, e.source, n)),
929
+ levelFormats: o([...e.rows, ...e.columns], (r) => vn(r.field, e.source, n))
930
930
  };
931
931
  }
932
- function In(e, t = []) {
932
+ function Sn(e, t = []) {
933
933
  const n = We(e);
934
934
  if (n.status !== "ready") return [];
935
- const { spec: o, presentation: r } = n.config, i = _t(t);
935
+ const { spec: o, presentation: r } = n.config, i = qt(t);
936
936
  return o.measures.map((s) => {
937
937
  var m;
938
- const a = s.kind === "aggregate" ? i(s.field, o.source) : void 0, c = gr(r.measureFormats[s.id], hn(s, o.source, i)), l = s.kind === "calculated" ? s.definition.dataType : ["MIN", "MAX"].includes(s.aggregate) ? ((m = s.field.derivedField) == null ? void 0 : m.dataType) ?? (a == null ? void 0 : a.resolvedField.dataType) ?? s.field.dataType : "number", u = re(l) === "number", d = s.kind === "calculated" || !!(a || s.field.derivedField || s.field.name === "*"), f = c && yr(c) ? c : !c && u && d ? { type: "number" } : void 0;
939
- return { measureId: s.id, label: br(s, r), canonical: f };
938
+ const a = s.kind === "aggregate" ? i(s.field, o.source) : void 0, c = Cr(r.measureFormats[s.id], Fn(s, o.source, i)), l = s.kind === "calculated" ? s.definition.dataType : ["MIN", "MAX"].includes(s.aggregate) ? ((m = s.field.derivedField) == null ? void 0 : m.dataType) ?? (a == null ? void 0 : a.resolvedField.dataType) ?? s.field.dataType : "number", u = re(l) === "number", d = s.kind === "calculated" || !!(a || s.field.derivedField || s.field.name === "*"), f = c && Ir(c) ? c : !c && u && d ? { type: "number" } : void 0;
939
+ return { measureId: s.id, label: vr(s, r), canonical: f };
940
940
  });
941
941
  }
942
- function Mi(e) {
942
+ function wi(e) {
943
943
  var t, n;
944
944
  return e.type === "detailTable" ? ((t = e.config) == null ? void 0 : t.detailColumns) || [] : ((n = e.config) == null ? void 0 : n.metricColumns) || [];
945
945
  }
946
- function vn(e) {
946
+ function Tn(e) {
947
947
  return new Set(
948
- Xt(e).flatMap(
949
- (t) => (t.controlBindings || []).filter(ve).map((n) => n.controlId)
948
+ tn(e).flatMap(
949
+ (t) => (t.controlBindings || []).filter(Fe).map((n) => n.controlId)
950
950
  )
951
951
  );
952
952
  }
953
- function Vi(e, t) {
953
+ function Oi(e, t) {
954
954
  const n = [
955
955
  t.id,
956
956
  t.alias,
@@ -968,81 +968,81 @@ function Vi(e, t) {
968
968
  );
969
969
  return r == null ? void 0 : r[1];
970
970
  }
971
- function St(e) {
971
+ function Mt(e) {
972
972
  return [
973
973
  ...new Map(
974
974
  e.map((t) => [
975
- U(t),
975
+ $(t),
976
976
  t
977
977
  ])
978
978
  ).values()
979
979
  ];
980
980
  }
981
- function ki(e, t = [], n) {
982
- var M;
983
- const o = !!((M = e.sql) != null && M.trim()), r = Bt(e.type), i = o && r && e.type !== "kpi" && e.type !== "matrixTable", s = Mi(e), a = ho(e), c = !o && e.type === "kpi" ? s.map(
984
- (h) => Be(e, {
985
- column: { kind: "field", fieldId: h.id }
981
+ function Ai(e, t = [], n) {
982
+ var D;
983
+ const o = !!((D = e.sql) != null && D.trim()), r = Kt(e.type), i = o && r && e.type !== "kpi" && e.type !== "matrixTable", s = wi(e), a = So(e), c = !o && e.type === "kpi" ? s.map(
984
+ (C) => Be(e, {
985
+ column: { kind: "field", fieldId: C.id }
986
986
  })
987
- ) : [], l = !o && e.type === "matrixTable" ? In(e, n) : [], u = (o ? [] : s).map(
988
- (h) => ({
987
+ ) : [], l = !o && e.type === "matrixTable" ? Sn(e, n) : [], u = (o ? [] : s).map(
988
+ (C) => ({
989
989
  kind: "metric",
990
- metricId: h.id
990
+ metricId: C.id
991
991
  })
992
992
  ), d = l.map(
993
- (h) => ({
993
+ (C) => ({
994
994
  kind: "matrix_measure",
995
- measureId: h.measureId
995
+ measureId: C.measureId
996
996
  })
997
- ), f = l.filter((h) => {
997
+ ), f = l.filter((C) => {
998
998
  var w, A;
999
- return ((w = h.canonical) == null ? void 0 : w.type) === "number" || ((A = h.canonical) == null ? void 0 : A.type) === "currency";
999
+ return ((w = C.canonical) == null ? void 0 : w.type) === "number" || ((A = C.canonical) == null ? void 0 : A.type) === "currency";
1000
1000
  }).map(
1001
- (h) => ({
1001
+ (C) => ({
1002
1002
  kind: "matrix_measure",
1003
- measureId: h.measureId
1003
+ measureId: C.measureId
1004
1004
  })
1005
- ), m = e.type === "matrixTable" ? [] : e.type === "kpi" ? c.filter((h) => h.currencyBindable).flatMap(
1006
- (h) => h.target ? [h.target] : []
1005
+ ), m = e.type === "matrixTable" ? [] : e.type === "kpi" ? c.filter((C) => C.currencyBindable).flatMap(
1006
+ (C) => C.target ? [C.target] : []
1007
1007
  ) : (o || !r ? [] : s).filter(
1008
- (h) => (Io(e.type) ? Di(
1009
- h,
1010
- Vi(a, h)
1011
- ) : Ti(e, h)).currencyBindable
1008
+ (C) => (To(e.type) ? Pi(
1009
+ C,
1010
+ Oi(a, C)
1011
+ ) : xi(e, C)).currencyBindable
1012
1012
  ).map(
1013
- (h) => ({
1013
+ (C) => ({
1014
1014
  kind: "metric",
1015
- metricId: h.id
1015
+ metricId: C.id
1016
1016
  })
1017
1017
  ), g = [...new Set(t)], p = (i ? g : []).map(
1018
- (h) => ({
1018
+ (C) => ({
1019
1019
  kind: "column",
1020
- columnKey: h
1020
+ columnKey: C
1021
1021
  })
1022
1022
  ), y = (i ? g : []).filter(
1023
- (h) => Si(
1024
- a[h]
1023
+ (C) => ki(
1024
+ a[C]
1025
1025
  )
1026
1026
  ).map(
1027
- (h) => ({
1027
+ (C) => ({
1028
1028
  kind: "column",
1029
- columnKey: h
1029
+ columnKey: C
1030
1030
  })
1031
- ), b = (o && e.type === "kpi" ? g.slice(0, 1) : []).map(
1032
- (h) => ({
1031
+ ), h = (o && e.type === "kpi" ? g.slice(0, 1) : []).map(
1032
+ (C) => ({
1033
1033
  kind: "column",
1034
- columnKey: h
1034
+ columnKey: C
1035
1035
  })
1036
1036
  ), I = o && e.type === "kpi" ? Be(e, {
1037
1037
  resultColumnKey: g[0]
1038
- }) : void 0, v = r && (I != null && I.currencyBindable) ? b : [];
1038
+ }) : void 0, v = r && (I != null && I.currencyBindable) ? h : [];
1039
1039
  return {
1040
- knownTargets: St([
1040
+ knownTargets: Mt([
1041
1041
  ...e.type === "matrixTable" ? d : u,
1042
1042
  ...p,
1043
- ...b
1043
+ ...h
1044
1044
  ]),
1045
- eligibleTargets: St([
1045
+ eligibleTargets: Mt([
1046
1046
  ...m,
1047
1047
  ...f,
1048
1048
  ...y,
@@ -1050,20 +1050,20 @@ function ki(e, t = [], n) {
1050
1050
  ])
1051
1051
  };
1052
1052
  }
1053
- function rl(e, t) {
1053
+ function ul(e, t) {
1054
1054
  const n = Be(e, {
1055
1055
  resultColumnKey: t
1056
1056
  });
1057
1057
  return n.currencyBindable ? n.target : void 0;
1058
1058
  }
1059
- function il(e) {
1059
+ function dl(e) {
1060
1060
  var t;
1061
1061
  return (t = e.card.sql) != null && t.trim() ? { kind: "column", columnKey: e.columnKey } : e.metricId ? { kind: "metric", metricId: e.metricId } : void 0;
1062
1062
  }
1063
- function U(e) {
1063
+ function $(e) {
1064
1064
  return e.kind === "metric" ? `metric:${e.metricId}` : e.kind === "column" ? `column:${e.columnKey}` : `matrix_measure:${e.measureId}`;
1065
1065
  }
1066
- function xi(e) {
1066
+ function Ei(e) {
1067
1067
  if (!e || typeof e != "object" || Array.isArray(e))
1068
1068
  return;
1069
1069
  const t = e;
@@ -1074,20 +1074,20 @@ function xi(e) {
1074
1074
  if (t.kind === "matrix_measure" && typeof t.measureId == "string" && t.measureId.trim())
1075
1075
  return { kind: "matrix_measure", measureId: t.measureId };
1076
1076
  }
1077
- function Dt(e) {
1078
- const t = $t(e);
1077
+ function Vt(e) {
1078
+ const t = Yt(e);
1079
1079
  return typeof e == "string" && e === t ? t : void 0;
1080
1080
  }
1081
- function Fn(e) {
1081
+ function Dn(e) {
1082
1082
  if (e.type !== "enum" || e.source.kind !== "manual")
1083
1083
  return { diagnostic: "invalid_control_type" };
1084
1084
  const t = e.source.options.map(
1085
- (n) => Dt(n.value)
1085
+ (n) => Vt(n.value)
1086
1086
  );
1087
1087
  if (t.length === 0 || t.some((n) => !n))
1088
1088
  return { diagnostic: "invalid_currency_option" };
1089
1089
  if (e.requiredAtExecution) {
1090
- const n = e.initialValueStrategy === "saved_default" ? Dt(e.defaultValue) : void 0;
1090
+ const n = e.initialValueStrategy === "saved_default" ? Vt(e.defaultValue) : void 0;
1091
1091
  if (!n || !t.includes(n))
1092
1092
  return { diagnostic: "invalid_control_default" };
1093
1093
  }
@@ -1096,11 +1096,11 @@ function Fn(e) {
1096
1096
  currencies: t
1097
1097
  };
1098
1098
  }
1099
- function sl(e) {
1100
- return "control" in Fn(e);
1099
+ function fl(e) {
1100
+ return "control" in Dn(e);
1101
1101
  }
1102
- function Sn(e) {
1103
- const t = vn(e.dashboard);
1102
+ function Mn(e) {
1103
+ const t = Tn(e.dashboard);
1104
1104
  if (t.size === 0)
1105
1105
  return {
1106
1106
  definitions: e.definitions || [],
@@ -1122,8 +1122,8 @@ function Sn(e) {
1122
1122
  )
1123
1123
  };
1124
1124
  }
1125
- function al(e) {
1126
- return Sn({
1125
+ function pl(e) {
1126
+ return Mn({
1127
1127
  ...e,
1128
1128
  referencedControlIds: new Set(
1129
1129
  Ye({
@@ -1133,9 +1133,9 @@ function al(e) {
1133
1133
  )
1134
1134
  });
1135
1135
  }
1136
- function ll(e) {
1136
+ function ml(e) {
1137
1137
  var t;
1138
- return Sn({
1138
+ return Mn({
1139
1139
  ...e,
1140
1140
  referencedControlIds: new Set(
1141
1141
  Ye({
@@ -1145,33 +1145,33 @@ function ll(e) {
1145
1145
  )
1146
1146
  });
1147
1147
  }
1148
- function Dn(e) {
1148
+ function Vn(e) {
1149
1149
  return {
1150
1150
  knownKeys: new Set(
1151
- e.knownTargets.map(U)
1151
+ e.knownTargets.map($)
1152
1152
  ),
1153
1153
  eligibleKeys: new Set(
1154
- e.eligibleTargets.map(U)
1154
+ e.eligibleTargets.map($)
1155
1155
  ),
1156
1156
  controlsById: new Map(
1157
1157
  (e.controls || []).map((t) => [t.id, t])
1158
1158
  )
1159
1159
  };
1160
1160
  }
1161
- function Tn(e, t) {
1161
+ function kn(e, t) {
1162
1162
  if (!e || typeof e != "object" || e.target !== "presentation_currency")
1163
1163
  return {};
1164
1164
  const n = e, o = typeof n.controlId == "string" && n.controlId.trim() ? n.controlId : void 0;
1165
1165
  if (!o)
1166
1166
  return { diagnostic: { code: "invalid_binding_shape" } };
1167
- const r = xi(
1167
+ const r = Ei(
1168
1168
  n.presentationTarget
1169
1169
  );
1170
1170
  if (!r)
1171
1171
  return {
1172
1172
  diagnostic: { code: "missing_target", controlId: o }
1173
1173
  };
1174
- const i = U(r);
1174
+ const i = $(r);
1175
1175
  if (!t.knownKeys.has(i))
1176
1176
  return {
1177
1177
  diagnostic: { code: "stale_target", controlId: o }
@@ -1185,7 +1185,7 @@ function Tn(e, t) {
1185
1185
  return {
1186
1186
  diagnostic: { code: "missing_control", controlId: o }
1187
1187
  };
1188
- const a = Fn(s);
1188
+ const a = Dn(s);
1189
1189
  return "diagnostic" in a ? {
1190
1190
  diagnostic: { code: a.diagnostic, controlId: o }
1191
1191
  } : {
@@ -1197,27 +1197,27 @@ function Tn(e, t) {
1197
1197
  }
1198
1198
  };
1199
1199
  }
1200
- function cl(e) {
1201
- const t = Dn(e);
1200
+ function gl(e) {
1201
+ const t = Vn(e);
1202
1202
  return (e.bindings || []).flatMap((n) => {
1203
- const o = Tn(n, t);
1203
+ const o = kn(n, t);
1204
1204
  return "diagnostic" in o ? [o.diagnostic] : [];
1205
1205
  });
1206
1206
  }
1207
- function Pi(e) {
1207
+ function Bi(e) {
1208
1208
  var r;
1209
- const t = [], n = U(e.target), o = Dn(e);
1209
+ const t = [], n = $(e.target), o = Vn(e);
1210
1210
  for (const i of e.bindings || []) {
1211
- const s = Tn(i, o);
1211
+ const s = kn(i, o);
1212
1212
  if ("diagnostic" in s) {
1213
1213
  t.push(s.diagnostic);
1214
1214
  continue;
1215
1215
  }
1216
1216
  const a = s.binding;
1217
- if (!a || U(
1217
+ if (!a || $(
1218
1218
  a.presentationTarget
1219
1219
  ) !== n) continue;
1220
- const l = $t(
1220
+ const l = Yt(
1221
1221
  (r = e.values) == null ? void 0 : r[a.control.id]
1222
1222
  );
1223
1223
  if (!(!l || !a.currencies.includes(l)))
@@ -1225,10 +1225,10 @@ function Pi(e) {
1225
1225
  }
1226
1226
  return { diagnostics: t };
1227
1227
  }
1228
- function wi(e, t, n, o) {
1229
- const r = { ...e, config: { ...e.config, matrix: t } }, i = ki(r, [], o), s = In(r, o), a = { ...t.presentation.measureFormats };
1228
+ function _i(e, t, n, o) {
1229
+ const r = { ...e, config: { ...e.config, matrix: t } }, i = Ai(r, [], o), s = Sn(r, o), a = { ...t.presentation.measureFormats };
1230
1230
  for (const c of s) {
1231
- const l = { kind: "matrix_measure", measureId: c.measureId }, { currency: u } = Pi({
1231
+ const l = { kind: "matrix_measure", measureId: c.measureId }, { currency: u } = Bi({
1232
1232
  ...n,
1233
1233
  ...i,
1234
1234
  bindings: e.controlBindings,
@@ -1240,7 +1240,7 @@ function wi(e, t, n, o) {
1240
1240
  }
1241
1241
  return { ...t.presentation, measureFormats: a };
1242
1242
  }
1243
- function Oi(e, t) {
1243
+ function Ri(e, t) {
1244
1244
  if (!e || typeof e != "object" || !("kind" in e))
1245
1245
  return e;
1246
1246
  switch (e.kind) {
@@ -1285,12 +1285,12 @@ function Oi(e, t) {
1285
1285
  return e;
1286
1286
  }
1287
1287
  }
1288
- function Ai(e, t) {
1288
+ function Ki(e, t) {
1289
1289
  return {
1290
1290
  id: e.id,
1291
1291
  scope: e.scope,
1292
1292
  type: e.type,
1293
- source: Oi(e.source, t),
1293
+ source: Ri(e.source, t),
1294
1294
  initialValueStrategy: e.initialValueStrategy,
1295
1295
  defaultValue: e.defaultValue,
1296
1296
  requiredAtExecution: e.requiredAtExecution,
@@ -1305,7 +1305,7 @@ function Ai(e, t) {
1305
1305
  } : {}
1306
1306
  };
1307
1307
  }
1308
- function Ei(e, t) {
1308
+ function qi(e, t) {
1309
1309
  return e.target === "sql_param" || e.target === "presentation_currency" ? e : e.target === "config_field_selector" && !(t != null && t.includePresentation) ? {
1310
1310
  ...e,
1311
1311
  mapping: Object.fromEntries(
@@ -1329,49 +1329,49 @@ function Ei(e, t) {
1329
1329
  )
1330
1330
  };
1331
1331
  }
1332
- function Tt(e = [], t) {
1333
- return [...e].map((n) => Ai(n, t)).sort(
1332
+ function kt(e = [], t) {
1333
+ return [...e].map((n) => Ki(n, t)).sort(
1334
1334
  (n, o) => n.id.localeCompare(o.id) || n.scope.localeCompare(o.scope) || n.type.localeCompare(o.type)
1335
1335
  );
1336
1336
  }
1337
- function Bi(e = [], t) {
1337
+ function Ni(e = [], t) {
1338
1338
  return e.filter(
1339
- (n) => (t == null ? void 0 : t.includePresentation) || !ve(n)
1340
- ).map((n) => Ei(n, t)).sort(
1339
+ (n) => (t == null ? void 0 : t.includePresentation) || !Fe(n)
1340
+ ).map((n) => qi(n, t)).sort(
1341
1341
  (n, o) => _(n).localeCompare(_(o))
1342
1342
  );
1343
1343
  }
1344
- function _i(e, t) {
1344
+ function Li(e, t) {
1345
1345
  return e ? _({
1346
- controlDefinitions: Tt(e.controlDefinitions, t),
1347
- cardControlDefinitions: Tt(
1346
+ controlDefinitions: kt(e.controlDefinitions, t),
1347
+ cardControlDefinitions: kt(
1348
1348
  e.cardControlDefinitions,
1349
1349
  t
1350
1350
  ),
1351
- controlBindings: Bi(e.controlBindings, t)
1351
+ controlBindings: Ni(e.controlBindings, t)
1352
1352
  }) : "__none__";
1353
1353
  }
1354
- const Ri = ["table", "detailTable"], Mt = (e) => Ri.includes(e.type), Ki = "calendar-context";
1355
- function qi(e) {
1354
+ const ji = ["table", "detailTable"], Pt = (e) => ji.includes(e.type), zi = "calendar-context";
1355
+ function Gi(e) {
1356
1356
  const { id: t, label: n, field: o, ...r } = e;
1357
1357
  return {
1358
1358
  ...r,
1359
- field: Xe(
1359
+ field: Ze(
1360
1360
  o
1361
1361
  )
1362
1362
  };
1363
1363
  }
1364
- function Me(e) {
1364
+ function Ve(e) {
1365
1365
  if (!e)
1366
1366
  return;
1367
1367
  const { id: t, conditions: n, groups: o, ...r } = e;
1368
1368
  return {
1369
1369
  ...r,
1370
- conditions: n.map(qi),
1371
- groups: o.map((i) => Me(i))
1370
+ conditions: n.map(Gi),
1371
+ groups: o.map((i) => Ve(i))
1372
1372
  };
1373
1373
  }
1374
- function Xe(e) {
1374
+ function Ze(e) {
1375
1375
  var o, r;
1376
1376
  const { label: t, ...n } = e;
1377
1377
  return {
@@ -1380,22 +1380,22 @@ function Xe(e) {
1380
1380
  calculatedFormula: {
1381
1381
  ...e.calculatedFormula,
1382
1382
  inputFields: e.calculatedFormula.inputFields.map(
1383
- Xe
1383
+ Ze
1384
1384
  )
1385
1385
  }
1386
1386
  } : {},
1387
1387
  ...(r = e.parameters) != null && r.filters ? {
1388
1388
  parameters: {
1389
1389
  ...e.parameters,
1390
- filters: Me(
1390
+ filters: Ve(
1391
1391
  e.parameters.filters
1392
1392
  )
1393
1393
  }
1394
1394
  } : {}
1395
1395
  };
1396
1396
  }
1397
- function Ni(e) {
1398
- const t = (n) => n == null ? void 0 : n.map(Xe);
1397
+ function Hi(e) {
1398
+ const t = (n) => n == null ? void 0 : n.map(Ze);
1399
1399
  return {
1400
1400
  ...e,
1401
1401
  groupByColumns: t(e.groupByColumns),
@@ -1403,26 +1403,26 @@ function Ni(e) {
1403
1403
  pivotByColumns: t(e.pivotByColumns),
1404
1404
  sortByColumns: t(e.sortByColumns),
1405
1405
  detailColumns: t(e.detailColumns),
1406
- filters: e.filters ? Me(e.filters) : void 0
1406
+ filters: e.filters ? Ve(e.filters) : void 0
1407
1407
  };
1408
1408
  }
1409
- function Li(e, t, n) {
1409
+ function $i(e, t, n) {
1410
1410
  if (!e)
1411
1411
  return JSON.stringify(e);
1412
- if (n === "matrixTable" && e.matrix) return _(Ar(e.matrix.spec));
1413
- const { matrix: o, ...r } = e, i = t ? Ni(r) : r;
1412
+ if (n === "matrixTable" && e.matrix) return _(Kr(e.matrix.spec));
1413
+ const { matrix: o, ...r } = e, i = t ? Hi(r) : r;
1414
1414
  return JSON.stringify({
1415
1415
  ...i,
1416
- filters: Me(i.filters)
1416
+ filters: Ve(i.filters)
1417
1417
  });
1418
1418
  }
1419
- function ji(e) {
1419
+ function Ui(e) {
1420
1420
  if (!e)
1421
1421
  return null;
1422
1422
  const { format: t, ...n } = e;
1423
1423
  return n;
1424
1424
  }
1425
- function zi(e, t) {
1425
+ function Qi(e, t) {
1426
1426
  const n = /* @__PURE__ */ new Map();
1427
1427
  for (const r of (t == null ? void 0 : t.controlDefinitions) || [])
1428
1428
  n.set(r.id, r.type);
@@ -1438,7 +1438,7 @@ function zi(e, t) {
1438
1438
  );
1439
1439
  return _(o);
1440
1440
  }
1441
- function Gi(e, {
1441
+ function Wi(e, {
1442
1442
  finalFiltersKey: t,
1443
1443
  cardFilterValues: n,
1444
1444
  controlValues: o,
@@ -1452,12 +1452,12 @@ function Gi(e, {
1452
1452
  }) {
1453
1453
  const { filterColumns: d, ...f } = e.queryConfig || {}, m = d == null ? void 0 : d.filter(
1454
1454
  (v) => {
1455
- var M, h;
1456
- return (h = (M = e.queryConfig) == null ? void 0 : M.filters) == null ? void 0 : h.some((w) => w.filterColumnName === v.name);
1455
+ var D, C;
1456
+ return (C = (D = e.queryConfig) == null ? void 0 : D.filters) == null ? void 0 : C.some((w) => w.filterColumnName === v.name);
1457
1457
  }
1458
1458
  ), g = (e == null ? void 0 : e.sql) || "", p = Le((e == null ? void 0 : e.python) || ""), y = ["table", "detailTable", "matrixTable"].includes(
1459
1459
  e.type
1460
- ) ? "table" : e.type === "kpi" ? "kpi" : "chart", b = a || bn(e.config, { cardType: e.type, dataSource: e.dataSource }), I = vo.includes(
1460
+ ) ? "table" : e.type === "kpi" ? "kpi" : "chart", h = a || In(e.config, { cardType: e.type, dataSource: e.dataSource }), I = Do.includes(
1461
1461
  e.type
1462
1462
  );
1463
1463
  return [
@@ -1467,34 +1467,34 @@ function Gi(e, {
1467
1467
  g,
1468
1468
  p,
1469
1469
  JSON.stringify(n),
1470
- zi(o, {
1470
+ Qi(o, {
1471
1471
  controlDefinitions: r,
1472
1472
  cardControlDefinitions: i
1473
1473
  }),
1474
- _i({
1474
+ Li({
1475
1475
  controlDefinitions: r,
1476
1476
  cardControlDefinitions: i,
1477
1477
  controlBindings: s
1478
1478
  }),
1479
1479
  _(
1480
- ji(c)
1480
+ Ui(c)
1481
1481
  ),
1482
1482
  _(l ?? null),
1483
- Ki,
1483
+ zi,
1484
1484
  _(u),
1485
1485
  JSON.stringify(f),
1486
1486
  JSON.stringify(m),
1487
- Li(
1488
- b,
1487
+ $i(
1488
+ h,
1489
1489
  I,
1490
1490
  e.type
1491
1491
  ),
1492
1492
  t
1493
1493
  ];
1494
1494
  }
1495
- function Hi(e, t, n) {
1495
+ function Yi(e, t, n) {
1496
1496
  var a, c, l;
1497
- const o = Gi(e, t), r = _(o), i = ((a = n == null ? void 0 : n.resolvePaginationConfig) == null ? void 0 : a.call(n, r)) ?? e.paginationConfig, s = Mt(e) && Fe(e.config) || Mt(e) && e.sql && ((l = (c = e.preferences) == null ? void 0 : c.tablePrefs) == null ? void 0 : l.enableDevModePagination);
1497
+ const o = Wi(e, t), r = _(o), i = ((a = n == null ? void 0 : n.resolvePaginationConfig) == null ? void 0 : a.call(n, r)) ?? e.paginationConfig, s = Pt(e) && Se(e.config) || Pt(e) && e.sql && ((l = (c = e.preferences) == null ? void 0 : c.tablePrefs) == null ? void 0 : l.enableDevModePagination);
1498
1498
  return {
1499
1499
  queryKey: [
1500
1500
  ...o,
@@ -1504,8 +1504,8 @@ function Hi(e, t, n) {
1504
1504
  paginationConfig: i
1505
1505
  };
1506
1506
  }
1507
- function Ui(e, t, n, o) {
1508
- return Hi(
1507
+ function Ji(e, t, n, o) {
1508
+ return Yi(
1509
1509
  e,
1510
1510
  {
1511
1511
  finalFiltersKey: t.finalFiltersKey,
@@ -1522,9 +1522,9 @@ function Ui(e, t, n, o) {
1522
1522
  o
1523
1523
  );
1524
1524
  }
1525
- function Mn(e) {
1525
+ function Pn(e) {
1526
1526
  const t = {
1527
- ...Vr,
1527
+ ...Or,
1528
1528
  ...e.presentation
1529
1529
  }, n = t.displayMode, {
1530
1530
  bookkeepingKeys: o,
@@ -1532,7 +1532,7 @@ function Mn(e) {
1532
1532
  deltaColumnKeys: i,
1533
1533
  percentChangeColumnKeys: s,
1534
1534
  ratioColumnKeys: a
1535
- } = Zt(e.comparisonMetadata), c = /* @__PURE__ */ new Set();
1535
+ } = nn(e.comparisonMetadata), c = /* @__PURE__ */ new Set();
1536
1536
  t.showComparison && (n === "difference" || n === "both") && i.forEach((f) => c.add(f)), t.showComparison && (n === "percent_change" || n === "both") && s.forEach((f) => c.add(f)), t.showComparison && n === "ratio" && a.forEach((f) => c.add(f));
1537
1537
  const l = new Set(o);
1538
1538
  t.showComparison || r.forEach((f) => l.add(f)), [i, s, a].forEach(
@@ -1543,11 +1543,11 @@ function Mn(e) {
1543
1543
  const u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
1544
1544
  return Object.entries(e.comparisonMetadata || {}).forEach(
1545
1545
  ([f, m]) => {
1546
- var b;
1546
+ var h;
1547
1547
  const g = m.output;
1548
1548
  if (!g || g.outputId !== f || g.availability.status !== "available")
1549
1549
  return;
1550
- const p = ((b = e.resolveMetricName) == null ? void 0 : b.call(e, {
1550
+ const p = ((h = e.resolveMetricName) == null ? void 0 : h.call(e, {
1551
1551
  metricId: g.metricId,
1552
1552
  metricAlias: g.metricAlias
1553
1553
  })) || m.displayName || g.metricId, y = m.displayLabel || "Comparison";
@@ -1585,14 +1585,14 @@ function Mn(e) {
1585
1585
  columnPresentationOwners: d
1586
1586
  };
1587
1587
  }
1588
- function ul(e) {
1588
+ function yl(e) {
1589
1589
  var t, n;
1590
- return Mn({
1590
+ return Pn({
1591
1591
  comparisonMetadata: e.comparisonMetadata,
1592
1592
  presentation: (n = (t = e.card) == null ? void 0 : t.preferences) == null ? void 0 : n.comparisonPresentation,
1593
1593
  resolveMetricName: ({ metricId: o, metricAlias: r }) => {
1594
1594
  var i;
1595
- return (i = mn({
1595
+ return (i = bn({
1596
1596
  card: e.card,
1597
1597
  columnKeyMap: e.columnKeyMap,
1598
1598
  metricId: o,
@@ -1601,7 +1601,7 @@ function ul(e) {
1601
1601
  }
1602
1602
  });
1603
1603
  }
1604
- function dl(e) {
1604
+ function bl(e) {
1605
1605
  var n;
1606
1606
  return (((n = e.card.config) == null ? void 0 : n.metricColumns) || []).filter(
1607
1607
  (o) => {
@@ -1609,10 +1609,13 @@ function dl(e) {
1609
1609
  return ((r = o.comparison) == null ? void 0 : r.mode) === "explicit";
1610
1610
  }
1611
1611
  ).some(
1612
- (o) => !Yt(e.comparisonMetadata, o)
1612
+ (o) => !Xt(e.comparisonMetadata, o)
1613
1613
  );
1614
1614
  }
1615
- function Ze(e) {
1615
+ function Zi(e) {
1616
+ return e.part === "base" && !!e.columnId;
1617
+ }
1618
+ function Xe(e) {
1616
1619
  const t = e.config ?? {};
1617
1620
  return e.type === "detailTable" ? [{ role: "detail", fields: t.detailColumns ?? [] }] : [
1618
1621
  { role: "groupby", fields: t.groupByColumns ?? [] },
@@ -1628,14 +1631,14 @@ function et(e, t) {
1628
1631
  metricAlias: Q(e)
1629
1632
  } : { kind: "dimension", role: t, fieldId: e.id };
1630
1633
  }
1631
- function Vt(e) {
1634
+ function xt(e) {
1632
1635
  const t = /* @__PURE__ */ new Map();
1633
1636
  for (const n of e) t.set(n, (t.get(n) ?? 0) + 1);
1634
1637
  return t;
1635
1638
  }
1636
- function $i(e, t) {
1639
+ function Xi(e, t) {
1637
1640
  var d, f;
1638
- const n = [...t.keys], o = new Set(n), r = t.columnKeyMap, i = Ze(e).flatMap(
1641
+ const n = [...t.keys], o = new Set(n), r = t.columnKeyMap, i = Xe(e).flatMap(
1639
1642
  ({ role: m, fields: g }) => g.flatMap((p) => {
1640
1643
  const y = et(p, m);
1641
1644
  return y ? [
@@ -1648,7 +1651,7 @@ function $i(e, t) {
1648
1651
  }
1649
1652
  ] : [];
1650
1653
  })
1651
- ), s = Vt(i.map((m) => m.columnId)), a = Vt(
1654
+ ), s = xt(i.map((m) => m.columnId)), a = xt(
1652
1655
  i.flatMap(
1653
1656
  (m) => m.outputKey ? [m.outputKey] : []
1654
1657
  )
@@ -1663,7 +1666,7 @@ function $i(e, t) {
1663
1666
  baseKey: g,
1664
1667
  // Today's header for the column's own key; a metric shown only as pivot
1665
1668
  // members is named by its field.
1666
- authorLabel: g ? gn(g, e, r) ?? g : m.field.label || m.field.name || m.columnId
1669
+ authorLabel: g ? hn(g, e, r) ?? g : m.field.label || m.field.name || m.columnId
1667
1670
  }), g && l.set(g, { columnId: m.columnId, part: "base" });
1668
1671
  }
1669
1672
  const u = e.config;
@@ -1682,16 +1685,16 @@ function $i(e, t) {
1682
1685
  kind: "metric",
1683
1686
  metricId: p.identity.metricId,
1684
1687
  metricAlias: p.identity.metricAlias
1685
- }, b = j(y);
1688
+ }, h = j(y);
1686
1689
  if (p.authoredMetric) {
1687
- if (!c.has(b))
1690
+ if (!c.has(h))
1688
1691
  continue;
1689
1692
  } else {
1690
- if (p.identity.metricId !== $e)
1693
+ if (p.identity.metricId !== Ue)
1691
1694
  continue;
1692
- c.has(b) || c.set(b, { columnId: b, identity: y, authorLabel: "Count" });
1695
+ c.has(h) || c.set(h, { columnId: h, identity: y, authorLabel: "Count" });
1693
1696
  }
1694
- l.set(g.key, { columnId: b, part: "pivot-member" });
1697
+ l.set(g.key, { columnId: h, part: "pivot-member" });
1695
1698
  }
1696
1699
  }
1697
1700
  for (const [m, g] of Object.entries(
@@ -1706,17 +1709,17 @@ function $i(e, t) {
1706
1709
  metricAlias: p.metricAlias
1707
1710
  });
1708
1711
  if (c.has(y))
1709
- for (const b of [
1712
+ for (const h of [
1710
1713
  p.comparisonColumnKey,
1711
1714
  p.deltaColumnKey,
1712
1715
  p.percentChangeColumnKey,
1713
1716
  p.ratioColumnKey
1714
1717
  ])
1715
- b && !l.has(b) && l.set(b, { columnId: y, part: "comparison" });
1718
+ h && !l.has(h) && l.set(h, { columnId: y, part: "comparison" });
1716
1719
  }
1717
1720
  return { entries: c, owners: l };
1718
1721
  }
1719
- function Qi(e) {
1722
+ function es(e) {
1720
1723
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1721
1724
  for (const o of e.keys) {
1722
1725
  const r = { kind: "result", key: o }, i = j(r);
@@ -1729,29 +1732,29 @@ function Qi(e) {
1729
1732
  }
1730
1733
  return { entries: t, owners: n };
1731
1734
  }
1732
- function fl(e) {
1735
+ function hl(e) {
1733
1736
  const t = /* @__PURE__ */ new Set();
1734
1737
  for (const n of e ?? [])
1735
1738
  if (n && typeof n == "object")
1736
1739
  for (const o of Object.keys(n)) t.add(o);
1737
1740
  return [...t];
1738
1741
  }
1739
- function Wi(e, t) {
1742
+ function ts(e, t) {
1740
1743
  if (e.toLowerCase() !== "count") return !1;
1741
1744
  const n = t == null ? void 0 : t.find((o) => (o == null ? void 0 : o[e]) != null);
1742
1745
  return n ? typeof n[e] == "number" : !1;
1743
1746
  }
1744
- function Yi(e, t, n, o) {
1747
+ function ns(e, t, n, o) {
1745
1748
  var c, l, u, d;
1746
1749
  let r = [...t.keys], i = /* @__PURE__ */ new Map();
1747
1750
  const s = t.comparisonMetadata;
1748
1751
  if (n === "screen") {
1749
- const f = Zt(s);
1752
+ const f = nn(s);
1750
1753
  r = r.filter((g) => !f.internalKeys.has(g));
1751
1754
  const m = e.type === "table" ? (c = e.preferences) == null ? void 0 : c.comparisonPresentation : void 0;
1752
- tn(m) || (r = r.filter((g) => !f.comparisonColumnKeys.has(g)));
1755
+ rn(m) || (r = r.filter((g) => !f.comparisonColumnKeys.has(g)));
1753
1756
  } else {
1754
- const f = Mn({
1757
+ const f = Pn({
1755
1758
  comparisonMetadata: s,
1756
1759
  presentation: (l = e.preferences) == null ? void 0 : l.comparisonPresentation,
1757
1760
  resolveMetricName: o
@@ -1759,8 +1762,8 @@ function Yi(e, t, n, o) {
1759
1762
  r = r.filter((m) => !f.excludedKeys.has(m)), i = f.columnLabels;
1760
1763
  }
1761
1764
  const a = e.config;
1762
- return e.type === "table" && !((u = a == null ? void 0 : a.metricColumns) != null && u.length) && ((d = a == null ? void 0 : a.groupByColumns) != null && d.length) && !e.sql && (r = r.filter((f) => !Wi(f, t.rows))), {
1763
- keys: bi({
1765
+ return e.type === "table" && !((u = a == null ? void 0 : a.metricColumns) != null && u.length) && ((d = a == null ? void 0 : a.groupByColumns) != null && d.length) && !e.sql && (r = r.filter((f) => !ts(f, t.rows))), {
1766
+ keys: Fi({
1764
1767
  keys: r,
1765
1768
  card: e,
1766
1769
  comparisonMetadata: s,
@@ -1770,13 +1773,13 @@ function Yi(e, t, n, o) {
1770
1773
  exportLabels: i
1771
1774
  };
1772
1775
  }
1773
- function Ji(e, t, n) {
1776
+ function os(e, t, n) {
1774
1777
  var r, i;
1775
1778
  const o = /* @__PURE__ */ new Map();
1776
- if (e.type !== "table" || !tn((r = e.preferences) == null ? void 0 : r.comparisonPresentation))
1779
+ if (e.type !== "table" || !rn((r = e.preferences) == null ? void 0 : r.comparisonPresentation))
1777
1780
  return o;
1778
1781
  for (const s of ((i = e.config) == null ? void 0 : i.metricColumns) ?? []) {
1779
- const { comparisonKind: a, metadata: c } = Jt(
1782
+ const { comparisonKind: a, metadata: c } = en(
1780
1783
  t.comparisonMetadata,
1781
1784
  s
1782
1785
  );
@@ -1786,7 +1789,7 @@ function Ji(e, t, n) {
1786
1789
  [...n],
1787
1790
  t.columnKeyMap
1788
1791
  )) continue;
1789
- const u = pn(
1792
+ const u = yn(
1790
1793
  s.label || s.name,
1791
1794
  a,
1792
1795
  c
@@ -1795,18 +1798,18 @@ function Ji(e, t, n) {
1795
1798
  }
1796
1799
  return o;
1797
1800
  }
1798
- function Xi(e) {
1799
- const t = Ze(e);
1801
+ function rs(e) {
1802
+ const t = Xe(e);
1800
1803
  return [
1801
1804
  ...t.filter((n) => n.role === "metric"),
1802
1805
  ...t.filter((n) => n.role !== "metric")
1803
1806
  ];
1804
1807
  }
1805
- function Zi(e, t, n) {
1808
+ function is(e, t, n) {
1806
1809
  if (!t.length) return [];
1807
- const o = Xi(e), r = [], i = /* @__PURE__ */ new Set();
1810
+ const o = rs(e), r = [], i = /* @__PURE__ */ new Set();
1808
1811
  for (const s of t) {
1809
- const a = Er(o, s);
1812
+ const a = qr(o, s);
1810
1813
  if (!a) continue;
1811
1814
  const c = o[a.group], l = et(c.fields[a.index], c.role);
1812
1815
  if (!l) continue;
@@ -1818,15 +1821,15 @@ function Zi(e, t, n) {
1818
1821
  }
1819
1822
  return r;
1820
1823
  }
1821
- function es(e, t) {
1824
+ function ss(e, t) {
1822
1825
  return e ? "query" : t === "server" ? "page-only" : "browser";
1823
1826
  }
1824
- function Vn(e, t) {
1827
+ function xn(e, t) {
1825
1828
  var n, o, r;
1826
1829
  return !!t && ((r = (o = (n = e.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : o.columnVisibility) == null ? void 0 : r[t]) === !1;
1827
1830
  }
1828
- function ts(e) {
1829
- return e.type !== "table" && e.type !== "detailTable" ? "card-type" : en(e) ? void 0 : "author-disabled";
1831
+ function as(e) {
1832
+ return e.type !== "table" && e.type !== "detailTable" ? "card-type" : on(e) ? void 0 : "author-disabled";
1830
1833
  }
1831
1834
  function _e(e, t) {
1832
1835
  const n = [], o = /* @__PURE__ */ new Map();
@@ -1837,7 +1840,7 @@ function _e(e, t) {
1837
1840
  }
1838
1841
  return n;
1839
1842
  }
1840
- function ue(e, t, n) {
1843
+ function de(e, t, n) {
1841
1844
  const o = _e(e, t), r = new Set(n), i = new Map(
1842
1845
  o.flatMap(
1843
1846
  (a) => a.columnId ? [[a.columnId, a]] : []
@@ -1852,17 +1855,17 @@ function ue(e, t, n) {
1852
1855
  s.splice(u, 0, a);
1853
1856
  }), s.flatMap((a) => a.keys);
1854
1857
  }
1855
- function ns(e) {
1858
+ function ls(e) {
1856
1859
  return e != null && e.pivotIdentity ? JSON.stringify(e.pivotIdentity.members.map((t) => t.value)) : void 0;
1857
1860
  }
1858
- function os(e, t, n, o) {
1861
+ function cs(e, t, n, o) {
1859
1862
  const r = e.findIndex(
1860
1863
  (l) => {
1861
1864
  var u;
1862
1865
  return ((u = t(l)) == null ? void 0 : u.part) === "pivot-member";
1863
1866
  }
1864
1867
  );
1865
- if (r === -1) return ue(e, t, n);
1868
+ if (r === -1) return de(e, t, n);
1866
1869
  let i = r;
1867
1870
  e.forEach((l, u) => {
1868
1871
  var d;
@@ -1873,102 +1876,108 @@ function os(e, t, n, o) {
1873
1876
  ), a = [];
1874
1877
  let c;
1875
1878
  for (const l of e.slice(r, i + 1)) {
1876
- const u = ns(s.get(l)) ?? `key:${l}`;
1879
+ const u = ls(s.get(l)) ?? `key:${l}`;
1877
1880
  (!a.length || u !== c) && a.push([]), a[a.length - 1].push(l), c = u;
1878
1881
  }
1879
1882
  return [
1880
- ...ue(e.slice(0, r), t, n),
1881
- ...a.flatMap((l) => ue(l, t, n)),
1882
- ...ue(e.slice(i + 1), t, n)
1883
+ ...de(e.slice(0, r), t, n),
1884
+ ...a.flatMap((l) => de(l, t, n)),
1885
+ ...de(e.slice(i + 1), t, n)
1883
1886
  ];
1884
1887
  }
1885
- function pl(e) {
1888
+ function Cl(e) {
1886
1889
  if (oe(e) !== "config") return;
1887
1890
  const t = /* @__PURE__ */ new Set();
1888
- for (const { role: n, fields: o } of Ze(e))
1891
+ for (const { role: n, fields: o } of Xe(e))
1889
1892
  for (const r of o) {
1890
1893
  const i = et(r, n);
1891
1894
  i && t.add(j(i));
1892
1895
  }
1893
1896
  return t;
1894
1897
  }
1895
- function ml(e) {
1896
- const t = nn(e);
1897
- return (t == null ? void 0 : t.kind) === "metric" && t.metricId === $e;
1898
+ function Il(e) {
1899
+ const t = sn(e);
1900
+ return (t == null ? void 0 : t.kind) === "metric" && t.metricId === Ue;
1898
1901
  }
1899
- function gl(e) {
1900
- var ut, dt, ft, pt;
1901
- const { card: t, result: n } = e, o = e.projection ?? "screen", r = oe(t) === "config", i = ts(t), s = i === "card-type" ? void 0 : i === "author-disabled" ? (ut = e.settings) != null && ut.sort ? { sort: e.settings.sort } : void 0 : e.settings, a = es(r, e.paginationMode), c = n.columnKeyMap, l = r ? $i(t, n) : Qi(n), u = (C) => {
1902
+ function vl(e) {
1903
+ var ut, dt, ft, pt, mt, gt, yt;
1904
+ const { card: t, result: n } = e, o = e.projection ?? "screen", r = oe(t) === "config", i = as(t), s = i === "card-type" ? void 0 : i === "author-disabled" ? (ut = e.settings) != null && ut.sort ? { sort: e.settings.sort } : void 0 : e.settings, a = ss(r, e.paginationMode), c = n.columnKeyMap, l = r ? Xi(t, n) : es(n), u = (b) => {
1902
1905
  var S, V;
1903
- return C && ((V = (S = s == null ? void 0 : s.labels) == null ? void 0 : S[C]) == null ? void 0 : V.trim()) || void 0;
1904
- }, d = (C) => j({ kind: "metric", ...C }), { keys: f, exportLabels: m } = Yi(
1906
+ return b && ((V = (S = s == null ? void 0 : s.labels) == null ? void 0 : S[b]) == null ? void 0 : V.trim()) || void 0;
1907
+ }, d = (b) => j({ kind: "metric", ...b }), { keys: f, exportLabels: m } = ns(
1905
1908
  t,
1906
1909
  n,
1907
1910
  o,
1908
- (C) => {
1911
+ (b) => {
1909
1912
  var V;
1910
- const S = d(C);
1913
+ const S = d(b);
1911
1914
  return u(l.entries.has(S) ? S : void 0) ?? ((V = l.entries.get(S)) == null ? void 0 : V.authorLabel);
1912
1915
  }
1913
- ), g = (C) => Vn(t, C), p = (C) => {
1914
- const S = l.owners.get(C);
1916
+ ), g = (b) => xn(t, b), p = (b) => {
1917
+ const S = l.owners.get(b);
1915
1918
  if (!S || i === "card-type") return;
1916
1919
  const V = l.entries.get(S.columnId);
1917
1920
  if (!(!V || V.baseKey && g(V.baseKey)))
1918
1921
  return S;
1919
- }, y = f.filter((C) => !g(C)), I = _e(y, p).flatMap(
1920
- (C) => C.columnId ? [C.columnId] : []
1921
- ), v = new Set(I), M = r ? Zi(
1922
+ }, y = f.filter((b) => !g(b)), I = _e(y, p).flatMap(
1923
+ (b) => b.columnId ? [b.columnId] : []
1924
+ ), v = new Set(I), D = r ? is(
1922
1925
  t,
1923
1926
  ((dt = t.config) == null ? void 0 : dt.sortByColumns) ?? [],
1924
1927
  l.entries
1925
- ).filter((C) => v.has(C.columnId)) : [], h = [
1928
+ ).filter((b) => v.has(b.columnId)) : [], C = [
1926
1929
  ...(s == null ? void 0 : s.order) ?? [],
1927
1930
  ...(s == null ? void 0 : s.hidden) ?? [],
1928
1931
  ...Object.keys((s == null ? void 0 : s.labels) ?? {}),
1929
- ...((s == null ? void 0 : s.sort) ?? []).map((C) => C.columnId)
1932
+ ...((s == null ? void 0 : s.sort) ?? []).map((b) => b.columnId),
1933
+ ...Object.keys((s == null ? void 0 : s.widths) ?? {})
1930
1934
  ], w = [
1931
- ...new Set(h.filter((C) => !v.has(C)))
1935
+ ...new Set(C.filter((b) => !v.has(b)))
1932
1936
  ];
1933
1937
  let A;
1934
1938
  if (s != null && s.sort && a !== "page-only") {
1935
- const C = s.sort.filter(
1939
+ const b = s.sort.filter(
1936
1940
  (S) => v.has(S.columnId)
1937
1941
  );
1938
- A = C.length || !s.sort.length ? C : void 0;
1942
+ A = b.length || !s.sort.length ? b : void 0;
1939
1943
  }
1940
- const D = hr(
1944
+ const M = Sr(
1941
1945
  s ? {
1942
1946
  order: (ft = s.order) == null ? void 0 : ft.filter(
1943
- (C) => v.has(C)
1947
+ (b) => v.has(b)
1944
1948
  ),
1945
1949
  hidden: (pt = s.hidden) == null ? void 0 : pt.filter(
1946
- (C) => v.has(C)
1950
+ (b) => v.has(b)
1947
1951
  ),
1948
1952
  labels: Object.fromEntries(
1949
1953
  Object.entries(s.labels ?? {}).filter(
1950
- ([C]) => v.has(C)
1954
+ ([b]) => v.has(b)
1951
1955
  )
1952
1956
  ),
1953
- sort: A
1957
+ sort: A,
1958
+ widths: Object.fromEntries(
1959
+ Object.entries(s.widths ?? {}).filter(
1960
+ ([b]) => v.has(b)
1961
+ )
1962
+ )
1954
1963
  } : void 0
1955
- ), F = D == null ? void 0 : D.order, k = F ? os(y, p, F, n.columns) : y, O = F ? [...k, ...f.filter(g)] : f, P = _e(k, p).flatMap(
1956
- (C) => C.columnId ? [C.columnId] : []
1957
- ), T = new Set((D == null ? void 0 : D.hidden) ?? []);
1958
- P.length && P.every((C) => T.has(C)) && T.delete(P[0]);
1959
- const x = o === "screen" ? Ji(t, n, f) : /* @__PURE__ */ new Map(), E = (C, S) => {
1964
+ ), F = M == null ? void 0 : M.order, k = F ? cs(y, p, F, n.columns) : y, O = F ? [...k, ...f.filter(g)] : f, x = _e(k, p).flatMap(
1965
+ (b) => b.columnId ? [b.columnId] : []
1966
+ ), T = new Set((M == null ? void 0 : M.hidden) ?? []);
1967
+ x.length && x.every((b) => T.has(b)) && T.delete(x[0]);
1968
+ const P = o === "screen" ? os(t, n, f) : /* @__PURE__ */ new Map(), E = (b, S) => {
1960
1969
  const V = u(S == null ? void 0 : S.columnId);
1961
1970
  if ((S == null ? void 0 : S.part) === "base" && V) return V;
1962
- const N = x.get(C);
1963
- if (N)
1964
- return ai(
1965
- ((S == null ? void 0 : S.part) === "comparison" ? V : void 0) ?? (N.metric.label || N.metric.name),
1966
- N.kind
1971
+ const K = P.get(b);
1972
+ if (K)
1973
+ return fi(
1974
+ ((S == null ? void 0 : S.part) === "comparison" ? V : void 0) ?? (K.metric.label || K.metric.name),
1975
+ K.kind
1967
1976
  );
1968
- const J = m.get(C);
1977
+ const J = m.get(b);
1969
1978
  if (J) return J;
1970
- const X = gi({
1971
- columnId: C,
1979
+ const Z = Ii({
1980
+ columnId: b,
1972
1981
  card: t,
1973
1982
  columnKeyMap: c,
1974
1983
  resultColumns: n.columns,
@@ -1976,72 +1985,81 @@ function gl(e) {
1976
1985
  // as dates (its temporal activation covers group columns only).
1977
1986
  metricLabelOverride: (S == null ? void 0 : S.part) === "pivot-member" ? V : void 0
1978
1987
  });
1979
- return X || (gn(C, t, c) ?? C);
1980
- }, R = O.map((C) => {
1981
- var V;
1982
- const S = p(C);
1988
+ return Z || (hn(b, t, c) ?? b);
1989
+ }, R = O.map((b) => {
1990
+ var K;
1991
+ const S = p(b), V = (S == null ? void 0 : S.part) ?? ((K = l.owners.get(b)) == null ? void 0 : K.part) ?? "base";
1983
1992
  return {
1984
- outputKey: C,
1993
+ outputKey: b,
1985
1994
  ...S ? { columnId: S.columnId } : {},
1986
- part: (S == null ? void 0 : S.part) ?? ((V = l.owners.get(C)) == null ? void 0 : V.part) ?? "base",
1987
- visible: !g(C) && !(S && T.has(S.columnId)),
1988
- label: E(C, S)
1995
+ part: V,
1996
+ visible: !g(b) && !(S && T.has(S.columnId)),
1997
+ label: E(b, S),
1998
+ resizable: !i && Zi({ part: V, columnId: S == null ? void 0 : S.columnId })
1989
1999
  };
1990
2000
  }), z = Object.fromEntries(
1991
- R.map((C) => [C.outputKey, C.label])
1992
- ), Y = a === "page-only" ? [] : a === "query" ? M : (D == null ? void 0 : D.sort) ?? [], Ve = new Map(
1993
- Y.map((C) => [C.columnId, C.direction])
1994
- ), ro = Y.flatMap((C) => {
2001
+ R.map((b) => [b.outputKey, b.label])
2002
+ ), Y = {
2003
+ ...((gt = (mt = t.preferences) == null ? void 0 : mt.tablePrefs) == null ? void 0 : gt.columnSizing) ?? {}
2004
+ };
2005
+ for (const b of R) {
2006
+ const S = b.resizable ? (yt = M == null ? void 0 : M.widths) == null ? void 0 : yt[b.columnId] : void 0;
2007
+ S !== void 0 && (Y[b.outputKey] = S);
2008
+ }
2009
+ const ce = a === "page-only" ? [] : a === "query" ? D : (M == null ? void 0 : M.sort) ?? [], ao = new Map(
2010
+ ce.map((b) => [b.columnId, b.direction])
2011
+ ), lo = ce.flatMap((b) => {
1995
2012
  var V;
1996
- const S = (V = l.entries.get(C.columnId)) == null ? void 0 : V.baseKey;
1997
- return S && y.includes(S) ? [{ outputKey: S, desc: C.direction === "desc" }] : [];
1998
- }), ct = !i && !!(D != null && D.order || D != null && D.hidden || D != null && D.labels);
1999
- let ce;
2013
+ const S = (V = l.entries.get(b.columnId)) == null ? void 0 : V.baseKey;
2014
+ return S && y.includes(S) ? [{ outputKey: S, desc: b.direction === "desc" }] : [];
2015
+ }), ct = !i && Tr(M);
2016
+ let ue;
2000
2017
  if (i)
2001
- ce = { available: !1, reason: i };
2002
- else if (!P.length)
2003
- ce = { available: !1, reason: "no-addressable-columns" };
2018
+ ue = { available: !1, reason: i };
2019
+ else if (!x.length)
2020
+ ue = { available: !1, reason: "no-addressable-columns" };
2004
2021
  else {
2005
- const C = new Set(F ?? []), S = P.filter(
2022
+ const b = new Set(F ?? []), S = x.filter(
2006
2023
  (V) => !T.has(V)
2007
2024
  ).length;
2008
- ce = {
2025
+ ue = {
2009
2026
  available: !0,
2010
2027
  canReset: ct,
2011
- items: P.map((V) => {
2012
- const N = l.entries.get(V), J = T.has(V), X = Ve.get(V);
2028
+ items: x.map((V) => {
2029
+ const K = l.entries.get(V), J = T.has(V), Z = ao.get(V);
2013
2030
  return {
2014
2031
  columnId: V,
2015
- label: u(V) ?? N.authorLabel,
2016
- authorLabel: N.authorLabel,
2032
+ label: u(V) ?? K.authorLabel,
2033
+ authorLabel: K.authorLabel,
2017
2034
  hidden: J,
2018
- isNew: F !== void 0 && !C.has(V),
2035
+ isNew: F !== void 0 && !b.has(V),
2019
2036
  canHide: !J && S > 1,
2020
- ...X ? { sort: X } : {}
2037
+ ...Z ? { sort: Z } : {}
2021
2038
  };
2022
2039
  })
2023
2040
  };
2024
2041
  }
2025
2042
  return {
2026
2043
  columns: R,
2027
- visibleKeys: R.filter((C) => C.visible).map((C) => C.outputKey),
2044
+ visibleKeys: R.filter((b) => b.visible).map((b) => b.outputKey),
2028
2045
  labels: z,
2046
+ columnSizing: Y,
2029
2047
  sortMode: a,
2030
- clientSort: ro,
2031
- panel: ce,
2032
- ...D ? { settings: D } : {},
2048
+ clientSort: lo,
2049
+ panel: ue,
2050
+ ...M ? { settings: M } : {},
2033
2051
  dropped: w,
2034
2052
  isCustomized: ct,
2035
2053
  canSort: i !== "card-type" && a !== "page-only",
2036
2054
  author: { order: I }
2037
2055
  };
2038
2056
  }
2039
- function yl(e, t) {
2057
+ function Fl(e, t) {
2040
2058
  var n;
2041
- return (n = kn(e, t)) == null ? void 0 : n.field;
2059
+ return (n = wn(e, t)) == null ? void 0 : n.field;
2042
2060
  }
2043
- function kn(e, t) {
2044
- const n = nn(t), o = e.config;
2061
+ function wn(e, t) {
2062
+ const n = sn(t), o = e.config;
2045
2063
  if (!n || !o) return;
2046
2064
  let r = [], i;
2047
2065
  if (n.kind === "dimension")
@@ -2054,15 +2072,15 @@ function kn(e, t) {
2054
2072
  return;
2055
2073
  return r.length === 1 ? { field: r[0], role: i } : void 0;
2056
2074
  }
2057
- function rs(e, t) {
2075
+ function us(e, t) {
2058
2076
  const n = t == null ? void 0 : t.sort;
2059
2077
  if (!n || !e.config || e.type !== "table" && e.type !== "detailTable" || oe(e) !== "config")
2060
2078
  return e.config;
2061
2079
  const o = n.flatMap((r) => {
2062
- const i = kn(e, r.columnId);
2080
+ const i = wn(e, r.columnId);
2063
2081
  if (!i) return [];
2064
- const s = Br(i.field, i.role);
2065
- return Vn(e, s) ? [] : [
2082
+ const s = Nr(i.field, i.role);
2083
+ return xn(e, s) ? [] : [
2066
2084
  {
2067
2085
  ...i.field,
2068
2086
  alias: s,
@@ -2073,7 +2091,7 @@ function rs(e, t) {
2073
2091
  });
2074
2092
  return n.length > 0 && o.length === 0 ? e.config : { ...e.config, sortByColumns: o };
2075
2093
  }
2076
- function is(e) {
2094
+ function ds(e) {
2077
2095
  if (!e.name)
2078
2096
  return;
2079
2097
  const t = e.entityName && e.entityName !== "SEMAPHOR_CALCULATED_FIELD" ? e.entityName : void 0;
@@ -2099,7 +2117,7 @@ function ae(e) {
2099
2117
  e.label,
2100
2118
  e.name,
2101
2119
  e.qualifiedFieldName,
2102
- is(e)
2120
+ ds(e)
2103
2121
  ].map((t) => typeof t == "string" ? t.trim() : "").filter(Boolean)
2104
2122
  )
2105
2123
  );
@@ -2112,12 +2130,12 @@ function tt(e, t) {
2112
2130
  ...i.map((s) => ({ ...s, role: "metric" }))
2113
2131
  ].filter((s) => !!s.id);
2114
2132
  }
2115
- function bl(e, t) {
2133
+ function Sl(e, t) {
2116
2134
  return t ? !ae(e).some(
2117
2135
  (n) => t[n] === !1
2118
2136
  ) : !0;
2119
2137
  }
2120
- function Cl(e, t) {
2138
+ function Tl(e, t) {
2121
2139
  for (const n of ae(e))
2122
2140
  if (t != null && t[n])
2123
2141
  return n;
@@ -2127,30 +2145,30 @@ function nt(e) {
2127
2145
  var t;
2128
2146
  return e.type === "table" && !((t = e.sql) != null && t.trim()) && !!e.config;
2129
2147
  }
2130
- function xn(e) {
2148
+ function On(e) {
2131
2149
  var t, n, o, r;
2132
2150
  return ((r = (o = (n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.tableStyle) == null ? void 0 : o.totals) == null ? void 0 : r.enabled) === !0;
2133
2151
  }
2134
- function Pn(e) {
2135
- return nt(e) ? xn(e) : !1;
2152
+ function An(e) {
2153
+ return nt(e) ? On(e) : !1;
2136
2154
  }
2137
- function ss(e, t, n) {
2138
- if (!Pn(e))
2155
+ function fs(e, t, n) {
2156
+ if (!An(e))
2139
2157
  return;
2140
2158
  const o = tt(e, n).filter((r) => r.role !== "metric").map((r) => new Set(ae(r)));
2141
2159
  return t.find(
2142
2160
  (r) => o.some((i) => i.has(r))
2143
2161
  );
2144
2162
  }
2145
- function hl({
2163
+ function Dl({
2146
2164
  card: e,
2147
2165
  effectiveCardConfig: t,
2148
2166
  visibleColumnIds: n,
2149
2167
  totalsByColumnId: o
2150
2168
  }) {
2151
- if (!Pn(e) || !o || Object.keys(o).length === 0)
2169
+ if (!An(e) || !o || Object.keys(o).length === 0)
2152
2170
  return;
2153
- const r = ss(
2171
+ const r = fs(
2154
2172
  e,
2155
2173
  n,
2156
2174
  t
@@ -2164,7 +2182,7 @@ function hl({
2164
2182
  ])
2165
2183
  );
2166
2184
  }
2167
- function Il(e) {
2185
+ function Ml(e) {
2168
2186
  var t, n, o, r, i, s;
2169
2187
  return nt(e) ? {
2170
2188
  ...e,
@@ -2183,11 +2201,11 @@ function Il(e) {
2183
2201
  }
2184
2202
  } : e;
2185
2203
  }
2186
- function as(e, t, n) {
2187
- if (!nt(e) || !xn(e))
2204
+ function ps(e, t, n) {
2205
+ if (!nt(e) || !On(e))
2188
2206
  return;
2189
2207
  const o = tt(e, t), r = new Set(
2190
- xr(
2208
+ Er(
2191
2209
  o.filter((c) => c.role === "metric")
2192
2210
  )
2193
2211
  ), i = o.filter((c) => c.role !== "metric"), s = n && i.find(
@@ -2218,7 +2236,7 @@ function as(e, t, n) {
2218
2236
  columns: a
2219
2237
  } : void 0;
2220
2238
  }
2221
- function vl(e) {
2239
+ function Vl(e) {
2222
2240
  var t, n, o, r, i, s;
2223
2241
  return {
2224
2242
  ...e,
@@ -2237,32 +2255,32 @@ function vl(e) {
2237
2255
  }
2238
2256
  };
2239
2257
  }
2240
- const ls = 500, cs = 250;
2258
+ const ms = 500, gs = 250;
2241
2259
  function Re(e) {
2242
2260
  return e.type === "table" || e.type === "detailTable";
2243
2261
  }
2244
- function us(e) {
2262
+ function ys(e) {
2245
2263
  var t, n, o;
2246
2264
  return !!((t = e.sql) != null && t.trim() && Re(e) && ((o = (n = e.preferences) == null ? void 0 : n.tablePrefs) != null && o.enableDevModePagination));
2247
2265
  }
2248
- function Fl(e) {
2249
- return e === "export-full-with-cap" ? ls : cs;
2266
+ function kl(e) {
2267
+ return e === "export-full-with-cap" ? ms : gs;
2250
2268
  }
2251
- function ds({
2269
+ function bs({
2252
2270
  card: e,
2253
2271
  isTablePrintMode: t,
2254
2272
  isDocumentSectionRuntime: n,
2255
2273
  documentTableDataPolicy: o
2256
2274
  }) {
2257
2275
  var c, l;
2258
- const r = n && o !== void 0 && Re(e), i = t && !r, s = Fe(e.config) && Re(e) && !e.sql, a = r ? us(e) : !!(e.sql && ((l = (c = e.preferences) == null ? void 0 : c.tablePrefs) != null && l.enableDevModePagination));
2276
+ const r = n && o !== void 0 && Re(e), i = t && !r, s = Se(e.config) && Re(e) && !e.sql, a = r ? ys(e) : !!(e.sql && ((l = (c = e.preferences) == null ? void 0 : c.tablePrefs) != null && l.enableDevModePagination));
2259
2277
  return !i && (s || a);
2260
2278
  }
2261
- function fs(e) {
2279
+ function hs(e) {
2262
2280
  var t, n, o;
2263
2281
  return ((t = e.paginationConfig) == null ? void 0 : t.pageSize) || ((o = (n = e.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : o.pageSize) || 50;
2264
2282
  }
2265
- function Sl({
2283
+ function Pl({
2266
2284
  current: e,
2267
2285
  defaultPageSize: t,
2268
2286
  queryInputIdentity: n
@@ -2275,10 +2293,10 @@ function Sl({
2275
2293
  pageSize: (e == null ? void 0 : e.pageSize) ?? t
2276
2294
  };
2277
2295
  }
2278
- function Dl(e, t, n) {
2296
+ function xl(e, t, n) {
2279
2297
  return (e == null ? void 0 : e.queryInputIdentity) === n && e.page === t.page && e.pageSize === t.pageSize;
2280
2298
  }
2281
- function Tl(e, t) {
2299
+ function wl(e, t) {
2282
2300
  return !e || !t || e.page === t.page && e.pageSize === t.pageSize ? e : {
2283
2301
  ...e,
2284
2302
  page: t.page,
@@ -2286,20 +2304,20 @@ function Tl(e, t) {
2286
2304
  hasPrevPage: t.page > 1
2287
2305
  };
2288
2306
  }
2289
- function ps(e) {
2290
- return { page: 1, pageSize: fs(e) };
2307
+ function Cs(e) {
2308
+ return { page: 1, pageSize: hs(e) };
2291
2309
  }
2292
- function ms(e) {
2310
+ function Is(e) {
2293
2311
  var s, a, c, l, u;
2294
- const { card: t } = e, n = ds({
2312
+ const { card: t } = e, n = bs({
2295
2313
  card: t,
2296
2314
  isTablePrintMode: ((s = e.display) == null ? void 0 : s.isTablePrintMode) ?? !1,
2297
2315
  isDocumentSectionRuntime: !!e.documentSection,
2298
2316
  documentTableDataPolicy: (a = e.documentSection) == null ? void 0 : a.documentTableDataPolicy
2299
- }), { page: o } = e, r = e.tableTotalsRequest ?? (e.documentSection ? void 0 : as(t, e.finalConfig)), i = !!((c = e.display) != null && c.deliveryStrict && e.display.isTablePrintMode && !e.documentSection && Pr(t.type));
2317
+ }), { page: o } = e, r = e.tableTotalsRequest ?? (e.documentSection ? void 0 : ps(t, e.finalConfig)), i = !!((c = e.display) != null && c.deliveryStrict && e.display.isTablePrintMode && !e.documentSection && Br(t.type));
2300
2318
  return {
2301
2319
  ...r ? { tableTotalsRequest: r } : {},
2302
- ...i ? { sourceRowProbe: { limit: wr.maxTableRows } } : {},
2320
+ ...i ? { sourceRowProbe: { limit: _r.maxTableRows } } : {},
2303
2321
  ...n ? {
2304
2322
  pagination: {
2305
2323
  page: (o == null ? void 0 : o.page) || 1,
@@ -2308,14 +2326,14 @@ function ms(e) {
2308
2326
  } : {}
2309
2327
  };
2310
2328
  }
2311
- function gs(e, t = {}) {
2329
+ function vs(e, t = {}) {
2312
2330
  var r, i, s;
2313
2331
  const n = ((r = e.connectionId) == null ? void 0 : r.trim()) || void 0;
2314
2332
  if (t.editorDevMode) return n;
2315
2333
  const o = ((s = (i = e.dataSource) == null ? void 0 : i.connectionId) == null ? void 0 : s.trim()) || void 0;
2316
2334
  return e.sql ? n || o : o || n;
2317
2335
  }
2318
- function ys(e, t) {
2336
+ function Fs(e, t) {
2319
2337
  var n;
2320
2338
  return {
2321
2339
  connectionId: t,
@@ -2324,8 +2342,8 @@ function ys(e, t) {
2324
2342
  selectedEntities: []
2325
2343
  };
2326
2344
  }
2327
- function Ml(e, t, n = {}) {
2328
- const o = gs(e, n);
2345
+ function Ol(e, t, n = {}) {
2346
+ const o = vs(e, n);
2329
2347
  if (!o)
2330
2348
  throw new Error("No connection ID found for card");
2331
2349
  const r = t.cardDataSource || e.dataSource;
@@ -2333,11 +2351,11 @@ function Ml(e, t, n = {}) {
2333
2351
  connectionId: o,
2334
2352
  requestPayloadBase: {
2335
2353
  ...t,
2336
- cardDataSource: n.liveDataSource ? r : r || ys(e, o)
2354
+ cardDataSource: n.liveDataSource ? r : r || Fs(e, o)
2337
2355
  }
2338
2356
  };
2339
2357
  }
2340
- const bs = /* @__PURE__ */ new Set([
2358
+ const Ss = /* @__PURE__ */ new Set([
2341
2359
  "day",
2342
2360
  "week",
2343
2361
  "month",
@@ -2347,9 +2365,9 @@ const bs = /* @__PURE__ */ new Set([
2347
2365
  "minute",
2348
2366
  "second"
2349
2367
  ]);
2350
- function Cs(e) {
2368
+ function Ts(e) {
2351
2369
  let t = e.spec;
2352
- const n = Rt(
2370
+ const n = Nt(
2353
2371
  e.controlDefinitions || [],
2354
2372
  e.cardControlDefinitions || []
2355
2373
  ), o = (e.controlBindings || []).filter(
@@ -2363,99 +2381,99 @@ function Cs(e) {
2363
2381
  const l = () => {
2364
2382
  if (c) return c;
2365
2383
  const p = e.catalog, y = /* @__PURE__ */ new Map();
2366
- for (const b of p) {
2367
- const I = y.get(b.id) ?? [];
2368
- y.set(b.id, [...I, b]);
2384
+ for (const h of p) {
2385
+ const I = y.get(h.id) ?? [];
2386
+ y.set(h.id, [...I, h]);
2369
2387
  }
2370
2388
  return c = { refs: p, byId: y }, c;
2371
2389
  }, u = (p, y) => {
2372
- throw new Vo(p, {
2373
- code: ko,
2390
+ throw new wo(p, {
2391
+ code: Oo,
2374
2392
  ...y ? { controlId: y } : {}
2375
2393
  });
2376
2394
  }, d = (p, y) => {
2377
2395
  var I;
2378
2396
  if (p.derivedField) return p.derivedField.dataType;
2379
- const b = l().refs.filter((v) => v.field.name === p.name && Oe(v.field.source ?? e.spec.source, p.source ?? e.spec.source));
2380
- return b.length > 1 ? u("The selected field is ambiguous in the authorized Matrix field catalog.", y) : re(((I = b[0]) == null ? void 0 : I.field.dataType) ?? p.dataType);
2381
- }, f = (p, y) => Fo(p, y.target, (b) => d(b, y.controlId)), m = lr.safeParse(t);
2397
+ const h = l().refs.filter((v) => v.field.name === p.name && Oe(v.field.source ?? e.spec.source, p.source ?? e.spec.source));
2398
+ return h.length > 1 ? u("The selected field is ambiguous in the authorized Matrix field catalog.", y) : re(((I = h[0]) == null ? void 0 : I.field.dataType) ?? p.dataType);
2399
+ }, f = (p, y) => Mo(p, y.target, (h) => d(h, y.controlId)), m = fr.safeParse(t);
2382
2400
  if (!m.success) return u(m.error.message);
2383
2401
  t = m.data;
2384
2402
  const g = [...r, ...i].map((p) => {
2385
- const y = Kt({ binding: p, definitions: n, controlValues: e.controlValues }), b = !p.matrixTargetId && y !== void 0 && y !== Ae ? f(m.data, p) : [];
2403
+ const y = Lt({ binding: p, definitions: n, controlValues: e.controlValues }), h = !p.matrixTargetId && y !== void 0 && y !== Ae ? f(m.data, p) : [];
2386
2404
  return {
2387
2405
  binding: p,
2388
2406
  selectedValue: y,
2389
- targetId: p.matrixTargetId ?? (b.length === 1 ? b[0].id : void 0)
2407
+ targetId: p.matrixTargetId ?? (h.length === 1 ? h[0].id : void 0)
2390
2408
  };
2391
2409
  });
2392
- for (const { binding: p, targetId: y, selectedValue: b } of g) {
2393
- if (b === void 0 || b === Ae)
2410
+ for (const { binding: p, targetId: y, selectedValue: h } of g) {
2411
+ if (h === void 0 || h === Ae)
2394
2412
  continue;
2395
- const I = (F) => u(F, p.controlId), v = p.target === "config_metric_selector" || p.target === "config_aggregation", M = f(t, p);
2396
- (!y || !M.some((F) => F.id === y)) && I("Choose a valid Matrix level or measure target for this control.");
2397
- const h = `${p.target}:${y}`;
2398
- s.has(h) && I("Multiple controls cannot replace the same Matrix target."), s.add(h);
2413
+ const I = (F) => u(F, p.controlId), v = p.target === "config_metric_selector" || p.target === "config_aggregation", D = f(t, p);
2414
+ (!y || !D.some((F) => F.id === y)) && I("Choose a valid Matrix level or measure target for this control.");
2415
+ const C = `${p.target}:${y}`;
2416
+ s.has(C) && I("Multiple controls cannot replace the same Matrix target."), s.add(C);
2399
2417
  const w = (F) => {
2400
- const k = (l().byId.get(F.id) ?? []).filter((P) => !F.source || Oe(F.source, P.field.source ?? e.spec.source));
2418
+ const k = (l().byId.get(F.id) ?? []).filter((x) => !F.source || Oe(F.source, x.field.source ?? e.spec.source));
2401
2419
  if (k.length !== 1) return I(k.length ? "The selected field is ambiguous in the authorized Matrix field catalog." : "The selected field is not in the authorized Matrix field catalog.");
2402
- const O = ur.safeParse(k[0].field);
2420
+ const O = mr.safeParse(k[0].field);
2403
2421
  return O.success ? O.data : I(O.error.message);
2404
- }, A = p.target === "config_metric_selector" || p.target === "config_field_selector" ? p.mapping[b] : void 0, D = A && typeof A == "object" && "kind" in A && A.kind === "matrix_instance" ? A.id : void 0;
2422
+ }, A = p.target === "config_metric_selector" || p.target === "config_field_selector" ? p.mapping[h] : void 0, M = A && typeof A == "object" && "kind" in A && A.kind === "matrix_instance" ? A.id : void 0;
2405
2423
  if (v) {
2406
2424
  a.set(y, p.controlId);
2407
- const F = D === void 0 ? void 0 : m.data.measures.find(
2408
- (T) => T.id === D && T.kind === "aggregate"
2425
+ const F = M === void 0 ? void 0 : m.data.measures.find(
2426
+ (T) => T.id === M && T.kind === "aggregate"
2409
2427
  );
2410
- D !== void 0 && !F && I("The selected Matrix aggregate measure is no longer available.");
2411
- const k = p.target === "config_metric_selector" && !F ? So({ binding: p, selectedValue: b }) : void 0, O = ((F == null ? void 0 : F.kind) === "aggregate" ? F.aggregate : k == null ? void 0 : k.aggregate) ?? (p.target === "config_aggregation" ? mt({ binding: p, selectedValue: b }) : void 0), P = O === void 0 ? void 0 : cr.safeParse(O);
2412
- P && !P.success && I("This aggregation is not supported by Matrix."), t = {
2428
+ M !== void 0 && !F && I("The selected Matrix aggregate measure is no longer available.");
2429
+ const k = p.target === "config_metric_selector" && !F ? Vo({ binding: p, selectedValue: h }) : void 0, O = ((F == null ? void 0 : F.kind) === "aggregate" ? F.aggregate : k == null ? void 0 : k.aggregate) ?? (p.target === "config_aggregation" ? bt({ binding: p, selectedValue: h }) : void 0), x = O === void 0 ? void 0 : pr.safeParse(O);
2430
+ x && !x.success && I("This aggregation is not supported by Matrix."), t = {
2413
2431
  ...t,
2414
2432
  measures: t.measures.map(
2415
2433
  (T) => T.id !== y || T.kind !== "aggregate" ? T : {
2416
2434
  ...T,
2417
2435
  ...k ? { field: w(k) } : {},
2418
2436
  ...(F == null ? void 0 : F.kind) === "aggregate" ? { field: F.field } : {},
2419
- aggregate: P != null && P.success ? P.data : T.aggregate
2437
+ aggregate: x != null && x.success ? x.data : T.aggregate
2420
2438
  }
2421
2439
  )
2422
2440
  };
2423
2441
  } else {
2424
- const F = D === void 0 ? void 0 : [...m.data.rows, ...m.data.columns].find(
2425
- (T) => T.id === D
2442
+ const F = M === void 0 ? void 0 : [...m.data.rows, ...m.data.columns].find(
2443
+ (T) => T.id === M
2426
2444
  );
2427
- D !== void 0 && !F && I("The selected Matrix level is no longer available.");
2428
- const k = p.target === "config_field_selector" && !F ? Do({ binding: p, selectedValue: b }) : void 0, O = p.target === "config_grain" ? mt({ binding: p, selectedValue: b }) : F ? F.grain : k == null ? void 0 : k.granularity;
2429
- O !== void 0 && !bs.has(O) && I("This time grain is not supported by Matrix.");
2430
- const P = (T) => T.map((x) => {
2431
- if (x.id !== y) return x;
2432
- const E = (F == null ? void 0 : F.field) ?? (k ? w(k) : x.field), R = d(E, p.controlId), z = O ?? (k && yt(R) ? x.grain : void 0);
2433
- return z && !yt(R) && I("A time grain requires a temporal Matrix level."), { ...x, field: E, grain: z };
2445
+ M !== void 0 && !F && I("The selected Matrix level is no longer available.");
2446
+ const k = p.target === "config_field_selector" && !F ? ko({ binding: p, selectedValue: h }) : void 0, O = p.target === "config_grain" ? bt({ binding: p, selectedValue: h }) : F ? F.grain : k == null ? void 0 : k.granularity;
2447
+ O !== void 0 && !Ss.has(O) && I("This time grain is not supported by Matrix.");
2448
+ const x = (T) => T.map((P) => {
2449
+ if (P.id !== y) return P;
2450
+ const E = (F == null ? void 0 : F.field) ?? (k ? w(k) : P.field), R = d(E, p.controlId), z = O ?? (k && Ct(R) ? P.grain : void 0);
2451
+ return z && !Ct(R) && I("A time grain requires a temporal Matrix level."), { ...P, field: E, grain: z };
2434
2452
  });
2435
2453
  t = {
2436
2454
  ...t,
2437
- rows: P(t.rows),
2438
- columns: P(t.columns)
2455
+ rows: x(t.rows),
2456
+ columns: x(t.columns)
2439
2457
  };
2440
2458
  }
2441
2459
  }
2442
2460
  for (const [p, y] of Array.from(a)) {
2443
- const b = t.measures.find((v) => v.id === p);
2444
- if (!b || b.kind !== "aggregate") continue;
2445
- const I = d(b.field, y);
2446
- To(I).some((v) => v.value === b.aggregate) || u(`Aggregation '${b.aggregate}' is not eligible for this Matrix field datatype.`, y);
2461
+ const h = t.measures.find((v) => v.id === p);
2462
+ if (!h || h.kind !== "aggregate") continue;
2463
+ const I = d(h.field, y);
2464
+ Po(I).some((v) => v.value === h.aggregate) || u(`Aggregation '${h.aggregate}' is not eligible for this Matrix field datatype.`, y);
2447
2465
  }
2448
2466
  try {
2449
- return Mo(m.data, t);
2467
+ return xo(m.data, t);
2450
2468
  } catch (p) {
2451
- if (p instanceof pr) return u(p.message);
2469
+ if (p instanceof br) return u(p.message);
2452
2470
  throw p;
2453
2471
  }
2454
2472
  }
2455
- function wn(e, t) {
2473
+ function En(e, t) {
2456
2474
  const n = [], o = (r) => {
2457
2475
  if (r.source) {
2458
- const i = dr.safeParse(r.source);
2476
+ const i = gr.safeParse(r.source);
2459
2477
  if (i.success) n.push(i.data);
2460
2478
  else if (t) throw i.error;
2461
2479
  }
@@ -2469,14 +2487,14 @@ function wn(e, t) {
2469
2487
  }
2470
2488
  return n;
2471
2489
  }
2472
- function hs(e, t = [], n = []) {
2473
- return Ht([...cn(e), ...wn(t), ...n]);
2490
+ function Ds(e, t = [], n = []) {
2491
+ return Qt([...fn(e), ...En(t), ...n]);
2474
2492
  }
2475
- function Is(e, t = {}) {
2476
- const n = t.controlBindings ?? [], o = Rt(t.controlDefinitions ?? [], t.cardControlDefinitions ?? []), r = new Map(n.filter((i) => i.target === "config_field_selector" || i.target === "config_metric_selector").map((i) => [i, Kt({ binding: i, definitions: o, controlValues: t.controlValues })]));
2477
- return Ht([...cn(e), ...wn(n, r)]);
2493
+ function Ms(e, t = {}) {
2494
+ const n = t.controlBindings ?? [], o = Nt(t.controlDefinitions ?? [], t.cardControlDefinitions ?? []), r = new Map(n.filter((i) => i.target === "config_field_selector" || i.target === "config_metric_selector").map((i) => [i, Lt({ binding: i, definitions: o, controlValues: t.controlValues })]));
2495
+ return Qt([...fn(e), ...En(n, r)]);
2478
2496
  }
2479
- function vs(e, t) {
2497
+ function Vs(e, t) {
2480
2498
  return {
2481
2499
  id: t,
2482
2500
  field: e.field,
@@ -2487,17 +2505,17 @@ function vs(e, t) {
2487
2505
  ...e.rawTemporal ? { rawTemporal: e.rawTemporal } : {}
2488
2506
  };
2489
2507
  }
2490
- function Fs(e, t) {
2491
- return Ne(e) ? Ss(e, t) : e.config ?? {};
2508
+ function ks(e, t) {
2509
+ return Ne(e) ? Ps(e, t) : e.config ?? {};
2492
2510
  }
2493
- function Ss(e, t) {
2511
+ function Ps(e, t) {
2494
2512
  var o;
2495
2513
  const n = (o = t == null ? void 0 : t.steps[t.steps.length - 1]) == null ? void 0 : o.toField;
2496
- return n ? si(e.config ?? {}, n, {
2514
+ return n ? di(e.config ?? {}, n, {
2497
2515
  sortPolicy: "retargetDimensionSort"
2498
2516
  }) : e.config ?? {};
2499
2517
  }
2500
- function Ds(e, t) {
2518
+ function xs(e, t) {
2501
2519
  const n = (e == null ? void 0 : e.steps) ?? [];
2502
2520
  if (n.length !== 0)
2503
2521
  return {
@@ -2516,7 +2534,7 @@ function Ds(e, t) {
2516
2534
  logicalOperator: "AND",
2517
2535
  negate: !1,
2518
2536
  conditions: o.conditions.map(
2519
- (i) => vs(
2537
+ (i) => Vs(
2520
2538
  i,
2521
2539
  `${i.field.id}-${i.value}`
2522
2540
  )
@@ -2533,55 +2551,55 @@ function ot(e) {
2533
2551
  function rt(e) {
2534
2552
  return e === "not in" ? "exclude" : "include";
2535
2553
  }
2536
- function Ts(e) {
2554
+ function ws(e) {
2537
2555
  return e === "exclude" ? "not in" : "in";
2538
2556
  }
2539
- function Vl(e) {
2557
+ function Al(e) {
2540
2558
  var n;
2541
2559
  const t = (n = e.liveValue) == null ? void 0 : n.operation;
2542
2560
  return ot(t) ? rt(t) : e.pendingMode ?? e.authoredMode;
2543
2561
  }
2544
- function Ms(e) {
2562
+ function Os(e) {
2545
2563
  var o;
2546
2564
  let t = !1;
2547
2565
  const n = (o = e.inputs) == null ? void 0 : o.map((r) => {
2548
2566
  if (r.kind !== "filter" || !r.filter) return r;
2549
- const i = Vs(
2567
+ const i = As(
2550
2568
  r.filter,
2551
- new Set(ks(e.defaultInputValues, r))
2569
+ new Set(Es(e.defaultInputValues, r))
2552
2570
  );
2553
2571
  return i === r.filter ? r : (t = !0, { ...r, filter: i });
2554
2572
  });
2555
2573
  return t ? { ...e, inputs: n } : e;
2556
2574
  }
2557
- function Vs(e, t) {
2575
+ function As(e, t) {
2558
2576
  if (t.size !== 1 || !ot(e.operation))
2559
2577
  return e;
2560
2578
  const [n] = t;
2561
- return rt(e.operation) === n ? e : { ...e, operation: Ts(n) };
2579
+ return rt(e.operation) === n ? e : { ...e, operation: ws(n) };
2562
2580
  }
2563
- function ks(e, t) {
2581
+ function Es(e, t) {
2564
2582
  var r;
2565
2583
  const n = (i) => Object.values(i ?? {}).map((s) => s[t.id]);
2566
2584
  return (t.runtimeScope === "shared" ? [(r = e == null ? void 0 : e.shared) == null ? void 0 : r[t.id]] : t.runtimeScope === "perSheet" ? n(e == null ? void 0 : e.bySheetId) : t.runtimeScope === "perCard" ? n(e == null ? void 0 : e.byCardId) : t.runtimeScope === "perDocumentSection" ? n(e == null ? void 0 : e.byDocumentSectionId) : []).flatMap(
2567
- (i) => (i == null ? void 0 : i.status) === "set" && i.value.kind === "filter" ? xs(i.value.filterValue) : []
2585
+ (i) => (i == null ? void 0 : i.status) === "set" && i.value.kind === "filter" ? Bs(i.value.filterValue) : []
2568
2586
  );
2569
2587
  }
2570
- function xs(e) {
2588
+ function Bs(e) {
2571
2589
  return ot(e.operation) ? [rt(e.operation)] : [];
2572
2590
  }
2573
- function kl(e) {
2574
- const t = Qt(e), o = K(t).issues.length ? t : xa(t);
2575
- return ri(Ms(o)).dashboard;
2591
+ function El(e) {
2592
+ const t = Jt(e), o = q(t).issues.length ? t : Ba(t);
2593
+ return ci(Os(o)).dashboard;
2576
2594
  }
2577
2595
  function it(e, t) {
2578
2596
  const n = {};
2579
- for (const o of Xt(e)) {
2597
+ for (const o of tn(e)) {
2580
2598
  if (!o.inlineFilters || o.inlineFilters.length === 0)
2581
2599
  continue;
2582
2600
  const r = [];
2583
2601
  for (const i of o.inlineFilters) {
2584
- const s = xo(i, t);
2602
+ const s = Ao(i, t);
2585
2603
  s && r.push(s);
2586
2604
  }
2587
2605
  r.length > 0 && (n[o.id] = r);
@@ -2589,7 +2607,7 @@ function it(e, t) {
2589
2607
  return n;
2590
2608
  }
2591
2609
  function ne(e) {
2592
- const t = Se(e ?? {}), n = [];
2610
+ const t = Te(e ?? {}), n = [];
2593
2611
  for (const [o, r] of Object.entries(t.shared ?? {}))
2594
2612
  n.push({ scope: "shared", target: null, inputId: o, slot: r });
2595
2613
  for (const o of ["bySheetId", "byCardId"])
@@ -2598,7 +2616,7 @@ function ne(e) {
2598
2616
  n.push({ scope: o, target: r, inputId: s, slot: a });
2599
2617
  return n;
2600
2618
  }
2601
- function Ie(e, t, n) {
2619
+ function ve(e, t, n) {
2602
2620
  const o = e;
2603
2621
  if (t.scope === "shared") {
2604
2622
  o.shared = { ...o.shared, [t.inputId]: n };
@@ -2607,8 +2625,8 @@ function Ie(e, t, n) {
2607
2625
  const r = { ...o[t.scope] ?? {} };
2608
2626
  r[t.target] = { ...r[t.target], [t.inputId]: n }, o[t.scope] = r;
2609
2627
  }
2610
- function On(e, t, n) {
2611
- const o = qt(
2628
+ function Bn(e, t, n) {
2629
+ const o = jt(
2612
2630
  e,
2613
2631
  t.controlOverrides,
2614
2632
  { hasExplicitRuntimeOverrides: t.controlOverrides !== void 0 }
@@ -2622,17 +2640,17 @@ function On(e, t, n) {
2622
2640
  };
2623
2641
  }
2624
2642
  function st(e, t, n) {
2625
- return An(
2643
+ return _n(
2626
2644
  e,
2627
- On(e, t, n),
2645
+ Bn(e, t, n),
2628
2646
  n
2629
2647
  );
2630
2648
  }
2631
- function xl(e, t, n) {
2632
- return An(e, t, n);
2649
+ function Bl(e, t, n) {
2650
+ return _n(e, t, n);
2633
2651
  }
2634
- function An(e, t, n) {
2635
- const o = e.sheets ?? [], r = o.filter((a) => (a.kind ?? "dashboard") === "dashboard").map((a) => a.id), i = o.filter((a) => a.kind === "document"), s = r.length ? wo({
2652
+ function _n(e, t, n) {
2653
+ const o = e.sheets ?? [], r = o.filter((a) => (a.kind ?? "dashboard") === "dashboard").map((a) => a.id), i = o.filter((a) => a.kind === "document"), s = r.length ? Bo({
2636
2654
  dashboard: e,
2637
2655
  sheetIds: r,
2638
2656
  mode: "dashboard",
@@ -2645,7 +2663,7 @@ function An(e, t, n) {
2645
2663
  var l;
2646
2664
  return ze(
2647
2665
  a,
2648
- Oo({
2666
+ _o({
2649
2667
  dashboard: e,
2650
2668
  sheetId: c.id,
2651
2669
  sheetKind: "document",
@@ -2662,7 +2680,7 @@ function An(e, t, n) {
2662
2680
  s
2663
2681
  );
2664
2682
  }
2665
- function En(e, t) {
2683
+ function Rn(e, t) {
2666
2684
  const n = {}, o = {}, r = /* @__PURE__ */ new Map();
2667
2685
  for (const i of ne(t)) {
2668
2686
  const s = e.get(i.inputId), { slot: a } = i, c = () => a.status === "set" && a.value.kind === "filter" ? a.value.filterValue : a.status === "cleared" ? null : void 0;
@@ -2675,51 +2693,51 @@ function En(e, t) {
2675
2693
  } else if ((s == null ? void 0 : s.source) === "dashboardControl" || (s == null ? void 0 : s.source) === "cardControl")
2676
2694
  a.status === "set" && a.value.kind === "control" ? o[s.controlId] = a.value.value : a.status === "cleared" && (o[s.controlId] = void 0);
2677
2695
  else {
2678
- Ie(n, i, a);
2696
+ ve(n, i, a);
2679
2697
  continue;
2680
2698
  }
2681
- a.comparisonSelection && Ie(n, i, {
2699
+ a.comparisonSelection && ve(n, i, {
2682
2700
  comparisonSelection: a.comparisonSelection
2683
2701
  });
2684
2702
  }
2685
2703
  return {
2686
- runtime: Se(n),
2704
+ runtime: Te(n),
2687
2705
  controlValues: o,
2688
2706
  inlineFilterValues: r
2689
2707
  };
2690
2708
  }
2691
- function Ps(e, t) {
2709
+ function _s(e, t) {
2692
2710
  if (!t.size) return [...e];
2693
2711
  const n = e.filter((r) => !t.has(r.filterId)), o = [...t.values()].filter(
2694
2712
  (r) => r !== null
2695
2713
  );
2696
- return Ao(n, o);
2714
+ return Ro(n, o);
2697
2715
  }
2698
- function Bn(e, t, n) {
2716
+ function Kn(e, t, n) {
2699
2717
  if (!Object.keys(n).length) return t;
2700
- const o = qt(
2718
+ const o = jt(
2701
2719
  e,
2702
2720
  t,
2703
2721
  { hasExplicitRuntimeOverrides: t !== void 0 }
2704
2722
  );
2705
2723
  return {
2706
- ...Po({
2724
+ ...Eo({
2707
2725
  dashboardValues: o.dashboardControlValues,
2708
2726
  cardValuesMap: o.cardControlValuesMap
2709
2727
  }),
2710
2728
  ...n
2711
2729
  };
2712
2730
  }
2713
- function ws(e, t) {
2731
+ function Rs(e, t) {
2714
2732
  if (!t.size) return;
2715
2733
  const n = Object.fromEntries(
2716
2734
  Object.entries(e).map(([o, r]) => [o, [...r]])
2717
2735
  );
2718
2736
  for (const [o, r] of t)
2719
- n[o] = Ps(n[o] ?? [], r);
2737
+ n[o] = _s(n[o] ?? [], r);
2720
2738
  return n;
2721
2739
  }
2722
- function Os(e, t, n) {
2740
+ function Ks(e, t, n) {
2723
2741
  const o = new Map(
2724
2742
  H(e).map(({ card: s }) => [
2725
2743
  s.id,
@@ -2739,11 +2757,11 @@ function Os(e, t, n) {
2739
2757
  }
2740
2758
  return r ? i : void 0;
2741
2759
  }
2742
- function Pl(e) {
2743
- const { dashboard: t, capture: n, calendar: o } = e, r = oo(t, n.filterValues, {
2760
+ function _l(e) {
2761
+ const { dashboard: t, capture: n, calendar: o } = e, r = so(t, n.filterValues, {
2744
2762
  calendar: o
2745
2763
  }), i = n.dashboardInputExecutionSnapshot, s = n.controlValues, a = {
2746
- ...On(
2764
+ ...Bn(
2747
2765
  t,
2748
2766
  {
2749
2767
  adHocFilterValues: r.adHocFilterValues,
@@ -2751,7 +2769,7 @@ function Pl(e) {
2751
2769
  // The snapshot replays exactly over the listed values.
2752
2770
  dashboardInputValues: i ? ze(
2753
2771
  r.slots,
2754
- Bo({
2772
+ qo({
2755
2773
  dashboard: t,
2756
2774
  dashboardInputValues: i.dashboardInputValues,
2757
2775
  sheetId: i.sheetId,
@@ -2761,24 +2779,24 @@ function Pl(e) {
2761
2779
  },
2762
2780
  o
2763
2781
  ),
2764
- cardViewState: i ? Eo(i.cardViewState) : {}
2765
- }, c = i ? _o(i.transientContexts) : void 0;
2782
+ cardViewState: i ? Ko(i.cardViewState) : {}
2783
+ }, c = i ? No(i.transientContexts) : void 0;
2766
2784
  return {
2767
2785
  runtimeValues: a,
2768
2786
  controlOverrides: s,
2769
2787
  ...c != null && c.length ? { transientContexts: c } : {}
2770
2788
  };
2771
2789
  }
2772
- function wl(e, t) {
2790
+ function Rl(e, t) {
2773
2791
  const { controlContractOverrides: n, cardId: o } = t;
2774
2792
  if (!n || (n.controlDefinitions !== void 0 && (e.controls = n.controlDefinitions), typeof o != "string" || o.trim().length === 0))
2775
2793
  return e;
2776
2794
  const r = ie(e, o);
2777
2795
  return r && (n.cardControlDefinitions !== void 0 && (r.controls = n.cardControlDefinitions), n.controlBindings !== void 0 && (r.controlBindings = n.controlBindings)), e;
2778
2796
  }
2779
- const As = ["bySheetId", "byCardId", "byDocumentSectionId"];
2780
- function Es(e, t) {
2781
- const n = K(e);
2797
+ const qs = ["bySheetId", "byCardId", "byDocumentSectionId"];
2798
+ function Ns(e, t) {
2799
+ const n = q(e);
2782
2800
  let o = !1;
2783
2801
  const r = (s) => {
2784
2802
  if (!s) return s;
@@ -2793,7 +2811,7 @@ function Es(e, t) {
2793
2811
  ...t,
2794
2812
  ...t.shared ? { shared: r(t.shared) } : {}
2795
2813
  };
2796
- for (const s of As) {
2814
+ for (const s of qs) {
2797
2815
  const a = t[s];
2798
2816
  a && (i[s] = Object.fromEntries(
2799
2817
  Object.entries(a).map(([c, l]) => [c, r(l) ?? {}])
@@ -2801,7 +2819,7 @@ function Es(e, t) {
2801
2819
  }
2802
2820
  return o ? i : t;
2803
2821
  }
2804
- function Bs(e) {
2822
+ function Ls(e) {
2805
2823
  var t, n;
2806
2824
  return ((n = (t = e.sheets) == null ? void 0 : t[0]) == null ? void 0 : n.id) ?? null;
2807
2825
  }
@@ -2809,10 +2827,10 @@ function le(e, t) {
2809
2827
  var n;
2810
2828
  return !!t && !!((n = e.sheets) != null && n.some((o) => o.id === t));
2811
2829
  }
2812
- function Ol(e) {
2813
- const { dashboard: t, host: n, calendar: o } = e, r = oo(t, n.filterValues, {
2830
+ function Kl(e) {
2831
+ const { dashboard: t, host: n, calendar: o } = e, r = so(t, n.filterValues, {
2814
2832
  calendar: o
2815
- }).slots, i = n.controlValues, s = le(t, n.selectedSheetId) ? n.selectedSheetId : Bs(t);
2833
+ }).slots, i = n.controlValues, s = le(t, n.selectedSheetId) ? n.selectedSheetId : Ls(t);
2816
2834
  return {
2817
2835
  hostInputValues: r,
2818
2836
  controlOverrides: i,
@@ -2829,36 +2847,36 @@ function Ol(e) {
2829
2847
  )
2830
2848
  };
2831
2849
  }
2832
- function _n(e) {
2850
+ function qn(e) {
2833
2851
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
2834
2852
  for (const r of Ge(e))
2835
2853
  r.kind === "filter" && r.filter ? t.set(r.id, r.filter) : r.kind === "control" && n.add(r.id), r.compatibility && o.set(r.id, r.compatibility);
2836
2854
  return { filterInputs: t, controlInputIds: n, compatibility: o };
2837
2855
  }
2838
- function Rn(e, t) {
2839
- const n = Ut(t);
2856
+ function Nn(e, t) {
2857
+ const n = Wt(t);
2840
2858
  if (!n) return;
2841
2859
  const o = ie(e, n);
2842
- return o ? Ro(o, e) ? "applies" : "not-eligible" : "removed";
2860
+ return o ? Lo(o, e) ? "applies" : "not-eligible" : "removed";
2843
2861
  }
2844
- function Al(e, t) {
2845
- const n = Rn(e, t);
2862
+ function ql(e, t) {
2863
+ const n = Nn(e, t);
2846
2864
  return n ? n === "applies" : Ge(e).some(
2847
2865
  (o) => o.id === t
2848
2866
  );
2849
2867
  }
2850
- function Kn(e, t, n, o) {
2868
+ function Ln(e, t, n, o) {
2851
2869
  if (!n) return {};
2852
2870
  const r = new Set((e.sheets ?? []).map((l) => l.id)), i = new Set(
2853
2871
  H(e).map(({ card: l }) => l.id)
2854
- ), s = K(e), a = (l) => {
2872
+ ), s = q(e), a = (l) => {
2855
2873
  var d;
2856
2874
  if (!l) return;
2857
2875
  const u = {};
2858
2876
  for (const [f, m] of Object.entries(l)) {
2859
2877
  const g = t.filterInputs.has(f) || t.controlInputIds.has(f) ? f : ((d = s.findFilterInput({ inputId: f })) == null ? void 0 : d.input.id) ?? f;
2860
2878
  if (g !== f && l[g]) continue;
2861
- const p = Rn(e, g);
2879
+ const p = Nn(e, g);
2862
2880
  if (p) {
2863
2881
  if (p !== "applies") {
2864
2882
  o.push({
@@ -2913,7 +2931,7 @@ function Kn(e, t, n, o) {
2913
2931
  }
2914
2932
  return d;
2915
2933
  };
2916
- return Se({
2934
+ return Te({
2917
2935
  shared: a(n.shared),
2918
2936
  bySheetId: c(n.bySheetId, (l) => r.has(l)),
2919
2937
  byCardId: c(n.byCardId, (l) => i.has(l))
@@ -2926,11 +2944,11 @@ function B(e, t, n, o = {}) {
2926
2944
  ), i = {};
2927
2945
  for (const [s, a] of Object.entries(t ?? {})) {
2928
2946
  const c = r.get(s);
2929
- if (c && en(c)) {
2930
- Ir(a) || (i[s] = a);
2947
+ if (c && on(c)) {
2948
+ Dr(a) || (i[s] = a);
2931
2949
  continue;
2932
2950
  }
2933
- if (c && o.sessionSorts && vr(c)) {
2951
+ if (c && o.sessionSorts && Mr(c)) {
2934
2952
  a.sort && (i[s] = { sort: a.sort });
2935
2953
  continue;
2936
2954
  }
@@ -2943,7 +2961,7 @@ function B(e, t, n, o = {}) {
2943
2961
  }
2944
2962
  return i;
2945
2963
  }
2946
- function _s(e, t, n) {
2964
+ function js(e, t, n) {
2947
2965
  if (t) {
2948
2966
  if (le(e, t)) return t;
2949
2967
  n.push({
@@ -2955,7 +2973,7 @@ function _s(e, t, n) {
2955
2973
  }
2956
2974
  }
2957
2975
  const at = (e, t) => De(e ?? null, t ?? null);
2958
- function qn(e) {
2976
+ function jn(e) {
2959
2977
  return {
2960
2978
  adHocFilterValues: e.adHocFilterValues,
2961
2979
  controlOverrides: e.controlOverrides,
@@ -2965,7 +2983,7 @@ function qn(e) {
2965
2983
  tableSettings: e.tableSettings
2966
2984
  };
2967
2985
  }
2968
- function de(e, t) {
2986
+ function fe(e, t) {
2969
2987
  return {
2970
2988
  adHocFilterValues: [],
2971
2989
  controlOverrides: e.controlOverrides,
@@ -2974,7 +2992,7 @@ function de(e, t) {
2974
2992
  tableSettings: t
2975
2993
  };
2976
2994
  }
2977
- function Nn(e, t) {
2995
+ function zn(e, t) {
2978
2996
  const n = t.dashboardInputValues === e.baseline.hostInputValues && !t.inlineFilterValuesMap && !t.adHocFilterValues.length && t.controlOverrides === e.baseline.controlOverrides;
2979
2997
  return {
2980
2998
  selectedSheetId: t.selectedSheetId,
@@ -2984,24 +3002,24 @@ function Nn(e, t) {
2984
3002
  };
2985
3003
  }
2986
3004
  function G(e, t) {
2987
- const n = qn(t), o = t.restore ?? n;
3005
+ const n = jn(t), o = t.restore ?? n;
2988
3006
  return {
2989
3007
  ...n,
2990
3008
  appliedBookmarkId: t.appliedBookmarkId,
2991
3009
  rememberedWrites: t.rememberedWrites ?? [],
2992
3010
  notices: t.notices ?? [],
2993
- opened: Nn(e, o),
3011
+ opened: zn(e, o),
2994
3012
  restore: o
2995
3013
  };
2996
3014
  }
2997
- function kt(e, t, n, o) {
2998
- const { dashboard: r, baseline: i } = e, s = [], a = on(t.state, Qe), c = a.ok ? a.value : {};
3015
+ function wt(e, t, n, o) {
3016
+ const { dashboard: r, baseline: i } = e, s = [], a = an(t.state, Qe), c = a.ok ? a.value : {};
2999
3017
  for (const g of a.ok ? a.issues : [])
3000
- s.push(Rs(g));
3001
- const l = _n(r), u = En(
3018
+ s.push(zs(g));
3019
+ const l = qn(r), u = Rn(
3002
3020
  l.compatibility,
3003
- Kn(r, l, c.inputs, s)
3004
- ), d = _s(r, c.selectedSheetId, s) ?? i.selectedSheetId, f = B(
3021
+ Ln(r, l, c.inputs, s)
3022
+ ), d = js(r, c.selectedSheetId, s) ?? i.selectedSheetId, f = B(
3005
3023
  r,
3006
3024
  c.tableSettings,
3007
3025
  s
@@ -3014,7 +3032,7 @@ function kt(e, t, n, o) {
3014
3032
  appliedBookmarkId: t.id,
3015
3033
  // A bookmark opens without ad-hoc values, as today (P4a-02 f).
3016
3034
  adHocFilterValues: [],
3017
- controlOverrides: Bn(
3035
+ controlOverrides: Kn(
3018
3036
  r,
3019
3037
  i.controlOverrides,
3020
3038
  u.controlValues
@@ -3024,8 +3042,8 @@ function kt(e, t, n, o) {
3024
3042
  i.hostInputValues,
3025
3043
  u.runtime
3026
3044
  ),
3027
- ...Ln(
3028
- ws(
3045
+ ...Gn(
3046
+ Rs(
3029
3047
  it(r, e.calendar),
3030
3048
  u.inlineFilterValues
3031
3049
  )
@@ -3045,7 +3063,7 @@ function kt(e, t, n, o) {
3045
3063
  notices: s
3046
3064
  });
3047
3065
  }
3048
- function Rs(e) {
3066
+ function zs(e) {
3049
3067
  return {
3050
3068
  kind: "setting-no-longer-applies",
3051
3069
  target: e.target,
@@ -3053,28 +3071,28 @@ function Rs(e) {
3053
3071
  reason: "invalid"
3054
3072
  };
3055
3073
  }
3056
- function Ln(e) {
3074
+ function Gn(e) {
3057
3075
  return e ? { inlineFilterValuesMap: e } : {};
3058
3076
  }
3059
- function xt(e, t, n) {
3077
+ function Ot(e, t, n) {
3060
3078
  const { dashboard: o, baseline: r } = e;
3061
3079
  return {
3062
3080
  // A reload in place keeps ad-hoc values, as today (P4a-02 f), unless the
3063
3081
  // template now defines a filter with that id.
3064
3082
  adHocFilterValues: t.adHocFilterValues.filter(
3065
- (i) => !K(o).findFilterInput({ filterId: i.filterId })
3083
+ (i) => !q(o).findFilterInput({ filterId: i.filterId })
3066
3084
  ),
3067
3085
  // A host's new control defaults are the baseline's, not the viewer's.
3068
3086
  controlOverrides: n.controlsChanged ? r.controlOverrides : t.controlOverrides,
3069
3087
  // Live slots stay, except a filter value this template no longer accepts:
3070
3088
  // that filter loads its new default, as the old list did. The resolver
3071
3089
  // ignores slots this template no longer has.
3072
- dashboardInputValues: Es(
3090
+ dashboardInputValues: Ns(
3073
3091
  o,
3074
3092
  t.dashboardInputValues
3075
3093
  ),
3076
- ...Ln(
3077
- Os(
3094
+ ...Gn(
3095
+ Ks(
3078
3096
  o,
3079
3097
  it(o, e.calendar),
3080
3098
  t.inlineFilterValuesMap ?? {}
@@ -3089,15 +3107,15 @@ function xt(e, t, n) {
3089
3107
  )
3090
3108
  };
3091
3109
  }
3092
- function El(e) {
3110
+ function Nl(e) {
3093
3111
  const { dashboard: t, baseline: n, event: o } = e, r = e.rememberedTableSettings;
3094
3112
  switch (o.kind) {
3095
3113
  case "initial-load":
3096
- return o.defaultBookmark ? kt(e, o.defaultBookmark, r, {
3114
+ return o.defaultBookmark ? wt(e, o.defaultBookmark, r, {
3097
3115
  writeRemembered: !1
3098
3116
  }) : G(e, {
3099
3117
  appliedBookmarkId: null,
3100
- ...de(
3118
+ ...fe(
3101
3119
  n,
3102
3120
  B(t, r, void 0, {
3103
3121
  sessionSorts: o.captured
@@ -3111,7 +3129,7 @@ function El(e) {
3111
3129
  i.previousBaseline.controlOverrides ?? null,
3112
3130
  n.controlOverrides ?? null
3113
3131
  )
3114
- }, c = xt(
3132
+ }, c = Ot(
3115
3133
  e,
3116
3134
  {
3117
3135
  adHocFilterValues: i.adHocFilterValues,
@@ -3122,7 +3140,7 @@ function El(e) {
3122
3140
  tableSettings: i.tableSettings
3123
3141
  },
3124
3142
  a
3125
- ), l = s ? xt(e, s.restore, a) : de(
3143
+ ), l = s ? Ot(e, s.restore, a) : fe(
3126
3144
  n,
3127
3145
  B(t, r, void 0)
3128
3146
  );
@@ -3134,13 +3152,13 @@ function El(e) {
3134
3152
  });
3135
3153
  }
3136
3154
  case "open-bookmark":
3137
- return kt(e, o.bookmark, r, {
3155
+ return wt(e, o.bookmark, r, {
3138
3156
  writeRemembered: !0
3139
3157
  });
3140
3158
  case "open-default-view":
3141
3159
  return G(e, {
3142
3160
  appliedBookmarkId: null,
3143
- ...de(
3161
+ ...fe(
3144
3162
  n,
3145
3163
  B(t, r, void 0)
3146
3164
  )
@@ -3148,7 +3166,7 @@ function El(e) {
3148
3166
  case "reset-to-default-view":
3149
3167
  return G(e, {
3150
3168
  appliedBookmarkId: null,
3151
- ...de(n, {}),
3169
+ ...fe(n, {}),
3152
3170
  rememberedWrites: [{ kind: "clear-all" }]
3153
3171
  });
3154
3172
  case "discard-changes": {
@@ -3180,7 +3198,7 @@ function El(e) {
3180
3198
  }
3181
3199
  }
3182
3200
  }
3183
- function Bl(e) {
3201
+ function Ll(e) {
3184
3202
  const { dashboard: t, calendar: n } = e, o = e.hostControlValues, r = {
3185
3203
  ...e.baseline,
3186
3204
  controlOverrides: o,
@@ -3196,19 +3214,19 @@ function Bl(e) {
3196
3214
  };
3197
3215
  let i = o;
3198
3216
  if (e.appliedBookmark) {
3199
- const c = on(
3217
+ const c = an(
3200
3218
  e.appliedBookmark.state,
3201
3219
  Qe
3202
- ), l = _n(t), u = En(
3220
+ ), l = qn(t), u = Rn(
3203
3221
  l.compatibility,
3204
- Kn(
3222
+ Ln(
3205
3223
  t,
3206
3224
  l,
3207
3225
  c.ok ? c.value.inputs : void 0,
3208
3226
  []
3209
3227
  )
3210
3228
  ).controlValues;
3211
- i = Bn(t, o, u);
3229
+ i = Kn(t, o, u);
3212
3230
  }
3213
3231
  const s = e.applied;
3214
3232
  if (!s) return { baseline: r, controlOverrides: i, applied: null };
@@ -3220,12 +3238,12 @@ function Bl(e) {
3220
3238
  ...s,
3221
3239
  controlOverrides: i,
3222
3240
  restore: a,
3223
- opened: Nn({ dashboard: t, baseline: r, calendar: n }, a)
3241
+ opened: zn({ dashboard: t, baseline: r, calendar: n }, a)
3224
3242
  }
3225
3243
  };
3226
3244
  }
3227
- function _l(e, t, n) {
3228
- const o = qn(n.values);
3245
+ function jl(e, t, n) {
3246
+ const o = jn(n.values);
3229
3247
  return {
3230
3248
  ...o,
3231
3249
  appliedBookmarkId: t,
@@ -3235,30 +3253,30 @@ function _l(e, t, n) {
3235
3253
  restore: o
3236
3254
  };
3237
3255
  }
3238
- const Pt = (e) => JSON.stringify([e.scope, e.target, e.inputId]);
3239
- function fe(e) {
3256
+ const At = (e) => JSON.stringify([e.scope, e.target, e.inputId]);
3257
+ function pe(e) {
3240
3258
  return !e || e.status === "cleared" && !e.comparisonSelection;
3241
3259
  }
3242
- function jn(e, t) {
3260
+ function Hn(e, t) {
3243
3261
  const n = new Map(
3244
- ne(e).map((i) => [Pt(i), i])
3262
+ ne(e).map((i) => [At(i), i])
3245
3263
  ), o = new Map(
3246
- ne(t).map((i) => [Pt(i), i])
3264
+ ne(t).map((i) => [At(i), i])
3247
3265
  ), r = {};
3248
3266
  for (const [i, s] of o) {
3249
3267
  const a = n.get(i);
3250
- a && De(a.slot, s.slot) || fe(s.slot) && fe(a == null ? void 0 : a.slot) || Ie(
3268
+ a && De(a.slot, s.slot) || pe(s.slot) && pe(a == null ? void 0 : a.slot) || ve(
3251
3269
  r,
3252
3270
  s,
3253
- fe(s.slot) ? { status: "cleared" } : s.slot
3271
+ pe(s.slot) ? { status: "cleared" } : s.slot
3254
3272
  );
3255
3273
  }
3256
3274
  for (const [i, s] of n)
3257
- o.has(i) || fe(s.slot) || Ie(r, s, { status: "cleared" });
3258
- return Se(r);
3275
+ o.has(i) || pe(s.slot) || ve(r, s, { status: "cleared" });
3276
+ return Te(r);
3259
3277
  }
3260
- function Rl(e) {
3261
- const { dashboard: t, baseline: n, current: o } = e, r = jn(n.materializedInputs, o.inputs), i = B(
3278
+ function zl(e) {
3279
+ const { dashboard: t, baseline: n, current: o } = e, r = Hn(n.materializedInputs, o.inputs), i = B(
3262
3280
  t,
3263
3281
  o.tableSettings,
3264
3282
  void 0
@@ -3270,31 +3288,31 @@ function Rl(e) {
3270
3288
  ...Object.keys(i).length ? { tableSettings: i } : {}
3271
3289
  };
3272
3290
  }
3273
- function Ks(e) {
3291
+ function Gs(e) {
3274
3292
  const t = /* @__PURE__ */ new Map();
3275
3293
  for (const n of Ge(e))
3276
3294
  n.label && t.set(n.id, n.label);
3277
3295
  return t;
3278
3296
  }
3279
- function qs(e, t, n) {
3297
+ function Hs(e, t, n) {
3280
3298
  var r, i;
3281
- const o = Ut(n);
3299
+ const o = Wt(n);
3282
3300
  if (o) {
3283
3301
  const s = (i = (r = ie(e, o)) == null ? void 0 : r.title) == null ? void 0 : i.trim();
3284
3302
  return s ? `Selection in ${s}` : "Selection";
3285
3303
  }
3286
3304
  return t.get(n) ?? n;
3287
3305
  }
3288
- function Kl(e) {
3306
+ function Gl(e) {
3289
3307
  var l, u;
3290
- const { dashboard: t, opened: n, current: o } = e, r = [], i = Ks(t), s = /* @__PURE__ */ new Set();
3308
+ const { dashboard: t, opened: n, current: o } = e, r = [], i = Gs(t), s = /* @__PURE__ */ new Set();
3291
3309
  for (const d of ne(
3292
- jn(n.inputs, o.inputs)
3310
+ Hn(n.inputs, o.inputs)
3293
3311
  ))
3294
3312
  s.has(d.inputId) || (s.add(d.inputId), r.push({
3295
3313
  target: "input",
3296
3314
  inputId: d.inputId,
3297
- label: qs(t, i, d.inputId)
3315
+ label: Hs(t, i, d.inputId)
3298
3316
  }));
3299
3317
  (n.selectedSheetId ?? null) !== (o.selectedSheetId ?? null) && r.push({ target: "sheet" });
3300
3318
  const a = B(
@@ -3317,7 +3335,7 @@ function Kl(e) {
3317
3335
  });
3318
3336
  return r;
3319
3337
  }
3320
- function wt(e) {
3338
+ function Et(e) {
3321
3339
  const t = ee(e.filter);
3322
3340
  return {
3323
3341
  inputId: e.inputId,
@@ -3331,7 +3349,7 @@ function wt(e) {
3331
3349
  }
3332
3350
  };
3333
3351
  }
3334
- function Ns(e) {
3352
+ function $s(e) {
3335
3353
  var r, i;
3336
3354
  if ((r = e.card.sql) != null && r.trim())
3337
3355
  return {
@@ -3341,7 +3359,7 @@ function Ns(e) {
3341
3359
  };
3342
3360
  const t = e.inputs.filter((s) => !ee(s.filter)).map((s) => ({
3343
3361
  input: s,
3344
- resolution: Ko({
3362
+ resolution: jo({
3345
3363
  filter: s.filter,
3346
3364
  filterValue: s.filterValue,
3347
3365
  effectiveFilterValue: s.effectiveFilterValue,
@@ -3355,13 +3373,13 @@ function Ns(e) {
3355
3373
  const n = e.inputs.find(
3356
3374
  (s) => ee(s.filter)
3357
3375
  );
3358
- if (n && ((i = n.filterValue) == null ? void 0 : i.filterId) === n.filterId && n.effectiveFilterValue.filterId === n.filterId && qo(n.effectiveFilterValue))
3376
+ if (n && ((i = n.filterValue) == null ? void 0 : i.filterId) === n.filterId && n.effectiveFilterValue.filterId === n.filterId && zo(n.effectiveFilterValue))
3359
3377
  return {
3360
3378
  inputs: e.inputs,
3361
3379
  fieldCandidates: t,
3362
3380
  resolution: {
3363
3381
  status: "resolved",
3364
- resolvedOwner: wt(n)
3382
+ resolvedOwner: Et(n)
3365
3383
  }
3366
3384
  };
3367
3385
  const o = t.filter(
@@ -3372,7 +3390,7 @@ function Ns(e) {
3372
3390
  fieldCandidates: t,
3373
3391
  resolution: {
3374
3392
  status: "resolved",
3375
- resolvedOwner: wt(o[0].input)
3393
+ resolvedOwner: Et(o[0].input)
3376
3394
  }
3377
3395
  } : o.length > 1 ? {
3378
3396
  inputs: e.inputs,
@@ -3385,7 +3403,7 @@ function Ns(e) {
3385
3403
  }
3386
3404
  } : { inputs: e.inputs, fieldCandidates: t, resolution: { status: "none" } };
3387
3405
  }
3388
- function ql(e) {
3406
+ function Hl(e) {
3389
3407
  var n, o;
3390
3408
  const t = {
3391
3409
  ownerCardCount: 0,
@@ -3407,7 +3425,7 @@ function ql(e) {
3407
3425
  }
3408
3426
  return t;
3409
3427
  }
3410
- const Ls = /* @__PURE__ */ new Set([
3428
+ const Us = /* @__PURE__ */ new Set([
3411
3429
  "between",
3412
3430
  "not between",
3413
3431
  "=",
@@ -3418,36 +3436,36 @@ const Ls = /* @__PURE__ */ new Set([
3418
3436
  "<=",
3419
3437
  "is null",
3420
3438
  "is not null"
3421
- ]), js = /^(\d{4}-\d{2}-\d{2})T/, zs = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/;
3439
+ ]), Qs = /^(\d{4}-\d{2}-\d{2})T/, Ws = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/;
3422
3440
  function lt(e) {
3423
- return Ls.has(e);
3441
+ return Us.has(e);
3424
3442
  }
3425
- function Gs(e, t) {
3443
+ function Ys(e, t) {
3426
3444
  if (e instanceof Date)
3427
- return Number.isNaN(e.getTime()) ? e : t ? bt(e, t, "yyyy-MM-dd") : e.toISOString().slice(0, 10);
3445
+ return Number.isNaN(e.getTime()) ? e : t ? It(e, t, "yyyy-MM-dd") : e.toISOString().slice(0, 10);
3428
3446
  if (typeof e != "string")
3429
3447
  return e;
3430
3448
  const n = e.trim();
3431
- if (t && zs.test(n)) {
3449
+ if (t && Ws.test(n)) {
3432
3450
  const r = new Date(n);
3433
3451
  if (!Number.isNaN(r.getTime()))
3434
- return bt(r, t, "yyyy-MM-dd");
3452
+ return It(r, t, "yyyy-MM-dd");
3435
3453
  }
3436
- const o = js.exec(n);
3454
+ const o = Qs.exec(n);
3437
3455
  return o ? o[1] : e;
3438
3456
  }
3439
- function zn(e, t) {
3457
+ function $n(e, t) {
3440
3458
  return Array.isArray(e) ? e.map(
3441
- (n) => Gs(n, t)
3459
+ (n) => Ys(n, t)
3442
3460
  ) : e;
3443
3461
  }
3444
- function Gn(e) {
3462
+ function Un(e) {
3445
3463
  return typeof e.allowMinutePrecision == "boolean" ? e.allowMinutePrecision : He(
3446
3464
  e.dashboard,
3447
3465
  e.semanticExecutionPayload
3448
3466
  ).allEligibleTargetsAreDateTime;
3449
3467
  }
3450
- function Hn(e) {
3468
+ function Qn(e) {
3451
3469
  const {
3452
3470
  globalDateFilter: t,
3453
3471
  globalDateFilterValue: n,
@@ -3461,7 +3479,7 @@ function Hn(e) {
3461
3479
  ...n,
3462
3480
  filterId: t.id
3463
3481
  };
3464
- const i = n, s = i.temporalPrecision === "minute" || me(i.relativeMeta), a = !r && s, c = i.operation === "is null" || i.operation === "is not null" ? [] : a ? zn(i.values, o) : i.values, l = r || !me(i.relativeMeta) ? i.relativeMeta : void 0, u = r && i.temporalPrecision === "minute" ? i.temporalPrecision : void 0, {
3482
+ const i = n, s = i.temporalPrecision === "minute" || ge(i.relativeMeta), a = !r && s, c = i.operation === "is null" || i.operation === "is not null" ? [] : a ? $n(i.values, o) : i.values, l = r || !ge(i.relativeMeta) ? i.relativeMeta : void 0, u = r && i.temporalPrecision === "minute" ? i.temporalPrecision : void 0, {
3465
3483
  relativeMeta: d,
3466
3484
  temporalPrecision: f,
3467
3485
  values: m,
@@ -3475,19 +3493,19 @@ function Hn(e) {
3475
3493
  ...u ? { temporalPrecision: u } : {}
3476
3494
  };
3477
3495
  }
3478
- function Hs(e) {
3479
- const t = $(e.filters);
3496
+ function Js(e) {
3497
+ const t = U(e.filters);
3480
3498
  if (!t)
3481
3499
  return e.filterValues;
3482
- const n = Gn(e);
3483
- return e.filterValues.map((o) => o.filterId !== t.id ? o : Hn({
3500
+ const n = Un(e);
3501
+ return e.filterValues.map((o) => o.filterId !== t.id ? o : Qn({
3484
3502
  globalDateFilter: t,
3485
3503
  globalDateFilterValue: o,
3486
3504
  timezone: e.timezone,
3487
3505
  allowMinutePrecision: n
3488
3506
  }) || o);
3489
3507
  }
3490
- function Un(e) {
3508
+ function Wn(e) {
3491
3509
  const {
3492
3510
  globalDateFilter: t,
3493
3511
  globalDateFilterValue: n,
@@ -3498,16 +3516,16 @@ function Un(e) {
3498
3516
  } = e;
3499
3517
  if (!t || !n || !o || !lt(n.operation))
3500
3518
  return null;
3501
- const a = n, c = No(
3519
+ const a = n, c = Go(
3502
3520
  o.dataType
3503
- ), l = s && c, u = a.temporalPrecision === "minute" || me(a.relativeMeta), d = l && a.temporalPrecision === "minute" ? a.temporalPrecision : void 0, f = l || !me(a.relativeMeta) ? a.relativeMeta : void 0, m = !l && u;
3521
+ ), l = s && c, u = a.temporalPrecision === "minute" || ge(a.relativeMeta), d = l && a.temporalPrecision === "minute" ? a.temporalPrecision : void 0, f = l || !ge(a.relativeMeta) ? a.relativeMeta : void 0, m = !l && u;
3504
3522
  return {
3505
3523
  filterId: t.id,
3506
3524
  dateOwner: "global_date",
3507
3525
  name: o.qualifiedFieldName || o.name,
3508
3526
  operation: a.operation,
3509
3527
  valueType: "date",
3510
- values: a.operation === "is null" || a.operation === "is not null" ? [] : m ? zn(
3528
+ values: a.operation === "is null" || a.operation === "is not null" ? [] : m ? $n(
3511
3529
  a.values,
3512
3530
  i
3513
3531
  ) : a.values,
@@ -3532,25 +3550,25 @@ function Un(e) {
3532
3550
  ...d ? { temporalPrecision: d } : {}
3533
3551
  };
3534
3552
  }
3535
- function q(e) {
3553
+ function N(e) {
3536
3554
  return typeof e == "string" ? e.trim() : "";
3537
3555
  }
3538
- function Us(e) {
3556
+ function Zs(e) {
3539
3557
  var t;
3540
3558
  return (((t = e.semanticContext) == null ? void 0 : t.selectedEntities) || []).filter((n) => typeof n == "object" && n !== null).filter((n) => n.type === "dataset").map((n) => {
3541
3559
  var o;
3542
3560
  return {
3543
- domainId: q(n.domainId) || q((o = e.semanticContext) == null ? void 0 : o.semanticDomainId),
3544
- datasetName: q(n.name),
3545
- selectedEntityId: q(n.id)
3561
+ domainId: N(n.domainId) || N((o = e.semanticContext) == null ? void 0 : o.semanticDomainId),
3562
+ datasetName: N(n.name),
3563
+ selectedEntityId: N(n.id)
3546
3564
  };
3547
3565
  }).filter((n) => n.domainId && n.datasetName);
3548
3566
  }
3549
- function $s(e) {
3567
+ function Xs(e) {
3550
3568
  var c, l, u, d, f;
3551
3569
  if (ee(e) || (c = e.sql) != null && c.trim())
3552
3570
  return null;
3553
- const t = Us(e), n = q((l = e.semanticContext) == null ? void 0 : l.semanticDomainId), o = q((u = e.fieldMeta) == null ? void 0 : u.entityId), r = q((d = e.fieldMeta) == null ? void 0 : d.entityName), i = q((f = e.fieldMeta) == null ? void 0 : f.entityType) === "dataset", s = t.find(
3571
+ const t = Zs(e), n = N((l = e.semanticContext) == null ? void 0 : l.semanticDomainId), o = N((u = e.fieldMeta) == null ? void 0 : u.entityId), r = N((d = e.fieldMeta) == null ? void 0 : d.entityName), i = N((f = e.fieldMeta) == null ? void 0 : f.entityType) === "dataset", s = t.find(
3554
3572
  (m) => o && m.selectedEntityId === o
3555
3573
  );
3556
3574
  if (s)
@@ -3563,22 +3581,22 @@ function $s(e) {
3563
3581
  datasetName: r
3564
3582
  } : null);
3565
3583
  }
3566
- function Qs(e) {
3584
+ function ea(e) {
3567
3585
  var r, i;
3568
3586
  const { filter: t, semanticExecutionPayload: n } = e;
3569
3587
  if (!n)
3570
3588
  return null;
3571
- const o = $s(t);
3589
+ const o = Xs(t);
3572
3590
  return o && ((i = (r = n.domainsById[o.domainId]) == null ? void 0 : r.datasetsByName[o.datasetName]) == null ? void 0 : i.primaryDateField) || null;
3573
3591
  }
3574
- function $n(e) {
3575
- const t = $(e.filters);
3592
+ function Yn(e) {
3593
+ const t = U(e.filters);
3576
3594
  return t ? e.filterValues.filter(
3577
3595
  (n) => n.filterId !== t.id
3578
3596
  ) : e.filterValues;
3579
3597
  }
3580
- function Nl(e) {
3581
- const t = $(e.filters), n = $n({
3598
+ function $l(e) {
3599
+ const t = U(e.filters), n = Yn({
3582
3600
  filters: e.filters,
3583
3601
  filterValues: e.filterValues
3584
3602
  });
@@ -3586,10 +3604,10 @@ function Nl(e) {
3586
3604
  return n;
3587
3605
  const o = e.filterValues.find(
3588
3606
  (s) => s.filterId === t.id
3589
- ), r = Qs({
3607
+ ), r = ea({
3590
3608
  filter: e.filter,
3591
3609
  semanticExecutionPayload: e.semanticExecutionPayload
3592
- }), i = Un({
3610
+ }), i = Wn({
3593
3611
  globalDateFilter: t,
3594
3612
  globalDateFilterValue: o,
3595
3613
  resolvedPrimaryDateField: r || void 0,
@@ -3599,18 +3617,18 @@ function Nl(e) {
3599
3617
  });
3600
3618
  return i ? [i, ...n] : n;
3601
3619
  }
3602
- function Ws(e) {
3620
+ function ta(e) {
3603
3621
  var u;
3604
- const t = $(e.filters), n = t ? e.cardFilterValues.find(
3622
+ const t = U(e.filters), n = t ? e.cardFilterValues.find(
3605
3623
  (d) => d.filterId === t.id
3606
3624
  ) : void 0, o = t ? e.cardFilterValues.filter(
3607
3625
  (d) => d.filterId !== t.id
3608
- ) : e.cardFilterValues, r = e.resolvedPrimaryDateField ?? Nt({
3626
+ ) : e.cardFilterValues, r = e.resolvedPrimaryDateField ?? zt({
3609
3627
  card: e.card,
3610
3628
  cardConfig: e.cardConfig,
3611
3629
  resolvedFields: e.resolvedFields,
3612
3630
  semanticExecutionPayload: e.semanticExecutionPayload
3613
- }), i = Un({
3631
+ }), i = Wn({
3614
3632
  globalDateFilter: t,
3615
3633
  globalDateFilterValue: n,
3616
3634
  resolvedPrimaryDateField: r || void 0,
@@ -3631,7 +3649,7 @@ function Ws(e) {
3631
3649
  effectiveFilterValue: f,
3632
3650
  mappedFilterValue: (m = e.mappedFilterValuesByInputId) == null ? void 0 : m.get(d.inputId)
3633
3651
  }] : [];
3634
- })) || [], l = Ns({
3652
+ })) || [], l = $s({
3635
3653
  inputs: c,
3636
3654
  temporalBinding: r,
3637
3655
  card: e.card
@@ -3642,13 +3660,13 @@ function Ws(e) {
3642
3660
  dateComparisonPlan: l
3643
3661
  };
3644
3662
  }
3645
- function Ll(e) {
3646
- const t = $(e.filters), n = Gn(e), o = t ? e.filterValues.find(
3663
+ function Ul(e) {
3664
+ const t = U(e.filters), n = Un(e), o = t ? e.filterValues.find(
3647
3665
  (s) => s.filterId === t.id
3648
- ) : void 0, r = $n(e);
3666
+ ) : void 0, r = Yn(e);
3649
3667
  return !t || !o || !lt(o.operation) ? r : [
3650
3668
  {
3651
- ...Hn({
3669
+ ...Qn({
3652
3670
  globalDateFilter: t,
3653
3671
  globalDateFilterValue: o,
3654
3672
  timezone: e.timezone,
@@ -3660,26 +3678,26 @@ function Ll(e) {
3660
3678
  ...r
3661
3679
  ];
3662
3680
  }
3663
- class Ys extends Error {
3681
+ class na extends Error {
3664
3682
  }
3665
- function jl(e, t) {
3683
+ function Ql(e, t) {
3666
3684
  const n = new Map((e ? H(e) : []).map(({ card: o }) => [o.id, o]));
3667
3685
  return t && n.set(t.id, t), [...n.values()].flatMap((o) => {
3668
3686
  const r = We(o);
3669
- return r.status === "ready" ? hs(r.config.spec, o.controlBindings) : [];
3687
+ return r.status === "ready" ? Ds(r.config.spec, o.controlBindings) : [];
3670
3688
  });
3671
3689
  }
3672
- function Js(e, t, n) {
3673
- const o = Tr(e);
3690
+ function oa(e, t, n) {
3691
+ const o = xr(e);
3674
3692
  if (!o) throw new Error("Matrix card definition is required.");
3675
- const r = n && Cs({
3693
+ const r = n && Ts({
3676
3694
  ...n,
3677
3695
  spec: o.spec,
3678
3696
  catalog: t.map((u) => ({ ...u, id: u.resolvedField.id }))
3679
- }), i = r ? { ...o, spec: r.spec } : o, s = Lo(t), a = jo(t), c = (u) => {
3697
+ }), i = r ? { ...o, spec: r.spec } : o, s = Ho(t), a = $o(t), c = (u) => {
3680
3698
  const d = a(u, i.spec.source);
3681
3699
  if (!(!d && u.derivedField)) {
3682
- if (!d) throw new Ys(`Matrix field metadata is unavailable: ${u.name}`);
3700
+ if (!d) throw new na(`Matrix field metadata is unavailable: ${u.name}`);
3683
3701
  return { ...d, ...u.derivedField ? { derivedField: u.derivedField } : {} };
3684
3702
  }
3685
3703
  }, l = {
@@ -3701,18 +3719,18 @@ function Js(e, t, n) {
3701
3719
  };
3702
3720
  return { config: i, fields: l, resolveField: s };
3703
3721
  }
3704
- function Xs(e) {
3722
+ function ra(e) {
3705
3723
  const t = e.filter(Boolean);
3706
3724
  if (t.length !== 0)
3707
3725
  return t.length === 1 ? t[0] : {
3708
- id: zo(),
3726
+ id: Uo(),
3709
3727
  logicalOperator: "AND",
3710
3728
  negate: !1,
3711
3729
  conditions: [],
3712
3730
  groups: t
3713
3731
  };
3714
3732
  }
3715
- function Zs(e) {
3733
+ function ia(e) {
3716
3734
  if (!e) return;
3717
3735
  const t = (n) => ({
3718
3736
  logicalOperator: n.logicalOperator,
@@ -3731,12 +3749,12 @@ function Zs(e) {
3731
3749
  });
3732
3750
  return JSON.stringify(t(e));
3733
3751
  }
3734
- function ea(e, t, n = {}) {
3752
+ function sa(e, t, n = {}) {
3735
3753
  const o = e.metricColumns || [];
3736
3754
  if (o.length === 0) return e;
3737
- const r = Go.includes(
3755
+ const r = Qo.includes(
3738
3756
  t
3739
- ), i = Ho.includes(
3757
+ ), i = Wo.includes(
3740
3758
  t
3741
3759
  ), s = (l) => {
3742
3760
  var u;
@@ -3752,7 +3770,7 @@ function ea(e, t, n = {}) {
3752
3770
  const c = o.map(
3753
3771
  (l) => {
3754
3772
  var f;
3755
- const u = Fr(l);
3773
+ const u = Vr(l);
3756
3774
  if (u === "none")
3757
3775
  return l;
3758
3776
  let d = l;
@@ -3767,44 +3785,44 @@ function ea(e, t, n = {}) {
3767
3785
  metricColumns: c
3768
3786
  } : e;
3769
3787
  }
3770
- function zl(e, t = {}) {
3771
- return Qn(Wn(e, t));
3788
+ function Wl(e, t = {}) {
3789
+ return Jn(Zn(e, t));
3772
3790
  }
3773
- function Qn(e) {
3774
- return Xs([e.authored, e.drill, e.selections]);
3791
+ function Jn(e) {
3792
+ return ra([e.authored, e.drill, e.selections]);
3775
3793
  }
3776
- function Wn(e, t = {}) {
3794
+ function Zn(e, t = {}) {
3777
3795
  return {
3778
- authored: t.includeAuthoredFilters === !1 ? void 0 : Uo(e),
3779
- drill: Ds(t.drill, e.id),
3780
- selections: Or(t.selections ?? [])
3796
+ authored: t.includeAuthoredFilters === !1 ? void 0 : Yo(e),
3797
+ drill: xs(t.drill, e.id),
3798
+ selections: Rr(t.selections ?? [])
3781
3799
  };
3782
3800
  }
3783
- function ta(e, t, n) {
3784
- const o = Fs(e, t);
3785
- return Ne(e) ? ea(
3801
+ function aa(e, t, n) {
3802
+ const o = ks(e, t);
3803
+ return Ne(e) ? sa(
3786
3804
  { ...o, filters: n },
3787
3805
  e.type,
3788
3806
  // A data variable's card keeps its own period comparison (P3b-03).
3789
- { keepsPeriodComparison: Sr(e) }
3807
+ { keepsPeriodComparison: kr(e) }
3790
3808
  ) : o;
3791
3809
  }
3792
- function na(e) {
3793
- const t = $o(e);
3810
+ function la(e) {
3811
+ const t = Jo(e);
3794
3812
  return {
3795
3813
  contextMode: t,
3796
3814
  shouldApplyDashboardFilters: !t || t === "full"
3797
3815
  };
3798
3816
  }
3799
- function oa(e) {
3817
+ function ca(e) {
3800
3818
  const t = e.dashboardControls || [], n = e.card.controls || [], o = /* @__PURE__ */ new Set([
3801
3819
  ...t.map((r) => r.id),
3802
3820
  ...n.map((r) => r.id)
3803
3821
  ]);
3804
- return Yn(
3822
+ return Xn(
3805
3823
  e.card,
3806
3824
  {
3807
- controlValues: Lt({
3825
+ controlValues: Gt({
3808
3826
  relevantControlIds: o,
3809
3827
  dashboardValues: e.dashboardControlValues,
3810
3828
  cardValues: e.cardControlValues
@@ -3816,9 +3834,9 @@ function oa(e) {
3816
3834
  e.presentationControlIds
3817
3835
  );
3818
3836
  }
3819
- function Yn(e, t, n) {
3837
+ function Xn(e, t, n) {
3820
3838
  const r = t.controlBindings.filter(
3821
- (f) => !ve(f)
3839
+ (f) => !Fe(f)
3822
3840
  ), i = new Set(
3823
3841
  Ye({
3824
3842
  sql: e.sql,
@@ -3839,7 +3857,7 @@ function Yn(e, t, n) {
3839
3857
  (f) => l.has(f.controlId)
3840
3858
  );
3841
3859
  return {
3842
- controlValues: Lt({
3860
+ controlValues: Gt({
3843
3861
  relevantControlIds: l,
3844
3862
  dashboardValues: t.controlValues
3845
3863
  }),
@@ -3848,7 +3866,7 @@ function Yn(e, t, n) {
3848
3866
  controlBindings: u
3849
3867
  };
3850
3868
  }
3851
- function ra({
3869
+ function ua({
3852
3870
  card: e,
3853
3871
  dashboard: t,
3854
3872
  transientContexts: n,
@@ -3863,11 +3881,11 @@ function ra({
3863
3881
  dashboardInputContext: d,
3864
3882
  includeAuthoredFilters: f
3865
3883
  }) {
3866
- var D;
3867
- const m = vn(t);
3884
+ var M;
3885
+ const m = Tn(t);
3868
3886
  for (const F of e.controlBindings || [])
3869
- ve(F) && m.add(F.controlId);
3870
- const { shouldApplyDashboardFilters: g } = na(n), p = d != null && d.inputs.length ? d : void 0, y = Wn(e, {
3887
+ Fe(F) && m.add(F.controlId);
3888
+ const { shouldApplyDashboardFilters: g } = la(n), p = d != null && d.inputs.length ? d : void 0, y = Zn(e, {
3871
3889
  includeAuthoredFilters: f,
3872
3890
  // Blocked and skipped conditions are already projected away, so a
3873
3891
  // selection can only ever narrow this card on its own fields. Carried
@@ -3876,19 +3894,19 @@ function ra({
3876
3894
  (F) => F.status === "apply"
3877
3895
  ),
3878
3896
  drill: o == null ? void 0 : o.drill
3879
- }), b = Qn(y), I = f === !1 ? Te(b, !0) : b, v = ta(
3897
+ }), h = Jn(y), I = f === !1 ? Me(h, !0) : h, v = aa(
3880
3898
  e,
3881
3899
  o == null ? void 0 : o.drill,
3882
3900
  I
3883
- ), M = rs({ ...e, config: v }, r) ?? v, h = bn(M, {
3901
+ ), D = us({ ...e, config: v }, r) ?? v, C = In(D, {
3884
3902
  cardType: e.type,
3885
3903
  dataSource: e.dataSource,
3886
- temporalResultOwner: jt({
3887
- hasExecutableConfig: Fe(M, e.type),
3904
+ temporalResultOwner: Ht({
3905
+ hasExecutableConfig: Se(D, e.type),
3888
3906
  sql: e.sql,
3889
3907
  normalizedPython: Le(e.python || "")
3890
3908
  })
3891
- }) || M, w = Zs(I) || "", A = p ? Yn(
3909
+ }) || D, w = ia(I) || "", A = p ? Xn(
3892
3910
  e,
3893
3911
  {
3894
3912
  controlValues: p.controlValues,
@@ -3897,7 +3915,7 @@ function ra({
3897
3915
  controlBindings: p.controlBindings
3898
3916
  },
3899
3917
  m
3900
- ) : oa({
3918
+ ) : ca({
3901
3919
  card: e,
3902
3920
  presentationControlIds: m,
3903
3921
  dashboardControls: c,
@@ -3927,21 +3945,21 @@ function ra({
3927
3945
  ...A,
3928
3946
  resolvedFilters: I,
3929
3947
  resolvedFilterParts: y,
3930
- drillSteps: ((D = o == null ? void 0 : o.drill) == null ? void 0 : D.steps) ?? Qo,
3931
- finalConfig: M,
3932
- queryRelevantConfig: h,
3948
+ drillSteps: ((M = o == null ? void 0 : o.drill) == null ? void 0 : M.steps) ?? Zo,
3949
+ finalConfig: D,
3950
+ queryRelevantConfig: C,
3933
3951
  finalFiltersKey: w
3934
3952
  };
3935
3953
  }
3936
- function ia(e, t) {
3954
+ function da(e, t) {
3937
3955
  return !!t && e.endsWith(t);
3938
3956
  }
3939
- function Jn(e, t) {
3957
+ function eo(e, t) {
3940
3958
  return (e ?? []).filter(
3941
- (n) => ia(n.filterId, t)
3959
+ (n) => da(n.filterId, t)
3942
3960
  );
3943
3961
  }
3944
- function Xn(e, t, n) {
3962
+ function to(e, t, n) {
3945
3963
  var o;
3946
3964
  if (t)
3947
3965
  return {
@@ -3950,18 +3968,18 @@ function Xn(e, t, n) {
3950
3968
  ...n ? { owner: n } : {}
3951
3969
  };
3952
3970
  }
3953
- function sa(e) {
3971
+ function fa(e) {
3954
3972
  if (e.resolution.status === "resolved")
3955
- return Xn(
3973
+ return to(
3956
3974
  e.card,
3957
3975
  e.resolution.resolvedOwner.selection,
3958
3976
  e.resolution.resolvedOwner.owner
3959
3977
  );
3960
3978
  }
3961
- function aa(e) {
3979
+ function pa(e) {
3962
3980
  return `Set ${e.join(", ")} to run this card.`;
3963
3981
  }
3964
- function la({
3982
+ function ma({
3965
3983
  dashboardInputContext: e,
3966
3984
  shouldApplyDashboardFilters: t
3967
3985
  }) {
@@ -3969,14 +3987,14 @@ function la({
3969
3987
  return e.activeFilters;
3970
3988
  const n = new Set(
3971
3989
  e.inputs.flatMap(
3972
- (o) => o.kind === "filter" && rn(o) ? [o.filter.id] : []
3990
+ (o) => o.kind === "filter" && ln(o) ? [o.filter.id] : []
3973
3991
  )
3974
3992
  );
3975
3993
  return e.activeFilters.filter(
3976
3994
  (o) => n.has(o.filterId)
3977
3995
  );
3978
3996
  }
3979
- function ca({
3997
+ function ga({
3980
3998
  dashboardInputFilterValues: e,
3981
3999
  adHocFilterValues: t
3982
4000
  }) {
@@ -3988,7 +4006,7 @@ function ca({
3988
4006
  return n;
3989
4007
  }
3990
4008
  function Ke(e, t) {
3991
- const n = t.shouldApplyDashboardFilters ? Jn(t.adHocFilterValues, t.selectedSheetId) : [];
4009
+ const n = t.shouldApplyDashboardFilters ? eo(t.adHocFilterValues, t.selectedSheetId) : [];
3992
4010
  if (!t.dashboardInputContext)
3993
4011
  return {
3994
4012
  status: "ready",
@@ -4006,14 +4024,14 @@ function Ke(e, t) {
4006
4024
  return u.kind === "filter" && ((d = u.compatibility) == null ? void 0 : d.source) === "cardInlineFilter" ? [u.filter.id] : [];
4007
4025
  }
4008
4026
  )
4009
- ), s = la({
4027
+ ), s = ma({
4010
4028
  dashboardInputContext: t.dashboardInputContext,
4011
4029
  shouldApplyDashboardFilters: t.shouldApplyDashboardFilters
4012
4030
  }).filter((u) => !r.has(u.filterId)), a = s.filter(
4013
4031
  (u) => !i.has(u.filterId)
4014
4032
  ), c = s.filter(
4015
4033
  (u) => i.has(u.filterId)
4016
- ), l = Wo({
4034
+ ), l = Xo({
4017
4035
  card: e,
4018
4036
  inputs: o,
4019
4037
  resolvedInputs: t.dashboardInputContext.resolvedInputs,
@@ -4026,7 +4044,7 @@ function Ke(e, t) {
4026
4044
  } : {
4027
4045
  status: "ready",
4028
4046
  filterValues: [
4029
- ...ca({
4047
+ ...ga({
4030
4048
  dashboardInputFilterValues: [
4031
4049
  ...a,
4032
4050
  ...l.filterValues
@@ -4038,7 +4056,7 @@ function Ke(e, t) {
4038
4056
  mappingDispositions: l.dispositions
4039
4057
  };
4040
4058
  }
4041
- function ua(e, t) {
4059
+ function ya(e, t) {
4042
4060
  const n = e.dashboardInputContext;
4043
4061
  if (!n) return [];
4044
4062
  const o = new Set(
@@ -4049,10 +4067,10 @@ function ua(e, t) {
4049
4067
  return n.resolvedInputs.flatMap((i) => {
4050
4068
  if (!i.missingRequiredValue) return [];
4051
4069
  const s = r.get(i.id);
4052
- return s ? s.kind === "filter" && (!e.shouldApplyDashboardFilters && !rn(s) || o.has(s.id)) ? [] : [i.label] : [];
4070
+ return s ? s.kind === "filter" && (!e.shouldApplyDashboardFilters && !ln(s) || o.has(s.id)) ? [] : [i.label] : [];
4053
4071
  });
4054
4072
  }
4055
- function da({
4073
+ function ba({
4056
4074
  card: e,
4057
4075
  cardConfig: t,
4058
4076
  input: n,
@@ -4065,7 +4083,7 @@ function da({
4065
4083
  var p;
4066
4084
  const c = n.dashboardInputContext ? n.dashboardInputContext.inputs.flatMap(
4067
4085
  (y) => y.kind === "filter" ? [y.filter] : []
4068
- ) : [], l = Ke(e, n), u = ua(
4086
+ ) : [], l = Ke(e, n), u = ya(
4069
4087
  n,
4070
4088
  l.mappingDispositions
4071
4089
  );
@@ -4085,7 +4103,7 @@ function da({
4085
4103
  mappingDispositions: l.mappingDispositions,
4086
4104
  missingRequiredLabels: []
4087
4105
  };
4088
- const d = Ws({
4106
+ const d = ta({
4089
4107
  card: e,
4090
4108
  cardConfig: t,
4091
4109
  filters: c,
@@ -4101,12 +4119,12 @@ function da({
4101
4119
  (y) => y.status === "apply" ? [[y.inputId, y.filterValue]] : []
4102
4120
  )
4103
4121
  )
4104
- }), f = $(c), m = !!(f && d.cardFilterValues.some(
4122
+ }), f = U(c), m = !!(f && d.cardFilterValues.some(
4105
4123
  (y) => y.filterId === f.id
4106
- )), g = d.resolvedPrimaryDateField && !((p = e.sql) != null && p.trim()) ? d.dateComparisonPlan.inputs.length ? sa({
4124
+ )), g = d.resolvedPrimaryDateField && !((p = e.sql) != null && p.trim()) ? d.dateComparisonPlan.inputs.length ? fa({
4107
4125
  card: e,
4108
4126
  resolution: d.dateComparisonPlan.resolution
4109
- }) : m ? Xn(
4127
+ }) : m ? to(
4110
4128
  e,
4111
4129
  n.globalDateComparisonSelection
4112
4130
  ) : void 0 : void 0;
@@ -4118,8 +4136,8 @@ function da({
4118
4136
  mappingDispositions: l.mappingDispositions
4119
4137
  };
4120
4138
  }
4121
- function Zn(e, t, n) {
4122
- const o = da({
4139
+ function no(e, t, n) {
4140
+ const o = ba({
4123
4141
  resolvedFields: t.resolvedDateFields,
4124
4142
  ...n,
4125
4143
  card: e,
@@ -4138,8 +4156,8 @@ function Zn(e, t, n) {
4138
4156
  dateComparisonInputs: r.dateComparisonInputs
4139
4157
  }, compiledFilters: o };
4140
4158
  }
4141
- function fa(e, t, n) {
4142
- const o = Yo(e), r = Zn(e, t, {
4159
+ function ha(e, t, n) {
4160
+ const o = er(e), r = no(e, t, {
4143
4161
  resolvedPrimaryDateField: n.resolvedPrimaryDateField,
4144
4162
  timezone: n.calendarContext.tz,
4145
4163
  allowMinutePrecision: n.allowGlobalDateMinutePrecision
@@ -4150,13 +4168,13 @@ function fa(e, t, n) {
4150
4168
  cardFilterValues: s,
4151
4169
  resolvedPrimaryDateField: a,
4152
4170
  globalDateComparison: c
4153
- } = i, { queryKey: l, queryInputIdentity: u, paginationConfig: d } = Ui(
4171
+ } = i, { queryKey: l, queryInputIdentity: u, paginationConfig: d } = Ji(
4154
4172
  e,
4155
4173
  r.queryContext,
4156
4174
  n.calendarContext,
4157
4175
  { resolvePaginationConfig: n.resolvePaginationConfig }
4158
- ), f = t.queryRelevantConfig, m = Le(e.python || ""), g = jt({
4159
- hasExecutableConfig: Fe(f, e.type),
4176
+ ), f = t.queryRelevantConfig, m = Le(e.python || ""), g = Ht({
4177
+ hasExecutableConfig: Se(f, e.type),
4160
4178
  sql: e.sql,
4161
4179
  normalizedPython: m
4162
4180
  });
@@ -4191,29 +4209,29 @@ function fa(e, t, n) {
4191
4209
  }
4192
4210
  };
4193
4211
  }
4194
- const Ot = [], pa = [], ma = {};
4195
- function Gl(e, t) {
4212
+ const Bt = [], Ca = [], Ia = {};
4213
+ function Yl(e, t) {
4196
4214
  return {
4197
4215
  sheetId: e.sheetId,
4198
4216
  sectionId: e.sectionId,
4199
- documentFilterValues: e.documentFilterValues ?? Ot,
4200
- documentControlDefinitions: e.documentControlDefinitions ?? pa,
4201
- documentControlValues: e.documentControlValues ?? ma,
4202
- editorFilterValues: t ?? Ot
4217
+ documentFilterValues: e.documentFilterValues ?? Bt,
4218
+ documentControlDefinitions: e.documentControlDefinitions ?? Ca,
4219
+ documentControlValues: e.documentControlValues ?? Ia,
4220
+ editorFilterValues: t ?? Bt
4203
4221
  };
4204
4222
  }
4205
- function ga({
4223
+ function va({
4206
4224
  card: e,
4207
4225
  dashboard: t,
4208
4226
  runtime: n,
4209
4227
  dashboardRuntimeValues: o,
4210
4228
  calendar: r
4211
4229
  }) {
4212
- const i = zt({
4230
+ const i = $t({
4213
4231
  dashboard: t,
4214
4232
  dashboardInputValues: o.dashboardInputValues,
4215
4233
  transientContexts: void 0
4216
- }) ? Ue({
4234
+ }) ? $e({
4217
4235
  transientContexts: void 0,
4218
4236
  dashboard: t,
4219
4237
  sheetId: n.sheetId,
@@ -4230,7 +4248,7 @@ function ga({
4230
4248
  ...n.documentFilterValues
4231
4249
  ];
4232
4250
  return {
4233
- card: a ? e : ya(
4251
+ card: a ? e : Fa(
4234
4252
  e,
4235
4253
  n.documentControlDefinitions
4236
4254
  ),
@@ -4248,7 +4266,7 @@ function ga({
4248
4266
  dashboardInputContext: s
4249
4267
  };
4250
4268
  }
4251
- function ya(e, t) {
4269
+ function Fa(e, t) {
4252
4270
  if (t.length === 0)
4253
4271
  return e;
4254
4272
  const n = /* @__PURE__ */ new Map();
@@ -4261,7 +4279,7 @@ function ya(e, t) {
4261
4279
  controls: Array.from(n.values())
4262
4280
  };
4263
4281
  }
4264
- function Hl({
4282
+ function Jl({
4265
4283
  card: e,
4266
4284
  place: t,
4267
4285
  source: n
@@ -4273,9 +4291,9 @@ function Hl({
4273
4291
  inputContext: o.inputContext
4274
4292
  };
4275
4293
  }
4276
- function ba(e, t, n) {
4294
+ function Sa(e, t, n) {
4277
4295
  return {
4278
- calendarContext: n ?? Mr,
4296
+ calendarContext: n ?? wr,
4279
4297
  allowGlobalDateMinutePrecision: He(
4280
4298
  e,
4281
4299
  t
@@ -4284,17 +4302,17 @@ function ba(e, t, n) {
4284
4302
  globalCacheConfig: e.globalCacheConfig
4285
4303
  };
4286
4304
  }
4287
- function Ul(e, t) {
4288
- return no(
4305
+ function Zl(e, t) {
4306
+ return io(
4289
4307
  e,
4290
4308
  t,
4291
4309
  t.allowGlobalDateMinutePrecision
4292
4310
  );
4293
4311
  }
4294
- function Ca(e, t, n = {}) {
4295
- const o = to(e, t);
4312
+ function Ta(e, t, n = {}) {
4313
+ const o = ro(e, t);
4296
4314
  return {
4297
- ...fa(e.card, e.context, {
4315
+ ...ha(e.card, e.context, {
4298
4316
  resolvedPrimaryDateField: o,
4299
4317
  calendarContext: t.calendarContext,
4300
4318
  allowGlobalDateMinutePrecision: t.allowGlobalDateMinutePrecision,
@@ -4304,7 +4322,7 @@ function Ca(e, t, n = {}) {
4304
4322
  resolvedPrimaryDateField: o
4305
4323
  };
4306
4324
  }
4307
- function ha({
4325
+ function Da({
4308
4326
  card: e,
4309
4327
  place: t,
4310
4328
  source: n,
@@ -4313,19 +4331,19 @@ function ha({
4313
4331
  withRequest: i = !1
4314
4332
  }) {
4315
4333
  var p, y;
4316
- const { dashboard: s } = n, a = e.id, c = (b, I) => {
4317
- var M;
4334
+ const { dashboard: s } = n, a = e.id, c = (h, I) => {
4335
+ var D;
4318
4336
  let v;
4319
4337
  try {
4320
- const h = We(b);
4321
- if (h.status === "invalid") throw h.error;
4338
+ const C = We(h);
4339
+ if (C.status === "invalid") throw C.error;
4322
4340
  const w = qe(
4323
- b,
4341
+ h,
4324
4342
  I,
4325
4343
  n,
4326
- h.status === "absent"
4344
+ C.status === "absent"
4327
4345
  );
4328
- if (v = w.context, h.status === "absent")
4346
+ if (v = w.context, C.status === "absent")
4329
4347
  return { status: "ready", value: { assembled: w } };
4330
4348
  if (!r)
4331
4349
  return {
@@ -4334,15 +4352,15 @@ function ha({
4334
4352
  message: "Matrix field metadata is required.",
4335
4353
  context: v
4336
4354
  };
4337
- const A = Is(h.config.spec, v), D = r.filter(
4338
- (x) => x.field.source && A.some(
4339
- (E) => Oe(E, x.field.source)
4355
+ const A = Ms(C.config.spec, v), M = r.filter(
4356
+ (P) => P.field.source && A.some(
4357
+ (E) => Oe(E, P.field.source)
4340
4358
  )
4341
- ), F = Js(b, D, v), { params: k } = w, O = k.dashboardInputContext;
4359
+ ), F = oa(h, M, v), { params: k } = w, O = k.dashboardInputContext;
4342
4360
  F.config = {
4343
4361
  ...F.config,
4344
- presentation: wi(
4345
- b,
4362
+ presentation: _i(
4363
+ h,
4346
4364
  F.config,
4347
4365
  {
4348
4366
  controls: O ? [
@@ -4354,32 +4372,32 @@ function ha({
4354
4372
  ],
4355
4373
  values: (O == null ? void 0 : O.controlValues) ?? {
4356
4374
  ...k.dashboardControlValues,
4357
- ...(M = k.cardControlValuesMap) == null ? void 0 : M[b.id]
4375
+ ...(D = k.cardControlValuesMap) == null ? void 0 : D[h.id]
4358
4376
  }
4359
4377
  },
4360
- D
4378
+ M
4361
4379
  )
4362
4380
  };
4363
- const P = {
4364
- ...b,
4381
+ const x = {
4382
+ ...h,
4365
4383
  config: { matrix: F.config }
4366
- }, T = qe(P, I, n, !1);
4384
+ }, T = qe(x, I, n, !1);
4367
4385
  return {
4368
4386
  status: "ready",
4369
4387
  value: {
4370
4388
  assembled: {
4371
- card: P,
4389
+ card: x,
4372
4390
  context: { ...T.context, resolvedDateFields: F.fields },
4373
4391
  inputContext: T.inputContext
4374
4392
  },
4375
4393
  matrix: F
4376
4394
  }
4377
4395
  };
4378
- } catch (h) {
4396
+ } catch (C) {
4379
4397
  return {
4380
4398
  status: "blocked",
4381
4399
  reason: "configuration",
4382
- message: h instanceof Error ? h.message : "Card configuration is invalid.",
4400
+ message: C instanceof Error ? C.message : "Card configuration is invalid.",
4383
4401
  context: v
4384
4402
  };
4385
4403
  }
@@ -4393,55 +4411,55 @@ function ha({
4393
4411
  missingRequiredLabels: [],
4394
4412
  message: l.message
4395
4413
  };
4396
- const { assembled: u, matrix: d } = l.value, f = ba(
4414
+ const { assembled: u, matrix: d } = l.value, f = Sa(
4397
4415
  s,
4398
4416
  o,
4399
4417
  n.calendar
4400
- ), m = u.context.filterCompilationInput, g = Jo(s);
4418
+ ), m = u.context.filterCompilationInput, g = tr(s);
4401
4419
  try {
4402
- const b = Ke(u.card, m), I = d && g && b.status === "ready" && b.filterValues.some((w) => w.filterId === g.id);
4420
+ const h = Ke(u.card, m), I = d && g && h.status === "ready" && h.filterValues.some((w) => w.filterId === g.id);
4403
4421
  let v = f.allowGlobalDateMinutePrecision;
4404
4422
  if (I) {
4405
4423
  const w = (p = m.dashboardInputContext) == null ? void 0 : p.inputs.find(
4406
4424
  (T) => T.kind === "filter" && T.filter.id === g.id
4407
- ), D = Xo(s, g).filter(
4408
- ({ card: T, sheet: x }) => !w || Dr(w, {
4425
+ ), M = nr(s, g).filter(
4426
+ ({ card: T, sheet: P }) => !w || Pr(w, {
4409
4427
  cardId: T.id,
4410
- sheetId: x.id,
4411
- sheetKind: Gt(x) ? "document" : "dashboard"
4428
+ sheetId: P.id,
4429
+ sheetKind: Ut(P) ? "document" : "dashboard"
4412
4430
  })
4413
- ).map(({ card: T, sheet: x }) => ({
4431
+ ).map(({ card: T, sheet: P }) => ({
4414
4432
  card: T,
4415
- value: T.id === a ? l : c(T, { kind: "sheet", sheetId: x.id })
4433
+ value: T.id === a ? l : c(T, { kind: "sheet", sheetId: P.id })
4416
4434
  })), F = new Map(
4417
- D.map(({ card: T, value: x }) => [
4435
+ M.map(({ card: T, value: P }) => [
4418
4436
  T.id,
4419
- x.status === "ready" ? x.value.assembled.card : null
4437
+ P.status === "ready" ? P.value.assembled.card : null
4420
4438
  ])
4421
4439
  ), k = new Map(
4422
- D.map(({ card: T, value: x }) => {
4440
+ M.map(({ card: T, value: P }) => {
4423
4441
  var E;
4424
4442
  return [
4425
4443
  T.id,
4426
- x.status === "ready" ? (E = x.value.matrix) == null ? void 0 : E.fields : void 0
4444
+ P.status === "ready" ? (E = P.value.matrix) == null ? void 0 : E.fields : void 0
4427
4445
  ];
4428
4446
  })
4429
- ), O = D.flatMap(
4430
- ({ card: T, value: x }) => {
4431
- const E = T.id, R = x.status === "ready" ? x.value.assembled.context : x.context;
4447
+ ), O = M.flatMap(
4448
+ ({ card: T, value: P }) => {
4449
+ const E = T.id, R = P.status === "ready" ? P.value.assembled.context : P.context;
4432
4450
  if (!R) return [E];
4433
- const z = x.status === "ready" ? x.value.assembled.card : T;
4451
+ const z = P.status === "ready" ? P.value.assembled.card : T;
4434
4452
  try {
4435
4453
  const Y = Ke(
4436
4454
  z,
4437
4455
  R.filterCompilationInput
4438
4456
  );
4439
- return Y.status === "blocked" || Y.filterValues.some((Ve) => Ve.filterId === g.id) ? [E] : [];
4457
+ return Y.status === "blocked" || Y.filterValues.some((ce) => ce.filterId === g.id) ? [E] : [];
4440
4458
  } catch {
4441
4459
  return F.set(E, null), [E];
4442
4460
  }
4443
4461
  }
4444
- ), P = He(
4462
+ ), x = He(
4445
4463
  s,
4446
4464
  o,
4447
4465
  g,
@@ -4449,59 +4467,59 @@ function ha({
4449
4467
  k,
4450
4468
  O
4451
4469
  );
4452
- if ((y = P.unresolvedCardIds) != null && y.length)
4470
+ if ((y = x.unresolvedCardIds) != null && y.length)
4453
4471
  return {
4454
4472
  status: "blocked",
4455
4473
  cardId: a,
4456
4474
  mappingDispositions: [],
4457
4475
  reason: "coverage",
4458
4476
  missingRequiredLabels: [],
4459
- message: `Date precision requires field metadata and valid inputs for: ${P.unresolvedCardIds.join(", ")}.`
4477
+ message: `Date precision requires field metadata and valid inputs for: ${x.unresolvedCardIds.join(", ")}.`
4460
4478
  };
4461
- v = P.allEligibleTargetsAreDateTime;
4479
+ v = x.allEligibleTargetsAreDateTime;
4462
4480
  }
4463
- const M = no(u, f, v);
4464
- if (M.status === "blocked")
4481
+ const D = io(u, f, v);
4482
+ if (D.status === "blocked")
4465
4483
  return {
4466
4484
  status: "blocked",
4467
- cardId: M.cardId,
4468
- mappingDispositions: M.mappingDispositions,
4469
- reason: M.reason,
4470
- missingRequiredLabels: M.missingRequiredLabels,
4471
- ...M.reason === "requiredInput" ? { message: aa(M.missingRequiredLabels) } : {},
4472
- ...M.resolvedPrimaryDateField ? { resolvedPrimaryDateField: M.resolvedPrimaryDateField } : {}
4485
+ cardId: D.cardId,
4486
+ mappingDispositions: D.mappingDispositions,
4487
+ reason: D.reason,
4488
+ missingRequiredLabels: D.missingRequiredLabels,
4489
+ ...D.reason === "requiredInput" ? { message: pa(D.missingRequiredLabels) } : {},
4490
+ ...D.resolvedPrimaryDateField ? { resolvedPrimaryDateField: D.resolvedPrimaryDateField } : {}
4473
4491
  };
4474
- const h = i && !d ? Ca(u, f) : void 0;
4492
+ const C = i && !d ? Ta(u, f) : void 0;
4475
4493
  return {
4476
- ...M,
4494
+ ...D,
4477
4495
  ...d ? { matrix: d } : {},
4478
4496
  // The whole request a card runs with: the contract's payload and its
4479
4497
  // extras (server pagination, table totals) from the one extras owner,
4480
4498
  // on the first page a new viewer opens (ledger P3-78).
4481
- ...(h == null ? void 0 : h.status) === "ready" ? {
4499
+ ...(C == null ? void 0 : C.status) === "ready" ? {
4482
4500
  request: {
4483
- ...h.requestPayloadBase,
4484
- ...ms({
4501
+ ...C.requestPayloadBase,
4502
+ ...Is({
4485
4503
  card: u.card,
4486
4504
  finalConfig: u.context.finalConfig,
4487
4505
  documentSection: t.kind === "documentSection" ? {} : void 0,
4488
- page: ps(u.card)
4506
+ page: Cs(u.card)
4489
4507
  })
4490
4508
  }
4491
4509
  } : {}
4492
4510
  };
4493
- } catch (b) {
4511
+ } catch (h) {
4494
4512
  return {
4495
4513
  status: "blocked",
4496
4514
  cardId: a,
4497
4515
  mappingDispositions: [],
4498
4516
  reason: "configuration",
4499
4517
  missingRequiredLabels: [],
4500
- message: b instanceof Error ? b.message : "Card filter configuration is invalid."
4518
+ message: h instanceof Error ? h.message : "Card filter configuration is invalid."
4501
4519
  };
4502
4520
  }
4503
4521
  }
4504
- function Ia(e) {
4522
+ function Ma(e) {
4505
4523
  const t = e.editor ? {
4506
4524
  ...e.inlineFilterValuesMap,
4507
4525
  ...Object.fromEntries(
@@ -4520,8 +4538,8 @@ function Ia(e) {
4520
4538
  }
4521
4539
  function qe(e, t, n, o) {
4522
4540
  var l, u;
4523
- const { dashboard: r } = n, i = Ia(n), s = t.kind === "documentSection" ? {
4524
- ...ga({
4541
+ const { dashboard: r } = n, i = Ma(n), s = t.kind === "documentSection" ? {
4542
+ ...va({
4525
4543
  card: e,
4526
4544
  dashboard: r,
4527
4545
  runtime: t.section,
@@ -4530,24 +4548,24 @@ function qe(e, t, n, o) {
4530
4548
  }),
4531
4549
  selectedSheetId: t.section.sheetId,
4532
4550
  includeAuthoredFilters: o
4533
- } : va(e, t.sheetId, n, i, o), a = ra(s), c = (l = e.config) == null ? void 0 : l.rowLimit;
4534
- return (u = e.sql) != null && u.trim() && c && eo(r, e.id) && (a.sqlRowLimit = c), {
4551
+ } : Va(e, t.sheetId, n, i, o), a = ua(s), c = (l = e.config) == null ? void 0 : l.rowLimit;
4552
+ return (u = e.sql) != null && u.trim() && c && oo(r, e.id) && (a.sqlRowLimit = c), {
4535
4553
  card: s.card,
4536
4554
  params: s,
4537
4555
  context: a,
4538
4556
  inputContext: s.dashboardInputContext
4539
4557
  };
4540
4558
  }
4541
- function eo(e, t) {
4559
+ function oo(e, t) {
4542
4560
  return (e.variables ?? []).some((n) => n.id === t);
4543
4561
  }
4544
- function va(e, t, n, o, r) {
4562
+ function Va(e, t, n, o, r) {
4545
4563
  var l, u;
4546
- const { dashboard: i } = n, s = eo(i, e.id), a = s ? void 0 : n.transientContexts, c = zt({
4564
+ const { dashboard: i } = n, s = oo(i, e.id), a = s ? void 0 : n.transientContexts, c = $t({
4547
4565
  dashboard: i,
4548
4566
  dashboardInputValues: o.dashboardInputValues,
4549
4567
  transientContexts: a
4550
- }) ? Ue({
4568
+ }) ? $e({
4551
4569
  transientContexts: a,
4552
4570
  dashboard: i,
4553
4571
  sheetId: t,
@@ -4572,16 +4590,16 @@ function va(e, t, n, o, r) {
4572
4590
  includeAuthoredFilters: r
4573
4591
  };
4574
4592
  }
4575
- function to({ card: e, context: t }, n) {
4576
- return Nt({
4593
+ function ro({ card: e, context: t }, n) {
4594
+ return zt({
4577
4595
  card: e,
4578
4596
  cardConfig: t.queryRelevantConfig,
4579
4597
  resolvedFields: t.resolvedDateFields,
4580
4598
  semanticExecutionPayload: n.semanticExecutionPayload
4581
4599
  });
4582
4600
  }
4583
- function no(e, t, n) {
4584
- const { card: o } = e, r = to(e, t), i = Zn(o, e.context, {
4601
+ function io(e, t, n) {
4602
+ const { card: o } = e, r = ro(e, t), i = no(o, e.context, {
4585
4603
  resolvedPrimaryDateField: r,
4586
4604
  timezone: t.calendarContext.tz,
4587
4605
  allowMinutePrecision: n
@@ -4594,7 +4612,7 @@ function no(e, t, n) {
4594
4612
  resolvedPrimaryDateField: r
4595
4613
  };
4596
4614
  }
4597
- function $l({
4615
+ function Xl({
4598
4616
  dashboard: e,
4599
4617
  dashboardInputValues: t,
4600
4618
  adHocFilterValues: n,
@@ -4606,15 +4624,15 @@ function $l({
4606
4624
  semanticExecutionPayload: c,
4607
4625
  timezone: l
4608
4626
  }) {
4609
- const u = e ? [...Zo(e)] : void 0, d = r ?? null, f = (I) => {
4627
+ const u = e ? [...or(e)] : void 0, d = r ?? null, f = (I) => {
4610
4628
  var v;
4611
- return e ? Da({
4629
+ return e ? xa({
4612
4630
  dashboard: e,
4613
4631
  runtimeValues: { dashboardInputValues: t },
4614
4632
  adHocFilterValues: n,
4615
4633
  sheetId: I,
4616
- sheetKind: Gt(
4617
- (v = e.sheets) == null ? void 0 : v.find((M) => M.id === I)
4634
+ sheetKind: Ut(
4635
+ (v = e.sheets) == null ? void 0 : v.find((D) => D.id === I)
4618
4636
  ) ? "document" : "dashboard",
4619
4637
  calendar: o
4620
4638
  }) : [];
@@ -4633,10 +4651,10 @@ function $l({
4633
4651
  ) : [];
4634
4652
  for (const I of p)
4635
4653
  Object.assign(g, (a == null ? void 0 : a[I.card.id]) || {});
4636
- const y = er({
4654
+ const y = rr({
4637
4655
  filterDefinitions: u,
4638
4656
  filterValues: m
4639
- }), b = Hs({
4657
+ }), h = Js({
4640
4658
  filters: u,
4641
4659
  filterValues: y,
4642
4660
  dashboard: e,
@@ -4645,11 +4663,11 @@ function $l({
4645
4663
  });
4646
4664
  return {
4647
4665
  selectedSheetId: d,
4648
- filterValues: b,
4666
+ filterValues: h,
4649
4667
  controlValues: g
4650
4668
  };
4651
4669
  }
4652
- function Ql({
4670
+ function ec({
4653
4671
  dashboard: e,
4654
4672
  cardId: t,
4655
4673
  transientContexts: n,
@@ -4667,16 +4685,16 @@ function Ql({
4667
4685
  sheetId: g,
4668
4686
  documentSection: p,
4669
4687
  editor: y,
4670
- withRequest: b
4688
+ withRequest: h
4671
4689
  }) {
4672
- var M;
4690
+ var D;
4673
4691
  if (!e)
4674
4692
  return null;
4675
- m && !Ct(e, t) && g && (e = { ...e, sheets: (M = e.sheets) == null ? void 0 : M.map((h) => h.id === g ? { ...h, cards: [...h.cards ?? [], m] } : h) });
4676
- const I = Ct(e, t);
4693
+ m && !vt(e, t) && g && (e = { ...e, sheets: (D = e.sheets) == null ? void 0 : D.map((C) => C.id === g ? { ...C, cards: [...C.cards ?? [], m] } : C) });
4694
+ const I = vt(e, t);
4677
4695
  if (!I)
4678
4696
  return null;
4679
- const v = ha({
4697
+ const v = Da({
4680
4698
  card: m ?? I.card,
4681
4699
  place: p ? { kind: "documentSection", section: p } : { kind: "sheet", sheetId: I.sheet.id },
4682
4700
  source: {
@@ -4686,7 +4704,7 @@ function Ql({
4686
4704
  inlineFilterValuesMap: a,
4687
4705
  cardControlValuesMap: l ? Object.fromEntries(
4688
4706
  Object.entries(l).filter(
4689
- (h) => h[1] !== void 0
4707
+ (C) => C[1] !== void 0
4690
4708
  )
4691
4709
  ) : void 0,
4692
4710
  dashboardInputValues: u,
@@ -4698,7 +4716,7 @@ function Ql({
4698
4716
  },
4699
4717
  semanticExecutionPayload: i,
4700
4718
  matrixCatalog: f,
4701
- withRequest: b
4719
+ withRequest: h
4702
4720
  });
4703
4721
  return v.status === "blocked" ? v : {
4704
4722
  status: "ready",
@@ -4711,19 +4729,19 @@ function Ql({
4711
4729
  ...v.request ? { request: v.request } : {}
4712
4730
  };
4713
4731
  }
4714
- function Fa(e, t, n) {
4715
- const o = t === "date" && "relativeMeta" in e ? fr(e.relativeMeta) : void 0;
4732
+ function ka(e, t, n) {
4733
+ const o = t === "date" && "relativeMeta" in e ? yr(e.relativeMeta) : void 0;
4716
4734
  if (!o) return { values: e.values };
4717
- const r = rr(o, n ?? void 0), i = e.operation === "between" || e.operation === "not between";
4735
+ const r = lr(o, n ?? void 0), i = e.operation === "between" || e.operation === "not between";
4718
4736
  return {
4719
4737
  values: r && i ? r : e.values,
4720
4738
  relativeMeta: o,
4721
4739
  ..."temporalPrecision" in e && e.temporalPrecision === "minute" ? { temporalPrecision: "minute" } : {}
4722
4740
  };
4723
4741
  }
4724
- function Sa(e, t, n) {
4725
- const o = t, r = nr(e);
4726
- return or({
4742
+ function Pa(e, t, n) {
4743
+ const o = t, r = sr(e);
4744
+ return ar({
4727
4745
  definition: e,
4728
4746
  sourceValue: o,
4729
4747
  value: {
@@ -4734,12 +4752,12 @@ function Sa(e, t, n) {
4734
4752
  dataType: e.dataType,
4735
4753
  fieldMeta: e.fieldMeta,
4736
4754
  semanticContext: e.semanticContext,
4737
- ...Fa(o, r, n)
4755
+ ...ka(o, r, n)
4738
4756
  }
4739
4757
  });
4740
4758
  }
4741
- function oo(e, t, n) {
4742
- const o = K(e);
4759
+ function so(e, t, n) {
4760
+ const o = q(e);
4743
4761
  let r = {};
4744
4762
  const i = [], s = [];
4745
4763
  for (const a of t ?? []) {
@@ -4748,16 +4766,16 @@ function oo(e, t, n) {
4748
4766
  s.push(a.filterId);
4749
4767
  continue;
4750
4768
  }
4751
- const u = tr(
4752
- Sa(l.filter, a, n.calendar)
4769
+ const u = ir(
4770
+ Pa(l.filter, a, n.calendar)
4753
4771
  );
4754
4772
  if (u) {
4755
4773
  if (l.runtimeScope === "shared") {
4756
- r = gt(r, l, {}, u);
4774
+ r = ht(r, l, {}, u);
4757
4775
  continue;
4758
4776
  }
4759
- for (const d of sn(e).values())
4760
- an(l, d) && (r = gt(
4777
+ for (const d of cn(e).values())
4778
+ un(l, d) && (r = ht(
4761
4779
  r,
4762
4780
  l,
4763
4781
  { sheetId: d.sheetId },
@@ -4767,11 +4785,11 @@ function oo(e, t, n) {
4767
4785
  }
4768
4786
  return { slots: r, adHocFilterValues: i, droppedFilterIds: s };
4769
4787
  }
4770
- function Da(e) {
4788
+ function xa(e) {
4771
4789
  const { dashboard: t, sheetId: n } = e, o = [];
4772
4790
  if (n)
4773
- for (const { input: r } of ir(t, n, e.sheetKind)) {
4774
- const i = sr({
4791
+ for (const { input: r } of cr(t, n, e.sheetKind)) {
4792
+ const i = ur({
4775
4793
  dashboard: t,
4776
4794
  input: r,
4777
4795
  runtimeValues: { dashboardInputValues: e.runtimeValues.dashboardInputValues },
@@ -4780,16 +4798,16 @@ function Da(e) {
4780
4798
  });
4781
4799
  i.kind === "filter" && i.filterValue && o.push(i.filterValue);
4782
4800
  }
4783
- return [...o, ...Jn(e.adHocFilterValues, n)];
4801
+ return [...o, ...eo(e.adHocFilterValues, n)];
4784
4802
  }
4785
- function Wl(e, t) {
4803
+ function tc(e, t) {
4786
4804
  switch (t.runtimeScope) {
4787
4805
  case "shared":
4788
4806
  return [{}];
4789
4807
  case "perSheet":
4790
- return [...sn(e).values()].filter((n) => an(t, n)).map((n) => ({ sheetId: n.sheetId }));
4808
+ return [...cn(e).values()].filter((n) => un(t, n)).map((n) => ({ sheetId: n.sheetId }));
4791
4809
  case "perCard": {
4792
- const n = K(e);
4810
+ const n = q(e);
4793
4811
  return [
4794
4812
  ...n.reachedCards({ inputId: t.id }).map((o) => ({ sheetId: o.sheetId, cardId: o.cardId })),
4795
4813
  // A variable holds a value at each place it is used (DV-D35).
@@ -4800,7 +4818,7 @@ function Wl(e, t) {
4800
4818
  }
4801
4819
  case "perDocumentSection": {
4802
4820
  const n = /* @__PURE__ */ new Map();
4803
- for (const o of K(e).reachedCards({ inputId: t.id }))
4821
+ for (const o of q(e).reachedCards({ inputId: t.id }))
4804
4822
  o.kind === "documentSectionCard" && n.set(o.sectionId, { sheetId: o.sheetId, sectionId: o.sectionId });
4805
4823
  return [...n.values()];
4806
4824
  }
@@ -4808,36 +4826,36 @@ function Wl(e, t) {
4808
4826
  return [];
4809
4827
  }
4810
4828
  }
4811
- function At(e) {
4829
+ function _t(e) {
4812
4830
  var t;
4813
4831
  return [
4814
4832
  ...e.cards ?? [],
4815
4833
  ...(e.frames ?? []).flatMap((n) => n.cards),
4816
4834
  ...(((t = e.document) == null ? void 0 : t.sections) ?? []).flatMap(
4817
- (n) => ln(n)
4835
+ (n) => dn(n)
4818
4836
  )
4819
4837
  ];
4820
4838
  }
4821
- function Ta(e, t) {
4839
+ function wa(e, t) {
4822
4840
  var n, o;
4823
4841
  return {
4824
4842
  sheetId: e.id,
4825
4843
  cardId: t.id,
4826
4844
  sheetKind: e.kind ?? "dashboard",
4827
4845
  sectionId: (o = (n = e.document) == null ? void 0 : n.sections.find(
4828
- (r) => ln(r).some(({ id: i }) => i === t.id)
4846
+ (r) => dn(r).some(({ id: i }) => i === t.id)
4829
4847
  )) == null ? void 0 : o.id
4830
4848
  };
4831
4849
  }
4832
- function Ma(e, t, n, o) {
4850
+ function Oa(e, t, n, o) {
4833
4851
  var l, u, d;
4834
4852
  const r = {}, i = (l = e.preferences) == null ? void 0 : l.textVisualOptions;
4835
4853
  if (!i) return r;
4836
- const s = Ue({
4854
+ const s = $e({
4837
4855
  // Authoring: carried drill context never applies to a dashboard being edited.
4838
4856
  transientContexts: void 0,
4839
4857
  dashboard: n,
4840
- ...Ta(o, t),
4858
+ ...wa(o, t),
4841
4859
  card: t,
4842
4860
  runtimeValues: {},
4843
4861
  // Aliases only: no input value is read.
@@ -4851,7 +4869,7 @@ function Ma(e, t, n, o) {
4851
4869
  } : f;
4852
4870
  return m && (r[f.variableName] = g), g;
4853
4871
  }, c = (f) => {
4854
- Object.assign(f, Wt(f, (m) => a(m))), f.type === "link" && [...f.children, ...Array.isArray(f.url) ? f.url : []].forEach((m) => c(m)), f.type === "when" && [...f.then ?? [], ...f.else ?? []].forEach(c);
4872
+ Object.assign(f, Zt(f, (m) => a(m))), f.type === "link" && [...f.children, ...Array.isArray(f.url) ? f.url : []].forEach((m) => c(m)), f.type === "when" && [...f.then ?? [], ...f.else ?? []].forEach(c);
4855
4873
  };
4856
4874
  return (u = i.content) == null || u.forEach((f) => {
4857
4875
  f.type === "variable" && (f.ref = a(f.ref));
@@ -4859,17 +4877,17 @@ function Ma(e, t, n, o) {
4859
4877
  f.type === "list" ? f.items.forEach((m) => m.forEach(c)) : f.children.forEach(c);
4860
4878
  }), r;
4861
4879
  }
4862
- function Va(e, t) {
4880
+ function Aa(e, t) {
4863
4881
  var i;
4864
- const n = At(e);
4882
+ const n = _t(e);
4865
4883
  if (!n.some((s) => {
4866
4884
  var a;
4867
4885
  return (a = s.preferences) == null ? void 0 : a.textVisualOptions;
4868
4886
  }))
4869
4887
  return e;
4870
- const o = ye(e), r = At(o);
4888
+ const o = be(e), r = _t(o);
4871
4889
  for (let s = 0; s < r.length; s++) {
4872
- const a = Ma(
4890
+ const a = Oa(
4873
4891
  r[s],
4874
4892
  n[s],
4875
4893
  t,
@@ -4877,150 +4895,151 @@ function Va(e, t) {
4877
4895
  );
4878
4896
  (i = e.frames) != null && i.some(
4879
4897
  (c) => c.visualId && c.cards.some((l) => l.id === r[s].id)
4880
- ) && (r[s].linkedReferenceOverrides = Jr(
4898
+ ) && (r[s].linkedReferenceOverrides = ni(
4881
4899
  r[s].linkedReferenceOverrides,
4882
4900
  { inputAliases: a }
4883
4901
  ));
4884
4902
  }
4885
4903
  return o;
4886
4904
  }
4887
- function ka(e) {
4905
+ function Ea(e) {
4888
4906
  var n;
4889
4907
  const t = (n = e.sheets) == null ? void 0 : n.map(
4890
- (o) => Va(o, e)
4908
+ (o) => Aa(o, e)
4891
4909
  );
4892
4910
  return t && t.some((o, r) => o !== e.sheets[r]) ? { ...e, sheets: t } : e;
4893
4911
  }
4894
- function xa(e) {
4895
- const t = K(e);
4896
- return t.issues.length === 0 && !t.needsUpgrade ? e : t.issues.length ? t.toStoredDashboard() : K(
4897
- ka(e)
4912
+ function Ba(e) {
4913
+ const t = q(e);
4914
+ return t.issues.length === 0 && !t.needsUpgrade ? e : t.issues.length ? t.toStoredDashboard() : q(
4915
+ Ea(e)
4898
4916
  ).toStoredDashboard();
4899
4917
  }
4900
4918
  export {
4901
4919
  rt as $,
4902
- oo as A,
4903
- Da as B,
4904
- Wl as C,
4905
- ia as D,
4906
- Jn as E,
4907
- Jr as F,
4908
- Ya as G,
4909
- si as H,
4910
- Cs as I,
4911
- Mt as J,
4912
- gl as K,
4913
- Xr as L,
4914
- fl as M,
4915
- Ti as N,
4916
- Di as O,
4917
- Fi as P,
4918
- il as Q,
4919
- In as R,
4920
+ so as A,
4921
+ xa as B,
4922
+ tc as C,
4923
+ da as D,
4924
+ eo as E,
4925
+ ni as F,
4926
+ nl as G,
4927
+ di as H,
4928
+ Ts as I,
4929
+ Pt as J,
4930
+ vl as K,
4931
+ oi as L,
4932
+ hl as M,
4933
+ xi as N,
4934
+ Pi as O,
4935
+ Vi as P,
4936
+ dl as Q,
4937
+ Sn as R,
4920
4938
  Be as S,
4921
- el as T,
4922
- ss as U,
4923
- as as V,
4924
- ki as W,
4925
- U as X,
4926
- ul as Y,
4927
- Pi as Z,
4928
- dl as _,
4929
- qs as a,
4930
- bl as a$,
4939
+ sl as T,
4940
+ fs as U,
4941
+ ps as V,
4942
+ Ai as W,
4943
+ $ as X,
4944
+ yl as Y,
4945
+ Bi as Z,
4946
+ bl as _,
4947
+ Hs as a,
4948
+ tt as a$,
4931
4949
  ot as a0,
4932
- Rr as a1,
4933
- sl as a2,
4934
- cl as a3,
4935
- Mi as a4,
4936
- ol as a5,
4950
+ jr as a1,
4951
+ fl as a2,
4952
+ gl as a3,
4953
+ wi as a4,
4954
+ cl as a5,
4937
4955
  nt as a6,
4938
- Pn as a7,
4939
- Ul as a8,
4940
- ba as a9,
4941
- Gl as aA,
4942
- Ll as aB,
4943
- se as aC,
4944
- pn as aD,
4945
- Za as aE,
4946
- Xa as aF,
4947
- nl as aG,
4948
- ha as aH,
4949
- di as aI,
4950
- tl as aJ,
4951
- jl as aK,
4952
- un as aL,
4953
- al as aM,
4954
- Nl as aN,
4955
- Vl as aO,
4956
- Ts as aP,
4957
- ql as aQ,
4958
- Hn as aR,
4959
- Ke as aS,
4960
- rl as aT,
4961
- Ys as aU,
4962
- Un as aV,
4963
- Ye as aW,
4964
- ll as aX,
4965
- Il as aY,
4966
- vl as aZ,
4967
- tt as a_,
4968
- At as aa,
4969
- Ta as ab,
4970
- Ma as ac,
4971
- Va as ad,
4972
- _l as ae,
4973
- El as af,
4974
- On as ag,
4975
- Bl as ah,
4976
- _i as ai,
4977
- aa as aj,
4978
- $l as ak,
4979
- ta as al,
4980
- zl as am,
4981
- hl as an,
4982
- Hl as ao,
4983
- ds as ap,
4984
- fs as aq,
4985
- Ca as ar,
4986
- Sl as as,
4987
- Dl as at,
4988
- ms as au,
4989
- Re as av,
4990
- us as aw,
4991
- gs as ax,
4992
- Tl as ay,
4993
- xn as az,
4994
- pl as b,
4995
- Cl as b0,
4996
- Fl as b1,
4997
- cs as b2,
4998
- ne as b3,
4999
- xl as b4,
5000
- Kl as b5,
5001
- Rl as b6,
5002
- Ui as c,
5003
- na as d,
5004
- Wr as e,
5005
- yl as f,
5006
- Ml as g,
5007
- Al as h,
5008
- ml as i,
5009
- wl as j,
5010
- ye as k,
5011
- Ks as l,
5012
- Ql as m,
5013
- Ol as n,
4956
+ An as a7,
4957
+ Zl as a8,
4958
+ Sa as a9,
4959
+ On as aA,
4960
+ Yl as aB,
4961
+ Ul as aC,
4962
+ se as aD,
4963
+ yn as aE,
4964
+ il as aF,
4965
+ rl as aG,
4966
+ ll as aH,
4967
+ Da as aI,
4968
+ yi as aJ,
4969
+ al as aK,
4970
+ Ql as aL,
4971
+ pn as aM,
4972
+ pl as aN,
4973
+ $l as aO,
4974
+ Al as aP,
4975
+ ws as aQ,
4976
+ Hl as aR,
4977
+ Qn as aS,
4978
+ Ke as aT,
4979
+ ul as aU,
4980
+ na as aV,
4981
+ Wn as aW,
4982
+ Ye as aX,
4983
+ ml as aY,
4984
+ Ml as aZ,
4985
+ Vl as a_,
4986
+ _t as aa,
4987
+ wa as ab,
4988
+ Oa as ac,
4989
+ Aa as ad,
4990
+ Zi as ae,
4991
+ jl as af,
4992
+ Nl as ag,
4993
+ Bn as ah,
4994
+ Ll as ai,
4995
+ Li as aj,
4996
+ pa as ak,
4997
+ Xl as al,
4998
+ aa as am,
4999
+ Wl as an,
5000
+ Dl as ao,
5001
+ Jl as ap,
5002
+ bs as aq,
5003
+ hs as ar,
5004
+ Ta as as,
5005
+ Pl as at,
5006
+ xl as au,
5007
+ Is as av,
5008
+ Re as aw,
5009
+ ys as ax,
5010
+ vs as ay,
5011
+ wl as az,
5012
+ Cl as b,
5013
+ Sl as b0,
5014
+ Tl as b1,
5015
+ kl as b2,
5016
+ gs as b3,
5017
+ ne as b4,
5018
+ Bl as b5,
5019
+ Gl as b6,
5020
+ zl as b7,
5021
+ Ji as c,
5022
+ la as d,
5023
+ ei as e,
5024
+ Fl as f,
5025
+ Ol as g,
5026
+ ql as h,
5027
+ Il as i,
5028
+ Rl as j,
5029
+ be as k,
5030
+ Gs as l,
5031
+ ec as m,
5032
+ Kl as n,
5014
5033
  st as o,
5015
- kl as p,
5016
- Sa as q,
5017
- Pl as r,
5018
- hs as s,
5019
- Is as t,
5020
- Zr as u,
5021
- ni as v,
5022
- fn as w,
5023
- Ja as x,
5024
- ri as y,
5025
- xa as z
5034
+ El as p,
5035
+ Pa as q,
5036
+ _l as r,
5037
+ Ds as s,
5038
+ Ms as t,
5039
+ ri as u,
5040
+ ai as v,
5041
+ gn as w,
5042
+ ol as x,
5043
+ ci as y,
5044
+ Ba as z
5026
5045
  };