react-semaphor 0.1.567 → 0.1.569

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 (128) hide show
  1. package/README.md +0 -7
  2. package/dist/analytics-protocol/index.js +434 -454
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/brand-studio/index.js +10 -12
  5. package/dist/briefings/index.js +4 -4
  6. package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → _commonjsHelpers-Bid1ZNYj.js} +271 -222
  7. package/dist/chunks/{assistant-chat-D-IuHHwh.js → assistant-chat-Dzf2Mbph.js} +107 -109
  8. package/dist/chunks/{bookmark-impact-B0estCHn.js → bookmark-impact-Czg6FGt5.js} +2 -2
  9. package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
  10. package/dist/chunks/{card-filter-builder-DbSmzvem.js → card-filter-builder-BS982X7x.js} +1001 -1000
  11. package/dist/chunks/{code-editor-DJNOsgJH.js → code-editor-BsxHzm9u.js} +43 -45
  12. package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-lLTgzOkM.js} +252 -253
  13. package/dist/chunks/{dashboard-f8J9DHh5.js → dashboard-BiYSbxZv.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-DunvZYsU.js → dashboard-briefing-launcher-Bdj7luOr.js} +119 -120
  15. package/dist/chunks/{dashboard-controls-B09cN2Dz.js → dashboard-controls-TViDsnb8.js} +17 -19
  16. package/dist/chunks/dashboard-json-Dg9dQd9U.js +66 -0
  17. package/dist/chunks/{dates-BsJcyoC_.js → dates-BsPrWZIP.js} +8 -8
  18. package/dist/chunks/{edit-dashboard-visual-Cwzbpty8.js → edit-dashboard-visual-C6hoIeEJ.js} +20 -21
  19. package/dist/chunks/{filter-reach-copy-P-kDwUpY.js → filter-reach-copy-hcQ4os0u.js} +862 -852
  20. package/dist/chunks/filter-value-text-CVxEEDVl.js +146 -0
  21. package/dist/chunks/{index-BcXw0CpM.js → index-G4q89J6O.js} +74 -76
  22. package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-BIcoFfdS.js} +1 -1
  23. package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C6tYkHyv.js} +1 -1
  24. package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
  25. package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
  26. package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
  27. package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
  28. package/dist/chunks/{palette-4vf2BEEg.js → palette-NjHOE_6B.js} +1 -1
  29. package/dist/chunks/pivot-result-contract-expectations-DkmueDTW.js +55 -0
  30. package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
  31. package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
  32. package/dist/chunks/{report-preferences-dialog-CbgmdWeZ.js → report-preferences-dialog-Xc8_GFju.js} +26 -28
  33. package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
  34. package/dist/chunks/{resolve-dashboard-input-context-DPKSF3qj.js → resolve-dashboard-input-context-KqvcLcTM.js} +5956 -5880
  35. package/dist/chunks/{save-D6pHmSSP.js → save-C6VmEJTA.js} +1 -1
  36. package/dist/chunks/{saved-dashboard-context-CNudmm9U.js → saved-dashboard-context-BeXXyoD4.js} +6 -6
  37. package/dist/chunks/{semaphor-ready-indicator-CQd-PCCZ.js → semaphor-ready-indicator-BNkaANsG.js} +31011 -30850
  38. package/dist/chunks/{shelf-drop-preview-context-CWS3e20y.js → shelf-drop-preview-context-C_issPBA.js} +18 -20
  39. package/dist/chunks/{stored-dashboard-CrQFT27O.js → stored-dashboard-B6_StAty.js} +232 -234
  40. package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-BWP2joD1.js} +1 -1
  41. package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-scSWQXAB.js} +4 -4
  42. package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
  43. package/dist/chunks/{upload-Cf3wXZT8.js → upload-BRW4Mwrd.js} +1 -1
  44. package/dist/chunks/validators-B8fpdinG.js +3651 -0
  45. package/dist/chunks/{variable-draft-BDxlD0dM.js → variable-draft-BQ3OMjvy.js} +4 -4
  46. package/dist/dashboard/index.js +2 -2
  47. package/dist/dashboard-authoring/index.js +1778 -1741
  48. package/dist/format-utils/index.js +230 -231
  49. package/dist/index.js +236 -237
  50. package/dist/report-runtime-context/index.js +1 -1
  51. package/dist/style.css +1 -1
  52. package/dist/surfboard/index.js +2 -2
  53. package/dist/types/components/surfboard/filter/types.d.ts +5 -4
  54. package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
  55. package/dist/types/index.js +9 -9
  56. package/dist/types/lib/document/document-edits.d.ts +8 -3
  57. package/dist/types/lib/document/document-text-style.d.ts +54 -0
  58. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  59. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  60. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  61. package/dist/types/lib/types/index.d.ts +1 -1
  62. package/dist/types/lib/utils/card-definition.d.ts +7 -7
  63. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
  64. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
  65. package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
  66. package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
  67. package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
  68. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +4 -4
  69. package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
  70. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
  71. package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
  72. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
  73. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
  74. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
  75. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
  76. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
  77. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
  78. package/dist/types/shared/assistant-protocol/context.d.ts +12 -12
  79. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
  80. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +176 -1756
  81. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
  82. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +74 -74
  83. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
  84. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +8 -2
  85. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
  86. package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
  87. package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
  88. package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
  89. package/dist/types/shared/temporal/index.d.ts +0 -2
  90. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
  91. package/package.json +2 -24
  92. package/DATA_APP_SDK.md +0 -339
  93. package/dist/chunks/dashboard-json-BNNCaKEc.js +0 -68
  94. package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
  95. package/dist/chunks/index-CuHybtft.js +0 -51
  96. package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
  97. package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
  98. package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
  99. package/dist/chunks/operators-B3zZoskU.js +0 -66
  100. package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
  101. package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
  102. package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
  103. package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
  104. package/dist/chunks/validators-wtjw0aw6.js +0 -3332
  105. package/dist/data-app-sdk/index.js +0 -1412
  106. package/dist/data-app-sdk-adapters/index.js +0 -361
  107. package/dist/data-app-sdk-validation/index.js +0 -1031
  108. package/dist/types/data-app-sdk/adapters.d.ts +0 -35
  109. package/dist/types/data-app-sdk/builders.d.ts +0 -62
  110. package/dist/types/data-app-sdk/contracts.d.ts +0 -419
  111. package/dist/types/data-app-sdk/executor.d.ts +0 -5
  112. package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
  113. package/dist/types/data-app-sdk/hooks.d.ts +0 -11
  114. package/dist/types/data-app-sdk/index.d.ts +0 -9
  115. package/dist/types/data-app-sdk/provider.d.ts +0 -8
  116. package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
  117. package/dist/types/data-app-sdk/selection.d.ts +0 -2
  118. package/dist/types/data-app-sdk/validation.d.ts +0 -58
  119. package/dist/types/data-app-sdk-adapters.d.ts +0 -2
  120. package/dist/types/data-app-sdk-validation.d.ts +0 -2
  121. package/dist/types/data-app-sdk.d.ts +0 -2
  122. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
  123. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
  124. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
  125. package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
  126. package/dist/types/shared/temporal/relative-date.d.ts +0 -21
  127. package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
  128. package/src/data-app-sdk/README.md +0 -402
@@ -1,42 +0,0 @@
1
- import { l as s, o as f, q as u } from "./validators-wtjw0aw6.js";
2
- import "./matrix-operation-contract-Eb6elidS.js";
3
- import "./analytics-base-schemas-BaIQrEzX.js";
4
- import "zod";
5
- function c(i, r = {}) {
6
- var o, e;
7
- if (i.type !== "matrixTable" || !i.config || typeof i.config != "object" || !("matrix" in i.config)) return { status: "absent" };
8
- if ((o = i.sql) != null && o.trim() || (e = i.python) != null && e.trim())
9
- return { status: "invalid", error: new Error("A Matrix definition requires a config-only Matrix card.") };
10
- if ("matrixIntent" in i.config && i.config.matrixIntent !== void 0) return { status: "invalid", error: new Error("A Matrix card cannot contain two definitions.") };
11
- const t = (r.authoringDraft ? s : f).safeParse(i.config.matrix);
12
- return t.success ? { status: "ready", config: t.data } : { status: "invalid", error: t.error };
13
- }
14
- function p(i) {
15
- const r = c(i);
16
- if (r.status === "invalid") throw r.error;
17
- return r.status === "ready" ? r.config : void 0;
18
- }
19
- function d(i) {
20
- const r = [], n = (t, o, e) => {
21
- r.push({ field: t, place: o, ownerId: e }), t.derivedField && Object.values(t.derivedField.inputs).forEach((a) => n(a.field, "input", e));
22
- };
23
- return i.rows.forEach((t) => n(t.field, "row", t.id)), i.columns.forEach((t) => n(t.field, "column", t.id)), i.measures.forEach((t) => {
24
- t.kind === "aggregate" ? n(t.field, "measure", t.id) : Object.values(t.definition.inputs).forEach((o) => n(o.field, "input", t.id));
25
- }), r;
26
- }
27
- function m(i) {
28
- return d(i).map((r) => r.field);
29
- }
30
- function v(i) {
31
- return u([
32
- i.source,
33
- ...m(i).map((r) => r.source ?? i.source)
34
- ]);
35
- }
36
- export {
37
- d as a,
38
- v as b,
39
- c as i,
40
- m,
41
- p as r
42
- };
@@ -1,105 +0,0 @@
1
- import { t as d } from "./validators-wtjw0aw6.js";
2
- const h = [
3
- "=",
4
- "!=",
5
- ">",
6
- "<",
7
- ">=",
8
- "<=",
9
- "like",
10
- "not like",
11
- "between",
12
- "not between",
13
- "in",
14
- "not in",
15
- "is null",
16
- "is not null"
17
- ], m = /* @__PURE__ */ new Set(["string", "number", "date", "boolean"]);
18
- function v(t) {
19
- return typeof t == "string" && h.includes(t);
20
- }
21
- function b(t, e) {
22
- switch (t) {
23
- case "is null":
24
- case "is not null":
25
- return e.length === 0;
26
- case "between":
27
- case "not between":
28
- return e.length === 2;
29
- case "in":
30
- case "not in":
31
- return e.length >= 1;
32
- default:
33
- return e.length === 1;
34
- }
35
- }
36
- function y(t) {
37
- if (!t || typeof t != "object" || Array.isArray(t))
38
- return;
39
- const e = t, i = {};
40
- for (const n of g)
41
- e[n] !== void 0 && (i[n] = e[n]);
42
- return i;
43
- }
44
- const g = [
45
- "operation",
46
- "values",
47
- "valueType",
48
- "temporalBucket",
49
- "relativeMeta",
50
- "temporalPrecision"
51
- ];
52
- function P(t) {
53
- const e = y(t);
54
- if (!e) return;
55
- const { operation: i, values: n } = e;
56
- if (!v(i) || !Array.isArray(n) || !b(i, n)) return;
57
- const r = typeof e.valueType == "string" && m.has(e.valueType) ? e.valueType : void 0;
58
- return {
59
- operation: i,
60
- values: n,
61
- ...r ? { valueType: r } : {},
62
- ...e.temporalBucket !== void 0 ? { temporalBucket: e.temporalBucket } : {},
63
- ...e.relativeMeta !== void 0 ? { relativeMeta: e.relativeMeta } : {},
64
- ...e.temporalPrecision !== void 0 ? { temporalPrecision: e.temporalPrecision } : {}
65
- };
66
- }
67
- function A(t) {
68
- const e = P(t);
69
- if (!e)
70
- throw new Error(
71
- `Filter operation "${String(t.operation)}" cannot be expressed as predicate semantics.`
72
- );
73
- return e;
74
- }
75
- function T(t) {
76
- return t.operation === "is null" || t.operation === "is not null";
77
- }
78
- function E(t, e) {
79
- var n;
80
- if (e === null) return !0;
81
- if (e.overrides.length === 0) return t.length <= e.depth;
82
- const i = d(t);
83
- return ((n = e.overrides.find((r) => r.path.length === t.length && d(r.path) === i)) == null ? void 0 : n.expanded) ?? t.length <= e.depth;
84
- }
85
- function k(t) {
86
- var u;
87
- const { path: e, levelCount: i, expansion: n, total: r, axis: p } = t, s = e.length >= i || ((u = e[e.length - 1]) == null ? void 0 : u.member.kind) === "others", l = !s && !t.childrenEmpty, o = l && E(e, n), c = p === "rows" && t.rowLayout !== "tabular", f = o && !!t.skipRedundant && !!t.singleChild, a = !!(r != null && r.visible) && !f;
88
- return {
89
- expandable: l,
90
- expanded: o,
91
- memberVisible: c || !o,
92
- valueVisible: s || a && (!o || r.position === "before"),
93
- subtotalBefore: !c && o && a && r.position === "before",
94
- subtotalAfter: o && a && r.position === "after"
95
- };
96
- }
97
- export {
98
- h as N,
99
- P as a,
100
- E as b,
101
- T as i,
102
- y as p,
103
- k as r,
104
- A as t
105
- };
@@ -1,66 +0,0 @@
1
- function r(n) {
2
- const t = o(n);
3
- return e(t) ? t : void 0;
4
- }
5
- function o(n) {
6
- if (typeof n != "string" || n.trim().length === 0)
7
- return;
8
- const t = n.trim().toLowerCase();
9
- switch (t) {
10
- case "=":
11
- return "=";
12
- case "!=":
13
- return "!=";
14
- case "in":
15
- return "in";
16
- case "not_in":
17
- return "not_in";
18
- case "contains":
19
- return "contains";
20
- case "not_contains":
21
- return "not_contains";
22
- case "between":
23
- return "between";
24
- case "not_between":
25
- return "not_between";
26
- case ">":
27
- case ">=":
28
- case "<":
29
- case "<=":
30
- return t;
31
- case "is_null":
32
- return "is_null";
33
- case "is_not_null":
34
- return "is_not_null";
35
- default:
36
- return i(n) ? n : void 0;
37
- }
38
- }
39
- function e(n) {
40
- return n === "=" || n === "!=" || n === "in" || n === "not_in" || n === "contains" || n === "not_contains" || n === "between" || n === "not_between" || n === ">" || n === ">=" || n === "<" || n === "<=";
41
- }
42
- function i(n) {
43
- return e(n) || n === "not_contains" || n === "is_null" || n === "is_not_null";
44
- }
45
- function s(n) {
46
- switch (n) {
47
- case "not in":
48
- return "not_in";
49
- case "like":
50
- return "contains";
51
- case "not like":
52
- return "not_contains";
53
- case "not between":
54
- return "not_between";
55
- case "is null":
56
- case "is not null":
57
- return;
58
- default:
59
- return r(n);
60
- }
61
- }
62
- export {
63
- o as a,
64
- r as n,
65
- s as t
66
- };
@@ -1,56 +0,0 @@
1
- var c = Object.defineProperty;
2
- var d = (r, e, t) => e in r ? c(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var l = (r, e, t) => d(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { ad as u } from "./temporal-input-presentation--2r9BLr0.js";
5
- import "./validators-wtjw0aw6.js";
6
- import "./matrix-operation-contract-Eb6elidS.js";
7
- import { r as v } from "./metric-comparison-ChXUFaZu.js";
8
- import "./analytics-base-schemas-BaIQrEzX.js";
9
- import "zod";
10
- class m extends Error {
11
- constructor(t, a) {
12
- super(`${t}: ${a}`);
13
- l(this, "deliveryBlocking", !0);
14
- this.code = t, this.name = "PivotHeaderPresentationError";
15
- }
16
- }
17
- function k(r) {
18
- var i;
19
- const e = r.mode ?? "formatted", t = r.members.map((o) => {
20
- var n;
21
- if (e === "canonical" || !o.temporalBucket)
22
- return o.value === null ? "" : String(o.value);
23
- const s = (n = r.resolveTemporalFormat) == null ? void 0 : n.call(r, o.fieldId);
24
- if (!s)
25
- throw new m(
26
- "missing_resolved_temporal_format",
27
- `Missing resolved temporal presentation for pivot field "${o.fieldId}"`
28
- );
29
- return u({
30
- value: o.value,
31
- metadata: o.temporalBucket,
32
- format: s
33
- });
34
- }), a = ((i = r.metricLabel) == null ? void 0 : i.trim()) || void 0;
35
- return {
36
- memberLabels: t,
37
- ...a ? { metricLabel: a } : {},
38
- flattenedLabel: [
39
- ...t,
40
- ...a ? [a] : []
41
- ].join(" / ")
42
- };
43
- }
44
- function B(r) {
45
- const e = /* @__PURE__ */ new Map();
46
- return r.forEach((t) => {
47
- t.id && e.set(t.id, (e.get(t.id) ?? 0) + 1);
48
- }), r.flatMap(
49
- (t) => t.id && (e.get(t.id) ?? 0) > 1 ? [v(t)] : []
50
- );
51
- }
52
- export {
53
- m as P,
54
- B as d,
55
- k as p
56
- };
@@ -1,242 +0,0 @@
1
- var b = Object.defineProperty;
2
- var _ = (t, e, r) => e in t ? b(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var f = (t, e, r) => _(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { R as v } from "./analytics-base-schemas-BaIQrEzX.js";
5
- class s extends Error {
6
- constructor(r) {
7
- super(r);
8
- f(this, "code");
9
- this.name = "RawTemporalMetadataContractError", this.code = v.invalidMetadata;
10
- }
11
- }
12
- function R(t) {
13
- if (t === null || typeof t != "object" || Array.isArray(t))
14
- return !1;
15
- const e = Object.getPrototypeOf(t);
16
- return e === null || e === Object.prototype;
17
- }
18
- function g(t) {
19
- if (!R(t))
20
- throw new s(
21
- "Raw temporal metadata must be an object."
22
- );
23
- const e = Object.keys(t);
24
- if (e.length !== 2 || !e.includes("kind") || !e.includes("valueKind"))
25
- throw new s(
26
- "Raw temporal metadata must contain only kind and valueKind."
27
- );
28
- if (t.kind !== "raw_temporal")
29
- throw new s(
30
- "Raw temporal metadata kind must be raw_temporal."
31
- );
32
- if (t.valueKind !== "date" && t.valueKind !== "wall_datetime" && t.valueKind !== "instant")
33
- throw new s(
34
- "Raw temporal valueKind must be date, wall_datetime, or instant."
35
- );
36
- return {
37
- kind: "raw_temporal",
38
- valueKind: t.valueKind
39
- };
40
- }
41
- function S(t, e) {
42
- if (!t.rawTemporal) {
43
- if (e.metadataRequired)
44
- throw new s(
45
- "Activated raw temporal result is missing metadata."
46
- );
47
- return;
48
- }
49
- if (t.temporalBucket)
50
- throw new s(
51
- "A result column cannot carry both raw and grouped temporal metadata."
52
- );
53
- const r = g(t.rawTemporal), n = r.valueKind === "date" ? "date" : "datetime";
54
- if (t.dataType !== n)
55
- throw new s(
56
- `${r.valueKind} raw temporal values require dataType ${n}.`
57
- );
58
- return r;
59
- }
60
- function $(t) {
61
- if (!t) return null;
62
- for (const [e, r] of Object.entries(C))
63
- if (k(r, t))
64
- return e;
65
- return null;
66
- }
67
- const l = (t, e) => Math.abs(t) === 1 ? e : `${e}s`;
68
- function p(t, e) {
69
- if (t === 0)
70
- return e === "day" ? "today" : `this ${e}`;
71
- if (t === -1)
72
- return e === "day" ? "yesterday" : `last ${e}`;
73
- if (t === 1)
74
- return e === "day" ? "tomorrow" : `next ${e}`;
75
- const r = Math.abs(t);
76
- return t < 0 ? `${r} ${l(r, e)} ago` : `${r} ${l(r, e)} ahead`;
77
- }
78
- const N = (t) => t.charAt(0).toUpperCase() + t.slice(1);
79
- function h(t, e) {
80
- return N(p(t, e));
81
- }
82
- function A(t) {
83
- if (!t) return null;
84
- if (t.mode === "last" && t.relativeTo === "latest_data") {
85
- const { relativeTo: r, ...n } = t, a = A(n);
86
- return a ? `${a} of data` : null;
87
- }
88
- const e = $(t);
89
- return e || (t.mode === "this" ? t.boundary === "first_day" ? "First day of the month" : t.boundary === "last_day" ? "Last day of the month" : `This ${t.unit}${t.toDate ? " to date" : ""}` : t.mode === "previous" ? `Last ${t.unit}` : t.mode === "last" ? `Last ${t.n} ${l(t.n, t.unit)}` : t.mode === "between" ? t.from === t.to ? h(t.from, t.unit) : `${h(t.from, t.unit)} to ${p(
90
- t.to,
91
- t.unit
92
- )}` : null);
93
- }
94
- function k(t, e) {
95
- return !(t.mode !== e.mode || t.unit !== e.unit || t.mode === "last" && e.mode === "last" && (t.n !== e.n || !!t.complete != !!e.complete || t.relativeTo !== e.relativeTo) || t.mode === "this" && e.mode === "this" && (!!t.toDate != !!e.toDate || t.boundary !== e.boundary) || t.mode === "between" && e.mode === "between" && (t.from !== e.from || t.to !== e.to));
96
- }
97
- const C = {
98
- // Sub-day presets
99
- "Last 30 minutes": { mode: "last", n: 30, unit: "minute" },
100
- "Last 1 hour": { mode: "last", n: 1, unit: "hour" },
101
- "Last 4 hours": { mode: "last", n: 4, unit: "hour" },
102
- "Last 12 hours": { mode: "last", n: 12, unit: "hour" },
103
- "Last 24 hours": { mode: "last", n: 24, unit: "hour" },
104
- // Day presets
105
- Today: { mode: "this", unit: "day" },
106
- Yesterday: { mode: "previous", unit: "day" },
107
- "First day of the month": {
108
- mode: "this",
109
- unit: "month",
110
- boundary: "first_day"
111
- },
112
- "Last day of the month": {
113
- mode: "this",
114
- unit: "month",
115
- boundary: "last_day"
116
- },
117
- "Last 7 days": { mode: "between", unit: "day", from: -6, to: 0 },
118
- "Last 30 days": { mode: "between", unit: "day", from: -29, to: 0 },
119
- "Last 90 days": { mode: "between", unit: "day", from: -89, to: 0 },
120
- // Week presets
121
- "This week": { mode: "this", unit: "week" },
122
- "Last week": { mode: "previous", unit: "week" },
123
- "Last 2 weeks": { mode: "last", n: 2, unit: "week", complete: !0 },
124
- // Month presets
125
- "This month": { mode: "this", unit: "month" },
126
- "Last month": { mode: "previous", unit: "month" },
127
- "Last 3 months": { mode: "last", n: 3, unit: "month", complete: !0 },
128
- "Last 6 months": { mode: "last", n: 6, unit: "month", complete: !0 },
129
- "Last 9 months": { mode: "last", n: 9, unit: "month", complete: !0 },
130
- "Last 12 months": { mode: "last", n: 12, unit: "month", complete: !0 },
131
- // Quarter presets
132
- "This quarter": { mode: "this", unit: "quarter" },
133
- "Last quarter": { mode: "previous", unit: "quarter" },
134
- "Last 4 quarters": { mode: "last", n: 4, unit: "quarter", complete: !0 },
135
- // Year presets
136
- "This year": { mode: "this", unit: "year" },
137
- "Last year": { mode: "previous", unit: "year" }
138
- }, y = /* @__PURE__ */ new Map();
139
- function D(t, e) {
140
- let r = y.get(e);
141
- r || (r = new Intl.DateTimeFormat("en-CA", {
142
- calendar: "gregory",
143
- numberingSystem: "latn",
144
- timeZone: e,
145
- year: "numeric",
146
- month: "2-digit",
147
- day: "2-digit",
148
- hour: "2-digit",
149
- minute: "2-digit",
150
- second: "2-digit",
151
- hourCycle: "h23"
152
- }), y.set(e, r));
153
- const n = r.formatToParts(t), a = (o) => {
154
- var i;
155
- return Number((i = n.find((d) => d.type === o)) == null ? void 0 : i.value);
156
- };
157
- return {
158
- year: a("year"),
159
- month: a("month"),
160
- day: a("day"),
161
- hour: a("hour"),
162
- minute: a("minute"),
163
- second: a("second")
164
- };
165
- }
166
- function c(t) {
167
- const e = /* @__PURE__ */ new Date(0);
168
- return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond ?? 0), e.getTime();
169
- }
170
- function u(t, e) {
171
- const r = t - (t % 1e3 + 1e3) % 1e3;
172
- return c(D(new Date(r), e)) - r;
173
- }
174
- const m = 864e5;
175
- function j(t, e) {
176
- const r = M(t, e);
177
- if (r.length) return r[0];
178
- const n = c(t);
179
- return new Date(n - u(n - m, e));
180
- }
181
- function M(t, e) {
182
- const r = c(t), n = u(r - m, e), a = u(r + m, e);
183
- return [.../* @__PURE__ */ new Set([n, a])].map((o) => r - o).filter((o) => u(o, e) === r - o).sort((o, i) => o - i).map((o) => new Date(o));
184
- }
185
- const w = /^(\d{4})-(\d{2})-(\d{2})$/, T = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?$/, L = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}:\d{2})$/;
186
- function F(t) {
187
- if (w.test(t)) return "date";
188
- if (L.test(t)) return "instant";
189
- if (T.test(t)) return "wall_datetime";
190
- }
191
- function E(t) {
192
- return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
193
- }
194
- function O(t, e) {
195
- return e === 2 ? E(t) ? 29 : 28 : [4, 6, 9, 11].includes(e) ? 30 : 31;
196
- }
197
- function K(t) {
198
- return t.year >= 1 && t.year <= 9999 && t.month >= 1 && t.month <= 12 && t.day >= 1 && t.day <= O(t.year, t.month) && t.hour >= 0 && t.hour <= 23 && t.minute >= 0 && t.minute <= 59 && t.second >= 0 && t.second <= 59;
199
- }
200
- function q(t) {
201
- return {
202
- year: Number(t[1]),
203
- month: Number(t[2]),
204
- day: Number(t[3]),
205
- hour: Number(t[4] ?? 0),
206
- minute: Number(t[5] ?? 0),
207
- second: Number(t[6] ?? 0),
208
- fraction: t[7] ?? ""
209
- };
210
- }
211
- function W(t, e) {
212
- const r = e === "date" ? t.match(w) : e === "wall_datetime" ? t.match(T) : t.match(L);
213
- if (!r) return { status: "invalid_shape" };
214
- const n = q(r);
215
- if (!K(n)) return { status: "out_of_range" };
216
- if (e === "instant") {
217
- const a = r[8];
218
- if (a && a !== "Z") {
219
- const [i, d] = a.slice(1).split(":").map(Number);
220
- if (i > 23 || d > 59) return { status: "out_of_range" };
221
- }
222
- const o = new Date(t.replace(" ", "T"));
223
- return Number.isNaN(o.getTime()) ? { status: "out_of_range" } : { status: "valid", fields: n, instant: o };
224
- }
225
- return { status: "valid", fields: n };
226
- }
227
- export {
228
- s as R,
229
- W as a,
230
- h as b,
231
- F as c,
232
- C as d,
233
- D as e,
234
- $ as f,
235
- A as g,
236
- j as h,
237
- g as p,
238
- k as r,
239
- S as v,
240
- c as w,
241
- M as z
242
- };
@@ -1,46 +0,0 @@
1
- import { s as p, S as h } from "./matrix-operation-contract-Eb6elidS.js";
2
- function f(e, l, t) {
3
- return e.length === 1 && t(e[0]) === t(l) ? { tuples: [], outcome: "cleared" } : { tuples: [l], outcome: "selected" };
4
- }
5
- function S(e, l) {
6
- const t = /* @__PURE__ */ new Set();
7
- return e.filter((n) => {
8
- const r = l(n);
9
- return t.has(r) ? !1 : (t.add(r), !0);
10
- });
11
- }
12
- function x(e, l, t, n) {
13
- const r = n.limit ?? h, o = n.tupleKey ?? p;
14
- if (t.kind === "clear") return { tuples: [], outcome: "cleared" };
15
- if (t.kind === "replace" || !n.multipleSelection)
16
- return f(e, l, o);
17
- if (t.kind === "toggle") {
18
- const a = e.findIndex(
19
- (c) => o(c) === o(l)
20
- );
21
- if (a >= 0) {
22
- const c = e.filter((y, m) => m !== a);
23
- return { tuples: c, outcome: c.length ? "removed" : "cleared" };
24
- }
25
- return e.length >= r ? { tuples: e, outcome: "limitReached" } : { tuples: [...e, l], outcome: "added" };
26
- }
27
- const d = (a) => t.ordered.findIndex(
28
- (c) => o(c) === o(a)
29
- ), i = d(t.anchor), u = d(l);
30
- if (i < 0 || u < 0) return f(e, l, o);
31
- const s = S(
32
- t.ordered.slice(Math.min(i, u), Math.max(i, u) + 1),
33
- o
34
- );
35
- return s.length <= r ? { tuples: s, outcome: "rangeSelected" } : {
36
- tuples: i <= u ? s.slice(0, r) : s.slice(-r),
37
- outcome: "limitReached"
38
- };
39
- }
40
- function k(e, l, t) {
41
- return t.multipleSelection ? e.metaKey || e.ctrlKey ? "toggle" : e.shiftKey ? l === "table" && t.hasAnchor ? "range" : "toggle" : e.pointerType === "touch" && t.checkboxesShown ? "toggle" : "replace" : "replace";
42
- }
43
- export {
44
- k as g,
45
- x as r
46
- };