react-semaphor 0.1.526 → 0.1.528

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 (180) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1190 -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-DUu-tCQw.js} +66 -65
  6. package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BdPceiw8.js} +68 -65
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-BkskKMck.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-Bb0RhGRC.js} +372 -359
  10. package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-loWTHPMi.js} +739 -686
  11. package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DUci_SOR.js} +10 -10
  12. package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-z9WN26w7.js} +6603 -6572
  13. package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-CGSFK9S-.js} +266 -267
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-CdXSo1pb.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-CTYnXU85.js} +781 -780
  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-DhykwdZs.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BV9ywFtJ.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-1Mm8x8w7.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-Dp7kFpVk.js +1383 -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-CZa3556D.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-Bqdtknud.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-VV0-Ro6F.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-IZjBSU6Z.js} +47 -26
  35. package/dist/chunks/semantic-format-BBLvfwua.js +192 -0
  36. package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-DbA4mVQL.js} +49909 -46207
  37. package/dist/chunks/{slider-BYIH4icg.js → slider-DpiJG8lv.js} +81 -82
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/switch-C4YH-W1X.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/semantic-types.d.ts +4 -2
  101. package/dist/types/lib/types/token-types.d.ts +0 -1
  102. package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
  103. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  104. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  105. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  106. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  107. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  108. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +89 -0
  109. package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
  110. package/dist/types/shared/analytics-protocol/contracts.d.ts +48 -7
  111. package/dist/types/shared/analytics-protocol/index.d.ts +15 -1
  112. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  113. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  114. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  115. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +61 -6
  116. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
  117. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  118. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  119. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  120. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  121. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  124. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  125. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  126. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  127. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  128. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  129. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  130. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  131. package/dist/types/shared/temporal/index.d.ts +5 -0
  132. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  133. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  134. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  135. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  136. package/package.json +1 -17
  137. package/src/data-app-sdk/README.md +6 -3
  138. package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
  139. package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
  140. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  141. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  142. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  143. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  144. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  145. package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
  146. package/dist/chunks/search-CJz-QQ0Q.js +0 -24
  147. package/dist/chunks/switch-XaAACBrJ.js +0 -2234
  148. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  149. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  150. package/dist/data-app-builder/index.js +0 -3666
  151. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  152. package/dist/data-app-codegen/index.js +0 -22
  153. package/dist/data-app-codegen-node/index.js +0 -1807
  154. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  155. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  156. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  157. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  158. package/dist/types/data-app-builder/constants.d.ts +0 -14
  159. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  160. package/dist/types/data-app-builder/index.d.ts +0 -1
  161. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  162. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  163. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  164. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  165. package/dist/types/data-app-builder/types.d.ts +0 -558
  166. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  167. package/dist/types/data-app-builder.d.ts +0 -2
  168. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  169. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  170. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  171. package/dist/types/data-app-codegen/index.d.ts +0 -6
  172. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  173. package/dist/types/data-app-codegen/node.d.ts +0 -2
  174. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  175. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  176. package/dist/types/data-app-codegen-node.d.ts +0 -2
  177. package/dist/types/data-app-codegen.d.ts +0 -2
  178. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  179. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  180. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -1,15 +0,0 @@
1
- import { jsx as a, jsxs as n } from "react/jsx-runtime";
2
- import { E as o, F as d, B as i, S as s, U as c, D as l, C as t, a as h } from "./semaphor-ready-indicator-BLRDuLr4.js";
3
- import { S as f } from "./pre-block-Cq1RqhZX.js";
4
- function u(e) {
5
- if (typeof window > "u")
6
- return null;
7
- const { preferences: r } = e;
8
- return /* @__PURE__ */ a(o, { FallbackComponent: d, children: /* @__PURE__ */ a(f, { dashboardProps: e, children: /* @__PURE__ */ n(i, { children: [
9
- /* @__PURE__ */ a(s, { componentType: "dashboard", componentId: e.id }),
10
- /* @__PURE__ */ a(c, { appearance: e.appearance, children: /* @__PURE__ */ a(l, { preferences: r, children: /* @__PURE__ */ a("main", { className: "flex h-full flex-col", children: /* @__PURE__ */ a(t, { ...e, type: "dashboard", children: /* @__PURE__ */ a(h, {}) }) }) }) })
11
- ] }) }) });
12
- }
13
- export {
14
- u as D
15
- };
@@ -1,183 +0,0 @@
1
- import { al as _ } from "./validators-CsdOtZI6.js";
2
- function k(e) {
3
- return `compat-filter:${e}`;
4
- }
5
- function j(e) {
6
- return `compat-control:${e}`;
7
- }
8
- function z(e, n) {
9
- return `compat-inline-filter:${e}:${n}`;
10
- }
11
- function M(e, n) {
12
- return `compat-card-control:${e}:${n}`;
13
- }
14
- function C(e, n) {
15
- const t = e.split(".").map((r) => r.trim()), i = n.split(".").map((r) => r.trim());
16
- if (t.length === 0 || i.length === 0 || t.some((r) => !r) || i.some((r) => !r))
17
- return !1;
18
- const [s, o] = t.length <= i.length ? [t, i] : [i, t], a = o.length - s.length;
19
- return s.every((r, c) => r === o[c + a]);
20
- }
21
- function N(e, n) {
22
- const t = e.split("."), i = n.split("."), s = t.pop(), o = i.pop();
23
- return !!(s && s === o && t.length > 0 && i.length > 0 && C(
24
- t.join("."),
25
- i.join(".")
26
- ));
27
- }
28
- function q(e) {
29
- const n = e.map((i) => i.trim()).filter(Boolean);
30
- if (n.every(
31
- (i, s) => n.slice(s + 1).every(
32
- (o) => C(i, o)
33
- )
34
- ))
35
- return [...n].sort(
36
- (i, s) => s.split(".").length - i.split(".").length
37
- )[0];
38
- }
39
- function u(e) {
40
- return typeof e == "object" && e !== null && !Array.isArray(e);
41
- }
42
- function h(e) {
43
- if (typeof e != "string") return "";
44
- const n = e.split(".").map((t) => t.trim());
45
- return n.length > 1 && n.every(Boolean) ? n.join(".") : "";
46
- }
47
- function v(e) {
48
- if (typeof e != "string") return "";
49
- const n = e.split(".").map((t) => t.trim());
50
- return n.length > 0 && n.every(Boolean) ? n.join(".") : "";
51
- }
52
- function d(e) {
53
- return typeof e == "string" ? e.trim() : "";
54
- }
55
- function D(e, n) {
56
- return e.every(
57
- (t, i) => e.slice(i + 1).every((s) => n(t, s))
58
- );
59
- }
60
- function F(e, n) {
61
- const t = d(e.id), i = d(e.name), s = d(n.entityId), o = d(n.entityName);
62
- return !i || !s && !o ? !1 : (!s || s === t || s === i) && (!o || o === i);
63
- }
64
- function T(e) {
65
- const n = u(e.semanticContext) ? e.semanticContext : void 0, t = u(e.fieldMeta) ? e.fieldMeta : void 0, i = d(n == null ? void 0 : n.semanticDomainId), s = Array.isArray(n == null ? void 0 : n.selectedEntities) ? n.selectedEntities.filter(
66
- (y) => u(y) && y.type === "dataset"
67
- ) : [];
68
- if (!!!(i || s.length > 0 || (t == null ? void 0 : t.entityType) === "dataset")) return;
69
- if (!i)
70
- return { status: "unresolved", reason: "incomplete_source_identity" };
71
- const a = d(t == null ? void 0 : t.entityId), r = d(t == null ? void 0 : t.entityName), c = !!(a || r), f = c ? s.filter(
72
- (y) => F(y, {
73
- entityId: a,
74
- entityName: r
75
- })
76
- ) : s;
77
- if (f.length > 1)
78
- return { status: "unresolved", reason: "incomplete_source_identity" };
79
- if (c && s.length > 0 && f.length === 0)
80
- return { status: "unresolved", reason: "divergent_source_identity" };
81
- const l = f[0], m = d(l == null ? void 0 : l.domainId), p = d(l == null ? void 0 : l.id), g = d(l == null ? void 0 : l.name);
82
- if (m && m !== i)
83
- return { status: "unresolved", reason: "divergent_source_identity" };
84
- const I = p, b = g || r;
85
- return b ? {
86
- status: "resolved",
87
- source: {
88
- kind: "semantic",
89
- domainId: i,
90
- datasetName: b,
91
- ...I ? { datasetId: I } : {}
92
- }
93
- } : { status: "unresolved", reason: "incomplete_source_identity" };
94
- }
95
- function S(e, n) {
96
- const t = d(e.connectionId), i = u(e.semanticContext) ? e.semanticContext : void 0, s = d(i == null ? void 0 : i.connectionId);
97
- if (t && s && t !== s)
98
- return { status: "unresolved", reason: "divergent_source_identity" };
99
- const o = t || s, a = u(e.fieldMeta) ? e.fieldMeta : void 0, r = n.split(".").slice(0, -1).join("."), c = v(e.qualifiedTableName), f = v(
100
- a == null ? void 0 : a.qualifiedEntityName
101
- ), l = [
102
- c,
103
- f,
104
- r
105
- ].filter(Boolean), m = q(l);
106
- return !m && l.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !o || !m ? { status: "unresolved", reason: "incomplete_source_identity" } : {
107
- status: "resolved",
108
- source: { kind: "physical", connectionId: o, tableName: m }
109
- };
110
- }
111
- function A(e, n) {
112
- const t = u(e.fieldMeta) ? e.fieldMeta : void 0, i = typeof (t == null ? void 0 : t.qualifiedFieldName) == "string" ? t.qualifiedFieldName.trim() : "", s = h(
113
- t == null ? void 0 : t.qualifiedFieldName
114
- ), o = typeof e.column == "string" ? e.column.trim() : "", a = h(o), r = typeof e.qualifiedTableName == "string" ? e.qualifiedTableName.trim() : "", c = v(
115
- e.qualifiedTableName
116
- );
117
- if (i && !s || n && r && !c || o.includes(".") && !a)
118
- return { status: "unresolved", reason: "incomplete_field_identity" };
119
- const f = a.split("."), l = a ? f[f.length - 1] : o, m = n && c && l ? `${c}.${l}` : "", p = [
120
- s,
121
- a,
122
- m
123
- ].filter(Boolean);
124
- if (!D(
125
- p,
126
- N
127
- ))
128
- return { status: "unresolved", reason: "divergent_field_identity" };
129
- const g = a || s || m;
130
- return g ? { status: "resolved", qualifiedFieldName: g } : { status: "unresolved", reason: "incomplete_field_identity" };
131
- }
132
- function E(e) {
133
- if (!u(e))
134
- return { status: "ineligible", reason: "invalid_input" };
135
- if (e.kind === "global-date")
136
- return { status: "eligible", kind: "global_date" };
137
- const n = _(e.dataType);
138
- if (n !== "date" && n !== "datetime")
139
- return { status: "ineligible", reason: "non_date_filter" };
140
- const t = u(e.fieldMeta) ? e.fieldMeta : void 0, i = _(
141
- t == null ? void 0 : t.dataType
142
- );
143
- if ((t == null ? void 0 : t.dataType) !== void 0 && i !== "date" && i !== "datetime")
144
- return { status: "ineligible", reason: "non_date_filter" };
145
- if (e.customFilterPreferences)
146
- return { status: "ineligible", reason: "custom_filter" };
147
- if (e.targetColumns !== void 0 && (!Array.isArray(e.targetColumns) || e.targetColumns.length > 0))
148
- return { status: "ineligible", reason: "multi_target_filter" };
149
- const s = T(e), o = A(e, s === void 0);
150
- if (o.status === "unresolved")
151
- return { status: "ineligible", reason: o.reason };
152
- const a = s || S(e, o.qualifiedFieldName);
153
- return a.status === "resolved" ? {
154
- status: "eligible",
155
- kind: "field_date",
156
- qualifiedFieldName: o.qualifiedFieldName,
157
- source: a.source
158
- } : { status: "ineligible", reason: a.reason };
159
- }
160
- function B(e) {
161
- if (!u(e) || e.kind !== "filter" || !u(e.filter))
162
- return { status: "ineligible", reason: "invalid_input" };
163
- const n = E(
164
- e.filter
165
- );
166
- return n.status === "ineligible" ? n : n.kind === "field_date" && u(e.compatibility) && e.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : n;
167
- }
168
- function Q(e) {
169
- return B(e).status === "eligible";
170
- }
171
- export {
172
- B as a,
173
- j as b,
174
- z as c,
175
- M as d,
176
- q as e,
177
- C as f,
178
- k as g,
179
- Q as i,
180
- N as q,
181
- E as r,
182
- F as s
183
- };
@@ -1,341 +0,0 @@
1
- import { b5 as v, S as p, al as N, W as _ } from "./validators-CsdOtZI6.js";
2
- import "./matrix-operation-contract-D32U2CSw.js";
3
- import { t as m, c as L, g as I, e as A, a as d, b as C, d as O, f as R } from "./semantic-format-Baqp8kD_.js";
4
- import { f as S, h as Z, r as k, i as z } from "./raw-temporal-7bFbXd2a.js";
5
- import { f as X, l as V, g as E, i as P } from "./numeric-presentation-VhMUHfrJ.js";
6
- import { b as g, c as y } from "./constants-DeLIHVAW.js";
7
- import { r as $, f as Y } from "./temporal-bucket-PcLFSYWX.js";
8
- function T(t, e) {
9
- const n = m(t), s = m(e), r = n.getTime() - s.getTime();
10
- return r < 0 ? -1 : r > 0 ? 1 : r;
11
- }
12
- function j(t) {
13
- return L(t, Date.now());
14
- }
15
- function B(t, e) {
16
- const n = m(t), s = m(e), r = n.getFullYear() - s.getFullYear(), o = n.getMonth() - s.getMonth();
17
- return r * 12 + o;
18
- }
19
- function H(t) {
20
- return (e) => {
21
- const s = (t ? Math[t] : Math.trunc)(e);
22
- return s === 0 ? 0 : s;
23
- };
24
- }
25
- function U(t, e) {
26
- return +m(t) - +m(e);
27
- }
28
- function W(t) {
29
- const e = m(t);
30
- return e.setHours(23, 59, 59, 999), e;
31
- }
32
- function q(t) {
33
- const e = m(t), n = e.getMonth();
34
- return e.setFullYear(e.getFullYear(), n + 1, 0), e.setHours(23, 59, 59, 999), e;
35
- }
36
- function G(t) {
37
- const e = m(t);
38
- return +W(e) == +q(e);
39
- }
40
- function K(t, e) {
41
- const n = m(t), s = m(e), r = T(n, s), o = Math.abs(
42
- B(n, s)
43
- );
44
- let l;
45
- if (o < 1)
46
- l = 0;
47
- else {
48
- n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - r * o);
49
- let a = T(n, s) === -r;
50
- G(m(t)) && o === 1 && T(t, s) === 1 && (a = !1), l = r * (o - Number(a));
51
- }
52
- return l === 0 ? 0 : l;
53
- }
54
- function J(t, e, n) {
55
- const s = U(t, e) / 1e3;
56
- return H(n == null ? void 0 : n.roundingMethod)(s);
57
- }
58
- function Q(t, e, n) {
59
- const s = I(), r = (n == null ? void 0 : n.locale) ?? s.locale ?? A, o = 2520, l = T(t, e);
60
- if (isNaN(l))
61
- throw new RangeError("Invalid time value");
62
- const a = Object.assign({}, n, {
63
- addSuffix: n == null ? void 0 : n.addSuffix,
64
- comparison: l
65
- });
66
- let h, u;
67
- l > 0 ? (h = m(e), u = m(t)) : (h = m(t), u = m(e));
68
- const f = J(u, h), c = (d(u) - d(h)) / 1e3, i = Math.round((f - c) / 60);
69
- let M;
70
- if (i < 2)
71
- return n != null && n.includeSeconds ? f < 5 ? r.formatDistance("lessThanXSeconds", 5, a) : f < 10 ? r.formatDistance("lessThanXSeconds", 10, a) : f < 20 ? r.formatDistance("lessThanXSeconds", 20, a) : f < 40 ? r.formatDistance("halfAMinute", 0, a) : f < 60 ? r.formatDistance("lessThanXMinutes", 1, a) : r.formatDistance("xMinutes", 1, a) : i === 0 ? r.formatDistance("lessThanXMinutes", 1, a) : r.formatDistance("xMinutes", i, a);
72
- if (i < 45)
73
- return r.formatDistance("xMinutes", i, a);
74
- if (i < 90)
75
- return r.formatDistance("aboutXHours", 1, a);
76
- if (i < g) {
77
- const D = Math.round(i / 60);
78
- return r.formatDistance("aboutXHours", D, a);
79
- } else {
80
- if (i < o)
81
- return r.formatDistance("xDays", 1, a);
82
- if (i < y) {
83
- const D = Math.round(i / g);
84
- return r.formatDistance("xDays", D, a);
85
- } else if (i < y * 2)
86
- return M = Math.round(i / y), r.formatDistance("aboutXMonths", M, a);
87
- }
88
- if (M = K(u, h), M < 12) {
89
- const D = Math.round(i / y);
90
- return r.formatDistance("xMonths", D, a);
91
- } else {
92
- const D = M % 12, b = Math.trunc(M / 12);
93
- return D < 3 ? r.formatDistance("aboutXYears", b, a) : D < 9 ? r.formatDistance("overXYears", b, a) : r.formatDistance("almostXYears", b + 1, a);
94
- }
95
- }
96
- function F(t, e) {
97
- return Q(t, j(t), e);
98
- }
99
- function Me(t, e) {
100
- return t && t !== "auto" ? t : e;
101
- }
102
- function De(t, e = /* @__PURE__ */ new Date()) {
103
- try {
104
- const n = {
105
- timeZone: t,
106
- timeZoneName: "short"
107
- }, r = new Intl.DateTimeFormat("en-US", n).formatToParts(e).find((o) => o.type === "timeZoneName");
108
- return (r == null ? void 0 : r.value) || t;
109
- } catch {
110
- return t;
111
- }
112
- }
113
- function ye(t) {
114
- try {
115
- const e = {
116
- timeZone: t,
117
- timeZoneName: "long"
118
- }, s = new Intl.DateTimeFormat("en-US", e).formatToParts(
119
- /* @__PURE__ */ new Date()
120
- ).find((r) => r.type === "timeZoneName");
121
- return (s == null ? void 0 : s.value) || t;
122
- } catch {
123
- return t;
124
- }
125
- }
126
- function w(t, e = "auto") {
127
- if (!t)
128
- return /* @__PURE__ */ new Date(NaN);
129
- const n = t.endsWith("Z"), s = /[+-]\d{2}:?\d{2}$/.test(t), r = /\([A-Z]{3,4}\)$/.test(t);
130
- if (e === "auto")
131
- return n || s || r ? new Date(t) : /* @__PURE__ */ new Date(t + "Z");
132
- if (e === "local") {
133
- if (n || s) {
134
- const o = t.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
135
- return new Date(o);
136
- }
137
- return new Date(t);
138
- } else return e === "UTC" ? n ? new Date(t) : s ? new Date(t) : /* @__PURE__ */ new Date(t + "Z") : n || s || r ? new Date(t) : S(t, e);
139
- }
140
- const ee = "MM/dd/yyyy", te = (t, e, n, s = "auto") => {
141
- if (!t)
142
- return "";
143
- try {
144
- const r = w(t, s);
145
- if (isNaN(r.getTime()))
146
- return t;
147
- const l = (e && e.trim() ? e : ee).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
148
- return n && n !== "auto" ? C(r, n, l) : O(r, l);
149
- } catch (r) {
150
- return console.error("Date formatting error:", r), t;
151
- }
152
- }, ne = (t, e = "auto") => {
153
- if (!t)
154
- return "";
155
- try {
156
- const n = w(t, e);
157
- return isNaN(n.getTime()) ? t : F(n, { addSuffix: !0 });
158
- } catch (n) {
159
- return console.error("Relative time formatting error:", n), t;
160
- }
161
- };
162
- function re(t, e, n, s) {
163
- const r = t instanceof Date ? t.toISOString() : String(t), o = (s == null ? void 0 : s.browserTimezone) || n, l = (s == null ? void 0 : s.isSqlCard) ?? !1;
164
- if (e != null && e.useRelativeTime)
165
- return ne(
166
- r,
167
- (e == null ? void 0 : e.sourceTimezone) || "auto"
168
- );
169
- const a = e != null && e.useCustomFormat && (e != null && e.customFormat) ? e.customFormat : (e == null ? void 0 : e.format) || "MM/dd/yyyy";
170
- return te(
171
- r,
172
- a,
173
- e != null && e.timezone && (e == null ? void 0 : e.timezone) !== "auto" ? e.timezone : l ? o : n,
174
- (e == null ? void 0 : e.sourceTimezone) || "auto"
175
- );
176
- }
177
- function x(t, e, n) {
178
- var l, a;
179
- if (t == null)
180
- return t === null ? ((l = n.absence) == null ? void 0 : l.nullText) ?? "" : ((a = n.absence) == null ? void 0 : a.emptyText) ?? "";
181
- const s = v(t) ? t : void 0, r = s ? s.value : t, o = s ?? (typeof t == "number" ? t : void 0);
182
- if (!n.useFormattedValues || !e)
183
- return String(r);
184
- switch (e.type) {
185
- case "number":
186
- return o !== void 0 ? X(
187
- o,
188
- e.numberFormat,
189
- n.locale
190
- ) : String(r);
191
- case "date":
192
- return re(
193
- r,
194
- e.dateFormat,
195
- n.timezone,
196
- {
197
- browserTimezone: n.browserTimezone,
198
- isSqlCard: n.isSqlCard
199
- }
200
- );
201
- case "progress":
202
- return o !== void 0 ? `${r}%` : String(r);
203
- case "badge":
204
- case "link":
205
- case "text":
206
- case "none":
207
- default:
208
- return String(r);
209
- }
210
- }
211
- function Te(t, e) {
212
- return e.visibleColumns.map((n) => {
213
- const s = t[n], r = e.columnSettings[n];
214
- return x(s, r, {
215
- useFormattedValues: e.useFormattedValues,
216
- timezone: e.timezone,
217
- locale: e.locale
218
- });
219
- });
220
- }
221
- function se(t, e) {
222
- var r;
223
- const n = t[t.length - 1];
224
- if (!n) return "";
225
- if (n.member.kind === "others") return "Others";
226
- const s = n.member.value;
227
- return s === null ? "(Blank)" : ((r = e == null ? void 0 : e.get(n.levelId)) == null ? void 0 : r(s)) ?? (typeof s == "object" ? s.value : String(s));
228
- }
229
- function ae(t, e, n) {
230
- return t === "grand_total" ? n ?? "Grand Total" : t === "subtotal" ? (n == null ? void 0 : n.split(_).join(e)) ?? `${e} Total` : e;
231
- }
232
- function be(t, e, n, s) {
233
- var l;
234
- const r = t[t.length - 1], o = e === "grand_total" ? n.grand.label : r ? (l = n.levels[r.levelId]) == null ? void 0 : l.label : void 0;
235
- return ae(e, se(t, s), o);
236
- }
237
- function pe(t, e, n) {
238
- return t.kind === "value" ? (e == null ? void 0 : e(t.value)) ?? "" : t.kind === "null" ? n.nullText : n.emptyText;
239
- }
240
- function de(t) {
241
- const { path: e, previousPath: n, role: s, repeatLabels: r, levelCount: o } = t;
242
- return Array.from({ length: o }, (l, a) => {
243
- const h = e.slice(0, a + 1), u = s === "grand_total" ? a === 0 : s === "subtotal" && a === e.length - 1, f = n && n.length > a && p(n.slice(0, a + 1)) === p(h);
244
- return {
245
- path: h,
246
- total: u,
247
- visible: u || e.length > a && (r || !f || a === e.length - 1)
248
- };
249
- });
250
- }
251
- function oe(t, e) {
252
- return R(t ?? e, {
253
- preserveOmittedProperties: !0,
254
- numericInput: "canonical"
255
- });
256
- }
257
- function ge(t, e, n) {
258
- const s = /* @__PURE__ */ new Map(), r = (o, l) => {
259
- const a = (l === "levels" ? e.levelFormats : e.measureFormats)[o.id], h = o.semanticFormat, u = oe(a, h);
260
- l === "measures" && s.set(o.id, {
261
- isNumeric: N(o.column.dataType) === "number",
262
- // Use normalized affixes: a redundant percent suffix is already removed.
263
- hasTextAffixes: !!u && !!("prefix" in u && u.prefix || "suffix" in u && u.suffix)
264
- });
265
- const f = (c) => x(c, void 0, {
266
- useFormattedValues: !0,
267
- timezone: n.calendar.tz,
268
- locale: n.valueFormat.locale,
269
- absence: e.absence
270
- });
271
- if (o.column.temporalBucket) {
272
- const c = o.column.temporalBucket, i = $({
273
- metadata: c,
274
- cardFormat: (a == null ? void 0 : a.type) === "temporal_bucket" ? a : void 0,
275
- semanticFormat: (h == null ? void 0 : h.type) === "temporal_bucket" ? { granularity: c.granularity, format: h } : void 0,
276
- locale: n.valueFormat.locale,
277
- styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
278
- });
279
- return (M) => typeof M == "string" ? Y({ value: M, metadata: c, format: i.format }) : f(M);
280
- }
281
- if (o.column.rawTemporal) {
282
- const c = Z({
283
- metadata: o.column.rawTemporal,
284
- format: k({
285
- format: (u == null ? void 0 : u.type) === "date" ? {
286
- type: "raw_temporal",
287
- timezone: u.timezone,
288
- sourceTimezone: u.sourceTimezone,
289
- presentation: u.pattern ? {
290
- mode: "pattern",
291
- dialect: "semaphor_tokens",
292
- pattern: u.pattern
293
- } : { mode: "auto" }
294
- } : void 0,
295
- preferences: n.valueFormat,
296
- calendar: n.calendar
297
- })
298
- });
299
- return (i) => {
300
- if (typeof i != "string") return f(i);
301
- const M = c(i);
302
- return M.ok ? M.text : f(i);
303
- };
304
- }
305
- if (z(u)) {
306
- const c = V(u, n.valueFormat);
307
- return (i) => typeof i == "number" || typeof i == "object" && i !== null ? E(i, c) : f(i);
308
- }
309
- return (u == null ? void 0 : u.type) === "duration" ? (c) => typeof c == "number" || typeof c == "string" || typeof c == "object" && c !== null ? P(
310
- typeof c == "object" ? c.value : c,
311
- u
312
- ) : f(c) : (u == null ? void 0 : u.type) === "string" ? (c) => c === null ? f(c) : `${u.prefix ?? ""}${f(c)}${u.suffix ?? ""}` : f;
313
- };
314
- return {
315
- levels: new Map(
316
- t.levels.map((o) => [o.id, r(o, "levels")])
317
- ),
318
- measures: new Map(
319
- t.measures.map((o) => [o.id, r(o, "measures")])
320
- ),
321
- measureSemantics: s
322
- };
323
- }
324
- export {
325
- te as a,
326
- ne as b,
327
- ye as c,
328
- x as d,
329
- ge as e,
330
- Te as f,
331
- De as g,
332
- be as h,
333
- de as i,
334
- pe as j,
335
- F as k,
336
- oe as l,
337
- se as m,
338
- ae as n,
339
- w as p,
340
- Me as r
341
- };