react-semaphor 0.1.602 → 0.1.603

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 (107) hide show
  1. package/dist/analytics-protocol/index.js +415 -375
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
  7. package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
  8. package/dist/chunks/{assistant-chat-BWF3GYip.js → assistant-chat-B6hNQI1t.js} +146 -146
  9. package/dist/chunks/{bookmark-impact-BF3iRx5a.js → bookmark-impact-Ba2PLcGp.js} +3 -3
  10. package/dist/chunks/{bookmark-state-CBSTdW6q.js → bookmark-state-n7AaNzR_.js} +517 -516
  11. package/dist/chunks/{card-filter-builder-B8XHwMY6.js → card-filter-builder-Y22HizVx.js} +104 -104
  12. package/dist/chunks/{comparison-window-caption-W83qB4V5.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
  13. package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
  14. package/dist/chunks/{dashboard-DG5EIYYB.js → dashboard-BghI99oY.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CBSrhyWZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +103 -103
  16. package/dist/chunks/{dashboard-controls-D6ECO4N1.js → dashboard-controls-CtFXlyjV.js} +53 -53
  17. package/dist/chunks/{dashboard-json-DrJftBSL.js → dashboard-json-DfGBUtCd.js} +5 -5
  18. package/dist/chunks/dates-BnrXF4bb.js +185 -0
  19. package/dist/chunks/{edit-dashboard-visual-BDYAJIbb.js → edit-dashboard-visual-oxt3x1wb.js} +7976 -8184
  20. package/dist/chunks/{filter-line-BXT6y303.js → filter-line-Cy5YYqRL.js} +27 -27
  21. package/dist/chunks/{filter-reach-copy-BukhZmzm.js → filter-reach-copy-CE_ZX147.js} +1590 -1729
  22. package/dist/chunks/{filter-value-text-D3-bf3_b.js → filter-value-text-fWvSDwkl.js} +11 -11
  23. package/dist/chunks/{index-BW0yozjs.js → index-D5rxbtS4.js} +24 -24
  24. package/dist/chunks/{layout-grid-Ds0diMeY.js → layout-grid-9LndRoLa.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-CgQgVeeI.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
  26. package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
  27. package/dist/chunks/{matrix-operation-contract--DkNCOzd.js → matrix-operation-contract-DPBj69D8.js} +3 -2
  28. package/dist/chunks/{metric-comparison-zMylnIkc.js → metric-comparison-B0FR-Q8I.js} +184 -125
  29. package/dist/chunks/{paintbrush-CX8pao1j.js → paintbrush-58FQYY-y.js} +1 -1
  30. package/dist/chunks/{palette-CuA0HlzF.js → palette-Be62Tkoa.js} +1 -1
  31. package/dist/chunks/{pivot-result-contract-expectations-C8KL7hPx.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
  32. package/dist/chunks/{pivot-result-identity-C1AOH1PS.js → pivot-result-identity-CAP4--iq.js} +1 -1
  33. package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
  34. package/dist/chunks/{report-preferences-dialog-CbuVNDGi.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
  35. package/dist/chunks/{report-runtime-context-E7USjN7E.js → report-runtime-context-c77_KF9v.js} +2 -2
  36. package/dist/chunks/{resolve-dashboard-input-context-CULCE_hM.js → resolve-dashboard-input-context-Rtl1ffmE.js} +7115 -6963
  37. package/dist/chunks/{save-BKHlDONy.js → save-C5A0JnEV.js} +1 -1
  38. package/dist/chunks/{saved-dashboard-context-C1WlOx5z.js → saved-dashboard-context-tcyTU8jm.js} +193 -207
  39. package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
  40. package/dist/chunks/{semaphor-ready-indicator-CBIRcDWs.js → semaphor-ready-indicator-FBvunj6S.js} +35550 -35273
  41. package/dist/chunks/{shelf-drop-preview-context-xR69SMA8.js → shelf-drop-preview-context-QKStrcK9.js} +6 -6
  42. package/dist/chunks/{stored-dashboard-BuM8vnWf.js → stored-dashboard-CHozcAY9.js} +621 -616
  43. package/dist/chunks/{style-sheet-parts-Bt9ZNre8.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
  44. package/dist/chunks/{table-export-sheet-DVljtHkG.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
  45. package/dist/chunks/{token-types-D_xKgyVS.js → token-types-XbM6QByy.js} +1 -1
  46. package/dist/chunks/{upload-Dll_M7XQ.js → upload-H15d7uHK.js} +1 -1
  47. package/dist/chunks/{validators-ClWHpYql.js → validators-Baf3VIf5.js} +3 -3
  48. package/dist/chunks/{variable-draft-CDGGl53R.js → variable-draft-C2y8Jp6Z.js} +3 -3
  49. package/dist/dashboard/index.js +2 -2
  50. package/dist/dashboard-authoring/index.js +2466 -2343
  51. package/dist/format-utils/index.js +205 -204
  52. package/dist/index.js +20 -20
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +2 -2
  56. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
  57. package/dist/types/index.js +5 -5
  58. package/dist/types/lib/document/document-edits.d.ts +0 -4
  59. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  60. package/dist/types/lib/types/common-types.d.ts +0 -2
  61. package/dist/types/lib/types/explorer-types.d.ts +1 -1
  62. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
  63. package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
  64. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
  65. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
  66. package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
  67. package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
  68. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
  69. package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
  70. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  71. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
  72. package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
  73. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
  74. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
  75. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  76. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
  77. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
  78. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
  79. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  80. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  81. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
  82. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
  83. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
  84. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
  85. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
  86. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
  87. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
  88. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
  89. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
  90. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
  91. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
  92. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
  93. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
  94. package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
  95. package/dist/types/shared/format-utils/index.d.ts +1 -0
  96. package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
  97. package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
  98. package/dist/types/shared/temporal/index.d.ts +2 -0
  99. package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
  100. package/dist/types/shared/temporal/temporal.d.ts +27 -0
  101. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
  102. package/dist/usage-events/index.js +1 -1
  103. package/package.json +3 -2
  104. package/dist/chunks/dates-Bz-qM5px.js +0 -164
  105. package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
  106. package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
  107. package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
@@ -1,25 +1,25 @@
1
1
  import { jsx as r, Fragment as M, jsxs as d } from "react/jsx-runtime";
2
- import He, { useMemo as j, useState as I, useEffect as B, lazy as ae, Suspense as Y, useRef as L, useLayoutEffect as ee, useCallback as P, Activity as Ke, useId as $ } from "react";
3
- import { b as qe, b8 as be, bk as Ge, bl as Je, u as D, bm as ze, Y as Xe, W as Ze, bn as Ye, bo as Qe, bp as et, bq as tt, br as J, bs as Le, bt as ge, bu as at, ad as X, ac as rt, bv as nt, bw as st, ae as ye, af as lt, bx as it, E as ot, F as dt, S as ct, B as ut, a as mt, U as ht, by as ft, D as bt, A as pt, C as gt, bz as yt, bA as ve, bB as ne, bC as vt, i as St, j as wt, k as xt, l as Tt, m as Se, n as we, bD as Ct, bE as pe, bF as F, bG as Nt, bH as Et, bI as It, bJ as At, bK as Dt } from "./semaphor-ready-indicator-CBIRcDWs.js";
2
+ import He, { useMemo as B, useState as I, useEffect as j, lazy as ae, Suspense as Q, useRef as L, useLayoutEffect as ee, useCallback as P, useId as $ } from "react";
3
+ import { b as Ke, b8 as be, bk as qe, bl as Ge, u as D, bm as ze, Y as Je, W as Xe, bn as Ze, bo as Ye, bp as Qe, bq as et, br as J, bs as Le, bt as ge, bu as tt, ad as X, ac as at, bv as rt, bw as nt, ae as ve, af as st, bx as lt, E as it, F as ot, S as dt, B as ct, a as ut, U as mt, by as ht, D as ft, A as bt, C as pt, bz as gt, bA as vt, bB as ye, bC as ne, bD as yt, i as St, j as wt, k as xt, l as Ct, m as Se, n as we, bE as Tt, bF as pe, bG as F, bH as Nt, bI as Et, bJ as It, bK as At, bL as Dt } from "./semaphor-ready-indicator-FBvunj6S.js";
4
4
  import { j as kt, c as U } from "./pickers-DkqmtnTL.js";
5
- import { K as _t } from "./bookmark-state-CBSTdW6q.js";
5
+ import { L as _t } from "./bookmark-state-n7AaNzR_.js";
6
6
  import { r as Pt, a as Re } from "./availability-Bp5Gfu1I.js";
7
- import { s as zt } from "./resolve-dashboard-input-context-CULCE_hM.js";
8
- import { B as z, Z as Lt, _ as Rt, $ as Ut, a0 as Ft, a1 as Ot, a2 as Bt, s as G, e as jt, f as Mt, h as Vt, j as xe, L as Ue, y as de, z as ce, A as ue, D as me, E as O, T as Wt, k as $t, l as Te, n as Ce } from "./style-sheet-parts-Bt9ZNre8.js";
9
- import "./validators-ClWHpYql.js";
10
- import "./matrix-operation-contract--DkNCOzd.js";
11
- import "./analytics-base-schemas-DevrgqQb.js";
7
+ import { s as zt } from "./resolve-dashboard-input-context-Rtl1ffmE.js";
8
+ import { B as z, Z as Lt, _ as Rt, $ as Ut, a0 as Ft, a1 as Ot, a2 as Bt, s as G, e as jt, f as Mt, h as Vt, j as xe, L as Ue, y as de, z as ce, A as ue, D as me, E as O, T as Wt, k as $t, l as Ce, n as Te } from "./style-sheet-parts-CDCG-8Ej.js";
9
+ import "./validators-Baf3VIf5.js";
10
+ import "./matrix-operation-contract-DPBj69D8.js";
11
+ import "./analytics-base-schemas-DsUh5Q3C.js";
12
12
  import { parseValueFormatPreferencesResponse as Ht, canonicalizeSupportedLocale as Fe, getSupportedCurrencyCodes as Kt, canonicalizeSupportedCurrencyCode as qt } from "../value-format-preferences/index.js";
13
- import { a as Gt } from "./filter-reach-copy-BukhZmzm.js";
14
- import { a as Jt } from "./report-runtime-context-E7USjN7E.js";
15
- import { as as Z, az as H } from "./pivot-result-contract-expectations-C8KL7hPx.js";
13
+ import { a as Gt } from "./filter-reach-copy-CE_ZX147.js";
14
+ import { a as Jt } from "./report-runtime-context-c77_KF9v.js";
15
+ import { at as Z, aA as H } from "./pivot-result-contract-expectations-BYqAmG9n.js";
16
16
  function Xt() {
17
17
  return /* @__PURE__ */ r(
18
18
  "div",
19
19
  {
20
20
  role: "dashboard-plus-main",
21
21
  className: "flex min-h-0 grow basis-0 overflow-hidden",
22
- children: /* @__PURE__ */ r("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: /* @__PURE__ */ r(qe, {}) })
22
+ children: /* @__PURE__ */ r("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: /* @__PURE__ */ r(Ke, {}) })
23
23
  }
24
24
  );
25
25
  }
@@ -49,22 +49,22 @@ let Ne = 0;
49
49
  function Ee(e, a) {
50
50
  Ne += 1;
51
51
  const { name: t, layout: n } = Re(a == null ? void 0 : a.config);
52
- return { ...Je(n), id: Ne, callerKey: e, assistantName: t };
52
+ return { ...Ge(n), id: Ne, callerKey: e, assistantName: t };
53
53
  }
54
54
  function ea({
55
55
  children: e,
56
56
  authToken: a
57
57
  }) {
58
- const t = be(), n = j(
58
+ const t = be(), n = B(
59
59
  () => a === void 0 ? t.tokenProps : aa(a),
60
60
  [a, t.tokenProps]
61
- ), s = j(() => Yt(n), [n]), i = j(
61
+ ), s = B(() => Yt(n), [n]), i = B(
62
62
  () => Qt(n).available,
63
63
  [n]
64
64
  ), [l, o] = I(() => Ee(s, n));
65
65
  l.callerKey !== s && o(Ee(s, n)), ra(l);
66
- const h = j(() => ({ instance: l, available: i }), [l, i]);
67
- return /* @__PURE__ */ r(Ge.Provider, { value: h, children: e });
66
+ const h = B(() => ({ instance: l, available: i }), [l, i]);
67
+ return /* @__PURE__ */ r(qe.Provider, { value: h, children: e });
68
68
  }
69
69
  function ta({ children: e }) {
70
70
  return ze() ? /* @__PURE__ */ r(M, { children: e }) : /* @__PURE__ */ r(ea, { children: e });
@@ -78,7 +78,7 @@ function aa(e) {
78
78
  }
79
79
  }
80
80
  function ra(e) {
81
- B(() => {
81
+ j(() => {
82
82
  const a = (n, s) => {
83
83
  const i = e.store.getState().focus;
84
84
  i && !na(i, n, s) && e.clearFocus();
@@ -93,9 +93,9 @@ function na(e, a, t) {
93
93
  const n = t ? _t(t, e.cardId) : void 0;
94
94
  return !!n && n.sheet.id === e.sheetId;
95
95
  }
96
- const sa = ae(() => import("./assistant-chat-BWF3GYip.js"));
97
- function Ya() {
98
- const e = Xe(), a = Ze();
96
+ const sa = ae(() => import("./assistant-chat-B6hNQI1t.js"));
97
+ function Qa() {
98
+ const e = Je(), a = Xe();
99
99
  if (!e.available) return null;
100
100
  const t = a !== "lg";
101
101
  return /* @__PURE__ */ d(
@@ -109,7 +109,7 @@ function Ya() {
109
109
  onClick: e.toggle,
110
110
  className: t ? "w-7 px-0" : void 0,
111
111
  children: [
112
- /* @__PURE__ */ r(Ye, { className: "h-3.5 w-3.5" }),
112
+ /* @__PURE__ */ r(Ze, { className: "h-3.5 w-3.5" }),
113
113
  !t && e.assistantName
114
114
  ]
115
115
  }
@@ -123,10 +123,10 @@ const la = {
123
123
  "full-page": "absolute inset-0 z-30"
124
124
  }, ia = "absolute left-0 top-0 z-30 max-h-[var(--assistant-beside-max-h)] max-w-[var(--assistant-beside-max-w)] rounded-card border border-border shadow-lg", oa = 640, q = 8;
125
125
  function da({ surface: e = "dashboard" } = {}) {
126
- const a = ze(), { isOpen: t, mounted: n, storedLayout: s, width: i, beside: l, besideSize: o, focusCardId: h, askCount: w } = Qe(
127
- (a == null ? void 0 : a.instance.store) ?? tt,
128
- et((f) => {
129
- var y;
126
+ const a = ze(), { isOpen: t, mounted: n, storedLayout: s, width: i, beside: l, besideSize: o, focusCardId: h, askCount: w } = Ye(
127
+ (a == null ? void 0 : a.instance.store) ?? et,
128
+ Qe((f) => {
129
+ var v;
130
130
  return {
131
131
  isOpen: f.isOpen,
132
132
  mounted: f.mounted,
@@ -134,7 +134,7 @@ function da({ surface: e = "dashboard" } = {}) {
134
134
  width: f.width,
135
135
  beside: f.beside,
136
136
  besideSize: f.besideSize,
137
- focusCardId: (y = f.focus) == null ? void 0 : y.cardId,
137
+ focusCardId: (v = f.focus) == null ? void 0 : v.cardId,
138
138
  askCount: f.askCount
139
139
  };
140
140
  })
@@ -165,13 +165,13 @@ function da({ surface: e = "dashboard" } = {}) {
165
165
  onKeyDown: c === "beside-card" ? (f) => {
166
166
  if (f.key !== "Escape" || f.defaultPrevented || !(f.target instanceof Node) || !f.currentTarget.contains(f.target)) return;
167
167
  f.preventDefault();
168
- const y = b.cardActions();
169
- a.instance.close(), y == null || y.focus();
168
+ const v = b.cardActions();
169
+ a.instance.close(), v == null || v.focus();
170
170
  } : void 0,
171
171
  children: [
172
172
  m ? /* @__PURE__ */ r(fa, { instance: a.instance, side: c === "docked-left" ? "right" : "left", width: i }) : null,
173
173
  c === "beside-card" ? /* @__PURE__ */ r(ha, { instance: a.instance, size: o, side: b.handleSide }) : null,
174
- /* @__PURE__ */ r(Y, { fallback: null, children: /* @__PURE__ */ r(sa, { instance: a.instance, surface: e, placement: c }, a.instance.id) })
174
+ /* @__PURE__ */ r(Q, { fallback: null, children: /* @__PURE__ */ r(sa, { instance: a.instance, surface: e, placement: c }, a.instance.id) })
175
175
  ]
176
176
  }
177
177
  );
@@ -198,15 +198,15 @@ function ua(e, a) {
198
198
  Ut({ padding: q }),
199
199
  Ft({
200
200
  padding: q,
201
- apply: ({ availableWidth: m, availableHeight: f, elements: y }) => {
202
- y.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, m)}px`), y.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, f)}px`);
201
+ apply: ({ availableWidth: m, availableHeight: f, elements: v }) => {
202
+ v.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, m)}px`), v.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, f)}px`);
203
203
  }
204
204
  }),
205
205
  Ot()
206
206
  ],
207
- whileElementsMounted: (m, f, y) => Bt(m, f, () => {
207
+ whileElementsMounted: (m, f, v) => Bt(m, f, () => {
208
208
  const E = ma(m, f);
209
- n(E), E === null && i(l.current), y();
209
+ n(E), E === null && i(l.current), v();
210
210
  })
211
211
  }), c = w.floating;
212
212
  return ee(() => {
@@ -342,7 +342,7 @@ function fa({ instance: e, side: a, width: t }) {
342
342
  );
343
343
  }
344
344
  function ba(e) {
345
- const a = at();
345
+ const a = tt();
346
346
  return P(
347
347
  async (t, n) => {
348
348
  const s = D.getState();
@@ -358,7 +358,7 @@ function ba(e) {
358
358
  const h = await a(o, { reuseLoaded: !0 }).catch((w) => {
359
359
  console.warn("Applying the change without refreshed semantic metadata:", w);
360
360
  });
361
- rt(l, h);
361
+ at(l, h);
362
362
  }
363
363
  return n != null && n.stillWanted && !n.stillWanted() ? { ok: !1, reason: "dropped" } : e() ? D.getState().actions.applyProposal({ ...t, semanticExecutionPayload: l }) : { ok: !1, reason: "not_editable", message: X.no_save };
364
364
  },
@@ -366,12 +366,12 @@ function ba(e) {
366
366
  );
367
367
  }
368
368
  function pa(e) {
369
- const { canEditDashboard: a, isInspectionMode: t } = nt(), n = st(), s = D(ye), i = e && n && a === !0 && !t, l = L(i);
369
+ const { canEditDashboard: a, isInspectionMode: t } = rt(), n = nt(), s = D(ve), i = e && n && a === !0 && !t, l = L(i);
370
370
  ee(() => {
371
371
  l.current = i;
372
372
  });
373
373
  const o = P(
374
- () => l.current && ye(D.getState()),
374
+ () => l.current && ve(D.getState()),
375
375
  []
376
376
  );
377
377
  return { canChange: i && s, canChangeNow: o };
@@ -397,9 +397,9 @@ function ga({
397
397
  }), i = ba(n), [l, o] = I(null), h = L(/* @__PURE__ */ new Map()), w = L(/* @__PURE__ */ new Map()), x = L(Promise.resolve()), u = L({ apply: i, onLifecycleEvent: a });
398
398
  ee(() => {
399
399
  u.current = { apply: i, onLifecycleEvent: a };
400
- }), B(() => {
400
+ }), j(() => {
401
401
  e.setScreenState({ eligible: t, ...s ? { dashboardId: s } : {} });
402
- }, [e, t, s]), B(
402
+ }, [e, t, s]), j(
403
403
  () => D.subscribe((c, S) => {
404
404
  if (c.editSessionEpoch !== S.editSessionEpoch) {
405
405
  h.current.clear(), o(null);
@@ -410,29 +410,29 @@ function ga({
410
410
  f !== c.dashboard && h.current.delete(m);
411
411
  }),
412
412
  []
413
- ), B(() => {
413
+ ), j(() => {
414
414
  const c = (m) => {
415
415
  const f = D.getState().dashboard;
416
416
  if (!f || f.id !== m.dashboardId) return;
417
- const y = Sa();
418
- h.current.set(y, f), e.answerCopyRequest({
417
+ const v = Sa();
418
+ h.current.set(v, f), e.answerCopyRequest({
419
419
  kind: "uploaded",
420
420
  screenId: e.screenId,
421
421
  requestId: m.requestId,
422
- revisionId: y,
422
+ revisionId: v,
423
423
  dashboard: f
424
424
  });
425
425
  }, S = async (m, f) => {
426
- var p, v, C;
427
- const y = w.current.get(m.deliveryId);
428
- if (y) {
429
- e.reportOutcome({ screenId: e.screenId, deliveryId: m.deliveryId, outcome: y });
426
+ var p, y, T;
427
+ const v = w.current.get(m.deliveryId);
428
+ if (v) {
429
+ e.reportOutcome({ screenId: e.screenId, deliveryId: m.deliveryId, outcome: v });
430
430
  return;
431
431
  }
432
432
  const E = h.current.get(m.revisionId), A = () => !E || h.current.get(m.revisionId) !== E ? "dashboard_changed" : performance.now() < f + m.applyWithinMs ? null : "expired", _ = A();
433
433
  let k;
434
434
  if (_ || !E)
435
- k = Q(_ ?? "dashboard_changed");
435
+ k = Y(_ ?? "dashboard_changed");
436
436
  else {
437
437
  let g = "expired";
438
438
  const V = await u.current.apply(
@@ -444,11 +444,11 @@ function ga({
444
444
  }
445
445
  }
446
446
  );
447
- k = va(V, g);
447
+ k = ya(V, g);
448
448
  }
449
449
  if (w.current.set(m.deliveryId, k), e.reportOutcome({ screenId: e.screenId, deliveryId: m.deliveryId, outcome: k }), k.status !== "applied") return;
450
450
  const N = ((p = D.getState().dashboard) == null ? void 0 : p.id) ?? "";
451
- o({ deliveryId: m.deliveryId, proposalId: m.proposalId, summary: m.summary, dashboardId: N, words: null }), (C = (v = u.current).onLifecycleEvent) == null || C.call(v, {
451
+ o({ deliveryId: m.deliveryId, proposalId: m.proposalId, summary: m.summary, dashboardId: N, words: null }), (T = (y = u.current).onLifecycleEvent) == null || T.call(y, {
452
452
  type: "dashboard:change-applied",
453
453
  dashboardId: N,
454
454
  payload: { deliveryId: m.deliveryId, summary: m.summary }
@@ -461,7 +461,7 @@ function ga({
461
461
  }
462
462
  const f = performance.now();
463
463
  x.current = x.current.then(
464
- () => S(m, f).catch((y) => console.error("[live-screen] a delivery failed", y))
464
+ () => S(m, f).catch((v) => console.error("[live-screen] a delivery failed", v))
465
465
  );
466
466
  });
467
467
  }, [e]);
@@ -475,10 +475,10 @@ function ga({
475
475
  payload: { deliveryId: l.deliveryId, summary: l.summary }
476
476
  }), o(null)) : c.reason === "changed_since" ? o({ ...l, words: "changed_since" }) : c.reason === "not_editable" ? o({ ...l, words: "not_editable" }) : o(null);
477
477
  }, [l]);
478
- return l ? /* @__PURE__ */ r(ya, { note: l, onUndo: b }) : null;
478
+ return l ? /* @__PURE__ */ r(va, { note: l, onUndo: b }) : null;
479
479
  }
480
- function ya({ note: e, onUndo: a }) {
481
- const t = D((l) => lt(l, e.proposalId)), n = D((l) => l.isVisualEditing);
480
+ function va({ note: e, onUndo: a }) {
481
+ const t = D((l) => st(l, e.proposalId)), n = D((l) => l.isVisualEditing);
482
482
  if (t === "none" && e.words === null) return null;
483
483
  const s = e.words === "changed_since" || t === "changed_since", i = s ? "changed_since" : e.words === "not_editable" ? "not_editable" : t;
484
484
  return /* @__PURE__ */ d(
@@ -505,7 +505,7 @@ function ya({ note: e, onUndo: a }) {
505
505
  title: n ? K.closeEditorToUndo : void 0,
506
506
  onClick: a,
507
507
  children: [
508
- /* @__PURE__ */ r(it, { className: "h-3 w-3" }),
508
+ /* @__PURE__ */ r(lt, { className: "h-3 w-3" }),
509
509
  K.undo
510
510
  ]
511
511
  }
@@ -515,43 +515,43 @@ function ya({ note: e, onUndo: a }) {
515
515
  }
516
516
  );
517
517
  }
518
- function va(e, a) {
518
+ function ya(e, a) {
519
519
  if (e.ok) return { status: "applied" };
520
520
  switch (e.reason) {
521
521
  case "dashboard_changed":
522
522
  case "not_editable":
523
- return Q(e.reason);
523
+ return Y(e.reason);
524
524
  case "refused":
525
525
  return { status: "not_applied", reason: "refused", message: (e.message || Be.refused).slice(0, 500) };
526
526
  case "dropped":
527
- return Q(a);
527
+ return Y(a);
528
528
  case "previous_not_applied":
529
- return Q("refused");
529
+ return Y("refused");
530
530
  }
531
531
  }
532
- function Q(e) {
532
+ function Y(e) {
533
533
  return { status: "not_applied", reason: e, message: Be[e] };
534
534
  }
535
535
  function Sa() {
536
536
  return globalThis.crypto.randomUUID();
537
537
  }
538
- const wa = ae(() => import("./dashboard-controls-D6ECO4N1.js")), xa = ae(
539
- () => import("./edit-dashboard-visual-BDYAJIbb.js")
540
- ), Ta = ae(() => import("./dashboard-json-DrJftBSL.js"));
541
- function Qa({
538
+ const wa = ae(() => import("./dashboard-controls-CtFXlyjV.js")), xa = ae(
539
+ () => import("./edit-dashboard-visual-oxt3x1wb.js")
540
+ ), Ca = ae(() => import("./dashboard-json-DfGBUtCd.js"));
541
+ function er({
542
542
  showControls: e = !1,
543
543
  showFooter: a = !0,
544
544
  liveScreen: t,
545
545
  ...n
546
546
  }) {
547
- const s = D((h) => h.isVisualEditing), i = D(
548
- (h) => h.showDashboardJSON
549
- ), { appearance: l, preferences: o } = n;
550
- return /* @__PURE__ */ r(ot, { FallbackComponent: dt, children: /* @__PURE__ */ r(ct, { dashboardProps: n, children: /* @__PURE__ */ d(ut, { children: [
551
- /* @__PURE__ */ r(mt, { componentType: "surfboard", componentId: n.id }),
552
- /* @__PURE__ */ d(ht, { appearance: l, children: [
547
+ const s = D(
548
+ (o) => o.showDashboardJSON
549
+ ), { appearance: i, preferences: l } = n;
550
+ return /* @__PURE__ */ r(it, { FallbackComponent: ot, children: /* @__PURE__ */ r(dt, { dashboardProps: n, children: /* @__PURE__ */ d(ct, { children: [
551
+ /* @__PURE__ */ r(ut, { componentType: "surfboard", componentId: n.id }),
552
+ /* @__PURE__ */ d(mt, { appearance: i, children: [
553
553
  /* @__PURE__ */ r(
554
- ft,
554
+ ht,
555
555
  {
556
556
  toastOptions: {
557
557
  classNames: {
@@ -565,16 +565,13 @@ function Qa({
565
565
  }
566
566
  }
567
567
  ),
568
- /* @__PURE__ */ d(bt, { preferences: o, children: [
569
- i && /* @__PURE__ */ r(Y, { fallback: null, children: /* @__PURE__ */ r(Ta, {}) }),
570
- /* @__PURE__ */ r(pt, { children: /* @__PURE__ */ r(ta, { children: /* @__PURE__ */ d("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
571
- e && /* @__PURE__ */ r(Y, { fallback: null, children: /* @__PURE__ */ r(wa, {}) }),
568
+ /* @__PURE__ */ d(ft, { preferences: l, children: [
569
+ s && /* @__PURE__ */ r(Q, { fallback: null, children: /* @__PURE__ */ r(Ca, {}) }),
570
+ /* @__PURE__ */ r(bt, { children: /* @__PURE__ */ r(ta, { children: /* @__PURE__ */ d("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
571
+ e && /* @__PURE__ */ r(Q, { fallback: null, children: /* @__PURE__ */ r(wa, {}) }),
572
572
  t && /* @__PURE__ */ r(ga, { port: t, onLifecycleEvent: n.onDashboardLifecycleEvent }),
573
573
  /* @__PURE__ */ d("div", { className: "relative flex grow overflow-hidden", children: [
574
- /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ d(gt, { ...n, type: "dashboard", children: [
575
- s && /* @__PURE__ */ r(Y, { fallback: null, children: /* @__PURE__ */ r(xa, {}) }),
576
- /* @__PURE__ */ r(Ke, { mode: s ? "hidden" : "visible", children: /* @__PURE__ */ r(Xt, {}) })
577
- ] }) }),
574
+ /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ r(pt, { ...n, type: "dashboard", children: /* @__PURE__ */ r(Ta, {}) }) }),
578
575
  /* @__PURE__ */ r(da, {})
579
576
  ] })
580
577
  ] }) }) })
@@ -582,11 +579,28 @@ function Qa({
582
579
  ] })
583
580
  ] }) }) });
584
581
  }
585
- function Ca(e = {}) {
582
+ function Ta() {
583
+ const e = D((t) => t.isVisualEditing), a = B(() => /* @__PURE__ */ r(gt.Provider, { value: !0, children: /* @__PURE__ */ r(Xt, {}) }), []);
584
+ return /* @__PURE__ */ d("div", { className: "relative flex min-h-0 min-w-0 grow basis-0 flex-col", children: [
585
+ /* @__PURE__ */ r(
586
+ "div",
587
+ {
588
+ className: "flex min-h-0 grow basis-0 flex-col",
589
+ style: e ? { visibility: "hidden" } : void 0,
590
+ inert: e || void 0,
591
+ "aria-hidden": e || void 0,
592
+ "data-dashboard-hidden": e || void 0,
593
+ children: a
594
+ }
595
+ ),
596
+ e && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-10 flex flex-col", children: /* @__PURE__ */ r(Q, { fallback: null, children: /* @__PURE__ */ r(xa, {}) }) })
597
+ ] });
598
+ }
599
+ function Na(e = {}) {
586
600
  const { authToken: a, tokenProps: t } = be(), n = D(
587
601
  (N) => N.actions.applyResolvedCalendarPreferences
588
- ), s = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, l = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, h] = I(!1), [w, x] = I(!1), [u, b] = I(!1), [c, S] = I(null), [m, f] = I(null), y = L(i);
589
- y.current = i, B(() => {
602
+ ), s = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, l = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, h] = I(!1), [w, x] = I(!1), [u, b] = I(!1), [c, S] = I(null), [m, f] = I(null), v = L(i);
603
+ v.current = i, j(() => {
590
604
  f(null), S(null), h(!1), x(!1), b(!1);
591
605
  }, [i]);
592
606
  const E = P(async (N) => {
@@ -607,18 +621,18 @@ function Ca(e = {}) {
607
621
  }
608
622
  );
609
623
  if (!p.ok) {
610
- const C = await p.json().catch(() => ({}));
611
- throw new Error(C.error || "Failed to fetch preferences");
624
+ const T = await p.json().catch(() => ({}));
625
+ throw new Error(T.error || "Failed to fetch preferences");
612
626
  }
613
- const v = await E(p);
614
- y.current === N && f(v);
627
+ const y = await E(p);
628
+ v.current === N && f(y);
615
629
  } catch (p) {
616
- y.current === N && S(p instanceof Error ? p.message : "Unknown error");
630
+ v.current === N && S(p instanceof Error ? p.message : "Unknown error");
617
631
  } finally {
618
- y.current === N && h(!1);
632
+ v.current === N && h(!1);
619
633
  }
620
634
  }, [i, l, s, E]);
621
- B(() => {
635
+ j(() => {
622
636
  s && A();
623
637
  }, [s, A]);
624
638
  const _ = P(
@@ -628,7 +642,7 @@ function Ca(e = {}) {
628
642
  const p = i;
629
643
  x(!0), S(null);
630
644
  try {
631
- const v = await fetch(
645
+ const y = await fetch(
632
646
  `${l}/v1/user-preferences/calendar`,
633
647
  {
634
648
  method: "PATCH",
@@ -639,16 +653,16 @@ function Ca(e = {}) {
639
653
  body: JSON.stringify(N)
640
654
  }
641
655
  );
642
- if (!v.ok) {
643
- const g = await v.json().catch(() => ({}));
656
+ if (!y.ok) {
657
+ const g = await y.json().catch(() => ({}));
644
658
  throw new Error(g.error || "Failed to update preferences");
645
659
  }
646
- const C = await E(v);
647
- return y.current !== p ? !1 : (f(C), n(C.resolved, C.sources), !0);
648
- } catch (v) {
649
- return y.current === p && S(v instanceof Error ? v.message : "Unknown error"), !1;
660
+ const T = await E(y);
661
+ return v.current !== p ? !1 : (f(T), n(T.resolved, T.sources), !0);
662
+ } catch (y) {
663
+ return v.current === p && S(y instanceof Error ? y.message : "Unknown error"), !1;
650
664
  } finally {
651
- y.current === p && x(!1);
665
+ v.current === p && x(!1);
652
666
  }
653
667
  },
654
668
  [
@@ -671,15 +685,15 @@ function Ca(e = {}) {
671
685
  }
672
686
  );
673
687
  if (!p.ok) {
674
- const C = await p.json().catch(() => ({}));
675
- throw new Error(C.error || "Failed to clear preferences");
688
+ const T = await p.json().catch(() => ({}));
689
+ throw new Error(T.error || "Failed to clear preferences");
676
690
  }
677
- const v = await E(p);
678
- return y.current !== N ? !1 : (f(v), n(v.resolved, v.sources), !0);
691
+ const y = await E(p);
692
+ return v.current !== N ? !1 : (f(y), n(y.resolved, y.sources), !0);
679
693
  } catch (p) {
680
- return y.current === N && S(p instanceof Error ? p.message : "Unknown error"), !1;
694
+ return v.current === N && S(p instanceof Error ? p.message : "Unknown error"), !1;
681
695
  } finally {
682
- y.current === N && b(!1);
696
+ v.current === N && b(!1);
683
697
  }
684
698
  }, [
685
699
  i,
@@ -718,7 +732,7 @@ const te = [
718
732
  { value: 1, label: "Monday" },
719
733
  { value: 6, label: "Saturday" }
720
734
  ], Ae = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
721
- function Na() {
735
+ function Ea() {
722
736
  try {
723
737
  const e = Intl;
724
738
  if (e.supportedValuesOf)
@@ -727,7 +741,7 @@ function Na() {
727
741
  }
728
742
  return te.map((e) => e.value);
729
743
  }
730
- function Ea(e) {
744
+ function Ia(e) {
731
745
  if (!e) return "default";
732
746
  if (e.tz !== e.weekStart) return "inherited";
733
747
  switch (e.tz) {
@@ -747,11 +761,11 @@ function De(e) {
747
761
  const a = te.find((t) => t.value === e);
748
762
  return a ? a.label : e;
749
763
  }
750
- function Ia(e) {
764
+ function Aa(e) {
751
765
  const a = je.find((t) => t.value === e);
752
766
  return a ? a.label : String(e);
753
767
  }
754
- function Aa({
768
+ function Da({
755
769
  active: e,
756
770
  onClose: a
757
771
  }) {
@@ -762,16 +776,16 @@ function Aa({
762
776
  isClearing: i,
763
777
  updatePreferences: l,
764
778
  clearPreferences: o
765
- } = Ca({ enabled: e }), h = yt(), w = (t == null ? void 0 : t.resolved.tz) || (h == null ? void 0 : h.tz) || "UTC", x = (t == null ? void 0 : t.resolved.weekStart) ?? (h == null ? void 0 : h.weekStart) ?? 1, [u, b] = I((t == null ? void 0 : t.stored) === null), [c, S] = I(!1), [m, f] = I(
779
+ } = Na({ enabled: e }), h = vt(), w = (t == null ? void 0 : t.resolved.tz) || (h == null ? void 0 : h.tz) || "UTC", x = (t == null ? void 0 : t.resolved.weekStart) ?? (h == null ? void 0 : h.weekStart) ?? 1, [u, b] = I((t == null ? void 0 : t.stored) === null), [c, S] = I(!1), [m, f] = I(
766
780
  w
767
- ), [y, E] = I(
781
+ ), [v, E] = I(
768
782
  x
769
- ), [A, _] = I(!1), k = j(() => Na(), []), N = j(
783
+ ), [A, _] = I(!1), k = B(() => Ea(), []), N = B(
770
784
  () => k.filter(
771
- (T) => !te.some(($e) => $e.value === T)
785
+ (C) => !te.some(($e) => $e.value === C)
772
786
  ),
773
787
  [k]
774
- ), p = j(() => De(m), [m]), v = t != null && t.inherited ? De(t.inherited.tz) : "UTC", C = t != null && t.inherited ? Ia(t.inherited.weekStart) : "Monday", g = Ea(
788
+ ), p = B(() => De(m), [m]), y = t != null && t.inherited ? De(t.inherited.tz) : "UTC", T = t != null && t.inherited ? Aa(t.inherited.weekStart) : "Monday", g = Ia(
775
789
  t == null ? void 0 : t.inheritedSources
776
790
  );
777
791
  He.useEffect(() => {
@@ -794,7 +808,7 @@ function Aa({
794
808
  }
795
809
  u ? await o() ? (F.success("Now using default settings."), a()) : F.error("Failed to save preferences. Please try again.") : await l({
796
810
  tz: m,
797
- weekStart: y
811
+ weekStart: v
798
812
  }) ? (F.success("Preferences saved."), a()) : F.error("Failed to save preferences. Please try again.");
799
813
  }, R = () => {
800
814
  a();
@@ -802,11 +816,11 @@ function Aa({
802
816
  return /* @__PURE__ */ d(M, { children: [
803
817
  /* @__PURE__ */ d("div", { className: "space-y-4 py-1", children: [
804
818
  /* @__PURE__ */ d(
805
- ve,
819
+ ye,
806
820
  {
807
821
  value: u ? "defaults" : "custom",
808
- onValueChange: (T) => {
809
- S(!0), b(T === "defaults");
822
+ onValueChange: (C) => {
823
+ S(!0), b(C === "defaults");
810
824
  },
811
825
  className: "space-y-0.5",
812
826
  children: [
@@ -837,9 +851,9 @@ function Aa({
837
851
  " defaults"
838
852
  ] }),
839
853
  /* @__PURE__ */ d("p", { className: "text-[12px] text-muted-foreground", children: [
840
- v,
854
+ y,
841
855
  ", week starts ",
842
- C
856
+ T
843
857
  ] })
844
858
  ] })
845
859
  ]
@@ -900,7 +914,7 @@ function Aa({
900
914
  disabled: u,
901
915
  children: [
902
916
  /* @__PURE__ */ r("span", { className: "truncate", children: p }),
903
- /* @__PURE__ */ r(vt, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
917
+ /* @__PURE__ */ r(yt, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
904
918
  ]
905
919
  }
906
920
  ) }),
@@ -912,13 +926,13 @@ function Aa({
912
926
  children: /* @__PURE__ */ d(St, { className: "overflow-visible", children: [
913
927
  /* @__PURE__ */ r(wt, { placeholder: "Search timezones…" }),
914
928
  /* @__PURE__ */ d(xt, { children: [
915
- /* @__PURE__ */ r(Tt, { children: "No timezone found." }),
916
- /* @__PURE__ */ r(Se, { heading: "Common", children: te.map((T) => /* @__PURE__ */ d(
929
+ /* @__PURE__ */ r(Ct, { children: "No timezone found." }),
930
+ /* @__PURE__ */ r(Se, { heading: "Common", children: te.map((C) => /* @__PURE__ */ d(
917
931
  we,
918
932
  {
919
- value: `${T.value} ${T.label}`,
933
+ value: `${C.value} ${C.label}`,
920
934
  onSelect: () => {
921
- S(!0), f(T.value), _(!1);
935
+ S(!0), f(C.value), _(!1);
922
936
  },
923
937
  children: [
924
938
  /* @__PURE__ */ r(
@@ -926,23 +940,23 @@ function Aa({
926
940
  {
927
941
  className: U(
928
942
  "h-3.5 w-3.5",
929
- m === T.value ? "opacity-100" : "opacity-0"
943
+ m === C.value ? "opacity-100" : "opacity-0"
930
944
  )
931
945
  }
932
946
  ),
933
- /* @__PURE__ */ r("span", { className: "flex-1", children: T.label }),
934
- /* @__PURE__ */ r("span", { className: "text-[11px] text-muted-foreground", children: T.value })
947
+ /* @__PURE__ */ r("span", { className: "flex-1", children: C.label }),
948
+ /* @__PURE__ */ r("span", { className: "text-[11px] text-muted-foreground", children: C.value })
935
949
  ]
936
950
  },
937
- T.value
951
+ C.value
938
952
  )) }),
939
- /* @__PURE__ */ r(Ct, {}),
940
- /* @__PURE__ */ r(Se, { heading: "All timezones", children: N.map((T) => /* @__PURE__ */ d(
953
+ /* @__PURE__ */ r(Tt, {}),
954
+ /* @__PURE__ */ r(Se, { heading: "All timezones", children: N.map((C) => /* @__PURE__ */ d(
941
955
  we,
942
956
  {
943
- value: T,
957
+ value: C,
944
958
  onSelect: () => {
945
- S(!0), f(T), _(!1);
959
+ S(!0), f(C), _(!1);
946
960
  },
947
961
  children: [
948
962
  /* @__PURE__ */ r(
@@ -950,14 +964,14 @@ function Aa({
950
964
  {
951
965
  className: U(
952
966
  "h-3.5 w-3.5",
953
- m === T ? "opacity-100" : "opacity-0"
967
+ m === C ? "opacity-100" : "opacity-0"
954
968
  )
955
969
  }
956
970
  ),
957
- T
971
+ C
958
972
  ]
959
973
  },
960
- T
974
+ C
961
975
  )) })
962
976
  ] })
963
977
  ] })
@@ -970,18 +984,18 @@ function Aa({
970
984
  /* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
971
985
  /* @__PURE__ */ r(G, { className: Ae, children: "Week starts on" }),
972
986
  /* @__PURE__ */ r(
973
- ve,
987
+ ye,
974
988
  {
975
- value: String(y),
976
- onValueChange: (T) => {
977
- S(!0), E(Number(T));
989
+ value: String(v),
990
+ onValueChange: (C) => {
991
+ S(!0), E(Number(C));
978
992
  },
979
993
  className: "flex gap-4",
980
994
  disabled: u,
981
- children: je.map((T) => /* @__PURE__ */ d(
995
+ children: je.map((C) => /* @__PURE__ */ d(
982
996
  "label",
983
997
  {
984
- htmlFor: `week-start-${T.value}`,
998
+ htmlFor: `week-start-${C.value}`,
985
999
  className: U(
986
1000
  "flex cursor-pointer items-center gap-2 text-[13px]",
987
1001
  u && "cursor-not-allowed"
@@ -990,15 +1004,15 @@ function Aa({
990
1004
  /* @__PURE__ */ r(
991
1005
  ne,
992
1006
  {
993
- value: String(T.value),
994
- id: `week-start-${T.value}`,
1007
+ value: String(C.value),
1008
+ id: `week-start-${C.value}`,
995
1009
  disabled: u
996
1010
  }
997
1011
  ),
998
- T.label
1012
+ C.label
999
1013
  ]
1000
1014
  },
1001
- T.value
1015
+ C.value
1002
1016
  ))
1003
1017
  }
1004
1018
  )
@@ -1025,80 +1039,80 @@ function Aa({
1025
1039
  ] })
1026
1040
  ] });
1027
1041
  }
1028
- function Da(e = {}) {
1042
+ function ka(e = {}) {
1029
1043
  const { authToken: a, tokenProps: t } = be(), n = D(
1030
1044
  (p) => p.actions.applyResolvedValueFormatPreferences
1031
1045
  ), s = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, l = (t == null ? void 0 : t.apiServiceUrl) ?? null, o = L(i);
1032
1046
  o.current = i;
1033
- const [h, w] = I(null), [x, u] = I(!1), [b, c] = I(!1), [S, m] = I(!1), [f, y] = I(null);
1034
- B(() => {
1035
- w(null), y(null), u(!1), c(!1), m(!1);
1047
+ const [h, w] = I(null), [x, u] = I(!1), [b, c] = I(!1), [S, m] = I(!1), [f, v] = I(null);
1048
+ j(() => {
1049
+ w(null), v(null), u(!1), c(!1), m(!1);
1036
1050
  }, [i]);
1037
1051
  const E = P(async (p) => {
1038
- const v = Ht(await p.json());
1039
- if (!v.ok)
1052
+ const y = Ht(await p.json());
1053
+ if (!y.ok)
1040
1054
  throw new Error("Value format preferences response is invalid");
1041
- return v.value;
1055
+ return y.value;
1042
1056
  }, []), A = P(
1043
- async (p, v) => {
1057
+ async (p, y) => {
1044
1058
  if (!i || !l)
1045
1059
  throw new Error("Not authenticated");
1046
- const C = await fetch(
1060
+ const T = await fetch(
1047
1061
  `${l}/v1/user-preferences/value-format`,
1048
1062
  {
1049
1063
  method: p,
1050
1064
  headers: {
1051
1065
  Authorization: `Bearer ${i}`,
1052
- ...v ? { "Content-Type": "application/json" } : {}
1066
+ ...y ? { "Content-Type": "application/json" } : {}
1053
1067
  },
1054
- body: v ? JSON.stringify(v) : void 0
1068
+ body: y ? JSON.stringify(y) : void 0
1055
1069
  }
1056
1070
  );
1057
- if (!C.ok) {
1058
- const g = await C.json().catch(() => ({}));
1071
+ if (!T.ok) {
1072
+ const g = await T.json().catch(() => ({}));
1059
1073
  throw new Error(g.error || "Failed to update preferences");
1060
1074
  }
1061
- return E(C);
1075
+ return E(T);
1062
1076
  },
1063
1077
  [i, l, E]
1064
1078
  ), _ = P(async () => {
1065
1079
  if (!s || !i || !l) return;
1066
1080
  const p = i;
1067
- u(!0), y(null);
1081
+ u(!0), v(null);
1068
1082
  try {
1069
- const v = await A("GET");
1070
- o.current === p && w(v);
1071
- } catch (v) {
1072
- o.current === p && y(v instanceof Error ? v.message : "Unknown error");
1083
+ const y = await A("GET");
1084
+ o.current === p && w(y);
1085
+ } catch (y) {
1086
+ o.current === p && v(y instanceof Error ? y.message : "Unknown error");
1073
1087
  } finally {
1074
1088
  o.current === p && u(!1);
1075
1089
  }
1076
1090
  }, [i, l, s, A]);
1077
- B(() => {
1091
+ j(() => {
1078
1092
  s && _();
1079
1093
  }, [s, _]);
1080
1094
  const k = P(
1081
1095
  async (p) => {
1082
- const v = i;
1083
- c(!0), y(null);
1096
+ const y = i;
1097
+ c(!0), v(null);
1084
1098
  try {
1085
- const C = await A("PATCH", p);
1086
- return o.current !== v ? !1 : (w(C), n(C.resolved, C.sources), !0);
1087
- } catch (C) {
1088
- return o.current === v && y(C instanceof Error ? C.message : "Unknown error"), !1;
1099
+ const T = await A("PATCH", p);
1100
+ return o.current !== y ? !1 : (w(T), n(T.resolved, T.sources), !0);
1101
+ } catch (T) {
1102
+ return o.current === y && v(T instanceof Error ? T.message : "Unknown error"), !1;
1089
1103
  } finally {
1090
- o.current === v && c(!1);
1104
+ o.current === y && c(!1);
1091
1105
  }
1092
1106
  },
1093
1107
  [i, n, A]
1094
1108
  ), N = P(async () => {
1095
1109
  const p = i;
1096
- m(!0), y(null);
1110
+ m(!0), v(null);
1097
1111
  try {
1098
- const v = await A("DELETE");
1099
- return o.current !== p ? !1 : (w(v), n(v.resolved, v.sources), !0);
1100
- } catch (v) {
1101
- return o.current === p && y(v instanceof Error ? v.message : "Unknown error"), !1;
1112
+ const y = await A("DELETE");
1113
+ return o.current !== p ? !1 : (w(y), n(y.resolved, y.sources), !0);
1114
+ } catch (y) {
1115
+ return o.current === p && v(y instanceof Error ? y.message : "Unknown error"), !1;
1102
1116
  } finally {
1103
1117
  o.current === p && m(!1);
1104
1118
  }
@@ -1139,7 +1153,7 @@ const he = [
1139
1153
  "INR",
1140
1154
  "BRL",
1141
1155
  "KWD"
1142
- ]), ka = Kt(), _a = ka.filter(
1156
+ ]), _a = Kt(), Pa = _a.filter(
1143
1157
  (e) => !Me.has(e)
1144
1158
  ), Ve = [
1145
1159
  { value: "short", label: "Short" },
@@ -1168,7 +1182,7 @@ function le(e) {
1168
1182
  var a;
1169
1183
  return ((a = Ve.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
1170
1184
  }
1171
- function Pa(e) {
1185
+ function za(e) {
1172
1186
  const a = he.find((t) => t.value === e);
1173
1187
  return a ? `${a.label} — ${a.value}` : e;
1174
1188
  }
@@ -1229,14 +1243,14 @@ function oe({
1229
1243
  )
1230
1244
  ] });
1231
1245
  }
1232
- function za({
1246
+ function La({
1233
1247
  value: e,
1234
1248
  inherited: a,
1235
1249
  inheritedSources: t,
1236
1250
  onChange: n,
1237
1251
  disabled: s
1238
1252
  }) {
1239
- var N, p, v, C;
1253
+ var N, p, y, T;
1240
1254
  const i = $(), l = $(), o = $(), h = $(), w = $(), u = (e.locale === void 0 ? void 0 : Fe(e.locale)) ?? a.locale, b = e.defaultCurrency ?? a.defaultCurrency, c = {
1241
1255
  locale: u,
1242
1256
  dateStyle: e.dateStyle ?? a.dateStyle,
@@ -1255,7 +1269,7 @@ function za({
1255
1269
  value: ke,
1256
1270
  metadata: { kind: "raw_temporal", valueKind: "date" },
1257
1271
  format: m
1258
- }).text, y = H({
1272
+ }).text, v = H({
1259
1273
  value: se,
1260
1274
  metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
1261
1275
  format: m
@@ -1322,7 +1336,7 @@ function za({
1322
1336
  locale: g === "inherit" ? void 0 : g
1323
1337
  }),
1324
1338
  children: [
1325
- /* @__PURE__ */ r(ce, { id: i, size: "xs", children: /* @__PURE__ */ r(ue, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : Pa(e.locale) }) }),
1339
+ /* @__PURE__ */ r(ce, { id: i, size: "xs", children: /* @__PURE__ */ r(ue, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : za(e.locale) }) }),
1326
1340
  /* @__PURE__ */ d(me, { children: [
1327
1341
  /* @__PURE__ */ d(O, { value: "inherit", children: [
1328
1342
  "Inherited from ",
@@ -1370,7 +1384,7 @@ function za({
1370
1384
  {
1371
1385
  id: h,
1372
1386
  label: "Date",
1373
- value: (v = e.dateTime) == null ? void 0 : v.dateStyle,
1387
+ value: (y = e.dateTime) == null ? void 0 : y.dateStyle,
1374
1388
  inherited: a.dateTime.dateStyle,
1375
1389
  inheritedSource: t.dateTime.dateStyle,
1376
1390
  examples: A,
@@ -1383,7 +1397,7 @@ function za({
1383
1397
  {
1384
1398
  id: w,
1385
1399
  label: "Time",
1386
- value: (C = e.dateTime) == null ? void 0 : C.timeStyle,
1400
+ value: (T = e.dateTime) == null ? void 0 : T.timeStyle,
1387
1401
  inherited: a.dateTime.timeStyle,
1388
1402
  inheritedSource: t.dateTime.timeStyle,
1389
1403
  examples: _,
@@ -1421,7 +1435,7 @@ function za({
1421
1435
  a.defaultCurrency
1422
1436
  ] }),
1423
1437
  [...Me].map((g) => /* @__PURE__ */ r(O, { value: g, children: g }, g)),
1424
- _a.map((g) => /* @__PURE__ */ r(O, { value: g, children: g }, g))
1438
+ Pa.map((g) => /* @__PURE__ */ r(O, { value: g, children: g }, g))
1425
1439
  ] })
1426
1440
  ]
1427
1441
  }
@@ -1436,7 +1450,7 @@ function za({
1436
1450
  ] }),
1437
1451
  /* @__PURE__ */ d("div", { className: "flex items-baseline justify-between gap-4", children: [
1438
1452
  /* @__PURE__ */ r("dt", { className: "text-muted-foreground", children: "Date & time" }),
1439
- /* @__PURE__ */ r("dd", { className: "text-right font-medium text-foreground", children: y })
1453
+ /* @__PURE__ */ r("dd", { className: "text-right font-medium text-foreground", children: v })
1440
1454
  ] }),
1441
1455
  /* @__PURE__ */ d("div", { className: "flex items-baseline justify-between gap-4", children: [
1442
1456
  /* @__PURE__ */ r("dt", { className: "text-muted-foreground", children: "Currency" }),
@@ -1469,7 +1483,7 @@ function Pe(e, a) {
1469
1483
  return e == null ? void 0 : e.defaultCurrency;
1470
1484
  }
1471
1485
  }
1472
- function La(e) {
1486
+ function Ra(e) {
1473
1487
  var n, s;
1474
1488
  const a = (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.dateStyle, t = (s = e == null ? void 0 : e.dateTime) == null ? void 0 : s.timeStyle;
1475
1489
  return {
@@ -1479,12 +1493,12 @@ function La(e) {
1479
1493
  defaultCurrency: e == null ? void 0 : e.defaultCurrency
1480
1494
  };
1481
1495
  }
1482
- function Ra({
1496
+ function Ua({
1483
1497
  active: e,
1484
1498
  onClose: a
1485
1499
  }) {
1486
1500
  var o, h, w, x, u, b, c;
1487
- const { preferences: t, isLoading: n, isSaving: s, updatePreferences: i } = Da({ enabled: e });
1501
+ const { preferences: t, isLoading: n, isSaving: s, updatePreferences: i } = ka({ enabled: e });
1488
1502
  if (!e) return null;
1489
1503
  if (!t)
1490
1504
  return /* @__PURE__ */ d(M, { children: [
@@ -1505,7 +1519,7 @@ function Ra({
1505
1519
  ((c = t.stored) == null ? void 0 : c.defaultCurrency) ?? ""
1506
1520
  ].join(":");
1507
1521
  return /* @__PURE__ */ r(
1508
- Ua,
1522
+ Fa,
1509
1523
  {
1510
1524
  preferences: t,
1511
1525
  isSaving: s,
@@ -1515,7 +1529,7 @@ function Ra({
1515
1529
  l
1516
1530
  );
1517
1531
  }
1518
- function Ua({
1532
+ function Fa({
1519
1533
  preferences: e,
1520
1534
  isSaving: a,
1521
1535
  updatePreferences: t,
@@ -1523,7 +1537,7 @@ function Ua({
1523
1537
  }) {
1524
1538
  var w, x;
1525
1539
  const [s, i] = I(
1526
- () => La(e.stored)
1540
+ () => Ra(e.stored)
1527
1541
  ), l = (s.locale === void 0 || Fe(s.locale) !== void 0) && (s.defaultCurrency === void 0 || qt(s.defaultCurrency) !== void 0) && (s.dateStyle === void 0 || ["short", "medium", "long"].includes(s.dateStyle)) && (((w = s.dateTime) == null ? void 0 : w.dateStyle) === void 0 || ["short", "medium", "long"].includes(s.dateTime.dateStyle)) && (((x = s.dateTime) == null ? void 0 : x.timeStyle) === void 0 || ["short", "medium", "long"].includes(s.dateTime.timeStyle)), o = async () => {
1528
1542
  const u = {
1529
1543
  ...s.locale !== void 0 ? { locale: s.locale } : {},
@@ -1546,7 +1560,7 @@ function Ua({
1546
1560
  };
1547
1561
  return /* @__PURE__ */ d(M, { children: [
1548
1562
  /* @__PURE__ */ r("div", { className: "py-2", children: /* @__PURE__ */ r(
1549
- za,
1563
+ La,
1550
1564
  {
1551
1565
  value: s,
1552
1566
  inherited: e.inherited,
@@ -1593,7 +1607,7 @@ function Ua({
1593
1607
  ] })
1594
1608
  ] });
1595
1609
  }
1596
- function er({
1610
+ function tr({
1597
1611
  open: e,
1598
1612
  onOpenChange: a
1599
1613
  }) {
@@ -1605,18 +1619,18 @@ function er({
1605
1619
  ] }),
1606
1620
  /* @__PURE__ */ d(Wt, { value: t, onValueChange: n, children: [
1607
1621
  /* @__PURE__ */ d($t, { variant: "underline", className: "w-full justify-start", children: [
1608
- /* @__PURE__ */ r(Te, { value: "display", children: "Display formats" }),
1609
- /* @__PURE__ */ r(Te, { value: "calendar", children: "Calendar" })
1622
+ /* @__PURE__ */ r(Ce, { value: "display", children: "Display formats" }),
1623
+ /* @__PURE__ */ r(Ce, { value: "calendar", children: "Calendar" })
1610
1624
  ] }),
1611
- /* @__PURE__ */ r(Ce, { value: "display", children: /* @__PURE__ */ r(
1612
- Ra,
1625
+ /* @__PURE__ */ r(Te, { value: "display", children: /* @__PURE__ */ r(
1626
+ Ua,
1613
1627
  {
1614
1628
  active: e && t === "display",
1615
1629
  onClose: s
1616
1630
  }
1617
1631
  ) }),
1618
- /* @__PURE__ */ r(Ce, { value: "calendar", children: /* @__PURE__ */ r(
1619
- Aa,
1632
+ /* @__PURE__ */ r(Te, { value: "calendar", children: /* @__PURE__ */ r(
1633
+ Da,
1620
1634
  {
1621
1635
  active: e && t === "calendar",
1622
1636
  onClose: s
@@ -1627,11 +1641,11 @@ function er({
1627
1641
  }
1628
1642
  export {
1629
1643
  ea as A,
1630
- Qa as D,
1631
- er as R,
1632
- za as a,
1644
+ er as D,
1645
+ tr as R,
1646
+ La as a,
1633
1647
  da as b,
1634
- Ya as c,
1648
+ Qa as c,
1635
1649
  ba as d,
1636
1650
  pa as u
1637
1651
  };