react-semaphor 0.1.526 → 0.1.527

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 (175) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1179 -296
  3. package/dist/brand-studio/index.js +15 -15
  4. package/dist/briefings/index.js +50 -49
  5. package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DEhjPSr-.js} +66 -65
  6. package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BlIbwkuD.js} +68 -65
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-JNHR0_cZ.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-D9pFByPh.js} +372 -359
  10. package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-CJI5ZWMq.js} +739 -686
  11. package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DLdrFry-.js} +10 -10
  12. package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-D5LjWle1.js} +6603 -6572
  13. package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-G91NQKxU.js} +266 -267
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-DeVQLIsP.js} +19 -19
  15. package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
  16. package/dist/chunks/{index-CbjuruKe.js → index-BvJOYbNv.js} +755 -745
  17. package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
  18. package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DY45yiUM.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BypfLZsK.js} +11 -11
  20. package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
  21. package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-BoKU3MzZ.js} +655 -511
  22. package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
  23. package/dist/chunks/matrix-operation-contract-BV02rLhu.js +809 -0
  24. package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
  25. package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
  26. package/dist/chunks/pivot-header-presentation-D5v8uyjj.js +618 -0
  27. package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-BWrPhlGT.js} +259 -204
  29. package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
  30. package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
  31. package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
  32. package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-D3hxu4sE.js} +131 -132
  33. package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
  34. package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-C7Um5XN-.js} +47 -26
  35. package/dist/chunks/semantic-format-BjBMOSoo.js +192 -0
  36. package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-D46I_4g7.js} +49895 -46141
  37. package/dist/chunks/{slider-BYIH4icg.js → slider-B6LELqx6.js} +81 -82
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/switch-_7uBAbYx.js +24003 -0
  40. package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
  41. package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
  42. package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
  43. package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
  44. package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
  45. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  46. package/dist/dashboard/index.js +1 -1
  47. package/dist/dashboard-authoring/index.js +138 -137
  48. package/dist/data-app-sdk/index.js +12 -12
  49. package/dist/data-app-sdk-adapters/index.js +23 -22
  50. package/dist/data-app-sdk-validation/index.js +27 -26
  51. package/dist/format-utils/index.js +247 -329
  52. package/dist/index.js +165 -168
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +1 -1
  56. package/dist/types/briefings/index.d.ts +3 -0
  57. package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
  58. package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
  59. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  60. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
  61. package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
  62. package/dist/types/components/surfboard/filter/types.d.ts +8 -29
  63. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
  64. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
  65. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
  66. package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
  67. package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
  68. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  69. package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
  70. package/dist/types/index.js +5 -5
  71. package/dist/types/lib/api/exports-api.d.ts +3 -0
  72. package/dist/types/lib/csv-download.d.ts +9 -0
  73. package/dist/types/lib/csv-encoding-options.d.ts +6 -0
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
  75. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
  76. package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
  77. package/dist/types/lib/export-utils.d.ts +17 -15
  78. package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
  79. package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
  80. package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
  81. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
  83. package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
  84. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
  85. package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
  86. package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
  87. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
  88. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
  89. package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
  90. package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
  91. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  92. package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
  93. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
  94. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
  95. package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
  96. package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
  97. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
  98. package/dist/types/lib/types/common-types.d.ts +5 -0
  99. package/dist/types/lib/types/explorer-types.d.ts +14 -0
  100. package/dist/types/lib/types/token-types.d.ts +0 -1
  101. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  102. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  103. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  104. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  105. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  106. package/dist/types/shared/analytics-protocol/contracts.d.ts +10 -7
  107. package/dist/types/shared/analytics-protocol/index.d.ts +12 -1
  108. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  109. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  110. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  111. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +51 -5
  112. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  113. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  114. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  115. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  116. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  117. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  118. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  119. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  120. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  121. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  122. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  123. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  124. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  125. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  126. package/dist/types/shared/temporal/index.d.ts +5 -0
  127. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  128. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  129. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  130. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  131. package/package.json +1 -17
  132. package/src/data-app-sdk/README.md +6 -3
  133. package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
  134. package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
  135. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  136. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  137. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  138. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  139. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  140. package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
  141. package/dist/chunks/search-CJz-QQ0Q.js +0 -24
  142. package/dist/chunks/switch-XaAACBrJ.js +0 -2234
  143. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  144. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  145. package/dist/data-app-builder/index.js +0 -3666
  146. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  147. package/dist/data-app-codegen/index.js +0 -22
  148. package/dist/data-app-codegen-node/index.js +0 -1807
  149. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  150. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  151. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  152. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  153. package/dist/types/data-app-builder/constants.d.ts +0 -14
  154. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  155. package/dist/types/data-app-builder/index.d.ts +0 -1
  156. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  157. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  158. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  159. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  160. package/dist/types/data-app-builder/types.d.ts +0 -558
  161. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  162. package/dist/types/data-app-builder.d.ts +0 -2
  163. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  164. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  165. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  166. package/dist/types/data-app-codegen/index.d.ts +0 -6
  167. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  168. package/dist/types/data-app-codegen/node.d.ts +0 -2
  169. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  170. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  171. package/dist/types/data-app-codegen-node.d.ts +0 -2
  172. package/dist/types/data-app-codegen.d.ts +0 -2
  173. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  174. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  175. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -0,0 +1,809 @@
1
+ import { z as e } from "zod";
2
+ import { a5 as p, $ as T, aa as k, bl as E, B as m, a6 as te, bf as x, bm as se, aX as re, a0 as ne, b0 as oe, b1 as ie, b4 as ce, b5 as le, aQ as S, aV as A, aK as ue, a_ as me, a$ as M, aH as de, aG as pe, aW as he, aN as ge, aO as ye, w as z, aS as fe, s as be, q as B, E as Se, A as Ie, m as we } from "./validators-CQcG0EPN.js";
3
+ const j = {
4
+ answerSummary: "string",
5
+ responseDetail: "responseDetail",
6
+ mode: "string",
7
+ comparisonKind: "string",
8
+ executionResult: "executionResult",
9
+ compiledQuery: "unknown",
10
+ data: "unknown",
11
+ resultSets: "record",
12
+ analysisWarnings: "unknownArray",
13
+ columns: "unknownArray",
14
+ records: "recordArray",
15
+ rowCount: "number",
16
+ rowLimitExceeded: "boolean",
17
+ output: "string",
18
+ querySpec: "unknown",
19
+ metadata: "record",
20
+ validation: "validationResult",
21
+ coverage: "coverage",
22
+ diagnosticFeedback: "diagnosticFeedback",
23
+ missingFields: "stringArray",
24
+ warnings: "unknownArray",
25
+ comparison: "unknown",
26
+ population: "population",
27
+ comparisons: "recordArray",
28
+ fieldsUsed: "compactExecutionFieldArray",
29
+ primary: "recordArray",
30
+ contributors: "recordArray",
31
+ segments: "recordArray",
32
+ periodChanges: "recordArray",
33
+ changes: "recordArray",
34
+ largestNegativeChanges: "recordArray",
35
+ largestPositiveChanges: "recordArray",
36
+ drivers: "recordArray",
37
+ absoluteDeltaDrivers: "recordArray",
38
+ largestNegativeDrivers: "recordArray",
39
+ largestPositiveDrivers: "recordArray",
40
+ periodRows: "recordArray",
41
+ sql: "unknown",
42
+ omitted: "stringArray"
43
+ }, ia = Object.freeze({
44
+ coordinates: 2e4,
45
+ responseBytes: 5 * 1024 * 1024
46
+ }), y = e.string().uuid(), u = e.string().min(1), ke = e.number().int().positive().max(Number.MAX_SAFE_INTEGER);
47
+ function l(a, t, s) {
48
+ a.addIssue({ code: "custom", path: t, message: s });
49
+ }
50
+ function h(a, t, s) {
51
+ new Set(a).size !== a.length && l(t, s, "Duplicate identity.");
52
+ }
53
+ const ve = e.object({
54
+ id: u,
55
+ axis: T,
56
+ parent: p,
57
+ position: e.union([
58
+ e.object({ kind: e.literal("first") }).strict(),
59
+ e.object({ kind: e.enum(["after", "before"]), cursor: u }).strict()
60
+ ]),
61
+ size: ke
62
+ }).strict(), P = e.object({
63
+ paths: e.array(p).readonly(),
64
+ pageIds: e.array(u).readonly()
65
+ }).strict(), xe = e.object({
66
+ id: u,
67
+ rows: P,
68
+ columns: P,
69
+ measureIds: e.array(y).min(1).readonly()
70
+ }).strict(), D = e.object({
71
+ pages: e.array(ve).readonly(),
72
+ blocks: e.array(xe).readonly()
73
+ }).strict().superRefine((a, t) => {
74
+ !a.pages.length && !a.blocks.length && l(t, [], "Request at least one page or block."), h(
75
+ [...a.pages, ...a.blocks].map((s) => s.id),
76
+ t,
77
+ []
78
+ );
79
+ for (const s of a.blocks) {
80
+ h(s.measureIds, t, ["blocks", s.id, "measureIds"]);
81
+ for (const r of ["rows", "columns"])
82
+ for (const n of s[r].pageIds)
83
+ a.pages.some(
84
+ (i) => i.id === n && i.axis === r
85
+ ) || l(
86
+ t,
87
+ ["blocks", s.id, r],
88
+ "Page reference must name a page on this axis in this operation."
89
+ );
90
+ }
91
+ }), ca = e.object({ spec: k, request: D }).strict().superRefine(({ spec: a, request: t }, s) => {
92
+ for (const r of t.pages)
93
+ E(
94
+ a,
95
+ r.axis,
96
+ r.parent,
97
+ s,
98
+ ["pages", r.id],
99
+ !0
100
+ ), r.parent.length >= a[r.axis].length && l(
101
+ s,
102
+ ["pages", r.id],
103
+ "Cannot request children of a leaf or empty axis."
104
+ );
105
+ for (const r of t.blocks) {
106
+ r.measureIds.some((n) => !a.measures.some((i) => i.id === n)) && l(s, ["blocks", r.id], "Unknown block measure.");
107
+ for (const n of ["rows", "columns"])
108
+ for (const i of r[n].paths)
109
+ E(a, n, i, s, ["blocks", r.id, n]);
110
+ }
111
+ }), Ae = e.object({
112
+ requestId: u,
113
+ axis: T,
114
+ parent: p,
115
+ members: e.array(e.object({ path: p }).strict()).readonly(),
116
+ before: u.nullable(),
117
+ after: u.nullable(),
118
+ exactCount: e.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()
119
+ }).strict().superRefine((a, t) => {
120
+ a.parent.some((r) => r.member.kind === "others") && l(t, ["parent"], "Others has no children.");
121
+ const s = a.members.filter(
122
+ ({ path: r }) => {
123
+ var n;
124
+ return ((n = r[r.length - 1]) == null ? void 0 : n.member.kind) === "others";
125
+ }
126
+ );
127
+ s.length > 1 && l(t, ["members"], "A page may contain Others only once."), s.length && (a.members[a.members.length - 1] !== s[0] && l(t, ["members"], "Others must be the last page member."), a.after !== null && l(t, ["after"], "Others must end the branch.")), new Set(
128
+ a.members.map(
129
+ (r) => {
130
+ var n;
131
+ return (n = r.path[r.path.length - 1]) == null ? void 0 : n.levelId;
132
+ }
133
+ )
134
+ ).size > 1 && l(t, ["members"], "One page must contain one child level."), h(
135
+ a.members.map((r) => m(r.path)),
136
+ t,
137
+ ["members"]
138
+ );
139
+ for (const r of a.members)
140
+ (r.path.length !== a.parent.length + 1 || m(r.path.slice(0, -1)) !== m(a.parent)) && l(t, ["members"], "Page members must be immediate children.");
141
+ }), L = e.object({
142
+ rowPaths: e.array(p).readonly(),
143
+ columnPaths: e.array(p).readonly(),
144
+ measureIds: e.array(y).readonly()
145
+ }).strict();
146
+ function W(a, t) {
147
+ const s = a.rowPaths.map(m), r = a.columnPaths.map(m);
148
+ return h(s, t, ["coverage", "rowPaths"]), h(r, t, ["coverage", "columnPaths"]), h(a.measureIds, t, ["coverage", "measureIds"]), { rows: s, columns: r };
149
+ }
150
+ const je = e.object({
151
+ requestId: u,
152
+ coverage: L,
153
+ cells: e.array(
154
+ te.extend({ value: x }).strict()
155
+ ).readonly()
156
+ }).strict().superRefine((a, t) => {
157
+ const { rows: s, columns: r } = W(a.coverage, t), n = new Set(s), i = new Set(r), o = new Set(a.coverage.measureIds);
158
+ h(
159
+ a.cells.map(
160
+ (c) => JSON.stringify([
161
+ m(c.rowPath),
162
+ m(c.columnPath),
163
+ c.measureId
164
+ ])
165
+ ),
166
+ t,
167
+ ["cells"]
168
+ );
169
+ for (const c of a.cells)
170
+ (!n.has(m(c.rowPath)) || !i.has(m(c.columnPath)) || !o.has(c.measureId)) && l(t, ["cells"], "Cell is outside certified coverage.");
171
+ }), I = e.number().int().nonnegative(), Re = e.object({
172
+ requestId: u,
173
+ coverage: L,
174
+ values: e.array(
175
+ e.tuple([I, I, I, x]).readonly()
176
+ ).readonly()
177
+ }).strict().superRefine((a, t) => {
178
+ W(a.coverage, t);
179
+ const { rowPaths: s, columnPaths: r, measureIds: n } = a.coverage, i = /* @__PURE__ */ new Set();
180
+ for (const [o, c, d] of a.values) {
181
+ if (o >= s.length || c >= r.length || d >= n.length) {
182
+ l(t, ["values"], "Cell is outside certified coverage.");
183
+ continue;
184
+ }
185
+ const g = `${o},${c},${d}`;
186
+ i.has(g) && l(t, ["values"], "Duplicate identity."), i.add(g);
187
+ }
188
+ }), _ = e.object({
189
+ id: y,
190
+ column: re,
191
+ nativeDataType: u,
192
+ semanticFormat: se.optional()
193
+ }).strict(), K = e.object({
194
+ levels: e.array(_).readonly(),
195
+ measures: e.array(_).readonly()
196
+ }).strict(), R = e.object({
197
+ code: e.enum([
198
+ "invalid_request",
199
+ "unsupported_capability",
200
+ "stale_cursor",
201
+ "forbidden",
202
+ "budget_exceeded",
203
+ "source_truncated",
204
+ "execution_failed",
205
+ "cancelled"
206
+ ]),
207
+ message: u,
208
+ /** Technical cause for dashboard owners; never shown as the primary copy. */
209
+ detail: u.optional(),
210
+ retryable: e.boolean(),
211
+ scope: e.union([
212
+ e.object({ kind: e.literal("operation") }).strict(),
213
+ e.object({ kind: e.enum(["page", "block"]), requestId: u }).strict()
214
+ ])
215
+ }).strict(), Ce = e.object({
216
+ dialect: e.enum(["postgres", "clickhouse", "duckdb"]),
217
+ aggregates: e.array(ne).readonly()
218
+ }).strict();
219
+ function U(a) {
220
+ return e.object({
221
+ queryIdentity: u,
222
+ descriptors: K,
223
+ capabilities: Ce,
224
+ pages: e.array(Ae).readonly(),
225
+ blocks: e.array(a).readonly(),
226
+ failures: e.array(R).readonly()
227
+ }).strict().superRefine((t, s) => {
228
+ const r = new Set(
229
+ t.descriptors.levels.map((o) => o.id)
230
+ ), n = new Set(
231
+ t.descriptors.measures.map((o) => o.id)
232
+ ), i = t.pages.flatMap((o) => [
233
+ o.parent,
234
+ ...o.members.map((c) => c.path)
235
+ ]);
236
+ for (const o of t.blocks)
237
+ i.push(...o.coverage.rowPaths, ...o.coverage.columnPaths), o.coverage.measureIds.some((c) => !n.has(c)) && l(
238
+ s,
239
+ ["blocks", o.requestId],
240
+ "Coverage references an unknown measure descriptor."
241
+ );
242
+ i.some((o) => o.some((c) => !r.has(c.levelId))) && l(
243
+ s,
244
+ ["descriptors"],
245
+ "Acquired paths require level descriptors."
246
+ ), h(
247
+ [...t.descriptors.levels, ...t.descriptors.measures].map(
248
+ (o) => o.id
249
+ ),
250
+ s,
251
+ ["descriptors"]
252
+ ), h(
253
+ [...t.pages, ...t.blocks].map((o) => o.requestId),
254
+ s,
255
+ []
256
+ ), h(
257
+ t.failures.map(
258
+ (o) => o.scope.kind === "operation" ? "operation" : o.scope.requestId
259
+ ),
260
+ s,
261
+ ["failures"]
262
+ );
263
+ for (const o of t.failures)
264
+ if (o.scope.kind === "operation")
265
+ l(
266
+ s,
267
+ ["failures"],
268
+ "Operation failure cannot accompany acquired data."
269
+ );
270
+ else {
271
+ const c = o.scope.requestId;
272
+ [...t.pages, ...t.blocks].some(
273
+ (d) => d.requestId === c
274
+ ) && l(
275
+ s,
276
+ ["failures"],
277
+ "A requested unit cannot both succeed and fail."
278
+ );
279
+ }
280
+ });
281
+ }
282
+ const $ = U(
283
+ je
284
+ ), Ee = U(
285
+ Re
286
+ );
287
+ function V(a) {
288
+ return e.union([
289
+ e.object({
290
+ status: e.enum(["success", "partial"]),
291
+ window: a
292
+ }).strict(),
293
+ e.object({ status: e.literal("failed"), failure: R }).strict()
294
+ ]).superRefine((t, s) => {
295
+ const r = t;
296
+ if (r.status === "failed") return;
297
+ const { window: n } = r;
298
+ !n.pages.length && !n.blocks.length && l(
299
+ s,
300
+ ["window"],
301
+ "A window outcome requires successful acquired work."
302
+ ), r.status === "success" != (n.failures.length === 0) && l(s, ["status"], "Status must match failure coverage.");
303
+ });
304
+ }
305
+ const la = V(
306
+ $
307
+ ), ua = V(
308
+ Ee
309
+ );
310
+ function Pe(a) {
311
+ const { rowPaths: t, columnPaths: s, measureIds: r } = a.coverage, n = (d) => new Map(d.map((g, f) => [g, f])), i = n(t.map(m)), o = n(s.map(m)), c = n(r);
312
+ return {
313
+ requestId: a.requestId,
314
+ coverage: a.coverage,
315
+ values: a.cells.map((d) => {
316
+ const g = i.get(m(d.rowPath)), f = o.get(m(d.columnPath)), C = c.get(d.measureId);
317
+ if (g === void 0 || f === void 0 || C === void 0)
318
+ throw new Error("Cell is outside certified coverage.");
319
+ return [g, f, C, d.value];
320
+ })
321
+ };
322
+ }
323
+ function _e(a) {
324
+ const { rowPaths: t, columnPaths: s, measureIds: r } = a.coverage;
325
+ return {
326
+ requestId: a.requestId,
327
+ coverage: a.coverage,
328
+ cells: a.values.map(([n, i, o, c]) => ({
329
+ rowPath: t[n],
330
+ columnPath: s[i],
331
+ measureId: r[o],
332
+ value: c
333
+ }))
334
+ };
335
+ }
336
+ function qe(a) {
337
+ return { ...a, blocks: a.blocks.map(Pe) };
338
+ }
339
+ function ma(a) {
340
+ return { ...a, blocks: a.blocks.map(_e) };
341
+ }
342
+ function da(a) {
343
+ return a.status === "failed" ? a : { status: a.status, window: qe(a.window) };
344
+ }
345
+ const J = e.object({
346
+ kind: e.literal("matrix"),
347
+ window: $
348
+ }).strict(), Z = e.enum(["member", "subtotal", "grand_total"]), Fe = e.discriminatedUnion("kind", [
349
+ e.object({ kind: e.literal("hierarchy"), label: e.string() }).strict(),
350
+ e.object({ kind: e.literal("level"), levelId: y, label: e.string() }).strict(),
351
+ e.object({
352
+ kind: e.literal("measure"),
353
+ measureId: y,
354
+ columnPath: p,
355
+ role: Z,
356
+ label: e.string()
357
+ }).strict()
358
+ ]), Ne = e.object({
359
+ columns: e.array(Fe).readonly(),
360
+ descriptors: K
361
+ }).strict(), q = e.union([
362
+ e.object({
363
+ kind: e.literal("value"),
364
+ value: x.refine(
365
+ (a) => a !== null
366
+ )
367
+ }).strict(),
368
+ e.object({ kind: e.enum(["null", "empty"]) }).strict()
369
+ ]), Oe = e.discriminatedUnion("kind", [
370
+ e.object({
371
+ kind: e.literal("layout"),
372
+ rowPath: p,
373
+ role: Z,
374
+ values: e.array(q).readonly()
375
+ }).strict(),
376
+ e.object({
377
+ kind: e.literal("flat"),
378
+ rowPath: p,
379
+ columnPath: p,
380
+ values: e.array(q).readonly()
381
+ }).strict()
382
+ ]), pa = e.discriminatedUnion("kind", [
383
+ e.object({
384
+ kind: e.literal("layout"),
385
+ layout: Ne,
386
+ next: u
387
+ }).strict(),
388
+ e.object({
389
+ kind: e.literal("rows"),
390
+ rows: e.array(Oe).readonly(),
391
+ next: u.nullable()
392
+ }).strict()
393
+ ]), Te = e.union([
394
+ oe,
395
+ ie,
396
+ ce,
397
+ le,
398
+ J
399
+ ]), Me = e.object({
400
+ status: e.enum([
401
+ "not_required",
402
+ "resolved",
403
+ "missing",
404
+ "ambiguous",
405
+ "fanout_risk",
406
+ "unknown"
407
+ ]),
408
+ requiredSources: e.array(S).optional(),
409
+ relationshipsUsed: e.array(e.string()).optional(),
410
+ missingSources: e.array(e.string()).optional(),
411
+ warnings: e.array(e.string()).optional(),
412
+ message: e.string().optional(),
413
+ recommendedNextStep: e.string().optional(),
414
+ joinPlanSummary: e.object({
415
+ baseSource: S.optional(),
416
+ joinedSources: e.array(S).optional(),
417
+ joinCount: e.number().optional()
418
+ }).passthrough().optional(),
419
+ fanoutRisk: e.object({
420
+ status: e.enum(["none", "warning", "error", "unknown"]),
421
+ message: e.string().optional()
422
+ }).passthrough().optional()
423
+ }).passthrough(), F = e.enum([
424
+ "ambiguous_fields",
425
+ "empty_result",
426
+ "missing_grounded_fields",
427
+ "missing_relationship",
428
+ "no_grounded_query",
429
+ "partial_result",
430
+ "presentation_incomplete",
431
+ "query_validation_failed",
432
+ "unsafe_join"
433
+ ]), X = e.object({
434
+ version: e.literal(1),
435
+ status: e.enum(["answered", "partial", "blocked"]),
436
+ summary: e.string(),
437
+ answered: e.array(
438
+ e.object({
439
+ slotId: e.string().optional(),
440
+ queryId: e.string().optional(),
441
+ summary: e.string(),
442
+ evidenceIds: e.array(e.string()).optional(),
443
+ fieldsUsed: e.array(A).optional()
444
+ }).passthrough()
445
+ ),
446
+ blocked: e.array(
447
+ e.object({
448
+ slotId: e.string().optional(),
449
+ queryId: e.string().optional(),
450
+ reasonCode: F,
451
+ message: e.string(),
452
+ missingFields: e.array(e.string()).optional(),
453
+ availableFields: e.array(e.string()).optional(),
454
+ ambiguousFields: e.array(e.string()).optional(),
455
+ missingRelationships: e.array(e.string()).optional(),
456
+ evidenceIds: e.array(e.string()).optional(),
457
+ neededFromUser: e.array(e.string()).optional(),
458
+ recommendedNextStep: e.string().optional()
459
+ }).passthrough()
460
+ ),
461
+ semanticModelRecommendations: e.array(
462
+ e.object({
463
+ reasonCode: F,
464
+ message: e.string(),
465
+ recommendedNextStep: e.string().optional()
466
+ }).passthrough()
467
+ ).optional()
468
+ }).passthrough(), Q = e.object({
469
+ scope: e.literal("filtered_query"),
470
+ measures: e.record(ue)
471
+ }).passthrough(), G = e.object({
472
+ answeredObligations: e.array(e.string()),
473
+ missingObligations: e.array(e.string()),
474
+ warnings: e.array(me).optional()
475
+ }).passthrough(), H = e.object({
476
+ intentId: e.string().optional(),
477
+ queryId: e.string().optional(),
478
+ status: e.enum(["answered", "partial", "failed"]),
479
+ resultShape: e.enum([
480
+ "metric",
481
+ "records",
482
+ "inputOptions",
483
+ "sql",
484
+ "matrix",
485
+ "period_change",
486
+ "analysis"
487
+ ]).optional(),
488
+ intent: e.unknown().optional(),
489
+ compiledQuery: e.unknown().optional(),
490
+ fieldsUsed: e.array(A).optional(),
491
+ result: Te.optional(),
492
+ validation: M,
493
+ coverage: G.optional(),
494
+ missingFields: e.array(e.string()).optional(),
495
+ warnings: e.array(e.string()).optional(),
496
+ relationshipDiagnostics: Me.optional(),
497
+ diagnosticFeedback: X.optional(),
498
+ population: Q.optional(),
499
+ metadata: e.record(e.string(), e.unknown()).optional()
500
+ }).passthrough(), ze = H;
501
+ function Be(a) {
502
+ switch (a) {
503
+ case "boolean":
504
+ return e.boolean().optional();
505
+ case "compactExecutionFieldArray":
506
+ return e.array(he).optional();
507
+ case "coverage":
508
+ return G.optional();
509
+ case "diagnosticFeedback":
510
+ return X.optional();
511
+ case "executionFieldArray":
512
+ return e.array(A).optional();
513
+ case "executionResult":
514
+ return ze.optional();
515
+ case "number":
516
+ return e.number().finite().optional();
517
+ case "population":
518
+ return Q.optional();
519
+ case "record":
520
+ return pe.optional();
521
+ case "recordArray":
522
+ return de.optional();
523
+ case "responseDetail":
524
+ return e.enum(["compact", "standard", "debug"]).optional();
525
+ case "string":
526
+ return e.string().optional();
527
+ case "stringArray":
528
+ return e.array(e.string()).optional();
529
+ case "unknown":
530
+ return e.unknown().optional();
531
+ case "unknownArray":
532
+ return e.array(e.unknown()).optional();
533
+ case "validationResult":
534
+ return M.optional();
535
+ }
536
+ }
537
+ const De = Object.fromEntries(
538
+ Object.entries(j).map(
539
+ ([a, t]) => [a, Be(t)]
540
+ )
541
+ ), Le = e.object(De).strict(), We = new Set(
542
+ Object.keys(j)
543
+ );
544
+ function ha() {
545
+ return Object.keys(
546
+ j
547
+ );
548
+ }
549
+ function Ke(a) {
550
+ return We.has(a);
551
+ }
552
+ function ga(a) {
553
+ if (!a || typeof a != "object" || Array.isArray(a))
554
+ throw new Error("Semaphor analyze result must be an object.");
555
+ const s = Object.keys(a).filter(
556
+ (r) => !Ke(r)
557
+ );
558
+ if (s.length)
559
+ throw new Error(
560
+ `Semaphor analyze result contains unsupported top-level field(s): ${s.join(", ")}.`
561
+ );
562
+ return Le.parse(a);
563
+ }
564
+ const Y = 100, b = "selection:";
565
+ function ee(a) {
566
+ return [
567
+ B(a.source),
568
+ Se(a.name),
569
+ a.sourceField ?? ""
570
+ ].join("::");
571
+ }
572
+ function ya(a) {
573
+ return `${b}${a}`;
574
+ }
575
+ function Ue(a) {
576
+ return a.startsWith(b) && a.length > b.length;
577
+ }
578
+ function fa(a) {
579
+ return Ue(a) ? a.slice(b.length) : void 0;
580
+ }
581
+ function ae(a) {
582
+ if (!a) return "";
583
+ const t = a.calendar.fiscalCalendar;
584
+ return JSON.stringify([
585
+ a.granularity,
586
+ a.calendar.tz,
587
+ a.calendar.weekStart,
588
+ t ? [t.kind, t.yearStartMonth] : null
589
+ ]);
590
+ }
591
+ function $e(a) {
592
+ return JSON.stringify([
593
+ ee(a.field),
594
+ a.operator,
595
+ a.operator === "isNull" ? null : a.value,
596
+ ae(a.temporalBucket)
597
+ ]);
598
+ }
599
+ function N(a) {
600
+ return JSON.stringify(a.conditions.map($e).sort());
601
+ }
602
+ function v(a) {
603
+ return JSON.stringify([
604
+ B(a.field.source),
605
+ a.field.name,
606
+ a.operator,
607
+ a.operator === "isNull" ? null : a.value,
608
+ ae(a.temporalBucket)
609
+ ]);
610
+ }
611
+ function O(a) {
612
+ return JSON.stringify(
613
+ a.conditions.map(v).sort()
614
+ );
615
+ }
616
+ function ba(a) {
617
+ const t = a.map((s) => s.id);
618
+ if (new Set(t).size !== t.length)
619
+ throw new Error("Data App selections require one active selection per id.");
620
+ return a.map((s) => ({
621
+ ...s,
622
+ tuples: s.tuples.map((r) => ({
623
+ ...r,
624
+ conditions: [...r.conditions].sort(
625
+ (n, i) => w(
626
+ v(n),
627
+ v(i)
628
+ )
629
+ )
630
+ })).sort(
631
+ (r, n) => w(
632
+ O(r),
633
+ O(n)
634
+ )
635
+ )
636
+ })).sort((s, r) => w(s.id, r.id));
637
+ }
638
+ function w(a, t) {
639
+ return a < t ? -1 : a > t ? 1 : 0;
640
+ }
641
+ function Sa(a, t) {
642
+ return N(a) === N(t);
643
+ }
644
+ const Ve = "(Blank)";
645
+ function Ia(a) {
646
+ return a.conditions.map((t) => t.label ? t.label : t.operator === "isNull" || t.value === null ? Ve : String(t.value)).join(" · ");
647
+ }
648
+ const Je = e.union([
649
+ ge,
650
+ ye
651
+ ]), Ze = e.object({
652
+ name: e.string().min(1),
653
+ source: Je,
654
+ dataType: e.enum(["string", "number", "boolean", "date", "datetime"]),
655
+ sourceField: e.string().min(1).optional()
656
+ }).strict(), Xe = e.object({
657
+ field: Ze,
658
+ operator: e.enum(["=", "isNull"]),
659
+ value: e.union([e.string(), e.number().finite(), e.null()]),
660
+ label: e.string().optional(),
661
+ temporalBucket: z.optional()
662
+ }).strict().superRefine((a, t) => {
663
+ a.operator === "isNull" != (a.value === null) && t.addIssue({
664
+ code: e.ZodIssueCode.custom,
665
+ message: "isNull carries a null value, and only isNull does.",
666
+ path: ["value"]
667
+ });
668
+ }), Qe = e.object({
669
+ conditions: e.array(Xe).min(1)
670
+ }).strict().superRefine((a, t) => {
671
+ const s = a.conditions.map((r) => ee(r.field));
672
+ new Set(s).size !== s.length && t.addIssue({
673
+ code: e.ZodIssueCode.custom,
674
+ message: "A tuple holds one condition per field.",
675
+ path: ["conditions"]
676
+ });
677
+ }), wa = e.object({
678
+ kind: e.literal("selection"),
679
+ sourceCardId: e.string().min(1),
680
+ tuples: e.array(Qe).min(1).max(Y)
681
+ }).strict(), Ge = e.object({
682
+ field: fe,
683
+ operator: e.enum(["=", "isNull"]),
684
+ value: e.union([e.string(), e.number().finite(), e.null()]),
685
+ temporalBucket: z.optional()
686
+ }).strict().superRefine((a, t) => {
687
+ a.operator === "isNull" != (a.value === null) && t.addIssue({
688
+ code: e.ZodIssueCode.custom,
689
+ message: "isNull carries a null value, and only isNull does.",
690
+ path: ["value"]
691
+ });
692
+ }), He = e.object({
693
+ conditions: e.array(Ge).min(1)
694
+ }).strict().superRefine((a, t) => {
695
+ for (let s = 0; s < a.conditions.length; s += 1) {
696
+ const r = a.conditions[s];
697
+ a.conditions.findIndex(
698
+ (i, o) => o < s && be(i.field, r.field)
699
+ ) !== -1 && t.addIssue({
700
+ code: e.ZodIssueCode.custom,
701
+ message: "A selection tuple can contain only one condition per field.",
702
+ path: ["conditions", s, "field"]
703
+ });
704
+ }
705
+ }), ka = e.object({
706
+ id: e.string().min(1),
707
+ tuples: e.array(He).min(1).max(Y)
708
+ }).strict(), Ye = e.object({ key: e.string().min(1), nativeText: e.string().nullable() }).strict(), ea = e.object({
709
+ executionInstant: e.string().refine((a) => Ie(a) !== null, {
710
+ message: "executionInstant must be an ISO instant"
711
+ }),
712
+ dataAnchors: e.array(Ye).default([])
713
+ }).strict().refine(
714
+ (a) => new Set(a.dataAnchors.map((t) => t.key)).size === a.dataAnchors.length,
715
+ { message: "dataAnchors keys must be unique", path: ["dataAnchors"] }
716
+ );
717
+ function va(a) {
718
+ if (a == null) return;
719
+ const t = ea.safeParse(a);
720
+ return t.success ? t.data : void 0;
721
+ }
722
+ const aa = e.object({
723
+ intent: we,
724
+ matrixWindowRequest: D
725
+ }).strict(), ta = e.object({
726
+ runtimeFilters: k.innerType().shape.filters,
727
+ runtimeSorts: k.innerType().shape.sorts.optional()
728
+ });
729
+ function xa(a) {
730
+ return ta.parse(a);
731
+ }
732
+ const sa = {
733
+ // A window executes a governed statement set, not one compiled query.
734
+ compiledQuery: e.never().optional(),
735
+ intent: aa.shape.intent,
736
+ resultShape: e.literal("matrix"),
737
+ result: J.optional(),
738
+ metadata: e.object({ rowLimitExceeded: e.boolean(), matrixFailure: R.optional() }).passthrough()
739
+ }, ra = H.extend(sa), Aa = ra.superRefine((a, t) => {
740
+ a.status === "failed" == !!a.result && t.addIssue({ code: "custom", message: "Only answered or partial Matrix execution carries a window." }), a.result && a.status === "partial" != a.result.window.failures.length > 0 && t.addIssue({ code: "custom", message: "Matrix execution status must match acquired window failures." });
741
+ });
742
+ export {
743
+ _e as $,
744
+ Sa as A,
745
+ Ia as B,
746
+ Ze as C,
747
+ Xe as D,
748
+ Qe as E,
749
+ wa as F,
750
+ Ge as G,
751
+ He as H,
752
+ ea as I,
753
+ va as J,
754
+ ve as K,
755
+ P as L,
756
+ ia as M,
757
+ xe as N,
758
+ ca as O,
759
+ Ae as P,
760
+ je as Q,
761
+ Re as R,
762
+ j as S,
763
+ _ as T,
764
+ R as U,
765
+ Ce as V,
766
+ $ as W,
767
+ Ee as X,
768
+ la as Y,
769
+ ua as Z,
770
+ Pe as _,
771
+ ka as a,
772
+ qe as a0,
773
+ ma as a1,
774
+ da as a2,
775
+ Fe as a3,
776
+ Ne as a4,
777
+ q as a5,
778
+ Oe as a6,
779
+ pa as a7,
780
+ ta as a8,
781
+ xa as a9,
782
+ Aa as aa,
783
+ aa as ab,
784
+ Me as b,
785
+ ba as c,
786
+ X as d,
787
+ Q as e,
788
+ G as f,
789
+ ha as g,
790
+ H as h,
791
+ Ke as i,
792
+ ze as j,
793
+ De as k,
794
+ Le as l,
795
+ D as m,
796
+ J as n,
797
+ Y as o,
798
+ ga as p,
799
+ ee as q,
800
+ ya as r,
801
+ Te as s,
802
+ Ue as t,
803
+ fa as u,
804
+ ae as v,
805
+ $e as w,
806
+ N as x,
807
+ v as y,
808
+ O as z
809
+ };