@epam/ai-dial-scheduled-tasks 1.1.0-dev.114 → 1.1.0-dev.121

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.
package/index.js CHANGED
@@ -1,299 +1,317 @@
1
- import { PanelEmptyState as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
2
- import { Input as r, SearchBar as i, Textarea as a } from "@epam/ai-dial-kit";
3
- import { Calendar as o, CalendarMode as s, CardShell as c, DIAL_ICON_SIZE as l, DialDropdown as u, DialSelectField as d, DialSkeleton as f, DialSkeletonVariant as p, DialSpinner as m, FolderPath as h, GhostButton as g, GhostIconButton as _, Highlight as v, IconButton as y, LazyDialMarkdownEditor as b, NeutralButton as x, PrimaryButton as S } from "@epam/ai-dial-ui-kit";
4
- import { IconArrowLeft as C, IconArrowsSort as w, IconCalendarTime as T, IconCheck as E, IconChevronUp as D, IconDotsVertical as O, IconEdit as k, IconPlayerPlay as A, IconPlus as j, IconTrash as M } from "@tabler/icons-react";
5
- import { Suspense as N, lazy as P, useEffect as ee, useMemo as te, useRef as ne } from "react";
6
- import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
1
+ import { MDMessageViewer as e, PanelEmptyState as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
2
+ import { Input as i, SearchBar as a, Textarea as o } from "@epam/ai-dial-kit";
3
+ import { ButtonAppearance as s, ButtonDropdown as c, ButtonVariant as l, Calendar as u, CalendarMode as d, CardShell as f, DIAL_ICON_SIZE as p, DialDropdown as m, DialSelectField as h, DialSkeleton as g, DialSkeletonVariant as _, DialSpinner as v, FolderPath as y, GhostButton as b, GhostIconButton as x, Highlight as S, IconButton as C, LazyDialMarkdownEditor as w, NeutralButton as T, PrimaryButton as E } from "@epam/ai-dial-ui-kit";
4
+ import { IconAlertTriangle as D, IconArrowLeft as O, IconCalendarTime as k, IconCircleCheck as A, IconCircleX as j, IconDotsVertical as M, IconEdit as N, IconPlayerPlay as P, IconPlus as F, IconTrash as I } from "@tabler/icons-react";
5
+ import { Suspense as L, lazy as R, useEffect as ee, useMemo as te, useRef as ne } from "react";
6
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
7
7
  //#region src/models/scheduled-task-item.ts
8
- var R = /* @__PURE__ */ function(e) {
8
+ var H = /* @__PURE__ */ function(e) {
9
9
  return e.Shared = "shared", e.MyTasks = "myTasks", e;
10
- }({}), z = {
11
- title: "_title_14goq_1",
12
- description: "_description_14goq_5",
13
- schedulePill: "_schedulePill_14goq_9",
14
- scheduleLabel: "_scheduleLabel_14goq_14",
15
- locationLabel: "_locationLabel_14goq_18",
16
- locationLeaf: "_locationLeaf_14goq_22",
17
- newBadge: "_newBadge_14goq_26",
18
- locationDivider: "_locationDivider_14goq_31"
19
- }, B = ({ item: e, searchQuery: r = "", onEdit: i, onRunNow: a, onDelete: o, labels: s, styles: d, className: f }) => {
20
- let p = s?.newBadgeLabel ?? "NEW", m = s?.actionsLabel ?? "More actions", g = s?.editActionLabel ?? "Edit", _ = s?.runNowActionLabel ?? "Run now", b = s?.deleteActionLabel ?? "Delete", { colors: x, typography: S } = d ?? {}, C = S?.titleClassName ?? "dial-body-semi-text", w = S?.descriptionClassName ?? "dial-small-text", T = S?.scheduleLabelClassName ?? "dial-tiny-text", E = S?.locationLabelClassName ?? "dial-tiny-text", D = S?.locationLeafClassName ?? "dial-tiny-semi-text", j = S?.newBadgeClassName ?? "dial-tiny-semi-text", N = t({
21
- "--stc-title-text": x?.titleText,
22
- "--stc-desc-text": x?.descriptionText,
23
- "--stc-pill-bg": x?.schedulePillBackground,
24
- "--stc-pill-border": x?.schedulePillBorder,
25
- "--stc-schedule-label-text": x?.scheduleLabelText,
26
- "--stc-location-label-text": x?.locationLabelText,
27
- "--stc-location-leaf-text": x?.locationLeafText,
28
- "--stc-new-badge-bg": x?.newBadgeBackground,
29
- "--stc-new-badge-text": x?.newBadgeText,
30
- "--stc-location-divider-border": x?.locationDividerBorder
31
- }), P = [];
32
- return i && P.push({
10
+ }({}), U = {
11
+ title: "_title_1xv9i_1",
12
+ description: "_description_1xv9i_5",
13
+ schedulePill: "_schedulePill_1xv9i_9",
14
+ scheduleLabel: "_scheduleLabel_1xv9i_14",
15
+ locationLabel: "_locationLabel_1xv9i_18",
16
+ locationLeaf: "_locationLeaf_1xv9i_22",
17
+ newBadge: "_newBadge_1xv9i_26",
18
+ locationDivider: "_locationDivider_1xv9i_31"
19
+ }, W = ({ item: e, searchQuery: t = "", onEdit: i, onRunNow: a, onDelete: o, onCardClick: s, labels: c, styles: l, className: u }) => {
20
+ let d = c?.newBadgeLabel ?? "NEW", h = c?.actionsLabel ?? "More actions", g = c?.editActionLabel ?? "Edit", _ = c?.runNowActionLabel ?? "Run now", v = c?.deleteActionLabel ?? "Delete", { colors: b, typography: x } = l ?? {}, w = x?.titleClassName ?? "dial-body-semi-text", T = x?.descriptionClassName ?? "dial-small-text", E = x?.scheduleLabelClassName ?? "dial-tiny-text", D = x?.locationLabelClassName ?? "dial-tiny-text", O = x?.locationLeafClassName ?? "dial-tiny-semi-text", k = x?.newBadgeClassName ?? "dial-tiny-semi-text", A = n({
21
+ "--stc-title-text": b?.titleText,
22
+ "--stc-desc-text": b?.descriptionText,
23
+ "--stc-pill-bg": b?.schedulePillBackground,
24
+ "--stc-pill-border": b?.schedulePillBorder,
25
+ "--stc-schedule-label-text": b?.scheduleLabelText,
26
+ "--stc-location-label-text": b?.locationLabelText,
27
+ "--stc-location-leaf-text": b?.locationLeafText,
28
+ "--stc-new-badge-bg": b?.newBadgeBackground,
29
+ "--stc-new-badge-text": b?.newBadgeText,
30
+ "--stc-location-divider-border": b?.locationDividerBorder
31
+ }), j = [];
32
+ i && j.push({
33
33
  key: "edit",
34
34
  label: g,
35
- icon: /* @__PURE__ */ I(k, {
36
- size: l.SM,
35
+ icon: /* @__PURE__ */ B(N, {
36
+ size: p.SM,
37
37
  "aria-hidden": !0
38
38
  }),
39
- onClick: () => i(e.id)
40
- }), a && P.push({
39
+ onClick: ({ domEvent: t }) => {
40
+ t.stopPropagation(), i(e.id);
41
+ }
42
+ }), a && j.push({
41
43
  key: "runNow",
42
44
  label: _,
43
- icon: /* @__PURE__ */ I(A, {
44
- size: l.SM,
45
+ icon: /* @__PURE__ */ B(P, {
46
+ size: p.SM,
45
47
  "aria-hidden": !0
46
48
  }),
47
- onClick: () => a(e.id)
48
- }), o && P.push({
49
+ onClick: ({ domEvent: t }) => {
50
+ t.stopPropagation(), a(e.id);
51
+ }
52
+ }), o && j.push({
49
53
  key: "delete",
50
- label: b,
51
- icon: /* @__PURE__ */ I(M, {
52
- size: l.SM,
54
+ label: v,
55
+ icon: /* @__PURE__ */ B(I, {
56
+ size: p.SM,
53
57
  "aria-hidden": !0
54
58
  }),
55
59
  danger: !0,
56
- onClick: () => o(e.id)
57
- }), /* @__PURE__ */ L(c, {
58
- role: "group",
60
+ onClick: ({ domEvent: t }) => {
61
+ t.stopPropagation(), o(e.id);
62
+ }
63
+ });
64
+ let F = s ? {
65
+ tabIndex: 0,
66
+ onClick: () => s(e.id),
67
+ onKeyDown: (t) => {
68
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), s(e.id));
69
+ }
70
+ } : {};
71
+ return /* @__PURE__ */ V(f, {
72
+ role: s ? "button" : "group",
59
73
  "aria-label": e.displayName,
60
- style: N,
61
- className: n("h-[232px]", f),
74
+ style: A,
75
+ className: r("h-[232px]", s && "cursor-pointer", u),
76
+ ...F,
62
77
  children: [
63
- /* @__PURE__ */ L("div", {
78
+ /* @__PURE__ */ V("div", {
64
79
  className: "flex shrink-0 items-start justify-between gap-2",
65
- children: [/* @__PURE__ */ L("div", {
80
+ children: [/* @__PURE__ */ V("div", {
66
81
  className: "flex min-w-0 flex-1 items-center gap-2",
67
- children: [/* @__PURE__ */ I(v, {
82
+ children: [/* @__PURE__ */ B(S, {
68
83
  text: e.displayName,
69
- query: r,
84
+ query: t,
70
85
  maxLines: 1,
71
- className: n(C, z.title)
72
- }), e.isNew && /* @__PURE__ */ I("span", {
73
- className: n("shrink-0 rounded-full px-2 py-0.5", j, z.newBadge),
74
- children: p
86
+ className: r(w, U.title)
87
+ }), e.isNew && /* @__PURE__ */ B("span", {
88
+ className: r("shrink-0 rounded-full px-2 py-0.5", k, U.newBadge),
89
+ children: d
75
90
  })]
76
- }), P.length > 0 && /* @__PURE__ */ I(u, {
77
- items: P,
91
+ }), j.length > 0 && /* @__PURE__ */ B(m, {
92
+ items: j,
78
93
  matchReferenceWidth: !1,
79
94
  placement: "bottom-end",
80
- children: /* @__PURE__ */ I(y, {
81
- icon: /* @__PURE__ */ I(O, {
82
- size: l.SM,
95
+ children: /* @__PURE__ */ B(C, {
96
+ icon: /* @__PURE__ */ B(M, {
97
+ size: p.SM,
83
98
  "aria-hidden": !0
84
99
  }),
85
- "aria-label": m,
86
- className: "shrink-0"
100
+ "aria-label": h,
101
+ className: "shrink-0",
102
+ onClick: (e) => e.stopPropagation()
87
103
  })
88
104
  })]
89
105
  }),
90
- e.descriptionPreview && /* @__PURE__ */ I("p", {
91
- className: n("line-clamp-4 min-h-0 flex-1 overflow-hidden !leading-[22px]", w, z.description),
106
+ e.descriptionPreview && /* @__PURE__ */ B("p", {
107
+ className: r("line-clamp-4 min-h-0 flex-1 overflow-hidden !leading-[22px]", T, U.description),
92
108
  children: e.descriptionPreview
93
109
  }),
94
- /* @__PURE__ */ L("div", {
110
+ /* @__PURE__ */ V("div", {
95
111
  className: "mt-auto flex shrink-0 flex-col gap-3",
96
- children: [/* @__PURE__ */ I("div", {
112
+ children: [/* @__PURE__ */ B("div", {
97
113
  className: "flex min-h-[28px] items-center",
98
- children: /* @__PURE__ */ I("span", {
99
- className: n("inline-block rounded-lg border px-2 py-1", z.schedulePill, T, z.scheduleLabel),
114
+ children: /* @__PURE__ */ B("span", {
115
+ className: r("inline-block rounded-lg border px-2 py-1", U.schedulePill, E, U.scheduleLabel),
100
116
  children: e.scheduleLabel
101
117
  })
102
- }), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */ I(h, {
118
+ }), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */ B(y, {
103
119
  segments: e.locationSegments,
104
- labelClassName: n(E, z.locationLabel),
105
- leafClassName: n(D, z.locationLeaf),
106
- className: n("pt-3", z.locationDivider)
120
+ labelClassName: r(D, U.locationLabel),
121
+ leafClassName: r(O, U.locationLeaf),
122
+ className: r("pt-3", U.locationDivider)
107
123
  })]
108
124
  })
109
125
  ]
110
126
  });
111
- }, V = { card: "_card_1a43j_1" }, H = [
127
+ }, G = { card: "_card_1a43j_1" }, re = [
112
128
  "100%",
113
129
  "100%",
114
130
  "61%"
115
- ], U = "var(--stcs-skeleton-bg)", W = ({ styles: e }) => /* @__PURE__ */ L(c, {
131
+ ], K = "var(--stcs-skeleton-bg)", ie = ({ styles: e }) => /* @__PURE__ */ V(f, {
116
132
  "aria-hidden": !0,
117
- style: t({ "--stcs-skeleton-bg": e?.colors?.skeletonColor }),
118
- className: n("h-[232px]", V.card),
133
+ style: n({ "--stcs-skeleton-bg": e?.colors?.skeletonColor }),
134
+ className: r("h-[232px]", G.card),
119
135
  children: [
120
- /* @__PURE__ */ I(f, {
121
- variant: p.Rectangular,
136
+ /* @__PURE__ */ B(g, {
137
+ variant: _.Rectangular,
122
138
  width: "60%",
123
139
  height: "20px",
124
- color: U,
140
+ color: K,
125
141
  className: "shrink-0"
126
142
  }),
127
- /* @__PURE__ */ I("div", {
143
+ /* @__PURE__ */ B("div", {
128
144
  className: "flex min-h-0 flex-1 flex-col gap-3 overflow-hidden",
129
- children: H.map((e, t) => /* @__PURE__ */ I(f, {
130
- variant: p.Rectangular,
145
+ children: re.map((e, t) => /* @__PURE__ */ B(g, {
146
+ variant: _.Rectangular,
131
147
  width: e,
132
148
  height: "16px",
133
- color: U
149
+ color: K
134
150
  }, t))
135
151
  }),
136
- /* @__PURE__ */ I(f, {
137
- variant: p.Rectangular,
152
+ /* @__PURE__ */ B(g, {
153
+ variant: _.Rectangular,
138
154
  width: "110px",
139
155
  height: "28px",
140
- color: U,
156
+ color: K,
141
157
  className: "shrink-0 rounded-lg"
142
158
  })
143
159
  ]
144
- }), G = ({ items: e, searchQuery: t, onEdit: n, onRunNow: r, onDelete: i, labels: a, cardStyles: o, trailingSkeletonCount: s = 0, skeletonStyles: c }) => /* @__PURE__ */ L("div", {
160
+ }), ae = ({ items: e, searchQuery: t, onEdit: n, onRunNow: r, onDelete: i, onCardClick: a, labels: o, cardStyles: s, trailingSkeletonCount: c = 0, skeletonStyles: l }) => /* @__PURE__ */ V("div", {
145
161
  className: "grid grid-cols-1 gap-5 desktop:grid-cols-3",
146
- children: [e.map((e) => /* @__PURE__ */ I(B, {
162
+ children: [e.map((e) => /* @__PURE__ */ B(W, {
147
163
  item: e,
148
164
  searchQuery: t,
149
165
  onEdit: n,
150
166
  onRunNow: r,
151
167
  onDelete: i,
152
- labels: a,
153
- styles: o
154
- }, e.id)), Array.from({ length: s }, (e, t) => /* @__PURE__ */ I(W, { styles: c }, `skeleton-${t}`))]
155
- }), K = { countBadge: "_countBadge_5ysac_1" }, q = ({ title: e, count: r, children: i, styles: a }) => {
156
- let o = a?.typography?.titleClassName ?? "dial-small-semi-text", s = a?.typography?.countBadgeClassName ?? "dial-tiny-text", c = t({
168
+ onCardClick: a,
169
+ labels: o,
170
+ styles: s
171
+ }, e.id)), Array.from({ length: c }, (e, t) => /* @__PURE__ */ B(ie, { styles: l }, `skeleton-${t}`))]
172
+ }), oe = { countBadge: "_countBadge_4bnxj_1" }, se = ({ title: e, count: t, children: i, styles: a }) => {
173
+ let o = a?.typography?.titleClassName ?? "dial-small-semi-text", s = a?.typography?.countBadgeClassName ?? "dial-tiny-text", c = n({
157
174
  "--sts-badge-bg": a?.colors?.countBadgeBackground,
158
175
  "--sts-badge-text": a?.colors?.countBadgeText
159
176
  });
160
- return /* @__PURE__ */ L("section", {
177
+ return /* @__PURE__ */ V("section", {
161
178
  ...e ? { "aria-label": e } : {},
162
179
  style: c,
163
180
  className: "flex flex-col gap-3",
164
- children: [e && /* @__PURE__ */ L("div", {
181
+ children: [e && /* @__PURE__ */ V("div", {
165
182
  className: "flex items-center gap-2 rtl:flex-row-reverse",
166
- children: [/* @__PURE__ */ I("h2", {
183
+ children: [/* @__PURE__ */ B("h2", {
167
184
  className: o,
168
185
  children: e
169
- }), /* @__PURE__ */ I("span", {
170
- className: n("rounded-full px-2 py-0.5", s, K.countBadge),
171
- children: r
186
+ }), /* @__PURE__ */ B("span", {
187
+ className: r("rounded-full px-2 py-0.5", s, oe.countBadge),
188
+ children: t
172
189
  })]
173
190
  }), i]
174
191
  });
175
- }, J = {
176
- container: "_container_sac6a_1",
177
- subtitle: "_subtitle_sac6a_5",
178
- sortButton: "_sortButton_sac6a_9"
179
- }, re = [R.Shared, R.MyTasks], ie = (e, t, n, r, i, a) => {
192
+ }, q = {
193
+ container: "_container_r5sk9_1",
194
+ subtitle: "_subtitle_r5sk9_5",
195
+ sortButton: "_sortButton_r5sk9_9"
196
+ }, ce = [H.Shared, H.MyTasks], le = (e, t, n, r, i, a) => {
180
197
  if (!e) return t ? a.loadingMoreLabel : n ? a.errorLabel : r > 0 ? `${r}` : i ? a.noResultsLabel : a.emptyStateLabel;
181
- }, ae = (e) => {
198
+ }, ue = (e) => {
182
199
  if (!e || e === document.body) return null;
183
200
  let { overflow: t, overflowY: n } = getComputedStyle(e);
184
- return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : ae(e.parentElement);
185
- }, oe = ({ labels: r, onCreateClick: a, searchQuery: o, onSearchQueryChange: s, sortKey: c, onSortChange: d, items: f, isLoading: p = !1, error: h, onRetry: _, hasMore: v = !1, isLoadingMore: y = !1, skeletonCount: b = 6, onLoadMore: x, onEdit: C, onRunNow: O, onDelete: k, styles: A }) => {
186
- let { colors: M, typography: N, emptyStateIconSize: P = 48 } = A ?? {}, F = N?.titleClassName ?? "dial-h1-text", z = N?.subtitleClassName ?? "dial-body-text", B = t({
187
- "--st-bg": M?.background,
188
- "--st-subtitle-text": M?.subtitleText,
189
- "--st-sort-text": M?.sortButtonText
190
- }), V = r.sortOptions.find((e) => e.key === c)?.label ?? "", H = te(() => {
191
- let e = { [R.Shared]: r.sharedSectionTitle };
192
- return re.map((t) => ({
193
- key: t,
194
- title: e[t],
195
- items: f.filter((e) => e.sectionKey === t)
201
+ return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : ue(e.parentElement);
202
+ }, de = ({ labels: e, onCreateClick: i, searchQuery: o, onSearchQueryChange: u, sortKey: d, onSortChange: f, items: m, isLoading: h = !1, error: g, onRetry: _, hasMore: y = !1, isLoadingMore: x = !1, skeletonCount: S = 6, onLoadMore: C, onEdit: w, onRunNow: T, onDelete: D, onCardClick: O, styles: A }) => {
203
+ let { colors: j, typography: M, emptyStateIconSize: N = 48 } = A ?? {}, P = M?.titleClassName ?? "dial-h1-text", I = M?.subtitleClassName ?? "dial-body-text", L = n({
204
+ "--st-bg": j?.background,
205
+ "--st-subtitle-text": j?.subtitleText,
206
+ "--st-sort-text": j?.sortButtonText
207
+ }), R = e.sortOptions.find((e) => e.key === d)?.label ?? "", z = te(() => {
208
+ let t = { [H.Shared]: e.sharedSectionTitle };
209
+ return ce.map((e) => ({
210
+ key: e,
211
+ title: t[e],
212
+ items: m.filter((t) => t.sectionKey === e)
196
213
  })).filter((e) => e.items.length > 0);
197
- }, [f, r.sharedSectionTitle]), U = ie(p, y, !!h, f.length, o.trim().length > 0, r), W = ne(null);
214
+ }, [m, e.sharedSectionTitle]), U = le(h, x, !!g, m.length, o.trim().length > 0, e), W = ne(null);
198
215
  ee(() => {
199
216
  let e = W.current;
200
- if (!e || !x) return;
201
- let t = ae(e.parentElement);
217
+ if (!e || !C) return;
218
+ let t = ue(e.parentElement);
202
219
  if (!t) return;
203
220
  let n = () => {
204
- if (y || p || !v) return;
221
+ if (x || h || !y) return;
205
222
  let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
206
- r.top < n.bottom && r.bottom > n.top && x();
223
+ r.top < n.bottom && r.bottom > n.top && C();
207
224
  };
208
225
  return t.addEventListener("scroll", n, { passive: !0 }), n(), () => t.removeEventListener("scroll", n);
209
226
  }, [
210
- v,
211
227
  y,
212
- p,
213
- x
228
+ x,
229
+ h,
230
+ C
214
231
  ]);
215
- let K = () => {
216
- if (p) return /* @__PURE__ */ I(m, {});
217
- if (h) return /* @__PURE__ */ L("div", {
232
+ let G = () => {
233
+ if (h) return /* @__PURE__ */ B(v, {});
234
+ if (g) return /* @__PURE__ */ V("div", {
218
235
  className: "flex flex-col items-center gap-3",
219
- children: [/* @__PURE__ */ I("p", {
220
- className: n(z, J.subtitle),
221
- children: r.errorLabel
222
- }), /* @__PURE__ */ I(g, {
223
- label: r.retryLabel,
236
+ children: [/* @__PURE__ */ B("p", {
237
+ className: r(I, q.subtitle),
238
+ children: e.errorLabel
239
+ }), /* @__PURE__ */ B(b, {
240
+ label: e.retryLabel,
224
241
  onClick: _
225
242
  })]
226
243
  });
227
- if (f.length === 0) return o.trim() ? /* @__PURE__ */ I("p", {
228
- className: n(z, J.subtitle),
229
- children: r.noResultsLabel
230
- }) : /* @__PURE__ */ I(e, {
231
- icon: /* @__PURE__ */ I(T, {
244
+ if (m.length === 0) return o.trim() ? /* @__PURE__ */ B("p", {
245
+ className: r(I, q.subtitle),
246
+ children: e.noResultsLabel
247
+ }) : /* @__PURE__ */ B(t, {
248
+ icon: /* @__PURE__ */ B(k, {
232
249
  "aria-hidden": !0,
233
- size: P,
250
+ size: N,
234
251
  stroke: 1
235
252
  }),
236
- label: r.emptyStateLabel
253
+ label: e.emptyStateLabel
237
254
  });
238
- let t = H.length - 1;
239
- return /* @__PURE__ */ L("div", {
255
+ let n = z.length - 1;
256
+ return /* @__PURE__ */ V("div", {
240
257
  className: "flex w-full flex-col gap-6",
241
- children: [H.map((e, n) => /* @__PURE__ */ I(q, {
242
- title: e.title,
243
- count: e.items.length,
244
- children: /* @__PURE__ */ I(G, {
245
- items: e.items,
258
+ children: [z.map((t, r) => /* @__PURE__ */ B(se, {
259
+ title: t.title,
260
+ count: t.items.length,
261
+ children: /* @__PURE__ */ B(ae, {
262
+ items: t.items,
246
263
  searchQuery: o,
247
- onEdit: C,
248
- onRunNow: O,
249
- onDelete: k,
250
- labels: r.cardLabels,
251
- trailingSkeletonCount: y && n === t ? b : 0,
252
- skeletonStyles: { colors: { skeletonColor: M?.skeletonColor } }
264
+ onEdit: w,
265
+ onRunNow: T,
266
+ onDelete: D,
267
+ onCardClick: O,
268
+ labels: e.cardLabels,
269
+ trailingSkeletonCount: x && r === n ? S : 0,
270
+ skeletonStyles: { colors: { skeletonColor: j?.skeletonColor } }
253
271
  })
254
- }, e.key)), /* @__PURE__ */ I("div", {
272
+ }, t.key)), /* @__PURE__ */ B("div", {
255
273
  ref: W,
256
274
  "aria-hidden": !0,
257
275
  className: "h-px w-full"
258
276
  })]
259
277
  });
260
- }, oe = p || !!h || f.length === 0;
261
- return /* @__PURE__ */ L("div", {
262
- style: B,
263
- className: n("flex h-full w-full flex-col gap-6 overflow-y-auto px-8 py-4", J.container),
278
+ }, re = h || !!g || m.length === 0;
279
+ return /* @__PURE__ */ V("div", {
280
+ style: L,
281
+ className: r("flex h-full w-full flex-col gap-6 overflow-y-auto px-8 py-4", q.container),
264
282
  children: [
265
- /* @__PURE__ */ L("div", {
283
+ /* @__PURE__ */ V("div", {
266
284
  className: "flex items-start justify-between gap-4",
267
- children: [/* @__PURE__ */ L("div", {
285
+ children: [/* @__PURE__ */ V("div", {
268
286
  className: "min-w-0 gap-2",
269
- children: [/* @__PURE__ */ I("h1", {
270
- className: n("truncate", F),
271
- children: r.title
272
- }), /* @__PURE__ */ I("p", {
273
- className: n("mt-1", z, J.subtitle),
274
- children: r.subtitle
287
+ children: [/* @__PURE__ */ B("h1", {
288
+ className: r("truncate", P),
289
+ children: e.title
290
+ }), /* @__PURE__ */ B("p", {
291
+ className: r("mt-1", I, q.subtitle),
292
+ children: e.subtitle
275
293
  })]
276
- }), /* @__PURE__ */ I(S, {
277
- label: r.createButtonLabel,
278
- iconBefore: /* @__PURE__ */ I(j, {
279
- size: l.SM,
294
+ }), /* @__PURE__ */ B(E, {
295
+ label: e.createButtonLabel,
296
+ iconBefore: /* @__PURE__ */ B(F, {
297
+ size: p.SM,
280
298
  "aria-hidden": !0
281
299
  }),
282
- onClick: a,
300
+ onClick: i,
283
301
  className: "shrink-0"
284
302
  })]
285
303
  }),
286
- /* @__PURE__ */ L("div", {
304
+ /* @__PURE__ */ V("div", {
287
305
  className: "flex flex-wrap items-center gap-3",
288
- children: [/* @__PURE__ */ I("div", {
306
+ children: [/* @__PURE__ */ B("div", {
289
307
  className: "flex-1",
290
- children: /* @__PURE__ */ I(i, {
308
+ children: /* @__PURE__ */ B(a, {
291
309
  value: o,
292
- onChange: s,
310
+ onChange: u,
293
311
  labels: {
294
- placeholder: r.searchPlaceholder,
295
- ariaLabel: r.searchAriaLabel,
296
- clearLabel: r.clearSearchLabel
312
+ placeholder: e.searchPlaceholder,
313
+ ariaLabel: e.searchAriaLabel,
314
+ clearLabel: e.clearSearchLabel
297
315
  },
298
316
  iconSize: 18,
299
317
  iconStrokeWidth: 1.8,
@@ -303,292 +321,568 @@ var R = /* @__PURE__ */ function(e) {
303
321
  clearButtonClassName: "size-11 desktop:size-auto"
304
322
  }
305
323
  })
306
- }), r.sortOptions.length > 0 && /* @__PURE__ */ I(u, {
307
- matchReferenceWidth: !1,
308
- placement: "bottom-end",
309
- listClassName: "cp-dropdown-overlay",
310
- items: r.sortOptions.map((e) => ({
311
- key: e.key,
312
- label: /* @__PURE__ */ L("span", {
313
- className: "flex w-full items-center justify-between gap-2",
314
- children: [e.label, e.key === c && /* @__PURE__ */ I(E, {
315
- size: l.SM,
316
- "aria-hidden": !0
317
- })]
318
- }),
319
- onClick: () => d(e.key)
320
- })),
321
- children: /* @__PURE__ */ I(g, {
322
- label: V,
323
- "aria-label": r.sortLabel,
324
- className: n("rounded-[4px]", J.sortButton),
325
- iconBefore: /* @__PURE__ */ I(w, {
326
- size: 20,
327
- "aria-hidden": !0
328
- }),
329
- iconAfter: /* @__PURE__ */ I(D, {
330
- size: 20,
331
- "aria-hidden": !0
332
- })
333
- })
324
+ }), e.sortOptions.length > 0 && /* @__PURE__ */ B(c, {
325
+ label: R,
326
+ variant: l.Primary,
327
+ appearance: s.Ghost,
328
+ items: e.sortOptions.map((e) => ({
329
+ ...e,
330
+ onClick: () => f(e.key)
331
+ }))
334
332
  })]
335
333
  }),
336
- /* @__PURE__ */ I("span", {
334
+ /* @__PURE__ */ B("span", {
337
335
  role: "status",
338
336
  "aria-live": "polite",
339
337
  className: "sr-only",
340
338
  children: U
341
339
  }),
342
- /* @__PURE__ */ I("div", {
343
- className: n("mx-auto flex size-full w-full max-w-[1180px] flex-col", oe && "items-center justify-center"),
344
- children: K()
340
+ /* @__PURE__ */ B("div", {
341
+ className: r("mx-auto flex size-full w-full max-w-[1180px] flex-col", re && "items-center justify-center"),
342
+ children: G()
345
343
  })
346
344
  ]
347
345
  });
348
- }, se = /* @__PURE__ */ function(e) {
346
+ }, fe = /* @__PURE__ */ function(e) {
349
347
  return e.FirstToRun = "firstToRun", e.LastToRun = "lastToRun", e.Newest = "newest", e.NameAZ = "nameAZ", e;
350
- }({}), ce = 500, Y = /* @__PURE__ */ function(e) {
348
+ }({}), pe = 500, J = /* @__PURE__ */ function(e) {
351
349
  return e.Once = "once", e.Recurring = "recurring", e;
352
- }({}), X = /* @__PURE__ */ function(e) {
350
+ }({}), Y = /* @__PURE__ */ function(e) {
353
351
  return e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e;
354
- }({}), Z = (e) => String(e).padStart(2, "0"), le = (e) => e ? new Date(e) : null, ue = (e) => {
352
+ }({}), X = (e) => String(e).padStart(2, "0"), me = (e) => e ? new Date(e) : null, he = (e) => {
353
+ if (e == null) return "";
354
+ let t = e instanceof Date ? e : new Date(e);
355
+ return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${X(t.getMonth() + 1)}-${X(t.getDate())}T${X(t.getHours())}:${X(t.getMinutes())}`;
356
+ }, ge = (e) => {
357
+ if (!e) return null;
358
+ let [t, n, r] = e.split("-").map(Number);
359
+ return new Date(t, n - 1, r);
360
+ }, _e = (e) => {
355
361
  if (e == null) return "";
356
362
  let t = e instanceof Date ? e : new Date(e);
357
- return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${Z(t.getMonth() + 1)}-${Z(t.getDate())}T${Z(t.getHours())}:${Z(t.getMinutes())}`;
358
- }, de = (e) => {
363
+ return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${X(t.getMonth() + 1)}-${X(t.getDate())}`;
364
+ }, ve = (e) => {
359
365
  let t = Number(e);
360
366
  return e && Number.isFinite(t) ? String(t + 1) : null;
361
- }, fe = (e) => {
367
+ }, ye = (e) => {
362
368
  let t = typeof e == "string" ? Number(e) : NaN;
363
369
  return Number.isFinite(t) ? String(t - 1) : "";
364
- }, Q = {
365
- container: "_container_1wply_1",
366
- header: "_header_1wply_5",
367
- detailsColumn: "_detailsColumn_1wply_9",
368
- sectionSubtitle: "_sectionSubtitle_1wply_13",
369
- instructionsError: "_instructionsError_1wply_17"
370
- }, $ = (e) => `${e} *`, pe = P(async () => ({ default: (await b()).DialMarkdownEditor })), me = ({ labels: e, values: i, errors: c, modelOptions: u, onFieldChange: f, onBack: p, onCancel: h, onSubmit: g, isSubmitting: v = !1, markdownEditorTheme: y, styles: b }) => {
371
- let { colors: w, typography: T } = b ?? {}, E = T?.titleClassName ?? "dial-h1-text", D = T?.sectionTitleClassName ?? "dial-body-semi-text", O = T?.sectionSubtitleClassName ?? "dial-tiny-text", k = T?.scheduleSectionLabelClassName ?? "dial-body-semi-text mb-1", A = T?.instructionsErrorClassName ?? "dial-small-text", j = t({
372
- "--stcf-bg": w?.background,
373
- "--stcf-header-border": w?.headerBorder,
374
- "--stcf-details-border": w?.detailsColumnBorder,
375
- "--stcf-subtitle-text": w?.sectionSubtitleText,
376
- "--stcf-error-text": w?.instructionsErrorText
377
- }), M = v || !i.displayName.trim() || !i.modelId || !i.prompt.trim();
378
- return /* @__PURE__ */ L("div", {
370
+ }, Z = {
371
+ container: "_container_sq3dp_1",
372
+ header: "_header_sq3dp_5",
373
+ detailsColumn: "_detailsColumn_sq3dp_9",
374
+ sectionSubtitle: "_sectionSubtitle_sq3dp_13",
375
+ instructionsError: "_instructionsError_sq3dp_17"
376
+ }, be = (e) => `${e} *`, xe = R(async () => ({ default: (await w()).DialMarkdownEditor })), Se = ({ labels: e, values: t, errors: a, modelOptions: s, onFieldChange: c, onBack: l, onCancel: f, onSubmit: m, isSubmitting: g = !1, markdownEditorTheme: _, styles: y }) => {
377
+ let { colors: b, typography: S } = y ?? {}, C = S?.titleClassName ?? "dial-h1-text", w = S?.sectionTitleClassName ?? "dial-body-semi-text", D = S?.sectionSubtitleClassName ?? "dial-tiny-text", k = S?.scheduleSectionLabelClassName ?? "dial-body-semi-text mb-1", A = S?.instructionsErrorClassName ?? "dial-small-text", j = n({
378
+ "--stcf-bg": b?.background,
379
+ "--stcf-header-border": b?.headerBorder,
380
+ "--stcf-details-border": b?.detailsColumnBorder,
381
+ "--stcf-subtitle-text": b?.sectionSubtitleText,
382
+ "--stcf-error-text": b?.instructionsErrorText
383
+ }), M = g || !t.displayName.trim() || !t.modelId || !t.prompt.trim();
384
+ return /* @__PURE__ */ V("div", {
379
385
  style: j,
380
- className: n("flex h-full w-full flex-col overflow-y-auto", Q.container),
381
- children: [/* @__PURE__ */ L("div", {
382
- className: n("flex h-16 items-center justify-between gap-6 border-b px-8", Q.header),
383
- children: [/* @__PURE__ */ L("div", {
386
+ className: r("flex h-full w-full flex-col overflow-y-auto", Z.container),
387
+ children: [/* @__PURE__ */ V("div", {
388
+ className: r("flex h-16 items-center justify-between gap-6 border-b px-8", Z.header),
389
+ children: [/* @__PURE__ */ V("div", {
384
390
  className: "flex min-w-0 flex-1 items-center gap-2",
385
- children: [/* @__PURE__ */ I(_, {
386
- icon: /* @__PURE__ */ I(C, {
387
- size: l.LG,
391
+ children: [/* @__PURE__ */ B(x, {
392
+ icon: /* @__PURE__ */ B(O, {
393
+ size: p.LG,
388
394
  className: "rtl:scale-x-[-1]",
389
395
  "aria-hidden": !0
390
396
  }),
391
397
  "aria-label": e.backButtonLabel,
392
- onClick: p
393
- }), /* @__PURE__ */ I("h1", {
394
- className: n("truncate", E),
398
+ onClick: l
399
+ }), /* @__PURE__ */ B("h1", {
400
+ className: r("truncate", C),
395
401
  children: e.pageTitle
396
402
  })]
397
- }), /* @__PURE__ */ L("div", {
403
+ }), /* @__PURE__ */ V("div", {
398
404
  className: "flex items-center gap-2",
399
- children: [/* @__PURE__ */ I(x, {
405
+ children: [/* @__PURE__ */ B(T, {
400
406
  label: e.cancelButtonLabel,
401
- onClick: h,
402
- disabled: v
403
- }), /* @__PURE__ */ I(S, {
407
+ onClick: f,
408
+ disabled: g
409
+ }), /* @__PURE__ */ B(E, {
404
410
  label: e.createButtonLabel,
405
- onClick: g,
411
+ onClick: m,
406
412
  disabled: M
407
413
  })]
408
414
  })]
409
- }), /* @__PURE__ */ L("div", {
415
+ }), /* @__PURE__ */ V("div", {
410
416
  className: "flex flex-1 flex-col desktop:flex-row",
411
417
  children: [
412
- /* @__PURE__ */ L("div", {
418
+ /* @__PURE__ */ V("div", {
413
419
  role: "group",
414
420
  "aria-label": e.detailsSectionTitle,
415
- className: n("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", Q.detailsColumn),
421
+ className: r("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", Z.detailsColumn),
416
422
  children: [
417
- /* @__PURE__ */ L("div", {
423
+ /* @__PURE__ */ V("div", {
418
424
  className: "flex flex-col gap-1",
419
- children: [/* @__PURE__ */ I("h2", {
420
- className: D,
425
+ children: [/* @__PURE__ */ B("h2", {
426
+ className: w,
421
427
  children: e.detailsSectionTitle
422
- }), /* @__PURE__ */ I("p", {
423
- className: n(O, Q.sectionSubtitle),
428
+ }), /* @__PURE__ */ B("p", {
429
+ className: r(D, Z.sectionSubtitle),
424
430
  children: e.detailsSectionSubtitle
425
431
  })]
426
432
  }),
427
- /* @__PURE__ */ I(r, {
433
+ /* @__PURE__ */ B(i, {
428
434
  id: "scheduled-task-display-name",
429
- value: i.displayName,
430
- onChange: (e) => f("displayName", e ?? ""),
435
+ value: t.displayName,
436
+ onChange: (e) => c("displayName", e ?? ""),
431
437
  labelProps: {
432
438
  label: e.displayNameLabel,
433
439
  required: !0
434
440
  },
435
- invalid: !!c.displayName,
436
- error: c.displayName
441
+ invalid: !!a.displayName,
442
+ error: a.displayName
437
443
  }),
438
- /* @__PURE__ */ I(a, {
444
+ /* @__PURE__ */ B(o, {
439
445
  id: "scheduled-task-description",
440
- value: i.description ?? "",
441
- onChange: (e) => f("description", e),
446
+ value: t.description ?? "",
447
+ onChange: (e) => c("description", e),
442
448
  labelProps: { label: e.descriptionLabel },
443
449
  maxLength: 500,
444
- invalid: !!c.description,
445
- error: c.description,
446
- caption: i.description ? `${i.description.length}/500` : void 0
450
+ invalid: !!a.description,
451
+ error: a.description,
452
+ caption: t.description ? `${t.description.length}/500` : void 0
447
453
  }),
448
- /* @__PURE__ */ I(d, {
454
+ /* @__PURE__ */ B(h, {
449
455
  label: e.modelOrAgentLabel,
450
456
  required: !0,
451
- value: i.modelId,
457
+ value: t.modelId,
452
458
  placeholder: e.modelPlaceholder,
453
- onChange: (e) => f("modelId", e),
454
- error: c.modelId,
455
- options: u.map((e) => ({
459
+ onChange: (e) => c("modelId", e),
460
+ error: a.modelId,
461
+ options: s.map((e) => ({
456
462
  value: e.id,
457
463
  label: e.label
458
464
  }))
459
465
  }),
460
- /* @__PURE__ */ L("fieldset", {
466
+ /* @__PURE__ */ V("fieldset", {
461
467
  className: "flex flex-col gap-3",
462
468
  children: [
463
- /* @__PURE__ */ I("legend", {
469
+ /* @__PURE__ */ B("legend", {
464
470
  className: k,
465
471
  children: e.scheduleSectionLabel
466
472
  }),
467
- /* @__PURE__ */ I(d, {
473
+ /* @__PURE__ */ B(h, {
468
474
  label: e.scheduleTypeAriaLabel,
469
- value: i.scheduleType,
470
- onChange: (e) => f("scheduleType", e),
475
+ value: t.scheduleType,
476
+ onChange: (e) => c("scheduleType", e),
471
477
  options: [{
472
- value: Y.Once,
478
+ value: J.Once,
473
479
  label: e.scheduleTypeOnceLabel
474
480
  }, {
475
- value: Y.Recurring,
481
+ value: J.Recurring,
476
482
  label: e.scheduleTypeRecurringLabel
477
483
  }]
478
484
  }),
479
- i.scheduleType === Y.Once && /* @__PURE__ */ L("div", {
485
+ t.scheduleType === J.Once && /* @__PURE__ */ V("div", {
480
486
  className: "flex flex-col gap-1",
481
- children: [/* @__PURE__ */ I(o, {
487
+ children: [/* @__PURE__ */ B(u, {
482
488
  id: "scheduled-task-run-at",
483
- mode: s.DateTime,
484
- value: le(i.runAt),
485
- onChange: (e) => f("runAt", ue(e)),
486
- label: $(e.runAtLabel),
487
- invalid: !!c.runAt
488
- }), c.runAt && /* @__PURE__ */ I("p", {
489
- className: n(A, Q.instructionsError),
490
- children: c.runAt
489
+ mode: d.DateTime,
490
+ value: me(t.runAt),
491
+ onChange: (e) => c("runAt", he(e)),
492
+ label: be(e.runAtLabel),
493
+ invalid: !!a.runAt
494
+ }), a.runAt && /* @__PURE__ */ B("p", {
495
+ className: r(A, Z.instructionsError),
496
+ children: a.runAt
491
497
  })]
492
498
  }),
493
- i.scheduleType === Y.Recurring && /* @__PURE__ */ L(F, { children: [
494
- /* @__PURE__ */ I(d, {
499
+ t.scheduleType === J.Recurring && /* @__PURE__ */ V(z, { children: [
500
+ /* @__PURE__ */ B(h, {
495
501
  label: e.frequencyLabel,
496
- value: i.frequency,
497
- onChange: (e) => f("frequency", e),
502
+ value: t.frequency,
503
+ onChange: (e) => c("frequency", e),
498
504
  options: e.frequencyOptions.map((e) => ({
499
505
  value: e.key,
500
506
  label: e.label
501
507
  }))
502
508
  }),
503
- /* @__PURE__ */ L("div", {
509
+ /* @__PURE__ */ V("div", {
504
510
  className: "flex flex-col gap-1",
505
- children: [/* @__PURE__ */ I(o, {
511
+ children: [/* @__PURE__ */ B(u, {
506
512
  id: "scheduled-task-time",
507
- mode: s.Time,
508
- value: i.time,
509
- onChange: (e) => f("time", typeof e == "string" ? e : ""),
510
- label: $(e.timeLabel),
511
- invalid: !!c.time
512
- }), c.time && /* @__PURE__ */ I("p", {
513
- className: n(A, Q.instructionsError),
514
- children: c.time
513
+ mode: d.Time,
514
+ value: t.time,
515
+ onChange: (e) => c("time", typeof e == "string" ? e : ""),
516
+ label: be(e.timeLabel),
517
+ invalid: !!a.time
518
+ }), a.time && /* @__PURE__ */ B("p", {
519
+ className: r(A, Z.instructionsError),
520
+ children: a.time
515
521
  })]
516
522
  }),
517
- i.frequency === X.Weekly && /* @__PURE__ */ L("div", {
523
+ t.frequency === Y.Weekly && /* @__PURE__ */ V("div", {
518
524
  className: "flex flex-col gap-1",
519
- children: [/* @__PURE__ */ I(o, {
525
+ children: [/* @__PURE__ */ B(u, {
520
526
  id: "scheduled-task-day-of-week",
521
- mode: s.Weekday,
522
- value: de(i.dayOfWeek),
523
- onChange: (e) => f("dayOfWeek", fe(e)),
524
- label: $(e.dayOfWeekLabel),
525
- invalid: !!c.dayOfWeek
526
- }), c.dayOfWeek && /* @__PURE__ */ I("p", {
527
- className: n(A, Q.instructionsError),
528
- children: c.dayOfWeek
527
+ mode: d.Weekday,
528
+ value: ve(t.dayOfWeek),
529
+ onChange: (e) => c("dayOfWeek", ye(e)),
530
+ label: be(e.dayOfWeekLabel),
531
+ invalid: !!a.dayOfWeek
532
+ }), a.dayOfWeek && /* @__PURE__ */ B("p", {
533
+ className: r(A, Z.instructionsError),
534
+ children: a.dayOfWeek
529
535
  })]
530
536
  }),
531
- i.frequency === X.Monthly && /* @__PURE__ */ I(r, {
537
+ t.frequency === Y.Monthly && /* @__PURE__ */ B(i, {
532
538
  id: "scheduled-task-day-of-month",
533
- value: i.dayOfMonth ?? "",
534
- onChange: (e) => f("dayOfMonth", e ?? ""),
539
+ value: t.dayOfMonth ?? "",
540
+ onChange: (e) => c("dayOfMonth", e ?? ""),
535
541
  labelProps: {
536
542
  label: e.dayOfMonthLabel,
537
543
  required: !0
538
544
  },
539
- invalid: !!c.dayOfMonth,
540
- error: c.dayOfMonth
545
+ invalid: !!a.dayOfMonth,
546
+ error: a.dayOfMonth
547
+ }),
548
+ /* @__PURE__ */ V("div", {
549
+ className: "flex flex-col gap-3 desktop:flex-row",
550
+ children: [/* @__PURE__ */ V("div", {
551
+ className: "flex flex-1 flex-col gap-1",
552
+ children: [/* @__PURE__ */ B(u, {
553
+ id: "scheduled-task-start-date",
554
+ mode: d.Date,
555
+ value: ge(t.startDate),
556
+ onChange: (e) => c("startDate", _e(e)),
557
+ label: e.startDateLabel,
558
+ placeholder: e.startDatePlaceholder,
559
+ invalid: !!a.startDate
560
+ }), a.startDate && /* @__PURE__ */ B("p", {
561
+ className: r(A, Z.instructionsError),
562
+ children: a.startDate
563
+ })]
564
+ }), /* @__PURE__ */ V("div", {
565
+ className: "flex flex-1 flex-col gap-1",
566
+ children: [/* @__PURE__ */ B(u, {
567
+ id: "scheduled-task-end-date",
568
+ mode: d.Date,
569
+ value: ge(t.endDate),
570
+ onChange: (e) => c("endDate", _e(e)),
571
+ label: e.endDateLabel,
572
+ placeholder: e.endDatePlaceholder,
573
+ invalid: !!a.endDate
574
+ }), a.endDate && /* @__PURE__ */ B("p", {
575
+ className: r(A, Z.instructionsError),
576
+ children: a.endDate
577
+ })]
578
+ })]
541
579
  })
542
580
  ] })
543
581
  ]
544
582
  })
545
583
  ]
546
584
  }),
547
- /* @__PURE__ */ L("div", {
585
+ /* @__PURE__ */ V("div", {
548
586
  role: "group",
549
587
  "aria-label": e.configurationSectionTitle,
550
588
  className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
551
- children: [/* @__PURE__ */ L("div", {
589
+ children: [/* @__PURE__ */ V("div", {
552
590
  className: "flex flex-col gap-1",
553
- children: [/* @__PURE__ */ I("h2", {
554
- className: D,
591
+ children: [/* @__PURE__ */ B("h2", {
592
+ className: w,
555
593
  children: e.configurationSectionTitle
556
- }), /* @__PURE__ */ I("p", {
557
- className: n(O, Q.sectionSubtitle),
594
+ }), /* @__PURE__ */ B("p", {
595
+ className: r(D, Z.sectionSubtitle),
558
596
  children: e.configurationSectionSubtitle
559
597
  })]
560
- }), /* @__PURE__ */ L("div", {
598
+ }), /* @__PURE__ */ V("div", {
561
599
  role: "group",
562
600
  "aria-label": e.instructionsLabel,
563
601
  className: "flex flex-1 flex-col gap-1",
564
602
  children: [
565
- /* @__PURE__ */ I("span", {
603
+ /* @__PURE__ */ B("span", {
566
604
  className: k,
567
605
  children: e.instructionsLabel
568
606
  }),
569
- /* @__PURE__ */ I(N, {
570
- fallback: /* @__PURE__ */ I(m, {}),
571
- children: /* @__PURE__ */ I(pe, {
572
- value: i.prompt,
573
- onChange: (e) => f("prompt", e),
607
+ /* @__PURE__ */ B(L, {
608
+ fallback: /* @__PURE__ */ B(v, {}),
609
+ children: /* @__PURE__ */ B(xe, {
610
+ value: t.prompt,
611
+ onChange: (e) => c("prompt", e),
574
612
  height: 480,
575
- theme: y
613
+ theme: _
576
614
  })
577
615
  }),
578
- c.prompt && /* @__PURE__ */ I("p", {
579
- className: n(A, Q.instructionsError),
580
- children: c.prompt
616
+ a.prompt && /* @__PURE__ */ B("p", {
617
+ className: r(A, Z.instructionsError),
618
+ children: a.prompt
581
619
  })
582
620
  ]
583
621
  })]
584
622
  }),
585
- /* @__PURE__ */ I("div", {
623
+ /* @__PURE__ */ B("div", {
586
624
  "aria-hidden": !0,
587
625
  className: "hidden desktop:block desktop:w-[360px] desktop:shrink-0"
588
626
  })
589
627
  ]
590
628
  })]
591
629
  });
630
+ }, Q = /* @__PURE__ */ function(e) {
631
+ return e.Success = "success", e.Error = "error", e.InProgress = "inProgress", e.Missed = "missed", e;
632
+ }({}), $ = {
633
+ container: "_container_1ci42_1",
634
+ header: "_header_1ci42_5",
635
+ detailsColumn: "_detailsColumn_1ci42_9",
636
+ subtitleText: "_subtitleText_1ci42_13",
637
+ successIcon: "_successIcon_1ci42_17",
638
+ errorIcon: "_errorIcon_1ci42_21",
639
+ missedIcon: "_missedIcon_1ci42_25",
640
+ historyCard: "_historyCard_1ci42_29"
641
+ }, Ce = (e) => {
642
+ if (!e || e === document.body) return null;
643
+ let { overflow: t, overflowY: n } = getComputedStyle(e);
644
+ return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : Ce(e.parentElement);
645
+ }, we = ({ status: e }) => {
646
+ switch (e) {
647
+ case Q.Success: return /* @__PURE__ */ B(A, {
648
+ size: p.SM,
649
+ className: $.successIcon,
650
+ "aria-hidden": !0
651
+ });
652
+ case Q.Error: return /* @__PURE__ */ B(j, {
653
+ size: p.SM,
654
+ className: $.errorIcon,
655
+ "aria-hidden": !0
656
+ });
657
+ case Q.InProgress: return /* @__PURE__ */ B("span", {
658
+ "aria-hidden": !0,
659
+ children: /* @__PURE__ */ B(v, { size: p.SM })
660
+ });
661
+ case Q.Missed: return /* @__PURE__ */ B(D, {
662
+ size: p.SM,
663
+ className: $.missedIcon,
664
+ "aria-hidden": !0
665
+ });
666
+ default: return null;
667
+ }
668
+ }, Te = ({ labels: t, onBack: i, displayName: a, isLoading: o = !1, error: s, onRetry: c, description: l, modelLabel: u, repeatsLabel: d, activeWindowLabel: f, nextRunLabel: m, instructionsMarkdown: h, renderInstructions: y, runs: S, runsIsLoading: C = !1, runsIsLoadingMore: w = !1, runsSkeletonCount: T = 6, runsError: E, onRunsRetry: D, runsHasMore: k = !1, onRunsLoadMore: A, onRunClick: j, styles: M }) => {
669
+ let { colors: N, typography: P } = M ?? {}, F = P?.titleClassName ?? "dial-h1-text", I = P?.sectionTitleClassName ?? "dial-body-semi-text", L = P?.fieldLabelClassName ?? "dial-tiny-text", R = P?.fieldValueClassName ?? "dial-body-text", te = P?.runTimestampClassName ?? "dial-small-text", z = n({
670
+ "--stdv-bg": N?.background,
671
+ "--stdv-header-border": N?.headerBorder,
672
+ "--stdv-details-border": N?.detailsColumnBorder,
673
+ "--stdv-subtitle-text": N?.subtitleText,
674
+ "--stdv-success-icon": N?.successIconColor,
675
+ "--stdv-error-icon": N?.errorIconColor,
676
+ "--stdv-missed-icon": N?.missedIconColor,
677
+ "--stdv-history-bg": N?.historyCardBackground
678
+ }), H = ne(null);
679
+ ee(() => {
680
+ let e = H.current;
681
+ if (!e || !A) return;
682
+ let t = Ce(e.parentElement);
683
+ if (!t) return;
684
+ let n = () => {
685
+ if (w || C || !k) return;
686
+ let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
687
+ r.top < n.bottom && r.bottom > n.top && A();
688
+ };
689
+ return t.addEventListener("scroll", n, { passive: !0 }), n(), () => t.removeEventListener("scroll", n);
690
+ }, [
691
+ k,
692
+ w,
693
+ C,
694
+ A
695
+ ]);
696
+ let U = (t) => y ? y(t) : /* @__PURE__ */ B(e, { content: t }), W = (e) => {
697
+ let n = `${t.runStatusLabels[e.status]} ${e.timestampLabel}`, i = !!j;
698
+ return /* @__PURE__ */ V("li", {
699
+ ...i ? {
700
+ role: "button",
701
+ tabIndex: 0,
702
+ onClick: () => j?.(e.id),
703
+ onKeyDown: (t) => {
704
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), j?.(e.id));
705
+ }
706
+ } : {},
707
+ "aria-label": n,
708
+ className: r("flex h-8 items-center justify-between gap-2 rounded-full pe-2 ps-5", i && "cursor-pointer"),
709
+ children: [/* @__PURE__ */ B("span", {
710
+ className: r(te, "truncate"),
711
+ children: e.timestampLabel
712
+ }), /* @__PURE__ */ B("span", {
713
+ className: "flex h-8 w-14 shrink-0 items-center justify-end",
714
+ children: /* @__PURE__ */ B(we, { status: e.status })
715
+ })]
716
+ }, e.id);
717
+ }, G = (e) => Array.from({ length: e }, (e, t) => /* @__PURE__ */ V("li", {
718
+ "aria-hidden": "true",
719
+ className: "flex h-8 items-center justify-between gap-2 pe-2 ps-5",
720
+ children: [/* @__PURE__ */ B(g, {
721
+ variant: _.Rectangular,
722
+ width: "160px",
723
+ height: "16px"
724
+ }), /* @__PURE__ */ B(g, {
725
+ variant: _.Rectangular,
726
+ width: "16px",
727
+ height: "16px",
728
+ className: "shrink-0 rounded-full"
729
+ })]
730
+ }, `history-skeleton-${t}`));
731
+ return /* @__PURE__ */ V("div", {
732
+ style: z,
733
+ className: r("flex h-full w-full flex-col overflow-y-auto", $.container),
734
+ children: [
735
+ /* @__PURE__ */ V("div", {
736
+ className: r("flex h-16 shrink-0 items-center gap-2 border-b px-8", $.header),
737
+ children: [/* @__PURE__ */ B(x, {
738
+ icon: /* @__PURE__ */ B(O, {
739
+ size: p.LG,
740
+ className: "rtl:scale-x-[-1]",
741
+ "aria-hidden": !0
742
+ }),
743
+ "aria-label": t.backAriaLabel,
744
+ onClick: i
745
+ }), /* @__PURE__ */ B("h1", {
746
+ className: r("truncate", F),
747
+ children: a
748
+ })]
749
+ }),
750
+ o && /* @__PURE__ */ B("div", {
751
+ className: "flex flex-1 items-center justify-center",
752
+ children: /* @__PURE__ */ B(v, {})
753
+ }),
754
+ !o && s && /* @__PURE__ */ V("div", {
755
+ className: "flex flex-1 flex-col items-center justify-center gap-3",
756
+ children: [/* @__PURE__ */ B("p", {
757
+ className: r(R, $.subtitleText),
758
+ children: t.errorLabel
759
+ }), /* @__PURE__ */ B(b, {
760
+ label: t.retryLabel,
761
+ onClick: c
762
+ })]
763
+ }),
764
+ !o && !s && /* @__PURE__ */ V("div", {
765
+ className: "flex flex-1 flex-col desktop:flex-row",
766
+ children: [
767
+ /* @__PURE__ */ V("div", {
768
+ role: "group",
769
+ "aria-label": t.detailsTitle,
770
+ className: r("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", $.detailsColumn),
771
+ children: [
772
+ /* @__PURE__ */ B("h2", {
773
+ className: I,
774
+ children: t.detailsTitle
775
+ }),
776
+ l && /* @__PURE__ */ V("div", {
777
+ className: "flex flex-col gap-1",
778
+ children: [/* @__PURE__ */ B("span", {
779
+ className: L,
780
+ children: t.descriptionLabel
781
+ }), /* @__PURE__ */ B("p", {
782
+ className: R,
783
+ children: l
784
+ })]
785
+ }),
786
+ u && /* @__PURE__ */ V("div", {
787
+ className: "flex flex-col gap-1",
788
+ children: [/* @__PURE__ */ B("span", {
789
+ className: L,
790
+ children: t.modelLabel
791
+ }), /* @__PURE__ */ B("p", {
792
+ className: R,
793
+ children: u
794
+ })]
795
+ }),
796
+ d && /* @__PURE__ */ V("div", {
797
+ className: "flex flex-col gap-1",
798
+ children: [/* @__PURE__ */ B("span", {
799
+ className: L,
800
+ children: t.repeatsLabel
801
+ }), /* @__PURE__ */ B("p", {
802
+ className: R,
803
+ children: d
804
+ })]
805
+ }),
806
+ f && /* @__PURE__ */ V("div", {
807
+ className: "flex flex-col gap-1",
808
+ children: [/* @__PURE__ */ B("span", {
809
+ className: L,
810
+ children: t.activeWindowLabel
811
+ }), /* @__PURE__ */ B("p", {
812
+ className: R,
813
+ children: f
814
+ })]
815
+ })
816
+ ]
817
+ }),
818
+ /* @__PURE__ */ V("div", {
819
+ className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
820
+ children: [/* @__PURE__ */ B("h2", {
821
+ className: I,
822
+ children: t.configurationTitle
823
+ }), /* @__PURE__ */ V("div", {
824
+ role: "group",
825
+ "aria-label": t.instructionsLabel,
826
+ className: "flex flex-col gap-1",
827
+ children: [/* @__PURE__ */ B("span", {
828
+ className: L,
829
+ children: t.instructionsLabel
830
+ }), h && U(h)]
831
+ })]
832
+ }),
833
+ /* @__PURE__ */ B("div", {
834
+ className: "flex w-full justify-center p-6 desktop:w-auto desktop:items-start",
835
+ children: /* @__PURE__ */ V("div", {
836
+ className: r("flex w-full flex-col gap-4 overflow-y-auto rounded-xl px-6 py-5 shadow-md desktop:max-h-[70vh] desktop:w-[360px]", $.historyCard),
837
+ children: [
838
+ /* @__PURE__ */ B("h2", {
839
+ className: I,
840
+ children: t.historyTitle
841
+ }),
842
+ m && /* @__PURE__ */ B("p", {
843
+ className: r(te, $.subtitleText),
844
+ children: m
845
+ }),
846
+ t.historyLoadingMoreLabel && /* @__PURE__ */ B("span", {
847
+ role: "status",
848
+ "aria-live": "polite",
849
+ className: "sr-only",
850
+ children: w ? t.historyLoadingMoreLabel : ""
851
+ }),
852
+ C && S.length === 0 ? /* @__PURE__ */ B("ul", {
853
+ "aria-label": t.historyTitle,
854
+ children: G(T)
855
+ }) : E ? /* @__PURE__ */ V("div", {
856
+ className: "flex flex-col items-start gap-3",
857
+ children: [/* @__PURE__ */ B("p", {
858
+ className: r(R, $.subtitleText),
859
+ children: t.historyErrorLabel
860
+ }), /* @__PURE__ */ B(b, {
861
+ label: t.historyRetryLabel,
862
+ onClick: D
863
+ })]
864
+ }) : S.length === 0 ? /* @__PURE__ */ B("p", {
865
+ className: r(R, $.subtitleText),
866
+ children: t.historyEmptyLabel
867
+ }) : /* @__PURE__ */ V("ul", {
868
+ "aria-label": t.historyTitle,
869
+ children: [
870
+ S.map(W),
871
+ w && G(T),
872
+ /* @__PURE__ */ B("li", {
873
+ ref: H,
874
+ "aria-hidden": !0,
875
+ className: "h-px w-full"
876
+ })
877
+ ]
878
+ })
879
+ ]
880
+ })
881
+ })
882
+ ]
883
+ })
884
+ ]
885
+ });
592
886
  };
593
887
  //#endregion
594
- export { ce as DESCRIPTION_MAX_LENGTH, B as ScheduledTaskCard, G as ScheduledTaskCardGrid, W as ScheduledTaskCardSkeleton, me as ScheduledTaskCreateForm, X as ScheduledTaskFrequency, Y as ScheduledTaskScheduleType, q as ScheduledTaskSection, R as ScheduledTaskSectionKey, oe as ScheduledTasks, se as ScheduledTasksSortKey };
888
+ export { pe as DESCRIPTION_MAX_LENGTH, W as ScheduledTaskCard, ae as ScheduledTaskCardGrid, ie as ScheduledTaskCardSkeleton, Se as ScheduledTaskCreateForm, Te as ScheduledTaskDetailView, Y as ScheduledTaskFrequency, Q as ScheduledTaskRunStatus, J as ScheduledTaskScheduleType, se as ScheduledTaskSection, H as ScheduledTaskSectionKey, de as ScheduledTasks, fe as ScheduledTasksSortKey };