react-semaphor 0.1.560 → 0.1.561

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 (107) hide show
  1. package/dist/analytics-protocol/index.js +353 -349
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{analytics-base-schemas-CHLxsPfX.js → analytics-base-schemas-CB3oFAXk.js} +199 -171
  7. package/dist/chunks/{assistant-chat-Bu2fFm_I.js → assistant-chat-DiVHY3Hw.js} +27 -28
  8. package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
  9. package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
  10. package/dist/chunks/{braces-Da41xfUd.js → braces-u8VorWJc.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-4FNkMrzE.js → comparison-window-caption-DDsIWJYT.js} +108 -108
  12. package/dist/chunks/{context-BgPDzLHZ.js → context-TUjw9eqr.js} +1 -1
  13. package/dist/chunks/{custom-visual-inputs-Dz-enUNR.js → custom-visual-inputs-DfolidZ9.js} +1 -1
  14. package/dist/chunks/{dashboard-_MeBuy67.js → dashboard-BRdZBPqr.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CEi4Pr_v.js → dashboard-briefing-launcher-CgvTLndW.js} +161 -162
  16. package/dist/chunks/{dashboard-controls-Bi7fyG-4.js → dashboard-controls-B4vfSzTF.js} +881 -945
  17. package/dist/chunks/{dashboard-json-B1mU_OMa.js → dashboard-json-Y3MF59g7.js} +5 -5
  18. package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
  19. package/dist/chunks/{edit-dashboard-visual-0CJN31Y3.js → edit-dashboard-visual-DwjZcxj-.js} +6112 -6146
  20. package/dist/chunks/{filter-reach-copy-BF4w4kI2.js → filter-reach-copy-bijwf_-b.js} +1250 -1392
  21. package/dist/chunks/{filter-value-text-CRC-K_l_.js → filter-value-text-DFnhwuEW.js} +3 -3
  22. package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
  23. package/dist/chunks/{index-DtHidOPV.js → index-ClwbY3BL.js} +197 -198
  24. package/dist/chunks/{layout-grid-BvsH4RY2.js → layout-grid-CtvCBfOm.js} +1 -1
  25. package/dist/chunks/{list-filter-Dg0otx5E.js → list-filter-BklYgciR.js} +1 -1
  26. package/dist/chunks/{matrix-analytical-definition-CM18W8w6.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
  27. package/dist/chunks/{matrix-card-HPskLaPy.js → matrix-card-CUorIB7Q.js} +3 -3
  28. package/dist/chunks/{matrix-member-presentation-Bbrfrke4.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-WPv4R-H_.js → matrix-operation-contract-BSiGEXVC.js} +255 -248
  30. package/dist/chunks/{metric-comparison-ljMKYZKa.js → metric-comparison-95aC0uEO.js} +6 -6
  31. package/dist/chunks/{model-change-Ccn1zaxl.js → model-change-B5wQhg5G.js} +1 -1
  32. package/dist/chunks/{palette-Bsh376zO.js → palette-DTnMhipt.js} +1 -1
  33. package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
  34. package/dist/chunks/{pivot-result-identity-vS9TSh4f.js → pivot-result-identity-olvXJoB9.js} +1 -1
  35. package/dist/chunks/{report-preferences-dialog-BV8L0SeS.js → report-preferences-dialog-C2YUIwKG.js} +14 -14
  36. package/dist/chunks/{report-runtime-context-BZQh9ywy.js → report-runtime-context-DoIUr3MP.js} +2 -2
  37. package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
  38. package/dist/chunks/{save-B5EAsgQF.js → save-DH4RyrnG.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-n2Wn11cV.js → saved-dashboard-context-8jqfI7hI.js} +12 -12
  40. package/dist/chunks/{selection-reducer-D0YnaAD9.js → selection-reducer-CV7K4FI6.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-XLBLOJ2V.js → semaphor-ready-indicator-E2XWyibu.js} +30253 -31076
  42. package/dist/chunks/{shelf-drop-preview-context-DHMa54a-.js → shelf-drop-preview-context-C29EUzDp.js} +7 -7
  43. package/dist/chunks/{source-entity-resolution-dUG5VWRm.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
  44. package/dist/chunks/{switch-ByxH4M7t.js → switch-balDSHc7.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-C_GdeTYU.js → table-export-sheet-CK8tvh4d.js} +1 -1
  46. package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
  47. package/dist/chunks/{token-types-CQtXUVMy.js → token-types-DhYH5YKb.js} +1 -1
  48. package/dist/chunks/{upload-wbR-NVzq.js → upload-Ufj8vjyn.js} +1 -1
  49. package/dist/chunks/{use-create-flow-overlay-state-CEBaLOKC.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
  50. package/dist/chunks/{validators-CXTneCA4.js → validators-BtaCFIEB.js} +37 -37
  51. package/dist/chunks/{zoned-wall-clock-B1n_WjW3.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2400 -1856
  54. package/dist/data-app-sdk/index.js +20 -20
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +10 -10
  57. package/dist/format-utils/index.js +257 -256
  58. package/dist/index.js +214 -215
  59. package/dist/report-runtime-context/index.js +2 -2
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +2 -2
  62. package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
  63. package/dist/types/index.js +50 -51
  64. package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
  65. package/dist/types/lib/stores/editor-store.d.ts +9 -1
  66. package/dist/types/lib/stores/table-actions.d.ts +0 -2
  67. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +10 -0
  68. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
  69. package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
  70. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
  71. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
  72. package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
  73. package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
  74. package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
  75. package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
  76. package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
  77. package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
  78. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
  79. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
  80. package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
  81. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
  82. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
  83. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
  84. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
  85. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  86. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
  87. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +539 -22
  88. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
  89. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
  90. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +1 -8
  91. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  92. package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
  93. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
  94. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
  95. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
  96. package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
  97. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +8 -1
  98. package/dist/types/shared/format-utils/raw-temporal.d.ts +16 -0
  99. package/package.json +2 -2
  100. package/dist/chunks/bookmark-state-BFY9oNmr.js +0 -111
  101. package/dist/chunks/document-dashboard-inputs-CkWfDB8c.js +0 -3010
  102. package/dist/chunks/global-date-filter-utils-D8365uPH.js +0 -12889
  103. package/dist/chunks/pivot-result-contract-expectations-Bl5suy4-.js +0 -1832
  104. package/dist/chunks/raw-temporal-presentation-BHm7s-hz.js +0 -540
  105. package/dist/chunks/resolve-dashboard-input-context-CAMiWvyR.js +0 -5280
  106. package/dist/chunks/table-settings-Imz0FgWi.js +0 -637
  107. package/dist/chunks/temporal-input-presentation-uvNK_tM0.js +0 -3228
@@ -1,7 +1,7 @@
1
1
  import { z as t } from "zod";
2
- import { x as je, H as Fe, N as Le, P as Ue, V as qe, W as De, s as U, F as Z, n as Me, K as Ge, L as ce, g as Be, r as ze, G as Ve, y as We, z as Ke, b as le, C as Xe } from "./analytics-base-schemas-CHLxsPfX.js";
3
- import { R as w, K as ue, Y as B, a_ as ee, t as A, S as Ze, aU as $, M as $e, s as He, H as de, ag as Ye, r as Qe, m as Je } from "./validators-CXTneCA4.js";
4
- const H = {
2
+ import { x as je, K as Fe, U as Le, V as Ue, Y as qe, Z as De, s as U, I as Z, n as Me, P as Be, Q as ce, g as Ge, r as ze, J as Ve, B as We, C as Ke, b as le, F as Xe } from "./analytics-base-schemas-CB3oFAXk.js";
3
+ import { R as w, K as ue, Y as G, a_ as ee, t as A, S as Ze, aU as $, M as $e, s as Ye, H as de, ag as He, r as Qe, aj as Je, m as et } from "./validators-BtaCFIEB.js";
4
+ const Y = {
5
5
  answerSummary: "string",
6
6
  responseDetail: "responseDetail",
7
7
  mode: "string",
@@ -61,7 +61,7 @@ const H = {
61
61
  "timeout",
62
62
  "budget_exceeded",
63
63
  "cancelled"
64
- ], et = {
64
+ ], tt = {
65
65
  invalid_request: 400,
66
66
  missing_relationship: 400,
67
67
  ambiguous_relationship: 400,
@@ -74,29 +74,29 @@ const H = {
74
74
  timeout: 504,
75
75
  budget_exceeded: 413,
76
76
  cancelled: 499
77
- }, tt = /* @__PURE__ */ new Set(["execution_failed", "timeout"]);
78
- function nt(e) {
77
+ }, nt = /* @__PURE__ */ new Set(["execution_failed", "timeout"]);
78
+ function at(e) {
79
79
  return typeof e == "string" && me.includes(e);
80
80
  }
81
- function at(e, n, a = {}) {
81
+ function rt(e, n, a = {}) {
82
82
  return {
83
83
  code: e,
84
84
  message: n,
85
85
  ...a.details ? { details: a.details } : {},
86
86
  ...a.nextStep ? { nextStep: a.nextStep } : {},
87
- retryable: tt.has(e),
88
- status: a.status ?? et[e]
87
+ retryable: nt.has(e),
88
+ status: a.status ?? tt[e]
89
89
  };
90
90
  }
91
- function sn(e) {
91
+ function cn(e) {
92
92
  if (!e || typeof e != "object") return;
93
93
  const n = e.refusal ?? e;
94
94
  if (!n || typeof n != "object") return;
95
95
  const { code: a, message: r } = n;
96
- if (!(!nt(a) || typeof r != "string"))
96
+ if (!(!at(a) || typeof r != "string"))
97
97
  return n;
98
98
  }
99
- const rt = {
99
+ const st = {
100
100
  invalid_request: { message: "This query configuration cannot run.", nextStep: "Check the selected fields, filters and parameters." },
101
101
  missing_relationship: { message: "The selected data is not connected.", nextStep: "Choose related datasets or ask the owner to add a relationship." },
102
102
  ambiguous_relationship: { message: "The selected data has more than one relationship path.", nextStep: "Choose the relationship to use." },
@@ -110,29 +110,29 @@ const rt = {
110
110
  budget_exceeded: { message: "The query exceeds this view’s limits.", nextStep: "Request fewer rows, columns or measures." },
111
111
  cancelled: { message: "The query was cancelled.", nextStep: "Reload the view when ready." }
112
112
  };
113
- function on(e) {
114
- const n = rt[e.code], a = at(e.code, n.message, { nextStep: n.nextStep, status: e.status }), r = e.retryable ?? a.retryable;
113
+ function ln(e) {
114
+ const n = st[e.code], a = rt(e.code, n.message, { nextStep: n.nextStep, status: e.status }), r = e.retryable ?? a.retryable;
115
115
  return {
116
116
  ...a,
117
117
  retryable: r,
118
118
  ...!r && a.retryable ? { nextStep: "Ask the owner to check the query." } : {}
119
119
  };
120
120
  }
121
- const st = [
121
+ const ot = [
122
122
  ...me,
123
123
  "stale_cursor",
124
124
  "source_truncated"
125
- ], cn = Object.freeze({
125
+ ], un = Object.freeze({
126
126
  coordinates: 2e4,
127
127
  responseBytes: 5 * 1024 * 1024
128
- }), O = t.string().uuid(), y = t.string().min(1), ot = t.number().int().positive().max(Number.MAX_SAFE_INTEGER);
129
- function g(e, n, a) {
128
+ }), O = t.string().uuid(), y = t.string().min(1), it = t.number().int().positive().max(Number.MAX_SAFE_INTEGER);
129
+ function f(e, n, a) {
130
130
  e.addIssue({ code: "custom", path: n, message: a });
131
131
  }
132
132
  function v(e, n, a) {
133
- new Set(e).size !== e.length && g(n, a, "Duplicate identity.");
133
+ new Set(e).size !== e.length && f(n, a, "Duplicate identity.");
134
134
  }
135
- const it = t.object({
135
+ const ct = t.object({
136
136
  id: y,
137
137
  axis: ue,
138
138
  parent: w,
@@ -140,20 +140,20 @@ const it = t.object({
140
140
  t.object({ kind: t.literal("first") }).strict(),
141
141
  t.object({ kind: t.enum(["after", "before"]), cursor: y }).strict()
142
142
  ]),
143
- size: ot
143
+ size: it
144
144
  }).strict(), te = t.object({
145
145
  paths: t.array(w).readonly(),
146
146
  pageIds: t.array(y).readonly()
147
- }).strict(), ct = t.object({
147
+ }).strict(), lt = t.object({
148
148
  id: y,
149
149
  rows: te,
150
150
  columns: te,
151
151
  measureIds: t.array(O).min(1).readonly()
152
152
  }).strict(), pe = t.object({
153
- pages: t.array(it).readonly(),
154
- blocks: t.array(ct).readonly()
153
+ pages: t.array(ct).readonly(),
154
+ blocks: t.array(lt).readonly()
155
155
  }).strict().superRefine((e, n) => {
156
- !e.pages.length && !e.blocks.length && g(n, [], "Request at least one page or block."), v(
156
+ !e.pages.length && !e.blocks.length && f(n, [], "Request at least one page or block."), v(
157
157
  [...e.pages, ...e.blocks].map((a) => a.id),
158
158
  n,
159
159
  []
@@ -164,13 +164,13 @@ const it = t.object({
164
164
  for (const s of a[r].pageIds)
165
165
  e.pages.some(
166
166
  (c) => c.id === s && c.axis === r
167
- ) || g(
167
+ ) || f(
168
168
  n,
169
169
  ["blocks", a.id, r],
170
170
  "Page reference must name a page on this axis in this operation."
171
171
  );
172
172
  }
173
- }), ln = t.object({ spec: B, request: pe }).strict().superRefine(({ spec: e, request: n }, a) => {
173
+ }), dn = t.object({ spec: G, request: pe }).strict().superRefine(({ spec: e, request: n }, a) => {
174
174
  for (const r of n.pages)
175
175
  ee(
176
176
  e,
@@ -179,18 +179,18 @@ const it = t.object({
179
179
  a,
180
180
  ["pages", r.id],
181
181
  !0
182
- ), r.parent.length >= e[r.axis].length && g(
182
+ ), r.parent.length >= e[r.axis].length && f(
183
183
  a,
184
184
  ["pages", r.id],
185
185
  "Cannot request children of a leaf or empty axis."
186
186
  );
187
187
  for (const r of n.blocks) {
188
- r.measureIds.some((s) => !e.measures.some((c) => c.id === s)) && g(a, ["blocks", r.id], "Unknown block measure.");
188
+ r.measureIds.some((s) => !e.measures.some((c) => c.id === s)) && f(a, ["blocks", r.id], "Unknown block measure.");
189
189
  for (const s of ["rows", "columns"])
190
190
  for (const c of r[s].paths)
191
191
  ee(e, s, c, a, ["blocks", r.id, s]);
192
192
  }
193
- }), lt = t.object({
193
+ }), ut = t.object({
194
194
  requestId: y,
195
195
  axis: ue,
196
196
  parent: w,
@@ -199,44 +199,44 @@ const it = t.object({
199
199
  after: y.nullable(),
200
200
  exactCount: t.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()
201
201
  }).strict().superRefine((e, n) => {
202
- e.parent.some((r) => r.member.kind === "others") && g(n, ["parent"], "Others has no children.");
202
+ e.parent.some((r) => r.member.kind === "others") && f(n, ["parent"], "Others has no children.");
203
203
  const a = e.members.filter(
204
204
  ({ path: r }) => {
205
205
  var s;
206
206
  return ((s = r[r.length - 1]) == null ? void 0 : s.member.kind) === "others";
207
207
  }
208
208
  );
209
- a.length > 1 && g(n, ["members"], "A page may contain Others only once."), a.length && (e.members[e.members.length - 1] !== a[0] && g(n, ["members"], "Others must be the last page member."), e.after !== null && g(n, ["after"], "Others must end the branch.")), new Set(
209
+ a.length > 1 && f(n, ["members"], "A page may contain Others only once."), a.length && (e.members[e.members.length - 1] !== a[0] && f(n, ["members"], "Others must be the last page member."), e.after !== null && f(n, ["after"], "Others must end the branch.")), new Set(
210
210
  e.members.map(
211
211
  (r) => {
212
212
  var s;
213
213
  return (s = r.path[r.path.length - 1]) == null ? void 0 : s.levelId;
214
214
  }
215
215
  )
216
- ).size > 1 && g(n, ["members"], "One page must contain one child level."), v(
216
+ ).size > 1 && f(n, ["members"], "One page must contain one child level."), v(
217
217
  e.members.map((r) => A(r.path)),
218
218
  n,
219
219
  ["members"]
220
220
  );
221
221
  for (const r of e.members)
222
- (r.path.length !== e.parent.length + 1 || A(r.path.slice(0, -1)) !== A(e.parent)) && g(n, ["members"], "Page members must be immediate children.");
222
+ (r.path.length !== e.parent.length + 1 || A(r.path.slice(0, -1)) !== A(e.parent)) && f(n, ["members"], "Page members must be immediate children.");
223
223
  }), he = t.object({
224
224
  rowPaths: t.array(w).readonly(),
225
225
  columnPaths: t.array(w).readonly(),
226
226
  measureIds: t.array(O).readonly()
227
227
  }).strict();
228
- function ge(e, n) {
228
+ function fe(e, n) {
229
229
  const a = e.rowPaths.map(A), r = e.columnPaths.map(A);
230
230
  return v(a, n, ["coverage", "rowPaths"]), v(r, n, ["coverage", "columnPaths"]), v(e.measureIds, n, ["coverage", "measureIds"]), { rows: a, columns: r };
231
231
  }
232
- const ut = t.object({
232
+ const dt = t.object({
233
233
  requestId: y,
234
234
  coverage: he,
235
235
  cells: t.array(
236
236
  Ze.extend({ value: $ }).strict()
237
237
  ).readonly()
238
238
  }).strict().superRefine((e, n) => {
239
- const { rows: a, columns: r } = ge(e.coverage, n), s = new Set(a), c = new Set(r), i = new Set(e.coverage.measureIds);
239
+ const { rows: a, columns: r } = fe(e.coverage, n), s = new Set(a), c = new Set(r), i = new Set(e.coverage.measureIds);
240
240
  v(
241
241
  e.cells.map(
242
242
  (l) => JSON.stringify([
@@ -249,34 +249,34 @@ const ut = t.object({
249
249
  ["cells"]
250
250
  );
251
251
  for (const l of e.cells)
252
- (!s.has(A(l.rowPath)) || !c.has(A(l.columnPath)) || !i.has(l.measureId)) && g(n, ["cells"], "Cell is outside certified coverage.");
253
- }), q = t.number().int().nonnegative(), dt = t.object({
252
+ (!s.has(A(l.rowPath)) || !c.has(A(l.columnPath)) || !i.has(l.measureId)) && f(n, ["cells"], "Cell is outside certified coverage.");
253
+ }), q = t.number().int().nonnegative(), mt = t.object({
254
254
  requestId: y,
255
255
  coverage: he,
256
256
  values: t.array(
257
257
  t.tuple([q, q, q, $]).readonly()
258
258
  ).readonly()
259
259
  }).strict().superRefine((e, n) => {
260
- ge(e.coverage, n);
260
+ fe(e.coverage, n);
261
261
  const { rowPaths: a, columnPaths: r, measureIds: s } = e.coverage, c = /* @__PURE__ */ new Set();
262
262
  for (const [i, l, m] of e.values) {
263
263
  if (i >= a.length || l >= r.length || m >= s.length) {
264
- g(n, ["values"], "Cell is outside certified coverage.");
264
+ f(n, ["values"], "Cell is outside certified coverage.");
265
265
  continue;
266
266
  }
267
267
  const o = `${i},${l},${m}`;
268
- c.has(o) && g(n, ["values"], "Duplicate identity."), c.add(o);
268
+ c.has(o) && f(n, ["values"], "Duplicate identity."), c.add(o);
269
269
  }
270
270
  }), ne = t.object({
271
271
  id: O,
272
272
  column: Fe,
273
273
  nativeDataType: y,
274
274
  semanticFormat: je.optional()
275
- }).strict(), fe = t.object({
275
+ }).strict(), ge = t.object({
276
276
  levels: t.array(ne).readonly(),
277
277
  measures: t.array(ne).readonly()
278
- }).strict(), Y = t.object({
279
- code: t.enum(st),
278
+ }).strict(), H = t.object({
279
+ code: t.enum(ot),
280
280
  message: y,
281
281
  /** Technical cause for dashboard owners; never shown as the primary copy. */
282
282
  detail: y.optional(),
@@ -288,18 +288,18 @@ const ut = t.object({
288
288
  t.object({ kind: t.literal("operation") }).strict(),
289
289
  t.object({ kind: t.enum(["page", "block"]), requestId: y }).strict()
290
290
  ])
291
- }).strict(), mt = t.object({
291
+ }).strict(), pt = t.object({
292
292
  dialect: t.enum(["postgres", "clickhouse", "duckdb", "snowflake"]),
293
293
  aggregates: t.array($e).readonly()
294
294
  }).strict();
295
295
  function ye(e) {
296
296
  return t.object({
297
297
  queryIdentity: y,
298
- descriptors: fe,
299
- capabilities: mt,
300
- pages: t.array(lt).readonly(),
298
+ descriptors: ge,
299
+ capabilities: pt,
300
+ pages: t.array(ut).readonly(),
301
301
  blocks: t.array(e).readonly(),
302
- failures: t.array(Y).readonly()
302
+ failures: t.array(H).readonly()
303
303
  }).strict().superRefine((n, a) => {
304
304
  const r = new Set(
305
305
  n.descriptors.levels.map((i) => i.id)
@@ -310,12 +310,12 @@ function ye(e) {
310
310
  ...i.members.map((l) => l.path)
311
311
  ]);
312
312
  for (const i of n.blocks)
313
- c.push(...i.coverage.rowPaths, ...i.coverage.columnPaths), i.coverage.measureIds.some((l) => !s.has(l)) && g(
313
+ c.push(...i.coverage.rowPaths, ...i.coverage.columnPaths), i.coverage.measureIds.some((l) => !s.has(l)) && f(
314
314
  a,
315
315
  ["blocks", i.requestId],
316
316
  "Coverage references an unknown measure descriptor."
317
317
  );
318
- c.some((i) => i.some((l) => !r.has(l.levelId))) && g(
318
+ c.some((i) => i.some((l) => !r.has(l.levelId))) && f(
319
319
  a,
320
320
  ["descriptors"],
321
321
  "Acquired paths require level descriptors."
@@ -338,7 +338,7 @@ function ye(e) {
338
338
  );
339
339
  for (const i of n.failures)
340
340
  if (i.scope.kind === "operation")
341
- g(
341
+ f(
342
342
  a,
343
343
  ["failures"],
344
344
  "Operation failure cannot accompany acquired data."
@@ -347,7 +347,7 @@ function ye(e) {
347
347
  const l = i.scope.requestId;
348
348
  [...n.pages, ...n.blocks].some(
349
349
  (m) => m.requestId === l
350
- ) && g(
350
+ ) && f(
351
351
  a,
352
352
  ["failures"],
353
353
  "A requested unit cannot both succeed and fail."
@@ -356,9 +356,9 @@ function ye(e) {
356
356
  });
357
357
  }
358
358
  const Se = ye(
359
- ut
360
- ), pt = ye(
361
359
  dt
360
+ ), ht = ye(
361
+ mt
362
362
  );
363
363
  function be(e) {
364
364
  return t.union([
@@ -366,24 +366,24 @@ function be(e) {
366
366
  status: t.enum(["success", "partial"]),
367
367
  window: e
368
368
  }).strict(),
369
- t.object({ status: t.literal("failed"), failure: Y }).strict()
369
+ t.object({ status: t.literal("failed"), failure: H }).strict()
370
370
  ]).superRefine((n, a) => {
371
371
  const r = n;
372
372
  if (r.status === "failed") return;
373
373
  const { window: s } = r;
374
- !s.pages.length && !s.blocks.length && g(
374
+ !s.pages.length && !s.blocks.length && f(
375
375
  a,
376
376
  ["window"],
377
377
  "A window outcome requires successful acquired work."
378
- ), r.status === "success" != (s.failures.length === 0) && g(a, ["status"], "Status must match failure coverage.");
378
+ ), r.status === "success" != (s.failures.length === 0) && f(a, ["status"], "Status must match failure coverage.");
379
379
  });
380
380
  }
381
- const un = be(
381
+ const mn = be(
382
382
  Se
383
- ), dn = be(
384
- pt
383
+ ), pn = be(
384
+ ht
385
385
  );
386
- function ht(e) {
386
+ function ft(e) {
387
387
  const { rowPaths: n, columnPaths: a, measureIds: r } = e.coverage, s = (m) => new Map(m.map((o, d) => [o, d])), c = s(n.map(A)), i = s(a.map(A)), l = s(r);
388
388
  return {
389
389
  requestId: e.requestId,
@@ -409,19 +409,19 @@ function gt(e) {
409
409
  }))
410
410
  };
411
411
  }
412
- function ft(e) {
413
- return { ...e, blocks: e.blocks.map(ht) };
412
+ function yt(e) {
413
+ return { ...e, blocks: e.blocks.map(ft) };
414
414
  }
415
- function mn(e) {
415
+ function hn(e) {
416
416
  return { ...e, blocks: e.blocks.map(gt) };
417
417
  }
418
- function pn(e) {
419
- return e.status === "failed" ? e : { status: e.status, window: ft(e.window) };
418
+ function fn(e) {
419
+ return e.status === "failed" ? e : { status: e.status, window: yt(e.window) };
420
420
  }
421
421
  const Ae = t.object({
422
422
  kind: t.literal("matrix"),
423
423
  window: Se
424
- }).strict(), Ie = t.enum(["member", "subtotal", "grand_total"]), yt = t.discriminatedUnion("kind", [
424
+ }).strict(), Ie = t.enum(["member", "subtotal", "grand_total"]), St = t.discriminatedUnion("kind", [
425
425
  t.object({ kind: t.literal("hierarchy"), label: t.string() }).strict(),
426
426
  t.object({ kind: t.literal("level"), levelId: O, label: t.string() }).strict(),
427
427
  t.object({
@@ -431,9 +431,9 @@ const Ae = t.object({
431
431
  role: Ie,
432
432
  label: t.string()
433
433
  }).strict()
434
- ]), St = t.object({
435
- columns: t.array(yt).readonly(),
436
- descriptors: fe
434
+ ]), bt = t.object({
435
+ columns: t.array(St).readonly(),
436
+ descriptors: ge
437
437
  }).strict(), ae = t.union([
438
438
  t.object({
439
439
  kind: t.literal("value"),
@@ -442,7 +442,7 @@ const Ae = t.object({
442
442
  )
443
443
  }).strict(),
444
444
  t.object({ kind: t.enum(["null", "empty"]) }).strict()
445
- ]), bt = t.discriminatedUnion("kind", [
445
+ ]), At = t.discriminatedUnion("kind", [
446
446
  t.object({
447
447
  kind: t.literal("layout"),
448
448
  rowPath: w,
@@ -455,24 +455,24 @@ const Ae = t.object({
455
455
  columnPath: w,
456
456
  values: t.array(ae).readonly()
457
457
  }).strict()
458
- ]), hn = t.discriminatedUnion("kind", [
458
+ ]), gn = t.discriminatedUnion("kind", [
459
459
  t.object({
460
460
  kind: t.literal("layout"),
461
- layout: St,
461
+ layout: bt,
462
462
  next: y
463
463
  }).strict(),
464
464
  t.object({
465
465
  kind: t.literal("rows"),
466
- rows: t.array(bt).readonly(),
466
+ rows: t.array(At).readonly(),
467
467
  next: y.nullable()
468
468
  }).strict()
469
- ]), At = t.union([
469
+ ]), It = t.union([
470
470
  Le,
471
471
  Ue,
472
472
  qe,
473
473
  De,
474
474
  Ae
475
- ]), It = t.object({
475
+ ]), _t = t.object({
476
476
  status: t.enum([
477
477
  "not_required",
478
478
  "resolved",
@@ -547,7 +547,7 @@ const Ae = t.object({
547
547
  }).passthrough(), we = t.object({
548
548
  answeredObligations: t.array(t.string()),
549
549
  missingObligations: t.array(t.string()),
550
- warnings: t.array(Ge).optional()
550
+ warnings: t.array(Be).optional()
551
551
  }).passthrough(), ve = t.object({
552
552
  intentId: t.string().optional(),
553
553
  queryId: t.string().optional(),
@@ -564,17 +564,17 @@ const Ae = t.object({
564
564
  intent: t.unknown().optional(),
565
565
  compiledQuery: t.unknown().optional(),
566
566
  fieldsUsed: t.array(Z).optional(),
567
- result: At.optional(),
567
+ result: It.optional(),
568
568
  validation: ce,
569
569
  coverage: we.optional(),
570
570
  missingFields: t.array(t.string()).optional(),
571
571
  warnings: t.array(t.string()).optional(),
572
- relationshipDiagnostics: It.optional(),
572
+ relationshipDiagnostics: _t.optional(),
573
573
  diagnosticFeedback: _e.optional(),
574
574
  population: ke.optional(),
575
575
  metadata: t.record(t.string(), t.unknown()).optional()
576
- }).passthrough(), _t = ve;
577
- function kt(e) {
576
+ }).passthrough(), kt = ve;
577
+ function wt(e) {
578
578
  switch (e) {
579
579
  case "boolean":
580
580
  return t.boolean().optional();
@@ -587,7 +587,7 @@ function kt(e) {
587
587
  case "executionFieldArray":
588
588
  return t.array(Z).optional();
589
589
  case "executionResult":
590
- return _t.optional();
590
+ return kt.optional();
591
591
  case "number":
592
592
  return t.number().finite().optional();
593
593
  case "population":
@@ -595,7 +595,7 @@ function kt(e) {
595
595
  case "record":
596
596
  return ze.optional();
597
597
  case "recordArray":
598
- return Be.optional();
598
+ return Ge.optional();
599
599
  case "responseDetail":
600
600
  return t.enum(["compact", "standard", "debug"]).optional();
601
601
  case "string":
@@ -610,49 +610,49 @@ function kt(e) {
610
610
  return ce.optional();
611
611
  }
612
612
  }
613
- const wt = Object.fromEntries(
614
- Object.entries(H).map(
615
- ([e, n]) => [e, kt(n)]
613
+ const vt = Object.fromEntries(
614
+ Object.entries(Y).map(
615
+ ([e, n]) => [e, wt(n)]
616
616
  )
617
- ), vt = t.object(wt).strict(), Tt = new Set(
618
- Object.keys(H)
617
+ ), Tt = t.object(vt).strict(), Et = new Set(
618
+ Object.keys(Y)
619
619
  );
620
- function gn() {
620
+ function yn() {
621
621
  return Object.keys(
622
- H
622
+ Y
623
623
  );
624
624
  }
625
- function Et(e) {
626
- return Tt.has(e);
625
+ function Rt(e) {
626
+ return Et.has(e);
627
627
  }
628
- function fn(e) {
628
+ function Sn(e) {
629
629
  if (!e || typeof e != "object" || Array.isArray(e))
630
630
  throw new Error("Semaphor analyze result must be an object.");
631
631
  const a = Object.keys(e).filter(
632
- (r) => !Et(r)
632
+ (r) => !Rt(r)
633
633
  );
634
634
  if (a.length)
635
635
  throw new Error(
636
636
  `Semaphor analyze result contains unsupported top-level field(s): ${a.join(", ")}.`
637
637
  );
638
- return vt.parse(e);
638
+ return Tt.parse(e);
639
639
  }
640
640
  const Te = 100, F = "selection:";
641
641
  function Ee(e) {
642
642
  return [
643
643
  de(e.source),
644
- Ye(e.name),
644
+ He(e.name),
645
645
  e.sourceField ?? ""
646
646
  ].join("::");
647
647
  }
648
- function yn(e) {
648
+ function bn(e) {
649
649
  return `${F}${e}`;
650
650
  }
651
- function Rt(e) {
651
+ function Ct(e) {
652
652
  return e.startsWith(F) && e.length > F.length;
653
653
  }
654
- function Sn(e) {
655
- return Rt(e) ? e.slice(F.length) : void 0;
654
+ function An(e) {
655
+ return Ct(e) ? e.slice(F.length) : void 0;
656
656
  }
657
657
  function Re(e) {
658
658
  if (!e) return "";
@@ -664,7 +664,7 @@ function Re(e) {
664
664
  n ? [n.kind, n.yearStartMonth] : null
665
665
  ]);
666
666
  }
667
- function Ct(e) {
667
+ function Nt(e) {
668
668
  return JSON.stringify([
669
669
  Ee(e.field),
670
670
  e.operator,
@@ -673,7 +673,7 @@ function Ct(e) {
673
673
  ]);
674
674
  }
675
675
  function se(e) {
676
- return JSON.stringify(e.conditions.map(Ct).sort());
676
+ return JSON.stringify(e.conditions.map(Nt).sort());
677
677
  }
678
678
  function z(e) {
679
679
  return JSON.stringify([
@@ -689,7 +689,7 @@ function oe(e) {
689
689
  e.conditions.map(z).sort()
690
690
  );
691
691
  }
692
- function bn(e) {
692
+ function In(e) {
693
693
  const n = e.map((a) => a.id);
694
694
  if (new Set(n).size !== n.length)
695
695
  throw new Error("Data App selections require one active selection per id.");
@@ -714,23 +714,23 @@ function bn(e) {
714
714
  function D(e, n) {
715
715
  return e < n ? -1 : e > n ? 1 : 0;
716
716
  }
717
- function An(e, n) {
717
+ function _n(e, n) {
718
718
  return se(e) === se(n);
719
719
  }
720
- const Nt = "(Blank)";
721
- function In(e) {
722
- return e.conditions.map((n) => n.label ? n.label : n.operator === "isNull" || n.value === null ? Nt : String(n.value)).join(" · ");
720
+ const Ot = "(Blank)";
721
+ function kn(e) {
722
+ return e.conditions.map((n) => n.label ? n.label : n.operator === "isNull" || n.value === null ? Ot : String(n.value)).join(" · ");
723
723
  }
724
- const Ot = t.union([
724
+ const xt = t.union([
725
725
  We,
726
726
  Ke
727
- ]), xt = t.object({
727
+ ]), Pt = t.object({
728
728
  name: t.string().min(1),
729
- source: Ot,
729
+ source: xt,
730
730
  dataType: t.enum(["string", "number", "boolean", "date", "datetime"]),
731
731
  sourceField: t.string().min(1).optional()
732
- }).strict(), Pt = t.object({
733
- field: xt,
732
+ }).strict(), jt = t.object({
733
+ field: Pt,
734
734
  operator: t.enum(["=", "isNull"]),
735
735
  value: t.union([t.string(), t.number().finite(), t.null()]),
736
736
  label: t.string().optional(),
@@ -741,8 +741,8 @@ const Ot = t.union([
741
741
  message: "isNull carries a null value, and only isNull does.",
742
742
  path: ["value"]
743
743
  });
744
- }), jt = t.object({
745
- conditions: t.array(Pt).min(1)
744
+ }), Ft = t.object({
745
+ conditions: t.array(jt).min(1)
746
746
  }).strict().superRefine((e, n) => {
747
747
  const a = e.conditions.map((r) => Ee(r.field));
748
748
  new Set(a).size !== a.length && n.addIssue({
@@ -750,11 +750,11 @@ const Ot = t.union([
750
750
  message: "A tuple holds one condition per field.",
751
751
  path: ["conditions"]
752
752
  });
753
- }), _n = t.object({
753
+ }), wn = t.object({
754
754
  kind: t.literal("selection"),
755
755
  sourceCardId: t.string().min(1),
756
- tuples: t.array(jt).min(1).max(Te)
757
- }).strict(), Ft = t.object({
756
+ tuples: t.array(Ft).min(1).max(Te)
757
+ }).strict(), Lt = t.object({
758
758
  field: Xe,
759
759
  operator: t.enum(["=", "isNull"]),
760
760
  value: t.union([t.string(), t.number().finite(), t.null()]),
@@ -765,34 +765,34 @@ const Ot = t.union([
765
765
  message: "isNull carries a null value, and only isNull does.",
766
766
  path: ["value"]
767
767
  });
768
- }), Lt = t.object({
769
- conditions: t.array(Ft).min(1)
768
+ }), Ut = t.object({
769
+ conditions: t.array(Lt).min(1)
770
770
  }).strict().superRefine((e, n) => {
771
771
  for (let a = 0; a < e.conditions.length; a += 1) {
772
772
  const r = e.conditions[a];
773
773
  e.conditions.findIndex(
774
- (c, i) => i < a && He(c.field, r.field)
774
+ (c, i) => i < a && Ye(c.field, r.field)
775
775
  ) !== -1 && n.addIssue({
776
776
  code: t.ZodIssueCode.custom,
777
777
  message: "A selection tuple can contain only one condition per field.",
778
778
  path: ["conditions", a, "field"]
779
779
  });
780
780
  }
781
- }), kn = t.object({
781
+ }), vn = t.object({
782
782
  id: t.string().min(1),
783
- tuples: t.array(Lt).min(1).max(Te)
784
- }).strict(), Ut = t.object({ key: t.string().min(1), nativeText: t.string().nullable() }).strict(), qt = t.object({
783
+ tuples: t.array(Ut).min(1).max(Te)
784
+ }).strict(), qt = t.object({ key: t.string().min(1), nativeText: t.string().nullable() }).strict(), Dt = t.object({
785
785
  executionInstant: t.string().refine((e) => Qe(e) !== null, {
786
786
  message: "executionInstant must be an ISO instant"
787
787
  }),
788
- dataAnchors: t.array(Ut).default([])
788
+ dataAnchors: t.array(qt).default([])
789
789
  }).strict().refine(
790
790
  (e) => new Set(e.dataAnchors.map((n) => n.key)).size === e.dataAnchors.length,
791
791
  { message: "dataAnchors keys must be unique", path: ["dataAnchors"] }
792
792
  );
793
- function wn(e) {
793
+ function Tn(e) {
794
794
  if (e == null) return;
795
- const n = qt.safeParse(e);
795
+ const n = Dt.safeParse(e);
796
796
  return n.success ? n.data : void 0;
797
797
  }
798
798
  const Ce = {
@@ -859,10 +859,10 @@ const Ce = {
859
859
  COLLECT_SET: "other",
860
860
  FIRST: "other",
861
861
  LAST: "other"
862
- }, Dt = /(?:_AGG$|^APPROX_[A-Z0-9_]+$|^COUNT_DISTINCT$|^HLL_(?:COUNT|ESTIMATE)$|^REGR_[A-Z_]+$)/;
863
- function Mt(e) {
862
+ }, Mt = /(?:_AGG$|^APPROX_[A-Z0-9_]+$|^COUNT_DISTINCT$|^HLL_(?:COUNT|ESTIMATE)$|^REGR_[A-Z_]+$)/;
863
+ function Bt(e) {
864
864
  const n = e.toUpperCase();
865
- return n in Ce || Dt.test(n);
865
+ return n in Ce || Mt.test(n);
866
866
  }
867
867
  function Ne(e, n = !1) {
868
868
  const a = Ce[e.toUpperCase()] ?? "other";
@@ -883,7 +883,7 @@ const Gt = /* @__PURE__ */ new Set([
883
883
  "CAST",
884
884
  "TRY_CAST",
885
885
  "SAFE_CAST"
886
- ]), Bt = /* @__PURE__ */ new Set(["DECIMAL", "NUMERIC", "INTEGER", "INT", "BIGINT", "FLOAT", "DOUBLE", "REAL", "VARCHAR", "TEXT"]), ie = /[A-Za-z_]/, zt = /[A-Za-z0-9_]/;
886
+ ]), zt = /* @__PURE__ */ new Set(["DECIMAL", "NUMERIC", "INTEGER", "INT", "BIGINT", "FLOAT", "DOUBLE", "REAL", "VARCHAR", "TEXT"]), ie = /[A-Za-z_]/, Vt = /[A-Za-z0-9_]/;
887
887
  function V(e, n) {
888
888
  const a = e[n];
889
889
  let r = n + 1;
@@ -920,12 +920,12 @@ function j(e, n) {
920
920
  }
921
921
  function M(e, n) {
922
922
  let a = n + 1;
923
- for (; a < e.length && zt.test(e[a]); ) a += 1;
923
+ for (; a < e.length && Vt.test(e[a]); ) a += 1;
924
924
  return a;
925
925
  }
926
- const Vt = /\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
927
- function Wt(e) {
928
- return Array.from(e.matchAll(Vt), (n) => n[1]);
926
+ const Wt = /\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
927
+ function Kt(e) {
928
+ return Array.from(e.matchAll(Wt), (n) => n[1]);
929
929
  }
930
930
  function W(e, n = /* @__PURE__ */ new Set()) {
931
931
  const a = [], r = [];
@@ -947,11 +947,11 @@ function W(e, n = /* @__PURE__ */ new Set()) {
947
947
  }
948
948
  if (ie.test(m)) {
949
949
  const o = M(e, l), d = e.slice(l, o), p = j(e, o);
950
- if (e[p] === "(" && Mt(d)) {
951
- let f = P(e, p);
952
- const I = f - 1;
953
- let R = f;
954
- const T = e.slice(p + 1, f - 1);
950
+ if (e[p] === "(" && Bt(d)) {
951
+ let g = P(e, p);
952
+ const I = g - 1;
953
+ let R = g;
954
+ const T = e.slice(p + 1, g - 1);
955
955
  let x = T.trim() ? 1 : 0;
956
956
  for (let h = p + 1; h < R - 1; h++)
957
957
  e[h] === "'" || e[h] === '"' ? h = V(e, h) - 1 : e[h] === "(" ? h = P(e, h) - 1 : e[h] === "," && x++;
@@ -959,18 +959,18 @@ function W(e, n = /* @__PURE__ */ new Set()) {
959
959
  W(C ? T.replace(/^\s*DISTINCT\b/i, "") : T).calls.length > 0 && (s = !0);
960
960
  let b = !1, _ = !1;
961
961
  for (; ; ) {
962
- const h = j(e, f);
962
+ const h = j(e, g);
963
963
  if (!ie.test(e[h] || "")) break;
964
964
  const N = M(e, h), E = e.slice(h, N).toUpperCase(), u = j(e, N);
965
965
  if (E === "WITHIN") {
966
966
  const S = M(e, u), k = j(e, S);
967
967
  if (e.slice(u, S).toUpperCase() === "GROUP" && e[k] === "(") {
968
- f = P(e, k), R = f;
968
+ g = P(e, k), R = g;
969
969
  continue;
970
970
  }
971
971
  }
972
972
  if ((E === "FILTER" || E === "OVER") && e[u] === "(") {
973
- b = b || E === "OVER", _ = _ || E === "FILTER", f = P(e, u);
973
+ b = b || E === "OVER", _ = _ || E === "FILTER", g = P(e, u);
974
974
  continue;
975
975
  }
976
976
  break;
@@ -980,11 +980,11 @@ function W(e, n = /* @__PURE__ */ new Set()) {
980
980
  kind: Ne(d, C),
981
981
  distinct: C,
982
982
  windowed: b,
983
- tokens: Wt(e.slice(p, f)),
983
+ tokens: Kt(e.slice(p, g)),
984
984
  span: { start: l, end: R, argumentStart: p + 1, argumentEnd: I },
985
985
  argumentCount: x,
986
986
  filtered: _
987
- }), c += `@${a.length - 1}`, l = f;
987
+ }), c += `@${a.length - 1}`, l = g;
988
988
  continue;
989
989
  }
990
990
  c += e.slice(l, o), l = o;
@@ -997,11 +997,11 @@ function W(e, n = /* @__PURE__ */ new Set()) {
997
997
  nestedAggregate: s,
998
998
  windowed: a.some((m) => m.windowed),
999
999
  tokensOutsideAggregates: r,
1000
- aggregateInputsComplete: i && Kt(c, n),
1000
+ aggregateInputsComplete: i && Xt(c, n),
1001
1001
  skeleton: c
1002
1002
  };
1003
1003
  }
1004
- function Kt(e, n) {
1004
+ function Xt(e, n) {
1005
1005
  var m;
1006
1006
  const a = [];
1007
1007
  let r = 0;
@@ -1038,7 +1038,7 @@ function Kt(e, n) {
1038
1038
  return s++, !0;
1039
1039
  if (!Gt.has(o) || (s++, !c("(") || !i())) return !1;
1040
1040
  if (["CAST", "TRY_CAST", "SAFE_CAST"].includes(o)) {
1041
- if (!c("AS") || !Bt.has(a[s++]) || (c("PRECISION"), c("(") && (!/^\d+$/.test(a[s++] || "") || c(",") && !/^\d+$/.test(a[s++] || "") || !c(")"))))
1041
+ if (!c("AS") || !zt.has(a[s++]) || (c("PRECISION"), c("(") && (!/^\d+$/.test(a[s++] || "") || c(",") && !/^\d+$/.test(a[s++] || "") || !c(")"))))
1042
1042
  return !1;
1043
1043
  } else
1044
1044
  for (; c(","); ) if (!i()) return !1;
@@ -1046,7 +1046,7 @@ function Kt(e, n) {
1046
1046
  };
1047
1047
  return i() && s === a.length;
1048
1048
  }
1049
- function Xt(e) {
1049
+ function Zt(e) {
1050
1050
  const n = [];
1051
1051
  let a = 0;
1052
1052
  for (; a < e.length; ) {
@@ -1090,8 +1090,8 @@ function Xt(e) {
1090
1090
  }
1091
1091
  return n;
1092
1092
  }
1093
- function Zt(e) {
1094
- const n = Xt(e), a = n.some((o) => o.type === "op" && o.value === "/");
1093
+ function $t(e) {
1094
+ const n = Zt(e), a = n.some((o) => o.type === "op" && o.value === "/");
1095
1095
  if (n.some((o) => o.type === "other"))
1096
1096
  return { kind: "other", hasDivision: a };
1097
1097
  let r = 0, s = !0;
@@ -1103,9 +1103,9 @@ function Zt(e) {
1103
1103
  if (!(I && I.type === "op" && (I.value === "+" || I.value === "-"))) break;
1104
1104
  r += 1;
1105
1105
  }
1106
- const f = i();
1107
- if (!f) return null;
1108
- d === void 0 ? d = f.degree : d !== f.degree && (s = !1), o = o.concat(f.units), p = !1;
1106
+ const g = i();
1107
+ if (!g) return null;
1108
+ d === void 0 ? d = g.degree : d !== g.degree && (s = !1), o = o.concat(g.units), p = !1;
1109
1109
  }
1110
1110
  return { degree: d ?? 0, units: o };
1111
1111
  }, i = () => {
@@ -1167,7 +1167,7 @@ function xe(e) {
1167
1167
  return { kind: "none", reason: "other" };
1168
1168
  }
1169
1169
  }
1170
- function $t(e) {
1170
+ function Yt(e) {
1171
1171
  var n, a;
1172
1172
  return ((n = e.derivedField) == null ? void 0 : n.computeStage) || ((a = e.calculatedFormula) == null ? void 0 : a.computeStage);
1173
1173
  }
@@ -1194,7 +1194,7 @@ function X(e) {
1194
1194
  unresolved: !1
1195
1195
  };
1196
1196
  }
1197
- function G(e, n) {
1197
+ function B(e, n) {
1198
1198
  var r;
1199
1199
  const a = (r = n.derivedField) == null ? void 0 : r.aggregationBehavior;
1200
1200
  return !a || e.unresolved ? e : a === "additive" ? e.reaggregation.kind === "additive" ? e : { ...e, reaggregation: { kind: "additive" } } : { ...e, reaggregation: { kind: "none", reason: "declared" } };
@@ -1208,13 +1208,13 @@ function Ht(e, n) {
1208
1208
  const a = K(e.aggregate);
1209
1209
  return a ? X(a) : "raw";
1210
1210
  }
1211
- const Yt = 12;
1211
+ const Qt = 12;
1212
1212
  function J(e, n) {
1213
1213
  var E;
1214
- if (n > Yt) return Q;
1214
+ if (n > Qt) return Q;
1215
1215
  const a = typeof e.expression == "string" ? e.expression.trim() : "";
1216
1216
  if (!a)
1217
- return G(
1217
+ return B(
1218
1218
  X(K(e.aggregate) ?? "sum"),
1219
1219
  e
1220
1220
  );
@@ -1233,17 +1233,17 @@ function J(e, n) {
1233
1233
  })
1234
1234
  ), m = Array.from(i.values()).filter(
1235
1235
  (u) => u !== "raw"
1236
- ), o = Array.from(i.values()).some((u) => u === "raw"), d = r.calls.length > 0 || m.length > 0 || $t(e) === "aggregate" || !!e.isPreAggregated, p = new Set(
1236
+ ), o = Array.from(i.values()).some((u) => u === "raw"), d = r.calls.length > 0 || m.length > 0 || Yt(e) === "aggregate" || !!e.isPreAggregated, p = new Set(
1237
1237
  [...i].filter(
1238
1238
  ([u, S]) => S === "raw" ? !d && !!c(u) : !S.unresolved
1239
1239
  ).map(([u]) => u)
1240
- ), f = W(a, p).aggregateInputsComplete;
1240
+ ), g = W(a, p).aggregateInputsComplete;
1241
1241
  if (!d) {
1242
- if (!f) return Pe;
1242
+ if (!g) return Pe;
1243
1243
  const u = K(e.aggregate);
1244
- return u ? G(X(u), e) : "row_input";
1244
+ return u ? B(X(u), e) : "row_input";
1245
1245
  }
1246
- const I = !f || o || r.nestedAggregate || l || m.some((u) => u.unresolved) || r.calls.length === 0 && m.length === 0, R = [
1246
+ const I = !g || o || r.nestedAggregate || l || m.some((u) => u.unresolved) || r.calls.length === 0 && m.length === 0, R = [
1247
1247
  ...r.calls.map((u) => ({ kind: u.kind, distinct: u.distinct })),
1248
1248
  ...m.flatMap((u) => u.calls)
1249
1249
  ], T = r.windowed || m.some((u) => u.windowed), x = !I && !T && R.every((u) => Oe.has(u.kind)), C = (u) => {
@@ -1253,7 +1253,7 @@ function J(e, n) {
1253
1253
  }
1254
1254
  const S = i.get(u.token);
1255
1255
  return S && S !== "raw" ? S.reaggregation : { kind: "none", reason: "unresolved" };
1256
- }, b = Zt(r.skeleton);
1256
+ }, b = $t(r.skeleton);
1257
1257
  let _, h, N = "numeric";
1258
1258
  if (I)
1259
1259
  _ = { kind: "none", reason: "unresolved" }, h = "unresolved";
@@ -1268,7 +1268,7 @@ function J(e, n) {
1268
1268
  h = u.identity, N = u.outputType;
1269
1269
  }
1270
1270
  else b.kind === "linear" ? (_ = b.units.every((S) => C(S).kind === "additive") ? { kind: "additive" } : { kind: "none", reason: "other" }, h = "linear") : (_ = { kind: "none", reason: b.hasDivision ? "ratio" : "other" }, h = b.hasDivision ? "ratio" : "expression");
1271
- return G(
1271
+ return B(
1272
1272
  {
1273
1273
  stage: "aggregate",
1274
1274
  calls: R,
@@ -1282,106 +1282,113 @@ function J(e, n) {
1282
1282
  e
1283
1283
  );
1284
1284
  }
1285
- function vn(e) {
1285
+ function Jt(e) {
1286
1286
  const n = J(e, 0);
1287
1287
  return n === "row_input" ? Pe : n;
1288
1288
  }
1289
- const Qt = t.object({
1290
- intent: Je,
1289
+ function En(e) {
1290
+ const n = Je((e == null ? void 0 : e.dataType) || "number");
1291
+ if (!e) return n;
1292
+ const a = Jt(e);
1293
+ return a.unresolved || a.outputType === "input" ? n : "number";
1294
+ }
1295
+ const en = t.object({
1296
+ intent: et,
1291
1297
  matrixWindowRequest: pe
1292
- }).strict(), Jt = t.object({
1293
- runtimeFilters: B.innerType().shape.filters,
1294
- runtimeSorts: B.innerType().shape.sorts.optional()
1298
+ }).strict(), tn = t.object({
1299
+ runtimeFilters: G.innerType().shape.filters,
1300
+ runtimeSorts: G.innerType().shape.sorts.optional()
1295
1301
  });
1296
- function Tn(e) {
1297
- return Jt.parse(e);
1302
+ function Rn(e) {
1303
+ return tn.parse(e);
1298
1304
  }
1299
- const en = {
1305
+ const nn = {
1300
1306
  // A window executes a governed statement set, not one compiled query.
1301
1307
  compiledQuery: t.never().optional(),
1302
- intent: Qt.shape.intent,
1308
+ intent: en.shape.intent,
1303
1309
  resultShape: t.literal("matrix"),
1304
1310
  result: Ae.optional(),
1305
- metadata: t.object({ rowLimitExceeded: t.boolean(), matrixFailure: Y.optional() }).passthrough()
1306
- }, tn = ve.extend(en), En = tn.superRefine((e, n) => {
1311
+ metadata: t.object({ rowLimitExceeded: t.boolean(), matrixFailure: H.optional() }).passthrough()
1312
+ }, an = ve.extend(nn), Cn = an.superRefine((e, n) => {
1307
1313
  e.status === "failed" == !!e.result && n.addIssue({ code: "custom", message: "Only answered or partial Matrix execution carries a window." }), e.result && e.status === "partial" != e.result.window.failures.length > 0 && n.addIssue({ code: "custom", message: "Matrix execution status must match acquired window failures." });
1308
1314
  });
1309
1315
  export {
1310
- lt as $,
1311
- An as A,
1312
- In as B,
1313
- xt as C,
1314
- Pt as D,
1315
- jt as E,
1316
- Ft as F,
1317
- Lt as G,
1318
- qt as H,
1319
- wn as I,
1320
- Mt as J,
1316
+ dn as $,
1317
+ kn as A,
1318
+ Pt as B,
1319
+ jt as C,
1320
+ Ft as D,
1321
+ wn as E,
1322
+ Lt as F,
1323
+ Ut as G,
1324
+ Dt as H,
1325
+ Tn as I,
1326
+ Bt as J,
1321
1327
  Ne as K,
1322
1328
  W as L,
1323
- Zt as M,
1324
- vn as N,
1325
- me as O,
1326
- nt as P,
1329
+ $t as M,
1330
+ Jt as N,
1331
+ En as O,
1332
+ me as P,
1327
1333
  at as Q,
1328
- sn as R,
1334
+ rt as R,
1329
1335
  Te as S,
1330
- on as T,
1331
- st as U,
1332
- cn as V,
1333
- it as W,
1334
- te as X,
1335
- ct as Y,
1336
- pe as Z,
1337
- ln as _,
1338
- kn as a,
1336
+ cn as T,
1337
+ ln as U,
1338
+ ot as V,
1339
+ un as W,
1340
+ ct as X,
1341
+ te as Y,
1342
+ lt as Z,
1343
+ pe as _,
1344
+ vn as a,
1339
1345
  ut as a0,
1340
1346
  dt as a1,
1341
- ne as a2,
1342
- Y as a3,
1343
- mt as a4,
1344
- Se as a5,
1345
- pt as a6,
1346
- un as a7,
1347
- dn as a8,
1348
- ht as a9,
1349
- gt as aa,
1350
- ft as ab,
1351
- mn as ac,
1352
- pn as ad,
1353
- yt as ae,
1347
+ mt as a2,
1348
+ ne as a3,
1349
+ H as a4,
1350
+ pt as a5,
1351
+ Se as a6,
1352
+ ht as a7,
1353
+ mn as a8,
1354
+ pn as a9,
1355
+ ft as aa,
1356
+ gt as ab,
1357
+ yt as ac,
1358
+ hn as ad,
1359
+ fn as ae,
1354
1360
  St as af,
1355
- ae as ag,
1356
- bt as ah,
1357
- hn as ai,
1358
- Jt as aj,
1359
- Tn as ak,
1360
- En as al,
1361
- Qt as am,
1362
- _n as b,
1363
- bn as c,
1364
- Sn as d,
1365
- H as e,
1366
- At as f,
1367
- gn as g,
1368
- It as h,
1369
- Et as i,
1370
- _e as j,
1371
- ke as k,
1372
- we as l,
1373
- ve as m,
1374
- _t as n,
1375
- wt as o,
1376
- fn as p,
1377
- vt as q,
1378
- Ae as r,
1361
+ bt as ag,
1362
+ ae as ah,
1363
+ At as ai,
1364
+ gn as aj,
1365
+ tn as ak,
1366
+ Rn as al,
1367
+ Cn as am,
1368
+ en as an,
1369
+ Y as b,
1370
+ In as c,
1371
+ It as d,
1372
+ _t as e,
1373
+ _e as f,
1374
+ yn as g,
1375
+ ke as h,
1376
+ Rt as i,
1377
+ we as j,
1378
+ ve as k,
1379
+ kt as l,
1380
+ vt as m,
1381
+ Tt as n,
1382
+ Ae as o,
1383
+ Sn as p,
1384
+ Ee as q,
1385
+ bn as r,
1379
1386
  se as s,
1380
- Ee as t,
1381
- yn as u,
1382
- Rt as v,
1383
- Re as w,
1384
- Ct as x,
1385
- z as y,
1386
- oe as z
1387
+ Ct as t,
1388
+ An as u,
1389
+ Re as v,
1390
+ Nt as w,
1391
+ z as x,
1392
+ oe as y,
1393
+ _n as z
1387
1394
  };