react-semaphor 0.1.568 → 0.1.570

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 (191) hide show
  1. package/README.md +0 -7
  2. package/dist/analytics-protocol/index.js +434 -454
  3. package/dist/appearance/index.js +6 -3
  4. package/dist/appearance-runtime/index.js +1 -1
  5. package/dist/assistant-context/index.js +1 -1
  6. package/dist/brand-studio/index.js +572 -436
  7. package/dist/briefings/index.js +4 -4
  8. package/dist/chunks/appearance-context-BwBp25ZG.js +162 -0
  9. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +80 -0
  10. package/dist/chunks/assistant-chat-B-Ddyy8b.js +5940 -0
  11. package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-DCYD-6Fr.js} +2 -2
  12. package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
  13. package/dist/chunks/brand-B4BdpAB_.js +54 -0
  14. package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-0VvKmRst.js} +992 -991
  15. package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-PtcDWvkN.js} +252 -253
  16. package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-DxGIr1vZ.js} +1 -1
  17. package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-B-quOOOQ.js} +253 -253
  18. package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-Caodx80b.js} +288 -285
  19. package/dist/chunks/dashboard-json-Ct-AGDHF.js +66 -0
  20. package/dist/chunks/{dates-CKO05ino.js → dates-B9mL8BHE.js} +16 -15
  21. package/dist/chunks/edit-Bpdh_P_a.js +226 -0
  22. package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-DeDTuYB5.js} +2257 -2270
  23. package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-BSY33ro5.js} +1440 -1301
  24. package/dist/chunks/filter-value-text-DvvSNlho.js +146 -0
  25. package/dist/chunks/index-BVKzKl5d.js +90 -0
  26. package/dist/chunks/{index-RNaTnE3m.js → index-CV_Kzou0.js} +233 -223
  27. package/dist/chunks/{index-CPNZW0mu.js → index-y3HUzRNk.js} +76 -77
  28. package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-8rR-LPTk.js} +1 -1
  29. package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C1-uTgjR.js} +1 -1
  30. package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
  31. package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
  32. package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
  33. package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
  34. package/dist/chunks/paintbrush-aR17Z3C9.js +27 -0
  35. package/dist/chunks/{palette-4vf2BEEg.js → palette-a5FCZKFI.js} +1 -1
  36. package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → pickers-DkqmtnTL.js} +352 -290
  37. package/dist/chunks/pivot-result-contract-expectations-C-HnUKYe.js +55 -0
  38. package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
  39. package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
  40. package/dist/chunks/{report-preferences-dialog-Mbd-I0wV.js → report-preferences-dialog-Yvhv3WX2.js} +95 -97
  41. package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
  42. package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-Lkbwycwe.js} +5491 -5683
  43. package/dist/chunks/resolver-DG_tfEpt.js +156 -0
  44. package/dist/chunks/{save-D6pHmSSP.js → save-D985VvYp.js} +1 -1
  45. package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-DC_TEd6y.js} +6 -6
  46. package/dist/chunks/schema-C9NPiIru.js +2568 -0
  47. package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-ByFvqHEO.js} +35916 -36001
  48. package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-CjoVaK6J.js} +64 -66
  49. package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-C0hekXiI.js} +332 -333
  50. package/dist/chunks/{code-editor-DJNOsgJH.js → style-sheet-parts-C7qGZuH1.js} +2402 -2040
  51. package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-CP8zSOhj.js} +1 -1
  52. package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-CqbJjIuu.js} +18 -18
  53. package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
  54. package/dist/chunks/{upload-Cf3wXZT8.js → upload-CiGNKJ_0.js} +1 -1
  55. package/dist/chunks/validators-B8fpdinG.js +3651 -0
  56. package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-9-huI1h4.js} +4 -4
  57. package/dist/dashboard/index.js +2 -2
  58. package/dist/dashboard-authoring/index.js +1888 -1826
  59. package/dist/format-utils/index.js +230 -231
  60. package/dist/index.js +349 -353
  61. package/dist/layouts/index.js +1 -1
  62. package/dist/report-runtime-context/index.js +1 -1
  63. package/dist/style.css +1 -1
  64. package/dist/surfboard/index.js +2 -2
  65. package/dist/types/appearance/index.d.ts +1 -0
  66. package/dist/types/brand-studio/brand-studio-draft.d.ts +7 -0
  67. package/dist/types/brand-studio/index.d.ts +1 -1
  68. package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
  69. package/dist/types/components/providers/appearance-runtime-provider.d.ts +4 -1
  70. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -2
  71. package/dist/types/components/sharing-and-management/utils/types.d.ts +0 -72
  72. package/dist/types/components/surfboard/filter/types.d.ts +5 -4
  73. package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
  74. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -1
  75. package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -9
  76. package/dist/types/components/visual/data-table/utils/pagination-utils.d.ts +0 -19
  77. package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -1
  78. package/dist/types/index.js +9 -9
  79. package/dist/types/lib/appearance/aliases.d.ts +42 -0
  80. package/dist/types/lib/appearance/compiler.d.ts +6 -0
  81. package/dist/types/lib/appearance/defaults.d.ts +6 -0
  82. package/dist/types/lib/appearance/index.d.ts +2 -0
  83. package/dist/types/lib/appearance/normalize-organization.d.ts +17 -0
  84. package/dist/types/lib/appearance/resolver.d.ts +2 -2
  85. package/dist/types/lib/appearance/types.d.ts +38 -1
  86. package/dist/types/lib/charts/types.d.ts +6 -2
  87. package/dist/types/lib/dashboard/semantic-dataset-references.d.ts +0 -1
  88. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +0 -2
  89. package/dist/types/lib/dashboard-variables/types.d.ts +1 -6
  90. package/dist/types/lib/download-pdf.d.ts +0 -1
  91. package/dist/types/lib/hooks/use-dashboard.d.ts +3 -4
  92. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  93. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  94. package/dist/types/lib/stores/dashboard-store.d.ts +15 -6
  95. package/dist/types/lib/stores/editor-store.d.ts +0 -1
  96. package/dist/types/lib/stores/table-actions.d.ts +0 -1
  97. package/dist/types/lib/table-formatting/table-formatting-css.d.ts +0 -5
  98. package/dist/types/lib/types/common-types.d.ts +3 -2
  99. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  100. package/dist/types/lib/types/index.d.ts +1 -1
  101. package/dist/types/lib/types/summary-types.d.ts +0 -5
  102. package/dist/types/lib/utils/card-definition.d.ts +7 -7
  103. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
  104. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +4 -4
  105. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
  106. package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
  107. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +10 -10
  108. package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
  109. package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
  110. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +72 -72
  111. package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
  112. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
  113. package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
  114. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
  115. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
  116. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
  117. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
  118. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
  119. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
  120. package/dist/types/shared/assistant-protocol/context.d.ts +30 -30
  121. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
  122. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +344 -1772
  123. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +4 -1
  124. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
  125. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +9 -0
  126. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +104 -104
  127. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
  128. package/dist/types/shared/dashboard-authoring/dashboard-style/bounds.d.ts +17 -0
  129. package/dist/types/shared/dashboard-authoring/dashboard-style/brand.d.ts +20 -0
  130. package/dist/types/shared/dashboard-authoring/dashboard-style/edit-words.d.ts +7 -0
  131. package/dist/types/shared/dashboard-authoring/dashboard-style/edit.d.ts +19 -0
  132. package/dist/types/shared/dashboard-authoring/dashboard-style/index.d.ts +15 -0
  133. package/dist/types/shared/dashboard-authoring/dashboard-style/layers.d.ts +19 -0
  134. package/dist/types/shared/dashboard-authoring/dashboard-style/legacy.d.ts +21 -0
  135. package/dist/types/shared/dashboard-authoring/dashboard-style/parse.d.ts +18 -0
  136. package/dist/types/shared/dashboard-authoring/dashboard-style/pickers.d.ts +12 -0
  137. package/dist/types/shared/dashboard-authoring/dashboard-style/types.d.ts +122 -0
  138. package/dist/types/shared/dashboard-authoring/dashboard-style/view.d.ts +10 -0
  139. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  140. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +11 -0
  141. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +23 -0
  142. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
  143. package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
  144. package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
  145. package/dist/types/shared/format-utils/matrix-continuation.d.ts +10 -10
  146. package/dist/types/shared/temporal/index.d.ts +0 -2
  147. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
  148. package/package.json +7 -26
  149. package/DATA_APP_SDK.md +0 -339
  150. package/dist/chunks/appearance-context-DEYtWinQ.js +0 -126
  151. package/dist/chunks/appearance-runtime-provider-B-M8gwlZ.js +0 -81
  152. package/dist/chunks/assistant-chat-BN5I8KuN.js +0 -8849
  153. package/dist/chunks/color-CJvdlFM_.js +0 -2162
  154. package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
  155. package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
  156. package/dist/chunks/index-CLIro-EG.js +0 -425
  157. package/dist/chunks/index-CuHybtft.js +0 -51
  158. package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
  159. package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
  160. package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
  161. package/dist/chunks/operators-B3zZoskU.js +0 -66
  162. package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
  163. package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
  164. package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
  165. package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
  166. package/dist/chunks/validators-wtjw0aw6.js +0 -3332
  167. package/dist/data-app-sdk/index.js +0 -1412
  168. package/dist/data-app-sdk-adapters/index.js +0 -361
  169. package/dist/data-app-sdk-validation/index.js +0 -1031
  170. package/dist/types/components/sharing-and-management/utils/group-types.d.ts +0 -105
  171. package/dist/types/data-app-sdk/adapters.d.ts +0 -35
  172. package/dist/types/data-app-sdk/builders.d.ts +0 -62
  173. package/dist/types/data-app-sdk/contracts.d.ts +0 -419
  174. package/dist/types/data-app-sdk/executor.d.ts +0 -5
  175. package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
  176. package/dist/types/data-app-sdk/hooks.d.ts +0 -11
  177. package/dist/types/data-app-sdk/index.d.ts +0 -9
  178. package/dist/types/data-app-sdk/provider.d.ts +0 -8
  179. package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
  180. package/dist/types/data-app-sdk/selection.d.ts +0 -2
  181. package/dist/types/data-app-sdk/validation.d.ts +0 -58
  182. package/dist/types/data-app-sdk-adapters.d.ts +0 -2
  183. package/dist/types/data-app-sdk-validation.d.ts +0 -2
  184. package/dist/types/data-app-sdk.d.ts +0 -2
  185. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
  186. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
  187. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
  188. package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
  189. package/dist/types/shared/temporal/relative-date.d.ts +0 -21
  190. package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
  191. package/src/data-app-sdk/README.md +0 -402
@@ -0,0 +1,66 @@
1
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
+ import { useMemo as u, useState as f, useRef as b, useEffect as p } from "react";
3
+ import { u as o } from "./semaphor-ready-indicator-ByFvqHEO.js";
4
+ import { B as S, X as N, C as D } from "./style-sheet-parts-C7qGZuH1.js";
5
+ import { c as J } from "./pickers-DkqmtnTL.js";
6
+ import "./validators-B8fpdinG.js";
7
+ import "./matrix-operation-contract-DCVinw1o.js";
8
+ import "./analytics-base-schemas-BaIQrEzX.js";
9
+ import "../value-format-preferences/index.js";
10
+ function z() {
11
+ const r = o((s) => s.dashboard), c = o((s) => s.actions.setDashboard), h = o(
12
+ (s) => s.showDashboardJSON
13
+ ), l = o(
14
+ (s) => s.actions.setShowDashboardJSON
15
+ ), a = u(
16
+ () => r ? JSON.stringify(r, null, 2) : "",
17
+ [r]
18
+ ), [m, n] = f(a), e = b(a);
19
+ return p(() => {
20
+ a !== e.current && (n(a), e.current = a);
21
+ }, [a]), /* @__PURE__ */ d(
22
+ "div",
23
+ {
24
+ className: J("relative p-2", {
25
+ hidden: !h
26
+ }),
27
+ children: [
28
+ /* @__PURE__ */ d(
29
+ S,
30
+ {
31
+ variant: "secondary",
32
+ size: "sm",
33
+ className: "absolute right-2 top-2 z-10 h-8",
34
+ onClick: () => l(!1),
35
+ children: [
36
+ /* @__PURE__ */ t(N, { className: "mr-2 h-4 w-4" }),
37
+ "Close"
38
+ ]
39
+ }
40
+ ),
41
+ /* @__PURE__ */ t("div", { className: "h-[550px] overflow-hidden", children: /* @__PURE__ */ t(
42
+ D,
43
+ {
44
+ value: m,
45
+ onValueChange: (s) => {
46
+ n(s);
47
+ try {
48
+ const i = JSON.parse(s);
49
+ e.current = JSON.stringify(
50
+ i,
51
+ null,
52
+ 2
53
+ ), c(i);
54
+ } catch {
55
+ }
56
+ },
57
+ language: "json"
58
+ }
59
+ ) })
60
+ ]
61
+ }
62
+ );
63
+ }
64
+ export {
65
+ z as default
66
+ };
@@ -1,16 +1,17 @@
1
- import { h as D, d as F, r as b, a as f, e as g } from "./resolve-dashboard-input-context-Du0fjN3h.js";
2
- import { d as h } from "./filter-reach-copy-jZGzK_IH.js";
3
- import "./validators-wtjw0aw6.js";
4
- import "./matrix-operation-contract-Eb6elidS.js";
1
+ import { h as D, d as F, r as b, a as f, e as g } from "./resolve-dashboard-input-context-Lkbwycwe.js";
2
+ import { d as h } from "./filter-reach-copy-BSY33ro5.js";
3
+ import "./validators-B8fpdinG.js";
4
+ import "./matrix-operation-contract-DCVinw1o.js";
5
5
  import "./analytics-base-schemas-BaIQrEzX.js";
6
6
  import "zod";
7
- import "./temporal-input-presentation--2r9BLr0.js";
7
+ import "./temporal-input-presentation-CqbJjIuu.js";
8
8
  import "../value-format-preferences/index.js";
9
- import { A as y } from "./bookmark-state-Du3s13_V.js";
10
- import "./index-RNaTnE3m.js";
9
+ import { A as y } from "./bookmark-state-CflS88gq.js";
10
+ import "./schema-C9NPiIru.js";
11
+ import "./index-CV_Kzou0.js";
11
12
  import "./context-R31TSL5V.js";
12
- import { p as C, r as N } from "./stored-dashboard-d3xQYxBD.js";
13
- import { g as q } from "./saved-dashboard-context-y8N6RvjS.js";
13
+ import { p as C, r as N } from "./stored-dashboard-C0hekXiI.js";
14
+ import { g as q } from "./saved-dashboard-context-DC_TEd6y.js";
14
15
  function T(n, e) {
15
16
  var s;
16
17
  if (e.status === "blocked" || (s = n.sql) != null && s.trim()) return !1;
@@ -21,7 +22,7 @@ function T(n, e) {
21
22
  );
22
23
  return e.cardFilterValues.some((t) => {
23
24
  const a = e.queryFilterDefinitions.find(
24
- (d) => d.id === t.filterId
25
+ (o) => o.id === t.filterId
25
26
  );
26
27
  if (!D(t)) return !1;
27
28
  if (!(i.has(t.filterId) || (a == null ? void 0 : a.kind) === "global-date"))
@@ -45,7 +46,7 @@ function w(n, e, i) {
45
46
  const s = e.qualifiedFieldName, t = e.qualifiedEntityName, a = t && e.name ? `${t}.${e.name}` : s;
46
47
  return n.some((r) => {
47
48
  if (!(f(r.dataType || "") === "date")) return !1;
48
- const d = h(r, i), o = d.split("."), u = o[o.length - 1] || d, p = o.length > 1 ? o.slice(0, -1).join(".") : void 0, c = r.qualifiedTableName || p, m = c ? `${c}.${u}` : void 0;
49
+ const o = h(r, i), d = o.split("."), u = d[d.length - 1] || o, p = d.length > 1 ? d.slice(0, -1).join(".") : void 0, c = r.qualifiedTableName || p, m = c ? `${c}.${u}` : void 0;
49
50
  return s ? m ? m === a || m.endsWith(`.${s}`) : u === e.name : m ? m === a : u === e.name;
50
51
  });
51
52
  }
@@ -60,8 +61,8 @@ function P(n, e) {
60
61
  return t ? s(t) : !1;
61
62
  }
62
63
  function v(n, e) {
63
- var l, d;
64
- const i = (d = (l = n.config) == null ? void 0 : l.groupByColumns) == null ? void 0 : d.find((o) => f(o.dataType || "") === "date"), s = e.resolvedPrimaryDateField, t = i ? { id: i.id, name: i.name, label: i.label || i.name, qualifiedFieldName: i.qualifiedFieldName } : s ? { name: s.name, label: s.name, qualifiedFieldName: s.qualifiedFieldName } : void 0;
64
+ var l, o;
65
+ const i = (o = (l = n.config) == null ? void 0 : l.groupByColumns) == null ? void 0 : o.find((d) => f(d.dataType || "") === "date"), s = e.resolvedPrimaryDateField, t = i ? { id: i.id, name: i.name, label: i.label || i.name, qualifiedFieldName: i.qualifiedFieldName } : s ? { name: s.name, label: s.name, qualifiedFieldName: s.qualifiedFieldName } : void 0;
65
66
  if (!t) return { comparisonDate: null, dateWindow: e.status === "ready" ? "none" : "unknown" };
66
67
  const a = { name: t.name, label: t.label };
67
68
  if (P(n, t)) return { comparisonDate: a, dateWindow: "applies" };
@@ -69,7 +70,7 @@ function v(n, e) {
69
70
  const r = T(n, { status: "ready", ...e.compiledFilters });
70
71
  return { comparisonDate: a, dateWindow: r ? "applies" : "none" };
71
72
  }
72
- function j(n) {
73
+ function z(n) {
73
74
  const e = C(n.dashboard), i = y(e).find((r) => r.cardId === n.cardId);
74
75
  if (!i || i.kind === "documentSectionCard") return { comparisonDate: null, dateWindow: "unknown" };
75
76
  const { runtimeValues: s, transientContexts: t } = N({ dashboard: e, capture: {}, calendar: n.calendar }), a = q({
@@ -86,6 +87,6 @@ function j(n) {
86
87
  );
87
88
  }
88
89
  export {
89
- j as a,
90
+ z as a,
90
91
  v as r
91
92
  };
@@ -0,0 +1,226 @@
1
+ import { b as v, D as g, s as B, r as N, a as j, n as U } from "./resolver-DG_tfEpt.js";
2
+ import { S as b, C as p, a as f } from "./pickers-DkqmtnTL.js";
3
+ const w = {
4
+ spacing: { min: 0, max: 24, label: "Spacing" },
5
+ canvasPadding: { min: 0, max: 48, label: "Canvas padding" },
6
+ cardCorners: { min: 0, max: 24, label: "Card corners" },
7
+ controlCorners: { min: 0, max: 12, label: "Control corners" },
8
+ barCorners: { min: 0, max: 24, label: "Bar corners" }
9
+ }, d = { min: 1, max: 12 };
10
+ function _(o) {
11
+ const { min: e, max: s, label: r } = w[o];
12
+ return `${r} ${r.endsWith("s") ? "are" : "is"} ${e} to ${s} px`;
13
+ }
14
+ function Z(o) {
15
+ return o in w;
16
+ }
17
+ const M = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
18
+ function y(o) {
19
+ return typeof o == "string" && M.test(o);
20
+ }
21
+ const H = ["none", "subtle", "raised"], L = /* @__PURE__ */ new Set(["canvas", "chartColors"]);
22
+ function rr(o, e) {
23
+ const s = l(v(o), e), r = l(v({ ...o, tokenAppearance: null, reactAppearance: null }), e), n = l(v({ defaults: o.defaults, organizationAppearance: o.organizationAppearance }), e), a = Object.fromEntries(g.map((i) => [i, z(o, i, e)])), c = o.dashboardStyle ?? {}, t = g.filter((i) => B(c, i, e) !== void 0), C = g.reduce((i, k) => {
24
+ if (!L.has(k)) return i + (c[k] !== void 0 ? 1 : 0);
25
+ const A = c[k];
26
+ return i + (A ? Object.values(A).filter((T) => T !== void 0).length : 0);
27
+ }, 0);
28
+ return {
29
+ mode: e,
30
+ shows: s,
31
+ authored: r,
32
+ inherited: n,
33
+ source: a,
34
+ hostSet: g.filter((i) => a[i] === "token" || a[i] === "react"),
35
+ changed: t,
36
+ changeCount: C,
37
+ pickers: F(r)
38
+ };
39
+ }
40
+ function l(o, e) {
41
+ const s = o.schemes[e], r = (a) => N(s, j[a]), n = r("cardShadow");
42
+ return {
43
+ spacing: r("spacing"),
44
+ canvasPadding: r("canvasPadding"),
45
+ canvas: r("canvas"),
46
+ cardBorder: r("cardBorder") === 0 ? "off" : "on",
47
+ cardShadow: H.includes(n) ? n : "custom",
48
+ cardCorners: r("cardCorners"),
49
+ controlCorners: r("controlCorners"),
50
+ chartColors: [...r("chartColors") ?? []],
51
+ barCorners: r("barCorners")
52
+ };
53
+ }
54
+ function z(o, e, s) {
55
+ const r = (n) => {
56
+ var a, c;
57
+ return N((c = (a = U(n)) == null ? void 0 : a.schemes) == null ? void 0 : c[s], j[e]) !== void 0;
58
+ };
59
+ return r(o.reactAppearance) ? "react" : r(o.tokenAppearance) ? "token" : o.dashboardStyle && B(o.dashboardStyle, e, s) !== void 0 ? "dashboard" : r(o.organizationAppearance) ? "organization" : "defaults";
60
+ }
61
+ function F(o) {
62
+ const e = Object.keys(b).find((n) => b[n] === o.spacing) ?? null, s = Object.keys(p).find((n) => {
63
+ const a = p[n];
64
+ return a.cardBorder === o.cardBorder && a.cardShadow === o.cardShadow && a.canvas === o.canvas;
65
+ }) ?? null, r = Object.keys(f).find(
66
+ (n) => f[n].cardCorners === o.cardCorners && f[n].controlCorners === o.controlCorners
67
+ ) ?? null;
68
+ return { spacing: e, cards: s, corners: r };
69
+ }
70
+ const I = { muted: "muted", background: "plain" }, G = {
71
+ none: "Removes card shadows",
72
+ subtle: "Gives cards a subtle shadow",
73
+ raised: "Gives cards a raised shadow"
74
+ }, W = {
75
+ outlined: "Shows cards outlined, with a border and no shadow",
76
+ raised: "Shows cards raised, with no border",
77
+ open: "Shows cards open, on a plain canvas"
78
+ };
79
+ function q(o) {
80
+ const { edit: e, before: s, after: r } = o;
81
+ if (e.reset === "all" && Object.keys(e).length === 1)
82
+ return h(s, r) ? [] : [o.resetAll ?? "Resets the dashboard's style to the brand"];
83
+ const n = [], a = (t) => !h(s.light[t], r.light[t]) || !h(s.dark[t], r.dark[t]);
84
+ a("spacing") && n.push(r.light.spacing === 0 ? "Removes the gap between cards" : `Sets the gap between cards to ${r.light.spacing} px`), a("canvasPadding") && n.push(`Sets the canvas padding to ${r.light.canvasPadding} px`);
85
+ const c = e.cards && !a("cardBorder") && !a("cardShadow") && !a("canvas") ? void 0 : e.cards;
86
+ if (c && p[c] ? n.push(W[c]) : (a("cardBorder") && n.push(r.light.cardBorder === "on" ? "Shows card borders" : "Hides card borders"), a("cardShadow") && n.push(G[r.light.cardShadow] ?? "Changes the card shadow"), a("canvas") && n.push($("Sets the canvas to", s, r, "canvas", (t) => I[t] ?? t))), a("cardCorners") || a("controlCorners")) {
87
+ const { cardCorners: t, controlCorners: C } = r.light;
88
+ n.push(t === 0 && C === 0 ? "Squares corners" : `Rounds corners (cards ${t} px, controls ${C} px)`);
89
+ }
90
+ return a("chartColors") && n.push($("Sets chart colors to", s, r, "chartColors", (t) => `${t.length} ${t.length === 1 ? "color" : "colors"}`)), a("barCorners") && n.push(r.light.barCorners === 0 ? "Squares bar corners" : `Rounds bar corners to ${r.light.barCorners} px`), n;
91
+ }
92
+ function $(o, e, s, r, n) {
93
+ const a = !h(e.light[r], s.light[r]), c = !h(e.dark[r], s.dark[r]);
94
+ return a && c && h(s.light[r], s.dark[r]) ? `${o} ${n(s.light[r])}` : a && c ? `${o} ${n(s.light[r])} in light mode and ${n(s.dark[r])} in dark mode` : a ? `${o} ${n(s.light[r])} in light mode` : `${o} ${n(s.dark[r])} in dark mode`;
95
+ }
96
+ function h(o, e) {
97
+ return JSON.stringify(o) === JSON.stringify(e);
98
+ }
99
+ const u = ["light", "dark"], O = ["reset", "spacing", "canvasPadding", "cards", "canvas", "border", "shadow", "corners", "chartColors", "barCorners"], E = ["spacing", "canvasPadding", "canvas", "cards", "border", "shadow", "corners", "chartColors", "barCorners"], J = /* @__PURE__ */ new Set(["canvas", "chartColors"]);
100
+ function or(o) {
101
+ const e = Y(o.edit);
102
+ if (e) return { ok: !1, refusal: e };
103
+ const s = V(o.style ?? {}, o.edit, o.mode), r = { defaults: o.layers.defaults, organizationAppearance: o.layers.organizationAppearance }, n = K(s, r), a = R({ ...r, dashboardStyle: o.style }), c = R({ ...r, dashboardStyle: n });
104
+ return { ok: !0, style: n, sentences: q({ edit: o.edit, before: a, after: c }) };
105
+ }
106
+ function Y(o) {
107
+ if ((x(o) ? Object.entries(o).filter(([s, r]) => r !== void 0 && !(s === "reset" && Array.isArray(r) && r.length === 0)) : []).length === 0)
108
+ return { field: "edit", code: "empty_edit", message: "The style edit changes nothing.", fix: 'Name a setting to change, like spacing: "roomy" or cards: "raised".' };
109
+ for (const [s, r] of Object.entries(o))
110
+ if (r !== void 0 && !O.includes(s))
111
+ return { field: s, code: "unknown_field", message: `${s} is not a dashboard style setting.`, fix: `Use one of ${O.join(", ")}.` };
112
+ if (o.reset !== void 0 && o.reset !== "all" && !(Array.isArray(o.reset) && o.reset.every((s) => E.includes(s))))
113
+ return { field: "reset", code: "invalid_value", message: 'Reset takes "all" or a list of settings.', fix: `Use "all" or some of ${E.join(", ")}.` };
114
+ if (o.spacing !== void 0 && !(typeof o.spacing == "string" && o.spacing in b)) {
115
+ const s = m("spacing", o.spacing);
116
+ if (s) return { ...s, fix: `${s.fix} Or name a step: none, compact, default or roomy.` };
117
+ }
118
+ for (const s of ["canvasPadding", "barCorners"]) {
119
+ const r = o[s] !== void 0 ? m(s, o[s]) : void 0;
120
+ if (r) return r;
121
+ }
122
+ if (o.cards !== void 0 && !(o.cards in p))
123
+ return { field: "cards", code: "invalid_value", message: "Cards are outlined, raised or open.", fix: "Use outlined, raised or open." };
124
+ if (o.border !== void 0 && o.border !== "on" && o.border !== "off")
125
+ return { field: "border", code: "invalid_value", message: "Card border is on or off.", fix: "Use on or off." };
126
+ if (o.shadow !== void 0 && !["none", "subtle", "raised"].includes(o.shadow))
127
+ return { field: "shadow", code: "invalid_value", message: "Card shadow is none, subtle or raised.", fix: "Use none, subtle or raised." };
128
+ if (o.corners !== void 0)
129
+ if (typeof o.corners == "string") {
130
+ if (!(o.corners in f))
131
+ return { field: "corners", code: "invalid_value", message: "Corners are square, subtle, rounded or round.", fix: "Use square, subtle, rounded or round, or give cards and controls in px." };
132
+ } else {
133
+ if (!x(o.corners) || o.corners.cards === void 0 && o.corners.controls === void 0)
134
+ return { field: "corners", code: "invalid_value", message: "Corners take a step or px for cards and controls.", fix: "Use a step like rounded, or { cards: 10, controls: 6 }." };
135
+ {
136
+ const s = o.corners.cards !== void 0 ? m("cardCorners", o.corners.cards) : void 0;
137
+ if (s) return s;
138
+ const r = o.corners.controls !== void 0 ? m("controlCorners", o.corners.controls) : void 0;
139
+ if (r) return r;
140
+ }
141
+ }
142
+ if (o.canvas !== void 0)
143
+ for (const [s, r] of S(o.canvas)) {
144
+ if (s === void 0) return { field: "canvas", code: "unknown_field", message: "The canvas holds light and dark values only.", fix: "Give one fill, or { light, dark }." };
145
+ if (r !== "muted" && r !== "background" && !y(r))
146
+ return { field: s === "both" ? "canvas" : `canvas.${s}`, code: "invalid_colour", message: "The canvas is muted, background or a hex colour.", fix: "Use muted, background or a hex colour like #f4f4f5." };
147
+ }
148
+ if (o.chartColors !== void 0)
149
+ for (const [s, r] of S(o.chartColors)) {
150
+ const n = s === "both" ? "chartColors" : `chartColors.${s}`;
151
+ if (s === void 0) return { field: "chartColors", code: "unknown_field", message: "Chart colors hold light and dark lists only.", fix: "Give one list, or { light, dark }." };
152
+ if (!Array.isArray(r) || r.length < d.min || r.length > d.max)
153
+ return { field: n, code: "palette_size", message: `Chart colors take ${d.min} to ${d.max} colours.`, fix: `Chart colors take ${d.min} to ${d.max} hex colours, like #2563eb.` };
154
+ if (!r.every(y))
155
+ return { field: n, code: "invalid_colour", message: "Chart colors are hex colours.", fix: `Chart colors take ${d.min} to ${d.max} hex colours, like #2563eb.` };
156
+ }
157
+ }
158
+ function V(o, e, s) {
159
+ let r = e.reset === "all" ? {} : structuredClone(o);
160
+ if (Array.isArray(e.reset))
161
+ for (const n of e.reset)
162
+ n === "spacing" && delete r.spacing, n === "canvasPadding" && delete r.canvasPadding, (n === "canvas" || n === "cards") && (r = P(r, "canvas", s)), (n === "border" || n === "cards") && delete r.cardBorder, (n === "shadow" || n === "cards") && delete r.cardShadow, n === "corners" && (delete r.cardCorners, delete r.controlCorners), n === "chartColors" && (r = P(r, "chartColors", s)), n === "barCorners" && delete r.barCorners;
163
+ if (typeof e.spacing == "string" ? (r.spacing = b[e.spacing], r.canvasPadding = b[e.spacing]) : typeof e.spacing == "number" && (r.spacing = e.spacing), e.cards) {
164
+ const n = p[e.cards];
165
+ r.cardBorder = n.cardBorder, r.cardShadow = n.cardShadow, r.canvas = { light: n.canvas, dark: n.canvas };
166
+ }
167
+ if (typeof e.corners == "string" ? (r.cardCorners = f[e.corners].cardCorners, r.controlCorners = f[e.corners].controlCorners) : e.corners && (e.corners.cards !== void 0 && (r.cardCorners = e.corners.cards), e.corners.controls !== void 0 && (r.controlCorners = e.corners.controls)), e.canvasPadding !== void 0 && (r.canvasPadding = e.canvasPadding), e.border !== void 0 && (r.cardBorder = e.border), e.shadow !== void 0 && (r.cardShadow = e.shadow), e.barCorners !== void 0 && (r.barCorners = e.barCorners), e.canvas !== void 0)
168
+ for (const [n, a] of S(e.canvas))
169
+ for (const c of n === "both" ? u : [n])
170
+ r.canvas = { ...r.canvas, [c]: y(a) ? a.toLowerCase() : a };
171
+ if (e.chartColors !== void 0)
172
+ for (const [n, a] of S(e.chartColors))
173
+ for (const c of n === "both" ? u : [n])
174
+ r.chartColors = { ...r.chartColors, [c]: a.map((t) => t.toLowerCase()) };
175
+ return r;
176
+ }
177
+ function K(o, e) {
178
+ const s = v(e), r = { light: l(s, "light"), dark: l(s, "dark") }, n = { ...o };
179
+ for (const a of g)
180
+ if (n[a] !== void 0)
181
+ if (J.has(a)) {
182
+ const c = { ...n[a] };
183
+ for (const t of u)
184
+ c[t] !== void 0 && D(c[t], r[t][a]) && delete c[t];
185
+ Object.keys(c).length > 0 ? n[a] = c : delete n[a];
186
+ } else u.every((c) => D(n[a], r[c][a])) && delete n[a];
187
+ return Object.keys(n).length > 0 ? n : void 0;
188
+ }
189
+ function R(o) {
190
+ const e = v(o);
191
+ return { light: l(e, "light"), dark: l(e, "dark") };
192
+ }
193
+ function m(o, e) {
194
+ const { min: s, max: r } = w[o];
195
+ if (typeof e == "number" && Number.isInteger(e) && e >= s && e <= r) return;
196
+ const n = typeof e != "number" || !Number.isFinite(e) ? "invalid_value" : Number.isInteger(e) ? "out_of_range" : "not_integer";
197
+ return { field: o, code: n, message: `${_(o)}.`, fix: `${_(o)}; use ${r} for the most.` };
198
+ }
199
+ function S(o) {
200
+ return x(o) ? Object.entries(o).filter(([, e]) => e !== void 0).map(([e, s]) => [u.includes(e) ? e : void 0, s]) : [["both", o]];
201
+ }
202
+ function P(o, e, s) {
203
+ const r = { ...o[e] };
204
+ for (const a of s ? [s] : u) delete r[a];
205
+ const n = { ...o };
206
+ return Object.keys(r).length > 0 ? n[e] = r : delete n[e], n;
207
+ }
208
+ function D(o, e) {
209
+ return JSON.stringify(o) === JSON.stringify(e);
210
+ }
211
+ function x(o) {
212
+ return typeof o == "object" && o !== null && !Array.isArray(o);
213
+ }
214
+ export {
215
+ d as C,
216
+ w as D,
217
+ V as a,
218
+ rr as b,
219
+ Y as c,
220
+ q as d,
221
+ or as e,
222
+ _ as f,
223
+ y as g,
224
+ Z as i,
225
+ l as r
226
+ };