react-semaphor 0.1.283 → 0.1.284

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 (31) hide show
  1. package/dist/chunks/{dashboard-controls-wfMo3T6T.js → dashboard-controls-4pDdG3me.js} +1 -1
  2. package/dist/chunks/{dashboard-controls-DN8jYCON.js → dashboard-controls-Dhry2k8x.js} +4 -4
  3. package/dist/chunks/{dashboard-filter-controls-button-zeiatmo1.js → dashboard-filter-controls-button-BZXrmJP2.js} +11 -11
  4. package/dist/chunks/{dashboard-filter-controls-button-DKc_6T_O.js → dashboard-filter-controls-button-DEUvxIWD.js} +1 -1
  5. package/dist/chunks/dashboard-json-CYnf5rdp.js +1 -0
  6. package/dist/chunks/dashboard-json-D-KsLEGl.js +61 -0
  7. package/dist/chunks/{dashboard-summary-settings-dialog-CWtlFDFP.js → dashboard-summary-settings-dialog-B4jsBFro.js} +15 -15
  8. package/dist/chunks/{dashboard-summary-settings-dialog-BPyawgMV.js → dashboard-summary-settings-dialog-Cn4-fB2h.js} +1 -1
  9. package/dist/chunks/{edit-dashboard-visual-4nQV1U_c.js → edit-dashboard-visual-BDIt_S2F.js} +4782 -4853
  10. package/dist/chunks/edit-dashboard-visual-BQnApBvr.js +193 -0
  11. package/dist/chunks/{index-BHWWNpG6.js → index-DBuN9Zf6.js} +281 -250
  12. package/dist/chunks/{index-B7kUtCgG.js → index-y1uW2fuZ.js} +30193 -28860
  13. package/dist/chunks/{resource-management-panel-Dpin6Ffw.js → resource-management-panel-BC-cvjI9.js} +2 -2
  14. package/dist/chunks/{resource-management-panel-D8xvqypt.js → resource-management-panel-PSvKnmq5.js} +1 -1
  15. package/dist/chunks/{use-create-flow-overlay-state-XkHgf9f3.js → use-create-flow-overlay-state-COe7Ekru.js} +1 -1
  16. package/dist/chunks/{use-create-flow-overlay-state-VwKDgVAy.js → use-create-flow-overlay-state-Cr9AFdXx.js} +4 -4
  17. package/dist/chunks/use-visual-utils-Ccmzx7-m.js +353 -0
  18. package/dist/chunks/use-visual-utils-DNp8XO6G.js +1 -0
  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 +3 -2
  27. package/dist/chunks/dashboard-json-DK_hQ4vs.js +0 -66
  28. package/dist/chunks/dashboard-json-DyJBSpIU.js +0 -1
  29. package/dist/chunks/edit-dashboard-visual-0lBlwTCM.js +0 -193
  30. package/dist/chunks/use-visual-utils-C8YSTPfX.js +0 -1
  31. package/dist/chunks/use-visual-utils-CBocWNV1.js +0 -347
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as r, Fragment as le } from "react/jsx-runtime";
2
- import { bM as Pe, u as re, U as je, K as ce, cA as Fe, cB as Be, c as X, B as P, ct as ie, cC as ze, cD as He, cE as Ke, cF as _e, cG as Q, w as oe, cH as We, cI as Ge, cJ as Ye, cK as ge, ch as ue, cL as $e, cM as Je, cN as xe, cO as De, cP as we, cQ as Qe, al as Ne, ah as ve, cR as ye, cS as Ce, cT as Se, cU as Ee, cV as Ve, cW as Le, cX as Ae, cY as Oe, cZ as Te, c_ as Xe, c$ as he, d0 as Ze, af as te, b as qe, d1 as Re, d2 as ke, e as et, f as tt, g as rt, h as nt, i as ot, L as be, I as de, v as st, d3 as at, d4 as it, d5 as dt, bT as lt, bU as ct, bV as ut, bW as ht, d6 as mt, d7 as pt } from "./index-B7kUtCgG.js";
2
+ import { bM as Pe, u as re, U as je, K as ce, cA as Fe, cB as Be, c as X, B as P, ct as ie, cC as ze, cD as He, cE as Ke, cF as _e, cG as Q, w as oe, cH as We, cI as Ge, cJ as Ye, cK as ge, ch as ue, cL as $e, cM as Je, cN as xe, cO as De, cP as we, cQ as Qe, al as Ne, ah as ve, cR as ye, cS as Ce, cT as Se, cU as Ee, cV as Ve, cW as Le, cX as Ae, cY as Oe, cZ as Te, c_ as Xe, c$ as he, d0 as Ze, af as te, b as qe, d1 as Re, d2 as ke, d as et, e as tt, f as rt, g as nt, h as ot, L as be, I as de, v as st, d3 as at, d4 as it, d5 as dt, bT as lt, bU as ct, bV as ut, bW as ht, d6 as mt, d7 as pt } from "./index-y1uW2fuZ.js";
3
3
  import ft, { useRef as gt, useEffect as ne, useState as x } from "react";
4
- import { u as Ue } from "./use-visual-utils-CBocWNV1.js";
4
+ import { u as Ue } from "./use-visual-utils-Ccmzx7-m.js";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
7
7
  *
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-BHWWNpG6.js"),h=require("react"),re=require("./use-visual-utils-C8YSTPfX.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index-DBuN9Zf6.js"),h=require("react"),re=require("./use-visual-utils-DNp8XO6G.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("./index-BHWWNpG6.js"),t=require("react/jsx-runtime"),C=require("react"),se=require("./use-visual-utils-C8YSTPfX.js");/**
1
+ "use strict";const e=require("./index-DBuN9Zf6.js"),t=require("react/jsx-runtime"),C=require("react"),se=require("./use-visual-utils-DNp8XO6G.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,7 +1,7 @@
1
- import { bM as le, U as L, bN as Ke, bO as pt, bP as mt, bQ as ft, bR as ht, bS as bt, u as De, af as gt, bT as yt, bU as xt, bV as vt, ac as Ct, c as A, bW as kt, bX as Nt, B as q, s as St, H as ne, N as Ye, J as He, bY as Xe, w as Pe, M as Ne, bZ as Ge, X as Je, x as O, b_ as Dt, b$ as wt, c0 as ae, c1 as Fe, c2 as ze, c3 as fe, c4 as he, c5 as Tt, c6 as Ae, c7 as Vt, c8 as It, c9 as re, ca as qt, cb as Me, cc as Et, a6 as Oe, cd as Be, ce as We, cf as Ze, cg as et, ch as _t, L as H, I as tt, y as be, z as ge, A as ye, E as xe, F as ve, ci as at, cj as Lt, ck as Ft, cl as rt, cm as st, cn as zt, co as At, cp as Mt, cq as Ot, cr as Bt, cs as Qt, ct as jt, cu as Qe, cv as Rt, cw as je, cx as Ut, cy as Ce, cz as $t } from "./index-B7kUtCgG.js";
1
+ import { bM as le, U as L, bN as Ke, bO as pt, bP as mt, bQ as ft, bR as ht, bS as bt, u as De, af as gt, bT as yt, bU as xt, bV as vt, ac as Ct, c as A, bW as kt, bX as Nt, B as q, s as St, H as ne, N as Ye, J as He, bY as Xe, w as Pe, M as Ne, bZ as Ge, X as Je, x as O, b_ as Dt, b$ as wt, c0 as ae, c1 as Fe, c2 as ze, c3 as fe, c4 as he, c5 as Tt, c6 as Ae, c7 as Vt, c8 as It, c9 as re, ca as qt, cb as Me, cc as Et, a6 as Oe, cd as Be, ce as We, cf as Ze, cg as et, ch as _t, L as H, I as tt, y as be, z as ge, A as ye, E as xe, F as ve, ci as at, cj as Lt, ck as Ft, cl as rt, cm as st, cn as zt, co as At, cp as Mt, cq as Ot, cr as Bt, cs as Qt, ct as jt, cu as Qe, cv as Rt, cw as je, cx as Ut, cy as Ce, cz as $t } from "./index-y1uW2fuZ.js";
2
2
  import { jsx as t, jsxs as d, Fragment as $ } from "react/jsx-runtime";
3
3
  import { useMemo as z, useState as B, useRef as ke, useCallback as M, useEffect as Se, Fragment as Kt } from "react";
4
- import { u as we } from "./use-visual-utils-CBocWNV1.js";
4
+ import { u as we } from "./use-visual-utils-Ccmzx7-m.js";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
7
7
  *
@@ -1591,7 +1591,7 @@ export {
1591
1591
  Ht as c,
1592
1592
  ia as d,
1593
1593
  ca as e,
1594
- da as f,
1595
- nt as g,
1594
+ nt as f,
1595
+ da as g,
1596
1596
  ua as u
1597
1597
  };
@@ -0,0 +1,353 @@
1
+ import { G as Y, b as X, H as Z, J as q, K as ee, M as G, N as te, u as y, O as re, Q as se, x as $, T as oe, U as H, V as ae } from "./index-y1uW2fuZ.js";
2
+ import { useState as Q, useEffect as ne, useCallback as M } from "react";
3
+ function ie(e) {
4
+ const n = e.toUpperCase().indexOf("WHERE"), r = e.toUpperCase().indexOf("GROUP BY"), s = e.toUpperCase().indexOf("LIMIT"), t = e.toUpperCase().indexOf("ORDER BY");
5
+ let o = e.length;
6
+ if (t !== -1 && (o = t), s !== -1 && s < o && (o = s), n !== -1) {
7
+ const i = e.substring(0, n), a = e.substring(n);
8
+ return `${i} {{ filters | where }} AND ${a.substring(
9
+ 6
10
+ )}`;
11
+ } else if (r !== -1) {
12
+ const i = e.substring(0, r), a = e.substring(r);
13
+ return `${i} {{ filters | where }} ${a}`;
14
+ } else {
15
+ const i = e.substring(0, o), a = e.substring(o);
16
+ return console.log("beforeClause", i), console.log("afterClause", a), a ? `${i} {{ filters | where }} ${a}` : `${i.replace(/;$/, "")} {{ filters | where }}`;
17
+ }
18
+ }
19
+ function ce(e) {
20
+ const [n, r] = Q(null), [s, t] = Q(null), o = Y();
21
+ return ne(() => {
22
+ if (!e || e.trim() === "") {
23
+ r(null), t(null);
24
+ return;
25
+ }
26
+ if (!o)
27
+ return;
28
+ (async () => {
29
+ try {
30
+ if (!e.startsWith("http://") && !e.startsWith("https://"))
31
+ throw new Error(`Invalid URL format: ${e}`);
32
+ try {
33
+ new URL(e);
34
+ } catch {
35
+ throw new Error(`Invalid URL: ${e}`);
36
+ }
37
+ const c = `${e.endsWith("/") ? e : `${e}/`}index.js`;
38
+ try {
39
+ if (!(await fetch(c, { method: "HEAD" })).ok)
40
+ throw new Error(`Module not found at ${c}`);
41
+ } catch {
42
+ }
43
+ const u = await import(
44
+ /* @vite-ignore */
45
+ /* webpackIgnore: true */
46
+ c
47
+ );
48
+ if (typeof u.useChartStore != "function")
49
+ throw new Error("useChartStore is not a function");
50
+ r(() => u.useChartStore), t(null);
51
+ } catch (a) {
52
+ const c = a instanceof Error ? a.message : "Unknown error";
53
+ console.error("Failed to load remote chart store:", c), t(c), r(null);
54
+ }
55
+ })();
56
+ }, [e, o]), n;
57
+ }
58
+ function de(e, n) {
59
+ if (e.length === 0)
60
+ return "";
61
+ const r = e.find(
62
+ (s) => {
63
+ var t, o;
64
+ return ((t = s.customCardPreferences) == null ? void 0 : t.visualType) === "multiple" || !!((o = s.customCardPreferences) != null && o.dataInputCardIds);
65
+ }
66
+ );
67
+ if (r)
68
+ return r.id;
69
+ if (n) {
70
+ const s = e.find((t) => t.id === n);
71
+ if (s) {
72
+ const t = s.tabTitle;
73
+ if (t == "All__Header")
74
+ return e[0].id;
75
+ if (t && t.endsWith("__Header")) {
76
+ const i = t.split("__")[0], a = e.find(
77
+ (c) => c.tabTitle === i
78
+ );
79
+ return a ? a.id : e[0].id;
80
+ }
81
+ return n;
82
+ }
83
+ }
84
+ return e[0].id;
85
+ }
86
+ const O = /* @__PURE__ */ new Set();
87
+ function ge(e) {
88
+ return O.add(e), () => {
89
+ O.delete(e);
90
+ };
91
+ }
92
+ function le() {
93
+ O.forEach((e) => {
94
+ e();
95
+ });
96
+ }
97
+ const ue = (e) => {
98
+ if (!e || !("detailTableBackup" in e))
99
+ return e;
100
+ const { detailTableBackup: n, ...r } = e;
101
+ return r;
102
+ };
103
+ async function _(e, n, r, s) {
104
+ if (!n || !r)
105
+ throw new Error("Missing auth token or visual ID");
106
+ const t = ["resource-by-id", "visual", r], o = s.getQueryData(t);
107
+ if (o)
108
+ return console.log("Using cached visual data for:", r), { data: o, fromCache: !0 };
109
+ console.log("Fetching visual data from network for:", r);
110
+ const i = $.loading("Loading visual...", {
111
+ position: "top-center"
112
+ });
113
+ try {
114
+ const a = await fetch(
115
+ `${e}/management/v1/visuals/${r}`,
116
+ {
117
+ headers: {
118
+ Authorization: `Bearer ${n}`
119
+ }
120
+ }
121
+ );
122
+ if (!a.ok)
123
+ throw new Error("Failed to load visual");
124
+ const c = await a.json();
125
+ return s.setQueryData(t, c), $.dismiss(i), { data: c, fromCache: !1 };
126
+ } catch (a) {
127
+ throw $.dismiss(i), a;
128
+ }
129
+ }
130
+ function z(e) {
131
+ if (typeof e == "string")
132
+ return JSON.parse(e);
133
+ if (typeof e == "object")
134
+ return e;
135
+ throw new Error("Invalid frame object format");
136
+ }
137
+ function fe(e, n) {
138
+ var o, i;
139
+ const r = (e == null ? void 0 : e.frameObject) ?? ((o = e == null ? void 0 : e.visual) == null ? void 0 : o.frameObject);
140
+ if (!r)
141
+ return !1;
142
+ const s = z(r);
143
+ if (!(s != null && s.cards) || s.cards.length === 0)
144
+ return !1;
145
+ const t = (i = s.cards) == null ? void 0 : i.find(
146
+ (a) => a.id === s.activeCardId
147
+ );
148
+ return t ? (oe({
149
+ ...n,
150
+ frame: s,
151
+ card: t,
152
+ visualId: (e == null ? void 0 : e.id) || s.visualId
153
+ }), !0) : !1;
154
+ }
155
+ function he() {
156
+ const { setCardSql: e } = G(), n = H(
157
+ (t) => {
158
+ var o;
159
+ return ((o = t.card.customCardPreferences) == null ? void 0 : o.url) || "";
160
+ }
161
+ ), r = ce(n);
162
+ return { getUpdatedFrame: M(() => {
163
+ var b;
164
+ le();
165
+ const {
166
+ frame: t,
167
+ card: o,
168
+ isDevMode: i,
169
+ isShowingVisual: a,
170
+ selectedSchemaName: c,
171
+ selectedDatamodelId: u,
172
+ selectedDatabaseName: f,
173
+ selectedTableName: I,
174
+ selectedConnectionId: F
175
+ } = H.getState(), h = o.sql;
176
+ let p = h;
177
+ h && !h.includes("{{") && (p = ie(h), e(p));
178
+ const U = (b = r == null ? void 0 : r.getState()) == null ? void 0 : b.settings, v = ae(o, {
179
+ isDevMode: i,
180
+ cardSql: p,
181
+ isShowingVisual: a,
182
+ selectedSchemaName: c,
183
+ selectedDatamodelId: u,
184
+ selectedDatabaseName: f,
185
+ selectedTableName: I,
186
+ selectedConnectionId: F,
187
+ remoteChartSettings: U,
188
+ stripConfig: ue
189
+ }), g = t.cards.map(
190
+ (C) => C.id === o.id ? v : C
191
+ );
192
+ return {
193
+ ...t,
194
+ cards: g,
195
+ activeCardId: de(g, t.activeCardId)
196
+ };
197
+ }, [r, e]) };
198
+ }
199
+ function be() {
200
+ const { authToken: e, tokenProps: n } = X(), r = Z(), s = q(), { selectVisual: t } = ee(), {
201
+ setFrame: o,
202
+ setCard: i,
203
+ setIsDevMode: a,
204
+ initializeModeDrafts: c,
205
+ setActiveTabCardId: u,
206
+ updateDataSource: f,
207
+ setQueryResultColumns: I,
208
+ setSelectedConnectionId: F,
209
+ setSelectedDatabaseName: h,
210
+ setSelectedSchemaName: p,
211
+ setSelectedTableName: U,
212
+ setSelectedDatamodelId: v,
213
+ setFilterValues: g,
214
+ setInlineFilterValuesMap: b,
215
+ setApplyFilters: C
216
+ } = G(), {
217
+ setIsDashboardEditing: V,
218
+ setIsVisualEditing: x,
219
+ setSelectedFrameId: A,
220
+ clearSelectedFrameId: B,
221
+ addFrame: D,
222
+ setIsDashboardPanelOpen: P
223
+ } = te(), S = y((d) => d.selectedSheetId), R = y((d) => d.selectedFrameId), T = y((d) => d.dashboard), W = y((d) => d.filterValues), L = y(
224
+ (d) => d.inlineFilterValuesMap
225
+ ), w = re((s == null ? void 0 : s.id) || "", {
226
+ enabled: !!(s != null && s.id) && !!(e != null && e.accessToken)
227
+ }), J = M(
228
+ async (d) => {
229
+ try {
230
+ t(d), B();
231
+ const { data: m, fromCache: l } = await _(
232
+ n.apiServiceUrl,
233
+ (e == null ? void 0 : e.accessToken) || "",
234
+ d.id,
235
+ r
236
+ );
237
+ if (!fe(m, {
238
+ setFrame: o,
239
+ setCard: i,
240
+ setIsDevMode: a,
241
+ initializeModeDrafts: c,
242
+ setActiveTabCardId: u,
243
+ updateDataSource: f,
244
+ setQueryResultColumns: I,
245
+ setSelectedConnectionId: F,
246
+ setSelectedDatabaseName: h,
247
+ setSelectedSchemaName: p,
248
+ setSelectedTableName: U,
249
+ setSelectedDatamodelId: v,
250
+ setFilterValues: g,
251
+ setInlineFilterValuesMap: b,
252
+ setApplyFilters: C,
253
+ setIsDashboardEditing: V,
254
+ setIsVisualEditing: x,
255
+ dashboard: T,
256
+ selectedSheetId: S,
257
+ selectedFrameId: R,
258
+ filterValues: W,
259
+ inlineFilterValuesMap: L
260
+ }))
261
+ throw new Error("Failed to setup editor with visual data");
262
+ return { success: !0, fromCache: l };
263
+ } catch (m) {
264
+ return console.error("Error editing visual:", m), { success: !1, error: "Failed to load visual for editing" };
265
+ }
266
+ },
267
+ [
268
+ e == null ? void 0 : e.accessToken,
269
+ n.apiServiceUrl,
270
+ r,
271
+ t,
272
+ o,
273
+ i,
274
+ V,
275
+ x,
276
+ a,
277
+ c,
278
+ u,
279
+ f,
280
+ I,
281
+ F,
282
+ h,
283
+ p,
284
+ U,
285
+ v,
286
+ g,
287
+ b,
288
+ C,
289
+ B,
290
+ T,
291
+ S,
292
+ R,
293
+ W,
294
+ L
295
+ ]
296
+ ), K = M(
297
+ async (d) => {
298
+ var m;
299
+ try {
300
+ if (t(d), !S)
301
+ return {
302
+ success: !1,
303
+ error: "No sheet selected. Please select a sheet first."
304
+ };
305
+ const { data: l, fromCache: N } = await _(
306
+ n.apiServiceUrl,
307
+ (e == null ? void 0 : e.accessToken) || "",
308
+ d.id,
309
+ r
310
+ ), j = (l == null ? void 0 : l.frameObject) ?? ((m = l == null ? void 0 : l.visual) == null ? void 0 : m.frameObject);
311
+ if (!j)
312
+ return { success: !1, error: "Visual has no frame data" };
313
+ const E = z(j);
314
+ if (!(E != null && E.cards) || E.cards.length === 0)
315
+ return { success: !1, error: "Visual frame is malformed" };
316
+ const k = {
317
+ ...se(E),
318
+ visualId: d.id
319
+ // Link this frame to the library visual
320
+ };
321
+ return D(S, k, "end"), V(!0), A(k.id), P(!1), { success: !0, fromCache: N };
322
+ } catch (l) {
323
+ return console.error("Error adding visual:", l), { success: !1, error: "Failed to add visual to dashboard" };
324
+ }
325
+ },
326
+ [
327
+ e == null ? void 0 : e.accessToken,
328
+ n.apiServiceUrl,
329
+ r,
330
+ t,
331
+ S,
332
+ D,
333
+ V,
334
+ A,
335
+ P
336
+ ]
337
+ );
338
+ return {
339
+ visual: w.data,
340
+ isLoading: w.isLoading,
341
+ isError: w.isError,
342
+ error: w.error,
343
+ handleEditLibraryVisual: J,
344
+ handleAddLibraryVisual: K,
345
+ getUpdatedFrame: he().getUpdatedFrame,
346
+ refetch: w.refetch
347
+ };
348
+ }
349
+ export {
350
+ le as f,
351
+ ge as r,
352
+ be as u
353
+ };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./index-DBuN9Zf6.js"),g=require("react");function G(e){const n=e.toUpperCase().indexOf("WHERE"),r=e.toUpperCase().indexOf("GROUP BY"),s=e.toUpperCase().indexOf("LIMIT"),t=e.toUpperCase().indexOf("ORDER BY");let o=e.length;if(t!==-1&&(o=t),s!==-1&&s<o&&(o=s),n!==-1){const c=e.substring(0,n),a=e.substring(n);return`${c} {{ filters | where }} AND ${a.substring(6)}`}else if(r!==-1){const c=e.substring(0,r),a=e.substring(r);return`${c} {{ filters | where }} ${a}`}else{const c=e.substring(0,o),a=e.substring(o);return console.log("beforeClause",c),console.log("afterClause",a),a?`${c} {{ filters | where }} ${a}`:`${c.replace(/;$/,"")} {{ filters | where }}`}}function Y(e){const[n,r]=g.useState(null),[s,t]=g.useState(null),o=i.useEnsureReactGlobals();return g.useEffect(()=>{if(!e||e.trim()===""){r(null),t(null);return}if(!o)return;(async()=>{try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error(`Invalid URL format: ${e}`);try{new URL(e)}catch{throw new Error(`Invalid URL: ${e}`)}const d=`${e.endsWith("/")?e:`${e}/`}index.js`;try{if(!(await fetch(d,{method:"HEAD"})).ok)throw new Error(`Module not found at ${d}`)}catch{}const f=await import(d);if(typeof f.useChartStore!="function")throw new Error("useChartStore is not a function");r(()=>f.useChartStore),t(null)}catch(a){const d=a instanceof Error?a.message:"Unknown error";console.error("Failed to load remote chart store:",d),t(d),r(null)}})()},[e,o]),n}function J(e,n){if(e.length===0)return"";const r=e.find(s=>{var t,o;return((t=s.customCardPreferences)==null?void 0:t.visualType)==="multiple"||!!((o=s.customCardPreferences)!=null&&o.dataInputCardIds)});if(r)return r.id;if(n){const s=e.find(t=>t.id===n);if(s){const t=s.tabTitle;if(t=="All__Header")return e[0].id;if(t&&t.endsWith("__Header")){const c=t.split("__")[0],a=e.find(d=>d.tabTitle===c);return a?a.id:e[0].id}return n}}return e[0].id}const $=new Set;function K(e){return $.add(e),()=>{$.delete(e)}}function _(){$.forEach(e=>{e()})}const X=e=>{if(!e||!("detailTableBackup"in e))return e;const{detailTableBackup:n,...r}=e;return r};async function j(e,n,r,s){if(!n||!r)throw new Error("Missing auth token or visual ID");const t=["resource-by-id","visual",r],o=s.getQueryData(t);if(o)return console.log("Using cached visual data for:",r),{data:o,fromCache:!0};console.log("Fetching visual data from network for:",r);const c=i.ue.loading("Loading visual...",{position:"top-center"});try{const a=await fetch(`${e}/management/v1/visuals/${r}`,{headers:{Authorization:`Bearer ${n}`}});if(!a.ok)throw new Error("Failed to load visual");const d=await a.json();return s.setQueryData(t,d),i.ue.dismiss(c),{data:d,fromCache:!1}}catch(a){throw i.ue.dismiss(c),a}}function H(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error("Invalid frame object format")}function Z(e,n){var o,c;const r=(e==null?void 0:e.frameObject)??((o=e==null?void 0:e.visual)==null?void 0:o.frameObject);if(!r)return!1;const s=H(r);if(!(s!=null&&s.cards)||s.cards.length===0)return!1;const t=(c=s.cards)==null?void 0:c.find(a=>a.id===s.activeCardId);return t?(i.setupEditorWithCard({...n,frame:s,card:t,visualId:(e==null?void 0:e.id)||s.visualId}),!0):!1}function q(){const{setCardSql:e}=i.useEditorActions(),n=i.useEditorStore(t=>{var o;return((o=t.card.customCardPreferences)==null?void 0:o.url)||""}),r=Y(n);return{getUpdatedFrame:g.useCallback(()=>{var C;_();const{frame:t,card:o,isDevMode:c,isShowingVisual:a,selectedSchemaName:d,selectedDatamodelId:f,selectedDatabaseName:h,selectedTableName:F,selectedConnectionId:U}=i.useEditorStore.getState(),p=o.sql;let m=p;p&&!p.includes("{{")&&(m=G(p),e(m));const v=(C=r==null?void 0:r.getState())==null?void 0:C.settings,V=i.buildSavedEditorCard(o,{isDevMode:c,cardSql:m,isShowingVisual:a,selectedSchemaName:d,selectedDatamodelId:f,selectedDatabaseName:h,selectedTableName:F,selectedConnectionId:U,remoteChartSettings:v,stripConfig:X}),S=t.cards.map(E=>E.id===o.id?V:E);return{...t,cards:S,activeCardId:J(S,t.activeCardId)}},[r,e])}}function ee(){const{authToken:e,tokenProps:n}=i.useSemaphorContext(),r=i.useQueryClient(),s=i.useSelectedVisual(),{selectVisual:t}=i.useManagementActions(),{setFrame:o,setCard:c,setIsDevMode:a,initializeModeDrafts:d,setActiveTabCardId:f,updateDataSource:h,setQueryResultColumns:F,setSelectedConnectionId:U,setSelectedDatabaseName:p,setSelectedSchemaName:m,setSelectedTableName:v,setSelectedDatamodelId:V,setFilterValues:S,setInlineFilterValuesMap:C,setApplyFilters:E}=i.useEditorActions(),{setIsDashboardEditing:D,setIsVisualEditing:A,setSelectedFrameId:M,clearSelectedFrameId:P,addFrame:O,setIsDashboardPanelOpen:R}=i.useDashboardActions(),w=i.useDashboardStore(l=>l.selectedSheetId),x=i.useDashboardStore(l=>l.selectedFrameId),B=i.useDashboardStore(l=>l.dashboard),W=i.useDashboardStore(l=>l.filterValues),k=i.useDashboardStore(l=>l.inlineFilterValuesMap),y=i.useVisualById((s==null?void 0:s.id)||"",{enabled:!!(s!=null&&s.id)&&!!(e!=null&&e.accessToken)}),Q=g.useCallback(async l=>{try{t(l),P();const{data:b,fromCache:u}=await j(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",l.id,r);if(!Z(b,{setFrame:o,setCard:c,setIsDevMode:a,initializeModeDrafts:d,setActiveTabCardId:f,updateDataSource:h,setQueryResultColumns:F,setSelectedConnectionId:U,setSelectedDatabaseName:p,setSelectedSchemaName:m,setSelectedTableName:v,setSelectedDatamodelId:V,setFilterValues:S,setInlineFilterValuesMap:C,setApplyFilters:E,setIsDashboardEditing:D,setIsVisualEditing:A,dashboard:B,selectedSheetId:w,selectedFrameId:x,filterValues:W,inlineFilterValuesMap:k}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:u}}catch(b){return console.error("Error editing visual:",b),{success:!1,error:"Failed to load visual for editing"}}},[e==null?void 0:e.accessToken,n.apiServiceUrl,r,t,o,c,D,A,a,d,f,h,F,U,p,m,v,V,S,C,E,P,B,w,x,W,k]),z=g.useCallback(async l=>{var b;try{if(t(l),!w)return{success:!1,error:"No sheet selected. Please select a sheet first."};const{data:u,fromCache:L}=await j(n.apiServiceUrl,(e==null?void 0:e.accessToken)||"",l.id,r),T=(u==null?void 0:u.frameObject)??((b=u==null?void 0:u.visual)==null?void 0:b.frameObject);if(!T)return{success:!1,error:"Visual has no frame data"};const I=H(T);if(!(I!=null&&I.cards)||I.cards.length===0)return{success:!1,error:"Visual frame is malformed"};const N={...i.cloneLinkedFrameWithSourceMapping(I),visualId:l.id};return O(w,N,"end"),D(!0),M(N.id),R(!1),{success:!0,fromCache:L}}catch(u){return console.error("Error adding visual:",u),{success:!1,error:"Failed to add visual to dashboard"}}},[e==null?void 0:e.accessToken,n.apiServiceUrl,r,t,w,O,D,M,R]);return{visual:y.data,isLoading:y.isLoading,isError:y.isError,error:y.error,handleEditLibraryVisual:Q,handleAddLibraryVisual:z,getUpdatedFrame:q().getUpdatedFrame,refetch:y.refetch}}exports.flushPendingEditorDrafts=_;exports.registerPendingEditorDraftFlusher=K;exports.useVisualUtils=ee;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-BHWWNpG6.js"),e=require("../types/index.cjs");exports.Dashboard=r.Dashboard;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-DBuN9Zf6.js"),e=require("../types/index.cjs");exports.Dashboard=r.Dashboard;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as E } from "../chunks/index-B7kUtCgG.js";
1
+ import { D as E } from "../chunks/index-y1uW2fuZ.js";
2
2
  import { CONTROL_CARD_DEFAULT_VALUE as L, EMPTY_SELECTION as T } from "../types/index.js";
3
3
  export {
4
4
  L as CONTROL_CARD_DEFAULT_VALUE,
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BHWWNpG6.js"),_=require("./types/index.cjs"),M=require("./chunks/dashboard-summary-settings-dialog-BPyawgMV.js"),t=require("react/jsx-runtime"),x=require("react"),O=require("./chunks/resource-management-panel-D8xvqypt.js"),U=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");const A=require("./chunks/dashboard-filter-controls-button-DKc_6T_O.js"),L=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js");function z(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>s[n]})}}return r.default=s,Object.freeze(r)}const R=z(x);function Q(s){const{authToken:r,tokenProps:n}=e.useSemaphorContext();return e.useMutation({mutationFn:async o=>e.backtestAlert(n.apiServiceUrl,r.accessToken,s,o)})}function q(s){const{displayPreferences:r,cardId:n,...o}=s,l={...o,id:s.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:l,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:s.cardId}),t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:r,children:t.jsx(e.Container,{type:"visual",cardId:n,...l,children:t.jsx(V,{cardId:n})})})})]})})}function V({cardId:s}){const r=e.useDashboardStore(l=>{var c;return(c=l.dashboard)==null?void 0:c.sheets}),{card:n,frame:o}=x.useMemo(()=>{const l=r==null?void 0:r.flatMap(i=>i.frames),c=l==null?void 0:l.flatMap(i=>i==null?void 0:i.cards),u=c==null?void 0:c.find(i=>(i==null?void 0:i.id)===s),a=l==null?void 0:l.find(i=>{var m;return(m=i==null?void 0:i.cards)==null?void 0:m.find(f=>(f==null?void 0:f.id)===s)});return{card:u,frame:a}},[r,s]);return!n||!o?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${s}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:l,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:l,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:o})})})}function W({name:s,items:r,value:n,onChange:o,isLoading:l,isError:c,refetch:u,className:a,icon:i,showNone:m=!1}){const f=R.useRef(null),[D,C]=R.useState(!1),[b,j]=R.useState("100%"),y=m?[...r||[],{id:"none",name:"None"}]:r;R.useLayoutEffect(()=>{f.current&&j(f.current.offsetWidth)},[]);function I(){var h;return l?"Loading...":c?"Error":n?(h=r==null?void 0:r.find(S=>S.id===n))==null?void 0:h.name:`Select ${s}`}function T(h,S){o(S),C(!1)}return t.jsxs(e.Popover,{open:D,onOpenChange:C,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{ref:f,variant:"outline",role:"combobox","aria-expanded":D,className:e.cn("flex h-9 w-full justify-between",a),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[i&&t.jsx("div",{className:"mr-2",children:i}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:I()})]}),t.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:b},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:u,children:t.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",l&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",s==null?void 0:s.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:y==null?void 0:y.map(h=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:h.name,onSelect:S=>T(S,h.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(e.Check,{className:e.cn("size-4",n===h.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:h.name,children:h.name})]})},h.id))})]})]})})]})}function H({triggerButtonClassName:s,variant:r="ghost"}){const[n,o]=x.useState(!1),l=e.useDashboardStore(u=>{var a;return(a=u.dashboard)==null?void 0:a.id}),c=e.useDashboardStore(u=>{var a;return(a=u.dashboard)==null?void 0:a.title});return l?t.jsxs(t.Fragment,{children:[t.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",s),buttonProps:{variant:r},onClick:()=>o(!0),children:t.jsx(e.Clock,{className:"size-4"})}),t.jsx(e.EmailScheduleDialog,{open:n,onOpenChange:o,dashboardId:l,dashboardName:c})]}):null}function $(s,r){x.useEffect(()=>(s&&r&&(window.__SEMAPHOR_PRINT_STATE__={...r}),()=>{s&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[s,r])}function P(s){if(!s)return"--";const r=new Date(s);return Number.isNaN(r.getTime())?"--":r.toLocaleString()}function G(s){var r;return((r=s.alertState)==null?void 0:r.currentState)==="FIRING"?"Signal surfaced":s.status==="ACTIVE"?"Watching":s.status==="PAUSED"?"Paused":s.status}function K({alertId:s,onBack:r}){var h,S,F,w;const{authToken:n,tokenProps:o}=e.useSemaphorContext(),{data:l,isLoading:c,refetch:u}=e.useAlertDetail(s),a=(l==null?void 0:l.alert)??null,[i,m]=x.useState([]),[f,D]=x.useState([]),[C,b]=x.useState(null),j=x.useCallback(async()=>{var g;const d=o==null?void 0:o.apiServiceUrl,p=n==null?void 0:n.accessToken;if(!d||!p||!s)return null;try{const v=await fetch(`${d}/v1/alerts/${s}/runs?limit=20`,{headers:{Authorization:`Bearer ${p}`}});if(v.ok){const E=await v.json(),N=Array.isArray(E.runs)?E.runs:[],k=C&&N.some(B=>B.id===C)?C:((g=N[0])==null?void 0:g.id)??null;return D(N),b(k),k}D([]),b(null)}catch{return D([]),b(null),null}return null},[s,n,C,o]),y=x.useCallback(async d=>{const p=o==null?void 0:o.apiServiceUrl,g=n==null?void 0:n.accessToken,v=d??C;if(!p||!g||!s||!v){m([]);return}try{const E=await fetch(`${p}/v1/alerts/${s}/runs/${v}/deliveries`,{headers:{Authorization:`Bearer ${g}`}});if(E.ok){const N=await E.json();m(Array.isArray(N.attempts)?N.attempts:[])}else m([])}catch{m([])}},[s,n,C,o]),I=x.useCallback(async()=>{await u();const d=await j();await y(d)},[y,j,u]);x.useEffect(()=>{j().catch(()=>{})},[j]),x.useEffect(()=>{y().catch(()=>{})},[y]);const T=x.useMemo(()=>{const d={};for(const p of i)d[p.channel]||(d[p.channel]=[]),d[p.channel].push(p);return d},[i]);return c?t.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading signal detail..."}):a?t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[r&&t.jsx(e.Button,{variant:"outline",size:"sm",onClick:r,children:"Back"}),t.jsx("h2",{className:"text-lg font-semibold",children:a.name}),t.jsx(e.Badge,{variant:a.status==="ACTIVE"?"default":"secondary",children:G(a)}),((h=a.alertState)==null?void 0:h.currentState)&&t.jsx(e.Badge,{variant:a.alertState.currentState==="FIRING"?"destructive":"outline",children:a.alertState.currentState==="FIRING"?"Signal surfaced":"Stable"})]}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>void I(),children:"Refresh"})]}),a.description&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a.description}),t.jsxs("div",{className:"rounded-md border bg-muted/30 p-4 text-sm",children:[t.jsx("p",{className:"font-medium",children:"What changed"}),t.jsx("p",{className:"mt-1 text-muted-foreground",children:"Review the latest signal activity, then investigate the underlying dashboard context if you need more detail."})]}),t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-2",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Signal Watch"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Watching for:"})," ",e.formatSignalCondition(a.jobConfig.operator,a.jobConfig.threshold)]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Severity:"})," ",a.jobConfig.severity]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Last Evaluated:"})," ",P((S=a.alertState)==null?void 0:S.lastEvaluatedAt)]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Last Surfaced:"})," ",P((F=a.alertState)==null?void 0:F.lastTriggeredAt)]})]})]}),((w=a.deliveryConfig)==null?void 0:w.channels)&&a.deliveryConfig.channels.length>0&&t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-2",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Where It Surfaces"}),t.jsx("div",{className:"flex flex-wrap gap-2",children:a.deliveryConfig.channels.map(d=>t.jsx(e.Badge,{variant:"outline",children:d},d))})]}),f.length>0&&t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-3",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Recent Delivery Activity"}),f.length>1&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(d=>t.jsx(e.Button,{variant:d.id===C?"default":"outline",size:"sm",onClick:()=>b(d.id),children:P(d.scheduledFor)},d.id))}),Object.keys(T).length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No delivery attempts were recorded for this run."}):Object.entries(T).map(([d,p])=>t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(e.Badge,{variant:"secondary",className:"text-xs",children:d})}),t.jsx("div",{className:"overflow-hidden rounded border",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Recipient"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Status"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Time"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Error"})]})}),t.jsx("tbody",{children:p.map(g=>t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-2 py-1",children:g.recipient}),t.jsx("td",{className:"px-2 py-1",children:t.jsx(e.Badge,{variant:g.status==="SENT"?"default":"destructive",className:"text-[10px]",children:g.status})}),t.jsx("td",{className:"px-2 py-1",children:P(g.createdAt)}),t.jsx("td",{className:"px-2 py-1 text-muted-foreground",children:g.error||"--"})]},g.id))})]})})]},d))]})]}):t.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Signal not found."})}function Y(){var c,u;const{quotasQuery:s,usageQuery:r}=e.useAlertQuotas(),n=((c=s.data)==null?void 0:c.quotas)||[],o=((u=r.data)==null?void 0:u.usage)||[],l=new Map(o.map(a=>[a.tenantId||"org",a]));return t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Alert Quotas"}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>{s.refetch(),r.refetch()},children:"Refresh"})]}),s.isLoading||r.isLoading?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading quota usage..."}):null,t.jsx("div",{className:"overflow-hidden rounded-lg border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Tenant"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Active Alerts"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Active"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Min Cadence"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Context Sources"})]})}),t.jsx("tbody",{children:n.map(a=>{const i=a.tenantId||"org",m=l.get(i);return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-2",children:i}),t.jsx("td",{className:"px-3 py-2",children:(m==null?void 0:m.activeAlerts)??0}),t.jsx("td",{className:"px-3 py-2",children:a.policy.maxActiveAlerts}),t.jsxs("td",{className:"px-3 py-2",children:[a.policy.minCadenceMinutes," min"]}),t.jsx("td",{className:"px-3 py-2",children:a.policy.maxContextSources})]},i)})})]})})]})}exports.AlertManagementPage=e.AlertManagementPage;exports.AlertWizardDialog=e.AlertWizardDialog;exports.AlertsApiError=e.AlertsApiError;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.CardAlertIndicator=e.CardAlertIndicator;exports.CardSummary=e.CardSummary;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.EmailScheduleDialog=e.EmailScheduleDialog;exports.ExportError=e.ExportError;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.backtestAlert=e.backtestAlert;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createAlert=e.createAlert;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.deleteAlert=e.deleteAlert;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;exports.getAlert=e.getAlert;exports.getAlertContextSources=e.getAlertContextSources;exports.getAlertHistory=e.getAlertHistory;exports.getAlertQuotaUsage=e.getAlertQuotaUsage;exports.getAlertRunDeliveries=e.getAlertRunDeliveries;exports.getAlertRunSteps=e.getAlertRunSteps;exports.getAlertRuns=e.getAlertRuns;exports.getAlertState=e.getAlertState;exports.getColumnDataType=e.getColumnDataType;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.listAlertQuotas=e.listAlertQuotas;exports.listAlerts=e.listAlerts;exports.previewAlertDeliverable=e.previewAlertDeliverable;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.triggerAlertNow=e.triggerAlertNow;exports.updateAlert=e.updateAlert;exports.updateAlertContextSources=e.updateAlertContextSources;exports.updateAlertQuota=e.updateAlertQuota;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useAlertActions=e.useAlertActions;exports.useAlertDeliveries=e.useAlertDeliveries;exports.useAlertDetail=e.useAlertDetail;exports.useAlertDraft=e.useAlertDraft;exports.useAlertFilters=e.useAlertFilters;exports.useAlertHistory=e.useAlertHistory;exports.useAlertQuotas=e.useAlertQuotas;exports.useAlertRuns=e.useAlertRuns;exports.useAlertState=e.useAlertState;exports.useAlertStore=e.useAlertStore;exports.useAlertWizard=e.useAlertWizard;exports.useAlerts=e.useAlerts;exports.useAlertsBootstrap=e.useAlertsBootstrap;exports.useAlertsById=e.useAlertsById;exports.useAlertsForCard=e.useAlertsForCard;exports.useCard=e.useCard;exports.useCardAlertMap=e.useCardAlertMap;exports.useCardSummary=e.useCardSummary;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useSelectedAlertId=e.useSelectedAlertId;exports.useTextFilterHook=e.useTextFilterHook;exports.CONTROL_CARD_DEFAULT_VALUE=_.CONTROL_CARD_DEFAULT_VALUE;exports.DEFAULT_CALENDAR_CONTEXT=_.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=_.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.EMPTY_SELECTION=_.EMPTY_SELECTION;exports.CalendarPreferencesDialog=M.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=M.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=O.ResourceManagementPanel;exports.useDebouncedDirtyCheck=U.useDebouncedDirtyCheck;exports.AdvancedModeToggle=A.AdvancedModeToggle;exports.DashboardControlsSettings=A.DashboardControlsSettings;exports.DashboardFilterControlsButton=A.DashboardFilterControlsButton;exports.ExportNotificationItem=A.ExportNotificationItem;exports.ExportNotificationList=A.ExportNotificationList;exports.NotificationBell=A.NotificationBell;exports.UnsavedChangesAlert=A.UnsavedChangesAlert;exports.VisualEditingControls=A.VisualEditingControls;exports.useExportPolling=A.useExportPolling;exports.useExportRecovery=A.useExportRecovery;exports.usePristineSnapshotInitializer=A.usePristineSnapshotInitializer;exports.normalizeDashboardForDirtyCheck=L.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=L.serializeDashboardForDirtyCheck;exports.AlertDetailPageEmbedded=K;exports.Combobox=W;exports.ScheduleDashboard=H;exports.TenantQuotaPage=Y;exports.Visual=q;exports.useAlertBacktest=Q;exports.useExposePrintState=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-DBuN9Zf6.js"),_=require("./types/index.cjs"),M=require("./chunks/dashboard-summary-settings-dialog-Cn4-fB2h.js"),t=require("react/jsx-runtime"),x=require("react"),O=require("./chunks/resource-management-panel-PSvKnmq5.js"),U=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");const A=require("./chunks/dashboard-filter-controls-button-DEUvxIWD.js"),L=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js");function z(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>s[n]})}}return r.default=s,Object.freeze(r)}const R=z(x);function Q(s){const{authToken:r,tokenProps:n}=e.useSemaphorContext();return e.useMutation({mutationFn:async o=>e.backtestAlert(n.apiServiceUrl,r.accessToken,s,o)})}function q(s){const{displayPreferences:r,cardId:n,...o}=s,l={...o,id:s.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:l,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:s.cardId}),t.jsx(e.UXProvider,{children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:r,children:t.jsx(e.Container,{type:"visual",cardId:n,...l,children:t.jsx(V,{cardId:n})})})})]})})}function V({cardId:s}){const r=e.useDashboardStore(l=>{var c;return(c=l.dashboard)==null?void 0:c.sheets}),{card:n,frame:o}=x.useMemo(()=>{const l=r==null?void 0:r.flatMap(i=>i.frames),c=l==null?void 0:l.flatMap(i=>i==null?void 0:i.cards),u=c==null?void 0:c.find(i=>(i==null?void 0:i.id)===s),a=l==null?void 0:l.find(i=>{var m;return(m=i==null?void 0:i.cards)==null?void 0:m.find(f=>(f==null?void 0:f.id)===s)});return{card:u,frame:a}},[r,s]);return!n||!o?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${s}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:l,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:l,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:o})})})}function W({name:s,items:r,value:n,onChange:o,isLoading:l,isError:c,refetch:u,className:a,icon:i,showNone:m=!1}){const f=R.useRef(null),[D,C]=R.useState(!1),[b,j]=R.useState("100%"),y=m?[...r||[],{id:"none",name:"None"}]:r;R.useLayoutEffect(()=>{f.current&&j(f.current.offsetWidth)},[]);function I(){var h;return l?"Loading...":c?"Error":n?(h=r==null?void 0:r.find(S=>S.id===n))==null?void 0:h.name:`Select ${s}`}function T(h,S){o(S),C(!1)}return t.jsxs(e.Popover,{open:D,onOpenChange:C,children:[t.jsx(e.PopoverTrigger,{asChild:!0,children:t.jsxs(e.Button,{ref:f,variant:"outline",role:"combobox","aria-expanded":D,className:e.cn("flex h-9 w-full justify-between",a),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[i&&t.jsx("div",{className:"mr-2",children:i}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:I()})]}),t.jsx(e.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(e.PopoverContent,{className:"w-full p-0",style:{minWidth:b},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:u,children:t.jsx(e.RefreshCw,{className:e.cn("size-3.5 opacity-50",l&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",s==null?void 0:s.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:y==null?void 0:y.map(h=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:h.name,onSelect:S=>T(S,h.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(e.Check,{className:e.cn("size-4",n===h.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:h.name,children:h.name})]})},h.id))})]})]})})]})}function H({triggerButtonClassName:s,variant:r="ghost"}){const[n,o]=x.useState(!1),l=e.useDashboardStore(u=>{var a;return(a=u.dashboard)==null?void 0:a.id}),c=e.useDashboardStore(u=>{var a;return(a=u.dashboard)==null?void 0:a.title});return l?t.jsxs(t.Fragment,{children:[t.jsx(e.IconButton,{tooltip:"Schedule Dashboard",className:e.cn("h-7 p-2",s),buttonProps:{variant:r},onClick:()=>o(!0),children:t.jsx(e.Clock,{className:"size-4"})}),t.jsx(e.EmailScheduleDialog,{open:n,onOpenChange:o,dashboardId:l,dashboardName:c})]}):null}function $(s,r){x.useEffect(()=>(s&&r&&(window.__SEMAPHOR_PRINT_STATE__={...r}),()=>{s&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[s,r])}function P(s){if(!s)return"--";const r=new Date(s);return Number.isNaN(r.getTime())?"--":r.toLocaleString()}function G(s){var r;return((r=s.alertState)==null?void 0:r.currentState)==="FIRING"?"Signal surfaced":s.status==="ACTIVE"?"Watching":s.status==="PAUSED"?"Paused":s.status}function K({alertId:s,onBack:r}){var h,S,F,w;const{authToken:n,tokenProps:o}=e.useSemaphorContext(),{data:l,isLoading:c,refetch:u}=e.useAlertDetail(s),a=(l==null?void 0:l.alert)??null,[i,m]=x.useState([]),[f,D]=x.useState([]),[C,b]=x.useState(null),j=x.useCallback(async()=>{var g;const d=o==null?void 0:o.apiServiceUrl,p=n==null?void 0:n.accessToken;if(!d||!p||!s)return null;try{const v=await fetch(`${d}/v1/alerts/${s}/runs?limit=20`,{headers:{Authorization:`Bearer ${p}`}});if(v.ok){const E=await v.json(),N=Array.isArray(E.runs)?E.runs:[],k=C&&N.some(B=>B.id===C)?C:((g=N[0])==null?void 0:g.id)??null;return D(N),b(k),k}D([]),b(null)}catch{return D([]),b(null),null}return null},[s,n,C,o]),y=x.useCallback(async d=>{const p=o==null?void 0:o.apiServiceUrl,g=n==null?void 0:n.accessToken,v=d??C;if(!p||!g||!s||!v){m([]);return}try{const E=await fetch(`${p}/v1/alerts/${s}/runs/${v}/deliveries`,{headers:{Authorization:`Bearer ${g}`}});if(E.ok){const N=await E.json();m(Array.isArray(N.attempts)?N.attempts:[])}else m([])}catch{m([])}},[s,n,C,o]),I=x.useCallback(async()=>{await u();const d=await j();await y(d)},[y,j,u]);x.useEffect(()=>{j().catch(()=>{})},[j]),x.useEffect(()=>{y().catch(()=>{})},[y]);const T=x.useMemo(()=>{const d={};for(const p of i)d[p.channel]||(d[p.channel]=[]),d[p.channel].push(p);return d},[i]);return c?t.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading signal detail..."}):a?t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[r&&t.jsx(e.Button,{variant:"outline",size:"sm",onClick:r,children:"Back"}),t.jsx("h2",{className:"text-lg font-semibold",children:a.name}),t.jsx(e.Badge,{variant:a.status==="ACTIVE"?"default":"secondary",children:G(a)}),((h=a.alertState)==null?void 0:h.currentState)&&t.jsx(e.Badge,{variant:a.alertState.currentState==="FIRING"?"destructive":"outline",children:a.alertState.currentState==="FIRING"?"Signal surfaced":"Stable"})]}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>void I(),children:"Refresh"})]}),a.description&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a.description}),t.jsxs("div",{className:"rounded-md border bg-muted/30 p-4 text-sm",children:[t.jsx("p",{className:"font-medium",children:"What changed"}),t.jsx("p",{className:"mt-1 text-muted-foreground",children:"Review the latest signal activity, then investigate the underlying dashboard context if you need more detail."})]}),t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-2",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Signal Watch"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Watching for:"})," ",e.formatSignalCondition(a.jobConfig.operator,a.jobConfig.threshold)]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Severity:"})," ",a.jobConfig.severity]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Last Evaluated:"})," ",P((S=a.alertState)==null?void 0:S.lastEvaluatedAt)]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Last Surfaced:"})," ",P((F=a.alertState)==null?void 0:F.lastTriggeredAt)]})]})]}),((w=a.deliveryConfig)==null?void 0:w.channels)&&a.deliveryConfig.channels.length>0&&t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-2",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Where It Surfaces"}),t.jsx("div",{className:"flex flex-wrap gap-2",children:a.deliveryConfig.channels.map(d=>t.jsx(e.Badge,{variant:"outline",children:d},d))})]}),f.length>0&&t.jsxs("div",{className:"rounded-md border bg-background p-4 space-y-3",children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Recent Delivery Activity"}),f.length>1&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(d=>t.jsx(e.Button,{variant:d.id===C?"default":"outline",size:"sm",onClick:()=>b(d.id),children:P(d.scheduledFor)},d.id))}),Object.keys(T).length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No delivery attempts were recorded for this run."}):Object.entries(T).map(([d,p])=>t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(e.Badge,{variant:"secondary",className:"text-xs",children:d})}),t.jsx("div",{className:"overflow-hidden rounded border",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Recipient"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Status"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Time"}),t.jsx("th",{className:"px-2 py-1 text-left font-medium",children:"Error"})]})}),t.jsx("tbody",{children:p.map(g=>t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-2 py-1",children:g.recipient}),t.jsx("td",{className:"px-2 py-1",children:t.jsx(e.Badge,{variant:g.status==="SENT"?"default":"destructive",className:"text-[10px]",children:g.status})}),t.jsx("td",{className:"px-2 py-1",children:P(g.createdAt)}),t.jsx("td",{className:"px-2 py-1 text-muted-foreground",children:g.error||"--"})]},g.id))})]})})]},d))]})]}):t.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Signal not found."})}function Y(){var c,u;const{quotasQuery:s,usageQuery:r}=e.useAlertQuotas(),n=((c=s.data)==null?void 0:c.quotas)||[],o=((u=r.data)==null?void 0:u.usage)||[],l=new Map(o.map(a=>[a.tenantId||"org",a]));return t.jsxs("div",{className:"space-y-4 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Alert Quotas"}),t.jsx(e.Button,{variant:"outline",size:"sm",onClick:()=>{s.refetch(),r.refetch()},children:"Refresh"})]}),s.isLoading||r.isLoading?t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading quota usage..."}):null,t.jsx("div",{className:"overflow-hidden rounded-lg border",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Tenant"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Active Alerts"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Active"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Min Cadence"}),t.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Max Context Sources"})]})}),t.jsx("tbody",{children:n.map(a=>{const i=a.tenantId||"org",m=l.get(i);return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-2",children:i}),t.jsx("td",{className:"px-3 py-2",children:(m==null?void 0:m.activeAlerts)??0}),t.jsx("td",{className:"px-3 py-2",children:a.policy.maxActiveAlerts}),t.jsxs("td",{className:"px-3 py-2",children:[a.policy.minCadenceMinutes," min"]}),t.jsx("td",{className:"px-3 py-2",children:a.policy.maxContextSources})]},i)})})]})})]})}exports.AlertManagementPage=e.AlertManagementPage;exports.AlertWizardDialog=e.AlertWizardDialog;exports.AlertsApiError=e.AlertsApiError;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.CardAlertIndicator=e.CardAlertIndicator;exports.CardSummary=e.CardSummary;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.Dashboard=e.Dashboard;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.EmailScheduleDialog=e.EmailScheduleDialog;exports.ExportError=e.ExportError;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.backtestAlert=e.backtestAlert;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createAlert=e.createAlert;exports.createEmptyKpiConfig=e.createEmptyKpiConfig;exports.createExport=e.createExport;exports.createSqlGenConfig=e.createSqlGenConfig;exports.deleteAlert=e.deleteAlert;exports.downloadPdf=e.downloadPdf;exports.emitDashboardLoad=e.emitDashboardLoad;exports.emitDashboardUnload=e.emitDashboardUnload;exports.fmt=e.fmt;exports.formatFileSize=e.formatFileSize;exports.getAlert=e.getAlert;exports.getAlertContextSources=e.getAlertContextSources;exports.getAlertHistory=e.getAlertHistory;exports.getAlertQuotaUsage=e.getAlertQuotaUsage;exports.getAlertRunDeliveries=e.getAlertRunDeliveries;exports.getAlertRunSteps=e.getAlertRunSteps;exports.getAlertRuns=e.getAlertRuns;exports.getAlertState=e.getAlertState;exports.getColumnDataType=e.getColumnDataType;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedField=e.isCalculatedField;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.listAlertQuotas=e.listAlertQuotas;exports.listAlerts=e.listAlerts;exports.previewAlertDeliverable=e.previewAlertDeliverable;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.triggerAlertNow=e.triggerAlertNow;exports.updateAlert=e.updateAlert;exports.updateAlertContextSources=e.updateAlertContextSources;exports.updateAlertQuota=e.updateAlertQuota;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useAlertActions=e.useAlertActions;exports.useAlertDeliveries=e.useAlertDeliveries;exports.useAlertDetail=e.useAlertDetail;exports.useAlertDraft=e.useAlertDraft;exports.useAlertFilters=e.useAlertFilters;exports.useAlertHistory=e.useAlertHistory;exports.useAlertQuotas=e.useAlertQuotas;exports.useAlertRuns=e.useAlertRuns;exports.useAlertState=e.useAlertState;exports.useAlertStore=e.useAlertStore;exports.useAlertWizard=e.useAlertWizard;exports.useAlerts=e.useAlerts;exports.useAlertsBootstrap=e.useAlertsBootstrap;exports.useAlertsById=e.useAlertsById;exports.useAlertsForCard=e.useAlertsForCard;exports.useCard=e.useCard;exports.useCardAlertMap=e.useCardAlertMap;exports.useCardSummary=e.useCardSummary;exports.useCurrentActiveCard=e.useCurrentActiveCard;exports.useCurrentCardConfig=e.useCurrentCardConfig;exports.useCurrentSheetActiveCards=e.useCurrentSheetActiveCards;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardStore=e.useDashboardStore;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useSelectedAlertId=e.useSelectedAlertId;exports.useTextFilterHook=e.useTextFilterHook;exports.CONTROL_CARD_DEFAULT_VALUE=_.CONTROL_CARD_DEFAULT_VALUE;exports.DEFAULT_CALENDAR_CONTEXT=_.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=_.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.EMPTY_SELECTION=_.EMPTY_SELECTION;exports.CalendarPreferencesDialog=M.CalendarPreferencesDialog;exports.DashboardSummarySettingsDialog=M.DashboardSummarySettingsDialog;exports.ResourceManagementPanel=O.ResourceManagementPanel;exports.useDebouncedDirtyCheck=U.useDebouncedDirtyCheck;exports.AdvancedModeToggle=A.AdvancedModeToggle;exports.DashboardControlsSettings=A.DashboardControlsSettings;exports.DashboardFilterControlsButton=A.DashboardFilterControlsButton;exports.ExportNotificationItem=A.ExportNotificationItem;exports.ExportNotificationList=A.ExportNotificationList;exports.NotificationBell=A.NotificationBell;exports.UnsavedChangesAlert=A.UnsavedChangesAlert;exports.VisualEditingControls=A.VisualEditingControls;exports.useExportPolling=A.useExportPolling;exports.useExportRecovery=A.useExportRecovery;exports.usePristineSnapshotInitializer=A.usePristineSnapshotInitializer;exports.normalizeDashboardForDirtyCheck=L.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=L.serializeDashboardForDirtyCheck;exports.AlertDetailPageEmbedded=K;exports.Combobox=W;exports.ScheduleDashboard=H;exports.TenantQuotaPage=Y;exports.Visual=q;exports.useAlertBacktest=Q;exports.useExposePrintState=$;
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { b as j, W as q, Y as H, Z as W, _ as G, $ as K, a0 as Y, a1 as X, a2 as J, a3 as Z, u as F, a4 as O, a5 as ee, P as ae, k as te, B as T, c as _, a6 as se, l as re, m as ne, n as ie, a7 as Q, a8 as oe, o as le, p as de, q as ce, r as ue, s as me, a9 as he, aa as pe, ab as fe, ac as E, ad as be, ae as ge } from "./chunks/index-B7kUtCgG.js";
2
- import { aU as Me, aW as Fe, bC as Le, aY as Ue, aV as ze, ax as Be, aZ as Oe, D as je, av as We, ap as Qe, bI as Ve, b1 as $e, ah as qe, ak as He, ak as Ge, al as Ke, aw as Ye, a as Xe, bH as Je, as as Ze, bn as ea, bk as aa, bD as ta, b8 as sa, bp as ra, au as na, aq as ia, ar as oa, b2 as la, bL as da, bm as ca, bw as ua, bt as ma, bA as ha, bu as pa, bv as fa, bs as ba, br as ga, ba as xa, bG as Na, bF as va, bE as ya, b9 as Aa, bd as Ca, be as Sa, b7 as Da, at as Ea, b6 as Ta, a$ as wa, b0 as Ra, a_ as Ia, bb as _a, b5 as Pa, bK as ka, bJ as Ma, b4 as Fa, b3 as La, bz as Ua, bl as za, by as Ba, bf as Oa, bc as ja, bq as Wa, bo as Qa, bx as Va, bB as $a, aE as qa, aB as Ha, aN as Ga, aL as Ka, aT as Ya, aS as Xa, aK as Ja, aJ as Za, aI as et, aM as at, aX as tt, aG as st, aH as rt, aO as nt, aQ as it, ao as ot, aP as lt, az as dt, bh as ct, bj as ut, bi as mt, N as ht, an as pt, ag as ft, ay as bt, aA as gt, ai as xt, M as Nt, bg as vt, U as yt, aD as At, aC as Ct, aF as St, af as Dt, am as Et, aR as Tt, aj as wt } from "./chunks/index-B7kUtCgG.js";
1
+ import { b as j, W as q, Y as H, Z as W, _ as G, $ as K, a0 as Y, a1 as X, a2 as J, a3 as Z, u as F, a4 as O, a5 as ee, P as ae, j as te, B as T, c as _, a6 as se, l as re, m as ne, n as ie, a7 as Q, a8 as oe, o as le, p as de, q as ce, r as ue, s as me, a9 as he, aa as pe, ab as fe, ac as E, ad as be, ae as ge } from "./chunks/index-y1uW2fuZ.js";
2
+ import { aU as Me, aW as Fe, bC as Le, aY as Ue, aV as ze, ax as Be, aZ as Oe, D as je, av as We, ap as Qe, bI as Ve, b1 as $e, ah as qe, ak as He, ak as Ge, al as Ke, aw as Ye, a as Xe, bH as Je, as as Ze, bn as ea, bk as aa, bD as ta, b8 as sa, bp as ra, au as na, aq as ia, ar as oa, b2 as la, bL as da, bm as ca, bw as ua, bt as ma, bA as ha, bu as pa, bv as fa, bs as ba, br as ga, ba as xa, bG as Na, bF as va, bE as ya, b9 as Aa, bd as Ca, be as Sa, b7 as Da, at as Ea, b6 as Ta, a$ as wa, b0 as Ra, a_ as Ia, bb as _a, b5 as Pa, bK as ka, bJ as Ma, b4 as Fa, b3 as La, bz as Ua, bl as za, by as Ba, bf as Oa, bc as ja, bq as Wa, bo as Qa, bx as Va, bB as $a, aE as qa, aB as Ha, aN as Ga, aL as Ka, aT as Ya, aS as Xa, aK as Ja, aJ as Za, aI as et, aM as at, aX as tt, aG as st, aH as rt, aO as nt, aQ as it, ao as ot, aP as lt, az as dt, bh as ct, bj as ut, bi as mt, N as ht, an as pt, ag as ft, ay as bt, aA as gt, ai as xt, M as Nt, bg as vt, U as yt, aD as At, aC as Ct, aF as St, af as Dt, am as Et, aR as Tt, aj as wt } from "./chunks/index-y1uW2fuZ.js";
3
3
  import { CONTROL_CARD_DEFAULT_VALUE as It, DEFAULT_CALENDAR_CONTEXT as _t, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Pt, EMPTY_SELECTION as kt } from "./types/index.js";
4
- import { C as Ft, D as Lt } from "./chunks/dashboard-summary-settings-dialog-CWtlFDFP.js";
4
+ import { C as Ft, D as Lt } from "./chunks/dashboard-summary-settings-dialog-B4jsBFro.js";
5
5
  import { jsx as e, jsxs as r, Fragment as xe } from "react/jsx-runtime";
6
6
  import * as R from "react";
7
7
  import { useMemo as V, useState as P, useEffect as L, useCallback as M } from "react";
8
- import { ResourceManagementPanel as zt } from "./chunks/resource-management-panel-Dpin6Ffw.js";
8
+ import { ResourceManagementPanel as zt } from "./chunks/resource-management-panel-BC-cvjI9.js";
9
9
  import { u as Ot } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
10
10
  import "react-dom";
11
- import { A as Wt, D as Qt, c as Vt, a as $t, E as qt, N as Ht, U as Gt, V as Kt, u as Yt, b as Xt, d as Jt } from "./chunks/dashboard-filter-controls-button-zeiatmo1.js";
11
+ import { A as Wt, D as Qt, c as Vt, a as $t, E as qt, N as Ht, U as Gt, V as Kt, u as Yt, b as Xt, d as Jt } from "./chunks/dashboard-filter-controls-button-BZXrmJP2.js";
12
12
  import { n as es, s as as } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
13
13
  function De(a) {
14
14
  const { authToken: s, tokenProps: i } = j();