react-semaphor 0.1.284 → 0.1.285

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 (27) hide show
  1. package/dist/chunks/{dashboard-controls-4pDdG3me.js → dashboard-controls-B8f_BKTb.js} +1 -1
  2. package/dist/chunks/{dashboard-controls-Dhry2k8x.js → dashboard-controls-DSwmmI8w.js} +4 -4
  3. package/dist/chunks/{dashboard-filter-controls-button-BZXrmJP2.js → dashboard-filter-controls-button-BqmNXVoa.js} +53 -52
  4. package/dist/chunks/dashboard-filter-controls-button-DXKJ-0iV.js +11 -0
  5. package/dist/chunks/{dashboard-json-D-KsLEGl.js → dashboard-json-D0H5w5WI.js} +1 -1
  6. package/dist/chunks/{dashboard-json-CYnf5rdp.js → dashboard-json-qT21EDMm.js} +1 -1
  7. package/dist/chunks/{dashboard-summary-settings-dialog-B4jsBFro.js → dashboard-summary-settings-dialog-BRI5dAfz.js} +1 -1
  8. package/dist/chunks/{dashboard-summary-settings-dialog-Cn4-fB2h.js → dashboard-summary-settings-dialog-Mq8T35Qv.js} +1 -1
  9. package/dist/chunks/{edit-dashboard-visual-BQnApBvr.js → edit-dashboard-visual-DLpQykTX.js} +1 -1
  10. package/dist/chunks/{edit-dashboard-visual-BDIt_S2F.js → edit-dashboard-visual-gSIS7RGI.js} +3 -3
  11. package/dist/chunks/{index-DBuN9Zf6.js → index-Celt_oJr.js} +1 -1
  12. package/dist/chunks/{index-y1uW2fuZ.js → index-r_DA-pny.js} +4 -4
  13. package/dist/chunks/{resource-management-panel-PSvKnmq5.js → resource-management-panel-Brj3iNyX.js} +1 -1
  14. package/dist/chunks/{resource-management-panel-BC-cvjI9.js → resource-management-panel-DXLca9OX.js} +2 -2
  15. package/dist/chunks/{use-create-flow-overlay-state-Cr9AFdXx.js → use-create-flow-overlay-state-C1xhazfY.js} +2 -2
  16. package/dist/chunks/{use-create-flow-overlay-state-COe7Ekru.js → use-create-flow-overlay-state-DVyd9L7O.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-DNp8XO6G.js → use-visual-utils-CWcTBBvd.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-Ccmzx7-m.js → use-visual-utils-CqL5PNOR.js} +1 -1
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +5 -5
  23. package/dist/style.css +1 -1
  24. package/dist/surfboard/index.cjs +1 -1
  25. package/dist/surfboard/index.js +2 -2
  26. package/package.json +1 -1
  27. package/dist/chunks/dashboard-filter-controls-button-DEUvxIWD.js +0 -11
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-DBuN9Zf6.js"),x=require("react");require("react-dom");const P=require("./dashboard-filter-controls-button-DEUvxIWD.js"),_s=require("./date-formatter-CqXdM6JO.js"),Xe=require("./dashboard-summary-settings-dialog-Cn4-fB2h.js"),Us=require("./use-debounced-dirty-check-XHSwAefL.js"),we=require("./normalize-dashboard-for-dirty-check-BXRUMVb2.js"),Ye=require("./use-create-flow-overlay-state-COe7Ekru.js");function Rs(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(o,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return o.default=t,Object.freeze(o)}const C=Rs(x);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-Celt_oJr.js"),x=require("react");require("react-dom");const P=require("./dashboard-filter-controls-button-DXKJ-0iV.js"),_s=require("./date-formatter-CqXdM6JO.js"),Xe=require("./dashboard-summary-settings-dialog-Mq8T35Qv.js"),Us=require("./use-debounced-dirty-check-XHSwAefL.js"),we=require("./normalize-dashboard-for-dirty-check-BXRUMVb2.js"),Ye=require("./use-create-flow-overlay-state-DVyd9L7O.js");function Rs(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(o,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return o.default=t,Object.freeze(o)}const C=Rs(x);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,14 +1,14 @@
1
1
  import { jsxs as o, jsx as e, Fragment as I } from "react/jsx-runtime";
2
- import { bM as de, dq as qs, u as x, cC as ra, cD as na, B as A, cF as oa, cG as Q, dr as ia, N as qa, b as $, d as la, ds as Hs, ct as ca, e as da, f as ua, g as ma, h as Ha, L as Qe, I as ce, v as js, a7 as K, dt as we, cK as We, du as Bs, dv as Pa, dw as ja, c as Y, dx as Ba, dy as zs, c$ as ha, dz as Ks, dA as Qs, dB as Ws, dC as Js, dD as Xs, dE as Ys, H as Me, W as Ae, x as k, dF as Le, dG as za, dH as Ka, d8 as Zs, dI as et, w as Z, cJ as J, dJ as at, dK as st, dL as Je, dM as tt, dN as rt, dO as Qa, dP as Wa, dQ as Ce, dR as Ee, d4 as Xe, cP as Ye, dS as Ze, ch as Ja, dT as ea, cc as Xa, dU as nt, cS as Ya, cT as Za, cU as es, cV as as, cW as ss, cX as ts, cY as rs, cZ as aa, dV as ns, cB as ot, dW as it, ag as lt, U as Ua, af as De, dX as ct, am as dt, ah as je, dY as ut, dZ as mt, d_ as ht, aB as pt, d$ as ft, e0 as gt, bT as vt, bU as bt, bV as yt, e1 as Nt, bW as St, cH as xt, at as Dt, e2 as wt, e3 as Ct, dp as Et, e4 as Mt, e5 as At, cE as Lt, a9 as kt, cM as It, e6 as Ot, al as Tt, aa as _t, as as Pt, e7 as Ut } from "./index-y1uW2fuZ.js";
2
+ import { bM as de, dq as qs, u as x, cC as ra, cD as na, B as A, cF as oa, cG as Q, dr as ia, N as qa, b as $, d as la, ds as Hs, ct as ca, e as da, f as ua, g as ma, h as Ha, L as Qe, I as ce, v as js, a7 as K, dt as we, cK as We, du as Bs, dv as Pa, dw as ja, c as Y, dx as Ba, dy as zs, c$ as ha, dz as Ks, dA as Qs, dB as Ws, dC as Js, dD as Xs, dE as Ys, H as Me, W as Ae, x as k, dF as Le, dG as za, dH as Ka, d8 as Zs, dI as et, w as Z, cJ as J, dJ as at, dK as st, dL as Je, dM as tt, dN as rt, dO as Qa, dP as Wa, dQ as Ce, dR as Ee, d4 as Xe, cP as Ye, dS as Ze, ch as Ja, dT as ea, cc as Xa, dU as nt, cS as Ya, cT as Za, cU as es, cV as as, cW as ss, cX as ts, cY as rs, cZ as aa, dV as ns, cB as ot, dW as it, ag as lt, U as Ua, af as De, dX as ct, am as dt, ah as je, dY as ut, dZ as mt, d_ as ht, aB as pt, d$ as ft, e0 as gt, bT as vt, bU as bt, bV as yt, e1 as Nt, bW as St, cH as xt, at as Dt, e2 as wt, e3 as Ct, dp as Et, e4 as Mt, e5 as At, cE as Lt, a9 as kt, cM as It, e6 as Ot, al as Tt, aa as _t, as as Pt, e7 as Ut } from "./index-r_DA-pny.js";
3
3
  import * as M from "react";
4
4
  import os, { useState as N, useMemo as W, useCallback as Ga, useEffect as Gt } from "react";
5
5
  import "react-dom";
6
- import { b as Rt, u as Ft, d as $t, A as Vt, V as qt, N as Ht, c as jt, D as Bt, U as zt } from "./dashboard-filter-controls-button-BZXrmJP2.js";
6
+ import { b as Rt, u as Ft, d as $t, A as Vt, V as qt, N as Ht, c as jt, D as Bt, U as zt } from "./dashboard-filter-controls-button-BqmNXVoa.js";
7
7
  import { l as Kt } from "./date-formatter-vkCj9Ct-.js";
8
- import { C as Qt, D as Wt } from "./dashboard-summary-settings-dialog-B4jsBFro.js";
8
+ import { C as Qt, D as Wt } from "./dashboard-summary-settings-dialog-BRI5dAfz.js";
9
9
  import { u as Jt } from "./use-debounced-dirty-check-BwAbnX_5.js";
10
10
  import { s as Be } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
11
- import { S as Ra } from "./use-create-flow-overlay-state-Cr9AFdXx.js";
11
+ import { S as Ra } from "./use-create-flow-overlay-state-C1xhazfY.js";
12
12
  /**
13
13
  * @license lucide-react v0.453.0 - ISC
14
14
  *
@@ -1,8 +1,8 @@
1
1
  import ge, { useState as F, useRef as z, useCallback as V, useEffect as T, useContext as be } from "react";
2
- import { bM as Z, b as $, aC as U, bJ as _, bF as ee, bG as j, aD as te, bE as Ce, d as ae, e as se, f as re, g as oe, h as ne, L as G, I as we, d8 as ye, v as xe, B as I, w as H, U as R, J as Ne, u as B, K as De, N as X, d9 as Ae, da as K, x as P, b_ as ie, af as Se, c as L, cC as le, cD as de, a6 as ce, cF as ue, cG as M, s as Ee, cK as Ie, ct as Le, M as Fe, db as Te, dc as ke, dd as Ue, cS as Me, cT as Ve, cU as Pe, cV as Be, cW as Oe, cX as ze, cY as Re, as as $e, bL as _e, X as je, de as He, df as Xe, cz as Ge, bH as W, a8 as Ke, aF as We, P as he, j as me, dg as qe, l as pe, dh as Je, di as Ye, dj as Qe, dk as Ze, dl as et, dm as fe, dn as q, dp as tt } from "./index-y1uW2fuZ.js";
2
+ import { bM as Z, b as $, aC as U, bJ as _, bF as ee, bG as j, aD as te, bE as Ce, d as ae, e as se, f as re, g as oe, h as ne, L as G, I as we, d8 as xe, v as ye, B as I, w as H, U as R, J as Ne, u as B, K as De, N as X, d9 as Ae, da as K, x as P, b_ as ie, af as Se, c as L, cC as le, cD as de, a6 as ce, cF as ue, cG as M, s as Ee, cK as Ie, ct as Le, M as Fe, db as Te, dc as ke, dd as Ue, cS as Me, cT as Ve, cU as Pe, cV as Be, cW as Oe, cX as ze, cY as Re, as as $e, bL as _e, X as je, de as He, df as Xe, cz as Ge, bH as W, a8 as Ke, aF as We, P as he, j as me, dg as qe, l as pe, dh as Je, di as Ye, dj as Qe, dk as Ze, dl as et, dm as fe, dn as q, dp as tt } from "./index-r_DA-pny.js";
3
3
  import { jsx as t, jsxs as s, Fragment as O } from "react/jsx-runtime";
4
- import { V as at, E as st, a as rt, b as ot, L as nt, c as it, d as lt, C as dt, u as ct, e as ut } from "./use-create-flow-overlay-state-Cr9AFdXx.js";
5
- import { u as ve } from "./use-visual-utils-Ccmzx7-m.js";
4
+ import { V as at, E as st, a as rt, b as ot, L as nt, c as it, d as lt, C as dt, u as ct, e as ut } from "./use-create-flow-overlay-state-C1xhazfY.js";
5
+ import { u as ve } from "./use-visual-utils-CqL5PNOR.js";
6
6
  import { k as J } from "./date-formatter-vkCj9Ct-.js";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
@@ -78,7 +78,7 @@ function Tt() {
78
78
  n.current = !1;
79
79
  return;
80
80
  }
81
- const y = await Promise.allSettled(
81
+ const x = await Promise.allSettled(
82
82
  f.map(async (r) => {
83
83
  try {
84
84
  const i = await ee(h, o, r.id);
@@ -111,7 +111,7 @@ function Tt() {
111
111
  }
112
112
  })
113
113
  ), { updateExport: S } = U.getState().actions;
114
- for (const r of y)
114
+ for (const r of x)
115
115
  r.status === "fulfilled" && r.value && S(r.value.id, r.value);
116
116
  const w = v();
117
117
  if (w.length > 0 && !document.hidden) {
@@ -274,7 +274,7 @@ function wt({
274
274
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
275
275
  /* @__PURE__ */ t(G, { htmlFor: "description", children: "Description (optional)" }),
276
276
  /* @__PURE__ */ t(
277
- ye,
277
+ xe,
278
278
  {
279
279
  id: "description",
280
280
  value: o,
@@ -286,7 +286,7 @@ function wt({
286
286
  )
287
287
  ] })
288
288
  ] }),
289
- /* @__PURE__ */ s(xe, { children: [
289
+ /* @__PURE__ */ s(ye, { children: [
290
290
  /* @__PURE__ */ t(
291
291
  I,
292
292
  {
@@ -303,10 +303,10 @@ function wt({
303
303
  ] })
304
304
  ] }) });
305
305
  }
306
- function yt() {
306
+ function xt() {
307
307
  const [e, a] = F(!1), [p, d] = F(!1), [c, u] = F(null), n = R((i) => i.frame), l = R((i) => i.card), h = Ne(), o = B((i) => i.selectedSheetId), v = B(
308
308
  (i) => i.actions.setIsDashboardPanelOpen
309
- ), { getUpdatedFrame: b } = ve(), { selectVisual: m } = De(), { addFrame: C, setSelectedFrameId: N, setIsVisualEditing: f } = X(), y = !!(n != null && n.visualId), S = (() => {
309
+ ), { getUpdatedFrame: b } = ve(), { selectVisual: m } = De(), { addFrame: C, setSelectedFrameId: N, setIsVisualEditing: f } = X(), x = !!(n != null && n.visualId), S = (() => {
310
310
  var i, g;
311
311
  return ((i = n == null ? void 0 : n.cards) == null ? void 0 : i.length) === 1 && ((g = n.cards[0]) != null && g.title) ? n.cards[0].title : h != null && h.title ? h.title : (l == null ? void 0 : l.title) || "Untitled Visual";
312
312
  })(), w = Ae((i) => {
@@ -338,34 +338,34 @@ function yt() {
338
338
  }
339
339
  const A = g.cards.length === 1 ? {
340
340
  ...g,
341
- cards: g.cards.map((x) => ({
342
- ...x,
341
+ cards: g.cards.map((y) => ({
342
+ ...y,
343
343
  title: i.name
344
344
  // Use visual name as card title
345
345
  }))
346
346
  } : g;
347
347
  if (i.saveToLibrary) {
348
348
  d(i.saveToCurrentDashboard), u(A);
349
- const x = {
349
+ const y = {
350
350
  title: i.name,
351
351
  description: i.description,
352
352
  frameObject: A,
353
353
  // Card title synced for single-card frames
354
354
  isPrivate: !1
355
355
  };
356
- w.mutate(x);
356
+ w.mutate(y);
357
357
  } else if (i.saveToCurrentDashboard) {
358
- const x = {
358
+ const y = {
359
359
  ...A,
360
360
  // Card title already synced
361
361
  id: K(),
362
362
  visualId: void 0
363
363
  // Explicitly no visualId for local visuals
364
364
  };
365
- C(o, x, "end"), N(x.id), P.success("Visual saved to dashboard"), a(!1), f(!1);
365
+ C(o, y, "end"), N(y.id), P.success("Visual saved to dashboard"), a(!1), f(!1);
366
366
  }
367
367
  },
368
- isLibraryVisual: y,
368
+ isLibraryVisual: x,
369
369
  currentVisualName: S,
370
370
  isSaving: w.isPending
371
371
  };
@@ -376,11 +376,11 @@ function Ut({
376
376
  const a = R((D) => D.frame), p = Se((D) => D.selectedVisual), d = B((D) => D.selectedFrameId), c = B((D) => D.selectedSheetId), { setIsVisualEditing: u, updateFrame: n } = X(), [l, h] = F(!1), [o, v] = F("both"), b = !!(a != null && a.visualId || p != null && p.id), m = !!(a != null && a.visualId && d), C = b && !m, {
377
377
  saveAsDialogOpen: N,
378
378
  setSaveAsDialogOpen: f,
379
- handleSaveAs: y,
379
+ handleSaveAs: x,
380
380
  isLibraryVisual: S,
381
381
  currentVisualName: w,
382
382
  isSaving: r
383
- } = yt(), { getUpdatedFrame: i } = ve(), g = () => {
383
+ } = xt(), { getUpdatedFrame: i } = ve(), g = () => {
384
384
  if (!c) {
385
385
  P.error("No sheet selected");
386
386
  return;
@@ -392,11 +392,11 @@ function Ut({
392
392
  h(!1), P.error(A);
393
393
  return;
394
394
  }
395
- const x = {
395
+ const y = {
396
396
  ...D,
397
397
  visualId: void 0
398
398
  };
399
- n(c, x), setTimeout(() => {
399
+ n(c, y), setTimeout(() => {
400
400
  h(!1), P.success("Changes applied. Visual is now local to this dashboard"), u(!1);
401
401
  }, 300);
402
402
  }, E = (D) => {
@@ -502,7 +502,7 @@ function Ut({
502
502
  currentVisualName: w,
503
503
  isSaving: r,
504
504
  destinationMode: o,
505
- onConfirm: y
505
+ onConfirm: x
506
506
  }
507
507
  )
508
508
  ] });
@@ -548,20 +548,21 @@ function Vt({
548
548
  /* @__PURE__ */ t(Oe, { children: n })
549
549
  ] }),
550
550
  /* @__PURE__ */ s(ze, { children: [
551
- /* @__PURE__ */ t(Re, { disabled: c, children: l }),
552
551
  /* @__PURE__ */ t(
553
552
  I,
554
553
  {
555
554
  type: "button",
555
+ size: "xs",
556
556
  onClick: d,
557
557
  disabled: c,
558
- variant: "destructive",
559
- className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
558
+ variant: "ghost",
559
+ className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
560
560
  children: h
561
561
  }
562
562
  ),
563
- /* @__PURE__ */ t(I, { type: "button", onClick: p, disabled: c, children: c ? /* @__PURE__ */ s(O, { children: [
564
- /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
563
+ /* @__PURE__ */ t(Re, { disabled: c, children: l }),
564
+ /* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: p, disabled: c, children: c ? /* @__PURE__ */ s(O, { children: [
565
+ /* @__PURE__ */ t(H, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
565
566
  "Saving..."
566
567
  ] }) : o })
567
568
  ] })
@@ -572,7 +573,7 @@ function Pt(e, a, p, d) {
572
573
  e && !p && a && d($e(a));
573
574
  }, [e, p, a, d]);
574
575
  }
575
- function xt({
576
+ function yt({
576
577
  export: e,
577
578
  onRemove: a
578
579
  }) {
@@ -665,25 +666,25 @@ function xt({
665
666
  }
666
667
  function Nt() {
667
668
  const { authToken: e, tokenProps: a } = $(), p = U((f) => f.activeExports), { clearCompleted: d, removeExport: c, updateExport: u } = te(), [n, l] = F(!1), [h, o] = F(!1), v = Array.from(p.values()).sort(
668
- (f, y) => y.startedAt.getTime() - f.startedAt.getTime()
669
+ (f, x) => x.startedAt.getTime() - f.startedAt.getTime()
669
670
  ), b = v.some(
670
671
  (f) => f.status === "completed" || f.status === "failed"
671
672
  ), m = V(async () => {
672
- const f = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
673
- if (!(!f || !y)) {
673
+ const f = a == null ? void 0 : a.apiServiceUrl, x = e == null ? void 0 : e.accessToken;
674
+ if (!(!f || !x)) {
674
675
  l(!0);
675
676
  try {
676
677
  const S = Array.from(p.values());
677
678
  await Promise.all(
678
679
  S.map(async (w) => {
679
680
  try {
680
- const r = await ee(f, y, w.id);
681
+ const r = await ee(f, x, w.id);
681
682
  let i;
682
683
  if (r.status === "completed")
683
684
  try {
684
685
  i = await j(
685
686
  f,
686
- y,
687
+ x,
687
688
  w.id
688
689
  );
689
690
  } catch (g) {
@@ -714,8 +715,8 @@ function Nt() {
714
715
  a == null ? void 0 : a.apiServiceUrl,
715
716
  u
716
717
  ]), C = V(async () => {
717
- const f = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
718
- if (!f || !y) {
718
+ const f = a == null ? void 0 : a.apiServiceUrl, x = e == null ? void 0 : e.accessToken;
719
+ if (!f || !x) {
719
720
  d();
720
721
  return;
721
722
  }
@@ -724,7 +725,7 @@ function Nt() {
724
725
  const S = v.filter(
725
726
  (r) => r.status === "completed" || r.status === "failed"
726
727
  ), w = await Promise.allSettled(
727
- S.map(async (r) => (await W(f, y, r.id), r.id))
728
+ S.map(async (r) => (await W(f, x, r.id), r.id))
728
729
  );
729
730
  for (const r of w)
730
731
  r.status === "fulfilled" ? c(r.value) : console.error("Failed to delete export:", r.reason);
@@ -739,10 +740,10 @@ function Nt() {
739
740
  c
740
741
  ]), N = V(
741
742
  async (f) => {
742
- const y = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
743
- if (y && S)
743
+ const x = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
744
+ if (x && S)
744
745
  try {
745
- await W(y, S, f), c(f);
746
+ await W(x, S, f), c(f);
746
747
  return;
747
748
  } catch (w) {
748
749
  console.error(`Failed to cancel export ${f}:`, w);
@@ -793,7 +794,7 @@ function Nt() {
793
794
  ] })
794
795
  ] }),
795
796
  /* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: v.map((f) => /* @__PURE__ */ t(
796
- xt,
797
+ yt,
797
798
  {
798
799
  export: f,
799
800
  onRemove: N
@@ -868,28 +869,28 @@ function Ot({
868
869
  }), m = B((A) => A.dashboard), { setDashboardControlsModel: C } = X(), { participants: N } = Je(Ye(m)), f = Array.from(
869
870
  new Map(
870
871
  N.flatMap(
871
- (A) => A.fieldChoices.map((x) => {
872
+ (A) => A.fieldChoices.map((y) => {
872
873
  var k;
873
874
  return [
874
- x.value,
875
+ y.value,
875
876
  {
876
- option: x,
877
- target: (k = A.fieldTargetMap) == null ? void 0 : k[x.value]
877
+ option: y,
878
+ target: (k = A.fieldTargetMap) == null ? void 0 : k[y.value]
878
879
  }
879
880
  ];
880
881
  })
881
882
  )
882
883
  ).values()
883
- ), y = Array.from(
884
+ ), x = Array.from(
884
885
  new Map(
885
886
  N.flatMap(
886
- (A) => A.metricChoices.map((x) => {
887
+ (A) => A.metricChoices.map((y) => {
887
888
  var k;
888
889
  return [
889
- x.value,
890
+ y.value,
890
891
  {
891
- option: x,
892
- target: (k = A.metricTargetMap) == null ? void 0 : k[x.value]
892
+ option: y,
893
+ target: (k = A.metricTargetMap) == null ? void 0 : k[y.value]
893
894
  }
894
895
  ];
895
896
  })
@@ -898,10 +899,10 @@ function Ot({
898
899
  ), S = Qe({
899
900
  ...m || {},
900
901
  controls: []
901
- }), w = Ze(m), r = (A, x, k) => {
902
+ }), w = Ze(m), r = (A, y, k) => {
902
903
  C(
903
904
  A,
904
- x,
905
+ y,
905
906
  Dt(k)
906
907
  );
907
908
  }, i = V(() => {
@@ -919,7 +920,7 @@ function Ot({
919
920
  defaultValues: m.defaultControlValues || {},
920
921
  usageByControlId: et(m),
921
922
  availableFieldChoices: f,
922
- availableMetricChoices: y,
923
+ availableMetricChoices: x,
923
924
  structuralParticipants: N,
924
925
  structuralParticipantIdsByControlId: w,
925
926
  initialCreateFlow: c === "create",
@@ -1064,7 +1065,7 @@ export {
1064
1065
  Bt as N,
1065
1066
  Vt as U,
1066
1067
  Ut as V,
1067
- xt as a,
1068
+ yt as a,
1068
1069
  kt as b,
1069
1070
  zt as c,
1070
1071
  Pt as d,
@@ -0,0 +1,11 @@
1
+ "use strict";const v=require("react"),e=require("./index-Celt_oJr.js"),t=require("react/jsx-runtime"),I=require("./use-create-flow-overlay-state-DVyd9L7O.js"),k=require("./use-visual-utils-CWcTBBvd.js"),L=require("./date-formatter-CqXdM6JO.js");/**
2
+ * @license lucide-react v0.453.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const T=e.createLucideIcon("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
7
+ * @license lucide-react v0.453.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const P=e.createLucideIcon("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]),V=1e4,z=15e3,O=3e4,R=3e4,$=12e4,M=2*60*60*1e3;function H(s){const r=Date.now()-s.getTime();return r<R?V:r<$?z:O}function q(){const{authToken:s,tokenProps:r}=e.useSemaphorContext(),p=e.useExportStore(m=>m.activeExports),[c,d]=v.useState(typeof document<"u"?!document.hidden:!0),u=v.useRef(null),n=v.useRef(!1),l=v.useRef(void 0),h=r==null?void 0:r.apiServiceUrl,o=s==null?void 0:s.accessToken,f=v.useCallback(()=>{const m=e.useExportStore.getState().activeExports;return Array.from(m.values()).filter(C=>e.isExportInProgress(C.status))},[]);v.useEffect(()=>{if(typeof document>"u")return;const m=()=>{d(!document.hidden)};return document.addEventListener("visibilitychange",m),()=>{document.removeEventListener("visibilitychange",m)}},[]);const b=v.useCallback(async()=>{if(!h||!o){n.current=!1;return}const m=f();if(m.length===0){n.current=!1;return}const C=Date.now(),D=m.filter(a=>C-a.startedAt.getTime()>M);if(D.length>0){const{updateExport:a}=e.useExportStore.getState().actions;for(const i of D)a(i.id,{status:"failed",error:"Export timed out. Please try again or contact support.",lastUpdatedAt:new Date})}const x=m.filter(a=>C-a.startedAt.getTime()<=M);if(x.length===0){n.current=!1;return}const j=await Promise.allSettled(x.map(async a=>{try{const i=await e.getExportStatus(h,o,a.id);let g;if(i.status==="completed")try{g=await e.getDownloadUrl(h,o,a.id)}catch(A){console.error(`[useExportPolling] Failed to get download URL for ${a.id}:`,A)}return{id:a.id,status:i.status,progress:i.progress,completedChunks:i.completedChunks,completedAt:i.completedAt?new Date(i.completedAt):void 0,lastUpdatedAt:new Date,fileSize:i.fileSize,error:i.error,downloadUrl:g}}catch(i){return console.error(`[useExportPolling] Failed to poll export ${a.id}:`,i),null}})),{updateExport:N}=e.useExportStore.getState().actions;for(const a of j)a.status==="fulfilled"&&a.value&&N(a.value.id,a.value);const w=f();if(w.length>0&&!document.hidden){const a=w.reduce((g,A)=>A.startedAt<g?A.startedAt:g,w[0].startedAt),i=H(a);u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{var g;(g=l.current)==null||g.call(l)},i)}else n.current=!1},[h,o,f]);return v.useEffect(()=>{l.current=b},[b]),v.useEffect(()=>{var C;f().length>0&&c&&!n.current&&(n.current=!0,(C=l.current)==null||C.call(l))},[p,c,f]),v.useEffect(()=>{var C;const m=f();c&&m.length>0&&!n.current&&(n.current=!0,(C=l.current)==null||C.call(l))},[c,f]),v.useEffect(()=>{!c&&u.current&&(clearTimeout(u.current),u.current=null,n.current=!1)},[c]),v.useEffect(()=>()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),{isPolling:n.current,isTabVisible:c,inProgressCount:f().length}}function _(){const{authToken:s,tokenProps:r}=e.useSemaphorContext(),p=e.useExportStore(l=>l.activeExports),{addExport:c}=e.useExportActions(),d=v.useRef(!1),u=r==null?void 0:r.apiServiceUrl,n=s==null?void 0:s.accessToken;v.useEffect(()=>{if(d.current||!u||!n)return;(async()=>{try{const{exports:h}=await e.getExports(u,n,{status:["pending","processing","chunking","compacting","completed","failed"],limit:20});for(const o of h){if(p.has(o.id))continue;const f=o.totalChunks?Math.round(o.completedChunks/o.totalChunks*100):0;let b;if(o.status==="completed")try{b=await e.getDownloadUrl(u,n,o.id)}catch(C){console.error(`[useExportRecovery] Failed to get download URL for ${o.id}:`,C)}const m={id:o.id,status:o.status,progress:f,title:X(o),totalRows:o.totalRows,totalChunks:o.totalChunks,completedChunks:o.completedChunks,startedAt:new Date(o.createdAt),lastUpdatedAt:new Date,completedAt:o.completedAt?new Date(o.completedAt):void 0,fileSize:o.fileSize,error:o.error,expiresAt:new Date(o.expiresAt),downloadUrl:b};c(m)}d.current=!0}catch(h){console.error("[useExportRecovery] Failed to recover exports:",h),d.current=!0}})()},[u,n,c,p])}function X(s){return s.title?s.title:e.isExportInProgress(s.status)?"Export in progress...":s.status==="completed"?"Export completed":s.status==="failed"?"Export failed":"Export"}function G({open:s,onOpenChange:r,isLibraryVisual:p,currentVisualName:c,isSaving:d=!1,destinationMode:u="both",onConfirm:n}){const[l,h]=v.useState(p&&c?`Copy of ${c}`:c||""),[o,f]=v.useState("");v.useEffect(()=>{s&&(h(p&&c?`Copy of ${c}`:c||""),f(""))},[s,p,c]);const b=!!l.trim(),m=u==="local"?{saveToLibrary:!1,saveToCurrentDashboard:!0,badgeType:"local",description:"Creates a local copy on the current dashboard.",actionLabel:"Add to Dashboard (Local)"}:u==="library"?{saveToLibrary:!0,saveToCurrentDashboard:!1,badgeType:"library",description:"Creates a reusable visual in Visual Library.",actionLabel:"Save as Library Visual"}:{saveToLibrary:!0,saveToCurrentDashboard:!0,badgeType:"linked",description:"Creates a new library visual and adds a linked copy to this dashboard.",actionLabel:"Save Copy as Linked Visual"},C=()=>{!b||d||n({name:l.trim(),description:o.trim()||void 0,saveToLibrary:m.saveToLibrary,saveToCurrentDashboard:m.saveToCurrentDashboard})};return t.jsx(e.Dialog,{open:s,onOpenChange:r,children:t.jsxs(e.DialogContent,{className:"sm:max-w-[500px]",children:[t.jsxs(e.DialogHeader,{children:[t.jsxs(e.DialogTitle,{className:"flex items-center gap-2",children:[t.jsx("span",{children:"Save Visual As"}),m.badgeType!=="local"&&t.jsx(I.VisualBadge,{type:m.badgeType,showLabel:!0,className:"px-2 py-0.5"})]}),t.jsx(e.DialogDescription,{children:m.description})]}),t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(e.Label,{htmlFor:"name",children:"Name"}),t.jsx(e.Input,{id:"name",value:l,onChange:D=>h(D.target.value),placeholder:"Enter visual name",disabled:d})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsx(e.Label,{htmlFor:"description",children:"Description (optional)"}),t.jsx(e.Textarea,{id:"description",value:o,onChange:D=>f(D.target.value),placeholder:"Enter visual description",rows:3,disabled:d})]})]}),t.jsxs(e.DialogFooter,{children:[t.jsx(e.Button,{variant:"outline",onClick:()=>r(!1),disabled:d,children:"Cancel"}),t.jsxs(e.Button,{onClick:C,disabled:!b||d,children:[d&&t.jsx(e.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),m.actionLabel]})]})]})})}function K(){const[s,r]=v.useState(!1),[p,c]=v.useState(!1),[d,u]=v.useState(null),n=e.useEditorStore(i=>i.frame),l=e.useEditorStore(i=>i.card),h=e.useSelectedVisual(),o=e.useDashboardStore(i=>i.selectedSheetId),f=e.useDashboardStore(i=>i.actions.setIsDashboardPanelOpen),{getUpdatedFrame:b}=k.useVisualUtils(),{selectVisual:m}=e.useManagementActions(),{addFrame:C,setSelectedFrameId:D,setIsVisualEditing:x}=e.useDashboardActions(),j=!!(n!=null&&n.visualId),N=(()=>{var i,g;return((i=n==null?void 0:n.cards)==null?void 0:i.length)===1&&((g=n.cards[0])!=null&&g.title)?n.cards[0].title:h!=null&&h.title?h.title:(l==null?void 0:l.title)||"Untitled Visual"})(),w=e.useCreateVisualWithFrame(i=>{if(i!=null&&i.id){if(m(i),p&&d&&o){const g={...d,id:e.v4(),visualId:i.id};C(o,g,"end"),D(g.id),c(!1),u(null),x(!1)}f(!0),r(!1)}});return{saveAsDialogOpen:s,setSaveAsDialogOpen:r,handleSaveAs:async i=>{if(!o){e.ue.error("No sheet selected");return}const g=b(),A=e.getDynamicFrameSaveIssue(g);if(A){e.ue.error(A);return}const E=g.cards.length===1?{...g,cards:g.cards.map(y=>({...y,title:i.name}))}:g;if(i.saveToLibrary){c(i.saveToCurrentDashboard),u(E);const y={title:i.name,description:i.description,frameObject:E,isPrivate:!1};w.mutate(y)}else if(i.saveToCurrentDashboard){const y={...E,id:e.v4(),visualId:void 0};C(o,y,"end"),D(y.id),e.ue.success("Visual saved to dashboard"),r(!1),x(!1)}},isLibraryVisual:j,currentVisualName:N,isSaving:w.isPending}}function W({className:s}){const r=e.useEditorStore(S=>S.frame),p=e.useManagementStore(S=>S.selectedVisual),c=e.useDashboardStore(S=>S.selectedFrameId),d=e.useDashboardStore(S=>S.selectedSheetId),{setIsVisualEditing:u,updateFrame:n}=e.useDashboardActions(),[l,h]=v.useState(!1),[o,f]=v.useState("both"),b=!!(r!=null&&r.visualId||p!=null&&p.id),m=!!(r!=null&&r.visualId&&c),C=b&&!m,{saveAsDialogOpen:D,setSaveAsDialogOpen:x,handleSaveAs:j,isLibraryVisual:N,currentVisualName:w,isSaving:a}=K(),{getUpdatedFrame:i}=k.useVisualUtils(),g=()=>{if(!d){e.ue.error("No sheet selected");return}if(l)return;h(!0);const S=i(),E=e.getDynamicFrameSaveIssue(S);if(E){h(!1),e.ue.error(E);return}const y={...S,visualId:void 0};n(d,y),setTimeout(()=>{h(!1),e.ue.success("Changes applied. Visual is now local to this dashboard"),u(!1)},300)},A=S=>{f(S),x(!0)};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"inline-flex items-center overflow-hidden rounded-md border border-input",children:[!b&&t.jsx(I.EditorAcceptButton,{className:e.cn(s,"rounded-none border-0"),variant:"default"}),b&&C&&t.jsx(I.VisualSaveButton,{className:e.cn(s,"rounded-none border-0"),variant:"default"}),b&&m&&t.jsx(I.VisualSaveAndApplyButton,{className:e.cn(s,"rounded-none border-0")}),t.jsxs(e.DropdownMenu,{modal:!1,children:[t.jsx(e.DropdownMenuTrigger,{className:"h-8",asChild:!0,children:t.jsx(e.Button,{variant:"default",size:"sm",className:e.cn(s,"w-8 rounded-none border-0 border-l border-primary-foreground/30 px-2"),"aria-label":"Open visual save options",disabled:a||l,children:t.jsx(e.ChevronDown,{className:"h-4 w-4"})})}),t.jsxs(e.DropdownMenuContent,{align:"end",children:[m&&t.jsxs(t.Fragment,{children:[t.jsxs(e.DropdownMenuItem,{onClick:g,disabled:l,children:[t.jsx(e.Check,{className:"mr-2 h-4 w-4"}),l?"Applying...":"Apply Locally"]}),t.jsx(e.DropdownMenuSeparator,{})]}),t.jsxs(e.DropdownMenuItem,{onClick:()=>A("local"),disabled:a,children:[t.jsx(e.Plus,{className:"mr-2 h-4 w-4"}),"Add to Dashboard (Local)"]}),t.jsxs(e.DropdownMenuItem,{onClick:()=>A("library"),disabled:a,children:[t.jsx(I.Library,{className:"mr-2 h-4 w-4"}),"Save as Library Visual"]}),t.jsxs(e.DropdownMenuItem,{onClick:()=>A("both"),disabled:a,children:[t.jsx(I.Link2,{className:"mr-2 h-4 w-4"}),"Save Copy as Linked Visual"]})]})]})]}),t.jsx(I.EditorCancelButton,{className:s}),t.jsx(G,{open:D,onOpenChange:S=>{a||x(S)},isLibraryVisual:N,currentVisualName:w,isSaving:a,destinationMode:o,onConfirm:j})]})}function Q({className:s,switchClassName:r}){const p=e.useEditorStore(l=>l.isDevMode),c=e.useDashboardStore(l=>l.isVisualEditing),{setIsDevMode:d}=e.useEditorActions(),{config:u}=v.useContext(e.SemaphorContext).tokenProps,n=(u==null?void 0:u.showAdvancedMode)!==!1;return!c||!n?null:t.jsxs("div",{className:e.cn("flex items-center space-x-2",s),children:[t.jsx(e.DevModeSwitch,{className:e.cn("",r),checked:p,onCheckedChange:()=>d(!p),id:"advanced-mode",icon:t.jsx(e.CodeXml,{className:"h-4 w-4"}),tooltip:"Advanced Mode"}),t.jsx("label",{htmlFor:"advanced-mode",className:"sr-only",children:"Advanced Mode"})]})}function Y({open:s,onOpenChange:r,onSave:p,onDiscard:c,isSaving:d,title:u="Unsaved changes",description:n="You have unsaved changes to this dashboard. What would you like to do?",cancelLabel:l="Cancel",discardLabel:h="Discard",saveLabel:o="Save"}){const f=b=>{!b&&d||r(b)};return t.jsx(e.AlertDialog,{open:s,onOpenChange:f,children:t.jsxs(e.AlertDialogContent,{children:[t.jsxs(e.AlertDialogHeader,{children:[t.jsx(e.AlertDialogTitle,{children:u}),t.jsx(e.AlertDialogDescription,{children:n})]}),t.jsxs(e.AlertDialogFooter,{children:[t.jsx(e.Button,{type:"button",size:"xs",onClick:c,disabled:d,variant:"ghost",className:"mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",children:h}),t.jsx(e.AlertDialogCancel,{disabled:d,children:l}),t.jsx(e.Button,{type:"button",size:"xs",onClick:p,disabled:d,children:d?t.jsxs(t.Fragment,{children:[t.jsx(e.LoaderCircle,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):o})]})]})})}function Z(s,r,p,c){v.useEffect(()=>{s&&!p&&r&&c(e.cloneDeep(r))},[s,p,r,c])}function U({export:s,onRemove:r}){const p=()=>{s.downloadUrl&&window.open(s.downloadUrl,"_blank")},c=l=>{l.stopPropagation(),r==null||r(s.id)},d=()=>{switch(s.status){case"completed":return t.jsx(e.CircleCheck,{className:"mt-0.5 h-5 w-5 shrink-0 text-green-600"});case"failed":return t.jsx(I.CircleX,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"});default:return t.jsx(e.LoaderCircle,{className:"text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin"})}},u=e.isExportInProgress(s.status),n=(()=>{switch(s.status){case"pending":return"Queued...";case"processing":return"Processing...";case"chunking":return"Processing...";case"compacting":return"Finalizing...";default:return"Processing..."}})();return t.jsxs("div",{className:"group p-4 transition-colors hover:bg-muted/50",children:[t.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[d(),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h4",{className:"mb-1 truncate text-sm font-medium",children:s.title}),s.status==="completed"&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[s.totalRows.toLocaleString()," rows"]}),s.fileSize&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"•"}),t.jsx("span",{children:e.formatFileSize(s.fileSize)})]})]}),u&&t.jsx("div",{className:"text-xs text-muted-foreground",children:n}),s.status==="failed"&&t.jsx("div",{className:"line-clamp-2 text-xs text-destructive",children:s.error||"Export failed"})]})]}),t.jsx(e.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:c,"aria-label":"Remove notification",children:t.jsx(e.X,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"ml-8",children:[s.status==="completed"&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:L.formatDistanceToNow(s.startedAt,{addSuffix:!0})}),s.downloadUrl&&t.jsxs(e.Button,{size:"sm",variant:"outline",className:"h-8 bg-transparent",onClick:p,children:[t.jsx(e.Download,{className:"mr-1.5 h-3.5 w-3.5"}),"Download"]})]}),u&&t.jsxs("div",{children:[t.jsx(e.Progress,{value:s.progress,className:"h-1.5"}),t.jsxs("span",{className:"mt-1 block text-xs text-muted-foreground",children:[s.progress,"% complete"]})]}),s.status==="failed"&&t.jsx("span",{className:"text-xs text-muted-foreground",children:L.formatDistanceToNow(s.startedAt,{addSuffix:!0})})]})]})}function B(){const{authToken:s,tokenProps:r}=e.useSemaphorContext(),p=e.useExportStore(x=>x.activeExports),{clearCompleted:c,removeExport:d,updateExport:u}=e.useExportActions(),[n,l]=v.useState(!1),[h,o]=v.useState(!1),f=Array.from(p.values()).sort((x,j)=>j.startedAt.getTime()-x.startedAt.getTime()),b=f.some(x=>x.status==="completed"||x.status==="failed"),m=v.useCallback(async()=>{const x=r==null?void 0:r.apiServiceUrl,j=s==null?void 0:s.accessToken;if(!(!x||!j)){l(!0);try{const N=Array.from(p.values());await Promise.all(N.map(async w=>{try{const a=await e.getExportStatus(x,j,w.id);let i;if(a.status==="completed")try{i=await e.getDownloadUrl(x,j,w.id)}catch(g){console.error(`Failed to get download URL for ${w.id}:`,g)}u(w.id,{status:a.status,progress:a.progress,completedChunks:a.completedChunks,completedAt:a.completedAt?new Date(a.completedAt):void 0,lastUpdatedAt:new Date,fileSize:a.fileSize,error:a.error,downloadUrl:i})}catch(a){console.error(`Failed to refresh export ${w.id}:`,a)}}))}finally{l(!1)}}},[p,s==null?void 0:s.accessToken,r==null?void 0:r.apiServiceUrl,u]),C=v.useCallback(async()=>{const x=r==null?void 0:r.apiServiceUrl,j=s==null?void 0:s.accessToken;if(!x||!j){c();return}o(!0);try{const N=f.filter(a=>a.status==="completed"||a.status==="failed"),w=await Promise.allSettled(N.map(async a=>(await e.cancelExport(x,j,a.id),a.id)));for(const a of w)a.status==="fulfilled"?d(a.value):console.error("Failed to delete export:",a.reason)}finally{o(!1)}},[f,r==null?void 0:r.apiServiceUrl,s==null?void 0:s.accessToken,c,d]),D=v.useCallback(async x=>{const j=r==null?void 0:r.apiServiceUrl,N=s==null?void 0:s.accessToken;if(j&&N)try{await e.cancelExport(j,N,x),d(x);return}catch(w){console.error(`Failed to cancel export ${x}:`,w)}d(x)},[r==null?void 0:r.apiServiceUrl,s==null?void 0:s.accessToken,d]);return f.length===0?t.jsxs("div",{className:"p-6 text-center",children:[t.jsx(T,{className:"mx-auto mb-2 h-8 w-8 text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No active exports"}),t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Large exports will appear here"})]}):t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(T,{className:"h-5 w-5 text-muted-foreground"}),t.jsx("h4",{className:"font-semibold",children:"Exports"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(e.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:m,disabled:n,title:"Refresh status",children:t.jsx(e.RefreshCw,{className:`h-4 w-4 ${n?"animate-spin":""}`})}),b&&t.jsx(e.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-sm",onClick:C,disabled:h,children:h?"Clearing...":"Clear all"})]})]}),t.jsx("div",{className:"max-h-[350px] overflow-y-auto",children:t.jsx("div",{className:"divide-y",children:f.map(x=>t.jsx(U,{export:x,onRemove:D},x.id))})})]})}function J({variant:s}){const r=e.useExportStore(h=>h.activeExports),p=e.useInProgressExportsCount(),c=r.size>0,d=Array.from(r.values()).some(h=>h.status==="completed"||h.status==="failed"),n=p>0?p>9?"9+":String(p):null,l=c;return t.jsxs(e.Popover,{children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{variant:s??"ghost",size:"icon",className:"relative h-8 w-8","aria-label":"Export notifications",children:[t.jsx(e.Bell,{className:"h-4 w-4"}),l&&t.jsx("span",{className:`absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${n?"-right-0.5 -top-0.5 h-4 min-w-4 px-0.5 text-[10px] font-semibold":"right-0.5 top-0.5 h-2 w-2"}`,children:n})]})}),t.jsx(e.PopoverContent,{className:"w-80 p-0",align:"end",sideOffset:8,children:t.jsx(B,{})})]})}function ee(s){if(s)return{renamed:s.type==="rename"?{oldId:s.oldId,newId:s.newId}:void 0,removedControlId:s.type==="remove"?s.controlId:void 0,cardBindingsById:s.type==="add"||s.type==="update"?s.cardBindingsById:void 0,affectedBindingControlIds:s.type==="add"||s.type==="update"?s.affectedBindingControlIds:void 0}}function te({open:s,onOpenChange:r,trigger:p,showTrigger:c=!0,initialMode:d="manage"}){const u=d==="create",{forceClose:n,handleOpenChange:l,isCreateFlowActive:h,preventPassiveDismissDuringCreate:o,resolvedOpen:f,setIsCreateFlowActive:b}=I.useCreateFlowOverlayState({open:s,onOpenChange:r,initialCreateFlowActive:d==="create",dismissMode:c?"passive":"explicit-only"}),m=e.useDashboardStore(E=>E.dashboard),{setDashboardControlsModel:C}=e.useDashboardActions(),{participants:D}=e.useDashboardStructuralParticipants(e.getDashboardCards(m)),x=Array.from(new Map(D.flatMap(E=>E.fieldChoices.map(y=>{var F;return[y.value,{option:y,target:(F=E.fieldTargetMap)==null?void 0:F[y.value]}]}))).values()),j=Array.from(new Map(D.flatMap(E=>E.metricChoices.map(y=>{var F;return[y.value,{option:y,target:(F=E.metricTargetMap)==null?void 0:F[y.value]}]}))).values()),N=e.collectDashboardControlIds({...m||{},controls:[]}),w=e.buildDashboardStructuralParticipantIdsByControlId(m),a=(E,y,F)=>{C(E,y,ee(F))},i=v.useCallback(()=>{if(u){n();return}b(!1)},[u,n,b]),g=t.jsx(I.ControlDefinitionListEditor,{scope:"dashboard",controls:m.controls||[],reservedControlIds:N,defaultValues:m.defaultControlValues||{},usageByControlId:e.buildDashboardControlUsageById(m),availableFieldChoices:x,availableMetricChoices:j,structuralParticipants:D,structuralParticipantIdsByControlId:w,initialCreateFlow:d==="create",onCreateFlowActiveChange:b,onCreateFlowComplete:i,onChange:a,emptyMessage:"No dashboard controls yet."}),A=h?"Add dashboard control":"Dashboard Controls",S=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Dashboard Controls"}),t.jsx("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."})]}),g]});return c?t.jsxs(e.Popover,{open:f,onOpenChange:l,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:p||t.jsxs(e.Button,{variant:"outline",className:"h-7 px-2",size:"sm",children:[t.jsx(e.SlidersHorizontal,{className:"mr-2 h-4 w-4"}),"Controls"]})}),t.jsx(e.PopoverContent,{className:"w-[620px] max-w-[95vw] space-y-4",align:"end",onEscapeKeyDown:o,onPointerDownOutside:o,children:S})]}):t.jsx(e.Dialog,{open:f,onOpenChange:l,children:t.jsxs(e.DialogContent,{className:"flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",onEscapeKeyDown:o,onPointerDownOutside:o,children:[t.jsxs(e.DialogHeader,{className:h?"space-y-0":void 0,children:[t.jsx(e.DialogTitle,{className:"text-[15px]",children:A}),t.jsx(e.DialogDescription,{className:h?"sr-only":"text-[13px]",children:h?"Configure and add a shared dashboard control.":"Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."})]}),t.jsx("div",{className:"min-h-0 overflow-y-auto pr-1",children:g})]})})}function se({showFilters:s,onToggleFilters:r,onAddFilter:p,onAddControl:c,onManageControls:d,size:u="default",className:n,primaryButtonClassName:l,secondaryButtonClassName:h,dropdownContentClassName:o}){const f=u==="toolbar";return t.jsxs("div",{className:e.cn("relative inline-flex items-stretch overflow-visible rounded-md border border-input bg-background shadow-none",n),children:[t.jsxs(e.Button,{variant:"ghost",className:e.cn(f?"h-8":"h-7","rounded-none border-0 bg-transparent pl-3 pr-2 shadow-none hover:bg-accent/50",l),onClick:r,size:"sm",children:[s?t.jsx(P,{className:"mr-2 h-4 w-4"}):t.jsx(e.Filter,{className:"mr-2 h-4 w-4"}),"Filter"]}),t.jsxs(e.DropdownMenu,{children:[t.jsx(e.DropdownMenuTrigger,{asChild:!0,children:t.jsx(e.Button,{className:e.cn(f?"h-8 w-8":"h-7 w-8","rounded-none border-0 bg-transparent px-1 shadow-none hover:bg-accent/50",h),variant:"ghost",size:"sm","aria-label":"Filter and control actions",children:t.jsx(e.ChevronDown,{className:"h-4 w-4"})})}),t.jsxs(e.DropdownMenuContent,{align:"start",className:e.cn("rounded-xl border border-border/60 p-1 shadow-sm",o),children:[t.jsxs(e.DropdownMenuItem,{onSelect:p,children:[t.jsx(e.Filter,{className:"mr-2 h-4 w-4"}),"Add filter"]}),t.jsxs(e.DropdownMenuItem,{onSelect:c,children:[t.jsx(e.SlidersHorizontal,{className:"mr-2 h-4 w-4"}),"Add control"]}),t.jsxs(e.DropdownMenuItem,{onSelect:d,children:[t.jsx(e.Pencil,{className:"mr-2 h-4 w-4"}),"Manage controls"]})]})]})]})}exports.AdvancedModeToggle=Q;exports.DashboardControlsSettings=te;exports.DashboardFilterControlsButton=se;exports.ExportNotificationItem=U;exports.ExportNotificationList=B;exports.NotificationBell=J;exports.UnsavedChangesAlert=Y;exports.VisualEditingControls=W;exports.useExportPolling=q;exports.useExportRecovery=_;exports.usePristineSnapshotInitializer=Z;
@@ -1,6 +1,6 @@
1
1
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import { useMemo as b, useState as f, useRef as m, useEffect as S } from "react";
3
- import { u as e, c as N, B as D, X as p, C as J } from "./index-y1uW2fuZ.js";
3
+ import { u as e, c as N, B as D, X as p, C as J } from "./index-r_DA-pny.js";
4
4
  import "react-dom";
5
5
  function x() {
6
6
  const o = e((s) => s.dashboard), i = e((s) => s.actions.setDashboard), h = e(
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("react"),s=require("./index-DBuN9Zf6.js");require("react-dom");function b(){const t=s.useDashboardStore(e=>e.dashboard),i=s.useDashboardStore(e=>e.actions.setDashboard),h=s.useDashboardStore(e=>e.showDashboardJSON),u=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),a=r.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,d]=r.useState(a),n=r.useRef(a);return r.useEffect(()=>{a!==n.current&&(d(a),n.current=a)},[a]),o.jsxs("div",{className:s.cn("relative p-2",{hidden:!h}),children:[o.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>u(!1),children:[o.jsx(s.X,{className:"mr-2 h-4 w-4"}),"Close"]}),o.jsx("div",{className:"h-[550px] overflow-hidden",children:o.jsx(s.CodeEditor,{value:l,onValueChange:e=>{d(e);try{const c=JSON.parse(e);n.current=JSON.stringify(c,null,2),i(c)}catch{}},language:"json"})})]})}exports.default=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("react"),s=require("./index-Celt_oJr.js");require("react-dom");function b(){const t=s.useDashboardStore(e=>e.dashboard),i=s.useDashboardStore(e=>e.actions.setDashboard),h=s.useDashboardStore(e=>e.showDashboardJSON),u=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),a=r.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,d]=r.useState(a),n=r.useRef(a);return r.useEffect(()=>{a!==n.current&&(d(a),n.current=a)},[a]),o.jsxs("div",{className:s.cn("relative p-2",{hidden:!h}),children:[o.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>u(!1),children:[o.jsx(s.X,{className:"mr-2 h-4 w-4"}),"Close"]}),o.jsx("div",{className:"h-[550px] overflow-hidden",children:o.jsx(s.CodeEditor,{value:l,onValueChange:e=>{d(e);try{const c=JSON.parse(e);n.current=JSON.stringify(c,null,2),i(c)}catch{}},language:"json"})})]})}exports.default=b;
@@ -1,6 +1,6 @@
1
1
  import { jsx as e, jsxs as a, Fragment as ce } from "react/jsx-runtime";
2
2
  import de, { useState as f, useCallback as j, useEffect as K, useMemo as F } from "react";
3
- import { b as ue, d as q, e as Y, f as Q, g as ee, h as ae, R, c as C, i as $, L as y, P as me, j as he, B as E, k as fe, l as pe, m as ve, n as be, o as Se, p as ge, q as V, r as G, s as X, t as ye, v as re, w as we, x as P, S as xe, y as Ne, z as ke, A as Ce, E as Te, F as Z, I as Ie } from "./index-y1uW2fuZ.js";
3
+ import { b as ue, d as q, e as Y, f as Q, g as ee, h as ae, R, c as C, i as $, L as y, P as me, j as he, B as E, k as fe, l as pe, m as ve, n as be, o as Se, p as ge, q as V, r as G, s as X, t as ye, v as re, w as we, x as P, S as xe, y as Ne, z as ke, A as Ce, E as Te, F as Z, I as Ie } from "./index-r_DA-pny.js";
4
4
  function Pe(s = {}) {
5
5
  var I, D, M, L;
6
6
  const { authToken: i, tokenProps: r } = ue(), S = s.enabled ?? !0, o = (i == null ? void 0 : i.accessToken) ?? null, h = (r == null ? void 0 : r.apiServiceUrl) ?? null, [N, w] = f(!1), [g, v] = f(!1), [u, n] = f(!1), [x, c] = f(null), [p, k] = f(null), A = p || {
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("react"),a=require("./index-DBuN9Zf6.js");function W(r={}){var C,I,P,D;const{authToken:o,tokenProps:s}=a.useSemaphorContext(),v=r.enabled??!0,d=(o==null?void 0:o.accessToken)??null,f=(s==null?void 0:s.apiServiceUrl)??null,[y,g]=l.useState(!1),[S,p]=l.useState(!1),[m,n]=l.useState(!1),[j,c]=l.useState(null),[x,w]=l.useState(null),k=x||{tz:((I=(C=s==null?void 0:s.params)==null?void 0:C.calendarContext)==null?void 0:I.tz)||null,weekStart:((D=(P=s==null?void 0:s.params)==null?void 0:P.calendarContext)==null?void 0:D.weekStart)??null},b=l.useCallback(async()=>{if(!(!v||!d||!f)){g(!0),c(null);try{const u=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${d}`}});if(!u.ok){const h=await u.json().catch(()=>({}));throw new Error(h.error||"Failed to fetch preferences")}const i=await u.json();w({tz:i.tz,weekStart:i.weekStart,source:i.source,isInherited:i.isInherited,userHasPrefs:i.userHasPrefs,inherited:i.inherited})}catch(u){const i=u instanceof Error?u.message:"Unknown error";c(i)}finally{g(!1)}}},[d,f,v]);l.useEffect(()=>{v&&b()},[v,b]);const T=l.useCallback(async u=>{if(!d||!f)return c("Not authenticated"),!1;p(!0),c(null);try{const i=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`},body:JSON.stringify(u)});if(!i.ok){const h=await i.json().catch(()=>({}));throw new Error(h.error||"Failed to update preferences")}return await b(),!0}catch(i){const h=i instanceof Error?i.message:"Unknown error";return c(h),!1}finally{p(!1)}},[d,f,b]),N=l.useCallback(async()=>{if(!d||!f)return c("Not authenticated"),!1;n(!0),c(null);try{const u=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${d}`}});if(!u.ok){const h=await u.json().catch(()=>({}));throw new Error(h.error||"Failed to clear preferences")}const i=await u.text();if(i)try{const h=JSON.parse(i);return w({tz:h.tz,weekStart:h.weekStart,source:h.source,isInherited:h.isInherited??!0,userHasPrefs:!1,inherited:h.inherited}),!0}catch{}return await b(),!0}catch(u){const i=u instanceof Error?u.message:"Unknown error";return c(i),!1}finally{n(!1)}},[d,f,b]);return{preferences:k,isLoading:y,isSaving:S,isClearing:m,error:j,updatePreferences:T,clearPreferences:N,refetch:b}}const A=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],H=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}];function G(){try{const r=Intl;if(r.supportedValuesOf)return r.supportedValuesOf("timeZone")}catch{}return A.map(r=>r.value)}function V(r){switch(r){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function U(r){const o=A.find(s=>s.value===r);return o?o.label:r}function X(r){const o=H.find(s=>s.value===r);return o?o.label:String(r)}function q({open:r,onOpenChange:o}){var M,z,F;const{preferences:s,isLoading:v,isSaving:d,isClearing:f,updatePreferences:y,clearPreferences:g}=W({enabled:r}),S=s.tz||((M=s.inherited)==null?void 0:M.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,p=s.weekStart??((z=s.inherited)==null?void 0:z.weekStart)??1,[m,n]=l.useState(!s.userHasPrefs),[j,c]=l.useState(!1),[x,w]=l.useState(S),[k,b]=l.useState(p),[T,N]=l.useState(!1),C=l.useMemo(()=>G(),[]),I=l.useMemo(()=>C.filter(t=>!A.some(R=>R.value===t)),[C]),P=l.useMemo(()=>U(x),[x]),D=s.inherited?U(s.inherited.tz):"UTC",u=s.inherited?X(s.inherited.weekStart):"Monday",i=V((F=s.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!r){c(!1);return}j||(s.userHasPrefs!==void 0&&n(!s.userHasPrefs),w(S),b(p))},[r,j,s.userHasPrefs,S,p]);const h=async()=>{if(v){a.ue.error("Preferences are still loading. Please try again.");return}m?await g()?(a.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),o(!1)):a.ue.error("Failed to save preferences. Please try again."):await y({tz:x,weekStart:k})?(a.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),o(!1)):a.ue.error("Failed to save preferences. Please try again.")},$=()=>{o(!1)},L=d||f,O=L||v;return e.jsx(a.Dialog,{open:r,onOpenChange:o,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:"Calendar Preferences"}),e.jsx(a.DialogDescription,{children:"Set your timezone and week start preferences for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs(a.RadioGroup,{value:m?"defaults":"custom",onValueChange:t=>{c(!0),n(t==="defaults")},className:"space-y-3",children:[e.jsxs("div",{className:a.cn("flex items-start space-x-3 rounded-lg border p-4 cursor-pointer transition-colors",m?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"),onClick:()=>{c(!0),n(!0)},children:[e.jsx(a.RadioGroupItem,{value:"defaults",id:"mode-defaults"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs(a.Label,{htmlFor:"mode-defaults",className:"cursor-pointer font-medium",children:["Use ",i," defaults"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[D,", Week starts ",u]})]})]}),e.jsxs("div",{className:a.cn("flex items-start space-x-3 rounded-lg border p-4 cursor-pointer transition-colors",m?"border-border hover:border-muted-foreground/50":"border-primary bg-primary/5"),onClick:()=>{c(!0),n(!1)},children:[e.jsx(a.RadioGroupItem,{value:"custom",id:"mode-custom"}),e.jsx(a.Label,{htmlFor:"mode-custom",className:"cursor-pointer font-medium",children:"Use custom settings"})]})]}),e.jsxs("div",{className:a.cn("space-y-6 transition-opacity",m&&"opacity-50 pointer-events-none"),children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{children:"Timezone"}),e.jsxs(a.Popover,{open:T,onOpenChange:N,modal:!0,children:[e.jsx(a.PopoverTrigger,{asChild:!0,children:e.jsxs(a.Button,{variant:"outline",role:"combobox","aria-expanded":T,className:"w-full justify-between",disabled:m,children:[P,e.jsx(a.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(a.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(a.Command,{className:"overflow-visible",children:[e.jsx(a.CommandInput,{placeholder:"Search timezones..."}),e.jsxs(a.CommandList,{children:[e.jsx(a.CommandEmpty,{children:"No timezone found."}),e.jsx(a.CommandGroup,{heading:"Common",children:A.map(t=>e.jsxs(a.CommandItem,{value:`${t.value} ${t.label}`,onSelect:()=>{c(!0),w(t.value),N(!1)},children:[e.jsx(a.Check,{className:a.cn("mr-2 h-4 w-4",x===t.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:t.label}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t.value})]},t.value))}),e.jsx(a.CommandSeparator,{}),e.jsx(a.CommandGroup,{heading:"All Timezones",children:I.map(t=>e.jsxs(a.CommandItem,{value:t,onSelect:()=>{c(!0),w(t),N(!1)},children:[e.jsx(a.Check,{className:a.cn("mr-2 h-4 w-4",x===t?"opacity-100":"opacity-0")}),t]},t))})]})]})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(a.Label,{children:"Week Starts On"}),e.jsx(a.RadioGroup,{value:String(k),onValueChange:t=>{c(!0),b(Number(t))},className:"flex gap-4",disabled:m,children:H.map(t=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(a.RadioGroupItem,{value:String(t.value),id:`week-start-${t.value}`,disabled:m}),e.jsx(a.Label,{htmlFor:`week-start-${t.value}`,className:a.cn("cursor-pointer font-normal",m&&"cursor-not-allowed"),children:t.label})]},t.value))})]})]})]}),e.jsxs(a.DialogFooter,{children:[e.jsx(a.Button,{variant:"outline",onClick:$,disabled:L,children:"Cancel"}),e.jsx(a.Button,{onClick:h,disabled:O,children:L?e.jsxs(e.Fragment,{children:[e.jsx(a.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]})})}const E=6,B=1,_=20;function Z(r){return Number.isNaN(r)?E:Math.min(_,Math.max(B,r))}function J({open:r,onOpenChange:o,dashboard:s,onApply:v,disabled:d=!1}){const[f,y]=l.useState(!1),[g,S]=l.useState("top"),[p,m]=l.useState(String(E)),n=s.summary;l.useEffect(()=>{r&&(y((n==null?void 0:n.enabled)===!0),S((n==null?void 0:n.position)==="bottom"?"bottom":"top"),m(String((n==null?void 0:n.maxItems)??E)))},[r,n==null?void 0:n.enabled,n==null?void 0:n.position,n==null?void 0:n.maxItems]);const j=l.useMemo(()=>Z(Number.parseInt(p||`${E}`,10)),[p]),c=()=>{v({enabled:f,position:g,maxItems:j}),o(!1)};return e.jsx(a.Dialog,{open:r,onOpenChange:o,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[420px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:"Summary Settings"}),e.jsx(a.DialogDescription,{children:"Configure dashboard-level summary display. Card-level summary settings still control which cards contribute."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-enabled",children:"Enable Dashboard Summary"}),e.jsx(a.Switch,{size:"sm",id:"dashboard-summary-enabled",checked:f,disabled:d,onCheckedChange:y})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-position",children:"Position"}),e.jsxs(a.Select,{value:g,disabled:d,onValueChange:x=>S(x),children:[e.jsx(a.SelectTrigger,{id:"dashboard-summary-position",children:e.jsx(a.SelectValue,{placeholder:"Select position"})}),e.jsxs(a.SelectContent,{children:[e.jsx(a.SelectItem,{value:"top",children:"Top"}),e.jsx(a.SelectItem,{value:"bottom",children:"Bottom"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-max-items",children:"Max Items"}),e.jsx(a.Input,{id:"dashboard-summary-max-items",type:"number",min:B,max:_,disabled:d,value:p,onChange:x=>m(x.target.value),onBlur:()=>m(String(j))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Display limit only. Computation is unchanged."})]}),d&&e.jsx("p",{className:"text-xs text-amber-700",children:"Enter dashboard edit mode to modify summary settings."})]}),e.jsxs(a.DialogFooter,{children:[e.jsx(a.Button,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(a.Button,{onClick:c,disabled:d,children:"Apply"})]})]})})}exports.CalendarPreferencesDialog=q;exports.DashboardSummarySettingsDialog=J;
1
+ "use strict";const e=require("react/jsx-runtime"),l=require("react"),a=require("./index-Celt_oJr.js");function W(r={}){var C,I,P,D;const{authToken:o,tokenProps:s}=a.useSemaphorContext(),v=r.enabled??!0,d=(o==null?void 0:o.accessToken)??null,f=(s==null?void 0:s.apiServiceUrl)??null,[y,g]=l.useState(!1),[S,p]=l.useState(!1),[m,n]=l.useState(!1),[j,c]=l.useState(null),[x,w]=l.useState(null),k=x||{tz:((I=(C=s==null?void 0:s.params)==null?void 0:C.calendarContext)==null?void 0:I.tz)||null,weekStart:((D=(P=s==null?void 0:s.params)==null?void 0:P.calendarContext)==null?void 0:D.weekStart)??null},b=l.useCallback(async()=>{if(!(!v||!d||!f)){g(!0),c(null);try{const u=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${d}`}});if(!u.ok){const h=await u.json().catch(()=>({}));throw new Error(h.error||"Failed to fetch preferences")}const i=await u.json();w({tz:i.tz,weekStart:i.weekStart,source:i.source,isInherited:i.isInherited,userHasPrefs:i.userHasPrefs,inherited:i.inherited})}catch(u){const i=u instanceof Error?u.message:"Unknown error";c(i)}finally{g(!1)}}},[d,f,v]);l.useEffect(()=>{v&&b()},[v,b]);const T=l.useCallback(async u=>{if(!d||!f)return c("Not authenticated"),!1;p(!0),c(null);try{const i=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`},body:JSON.stringify(u)});if(!i.ok){const h=await i.json().catch(()=>({}));throw new Error(h.error||"Failed to update preferences")}return await b(),!0}catch(i){const h=i instanceof Error?i.message:"Unknown error";return c(h),!1}finally{p(!1)}},[d,f,b]),N=l.useCallback(async()=>{if(!d||!f)return c("Not authenticated"),!1;n(!0),c(null);try{const u=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${d}`}});if(!u.ok){const h=await u.json().catch(()=>({}));throw new Error(h.error||"Failed to clear preferences")}const i=await u.text();if(i)try{const h=JSON.parse(i);return w({tz:h.tz,weekStart:h.weekStart,source:h.source,isInherited:h.isInherited??!0,userHasPrefs:!1,inherited:h.inherited}),!0}catch{}return await b(),!0}catch(u){const i=u instanceof Error?u.message:"Unknown error";return c(i),!1}finally{n(!1)}},[d,f,b]);return{preferences:k,isLoading:y,isSaving:S,isClearing:m,error:j,updatePreferences:T,clearPreferences:N,refetch:b}}const A=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],H=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}];function G(){try{const r=Intl;if(r.supportedValuesOf)return r.supportedValuesOf("timeZone")}catch{}return A.map(r=>r.value)}function V(r){switch(r){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function U(r){const o=A.find(s=>s.value===r);return o?o.label:r}function X(r){const o=H.find(s=>s.value===r);return o?o.label:String(r)}function q({open:r,onOpenChange:o}){var M,z,F;const{preferences:s,isLoading:v,isSaving:d,isClearing:f,updatePreferences:y,clearPreferences:g}=W({enabled:r}),S=s.tz||((M=s.inherited)==null?void 0:M.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,p=s.weekStart??((z=s.inherited)==null?void 0:z.weekStart)??1,[m,n]=l.useState(!s.userHasPrefs),[j,c]=l.useState(!1),[x,w]=l.useState(S),[k,b]=l.useState(p),[T,N]=l.useState(!1),C=l.useMemo(()=>G(),[]),I=l.useMemo(()=>C.filter(t=>!A.some(R=>R.value===t)),[C]),P=l.useMemo(()=>U(x),[x]),D=s.inherited?U(s.inherited.tz):"UTC",u=s.inherited?X(s.inherited.weekStart):"Monday",i=V((F=s.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!r){c(!1);return}j||(s.userHasPrefs!==void 0&&n(!s.userHasPrefs),w(S),b(p))},[r,j,s.userHasPrefs,S,p]);const h=async()=>{if(v){a.ue.error("Preferences are still loading. Please try again.");return}m?await g()?(a.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),o(!1)):a.ue.error("Failed to save preferences. Please try again."):await y({tz:x,weekStart:k})?(a.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),o(!1)):a.ue.error("Failed to save preferences. Please try again.")},$=()=>{o(!1)},L=d||f,O=L||v;return e.jsx(a.Dialog,{open:r,onOpenChange:o,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:"Calendar Preferences"}),e.jsx(a.DialogDescription,{children:"Set your timezone and week start preferences for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs(a.RadioGroup,{value:m?"defaults":"custom",onValueChange:t=>{c(!0),n(t==="defaults")},className:"space-y-3",children:[e.jsxs("div",{className:a.cn("flex items-start space-x-3 rounded-lg border p-4 cursor-pointer transition-colors",m?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"),onClick:()=>{c(!0),n(!0)},children:[e.jsx(a.RadioGroupItem,{value:"defaults",id:"mode-defaults"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs(a.Label,{htmlFor:"mode-defaults",className:"cursor-pointer font-medium",children:["Use ",i," defaults"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[D,", Week starts ",u]})]})]}),e.jsxs("div",{className:a.cn("flex items-start space-x-3 rounded-lg border p-4 cursor-pointer transition-colors",m?"border-border hover:border-muted-foreground/50":"border-primary bg-primary/5"),onClick:()=>{c(!0),n(!1)},children:[e.jsx(a.RadioGroupItem,{value:"custom",id:"mode-custom"}),e.jsx(a.Label,{htmlFor:"mode-custom",className:"cursor-pointer font-medium",children:"Use custom settings"})]})]}),e.jsxs("div",{className:a.cn("space-y-6 transition-opacity",m&&"opacity-50 pointer-events-none"),children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{children:"Timezone"}),e.jsxs(a.Popover,{open:T,onOpenChange:N,modal:!0,children:[e.jsx(a.PopoverTrigger,{asChild:!0,children:e.jsxs(a.Button,{variant:"outline",role:"combobox","aria-expanded":T,className:"w-full justify-between",disabled:m,children:[P,e.jsx(a.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(a.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(a.Command,{className:"overflow-visible",children:[e.jsx(a.CommandInput,{placeholder:"Search timezones..."}),e.jsxs(a.CommandList,{children:[e.jsx(a.CommandEmpty,{children:"No timezone found."}),e.jsx(a.CommandGroup,{heading:"Common",children:A.map(t=>e.jsxs(a.CommandItem,{value:`${t.value} ${t.label}`,onSelect:()=>{c(!0),w(t.value),N(!1)},children:[e.jsx(a.Check,{className:a.cn("mr-2 h-4 w-4",x===t.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:t.label}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t.value})]},t.value))}),e.jsx(a.CommandSeparator,{}),e.jsx(a.CommandGroup,{heading:"All Timezones",children:I.map(t=>e.jsxs(a.CommandItem,{value:t,onSelect:()=>{c(!0),w(t),N(!1)},children:[e.jsx(a.Check,{className:a.cn("mr-2 h-4 w-4",x===t?"opacity-100":"opacity-0")}),t]},t))})]})]})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(a.Label,{children:"Week Starts On"}),e.jsx(a.RadioGroup,{value:String(k),onValueChange:t=>{c(!0),b(Number(t))},className:"flex gap-4",disabled:m,children:H.map(t=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(a.RadioGroupItem,{value:String(t.value),id:`week-start-${t.value}`,disabled:m}),e.jsx(a.Label,{htmlFor:`week-start-${t.value}`,className:a.cn("cursor-pointer font-normal",m&&"cursor-not-allowed"),children:t.label})]},t.value))})]})]})]}),e.jsxs(a.DialogFooter,{children:[e.jsx(a.Button,{variant:"outline",onClick:$,disabled:L,children:"Cancel"}),e.jsx(a.Button,{onClick:h,disabled:O,children:L?e.jsxs(e.Fragment,{children:[e.jsx(a.LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]})})}const E=6,B=1,_=20;function Z(r){return Number.isNaN(r)?E:Math.min(_,Math.max(B,r))}function J({open:r,onOpenChange:o,dashboard:s,onApply:v,disabled:d=!1}){const[f,y]=l.useState(!1),[g,S]=l.useState("top"),[p,m]=l.useState(String(E)),n=s.summary;l.useEffect(()=>{r&&(y((n==null?void 0:n.enabled)===!0),S((n==null?void 0:n.position)==="bottom"?"bottom":"top"),m(String((n==null?void 0:n.maxItems)??E)))},[r,n==null?void 0:n.enabled,n==null?void 0:n.position,n==null?void 0:n.maxItems]);const j=l.useMemo(()=>Z(Number.parseInt(p||`${E}`,10)),[p]),c=()=>{v({enabled:f,position:g,maxItems:j}),o(!1)};return e.jsx(a.Dialog,{open:r,onOpenChange:o,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[420px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:"Summary Settings"}),e.jsx(a.DialogDescription,{children:"Configure dashboard-level summary display. Card-level summary settings still control which cards contribute."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-enabled",children:"Enable Dashboard Summary"}),e.jsx(a.Switch,{size:"sm",id:"dashboard-summary-enabled",checked:f,disabled:d,onCheckedChange:y})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-position",children:"Position"}),e.jsxs(a.Select,{value:g,disabled:d,onValueChange:x=>S(x),children:[e.jsx(a.SelectTrigger,{id:"dashboard-summary-position",children:e.jsx(a.SelectValue,{placeholder:"Select position"})}),e.jsxs(a.SelectContent,{children:[e.jsx(a.SelectItem,{value:"top",children:"Top"}),e.jsx(a.SelectItem,{value:"bottom",children:"Bottom"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"dashboard-summary-max-items",children:"Max Items"}),e.jsx(a.Input,{id:"dashboard-summary-max-items",type:"number",min:B,max:_,disabled:d,value:p,onChange:x=>m(x.target.value),onBlur:()=>m(String(j))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Display limit only. Computation is unchanged."})]}),d&&e.jsx("p",{className:"text-xs text-amber-700",children:"Enter dashboard edit mode to modify summary settings."})]}),e.jsxs(a.DialogFooter,{children:[e.jsx(a.Button,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(a.Button,{onClick:c,disabled:d,children:"Apply"})]})]})})}exports.CalendarPreferencesDialog=q;exports.DashboardSummarySettingsDialog=J;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-DBuN9Zf6.js"),N=require("react"),it=require("./use-visual-utils-DNp8XO6G.js"),De=require("./use-create-flow-overlay-state-COe7Ekru.js"),cn=require("react-dom");function dn(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>s[a]})}}return n.default=s,Object.freeze(n)}const Pt=dn(N);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-Celt_oJr.js"),N=require("react"),it=require("./use-visual-utils-CWcTBBvd.js"),De=require("./use-create-flow-overlay-state-DVyd9L7O.js"),cn=require("react-dom");function dn(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>s[a]})}}return n.default=s,Object.freeze(n)}const Pt=dn(N);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,9 +1,9 @@
1
1
  import { jsxs as a, jsx as e, Fragment as ye } from "react/jsx-runtime";
2
- import { bM as Be, x as ut, M as fe, U as F, e8 as ni, e9 as Fo, L as z, y as ee, z as te, A as ae, E as ne, F as j, ac as We, B as Q, ct as St, ea as Qn, eb as si, ec as ri, ed as li, ee as ii, ef as Jn, a6 as Et, X as nt, eg as Ys, ch as Yn, d as pa, e as fa, f as ga, g as xa, h as Va, bZ as Nt, bW as gt, bT as yt, bU as mt, bV as ht, eh as cl, ei as Ro, ej as oi, v as _n, ek as Ba, cP as Ja, c as W, cc as wt, el as ci, em as vs, cB as di, en as Lo, eo as Po, ep as Vo, eq as un, er as Bo, es as ui, et as zo, H as Wn, C as Xn, eu as _o, ev as $o, u as Oe, ew as qt, ex as La, cC as Ya, cD as Wa, ey as zs, cF as Xa, cG as dt, ez as za, eA as qo, eB as _s, eC as Ln, b as Ca, ag as mi, e7 as mn, eD as Ws, eE as jo, eF as Ko, eG as hi, eH as pi, eI as fi, dH as Xs, dF as Go, I as Ie, P as Tt, eJ as Uo, l as kt, eK as Ho, w as la, eL as Qo, eM as Jo, eN as Yo, bN as Za, bO as wa, bP as Sa, bQ as xn, bR as Gt, bS as Pa, eO as $s, eP as Ht, eQ as ot, eR as Qt, eS as gi, eT as $n, eU as qn, eV as jn, eW as Zs, dn as _a, eX as xi, eY as Wo, eZ as Xo, e_ as Zo, k as bi, e$ as ec, f0 as tc, f1 as ac, f2 as nc, f3 as vi, f4 as sc, f5 as ys, f6 as rc, f7 as dl, f8 as lc, f9 as ul, fa as er, fb as ic, fc as bn, fd as oc, R as vn, fe as Zn, ff as en, cQ as tr, fg as yi, i as ia, fh as cc, cn as Pt, co as _t, fi as dc, cp as $t, c$ as ar, db as nr, N as Ni, fj as sr, fk as uc, fl as Ci, fm as wi, fn as zt, e0 as Ns, fo as mc, fp as hc, fq as pc, fr as Si, ax as Ti, fs as ki, ft as fc, fu as gc, fv as xc, fw as hn, fx as bc, fy as vc, fz as ml, fA as yc, Z as es, a4 as rr, fB as Nc, fC as lr, ds as Cc, fD as hl, a7 as pt, fE as wc, dO as ir, dP as or, dQ as ma, dR as Pn, fF as Sc, e1 as Tc, fG as Ii, fH as kc, fI as Ic, d4 as ts, fJ as Dc, fK as Ac, fL as pl, fM as Ec, j as Ot, dm as ba, dt as as, cK as Lt, fN as ea, fO as va, fP as ya, fQ as oa, fR as $a, fS as Oc, fT as Mc, b2 as Fc, fU as Rc, fV as Lc, fW as Pc, fX as Vc, da as ha, fY as Bc, fZ as Di, f_ as zc, f$ as _c, g0 as $c, g1 as Ai, dI as fl, c6 as qc, cd as Ut, dj as jc, g2 as Kc, g3 as Gc, g4 as Uc, g5 as gl, g6 as Hc, g7 as Qc, g8 as Jc, g9 as Yc, af as Wc, dq as Xc, ga as Zc, gb as Ei, gc as ed, gd as td, ge as ad, gf as nd, gg as sd, gh as rd, gi as qs, gj as ld, gk as id, gl as od, gm as js, gn as cd, go as dd, gp as ud, gq as md, gr as xl, gs as hd, gt as bl, gu as vl, dd as Ks, cS as pd, gv as fd, cT as gd, cU as xd, cV as bd, cW as vd, cX as yd, cY as Nd, cZ as Cd, gw as tn, gx as wd, S as He, gy as Sd, gz as Td, gA as Oi, cE as cr, de as kd, cH as Id, gB as Dd, gC as Ad, gD as pn, gE as Kn, gF as Ed, gG as qa, gH as Ke, gI as Ge, gJ as Ue, gK as Od, gL as Md, gM as Mi, gN as Fi, gO as aa, gP as On, gQ as yl, gR as Fd, dp as Ri, gS as Rd, gT as Ld, gU as Pd, gV as yn, gW as Vd, gX as Bd, gY as zd, m as ja, n as Ka, o as Ga, p as Ua, q as Ha, r as Qa, gZ as _d, g_ as $d, g$ as Nl, h0 as qd, s as Ta, h1 as jd, h2 as Cs, h3 as Cl, h4 as Kd, h5 as At, h6 as Gd, h7 as Ud, h8 as Hd, h9 as Qd, ha as Jd, hb as ws, hc as Li, hd as Yd, he as Wd, hf as Xd, hg as Gn, hh as Zd, hi as eu, hj as dr, hk as ur, hl as Pi, hm as tu, d2 as Vi, hn as Bi, ho as zi, hp as au, e6 as nu, hq as et, hr as su, bg as ru, hs as Mn, ht as lu, hu as wl, hv as iu, hw as ou, bc as Sl, hx as Tl, hy as cu, hz as du, hA as uu, hB as mu, hC as hu, hD as pu, hE as fu, hF as gu, hG as xu, hH as bu, hI as vu, hJ as yu, hK as Nu, hL as Cu, hM as _i, hN as wu, hO as Su, hP as Tu, hQ as ku, hR as Iu, hS as Du, hT as Au, hU as Eu, hV as Ou, hW as Mu, hX as Fu, hY as $i, hZ as Ru, h_ as mr, h$ as ns, i0 as qi, i1 as Lu, i2 as Pu, i3 as Vu, i4 as Bu, i5 as zu, i6 as _u, i7 as ss, i8 as Ss, i9 as $u, ia as qu, ib as ju, ic as Ku, id as Gu, ie as kl, ig as Na, ih as Uu, ii as ji, ij as Ki, ik as Gs, il as Gi, im as Il, d6 as Dl, io as Hu, ip as Qu, iq as Ju, ir as Vn, is as Yu, it as hr, iu as Wu, iv as Xu, iw as Un, ix as Zu, iy as em, iz as tm, iA as fn, iB as na, iC as Us, iD as Hs, iE as gn, iF as Ui, aY as am, iG as nm, iH as Ts, iI as ks, iJ as sm, iK as Is, iL as rm, iM as Al, iN as El, iO as lm, iP as im, iQ as om, iR as cm, iS as dm, iT as um, iU as rs, cM as ls, iV as is, iW as Ol, iX as Hi, dX as Ds, iY as mm, iZ as hm, i_ as pm, _ as fm } from "./index-y1uW2fuZ.js";
2
+ import { bM as Be, x as ut, M as fe, U as F, e8 as ni, e9 as Fo, L as z, y as ee, z as te, A as ae, E as ne, F as j, ac as We, B as Q, ct as St, ea as Qn, eb as si, ec as ri, ed as li, ee as ii, ef as Jn, a6 as Et, X as nt, eg as Ys, ch as Yn, d as pa, e as fa, f as ga, g as xa, h as Va, bZ as Nt, bW as gt, bT as yt, bU as mt, bV as ht, eh as cl, ei as Ro, ej as oi, v as _n, ek as Ba, cP as Ja, c as W, cc as wt, el as ci, em as vs, cB as di, en as Lo, eo as Po, ep as Vo, eq as un, er as Bo, es as ui, et as zo, H as Wn, C as Xn, eu as _o, ev as $o, u as Oe, ew as qt, ex as La, cC as Ya, cD as Wa, ey as zs, cF as Xa, cG as dt, ez as za, eA as qo, eB as _s, eC as Ln, b as Ca, ag as mi, e7 as mn, eD as Ws, eE as jo, eF as Ko, eG as hi, eH as pi, eI as fi, dH as Xs, dF as Go, I as Ie, P as Tt, eJ as Uo, l as kt, eK as Ho, w as la, eL as Qo, eM as Jo, eN as Yo, bN as Za, bO as wa, bP as Sa, bQ as xn, bR as Gt, bS as Pa, eO as $s, eP as Ht, eQ as ot, eR as Qt, eS as gi, eT as $n, eU as qn, eV as jn, eW as Zs, dn as _a, eX as xi, eY as Wo, eZ as Xo, e_ as Zo, k as bi, e$ as ec, f0 as tc, f1 as ac, f2 as nc, f3 as vi, f4 as sc, f5 as ys, f6 as rc, f7 as dl, f8 as lc, f9 as ul, fa as er, fb as ic, fc as bn, fd as oc, R as vn, fe as Zn, ff as en, cQ as tr, fg as yi, i as ia, fh as cc, cn as Pt, co as _t, fi as dc, cp as $t, c$ as ar, db as nr, N as Ni, fj as sr, fk as uc, fl as Ci, fm as wi, fn as zt, e0 as Ns, fo as mc, fp as hc, fq as pc, fr as Si, ax as Ti, fs as ki, ft as fc, fu as gc, fv as xc, fw as hn, fx as bc, fy as vc, fz as ml, fA as yc, Z as es, a4 as rr, fB as Nc, fC as lr, ds as Cc, fD as hl, a7 as pt, fE as wc, dO as ir, dP as or, dQ as ma, dR as Pn, fF as Sc, e1 as Tc, fG as Ii, fH as kc, fI as Ic, d4 as ts, fJ as Dc, fK as Ac, fL as pl, fM as Ec, j as Ot, dm as ba, dt as as, cK as Lt, fN as ea, fO as va, fP as ya, fQ as oa, fR as $a, fS as Oc, fT as Mc, b2 as Fc, fU as Rc, fV as Lc, fW as Pc, fX as Vc, da as ha, fY as Bc, fZ as Di, f_ as zc, f$ as _c, g0 as $c, g1 as Ai, dI as fl, c6 as qc, cd as Ut, dj as jc, g2 as Kc, g3 as Gc, g4 as Uc, g5 as gl, g6 as Hc, g7 as Qc, g8 as Jc, g9 as Yc, af as Wc, dq as Xc, ga as Zc, gb as Ei, gc as ed, gd as td, ge as ad, gf as nd, gg as sd, gh as rd, gi as qs, gj as ld, gk as id, gl as od, gm as js, gn as cd, go as dd, gp as ud, gq as md, gr as xl, gs as hd, gt as bl, gu as vl, dd as Ks, cS as pd, gv as fd, cT as gd, cU as xd, cV as bd, cW as vd, cX as yd, cY as Nd, cZ as Cd, gw as tn, gx as wd, S as He, gy as Sd, gz as Td, gA as Oi, cE as cr, de as kd, cH as Id, gB as Dd, gC as Ad, gD as pn, gE as Kn, gF as Ed, gG as qa, gH as Ke, gI as Ge, gJ as Ue, gK as Od, gL as Md, gM as Mi, gN as Fi, gO as aa, gP as On, gQ as yl, gR as Fd, dp as Ri, gS as Rd, gT as Ld, gU as Pd, gV as yn, gW as Vd, gX as Bd, gY as zd, m as ja, n as Ka, o as Ga, p as Ua, q as Ha, r as Qa, gZ as _d, g_ as $d, g$ as Nl, h0 as qd, s as Ta, h1 as jd, h2 as Cs, h3 as Cl, h4 as Kd, h5 as At, h6 as Gd, h7 as Ud, h8 as Hd, h9 as Qd, ha as Jd, hb as ws, hc as Li, hd as Yd, he as Wd, hf as Xd, hg as Gn, hh as Zd, hi as eu, hj as dr, hk as ur, hl as Pi, hm as tu, d2 as Vi, hn as Bi, ho as zi, hp as au, e6 as nu, hq as et, hr as su, bg as ru, hs as Mn, ht as lu, hu as wl, hv as iu, hw as ou, bc as Sl, hx as Tl, hy as cu, hz as du, hA as uu, hB as mu, hC as hu, hD as pu, hE as fu, hF as gu, hG as xu, hH as bu, hI as vu, hJ as yu, hK as Nu, hL as Cu, hM as _i, hN as wu, hO as Su, hP as Tu, hQ as ku, hR as Iu, hS as Du, hT as Au, hU as Eu, hV as Ou, hW as Mu, hX as Fu, hY as $i, hZ as Ru, h_ as mr, h$ as ns, i0 as qi, i1 as Lu, i2 as Pu, i3 as Vu, i4 as Bu, i5 as zu, i6 as _u, i7 as ss, i8 as Ss, i9 as $u, ia as qu, ib as ju, ic as Ku, id as Gu, ie as kl, ig as Na, ih as Uu, ii as ji, ij as Ki, ik as Gs, il as Gi, im as Il, d6 as Dl, io as Hu, ip as Qu, iq as Ju, ir as Vn, is as Yu, it as hr, iu as Wu, iv as Xu, iw as Un, ix as Zu, iy as em, iz as tm, iA as fn, iB as na, iC as Us, iD as Hs, iE as gn, iF as Ui, aY as am, iG as nm, iH as Ts, iI as ks, iJ as sm, iK as Is, iL as rm, iM as Al, iN as El, iO as lm, iP as im, iQ as om, iR as cm, iS as dm, iT as um, iU as rs, cM as ls, iV as is, iW as Ol, iX as Hi, dX as Ds, iY as mm, iZ as hm, i_ as pm, _ as fm } from "./index-r_DA-pny.js";
3
3
  import * as Bn from "react";
4
4
  import ta, { useState as G, useRef as Te, useCallback as Se, useEffect as Ne, useMemo as oe, useContext as pr, Suspense as gm } from "react";
5
- import { r as Qi, f as Nn } from "./use-visual-utils-Ccmzx7-m.js";
6
- import { f as xt, C as Ml, g as fr, V as Ji, u as xm, e as bm } from "./use-create-flow-overlay-state-Cr9AFdXx.js";
5
+ import { r as Qi, f as Nn } from "./use-visual-utils-CqL5PNOR.js";
6
+ import { f as xt, C as Ml, g as fr, V as Ji, u as xm, e as bm } from "./use-create-flow-overlay-state-C1xhazfY.js";
7
7
  import { createPortal as vm } from "react-dom";
8
8
  /**
9
9
  * @license lucide-react v0.453.0 - ISC