react-semaphor 0.1.252 → 0.1.254

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 (29) hide show
  1. package/dist/chunks/{dashboard-controls-tzai5JMp.js → dashboard-controls-BexrbNJf.js} +36 -36
  2. package/dist/chunks/{dashboard-controls-RKNlZLUy.js → dashboard-controls-DAxuznIE.js} +1 -1
  3. package/dist/chunks/{dashboard-json-B5wllXw0.js → dashboard-json-CPSZe-aV.js} +1 -1
  4. package/dist/chunks/{dashboard-json-ihTGgefO.js → dashboard-json-Vk0RsmjM.js} +1 -1
  5. package/dist/chunks/{dashboard-summary-settings-dialog-5tiQcv5v.js → dashboard-summary-settings-dialog-Cyia8zvf.js} +1 -1
  6. package/dist/chunks/{dashboard-summary-settings-dialog-aTE5vsbO.js → dashboard-summary-settings-dialog-rxL5aR9k.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-DWk1Nj1P.js → edit-dashboard-visual-D-LNpOvO.js} +2 -2
  8. package/dist/chunks/{edit-dashboard-visual-BIQd7lCz.js → edit-dashboard-visual-cDtffrNL.js} +1 -1
  9. package/dist/chunks/{editor-action-buttons-CmELP3na.js → editor-action-buttons-BhAQM9hd.js} +1 -1
  10. package/dist/chunks/{editor-action-buttons-B7ESBjzC.js → editor-action-buttons-Dvd6HM3i.js} +2 -2
  11. package/dist/chunks/index-BTukFHEW.js +1109 -0
  12. package/dist/chunks/{index-BDN1Q9RG.js → index-Db9U8V07.js} +33519 -33220
  13. package/dist/chunks/{notification-bell-CYrG1hcX.js → notification-bell-BNAt4sBg.js} +36 -36
  14. package/dist/chunks/{notification-bell-TG-yGjyj.js → notification-bell-CgJqShQz.js} +1 -1
  15. package/dist/chunks/{resource-management-panel-jsX9tgNz.js → resource-management-panel-By75dr-L.js} +1 -1
  16. package/dist/chunks/{resource-management-panel-CnDTYkf7.js → resource-management-panel-zoO-BA4s.js} +26 -26
  17. package/dist/chunks/{use-visual-utils-BNXkYg0F.js → use-visual-utils-DkUet_gs.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-H6Nd2HfE.js → use-visual-utils-DsPG9j_Q.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 +413 -252
  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/dist/types/main.d.ts +249 -48
  27. package/dist/types/types.d.ts +92 -20
  28. package/package.json +1 -1
  29. package/dist/chunks/index-DvjTd3ue.js +0 -1109
package/dist/index.js CHANGED
@@ -1,41 +1,52 @@
1
- import { V as D, W as _, Y as I, Z as M, _ as w, $ as F, a0 as R, u as C, a1 as y, a2 as k, P as L, k as B, B as E, c as f, a3 as O, l as Q, m as U, n as z, a4 as N, a5 as q, o as V, p as H, q as j, r as W, s as G, a6 as K, a7 as Y, a8 as $ } from "./chunks/index-BDN1Q9RG.js";
2
- import { aS as pe, aR as he, bA as be, aU as fe, aT as Ae, ar as Ce, aV as xe, D as ge, ap as ye, aj as De, bG as Ee, aZ as Ne, ab as Se, ae as ve, ae as Te, af as Pe, aq as _e, a as Ie, bs as Me, bF as we, am as Fe, bj as Re, bg as ke, bB as Le, b4 as Be, bl as Oe, ao as Qe, ak as Ue, al as ze, a_ as qe, bJ as Ve, bi as He, bu as je, bp as We, by as Ge, bq as Ke, br as Ye, bo as $e, bn as Xe, b6 as Je, bE as Ze, bD as ea, bC as aa, b5 as sa, b9 as ta, ba as ra, b3 as oa, bt as na, an as la, b2 as ia, aX as da, aY as ca, aW as ua, b7 as ma, b1 as pa, bI as ha, bH as ba, b0 as fa, a$ as Aa, bx as Ca, bh as xa, bw as ga, bb as ya, b8 as Da, bm as Ea, bk as Na, bv as Sa, bz as va, ay as Ta, av as Pa, aK as _a, aI as Ia, aH as Ma, aG as wa, aC as Fa, aQ as Ra, aP as ka, aF as La, aE as Ba, aD as Oa, aJ as Qa, aA as Ua, aB as za, aL as qa, aN as Va, ai as Ha, aM as ja, at as Wa, bd as Ga, bf as Ka, be as Ya, N as $a, ah as Xa, aa as Ja, as as Za, au as es, ac as as, M as ss, bc as ts, U as rs, ax as os, aw as ns, az as ls, a9 as is, ag as ds, aO as cs, ad as us } from "./chunks/index-BDN1Q9RG.js";
3
- import { DEFAULT_CALENDAR_CONTEXT as ps, DEFAULT_SEMANTIC_DOMAIN_ACCESS as hs, EMPTY_SELECTION as bs } from "./types/index.js";
4
- import { C as As, D as Cs } from "./chunks/dashboard-summary-settings-dialog-aTE5vsbO.js";
5
- import { jsx as e, jsxs as n, Fragment as X } from "react/jsx-runtime";
6
- import * as b from "react";
7
- import { useMemo as J, useState as Z, useEffect as ee } from "react";
8
- import { ResourceManagementPanel as gs } from "./chunks/resource-management-panel-CnDTYkf7.js";
9
- import { u as Ds } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
1
+ import { b as O, V as q, W as H, Y as W, Z as G, _ as K, $ as Y, a0 as X, a1 as J, a2 as Z, u as F, a3 as j, a4 as ee, P as ae, k as te, B as T, c as P, a5 as se, l as re, m as ne, n as ie, a6 as Q, a7 as oe, o as le, p as de, q as ce, r as ue, s as me, a8 as he, a9 as pe, aa as fe, ab as E, ac as be, ad as ge } from "./chunks/index-Db9U8V07.js";
2
+ import { aT as Me, aV as Fe, bB as Le, aX as ze, aU as Ue, aw as Be, aY as je, D as Oe, au as We, ao as Qe, bH as Ve, b0 as $e, ag as qe, aj as He, aj as Ge, ak as Ke, av as Ye, a as Xe, bG as Je, ar as Ze, bm as ea, bj as aa, bC as ta, b7 as sa, bo as ra, at as na, ap as ia, aq as oa, b1 as la, bK as da, bl as ca, bv as ua, bs as ma, bz as ha, bt as pa, bu as fa, br as ba, bq as ga, b9 as xa, bF as Na, bE as va, bD as ya, b8 as Aa, bc as Ca, bd as Sa, b6 as Da, as as Ea, b5 as Ta, a_ as wa, a$ as Ia, aZ as Ra, ba as Pa, b4 as ka, bJ as _a, bI as Ma, b3 as Fa, b2 as La, by as za, bk as Ua, bx as Ba, be as ja, bb as Oa, bp as Wa, bn as Qa, bw as Va, bA as $a, aD as qa, aA as Ha, aM as Ga, aK as Ka, aS as Ya, aR as Xa, aJ as Ja, aI as Za, aH as et, aL as at, aW as tt, aF as st, aG as rt, aN as nt, aP as it, an as ot, aO as lt, ay as dt, bg as ct, bi as ut, bh as mt, N as ht, am as pt, af as ft, ax as bt, az as gt, ah as xt, M as Nt, bf as vt, U as yt, aC as At, aB as Ct, aE as St, ae as Dt, al as Et, aQ as Tt, ai as wt } from "./chunks/index-Db9U8V07.js";
3
+ import { DEFAULT_CALENDAR_CONTEXT as Rt, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Pt, EMPTY_SELECTION as kt } from "./types/index.js";
4
+ import { C as Mt, D as Ft } from "./chunks/dashboard-summary-settings-dialog-rxL5aR9k.js";
5
+ import { jsx as e, jsxs as r, Fragment as xe } from "react/jsx-runtime";
6
+ import * as I from "react";
7
+ import { useMemo as V, useState as k, useEffect as L, useCallback as M } from "react";
8
+ import { ResourceManagementPanel as zt } from "./chunks/resource-management-panel-zoO-BA4s.js";
9
+ import { u as Bt } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
10
10
  import "react-dom";
11
- import { A as Ns, a as Ss, E as vs, N as Ts, U as Ps, V as _s, u as Is, b as Ms, c as ws } from "./chunks/notification-bell-CYrG1hcX.js";
12
- import { n as Rs, s as ks } from "./chunks/normalize-dashboard-for-dirty-check-Bn27S0PN.js";
13
- function ne(a) {
14
- const { displayPreferences: s, ...i } = a, d = {
15
- ...i,
11
+ import { A as Ot, a as Wt, E as Qt, N as Vt, U as $t, V as qt, u as Ht, b as Gt, c as Kt } from "./chunks/notification-bell-BNAt4sBg.js";
12
+ import { n as Xt, s as Jt } from "./chunks/normalize-dashboard-for-dirty-check-Bn27S0PN.js";
13
+ function De(a) {
14
+ const { authToken: s, tokenProps: n } = O();
15
+ return q({
16
+ mutationFn: async (i) => H(
17
+ n.apiServiceUrl,
18
+ s.accessToken,
19
+ a,
20
+ i
21
+ )
22
+ });
23
+ }
24
+ function Ee(a) {
25
+ const { displayPreferences: s, ...n } = a, i = {
26
+ ...n,
16
27
  id: a.dashboardId
17
28
  // override the id to the dashboard id so that the dashboard is not loaded
18
29
  };
19
- return /* @__PURE__ */ e(D, { FallbackComponent: _, children: /* @__PURE__ */ n(I, { dashboardProps: d, children: [
20
- /* @__PURE__ */ e(M, { componentType: "visual", componentId: a.cardId }),
21
- /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(F, { displayPreferences: s, children: /* @__PURE__ */ e(R, { type: "visual", ...d, children: /* @__PURE__ */ e(ae, { cardId: a.cardId }) }) }) })
30
+ return /* @__PURE__ */ e(W, { FallbackComponent: G, children: /* @__PURE__ */ r(K, { dashboardProps: i, children: [
31
+ /* @__PURE__ */ e(Y, { componentType: "visual", componentId: a.cardId }),
32
+ /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(J, { displayPreferences: s, children: /* @__PURE__ */ e(Z, { type: "visual", ...i, children: /* @__PURE__ */ e(Ne, { cardId: a.cardId }) }) }) })
22
33
  ] }) });
23
34
  }
24
- function ae({ cardId: a }) {
25
- const s = C((r) => {
26
- var l;
27
- return (l = r.dashboard) == null ? void 0 : l.sheets;
28
- }), { card: i, frame: d } = J(() => {
29
- const r = s == null ? void 0 : s.flatMap((t) => t.frames), l = r == null ? void 0 : r.flatMap((t) => t == null ? void 0 : t.cards), c = l == null ? void 0 : l.find((t) => (t == null ? void 0 : t.id) === a), o = r == null ? void 0 : r.find(
30
- (t) => {
35
+ function Ne({ cardId: a }) {
36
+ const s = F((l) => {
37
+ var c;
38
+ return (c = l.dashboard) == null ? void 0 : c.sheets;
39
+ }), { card: n, frame: i } = V(() => {
40
+ const l = s == null ? void 0 : s.flatMap((o) => o.frames), c = l == null ? void 0 : l.flatMap((o) => o == null ? void 0 : o.cards), u = c == null ? void 0 : c.find((o) => (o == null ? void 0 : o.id) === a), t = l == null ? void 0 : l.find(
41
+ (o) => {
31
42
  var m;
32
- return (m = t == null ? void 0 : t.cards) == null ? void 0 : m.find((p) => (p == null ? void 0 : p.id) === a);
43
+ return (m = o == null ? void 0 : o.cards) == null ? void 0 : m.find((b) => (b == null ? void 0 : b.id) === a);
33
44
  }
34
45
  );
35
- return { card: c, frame: o };
46
+ return { card: u, frame: t };
36
47
  }, [s, a]);
37
- return !i || !d ? /* @__PURE__ */ e(
38
- y,
48
+ return !n || !i ? /* @__PURE__ */ e(
49
+ j,
39
50
  {
40
51
  error: new Error("Card not found"),
41
52
  resetErrorBoundary: () => {
@@ -43,108 +54,108 @@ function ae({ cardId: a }) {
43
54
  customerFacingMessage: `Card not found with ID: ${a}`
44
55
  }
45
56
  ) : /* @__PURE__ */ e("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ e(
46
- D,
57
+ W,
47
58
  {
48
59
  FallbackComponent: ({
49
- error: r,
50
- resetErrorBoundary: l
60
+ error: l,
61
+ resetErrorBoundary: c
51
62
  }) => /* @__PURE__ */ e(
52
- y,
63
+ j,
53
64
  {
54
- error: r,
55
- resetErrorBoundary: l,
65
+ error: l,
66
+ resetErrorBoundary: c,
56
67
  customerFacingMessage: "Error creating visual. Please try again."
57
68
  }
58
69
  ),
59
- children: /* @__PURE__ */ e(k, { card: i, frame: d })
70
+ children: /* @__PURE__ */ e(ee, { card: n, frame: i })
60
71
  }
61
72
  ) });
62
73
  }
63
- function le({
74
+ function Te({
64
75
  name: a,
65
76
  items: s,
66
- value: i,
67
- onChange: d,
68
- isLoading: r,
69
- isError: l,
70
- refetch: c,
71
- className: o,
72
- icon: t,
77
+ value: n,
78
+ onChange: i,
79
+ isLoading: l,
80
+ isError: c,
81
+ refetch: u,
82
+ className: t,
83
+ icon: o,
73
84
  showNone: m = !1
74
85
  }) {
75
- const p = b.useRef(null), [x, g] = b.useState(!1), [S, v] = b.useState("100%"), A = m ? [...s || [], { id: "none", name: "None" }] : s;
76
- b.useLayoutEffect(() => {
77
- p.current && v(p.current.offsetWidth);
86
+ const b = I.useRef(null), [v, g] = I.useState(!1), [y, A] = I.useState("100%"), x = m ? [...s || [], { id: "none", name: "None" }] : s;
87
+ I.useLayoutEffect(() => {
88
+ b.current && A(b.current.offsetWidth);
78
89
  }, []);
79
- function T() {
80
- var u;
81
- return r ? "Loading..." : l ? "Error" : i ? (u = s == null ? void 0 : s.find((h) => h.id === i)) == null ? void 0 : u.name : `Select ${a}`;
90
+ function _() {
91
+ var h;
92
+ return l ? "Loading..." : c ? "Error" : n ? (h = s == null ? void 0 : s.find((N) => N.id === n)) == null ? void 0 : h.name : `Select ${a}`;
82
93
  }
83
- function P(u, h) {
84
- d(h), g(!1);
94
+ function w(h, N) {
95
+ i(N), g(!1);
85
96
  }
86
- return /* @__PURE__ */ n(L, { open: x, onOpenChange: g, children: [
87
- /* @__PURE__ */ e(B, { asChild: !0, children: /* @__PURE__ */ n(
88
- E,
97
+ return /* @__PURE__ */ r(ae, { open: v, onOpenChange: g, children: [
98
+ /* @__PURE__ */ e(te, { asChild: !0, children: /* @__PURE__ */ r(
99
+ T,
89
100
  {
90
- ref: p,
101
+ ref: b,
91
102
  variant: "outline",
92
103
  role: "combobox",
93
- "aria-expanded": x,
94
- className: f("flex h-9 w-full justify-between", o),
104
+ "aria-expanded": v,
105
+ className: P("flex h-9 w-full justify-between", t),
95
106
  children: [
96
- /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
97
- t && /* @__PURE__ */ e("div", { className: "mr-2", children: t }),
98
- /* @__PURE__ */ e("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: T() })
107
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
108
+ o && /* @__PURE__ */ e("div", { className: "mr-2", children: o }),
109
+ /* @__PURE__ */ e("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: _() })
99
110
  ] }),
100
- /* @__PURE__ */ e(O, { className: "size-4 opacity-50" })
111
+ /* @__PURE__ */ e(se, { className: "size-4 opacity-50" })
101
112
  ]
102
113
  }
103
114
  ) }),
104
115
  /* @__PURE__ */ e(
105
- Q,
116
+ re,
106
117
  {
107
118
  className: "w-full p-0",
108
- style: { minWidth: S },
109
- children: /* @__PURE__ */ n(U, { children: [
110
- /* @__PURE__ */ n("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
111
- /* @__PURE__ */ e(z, { className: "h-9", placeholder: "Search..." }),
112
- /* @__PURE__ */ e(N, { className: "h-7", onClick: c, children: /* @__PURE__ */ e(
113
- q,
119
+ style: { minWidth: y },
120
+ children: /* @__PURE__ */ r(ne, { children: [
121
+ /* @__PURE__ */ r("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
122
+ /* @__PURE__ */ e(ie, { className: "h-9", placeholder: "Search..." }),
123
+ /* @__PURE__ */ e(Q, { className: "h-7", onClick: u, children: /* @__PURE__ */ e(
124
+ oe,
114
125
  {
115
- className: f(
126
+ className: P(
116
127
  "size-3.5 opacity-50",
117
- r && "animate-spin"
128
+ l && "animate-spin"
118
129
  )
119
130
  }
120
131
  ) })
121
132
  ] }),
122
- /* @__PURE__ */ n(V, { children: [
123
- /* @__PURE__ */ n(H, { children: [
133
+ /* @__PURE__ */ r(le, { children: [
134
+ /* @__PURE__ */ r(de, { children: [
124
135
  "No ",
125
136
  a == null ? void 0 : a.toLowerCase(),
126
137
  " found."
127
138
  ] }),
128
- /* @__PURE__ */ e(j, { children: A == null ? void 0 : A.map((u) => /* @__PURE__ */ e(
129
- W,
139
+ /* @__PURE__ */ e(ce, { children: x == null ? void 0 : x.map((h) => /* @__PURE__ */ e(
140
+ ue,
130
141
  {
131
142
  className: "overflow-x-auto",
132
- value: u.name,
133
- onSelect: (h) => P(h, u.id),
134
- children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
143
+ value: h.name,
144
+ onSelect: (N) => w(N, h.id),
145
+ children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
135
146
  /* @__PURE__ */ e(
136
- G,
147
+ me,
137
148
  {
138
- className: f(
149
+ className: P(
139
150
  "size-4",
140
- i === u.id ? "opacity-100" : "opacity-0"
151
+ n === h.id ? "opacity-100" : "opacity-0"
141
152
  )
142
153
  }
143
154
  ),
144
- /* @__PURE__ */ e("div", { title: u.name, children: u.name })
155
+ /* @__PURE__ */ e("div", { title: h.name, children: h.name })
145
156
  ] })
146
157
  },
147
- u.id
158
+ h.id
148
159
  )) })
149
160
  ] })
150
161
  ] })
@@ -152,54 +163,204 @@ function le({
152
163
  )
153
164
  ] });
154
165
  }
155
- function ie({
166
+ function we({
156
167
  triggerButtonClassName: a,
157
168
  variant: s = "ghost"
158
169
  }) {
159
- const [i, d] = Z(!1), r = C((c) => {
160
- var o;
161
- return (o = c.dashboard) == null ? void 0 : o.id;
162
- }), l = C((c) => {
163
- var o;
164
- return (o = c.dashboard) == null ? void 0 : o.title;
170
+ const [n, i] = k(!1), l = F((u) => {
171
+ var t;
172
+ return (t = u.dashboard) == null ? void 0 : t.id;
173
+ }), c = F((u) => {
174
+ var t;
175
+ return (t = u.dashboard) == null ? void 0 : t.title;
165
176
  });
166
- return r ? /* @__PURE__ */ n(X, { children: [
177
+ return l ? /* @__PURE__ */ r(xe, { children: [
167
178
  /* @__PURE__ */ e(
168
- N,
179
+ Q,
169
180
  {
170
181
  tooltip: "Schedule Dashboard",
171
- className: f("h-7 p-2", a),
182
+ className: P("h-7 p-2", a),
172
183
  buttonProps: { variant: s },
173
- onClick: () => d(!0),
174
- children: /* @__PURE__ */ e(K, { className: "size-4" })
184
+ onClick: () => i(!0),
185
+ children: /* @__PURE__ */ e(he, { className: "size-4" })
175
186
  }
176
187
  ),
177
188
  /* @__PURE__ */ e(
178
- Y,
189
+ pe,
179
190
  {
180
- open: i,
181
- onOpenChange: d,
182
- dashboardId: r,
183
- dashboardName: l
191
+ open: n,
192
+ onOpenChange: i,
193
+ dashboardId: l,
194
+ dashboardName: c
184
195
  }
185
196
  )
186
197
  ] }) : null;
187
198
  }
188
- function de(a, s) {
189
- ee(() => (a && s && (window.__SEMAPHOR_PRINT_STATE__ = {
199
+ function Ie(a, s) {
200
+ L(() => (a && s && (window.__SEMAPHOR_PRINT_STATE__ = {
190
201
  ...s
191
202
  }), () => {
192
203
  a && window.__SEMAPHOR_PRINT_STATE__ && delete window.__SEMAPHOR_PRINT_STATE__;
193
204
  }), [a, s]);
194
205
  }
195
- function ce() {
196
- var l, c;
197
- const { quotasQuery: a, usageQuery: s } = $(), i = ((l = a.data) == null ? void 0 : l.quotas) || [], d = ((c = s.data) == null ? void 0 : c.usage) || [], r = new Map(d.map((o) => [o.tenantId || "org", o]));
198
- return /* @__PURE__ */ n("div", { className: "space-y-4 p-4", children: [
199
- /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
206
+ function R(a) {
207
+ if (!a) return "--";
208
+ const s = new Date(a);
209
+ return Number.isNaN(s.getTime()) ? "--" : s.toLocaleString();
210
+ }
211
+ function ve(a) {
212
+ var s;
213
+ return ((s = a.alertState) == null ? void 0 : s.currentState) === "FIRING" ? "Signal surfaced" : a.status === "ACTIVE" ? "Watching" : a.status === "PAUSED" ? "Paused" : a.status;
214
+ }
215
+ function Re({ alertId: a, onBack: s }) {
216
+ var h, N, z, U;
217
+ const { authToken: n, tokenProps: i } = O(), { data: l, isLoading: c, refetch: u } = fe(a), t = (l == null ? void 0 : l.alert) ?? null, [o, m] = k([]), [b, v] = k([]), [g, y] = k(null), A = M(async () => {
218
+ var f;
219
+ const d = i == null ? void 0 : i.apiServiceUrl, p = n == null ? void 0 : n.accessToken;
220
+ if (!d || !p || !a) return null;
221
+ try {
222
+ const S = await fetch(`${d}/v1/alerts/${a}/runs?limit=20`, {
223
+ headers: { Authorization: `Bearer ${p}` }
224
+ });
225
+ if (S.ok) {
226
+ const D = await S.json(), C = Array.isArray(D.runs) ? D.runs : [], B = g && C.some(($) => $.id === g) ? g : ((f = C[0]) == null ? void 0 : f.id) ?? null;
227
+ return v(C), y(B), B;
228
+ }
229
+ v([]), y(null);
230
+ } catch {
231
+ return v([]), y(null), null;
232
+ }
233
+ return null;
234
+ }, [a, n, g, i]), x = M(async (d) => {
235
+ const p = i == null ? void 0 : i.apiServiceUrl, f = n == null ? void 0 : n.accessToken, S = d ?? g;
236
+ if (!p || !f || !a || !S) {
237
+ m([]);
238
+ return;
239
+ }
240
+ try {
241
+ const D = await fetch(
242
+ `${p}/v1/alerts/${a}/runs/${S}/deliveries`,
243
+ {
244
+ headers: { Authorization: `Bearer ${f}` }
245
+ }
246
+ );
247
+ if (D.ok) {
248
+ const C = await D.json();
249
+ m(Array.isArray(C.attempts) ? C.attempts : []);
250
+ } else
251
+ m([]);
252
+ } catch {
253
+ m([]);
254
+ }
255
+ }, [a, n, g, i]), _ = M(async () => {
256
+ await u();
257
+ const d = await A();
258
+ await x(d);
259
+ }, [x, A, u]);
260
+ L(() => {
261
+ A().catch(() => {
262
+ });
263
+ }, [A]), L(() => {
264
+ x().catch(() => {
265
+ });
266
+ }, [x]);
267
+ const w = V(() => {
268
+ const d = {};
269
+ for (const p of o)
270
+ d[p.channel] || (d[p.channel] = []), d[p.channel].push(p);
271
+ return d;
272
+ }, [o]);
273
+ return c ? /* @__PURE__ */ e("div", { className: "p-4 text-sm text-muted-foreground", children: "Loading signal detail..." }) : t ? /* @__PURE__ */ r("div", { className: "space-y-4 p-4", children: [
274
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-2", children: [
275
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
276
+ s && /* @__PURE__ */ e(T, { variant: "outline", size: "sm", onClick: s, children: "Back" }),
277
+ /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: t.name }),
278
+ /* @__PURE__ */ e(E, { variant: t.status === "ACTIVE" ? "default" : "secondary", children: ve(t) }),
279
+ ((h = t.alertState) == null ? void 0 : h.currentState) && /* @__PURE__ */ e(E, { variant: t.alertState.currentState === "FIRING" ? "destructive" : "outline", children: t.alertState.currentState === "FIRING" ? "Signal surfaced" : "Stable" })
280
+ ] }),
281
+ /* @__PURE__ */ e(T, { variant: "outline", size: "sm", onClick: () => void _(), children: "Refresh" })
282
+ ] }),
283
+ t.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t.description }),
284
+ /* @__PURE__ */ r("div", { className: "rounded-md border bg-muted/30 p-4 text-sm", children: [
285
+ /* @__PURE__ */ e("p", { className: "font-medium", children: "What changed" }),
286
+ /* @__PURE__ */ e("p", { className: "mt-1 text-muted-foreground", children: "Review the latest signal activity, then investigate the underlying dashboard context if you need more detail." })
287
+ ] }),
288
+ /* @__PURE__ */ r("div", { className: "rounded-md border bg-background p-4 space-y-2", children: [
289
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Signal Watch" }),
290
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-2 text-sm", children: [
291
+ /* @__PURE__ */ r("div", { children: [
292
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Watching for:" }),
293
+ " ",
294
+ be(t.jobConfig.operator, t.jobConfig.threshold)
295
+ ] }),
296
+ /* @__PURE__ */ r("div", { children: [
297
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Severity:" }),
298
+ " ",
299
+ t.jobConfig.severity
300
+ ] }),
301
+ /* @__PURE__ */ r("div", { children: [
302
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Last Evaluated:" }),
303
+ " ",
304
+ R((N = t.alertState) == null ? void 0 : N.lastEvaluatedAt)
305
+ ] }),
306
+ /* @__PURE__ */ r("div", { children: [
307
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Last Surfaced:" }),
308
+ " ",
309
+ R((z = t.alertState) == null ? void 0 : z.lastTriggeredAt)
310
+ ] })
311
+ ] })
312
+ ] }),
313
+ ((U = t.deliveryConfig) == null ? void 0 : U.channels) && t.deliveryConfig.channels.length > 0 && /* @__PURE__ */ r("div", { className: "rounded-md border bg-background p-4 space-y-2", children: [
314
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Where It Surfaces" }),
315
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: t.deliveryConfig.channels.map((d) => /* @__PURE__ */ e(E, { variant: "outline", children: d }, d)) })
316
+ ] }),
317
+ b.length > 0 && /* @__PURE__ */ r("div", { className: "rounded-md border bg-background p-4 space-y-3", children: [
318
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Recent Delivery Activity" }),
319
+ b.length > 1 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: b.map((d) => /* @__PURE__ */ e(
320
+ T,
321
+ {
322
+ variant: d.id === g ? "default" : "outline",
323
+ size: "sm",
324
+ onClick: () => y(d.id),
325
+ children: R(d.scheduledFor)
326
+ },
327
+ d.id
328
+ )) }),
329
+ Object.keys(w).length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No delivery attempts were recorded for this run." }) : Object.entries(w).map(([d, p]) => /* @__PURE__ */ r("div", { className: "space-y-1", children: [
330
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(E, { variant: "secondary", className: "text-xs", children: d }) }),
331
+ /* @__PURE__ */ e("div", { className: "overflow-hidden rounded border", children: /* @__PURE__ */ r("table", { className: "w-full text-xs", children: [
332
+ /* @__PURE__ */ e("thead", { className: "bg-muted/40", children: /* @__PURE__ */ r("tr", { children: [
333
+ /* @__PURE__ */ e("th", { className: "px-2 py-1 text-left font-medium", children: "Recipient" }),
334
+ /* @__PURE__ */ e("th", { className: "px-2 py-1 text-left font-medium", children: "Status" }),
335
+ /* @__PURE__ */ e("th", { className: "px-2 py-1 text-left font-medium", children: "Time" }),
336
+ /* @__PURE__ */ e("th", { className: "px-2 py-1 text-left font-medium", children: "Error" })
337
+ ] }) }),
338
+ /* @__PURE__ */ e("tbody", { children: p.map((f) => /* @__PURE__ */ r("tr", { className: "border-t", children: [
339
+ /* @__PURE__ */ e("td", { className: "px-2 py-1", children: f.recipient }),
340
+ /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
341
+ E,
342
+ {
343
+ variant: f.status === "SENT" ? "default" : "destructive",
344
+ className: "text-[10px]",
345
+ children: f.status
346
+ }
347
+ ) }),
348
+ /* @__PURE__ */ e("td", { className: "px-2 py-1", children: R(f.createdAt) }),
349
+ /* @__PURE__ */ e("td", { className: "px-2 py-1 text-muted-foreground", children: f.error || "--" })
350
+ ] }, f.id)) })
351
+ ] }) })
352
+ ] }, d))
353
+ ] })
354
+ ] }) : /* @__PURE__ */ e("div", { className: "p-4 text-sm text-muted-foreground", children: "Signal not found." });
355
+ }
356
+ function Pe() {
357
+ var c, u;
358
+ const { quotasQuery: a, usageQuery: s } = ge(), n = ((c = a.data) == null ? void 0 : c.quotas) || [], i = ((u = s.data) == null ? void 0 : u.usage) || [], l = new Map(i.map((t) => [t.tenantId || "org", t]));
359
+ return /* @__PURE__ */ r("div", { className: "space-y-4 p-4", children: [
360
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
200
361
  /* @__PURE__ */ e("h2", { className: "text-xl font-semibold", children: "Alert Quotas" }),
201
362
  /* @__PURE__ */ e(
202
- E,
363
+ T,
203
364
  {
204
365
  variant: "outline",
205
366
  size: "sm",
@@ -211,163 +372,163 @@ function ce() {
211
372
  )
212
373
  ] }),
213
374
  a.isLoading || s.isLoading ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Loading quota usage..." }) : null,
214
- /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-lg border", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
215
- /* @__PURE__ */ e("thead", { className: "bg-muted/40", children: /* @__PURE__ */ n("tr", { children: [
375
+ /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-lg border", children: /* @__PURE__ */ r("table", { className: "w-full text-sm", children: [
376
+ /* @__PURE__ */ e("thead", { className: "bg-muted/40", children: /* @__PURE__ */ r("tr", { children: [
216
377
  /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Tenant" }),
217
378
  /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Active Alerts" }),
218
379
  /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Max Active" }),
219
380
  /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Min Cadence" }),
220
381
  /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Max Context Sources" })
221
382
  ] }) }),
222
- /* @__PURE__ */ e("tbody", { children: i.map((o) => {
223
- const t = o.tenantId || "org", m = r.get(t);
224
- return /* @__PURE__ */ n("tr", { className: "border-t", children: [
225
- /* @__PURE__ */ e("td", { className: "px-3 py-2", children: t }),
383
+ /* @__PURE__ */ e("tbody", { children: n.map((t) => {
384
+ const o = t.tenantId || "org", m = l.get(o);
385
+ return /* @__PURE__ */ r("tr", { className: "border-t", children: [
386
+ /* @__PURE__ */ e("td", { className: "px-3 py-2", children: o }),
226
387
  /* @__PURE__ */ e("td", { className: "px-3 py-2", children: (m == null ? void 0 : m.activeAlerts) ?? 0 }),
227
- /* @__PURE__ */ e("td", { className: "px-3 py-2", children: o.policy.maxActiveAlerts }),
228
- /* @__PURE__ */ n("td", { className: "px-3 py-2", children: [
229
- o.policy.minCadenceMinutes,
388
+ /* @__PURE__ */ e("td", { className: "px-3 py-2", children: t.policy.maxActiveAlerts }),
389
+ /* @__PURE__ */ r("td", { className: "px-3 py-2", children: [
390
+ t.policy.minCadenceMinutes,
230
391
  " min"
231
392
  ] }),
232
- /* @__PURE__ */ e("td", { className: "px-3 py-2", children: o.policy.maxContextSources })
233
- ] }, t);
393
+ /* @__PURE__ */ e("td", { className: "px-3 py-2", children: t.policy.maxContextSources })
394
+ ] }, o);
234
395
  }) })
235
396
  ] }) })
236
397
  ] });
237
398
  }
238
399
  export {
239
- Ns as AdvancedModeToggle,
240
- pe as AlertCreationDialog,
241
- he as AlertManagementPage,
242
- be as AlertsApiError,
243
- fe as CALCULATED_FIELD_ENTITY_MARKER,
244
- As as CalendarPreferencesDialog,
245
- Ae as CardAlertIndicator,
246
- Ce as CardSummary,
247
- le as Combobox,
248
- xe as DATE_FORMAT_VALUES,
249
- ps as DEFAULT_CALENDAR_CONTEXT,
250
- hs as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
251
- ge as Dashboard,
252
- ye as DashboardExportDialog,
253
- Cs as DashboardSummarySettingsDialog,
254
- De as DashboardWC,
255
- bs as EMPTY_SELECTION,
256
- Y as EmailScheduleDialog,
257
- Ee as ExportError,
258
- Ss as ExportNotificationItem,
259
- vs as ExportNotificationList,
260
- Ts as NotificationBell,
261
- Ne as PivotMarkerEnum,
262
- gs as ResourceManagementPanel,
263
- Se as ResourceType,
264
- ie as ScheduleDashboard,
265
- I as SemaphorContextProvider,
266
- ve as SemaphorDataProvider,
267
- Te as SemaphorQueryClient,
268
- Pe as ShareDialog,
269
- _e as SummaryCard,
270
- Ie as Surfboard,
271
- ce as TenantQuotaPage,
272
- Ps as UnsavedChangesAlert,
273
- ne as Visual,
274
- _s as VisualEditingControls,
275
- Me as backtestAlert,
276
- we as cancelExport,
277
- Fe as cloneDeep,
278
- Re as createAlert,
279
- ke as createEmptyKpiConfig,
280
- Le as createExport,
281
- Be as createSqlGenConfig,
282
- Oe as deleteAlert,
283
- Qe as downloadPdf,
284
- Ue as emitDashboardLoad,
285
- ze as emitDashboardUnload,
286
- qe as fmt,
287
- Ve as formatFileSize,
288
- He as getAlert,
289
- je as getAlertContextSources,
290
- We as getAlertHistory,
291
- Ge as getAlertQuotaUsage,
292
- Ke as getAlertRunDeliveries,
293
- Ye as getAlertRunSteps,
294
- $e as getAlertRuns,
295
- Xe as getAlertState,
296
- Je as getColumnDataType,
297
- Ze as getDownloadUrl,
298
- ea as getExportStatus,
299
- aa as getExports,
300
- sa as getFilterValueType,
301
- ta as getFormattedTableNameForQuery,
302
- ra as getQualifiedTableName,
303
- oa as getSql,
304
- na as interpretAlertContext,
305
- la as invalidateToken,
306
- ia as isBooleanDataType,
307
- da as isCalculatedDimension,
308
- ca as isCalculatedField,
309
- ua as isCalculatedMetric,
310
- ma as isColumnInSqlGen,
311
- pa as isDateDataType,
312
- ha as isExportComplete,
313
- ba as isExportInProgress,
314
- fa as isNumberDataType,
315
- Aa as isTextDataType,
316
- Ca as listAlertQuotas,
317
- xa as listAlerts,
318
- Rs as normalizeDashboardForDirtyCheck,
319
- ga as previewAlertDeliverable,
320
- ya as resolveDataType,
321
- Da as resolveDatamodelName,
322
- ks as serializeDashboardForDirtyCheck,
323
- Ea as triggerAlertNow,
324
- Na as updateAlert,
325
- Sa as updateAlertContextSources,
326
- va as updateAlertQuota,
327
- Ta as useActiveExports,
328
- Pa as useAddNewFrame,
329
- _a as useAlertActions,
330
- Ia as useAlertBacktest,
331
- Ma as useAlertContextBuilder,
332
- wa as useAlertDeliveries,
333
- Fa as useAlertDetail,
334
- Ra as useAlertDraft,
335
- ka as useAlertFilters,
336
- La as useAlertHistory,
337
- $ as useAlertQuotas,
338
- Ba as useAlertRuns,
339
- Oa as useAlertState,
340
- Qa as useAlertStore,
341
- Ua as useAlerts,
342
- za as useAlertsBootstrap,
343
- qa as useAlertsById,
344
- Va as useAlertsForCard,
345
- Ha as useCard,
346
- ja as useCardAlertMap,
347
- Wa as useCardSummary,
348
- Ga as useCurrentActiveCard,
349
- Ka as useCurrentCardConfig,
350
- Ya as useCurrentSheetActiveCards,
351
- $a as useDashboardActions,
352
- Xa as useDashboardById,
353
- Ja as useDashboardQuery,
354
- C as useDashboardStore,
355
- Za as useDashboardSummary,
356
- es as useDataColumns,
357
- as as useDateFilterHook,
358
- Ds as useDebouncedDirtyCheck,
359
- ss as useEditorActions,
360
- ts as useEditorAside,
361
- rs as useEditorStore,
362
- os as useExportActions,
363
- Is as useExportPolling,
364
- Ms as useExportRecovery,
365
- ns as useExportStore,
366
- de as useExposePrintState,
367
- ls as useInProgressExportsCount,
368
- is as useManagementStore,
369
- ws as usePristineSnapshotInitializer,
370
- ds as useResourceManagement,
371
- cs as useSelectedAlertId,
372
- us as useTextFilterHook
400
+ Ot as AdvancedModeToggle,
401
+ Re as AlertDetailPageEmbedded,
402
+ Me as AlertManagementPage,
403
+ Fe as AlertWizardDialog,
404
+ Le as AlertsApiError,
405
+ ze as CALCULATED_FIELD_ENTITY_MARKER,
406
+ Mt as CalendarPreferencesDialog,
407
+ Ue as CardAlertIndicator,
408
+ Be as CardSummary,
409
+ Te as Combobox,
410
+ je as DATE_FORMAT_VALUES,
411
+ Rt as DEFAULT_CALENDAR_CONTEXT,
412
+ Pt as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
413
+ Oe as Dashboard,
414
+ We as DashboardExportDialog,
415
+ Ft as DashboardSummarySettingsDialog,
416
+ Qe as DashboardWC,
417
+ kt as EMPTY_SELECTION,
418
+ pe as EmailScheduleDialog,
419
+ Ve as ExportError,
420
+ Wt as ExportNotificationItem,
421
+ Qt as ExportNotificationList,
422
+ Vt as NotificationBell,
423
+ $e as PivotMarkerEnum,
424
+ zt as ResourceManagementPanel,
425
+ qe as ResourceType,
426
+ we as ScheduleDashboard,
427
+ K as SemaphorContextProvider,
428
+ He as SemaphorDataProvider,
429
+ Ge as SemaphorQueryClient,
430
+ Ke as ShareDialog,
431
+ Ye as SummaryCard,
432
+ Xe as Surfboard,
433
+ Pe as TenantQuotaPage,
434
+ $t as UnsavedChangesAlert,
435
+ Ee as Visual,
436
+ qt as VisualEditingControls,
437
+ H as backtestAlert,
438
+ Je as cancelExport,
439
+ Ze as cloneDeep,
440
+ ea as createAlert,
441
+ aa as createEmptyKpiConfig,
442
+ ta as createExport,
443
+ sa as createSqlGenConfig,
444
+ ra as deleteAlert,
445
+ na as downloadPdf,
446
+ ia as emitDashboardLoad,
447
+ oa as emitDashboardUnload,
448
+ la as fmt,
449
+ da as formatFileSize,
450
+ ca as getAlert,
451
+ ua as getAlertContextSources,
452
+ ma as getAlertHistory,
453
+ ha as getAlertQuotaUsage,
454
+ pa as getAlertRunDeliveries,
455
+ fa as getAlertRunSteps,
456
+ ba as getAlertRuns,
457
+ ga as getAlertState,
458
+ xa as getColumnDataType,
459
+ Na as getDownloadUrl,
460
+ va as getExportStatus,
461
+ ya as getExports,
462
+ Aa as getFilterValueType,
463
+ Ca as getFormattedTableNameForQuery,
464
+ Sa as getQualifiedTableName,
465
+ Da as getSql,
466
+ Ea as invalidateToken,
467
+ Ta as isBooleanDataType,
468
+ wa as isCalculatedDimension,
469
+ Ia as isCalculatedField,
470
+ Ra as isCalculatedMetric,
471
+ Pa as isColumnInSqlGen,
472
+ ka as isDateDataType,
473
+ _a as isExportComplete,
474
+ Ma as isExportInProgress,
475
+ Fa as isNumberDataType,
476
+ La as isTextDataType,
477
+ za as listAlertQuotas,
478
+ Ua as listAlerts,
479
+ Xt as normalizeDashboardForDirtyCheck,
480
+ Ba as previewAlertDeliverable,
481
+ ja as resolveDataType,
482
+ Oa as resolveDatamodelName,
483
+ Jt as serializeDashboardForDirtyCheck,
484
+ Wa as triggerAlertNow,
485
+ Qa as updateAlert,
486
+ Va as updateAlertContextSources,
487
+ $a as updateAlertQuota,
488
+ qa as useActiveExports,
489
+ Ha as useAddNewFrame,
490
+ Ga as useAlertActions,
491
+ De as useAlertBacktest,
492
+ Ka as useAlertDeliveries,
493
+ fe as useAlertDetail,
494
+ Ya as useAlertDraft,
495
+ Xa as useAlertFilters,
496
+ Ja as useAlertHistory,
497
+ ge as useAlertQuotas,
498
+ Za as useAlertRuns,
499
+ et as useAlertState,
500
+ at as useAlertStore,
501
+ tt as useAlertWizard,
502
+ st as useAlerts,
503
+ rt as useAlertsBootstrap,
504
+ nt as useAlertsById,
505
+ it as useAlertsForCard,
506
+ ot as useCard,
507
+ lt as useCardAlertMap,
508
+ dt as useCardSummary,
509
+ ct as useCurrentActiveCard,
510
+ ut as useCurrentCardConfig,
511
+ mt as useCurrentSheetActiveCards,
512
+ ht as useDashboardActions,
513
+ pt as useDashboardById,
514
+ ft as useDashboardQuery,
515
+ F as useDashboardStore,
516
+ bt as useDashboardSummary,
517
+ gt as useDataColumns,
518
+ xt as useDateFilterHook,
519
+ Bt as useDebouncedDirtyCheck,
520
+ Nt as useEditorActions,
521
+ vt as useEditorAside,
522
+ yt as useEditorStore,
523
+ At as useExportActions,
524
+ Ht as useExportPolling,
525
+ Gt as useExportRecovery,
526
+ Ct as useExportStore,
527
+ Ie as useExposePrintState,
528
+ St as useInProgressExportsCount,
529
+ Dt as useManagementStore,
530
+ Kt as usePristineSnapshotInitializer,
531
+ Et as useResourceManagement,
532
+ Tt as useSelectedAlertId,
533
+ wt as useTextFilterHook
373
534
  };