react-semaphor 0.1.544 → 0.1.546

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 (179) hide show
  1. package/dist/analytics-protocol/index.js +405 -441
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +100 -76
  4. package/dist/brand-studio/index.js +5 -5
  5. package/dist/briefings/index.js +55 -52
  6. package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
  7. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  8. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  9. package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-BPXhulAx.js} +2792 -2562
  10. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
  11. package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
  12. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  13. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  14. package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
  15. package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-C3CoKbGY.js} +1 -1
  16. package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
  17. package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
  18. package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-BrjxIiRt.js} +6 -6
  19. package/dist/chunks/document-dashboard-inputs-CRVHpIHp.js +3010 -0
  20. package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-DYYYDjY6.js} +5986 -6063
  21. package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-Ddf55Ku1.js} +8 -8
  22. package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
  23. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  24. package/dist/chunks/{index-DkAyQvC6.js → index-DkQkMKa1.js} +385 -339
  25. package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
  26. package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
  27. package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
  28. package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DWEeC0_c.js} +55 -55
  29. package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
  30. package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
  31. package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
  32. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
  33. package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
  34. package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
  35. package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
  36. package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
  37. package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
  38. package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
  39. package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-4QEZWe5U.js} +637 -610
  40. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  41. package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
  42. package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-D_I3Lxk0.js} +184 -212
  43. package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
  44. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  45. package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-4zpRHE-X.js} +56832 -59068
  46. package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-Cfw7TRAx.js} +890 -871
  47. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  48. package/dist/chunks/{switch-C3jLxlG0.js → switch-CEBOR4n7.js} +47 -48
  49. package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-4X9mAG3V.js} +1 -1
  50. package/dist/chunks/table-settings-CunhoDUi.js +605 -0
  51. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  52. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  53. package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-DZBZiiD-.js} +83 -83
  54. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  55. package/dist/dashboard/index.js +2 -2
  56. package/dist/dashboard-authoring/index.js +1800 -1135
  57. package/dist/data-app-sdk/index.js +6 -6
  58. package/dist/data-app-sdk-adapters/index.js +3 -3
  59. package/dist/data-app-sdk-validation/index.js +14 -14
  60. package/dist/format-utils/index.js +198 -187
  61. package/dist/index.js +359 -325
  62. package/dist/layouts/index.js +5 -242
  63. package/dist/report-runtime-context/index.js +2 -2
  64. package/dist/shared/index.js +4 -5
  65. package/dist/style.css +1 -1
  66. package/dist/surfboard/index.js +2 -2
  67. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  68. package/dist/types/briefings/attachments.d.ts +33 -6
  69. package/dist/types/briefings/index.d.ts +6 -5
  70. package/dist/types/components/index.d.ts +2 -0
  71. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  72. package/dist/types/components/surfboard/filter/types.d.ts +0 -14
  73. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
  74. package/dist/types/index.js +6 -6
  75. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  76. package/dist/types/lib/charts/types.d.ts +2 -2
  77. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
  78. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
  79. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +41 -1
  80. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +201 -0
  81. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  82. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
  83. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
  84. package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
  85. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
  86. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
  87. package/dist/types/lib/download-pdf.d.ts +75 -1
  88. package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
  89. package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
  90. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
  91. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  92. package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
  93. package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
  94. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
  95. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
  96. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
  97. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
  98. package/dist/types/lib/stores/dashboard-store.d.ts +159 -56
  99. package/dist/types/lib/stores/editor-store.d.ts +0 -3
  100. package/dist/types/lib/types/common-types.d.ts +29 -6
  101. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  102. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  103. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  104. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  105. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  106. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  107. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  108. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  109. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  110. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  111. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  112. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  113. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  114. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -12
  115. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  116. package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
  117. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  118. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  119. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  120. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  121. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  122. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  123. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  124. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  125. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
  126. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  127. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
  128. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  129. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  130. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -6
  131. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  132. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
  133. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +118 -0
  134. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  135. package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
  136. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
  137. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
  138. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
  139. package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
  140. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
  141. package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
  142. package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
  143. package/dist/types/shared/dashboard-authoring/index.d.ts +20 -2
  144. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  145. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  146. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
  147. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
  148. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  149. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
  150. package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
  151. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  152. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  153. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  154. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  155. package/dist/types/shared/layouts/index.d.ts +1 -2
  156. package/package.json +2 -2
  157. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
  158. package/dist/chunks/apply-dashboard-operations-Bz4n1Lq6.js +0 -2260
  159. package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
  160. package/dist/chunks/comparison-window-caption-BTkrN3W4.js +0 -1623
  161. package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +0 -323
  162. package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +0 -3725
  163. package/dist/chunks/dashboard-controls-8RyBTQUO.js +0 -2315
  164. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  165. package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
  166. package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
  167. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  168. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  169. package/dist/chunks/numeric-presentation-DESvLiu9.js +0 -5227
  170. package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
  171. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  172. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  173. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  174. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
  175. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
  176. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  177. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  178. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  179. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -1,28 +1,28 @@
1
1
  import { jsxs as h, jsx as l, Fragment as ie } from "react/jsx-runtime";
2
2
  import * as p from "react";
3
- import Ft, { useRef as J, useState as F, useCallback as $, useEffect as ee, useMemo as Q, lazy as Se, Suspense as ye, useLayoutEffect as Xe, Activity as Lt, useId as ce } from "react";
4
- import { u as j, b6 as _t, b7 as Mt, W as Ut, b8 as Ot, b9 as jt, ba as Wt, b as Bt, aX as Be, bb as $t, bc as Vt, bd as mt, p as Kt, be as Ht, bf as qt, bg as Gt, bh as Xt, bi as be, bj as ft, bk as Je, E as Jt, F as Yt, S as Zt, B as Qt, a as ea, U as ta, D as aa, A as ra, C as na, bl as la, bm as sa, bn as ia, bo as oa, bp as da, bq as Ye, br as Ne, bs as ca, bt as $e, bu as ua, bv as ma, bw as fa, bx as ha, by as pa } from "./semaphor-ready-indicator-DDAxk8us.js";
5
- import { ad as va, ae as H } from "./numeric-presentation-DESvLiu9.js";
6
- import { l as oe, B as V, N as ba, O as ga, Q as ya, U as wa, V as Sa, W as xa, X as se, z as Z, Y as he, P as Ca, a as Na, b as Ea, c as Ze, L as ht, r as Pe, s as ze, t as Fe, u as Le, v as X, T as Ta, d as ka, e as Qe, g as et } from "./switch-C3jLxlG0.js";
7
- import { X as Ia } from "./x-4f5U2XwU.js";
8
- import { j as Aa } from "./index-CuHybtft.js";
9
- import "./validators-DMHTpf7a.js";
10
- import "./matrix-operation-contract-8OIO4gob.js";
11
- import "./analytics-base-schemas-BFAoRlkU.js";
3
+ import Lt, { useRef as Y, useState as L, useCallback as $, useEffect as ee, useMemo as q, lazy as Se, Suspense as ye, useLayoutEffect as Xe, Activity as _t, useId as ce } from "react";
4
+ import { u as M, be as Mt, bf as Ot, bg as mt, a1 as Ut, bh as jt, bi as Bt, bj as Wt, b as $t, b2 as We, bk as Vt, bl as Kt, bm as ft, t as Ht, bn as qt, bo as Gt, bp as Xt, bq as Jt, br as be, bs as ht, bt as Je, E as Yt, F as Zt, S as Qt, B as ea, a as ta, U as aa, bu as ra, D as na, A as la, C as sa, bv as ia, bw as oa, bx as da, by as ca, bz as Ye, bA as Ne, bB as ua, bC as $e, bD as H, bE as ma, bF as fa, bG as ha, bH as pa, bI as va } from "./semaphor-ready-indicator-4zpRHE-X.js";
5
+ import "./validators-C-aOQlTB.js";
6
+ import "./matrix-operation-contract-D6vYkZK4.js";
7
+ import "./analytics-base-schemas-BKs3flFS.js";
12
8
  import "zod";
13
- import { parseValueFormatPreferencesResponse as Da, canonicalizeSupportedLocale as pt, getSupportedCurrencyCodes as Ra, canonicalizeSupportedCurrencyCode as Pa } from "../value-format-preferences/index.js";
14
- import { c as M } from "./class-utils-Df1OVOT1.js";
15
- import { x as za } from "./document-sheet-utils-Duo9uLoH.js";
16
- import { A as Fa } from "./table-settings-CLZocegs.js";
17
- import { r as La, a as vt } from "./availability-Bp5Gfu1I.js";
18
- import { s as _a } from "./stable-serialize-CfqXeiBP.js";
19
- import { S as Ma } from "./selection-reducer-Dj_8xD69.js";
20
- import { a as Ua } from "./report-runtime-context-Dq8XyODK.js";
21
- import { r as ge, M as ue } from "./temporal-bucket-D7NBrrtL.js";
22
- function Oa(e = []) {
23
- const a = J(null), t = J(null), r = J(null), [n, i] = F(), s = $(() => {
24
- var m, S, N;
25
- const o = ((m = a.current) == null ? void 0 : m.clientWidth) ?? 0, f = ((S = r.current) == null ? void 0 : S.offsetWidth) ?? 0, u = ((N = t.current) == null ? void 0 : N.offsetWidth) ?? 0, c = o - f - u - 8, v = Math.max(c, 0);
9
+ import { X as ba, cN as ga, bl as ya, bm as wa, ar as Sa, s as xa } from "./global-date-filter-utils-9d6m9-FE.js";
10
+ import { j as Ca } from "./index-CuHybtft.js";
11
+ import { parseValueFormatPreferencesResponse as Na, canonicalizeSupportedLocale as pt, getSupportedCurrencyCodes as Ea, canonicalizeSupportedCurrencyCode as Ta } from "../value-format-preferences/index.js";
12
+ import { c as O } from "./_commonjsHelpers-DimLPMtv.js";
13
+ import "./index-CtoK1Lgu.js";
14
+ import "./pivot-result-lifecycle-pwq3b7LC.js";
15
+ import { H as Ia } from "./table-settings-CunhoDUi.js";
16
+ import { l as oe, B as V, N as ka, O as Aa, Q as Da, U as Ra, V as Pa, W as za, X as se, z as Q, Y as he, P as Fa, a as La, b as _a, c as Ze, L as vt, r as Pe, s as ze, t as Fe, u as Le, v as J, T as Ma, d as Oa, e as Qe, g as et } from "./switch-CEBOR4n7.js";
17
+ import { X as Ua } from "./x-4f5U2XwU.js";
18
+ import { r as ja, a as bt } from "./availability-Bp5Gfu1I.js";
19
+ import { S as Ba } from "./selection-reducer-CJzkTZio.js";
20
+ import { a as Wa } from "./report-runtime-context-hWiTCzFV.js";
21
+ import { r as ge, M as ue } from "./temporal-bucket-CQOSbv9-.js";
22
+ function $a(e = []) {
23
+ const a = Y(null), t = Y(null), n = Y(null), [r, i] = L(), s = $(() => {
24
+ var m, x, I;
25
+ const o = ((m = a.current) == null ? void 0 : m.clientWidth) ?? 0, f = ((x = n.current) == null ? void 0 : x.offsetWidth) ?? 0, u = ((I = t.current) == null ? void 0 : I.offsetWidth) ?? 0, c = o - f - u - 8, v = Math.max(c, 0);
26
26
  i((w) => w === v ? w : v);
27
27
  }, []);
28
28
  return ee(() => {
@@ -33,34 +33,48 @@ function Oa(e = []) {
33
33
  }, [s, ...e]), {
34
34
  headerRef: a,
35
35
  leftActionsRef: t,
36
- rightActionsRef: r,
37
- titleMaxWidth: n,
36
+ rightActionsRef: n,
37
+ titleMaxWidth: r,
38
38
  updateAvailableWidth: s
39
39
  };
40
40
  }
41
- function ja({ filter: e }) {
42
- var S;
43
- const a = j(
44
- (N) => N.isDashboardEditing
45
- ), { preferences: t } = _t(), r = Mt((S = t == null ? void 0 : t.cardDisplay) == null ? void 0 : S.mode), n = j((N) => N.filterValues), i = n == null ? void 0 : n.some(
46
- (N) => N.filterId === e.id
47
- ), { removeFilterValues: s, removeFilter: o, updateFilter: f } = Ut(), {
48
- headerRef: u,
49
- leftActionsRef: g,
50
- rightActionsRef: c,
51
- titleMaxWidth: v,
52
- updateAvailableWidth: m
53
- } = Oa([
41
+ function Va({ filter: e }) {
42
+ var w;
43
+ const a = M(
44
+ (y) => y.isDashboardEditing
45
+ ), { preferences: t } = Mt(), n = Ot((w = t == null ? void 0 : t.cardDisplay) == null ? void 0 : w.mode), r = M((y) => y.dashboard), i = M(
46
+ (y) => y.dashboardInputValues
47
+ ), s = M((y) => y.selectedSheetId), o = mt(), f = q(() => {
48
+ var F;
49
+ const y = (F = ba(r).findFilterInput({
50
+ filterId: e.id
51
+ })) == null ? void 0 : F.input;
52
+ if (!y) return !1;
53
+ const P = ga({
54
+ dashboard: r,
55
+ input: y,
56
+ runtimeValues: i,
57
+ target: { sheetId: s },
58
+ calendar: o
59
+ });
60
+ return (P == null ? void 0 : P.status) === "set";
61
+ }, [o, r, i, e.id, s]), { removeFilterInput: u, saveFilterSettings: g } = Ut(), {
62
+ headerRef: c,
63
+ leftActionsRef: v,
64
+ rightActionsRef: m,
65
+ titleMaxWidth: x,
66
+ updateAvailableWidth: I
67
+ } = $a([
54
68
  a,
55
- i,
56
- r
69
+ f,
70
+ n
57
71
  ]);
58
72
  return ee(() => {
59
- m();
60
- }, [e.title, m]), /* @__PURE__ */ h(
73
+ I();
74
+ }, [e.title, I]), /* @__PURE__ */ h(
61
75
  "div",
62
76
  {
63
- ref: u,
77
+ ref: c,
64
78
  className: "group mb-1 flex h-5 items-center justify-between",
65
79
  children: [
66
80
  /* @__PURE__ */ h("div", { className: "flex grow items-center gap-2 min-w-0", children: [
@@ -68,12 +82,15 @@ function ja({ filter: e }) {
68
82
  "div",
69
83
  {
70
84
  className: "min-w-0 flex-1",
71
- style: v !== void 0 ? { maxWidth: v } : void 0,
85
+ style: x !== void 0 ? { maxWidth: x } : void 0,
72
86
  children: /* @__PURE__ */ l(oe, { className: "my-1 block w-full text-sm", children: /* @__PURE__ */ l(
73
- Ot,
87
+ jt,
74
88
  {
75
89
  value: e.title || e.column,
76
- onSave: (N) => f({ ...e, title: N }),
90
+ onSave: (y) => g(
91
+ { filterId: e.id },
92
+ { definition: { ...e, title: y } }
93
+ ),
77
94
  isEditable: a,
78
95
  placeholder: "Filter",
79
96
  displayClassName: "text-sm truncate",
@@ -86,43 +103,53 @@ function ja({ filter: e }) {
86
103
  "div",
87
104
  {
88
105
  className: "flex shrink-0 items-center gap-1.5",
89
- ref: g,
106
+ ref: v,
90
107
  children: [
91
- a && /* @__PURE__ */ l(jt, { filter: e, isEditing: a }),
108
+ a && /* @__PURE__ */ l(
109
+ Bt,
110
+ {
111
+ filter: e,
112
+ isEditing: a,
113
+ filterRef: { filterId: e.id }
114
+ }
115
+ ),
92
116
  a && /* @__PURE__ */ l(
93
117
  "button",
94
118
  {
95
119
  onClick: () => {
96
- s(e.id), o(e.id);
120
+ u({ filterId: e.id });
97
121
  },
98
122
  className: "text-muted-foreground hover:text-foreground",
99
- children: /* @__PURE__ */ l(Ia, { className: "size-3.5" })
123
+ children: /* @__PURE__ */ l(Ua, { className: "size-3.5" })
100
124
  }
101
125
  )
102
126
  ]
103
127
  }
104
128
  )
105
129
  ] }),
106
- /* @__PURE__ */ l("div", { className: "hidden", ref: c })
130
+ /* @__PURE__ */ l("div", { className: "hidden", ref: m })
107
131
  ]
108
132
  }
109
133
  );
110
134
  }
111
- function Wa() {
112
- const e = j((r) => r.dashboard.filters), a = j((r) => r.theme), t = e == null ? void 0 : e.filter((r) => r.hide);
113
- return t != null && t.length ? /* @__PURE__ */ l(
135
+ function Ka() {
136
+ const e = M((r) => r.dashboard), a = M((r) => r.selectedSheetId), t = M((r) => r.theme), n = q(
137
+ () => ya(e, a, "dashboard").filter(({ input: r }) => wa(r)).map(({ input: r }) => r.filter),
138
+ [e, a]
139
+ );
140
+ return n.length ? /* @__PURE__ */ l(
114
141
  "div",
115
142
  {
116
- className: M("mb-1 flex items-center gap-2 border-y px-0.5 pb-0.5", {
117
- "bg-[repeating-linear-gradient(45deg,_#ffffff_0_3px,_#f3f3f3_3px_6px)]": a === "light",
118
- "bg-[repeating-linear-gradient(45deg,_#18171d_0_3px,_#272729_3px_6px)]": a === "dark"
143
+ className: O("mb-1 flex items-center gap-2 border-y px-0.5 pb-0.5", {
144
+ "bg-[repeating-linear-gradient(45deg,_#ffffff_0_3px,_#f3f3f3_3px_6px)]": t === "light",
145
+ "bg-[repeating-linear-gradient(45deg,_#18171d_0_3px,_#272729_3px_6px)]": t === "dark"
119
146
  }),
120
- children: t == null ? void 0 : t.map((r) => /* @__PURE__ */ h(
147
+ children: n.map((r) => /* @__PURE__ */ h(
121
148
  "div",
122
149
  {
123
150
  className: "flex min-w-[250px] max-w-fit flex-col gap-1 p-2",
124
151
  children: [
125
- /* @__PURE__ */ l(ja, { filter: r }),
152
+ /* @__PURE__ */ l(Va, { filter: r }),
126
153
  /* @__PURE__ */ l(Wt, { filter: r })
127
154
  ]
128
155
  },
@@ -131,39 +158,39 @@ function Wa() {
131
158
  }
132
159
  ) : null;
133
160
  }
134
- function Ba() {
161
+ function Ha() {
135
162
  var i;
136
- const e = j((s) => s.dashboard), a = j((s) => s.selectedSheetId), t = j(
163
+ const e = M((s) => s.dashboard), a = M((s) => s.selectedSheetId), t = M(
137
164
  (s) => s.isDashboardEditing
138
- ), r = (i = e.sheets) == null ? void 0 : i.find(
165
+ ), n = (i = e.sheets) == null ? void 0 : i.find(
139
166
  (s) => s.id === a
140
- ), n = za(r);
167
+ ), r = Sa(n);
141
168
  return /* @__PURE__ */ l(
142
169
  "div",
143
170
  {
144
171
  role: "dashboard-plus-main",
145
172
  className: "flex min-h-0 grow basis-0 overflow-hidden",
146
173
  children: /* @__PURE__ */ h("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: [
147
- t && !n && /* @__PURE__ */ l(Wa, {}),
148
- /* @__PURE__ */ l(Bt, {})
174
+ t && !r && /* @__PURE__ */ l(Ka, {}),
175
+ /* @__PURE__ */ l($t, {})
149
176
  ] })
150
177
  }
151
178
  );
152
179
  }
153
- const $a = /* @__PURE__ */ new Set(["iat", "exp", "nbf", "jti"]);
154
- function Va(e) {
155
- return _a(
180
+ const qa = /* @__PURE__ */ new Set(["iat", "exp", "nbf", "jti"]);
181
+ function Ga(e) {
182
+ return xa(
156
183
  Object.fromEntries(
157
- Object.entries(e ?? {}).filter(([a]) => !$a.has(a))
184
+ Object.entries(e ?? {}).filter(([a]) => !qa.has(a))
158
185
  )
159
186
  );
160
187
  }
161
- function Ka(e) {
188
+ function Xa(e) {
162
189
  var t;
163
190
  const a = e == null ? void 0 : e.config;
164
- return La({
191
+ return ja({
165
192
  features: ((t = a == null ? void 0 : a.projectFeatures) == null ? void 0 : t.features) ?? {},
166
- config: { enabled: vt(a).enabled },
193
+ config: { enabled: bt(a).enabled },
167
194
  identity: {
168
195
  orgUserId: e == null ? void 0 : e.orgUserId,
169
196
  tenantId: e == null ? void 0 : e.tenantId,
@@ -175,54 +202,54 @@ function Ka(e) {
175
202
  let tt = 0;
176
203
  function at(e, a) {
177
204
  tt += 1;
178
- const { name: t, layout: r } = vt(a == null ? void 0 : a.config);
179
- return { ...Vt(r), id: tt, callerKey: e, assistantName: t };
205
+ const { name: t, layout: n } = bt(a == null ? void 0 : a.config);
206
+ return { ...Kt(n), id: tt, callerKey: e, assistantName: t };
180
207
  }
181
- function Ha({
208
+ function Ja({
182
209
  children: e,
183
210
  authToken: a
184
211
  }) {
185
- const t = Be(), r = Q(
186
- () => a === void 0 ? t.tokenProps : Ga(a),
212
+ const t = We(), n = q(
213
+ () => a === void 0 ? t.tokenProps : Za(a),
187
214
  [a, t.tokenProps]
188
- ), n = Q(() => Va(r), [r]), i = Q(
189
- () => Ka(r).available,
190
- [r]
191
- ), [s, o] = F(() => at(n, r));
192
- s.callerKey !== n && o(at(n, r)), Xa(s);
193
- const f = Q(() => ({ instance: s, available: i }), [s, i]);
194
- return /* @__PURE__ */ l($t.Provider, { value: f, children: e });
215
+ ), r = q(() => Ga(n), [n]), i = q(
216
+ () => Xa(n).available,
217
+ [n]
218
+ ), [s, o] = L(() => at(r, n));
219
+ s.callerKey !== r && o(at(r, n)), Qa(s);
220
+ const f = q(() => ({ instance: s, available: i }), [s, i]);
221
+ return /* @__PURE__ */ l(Vt.Provider, { value: f, children: e });
195
222
  }
196
- function qa({ children: e }) {
197
- return mt() ? /* @__PURE__ */ l(ie, { children: e }) : /* @__PURE__ */ l(Ha, { children: e });
223
+ function Ya({ children: e }) {
224
+ return ft() ? /* @__PURE__ */ l(ie, { children: e }) : /* @__PURE__ */ l(Ja, { children: e });
198
225
  }
199
- function Ga(e) {
226
+ function Za(e) {
200
227
  if (!(e != null && e.accessToken)) return {};
201
228
  try {
202
- return Aa(e.accessToken);
229
+ return Ca(e.accessToken);
203
230
  } catch {
204
231
  return {};
205
232
  }
206
233
  }
207
- function Xa(e) {
234
+ function Qa(e) {
208
235
  ee(() => {
209
- const a = (r, n) => {
236
+ const a = (n, r) => {
210
237
  const i = e.store.getState().focus;
211
- i && !Ja(i, r, n) && e.clearFocus();
212
- }, t = j.getState();
213
- return a(t.selectedSheetId, t.dashboard), j.subscribe((r, n) => {
214
- (r.selectedSheetId !== n.selectedSheetId || r.dashboard !== n.dashboard) && a(r.selectedSheetId, r.dashboard), r.isVisualEditing && !n.isVisualEditing && e.leaveBeside();
238
+ i && !er(i, n, r) && e.clearFocus();
239
+ }, t = M.getState();
240
+ return a(t.selectedSheetId, t.dashboard), M.subscribe((n, r) => {
241
+ (n.selectedSheetId !== r.selectedSheetId || n.dashboard !== r.dashboard) && a(n.selectedSheetId, n.dashboard), n.isVisualEditing && !r.isVisualEditing && e.leaveBeside();
215
242
  });
216
243
  }, [e]);
217
244
  }
218
- function Ja(e, a, t) {
245
+ function er(e, a, t) {
219
246
  if ((a ?? null) !== e.sheetId) return !1;
220
- const r = t ? Fa(t, e.cardId) : void 0;
221
- return !!r && r.sheet.id === e.sheetId;
247
+ const n = t ? Ia(t, e.cardId) : void 0;
248
+ return !!n && n.sheet.id === e.sheetId;
222
249
  }
223
- const Ya = Se(() => import("./assistant-chat-BNLkCDml.js"));
224
- function hn() {
225
- const e = Kt();
250
+ const tr = Se(() => import("./assistant-chat-BPXhulAx.js"));
251
+ function gn() {
252
+ const e = Ht();
226
253
  return e.available ? /* @__PURE__ */ h(
227
254
  V,
228
255
  {
@@ -231,24 +258,24 @@ function hn() {
231
258
  "aria-pressed": e.isOpen,
232
259
  onClick: e.toggle,
233
260
  children: [
234
- /* @__PURE__ */ l(Ht, { className: "h-3.5 w-3.5" }),
261
+ /* @__PURE__ */ l(qt, { className: "h-3.5 w-3.5" }),
235
262
  e.assistantName
236
263
  ]
237
264
  }
238
265
  ) : null;
239
266
  }
240
- const Za = {
267
+ const ar = {
241
268
  // Docked widths are the viewer's (the resize handle), applied as a style.
242
269
  "docked-right": "relative shrink-0 border-l border-border",
243
270
  "docked-left": "relative order-first shrink-0 border-r border-border",
244
271
  centered: "absolute left-1/2 top-1/2 z-30 h-[min(80%,760px)] w-[min(640px,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-card border border-border shadow-lg",
245
272
  "full-page": "absolute inset-0 z-30"
246
- }, Qa = "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", er = 640, fe = 8;
247
- function tr({ surface: e = "dashboard" } = {}) {
248
- const a = mt(), { isOpen: t, mounted: r, storedLayout: n, width: i, beside: s, besideSize: o, focusCardId: f, askCount: u } = qt(
249
- (a == null ? void 0 : a.instance.store) ?? Xt,
250
- Gt((w) => {
251
- var k;
273
+ }, rr = "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", nr = 640, fe = 8;
274
+ function lr({ surface: e = "dashboard" } = {}) {
275
+ const a = ft(), { isOpen: t, mounted: n, storedLayout: r, width: i, beside: s, besideSize: o, focusCardId: f, askCount: u } = Gt(
276
+ (a == null ? void 0 : a.instance.store) ?? Jt,
277
+ Xt((w) => {
278
+ var y;
252
279
  return {
253
280
  isOpen: w.isOpen,
254
281
  mounted: w.mounted,
@@ -256,15 +283,15 @@ function tr({ surface: e = "dashboard" } = {}) {
256
283
  width: w.width,
257
284
  beside: w.beside,
258
285
  besideSize: w.besideSize,
259
- focusCardId: (k = w.focus) == null ? void 0 : k.cardId,
286
+ focusCardId: (y = w.focus) == null ? void 0 : y.cardId,
260
287
  askCount: w.askCount
261
288
  };
262
289
  })
263
- ), g = e === "none", c = j(
264
- (w) => s && t && f && !g ? ar(w.dashboard, w.selectedSheetId, f) : void 0
265
- ), v = rr(c, u);
266
- if (!(a != null && a.available) || !r && !g) return null;
267
- const m = g ? "full-page" : v.shown ? "beside-card" : n, S = g || t, N = m === "docked-right" || m === "docked-left";
290
+ ), g = e === "none", c = M(
291
+ (w) => s && t && f && !g ? sr(w.dashboard, w.selectedSheetId, f) : void 0
292
+ ), v = ir(c, u);
293
+ if (!(a != null && a.available) || !n && !g) return null;
294
+ const m = g ? "full-page" : v.shown ? "beside-card" : r, x = g || t, I = m === "docked-right" || m === "docked-left";
268
295
  return /* @__PURE__ */ h(
269
296
  "aside",
270
297
  {
@@ -274,61 +301,61 @@ function tr({ surface: e = "dashboard" } = {}) {
274
301
  "data-layout": m,
275
302
  "data-beside-frame": m === "beside-card" ? c : void 0,
276
303
  "data-beside-side": m === "beside-card" ? v.side : void 0,
277
- className: M(
304
+ className: O(
278
305
  "flex-col bg-background",
279
- m === "beside-card" ? Qa : Za[m],
280
- S ? "flex" : "hidden"
306
+ m === "beside-card" ? rr : ar[m],
307
+ x ? "flex" : "hidden"
281
308
  ),
282
309
  style: m === "beside-card" ? { ...v.style, width: o.width, height: o.height } : (
283
310
  // The saved width, never more than the share of the dashboard's area the
284
311
  // handle allows, however the area is sized now or later (P4-10).
285
- N ? { width: i, maxWidth: `${bt * 100}%` } : void 0
312
+ I ? { width: i, maxWidth: `${gt * 100}%` } : void 0
286
313
  ),
287
314
  onKeyDown: m === "beside-card" ? (w) => {
288
315
  if (w.key !== "Escape" || w.defaultPrevented || !(w.target instanceof Node) || !w.currentTarget.contains(w.target)) return;
289
316
  w.preventDefault();
290
- const k = v.cardActions();
291
- a.instance.close(), k == null || k.focus();
317
+ const y = v.cardActions();
318
+ a.instance.close(), y == null || y.focus();
292
319
  } : void 0,
293
320
  children: [
294
- N ? /* @__PURE__ */ l(sr, { instance: a.instance, side: m === "docked-left" ? "right" : "left", width: i }) : null,
295
- m === "beside-card" ? /* @__PURE__ */ l(lr, { instance: a.instance, size: o, side: v.handleSide }) : null,
296
- /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(Ya, { instance: a.instance, surface: e, placement: m }, a.instance.id) })
321
+ I ? /* @__PURE__ */ l(cr, { instance: a.instance, side: m === "docked-left" ? "right" : "left", width: i }) : null,
322
+ m === "beside-card" ? /* @__PURE__ */ l(dr, { instance: a.instance, size: o, side: v.handleSide }) : null,
323
+ /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(tr, { instance: a.instance, surface: e, placement: m }, a.instance.id) })
297
324
  ]
298
325
  }
299
326
  );
300
327
  }
301
- function ar(e, a, t) {
302
- var n, i, s;
303
- const r = (n = e.sheets) == null ? void 0 : n.find((o) => o.id === a);
304
- return (s = (i = r == null ? void 0 : r.frames) == null ? void 0 : i.find((o) => {
328
+ function sr(e, a, t) {
329
+ var r, i, s;
330
+ const n = (r = e.sheets) == null ? void 0 : r.find((o) => o.id === a);
331
+ return (s = (i = n == null ? void 0 : n.frames) == null ? void 0 : i.find((o) => {
305
332
  var f;
306
333
  return (f = o.cards) == null ? void 0 : f.some((u) => u.id === t);
307
334
  })) == null ? void 0 : s.id;
308
335
  }
309
- function rr(e, a) {
310
- var S;
311
- const [t, r] = F(void 0), [n, i] = F(void 0), s = J(a);
336
+ function ir(e, a) {
337
+ var x;
338
+ const [t, n] = L(void 0), [r, i] = L(void 0), s = Y(a);
312
339
  Xe(() => {
313
340
  s.current = a;
314
341
  });
315
- const o = n === a ? null : t, { refs: f, elements: u, floatingStyles: g, middlewareData: c, isPositioned: v } = ba({
342
+ const o = r === a ? null : t, { refs: f, elements: u, floatingStyles: g, middlewareData: c, isPositioned: v } = ka({
316
343
  strategy: "absolute",
317
344
  placement: o ?? "right-start",
318
345
  middleware: [
319
- ga(fe),
320
- ya({ padding: fe }),
321
- wa({
346
+ Aa(fe),
347
+ Da({ padding: fe }),
348
+ Ra({
322
349
  padding: fe,
323
- apply: ({ availableWidth: N, availableHeight: w, elements: k }) => {
324
- k.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, N)}px`), k.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, w)}px`);
350
+ apply: ({ availableWidth: I, availableHeight: w, elements: y }) => {
351
+ y.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, I)}px`), y.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, w)}px`);
325
352
  }
326
353
  }),
327
- Sa()
354
+ Pa()
328
355
  ],
329
- whileElementsMounted: (N, w, k) => xa(N, w, () => {
330
- const z = nr(N, w);
331
- r(z), z === null && i(s.current), k();
356
+ whileElementsMounted: (I, w, y) => za(I, w, () => {
357
+ const P = or(I, w);
358
+ n(P), P === null && i(s.current), y();
332
359
  })
333
360
  }), m = u.floating;
334
361
  return Xe(() => {
@@ -340,38 +367,38 @@ function rr(e, a) {
340
367
  ...g,
341
368
  // Not before it is placed (its side is chosen first): never a flash at
342
369
  // the row's corner. With the card wholly out of view, it goes with the card.
343
- ...!v || (S = c.hide) != null && S.referenceHidden ? { visibility: "hidden" } : {}
370
+ ...!v || (x = c.hide) != null && x.referenceHidden ? { visibility: "hidden" } : {}
344
371
  },
345
372
  /** The side the conversation took; the size handle sits on the corner away from the card. */
346
373
  side: o ?? void 0,
347
374
  handleSide: o === "left-start" ? "left" : "right",
348
375
  /** The card's ··· menu, where Ask lives and focus returns on Escape. */
349
376
  cardActions: () => {
350
- var N;
351
- return e ? (N = rt(m == null ? void 0 : m.parentElement, e)) == null ? void 0 : N.querySelector("[data-card-actions]") : null;
377
+ var I;
378
+ return e ? (I = rt(m == null ? void 0 : m.parentElement, e)) == null ? void 0 : I.querySelector("[data-card-actions]") : null;
352
379
  }
353
380
  };
354
381
  }
355
382
  function rt(e, a) {
356
383
  return e ? Array.from(e.querySelectorAll("[data-frame-id]")).find((t) => t.dataset.frameId === a) ?? null : null;
357
384
  }
358
- function nr(e, a) {
385
+ function or(e, a) {
359
386
  const t = a.parentElement;
360
387
  if (!t || !e.isConnected) return null;
361
- const r = t.getBoundingClientRect();
362
- if (r.width < er) return null;
363
- const n = e.getBoundingClientRect(), { min: i } = ft, s = (o, f) => o >= i.width + 2 * fe && f >= i.height + 2 * fe;
364
- return s(r.right - n.right, r.height) ? "right-start" : s(n.left - r.left, r.height) ? "left-start" : s(r.width, r.bottom - n.bottom) ? "bottom-start" : null;
388
+ const n = t.getBoundingClientRect();
389
+ if (n.width < nr) return null;
390
+ const r = e.getBoundingClientRect(), { min: i } = ht, s = (o, f) => o >= i.width + 2 * fe && f >= i.height + 2 * fe;
391
+ return s(n.right - r.right, n.height) ? "right-start" : s(r.left - n.left, n.height) ? "left-start" : s(n.width, n.bottom - r.bottom) ? "bottom-start" : null;
365
392
  }
366
- function lr({
393
+ function dr({
367
394
  instance: e,
368
395
  size: a,
369
396
  side: t
370
397
  }) {
371
- const r = J(void 0), n = t === "left" ? -1 : 1, i = (s) => {
372
- const o = r.current;
398
+ const n = Y(void 0), r = t === "left" ? -1 : 1, i = (s) => {
399
+ const o = n.current;
373
400
  return {
374
- width: o.start.width + n * (s.clientX - o.x),
401
+ width: o.start.width + r * (s.clientX - o.x),
375
402
  height: o.start.height + (s.clientY - o.y)
376
403
  };
377
404
  };
@@ -384,60 +411,60 @@ function lr({
384
411
  title: "Drag to resize. Double-click to reset.",
385
412
  onPointerDown: (s) => {
386
413
  var o, f;
387
- s.preventDefault(), (f = (o = s.currentTarget).setPointerCapture) == null || f.call(o, s.pointerId), r.current = { x: s.clientX, y: s.clientY, start: a };
414
+ s.preventDefault(), (f = (o = s.currentTarget).setPointerCapture) == null || f.call(o, s.pointerId), n.current = { x: s.clientX, y: s.clientY, start: a };
388
415
  },
389
416
  onPointerMove: (s) => {
390
- r.current && e.setBesideSize(i(s));
417
+ n.current && e.setBesideSize(i(s));
391
418
  },
392
419
  onPointerUp: (s) => {
393
- r.current && (e.setBesideSize(i(s), { save: !0 }), r.current = void 0);
420
+ n.current && (e.setBesideSize(i(s), { save: !0 }), n.current = void 0);
394
421
  },
395
422
  onPointerCancel: () => {
396
- r.current = void 0;
423
+ n.current = void 0;
397
424
  },
398
425
  onKeyDown: (s) => {
399
426
  const o = {
400
- ArrowLeft: { width: -n * le, height: 0 },
401
- ArrowRight: { width: n * le, height: 0 },
427
+ ArrowLeft: { width: -r * le, height: 0 },
428
+ ArrowRight: { width: r * le, height: 0 },
402
429
  ArrowUp: { width: 0, height: -le },
403
430
  ArrowDown: { width: 0, height: le }
404
431
  }[s.key];
405
432
  o && (s.preventDefault(), e.setBesideSize({ width: a.width + o.width, height: a.height + o.height }, { save: !0 }));
406
433
  },
407
- onDoubleClick: () => e.setBesideSize(ft.default, { save: !0 }),
408
- className: M(
434
+ onDoubleClick: () => e.setBesideSize(ht.default, { save: !0 }),
435
+ className: O(
409
436
  "absolute bottom-0 z-10 h-3 w-3 touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
410
437
  t === "left" ? "left-0 cursor-nesw-resize rounded-bl-card" : "right-0 cursor-nwse-resize rounded-br-card"
411
438
  )
412
439
  }
413
440
  );
414
441
  }
415
- const le = 16, bt = 0.6;
416
- function sr({ instance: e, side: a, width: t }) {
417
- const r = J(void 0), n = (c) => {
418
- var m, S;
419
- const v = (S = (m = c.closest("aside")) == null ? void 0 : m.parentElement) == null ? void 0 : S.clientWidth;
420
- return v ? v * bt : be.max;
442
+ const le = 16, gt = 0.6;
443
+ function cr({ instance: e, side: a, width: t }) {
444
+ const n = Y(void 0), r = (c) => {
445
+ var m, x;
446
+ const v = (x = (m = c.closest("aside")) == null ? void 0 : m.parentElement) == null ? void 0 : x.clientWidth;
447
+ return v ? v * gt : be.max;
421
448
  }, i = (c) => {
422
449
  var v;
423
450
  return ((v = c.closest("aside")) == null ? void 0 : v.getBoundingClientRect().width) || t;
424
451
  }, s = (c) => {
425
- const v = r.current;
452
+ const v = n.current;
426
453
  if (!v) return t;
427
454
  const m = c - v.startX;
428
455
  return Je(v.startWidth + (a === "left" ? -m : m), v.maxForArea);
429
456
  }, o = (c) => {
430
457
  var v, m;
431
- c.preventDefault(), (m = (v = c.currentTarget).setPointerCapture) == null || m.call(v, c.pointerId), r.current = { startX: c.clientX, startWidth: i(c.currentTarget), maxForArea: n(c.currentTarget) };
458
+ c.preventDefault(), (m = (v = c.currentTarget).setPointerCapture) == null || m.call(v, c.pointerId), n.current = { startX: c.clientX, startWidth: i(c.currentTarget), maxForArea: r(c.currentTarget) };
432
459
  }, f = (c) => {
433
- r.current && e.setWidth(s(c.clientX));
460
+ n.current && e.setWidth(s(c.clientX));
434
461
  }, u = (c) => {
435
- r.current && (e.setWidth(s(c.clientX), { save: !0 }), r.current = void 0);
462
+ n.current && (e.setWidth(s(c.clientX), { save: !0 }), n.current = void 0);
436
463
  }, g = (c) => {
437
464
  if (c.key !== "ArrowLeft" && c.key !== "ArrowRight") return;
438
465
  c.preventDefault();
439
466
  const v = c.key === "ArrowLeft" == (a === "left");
440
- e.setWidth(Je(i(c.currentTarget) + (v ? le : -le), n(c.currentTarget)), { save: !0 });
467
+ e.setWidth(Je(i(c.currentTarget) + (v ? le : -le), r(c.currentTarget)), { save: !0 });
441
468
  };
442
469
  return /* @__PURE__ */ l(
443
470
  "div",
@@ -456,29 +483,29 @@ function sr({ instance: e, side: a, width: t }) {
456
483
  onPointerCancel: u,
457
484
  onKeyDown: g,
458
485
  onDoubleClick: () => e.setWidth(be.default, { save: !0 }),
459
- className: M(
486
+ className: O(
460
487
  "absolute inset-y-0 z-10 w-1.5 cursor-col-resize touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
461
488
  a === "left" ? "-left-[3px]" : "-right-[3px]"
462
489
  )
463
490
  }
464
491
  );
465
492
  }
466
- const ir = Se(() => import("./dashboard-controls-8RyBTQUO.js")), or = Se(
467
- () => import("./edit-dashboard-visual-BfJwnRIZ.js")
468
- ), dr = Se(() => import("./dashboard-json-7qT9jmfL.js"));
469
- function pn({
493
+ const ur = Se(() => import("./dashboard-controls-bxPrlSyp.js")), mr = Se(
494
+ () => import("./edit-dashboard-visual-DYYYDjY6.js")
495
+ ), fr = Se(() => import("./dashboard-json-BrjxIiRt.js"));
496
+ function yn({
470
497
  showControls: e = !1,
471
498
  showFooter: a = !0,
472
499
  ...t
473
500
  }) {
474
- const r = j((o) => o.isVisualEditing), n = j(
501
+ const n = M((o) => o.isVisualEditing), r = M(
475
502
  (o) => o.showDashboardJSON
476
503
  ), { appearance: i, preferences: s } = t;
477
- return /* @__PURE__ */ l(Jt, { FallbackComponent: Yt, children: /* @__PURE__ */ l(Zt, { dashboardProps: t, children: /* @__PURE__ */ h(Qt, { children: [
478
- /* @__PURE__ */ l(ea, { componentType: "surfboard", componentId: t.id }),
479
- /* @__PURE__ */ h(ta, { appearance: i, children: [
504
+ return /* @__PURE__ */ l(Yt, { FallbackComponent: Zt, children: /* @__PURE__ */ l(Qt, { dashboardProps: t, children: /* @__PURE__ */ h(ea, { children: [
505
+ /* @__PURE__ */ l(ta, { componentType: "surfboard", componentId: t.id }),
506
+ /* @__PURE__ */ h(aa, { appearance: i, children: [
480
507
  /* @__PURE__ */ l(
481
- va,
508
+ ra,
482
509
  {
483
510
  toastOptions: {
484
511
  classNames: {
@@ -492,41 +519,41 @@ function pn({
492
519
  }
493
520
  }
494
521
  ),
495
- /* @__PURE__ */ h(aa, { preferences: s, children: [
496
- n && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(dr, {}) }),
497
- /* @__PURE__ */ l(ra, { children: /* @__PURE__ */ l(qa, { children: /* @__PURE__ */ h("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
498
- e && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(ir, {}) }),
522
+ /* @__PURE__ */ h(na, { preferences: s, children: [
523
+ r && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(fr, {}) }),
524
+ /* @__PURE__ */ l(la, { children: /* @__PURE__ */ l(Ya, { children: /* @__PURE__ */ h("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
525
+ e && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(ur, {}) }),
499
526
  /* @__PURE__ */ h("div", { className: "relative flex grow overflow-hidden", children: [
500
- /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ h(na, { ...t, type: "dashboard", children: [
501
- r && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(or, {}) }),
502
- /* @__PURE__ */ l(Lt, { mode: r ? "hidden" : "visible", children: /* @__PURE__ */ l(Ba, {}) })
527
+ /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ h(sa, { ...t, type: "dashboard", children: [
528
+ n && /* @__PURE__ */ l(ye, { fallback: null, children: /* @__PURE__ */ l(mr, {}) }),
529
+ /* @__PURE__ */ l(_t, { mode: n ? "hidden" : "visible", children: /* @__PURE__ */ l(Ha, {}) })
503
530
  ] }) }),
504
- /* @__PURE__ */ l(tr, {})
531
+ /* @__PURE__ */ l(lr, {})
505
532
  ] })
506
533
  ] }) }) })
507
534
  ] })
508
535
  ] })
509
536
  ] }) }) });
510
537
  }
511
- var nt = 1, cr = 0.9, ur = 0.8, mr = 0.17, Ee = 0.1, Te = 0.999, fr = 0.9999, hr = 0.99, pr = /[\\\/_+.#"@\[\(\{&]/, vr = /[\\\/_+.#"@\[\(\{&]/g, br = /[\s-]/, gt = /[\s-]/g;
512
- function _e(e, a, t, r, n, i, s) {
513
- if (i === a.length) return n === e.length ? nt : hr;
514
- var o = `${n},${i}`;
538
+ var nt = 1, hr = 0.9, pr = 0.8, vr = 0.17, Ee = 0.1, Te = 0.999, br = 0.9999, gr = 0.99, yr = /[\\\/_+.#"@\[\(\{&]/, wr = /[\\\/_+.#"@\[\(\{&]/g, Sr = /[\s-]/, yt = /[\s-]/g;
539
+ function _e(e, a, t, n, r, i, s) {
540
+ if (i === a.length) return r === e.length ? nt : gr;
541
+ var o = `${r},${i}`;
515
542
  if (s[o] !== void 0) return s[o];
516
- for (var f = r.charAt(i), u = t.indexOf(f, n), g = 0, c, v, m, S; u >= 0; ) c = _e(e, a, t, r, u + 1, i + 1, s), c > g && (u === n ? c *= nt : pr.test(e.charAt(u - 1)) ? (c *= ur, m = e.slice(n, u - 1).match(vr), m && n > 0 && (c *= Math.pow(Te, m.length))) : br.test(e.charAt(u - 1)) ? (c *= cr, S = e.slice(n, u - 1).match(gt), S && n > 0 && (c *= Math.pow(Te, S.length))) : (c *= mr, n > 0 && (c *= Math.pow(Te, u - n))), e.charAt(u) !== a.charAt(i) && (c *= fr)), (c < Ee && t.charAt(u - 1) === r.charAt(i + 1) || r.charAt(i + 1) === r.charAt(i) && t.charAt(u - 1) !== r.charAt(i)) && (v = _e(e, a, t, r, u + 1, i + 2, s), v * Ee > c && (c = v * Ee)), c > g && (g = c), u = t.indexOf(f, u + 1);
543
+ for (var f = n.charAt(i), u = t.indexOf(f, r), g = 0, c, v, m, x; u >= 0; ) c = _e(e, a, t, n, u + 1, i + 1, s), c > g && (u === r ? c *= nt : yr.test(e.charAt(u - 1)) ? (c *= pr, m = e.slice(r, u - 1).match(wr), m && r > 0 && (c *= Math.pow(Te, m.length))) : Sr.test(e.charAt(u - 1)) ? (c *= hr, x = e.slice(r, u - 1).match(yt), x && r > 0 && (c *= Math.pow(Te, x.length))) : (c *= vr, r > 0 && (c *= Math.pow(Te, u - r))), e.charAt(u) !== a.charAt(i) && (c *= br)), (c < Ee && t.charAt(u - 1) === n.charAt(i + 1) || n.charAt(i + 1) === n.charAt(i) && t.charAt(u - 1) !== n.charAt(i)) && (v = _e(e, a, t, n, u + 1, i + 2, s), v * Ee > c && (c = v * Ee)), c > g && (g = c), u = t.indexOf(f, u + 1);
517
544
  return s[o] = g, g;
518
545
  }
519
546
  function lt(e) {
520
- return e.toLowerCase().replace(gt, " ");
547
+ return e.toLowerCase().replace(yt, " ");
521
548
  }
522
- function gr(e, a, t) {
549
+ function xr(e, a, t) {
523
550
  return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, _e(e, a, lt(e), lt(a), 0, 0, {});
524
551
  }
525
- var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-heading=""]', yt = '[cmdk-item=""]', st = `${yt}:not([aria-disabled="true"])`, Me = "cmdk-item-select", re = "data-value", wr = (e, a, t) => gr(e, a, t), wt = p.createContext(void 0), pe = () => p.useContext(wt), St = p.createContext(void 0), Ve = () => p.useContext(St), xt = p.createContext(void 0), Ct = p.forwardRef((e, a) => {
552
+ var me = '[cmdk-group=""]', Ie = '[cmdk-group-items=""]', Cr = '[cmdk-group-heading=""]', wt = '[cmdk-item=""]', st = `${wt}:not([aria-disabled="true"])`, Me = "cmdk-item-select", re = "data-value", Nr = (e, a, t) => xr(e, a, t), St = p.createContext(void 0), pe = () => p.useContext(St), xt = p.createContext(void 0), Ve = () => p.useContext(xt), Ct = p.createContext(void 0), Nt = p.forwardRef((e, a) => {
526
553
  let t = ne(() => {
527
554
  var d, T;
528
555
  return { search: "", value: (T = (d = e.value) != null ? d : e.defaultValue) != null ? T : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
529
- }), r = ne(() => /* @__PURE__ */ new Set()), n = ne(() => /* @__PURE__ */ new Map()), i = ne(() => /* @__PURE__ */ new Map()), s = ne(() => /* @__PURE__ */ new Set()), o = Nt(e), { label: f, children: u, value: g, onValueChange: c, filter: v, shouldFilter: m, loop: S, disablePointerSelection: N = !1, vimBindings: w = !0, ...k } = e, z = se(), L = se(), U = se(), _ = p.useRef(null), E = Rr();
556
+ }), n = ne(() => /* @__PURE__ */ new Set()), r = ne(() => /* @__PURE__ */ new Map()), i = ne(() => /* @__PURE__ */ new Map()), s = ne(() => /* @__PURE__ */ new Set()), o = Et(e), { label: f, children: u, value: g, onValueChange: c, filter: v, shouldFilter: m, loop: x, disablePointerSelection: I = !1, vimBindings: w = !0, ...y } = e, P = se(), F = se(), U = se(), _ = p.useRef(null), E = Lr();
530
557
  te(() => {
531
558
  if (g !== void 0) {
532
559
  let d = g.trim();
@@ -536,20 +563,20 @@ var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-head
536
563
  E(6, ae);
537
564
  }, []);
538
565
  let b = p.useMemo(() => ({ subscribe: (d) => (s.current.add(d), () => s.current.delete(d)), snapshot: () => t.current, setState: (d, T, A) => {
539
- var y, D, P, B;
566
+ var S, D, z, W;
540
567
  if (!Object.is(t.current[d], T)) {
541
- if (t.current[d] = T, d === "search") K(), x(), E(1, q);
568
+ if (t.current[d] = T, d === "search") K(), C(), E(1, G);
542
569
  else if (d === "value") {
543
570
  if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
544
- let O = document.getElementById(U);
545
- O ? O.focus() : (y = document.getElementById(z)) == null || y.focus();
571
+ let j = document.getElementById(U);
572
+ j ? j.focus() : (S = document.getElementById(P)) == null || S.focus();
546
573
  }
547
574
  if (E(7, () => {
548
- var O;
549
- t.current.selectedItemId = (O = G()) == null ? void 0 : O.id, b.emit();
575
+ var j;
576
+ t.current.selectedItemId = (j = X()) == null ? void 0 : j.id, b.emit();
550
577
  }), A || E(5, ae), ((D = o.current) == null ? void 0 : D.value) !== void 0) {
551
- let O = T ?? "";
552
- (B = (P = o.current).onValueChange) == null || B.call(P, O);
578
+ let j = T ?? "";
579
+ (W = (z = o.current).onValueChange) == null || W.call(z, j);
553
580
  return;
554
581
  }
555
582
  }
@@ -557,108 +584,108 @@ var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-head
557
584
  }
558
585
  }, emit: () => {
559
586
  s.current.forEach((d) => d());
560
- } }), []), C = p.useMemo(() => ({ value: (d, T, A) => {
561
- var y;
562
- T !== ((y = i.current.get(d)) == null ? void 0 : y.value) && (i.current.set(d, { value: T, keywords: A }), t.current.filtered.items.set(d, R(T, A)), E(2, () => {
563
- x(), b.emit();
587
+ } }), []), N = p.useMemo(() => ({ value: (d, T, A) => {
588
+ var S;
589
+ T !== ((S = i.current.get(d)) == null ? void 0 : S.value) && (i.current.set(d, { value: T, keywords: A }), t.current.filtered.items.set(d, R(T, A)), E(2, () => {
590
+ C(), b.emit();
564
591
  }));
565
- }, item: (d, T) => (r.current.add(d), T && (n.current.has(T) ? n.current.get(T).add(d) : n.current.set(T, /* @__PURE__ */ new Set([d]))), E(3, () => {
566
- K(), x(), t.current.value || q(), b.emit();
592
+ }, item: (d, T) => (n.current.add(d), T && (r.current.has(T) ? r.current.get(T).add(d) : r.current.set(T, /* @__PURE__ */ new Set([d]))), E(3, () => {
593
+ K(), C(), t.current.value || G(), b.emit();
567
594
  }), () => {
568
- i.current.delete(d), r.current.delete(d), t.current.filtered.items.delete(d);
569
- let A = G();
595
+ i.current.delete(d), n.current.delete(d), t.current.filtered.items.delete(d);
596
+ let A = X();
570
597
  E(4, () => {
571
- K(), (A == null ? void 0 : A.getAttribute("id")) === d && q(), b.emit();
598
+ K(), (A == null ? void 0 : A.getAttribute("id")) === d && G(), b.emit();
572
599
  });
573
- }), group: (d) => (n.current.has(d) || n.current.set(d, /* @__PURE__ */ new Set()), () => {
574
- i.current.delete(d), n.current.delete(d);
575
- }), filter: () => o.current.shouldFilter, label: f || e["aria-label"], getDisablePointerSelection: () => o.current.disablePointerSelection, listId: z, inputId: U, labelId: L, listInnerRef: _ }), []);
600
+ }), group: (d) => (r.current.has(d) || r.current.set(d, /* @__PURE__ */ new Set()), () => {
601
+ i.current.delete(d), r.current.delete(d);
602
+ }), filter: () => o.current.shouldFilter, label: f || e["aria-label"], getDisablePointerSelection: () => o.current.disablePointerSelection, listId: P, inputId: U, labelId: F, listInnerRef: _ }), []);
576
603
  function R(d, T) {
577
- var A, y;
578
- let D = (y = (A = o.current) == null ? void 0 : A.filter) != null ? y : wr;
604
+ var A, S;
605
+ let D = (S = (A = o.current) == null ? void 0 : A.filter) != null ? S : Nr;
579
606
  return d ? D(d, t.current.search, T) : 0;
580
607
  }
581
- function x() {
608
+ function C() {
582
609
  if (!t.current.search || o.current.shouldFilter === !1) return;
583
610
  let d = t.current.filtered.items, T = [];
584
- t.current.filtered.groups.forEach((y) => {
585
- let D = n.current.get(y), P = 0;
586
- D.forEach((B) => {
587
- let O = d.get(B);
588
- P = Math.max(O, P);
589
- }), T.push([y, P]);
611
+ t.current.filtered.groups.forEach((S) => {
612
+ let D = r.current.get(S), z = 0;
613
+ D.forEach((W) => {
614
+ let j = d.get(W);
615
+ z = Math.max(j, z);
616
+ }), T.push([S, z]);
590
617
  });
591
618
  let A = _.current;
592
- I().sort((y, D) => {
593
- var P, B;
594
- let O = y.getAttribute("id"), ve = D.getAttribute("id");
595
- return ((P = d.get(ve)) != null ? P : 0) - ((B = d.get(O)) != null ? B : 0);
596
- }).forEach((y) => {
597
- let D = y.closest(ke);
598
- D ? D.appendChild(y.parentElement === D ? y : y.closest(`${ke} > *`)) : A.appendChild(y.parentElement === A ? y : y.closest(`${ke} > *`));
599
- }), T.sort((y, D) => D[1] - y[1]).forEach((y) => {
619
+ k().sort((S, D) => {
620
+ var z, W;
621
+ let j = S.getAttribute("id"), ve = D.getAttribute("id");
622
+ return ((z = d.get(ve)) != null ? z : 0) - ((W = d.get(j)) != null ? W : 0);
623
+ }).forEach((S) => {
624
+ let D = S.closest(Ie);
625
+ D ? D.appendChild(S.parentElement === D ? S : S.closest(`${Ie} > *`)) : A.appendChild(S.parentElement === A ? S : S.closest(`${Ie} > *`));
626
+ }), T.sort((S, D) => D[1] - S[1]).forEach((S) => {
600
627
  var D;
601
- let P = (D = _.current) == null ? void 0 : D.querySelector(`${me}[${re}="${encodeURIComponent(y[0])}"]`);
602
- P == null || P.parentElement.appendChild(P);
628
+ let z = (D = _.current) == null ? void 0 : D.querySelector(`${me}[${re}="${encodeURIComponent(S[0])}"]`);
629
+ z == null || z.parentElement.appendChild(z);
603
630
  });
604
631
  }
605
- function q() {
606
- let d = I().find((A) => A.getAttribute("aria-disabled") !== "true"), T = d == null ? void 0 : d.getAttribute(re);
632
+ function G() {
633
+ let d = k().find((A) => A.getAttribute("aria-disabled") !== "true"), T = d == null ? void 0 : d.getAttribute(re);
607
634
  b.setState("value", T || void 0);
608
635
  }
609
636
  function K() {
610
- var d, T, A, y;
637
+ var d, T, A, S;
611
638
  if (!t.current.search || o.current.shouldFilter === !1) {
612
- t.current.filtered.count = r.current.size;
639
+ t.current.filtered.count = n.current.size;
613
640
  return;
614
641
  }
615
642
  t.current.filtered.groups = /* @__PURE__ */ new Set();
616
643
  let D = 0;
617
- for (let P of r.current) {
618
- let B = (T = (d = i.current.get(P)) == null ? void 0 : d.value) != null ? T : "", O = (y = (A = i.current.get(P)) == null ? void 0 : A.keywords) != null ? y : [], ve = R(B, O);
619
- t.current.filtered.items.set(P, ve), ve > 0 && D++;
644
+ for (let z of n.current) {
645
+ let W = (T = (d = i.current.get(z)) == null ? void 0 : d.value) != null ? T : "", j = (S = (A = i.current.get(z)) == null ? void 0 : A.keywords) != null ? S : [], ve = R(W, j);
646
+ t.current.filtered.items.set(z, ve), ve > 0 && D++;
620
647
  }
621
- for (let [P, B] of n.current) for (let O of B) if (t.current.filtered.items.get(O) > 0) {
622
- t.current.filtered.groups.add(P);
648
+ for (let [z, W] of r.current) for (let j of W) if (t.current.filtered.items.get(j) > 0) {
649
+ t.current.filtered.groups.add(z);
623
650
  break;
624
651
  }
625
652
  t.current.filtered.count = D;
626
653
  }
627
654
  function ae() {
628
655
  var d, T, A;
629
- let y = G();
630
- y && (((d = y.parentElement) == null ? void 0 : d.firstChild) === y && ((A = (T = y.closest(me)) == null ? void 0 : T.querySelector(yr)) == null || A.scrollIntoView({ block: "nearest" })), y.scrollIntoView({ block: "nearest" }));
656
+ let S = X();
657
+ S && (((d = S.parentElement) == null ? void 0 : d.firstChild) === S && ((A = (T = S.closest(me)) == null ? void 0 : T.querySelector(Cr)) == null || A.scrollIntoView({ block: "nearest" })), S.scrollIntoView({ block: "nearest" }));
631
658
  }
632
- function G() {
659
+ function X() {
633
660
  var d;
634
- return (d = _.current) == null ? void 0 : d.querySelector(`${yt}[aria-selected="true"]`);
661
+ return (d = _.current) == null ? void 0 : d.querySelector(`${wt}[aria-selected="true"]`);
635
662
  }
636
- function I() {
663
+ function k() {
637
664
  var d;
638
665
  return Array.from(((d = _.current) == null ? void 0 : d.querySelectorAll(st)) || []);
639
666
  }
640
667
  function de(d) {
641
- let T = I()[d];
668
+ let T = k()[d];
642
669
  T && b.setState("value", T.getAttribute(re));
643
670
  }
644
671
  function Ce(d) {
645
672
  var T;
646
- let A = G(), y = I(), D = y.findIndex((B) => B === A), P = y[D + d];
647
- (T = o.current) != null && T.loop && (P = D + d < 0 ? y[y.length - 1] : D + d === y.length ? y[0] : y[D + d]), P && b.setState("value", P.getAttribute(re));
673
+ let A = X(), S = k(), D = S.findIndex((W) => W === A), z = S[D + d];
674
+ (T = o.current) != null && T.loop && (z = D + d < 0 ? S[S.length - 1] : D + d === S.length ? S[0] : S[D + d]), z && b.setState("value", z.getAttribute(re));
648
675
  }
649
676
  function Ke(d) {
650
- let T = G(), A = T == null ? void 0 : T.closest(me), y;
651
- for (; A && !y; ) A = d > 0 ? Ar(A, me) : Dr(A, me), y = A == null ? void 0 : A.querySelector(st);
652
- y ? b.setState("value", y.getAttribute(re)) : Ce(d);
677
+ let T = X(), A = T == null ? void 0 : T.closest(me), S;
678
+ for (; A && !S; ) A = d > 0 ? zr(A, me) : Fr(A, me), S = A == null ? void 0 : A.querySelector(st);
679
+ S ? b.setState("value", S.getAttribute(re)) : Ce(d);
653
680
  }
654
- let He = () => de(I().length - 1), qe = (d) => {
681
+ let He = () => de(k().length - 1), qe = (d) => {
655
682
  d.preventDefault(), d.metaKey ? He() : d.altKey ? Ke(1) : Ce(1);
656
683
  }, Ge = (d) => {
657
684
  d.preventDefault(), d.metaKey ? de(0) : d.altKey ? Ke(-1) : Ce(-1);
658
685
  };
659
- return p.createElement(Z.div, { ref: a, tabIndex: -1, ...k, "cmdk-root": "", onKeyDown: (d) => {
686
+ return p.createElement(Q.div, { ref: a, tabIndex: -1, ...y, "cmdk-root": "", onKeyDown: (d) => {
660
687
  var T;
661
- (T = k.onKeyDown) == null || T.call(k, d);
688
+ (T = y.onKeyDown) == null || T.call(y, d);
662
689
  let A = d.nativeEvent.isComposing || d.keyCode === 229;
663
690
  if (!(d.defaultPrevented || A)) switch (d.key) {
664
691
  case "n":
@@ -689,52 +716,52 @@ var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-head
689
716
  }
690
717
  case "Enter": {
691
718
  d.preventDefault();
692
- let y = G();
693
- if (y) {
719
+ let S = X();
720
+ if (S) {
694
721
  let D = new Event(Me);
695
- y.dispatchEvent(D);
722
+ S.dispatchEvent(D);
696
723
  }
697
724
  }
698
725
  }
699
- } }, p.createElement("label", { "cmdk-label": "", htmlFor: C.inputId, id: C.labelId, style: zr }, f), xe(e, (d) => p.createElement(St.Provider, { value: b }, p.createElement(wt.Provider, { value: C }, d))));
700
- }), Sr = p.forwardRef((e, a) => {
701
- var t, r;
702
- let n = se(), i = p.useRef(null), s = p.useContext(xt), o = pe(), f = Nt(e), u = (r = (t = f.current) == null ? void 0 : t.forceMount) != null ? r : s == null ? void 0 : s.forceMount;
726
+ } }, p.createElement("label", { "cmdk-label": "", htmlFor: N.inputId, id: N.labelId, style: Mr }, f), xe(e, (d) => p.createElement(xt.Provider, { value: b }, p.createElement(St.Provider, { value: N }, d))));
727
+ }), Er = p.forwardRef((e, a) => {
728
+ var t, n;
729
+ let r = se(), i = p.useRef(null), s = p.useContext(Ct), o = pe(), f = Et(e), u = (n = (t = f.current) == null ? void 0 : t.forceMount) != null ? n : s == null ? void 0 : s.forceMount;
703
730
  te(() => {
704
- if (!u) return o.item(n, s == null ? void 0 : s.id);
731
+ if (!u) return o.item(r, s == null ? void 0 : s.id);
705
732
  }, [u]);
706
- let g = Et(n, i, [e.value, e.children, i], e.keywords), c = Ve(), v = Y((E) => E.value && E.value === g.current), m = Y((E) => u || o.filter() === !1 ? !0 : E.search ? E.filtered.items.get(n) > 0 : !0);
733
+ let g = Tt(r, i, [e.value, e.children, i], e.keywords), c = Ve(), v = Z((E) => E.value && E.value === g.current), m = Z((E) => u || o.filter() === !1 ? !0 : E.search ? E.filtered.items.get(r) > 0 : !0);
707
734
  p.useEffect(() => {
708
735
  let E = i.current;
709
- if (!(!E || e.disabled)) return E.addEventListener(Me, S), () => E.removeEventListener(Me, S);
736
+ if (!(!E || e.disabled)) return E.addEventListener(Me, x), () => E.removeEventListener(Me, x);
710
737
  }, [m, e.onSelect, e.disabled]);
711
- function S() {
738
+ function x() {
712
739
  var E, b;
713
- N(), (b = (E = f.current).onSelect) == null || b.call(E, g.current);
740
+ I(), (b = (E = f.current).onSelect) == null || b.call(E, g.current);
714
741
  }
715
- function N() {
742
+ function I() {
716
743
  c.setState("value", g.current, !0);
717
744
  }
718
745
  if (!m) return null;
719
- let { disabled: w, value: k, onSelect: z, forceMount: L, keywords: U, ..._ } = e;
720
- return p.createElement(Z.div, { ref: he(i, a), ..._, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!w, "aria-selected": !!v, "data-disabled": !!w, "data-selected": !!v, onPointerMove: w || o.getDisablePointerSelection() ? void 0 : N, onClick: w ? void 0 : S }, e.children);
721
- }), xr = p.forwardRef((e, a) => {
722
- let { heading: t, children: r, forceMount: n, ...i } = e, s = se(), o = p.useRef(null), f = p.useRef(null), u = se(), g = pe(), c = Y((m) => n || g.filter() === !1 ? !0 : m.search ? m.filtered.groups.has(s) : !0);
723
- te(() => g.group(s), []), Et(s, o, [e.value, e.heading, f]);
724
- let v = p.useMemo(() => ({ id: s, forceMount: n }), [n]);
725
- return p.createElement(Z.div, { ref: he(o, a), ...i, "cmdk-group": "", role: "presentation", hidden: c ? void 0 : !0 }, t && p.createElement("div", { ref: f, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), xe(e, (m) => p.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, p.createElement(xt.Provider, { value: v }, m))));
726
- }), Cr = p.forwardRef((e, a) => {
727
- let { alwaysRender: t, ...r } = e, n = p.useRef(null), i = Y((s) => !s.search);
728
- return !t && !i ? null : p.createElement(Z.div, { ref: he(n, a), ...r, "cmdk-separator": "", role: "separator" });
729
- }), Nr = p.forwardRef((e, a) => {
730
- let { onValueChange: t, ...r } = e, n = e.value != null, i = Ve(), s = Y((u) => u.search), o = Y((u) => u.selectedItemId), f = pe();
746
+ let { disabled: w, value: y, onSelect: P, forceMount: F, keywords: U, ..._ } = e;
747
+ return p.createElement(Q.div, { ref: he(i, a), ..._, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!w, "aria-selected": !!v, "data-disabled": !!w, "data-selected": !!v, onPointerMove: w || o.getDisablePointerSelection() ? void 0 : I, onClick: w ? void 0 : x }, e.children);
748
+ }), Tr = p.forwardRef((e, a) => {
749
+ let { heading: t, children: n, forceMount: r, ...i } = e, s = se(), o = p.useRef(null), f = p.useRef(null), u = se(), g = pe(), c = Z((m) => r || g.filter() === !1 ? !0 : m.search ? m.filtered.groups.has(s) : !0);
750
+ te(() => g.group(s), []), Tt(s, o, [e.value, e.heading, f]);
751
+ let v = p.useMemo(() => ({ id: s, forceMount: r }), [r]);
752
+ return p.createElement(Q.div, { ref: he(o, a), ...i, "cmdk-group": "", role: "presentation", hidden: c ? void 0 : !0 }, t && p.createElement("div", { ref: f, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), xe(e, (m) => p.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, p.createElement(Ct.Provider, { value: v }, m))));
753
+ }), Ir = p.forwardRef((e, a) => {
754
+ let { alwaysRender: t, ...n } = e, r = p.useRef(null), i = Z((s) => !s.search);
755
+ return !t && !i ? null : p.createElement(Q.div, { ref: he(r, a), ...n, "cmdk-separator": "", role: "separator" });
756
+ }), kr = p.forwardRef((e, a) => {
757
+ let { onValueChange: t, ...n } = e, r = e.value != null, i = Ve(), s = Z((u) => u.search), o = Z((u) => u.selectedItemId), f = pe();
731
758
  return p.useEffect(() => {
732
759
  e.value != null && i.setState("search", e.value);
733
- }, [e.value]), p.createElement(Z.input, { ref: a, ...r, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": f.listId, "aria-labelledby": f.labelId, "aria-activedescendant": o, id: f.inputId, type: "text", value: n ? e.value : s, onChange: (u) => {
734
- n || i.setState("search", u.target.value), t == null || t(u.target.value);
760
+ }, [e.value]), p.createElement(Q.input, { ref: a, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": f.listId, "aria-labelledby": f.labelId, "aria-activedescendant": o, id: f.inputId, type: "text", value: r ? e.value : s, onChange: (u) => {
761
+ r || i.setState("search", u.target.value), t == null || t(u.target.value);
735
762
  } });
736
- }), Er = p.forwardRef((e, a) => {
737
- let { children: t, label: r = "Suggestions", ...n } = e, i = p.useRef(null), s = p.useRef(null), o = Y((u) => u.selectedItemId), f = pe();
763
+ }), Ar = p.forwardRef((e, a) => {
764
+ let { children: t, label: n = "Suggestions", ...r } = e, i = p.useRef(null), s = p.useRef(null), o = Z((u) => u.selectedItemId), f = pe();
738
765
  return p.useEffect(() => {
739
766
  if (s.current && i.current) {
740
767
  let u = s.current, g = i.current, c, v = new ResizeObserver(() => {
@@ -747,29 +774,29 @@ var me = '[cmdk-group=""]', ke = '[cmdk-group-items=""]', yr = '[cmdk-group-head
747
774
  cancelAnimationFrame(c), v.unobserve(u);
748
775
  };
749
776
  }
750
- }, []), p.createElement(Z.div, { ref: he(i, a), ...n, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": o, "aria-label": r, id: f.listId }, xe(e, (u) => p.createElement("div", { ref: he(s, f.listInnerRef), "cmdk-list-sizer": "" }, u)));
751
- }), Tr = p.forwardRef((e, a) => {
752
- let { open: t, onOpenChange: r, overlayClassName: n, contentClassName: i, container: s, ...o } = e;
753
- return p.createElement(la, { open: t, onOpenChange: r }, p.createElement(sa, { container: s }, p.createElement(ia, { "cmdk-overlay": "", className: n }), p.createElement(oa, { "aria-label": e.label, "cmdk-dialog": "", className: i }, p.createElement(Ct, { ref: a, ...o }))));
754
- }), kr = p.forwardRef((e, a) => Y((t) => t.filtered.count === 0) ? p.createElement(Z.div, { ref: a, ...e, "cmdk-empty": "", role: "presentation" }) : null), Ir = p.forwardRef((e, a) => {
755
- let { progress: t, children: r, label: n = "Loading...", ...i } = e;
756
- return p.createElement(Z.div, { ref: a, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": n }, xe(e, (s) => p.createElement("div", { "aria-hidden": !0 }, s)));
757
- }), W = Object.assign(Ct, { List: Er, Item: Sr, Input: Nr, Group: xr, Separator: Cr, Dialog: Tr, Empty: kr, Loading: Ir });
758
- function Ar(e, a) {
777
+ }, []), p.createElement(Q.div, { ref: he(i, a), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": o, "aria-label": n, id: f.listId }, xe(e, (u) => p.createElement("div", { ref: he(s, f.listInnerRef), "cmdk-list-sizer": "" }, u)));
778
+ }), Dr = p.forwardRef((e, a) => {
779
+ let { open: t, onOpenChange: n, overlayClassName: r, contentClassName: i, container: s, ...o } = e;
780
+ return p.createElement(ia, { open: t, onOpenChange: n }, p.createElement(oa, { container: s }, p.createElement(da, { "cmdk-overlay": "", className: r }), p.createElement(ca, { "aria-label": e.label, "cmdk-dialog": "", className: i }, p.createElement(Nt, { ref: a, ...o }))));
781
+ }), Rr = p.forwardRef((e, a) => Z((t) => t.filtered.count === 0) ? p.createElement(Q.div, { ref: a, ...e, "cmdk-empty": "", role: "presentation" }) : null), Pr = p.forwardRef((e, a) => {
782
+ let { progress: t, children: n, label: r = "Loading...", ...i } = e;
783
+ return p.createElement(Q.div, { ref: a, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": r }, xe(e, (s) => p.createElement("div", { "aria-hidden": !0 }, s)));
784
+ }), B = Object.assign(Nt, { List: Ar, Item: Er, Input: kr, Group: Tr, Separator: Ir, Dialog: Dr, Empty: Rr, Loading: Pr });
785
+ function zr(e, a) {
759
786
  let t = e.nextElementSibling;
760
787
  for (; t; ) {
761
788
  if (t.matches(a)) return t;
762
789
  t = t.nextElementSibling;
763
790
  }
764
791
  }
765
- function Dr(e, a) {
792
+ function Fr(e, a) {
766
793
  let t = e.previousElementSibling;
767
794
  for (; t; ) {
768
795
  if (t.matches(a)) return t;
769
796
  t = t.previousElementSibling;
770
797
  }
771
798
  }
772
- function Nt(e) {
799
+ function Et(e) {
773
800
  let a = p.useRef(e);
774
801
  return te(() => {
775
802
  a.current = e;
@@ -780,59 +807,59 @@ function ne(e) {
780
807
  let a = p.useRef();
781
808
  return a.current === void 0 && (a.current = e()), a;
782
809
  }
783
- function Y(e) {
810
+ function Z(e) {
784
811
  let a = Ve(), t = () => e(a.snapshot());
785
812
  return p.useSyncExternalStore(a.subscribe, t, t);
786
813
  }
787
- function Et(e, a, t, r = []) {
788
- let n = p.useRef(), i = pe();
814
+ function Tt(e, a, t, n = []) {
815
+ let r = p.useRef(), i = pe();
789
816
  return te(() => {
790
817
  var s;
791
818
  let o = (() => {
792
819
  var u;
793
820
  for (let g of t) {
794
821
  if (typeof g == "string") return g.trim();
795
- if (typeof g == "object" && "current" in g) return g.current ? (u = g.current.textContent) == null ? void 0 : u.trim() : n.current;
822
+ if (typeof g == "object" && "current" in g) return g.current ? (u = g.current.textContent) == null ? void 0 : u.trim() : r.current;
796
823
  }
797
- })(), f = r.map((u) => u.trim());
798
- i.value(e, o, f), (s = a.current) == null || s.setAttribute(re, o), n.current = o;
799
- }), n;
824
+ })(), f = n.map((u) => u.trim());
825
+ i.value(e, o, f), (s = a.current) == null || s.setAttribute(re, o), r.current = o;
826
+ }), r;
800
827
  }
801
- var Rr = () => {
828
+ var Lr = () => {
802
829
  let [e, a] = p.useState(), t = ne(() => /* @__PURE__ */ new Map());
803
830
  return te(() => {
804
- t.current.forEach((r) => r()), t.current = /* @__PURE__ */ new Map();
805
- }, [e]), (r, n) => {
806
- t.current.set(r, n), a({});
831
+ t.current.forEach((n) => n()), t.current = /* @__PURE__ */ new Map();
832
+ }, [e]), (n, r) => {
833
+ t.current.set(n, r), a({});
807
834
  };
808
835
  };
809
- function Pr(e) {
836
+ function _r(e) {
810
837
  let a = e.type;
811
838
  return typeof a == "function" ? a(e.props) : "render" in a ? a.render(e.props) : e;
812
839
  }
813
840
  function xe({ asChild: e, children: a }, t) {
814
- return e && p.isValidElement(a) ? p.cloneElement(Pr(a), { ref: a.ref }, t(a.props.children)) : t(a);
841
+ return e && p.isValidElement(a) ? p.cloneElement(_r(a), { ref: a.ref }, t(a.props.children)) : t(a);
815
842
  }
816
- var zr = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
817
- const Tt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
818
- W,
843
+ var Mr = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
844
+ const It = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
845
+ B,
819
846
  {
820
847
  ref: t,
821
- className: M(
848
+ className: O(
822
849
  "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
823
850
  e
824
851
  ),
825
852
  ...a
826
853
  }
827
854
  ));
828
- Tt.displayName = W.displayName;
855
+ It.displayName = B.displayName;
829
856
  const kt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
830
- /* @__PURE__ */ l(Ma, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
857
+ /* @__PURE__ */ l(Ba, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
831
858
  /* @__PURE__ */ l(
832
- W.Input,
859
+ B.Input,
833
860
  {
834
861
  ref: t,
835
- className: M(
862
+ className: O(
836
863
  "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-[hsl(var(--semaphor-placeholder-foreground))] disabled:cursor-not-allowed disabled:opacity-50",
837
864
  e
838
865
  ),
@@ -840,74 +867,74 @@ const kt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div",
840
867
  }
841
868
  )
842
869
  ] }));
843
- kt.displayName = W.Input.displayName;
844
- const It = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
845
- W.List,
870
+ kt.displayName = B.Input.displayName;
871
+ const At = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
872
+ B.List,
846
873
  {
847
874
  ref: t,
848
- className: M("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
875
+ className: O("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
849
876
  ...a
850
877
  }
851
878
  ));
852
- It.displayName = W.List.displayName;
853
- const At = p.forwardRef((e, a) => /* @__PURE__ */ l(
854
- W.Empty,
879
+ At.displayName = B.List.displayName;
880
+ const Dt = p.forwardRef((e, a) => /* @__PURE__ */ l(
881
+ B.Empty,
855
882
  {
856
883
  ref: a,
857
884
  className: "py-6 text-center text-sm",
858
885
  ...e
859
886
  }
860
887
  ));
861
- At.displayName = W.Empty.displayName;
862
- const Ue = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
863
- W.Group,
888
+ Dt.displayName = B.Empty.displayName;
889
+ const Oe = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
890
+ B.Group,
864
891
  {
865
892
  ref: t,
866
- className: M(
893
+ className: O(
867
894
  "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
868
895
  e
869
896
  ),
870
897
  ...a
871
898
  }
872
899
  ));
873
- Ue.displayName = W.Group.displayName;
874
- const Dt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
875
- W.Separator,
900
+ Oe.displayName = B.Group.displayName;
901
+ const Rt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
902
+ B.Separator,
876
903
  {
877
904
  ref: t,
878
- className: M("-mx-1 h-px bg-border", e),
905
+ className: O("-mx-1 h-px bg-border", e),
879
906
  ...a
880
907
  }
881
908
  ));
882
- Dt.displayName = W.Separator.displayName;
883
- const Oe = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
884
- W.Item,
909
+ Rt.displayName = B.Separator.displayName;
910
+ const Ue = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
911
+ B.Item,
885
912
  {
886
913
  ref: t,
887
- className: M(
914
+ className: O(
888
915
  "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
889
916
  e
890
917
  ),
891
918
  ...a
892
919
  }
893
920
  ));
894
- Oe.displayName = W.Item.displayName;
895
- function Fr(e = {}) {
896
- const { authToken: a, tokenProps: t } = Be(), r = j(
921
+ Ue.displayName = B.Item.displayName;
922
+ function Or(e = {}) {
923
+ const { authToken: a, tokenProps: t } = We(), n = M(
897
924
  (E) => E.actions.applyResolvedCalendarPreferences
898
- ), n = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, f] = F(!1), [u, g] = F(!1), [c, v] = F(!1), [m, S] = F(null), [N, w] = F(null), k = J(i);
899
- k.current = i, ee(() => {
900
- w(null), S(null), f(!1), g(!1), v(!1);
925
+ ), r = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, f] = L(!1), [u, g] = L(!1), [c, v] = L(!1), [m, x] = L(null), [I, w] = L(null), y = Y(i);
926
+ y.current = i, ee(() => {
927
+ w(null), x(null), f(!1), g(!1), v(!1);
901
928
  }, [i]);
902
- const z = $(async (E) => {
903
- const b = Ua(await E.json());
929
+ const P = $(async (E) => {
930
+ const b = Wa(await E.json());
904
931
  if (!b.ok)
905
932
  throw new Error("Calendar preferences response is invalid");
906
933
  return b.value;
907
- }, []), L = $(async () => {
908
- if (!n || !i || !s) return;
934
+ }, []), F = $(async () => {
935
+ if (!r || !i || !s) return;
909
936
  const E = i;
910
- f(!0), S(null);
937
+ f(!0), x(null);
911
938
  try {
912
939
  const b = await fetch(
913
940
  `${s}/v1/user-preferences/calendar`,
@@ -920,25 +947,25 @@ function Fr(e = {}) {
920
947
  const R = await b.json().catch(() => ({}));
921
948
  throw new Error(R.error || "Failed to fetch preferences");
922
949
  }
923
- const C = await z(b);
924
- k.current === E && w(C);
950
+ const N = await P(b);
951
+ y.current === E && w(N);
925
952
  } catch (b) {
926
- k.current === E && S(b instanceof Error ? b.message : "Unknown error");
953
+ y.current === E && x(b instanceof Error ? b.message : "Unknown error");
927
954
  } finally {
928
- k.current === E && f(!1);
955
+ y.current === E && f(!1);
929
956
  }
930
- }, [i, s, n, z]);
957
+ }, [i, s, r, P]);
931
958
  ee(() => {
932
- n && L();
933
- }, [n, L]);
959
+ r && F();
960
+ }, [r, F]);
934
961
  const U = $(
935
962
  async (E) => {
936
963
  if (!i || !s)
937
- return S("Not authenticated"), !1;
964
+ return x("Not authenticated"), !1;
938
965
  const b = i;
939
- g(!0), S(null);
966
+ g(!0), x(null);
940
967
  try {
941
- const C = await fetch(
968
+ const N = await fetch(
942
969
  `${s}/v1/user-preferences/calendar`,
943
970
  {
944
971
  method: "PATCH",
@@ -949,29 +976,29 @@ function Fr(e = {}) {
949
976
  body: JSON.stringify(E)
950
977
  }
951
978
  );
952
- if (!C.ok) {
953
- const x = await C.json().catch(() => ({}));
954
- throw new Error(x.error || "Failed to update preferences");
979
+ if (!N.ok) {
980
+ const C = await N.json().catch(() => ({}));
981
+ throw new Error(C.error || "Failed to update preferences");
955
982
  }
956
- const R = await z(C);
957
- return k.current !== b ? !1 : (w(R), r(R.resolved, R.sources), !0);
958
- } catch (C) {
959
- return k.current === b && S(C instanceof Error ? C.message : "Unknown error"), !1;
983
+ const R = await P(N);
984
+ return y.current !== b ? !1 : (w(R), n(R.resolved, R.sources), !0);
985
+ } catch (N) {
986
+ return y.current === b && x(N instanceof Error ? N.message : "Unknown error"), !1;
960
987
  } finally {
961
- k.current === b && g(!1);
988
+ y.current === b && g(!1);
962
989
  }
963
990
  },
964
991
  [
965
992
  i,
966
993
  s,
967
- r,
968
- z
994
+ n,
995
+ P
969
996
  ]
970
997
  ), _ = $(async () => {
971
998
  if (!i || !s)
972
- return S("Not authenticated"), !1;
999
+ return x("Not authenticated"), !1;
973
1000
  const E = i;
974
- v(!0), S(null);
1001
+ v(!0), x(null);
975
1002
  try {
976
1003
  const b = await fetch(
977
1004
  `${s}/v1/user-preferences/calendar`,
@@ -984,28 +1011,28 @@ function Fr(e = {}) {
984
1011
  const R = await b.json().catch(() => ({}));
985
1012
  throw new Error(R.error || "Failed to clear preferences");
986
1013
  }
987
- const C = await z(b);
988
- return k.current !== E ? !1 : (w(C), r(C.resolved, C.sources), !0);
1014
+ const N = await P(b);
1015
+ return y.current !== E ? !1 : (w(N), n(N.resolved, N.sources), !0);
989
1016
  } catch (b) {
990
- return k.current === E && S(b instanceof Error ? b.message : "Unknown error"), !1;
1017
+ return y.current === E && x(b instanceof Error ? b.message : "Unknown error"), !1;
991
1018
  } finally {
992
- k.current === E && v(!1);
1019
+ y.current === E && v(!1);
993
1020
  }
994
1021
  }, [
995
1022
  i,
996
1023
  s,
997
- r,
998
- z
1024
+ n,
1025
+ P
999
1026
  ]);
1000
1027
  return {
1001
- preferences: N,
1028
+ preferences: I,
1002
1029
  isLoading: o,
1003
1030
  isSaving: u,
1004
1031
  isClearing: c,
1005
1032
  error: m,
1006
1033
  updatePreferences: U,
1007
1034
  clearPreferences: _,
1008
- refetch: L
1035
+ refetch: F
1009
1036
  };
1010
1037
  }
1011
1038
  const we = [
@@ -1023,12 +1050,12 @@ const we = [
1023
1050
  { value: "Asia/Kolkata", label: "Mumbai, New Delhi" },
1024
1051
  { value: "Australia/Sydney", label: "Sydney" },
1025
1052
  { value: "UTC", label: "UTC" }
1026
- ], Rt = [
1053
+ ], Pt = [
1027
1054
  { value: 0, label: "Sunday" },
1028
1055
  { value: 1, label: "Monday" },
1029
1056
  { value: 6, label: "Saturday" }
1030
1057
  ], it = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
1031
- function Lr() {
1058
+ function Ur() {
1032
1059
  try {
1033
1060
  const e = Intl;
1034
1061
  if (e.supportedValuesOf)
@@ -1037,7 +1064,7 @@ function Lr() {
1037
1064
  }
1038
1065
  return we.map((e) => e.value);
1039
1066
  }
1040
- function _r(e) {
1067
+ function jr(e) {
1041
1068
  if (!e) return "default";
1042
1069
  if (e.tz !== e.weekStart) return "inherited";
1043
1070
  switch (e.tz) {
@@ -1057,39 +1084,39 @@ function ot(e) {
1057
1084
  const a = we.find((t) => t.value === e);
1058
1085
  return a ? a.label : e;
1059
1086
  }
1060
- function Mr(e) {
1061
- const a = Rt.find((t) => t.value === e);
1087
+ function Br(e) {
1088
+ const a = Pt.find((t) => t.value === e);
1062
1089
  return a ? a.label : String(e);
1063
1090
  }
1064
- function Ur({
1091
+ function Wr({
1065
1092
  active: e,
1066
1093
  onClose: a
1067
1094
  }) {
1068
1095
  const {
1069
1096
  preferences: t,
1070
- isLoading: r,
1071
- isSaving: n,
1097
+ isLoading: n,
1098
+ isSaving: r,
1072
1099
  isClearing: i,
1073
1100
  updatePreferences: s,
1074
1101
  clearPreferences: o
1075
- } = Fr({ enabled: e }), f = da(), u = (t == null ? void 0 : t.resolved.tz) || (f == null ? void 0 : f.tz) || "UTC", g = (t == null ? void 0 : t.resolved.weekStart) ?? (f == null ? void 0 : f.weekStart) ?? 1, [c, v] = F((t == null ? void 0 : t.stored) === null), [m, S] = F(!1), [N, w] = F(
1102
+ } = Or({ enabled: e }), f = mt(), u = (t == null ? void 0 : t.resolved.tz) || (f == null ? void 0 : f.tz) || "UTC", g = (t == null ? void 0 : t.resolved.weekStart) ?? (f == null ? void 0 : f.weekStart) ?? 1, [c, v] = L((t == null ? void 0 : t.stored) === null), [m, x] = L(!1), [I, w] = L(
1076
1103
  u
1077
- ), [k, z] = F(
1104
+ ), [y, P] = L(
1078
1105
  g
1079
- ), [L, U] = F(!1), _ = Q(() => Lr(), []), E = Q(
1106
+ ), [F, U] = L(!1), _ = q(() => Ur(), []), E = q(
1080
1107
  () => _.filter(
1081
- (I) => !we.some((de) => de.value === I)
1108
+ (k) => !we.some((de) => de.value === k)
1082
1109
  ),
1083
1110
  [_]
1084
- ), b = Q(() => ot(N), [N]), C = t != null && t.inherited ? ot(t.inherited.tz) : "UTC", R = t != null && t.inherited ? Mr(t.inherited.weekStart) : "Monday", x = _r(
1111
+ ), b = q(() => ot(I), [I]), N = t != null && t.inherited ? ot(t.inherited.tz) : "UTC", R = t != null && t.inherited ? Br(t.inherited.weekStart) : "Monday", C = jr(
1085
1112
  t == null ? void 0 : t.inheritedSources
1086
1113
  );
1087
- Ft.useEffect(() => {
1114
+ Lt.useEffect(() => {
1088
1115
  if (!e) {
1089
- S(!1);
1116
+ x(!1);
1090
1117
  return;
1091
1118
  }
1092
- m || (t && v(t.stored === null), w(u), z(g));
1119
+ m || (t && v(t.stored === null), w(u), P(g));
1093
1120
  }, [
1094
1121
  e,
1095
1122
  m,
@@ -1097,26 +1124,26 @@ function Ur({
1097
1124
  u,
1098
1125
  g
1099
1126
  ]);
1100
- const q = async () => {
1101
- if (r) {
1127
+ const G = async () => {
1128
+ if (n) {
1102
1129
  H.error("Preferences are still loading. Please try again.");
1103
1130
  return;
1104
1131
  }
1105
1132
  c ? await o() ? (H.success("Now using default settings."), a()) : H.error("Failed to save preferences. Please try again.") : await s({
1106
- tz: N,
1107
- weekStart: k
1133
+ tz: I,
1134
+ weekStart: y
1108
1135
  }) ? (H.success("Preferences saved."), a()) : H.error("Failed to save preferences. Please try again.");
1109
1136
  }, K = () => {
1110
1137
  a();
1111
- }, ae = n || i, G = ae || r;
1138
+ }, ae = r || i, X = ae || n;
1112
1139
  return /* @__PURE__ */ h(ie, { children: [
1113
1140
  /* @__PURE__ */ h("div", { className: "space-y-4 py-1", children: [
1114
1141
  /* @__PURE__ */ h(
1115
1142
  Ye,
1116
1143
  {
1117
1144
  value: c ? "defaults" : "custom",
1118
- onValueChange: (I) => {
1119
- S(!0), v(I === "defaults");
1145
+ onValueChange: (k) => {
1146
+ x(!0), v(k === "defaults");
1120
1147
  },
1121
1148
  className: "space-y-0.5",
1122
1149
  children: [
@@ -1124,12 +1151,12 @@ function Ur({
1124
1151
  "label",
1125
1152
  {
1126
1153
  htmlFor: "mode-defaults",
1127
- className: M(
1154
+ className: O(
1128
1155
  "flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",
1129
1156
  c && "bg-muted/50"
1130
1157
  ),
1131
1158
  onClick: () => {
1132
- S(!0), v(!0);
1159
+ x(!0), v(!0);
1133
1160
  },
1134
1161
  children: [
1135
1162
  /* @__PURE__ */ l(
@@ -1143,11 +1170,11 @@ function Ur({
1143
1170
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
1144
1171
  /* @__PURE__ */ h("p", { className: "text-[13px] font-medium text-foreground", children: [
1145
1172
  "Use ",
1146
- x,
1173
+ C,
1147
1174
  " defaults"
1148
1175
  ] }),
1149
1176
  /* @__PURE__ */ h("p", { className: "text-[12px] text-muted-foreground", children: [
1150
- C,
1177
+ N,
1151
1178
  ", week starts ",
1152
1179
  R
1153
1180
  ] })
@@ -1159,12 +1186,12 @@ function Ur({
1159
1186
  "label",
1160
1187
  {
1161
1188
  htmlFor: "mode-custom",
1162
- className: M(
1189
+ className: O(
1163
1190
  "flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",
1164
1191
  !c && "bg-muted/50"
1165
1192
  ),
1166
1193
  onClick: () => {
1167
- S(!0), v(!1);
1194
+ x(!0), v(!1);
1168
1195
  },
1169
1196
  children: [
1170
1197
  /* @__PURE__ */ l(
@@ -1185,7 +1212,7 @@ function Ur({
1185
1212
  /* @__PURE__ */ h(
1186
1213
  "div",
1187
1214
  {
1188
- className: M(
1215
+ className: O(
1189
1216
  "space-y-4 border-t border-border/60 pt-4 transition-opacity",
1190
1217
  c && "pointer-events-none opacity-50"
1191
1218
  ),
@@ -1193,81 +1220,81 @@ function Ur({
1193
1220
  /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
1194
1221
  /* @__PURE__ */ l(oe, { className: it, children: "Timezone" }),
1195
1222
  /* @__PURE__ */ h(
1196
- Ca,
1223
+ Fa,
1197
1224
  {
1198
- open: L,
1225
+ open: F,
1199
1226
  onOpenChange: U,
1200
1227
  modal: !0,
1201
1228
  children: [
1202
- /* @__PURE__ */ l(Na, { asChild: !0, children: /* @__PURE__ */ h(
1229
+ /* @__PURE__ */ l(La, { asChild: !0, children: /* @__PURE__ */ h(
1203
1230
  V,
1204
1231
  {
1205
1232
  variant: "outline",
1206
1233
  size: "xs",
1207
1234
  role: "combobox",
1208
- "aria-expanded": L,
1235
+ "aria-expanded": F,
1209
1236
  className: "w-full justify-between text-[12px] font-normal",
1210
1237
  disabled: c,
1211
1238
  children: [
1212
1239
  /* @__PURE__ */ l("span", { className: "truncate", children: b }),
1213
- /* @__PURE__ */ l(ca, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
1240
+ /* @__PURE__ */ l(ua, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
1214
1241
  ]
1215
1242
  }
1216
1243
  ) }),
1217
1244
  /* @__PURE__ */ l(
1218
- Ea,
1245
+ _a,
1219
1246
  {
1220
1247
  className: "z-50 w-[--radix-popover-trigger-width] p-0",
1221
1248
  align: "start",
1222
- children: /* @__PURE__ */ h(Tt, { className: "overflow-visible", children: [
1249
+ children: /* @__PURE__ */ h(It, { className: "overflow-visible", children: [
1223
1250
  /* @__PURE__ */ l(kt, { placeholder: "Search timezones…" }),
1224
- /* @__PURE__ */ h(It, { children: [
1225
- /* @__PURE__ */ l(At, { children: "No timezone found." }),
1226
- /* @__PURE__ */ l(Ue, { heading: "Common", children: we.map((I) => /* @__PURE__ */ h(
1227
- Oe,
1251
+ /* @__PURE__ */ h(At, { children: [
1252
+ /* @__PURE__ */ l(Dt, { children: "No timezone found." }),
1253
+ /* @__PURE__ */ l(Oe, { heading: "Common", children: we.map((k) => /* @__PURE__ */ h(
1254
+ Ue,
1228
1255
  {
1229
- value: `${I.value} ${I.label}`,
1256
+ value: `${k.value} ${k.label}`,
1230
1257
  onSelect: () => {
1231
- S(!0), w(I.value), U(!1);
1258
+ x(!0), w(k.value), U(!1);
1232
1259
  },
1233
1260
  children: [
1234
1261
  /* @__PURE__ */ l(
1235
1262
  Ze,
1236
1263
  {
1237
- className: M(
1264
+ className: O(
1238
1265
  "h-3.5 w-3.5",
1239
- N === I.value ? "opacity-100" : "opacity-0"
1266
+ I === k.value ? "opacity-100" : "opacity-0"
1240
1267
  )
1241
1268
  }
1242
1269
  ),
1243
- /* @__PURE__ */ l("span", { className: "flex-1", children: I.label }),
1244
- /* @__PURE__ */ l("span", { className: "text-[11px] text-muted-foreground", children: I.value })
1270
+ /* @__PURE__ */ l("span", { className: "flex-1", children: k.label }),
1271
+ /* @__PURE__ */ l("span", { className: "text-[11px] text-muted-foreground", children: k.value })
1245
1272
  ]
1246
1273
  },
1247
- I.value
1274
+ k.value
1248
1275
  )) }),
1249
- /* @__PURE__ */ l(Dt, {}),
1250
- /* @__PURE__ */ l(Ue, { heading: "All timezones", children: E.map((I) => /* @__PURE__ */ h(
1251
- Oe,
1276
+ /* @__PURE__ */ l(Rt, {}),
1277
+ /* @__PURE__ */ l(Oe, { heading: "All timezones", children: E.map((k) => /* @__PURE__ */ h(
1278
+ Ue,
1252
1279
  {
1253
- value: I,
1280
+ value: k,
1254
1281
  onSelect: () => {
1255
- S(!0), w(I), U(!1);
1282
+ x(!0), w(k), U(!1);
1256
1283
  },
1257
1284
  children: [
1258
1285
  /* @__PURE__ */ l(
1259
1286
  Ze,
1260
1287
  {
1261
- className: M(
1288
+ className: O(
1262
1289
  "h-3.5 w-3.5",
1263
- N === I ? "opacity-100" : "opacity-0"
1290
+ I === k ? "opacity-100" : "opacity-0"
1264
1291
  )
1265
1292
  }
1266
1293
  ),
1267
- I
1294
+ k
1268
1295
  ]
1269
1296
  },
1270
- I
1297
+ k
1271
1298
  )) })
1272
1299
  ] })
1273
1300
  ] })
@@ -1282,17 +1309,17 @@ function Ur({
1282
1309
  /* @__PURE__ */ l(
1283
1310
  Ye,
1284
1311
  {
1285
- value: String(k),
1286
- onValueChange: (I) => {
1287
- S(!0), z(Number(I));
1312
+ value: String(y),
1313
+ onValueChange: (k) => {
1314
+ x(!0), P(Number(k));
1288
1315
  },
1289
1316
  className: "flex gap-4",
1290
1317
  disabled: c,
1291
- children: Rt.map((I) => /* @__PURE__ */ h(
1318
+ children: Pt.map((k) => /* @__PURE__ */ h(
1292
1319
  "label",
1293
1320
  {
1294
- htmlFor: `week-start-${I.value}`,
1295
- className: M(
1321
+ htmlFor: `week-start-${k.value}`,
1322
+ className: O(
1296
1323
  "flex cursor-pointer items-center gap-2 text-[13px]",
1297
1324
  c && "cursor-not-allowed"
1298
1325
  ),
@@ -1300,15 +1327,15 @@ function Ur({
1300
1327
  /* @__PURE__ */ l(
1301
1328
  Ne,
1302
1329
  {
1303
- value: String(I.value),
1304
- id: `week-start-${I.value}`,
1330
+ value: String(k.value),
1331
+ id: `week-start-${k.value}`,
1305
1332
  disabled: c
1306
1333
  }
1307
1334
  ),
1308
- I.label
1335
+ k.label
1309
1336
  ]
1310
1337
  },
1311
- I.value
1338
+ k.value
1312
1339
  ))
1313
1340
  }
1314
1341
  )
@@ -1328,29 +1355,29 @@ function Ur({
1328
1355
  children: "Cancel"
1329
1356
  }
1330
1357
  ),
1331
- /* @__PURE__ */ l(V, { size: "xs", onClick: q, disabled: G, children: ae ? /* @__PURE__ */ h(ie, { children: [
1332
- /* @__PURE__ */ l(ht, { className: "h-3.5 w-3.5 animate-spin" }),
1358
+ /* @__PURE__ */ l(V, { size: "xs", onClick: G, disabled: X, children: ae ? /* @__PURE__ */ h(ie, { children: [
1359
+ /* @__PURE__ */ l(vt, { className: "h-3.5 w-3.5 animate-spin" }),
1333
1360
  "Saving…"
1334
1361
  ] }) : "Save" })
1335
1362
  ] })
1336
1363
  ] });
1337
1364
  }
1338
- function Or(e = {}) {
1339
- const { authToken: a, tokenProps: t } = Be(), r = j(
1365
+ function $r(e = {}) {
1366
+ const { authToken: a, tokenProps: t } = We(), n = M(
1340
1367
  (b) => b.actions.applyResolvedValueFormatPreferences
1341
- ), n = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, o = J(i);
1368
+ ), r = e.enabled ?? !0, i = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, o = Y(i);
1342
1369
  o.current = i;
1343
- const [f, u] = F(null), [g, c] = F(!1), [v, m] = F(!1), [S, N] = F(!1), [w, k] = F(null);
1370
+ const [f, u] = L(null), [g, c] = L(!1), [v, m] = L(!1), [x, I] = L(!1), [w, y] = L(null);
1344
1371
  ee(() => {
1345
- u(null), k(null), c(!1), m(!1), N(!1);
1372
+ u(null), y(null), c(!1), m(!1), I(!1);
1346
1373
  }, [i]);
1347
- const z = $(async (b) => {
1348
- const C = Da(await b.json());
1349
- if (!C.ok)
1374
+ const P = $(async (b) => {
1375
+ const N = Na(await b.json());
1376
+ if (!N.ok)
1350
1377
  throw new Error("Value format preferences response is invalid");
1351
- return C.value;
1352
- }, []), L = $(
1353
- async (b, C) => {
1378
+ return N.value;
1379
+ }, []), F = $(
1380
+ async (b, N) => {
1354
1381
  if (!i || !s)
1355
1382
  throw new Error("Not authenticated");
1356
1383
  const R = await fetch(
@@ -1359,65 +1386,65 @@ function Or(e = {}) {
1359
1386
  method: b,
1360
1387
  headers: {
1361
1388
  Authorization: `Bearer ${i}`,
1362
- ...C ? { "Content-Type": "application/json" } : {}
1389
+ ...N ? { "Content-Type": "application/json" } : {}
1363
1390
  },
1364
- body: C ? JSON.stringify(C) : void 0
1391
+ body: N ? JSON.stringify(N) : void 0
1365
1392
  }
1366
1393
  );
1367
1394
  if (!R.ok) {
1368
- const x = await R.json().catch(() => ({}));
1369
- throw new Error(x.error || "Failed to update preferences");
1395
+ const C = await R.json().catch(() => ({}));
1396
+ throw new Error(C.error || "Failed to update preferences");
1370
1397
  }
1371
- return z(R);
1398
+ return P(R);
1372
1399
  },
1373
- [i, s, z]
1400
+ [i, s, P]
1374
1401
  ), U = $(async () => {
1375
- if (!n || !i || !s) return;
1402
+ if (!r || !i || !s) return;
1376
1403
  const b = i;
1377
- c(!0), k(null);
1404
+ c(!0), y(null);
1378
1405
  try {
1379
- const C = await L("GET");
1380
- o.current === b && u(C);
1381
- } catch (C) {
1382
- o.current === b && k(C instanceof Error ? C.message : "Unknown error");
1406
+ const N = await F("GET");
1407
+ o.current === b && u(N);
1408
+ } catch (N) {
1409
+ o.current === b && y(N instanceof Error ? N.message : "Unknown error");
1383
1410
  } finally {
1384
1411
  o.current === b && c(!1);
1385
1412
  }
1386
- }, [i, s, n, L]);
1413
+ }, [i, s, r, F]);
1387
1414
  ee(() => {
1388
- n && U();
1389
- }, [n, U]);
1415
+ r && U();
1416
+ }, [r, U]);
1390
1417
  const _ = $(
1391
1418
  async (b) => {
1392
- const C = i;
1393
- m(!0), k(null);
1419
+ const N = i;
1420
+ m(!0), y(null);
1394
1421
  try {
1395
- const R = await L("PATCH", b);
1396
- return o.current !== C ? !1 : (u(R), r(R.resolved, R.sources), !0);
1422
+ const R = await F("PATCH", b);
1423
+ return o.current !== N ? !1 : (u(R), n(R.resolved, R.sources), !0);
1397
1424
  } catch (R) {
1398
- return o.current === C && k(R instanceof Error ? R.message : "Unknown error"), !1;
1425
+ return o.current === N && y(R instanceof Error ? R.message : "Unknown error"), !1;
1399
1426
  } finally {
1400
- o.current === C && m(!1);
1427
+ o.current === N && m(!1);
1401
1428
  }
1402
1429
  },
1403
- [i, r, L]
1430
+ [i, n, F]
1404
1431
  ), E = $(async () => {
1405
1432
  const b = i;
1406
- N(!0), k(null);
1433
+ I(!0), y(null);
1407
1434
  try {
1408
- const C = await L("DELETE");
1409
- return o.current !== b ? !1 : (u(C), r(C.resolved, C.sources), !0);
1410
- } catch (C) {
1411
- return o.current === b && k(C instanceof Error ? C.message : "Unknown error"), !1;
1435
+ const N = await F("DELETE");
1436
+ return o.current !== b ? !1 : (u(N), n(N.resolved, N.sources), !0);
1437
+ } catch (N) {
1438
+ return o.current === b && y(N instanceof Error ? N.message : "Unknown error"), !1;
1412
1439
  } finally {
1413
- o.current === b && N(!1);
1440
+ o.current === b && I(!1);
1414
1441
  }
1415
- }, [i, r, L]);
1442
+ }, [i, n, F]);
1416
1443
  return {
1417
1444
  preferences: f,
1418
1445
  isLoading: g,
1419
1446
  isSaving: v,
1420
- isClearing: S,
1447
+ isClearing: x,
1421
1448
  error: w,
1422
1449
  updatePreferences: _,
1423
1450
  clearPreferences: E,
@@ -1437,7 +1464,7 @@ const je = [
1437
1464
  { value: "en-IN", label: "English (India)" },
1438
1465
  { value: "en-NZ", label: "English (New Zealand)" },
1439
1466
  { value: "mi-NZ", label: "Māori (New Zealand)" }
1440
- ], Pt = /* @__PURE__ */ new Set([
1467
+ ], zt = /* @__PURE__ */ new Set([
1441
1468
  "USD",
1442
1469
  "EUR",
1443
1470
  "GBP",
@@ -1448,14 +1475,14 @@ const je = [
1448
1475
  "INR",
1449
1476
  "BRL",
1450
1477
  "KWD"
1451
- ]), jr = Ra(), Wr = jr.filter(
1452
- (e) => !Pt.has(e)
1453
- ), zt = [
1478
+ ]), Vr = Ea(), Kr = Vr.filter(
1479
+ (e) => !zt.has(e)
1480
+ ), Ft = [
1454
1481
  { value: "short", label: "Short" },
1455
1482
  { value: "medium", label: "Medium" },
1456
1483
  { value: "long", label: "Long" }
1457
- ], dt = "2026-07-31", Ie = "2026-07-31T14:30:45";
1458
- function We(e) {
1484
+ ], dt = "2026-07-31", ke = "2026-07-31T14:30:45";
1485
+ function Be(e) {
1459
1486
  switch (e) {
1460
1487
  case "viewer_user":
1461
1488
  return "user";
@@ -1475,9 +1502,9 @@ function We(e) {
1475
1502
  }
1476
1503
  function Ae(e) {
1477
1504
  var a;
1478
- return ((a = zt.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
1505
+ return ((a = Ft.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
1479
1506
  }
1480
- function Br(e) {
1507
+ function Hr(e) {
1481
1508
  const a = je.find((t) => t.value === e);
1482
1509
  return a ? `${a.label} — ${a.value}` : e;
1483
1510
  }
@@ -1492,13 +1519,13 @@ function Re({
1492
1519
  id: e,
1493
1520
  label: a,
1494
1521
  value: t,
1495
- inherited: r,
1496
- inheritedSource: n,
1522
+ inherited: n,
1523
+ inheritedSource: r,
1497
1524
  examples: i,
1498
1525
  disabled: s,
1499
1526
  onValueChange: o
1500
1527
  }) {
1501
- const f = t === void 0 ? `Inherited · ${Ae(r)}` : Ae(t);
1528
+ const f = t === void 0 ? `Inherited · ${Ae(n)}` : Ae(t);
1502
1529
  return /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
1503
1530
  /* @__PURE__ */ l(oe, { htmlFor: e, className: "text-[11px] text-muted-foreground", children: a }),
1504
1531
  /* @__PURE__ */ h(
@@ -1510,18 +1537,18 @@ function Re({
1510
1537
  children: [
1511
1538
  /* @__PURE__ */ l(ze, { id: e, size: "xs", children: /* @__PURE__ */ l(Fe, { children: f }) }),
1512
1539
  /* @__PURE__ */ h(Le, { children: [
1513
- /* @__PURE__ */ l(X, { value: "inherit", className: "[&>span:last-child]:w-full", children: /* @__PURE__ */ h("span", { className: "flex w-full min-w-0 items-center justify-between gap-4", children: [
1540
+ /* @__PURE__ */ l(J, { value: "inherit", className: "[&>span:last-child]:w-full", children: /* @__PURE__ */ h("span", { className: "flex w-full min-w-0 items-center justify-between gap-4", children: [
1514
1541
  /* @__PURE__ */ h("span", { children: [
1515
1542
  "Inherited from ",
1516
- We(n),
1543
+ Be(r),
1517
1544
  " ·",
1518
1545
  " ",
1519
- Ae(r)
1546
+ Ae(n)
1520
1547
  ] }),
1521
- /* @__PURE__ */ l("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: i[r] })
1548
+ /* @__PURE__ */ l("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: i[n] })
1522
1549
  ] }) }),
1523
- zt.map((u) => /* @__PURE__ */ l(
1524
- X,
1550
+ Ft.map((u) => /* @__PURE__ */ l(
1551
+ J,
1525
1552
  {
1526
1553
  value: u.value,
1527
1554
  className: "[&>span:last-child]:w-full",
@@ -1538,14 +1565,14 @@ function Re({
1538
1565
  )
1539
1566
  ] });
1540
1567
  }
1541
- function $r({
1568
+ function qr({
1542
1569
  value: e,
1543
1570
  inherited: a,
1544
1571
  inheritedSources: t,
1545
- onChange: r,
1546
- disabled: n
1572
+ onChange: n,
1573
+ disabled: r
1547
1574
  }) {
1548
- var E, b, C, R;
1575
+ var E, b, N, R;
1549
1576
  const i = ce(), s = ce(), o = ce(), f = ce(), u = ce(), c = (e.locale === void 0 ? void 0 : pt(e.locale)) ?? a.locale, v = e.defaultCurrency ?? a.defaultCurrency, m = {
1550
1577
  locale: c,
1551
1578
  dateStyle: e.dateStyle ?? a.dateStyle,
@@ -1554,59 +1581,59 @@ function $r({
1554
1581
  timeStyle: ((b = e.dateTime) == null ? void 0 : b.timeStyle) ?? a.dateTime.timeStyle
1555
1582
  },
1556
1583
  defaultCurrency: v
1557
- }, S = new Intl.NumberFormat(c, {
1584
+ }, x = new Intl.NumberFormat(c, {
1558
1585
  style: "currency",
1559
1586
  currency: v
1560
- }).format(1e3), N = ge({
1587
+ }).format(1e3), I = ge({
1561
1588
  preferences: m,
1562
1589
  calendar: { tz: "UTC" }
1563
1590
  }), w = ue({
1564
1591
  value: dt,
1565
1592
  metadata: { kind: "raw_temporal", valueKind: "date" },
1566
- format: N
1567
- }).text, k = ue({
1568
- value: Ie,
1593
+ format: I
1594
+ }).text, y = ue({
1595
+ value: ke,
1569
1596
  metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
1570
- format: N
1571
- }).text, z = De(
1572
- (x) => ue({
1597
+ format: I
1598
+ }).text, P = De(
1599
+ (C) => ue({
1573
1600
  value: dt,
1574
1601
  metadata: { kind: "raw_temporal", valueKind: "date" },
1575
1602
  format: ge({
1576
- preferences: { ...m, dateStyle: x },
1603
+ preferences: { ...m, dateStyle: C },
1577
1604
  calendar: { tz: "UTC" }
1578
1605
  })
1579
1606
  }).text
1580
- ), L = De(
1581
- (x) => ue({
1582
- value: Ie,
1607
+ ), F = De(
1608
+ (C) => ue({
1609
+ value: ke,
1583
1610
  metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
1584
1611
  format: ge({
1585
1612
  preferences: {
1586
1613
  ...m,
1587
- dateTime: { ...m.dateTime, dateStyle: x }
1614
+ dateTime: { ...m.dateTime, dateStyle: C }
1588
1615
  },
1589
1616
  calendar: { tz: "UTC" }
1590
1617
  })
1591
1618
  }).text
1592
1619
  ), U = De(
1593
- (x) => ue({
1594
- value: Ie,
1620
+ (C) => ue({
1621
+ value: ke,
1595
1622
  metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
1596
1623
  format: ge({
1597
1624
  preferences: {
1598
1625
  ...m,
1599
- dateTime: { ...m.dateTime, timeStyle: x }
1626
+ dateTime: { ...m.dateTime, timeStyle: C }
1600
1627
  },
1601
1628
  calendar: { tz: "UTC" }
1602
1629
  })
1603
1630
  }).text
1604
- ), _ = (x, q) => {
1631
+ ), _ = (C, G) => {
1605
1632
  const K = {
1606
1633
  ...e.dateTime,
1607
- [x]: q === "inherit" ? void 0 : q
1634
+ [C]: G === "inherit" ? void 0 : G
1608
1635
  };
1609
- r({
1636
+ n({
1610
1637
  ...e,
1611
1638
  dateTime: K.dateStyle === void 0 && K.timeStyle === void 0 ? void 0 : K
1612
1639
  });
@@ -1625,29 +1652,29 @@ function $r({
1625
1652
  Pe,
1626
1653
  {
1627
1654
  value: e.locale ?? "inherit",
1628
- disabled: n,
1629
- onValueChange: (x) => r({
1655
+ disabled: r,
1656
+ onValueChange: (C) => n({
1630
1657
  ...e,
1631
- locale: x === "inherit" ? void 0 : x
1658
+ locale: C === "inherit" ? void 0 : C
1632
1659
  }),
1633
1660
  children: [
1634
- /* @__PURE__ */ l(ze, { id: i, size: "xs", children: /* @__PURE__ */ l(Fe, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : Br(e.locale) }) }),
1661
+ /* @__PURE__ */ l(ze, { id: i, size: "xs", children: /* @__PURE__ */ l(Fe, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : Hr(e.locale) }) }),
1635
1662
  /* @__PURE__ */ h(Le, { children: [
1636
- /* @__PURE__ */ h(X, { value: "inherit", children: [
1663
+ /* @__PURE__ */ h(J, { value: "inherit", children: [
1637
1664
  "Inherited from ",
1638
- We(t.locale),
1665
+ Be(t.locale),
1639
1666
  " ·",
1640
1667
  " ",
1641
1668
  a.locale
1642
1669
  ] }),
1643
1670
  e.locale && !je.some(
1644
- (x) => x.value === e.locale
1645
- ) && /* @__PURE__ */ l(X, { value: e.locale, children: e.locale }),
1646
- je.map((x) => /* @__PURE__ */ h(X, { value: x.value, children: [
1647
- x.label,
1671
+ (C) => C.value === e.locale
1672
+ ) && /* @__PURE__ */ l(J, { value: e.locale, children: e.locale }),
1673
+ je.map((C) => /* @__PURE__ */ h(J, { value: C.value, children: [
1674
+ C.label,
1648
1675
  " — ",
1649
- x.value
1650
- ] }, x.value))
1676
+ C.value
1677
+ ] }, C.value))
1651
1678
  ] })
1652
1679
  ]
1653
1680
  }
@@ -1663,11 +1690,11 @@ function $r({
1663
1690
  value: e.dateStyle,
1664
1691
  inherited: a.dateStyle,
1665
1692
  inheritedSource: t.dateStyle,
1666
- examples: z,
1667
- disabled: n,
1668
- onValueChange: (x) => r({
1693
+ examples: P,
1694
+ disabled: r,
1695
+ onValueChange: (C) => n({
1669
1696
  ...e,
1670
- dateStyle: x === "inherit" ? void 0 : x
1697
+ dateStyle: C === "inherit" ? void 0 : C
1671
1698
  })
1672
1699
  }
1673
1700
  )
@@ -1679,12 +1706,12 @@ function $r({
1679
1706
  {
1680
1707
  id: f,
1681
1708
  label: "Date",
1682
- value: (C = e.dateTime) == null ? void 0 : C.dateStyle,
1709
+ value: (N = e.dateTime) == null ? void 0 : N.dateStyle,
1683
1710
  inherited: a.dateTime.dateStyle,
1684
1711
  inheritedSource: t.dateTime.dateStyle,
1685
- examples: L,
1686
- disabled: n,
1687
- onValueChange: (x) => _("dateStyle", x)
1712
+ examples: F,
1713
+ disabled: r,
1714
+ onValueChange: (C) => _("dateStyle", C)
1688
1715
  }
1689
1716
  ),
1690
1717
  /* @__PURE__ */ l(
@@ -1696,8 +1723,8 @@ function $r({
1696
1723
  inherited: a.dateTime.timeStyle,
1697
1724
  inheritedSource: t.dateTime.timeStyle,
1698
1725
  examples: U,
1699
- disabled: n,
1700
- onValueChange: (x) => _("timeStyle", x)
1726
+ disabled: r,
1727
+ onValueChange: (C) => _("timeStyle", C)
1701
1728
  }
1702
1729
  )
1703
1730
  ] }),
@@ -1714,23 +1741,23 @@ function $r({
1714
1741
  Pe,
1715
1742
  {
1716
1743
  value: e.defaultCurrency ?? "inherit",
1717
- disabled: n,
1718
- onValueChange: (x) => r({
1744
+ disabled: r,
1745
+ onValueChange: (C) => n({
1719
1746
  ...e,
1720
- defaultCurrency: x === "inherit" ? void 0 : x
1747
+ defaultCurrency: C === "inherit" ? void 0 : C
1721
1748
  }),
1722
1749
  children: [
1723
1750
  /* @__PURE__ */ l(ze, { id: s, size: "xs", children: /* @__PURE__ */ l(Fe, { children: e.defaultCurrency === void 0 ? `Inherited · ${a.defaultCurrency}` : e.defaultCurrency }) }),
1724
1751
  /* @__PURE__ */ h(Le, { children: [
1725
- /* @__PURE__ */ h(X, { value: "inherit", children: [
1752
+ /* @__PURE__ */ h(J, { value: "inherit", children: [
1726
1753
  "Inherited from ",
1727
- We(t.defaultCurrency),
1754
+ Be(t.defaultCurrency),
1728
1755
  " ·",
1729
1756
  " ",
1730
1757
  a.defaultCurrency
1731
1758
  ] }),
1732
- [...Pt].map((x) => /* @__PURE__ */ l(X, { value: x, children: x }, x)),
1733
- Wr.map((x) => /* @__PURE__ */ l(X, { value: x, children: x }, x))
1759
+ [...zt].map((C) => /* @__PURE__ */ l(J, { value: C, children: C }, C)),
1760
+ Kr.map((C) => /* @__PURE__ */ l(J, { value: C, children: C }, C))
1734
1761
  ] })
1735
1762
  ]
1736
1763
  }
@@ -1745,11 +1772,11 @@ function $r({
1745
1772
  ] }),
1746
1773
  /* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
1747
1774
  /* @__PURE__ */ l("dt", { className: "text-muted-foreground", children: "Date & time" }),
1748
- /* @__PURE__ */ l("dd", { className: "text-right font-medium text-foreground", children: k })
1775
+ /* @__PURE__ */ l("dd", { className: "text-right font-medium text-foreground", children: y })
1749
1776
  ] }),
1750
1777
  /* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
1751
1778
  /* @__PURE__ */ l("dt", { className: "text-muted-foreground", children: "Currency" }),
1752
- /* @__PURE__ */ l("dd", { className: "text-right font-medium text-foreground", children: S })
1779
+ /* @__PURE__ */ l("dd", { className: "text-right font-medium text-foreground", children: x })
1753
1780
  ] })
1754
1781
  ] })
1755
1782
  ] }),
@@ -1764,7 +1791,7 @@ const ct = [
1764
1791
  "defaultCurrency"
1765
1792
  ];
1766
1793
  function ut(e, a) {
1767
- var t, r;
1794
+ var t, n;
1768
1795
  switch (a) {
1769
1796
  case "locale":
1770
1797
  return e == null ? void 0 : e.locale;
@@ -1773,14 +1800,14 @@ function ut(e, a) {
1773
1800
  case "dateTime.dateStyle":
1774
1801
  return (t = e == null ? void 0 : e.dateTime) == null ? void 0 : t.dateStyle;
1775
1802
  case "dateTime.timeStyle":
1776
- return (r = e == null ? void 0 : e.dateTime) == null ? void 0 : r.timeStyle;
1803
+ return (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.timeStyle;
1777
1804
  case "defaultCurrency":
1778
1805
  return e == null ? void 0 : e.defaultCurrency;
1779
1806
  }
1780
1807
  }
1781
- function Vr(e) {
1782
- var r, n;
1783
- const a = (r = e == null ? void 0 : e.dateTime) == null ? void 0 : r.dateStyle, t = (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.timeStyle;
1808
+ function Gr(e) {
1809
+ var n, r;
1810
+ const a = (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.dateStyle, t = (r = e == null ? void 0 : e.dateTime) == null ? void 0 : r.timeStyle;
1784
1811
  return {
1785
1812
  locale: e == null ? void 0 : e.locale,
1786
1813
  dateStyle: e == null ? void 0 : e.dateStyle,
@@ -1788,16 +1815,16 @@ function Vr(e) {
1788
1815
  defaultCurrency: e == null ? void 0 : e.defaultCurrency
1789
1816
  };
1790
1817
  }
1791
- function Kr({
1818
+ function Xr({
1792
1819
  active: e,
1793
1820
  onClose: a
1794
1821
  }) {
1795
1822
  var o, f, u, g, c, v, m;
1796
- const { preferences: t, isLoading: r, isSaving: n, updatePreferences: i } = Or({ enabled: e });
1823
+ const { preferences: t, isLoading: n, isSaving: r, updatePreferences: i } = $r({ enabled: e });
1797
1824
  if (!e) return null;
1798
1825
  if (!t)
1799
1826
  return /* @__PURE__ */ h(ie, { children: [
1800
- /* @__PURE__ */ l("div", { className: "py-2", children: /* @__PURE__ */ l("div", { className: "flex min-h-36 items-center justify-center text-[12px] text-muted-foreground", children: r ? "Loading preferences…" : "Preferences unavailable." }) }),
1827
+ /* @__PURE__ */ l("div", { className: "py-2", children: /* @__PURE__ */ l("div", { className: "flex min-h-36 items-center justify-center text-[12px] text-muted-foreground", children: n ? "Loading preferences…" : "Preferences unavailable." }) }),
1801
1828
  /* @__PURE__ */ h($e, { className: "justify-between sm:justify-between", children: [
1802
1829
  /* @__PURE__ */ l(V, { variant: "ghost", size: "xs", disabled: !0, children: "Reset display formats" }),
1803
1830
  /* @__PURE__ */ h("div", { className: "flex gap-2", children: [
@@ -1814,50 +1841,50 @@ function Kr({
1814
1841
  ((m = t.stored) == null ? void 0 : m.defaultCurrency) ?? ""
1815
1842
  ].join(":");
1816
1843
  return /* @__PURE__ */ l(
1817
- Hr,
1844
+ Jr,
1818
1845
  {
1819
1846
  preferences: t,
1820
- isSaving: n,
1847
+ isSaving: r,
1821
1848
  updatePreferences: i,
1822
1849
  onClose: a
1823
1850
  },
1824
1851
  s
1825
1852
  );
1826
1853
  }
1827
- function Hr({
1854
+ function Jr({
1828
1855
  preferences: e,
1829
1856
  isSaving: a,
1830
1857
  updatePreferences: t,
1831
- onClose: r
1858
+ onClose: n
1832
1859
  }) {
1833
1860
  var u, g;
1834
- const [n, i] = F(
1835
- () => Vr(e.stored)
1836
- ), s = (n.locale === void 0 || pt(n.locale) !== void 0) && (n.defaultCurrency === void 0 || Pa(n.defaultCurrency) !== void 0) && (n.dateStyle === void 0 || ["short", "medium", "long"].includes(n.dateStyle)) && (((u = n.dateTime) == null ? void 0 : u.dateStyle) === void 0 || ["short", "medium", "long"].includes(n.dateTime.dateStyle)) && (((g = n.dateTime) == null ? void 0 : g.timeStyle) === void 0 || ["short", "medium", "long"].includes(n.dateTime.timeStyle)), o = async () => {
1861
+ const [r, i] = L(
1862
+ () => Gr(e.stored)
1863
+ ), s = (r.locale === void 0 || pt(r.locale) !== void 0) && (r.defaultCurrency === void 0 || Ta(r.defaultCurrency) !== void 0) && (r.dateStyle === void 0 || ["short", "medium", "long"].includes(r.dateStyle)) && (((u = r.dateTime) == null ? void 0 : u.dateStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.dateStyle)) && (((g = r.dateTime) == null ? void 0 : g.timeStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.timeStyle)), o = async () => {
1837
1864
  const c = {
1838
- ...n.locale !== void 0 ? { locale: n.locale } : {},
1839
- ...n.dateStyle !== void 0 ? { dateStyle: n.dateStyle } : {},
1840
- ...n.dateTime ? { dateTime: { ...n.dateTime } } : {},
1841
- ...n.defaultCurrency !== void 0 ? { defaultCurrency: n.defaultCurrency } : {}
1865
+ ...r.locale !== void 0 ? { locale: r.locale } : {},
1866
+ ...r.dateStyle !== void 0 ? { dateStyle: r.dateStyle } : {},
1867
+ ...r.dateTime ? { dateTime: { ...r.dateTime } } : {},
1868
+ ...r.defaultCurrency !== void 0 ? { defaultCurrency: r.defaultCurrency } : {}
1842
1869
  }, v = ct.filter(
1843
- (N) => ut(n, N) === void 0 && ut(e.stored, N) !== void 0
1870
+ (I) => ut(r, I) === void 0 && ut(e.stored, I) !== void 0
1844
1871
  ), m = {
1845
1872
  ...Object.keys(c).length > 0 ? { set: c } : {},
1846
1873
  ...v.length > 0 ? { clear: v } : {}
1847
1874
  };
1848
- (Object.keys(m).length === 0 ? !0 : await t(m)) ? (H.success("Display format preferences saved."), r()) : H.error("Failed to save preferences. Please try again.");
1875
+ (Object.keys(m).length === 0 ? !0 : await t(m)) ? (H.success("Display format preferences saved."), n()) : H.error("Failed to save preferences. Please try again.");
1849
1876
  }, f = async () => {
1850
1877
  await t({
1851
1878
  clear: [...ct]
1852
- }) ? (H.success("Display format preferences reset."), r()) : H.error(
1879
+ }) ? (H.success("Display format preferences reset."), n()) : H.error(
1853
1880
  "Failed to reset display format preferences. Please try again."
1854
1881
  );
1855
1882
  };
1856
1883
  return /* @__PURE__ */ h(ie, { children: [
1857
1884
  /* @__PURE__ */ l("div", { className: "py-2", children: /* @__PURE__ */ l(
1858
- $r,
1885
+ qr,
1859
1886
  {
1860
- value: n,
1887
+ value: r,
1861
1888
  inherited: e.inherited,
1862
1889
  inheritedSources: e.inheritedSources,
1863
1890
  onChange: i,
@@ -1881,7 +1908,7 @@ function Hr({
1881
1908
  {
1882
1909
  variant: "outline",
1883
1910
  size: "xs",
1884
- onClick: r,
1911
+ onClick: n,
1885
1912
  disabled: a,
1886
1913
  children: "Cancel"
1887
1914
  }
@@ -1893,7 +1920,7 @@ function Hr({
1893
1920
  onClick: o,
1894
1921
  disabled: a || !s,
1895
1922
  children: a ? /* @__PURE__ */ h(ie, { children: [
1896
- /* @__PURE__ */ l(ht, { className: "h-3.5 w-3.5 animate-spin" }),
1923
+ /* @__PURE__ */ l(vt, { className: "h-3.5 w-3.5 animate-spin" }),
1897
1924
  "Saving…"
1898
1925
  ] }) : "Save"
1899
1926
  }
@@ -1902,49 +1929,49 @@ function Hr({
1902
1929
  ] })
1903
1930
  ] });
1904
1931
  }
1905
- function vn({
1932
+ function wn({
1906
1933
  open: e,
1907
1934
  onOpenChange: a
1908
1935
  }) {
1909
- const [t, r] = F("display"), n = () => a(!1);
1910
- return /* @__PURE__ */ l(ua, { open: e, onOpenChange: a, children: /* @__PURE__ */ h(ma, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
1911
- /* @__PURE__ */ h(fa, { children: [
1912
- /* @__PURE__ */ l(ha, { className: "text-[15px]", children: "Report preferences" }),
1913
- /* @__PURE__ */ l(pa, { className: "text-[13px] leading-5", children: "Set how values and Calendar periods appear for you." })
1936
+ const [t, n] = L("display"), r = () => a(!1);
1937
+ return /* @__PURE__ */ l(ma, { open: e, onOpenChange: a, children: /* @__PURE__ */ h(fa, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
1938
+ /* @__PURE__ */ h(ha, { children: [
1939
+ /* @__PURE__ */ l(pa, { className: "text-[15px]", children: "Report preferences" }),
1940
+ /* @__PURE__ */ l(va, { className: "text-[13px] leading-5", children: "Set how values and Calendar periods appear for you." })
1914
1941
  ] }),
1915
- /* @__PURE__ */ h(Ta, { value: t, onValueChange: r, children: [
1916
- /* @__PURE__ */ h(ka, { variant: "underline", className: "w-full justify-start", children: [
1942
+ /* @__PURE__ */ h(Ma, { value: t, onValueChange: n, children: [
1943
+ /* @__PURE__ */ h(Oa, { variant: "underline", className: "w-full justify-start", children: [
1917
1944
  /* @__PURE__ */ l(Qe, { value: "display", children: "Display formats" }),
1918
1945
  /* @__PURE__ */ l(Qe, { value: "calendar", children: "Calendar" })
1919
1946
  ] }),
1920
1947
  /* @__PURE__ */ l(et, { value: "display", children: /* @__PURE__ */ l(
1921
- Kr,
1948
+ Xr,
1922
1949
  {
1923
1950
  active: e && t === "display",
1924
- onClose: n
1951
+ onClose: r
1925
1952
  }
1926
1953
  ) }),
1927
1954
  /* @__PURE__ */ l(et, { value: "calendar", children: /* @__PURE__ */ l(
1928
- Ur,
1955
+ Wr,
1929
1956
  {
1930
1957
  active: e && t === "calendar",
1931
- onClose: n
1958
+ onClose: r
1932
1959
  }
1933
1960
  ) })
1934
1961
  ] })
1935
1962
  ] }) });
1936
1963
  }
1937
1964
  export {
1938
- Ha as A,
1939
- Tt as C,
1940
- pn as D,
1941
- vn as R,
1942
- $r as a,
1965
+ Ja as A,
1966
+ It as C,
1967
+ yn as D,
1968
+ wn as R,
1969
+ qr as a,
1943
1970
  kt as b,
1944
- It as c,
1945
- At as d,
1946
- Ue as e,
1947
- Oe as f,
1948
- tr as g,
1949
- hn as h
1971
+ At as c,
1972
+ Dt as d,
1973
+ Oe as e,
1974
+ Ue as f,
1975
+ lr as g,
1976
+ gn as h
1950
1977
  };