react-semaphor 0.1.545 → 0.1.547

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 (159) hide show
  1. package/dist/analytics-protocol/index.js +408 -442
  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 +4 -4
  5. package/dist/briefings/index.js +6 -6
  6. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  7. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  8. package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
  9. package/dist/chunks/{assistant-chat-D7sWTypJ.js → assistant-chat-CK84cPAB.js} +2826 -2595
  10. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-Cu-a5ie_.js} +8 -15
  11. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  12. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  13. package/dist/chunks/custom-visual-inputs-ChL54gGm.js +295 -0
  14. package/dist/chunks/{dashboard-B1tMju0u.js → dashboard-DCk26-6i.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CePgIu0Z.js → dashboard-briefing-launcher-CQ1eYsGy.js} +1291 -1277
  16. package/dist/chunks/dashboard-controls-BMeZjF7r.js +2307 -0
  17. package/dist/chunks/{dashboard-json-CoYRPqxx.js → dashboard-json-BZqCoanC.js} +5 -5
  18. package/dist/chunks/{document-dashboard-inputs-BesAHZvB.js → document-dashboard-inputs-tYd7ao0o.js} +877 -979
  19. package/dist/chunks/{edit-dashboard-visual-JPtNfJRb.js → edit-dashboard-visual-Bv3MHM_G.js} +2157 -2243
  20. package/dist/chunks/filter-reach-copy-CGWsL_ez.js +3480 -0
  21. package/dist/chunks/{filter-value-text-ff7osJr7.js → filter-value-text-Ddf55Ku1.js} +9 -9
  22. package/dist/chunks/global-date-filter-utils-BhAu8zIM.js +12137 -0
  23. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  24. package/dist/chunks/{index-DRWiuqyd.js → index-DmrLP5Ro.js} +105 -104
  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-DnCyRXJE.js → matrix-formatter-DWEeC0_c.js} +44 -44
  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-C3mUgnEx.js → raw-temporal-presentation-DypB7sMX.js} +8 -8
  38. package/dist/chunks/{report-preferences-dialog-DUtuUL_5.js → report-preferences-dialog-DoVyriYC.js} +154 -155
  39. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  40. package/dist/chunks/resolve-dashboard-input-context-D0JDUa4h.js +5576 -0
  41. package/dist/chunks/{saved-dashboard-context-LrF_kW0l.js → saved-dashboard-context-BfAH5j4L.js} +34 -34
  42. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  43. package/dist/chunks/{semaphor-ready-indicator-BxF96Yhv.js → semaphor-ready-indicator-CRm17oIP.js} +51771 -52574
  44. package/dist/chunks/{shelf-drop-preview-context-CNaM_Gmh.js → shelf-drop-preview-context-vy6P9THz.js} +7 -7
  45. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  46. package/dist/chunks/{switch-uDtPgQlQ.js → switch-CEBOR4n7.js} +3 -3
  47. package/dist/chunks/{table-export-sheet-YzMioA7Y.js → table-export-sheet-4X9mAG3V.js} +1 -1
  48. package/dist/chunks/table-settings-WysCBj62.js +614 -0
  49. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  50. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  51. package/dist/chunks/{use-create-flow-overlay-state-CjB7ig1o.js → use-create-flow-overlay-state-Csx_Xjsh.js} +101 -101
  52. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  53. package/dist/chunks/{relative-date-label-Bk2j94pA.js → zoned-wall-clock-MulfA26h.js} +64 -21
  54. package/dist/dashboard/index.js +2 -2
  55. package/dist/dashboard-authoring/index.js +1895 -1163
  56. package/dist/data-app-sdk/index.js +6 -6
  57. package/dist/data-app-sdk-adapters/index.js +3 -3
  58. package/dist/data-app-sdk-validation/index.js +14 -14
  59. package/dist/format-utils/index.js +133 -133
  60. package/dist/index.js +192 -186
  61. package/dist/layouts/index.js +5 -242
  62. package/dist/report-runtime-context/index.js +2 -2
  63. package/dist/shared/index.js +4 -5
  64. package/dist/style.css +1 -1
  65. package/dist/surfboard/index.js +2 -2
  66. package/dist/types/components/index.d.ts +2 -0
  67. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  68. package/dist/types/components/surfboard/filter/types.d.ts +7 -0
  69. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +10 -0
  70. package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
  71. package/dist/types/index.js +6 -6
  72. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  73. package/dist/types/lib/charts/types.d.ts +2 -2
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +346 -21
  75. package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
  76. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +6 -0
  77. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +2 -0
  78. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  79. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
  80. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  81. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  83. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
  84. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
  85. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +149 -10
  86. package/dist/types/lib/stores/dashboard-store.d.ts +137 -6
  87. package/dist/types/lib/types/common-types.d.ts +8 -0
  88. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  89. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  90. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  91. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  92. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  93. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  94. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  95. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  96. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
  97. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  98. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  99. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  100. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  101. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  102. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -1
  103. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  104. package/dist/types/shared/assistant-protocol/context.d.ts +29 -29
  105. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  106. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  107. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  108. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  109. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  110. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  111. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  112. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  113. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +45 -0
  114. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  115. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +96 -0
  116. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
  117. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  118. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  119. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +24 -14
  120. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  121. package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
  122. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
  123. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
  124. package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
  125. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +26 -0
  126. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  127. package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
  128. package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
  129. package/dist/types/shared/dashboard-authoring/index.d.ts +22 -2
  130. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  131. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  132. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +101 -0
  133. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +100 -0
  134. package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
  135. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  136. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  137. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  138. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  139. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  140. package/dist/types/shared/layouts/index.d.ts +1 -2
  141. package/package.json +2 -2
  142. package/dist/chunks/apply-dashboard-operations-CZEMsx8E.js +0 -2080
  143. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +0 -410
  144. package/dist/chunks/comparison-window-caption-D4E6IHPD.js +0 -1624
  145. package/dist/chunks/custom-visual-inputs-DLCD9Y5V.js +0 -329
  146. package/dist/chunks/dashboard-controls-Cq05n3e0.js +0 -2315
  147. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  148. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  149. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  150. package/dist/chunks/numeric-presentation-7X_IrD58.js +0 -5226
  151. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +0 -9415
  152. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  153. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  154. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  155. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +0 -46
  156. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  157. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  158. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  159. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -1,37 +1,36 @@
1
- import { jsx as t, jsxs as r, Fragment as _ } from "react/jsx-runtime";
2
- import At, { useState as k, useEffect as ge, useCallback as ae, useMemo as re, useLayoutEffect as Nt, useRef as rt, useContext as Kt } from "react";
3
- import { ae as E, ar as Gt } from "./numeric-presentation-7X_IrD58.js";
4
- import { B as L, l as De, q as nt, L as ne, j as Ft, c as st, i as Xt, P as Me, a as Re, b as Oe, S as It } from "./switch-uDtPgQlQ.js";
5
- import { cv as ot, by as Ae, bz as Fe, bB as Ie, cw as Yt, cx as Zt, a_ as Et, aY as $e, cy as Jt, cz as We, cA as it, a0 as qe, Z as de, u as D, cB as ea, cC as ta, cD as aa, $ as ee, ba as ra, cE as na, cF as sa, aT as be, ck as Tt, aK as _e, o as oa, k as ia, cG as la, cn as lt, co as dt, cp as ct, cq as ut, cr as ht, cs as mt, ct as pt, cu as Vt, aI as ft, cH as da, cI as ca, cc as Je, c9 as Qe, ca as He, cJ as Lt, cb as Ke, bV as Y, cl as ua, cj as ze, cK as ha, bT as ma, bA as gt, bC as bt, cL as pa, bx as fa, cM as Bt, cN as xt, cO as ga, bZ as ba, i as xa, cP as va, cQ as ya, cR as G, cS as Ca, R as Pt, cT as wa, cU as Na, cV as Sa, cW as ka, aF as Da, cX as he, cY as Aa, P as vt, cZ as Fa, c_ as Ia, c$ as Ea, d0 as Ta, d1 as Va, d2 as La, d3 as Ba, d4 as Ut, d5 as Pa, d6 as Ua, d7 as Ma, d8 as Mt, d9 as Ra, da as Be, db as Oa, dc as _a, dd as za, A as ja, au as $a, av as Wa, aa as qa, a9 as Qa, a8 as Ha, a7 as Ka, a4 as Ga, a2 as Xa, de as Ya, df as Za, dg as Ja, dh as er, di as tr, as as ar } from "./semaphor-ready-indicator-BxF96Yhv.js";
6
- import { L as yt } from "./layout-grid-Bgzth8vd.js";
7
- import { c as xe, X as Ge, C as Rt } from "./x-4f5U2XwU.js";
1
+ import { jsx as e, jsxs as r, Fragment as O } from "react/jsx-runtime";
2
+ import Et, { useState as D, useEffect as be, useCallback as ae, useMemo as re, useLayoutEffect as kt, useRef as nt, useContext as Kt } from "react";
3
+ import { cC as ot, bE as Fe, bF as Ee, bH as Ie, cD as Xt, b2 as It, b0 as Qe, cE as Yt, cF as Ge, cG as it, a4 as Ke, a1 as de, u as N, cH as Zt, cI as Jt, bD as F, cJ as ea, a3 as ee, be as ta, cK as aa, cL as ra, aX as xe, cr as Lt, aO as _e, o as na, k as sa, cM as oa, cu as lt, cv as dt, cw as ct, cx as ut, cy as ht, cz as mt, cA as pt, cB as Vt, aM as ft, cN as ia, cO as la, cj as et, cg as Le, ch as Ve, cP as Tt, ci as Te, c0 as X, cs as da, cq as je, cQ as ca, b_ as ua, bG as gt, bI as bt, cR as ha, bC as ma, cS as Bt, cT as xt, cU as pa, c4 as fa, i as ga, cV as ba, cW as xa, cX as K, cY as va, R as Pt, cZ as ya, c_ as Ca, c$ as wa, d0 as Na, aJ as Sa, d1 as he, d2 as ka, P as vt, d3 as Da, d4 as Aa, d5 as Fa, d6 as Ea, d7 as Ia, d8 as La, d9 as Va, da as Mt, db as Ta, dc as Ba, dd as Pa, de as Ut, df as Ma, dg as Re, dh as Ua, di as Ra, dj as za, A as Oa, ay as _a, az as ja, ae as $a, ad as Wa, ac as qa, ab as Ha, a8 as Qa, a6 as Ga, dk as Ka, dl as Xa, dm as Ya, dn as Za, dp as Ja, aw as er } from "./semaphor-ready-indicator-CRm17oIP.js";
4
+ import { B as L, l as De, q as st, L as ne, j as Rt, c as yt, i as tr, P as $e, a as We, b as qe, S as zt } from "./switch-CEBOR4n7.js";
5
+ import { L as Ae } from "./layout-grid-Bgzth8vd.js";
6
+ import { c as fe, X as Xe, C as Ct } from "./x-4f5U2XwU.js";
8
7
  import "./index-CuHybtft.js";
9
- import { t as rr } from "./validators-DMHTpf7a.js";
10
- import "./matrix-operation-contract-8OIO4gob.js";
11
- import "./analytics-base-schemas-BFAoRlkU.js";
8
+ import { o as ar } from "./validators-C-aOQlTB.js";
9
+ import "./matrix-operation-contract-D6vYkZK4.js";
10
+ import "./analytics-base-schemas-BKs3flFS.js";
12
11
  import "zod";
13
12
  import "../value-format-preferences/index.js";
14
13
  import { c as J } from "./_commonjsHelpers-DimLPMtv.js";
15
- import { S as nr } from "./selection-reducer-Dj_8xD69.js";
16
- import { s as Pe } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
17
- import { f as sr } from "./editor-draft-sync-BN5qYHPF.js";
18
- import { ce as je, cf as or, cd as ir, bW as lr, a5 as dr, cg as cr, aX as ur } from "./resolve-dashboard-input-context-DJ2tICwz.js";
14
+ import { S as rr } from "./selection-reducer-CJzkTZio.js";
15
+ import { s as ze } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
16
+ import { aL as nr, ay as sr, e1 as He, v as Dt, e2 as or, as as wt, e3 as ir, dq as lr, dc as dr, bp as cr, e4 as ur } from "./global-date-filter-utils-BhAu8zIM.js";
17
+ import { f as hr } from "./editor-draft-sync-BN5qYHPF.js";
19
18
  import "react-dom";
20
- import "./pivot-result-lifecycle-DM4CyGKs.js";
21
- import { F as hr } from "./table-settings-CLZocegs.js";
19
+ import "./pivot-result-lifecycle-pwq3b7LC.js";
20
+ import "./index-CtoK1Lgu.js";
21
+ import { I as mr } from "./table-settings-WysCBj62.js";
22
22
  import { S as Ot } from "./save-CfJpQQ68.js";
23
- import { V as mr, L as pr, a as fr, u as _t, C as zt, F as gr, b as br } from "./use-create-flow-overlay-state-CjB7ig1o.js";
24
- import { v as St } from "./custom-visual-inputs-DLCD9Y5V.js";
25
- import { q as kt } from "./matrix-formatter-DnCyRXJE.js";
26
- import { g as xr, f as vr } from "./document-dashboard-inputs-BesAHZvB.js";
27
- import { g as le, d as yr, a as Cr } from "./index-DRWiuqyd.js";
23
+ import { V as pr, L as fr, a as gr, u as _t, C as jt, F as br, b as xr } from "./use-create-flow-overlay-state-Csx_Xjsh.js";
24
+ import { q as At } from "./matrix-formatter-DWEeC0_c.js";
25
+ import { g as vr, f as yr } from "./document-dashboard-inputs-tYd7ao0o.js";
26
+ import { g as le, d as Cr, a as wr } from "./index-DmrLP5Ro.js";
28
27
  /**
29
28
  * @license lucide-react v0.453.0 - ISC
30
29
  *
31
30
  * This source code is licensed under the ISC license.
32
31
  * See the LICENSE file in the root directory of this source tree.
33
32
  */
34
- const wr = xe("ArrowUpRight", [
33
+ const Nr = fe("ArrowUpRight", [
35
34
  ["path", { d: "M7 7h10v10", key: "1tivn9" }],
36
35
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
37
36
  ]);
@@ -41,7 +40,7 @@ const wr = xe("ArrowUpRight", [
41
40
  * This source code is licensed under the ISC license.
42
41
  * See the LICENSE file in the root directory of this source tree.
43
42
  */
44
- const Nr = xe("Bell", [
43
+ const Sr = fe("Bell", [
45
44
  ["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
46
45
  ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
47
46
  ]);
@@ -51,7 +50,7 @@ const Nr = xe("Bell", [
51
50
  * This source code is licensed under the ISC license.
52
51
  * See the LICENSE file in the root directory of this source tree.
53
52
  */
54
- const Sr = xe("CalendarRange", [
53
+ const kr = fe("CalendarRange", [
55
54
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
56
55
  ["path", { d: "M16 2v4", key: "4m81vk" }],
57
56
  ["path", { d: "M3 10h18", key: "8toen8" }],
@@ -67,7 +66,7 @@ const Sr = xe("CalendarRange", [
67
66
  * This source code is licensed under the ISC license.
68
67
  * See the LICENSE file in the root directory of this source tree.
69
68
  */
70
- const kr = xe("CodeXml", [
69
+ const Dr = fe("CodeXml", [
71
70
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
72
71
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
73
72
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
@@ -78,7 +77,19 @@ const kr = xe("CodeXml", [
78
77
  * This source code is licensed under the ISC license.
79
78
  * See the LICENSE file in the root directory of this source tree.
80
79
  */
81
- const Dr = xe("MousePointer2", [
80
+ const Ar = fe("MonitorSmartphone", [
81
+ ["path", { d: "M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8", key: "10dyio" }],
82
+ ["path", { d: "M10 19v-3.96 3.15", key: "1irgej" }],
83
+ ["path", { d: "M7 19h5", key: "qswx4l" }],
84
+ ["rect", { width: "6", height: "10", x: "16", y: "12", rx: "2", key: "1egngj" }]
85
+ ]);
86
+ /**
87
+ * @license lucide-react v0.453.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */
92
+ const Fr = fe("MousePointer2", [
82
93
  [
83
94
  "path",
84
95
  {
@@ -93,7 +104,7 @@ const Dr = xe("MousePointer2", [
93
104
  * This source code is licensed under the ISC license.
94
105
  * See the LICENSE file in the root directory of this source tree.
95
106
  */
96
- const Ar = xe("Newspaper", [
107
+ const Er = fe("Newspaper", [
97
108
  [
98
109
  "path",
99
110
  {
@@ -105,39 +116,39 @@ const Ar = xe("Newspaper", [
105
116
  ["path", { d: "M15 18h-5", key: "95g1m2" }],
106
117
  ["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
107
118
  ]);
108
- function Fr() {
109
- return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */ r(
119
+ function Ir() {
120
+ return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t, a) => /* @__PURE__ */ r(
110
121
  "div",
111
122
  {
112
123
  className: "flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",
113
124
  children: [
114
- /* @__PURE__ */ t("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
125
+ /* @__PURE__ */ e("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
115
126
  /* @__PURE__ */ r("div", { className: "flex-1 space-y-1.5", children: [
116
- /* @__PURE__ */ t("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
117
- /* @__PURE__ */ t("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
127
+ /* @__PURE__ */ e("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
128
+ /* @__PURE__ */ e("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
118
129
  ] })
119
130
  ]
120
131
  },
121
132
  a
122
133
  )) });
123
134
  }
124
- function Ir({
125
- open: e,
135
+ function Lr({
136
+ open: t,
126
137
  onOpenChange: a,
127
138
  onSubmit: o,
128
139
  isCreating: s
129
140
  }) {
130
- const i = ot("interactive"), [n, d] = k(""), [c, l] = k("");
131
- ge(() => {
132
- e || (d(""), l(""));
133
- }, [e]);
134
- const h = () => {
135
- n.trim() && o({ title: n, description: c });
136
- }, u = (m) => {
141
+ const i = ot("interactive"), [n, c] = D(""), [d, l] = D("");
142
+ be(() => {
143
+ t || (c(""), l(""));
144
+ }, [t]);
145
+ const u = () => {
146
+ n.trim() && o({ title: n, description: d });
147
+ }, h = (m) => {
137
148
  a(m);
138
149
  };
139
- return /* @__PURE__ */ t(Ae, { open: e, onOpenChange: u, children: /* @__PURE__ */ r(
140
- Fe,
150
+ return /* @__PURE__ */ e(Fe, { open: t, onOpenChange: h, children: /* @__PURE__ */ r(
151
+ Ee,
141
152
  {
142
153
  showCloseButton: !1,
143
154
  className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
@@ -145,53 +156,53 @@ function Ir({
145
156
  children: [
146
157
  /* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
147
158
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
148
- /* @__PURE__ */ t(yt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
159
+ /* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
149
160
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
150
- /* @__PURE__ */ t(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
151
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
161
+ /* @__PURE__ */ e(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
162
+ /* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
152
163
  ] })
153
164
  ] }),
154
- /* @__PURE__ */ t(
165
+ /* @__PURE__ */ e(
155
166
  L,
156
167
  {
157
168
  size: "xs",
158
169
  variant: "ghost",
159
170
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
160
- onClick: () => u(!1),
171
+ onClick: () => h(!1),
161
172
  "aria-label": "Close",
162
173
  disabled: s,
163
- children: /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5" })
174
+ children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
164
175
  }
165
176
  )
166
177
  ] }),
167
178
  /* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
168
- /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
179
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
169
180
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
170
- /* @__PURE__ */ t(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
171
- /* @__PURE__ */ t(
172
- nt,
181
+ /* @__PURE__ */ e(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
182
+ /* @__PURE__ */ e(
183
+ st,
173
184
  {
174
185
  id: "visual-title",
175
186
  size: "sm",
176
187
  placeholder: "Untitled visual",
177
188
  value: n,
178
- onChange: (m) => d(m.target.value),
189
+ onChange: (m) => c(m.target.value),
179
190
  disabled: s,
180
191
  onKeyDown: (m) => {
181
- m.key === "Enter" && !m.shiftKey && (m.preventDefault(), h());
192
+ m.key === "Enter" && !m.shiftKey && (m.preventDefault(), u());
182
193
  }
183
194
  }
184
195
  )
185
196
  ] }),
186
197
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
187
- /* @__PURE__ */ t(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
188
- /* @__PURE__ */ t(
189
- nt,
198
+ /* @__PURE__ */ e(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
199
+ /* @__PURE__ */ e(
200
+ st,
190
201
  {
191
202
  id: "visual-description",
192
203
  size: "sm",
193
204
  placeholder: "Optional",
194
- value: c,
205
+ value: d,
195
206
  onChange: (m) => l(m.target.value),
196
207
  disabled: s
197
208
  }
@@ -199,24 +210,24 @@ function Ir({
199
210
  ] })
200
211
  ] }),
201
212
  /* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
202
- /* @__PURE__ */ t(
213
+ /* @__PURE__ */ e(
203
214
  L,
204
215
  {
205
216
  size: "xs",
206
217
  variant: "outline",
207
- onClick: () => u(!1),
218
+ onClick: () => h(!1),
208
219
  disabled: s,
209
220
  children: "Cancel"
210
221
  }
211
222
  ),
212
- /* @__PURE__ */ t(
223
+ /* @__PURE__ */ e(
213
224
  L,
214
225
  {
215
226
  size: "xs",
216
- onClick: h,
227
+ onClick: u,
217
228
  disabled: !n.trim() || s,
218
- children: s ? /* @__PURE__ */ r(_, { children: [
219
- /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }),
229
+ children: s ? /* @__PURE__ */ r(O, { children: [
230
+ /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }),
220
231
  "Creating..."
221
232
  ] }) : "Create library visual"
222
233
  }
@@ -226,10 +237,10 @@ function Ir({
226
237
  }
227
238
  ) });
228
239
  }
229
- function Er(e) {
230
- const [a, o] = k(null), [s, i] = k(null), n = Yt();
231
- return ge(() => {
232
- if (!e || e.trim() === "") {
240
+ function Vr(t) {
241
+ const [a, o] = D(null), [s, i] = D(null), n = Xt();
242
+ return be(() => {
243
+ if (!t || t.trim() === "") {
233
244
  o(null), i(null);
234
245
  return;
235
246
  }
@@ -237,38 +248,38 @@ function Er(e) {
237
248
  return;
238
249
  (async () => {
239
250
  try {
240
- if (!e.startsWith("http://") && !e.startsWith("https://"))
241
- throw new Error(`Invalid URL format: ${e}`);
251
+ if (!t.startsWith("http://") && !t.startsWith("https://"))
252
+ throw new Error(`Invalid URL format: ${t}`);
242
253
  try {
243
- new URL(e);
254
+ new URL(t);
244
255
  } catch {
245
- throw new Error(`Invalid URL: ${e}`);
256
+ throw new Error(`Invalid URL: ${t}`);
246
257
  }
247
- const l = `${e.endsWith("/") ? e : `${e}/`}index.js`;
258
+ const l = `${t.endsWith("/") ? t : `${t}/`}index.js`;
248
259
  try {
249
260
  if (!(await fetch(l, { method: "HEAD" })).ok)
250
261
  throw new Error(`Module not found at ${l}`);
251
262
  } catch {
252
263
  }
253
- const h = await import(
264
+ const u = await import(
254
265
  /* @vite-ignore */
255
266
  /* webpackIgnore: true */
256
267
  l
257
268
  );
258
- if (typeof h.useChartStore != "function")
269
+ if (typeof u.useChartStore != "function")
259
270
  throw new Error("useChartStore is not a function");
260
- o(() => h.useChartStore), i(null);
261
- } catch (c) {
262
- const l = c instanceof Error ? c.message : "Unknown error";
271
+ o(() => u.useChartStore), i(null);
272
+ } catch (d) {
273
+ const l = d instanceof Error ? d.message : "Unknown error";
263
274
  console.error("Failed to load remote chart store:", l), i(l), o(null);
264
275
  }
265
276
  })();
266
- }, [e, n]), a;
277
+ }, [t, n]), a;
267
278
  }
268
- function Tr(e, a) {
269
- if (e.length === 0)
279
+ function Tr(t, a) {
280
+ if (t.length === 0)
270
281
  return "";
271
- const o = e.find(
282
+ const o = t.find(
272
283
  (s) => {
273
284
  var i, n;
274
285
  return ((i = s.customCardPreferences) == null ? void 0 : i.visualType) === "multiple" || !!((n = s.customCardPreferences) != null && n.dataInputCardIds);
@@ -277,108 +288,35 @@ function Tr(e, a) {
277
288
  if (o)
278
289
  return o.id;
279
290
  if (a) {
280
- const s = e.find((i) => i.id === a);
291
+ const s = t.find((i) => i.id === a);
281
292
  if (s) {
282
293
  const i = s.tabTitle;
283
294
  if (i == "All__Header")
284
- return e[0].id;
295
+ return t[0].id;
285
296
  if (i && i.endsWith("__Header")) {
286
- const d = i.split("__")[0], c = e.find(
287
- (l) => l.tabTitle === d
297
+ const c = i.split("__")[0], d = t.find(
298
+ (l) => l.tabTitle === c
288
299
  );
289
- return c ? c.id : e[0].id;
300
+ return d ? d.id : t[0].id;
290
301
  }
291
302
  return a;
292
303
  }
293
304
  }
294
- return e[0].id;
295
- }
296
- function Vr(e, a) {
297
- return a ? {
298
- ...e,
299
- settings: a
300
- } : e;
301
- }
302
- function Lr(e, a) {
303
- const o = a.selectedConnectionId || e.connectionId || "";
304
- if (!e.dataSource) {
305
- if (!o)
306
- return;
307
- const s = a.selectedDatabaseName || e.lastSelectedDatabase, i = a.selectedSchemaName || e.lastSelectedSchema, n = a.selectedTableName || e.lastSelectedTable;
308
- return {
309
- connectionId: o,
310
- connectionType: "",
311
- mode: "database",
312
- selectedEntities: [],
313
- ...s && i && n ? {
314
- dbSelection: {
315
- database: s,
316
- schema: i,
317
- entityType: "table"
318
- }
319
- } : {}
320
- };
321
- }
322
- return {
323
- ...e.dataSource,
324
- connectionId: a.selectedConnectionId || e.dataSource.connectionId || e.connectionId || ""
325
- };
305
+ return t[0].id;
326
306
  }
327
- function Br(e, {
328
- isDevMode: a,
329
- cardSql: o,
330
- selectedSchemaName: s,
331
- selectedDatamodelId: i,
332
- selectedDatabaseName: n,
333
- selectedTableName: d,
334
- selectedConnectionId: c,
335
- remoteChartSettings: l,
336
- stripConfig: h
337
- }) {
338
- const u = a || Zt(e);
339
- return {
340
- ...e,
341
- dataSource: Lr(e, {
342
- selectedConnectionId: c,
343
- selectedDatabaseName: n,
344
- selectedSchemaName: s,
345
- selectedTableName: d
346
- }),
347
- lastSelectedSchema: s,
348
- lastSelectedDatamodelId: i,
349
- lastSelectedDatabase: n,
350
- lastSelectedTable: d,
351
- connectionId: c || e.connectionId,
352
- sql: u ? o || e.sql : void 0,
353
- python: u ? e.python : void 0,
354
- config: a || !e.config ? void 0 : h(e.config),
355
- customCfg: e.customCfg,
356
- preferences: e.preferences,
357
- customCardPreferences: Vr(
358
- e.customCardPreferences,
359
- l
360
- )
361
- };
362
- }
363
- const Pr = (e) => {
364
- if (!e || !("detailTableBackup" in e))
365
- return e;
366
- const { detailTableBackup: a, ...o } = e;
367
- return o;
368
- };
369
- async function Dt(e, a, o, s, i = "Opening library visual...") {
307
+ async function Ft(t, a, o, s, i = "Opening library visual...") {
370
308
  if (!a || !o)
371
309
  throw new Error("Missing auth token or visual ID");
372
- const n = ["resource-by-id", "visual", o], d = s.getQueryData(n);
373
- if (d)
374
- return console.log("Using cached visual data for:", o), { data: d, fromCache: !0 };
310
+ const n = ["resource-by-id", "visual", o], c = s.getQueryData(n);
311
+ if (c)
312
+ return console.log("Using cached visual data for:", o), { data: c, fromCache: !0 };
375
313
  console.log("Fetching visual data from network for:", o);
376
- const c = E.loading(i, {
314
+ const d = F.loading(i, {
377
315
  position: "top-center"
378
316
  });
379
317
  try {
380
318
  const l = await fetch(
381
- `${e}/management/v1/visuals/${o}`,
319
+ `${t}/management/v1/visuals/${o}`,
382
320
  {
383
321
  headers: {
384
322
  Authorization: `Bearer ${a}`
@@ -387,314 +325,308 @@ async function Dt(e, a, o, s, i = "Opening library visual...") {
387
325
  );
388
326
  if (!l.ok)
389
327
  throw new Error("Failed to load visual");
390
- const h = await l.json();
391
- return s.setQueryData(n, h), E.dismiss(c), { data: h, fromCache: !1 };
328
+ const u = await l.json();
329
+ return s.setQueryData(n, u), F.dismiss(d), { data: u, fromCache: !1 };
392
330
  } catch (l) {
393
- throw E.dismiss(c), l;
331
+ throw F.dismiss(d), l;
394
332
  }
395
333
  }
396
- function jt(e) {
397
- if (typeof e == "string")
398
- return JSON.parse(e);
399
- if (typeof e == "object")
400
- return e;
334
+ function $t(t) {
335
+ if (typeof t == "string")
336
+ return JSON.parse(t);
337
+ if (typeof t == "object")
338
+ return t;
401
339
  throw new Error("Invalid frame object format");
402
340
  }
403
- function Ur(e, a) {
404
- var n, d;
405
- const o = (e == null ? void 0 : e.frameObject) ?? ((n = e == null ? void 0 : e.visual) == null ? void 0 : n.frameObject);
341
+ function Br(t, a) {
342
+ var n, c;
343
+ const o = (t == null ? void 0 : t.frameObject) ?? ((n = t == null ? void 0 : t.visual) == null ? void 0 : n.frameObject);
406
344
  if (!o)
407
345
  return !1;
408
- const s = jt(o);
346
+ const s = $t(o);
409
347
  if (!(s != null && s.cards) || s.cards.length === 0)
410
348
  return !1;
411
- const i = (d = s.cards) == null ? void 0 : d.find(
412
- (c) => c.id === s.activeCardId
349
+ const i = (c = s.cards) == null ? void 0 : c.find(
350
+ (d) => d.id === s.activeCardId
413
351
  );
414
- return i ? (aa({
352
+ return i ? (ea({
415
353
  ...a,
416
354
  frame: s,
417
355
  card: i,
418
- visualId: (e == null ? void 0 : e.id) || s.visualId
356
+ visualId: (t == null ? void 0 : t.id) || s.visualId
419
357
  }), !0) : !1;
420
358
  }
421
- function Mr() {
422
- const e = ee(
359
+ function Pr() {
360
+ const t = ee(
423
361
  (s) => {
424
362
  var i;
425
363
  return ((i = s.card.customCardPreferences) == null ? void 0 : i.url) || "";
426
364
  }
427
- ), a = Er(e);
365
+ ), a = Vr(t);
428
366
  return { getUpdatedFrame: ae(() => {
429
- var v;
430
- sr();
367
+ var f;
368
+ hr();
431
369
  const {
432
370
  frame: s,
433
371
  card: i,
434
372
  isDevMode: n,
435
- selectedSchemaName: d,
436
- selectedDatamodelId: c,
437
- selectedDatabaseName: l,
438
- selectedTableName: h,
373
+ selectedSchemaName: c,
374
+ selectedDatabaseName: d,
375
+ selectedTableName: l,
439
376
  selectedConnectionId: u
440
- } = ee.getState(), m = i.sql, p = (v = a == null ? void 0 : a.getState()) == null ? void 0 : v.settings, g = Br(i, {
377
+ } = ee.getState(), h = i.sql, m = (f = a == null ? void 0 : a.getState()) == null ? void 0 : f.settings, p = nr(i, {
441
378
  isDevMode: n,
442
- cardSql: m,
443
- selectedSchemaName: d,
444
- selectedDatamodelId: c,
445
- selectedDatabaseName: l,
446
- selectedTableName: h,
379
+ cardSql: h,
380
+ selectedSchemaName: c,
381
+ selectedDatabaseName: d,
382
+ selectedTableName: l,
447
383
  selectedConnectionId: u,
448
- remoteChartSettings: p,
449
- stripConfig: Pr
450
- }), f = s.cards.map(
451
- (N) => N.id === i.id ? g : N
384
+ remoteChartSettings: m,
385
+ stripConfig: sr
386
+ }), g = s.cards.map(
387
+ (v) => v.id === i.id ? p : v
452
388
  );
453
389
  return {
454
390
  ...s,
455
- cards: f,
456
- activeCardId: Tr(f, s.activeCardId)
391
+ cards: g,
392
+ activeCardId: Tr(g, s.activeCardId)
457
393
  };
458
394
  }, [a]) };
459
395
  }
460
396
  function ve() {
461
- const { authToken: e, tokenProps: a } = Et(), o = $e(), s = Jt(), i = We(), { selectVisual: n } = it(), {
462
- setFrame: d,
463
- setCard: c,
397
+ const { authToken: t, tokenProps: a } = It(), o = Qe(), s = Yt(), i = Ge(), { selectVisual: n } = it(), {
398
+ setFrame: c,
399
+ setCard: d,
464
400
  setIsDevMode: l,
465
- initializeModeDrafts: h,
466
- setActiveTabCardId: u,
401
+ initializeModeDrafts: u,
402
+ setActiveTabCardId: h,
467
403
  updateDataSource: m,
468
404
  setQueryResultColumns: p,
469
405
  setSelectedConnectionId: g,
470
406
  setSelectedDatabaseName: f,
471
407
  setSelectedSchemaName: v,
472
- setSelectedTableName: N,
473
- setSelectedDatamodelId: T,
474
- setInlineFilterValuesMap: U,
475
- setApplyFilters: M,
408
+ setSelectedTableName: k,
409
+ setSelectedDatamodelId: V,
410
+ setInlineFilterValuesMap: M,
411
+ setApplyFilters: U,
476
412
  clearEditorContext: A
477
- } = qe(), {
478
- setIsDashboardEditing: O,
413
+ } = Ke(), {
414
+ setIsDashboardEditing: z,
479
415
  setIsVisualEditing: C,
480
416
  setSelectedFrameId: w,
481
417
  clearSelectedFrameId: x
482
- } = de(), F = D((Q) => Q.selectedSheetId), S = D((Q) => Q.selectedFrameId), j = D((Q) => Q.dashboard), I = D(
483
- (Q) => Q.inlineFilterValuesMap
484
- ), V = ea((i == null ? void 0 : i.id) || "", {
485
- enabled: !!(i != null && i.id) && !!(e != null && e.accessToken)
418
+ } = de(), E = N((H) => H.selectedSheetId), S = N((H) => H.selectedFrameId), j = N((H) => H.dashboard), I = N(
419
+ (H) => H.inlineFilterValuesMap
420
+ ), T = Zt((i == null ? void 0 : i.id) || "", {
421
+ enabled: !!(i != null && i.id) && !!(t != null && t.accessToken)
486
422
  }), Z = ae(
487
- async (Q) => {
423
+ async (H) => {
488
424
  try {
489
- n(Q), x(), A();
490
- const { data: H, fromCache: ce } = await Dt(
425
+ n(H), x(), A();
426
+ const { data: Q, fromCache: ce } = await Ft(
491
427
  a.apiServiceUrl,
492
- (e == null ? void 0 : e.accessToken) || "",
493
- Q.id,
428
+ (t == null ? void 0 : t.accessToken) || "",
429
+ H.id,
494
430
  o,
495
431
  "Opening library visual..."
496
432
  );
497
- if (!Ur(H, {
498
- setFrame: d,
499
- setCard: c,
433
+ if (!Br(Q, {
434
+ setFrame: c,
435
+ setCard: d,
500
436
  setIsDevMode: l,
501
- initializeModeDrafts: h,
502
- setActiveTabCardId: u,
437
+ initializeModeDrafts: u,
438
+ setActiveTabCardId: h,
503
439
  updateDataSource: m,
504
440
  setQueryResultColumns: p,
505
441
  setSelectedConnectionId: g,
506
442
  setSelectedDatabaseName: f,
507
443
  setSelectedSchemaName: v,
508
- setSelectedTableName: N,
509
- setSelectedDatamodelId: T,
510
- setInlineFilterValuesMap: U,
511
- setApplyFilters: M,
512
- setIsDashboardEditing: O,
444
+ setSelectedTableName: k,
445
+ setSelectedDatamodelId: V,
446
+ setInlineFilterValuesMap: M,
447
+ setApplyFilters: U,
448
+ setIsDashboardEditing: z,
513
449
  setIsVisualEditing: C,
514
450
  dashboard: j,
515
- selectedSheetId: F,
451
+ selectedSheetId: E,
516
452
  selectedFrameId: S,
517
453
  inlineFilterValuesMap: I
518
454
  }))
519
455
  throw new Error("Failed to setup editor with visual data");
520
456
  return { success: !0, fromCache: ce };
521
- } catch (H) {
522
- return console.error("Error editing visual:", H), { success: !1, error: "Failed to load visual for editing" };
457
+ } catch (Q) {
458
+ return console.error("Error editing visual:", Q), { success: !1, error: "Failed to load visual for editing" };
523
459
  }
524
460
  },
525
461
  [
526
- e == null ? void 0 : e.accessToken,
462
+ t == null ? void 0 : t.accessToken,
527
463
  a.apiServiceUrl,
528
464
  o,
529
465
  n,
530
- d,
531
466
  c,
532
- O,
467
+ d,
468
+ z,
533
469
  C,
534
470
  l,
535
- h,
536
471
  u,
472
+ h,
537
473
  m,
538
474
  p,
539
475
  g,
540
476
  f,
541
477
  v,
542
- N,
543
- T,
544
- U,
478
+ k,
479
+ V,
545
480
  M,
481
+ U,
546
482
  A,
547
483
  x,
548
484
  j,
549
- F,
485
+ E,
550
486
  S,
551
487
  I
552
488
  ]
553
- ), K = ae(
554
- async (Q) => {
489
+ ), G = ae(
490
+ async (H) => {
555
491
  var ce;
556
- const H = (z) => (E.error(z), { success: !1, error: z });
492
+ const Q = (_) => (F.error(_), { success: !1, error: _ });
557
493
  try {
558
- if (n(Q), !F)
559
- return H("No sheet selected. Please select a sheet first.");
560
- const { data: z, fromCache: ye } = await Dt(
494
+ if (n(H), !E)
495
+ return Q("No sheet selected. Please select a sheet first.");
496
+ const { data: _, fromCache: ye } = await Ft(
561
497
  a.apiServiceUrl,
562
- (e == null ? void 0 : e.accessToken) || "",
563
- Q.id,
498
+ (t == null ? void 0 : t.accessToken) || "",
499
+ H.id,
564
500
  o,
565
501
  "Adding visual to dashboard..."
566
- ), X = (z == null ? void 0 : z.frameObject) ?? ((ce = z == null ? void 0 : z.visual) == null ? void 0 : ce.frameObject);
567
- if (!X)
568
- return H("Visual has no frame data");
569
- const R = jt(X);
502
+ ), Y = (_ == null ? void 0 : _.frameObject) ?? ((ce = _ == null ? void 0 : _.visual) == null ? void 0 : ce.frameObject);
503
+ if (!Y)
504
+ return Q("Visual has no frame data");
505
+ const R = $t(Y);
570
506
  if (!(R != null && R.cards) || R.cards.length === 0)
571
- return H("Visual frame is malformed");
507
+ return Q("Visual frame is malformed");
572
508
  const te = {
573
- ...ta(R),
574
- visualId: Q.id
509
+ ...Jt(R),
510
+ visualId: H.id
575
511
  // Link this frame to the library visual
576
512
  };
577
- return await s(
578
- F,
579
- te,
580
- "end"
581
- ), O(!0), w(te.id), { success: !0, fromCache: ye };
582
- } catch (z) {
583
- return console.error("Error adding visual:", z), H(
584
- z instanceof Error ? z.message : "Failed to add visual to dashboard"
513
+ return await s(E, te), z(!0), w(te.id), { success: !0, fromCache: ye };
514
+ } catch (_) {
515
+ return console.error("Error adding visual:", _), Q(
516
+ _ instanceof Error ? _.message : "Failed to add visual to dashboard"
585
517
  );
586
518
  }
587
519
  },
588
520
  [
589
- e == null ? void 0 : e.accessToken,
521
+ t == null ? void 0 : t.accessToken,
590
522
  a.apiServiceUrl,
591
523
  o,
592
524
  n,
593
- F,
594
- O,
525
+ E,
526
+ z,
595
527
  w,
596
528
  s
597
529
  ]
598
530
  );
599
531
  return {
600
- visual: V.data,
601
- isLoading: V.isLoading,
602
- isError: V.isError,
603
- error: V.error,
532
+ visual: T.data,
533
+ isLoading: T.isLoading,
534
+ isError: T.isError,
535
+ error: T.error,
604
536
  handleEditLibraryVisual: Z,
605
- handleAddLibraryVisual: K,
606
- getUpdatedFrame: Mr().getUpdatedFrame,
607
- refetch: V.refetch
537
+ handleAddLibraryVisual: G,
538
+ getUpdatedFrame: Pr().getUpdatedFrame,
539
+ refetch: T.refetch
608
540
  };
609
541
  }
610
- function $t(e) {
611
- return e ? new Date(e).toLocaleDateString("en-US", {
542
+ function Wt(t) {
543
+ return t ? new Date(t).toLocaleDateString("en-US", {
612
544
  month: "short",
613
545
  day: "numeric",
614
546
  year: "numeric"
615
547
  }) : "Unknown";
616
548
  }
617
- function Wt(e, a) {
549
+ function qt(t, a) {
618
550
  var s;
619
- const o = (s = e.ownership.createdBy) == null ? void 0 : s.type;
551
+ const o = (s = t.ownership.createdBy) == null ? void 0 : s.type;
620
552
  return o === "tenant" || o === "organization" && a;
621
553
  }
622
- function Ct(e, a) {
554
+ function Nt(t, a) {
623
555
  var o, s;
624
- return Wt(e, a) ? ((o = e.ownership.createdBy) == null ? void 0 : o.name) || ((s = e.createdByTenantUserRel) == null ? void 0 : s.name) || e.lastModifiedBy || "Unknown" : "Organization";
556
+ return qt(t, a) ? ((o = t.ownership.createdBy) == null ? void 0 : o.name) || ((s = t.createdByTenantUserRel) == null ? void 0 : s.name) || t.lastModifiedBy || "Unknown" : "Organization";
625
557
  }
626
- function Rr(e, a) {
627
- return Ct(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((s) => s.charAt(0).toUpperCase()).join("") || "?";
558
+ function Mr(t, a) {
559
+ return Nt(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((s) => s.charAt(0).toUpperCase()).join("") || "?";
628
560
  }
629
- function Or(e) {
630
- const a = (e || "").toLowerCase();
631
- return a.includes("table") ? Ft : a.includes("pie") || a.includes("donut") ? da : a.includes("line") ? ca : a.includes("bar") ? Xt : yt;
561
+ function Ur(t) {
562
+ const a = (t || "").toLowerCase();
563
+ return a.includes("table") ? Rt : a.includes("pie") || a.includes("donut") ? ia : a.includes("line") ? la : a.includes("bar") ? tr : Ae;
632
564
  }
633
- function _r({ visual: e }) {
634
- const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
635
- return /* @__PURE__ */ t("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
565
+ function Rr({ visual: t }) {
566
+ const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
567
+ return /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
636
568
  }
637
- function ns({
638
- open: e,
569
+ function ts({
570
+ open: t,
639
571
  onOpenChange: a
640
572
  }) {
641
- const o = ot("interactive"), [s, i] = k(""), [n, d] = k(/* @__PURE__ */ new Set()), [c, l] = k(!1), [h, u] = k(
573
+ const o = ot("interactive"), [s, i] = D(""), [n, c] = D(/* @__PURE__ */ new Set()), [d, l] = D(!1), [u, h] = D(
642
574
  null
643
- ), [m, p] = k(
575
+ ), [m, p] = D(
644
576
  null
645
- ), [g, f] = k(!1), [v, N] = k(null), [T, U] = k(null), M = () => {
646
- d(/* @__PURE__ */ new Set()), u(null), p(null), f(!1), N(null);
577
+ ), [g, f] = D(!1), [v, k] = D(null), [V, M] = D(null), U = () => {
578
+ c(/* @__PURE__ */ new Set()), h(null), p(null), f(!1), k(null);
647
579
  }, A = () => {
648
- a(!1), M();
649
- }, { selectVisual: O } = it(), { handleAddLibraryVisual: C, handleEditLibraryVisual: w } = ve(), { isConsoleMode: x } = ra(), {
650
- resources: F,
580
+ a(!1), U();
581
+ }, { selectVisual: z } = it(), { handleAddLibraryVisual: C, handleEditLibraryVisual: w } = ve(), { isConsoleMode: x } = ta(), {
582
+ resources: E,
651
583
  isLoading: S,
652
584
  isError: j,
653
585
  createResource: I,
654
- updateResource: V,
586
+ updateResource: T,
655
587
  deleteResourceAsync: Z,
656
- duplicateResource: K,
657
- isCreating: Q,
658
- isDeleting: H
659
- } = na(
588
+ duplicateResource: G,
589
+ isCreating: H,
590
+ isDeleting: Q
591
+ } = aa(
660
592
  void 0,
661
593
  (b) => {
662
- l(!1), b && (O(b), w(b), A());
594
+ l(!1), b && (z(b), w(b), A());
663
595
  }
664
596
  ), {
665
597
  startUpdating: ce,
666
- stopUpdating: z,
598
+ stopUpdating: _,
667
599
  isUpdating: ye
668
- } = sa(), X = F, R = re(() => {
600
+ } = ra(), Y = E, R = re(() => {
669
601
  const b = s.trim().toLowerCase();
670
- return b ? X.filter(
602
+ return b ? Y.filter(
671
603
  (B) => {
672
604
  var q, ie, ue;
673
605
  return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(b)) || ((ie = B.description) == null ? void 0 : ie.toLowerCase().includes(b)) || ((ue = B.kind) == null ? void 0 : ue.toLowerCase().includes(b));
674
606
  }
675
- ) : X;
676
- }, [s, X]), te = re(
677
- () => X.filter(
607
+ ) : Y;
608
+ }, [s, Y]), te = re(
609
+ () => Y.filter(
678
610
  (b) => n.has(b.id)
679
611
  ),
680
- [n, X]
612
+ [n, Y]
681
613
  ), me = te.filter(
682
614
  (b) => b.permissions.canDelete
683
615
  ), pe = te.filter(
684
616
  (b) => b.permissions.canShare
685
617
  ), Ce = R.length > 0 && R.every(
686
618
  (b) => n.has(b.id)
687
- ), Ee = R.some(
619
+ ), Be = R.some(
688
620
  (b) => n.has(b.id)
689
- ), Xe = (b) => {
621
+ ), Ye = (b) => {
690
622
  const B = new Set(n);
691
- b(B), d(B);
623
+ b(B), c(B);
692
624
  }, $ = (b) => {
693
- Xe((B) => {
625
+ Ye((B) => {
694
626
  B.has(b) ? B.delete(b) : B.add(b);
695
627
  });
696
628
  }, W = () => {
697
- d((b) => {
629
+ c((b) => {
698
630
  const B = new Set(b);
699
631
  return Ce ? R.forEach(
700
632
  (q) => B.delete(q.id)
@@ -714,42 +646,42 @@ function ns({
714
646
  break;
715
647
  }
716
648
  B || A();
717
- }, Ye = (b) => {
649
+ }, Ze = (b) => {
718
650
  w(b), A();
719
- }, fe = (b) => {
720
- U(b), K(b, {
721
- onSettled: () => U(null)
651
+ }, ge = (b) => {
652
+ M(b), G(b, {
653
+ onSettled: () => M(null)
722
654
  });
723
- }, Te = () => {
655
+ }, Pe = () => {
724
656
  if (me.length === 0) {
725
- E.error("Select a visual you can delete");
657
+ F.error("Select a visual you can delete");
726
658
  return;
727
659
  }
728
- N(null), f(!0);
729
- }, Ze = async () => {
660
+ k(null), f(!0);
661
+ }, Je = async () => {
730
662
  const b = v ? [v] : me;
731
663
  try {
732
664
  for (const B of b)
733
665
  await Z(B.id);
734
- d((B) => {
666
+ c((B) => {
735
667
  const q = new Set(B);
736
668
  return b.forEach(
737
669
  (ie) => q.delete(ie.id)
738
670
  ), q;
739
- }), f(!1), N(null);
671
+ }), f(!1), k(null);
740
672
  } catch {
741
673
  }
742
674
  }, Ne = () => {
743
675
  if (te.length !== 1) {
744
- E.error("Select one visual to share");
676
+ F.error("Select one visual to share");
745
677
  return;
746
678
  }
747
679
  const [b] = te;
748
680
  if (!b.permissions.canShare) {
749
- E.error("You do not have permission to share this visual");
681
+ F.error("You do not have permission to share this visual");
750
682
  return;
751
683
  }
752
- u(b);
684
+ h(b);
753
685
  }, Se = ({
754
686
  title: b,
755
687
  description: B
@@ -761,26 +693,26 @@ function ns({
761
693
  return;
762
694
  }
763
695
  const ie = Object.keys(q), ue = ie.length === 1 ? ie[0] : void 0;
764
- ce(m.id, ue), V(
696
+ ce(m.id, ue), T(
765
697
  {
766
698
  resourceId: m.id,
767
699
  data: q
768
700
  },
769
701
  {
770
702
  onSuccess: () => {
771
- z(m.id, ue), p(null);
703
+ _(m.id, ue), p(null);
772
704
  },
773
705
  onError: () => {
774
- z(m.id, ue);
706
+ _(m.id, ue);
775
707
  }
776
708
  }
777
709
  );
778
710
  }, oe = (b) => {
779
- a(b), b || M();
711
+ a(b), b || U();
780
712
  }, ke = v ? 1 : me.length;
781
- return /* @__PURE__ */ r(_, { children: [
782
- /* @__PURE__ */ t(Ae, { open: e, onOpenChange: oe, children: /* @__PURE__ */ r(
783
- Fe,
713
+ return /* @__PURE__ */ r(O, { children: [
714
+ /* @__PURE__ */ e(Fe, { open: t, onOpenChange: oe, children: /* @__PURE__ */ r(
715
+ Ee,
784
716
  {
785
717
  showCloseButton: !1,
786
718
  className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
@@ -788,13 +720,13 @@ function ns({
788
720
  children: [
789
721
  /* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
790
722
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
791
- /* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
723
+ /* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
792
724
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
793
- /* @__PURE__ */ t(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
794
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
725
+ /* @__PURE__ */ e(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
726
+ /* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
795
727
  ] })
796
728
  ] }),
797
- /* @__PURE__ */ t(
729
+ /* @__PURE__ */ e(
798
730
  L,
799
731
  {
800
732
  size: "xs",
@@ -808,8 +740,8 @@ function ns({
808
740
  ] }),
809
741
  /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
810
742
  /* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
811
- /* @__PURE__ */ t(nr, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
812
- /* @__PURE__ */ t(
743
+ /* @__PURE__ */ e(rr, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
744
+ /* @__PURE__ */ e(
813
745
  "input",
814
746
  {
815
747
  autoFocus: !0,
@@ -829,51 +761,51 @@ function ns({
829
761
  className: "ml-auto",
830
762
  onClick: () => l(!0),
831
763
  children: [
832
- /* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" }),
764
+ /* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5" }),
833
765
  "New library visual"
834
766
  ]
835
767
  }
836
768
  )
837
769
  ] }),
838
- /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: S ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Fr, {}) }) : j ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : R.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
839
- /* @__PURE__ */ t(yt, { className: "h-5 w-5 text-muted-foreground/60" }),
840
- /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: s ? "No visuals found" : "No visuals yet" }),
841
- /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: s ? "Try a different search." : "Create a saved visual to add it here." })
842
- ] }) : /* @__PURE__ */ t(
770
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: S ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(Ir, {}) }) : j ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ e("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : R.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
771
+ /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-muted-foreground/60" }),
772
+ /* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: s ? "No visuals found" : "No visuals yet" }),
773
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: s ? "Try a different search." : "Create a saved visual to add it here." })
774
+ ] }) : /* @__PURE__ */ e(
843
775
  zr,
844
776
  {
845
777
  visuals: R,
846
778
  selectedIds: n,
847
779
  allFilteredSelected: Ce,
848
- someFilteredSelected: Ee,
780
+ someFilteredSelected: Be,
849
781
  onSelectAll: W,
850
782
  onToggleSelection: $,
851
783
  onAddVisual: se,
852
- onOpenVisual: Ye,
784
+ onOpenVisual: Ze,
853
785
  onEditDetails: p,
854
- onShareVisual: u,
786
+ onShareVisual: h,
855
787
  onDeleteVisual: (b) => {
856
- N(b), f(!0);
788
+ k(b), f(!0);
857
789
  },
858
- onDuplicateVisual: fe,
859
- duplicatingId: T,
860
- isDeleting: H,
790
+ onDuplicateVisual: ge,
791
+ duplicatingId: V,
792
+ isDeleting: Q,
861
793
  isConsoleMode: x
862
794
  }
863
795
  ) }),
864
796
  /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
865
- /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(_, { children: [
797
+ /* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(O, { children: [
866
798
  /* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
867
- /* @__PURE__ */ t("span", { className: "font-medium tabular-nums text-foreground", children: n.size }),
799
+ /* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: n.size }),
868
800
  " ",
869
801
  "selected"
870
802
  ] }),
871
- /* @__PURE__ */ t(
803
+ /* @__PURE__ */ e(
872
804
  L,
873
805
  {
874
806
  size: "xs",
875
807
  variant: "ghost",
876
- onClick: () => d(/* @__PURE__ */ new Set()),
808
+ onClick: () => c(/* @__PURE__ */ new Set()),
877
809
  children: "Clear"
878
810
  }
879
811
  ),
@@ -885,7 +817,7 @@ function ns({
885
817
  onClick: Ne,
886
818
  disabled: te.length !== 1 || pe.length !== 1,
887
819
  children: [
888
- /* @__PURE__ */ t(Tt, { className: "h-3.5 w-3.5" }),
820
+ /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
889
821
  "Share"
890
822
  ]
891
823
  }
@@ -896,10 +828,10 @@ function ns({
896
828
  size: "xs",
897
829
  variant: "outline",
898
830
  className: "text-destructive hover:text-destructive",
899
- onClick: Te,
831
+ onClick: Pe,
900
832
  disabled: me.length === 0,
901
833
  children: [
902
- /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
834
+ /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
903
835
  "Delete ",
904
836
  me.length || n.size
905
837
  ]
@@ -907,7 +839,7 @@ function ns({
907
839
  )
908
840
  ] }) }),
909
841
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
910
- /* @__PURE__ */ t(
842
+ /* @__PURE__ */ e(
911
843
  L,
912
844
  {
913
845
  size: "xs",
@@ -923,7 +855,7 @@ function ns({
923
855
  onClick: we,
924
856
  disabled: n.size === 0,
925
857
  children: [
926
- /* @__PURE__ */ t(st, { className: "h-3.5 w-3.5" }),
858
+ /* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" }),
927
859
  n.size === 0 ? "Add to dashboard" : `Add ${n.size} visual${n.size === 1 ? "" : "s"}`
928
860
  ]
929
861
  }
@@ -933,25 +865,25 @@ function ns({
933
865
  ]
934
866
  }
935
867
  ) }),
936
- /* @__PURE__ */ t(
937
- Ir,
868
+ /* @__PURE__ */ e(
869
+ Lr,
938
870
  {
939
- open: c,
871
+ open: d,
940
872
  onOpenChange: l,
941
873
  onSubmit: I,
942
- isCreating: Q
874
+ isCreating: H
943
875
  }
944
876
  ),
945
- h && /* @__PURE__ */ t(
946
- oa,
877
+ u && /* @__PURE__ */ e(
878
+ na,
947
879
  {
948
- resource: h,
949
- resourceType: ia.VISUAL,
950
- onClose: () => u(null)
880
+ resource: u,
881
+ resourceType: sa.VISUAL,
882
+ onClose: () => h(null)
951
883
  }
952
884
  ),
953
- m && /* @__PURE__ */ t(
954
- la,
885
+ m && /* @__PURE__ */ e(
886
+ oa,
955
887
  {
956
888
  open: !!m,
957
889
  resourceLabel: "Visual",
@@ -962,12 +894,12 @@ function ns({
962
894
  isSaving: ye(m.id)
963
895
  }
964
896
  ),
965
- /* @__PURE__ */ t(
897
+ /* @__PURE__ */ e(
966
898
  lt,
967
899
  {
968
900
  open: g,
969
901
  onOpenChange: (b) => {
970
- !b && H || (f(b), b || N(null));
902
+ !b && Q || (f(b), b || k(null));
971
903
  },
972
904
  children: /* @__PURE__ */ r(dt, { children: [
973
905
  /* @__PURE__ */ r(ct, { children: [
@@ -978,20 +910,20 @@ function ns({
978
910
  ke === 1 ? "" : "s",
979
911
  "?"
980
912
  ] }),
981
- /* @__PURE__ */ t(ht, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
913
+ /* @__PURE__ */ e(ht, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
982
914
  ] }),
983
915
  /* @__PURE__ */ r(mt, { children: [
984
- /* @__PURE__ */ t(pt, { disabled: H, children: "Cancel" }),
916
+ /* @__PURE__ */ e(pt, { disabled: Q, children: "Cancel" }),
985
917
  /* @__PURE__ */ r(
986
918
  Vt,
987
919
  {
988
920
  onClick: (b) => {
989
- b.preventDefault(), Ze();
921
+ b.preventDefault(), Je();
990
922
  },
991
- disabled: H || ke === 0,
923
+ disabled: Q || ke === 0,
992
924
  children: [
993
- H ? /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
994
- H ? "Deleting..." : "Delete"
925
+ Q ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
926
+ Q ? "Deleting..." : "Delete"
995
927
  ]
996
928
  }
997
929
  )
@@ -1002,17 +934,17 @@ function ns({
1002
934
  ] });
1003
935
  }
1004
936
  function zr({
1005
- visuals: e,
937
+ visuals: t,
1006
938
  selectedIds: a,
1007
939
  allFilteredSelected: o,
1008
940
  someFilteredSelected: s,
1009
941
  onSelectAll: i,
1010
942
  onToggleSelection: n,
1011
- onAddVisual: d,
1012
- onOpenVisual: c,
943
+ onAddVisual: c,
944
+ onOpenVisual: d,
1013
945
  onEditDetails: l,
1014
- onShareVisual: h,
1015
- onDeleteVisual: u,
946
+ onShareVisual: u,
947
+ onDeleteVisual: h,
1016
948
  onDuplicateVisual: m,
1017
949
  duplicatingId: p,
1018
950
  isDeleting: g,
@@ -1020,7 +952,7 @@ function zr({
1020
952
  }) {
1021
953
  return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
1022
954
  /* @__PURE__ */ r("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
1023
- /* @__PURE__ */ t(
955
+ /* @__PURE__ */ e(
1024
956
  ft,
1025
957
  {
1026
958
  checked: o ? !0 : s ? "indeterminate" : !1,
@@ -1028,24 +960,24 @@ function zr({
1028
960
  "aria-label": "Select all visuals"
1029
961
  }
1030
962
  ),
1031
- /* @__PURE__ */ t("span", { children: "Name" }),
1032
- /* @__PURE__ */ t("span", { children: "Created by" }),
1033
- /* @__PURE__ */ t("span", { children: "Updated" }),
1034
- /* @__PURE__ */ t("span", { children: "Visibility" }),
1035
- /* @__PURE__ */ t("span", { className: "text-right", children: "Shared" }),
1036
- /* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
963
+ /* @__PURE__ */ e("span", { children: "Name" }),
964
+ /* @__PURE__ */ e("span", { children: "Created by" }),
965
+ /* @__PURE__ */ e("span", { children: "Updated" }),
966
+ /* @__PURE__ */ e("span", { children: "Visibility" }),
967
+ /* @__PURE__ */ e("span", { className: "text-right", children: "Shared" }),
968
+ /* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
1037
969
  ] }),
1038
- e.map((v) => /* @__PURE__ */ t(
1039
- jr,
970
+ t.map((v) => /* @__PURE__ */ e(
971
+ Or,
1040
972
  {
1041
973
  visual: v,
1042
974
  selected: a.has(v.id),
1043
975
  onToggleSelection: n,
1044
- onAddVisual: d,
1045
- onOpenVisual: c,
976
+ onAddVisual: c,
977
+ onOpenVisual: d,
1046
978
  onEditDetails: l,
1047
- onShareVisual: h,
1048
- onDeleteVisual: u,
979
+ onShareVisual: u,
980
+ onDeleteVisual: h,
1049
981
  onDuplicateVisual: m,
1050
982
  duplicatingId: p,
1051
983
  isDeleting: g,
@@ -1055,23 +987,23 @@ function zr({
1055
987
  ))
1056
988
  ] });
1057
989
  }
1058
- function jr({
1059
- visual: e,
990
+ function Or({
991
+ visual: t,
1060
992
  selected: a,
1061
993
  onToggleSelection: o,
1062
994
  onAddVisual: s,
1063
995
  onOpenVisual: i,
1064
996
  onEditDetails: n,
1065
- onShareVisual: d,
1066
- onDeleteVisual: c,
997
+ onShareVisual: c,
998
+ onDeleteVisual: d,
1067
999
  onDuplicateVisual: l,
1068
- duplicatingId: h,
1069
- isDeleting: u,
1000
+ duplicatingId: u,
1001
+ isDeleting: h,
1070
1002
  isConsoleMode: m
1071
1003
  }) {
1072
1004
  var f;
1073
- const p = Or(e.kind), g = () => {
1074
- s(e);
1005
+ const p = Ur(t.kind), g = () => {
1006
+ s(t);
1075
1007
  };
1076
1008
  return /* @__PURE__ */ r(
1077
1009
  "div",
@@ -1081,12 +1013,12 @@ function jr({
1081
1013
  a && "bg-muted/70"
1082
1014
  ),
1083
1015
  children: [
1084
- /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
1016
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
1085
1017
  ft,
1086
1018
  {
1087
1019
  checked: a,
1088
- onCheckedChange: () => o(e.id),
1089
- "aria-label": `Select ${e.title || "visual"}`
1020
+ onCheckedChange: () => o(t.id),
1021
+ "aria-label": `Select ${t.title || "visual"}`
1090
1022
  }
1091
1023
  ) }),
1092
1024
  /* @__PURE__ */ r(
@@ -1095,24 +1027,24 @@ function jr({
1095
1027
  type: "button",
1096
1028
  className: "flex min-w-0 items-center gap-2 rounded-[4px] text-left outline-none focus-visible:ring-1 focus-visible:ring-ring",
1097
1029
  onClick: g,
1098
- "aria-label": `Add ${e.title || "visual"} to dashboard`,
1030
+ "aria-label": `Add ${t.title || "visual"} to dashboard`,
1099
1031
  children: [
1100
- /* @__PURE__ */ t(p, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1032
+ /* @__PURE__ */ e(p, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1101
1033
  /* @__PURE__ */ r("div", { className: "min-w-0", children: [
1102
- /* @__PURE__ */ t(
1034
+ /* @__PURE__ */ e(
1103
1035
  "div",
1104
1036
  {
1105
1037
  className: "truncate font-medium text-foreground",
1106
- title: e.title || "Untitled Visual",
1107
- children: e.title || "Untitled Visual"
1038
+ title: t.title || "Untitled Visual",
1039
+ children: t.title || "Untitled Visual"
1108
1040
  }
1109
1041
  ),
1110
- ((f = e.description) == null ? void 0 : f.trim()) && /* @__PURE__ */ t(
1042
+ ((f = t.description) == null ? void 0 : f.trim()) && /* @__PURE__ */ e(
1111
1043
  "div",
1112
1044
  {
1113
1045
  className: "truncate text-[11px] text-muted-foreground",
1114
- title: e.description,
1115
- children: e.description
1046
+ title: t.description,
1047
+ children: t.description
1116
1048
  }
1117
1049
  )
1118
1050
  ] })
@@ -1120,23 +1052,23 @@ function jr({
1120
1052
  }
1121
1053
  ),
1122
1054
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
1123
- /* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Rr(e, m) }),
1124
- /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Ct(e, m) })
1055
+ /* @__PURE__ */ e("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Mr(t, m) }),
1056
+ /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: Nt(t, m) })
1125
1057
  ] }),
1126
- /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: $t(e.updatedAt) }),
1127
- /* @__PURE__ */ t(_r, { visual: e }),
1128
- /* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
1129
- /* @__PURE__ */ t(
1130
- $r,
1058
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: Wt(t.updatedAt) }),
1059
+ /* @__PURE__ */ e(Rr, { visual: t }),
1060
+ /* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
1061
+ /* @__PURE__ */ e(
1062
+ _r,
1131
1063
  {
1132
- visual: e,
1064
+ visual: t,
1133
1065
  onOpenVisual: i,
1134
1066
  onEditDetails: n,
1135
- onShareVisual: d,
1136
- onDeleteVisual: c,
1067
+ onShareVisual: c,
1068
+ onDeleteVisual: d,
1137
1069
  onDuplicateVisual: l,
1138
- duplicatingId: h,
1139
- isDeleting: u,
1070
+ duplicatingId: u,
1071
+ isDeleting: h,
1140
1072
  isConsoleMode: m
1141
1073
  }
1142
1074
  )
@@ -1144,98 +1076,98 @@ function jr({
1144
1076
  }
1145
1077
  );
1146
1078
  }
1147
- function $r({
1148
- visual: e,
1079
+ function _r({
1080
+ visual: t,
1149
1081
  onOpenVisual: a,
1150
1082
  onEditDetails: o,
1151
1083
  onShareVisual: s,
1152
1084
  onDeleteVisual: i,
1153
1085
  onDuplicateVisual: n,
1154
- duplicatingId: d,
1155
- isDeleting: c,
1086
+ duplicatingId: c,
1087
+ isDeleting: d,
1156
1088
  isConsoleMode: l
1157
1089
  }) {
1158
1090
  return /* @__PURE__ */ r(
1159
1091
  "div",
1160
1092
  {
1161
1093
  className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
1162
- onClick: (h) => h.stopPropagation(),
1094
+ onClick: (u) => u.stopPropagation(),
1163
1095
  children: [
1164
- /* @__PURE__ */ t(
1096
+ /* @__PURE__ */ e(
1165
1097
  L,
1166
1098
  {
1167
1099
  size: "xs",
1168
1100
  variant: "ghost",
1169
1101
  className: "w-7 px-0",
1170
- onClick: () => a(e),
1102
+ onClick: () => a(t),
1171
1103
  "aria-label": "Edit visual",
1172
- children: /* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" })
1104
+ children: /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" })
1173
1105
  }
1174
1106
  ),
1175
- /* @__PURE__ */ r(Qe, { modal: !1, children: [
1176
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ t(
1107
+ /* @__PURE__ */ r(Le, { modal: !1, children: [
1108
+ /* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
1177
1109
  L,
1178
1110
  {
1179
1111
  size: "xs",
1180
1112
  variant: "ghost",
1181
1113
  className: "w-7 px-0",
1182
1114
  "aria-label": "More actions",
1183
- children: /* @__PURE__ */ t(Lt, { className: "h-3.5 w-3.5" })
1115
+ children: /* @__PURE__ */ e(Tt, { className: "h-3.5 w-3.5" })
1184
1116
  }
1185
1117
  ) }),
1186
1118
  /* @__PURE__ */ r(
1187
- Ke,
1119
+ Te,
1188
1120
  {
1189
1121
  align: "end",
1190
1122
  className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
1191
1123
  children: [
1192
- /* @__PURE__ */ r(Y, { onClick: () => a(e), children: [
1193
- /* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" }),
1124
+ /* @__PURE__ */ r(X, { onClick: () => a(t), children: [
1125
+ /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
1194
1126
  "Edit visual"
1195
1127
  ] }),
1196
1128
  /* @__PURE__ */ r(
1197
- Y,
1129
+ X,
1198
1130
  {
1199
- onClick: () => n(e.id),
1200
- disabled: d === e.id,
1131
+ onClick: () => n(t.id),
1132
+ disabled: c === t.id,
1201
1133
  children: [
1202
- d === e.id ? /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(ua, { className: "h-3.5 w-3.5" }),
1203
- d === e.id ? "Duplicating..." : "Duplicate"
1134
+ c === t.id ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
1135
+ c === t.id ? "Duplicating..." : "Duplicate"
1204
1136
  ]
1205
1137
  }
1206
1138
  ),
1207
- e.permissions.canEdit && /* @__PURE__ */ r(Y, { onClick: () => o(e), children: [
1208
- /* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" }),
1139
+ t.permissions.canEdit && /* @__PURE__ */ r(X, { onClick: () => o(t), children: [
1140
+ /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
1209
1141
  "Edit details"
1210
1142
  ] }),
1211
- e.permissions.canShare && /* @__PURE__ */ r(Y, { onClick: () => s(e), children: [
1212
- /* @__PURE__ */ t(Tt, { className: "h-3.5 w-3.5" }),
1143
+ t.permissions.canShare && /* @__PURE__ */ r(X, { onClick: () => s(t), children: [
1144
+ /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
1213
1145
  "Share"
1214
1146
  ] }),
1215
- e.permissions.canDelete && /* @__PURE__ */ r(_, { children: [
1216
- /* @__PURE__ */ t(ze, {}),
1147
+ t.permissions.canDelete && /* @__PURE__ */ r(O, { children: [
1148
+ /* @__PURE__ */ e(je, {}),
1217
1149
  /* @__PURE__ */ r(
1218
- Y,
1150
+ X,
1219
1151
  {
1220
1152
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
1221
- onClick: () => i(e),
1222
- disabled: c,
1153
+ onClick: () => i(t),
1154
+ disabled: d,
1223
1155
  children: [
1224
- /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
1225
- c ? "Deleting..." : "Delete"
1156
+ /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
1157
+ d ? "Deleting..." : "Delete"
1226
1158
  ]
1227
1159
  }
1228
1160
  )
1229
1161
  ] }),
1230
- /* @__PURE__ */ t(ze, {}),
1162
+ /* @__PURE__ */ e(je, {}),
1231
1163
  /* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
1232
- Wt(e, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
1233
- /* @__PURE__ */ t(ha, { className: "h-3 w-3" }),
1234
- /* @__PURE__ */ t("span", { className: "truncate", children: Ct(e, l) })
1164
+ qt(t, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
1165
+ /* @__PURE__ */ e(ca, { className: "h-3 w-3" }),
1166
+ /* @__PURE__ */ e("span", { className: "truncate", children: Nt(t, l) })
1235
1167
  ] }),
1236
1168
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
1237
- /* @__PURE__ */ t(ma, { className: "h-3 w-3" }),
1238
- /* @__PURE__ */ t("span", { children: $t(e.updatedAt) })
1169
+ /* @__PURE__ */ e(ua, { className: "h-3 w-3" }),
1170
+ /* @__PURE__ */ e("span", { children: Wt(t.updatedAt) })
1239
1171
  ] })
1240
1172
  ] })
1241
1173
  ]
@@ -1246,63 +1178,63 @@ function $r({
1246
1178
  }
1247
1179
  );
1248
1180
  }
1249
- function ss(e, a, o = !1) {
1250
- const s = D((h) => h.dashboard), i = D(
1251
- (h) => h.isDashboardEditing
1252
- ), n = D(
1253
- (h) => h.onDashboardLifecycleEvent
1254
- ), d = ae(() => {
1255
- const h = D.getState().dashboard;
1256
- return a || !e || !h || h.id !== e.id ? !1 : Pe(h) !== Pe(e);
1257
- }, [e, a]);
1258
- Nt(() => (D.setState({ checkUnsavedDashboardChanges: d }), () => {
1259
- D.getState().checkUnsavedDashboardChanges === d && D.setState({ checkUnsavedDashboardChanges: null });
1260
- }), [d]);
1261
- const c = re(() => !o || a || !s || i && (!e || s.id !== e.id) ? null : {
1181
+ function as(t, a, o = !1) {
1182
+ const s = N((u) => u.dashboard), i = N(
1183
+ (u) => u.isDashboardEditing
1184
+ ), n = N(
1185
+ (u) => u.onDashboardLifecycleEvent
1186
+ ), c = ae(() => {
1187
+ const u = N.getState().dashboard;
1188
+ return a || !t || !u || u.id !== t.id ? !1 : ze(u) !== ze(t);
1189
+ }, [t, a]);
1190
+ kt(() => (N.setState({ checkUnsavedDashboardChanges: c }), () => {
1191
+ N.getState().checkUnsavedDashboardChanges === c && N.setState({ checkUnsavedDashboardChanges: null });
1192
+ }), [c]);
1193
+ const d = re(() => !o || a || !s || i && (!t || s.id !== t.id) ? null : {
1262
1194
  dashboardId: s.id,
1263
- dirty: i && e ? Pe(s) !== Pe(e) : !1
1195
+ dirty: i && t ? ze(s) !== ze(t) : !1
1264
1196
  }, [
1265
1197
  i,
1266
1198
  a,
1267
1199
  o,
1268
- e,
1200
+ t,
1269
1201
  s
1270
- ]), l = rt(null);
1271
- return Nt(() => {
1272
- if (!n || !c) {
1202
+ ]), l = nt(null);
1203
+ return kt(() => {
1204
+ if (!n || !d) {
1273
1205
  l.current = null;
1274
1206
  return;
1275
1207
  }
1276
- const h = l.current;
1277
- (h == null ? void 0 : h.callback) === n && h.dashboardId === c.dashboardId && h.dirty === c.dirty || (l.current = {
1208
+ const u = l.current;
1209
+ (u == null ? void 0 : u.callback) === n && u.dashboardId === d.dashboardId && u.dirty === d.dirty || (l.current = {
1278
1210
  callback: n,
1279
- dashboardId: c.dashboardId,
1280
- dirty: c.dirty
1211
+ dashboardId: d.dashboardId,
1212
+ dirty: d.dirty
1281
1213
  }, n({
1282
1214
  type: "dashboard:dirty-state",
1283
- dashboardId: c.dashboardId,
1284
- payload: { dirty: c.dirty }
1215
+ dashboardId: d.dashboardId,
1216
+ payload: { dirty: d.dirty }
1285
1217
  }));
1286
- }, [c, n]), d;
1218
+ }, [d, n]), c;
1287
1219
  }
1288
- function Wr({
1289
- open: e,
1220
+ function jr({
1221
+ open: t,
1290
1222
  onOpenChange: a,
1291
1223
  isLibraryVisual: o,
1292
1224
  currentVisualName: s,
1293
1225
  isSaving: i = !1,
1294
1226
  destinationMode: n = "both",
1295
- onConfirm: d
1227
+ onConfirm: c
1296
1228
  }) {
1297
- const [c, l] = k(
1229
+ const [d, l] = D(
1298
1230
  o && s ? `Copy of ${s}` : s || ""
1299
- ), [h, u] = k("");
1300
- At.useEffect(() => {
1301
- e && (l(
1231
+ ), [u, h] = D("");
1232
+ Et.useEffect(() => {
1233
+ t && (l(
1302
1234
  o && s ? `Copy of ${s}` : s || ""
1303
- ), u(""));
1304
- }, [e, o, s]);
1305
- const m = !!c.trim(), p = n === "local" ? {
1235
+ ), h(""));
1236
+ }, [t, o, s]);
1237
+ const m = !!d.trim(), p = n === "local" ? {
1306
1238
  saveToLibrary: !1,
1307
1239
  saveToCurrentDashboard: !0,
1308
1240
  badgeType: "local",
@@ -1321,19 +1253,19 @@ function Wr({
1321
1253
  description: "Creates a new library visual and adds a linked copy to this dashboard.",
1322
1254
  actionLabel: "Save Copy as Linked Visual"
1323
1255
  }, g = () => {
1324
- !m || i || d({
1325
- name: c.trim(),
1326
- description: h.trim() || void 0,
1256
+ !m || i || c({
1257
+ name: d.trim(),
1258
+ description: u.trim() || void 0,
1327
1259
  saveToLibrary: p.saveToLibrary,
1328
1260
  saveToCurrentDashboard: p.saveToCurrentDashboard
1329
1261
  });
1330
1262
  };
1331
- return /* @__PURE__ */ t(Ae, { open: e, onOpenChange: a, children: /* @__PURE__ */ r(Fe, { className: "sm:max-w-[500px]", children: [
1263
+ return /* @__PURE__ */ e(Fe, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(Ee, { className: "sm:max-w-[500px]", children: [
1332
1264
  /* @__PURE__ */ r(gt, { children: [
1333
1265
  /* @__PURE__ */ r(Ie, { className: "flex items-center gap-2", children: [
1334
- /* @__PURE__ */ t("span", { children: "Save Visual As" }),
1335
- p.badgeType !== "local" && /* @__PURE__ */ t(
1336
- mr,
1266
+ /* @__PURE__ */ e("span", { children: "Save Visual As" }),
1267
+ p.badgeType !== "local" && /* @__PURE__ */ e(
1268
+ pr,
1337
1269
  {
1338
1270
  type: p.badgeType,
1339
1271
  showLabel: !0,
@@ -1341,16 +1273,16 @@ function Wr({
1341
1273
  }
1342
1274
  )
1343
1275
  ] }),
1344
- /* @__PURE__ */ t(bt, { children: p.description })
1276
+ /* @__PURE__ */ e(bt, { children: p.description })
1345
1277
  ] }),
1346
1278
  /* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
1347
1279
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
1348
- /* @__PURE__ */ t(De, { htmlFor: "name", children: "Name" }),
1349
- /* @__PURE__ */ t(
1350
- nt,
1280
+ /* @__PURE__ */ e(De, { htmlFor: "name", children: "Name" }),
1281
+ /* @__PURE__ */ e(
1282
+ st,
1351
1283
  {
1352
1284
  id: "name",
1353
- value: c,
1285
+ value: d,
1354
1286
  onChange: (f) => l(f.target.value),
1355
1287
  placeholder: "Enter visual name",
1356
1288
  disabled: i
@@ -1358,13 +1290,13 @@ function Wr({
1358
1290
  )
1359
1291
  ] }),
1360
1292
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
1361
- /* @__PURE__ */ t(De, { htmlFor: "description", children: "Description (optional)" }),
1362
- /* @__PURE__ */ t(
1363
- pa,
1293
+ /* @__PURE__ */ e(De, { htmlFor: "description", children: "Description (optional)" }),
1294
+ /* @__PURE__ */ e(
1295
+ ha,
1364
1296
  {
1365
1297
  id: "description",
1366
- value: h,
1367
- onChange: (f) => u(f.target.value),
1298
+ value: u,
1299
+ onChange: (f) => h(f.target.value),
1368
1300
  placeholder: "Enter visual description",
1369
1301
  rows: 3,
1370
1302
  disabled: i
@@ -1372,8 +1304,8 @@ function Wr({
1372
1304
  )
1373
1305
  ] })
1374
1306
  ] }),
1375
- /* @__PURE__ */ r(fa, { children: [
1376
- /* @__PURE__ */ t(
1307
+ /* @__PURE__ */ r(ma, { children: [
1308
+ /* @__PURE__ */ e(
1377
1309
  L,
1378
1310
  {
1379
1311
  variant: "outline",
@@ -1383,60 +1315,60 @@ function Wr({
1383
1315
  }
1384
1316
  ),
1385
1317
  /* @__PURE__ */ r(L, { onClick: g, disabled: !m || i, children: [
1386
- i && /* @__PURE__ */ t(ne, { className: "mr-2 h-4 w-4 animate-spin" }),
1318
+ i && /* @__PURE__ */ e(ne, { className: "mr-2 h-4 w-4 animate-spin" }),
1387
1319
  p.actionLabel
1388
1320
  ] })
1389
1321
  ] })
1390
1322
  ] }) });
1391
1323
  }
1392
- function wt(e) {
1324
+ function St(t) {
1393
1325
  var a;
1394
- for (const o of e.cards)
1395
- if (o.type === "matrixTable" && !rr.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
1396
- return E.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
1326
+ for (const o of t.cards)
1327
+ if (o.type === "matrixTable" && !ar.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
1328
+ return F.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
1397
1329
  return !0;
1398
1330
  }
1399
- function et({
1400
- className: e,
1331
+ function tt({
1332
+ className: t,
1401
1333
  variant: a = "outline"
1402
1334
  }) {
1403
1335
  const o = ee((n) => n.onSave), { getUpdatedFrame: s } = ve();
1404
1336
  function i() {
1405
1337
  const n = s();
1406
- wt(n) && (o == null || o(n));
1338
+ St(n) && (o == null || o(n));
1407
1339
  }
1408
1340
  return /* @__PURE__ */ r(
1409
1341
  L,
1410
1342
  {
1411
1343
  onClick: i,
1412
- className: e,
1344
+ className: t,
1413
1345
  size: "xs",
1414
1346
  variant: a,
1415
1347
  children: [
1416
- /* @__PURE__ */ t(st, { className: "h-3.5 w-3.5" }),
1348
+ /* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" }),
1417
1349
  "Done"
1418
1350
  ]
1419
1351
  }
1420
1352
  );
1421
1353
  }
1422
- function qr({
1423
- className: e,
1354
+ function $r({
1355
+ className: t,
1424
1356
  variant: a = "default"
1425
1357
  }) {
1426
- const o = $e(), [s, i] = k(!1), { setIsVisualEditing: n } = de(), { getUpdatedFrame: d } = ve(), c = We(), l = ee((m) => m.frame), h = Bt();
1427
- return /* @__PURE__ */ t(
1358
+ const o = Qe(), [s, i] = D(!1), { setIsVisualEditing: n } = de(), { getUpdatedFrame: c } = ve(), d = Ge(), l = ee((m) => m.frame), u = Bt();
1359
+ return /* @__PURE__ */ e(
1428
1360
  L,
1429
1361
  {
1430
1362
  onClick: () => {
1431
- const m = d();
1432
- if (!wt(m))
1363
+ const m = c();
1364
+ if (!St(m))
1433
1365
  return;
1434
- const p = (l == null ? void 0 : l.visualId) || (c == null ? void 0 : c.id);
1366
+ const p = (l == null ? void 0 : l.visualId) || (d == null ? void 0 : d.id);
1435
1367
  if (!p) {
1436
- E.error("No visual to save");
1368
+ F.error("No visual to save");
1437
1369
  return;
1438
1370
  }
1439
- i(!0), h.mutate(
1371
+ i(!0), u.mutate(
1440
1372
  {
1441
1373
  visualId: p,
1442
1374
  data: {
@@ -1445,149 +1377,148 @@ function qr({
1445
1377
  },
1446
1378
  {
1447
1379
  onSuccess: () => {
1448
- i(!1), E.success("Visual updated successfully"), o.invalidateQueries({
1380
+ i(!1), F.success("Visual updated successfully"), o.invalidateQueries({
1449
1381
  queryKey: ["resource-by-id", "visual", p],
1450
1382
  exact: !0
1451
1383
  });
1452
1384
  },
1453
1385
  onError: () => {
1454
- i(!1), E.error("Failed to update visual");
1386
+ i(!1), F.error("Failed to update visual");
1455
1387
  }
1456
1388
  }
1457
1389
  );
1458
1390
  },
1459
- className: e,
1391
+ className: t,
1460
1392
  size: "xs",
1461
1393
  variant: a,
1462
- children: s ? /* @__PURE__ */ r(_, { children: [
1463
- /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }),
1394
+ children: s ? /* @__PURE__ */ r(O, { children: [
1395
+ /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }),
1464
1396
  "Saving"
1465
- ] }) : /* @__PURE__ */ r(_, { children: [
1466
- /* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" }),
1397
+ ] }) : /* @__PURE__ */ r(O, { children: [
1398
+ /* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
1467
1399
  "Save to Library"
1468
1400
  ] })
1469
1401
  }
1470
1402
  );
1471
1403
  }
1472
- function Qr({
1473
- className: e
1404
+ function Wr({
1405
+ className: t
1474
1406
  }) {
1475
- const a = $e(), [o, s] = k(!1), i = We(), n = ee((f) => f.frame), d = D((f) => f.selectedSheetId), c = D((f) => f.dashboard), { updateFrame: l, setIsVisualEditing: h } = de(), { getUpdatedFrame: u } = ve(), m = Bt(), p = xt();
1476
- return /* @__PURE__ */ t(
1407
+ const a = Qe(), [o, s] = D(!1), i = Ge(), n = ee((f) => f.frame), c = N((f) => f.selectedSheetId), d = N((f) => f.dashboard), { updateFrame: l, setIsVisualEditing: u } = de(), { getUpdatedFrame: h } = ve(), m = Bt(), p = xt();
1408
+ return /* @__PURE__ */ e(
1477
1409
  L,
1478
1410
  {
1479
1411
  onClick: async () => {
1480
- if (!d) {
1481
- E.error("No sheet selected");
1412
+ if (!c) {
1413
+ F.error("No sheet selected");
1482
1414
  return;
1483
1415
  }
1484
1416
  const f = (n == null ? void 0 : n.visualId) || (i == null ? void 0 : i.id);
1485
1417
  if (!f) {
1486
- E.error("No visual to update");
1418
+ F.error("No visual to update");
1487
1419
  return;
1488
1420
  }
1489
1421
  s(!0);
1490
1422
  try {
1491
- const v = u();
1492
- if (!wt(v)) {
1423
+ const v = h();
1424
+ if (!St(v)) {
1493
1425
  s(!1);
1494
1426
  return;
1495
1427
  }
1496
- const N = {
1428
+ const k = {
1497
1429
  ...v,
1498
1430
  visualId: f
1499
1431
  // Keep the link to library visual
1500
- }, T = je(c, N.id), U = await p(N, {
1501
- previousFrame: T
1432
+ }, V = He(d, k.id), M = await p(k, {
1433
+ previousFrame: V
1502
1434
  });
1503
1435
  await m.mutateAsync({
1504
1436
  visualId: f,
1505
1437
  data: {
1506
1438
  frameObject: v
1507
1439
  }
1508
- }), l(d, N, {
1509
- semanticExecutionPayload: U
1510
- }), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", f] }), E.success("Saved to library and applied locally"), setTimeout(() => {
1511
- h(!1);
1440
+ }), l(c, k, {
1441
+ semanticExecutionPayload: M
1442
+ }), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", f] }), F.success("Saved to library and applied locally"), setTimeout(() => {
1443
+ u(!1);
1512
1444
  }, 300);
1513
1445
  } catch (v) {
1514
- console.error("Failed to save and apply:", v), E.error(
1446
+ console.error("Failed to save and apply:", v), F.error(
1515
1447
  v instanceof Error ? v.message : "Failed to save and apply changes"
1516
1448
  );
1517
1449
  } finally {
1518
1450
  s(!1);
1519
1451
  }
1520
1452
  },
1521
- className: e,
1453
+ className: t,
1522
1454
  size: "xs",
1523
1455
  variant: "default",
1524
1456
  disabled: o,
1525
- children: o ? /* @__PURE__ */ r(_, { children: [
1526
- /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }),
1457
+ children: o ? /* @__PURE__ */ r(O, { children: [
1458
+ /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin" }),
1527
1459
  "Saving..."
1528
- ] }) : /* @__PURE__ */ r(_, { children: [
1529
- /* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" }),
1460
+ ] }) : /* @__PURE__ */ r(O, { children: [
1461
+ /* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
1530
1462
  "Save & Apply"
1531
1463
  ] })
1532
1464
  }
1533
1465
  );
1534
1466
  }
1535
- function tt({ className: e }) {
1536
- const { setTempQueryData: a, setSqlGen: o } = qe(), s = $e(), i = ee((c) => c.tempQueryData), n = ee((c) => c.onClose);
1537
- function d() {
1467
+ function at({ className: t }) {
1468
+ const { setTempQueryData: a, setSqlGen: o } = Ke(), s = Qe(), i = ee((d) => d.tempQueryData), n = ee((d) => d.onClose);
1469
+ function c() {
1538
1470
  if (i) {
1539
- const { queryKey: c, queryData: l } = i;
1540
- c && l && s.setQueryData(c, l);
1471
+ const { queryKey: d, queryData: l } = i;
1472
+ d && l && s.setQueryData(d, l);
1541
1473
  }
1542
1474
  o({}), n == null || n();
1543
1475
  }
1544
1476
  return /* @__PURE__ */ r(
1545
1477
  L,
1546
1478
  {
1547
- onClick: d,
1548
- className: e,
1479
+ onClick: c,
1480
+ className: t,
1549
1481
  size: "xs",
1550
1482
  variant: "outline",
1551
1483
  children: [
1552
- /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5" }),
1484
+ /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" }),
1553
1485
  "Close"
1554
1486
  ]
1555
1487
  }
1556
1488
  );
1557
1489
  }
1558
- function Hr() {
1559
- const [e, a] = k(!1), [o, s] = k(!1), [i, n] = k(null), [d, c] = k(null), l = ee((w) => w.frame), h = ee((w) => w.card), u = We(), m = D((w) => w.selectedSheetId), p = D((w) => w.dashboard), { getUpdatedFrame: g } = ve(), { selectVisual: f } = it(), { addFrame: v, setSelectedFrameId: N, setIsVisualEditing: T } = de(), U = xt(), M = !!(l != null && l.visualId), A = (() => {
1490
+ function qr() {
1491
+ const [t, a] = D(!1), [o, s] = D(!1), [i, n] = D(null), [c, d] = D(null), l = ee((w) => w.frame), u = ee((w) => w.card), h = Ge(), m = N((w) => w.selectedSheetId), p = N((w) => w.dashboard), { getUpdatedFrame: g } = ve(), { selectVisual: f } = it(), { addFrame: v, setSelectedFrameId: k, setIsVisualEditing: V } = de(), M = xt(), U = !!(l != null && l.visualId), A = (() => {
1560
1492
  var w, x;
1561
- return ((w = l == null ? void 0 : l.cards) == null ? void 0 : w.length) === 1 && ((x = l.cards[0]) != null && x.title) ? l.cards[0].title : u != null && u.title ? u.title : (h == null ? void 0 : h.title) || "Untitled Visual";
1562
- })(), O = ga((w) => {
1563
- w != null && w.id && (f(w), o && i && d && m && (async () => {
1493
+ return ((w = l == null ? void 0 : l.cards) == null ? void 0 : w.length) === 1 && ((x = l.cards[0]) != null && x.title) ? l.cards[0].title : h != null && h.title ? h.title : (u == null ? void 0 : u.title) || "Untitled Visual";
1494
+ })(), z = pa((w) => {
1495
+ w != null && w.id && (f(w), o && i && c && m && (async () => {
1564
1496
  try {
1565
1497
  const x = {
1566
1498
  ...i,
1567
- id: St(),
1499
+ id: Dt(),
1568
1500
  visualId: w.id
1569
1501
  // Link to the newly created library visual
1570
1502
  };
1571
1503
  v(m, x, {
1572
- placement: "end",
1573
- semanticExecutionPayload: d
1574
- }), N(x.id), s(!1), n(null), c(null), T(!1);
1504
+ semanticExecutionPayload: c
1505
+ }), k(x.id), s(!1), n(null), d(null), V(!1);
1575
1506
  } catch (x) {
1576
1507
  console.error(
1577
1508
  "Failed to promote semantic metadata for saved visual:",
1578
1509
  x
1579
- ), E.error(
1510
+ ), F.error(
1580
1511
  x instanceof Error ? x.message : "Failed to prepare semantic metadata for the saved visual"
1581
1512
  );
1582
1513
  }
1583
1514
  })(), a(!1));
1584
1515
  });
1585
1516
  return {
1586
- saveAsDialogOpen: e,
1517
+ saveAsDialogOpen: t,
1587
1518
  setSaveAsDialogOpen: a,
1588
1519
  handleSaveAs: async (w) => {
1589
1520
  if (!m) {
1590
- E.error("No sheet selected");
1521
+ F.error("No sheet selected");
1591
1522
  return;
1592
1523
  }
1593
1524
  const x = g(), S = x.cards.length === 1 ? {
@@ -1602,19 +1533,19 @@ function Hr() {
1602
1533
  let j = null;
1603
1534
  if (w.saveToCurrentDashboard)
1604
1535
  try {
1605
- j = await U(S, {
1606
- previousFrame: je(p, S.id)
1536
+ j = await M(S, {
1537
+ previousFrame: He(p, S.id)
1607
1538
  });
1608
- } catch (V) {
1539
+ } catch (T) {
1609
1540
  console.error(
1610
1541
  "Failed to prepare semantic metadata before saving visual:",
1611
- V
1612
- ), E.error(
1613
- V instanceof Error ? V.message : "Failed to prepare semantic metadata for the saved visual"
1542
+ T
1543
+ ), F.error(
1544
+ T instanceof Error ? T.message : "Failed to prepare semantic metadata for the saved visual"
1614
1545
  );
1615
1546
  return;
1616
1547
  }
1617
- s(w.saveToCurrentDashboard), n(S), c(j);
1548
+ s(w.saveToCurrentDashboard), n(S), d(j);
1618
1549
  const I = {
1619
1550
  title: w.name,
1620
1551
  description: w.description,
@@ -1622,156 +1553,155 @@ function Hr() {
1622
1553
  // Card title synced for single-card frames
1623
1554
  isPrivate: !1
1624
1555
  };
1625
- O.mutate(I);
1556
+ z.mutate(I);
1626
1557
  } else if (w.saveToCurrentDashboard) {
1627
1558
  const j = {
1628
1559
  ...S,
1629
1560
  // Card title already synced
1630
- id: St(),
1561
+ id: Dt(),
1631
1562
  visualId: void 0
1632
1563
  // Explicitly no visualId for local visuals
1633
1564
  };
1634
1565
  try {
1635
- const I = await U(S, {
1636
- previousFrame: je(p, S.id)
1566
+ const I = await M(S, {
1567
+ previousFrame: He(p, S.id)
1637
1568
  });
1638
1569
  v(m, j, {
1639
- placement: "end",
1640
1570
  semanticExecutionPayload: I
1641
- }), N(j.id), E.success("Visual saved to dashboard"), a(!1), T(!1);
1571
+ }), k(j.id), F.success("Visual saved to dashboard"), a(!1), V(!1);
1642
1572
  } catch (I) {
1643
- console.error("Failed to save visual to dashboard:", I), E.error(
1573
+ console.error("Failed to save visual to dashboard:", I), F.error(
1644
1574
  I instanceof Error ? I.message : "Failed to prepare semantic metadata for the visual"
1645
1575
  );
1646
1576
  }
1647
1577
  }
1648
1578
  },
1649
- isLibraryVisual: M,
1579
+ isLibraryVisual: U,
1650
1580
  currentVisualName: A,
1651
- isSaving: O.isPending
1581
+ isSaving: z.isPending
1652
1582
  };
1653
1583
  }
1654
- function os(e = {}) {
1655
- const { isInspectionMode: a } = ba(), o = ee((I) => I.frame), s = ee((I) => I.editorContext), i = xa((I) => I.selectedVisual), n = D((I) => I.selectedFrameId), d = D((I) => I.selectedSheetId), c = D((I) => I.dashboard), { setIsVisualEditing: l, updateFrame: h } = de(), [u, m] = k(!1), [p, g] = k("both"), f = xt(), v = (s == null ? void 0 : s.type) === "documentSection", N = !!(o != null && o.visualId || i != null && i.id), T = !!(o != null && o.visualId && n), U = N && !T, {
1656
- saveAsDialogOpen: M,
1584
+ function rs(t = {}) {
1585
+ const { isInspectionMode: a } = fa(), o = ee((I) => I.frame), s = ee((I) => I.editorContext), i = ga((I) => I.selectedVisual), n = N((I) => I.selectedFrameId), c = N((I) => I.selectedSheetId), d = N((I) => I.dashboard), { setIsVisualEditing: l, updateFrame: u } = de(), [h, m] = D(!1), [p, g] = D("both"), f = xt(), v = (s == null ? void 0 : s.type) === "documentSection", k = !!(o != null && o.visualId || i != null && i.id), V = !!(o != null && o.visualId && n), M = k && !V, {
1586
+ saveAsDialogOpen: U,
1657
1587
  setSaveAsDialogOpen: A,
1658
- handleSaveAs: O,
1588
+ handleSaveAs: z,
1659
1589
  isLibraryVisual: C,
1660
1590
  currentVisualName: w,
1661
1591
  isSaving: x
1662
- } = Hr(), { getUpdatedFrame: F } = ve();
1592
+ } = qr(), { getUpdatedFrame: E } = ve();
1663
1593
  if (a)
1664
- return /* @__PURE__ */ r(_, { children: [
1665
- /* @__PURE__ */ t(
1666
- et,
1594
+ return /* @__PURE__ */ r(O, { children: [
1595
+ /* @__PURE__ */ e(
1596
+ tt,
1667
1597
  {
1668
1598
  className: "rounded-control",
1669
1599
  variant: "default"
1670
1600
  }
1671
1601
  ),
1672
- /* @__PURE__ */ t(tt, {})
1602
+ /* @__PURE__ */ e(at, {})
1673
1603
  ] });
1674
1604
  if (v)
1675
- return /* @__PURE__ */ r(_, { children: [
1676
- /* @__PURE__ */ t(et, { className: "rounded-control", variant: "default" }),
1677
- /* @__PURE__ */ t(tt, {})
1605
+ return /* @__PURE__ */ r(O, { children: [
1606
+ /* @__PURE__ */ e(tt, { className: "rounded-control", variant: "default" }),
1607
+ /* @__PURE__ */ e(at, {})
1678
1608
  ] });
1679
1609
  const S = async () => {
1680
- if (!d) {
1681
- E.error("No sheet selected");
1610
+ if (!c) {
1611
+ F.error("No sheet selected");
1682
1612
  return;
1683
1613
  }
1684
- if (u) return;
1614
+ if (h) return;
1685
1615
  m(!0);
1686
- const V = {
1687
- ...F(),
1616
+ const T = {
1617
+ ...E(),
1688
1618
  visualId: void 0
1689
- }, Z = je(c, V.id);
1619
+ }, Z = He(d, T.id);
1690
1620
  try {
1691
- const K = await f(V, {
1621
+ const G = await f(T, {
1692
1622
  previousFrame: Z
1693
1623
  });
1694
- h(d, V, {
1695
- semanticExecutionPayload: K
1624
+ u(c, T, {
1625
+ semanticExecutionPayload: G
1696
1626
  });
1697
- } catch (K) {
1698
- console.error("Failed to apply local semantic metadata:", K), m(!1), E.error(
1699
- K instanceof Error ? K.message : "Failed to prepare semantic metadata for this visual"
1627
+ } catch (G) {
1628
+ console.error("Failed to apply local semantic metadata:", G), m(!1), F.error(
1629
+ G instanceof Error ? G.message : "Failed to prepare semantic metadata for this visual"
1700
1630
  );
1701
1631
  return;
1702
1632
  }
1703
1633
  setTimeout(() => {
1704
- m(!1), E.success("Changes applied. Visual is now local to this dashboard"), l(!1);
1634
+ m(!1), F.success("Changes applied. Visual is now local to this dashboard"), l(!1);
1705
1635
  }, 300);
1706
1636
  }, j = (I) => {
1707
1637
  g(I), A(!0);
1708
1638
  };
1709
- return /* @__PURE__ */ r(_, { children: [
1639
+ return /* @__PURE__ */ r(O, { children: [
1710
1640
  /* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
1711
- !N && /* @__PURE__ */ t(et, { className: "!rounded-none", variant: "default" }),
1712
- N && U && /* @__PURE__ */ t(qr, { className: "!rounded-none", variant: "default" }),
1713
- N && T && /* @__PURE__ */ t(Qr, { className: "!rounded-none" }),
1714
- /* @__PURE__ */ r(Qe, { modal: !1, children: [
1715
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ t(
1641
+ !k && /* @__PURE__ */ e(tt, { className: "!rounded-none", variant: "default" }),
1642
+ k && M && /* @__PURE__ */ e($r, { className: "!rounded-none", variant: "default" }),
1643
+ k && V && /* @__PURE__ */ e(Wr, { className: "!rounded-none" }),
1644
+ /* @__PURE__ */ r(Le, { modal: !1, children: [
1645
+ /* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
1716
1646
  L,
1717
1647
  {
1718
1648
  variant: "default",
1719
1649
  size: "xs",
1720
1650
  className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
1721
1651
  "aria-label": "Open visual save options",
1722
- disabled: x || u,
1723
- children: /* @__PURE__ */ t(Rt, { className: "h-3.5 w-3.5" })
1652
+ disabled: x || h,
1653
+ children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
1724
1654
  }
1725
1655
  ) }),
1726
1656
  /* @__PURE__ */ r(
1727
- Ke,
1657
+ Te,
1728
1658
  {
1729
1659
  align: "end",
1730
1660
  className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
1731
1661
  children: [
1732
- T && /* @__PURE__ */ r(_, { children: [
1662
+ V && /* @__PURE__ */ r(O, { children: [
1733
1663
  /* @__PURE__ */ r(
1734
- Y,
1664
+ X,
1735
1665
  {
1736
1666
  onClick: S,
1737
- disabled: u,
1667
+ disabled: h,
1738
1668
  children: [
1739
- /* @__PURE__ */ t(st, { className: "h-3.5 w-3.5" }),
1740
- u ? "Applying..." : "Apply Locally"
1669
+ /* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" }),
1670
+ h ? "Applying..." : "Apply Locally"
1741
1671
  ]
1742
1672
  }
1743
1673
  ),
1744
- /* @__PURE__ */ t(ze, {})
1674
+ /* @__PURE__ */ e(je, {})
1745
1675
  ] }),
1746
1676
  /* @__PURE__ */ r(
1747
- Y,
1677
+ X,
1748
1678
  {
1749
1679
  onClick: () => j("local"),
1750
1680
  disabled: x,
1751
1681
  children: [
1752
- /* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" }),
1682
+ /* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5" }),
1753
1683
  "Add to Dashboard (Local)"
1754
1684
  ]
1755
1685
  }
1756
1686
  ),
1757
1687
  /* @__PURE__ */ r(
1758
- Y,
1688
+ X,
1759
1689
  {
1760
1690
  onClick: () => j("library"),
1761
1691
  disabled: x,
1762
1692
  children: [
1763
- /* @__PURE__ */ t(pr, { className: "h-3.5 w-3.5" }),
1693
+ /* @__PURE__ */ e(fr, { className: "h-3.5 w-3.5" }),
1764
1694
  "Save as Library Visual"
1765
1695
  ]
1766
1696
  }
1767
1697
  ),
1768
1698
  /* @__PURE__ */ r(
1769
- Y,
1699
+ X,
1770
1700
  {
1771
1701
  onClick: () => j("both"),
1772
1702
  disabled: x,
1773
1703
  children: [
1774
- /* @__PURE__ */ t(fr, { className: "h-3.5 w-3.5" }),
1704
+ /* @__PURE__ */ e(gr, { className: "h-3.5 w-3.5" }),
1775
1705
  "Save Copy as Linked Visual"
1776
1706
  ]
1777
1707
  }
@@ -1781,11 +1711,11 @@ function os(e = {}) {
1781
1711
  )
1782
1712
  ] })
1783
1713
  ] }),
1784
- /* @__PURE__ */ t(tt, {}),
1785
- /* @__PURE__ */ t(
1786
- Wr,
1714
+ /* @__PURE__ */ e(at, {}),
1715
+ /* @__PURE__ */ e(
1716
+ jr,
1787
1717
  {
1788
- open: M,
1718
+ open: U,
1789
1719
  onOpenChange: (I) => {
1790
1720
  x || A(I);
1791
1721
  },
@@ -1793,55 +1723,137 @@ function os(e = {}) {
1793
1723
  currentVisualName: w,
1794
1724
  isSaving: x,
1795
1725
  destinationMode: p,
1796
- onConfirm: O
1726
+ onConfirm: z
1797
1727
  }
1798
1728
  )
1799
1729
  ] });
1800
1730
  }
1801
- function is({ className: e }) {
1802
- const a = ee((u) => u.isDevMode), o = ee((u) => u.card.type), s = D((u) => u.isVisualEditing), { setIsDevMode: i } = qe(), { config: n } = Kt(va).tokenProps, d = (n == null ? void 0 : n.showAdvancedMode) !== !1;
1803
- if (!s || !d || !Gt(o))
1731
+ function ns({ className: t }) {
1732
+ const a = ee((h) => h.isDevMode), o = ee((h) => h.card.type), s = N((h) => h.isVisualEditing), { setIsDevMode: i } = Ke(), { config: n } = Kt(ba).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
1733
+ if (!s || !c || !or(o))
1804
1734
  return null;
1805
- const c = a ? Dr : kr, l = a ? "Visual editor" : "SQL editor", h = a ? "Switch to visual editor" : "Switch to SQL editor";
1735
+ const d = a ? Fr : Dr, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
1806
1736
  return /* @__PURE__ */ r(
1807
1737
  "button",
1808
1738
  {
1809
1739
  type: "button",
1810
- "aria-label": h,
1811
- title: h,
1740
+ "aria-label": u,
1741
+ title: u,
1812
1742
  onClick: () => i(!a),
1813
1743
  className: J(
1814
1744
  "inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
1815
- e
1745
+ t
1816
1746
  ),
1817
1747
  children: [
1818
- /* @__PURE__ */ t(c, { className: "h-3 w-3 text-muted-foreground" }),
1748
+ /* @__PURE__ */ e(d, { className: "h-3 w-3 text-muted-foreground" }),
1819
1749
  l
1820
1750
  ]
1821
1751
  }
1822
1752
  );
1823
1753
  }
1824
- function ls({
1825
- open: e,
1754
+ function ss() {
1755
+ const t = N((d) => d.isDashboardEditing), a = N((d) => d.isVisualEditing), o = N((d) => {
1756
+ var u;
1757
+ const l = ((u = d.dashboard) == null ? void 0 : u.sheets) ?? [];
1758
+ return l.find((h) => h.id === d.selectedSheetId) ?? l[0];
1759
+ }), s = N((d) => d.actions.arrangeSheet), i = N((d) => d.actions.undoArrange);
1760
+ if (!t || a || !o || wt(o)) return null;
1761
+ const n = !(o.frames ?? []).length, c = (d) => {
1762
+ const l = s(o.id, { keepOrder: d });
1763
+ if (!l.ok) {
1764
+ F.error(l.reason === "not_a_grid" ? "This sheet has no grid to arrange." : "The dashboard can't be arranged right now.");
1765
+ return;
1766
+ }
1767
+ F("Arranged", {
1768
+ // Long enough to reach Undo after looking at the result; the default 4 seconds isn't.
1769
+ duration: 1e4,
1770
+ description: d ? "Sizes and gaps fixed on every screen size, in your order." : "KPIs on top, charts in pairs, tables full width, on every screen size.",
1771
+ action: {
1772
+ label: "Undo",
1773
+ onClick: () => {
1774
+ const u = i();
1775
+ !u.ok && u.reason === "changed_since" && F.info("The dashboard changed after Arrange, so it can't be undone from here.");
1776
+ }
1777
+ }
1778
+ });
1779
+ };
1780
+ return /* @__PURE__ */ r("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
1781
+ /* @__PURE__ */ r(
1782
+ L,
1783
+ {
1784
+ variant: "ghost",
1785
+ size: "xs",
1786
+ disabled: n,
1787
+ title: n ? "This sheet has no cards to arrange" : "Lay out the cards by kind on every screen size",
1788
+ onClick: () => c(!1),
1789
+ className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
1790
+ children: [
1791
+ /* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5" }),
1792
+ "Arrange"
1793
+ ]
1794
+ }
1795
+ ),
1796
+ /* @__PURE__ */ r(Le, { modal: !1, children: [
1797
+ /* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
1798
+ L,
1799
+ {
1800
+ variant: "ghost",
1801
+ size: "xs",
1802
+ disabled: n,
1803
+ className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
1804
+ "aria-label": "Open arrange options",
1805
+ children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
1806
+ }
1807
+ ) }),
1808
+ /* @__PURE__ */ e(Te, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ r(X, { onClick: () => c(!0), children: [
1809
+ /* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5" }),
1810
+ "Keep my order"
1811
+ ] }) })
1812
+ ] })
1813
+ ] });
1814
+ }
1815
+ function os() {
1816
+ const t = N((s) => s.screenSizesOpen), a = N((s) => {
1817
+ var c, d;
1818
+ const i = ((c = s.dashboard) == null ? void 0 : c.sheets) ?? [], n = i.find((l) => l.id === s.selectedSheetId) ?? i[0];
1819
+ return !!n && !wt(n) && !!((d = n.frames) != null && d.length);
1820
+ }), o = N((s) => s.actions.setScreenSizesOpen);
1821
+ return a ? /* @__PURE__ */ e(
1822
+ L,
1823
+ {
1824
+ type: "button",
1825
+ size: "xs",
1826
+ variant: t ? "secondary" : "ghost",
1827
+ "aria-pressed": t,
1828
+ "aria-label": "Screen sizes",
1829
+ title: "Screen sizes",
1830
+ onClick: () => o(!t),
1831
+ className: "px-1.5",
1832
+ children: /* @__PURE__ */ e(Ar, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
1833
+ }
1834
+ ) : null;
1835
+ }
1836
+ function is({
1837
+ open: t,
1826
1838
  onOpenChange: a,
1827
1839
  onSave: o,
1828
1840
  onDiscard: s,
1829
1841
  isSaving: i,
1830
1842
  title: n = "Unsaved changes",
1831
- description: d = "You have unsaved changes to this dashboard. What would you like to do?",
1832
- cancelLabel: c = "Cancel",
1843
+ description: c = "You have unsaved changes to this dashboard. What would you like to do?",
1844
+ cancelLabel: d = "Cancel",
1833
1845
  discardLabel: l = "Discard changes",
1834
- saveLabel: h = "Save"
1846
+ saveLabel: u = "Save"
1835
1847
  }) {
1836
- return /* @__PURE__ */ t(lt, { open: e, onOpenChange: (m) => {
1848
+ return /* @__PURE__ */ e(lt, { open: t, onOpenChange: (m) => {
1837
1849
  !m && i || a(m);
1838
1850
  }, children: /* @__PURE__ */ r(dt, { children: [
1839
1851
  /* @__PURE__ */ r(ct, { children: [
1840
- /* @__PURE__ */ t(ut, { children: n }),
1841
- /* @__PURE__ */ t(ht, { children: d })
1852
+ /* @__PURE__ */ e(ut, { children: n }),
1853
+ /* @__PURE__ */ e(ht, { children: c })
1842
1854
  ] }),
1843
1855
  /* @__PURE__ */ r(mt, { children: [
1844
- /* @__PURE__ */ t(
1856
+ /* @__PURE__ */ e(
1845
1857
  L,
1846
1858
  {
1847
1859
  type: "button",
@@ -1853,20 +1865,20 @@ function ls({
1853
1865
  children: l
1854
1866
  }
1855
1867
  ),
1856
- /* @__PURE__ */ t(pt, { disabled: i, children: c }),
1857
- /* @__PURE__ */ t(L, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r(_, { children: [
1858
- /* @__PURE__ */ t(ne, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1868
+ /* @__PURE__ */ e(pt, { disabled: i, children: d }),
1869
+ /* @__PURE__ */ e(L, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r(O, { children: [
1870
+ /* @__PURE__ */ e(ne, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1859
1871
  "Saving..."
1860
- ] }) : h })
1872
+ ] }) : u })
1861
1873
  ] })
1862
1874
  ] }) });
1863
1875
  }
1864
- async function ds(e) {
1865
- var n, d;
1866
- const a = (d = (n = D.getState()) == null ? void 0 : n.authToken) == null ? void 0 : d.accessToken;
1876
+ async function ls(t) {
1877
+ var n, c;
1878
+ const a = (c = (n = N.getState()) == null ? void 0 : n.authToken) == null ? void 0 : c.accessToken;
1867
1879
  if (!a)
1868
1880
  return;
1869
- const o = `${e}/v1/invalidate-token`, s = await fetch(o, {
1881
+ const o = `${t}/v1/invalidate-token`, s = await fetch(o, {
1870
1882
  method: "POST",
1871
1883
  headers: {
1872
1884
  Authorization: `Bearer ${a}`
@@ -1877,128 +1889,128 @@ async function ds(e) {
1877
1889
  const i = await s.json();
1878
1890
  return console.log("invalidateToken", i), i;
1879
1891
  }
1880
- function Kr(e) {
1881
- switch (e == null ? void 0 : e.kind) {
1892
+ function Hr(t) {
1893
+ switch (t == null ? void 0 : t.kind) {
1882
1894
  case "queued":
1883
- return { text: G.queued };
1895
+ return { text: K.queued };
1884
1896
  case "preparing":
1885
- return { text: G.preparing };
1897
+ return { text: K.preparing };
1886
1898
  case "fetching":
1887
- return { text: G.fetchingRows(e.rowsProcessed) };
1899
+ return { text: K.fetchingRows(t.rowsProcessed) };
1888
1900
  case "finalizing":
1889
- return { text: G.finalizing };
1901
+ return { text: K.finalizing };
1890
1902
  case "processing":
1891
- return e.percent === null ? { text: G.processing } : { text: G.processing, detail: G.percentComplete(e.percent), bar: e.percent };
1903
+ return t.percent === null ? { text: K.processing } : { text: K.processing, detail: K.percentComplete(t.percent), bar: t.percent };
1892
1904
  default:
1893
- return { text: G.inProgress };
1905
+ return { text: K.inProgress };
1894
1906
  }
1895
1907
  }
1896
- function Gr(e) {
1908
+ function Qr(t) {
1897
1909
  var o;
1898
- const a = e.item;
1910
+ const a = t.item;
1899
1911
  return a.kind === "export" ? {
1900
1912
  title: a.title,
1901
1913
  status: a.status,
1902
1914
  startedAt: a.startedAt,
1903
1915
  finishedAt: a.finishedAt,
1904
- running: Kr(a.stage),
1916
+ running: Hr(a.stage),
1905
1917
  finishedDetail: [
1906
1918
  a.totalRows !== null ? `${a.totalRows.toLocaleString("en-US")} rows` : null,
1907
- a.fileSize ? Da(a.fileSize) : null
1919
+ a.fileSize ? Sa(a.fileSize) : null
1908
1920
  ].filter((s) => !!s),
1909
- failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ? G.failedFallback : null,
1921
+ failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ? K.failedFallback : null,
1910
1922
  note: null
1911
1923
  } : {
1912
1924
  title: a.title,
1913
1925
  status: a.status,
1914
1926
  startedAt: a.startedAt,
1915
1927
  finishedAt: a.finishedAt,
1916
- running: { text: a.stageLabel ?? G.inProgress },
1928
+ running: { text: a.stageLabel ?? K.inProgress },
1917
1929
  finishedDetail: [],
1918
1930
  failure: null,
1919
1931
  note: a.omittedAttachmentCount > 0 ? he.attachmentsLeftOut(a.omittedAttachmentCount) : null
1920
1932
  };
1921
1933
  }
1922
- function Xr({ row: e, now: a, api: o }) {
1923
- const [s, i] = k("idle"), n = Gr(e), d = ya(e, o), c = async () => {
1924
- if (!d) return;
1934
+ function Gr({ row: t, now: a, api: o }) {
1935
+ const [s, i] = D("idle"), n = Qr(t), c = xa(t, o), d = async () => {
1936
+ if (!c) return;
1925
1937
  i("working");
1926
- const f = await Aa(o, e, d);
1938
+ const f = await ka(o, t, c);
1927
1939
  i(f === "done" ? "idle" : f);
1928
- }, l = n.status === "ready" ? "bg-emerald-500" : n.status === "failed" ? "bg-destructive" : n.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", h = n.status === "ready" ? G.ready : n.status === "failed" ? G.failed : n.status === "cancelled" ? G.cancelled : G.inProgress, u = Date.parse(n.startedAt), m = kt(Date.parse(n.finishedAt ?? n.startedAt), a, { addSuffix: !0 }), p = n.status === "running" && e.item.kind === "export" && a - u >= Ca, g = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
1940
+ }, l = n.status === "ready" ? "bg-emerald-500" : n.status === "failed" ? "bg-destructive" : n.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = n.status === "ready" ? K.ready : n.status === "failed" ? K.failed : n.status === "cancelled" ? K.cancelled : K.inProgress, h = Date.parse(n.startedAt), m = At(Date.parse(n.finishedAt ?? n.startedAt), a, { addSuffix: !0 }), p = n.status === "running" && t.item.kind === "export" && a - h >= va, g = /* @__PURE__ */ e("span", { className: "text-muted-foreground/50", children: "·" });
1929
1941
  return /* @__PURE__ */ r("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
1930
- /* @__PURE__ */ t("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
1931
- /* @__PURE__ */ t("span", { className: "sr-only", children: h }),
1942
+ /* @__PURE__ */ e("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
1943
+ /* @__PURE__ */ e("span", { className: "sr-only", children: u }),
1932
1944
  /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
1933
1945
  /* @__PURE__ */ r("div", { className: "flex h-5 items-center gap-2", children: [
1934
- /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: n.title }),
1935
- d && s === "working" && /* @__PURE__ */ t("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ t(Pt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
1936
- d && s !== "working" && /* @__PURE__ */ t(
1946
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: n.title }),
1947
+ c && s === "working" && /* @__PURE__ */ e("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ e(Pt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
1948
+ c && s !== "working" && /* @__PURE__ */ e(
1937
1949
  "button",
1938
1950
  {
1939
1951
  type: "button",
1940
- onClick: () => void c(),
1952
+ onClick: () => void d(),
1941
1953
  className: "shrink-0 text-[12px] font-medium text-foreground/80 underline-offset-2 hover:text-foreground hover:underline focus-visible:underline focus-visible:outline-none",
1942
- children: wa[d]
1954
+ children: ya[c]
1943
1955
  }
1944
1956
  )
1945
1957
  ] }),
1946
1958
  n.status === "running" && n.running && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
1947
- /* @__PURE__ */ t("span", { className: "tabular-nums", children: n.running.text }),
1948
- n.running.detail && /* @__PURE__ */ r(_, { children: [
1959
+ /* @__PURE__ */ e("span", { className: "tabular-nums", children: n.running.text }),
1960
+ n.running.detail && /* @__PURE__ */ r(O, { children: [
1949
1961
  " ",
1950
1962
  g,
1951
1963
  " ",
1952
- /* @__PURE__ */ t("span", { className: "tabular-nums", children: n.running.detail })
1964
+ /* @__PURE__ */ e("span", { className: "tabular-nums", children: n.running.detail })
1953
1965
  ] }),
1954
1966
  " ",
1955
1967
  g,
1956
1968
  " ",
1957
- /* @__PURE__ */ t("span", { children: G.started(kt(u, a)) }),
1958
- n.running.bar !== void 0 && /* @__PURE__ */ t(Na, { value: n.running.bar, className: "mt-1.5 h-1" }),
1959
- p && /* @__PURE__ */ t("div", { className: "mt-1", children: G.longRunning })
1969
+ /* @__PURE__ */ e("span", { children: K.started(At(h, a)) }),
1970
+ n.running.bar !== void 0 && /* @__PURE__ */ e(Ca, { value: n.running.bar, className: "mt-1.5 h-1" }),
1971
+ p && /* @__PURE__ */ e("div", { className: "mt-1", children: K.longRunning })
1960
1972
  ] }),
1961
1973
  n.status !== "running" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
1962
1974
  n.status === "ready" && n.finishedDetail.length > 0 ? (
1963
1975
  // Disclosed on hover or focus only; the time is what a reader scans.
1964
1976
  /* @__PURE__ */ r("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
1965
- n.finishedDetail.map((f, v) => /* @__PURE__ */ r(At.Fragment, { children: [
1977
+ n.finishedDetail.map((f, v) => /* @__PURE__ */ r(Et.Fragment, { children: [
1966
1978
  v > 0 && g,
1967
- /* @__PURE__ */ t("span", { children: f })
1979
+ /* @__PURE__ */ e("span", { children: f })
1968
1980
  ] }, v)),
1969
1981
  g
1970
1982
  ] })
1971
- ) : n.status !== "ready" ? /* @__PURE__ */ r(_, { children: [
1972
- /* @__PURE__ */ t("span", { children: h }),
1983
+ ) : n.status !== "ready" ? /* @__PURE__ */ r(O, { children: [
1984
+ /* @__PURE__ */ e("span", { children: u }),
1973
1985
  g
1974
1986
  ] }) : null,
1975
- /* @__PURE__ */ t("span", { children: m })
1987
+ /* @__PURE__ */ e("span", { children: m })
1976
1988
  ] }),
1977
- n.note && /* @__PURE__ */ t("div", { className: "text-[12px] leading-4 text-muted-foreground", children: n.note }),
1978
- n.status === "failed" && n.failure && /* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: n.failure }),
1989
+ n.note && /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-muted-foreground", children: n.note }),
1990
+ n.status === "failed" && n.failure && /* @__PURE__ */ e("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: n.failure }),
1979
1991
  (s === "denied" || s === "blocked") && /* @__PURE__ */ r("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
1980
- /* @__PURE__ */ t(Sa, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
1981
- /* @__PURE__ */ t("span", { children: ka(s) })
1992
+ /* @__PURE__ */ e(wa, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
1993
+ /* @__PURE__ */ e("span", { children: Na(s) })
1982
1994
  ] })
1983
1995
  ] })
1984
1996
  ] });
1985
1997
  }
1986
- function cs({ variant: e }) {
1998
+ function ds({ variant: t }) {
1987
1999
  const { snapshot: a, markSeen: o } = vt(), s = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null;
1988
- return /* @__PURE__ */ r(Me, { onOpenChange: (i) => {
2000
+ return /* @__PURE__ */ r($e, { onOpenChange: (i) => {
1989
2001
  i && o();
1990
2002
  }, children: [
1991
- /* @__PURE__ */ t(Re, { asChild: !0, children: /* @__PURE__ */ r(
2003
+ /* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ r(
1992
2004
  L,
1993
2005
  {
1994
- variant: e ?? "ghost",
2006
+ variant: t ?? "ghost",
1995
2007
  size: "xs",
1996
2008
  className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
1997
2009
  "aria-label": he.title,
1998
2010
  title: he.title,
1999
2011
  children: [
2000
- /* @__PURE__ */ t(Nr, { className: "h-3.5 w-3.5" }),
2001
- s !== null && /* @__PURE__ */ t(
2012
+ /* @__PURE__ */ e(Sr, { className: "h-3.5 w-3.5" }),
2013
+ s !== null && /* @__PURE__ */ e(
2002
2014
  "span",
2003
2015
  {
2004
2016
  className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${s ? "-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold" : "right-1 top-1 h-1.5 w-1.5"}`,
@@ -2008,73 +2020,73 @@ function cs({ variant: e }) {
2008
2020
  ]
2009
2021
  }
2010
2022
  ) }),
2011
- /* @__PURE__ */ t(Oe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Yr, {}) })
2023
+ /* @__PURE__ */ e(qe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Kr, {}) })
2012
2024
  ] });
2013
2025
  }
2014
- function Yr() {
2015
- const e = vt(), a = Fa(), { rows: o, activeTruncated: s } = e.snapshot, i = o.some((n) => Ia(n.item.status));
2026
+ function Kr() {
2027
+ const t = vt(), a = Da(), { rows: o, activeTruncated: s } = t.snapshot, i = o.some((n) => Aa(n.item.status));
2016
2028
  return o.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
2017
- /* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(Ea, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
2018
- /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: he.title }),
2019
- /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: he.empty })
2029
+ /* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ e(Fa, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
2030
+ /* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: he.title }),
2031
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: he.empty })
2020
2032
  ] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
2021
2033
  /* @__PURE__ */ r("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
2022
- /* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: he.title }),
2023
- /* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
2034
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: he.title }),
2035
+ /* @__PURE__ */ e("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
2024
2036
  /* @__PURE__ */ r("div", { className: "ml-auto flex items-center gap-0.5", children: [
2025
- i && /* @__PURE__ */ t(
2037
+ i && /* @__PURE__ */ e(
2026
2038
  L,
2027
2039
  {
2028
2040
  variant: "ghost",
2029
2041
  size: "xs",
2030
2042
  className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
2031
- onClick: e.clearFinished,
2043
+ onClick: t.clearFinished,
2032
2044
  children: he.clear
2033
2045
  }
2034
2046
  ),
2035
- /* @__PURE__ */ t(
2047
+ /* @__PURE__ */ e(
2036
2048
  L,
2037
2049
  {
2038
2050
  variant: "ghost",
2039
2051
  size: "xs",
2040
2052
  className: "h-6 w-6 px-0 text-muted-foreground hover:text-foreground",
2041
- onClick: e.refresh,
2053
+ onClick: t.refresh,
2042
2054
  title: "Refresh status",
2043
2055
  "aria-label": "Refresh status",
2044
- children: /* @__PURE__ */ t(Pt, { strokeWidth: 1.75, className: "h-3.5 w-3.5" })
2056
+ children: /* @__PURE__ */ e(Pt, { strokeWidth: 1.75, className: "h-3.5 w-3.5" })
2045
2057
  }
2046
2058
  )
2047
2059
  ] })
2048
2060
  ] }),
2049
- s && /* @__PURE__ */ t("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: he.truncated }),
2050
- /* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: o.map((n) => /* @__PURE__ */ t(Xr, { row: n, now: a, api: e }, Ta(n))) }) })
2061
+ s && /* @__PURE__ */ e("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: he.truncated }),
2062
+ /* @__PURE__ */ e("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y divide-border/70", children: o.map((n) => /* @__PURE__ */ e(Gr, { row: n, now: a, api: t }, Ea(n))) }) })
2051
2063
  ] });
2052
2064
  }
2053
- function Zr(e) {
2054
- if (e)
2065
+ function Xr(t) {
2066
+ if (t)
2055
2067
  return {
2056
- renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
2057
- removedControlId: e.type === "remove" ? e.controlId : void 0,
2058
- cardBindingsById: e.type === "add" || e.type === "update" ? e.cardBindingsById : void 0,
2059
- affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
2068
+ renamed: t.type === "rename" ? { oldId: t.oldId, newId: t.newId } : void 0,
2069
+ removedControlId: t.type === "remove" ? t.controlId : void 0,
2070
+ cardBindingsById: t.type === "add" || t.type === "update" ? t.cardBindingsById : void 0,
2071
+ affectedBindingControlIds: t.type === "add" || t.type === "update" ? t.affectedBindingControlIds : void 0
2060
2072
  };
2061
2073
  }
2062
- function Jr({
2063
- open: e,
2074
+ function Yr({
2075
+ open: t,
2064
2076
  onOpenChange: a,
2065
2077
  trigger: o,
2066
2078
  showTrigger: s = !0,
2067
2079
  initialMode: i = "manage"
2068
2080
  }) {
2069
2081
  const n = i === "create", {
2070
- forceClose: d,
2071
- handleOpenChange: c,
2082
+ forceClose: c,
2083
+ handleOpenChange: d,
2072
2084
  isCreateFlowActive: l,
2073
- preventPassiveDismissDuringCreate: h,
2074
- resolvedOpen: u,
2085
+ preventPassiveDismissDuringCreate: u,
2086
+ resolvedOpen: h,
2075
2087
  setIsCreateFlowActive: m
2076
2088
  } = _t({
2077
- open: e,
2089
+ open: t,
2078
2090
  onOpenChange: a,
2079
2091
  initialCreateFlowActive: i === "create",
2080
2092
  // Dialog mode renders a built-in X close button — allow explicit
@@ -2084,105 +2096,105 @@ function Jr({
2084
2096
  // create and make consumers use `forceClose()` from a dedicated
2085
2097
  // button.
2086
2098
  dismissMode: s ? "passive" : "explicit-only"
2087
- }), p = D((x) => x.dashboard), { setDashboardControlsModel: g } = de(), { participants: f } = Va(hr(p)), v = Array.from(
2099
+ }), p = N((x) => x.dashboard), { setDashboardControlsModel: g } = de(), { participants: f } = Ia(mr(p)), v = Array.from(
2088
2100
  new Map(
2089
2101
  f.flatMap(
2090
- (x) => x.fieldChoices.map((F) => {
2102
+ (x) => x.fieldChoices.map((E) => {
2091
2103
  var S;
2092
2104
  return [
2093
- F.value,
2105
+ E.value,
2094
2106
  {
2095
- option: F,
2096
- target: (S = x.fieldTargetMap) == null ? void 0 : S[F.value]
2107
+ option: E,
2108
+ target: (S = x.fieldTargetMap) == null ? void 0 : S[E.value]
2097
2109
  }
2098
2110
  ];
2099
2111
  })
2100
2112
  )
2101
2113
  ).values()
2102
- ), N = Array.from(
2114
+ ), k = Array.from(
2103
2115
  new Map(
2104
2116
  f.flatMap(
2105
- (x) => x.metricChoices.map((F) => {
2117
+ (x) => x.metricChoices.map((E) => {
2106
2118
  var S;
2107
2119
  return [
2108
- F.value,
2120
+ E.value,
2109
2121
  {
2110
- option: F,
2111
- target: (S = x.metricTargetMap) == null ? void 0 : S[F.value]
2122
+ option: E,
2123
+ target: (S = x.metricTargetMap) == null ? void 0 : S[E.value]
2112
2124
  }
2113
2125
  ];
2114
2126
  })
2115
2127
  )
2116
2128
  ).values()
2117
- ), T = or({
2129
+ ), V = ir({
2118
2130
  ...p || {},
2119
2131
  controls: []
2120
- }), U = La(p), M = (x, F, S) => {
2132
+ }), M = La(p), U = (x, E, S) => {
2121
2133
  g(
2122
2134
  x,
2123
- F,
2124
- Zr(S)
2135
+ E,
2136
+ Xr(S)
2125
2137
  );
2126
2138
  }, A = ae(() => {
2127
2139
  if (n) {
2128
- d();
2140
+ c();
2129
2141
  return;
2130
2142
  }
2131
2143
  m(!1);
2132
- }, [n, d, m]), O = /* @__PURE__ */ t(
2133
- zt,
2144
+ }, [n, c, m]), z = /* @__PURE__ */ e(
2145
+ jt,
2134
2146
  {
2135
2147
  scope: "dashboard",
2136
2148
  controls: p.controls || [],
2137
- reservedControlIds: T,
2149
+ reservedControlIds: V,
2138
2150
  defaultValues: p.defaultControlValues || {},
2139
- usageByControlId: Ba(p),
2151
+ usageByControlId: Va(p),
2140
2152
  availableFieldChoices: v,
2141
- availableMetricChoices: N,
2153
+ availableMetricChoices: k,
2142
2154
  structuralParticipants: f,
2143
- structuralParticipantIdsByControlId: U,
2155
+ structuralParticipantIdsByControlId: M,
2144
2156
  initialCreateFlow: i === "create",
2145
2157
  onCreateFlowActiveChange: m,
2146
2158
  onCreateFlowComplete: A,
2147
- onChange: M,
2159
+ onChange: U,
2148
2160
  emptyMessage: "No dashboard controls yet."
2149
2161
  }
2150
- ), C = l ? "Add dashboard control" : "Dashboard Controls", w = /* @__PURE__ */ r(_, { children: [
2162
+ ), C = l ? "Add dashboard control" : "Dashboard Controls", w = /* @__PURE__ */ r(O, { children: [
2151
2163
  /* @__PURE__ */ r("div", { className: "space-y-1", children: [
2152
- /* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
2153
- /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
2164
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
2165
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
2154
2166
  ] }),
2155
- O
2167
+ z
2156
2168
  ] });
2157
- return s ? /* @__PURE__ */ r(Me, { open: u, onOpenChange: c, children: [
2158
- /* @__PURE__ */ t(Re, { asChild: !0, children: o || /* @__PURE__ */ r(L, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
2159
- /* @__PURE__ */ t(It, { className: "mr-2 h-4 w-4" }),
2169
+ return s ? /* @__PURE__ */ r($e, { open: h, onOpenChange: d, children: [
2170
+ /* @__PURE__ */ e(We, { asChild: !0, children: o || /* @__PURE__ */ r(L, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
2171
+ /* @__PURE__ */ e(zt, { className: "mr-2 h-4 w-4" }),
2160
2172
  "Controls"
2161
2173
  ] }) }),
2162
- /* @__PURE__ */ t(
2163
- Oe,
2174
+ /* @__PURE__ */ e(
2175
+ qe,
2164
2176
  {
2165
2177
  className: "w-[620px] max-w-[95vw] space-y-4",
2166
2178
  align: "end",
2167
- onEscapeKeyDown: h,
2168
- onPointerDownOutside: h,
2179
+ onEscapeKeyDown: u,
2180
+ onPointerDownOutside: u,
2169
2181
  children: w
2170
2182
  }
2171
2183
  )
2172
- ] }) : /* @__PURE__ */ t(Ae, { open: u, onOpenChange: c, children: /* @__PURE__ */ r(
2173
- Fe,
2184
+ ] }) : /* @__PURE__ */ e(Fe, { open: h, onOpenChange: d, children: /* @__PURE__ */ r(
2185
+ Ee,
2174
2186
  {
2175
2187
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
2176
- onEscapeKeyDown: h,
2177
- onPointerDownOutside: h,
2188
+ onEscapeKeyDown: u,
2189
+ onPointerDownOutside: u,
2178
2190
  children: [
2179
2191
  /* @__PURE__ */ r(
2180
2192
  gt,
2181
2193
  {
2182
2194
  className: l ? "space-y-0" : void 0,
2183
2195
  children: [
2184
- /* @__PURE__ */ t(Ie, { className: "text-[15px]", children: C }),
2185
- /* @__PURE__ */ t(
2196
+ /* @__PURE__ */ e(Ie, { className: "text-[15px]", children: C }),
2197
+ /* @__PURE__ */ e(
2186
2198
  bt,
2187
2199
  {
2188
2200
  className: l ? "sr-only" : "text-[13px]",
@@ -2192,12 +2204,12 @@ function Jr({
2192
2204
  ]
2193
2205
  }
2194
2206
  ),
2195
- /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: O })
2207
+ /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: z })
2196
2208
  ]
2197
2209
  }
2198
2210
  ) });
2199
2211
  }
2200
- const en = [
2212
+ const Zr = [
2201
2213
  "enum",
2202
2214
  "multi_enum",
2203
2215
  "text",
@@ -2205,8 +2217,8 @@ const en = [
2205
2217
  "boolean",
2206
2218
  "date"
2207
2219
  ];
2208
- function tn({
2209
- open: e,
2220
+ function Jr({
2221
+ open: t,
2210
2222
  onOpenChange: a,
2211
2223
  initialMode: o = "manage"
2212
2224
  }) {
@@ -2214,95 +2226,95 @@ function tn({
2214
2226
  const s = o === "create", {
2215
2227
  forceClose: i,
2216
2228
  handleOpenChange: n,
2217
- isCreateFlowActive: d,
2218
- preventPassiveDismissDuringCreate: c,
2229
+ isCreateFlowActive: c,
2230
+ preventPassiveDismissDuringCreate: d,
2219
2231
  resolvedOpen: l,
2220
- setIsCreateFlowActive: h
2232
+ setIsCreateFlowActive: u
2221
2233
  } = _t({
2222
- open: e,
2234
+ open: t,
2223
2235
  onOpenChange: a,
2224
2236
  initialCreateFlowActive: o === "create",
2225
2237
  dismissMode: "explicit-only"
2226
- }), u = D((x) => x.dashboard), m = D((x) => x.selectedSheetId), { setDashboardInputs: p } = de(), g = (w = u.sheets) == null ? void 0 : w.find(
2238
+ }), h = N((x) => x.dashboard), m = N((x) => x.selectedSheetId), { setDashboardInputs: p } = de(), g = (w = h.sheets) == null ? void 0 : w.find(
2227
2239
  (x) => x.id === m
2228
2240
  ), f = (g == null ? void 0 : g.kind) === "document" && !!g.document, v = re(
2229
- () => f && (g != null && g.document) ? xr(u, g.id) : [],
2230
- [u, f, g == null ? void 0 : g.document, g == null ? void 0 : g.id]
2231
- ), N = re(
2241
+ () => f && (g != null && g.document) ? vr(h, g.id) : [],
2242
+ [h, f, g == null ? void 0 : g.document, g == null ? void 0 : g.id]
2243
+ ), k = re(
2232
2244
  () => v.filter(
2233
2245
  (x) => x.kind === "control"
2234
2246
  ),
2235
2247
  [v]
2236
- ), T = re(
2237
- () => N.map((x) => x.control),
2238
- [N]
2239
- ), U = re(
2240
- () => rn(T),
2241
- [T]
2248
+ ), V = re(
2249
+ () => k.map((x) => x.control),
2250
+ [k]
2242
2251
  ), M = re(
2243
- () => an(u),
2244
- [u]
2252
+ () => tn(V),
2253
+ [V]
2254
+ ), U = re(
2255
+ () => en(h),
2256
+ [h]
2245
2257
  ), A = ae(() => {
2246
2258
  if (s) {
2247
2259
  i();
2248
2260
  return;
2249
2261
  }
2250
- h(!1);
2251
- }, [s, i, h]), O = ae(
2252
- (x, F, S) => {
2262
+ u(!1);
2263
+ }, [s, i, u]), z = ae(
2264
+ (x, E, S) => {
2253
2265
  !f || !(g != null && g.document) || p(
2254
- sn({
2255
- allInputs: u.inputs || [],
2266
+ rn({
2267
+ allInputs: h.inputs || [],
2256
2268
  documentSheetId: g.id,
2257
2269
  currentDocumentInputs: v,
2258
2270
  nextControls: x,
2259
- nextDefaultValues: F,
2271
+ nextDefaultValues: E,
2260
2272
  change: S
2261
2273
  })
2262
2274
  );
2263
2275
  },
2264
2276
  [
2265
- u.inputs,
2277
+ h.inputs,
2266
2278
  v,
2267
2279
  f,
2268
2280
  g,
2269
2281
  p
2270
2282
  ]
2271
2283
  );
2272
- return !f || !(g != null && g.document) ? null : /* @__PURE__ */ t(Ae, { open: l, onOpenChange: n, children: /* @__PURE__ */ r(
2273
- Fe,
2284
+ return !f || !(g != null && g.document) ? null : /* @__PURE__ */ e(Fe, { open: l, onOpenChange: n, children: /* @__PURE__ */ r(
2285
+ Ee,
2274
2286
  {
2275
2287
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
2276
- onEscapeKeyDown: c,
2277
- onPointerDownOutside: c,
2288
+ onEscapeKeyDown: d,
2289
+ onPointerDownOutside: d,
2278
2290
  children: [
2279
- /* @__PURE__ */ r(gt, { className: d ? "space-y-0" : void 0, children: [
2280
- /* @__PURE__ */ t(Ie, { className: "text-[15px]", children: d ? "Add document control" : "Document Controls" }),
2281
- /* @__PURE__ */ t(
2291
+ /* @__PURE__ */ r(gt, { className: c ? "space-y-0" : void 0, children: [
2292
+ /* @__PURE__ */ e(Ie, { className: "text-[15px]", children: c ? "Add document control" : "Document Controls" }),
2293
+ /* @__PURE__ */ e(
2282
2294
  bt,
2283
2295
  {
2284
- className: d ? "sr-only" : "text-[13px]",
2285
- children: d ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
2296
+ className: c ? "sr-only" : "text-[13px]",
2297
+ children: c ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
2286
2298
  }
2287
2299
  )
2288
2300
  ] }),
2289
- /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ t(
2290
- zt,
2301
+ /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
2302
+ jt,
2291
2303
  {
2292
2304
  scope: "dashboard",
2293
- controls: T,
2294
- reservedControlIds: M,
2295
- defaultValues: U,
2305
+ controls: V,
2306
+ reservedControlIds: U,
2307
+ defaultValues: M,
2296
2308
  usageByControlId: {},
2297
2309
  availableFieldChoices: [],
2298
2310
  availableMetricChoices: [],
2299
2311
  structuralParticipants: [],
2300
2312
  structuralParticipantIdsByControlId: {},
2301
- allowedControlTypes: en,
2313
+ allowedControlTypes: Zr,
2302
2314
  initialCreateFlow: o === "create",
2303
- onCreateFlowActiveChange: h,
2315
+ onCreateFlowActiveChange: u,
2304
2316
  onCreateFlowComplete: A,
2305
- onChange: O,
2317
+ onChange: z,
2306
2318
  emptyMessage: "No document controls yet."
2307
2319
  }
2308
2320
  ) })
@@ -2310,51 +2322,51 @@ function tn({
2310
2322
  }
2311
2323
  ) });
2312
2324
  }
2313
- function an(e) {
2314
- return (e.controls || []).map((a) => a.id);
2325
+ function en(t) {
2326
+ return (t.controls || []).map((a) => a.id);
2315
2327
  }
2316
- function rn(e) {
2328
+ function tn(t) {
2317
2329
  const a = {};
2318
- for (const o of e)
2330
+ for (const o of t)
2319
2331
  o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
2320
2332
  return a;
2321
2333
  }
2322
- function nn(e, a) {
2323
- return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
2324
- ...e,
2325
- defaultValue: a[e.id]
2326
- } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
2334
+ function an(t, a) {
2335
+ return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
2336
+ ...t,
2337
+ defaultValue: a[t.id]
2338
+ } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
2327
2339
  }
2328
- function sn({
2329
- allInputs: e,
2340
+ function rn({
2341
+ allInputs: t,
2330
2342
  documentSheetId: a,
2331
2343
  currentDocumentInputs: o,
2332
2344
  nextControls: s,
2333
2345
  nextDefaultValues: i,
2334
2346
  change: n
2335
2347
  }) {
2336
- const d = new Map(
2348
+ const c = new Map(
2337
2349
  s.map((p) => [
2338
2350
  p.id,
2339
- nn(p, i)
2351
+ an(p, i)
2340
2352
  ])
2341
- ), c = (n == null ? void 0 : n.type) === "rename" ? { oldId: n.oldId, newId: n.newId } : null, l = /* @__PURE__ */ new Set(), h = [];
2353
+ ), d = (n == null ? void 0 : n.type) === "rename" ? { oldId: n.oldId, newId: n.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
2342
2354
  for (const p of o) {
2343
2355
  if (p.kind !== "control") {
2344
- h.push(p);
2356
+ u.push(p);
2345
2357
  continue;
2346
2358
  }
2347
- const g = d.get(p.control.id) || ((c == null ? void 0 : c.oldId) === p.control.id ? d.get(c.newId) : void 0);
2359
+ const g = c.get(p.control.id) || ((d == null ? void 0 : d.oldId) === p.control.id ? c.get(d.newId) : void 0);
2348
2360
  if (!g)
2349
2361
  continue;
2350
2362
  l.add(g.id);
2351
- const f = ir(
2363
+ const f = lr(
2352
2364
  g.id,
2353
- [...e, ...h].filter(
2354
- (N) => N.id !== p.id
2365
+ [...t, ...u].filter(
2366
+ (k) => k.id !== p.id
2355
2367
  )
2356
2368
  ), v = g.id === f ? g : { ...g, id: f };
2357
- h.push({
2369
+ u.push({
2358
2370
  ...p,
2359
2371
  label: v.label,
2360
2372
  variableName: f,
@@ -2362,34 +2374,34 @@ function sn({
2362
2374
  control: v
2363
2375
  });
2364
2376
  }
2365
- for (const p of d.values())
2366
- l.has(p.id) || h.push(
2367
- vr({
2377
+ for (const p of c.values())
2378
+ l.has(p.id) || u.push(
2379
+ yr({
2368
2380
  control: p,
2369
- existingInputs: [...e, ...h],
2381
+ existingInputs: [...t, ...u],
2370
2382
  sheetId: a
2371
2383
  })
2372
2384
  );
2373
- const u = new Set(
2385
+ const h = new Set(
2374
2386
  o.map((p) => p.id)
2375
2387
  );
2376
- return [...e.filter(
2377
- (p) => !u.has(p.id)
2378
- ), ...h];
2388
+ return [...t.filter(
2389
+ (p) => !h.has(p.id)
2390
+ ), ...u];
2379
2391
  }
2380
- function on({
2381
- showFilters: e,
2392
+ function nn({
2393
+ showFilters: t,
2382
2394
  onShowFiltersChange: a,
2383
2395
  pickerContent: o,
2384
2396
  settingsContent: s,
2385
2397
  size: i = "default",
2386
2398
  className: n,
2387
- primaryButtonClassName: d,
2388
- secondaryButtonClassName: c,
2399
+ primaryButtonClassName: c,
2400
+ secondaryButtonClassName: d,
2389
2401
  pickerContentClassName: l,
2390
- settingsContentClassName: h
2402
+ settingsContentClassName: u
2391
2403
  }) {
2392
- const u = i === "toolbar", [m, p] = k(!1), g = ot("interactive");
2404
+ const h = i === "toolbar", [m, p] = D(!1), g = ot("interactive");
2393
2405
  return /* @__PURE__ */ r(
2394
2406
  "div",
2395
2407
  {
@@ -2398,28 +2410,28 @@ function on({
2398
2410
  // h-7 box (matches regular `size="xs"` buttons). Inner triggers
2399
2411
  // stretch to fill via `h-full`.
2400
2412
  "relative inline-flex items-stretch overflow-hidden rounded-control border border-input bg-background",
2401
- u ? "h-8" : "h-7",
2413
+ h ? "h-8" : "h-7",
2402
2414
  n
2403
2415
  ),
2404
2416
  children: [
2405
- /* @__PURE__ */ r(Me, { open: e, onOpenChange: a, children: [
2406
- /* @__PURE__ */ t(Re, { asChild: !0, children: /* @__PURE__ */ r(
2417
+ /* @__PURE__ */ r($e, { open: t, onOpenChange: a, children: [
2418
+ /* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ r(
2407
2419
  L,
2408
2420
  {
2409
2421
  variant: "ghost",
2410
2422
  size: "xs",
2411
2423
  className: J(
2412
2424
  "h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
2413
- d
2425
+ c
2414
2426
  ),
2415
2427
  children: [
2416
- e ? /* @__PURE__ */ t(gr, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Ut, { className: "h-3.5 w-3.5" }),
2428
+ t ? /* @__PURE__ */ e(br, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(Mt, { className: "h-3.5 w-3.5" }),
2417
2429
  "Filter"
2418
2430
  ]
2419
2431
  }
2420
2432
  ) }),
2421
- /* @__PURE__ */ t(
2422
- Oe,
2433
+ /* @__PURE__ */ e(
2434
+ qe,
2423
2435
  {
2424
2436
  align: "end",
2425
2437
  sideOffset: 6,
@@ -2432,28 +2444,28 @@ function on({
2432
2444
  }
2433
2445
  )
2434
2446
  ] }),
2435
- /* @__PURE__ */ r(Me, { open: m, onOpenChange: p, children: [
2436
- /* @__PURE__ */ t(Re, { asChild: !0, children: /* @__PURE__ */ t(
2447
+ /* @__PURE__ */ r($e, { open: m, onOpenChange: p, children: [
2448
+ /* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ e(
2437
2449
  L,
2438
2450
  {
2439
2451
  variant: "ghost",
2440
2452
  size: "xs",
2441
2453
  className: J(
2442
2454
  "h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
2443
- c
2455
+ d
2444
2456
  ),
2445
2457
  "aria-label": "Filter and control actions",
2446
- children: /* @__PURE__ */ t(Rt, { className: "h-3.5 w-3.5" })
2458
+ children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
2447
2459
  }
2448
2460
  ) }),
2449
- /* @__PURE__ */ t(
2450
- Oe,
2461
+ /* @__PURE__ */ e(
2462
+ qe,
2451
2463
  {
2452
2464
  align: "end",
2453
2465
  sideOffset: 6,
2454
2466
  className: J(
2455
2467
  "w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
2456
- h
2468
+ u
2457
2469
  ),
2458
2470
  style: g.contentStyle,
2459
2471
  children: s(() => p(!1))
@@ -2464,96 +2476,96 @@ function on({
2464
2476
  }
2465
2477
  );
2466
2478
  }
2467
- function ln() {
2468
- br();
2469
- const e = D((l) => l.selectedSheetId), a = D((l) => l.selectedFrameId), o = D((l) => l.dashboard), s = D((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = de(), { setCard: n } = qe(), d = ee((l) => l.card.dataSource);
2470
- return ge(() => {
2471
- var h, u;
2479
+ function sn() {
2480
+ xr();
2481
+ const t = N((l) => l.selectedSheetId), a = N((l) => l.selectedFrameId), o = N((l) => l.dashboard), s = N((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = de(), { setCard: n } = Ke(), c = ee((l) => l.card.dataSource);
2482
+ return be(() => {
2483
+ var u, h;
2472
2484
  let l = s();
2473
2485
  if (!l) {
2474
- const m = (h = o == null ? void 0 : o.sheets) == null ? void 0 : h.find((g) => g.id === e), p = (u = m == null ? void 0 : m.frames) == null ? void 0 : u[0];
2486
+ const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((g) => g.id === t), p = (h = m == null ? void 0 : m.frames) == null ? void 0 : h[0];
2475
2487
  p && (i(p.id), l = p);
2476
2488
  }
2477
2489
  if (l) {
2478
2490
  const m = l.cards.find((p) => p.id === l.activeCardId);
2479
2491
  m && n(m);
2480
2492
  }
2481
- }, [s, e, a, o, i, n]), {
2482
- hasEntities: !!(d != null && d.selectedEntities && d.selectedEntities.length > 0)
2493
+ }, [s, t, a, o, i, n]), {
2494
+ hasEntities: !!(c != null && c.selectedEntities && c.selectedEntities.length > 0)
2483
2495
  };
2484
2496
  }
2485
- function dn() {
2486
- const e = D((l) => l.dashboard), a = D(
2497
+ function on() {
2498
+ const t = N((l) => l.dashboard), a = N(
2487
2499
  (l) => l.semanticExecutionPayload
2488
- ), o = D(
2500
+ ), o = N(
2489
2501
  (l) => l.actions.addFilterInput
2490
- ), { hasEntities: s } = ln(), { isLoading: i } = Pa(), n = re(
2491
- () => lr(e, a),
2492
- [e, a]
2493
- ), c = !dr(e) && n.hasEligibleCards && !i;
2502
+ ), { hasEntities: s } = sn(), { isLoading: i } = Ta(), n = re(
2503
+ () => dr(t, a),
2504
+ [t, a]
2505
+ ), d = !cr(t) && n.hasEligibleCards && !i;
2494
2506
  return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
2495
- c && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
2507
+ d && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
2496
2508
  "button",
2497
2509
  {
2498
2510
  type: "button",
2499
- onClick: () => o(cr(), {
2511
+ onClick: () => o(ur(), {
2500
2512
  kind: "allSheets",
2501
2513
  sheetKinds: ["dashboard"]
2502
2514
  }),
2503
2515
  title: `Applies to ${n.eligibleCardCount} of ${n.totalCardCount} date-aware cards`,
2504
2516
  className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
2505
2517
  children: [
2506
- /* @__PURE__ */ t(Sr, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2518
+ /* @__PURE__ */ e(kr, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2507
2519
  /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
2508
- /* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
2509
- /* @__PURE__ */ t("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
2520
+ /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
2521
+ /* @__PURE__ */ e("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
2510
2522
  ] })
2511
2523
  ]
2512
2524
  }
2513
2525
  ) }),
2514
2526
  !s && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
2515
- /* @__PURE__ */ t(Ua, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2516
- /* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
2517
- /* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
2527
+ /* @__PURE__ */ e(Ba, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2528
+ /* @__PURE__ */ e("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
2529
+ /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
2518
2530
  ] }),
2519
- s && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Ma, { context: "filter" }) })
2531
+ s && /* @__PURE__ */ e("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ e(Pa, { context: "filter" }) })
2520
2532
  ] });
2521
2533
  }
2522
- function cn({
2523
- onAddFilter: e,
2534
+ function ln({
2535
+ onAddFilter: t,
2524
2536
  onAddControl: a,
2525
2537
  onManageControls: o,
2526
2538
  onDismiss: s
2527
2539
  }) {
2528
- const i = D(
2529
- (c) => c.dashboard.filterLayout
2530
- ), { setFilterLayout: n } = de(), d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
2540
+ const i = N(
2541
+ (d) => d.dashboard.filterLayout
2542
+ ), { setFilterLayout: n } = de(), c = (i == null ? void 0 : i.toolbarWrap) ?? !1;
2531
2543
  return /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
2532
2544
  /* @__PURE__ */ r("div", { className: "p-1", children: [
2533
- /* @__PURE__ */ t(
2534
- at,
2545
+ /* @__PURE__ */ e(
2546
+ rt,
2535
2547
  {
2536
- icon: Ut,
2548
+ icon: Mt,
2537
2549
  label: "Add filter",
2538
2550
  onClick: () => {
2539
- e(), s();
2551
+ t(), s();
2540
2552
  }
2541
2553
  }
2542
2554
  ),
2543
- /* @__PURE__ */ t(
2544
- at,
2555
+ /* @__PURE__ */ e(
2556
+ rt,
2545
2557
  {
2546
- icon: It,
2558
+ icon: zt,
2547
2559
  label: "Add control",
2548
2560
  onClick: () => {
2549
2561
  a(), s();
2550
2562
  }
2551
2563
  }
2552
2564
  ),
2553
- /* @__PURE__ */ t(
2554
- at,
2565
+ /* @__PURE__ */ e(
2566
+ rt,
2555
2567
  {
2556
- icon: Mt,
2568
+ icon: Ut,
2557
2569
  label: "Manage controls",
2558
2570
  onClick: () => {
2559
2571
  o(), s();
@@ -2561,23 +2573,23 @@ function cn({
2561
2573
  }
2562
2574
  )
2563
2575
  ] }),
2564
- /* @__PURE__ */ t("div", { className: "border-t border-border/60" }),
2576
+ /* @__PURE__ */ e("div", { className: "border-t border-border/60" }),
2565
2577
  /* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
2566
- /* @__PURE__ */ t("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
2567
- /* @__PURE__ */ t(
2568
- un,
2578
+ /* @__PURE__ */ e("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
2579
+ /* @__PURE__ */ e(
2580
+ dn,
2569
2581
  {
2570
2582
  id: "filter-display-wrap",
2571
2583
  label: "Wrap to multiple lines",
2572
- checked: d,
2573
- onCheckedChange: (c) => n({ toolbarWrap: c === !0 })
2584
+ checked: c,
2585
+ onCheckedChange: (d) => n({ toolbarWrap: d === !0 })
2574
2586
  }
2575
2587
  )
2576
2588
  ] })
2577
2589
  ] });
2578
2590
  }
2579
- function at({
2580
- icon: e,
2591
+ function rt({
2592
+ icon: t,
2581
2593
  label: a,
2582
2594
  onClick: o
2583
2595
  }) {
@@ -2588,49 +2600,49 @@ function at({
2588
2600
  onClick: o,
2589
2601
  className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[13px] text-foreground outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",
2590
2602
  children: [
2591
- /* @__PURE__ */ t(e, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2603
+ /* @__PURE__ */ e(t, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2592
2604
  a
2593
2605
  ]
2594
2606
  }
2595
2607
  );
2596
2608
  }
2597
- function un({
2598
- id: e,
2609
+ function dn({
2610
+ id: t,
2599
2611
  label: a,
2600
2612
  checked: o,
2601
2613
  onCheckedChange: s
2602
2614
  }) {
2603
2615
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
2604
- /* @__PURE__ */ t(ft, { id: e, checked: o, onCheckedChange: s }),
2605
- /* @__PURE__ */ t(
2616
+ /* @__PURE__ */ e(ft, { id: t, checked: o, onCheckedChange: s }),
2617
+ /* @__PURE__ */ e(
2606
2618
  De,
2607
2619
  {
2608
- htmlFor: e,
2620
+ htmlFor: t,
2609
2621
  className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
2610
2622
  children: a
2611
2623
  }
2612
2624
  )
2613
2625
  ] });
2614
2626
  }
2615
- function us({
2616
- size: e,
2627
+ function cs({
2628
+ size: t,
2617
2629
  className: a,
2618
2630
  primaryButtonClassName: o,
2619
2631
  secondaryButtonClassName: s,
2620
2632
  pickerContentClassName: i,
2621
2633
  settingsContentClassName: n
2622
2634
  }) {
2623
- var O;
2624
- const [d, c] = k(null), l = D((C) => C.dashboard), h = D((C) => C.selectedSheetId), u = D((C) => C.showFilters), m = D((C) => C.actions), { setDocumentPanelTarget: p, setShowFilters: g } = m, f = (O = l.sheets) == null ? void 0 : O.find(
2625
- (C) => C.id === h
2626
- ), v = ur(f), N = ae((C) => {
2635
+ var z;
2636
+ const [c, d] = D(null), l = N((C) => C.dashboard), u = N((C) => C.selectedSheetId), h = N((C) => C.showFilters), m = N((C) => C.actions), { setDocumentPanelTarget: p, setShowFilters: g } = m, f = (z = l.sheets) == null ? void 0 : z.find(
2637
+ (C) => C.id === u
2638
+ ), v = wt(f), k = ae((C) => {
2627
2639
  window.setTimeout(() => {
2628
- c(C);
2640
+ d(C);
2629
2641
  }, 0);
2630
- }, []), T = ae(
2642
+ }, []), V = ae(
2631
2643
  (C) => {
2632
- if (v && h) {
2633
- C && p(h, {
2644
+ if (v && u) {
2645
+ C && p(u, {
2634
2646
  kind: "document",
2635
2647
  group: "inputs"
2636
2648
  });
@@ -2640,34 +2652,34 @@ function us({
2640
2652
  },
2641
2653
  [
2642
2654
  v,
2643
- h,
2655
+ u,
2644
2656
  p,
2645
2657
  g
2646
2658
  ]
2647
- ), U = ae(() => {
2648
- T(!0);
2649
- }, [T]), M = ae(() => {
2650
- N("create");
2651
- }, [N]), A = ae(() => {
2652
- N("manage");
2653
- }, [N]);
2654
- return /* @__PURE__ */ r(_, { children: [
2655
- /* @__PURE__ */ t(
2656
- on,
2659
+ ), M = ae(() => {
2660
+ V(!0);
2661
+ }, [V]), U = ae(() => {
2662
+ k("create");
2663
+ }, [k]), A = ae(() => {
2664
+ k("manage");
2665
+ }, [k]);
2666
+ return /* @__PURE__ */ r(O, { children: [
2667
+ /* @__PURE__ */ e(
2668
+ nn,
2657
2669
  {
2658
- showFilters: v ? !1 : u,
2659
- onShowFiltersChange: T,
2660
- pickerContent: /* @__PURE__ */ t(dn, {}),
2661
- settingsContent: (C) => /* @__PURE__ */ t(
2662
- cn,
2670
+ showFilters: v ? !1 : h,
2671
+ onShowFiltersChange: V,
2672
+ pickerContent: /* @__PURE__ */ e(on, {}),
2673
+ settingsContent: (C) => /* @__PURE__ */ e(
2674
+ ln,
2663
2675
  {
2664
- onAddFilter: U,
2665
- onAddControl: M,
2676
+ onAddFilter: M,
2677
+ onAddControl: U,
2666
2678
  onManageControls: A,
2667
2679
  onDismiss: C
2668
2680
  }
2669
2681
  ),
2670
- size: e,
2682
+ size: t,
2671
2683
  className: a,
2672
2684
  primaryButtonClassName: o,
2673
2685
  secondaryButtonClassName: s,
@@ -2675,30 +2687,30 @@ function us({
2675
2687
  settingsContentClassName: n
2676
2688
  }
2677
2689
  ),
2678
- d ? v ? /* @__PURE__ */ t(
2679
- tn,
2690
+ c ? v ? /* @__PURE__ */ e(
2691
+ Jr,
2680
2692
  {
2681
2693
  open: !0,
2682
2694
  onOpenChange: (C) => {
2683
- C || c(null);
2695
+ C || d(null);
2684
2696
  },
2685
- initialMode: d
2697
+ initialMode: c
2686
2698
  }
2687
- ) : /* @__PURE__ */ t(
2688
- Jr,
2699
+ ) : /* @__PURE__ */ e(
2700
+ Yr,
2689
2701
  {
2690
2702
  open: !0,
2691
2703
  onOpenChange: (C) => {
2692
- C || c(null);
2704
+ C || d(null);
2693
2705
  },
2694
2706
  showTrigger: !1,
2695
- initialMode: d
2707
+ initialMode: c
2696
2708
  }
2697
2709
  ) : null
2698
2710
  ] });
2699
2711
  }
2700
- function hn({
2701
- disabled: e,
2712
+ function cn({
2713
+ disabled: t,
2702
2714
  briefingCount: a,
2703
2715
  className: o,
2704
2716
  onClick: s
@@ -2710,25 +2722,25 @@ function hn({
2710
2722
  type: "button",
2711
2723
  size: "xs",
2712
2724
  variant: "outline",
2713
- disabled: e,
2725
+ disabled: t,
2714
2726
  className: J("gap-1.5", o),
2715
2727
  onClick: s,
2716
2728
  "aria-label": "Reports & briefings",
2717
2729
  children: [
2718
- /* @__PURE__ */ t(Ar, { className: "h-3.5 w-3.5" }),
2730
+ /* @__PURE__ */ e(Er, { className: "h-3.5 w-3.5" }),
2719
2731
  "Reports & briefings",
2720
- i ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2732
+ i ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2721
2733
  ]
2722
2734
  }
2723
2735
  );
2724
2736
  }
2725
- const mn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", qt = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", Ue = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
2726
- function pn(e) {
2727
- return e === "dashboard" ? "This dashboard" : "Project";
2737
+ const un = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Ht = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", Oe = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
2738
+ function hn(t) {
2739
+ return t === "dashboard" ? "This dashboard" : "Project";
2728
2740
  }
2729
- function fn(e) {
2730
- if (!e) return "Never";
2731
- const a = new Date(e);
2741
+ function mn(t) {
2742
+ if (!t) return "Never";
2743
+ const a = new Date(t);
2732
2744
  if (Number.isNaN(a.getTime())) return "Unknown";
2733
2745
  const o = Date.now() - a.getTime(), s = Math.round(o / 6e4);
2734
2746
  if (s < 1) return "now";
@@ -2737,41 +2749,41 @@ function fn(e) {
2737
2749
  if (i < 24) return `${i}h ago`;
2738
2750
  const n = Math.round(i / 24);
2739
2751
  if (n < 7) return `${n}d ago`;
2740
- const d = Math.round(n / 7);
2741
- return d < 5 ? `${d}w ago` : `${Math.round(n / 30)}mo ago`;
2752
+ const c = Math.round(n / 7);
2753
+ return c < 5 ? `${c}w ago` : `${Math.round(n / 30)}mo ago`;
2742
2754
  }
2743
- function gn(e) {
2744
- return e.scheduleExpr ? yr(
2745
- e.scheduleExpr,
2746
- e.timezone || "UTC"
2755
+ function pn(t) {
2756
+ return t.scheduleExpr ? Cr(
2757
+ t.scheduleExpr,
2758
+ t.timezone || "UTC"
2747
2759
  ) ?? "Invalid schedule" : "On demand";
2748
2760
  }
2749
- function bn(e) {
2750
- if (e.lastRunStatus) {
2751
- const a = e.lastRunStatus.toString().toUpperCase();
2752
- return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${e.lastRunStatus.toString().toLowerCase()}`;
2761
+ function fn(t) {
2762
+ if (t.lastRunStatus) {
2763
+ const a = t.lastRunStatus.toString().toUpperCase();
2764
+ return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${t.lastRunStatus.toString().toLowerCase()}`;
2753
2765
  }
2754
2766
  return null;
2755
2767
  }
2756
- function Qt(e) {
2757
- return e.hasActiveRun ? "Running" : e.lastRunStatus ? `Last run ${e.lastRunStatus.toString().toLowerCase()}` : "Idle";
2768
+ function Qt(t) {
2769
+ return t.hasActiveRun ? "Running" : t.lastRunStatus ? `Last run ${t.lastRunStatus.toString().toLowerCase()}` : "Idle";
2758
2770
  }
2759
- function xn(e) {
2760
- return e.source.type === "dashboard" ? "This dashboard" : "Project";
2771
+ function gn(t) {
2772
+ return t.source.type === "dashboard" ? "This dashboard" : "Project";
2761
2773
  }
2762
- function vn({
2763
- activeView: e,
2774
+ function bn({
2775
+ activeView: t,
2764
2776
  onChange: a
2765
2777
  }) {
2766
- return /* @__PURE__ */ t(
2778
+ return /* @__PURE__ */ e(
2767
2779
  "div",
2768
2780
  {
2769
2781
  className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
2770
2782
  role: "tablist",
2771
2783
  "aria-label": "Briefing source view",
2772
2784
  children: ["dashboard", "project"].map((o) => {
2773
- const s = e === o;
2774
- return /* @__PURE__ */ t(
2785
+ const s = t === o;
2786
+ return /* @__PURE__ */ e(
2775
2787
  "button",
2776
2788
  {
2777
2789
  type: "button",
@@ -2782,7 +2794,7 @@ function vn({
2782
2794
  "h-6 rounded-[3px] px-2 text-[11px] transition-colors",
2783
2795
  s ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
2784
2796
  ),
2785
- children: pn(o)
2797
+ children: hn(o)
2786
2798
  },
2787
2799
  o
2788
2800
  );
@@ -2790,61 +2802,61 @@ function vn({
2790
2802
  }
2791
2803
  );
2792
2804
  }
2793
- function yn({
2794
- briefings: e,
2805
+ function xn({
2806
+ briefings: t,
2795
2807
  dashboardLabel: a,
2796
2808
  sourceView: o,
2797
2809
  error: s,
2798
2810
  loading: i,
2799
2811
  onSourceViewChange: n,
2800
- onClose: d,
2801
- onEdit: c,
2812
+ onClose: c,
2813
+ onEdit: d,
2802
2814
  onNew: l,
2803
- canCreate: h,
2804
- canCreateScheduledReport: u,
2815
+ canCreate: u,
2816
+ canCreateScheduledReport: h,
2805
2817
  analyticalBriefingsEnabled: m,
2806
2818
  onRunNow: p,
2807
2819
  onTogglePause: g,
2808
2820
  onDelete: f,
2809
2821
  selectingId: v,
2810
- busyId: N,
2811
- manageBriefingsHref: T,
2812
- contentKind: U,
2813
- hideHeader: M = !1
2822
+ busyId: k,
2823
+ manageBriefingsHref: V,
2824
+ contentKind: M,
2825
+ hideHeader: U = !1
2814
2826
  }) {
2815
- const A = e.length, O = e.filter((S) => S.status === "ACTIVE").length, C = U === "reports" ? A === 1 ? "report" : "reports" : U === "briefings" ? A === 1 ? "briefing" : "briefings" : A === 1 ? "item" : "items", w = e.find((S) => S.hasActiveRun) ?? null, x = U ?? "reports & briefings", F = o === "dashboard" ? a : `Project ${x}`;
2827
+ const A = t.length, z = t.filter((S) => S.status === "ACTIVE").length, C = M === "reports" ? A === 1 ? "report" : "reports" : M === "briefings" ? A === 1 ? "briefing" : "briefings" : A === 1 ? "item" : "items", w = t.find((S) => S.hasActiveRun) ?? null, x = M ?? "reports & briefings", E = o === "dashboard" ? a : `Project ${x}`;
2816
2828
  return /* @__PURE__ */ r(
2817
2829
  "section",
2818
2830
  {
2819
2831
  "aria-label": `Dashboard ${x.replace("&", "and")}`,
2820
2832
  className: "flex h-full min-h-0 flex-col bg-background text-foreground",
2821
2833
  children: [
2822
- M ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
2834
+ U ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
2823
2835
  /* @__PURE__ */ r("div", { className: "min-w-0", children: [
2824
- /* @__PURE__ */ t("div", { className: mn, children: x }),
2825
- /* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: F })
2836
+ /* @__PURE__ */ e("div", { className: un, children: x }),
2837
+ /* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: E })
2826
2838
  ] }),
2827
- /* @__PURE__ */ t(
2839
+ /* @__PURE__ */ e(
2828
2840
  "button",
2829
2841
  {
2830
2842
  type: "button",
2831
- onClick: d,
2843
+ onClick: c,
2832
2844
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
2833
2845
  "aria-label": `Close ${x.replace("&", "and")} panel`,
2834
- children: /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5" })
2846
+ children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
2835
2847
  }
2836
2848
  )
2837
2849
  ] }),
2838
2850
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
2839
2851
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-3", children: [
2840
- /* @__PURE__ */ t(
2841
- vn,
2852
+ /* @__PURE__ */ e(
2853
+ bn,
2842
2854
  {
2843
2855
  activeView: o,
2844
2856
  onChange: n
2845
2857
  }
2846
2858
  ),
2847
- /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && A === 0 ? /* @__PURE__ */ r("span", { children: [
2859
+ /* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && A === 0 ? /* @__PURE__ */ r("span", { children: [
2848
2860
  "Loading ",
2849
2861
  x,
2850
2862
  "…"
@@ -2852,15 +2864,15 @@ function yn({
2852
2864
  "No ",
2853
2865
  x,
2854
2866
  " yet"
2855
- ] }) : /* @__PURE__ */ r(_, { children: [
2867
+ ] }) : /* @__PURE__ */ r(O, { children: [
2856
2868
  /* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
2857
2869
  A,
2858
2870
  " ",
2859
2871
  C
2860
2872
  ] }),
2861
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2873
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2862
2874
  /* @__PURE__ */ r("span", { children: [
2863
- O,
2875
+ z,
2864
2876
  " active"
2865
2877
  ] })
2866
2878
  ] }) })
@@ -2871,30 +2883,30 @@ function yn({
2871
2883
  // when a manual reload is in flight, but don't show a separate
2872
2884
  // refresh button — close+reopen handles the rare "stale list"
2873
2885
  // case without crowding the toolbar.
2874
- /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2886
+ /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2875
2887
  ) : null,
2876
- A > 0 && h ? m && u ? /* @__PURE__ */ r(Qe, { children: [
2877
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Ue, children: [
2878
- /* @__PURE__ */ t(be, { className: "h-3 w-3" }),
2888
+ A > 0 && u ? m && h ? /* @__PURE__ */ r(Le, { children: [
2889
+ /* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Oe, children: [
2890
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
2879
2891
  " New"
2880
2892
  ] }) }),
2881
- /* @__PURE__ */ r(Ke, { align: "end", children: [
2882
- /* @__PURE__ */ t(Y, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
2883
- /* @__PURE__ */ t(
2884
- Y,
2893
+ /* @__PURE__ */ r(Te, { align: "end", children: [
2894
+ /* @__PURE__ */ e(X, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
2895
+ /* @__PURE__ */ e(
2896
+ X,
2885
2897
  {
2886
2898
  onClick: () => l("analytical_briefing"),
2887
2899
  children: "Create analytical briefing"
2888
2900
  }
2889
2901
  )
2890
2902
  ] })
2891
- ] }) : u ? /* @__PURE__ */ r(
2903
+ ] }) : h ? /* @__PURE__ */ r(
2892
2904
  "button",
2893
2905
  {
2894
2906
  onClick: () => l("scheduled_report"),
2895
- className: Ue,
2907
+ className: Oe,
2896
2908
  children: [
2897
- /* @__PURE__ */ t(be, { className: "h-3 w-3" }),
2909
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
2898
2910
  " Schedule report"
2899
2911
  ]
2900
2912
  }
@@ -2902,9 +2914,9 @@ function yn({
2902
2914
  "button",
2903
2915
  {
2904
2916
  onClick: () => l("analytical_briefing"),
2905
- className: Ue,
2917
+ className: Oe,
2906
2918
  children: [
2907
- /* @__PURE__ */ t(be, { className: "h-3 w-3" }),
2919
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
2908
2920
  " New briefing"
2909
2921
  ]
2910
2922
  }
@@ -2912,30 +2924,30 @@ function yn({
2912
2924
  ] })
2913
2925
  ] }),
2914
2926
  w ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
2915
- /* @__PURE__ */ t(ne, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
2916
- /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: w.name }),
2917
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2918
- /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Qt(w) })
2927
+ /* @__PURE__ */ e(ne, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
2928
+ /* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: w.name }),
2929
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2930
+ /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: Qt(w) })
2919
2931
  ] }) : null,
2920
2932
  /* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
2921
- s ? /* @__PURE__ */ t("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: s }) : null,
2922
- !i && e.length === 0 && !s ? /* @__PURE__ */ t(
2923
- Cn,
2933
+ s ? /* @__PURE__ */ e("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: s }) : null,
2934
+ !i && t.length === 0 && !s ? /* @__PURE__ */ e(
2935
+ vn,
2924
2936
  {
2925
2937
  onNew: l,
2926
- canCreate: h,
2927
- canCreateScheduledReport: u,
2938
+ canCreate: u,
2939
+ canCreateScheduledReport: h,
2928
2940
  analyticalBriefingsEnabled: m,
2929
- contentKind: U
2941
+ contentKind: M
2930
2942
  }
2931
2943
  ) : null,
2932
- e.map((S) => /* @__PURE__ */ t(
2933
- Nn,
2944
+ t.map((S) => /* @__PURE__ */ e(
2945
+ Cn,
2934
2946
  {
2935
2947
  briefing: S,
2936
2948
  isOpening: v === S.id,
2937
- isBusy: N === S.id,
2938
- onOpen: () => c(S.id),
2949
+ isBusy: k === S.id,
2950
+ onOpen: () => d(S.id),
2939
2951
  onRunNow: () => p(S),
2940
2952
  onTogglePause: () => g(S),
2941
2953
  onDelete: () => f(S)
@@ -2943,14 +2955,14 @@ function yn({
2943
2955
  S.id
2944
2956
  ))
2945
2957
  ] }),
2946
- T ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
2958
+ V ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
2947
2959
  "a",
2948
2960
  {
2949
- href: T,
2950
- className: J(qt, "h-6 px-1 text-[11px]"),
2961
+ href: V,
2962
+ className: J(Ht, "h-6 px-1 text-[11px]"),
2951
2963
  children: [
2952
2964
  "Manage all reports & briefings",
2953
- /* @__PURE__ */ t(wr, { className: "h-3 w-3" })
2965
+ /* @__PURE__ */ e(Nr, { className: "h-3 w-3" })
2954
2966
  ]
2955
2967
  }
2956
2968
  ) }) : null
@@ -2958,8 +2970,8 @@ function yn({
2958
2970
  }
2959
2971
  );
2960
2972
  }
2961
- function Cn({
2962
- onNew: e,
2973
+ function vn({
2974
+ onNew: t,
2963
2975
  canCreate: a,
2964
2976
  canCreateScheduledReport: o,
2965
2977
  analyticalBriefingsEnabled: s,
@@ -2973,33 +2985,33 @@ function Cn({
2973
2985
  description: "Create an analytical briefing to monitor this dashboard and brief your team."
2974
2986
  } : null;
2975
2987
  return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
2976
- /* @__PURE__ */ t(wn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
2977
- /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: (n == null ? void 0 : n.title) ?? "Have an analyst brief your team" }),
2978
- /* @__PURE__ */ t("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (n == null ? void 0 : n.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
2988
+ /* @__PURE__ */ e(yn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
2989
+ /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (n == null ? void 0 : n.title) ?? "Have an analyst brief your team" }),
2990
+ /* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (n == null ? void 0 : n.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
2979
2991
  a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
2980
2992
  o ? /* @__PURE__ */ r(
2981
2993
  "button",
2982
2994
  {
2983
- onClick: () => e("scheduled_report"),
2984
- className: Ue,
2995
+ onClick: () => t("scheduled_report"),
2996
+ className: Oe,
2985
2997
  children: [
2986
- /* @__PURE__ */ t(be, { className: "h-3 w-3" }),
2998
+ /* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
2987
2999
  " Schedule a report"
2988
3000
  ]
2989
3001
  }
2990
3002
  ) : null,
2991
- s ? /* @__PURE__ */ t(
3003
+ s ? /* @__PURE__ */ e(
2992
3004
  "button",
2993
3005
  {
2994
- onClick: () => e("analytical_briefing"),
2995
- className: qt,
3006
+ onClick: () => t("analytical_briefing"),
3007
+ className: Ht,
2996
3008
  children: "Create analytical briefing"
2997
3009
  }
2998
3010
  ) : null
2999
3011
  ] }) : null
3000
3012
  ] });
3001
3013
  }
3002
- function wn({ className: e }) {
3014
+ function yn({ className: t }) {
3003
3015
  return /* @__PURE__ */ r(
3004
3016
  "svg",
3005
3017
  {
@@ -3008,9 +3020,9 @@ function wn({ className: e }) {
3008
3020
  xmlns: "http://www.w3.org/2000/svg",
3009
3021
  role: "presentation",
3010
3022
  "aria-hidden": "true",
3011
- className: e,
3023
+ className: t,
3012
3024
  children: [
3013
- /* @__PURE__ */ t(
3025
+ /* @__PURE__ */ e(
3014
3026
  "rect",
3015
3027
  {
3016
3028
  x: "22",
@@ -3022,7 +3034,7 @@ function wn({ className: e }) {
3022
3034
  strokeWidth: "1.25"
3023
3035
  }
3024
3036
  ),
3025
- /* @__PURE__ */ t(
3037
+ /* @__PURE__ */ e(
3026
3038
  "line",
3027
3039
  {
3028
3040
  x1: "30",
@@ -3034,7 +3046,7 @@ function wn({ className: e }) {
3034
3046
  strokeLinecap: "round"
3035
3047
  }
3036
3048
  ),
3037
- /* @__PURE__ */ t(
3049
+ /* @__PURE__ */ e(
3038
3050
  "line",
3039
3051
  {
3040
3052
  x1: "30",
@@ -3047,8 +3059,8 @@ function wn({ className: e }) {
3047
3059
  opacity: "0.5"
3048
3060
  }
3049
3061
  ),
3050
- /* @__PURE__ */ t("circle", { cx: "31", cy: "32", r: "1", fill: "currentColor", opacity: "0.6" }),
3051
- /* @__PURE__ */ t(
3062
+ /* @__PURE__ */ e("circle", { cx: "31", cy: "32", r: "1", fill: "currentColor", opacity: "0.6" }),
3063
+ /* @__PURE__ */ e(
3052
3064
  "line",
3053
3065
  {
3054
3066
  x1: "35",
@@ -3061,8 +3073,8 @@ function wn({ className: e }) {
3061
3073
  strokeLinecap: "round"
3062
3074
  }
3063
3075
  ),
3064
- /* @__PURE__ */ t("circle", { cx: "31", cy: "38", r: "1", fill: "currentColor", opacity: "0.6" }),
3065
- /* @__PURE__ */ t(
3076
+ /* @__PURE__ */ e("circle", { cx: "31", cy: "38", r: "1", fill: "currentColor", opacity: "0.6" }),
3077
+ /* @__PURE__ */ e(
3066
3078
  "line",
3067
3079
  {
3068
3080
  x1: "35",
@@ -3075,8 +3087,8 @@ function wn({ className: e }) {
3075
3087
  strokeLinecap: "round"
3076
3088
  }
3077
3089
  ),
3078
- /* @__PURE__ */ t("circle", { cx: "31", cy: "44", r: "1", fill: "currentColor", opacity: "0.6" }),
3079
- /* @__PURE__ */ t(
3090
+ /* @__PURE__ */ e("circle", { cx: "31", cy: "44", r: "1", fill: "currentColor", opacity: "0.6" }),
3091
+ /* @__PURE__ */ e(
3080
3092
  "line",
3081
3093
  {
3082
3094
  x1: "35",
@@ -3089,7 +3101,7 @@ function wn({ className: e }) {
3089
3101
  strokeLinecap: "round"
3090
3102
  }
3091
3103
  ),
3092
- /* @__PURE__ */ t(
3104
+ /* @__PURE__ */ e(
3093
3105
  "rect",
3094
3106
  {
3095
3107
  x: "30",
@@ -3101,7 +3113,7 @@ function wn({ className: e }) {
3101
3113
  opacity: "0.55"
3102
3114
  }
3103
3115
  ),
3104
- /* @__PURE__ */ t(
3116
+ /* @__PURE__ */ e(
3105
3117
  "rect",
3106
3118
  {
3107
3119
  x: "38",
@@ -3113,7 +3125,7 @@ function wn({ className: e }) {
3113
3125
  opacity: "0.7"
3114
3126
  }
3115
3127
  ),
3116
- /* @__PURE__ */ t(
3128
+ /* @__PURE__ */ e(
3117
3129
  "rect",
3118
3130
  {
3119
3131
  x: "46",
@@ -3125,7 +3137,7 @@ function wn({ className: e }) {
3125
3137
  opacity: "0.85"
3126
3138
  }
3127
3139
  ),
3128
- /* @__PURE__ */ t(
3140
+ /* @__PURE__ */ e(
3129
3141
  "rect",
3130
3142
  {
3131
3143
  x: "54",
@@ -3137,7 +3149,7 @@ function wn({ className: e }) {
3137
3149
  opacity: "0.6"
3138
3150
  }
3139
3151
  ),
3140
- /* @__PURE__ */ t(
3152
+ /* @__PURE__ */ e(
3141
3153
  "rect",
3142
3154
  {
3143
3155
  x: "62",
@@ -3149,7 +3161,7 @@ function wn({ className: e }) {
3149
3161
  opacity: "0.75"
3150
3162
  }
3151
3163
  ),
3152
- /* @__PURE__ */ t(
3164
+ /* @__PURE__ */ e(
3153
3165
  "circle",
3154
3166
  {
3155
3167
  cx: "86",
@@ -3160,7 +3172,7 @@ function wn({ className: e }) {
3160
3172
  strokeWidth: "1.25"
3161
3173
  }
3162
3174
  ),
3163
- /* @__PURE__ */ t(
3175
+ /* @__PURE__ */ e(
3164
3176
  "line",
3165
3177
  {
3166
3178
  x1: "93.5",
@@ -3176,22 +3188,22 @@ function wn({ className: e }) {
3176
3188
  }
3177
3189
  );
3178
3190
  }
3179
- function Nn({
3180
- briefing: e,
3191
+ function Cn({
3192
+ briefing: t,
3181
3193
  isOpening: a,
3182
3194
  isBusy: o,
3183
3195
  onOpen: s,
3184
3196
  onRunNow: i,
3185
3197
  onTogglePause: n,
3186
- onDelete: d
3198
+ onDelete: c
3187
3199
  }) {
3188
- const c = e.status === "PAUSED", l = e.hasActiveRun, h = bn(e), u = fn(e.lastRunAt), m = e.lastRunStatus, p = le(e), g = m === "SUCCESS" ? Be.success.dot : m === "FAILED" ? Be.danger.dot : m ? Be.warning.dot : Be.neutral.dot;
3200
+ const d = t.status === "PAUSED", l = t.hasActiveRun, u = fn(t), h = mn(t.lastRunAt), m = t.lastRunStatus, p = le(t), g = m === "SUCCESS" ? Re.success.dot : m === "FAILED" ? Re.danger.dot : m ? Re.warning.dot : Re.neutral.dot;
3189
3201
  return /* @__PURE__ */ r(
3190
3202
  "div",
3191
3203
  {
3192
3204
  className: J(
3193
3205
  "group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
3194
- c && "opacity-70"
3206
+ d && "opacity-70"
3195
3207
  ),
3196
3208
  children: [
3197
3209
  /* @__PURE__ */ r(
@@ -3206,26 +3218,26 @@ function Nn({
3206
3218
  className: "cursor-pointer pr-8",
3207
3219
  children: [
3208
3220
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
3209
- /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
3210
- c ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
3221
+ /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
3222
+ d ? /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
3211
3223
  ] }),
3212
3224
  /* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
3213
- /* @__PURE__ */ t("span", { children: p.typeLabel }),
3214
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
3215
- /* @__PURE__ */ t("span", { children: xn(e) }),
3216
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
3217
- /* @__PURE__ */ t(Ra, { className: "h-3 w-3" }),
3218
- /* @__PURE__ */ t("span", { className: "truncate", children: gn(e) }),
3219
- e.lastRunAt ? /* @__PURE__ */ r(_, { children: [
3220
- /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
3225
+ /* @__PURE__ */ e("span", { children: p.typeLabel }),
3226
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
3227
+ /* @__PURE__ */ e("span", { children: gn(t) }),
3228
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
3229
+ /* @__PURE__ */ e(Ma, { className: "h-3 w-3" }),
3230
+ /* @__PURE__ */ e("span", { className: "truncate", children: pn(t) }),
3231
+ t.lastRunAt ? /* @__PURE__ */ r(O, { children: [
3232
+ /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
3221
3233
  /* @__PURE__ */ r("span", { children: [
3222
3234
  "Last run ",
3223
- u
3235
+ h
3224
3236
  ] })
3225
3237
  ] }) : null
3226
3238
  ] }),
3227
- h || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
3228
- l ? /* @__PURE__ */ t(ne, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
3239
+ u || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
3240
+ l ? /* @__PURE__ */ e(ne, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
3229
3241
  "span",
3230
3242
  {
3231
3243
  className: J(
@@ -3234,65 +3246,65 @@ function Nn({
3234
3246
  )
3235
3247
  }
3236
3248
  ),
3237
- /* @__PURE__ */ t("span", { className: "truncate", children: l ? Qt(e) : h })
3249
+ /* @__PURE__ */ e("span", { className: "truncate", children: l ? Qt(t) : u })
3238
3250
  ] }) : null
3239
3251
  ]
3240
3252
  }
3241
3253
  ),
3242
- /* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(Qe, { children: [
3243
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ t(
3254
+ /* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(Le, { children: [
3255
+ /* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
3244
3256
  "button",
3245
3257
  {
3246
3258
  type: "button",
3247
3259
  onClick: (f) => f.stopPropagation(),
3248
3260
  className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
3249
3261
  "aria-label": `${p.noun === "report" ? "Report" : "Briefing"} actions`,
3250
- children: /* @__PURE__ */ t(Lt, { className: "h-3.5 w-3.5" })
3262
+ children: /* @__PURE__ */ e(Tt, { className: "h-3.5 w-3.5" })
3251
3263
  }
3252
3264
  ) }),
3253
- /* @__PURE__ */ r(Ke, { align: "end", className: "w-44", children: [
3254
- /* @__PURE__ */ r(Y, { onClick: s, children: [
3255
- /* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" }),
3265
+ /* @__PURE__ */ r(Te, { align: "end", className: "w-44", children: [
3266
+ /* @__PURE__ */ r(X, { onClick: s, children: [
3267
+ /* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" }),
3256
3268
  "Edit ",
3257
3269
  p.noun
3258
3270
  ] }),
3259
3271
  /* @__PURE__ */ r(
3260
- Y,
3272
+ X,
3261
3273
  {
3262
3274
  onClick: (f) => {
3263
3275
  f.preventDefault(), i();
3264
3276
  },
3265
3277
  children: [
3266
- /* @__PURE__ */ t(Oa, { className: "h-3.5 w-3.5" }),
3278
+ /* @__PURE__ */ e(Ua, { className: "h-3.5 w-3.5" }),
3267
3279
  "Run now"
3268
3280
  ]
3269
3281
  }
3270
3282
  ),
3271
- e.scheduleExpr ? /* @__PURE__ */ t(
3272
- Y,
3283
+ t.scheduleExpr ? /* @__PURE__ */ e(
3284
+ X,
3273
3285
  {
3274
3286
  onClick: (f) => {
3275
3287
  f.preventDefault(), n();
3276
3288
  },
3277
- children: c ? /* @__PURE__ */ r(_, { children: [
3278
- /* @__PURE__ */ t(_a, { className: "h-3.5 w-3.5" }),
3289
+ children: d ? /* @__PURE__ */ r(O, { children: [
3290
+ /* @__PURE__ */ e(Ra, { className: "h-3.5 w-3.5" }),
3279
3291
  "Resume"
3280
- ] }) : /* @__PURE__ */ r(_, { children: [
3281
- /* @__PURE__ */ t(za, { className: "h-3.5 w-3.5" }),
3292
+ ] }) : /* @__PURE__ */ r(O, { children: [
3293
+ /* @__PURE__ */ e(za, { className: "h-3.5 w-3.5" }),
3282
3294
  "Pause"
3283
3295
  ] })
3284
3296
  }
3285
3297
  ) : null,
3286
- /* @__PURE__ */ t(ze, {}),
3298
+ /* @__PURE__ */ e(je, {}),
3287
3299
  /* @__PURE__ */ r(
3288
- Y,
3300
+ X,
3289
3301
  {
3290
3302
  onClick: (f) => {
3291
- f.preventDefault(), d();
3303
+ f.preventDefault(), c();
3292
3304
  },
3293
3305
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
3294
3306
  children: [
3295
- /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
3307
+ /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
3296
3308
  "Delete ",
3297
3309
  p.noun
3298
3310
  ]
@@ -3304,114 +3316,114 @@ function Nn({
3304
3316
  }
3305
3317
  );
3306
3318
  }
3307
- function Sn(e) {
3308
- return (e == null ? void 0 : e.trim()) || "This dashboard";
3319
+ function wn(t) {
3320
+ return (t == null ? void 0 : t.trim()) || "This dashboard";
3309
3321
  }
3310
- function kn(e) {
3311
- return e === "This dashboard" ? "Watch this dashboard" : `Watch ${e}`;
3322
+ function Nn(t) {
3323
+ return t === "This dashboard" ? "Watch this dashboard" : `Watch ${t}`;
3312
3324
  }
3313
- function Dn(e, a, o) {
3314
- return a !== "dashboard" ? e : e.filter(
3325
+ function Sn(t, a, o) {
3326
+ return a !== "dashboard" ? t : t.filter(
3315
3327
  (s) => s.source.type === "dashboard" && s.source.dashboardId === o
3316
3328
  );
3317
3329
  }
3318
- async function An(e) {
3330
+ async function kn(t) {
3319
3331
  const o = [];
3320
3332
  let s = 1, i = 0, n = Number.POSITIVE_INFINITY;
3321
3333
  for (; i < n; ) {
3322
- const d = await e.apiClient.listBriefings(
3323
- e.apiServiceUrl,
3324
- e.token,
3334
+ const c = await t.apiClient.listBriefings(
3335
+ t.apiServiceUrl,
3336
+ t.token,
3325
3337
  { scope: "organization", page: s, pageSize: 100 }
3326
3338
  );
3327
- if (o.push(...d.briefings), i += d.briefings.length, n = d.total, d.briefings.length === 0 || i >= n) break;
3339
+ if (o.push(...c.briefings), i += c.briefings.length, n = c.total, c.briefings.length === 0 || i >= n) break;
3328
3340
  s += 1;
3329
3341
  }
3330
3342
  return o;
3331
3343
  }
3332
- const Fn = {
3333
- listBriefings: Xa,
3334
- getBriefing: Ga,
3335
- pauseBriefing: Ka,
3336
- resumeBriefing: Ha,
3337
- deleteBriefing: Qa,
3338
- runBriefingNow: qa
3344
+ const Dn = {
3345
+ listBriefings: Ga,
3346
+ getBriefing: Qa,
3347
+ pauseBriefing: Ha,
3348
+ resumeBriefing: qa,
3349
+ deleteBriefing: Wa,
3350
+ runBriefingNow: $a
3339
3351
  };
3340
- function hs(e) {
3341
- return /* @__PURE__ */ t(ja, { authToken: e.token ? { accessToken: e.token } : void 0, children: /* @__PURE__ */ t($a, { children: /* @__PURE__ */ t(In, { ...e }) }) });
3352
+ function us(t) {
3353
+ return /* @__PURE__ */ e(Oa, { authToken: t.token ? { accessToken: t.token } : void 0, children: /* @__PURE__ */ e(_a, { children: /* @__PURE__ */ e(An, { ...t }) }) });
3342
3354
  }
3343
- function In({
3344
- dashboardId: e,
3355
+ function An({
3356
+ dashboardId: t,
3345
3357
  dashboardTitle: a,
3346
3358
  apiServiceUrl: o,
3347
3359
  token: s,
3348
3360
  disabled: i,
3349
3361
  className: n,
3350
- manageBriefingsHref: d,
3351
- open: c,
3362
+ manageBriefingsHref: c,
3363
+ open: d,
3352
3364
  onOpenChange: l,
3353
- hideTrigger: h = !1,
3354
- workflowIntent: u,
3365
+ hideTrigger: u = !1,
3366
+ workflowIntent: h,
3355
3367
  openRun: m,
3356
3368
  client: p
3357
3369
  }) {
3358
- const { authToken: g, tokenProps: f } = Et(), v = Wa(), N = !u || v.canCreate && (u === "scheduled_report" || v.analyticalBriefingsEnabled), [T, U] = k(!1), M = c ?? T, A = (y) => {
3359
- c === void 0 && U(y), l == null || l(y);
3360
- }, [O, C] = k(
3361
- u ? "author" : "list"
3362
- ), [w, x] = k(
3363
- u ?? "analytical_briefing"
3364
- ), [F, S] = k("dashboard"), [j, I] = k(
3370
+ const { authToken: g, tokenProps: f } = It(), v = ja(), k = !h || v.canCreate && (h === "scheduled_report" || v.analyticalBriefingsEnabled), [V, M] = D(!1), U = d ?? V, A = (y) => {
3371
+ d === void 0 && M(y), l == null || l(y);
3372
+ }, [z, C] = D(
3373
+ h ? "author" : "list"
3374
+ ), [w, x] = D(
3375
+ h ?? "analytical_briefing"
3376
+ ), [E, S] = D("dashboard"), [j, I] = D(
3365
3377
  []
3366
- ), [V, Z] = k(null), K = u && !N && !V ? "list" : O, [Q, H] = k(!1), [ce, z] = k(null), [ye, X] = k(null), [R, te] = k(
3378
+ ), [T, Z] = D(null), G = h && !k && !T ? "list" : z, [H, Q] = D(!1), [ce, _] = D(null), [ye, Y] = D(null), [R, te] = D(
3367
3379
  null
3368
- ), [me, pe] = k(null), Ce = rt(null), Ee = rt(M);
3369
- ge(() => {
3370
- const y = M && !Ee.current;
3371
- Ee.current = M, !(!y || !u) && (Z(null), S("dashboard"), x(u), C("author"), pe(null));
3372
- }, [M, u]);
3373
- const Xe = vt(), $ = o ?? (f == null ? void 0 : f.apiServiceUrl), W = s ?? (g == null ? void 0 : g.accessToken), se = re(() => ({ ...Fn, ...p }), [p]), [we, Ye] = k(null);
3374
- ge(() => {
3380
+ ), [me, pe] = D(null), Ce = nt(null), Be = nt(U);
3381
+ be(() => {
3382
+ const y = U && !Be.current;
3383
+ Be.current = U, !(!y || !h) && (Z(null), S("dashboard"), x(h), C("author"), pe(null));
3384
+ }, [U, h]);
3385
+ const Ye = vt(), $ = o ?? (f == null ? void 0 : f.apiServiceUrl), W = s ?? (g == null ? void 0 : g.accessToken), se = re(() => ({ ...Dn, ...p }), [p]), [we, Ze] = D(null);
3386
+ be(() => {
3375
3387
  if (!m || !$ || !W) return;
3376
3388
  let y = !0;
3377
3389
  return se.getBriefing($, W, m.briefingId).then(({ briefing: P }) => {
3378
- y && (Z(P), Ye(m), C("author"));
3390
+ y && (Z(P), Ze(m), C("author"));
3379
3391
  }, (P) => {
3380
- y && E.error(P instanceof Error ? P.message : "Could not open the run.");
3392
+ y && F.error(P instanceof Error ? P.message : "Could not open the run.");
3381
3393
  }), () => {
3382
3394
  y = !1;
3383
3395
  };
3384
3396
  }, [m, $, W, se]);
3385
- const fe = Sn(a), Te = re(() => {
3386
- const y = Dn(
3397
+ const ge = wn(a), Pe = re(() => {
3398
+ const y = Sn(
3387
3399
  j,
3388
- F,
3389
- e
3400
+ E,
3401
+ t
3390
3402
  );
3391
- if (!u)
3403
+ if (!h)
3392
3404
  return y;
3393
- const P = u === "scheduled_report" ? "report" : "briefing";
3405
+ const P = h === "scheduled_report" ? "report" : "briefing";
3394
3406
  return y.filter(
3395
- (Ve) => le(Ve).noun === P
3407
+ (Me) => le(Me).noun === P
3396
3408
  );
3397
- }, [e, j, F, u]), Ze = re(() => F === "dashboard" ? {
3398
- source: { type: "dashboard", dashboardId: e },
3399
- label: fe,
3400
- detail: kn(fe)
3409
+ }, [t, j, E, h]), Je = re(() => E === "dashboard" ? {
3410
+ source: { type: "dashboard", dashboardId: t },
3411
+ label: ge,
3412
+ detail: Nn(ge)
3401
3413
  } : {
3402
3414
  source: { type: "project" },
3403
3415
  label: "This project",
3404
3416
  detail: "Use any data in this project."
3405
- }, [e, fe, F]), Ne = !!($ && W), Se = Cr({
3417
+ }, [t, ge, E]), Ne = !!($ && W), Se = wr({
3406
3418
  canCreate: v.canCreate,
3407
3419
  analyticalBriefingsEnabled: v.analyticalBriefingsEnabled,
3408
- scheduledReportAvailable: F === "dashboard"
3420
+ scheduledReportAvailable: E === "dashboard"
3409
3421
  }), oe = ae(async () => {
3410
3422
  if (!(!$ || !W)) {
3411
- H(!0), pe(null);
3423
+ Q(!0), pe(null);
3412
3424
  try {
3413
3425
  I(
3414
- await An({
3426
+ await kn({
3415
3427
  apiClient: se,
3416
3428
  apiServiceUrl: $,
3417
3429
  token: W
@@ -3422,20 +3434,20 @@ function In({
3422
3434
  y instanceof Error ? y.message : "Could not load briefings."
3423
3435
  );
3424
3436
  } finally {
3425
- H(!1);
3437
+ Q(!1);
3426
3438
  }
3427
3439
  }
3428
3440
  }, [se, $, W]);
3429
- ge(() => {
3430
- !M || K !== "list" || !Ne || oe();
3431
- }, [Ne, K, oe, M]);
3441
+ be(() => {
3442
+ !U || G !== "list" || !Ne || oe();
3443
+ }, [Ne, G, oe, U]);
3432
3444
  const ke = () => {
3433
3445
  Z(null), S("dashboard"), C("list"), A(!0);
3434
3446
  }, b = (y) => {
3435
3447
  Z(null), x(y), C("author");
3436
3448
  }, B = async (y) => {
3437
3449
  if (!(!$ || !W)) {
3438
- z(y), pe(null);
3450
+ _(y), pe(null);
3439
3451
  try {
3440
3452
  const P = await se.getBriefing(
3441
3453
  $,
@@ -3448,34 +3460,34 @@ function In({
3448
3460
  P instanceof Error ? P.message : "Could not open briefing."
3449
3461
  );
3450
3462
  } finally {
3451
- z(null);
3463
+ _(null);
3452
3464
  }
3453
3465
  }
3454
3466
  }, q = async (y) => {
3455
3467
  if (!(!$ || !W)) {
3456
- X(y.id);
3468
+ Y(y.id);
3457
3469
  try {
3458
3470
  const P = await se.runBriefingNow(
3459
3471
  $,
3460
3472
  W,
3461
3473
  y.id,
3462
- { requestId: En() }
3474
+ { requestId: Fn() }
3463
3475
  );
3464
- Xe.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }), oe();
3476
+ Ye.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }), oe();
3465
3477
  } catch (P) {
3466
- E.error(
3478
+ F.error(
3467
3479
  P instanceof Error ? P.message : "Could not start the run."
3468
3480
  );
3469
3481
  } finally {
3470
- X(null);
3482
+ Y(null);
3471
3483
  }
3472
3484
  }
3473
3485
  }, ie = async (y) => {
3474
3486
  if (!$ || !W) return;
3475
- const { noun: P } = le(y), Ve = P === "report" ? "Report" : "Briefing";
3476
- X(y.id);
3487
+ const { noun: P } = le(y), Me = P === "report" ? "Report" : "Briefing";
3488
+ Y(y.id);
3477
3489
  try {
3478
- const Le = y.status === "PAUSED" ? await se.resumeBriefing(
3490
+ const Ue = y.status === "PAUSED" ? await se.resumeBriefing(
3479
3491
  $,
3480
3492
  W,
3481
3493
  y.id
@@ -3484,20 +3496,20 @@ function In({
3484
3496
  W,
3485
3497
  y.id
3486
3498
  );
3487
- E.success(
3488
- Le.briefing.status === "PAUSED" ? `${Ve} paused` : `${Ve} resumed`
3499
+ F.success(
3500
+ Ue.briefing.status === "PAUSED" ? `${Me} paused` : `${Me} resumed`
3489
3501
  ), oe();
3490
- } catch (Le) {
3491
- E.error(
3492
- Le instanceof Error ? Le.message : `Could not update the ${P} status.`
3502
+ } catch (Ue) {
3503
+ F.error(
3504
+ Ue instanceof Error ? Ue.message : `Could not update the ${P} status.`
3493
3505
  );
3494
3506
  } finally {
3495
- X(null);
3507
+ Y(null);
3496
3508
  }
3497
3509
  }, ue = async () => {
3498
3510
  if (!R || !$ || !W) return;
3499
3511
  const y = R;
3500
- X(y.id);
3512
+ Y(y.id);
3501
3513
  try {
3502
3514
  await se.deleteBriefing(
3503
3515
  $,
@@ -3505,27 +3517,27 @@ function In({
3505
3517
  y.id
3506
3518
  );
3507
3519
  const { noun: P } = le(y);
3508
- E.success(`${P === "report" ? "Report" : "Briefing"} deleted`), te(null), oe();
3520
+ F.success(`${P === "report" ? "Report" : "Briefing"} deleted`), te(null), oe();
3509
3521
  } catch (P) {
3510
- E.error(
3522
+ F.error(
3511
3523
  P instanceof Error ? P.message : "Could not delete the briefing."
3512
3524
  );
3513
3525
  } finally {
3514
- X(null);
3526
+ Y(null);
3515
3527
  }
3516
- }, Ht = Te.length;
3517
- return v.surfaceVisible ? /* @__PURE__ */ r(Ya, { open: M, onOpenChange: A, children: [
3518
- h ? null : /* @__PURE__ */ t(
3519
- hn,
3528
+ }, Gt = Pe.length;
3529
+ return v.surfaceVisible ? /* @__PURE__ */ r(Ka, { open: U, onOpenChange: A, children: [
3530
+ u ? null : /* @__PURE__ */ e(
3531
+ cn,
3520
3532
  {
3521
3533
  disabled: i || !Ne,
3522
- briefingCount: Ht,
3534
+ briefingCount: Gt,
3523
3535
  className: n,
3524
3536
  onClick: ke
3525
3537
  }
3526
3538
  ),
3527
3539
  /* @__PURE__ */ r(
3528
- Za,
3540
+ Xa,
3529
3541
  {
3530
3542
  ref: Ce,
3531
3543
  side: "right",
@@ -3536,79 +3548,79 @@ function In({
3536
3548
  y.preventDefault(), (P = Ce.current) == null || P.focus({ preventScroll: !0 });
3537
3549
  },
3538
3550
  children: [
3539
- /* @__PURE__ */ r(Ja, { className: "sr-only", children: [
3540
- /* @__PURE__ */ t(er, { children: "Reports & briefings" }),
3541
- /* @__PURE__ */ t(tr, { children: "Manage reports and briefings for this dashboard." })
3551
+ /* @__PURE__ */ r(Ya, { className: "sr-only", children: [
3552
+ /* @__PURE__ */ e(Za, { children: "Reports & briefings" }),
3553
+ /* @__PURE__ */ e(Ja, { children: "Manage reports and briefings for this dashboard." })
3542
3554
  ] }),
3543
- u ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
3555
+ h ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
3544
3556
  /* @__PURE__ */ r(
3545
3557
  "div",
3546
3558
  {
3547
3559
  className: "flex items-center gap-5",
3548
3560
  role: "tablist",
3549
- "aria-label": u === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
3561
+ "aria-label": h === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
3550
3562
  children: [
3551
- /* @__PURE__ */ t(
3563
+ /* @__PURE__ */ e(
3552
3564
  "button",
3553
3565
  {
3554
3566
  type: "button",
3555
3567
  role: "tab",
3556
- "aria-selected": K === "author",
3557
- disabled: !N,
3568
+ "aria-selected": G === "author",
3569
+ disabled: !k,
3558
3570
  className: J(
3559
3571
  "-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
3560
- K === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
3561
- !N && "cursor-not-allowed opacity-50"
3572
+ G === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
3573
+ !k && "cursor-not-allowed opacity-50"
3562
3574
  ),
3563
3575
  onClick: () => {
3564
- N && (Z(null), x(u), S("dashboard"), C("author"));
3576
+ k && (Z(null), x(h), S("dashboard"), C("author"));
3565
3577
  },
3566
- children: V ? `Edit ${le(V).noun}` : u === "scheduled_report" ? "Schedule report" : "Create briefing"
3578
+ children: T ? `Edit ${le(T).noun}` : h === "scheduled_report" ? "Schedule report" : "Create briefing"
3567
3579
  }
3568
3580
  ),
3569
- /* @__PURE__ */ t(
3581
+ /* @__PURE__ */ e(
3570
3582
  "button",
3571
3583
  {
3572
3584
  type: "button",
3573
3585
  role: "tab",
3574
- "aria-selected": K === "list",
3586
+ "aria-selected": G === "list",
3575
3587
  className: J(
3576
3588
  "-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
3577
- K === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3589
+ G === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3578
3590
  ),
3579
3591
  onClick: () => C("list"),
3580
- children: u === "scheduled_report" ? "Manage reports" : "Manage briefings"
3592
+ children: h === "scheduled_report" ? "Manage reports" : "Manage briefings"
3581
3593
  }
3582
3594
  )
3583
3595
  ]
3584
3596
  }
3585
3597
  ),
3586
- /* @__PURE__ */ t(
3598
+ /* @__PURE__ */ e(
3587
3599
  "button",
3588
3600
  {
3589
3601
  type: "button",
3590
3602
  onClick: () => A(!1),
3591
3603
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
3592
- "aria-label": u === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
3593
- children: /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5" })
3604
+ "aria-label": h === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
3605
+ children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
3594
3606
  }
3595
3607
  )
3596
3608
  ] }) : null,
3597
- K === "list" ? /* @__PURE__ */ t(
3598
- yn,
3609
+ G === "list" ? /* @__PURE__ */ e(
3610
+ xn,
3599
3611
  {
3600
- briefings: Te,
3601
- dashboardLabel: fe,
3602
- sourceView: F,
3612
+ briefings: Pe,
3613
+ dashboardLabel: ge,
3614
+ sourceView: E,
3603
3615
  error: me,
3604
- loading: Q,
3616
+ loading: H,
3605
3617
  onSourceViewChange: S,
3606
3618
  onClose: () => A(!1),
3607
3619
  onEdit: (y) => {
3608
3620
  B(y);
3609
3621
  },
3610
3622
  onNew: b,
3611
- canCreate: !u && Se.length > 0,
3623
+ canCreate: !h && Se.length > 0,
3612
3624
  canCreateScheduledReport: Se.includes(
3613
3625
  "scheduled_report"
3614
3626
  ),
@@ -3624,27 +3636,27 @@ function In({
3624
3636
  onDelete: (y) => te(y),
3625
3637
  selectingId: ce,
3626
3638
  busyId: ye,
3627
- manageBriefingsHref: d,
3628
- contentKind: u === "scheduled_report" ? "reports" : u === "analytical_briefing" ? "briefings" : void 0,
3629
- hideHeader: !!u
3639
+ manageBriefingsHref: c,
3640
+ contentKind: h === "scheduled_report" ? "reports" : h === "analytical_briefing" ? "briefings" : void 0,
3641
+ hideHeader: !!h
3630
3642
  }
3631
- ) : /* @__PURE__ */ t(
3632
- ar,
3643
+ ) : /* @__PURE__ */ e(
3644
+ er,
3633
3645
  {
3634
3646
  apiServiceUrl: $,
3635
3647
  token: W,
3636
- briefing: V,
3637
- initialRunId: we && (V == null ? void 0 : V.id) === we.briefingId ? we.runId : void 0,
3648
+ briefing: T,
3649
+ initialRunId: we && (T == null ? void 0 : T.id) === we.briefingId ? we.runId : void 0,
3638
3650
  intent: w,
3639
- sourceContext: V ? void 0 : Ze,
3640
- title: V ? `Edit ${le(V).noun}` : w === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3641
- hideHeader: !!u,
3651
+ sourceContext: T ? void 0 : Je,
3652
+ title: T ? `Edit ${le(T).noun}` : w === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3653
+ hideHeader: !!h,
3642
3654
  className: "h-full min-h-0 max-w-none border-0 shadow-none",
3643
- onBack: u ? void 0 : () => C("list"),
3655
+ onBack: h ? void 0 : () => C("list"),
3644
3656
  onCancel: () => A(!1),
3645
3657
  onDeleted: () => {
3646
- const y = V ? le(V).noun : "briefing";
3647
- E.success(`${y === "report" ? "Report" : "Briefing"} deleted`), Z(null), C("list"), oe();
3658
+ const y = T ? le(T).noun : "briefing";
3659
+ F.success(`${y === "report" ? "Report" : "Briefing"} deleted`), Z(null), C("list"), oe();
3648
3660
  },
3649
3661
  onRunStarted: () => {
3650
3662
  },
@@ -3659,7 +3671,7 @@ function In({
3659
3671
  ]
3660
3672
  }
3661
3673
  ),
3662
- /* @__PURE__ */ t(
3674
+ /* @__PURE__ */ e(
3663
3675
  lt,
3664
3676
  {
3665
3677
  open: !!R,
@@ -3676,12 +3688,12 @@ function In({
3676
3688
  ] }),
3677
3689
  /* @__PURE__ */ r(ht, { children: [
3678
3690
  "This permanently deletes ",
3679
- /* @__PURE__ */ t("strong", { children: R == null ? void 0 : R.name }),
3691
+ /* @__PURE__ */ e("strong", { children: R == null ? void 0 : R.name }),
3680
3692
  ". Recipients will stop receiving it."
3681
3693
  ] })
3682
3694
  ] }),
3683
3695
  /* @__PURE__ */ r(mt, { children: [
3684
- /* @__PURE__ */ t(pt, { children: "Cancel" }),
3696
+ /* @__PURE__ */ e(pt, { children: "Cancel" }),
3685
3697
  /* @__PURE__ */ r(
3686
3698
  Vt,
3687
3699
  {
@@ -3700,21 +3712,23 @@ function In({
3700
3712
  )
3701
3713
  ] }) : null;
3702
3714
  }
3703
- function En() {
3715
+ function Fn() {
3704
3716
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
3705
3717
  }
3706
3718
  export {
3707
- is as A,
3708
- Jr as D,
3709
- ls as U,
3710
- ns as V,
3711
- hn as W,
3712
- os as a,
3713
- cs as b,
3714
- tn as c,
3715
- on as d,
3716
- us as e,
3717
- hs as f,
3718
- ds as i,
3719
- ss as u
3719
+ ns as A,
3720
+ Yr as D,
3721
+ os as S,
3722
+ is as U,
3723
+ ts as V,
3724
+ cn as W,
3725
+ rs as a,
3726
+ ss as b,
3727
+ ds as c,
3728
+ Jr as d,
3729
+ nn as e,
3730
+ cs as f,
3731
+ us as g,
3732
+ ls as i,
3733
+ as as u
3720
3734
  };