react-semaphor 0.1.602 → 0.1.604

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 (211) hide show
  1. package/dist/activity/index.js +1 -73
  2. package/dist/analytics-protocol/index.js +1 -1451
  3. package/dist/appearance/index.js +1 -12
  4. package/dist/appearance-runtime/index.js +1 -5
  5. package/dist/assistant-context/index.js +1 -11
  6. package/dist/assistant-protocol/index.js +1 -152
  7. package/dist/brand-studio/index.js +4 -1594
  8. package/dist/briefings/index.js +1 -70
  9. package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
  10. package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
  11. package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
  12. package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
  13. package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
  14. package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
  15. package/dist/chunks/attribution-BEFSsbNn.js +1 -0
  16. package/dist/chunks/availability-3AIOf6Z-.js +1 -0
  17. package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
  18. package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
  19. package/dist/chunks/brand-DCaZyRt6.js +1 -0
  20. package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
  21. package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
  22. package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
  23. package/dist/chunks/context-ALdccLHw.js +2 -0
  24. package/dist/chunks/conversation-JMK2kyTK.js +1 -0
  25. package/dist/chunks/dashboard-BX28ld6s.js +1 -0
  26. package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
  27. package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
  28. package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
  29. package/dist/chunks/dates-D-KP8G-z.js +1 -0
  30. package/dist/chunks/edit-DEAK0UZo.js +1 -0
  31. package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
  32. package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
  33. package/dist/chunks/filter-line-CwQrqORc.js +1 -0
  34. package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
  35. package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
  36. package/dist/chunks/index-B-VF1ogs.js +1 -0
  37. package/dist/chunks/index-BE1DfxNs.js +1 -0
  38. package/dist/chunks/index-DViPGDFj.js +1 -0
  39. package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
  40. package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
  41. package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
  42. package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
  43. package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
  44. package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
  45. package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
  46. package/dist/chunks/palette-BzC-CGOc.js +6 -0
  47. package/dist/chunks/pickers-DuBrUht0.js +1 -0
  48. package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
  49. package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
  50. package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
  51. package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
  52. package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
  53. package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
  54. package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
  55. package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
  56. package/dist/chunks/save-DdFUZcbi.js +6 -0
  57. package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
  58. package/dist/chunks/schema-MC0cQSAb.js +4 -0
  59. package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
  60. package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
  61. package/dist/chunks/set-DuJfGkbY.js +1 -0
  62. package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
  63. package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
  64. package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
  65. package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
  66. package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
  67. package/dist/chunks/validators-CqV3Yka1.js +1 -0
  68. package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
  69. package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
  70. package/dist/dashboard/index.js +1 -7
  71. package/dist/dashboard-authoring/index.js +1 -4491
  72. package/dist/format-utils/index.js +1 -424
  73. package/dist/index.js +1 -554
  74. package/dist/layouts/index.js +1 -7
  75. package/dist/live-channel/index.js +1 -124
  76. package/dist/pdf-export-policy/index.js +1 -92
  77. package/dist/pdf-table-layout/index.js +1 -993
  78. package/dist/report-runtime-context/index.js +1 -9
  79. package/dist/shared/index.js +1 -6
  80. package/dist/style.css +1 -1
  81. package/dist/surfboard/index.js +1 -9
  82. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
  83. package/dist/types/index.js +1 -88
  84. package/dist/types/lib/document/document-edits.d.ts +0 -4
  85. package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
  86. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
  87. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  88. package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
  89. package/dist/types/lib/types/common-types.d.ts +0 -2
  90. package/dist/types/lib/types/explorer-types.d.ts +1 -1
  91. package/dist/types/lib/types/semantic-types.d.ts +6 -10
  92. package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
  93. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
  94. package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
  95. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
  96. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
  97. package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
  98. package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
  99. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
  100. package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
  101. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  102. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
  103. package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
  104. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
  105. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
  106. package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
  107. package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
  108. package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
  109. package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
  110. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
  111. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
  112. package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
  113. package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
  114. package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
  115. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
  116. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  117. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
  118. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
  119. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
  120. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  121. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  122. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
  123. package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
  124. package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
  125. package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
  126. package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
  127. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
  128. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
  129. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
  130. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
  131. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
  132. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
  133. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
  134. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
  135. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
  136. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
  137. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
  138. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
  139. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
  140. package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
  141. package/dist/types/shared/format-utils/index.d.ts +1 -0
  142. package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
  143. package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
  144. package/dist/types/shared/temporal/index.d.ts +2 -0
  145. package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
  146. package/dist/types/shared/temporal/temporal.d.ts +27 -0
  147. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
  148. package/dist/usage-events/index.js +1 -285
  149. package/dist/value-format-preferences/index.js +1 -635
  150. package/package.json +6 -2
  151. package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
  152. package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
  153. package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
  154. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
  155. package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
  156. package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
  157. package/dist/chunks/attribution-BvoKvhcj.js +0 -32
  158. package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
  159. package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
  160. package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
  161. package/dist/chunks/brand-BoUV0iHF.js +0 -54
  162. package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
  163. package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
  164. package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
  165. package/dist/chunks/context-BJoEFgNl.js +0 -369
  166. package/dist/chunks/conversation-sQiWYUOb.js +0 -16
  167. package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
  168. package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
  169. package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
  170. package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
  171. package/dist/chunks/dates-Bz-qM5px.js +0 -164
  172. package/dist/chunks/edit-9df1zOWe.js +0 -226
  173. package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
  174. package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
  175. package/dist/chunks/filter-line-BXT6y303.js +0 -703
  176. package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
  177. package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
  178. package/dist/chunks/index-BVKzKl5d.js +0 -90
  179. package/dist/chunks/index-BW0yozjs.js +0 -2795
  180. package/dist/chunks/index-CV_Kzou0.js +0 -595
  181. package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
  182. package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
  183. package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
  184. package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
  185. package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
  186. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
  187. package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
  188. package/dist/chunks/palette-CuA0HlzF.js +0 -23
  189. package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
  190. package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
  191. package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
  192. package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
  193. package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
  194. package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
  195. package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
  196. package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
  197. package/dist/chunks/resolver-DG_tfEpt.js +0 -156
  198. package/dist/chunks/save-BKHlDONy.js +0 -21
  199. package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
  200. package/dist/chunks/schema-C9NPiIru.js +0 -2568
  201. package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
  202. package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
  203. package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
  204. package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
  205. package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
  206. package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
  207. package/dist/chunks/token-types-D_xKgyVS.js +0 -8
  208. package/dist/chunks/upload-Dll_M7XQ.js +0 -15
  209. package/dist/chunks/validators-ClWHpYql.js +0 -3686
  210. package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
  211. package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
@@ -1,541 +0,0 @@
1
- import { T as p, a as g, b as k } from "./analytics-base-schemas-DevrgqQb.js";
2
- import { p as C } from "./validators-ClWHpYql.js";
3
- function N(e) {
4
- switch (e.kind) {
5
- case "monthDay":
6
- return {
7
- subDay: !1,
8
- dataAnchored: !1,
9
- bounds: { start: "day", end: "day" },
10
- comparesBySpan: !1,
11
- printsByName: !1,
12
- dayPickerDefault: !0,
13
- monthPickerDefault: !1
14
- };
15
- case "rolling": {
16
- const r = e.unit === "minute" || e.unit === "hour", o = e.anchor === "latest_data";
17
- return {
18
- subDay: r,
19
- dataAnchored: o,
20
- bounds: { start: "instant", end: "instant" },
21
- comparesBySpan: !1,
22
- printsByName: o || e.unit === "quarter" || e.unit === "year",
23
- dayPickerDefault: !1,
24
- monthPickerDefault: !1,
25
- span: { unit: e.unit, n: e.n, complete: !1 }
26
- };
27
- }
28
- case "periods": {
29
- const { unit: r, from: o, to: n, toDate: t } = e, a = e.anchor === "latest_data", s = e.anchor === "now", l = !!t && s, m = o === n;
30
- return {
31
- subDay: !1,
32
- dataAnchored: a,
33
- ...l && o === 0 ? { periodToDate: r } : {},
34
- // Measured from the end of a complete period, a "to date" window ends on a whole day.
35
- bounds: { start: "day", end: l ? "instant" : "day" },
36
- comparesBySpan: typeof e.anchor == "object",
37
- printsByName: a || r === "quarter" || r === "year",
38
- dayPickerDefault: r === "day" && m && s,
39
- monthPickerDefault: r === "month" && m && (o === 0 || o === -1) && s && !t,
40
- span: { unit: r, n: n - o + 1, complete: n < 0 }
41
- };
42
- }
43
- }
44
- }
45
- function h(e) {
46
- const r = k.safeParse(e);
47
- return r.success ? { ok: !0, value: r.data } : {
48
- ok: !1,
49
- error: {
50
- code: p.invalidMetadata,
51
- message: "Temporal bucket metadata is invalid.",
52
- path: "temporalBucket"
53
- }
54
- };
55
- }
56
- function f(e, r) {
57
- if (!e.temporalBucket)
58
- return r.metadataRequired ? {
59
- ok: !1,
60
- error: {
61
- code: p.missingMetadata,
62
- message: "Activated temporal bucket result is missing metadata.",
63
- path: "temporalBucket"
64
- }
65
- } : { ok: !0 };
66
- const o = h(
67
- e.temporalBucket
68
- );
69
- if (!o.ok || !o.value)
70
- return o;
71
- const n = g(
72
- o.value.granularity
73
- );
74
- return e.dataType !== n ? {
75
- ok: !1,
76
- error: {
77
- code: p.invalidMetadata,
78
- message: `${o.value.granularity} temporal buckets require dataType ${n}.`,
79
- path: "dataType"
80
- }
81
- } : o;
82
- }
83
- function y(e, r) {
84
- var o, n, t, a;
85
- return e.granularity === r.granularity && e.calendar.tz === r.calendar.tz && e.calendar.weekStart === r.calendar.weekStart && ((o = e.calendar.fiscalCalendar) == null ? void 0 : o.kind) === ((n = r.calendar.fiscalCalendar) == null ? void 0 : n.kind) && ((t = e.calendar.fiscalCalendar) == null ? void 0 : t.yearStartMonth) === ((a = r.calendar.fiscalCalendar) == null ? void 0 : a.yearStartMonth);
86
- }
87
- function A(e, r) {
88
- const o = /* @__PURE__ */ new Map();
89
- for (const n of e) {
90
- if (o.has(n.key))
91
- return {
92
- ok: !1,
93
- error: {
94
- code: p.invalidMetadata,
95
- message: `Canonical result contains duplicate column key "${n.key}".`,
96
- path: "columns"
97
- }
98
- };
99
- if (o.set(n.key, n), n.temporalBucket) {
100
- const t = f(n, {
101
- metadataRequired: !1
102
- });
103
- if (!t.ok)
104
- return {
105
- ok: !1,
106
- error: {
107
- ...t.error,
108
- path: `columns.${n.key}.${t.error.path || "temporalBucket"}`
109
- }
110
- };
111
- }
112
- }
113
- for (const n of r) {
114
- const t = o.get(n.key);
115
- if (!t)
116
- return {
117
- ok: !1,
118
- error: {
119
- code: p.missingMetadata,
120
- message: `Activated temporal bucket result is missing column "${n.key}".`,
121
- path: `columns.${n.key}`
122
- }
123
- };
124
- const a = f(t, {
125
- metadataRequired: !0
126
- });
127
- if (!a.ok)
128
- return {
129
- ok: !1,
130
- error: {
131
- ...a.error,
132
- path: `columns.${n.key}.${a.error.path || "temporalBucket"}`
133
- }
134
- };
135
- if (!a.value || !y(a.value, n.metadata))
136
- return {
137
- ok: !1,
138
- error: {
139
- code: p.invalidMetadata,
140
- message: `Temporal bucket metadata for column "${n.key}" contradicts the governed query context.`,
141
- path: `columns.${n.key}.temporalBucket`
142
- }
143
- };
144
- }
145
- return { ok: !0, value: e };
146
- }
147
- const $ = "higher_is_better", I = {
148
- displayMode: "difference",
149
- showComparison: !0,
150
- indicatorStyle: "arrow_badge",
151
- showColor: !0,
152
- conditionalLabel: !1
153
- };
154
- function w(e) {
155
- return C(e) !== null;
156
- }
157
- function B(e) {
158
- var r, o, n, t;
159
- if (((r = e.metricComparison) == null ? void 0 : r.mode) !== "off") {
160
- if (((o = e.metricComparison) == null ? void 0 : o.mode) === "explicit")
161
- return { source: "explicit", spec: e.metricComparison.spec };
162
- if (!((e.inheritGlobalComparison ?? ((n = e.globalDateComparison) == null ? void 0 : n.inheritGlobalComparison)) === !1 || ((t = e.globalDateComparison) == null ? void 0 : t.selection.mode) !== "period"))
163
- return {
164
- source: "inherited",
165
- spec: e.globalDateComparison.selection.spec,
166
- ...e.globalDateComparison.owner ? { owner: e.globalDateComparison.owner } : {}
167
- };
168
- }
169
- }
170
- function P(e) {
171
- if (e.alias) return e.alias;
172
- const r = e.entityName && e.entityName !== "SEMAPHOR_CALCULATED_FIELD" ? e.entityName : void 0, o = r && r !== e.name ? `${r}_` : "";
173
- if (e.role !== "metric") return `${o}${e.name}`;
174
- let n = e.aggregate || "metric";
175
- if (e.expression) {
176
- const t = e.expression.match(
177
- /^(COUNT|SUM|AVG|MIN|MAX|MEDIAN|DISTINCT)\s*\(/i
178
- );
179
- n = t ? t[1].toLowerCase() : "expr";
180
- } else
181
- n = n.toLowerCase();
182
- return `${o}${e.name}_${n}`;
183
- }
184
- function i(e, r, o) {
185
- return o ? { code: e, message: r, path: o } : { code: e, message: r };
186
- }
187
- function d(e) {
188
- return !!e && typeof e == "object" && !Array.isArray(e);
189
- }
190
- function c(e, r, o, n) {
191
- Object.keys(e).forEach((t) => {
192
- r.includes(t) || n.push(
193
- i(
194
- "invalid_comparison_spec",
195
- `Comparison kind does not accept field "${t}".`,
196
- `${o}.${t}`
197
- )
198
- );
199
- });
200
- }
201
- function u(e, r, o) {
202
- e.alignment !== void 0 && e.alignment !== "calendar" && e.alignment !== "weekday" && o.push(
203
- i(
204
- "invalid_comparison_spec",
205
- 'Comparison alignment must be "calendar" or "weekday".',
206
- `${r}.alignment`
207
- )
208
- ), e.toDate !== void 0 && typeof e.toDate != "boolean" && o.push(
209
- i(
210
- "invalid_comparison_spec",
211
- "Comparison toDate must be a boolean.",
212
- `${r}.toDate`
213
- )
214
- );
215
- }
216
- function b(e, r, o) {
217
- e !== void 0 && (typeof e != "number" || !Number.isSafeInteger(e) || e <= 0) && o.push(
218
- i(
219
- "invalid_comparison_spec",
220
- "Comparison offset must be a positive safe integer.",
221
- r
222
- )
223
- );
224
- }
225
- function _(e, r = "comparison") {
226
- const o = [];
227
- return d(e) ? (e.kind === "previous_period" ? (c(
228
- e,
229
- ["kind", "offsetPeriods", "alignment", "toDate"],
230
- r,
231
- o
232
- ), b(e.offsetPeriods, `${r}.offsetPeriods`, o), u(e, r, o)) : e.kind === "previous_year" ? (c(
233
- e,
234
- ["kind", "offsetYears", "alignment", "toDate"],
235
- r,
236
- o
237
- ), b(e.offsetYears, `${r}.offsetYears`, o), u(e, r, o)) : e.kind === "target" ? (c(e, ["kind", "targetValue"], r, o), (typeof e.targetValue != "number" || !Number.isFinite(e.targetValue)) && o.push(
238
- i(
239
- "invalid_comparison_spec",
240
- "Target comparison requires a finite targetValue.",
241
- `${r}.targetValue`
242
- )
243
- )) : o.push(
244
- i(
245
- "invalid_comparison_spec",
246
- "Comparison kind must be previous_period, previous_year, or target.",
247
- `${r}.kind`
248
- )
249
- ), { ok: o.length === 0, errors: o, warnings: [] }) : {
250
- ok: !1,
251
- errors: [
252
- i(
253
- "invalid_comparison_spec",
254
- "Comparison spec must be an object.",
255
- r
256
- )
257
- ],
258
- warnings: []
259
- };
260
- }
261
- function R(e, r = "comparison") {
262
- if (!d(e))
263
- return {
264
- ok: !1,
265
- errors: [
266
- i(
267
- "invalid_comparison_config",
268
- "Comparison config must be an object.",
269
- r
270
- )
271
- ],
272
- warnings: []
273
- };
274
- const o = [];
275
- return e.mode === "off" ? c(e, ["mode"], r, o) : e.mode === "explicit" ? (c(e, ["mode", "spec"], r, o), o.push(..._(e.spec, `${r}.spec`).errors)) : o.push(
276
- i(
277
- "invalid_comparison_config",
278
- "Comparison mode must be off or explicit.",
279
- `${r}.mode`
280
- )
281
- ), { ok: o.length === 0, errors: o, warnings: [] };
282
- }
283
- function D(e, r = "comparisonSelection") {
284
- if (!d(e))
285
- return {
286
- ok: !1,
287
- errors: [
288
- i(
289
- "invalid_global_date_comparison",
290
- "Global Date comparison selection must be an object.",
291
- r
292
- )
293
- ],
294
- warnings: []
295
- };
296
- const o = [];
297
- if (e.mode === "off")
298
- c(e, ["mode"], r, o);
299
- else if (e.mode === "period") {
300
- c(e, ["mode", "spec"], r, o);
301
- const n = _(e.spec, `${r}.spec`);
302
- o.push(...n.errors), d(e.spec) && e.spec.kind === "target" && o.push(
303
- i(
304
- "invalid_global_date_comparison",
305
- "Global Date comparison supports previous_period or previous_year, not target.",
306
- `${r}.spec.kind`
307
- )
308
- );
309
- } else
310
- o.push(
311
- i(
312
- "invalid_global_date_comparison",
313
- "Global Date comparison mode must be off or period.",
314
- `${r}.mode`
315
- )
316
- );
317
- return { ok: o.length === 0, errors: o, warnings: [] };
318
- }
319
- function E(e, r = "globalDateComparison") {
320
- if (!d(e))
321
- return {
322
- ok: !1,
323
- errors: [
324
- i(
325
- "invalid_global_date_comparison",
326
- "Global Date comparison context must be an object.",
327
- r
328
- )
329
- ],
330
- warnings: []
331
- };
332
- const o = [];
333
- return c(
334
- e,
335
- ["selection", "inheritGlobalComparison", "owner", "referenceTime"],
336
- r,
337
- o
338
- ), o.push(
339
- ...D(
340
- e.selection,
341
- `${r}.selection`
342
- ).errors
343
- ), e.inheritGlobalComparison !== void 0 && e.inheritGlobalComparison !== !1 && o.push(
344
- i(
345
- "invalid_global_date_comparison",
346
- "inheritGlobalComparison may only be false when present.",
347
- `${r}.inheritGlobalComparison`
348
- )
349
- ), e.owner !== void 0 && (d(e.owner) ? e.owner.kind === "global_date" ? c(e.owner, ["kind"], `${r}.owner`, o) : e.owner.kind === "field_date" ? (c(
350
- e.owner,
351
- ["kind", "filterId", "label"],
352
- `${r}.owner`,
353
- o
354
- ), (typeof e.owner.filterId != "string" || !e.owner.filterId.trim()) && o.push(
355
- i(
356
- "invalid_global_date_comparison",
357
- "Field Date comparison owner requires a non-empty filterId.",
358
- `${r}.owner.filterId`
359
- )
360
- ), (typeof e.owner.label != "string" || !e.owner.label.trim()) && o.push(
361
- i(
362
- "invalid_global_date_comparison",
363
- "Field Date comparison owner requires a non-empty label.",
364
- `${r}.owner.label`
365
- )
366
- )) : o.push(
367
- i(
368
- "invalid_global_date_comparison",
369
- "Comparison owner kind must be global_date or field_date.",
370
- `${r}.owner.kind`
371
- )
372
- ) : o.push(
373
- i(
374
- "invalid_global_date_comparison",
375
- "Comparison owner must be an object.",
376
- `${r}.owner`
377
- )
378
- )), e.referenceTime !== void 0 && (typeof e.referenceTime != "string" || !w(e.referenceTime)) && o.push(
379
- i(
380
- "invalid_global_date_comparison",
381
- "referenceTime must be a valid ISO date-time string when present.",
382
- `${r}.referenceTime`
383
- )
384
- ), { ok: o.length === 0, errors: o, warnings: [] };
385
- }
386
- function O(e) {
387
- const { referenceTime: r, ...o } = e;
388
- return o;
389
- }
390
- function G(e, r = "comparisonPolarity") {
391
- return e === "higher_is_better" || e === "lower_is_better" || e === "neutral" ? { ok: !0, errors: [], warnings: [] } : {
392
- ok: !1,
393
- errors: [
394
- i(
395
- "invalid_comparison_polarity",
396
- "Comparison polarity must be higher_is_better, lower_is_better, or neutral.",
397
- r
398
- )
399
- ],
400
- warnings: []
401
- };
402
- }
403
- function L(e, r = "comparisonPresentation") {
404
- if (!d(e))
405
- return {
406
- ok: !1,
407
- errors: [
408
- i(
409
- "invalid_comparison_presentation",
410
- "Comparison presentation must be an object.",
411
- r
412
- )
413
- ],
414
- warnings: []
415
- };
416
- const o = [], n = [
417
- "displayMode",
418
- "showComparison",
419
- "precision",
420
- "indicatorStyle",
421
- "showColor",
422
- "position",
423
- "conditionalLabel",
424
- "labelName",
425
- "conditionalLabels",
426
- "colors"
427
- ];
428
- return Object.keys(e).forEach((a) => {
429
- n.includes(a) || o.push(
430
- i(
431
- "invalid_comparison_presentation",
432
- `Comparison presentation does not accept field "${a}".`,
433
- `${r}.${a}`
434
- )
435
- );
436
- }), [
437
- ["displayMode", ["difference", "percent_change", "both", "ratio"]],
438
- ["indicatorStyle", ["arrow_badge", "arrow", "badge", "none"]],
439
- ["position", ["left", "right", "top"]]
440
- ].forEach(([a, s]) => {
441
- e[a] !== void 0 && !s.includes(e[a]) && o.push(
442
- i(
443
- "invalid_comparison_presentation",
444
- `Comparison presentation ${a} is invalid.`,
445
- `${r}.${a}`
446
- )
447
- );
448
- }), ["showComparison", "showColor", "conditionalLabel"].forEach((a) => {
449
- e[a] !== void 0 && typeof e[a] != "boolean" && o.push(
450
- i(
451
- "invalid_comparison_presentation",
452
- `Comparison presentation ${a} must be a boolean.`,
453
- `${r}.${a}`
454
- )
455
- );
456
- }), e.precision !== void 0 && (typeof e.precision != "number" || !Number.isInteger(e.precision) || e.precision < 0 || e.precision > 6) && o.push(
457
- i(
458
- "invalid_comparison_presentation",
459
- "Comparison presentation precision must be an integer from 0 through 6.",
460
- `${r}.precision`
461
- )
462
- ), e.labelName !== void 0 && typeof e.labelName != "string" && o.push(
463
- i(
464
- "invalid_comparison_presentation",
465
- "Comparison presentation labelName must be a string.",
466
- `${r}.labelName`
467
- )
468
- ), ["conditionalLabels", "colors"].forEach((a) => {
469
- const s = e[a];
470
- if (s !== void 0) {
471
- if (!d(s)) {
472
- o.push(
473
- i(
474
- "invalid_comparison_presentation",
475
- `Comparison presentation ${a} must be an object.`,
476
- `${r}.${a}`
477
- )
478
- );
479
- return;
480
- }
481
- Object.keys(s).forEach((l) => {
482
- ["increase", "decrease", "neutral"].includes(l) || o.push(
483
- i(
484
- "invalid_comparison_presentation",
485
- `Comparison presentation ${a} does not accept field "${l}".`,
486
- `${r}.${a}.${l}`
487
- )
488
- );
489
- }), Object.entries(s).forEach(([l, m]) => {
490
- m !== void 0 && typeof m != "string" && o.push(
491
- i(
492
- "invalid_comparison_presentation",
493
- `Comparison presentation ${a}.${l} must be a string.`,
494
- `${r}.${a}.${l}`
495
- )
496
- );
497
- });
498
- }
499
- }), { ok: o.length === 0, errors: o, warnings: [] };
500
- }
501
- function T(e) {
502
- return e === null ? "unknown" : e > 0 ? "increase" : e < 0 ? "decrease" : "no_change";
503
- }
504
- function v(e, r) {
505
- return e === "unknown" || e === "no_change" || r === "neutral" ? "neutral" : r === "higher_is_better" && e === "increase" || r === "lower_is_better" && e === "decrease" ? "favorable" : "unfavorable";
506
- }
507
- function j(e) {
508
- const {
509
- currentValue: r,
510
- comparisonValue: o,
511
- polarity: n = $
512
- } = e, a = r !== null && o !== null ? r - o : null, s = a !== null && o !== null && o !== 0 ? a / Math.abs(o) : null, l = r !== null && o !== null && o !== 0 ? r / o : null, m = T(a);
513
- return {
514
- status: o === null ? "insufficient_history" : "available",
515
- currentValue: r,
516
- comparisonValue: o,
517
- delta: a,
518
- percentChange: s,
519
- ratio: l,
520
- direction: m,
521
- sentiment: v(m, n)
522
- };
523
- }
524
- export {
525
- I as C,
526
- $ as D,
527
- N as a,
528
- B as b,
529
- _ as c,
530
- R as d,
531
- D as e,
532
- E as f,
533
- G as g,
534
- L as h,
535
- j as i,
536
- f as j,
537
- A as k,
538
- P as r,
539
- h as v,
540
- O as w
541
- };
@@ -1,119 +0,0 @@
1
- import { useState as D, useRef as y, useEffect as h, useCallback as x } from "react";
2
- const L = (n) => JSON.stringify(n, (e, r) => !r || typeof r != "object" || Array.isArray(r) ? r : Object.keys(r).sort().reduce((t, i) => (t[i] = r[i], t), {}));
3
- function F(n, e, r = 300, t = 1e3, i) {
4
- const [C, f] = D(!1), [I, c] = D(!1), a = y(null), o = y(0), T = y(n), g = y(e), l = i || L;
5
- h(() => {
6
- o.current += 1;
7
- const m = o.current, w = T.current !== n, N = g.current !== e;
8
- if (T.current = n, g.current = e, e === null) {
9
- const u = window.setTimeout(() => {
10
- m === o.current && (f(!1), c(!1));
11
- }, 0);
12
- return () => clearTimeout(u);
13
- }
14
- if (N && !w) {
15
- const u = window.setTimeout(() => {
16
- if (m === o.current) {
17
- const s = l(n), d = l(e);
18
- f(s !== d), c(!1);
19
- }
20
- }, 0);
21
- return () => clearTimeout(u);
22
- }
23
- const k = w ? window.setTimeout(() => {
24
- m === o.current && c(!0);
25
- }, 0) : null, R = setTimeout(() => {
26
- const u = window.requestIdleCallback || ((s) => window.setTimeout(
27
- () => s({
28
- didTimeout: !1,
29
- timeRemaining: () => 50
30
- }),
31
- 1
32
- ));
33
- a.current = u(
34
- (s) => {
35
- if (s.timeRemaining() > 0 || s.didTimeout) {
36
- if (m !== o.current) return;
37
- const d = l(n), p = l(e);
38
- f(d !== p), c(!1);
39
- }
40
- },
41
- { timeout: t }
42
- );
43
- }, r);
44
- return () => {
45
- k !== null && clearTimeout(k), clearTimeout(R), a.current !== null && ((window.cancelIdleCallback || window.clearTimeout)(a.current), a.current = null);
46
- };
47
- }, [n, e, r, t, l]);
48
- const A = x(() => {
49
- f(!1), c(!1);
50
- }, []);
51
- return {
52
- isDirty: e === null ? !1 : C,
53
- isDirtyPending: e === null ? !1 : I,
54
- resetDirty: A
55
- };
56
- }
57
- const O = [
58
- "i",
59
- "x",
60
- "y",
61
- "w",
62
- "h",
63
- "minW",
64
- "minH",
65
- "maxW",
66
- "maxH",
67
- "static",
68
- "isResizable",
69
- "isDraggable"
70
- ];
71
- function P(n, e, r) {
72
- n[e] = r;
73
- }
74
- function j(n) {
75
- const e = {};
76
- for (const r of O) {
77
- const t = n[r];
78
- t !== void 0 && ((r === "isResizable" || r === "isDraggable") && t === !0 || P(e, r, t));
79
- }
80
- return e;
81
- }
82
- function b(n) {
83
- return n ? n.map(j).sort((e, r) => {
84
- const t = String(e.i ?? ""), i = String(r.i ?? "");
85
- return t !== i ? t.localeCompare(i) : Number(e.y ?? 0) - Number(r.y ?? 0) || Number(e.x ?? 0) - Number(r.x ?? 0) || Number(e.h ?? 0) - Number(r.h ?? 0) || Number(e.w ?? 0) - Number(r.w ?? 0);
86
- }) : [];
87
- }
88
- function z(n) {
89
- if (!n) return;
90
- const e = {};
91
- for (const r of Object.keys(n).sort()) {
92
- const t = n[r];
93
- t && (e[r] = b(t));
94
- }
95
- return e;
96
- }
97
- function S(n) {
98
- var e;
99
- return n ? {
100
- ...n,
101
- sheets: (e = n.sheets) == null ? void 0 : e.map((r) => {
102
- if (!r) return r;
103
- const t = {
104
- ...r
105
- };
106
- return r.layout && (t.layout = b(r.layout)), r.layouts && (t.layouts = z(r.layouts)), t;
107
- })
108
- } : null;
109
- }
110
- function _(n) {
111
- return JSON.stringify(n ?? null, function(e, r) {
112
- return e === "layout" && Array.isArray(r) ? b(r) : e === "layouts" && r && typeof r == "object" && !Array.isArray(r) ? z(r) : !r || typeof r != "object" || Array.isArray(r) ? r : Object.keys(r).sort().reduce((t, i) => (t[i] = r[i], t), {});
113
- });
114
- }
115
- export {
116
- S as n,
117
- _ as s,
118
- F as u
119
- };
@@ -1,27 +0,0 @@
1
- import { c as a } from "./style-sheet-parts-Bt9ZNre8.js";
2
- /**
3
- * @license lucide-react v0.453.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const c = a("Paintbrush", [
9
- ["path", { d: "m14.622 17.897-10.68-2.913", key: "vj2p1u" }],
10
- [
11
- "path",
12
- {
13
- d: "M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",
14
- key: "18tc5c"
15
- }
16
- ],
17
- [
18
- "path",
19
- {
20
- d: "M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",
21
- key: "ytzfxy"
22
- }
23
- ]
24
- ]);
25
- export {
26
- c as P
27
- };
@@ -1,23 +0,0 @@
1
- import { c } from "./style-sheet-parts-Bt9ZNre8.js";
2
- /**
3
- * @license lucide-react v0.453.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const e = c("Palette", [
9
- ["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
10
- ["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
11
- ["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }],
12
- ["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
13
- [
14
- "path",
15
- {
16
- d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",
17
- key: "12rzf8"
18
- }
19
- ]
20
- ]);
21
- export {
22
- e as P
23
- };