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

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,13 +1,13 @@
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 { Calendar as s, CalendarMode as c, CardShell as l, DIAL_ICON_SIZE as u, DialDropdown as d, DialSelectField as f, DialSkeleton as p, DialSkeletonVariant as m, DialSpinner as h, FolderPath as g, GhostButton as _, GhostIconButton as v, Highlight as y, IconButton as b, LazyDialMarkdownEditor as x, NeutralButton as S, PrimaryButton as C } from "@epam/ai-dial-ui-kit";
4
+ import { IconAlertTriangle as w, IconArrowLeft as T, IconArrowsSort as E, IconCalendarTime as D, IconCheck as O, IconChevronUp 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 z, useRef as te } from "react";
6
+ import { Fragment as ne, 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 = {
10
+ }({}), U = {
11
11
  title: "_title_14goq_1",
12
12
  description: "_description_14goq_5",
13
13
  schedulePill: "_schedulePill_14goq_9",
@@ -16,189 +16,206 @@ var R = /* @__PURE__ */ function(e) {
16
16
  locationLeaf: "_locationLeaf_14goq_22",
17
17
  newBadge: "_newBadge_14goq_26",
18
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({
19
+ }, W = ({ item: e, searchQuery: t = "", onEdit: i, onRunNow: a, onDelete: o, onCardClick: s, labels: c, styles: f, className: p }) => {
20
+ let m = c?.newBadgeLabel ?? "NEW", h = c?.actionsLabel ?? "More actions", _ = c?.editActionLabel ?? "Edit", v = c?.runNowActionLabel ?? "Run now", x = c?.deleteActionLabel ?? "Delete", { colors: S, typography: C } = f ?? {}, w = C?.titleClassName ?? "dial-body-semi-text", T = C?.descriptionClassName ?? "dial-small-text", E = C?.scheduleLabelClassName ?? "dial-tiny-text", D = C?.locationLabelClassName ?? "dial-tiny-text", O = C?.locationLeafClassName ?? "dial-tiny-semi-text", k = C?.newBadgeClassName ?? "dial-tiny-semi-text", A = n({
21
+ "--stc-title-text": S?.titleText,
22
+ "--stc-desc-text": S?.descriptionText,
23
+ "--stc-pill-bg": S?.schedulePillBackground,
24
+ "--stc-pill-border": S?.schedulePillBorder,
25
+ "--stc-schedule-label-text": S?.scheduleLabelText,
26
+ "--stc-location-label-text": S?.locationLabelText,
27
+ "--stc-location-leaf-text": S?.locationLeafText,
28
+ "--stc-new-badge-bg": S?.newBadgeBackground,
29
+ "--stc-new-badge-text": S?.newBadgeText,
30
+ "--stc-location-divider-border": S?.locationDividerBorder
31
+ }), j = [];
32
+ i && j.push({
33
33
  key: "edit",
34
- label: g,
35
- icon: /* @__PURE__ */ I(k, {
36
- size: l.SM,
34
+ label: _,
35
+ icon: /* @__PURE__ */ B(N, {
36
+ size: u.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
- label: _,
43
- icon: /* @__PURE__ */ I(A, {
44
- size: l.SM,
44
+ label: v,
45
+ icon: /* @__PURE__ */ B(P, {
46
+ size: u.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: x,
55
+ icon: /* @__PURE__ */ B(I, {
56
+ size: u.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(l, {
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", p),
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(y, {
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: m
75
90
  })]
76
- }), P.length > 0 && /* @__PURE__ */ I(u, {
77
- items: P,
91
+ }), j.length > 0 && /* @__PURE__ */ B(d, {
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(b, {
96
+ icon: /* @__PURE__ */ B(M, {
97
+ size: u.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(g, {
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(l, {
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(p, {
137
+ variant: m.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(p, {
146
+ variant: m.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(p, {
153
+ variant: m.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_5ysac_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 = {
192
+ }, q = {
176
193
  container: "_container_sac6a_1",
177
194
  subtitle: "_subtitle_sac6a_5",
178
195
  sortButton: "_sortButton_sac6a_9"
179
- }, re = [R.Shared, R.MyTasks], ie = (e, t, n, r, i, a) => {
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({
201
+ return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : ue(e.parentElement);
202
+ }, de = ({ labels: e, onCreateClick: i, searchQuery: o, onSearchQueryChange: s, sortKey: c, onSortChange: l, items: f, isLoading: p = !1, error: m, onRetry: g, hasMore: v = !1, isLoadingMore: y = !1, skeletonCount: b = 6, onLoadMore: x, onEdit: S, onRunNow: w, onDelete: T, onCardClick: A, styles: j }) => {
203
+ let { colors: M, typography: N, emptyStateIconSize: P = 48 } = j ?? {}, I = N?.titleClassName ?? "dial-h1-text", L = N?.subtitleClassName ?? "dial-body-text", R = n({
187
204
  "--st-bg": M?.background,
188
205
  "--st-subtitle-text": M?.subtitleText,
189
206
  "--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)
207
+ }), ne = e.sortOptions.find((e) => e.key === c)?.label ?? "", U = z(() => {
208
+ let t = { [H.Shared]: e.sharedSectionTitle };
209
+ return ce.map((e) => ({
210
+ key: e,
211
+ title: t[e],
212
+ items: f.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
+ }, [f, e.sharedSectionTitle]), W = le(p, y, !!m, f.length, o.trim().length > 0, e), G = te(null);
198
215
  ee(() => {
199
- let e = W.current;
216
+ let e = G.current;
200
217
  if (!e || !x) return;
201
- let t = ae(e.parentElement);
218
+ let t = ue(e.parentElement);
202
219
  if (!t) return;
203
220
  let n = () => {
204
221
  if (y || p || !v) return;
@@ -212,88 +229,89 @@ var R = /* @__PURE__ */ function(e) {
212
229
  p,
213
230
  x
214
231
  ]);
215
- let K = () => {
216
- if (p) return /* @__PURE__ */ I(m, {});
217
- if (h) return /* @__PURE__ */ L("div", {
232
+ let re = () => {
233
+ if (p) return /* @__PURE__ */ B(h, {});
234
+ if (m) 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,
224
- onClick: _
236
+ children: [/* @__PURE__ */ B("p", {
237
+ className: r(L, q.subtitle),
238
+ children: e.errorLabel
239
+ }), /* @__PURE__ */ B(_, {
240
+ label: e.retryLabel,
241
+ onClick: g
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 (f.length === 0) return o.trim() ? /* @__PURE__ */ B("p", {
245
+ className: r(L, q.subtitle),
246
+ children: e.noResultsLabel
247
+ }) : /* @__PURE__ */ B(t, {
248
+ icon: /* @__PURE__ */ B(D, {
232
249
  "aria-hidden": !0,
233
250
  size: P,
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 = U.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: [U.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,
264
+ onEdit: S,
265
+ onRunNow: w,
266
+ onDelete: T,
267
+ onCardClick: A,
268
+ labels: e.cardLabels,
269
+ trailingSkeletonCount: y && r === n ? b : 0,
252
270
  skeletonStyles: { colors: { skeletonColor: M?.skeletonColor } }
253
271
  })
254
- }, e.key)), /* @__PURE__ */ I("div", {
255
- ref: W,
272
+ }, t.key)), /* @__PURE__ */ B("div", {
273
+ ref: G,
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
+ }, K = p || !!m || f.length === 0;
279
+ return /* @__PURE__ */ V("div", {
280
+ style: R,
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", I),
289
+ children: e.title
290
+ }), /* @__PURE__ */ B("p", {
291
+ className: r("mt-1", L, 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(C, {
295
+ label: e.createButtonLabel,
296
+ iconBefore: /* @__PURE__ */ B(F, {
297
+ size: u.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
310
  onChange: s,
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,588 @@ 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, {
324
+ }), e.sortOptions.length > 0 && /* @__PURE__ */ B(d, {
307
325
  matchReferenceWidth: !1,
308
326
  placement: "bottom-end",
309
327
  listClassName: "cp-dropdown-overlay",
310
- items: r.sortOptions.map((e) => ({
328
+ items: e.sortOptions.map((e) => ({
311
329
  key: e.key,
312
- label: /* @__PURE__ */ L("span", {
330
+ label: /* @__PURE__ */ V("span", {
313
331
  className: "flex w-full items-center justify-between gap-2",
314
- children: [e.label, e.key === c && /* @__PURE__ */ I(E, {
315
- size: l.SM,
332
+ children: [e.label, e.key === c && /* @__PURE__ */ B(O, {
333
+ size: u.SM,
316
334
  "aria-hidden": !0
317
335
  })]
318
336
  }),
319
- onClick: () => d(e.key)
337
+ onClick: () => l(e.key)
320
338
  })),
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, {
339
+ children: /* @__PURE__ */ B(_, {
340
+ label: ne,
341
+ "aria-label": e.sortLabel,
342
+ className: r("rounded-[4px]", q.sortButton),
343
+ iconBefore: /* @__PURE__ */ B(E, {
326
344
  size: 20,
327
345
  "aria-hidden": !0
328
346
  }),
329
- iconAfter: /* @__PURE__ */ I(D, {
347
+ iconAfter: /* @__PURE__ */ B(k, {
330
348
  size: 20,
331
349
  "aria-hidden": !0
332
350
  })
333
351
  })
334
352
  })]
335
353
  }),
336
- /* @__PURE__ */ I("span", {
354
+ /* @__PURE__ */ B("span", {
337
355
  role: "status",
338
356
  "aria-live": "polite",
339
357
  className: "sr-only",
340
- children: U
358
+ children: W
341
359
  }),
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()
360
+ /* @__PURE__ */ B("div", {
361
+ className: r("mx-auto flex size-full w-full max-w-[1180px] flex-col", K && "items-center justify-center"),
362
+ children: re()
345
363
  })
346
364
  ]
347
365
  });
348
- }, se = /* @__PURE__ */ function(e) {
366
+ }, fe = /* @__PURE__ */ function(e) {
349
367
  return e.FirstToRun = "firstToRun", e.LastToRun = "lastToRun", e.Newest = "newest", e.NameAZ = "nameAZ", e;
350
- }({}), ce = 500, Y = /* @__PURE__ */ function(e) {
368
+ }({}), pe = 500, J = /* @__PURE__ */ function(e) {
351
369
  return e.Once = "once", e.Recurring = "recurring", e;
352
- }({}), X = /* @__PURE__ */ function(e) {
370
+ }({}), Y = /* @__PURE__ */ function(e) {
353
371
  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) => {
372
+ }({}), X = (e) => String(e).padStart(2, "0"), me = (e) => e ? new Date(e) : null, he = (e) => {
355
373
  if (e == null) return "";
356
374
  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) => {
375
+ return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${X(t.getMonth() + 1)}-${X(t.getDate())}T${X(t.getHours())}:${X(t.getMinutes())}`;
376
+ }, ge = (e) => {
377
+ if (!e) return null;
378
+ let [t, n, r] = e.split("-").map(Number);
379
+ return new Date(t, n - 1, r);
380
+ }, _e = (e) => {
381
+ if (e == null) return "";
382
+ let t = e instanceof Date ? e : new Date(e);
383
+ return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${X(t.getMonth() + 1)}-${X(t.getDate())}`;
384
+ }, ve = (e) => {
359
385
  let t = Number(e);
360
386
  return e && Number.isFinite(t) ? String(t + 1) : null;
361
- }, fe = (e) => {
387
+ }, ye = (e) => {
362
388
  let t = typeof e == "string" ? Number(e) : NaN;
363
389
  return Number.isFinite(t) ? String(t - 1) : "";
364
- }, Q = {
390
+ }, Z = {
365
391
  container: "_container_1wply_1",
366
392
  header: "_header_1wply_5",
367
393
  detailsColumn: "_detailsColumn_1wply_9",
368
394
  sectionSubtitle: "_sectionSubtitle_1wply_13",
369
395
  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", {
396
+ }, be = (e) => `${e} *`, xe = R(async () => ({ default: (await x()).DialMarkdownEditor })), Se = ({ labels: e, values: t, errors: a, modelOptions: l, onFieldChange: d, onBack: p, onCancel: m, onSubmit: g, isSubmitting: _ = !1, markdownEditorTheme: y, styles: b }) => {
397
+ let { colors: x, typography: w } = b ?? {}, E = w?.titleClassName ?? "dial-h1-text", D = w?.sectionTitleClassName ?? "dial-body-semi-text", O = w?.sectionSubtitleClassName ?? "dial-tiny-text", k = w?.scheduleSectionLabelClassName ?? "dial-body-semi-text mb-1", A = w?.instructionsErrorClassName ?? "dial-small-text", j = n({
398
+ "--stcf-bg": x?.background,
399
+ "--stcf-header-border": x?.headerBorder,
400
+ "--stcf-details-border": x?.detailsColumnBorder,
401
+ "--stcf-subtitle-text": x?.sectionSubtitleText,
402
+ "--stcf-error-text": x?.instructionsErrorText
403
+ }), M = _ || !t.displayName.trim() || !t.modelId || !t.prompt.trim();
404
+ return /* @__PURE__ */ V("div", {
379
405
  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", {
406
+ className: r("flex h-full w-full flex-col overflow-y-auto", Z.container),
407
+ children: [/* @__PURE__ */ V("div", {
408
+ className: r("flex h-16 items-center justify-between gap-6 border-b px-8", Z.header),
409
+ children: [/* @__PURE__ */ V("div", {
384
410
  className: "flex min-w-0 flex-1 items-center gap-2",
385
- children: [/* @__PURE__ */ I(_, {
386
- icon: /* @__PURE__ */ I(C, {
387
- size: l.LG,
411
+ children: [/* @__PURE__ */ B(v, {
412
+ icon: /* @__PURE__ */ B(T, {
413
+ size: u.LG,
388
414
  className: "rtl:scale-x-[-1]",
389
415
  "aria-hidden": !0
390
416
  }),
391
417
  "aria-label": e.backButtonLabel,
392
418
  onClick: p
393
- }), /* @__PURE__ */ I("h1", {
394
- className: n("truncate", E),
419
+ }), /* @__PURE__ */ B("h1", {
420
+ className: r("truncate", E),
395
421
  children: e.pageTitle
396
422
  })]
397
- }), /* @__PURE__ */ L("div", {
423
+ }), /* @__PURE__ */ V("div", {
398
424
  className: "flex items-center gap-2",
399
- children: [/* @__PURE__ */ I(x, {
425
+ children: [/* @__PURE__ */ B(S, {
400
426
  label: e.cancelButtonLabel,
401
- onClick: h,
402
- disabled: v
403
- }), /* @__PURE__ */ I(S, {
427
+ onClick: m,
428
+ disabled: _
429
+ }), /* @__PURE__ */ B(C, {
404
430
  label: e.createButtonLabel,
405
431
  onClick: g,
406
432
  disabled: M
407
433
  })]
408
434
  })]
409
- }), /* @__PURE__ */ L("div", {
435
+ }), /* @__PURE__ */ V("div", {
410
436
  className: "flex flex-1 flex-col desktop:flex-row",
411
437
  children: [
412
- /* @__PURE__ */ L("div", {
438
+ /* @__PURE__ */ V("div", {
413
439
  role: "group",
414
440
  "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),
441
+ className: r("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", Z.detailsColumn),
416
442
  children: [
417
- /* @__PURE__ */ L("div", {
443
+ /* @__PURE__ */ V("div", {
418
444
  className: "flex flex-col gap-1",
419
- children: [/* @__PURE__ */ I("h2", {
445
+ children: [/* @__PURE__ */ B("h2", {
420
446
  className: D,
421
447
  children: e.detailsSectionTitle
422
- }), /* @__PURE__ */ I("p", {
423
- className: n(O, Q.sectionSubtitle),
448
+ }), /* @__PURE__ */ B("p", {
449
+ className: r(O, Z.sectionSubtitle),
424
450
  children: e.detailsSectionSubtitle
425
451
  })]
426
452
  }),
427
- /* @__PURE__ */ I(r, {
453
+ /* @__PURE__ */ B(i, {
428
454
  id: "scheduled-task-display-name",
429
- value: i.displayName,
430
- onChange: (e) => f("displayName", e ?? ""),
455
+ value: t.displayName,
456
+ onChange: (e) => d("displayName", e ?? ""),
431
457
  labelProps: {
432
458
  label: e.displayNameLabel,
433
459
  required: !0
434
460
  },
435
- invalid: !!c.displayName,
436
- error: c.displayName
461
+ invalid: !!a.displayName,
462
+ error: a.displayName
437
463
  }),
438
- /* @__PURE__ */ I(a, {
464
+ /* @__PURE__ */ B(o, {
439
465
  id: "scheduled-task-description",
440
- value: i.description ?? "",
441
- onChange: (e) => f("description", e),
466
+ value: t.description ?? "",
467
+ onChange: (e) => d("description", e),
442
468
  labelProps: { label: e.descriptionLabel },
443
469
  maxLength: 500,
444
- invalid: !!c.description,
445
- error: c.description,
446
- caption: i.description ? `${i.description.length}/500` : void 0
470
+ invalid: !!a.description,
471
+ error: a.description,
472
+ caption: t.description ? `${t.description.length}/500` : void 0
447
473
  }),
448
- /* @__PURE__ */ I(d, {
474
+ /* @__PURE__ */ B(f, {
449
475
  label: e.modelOrAgentLabel,
450
476
  required: !0,
451
- value: i.modelId,
477
+ value: t.modelId,
452
478
  placeholder: e.modelPlaceholder,
453
- onChange: (e) => f("modelId", e),
454
- error: c.modelId,
455
- options: u.map((e) => ({
479
+ onChange: (e) => d("modelId", e),
480
+ error: a.modelId,
481
+ options: l.map((e) => ({
456
482
  value: e.id,
457
483
  label: e.label
458
484
  }))
459
485
  }),
460
- /* @__PURE__ */ L("fieldset", {
486
+ /* @__PURE__ */ V("fieldset", {
461
487
  className: "flex flex-col gap-3",
462
488
  children: [
463
- /* @__PURE__ */ I("legend", {
489
+ /* @__PURE__ */ B("legend", {
464
490
  className: k,
465
491
  children: e.scheduleSectionLabel
466
492
  }),
467
- /* @__PURE__ */ I(d, {
493
+ /* @__PURE__ */ B(f, {
468
494
  label: e.scheduleTypeAriaLabel,
469
- value: i.scheduleType,
470
- onChange: (e) => f("scheduleType", e),
495
+ value: t.scheduleType,
496
+ onChange: (e) => d("scheduleType", e),
471
497
  options: [{
472
- value: Y.Once,
498
+ value: J.Once,
473
499
  label: e.scheduleTypeOnceLabel
474
500
  }, {
475
- value: Y.Recurring,
501
+ value: J.Recurring,
476
502
  label: e.scheduleTypeRecurringLabel
477
503
  }]
478
504
  }),
479
- i.scheduleType === Y.Once && /* @__PURE__ */ L("div", {
505
+ t.scheduleType === J.Once && /* @__PURE__ */ V("div", {
480
506
  className: "flex flex-col gap-1",
481
- children: [/* @__PURE__ */ I(o, {
507
+ children: [/* @__PURE__ */ B(s, {
482
508
  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
509
+ mode: c.DateTime,
510
+ value: me(t.runAt),
511
+ onChange: (e) => d("runAt", he(e)),
512
+ label: be(e.runAtLabel),
513
+ invalid: !!a.runAt
514
+ }), a.runAt && /* @__PURE__ */ B("p", {
515
+ className: r(A, Z.instructionsError),
516
+ children: a.runAt
491
517
  })]
492
518
  }),
493
- i.scheduleType === Y.Recurring && /* @__PURE__ */ L(F, { children: [
494
- /* @__PURE__ */ I(d, {
519
+ t.scheduleType === J.Recurring && /* @__PURE__ */ V(ne, { children: [
520
+ /* @__PURE__ */ B(f, {
495
521
  label: e.frequencyLabel,
496
- value: i.frequency,
497
- onChange: (e) => f("frequency", e),
522
+ value: t.frequency,
523
+ onChange: (e) => d("frequency", e),
498
524
  options: e.frequencyOptions.map((e) => ({
499
525
  value: e.key,
500
526
  label: e.label
501
527
  }))
502
528
  }),
503
- /* @__PURE__ */ L("div", {
529
+ /* @__PURE__ */ V("div", {
504
530
  className: "flex flex-col gap-1",
505
- children: [/* @__PURE__ */ I(o, {
531
+ children: [/* @__PURE__ */ B(s, {
506
532
  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
533
+ mode: c.Time,
534
+ value: t.time,
535
+ onChange: (e) => d("time", typeof e == "string" ? e : ""),
536
+ label: be(e.timeLabel),
537
+ invalid: !!a.time
538
+ }), a.time && /* @__PURE__ */ B("p", {
539
+ className: r(A, Z.instructionsError),
540
+ children: a.time
515
541
  })]
516
542
  }),
517
- i.frequency === X.Weekly && /* @__PURE__ */ L("div", {
543
+ t.frequency === Y.Weekly && /* @__PURE__ */ V("div", {
518
544
  className: "flex flex-col gap-1",
519
- children: [/* @__PURE__ */ I(o, {
545
+ children: [/* @__PURE__ */ B(s, {
520
546
  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
547
+ mode: c.Weekday,
548
+ value: ve(t.dayOfWeek),
549
+ onChange: (e) => d("dayOfWeek", ye(e)),
550
+ label: be(e.dayOfWeekLabel),
551
+ invalid: !!a.dayOfWeek
552
+ }), a.dayOfWeek && /* @__PURE__ */ B("p", {
553
+ className: r(A, Z.instructionsError),
554
+ children: a.dayOfWeek
529
555
  })]
530
556
  }),
531
- i.frequency === X.Monthly && /* @__PURE__ */ I(r, {
557
+ t.frequency === Y.Monthly && /* @__PURE__ */ B(i, {
532
558
  id: "scheduled-task-day-of-month",
533
- value: i.dayOfMonth ?? "",
534
- onChange: (e) => f("dayOfMonth", e ?? ""),
559
+ value: t.dayOfMonth ?? "",
560
+ onChange: (e) => d("dayOfMonth", e ?? ""),
535
561
  labelProps: {
536
562
  label: e.dayOfMonthLabel,
537
563
  required: !0
538
564
  },
539
- invalid: !!c.dayOfMonth,
540
- error: c.dayOfMonth
565
+ invalid: !!a.dayOfMonth,
566
+ error: a.dayOfMonth
567
+ }),
568
+ /* @__PURE__ */ V("div", {
569
+ className: "flex flex-col gap-3 desktop:flex-row",
570
+ children: [/* @__PURE__ */ V("div", {
571
+ className: "flex flex-1 flex-col gap-1",
572
+ children: [/* @__PURE__ */ B(s, {
573
+ id: "scheduled-task-start-date",
574
+ mode: c.Date,
575
+ value: ge(t.startDate),
576
+ onChange: (e) => d("startDate", _e(e)),
577
+ label: e.startDateLabel,
578
+ placeholder: e.startDatePlaceholder,
579
+ invalid: !!a.startDate
580
+ }), a.startDate && /* @__PURE__ */ B("p", {
581
+ className: r(A, Z.instructionsError),
582
+ children: a.startDate
583
+ })]
584
+ }), /* @__PURE__ */ V("div", {
585
+ className: "flex flex-1 flex-col gap-1",
586
+ children: [/* @__PURE__ */ B(s, {
587
+ id: "scheduled-task-end-date",
588
+ mode: c.Date,
589
+ value: ge(t.endDate),
590
+ onChange: (e) => d("endDate", _e(e)),
591
+ label: e.endDateLabel,
592
+ placeholder: e.endDatePlaceholder,
593
+ invalid: !!a.endDate
594
+ }), a.endDate && /* @__PURE__ */ B("p", {
595
+ className: r(A, Z.instructionsError),
596
+ children: a.endDate
597
+ })]
598
+ })]
541
599
  })
542
600
  ] })
543
601
  ]
544
602
  })
545
603
  ]
546
604
  }),
547
- /* @__PURE__ */ L("div", {
605
+ /* @__PURE__ */ V("div", {
548
606
  role: "group",
549
607
  "aria-label": e.configurationSectionTitle,
550
608
  className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
551
- children: [/* @__PURE__ */ L("div", {
609
+ children: [/* @__PURE__ */ V("div", {
552
610
  className: "flex flex-col gap-1",
553
- children: [/* @__PURE__ */ I("h2", {
611
+ children: [/* @__PURE__ */ B("h2", {
554
612
  className: D,
555
613
  children: e.configurationSectionTitle
556
- }), /* @__PURE__ */ I("p", {
557
- className: n(O, Q.sectionSubtitle),
614
+ }), /* @__PURE__ */ B("p", {
615
+ className: r(O, Z.sectionSubtitle),
558
616
  children: e.configurationSectionSubtitle
559
617
  })]
560
- }), /* @__PURE__ */ L("div", {
618
+ }), /* @__PURE__ */ V("div", {
561
619
  role: "group",
562
620
  "aria-label": e.instructionsLabel,
563
621
  className: "flex flex-1 flex-col gap-1",
564
622
  children: [
565
- /* @__PURE__ */ I("span", {
623
+ /* @__PURE__ */ B("span", {
566
624
  className: k,
567
625
  children: e.instructionsLabel
568
626
  }),
569
- /* @__PURE__ */ I(N, {
570
- fallback: /* @__PURE__ */ I(m, {}),
571
- children: /* @__PURE__ */ I(pe, {
572
- value: i.prompt,
573
- onChange: (e) => f("prompt", e),
627
+ /* @__PURE__ */ B(L, {
628
+ fallback: /* @__PURE__ */ B(h, {}),
629
+ children: /* @__PURE__ */ B(xe, {
630
+ value: t.prompt,
631
+ onChange: (e) => d("prompt", e),
574
632
  height: 480,
575
633
  theme: y
576
634
  })
577
635
  }),
578
- c.prompt && /* @__PURE__ */ I("p", {
579
- className: n(A, Q.instructionsError),
580
- children: c.prompt
636
+ a.prompt && /* @__PURE__ */ B("p", {
637
+ className: r(A, Z.instructionsError),
638
+ children: a.prompt
581
639
  })
582
640
  ]
583
641
  })]
584
642
  }),
585
- /* @__PURE__ */ I("div", {
643
+ /* @__PURE__ */ B("div", {
586
644
  "aria-hidden": !0,
587
645
  className: "hidden desktop:block desktop:w-[360px] desktop:shrink-0"
588
646
  })
589
647
  ]
590
648
  })]
591
649
  });
650
+ }, Q = /* @__PURE__ */ function(e) {
651
+ return e.Success = "success", e.Error = "error", e.InProgress = "inProgress", e.Missed = "missed", e;
652
+ }({}), $ = {
653
+ container: "_container_maf1p_1",
654
+ header: "_header_maf1p_5",
655
+ detailsColumn: "_detailsColumn_maf1p_9",
656
+ subtitleText: "_subtitleText_maf1p_13",
657
+ successIcon: "_successIcon_maf1p_17",
658
+ errorIcon: "_errorIcon_maf1p_21",
659
+ missedIcon: "_missedIcon_maf1p_25",
660
+ historyCard: "_historyCard_maf1p_29"
661
+ }, Ce = (e) => {
662
+ if (!e || e === document.body) return null;
663
+ let { overflow: t, overflowY: n } = getComputedStyle(e);
664
+ return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : Ce(e.parentElement);
665
+ }, we = ({ status: e }) => {
666
+ switch (e) {
667
+ case Q.Success: return /* @__PURE__ */ B(A, {
668
+ size: u.SM,
669
+ className: $.successIcon,
670
+ "aria-hidden": !0
671
+ });
672
+ case Q.Error: return /* @__PURE__ */ B(j, {
673
+ size: u.SM,
674
+ className: $.errorIcon,
675
+ "aria-hidden": !0
676
+ });
677
+ case Q.InProgress: return /* @__PURE__ */ B("span", {
678
+ "aria-hidden": !0,
679
+ children: /* @__PURE__ */ B(h, { size: u.SM })
680
+ });
681
+ case Q.Missed: return /* @__PURE__ */ B(w, {
682
+ size: u.SM,
683
+ className: $.missedIcon,
684
+ "aria-hidden": !0
685
+ });
686
+ default: return null;
687
+ }
688
+ }, Te = ({ labels: t, onBack: i, displayName: a, isLoading: o = !1, error: s, onRetry: c, description: l, modelLabel: d, repeatsLabel: f, activeWindowLabel: g, nextRunLabel: y, instructionsMarkdown: b, renderInstructions: x, runs: S, runsIsLoading: C = !1, runsIsLoadingMore: w = !1, runsSkeletonCount: E = 6, runsError: D, onRunsRetry: O, runsHasMore: k = !1, onRunsLoadMore: A, onRunClick: j, styles: M }) => {
689
+ 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", z = P?.runTimestampClassName ?? "dial-small-text", ne = n({
690
+ "--stdv-bg": N?.background,
691
+ "--stdv-header-border": N?.headerBorder,
692
+ "--stdv-details-border": N?.detailsColumnBorder,
693
+ "--stdv-subtitle-text": N?.subtitleText,
694
+ "--stdv-success-icon": N?.successIconColor,
695
+ "--stdv-error-icon": N?.errorIconColor,
696
+ "--stdv-missed-icon": N?.missedIconColor,
697
+ "--stdv-history-bg": N?.historyCardBackground
698
+ }), H = te(null);
699
+ ee(() => {
700
+ let e = H.current;
701
+ if (!e || !A) return;
702
+ let t = Ce(e.parentElement);
703
+ if (!t) return;
704
+ let n = () => {
705
+ if (w || C || !k) return;
706
+ let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
707
+ r.top < n.bottom && r.bottom > n.top && A();
708
+ };
709
+ return t.addEventListener("scroll", n, { passive: !0 }), n(), () => t.removeEventListener("scroll", n);
710
+ }, [
711
+ k,
712
+ w,
713
+ C,
714
+ A
715
+ ]);
716
+ let U = (t) => x ? x(t) : /* @__PURE__ */ B(e, { content: t }), W = (e) => {
717
+ let n = `${t.runStatusLabels[e.status]} ${e.timestampLabel}`, i = !!j;
718
+ return /* @__PURE__ */ V("li", {
719
+ ...i ? {
720
+ role: "button",
721
+ tabIndex: 0,
722
+ onClick: () => j?.(e.id),
723
+ onKeyDown: (t) => {
724
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), j?.(e.id));
725
+ }
726
+ } : {},
727
+ "aria-label": n,
728
+ className: r("flex h-8 items-center justify-between gap-2 rounded-full pe-2 ps-5", i && "cursor-pointer"),
729
+ children: [/* @__PURE__ */ B("span", {
730
+ className: r(z, "truncate"),
731
+ children: e.timestampLabel
732
+ }), /* @__PURE__ */ B("span", {
733
+ className: "flex h-8 w-14 shrink-0 items-center justify-end",
734
+ children: /* @__PURE__ */ B(we, { status: e.status })
735
+ })]
736
+ }, e.id);
737
+ }, G = (e) => Array.from({ length: e }, (e, t) => /* @__PURE__ */ V("li", {
738
+ "aria-hidden": "true",
739
+ className: "flex h-8 items-center justify-between gap-2 pe-2 ps-5",
740
+ children: [/* @__PURE__ */ B(p, {
741
+ variant: m.Rectangular,
742
+ width: "160px",
743
+ height: "16px"
744
+ }), /* @__PURE__ */ B(p, {
745
+ variant: m.Rectangular,
746
+ width: "16px",
747
+ height: "16px",
748
+ className: "shrink-0 rounded-full"
749
+ })]
750
+ }, `history-skeleton-${t}`));
751
+ return /* @__PURE__ */ V("div", {
752
+ style: ne,
753
+ className: r("flex h-full w-full flex-col overflow-y-auto", $.container),
754
+ children: [
755
+ /* @__PURE__ */ V("div", {
756
+ className: r("flex h-16 shrink-0 items-center gap-2 border-b px-8", $.header),
757
+ children: [/* @__PURE__ */ B(v, {
758
+ icon: /* @__PURE__ */ B(T, {
759
+ size: u.LG,
760
+ className: "rtl:scale-x-[-1]",
761
+ "aria-hidden": !0
762
+ }),
763
+ "aria-label": t.backAriaLabel,
764
+ onClick: i
765
+ }), /* @__PURE__ */ B("h1", {
766
+ className: r("truncate", F),
767
+ children: a
768
+ })]
769
+ }),
770
+ o && /* @__PURE__ */ B("div", {
771
+ className: "flex flex-1 items-center justify-center",
772
+ children: /* @__PURE__ */ B(h, {})
773
+ }),
774
+ !o && s && /* @__PURE__ */ V("div", {
775
+ className: "flex flex-1 flex-col items-center justify-center gap-3",
776
+ children: [/* @__PURE__ */ B("p", {
777
+ className: r(R, $.subtitleText),
778
+ children: t.errorLabel
779
+ }), /* @__PURE__ */ B(_, {
780
+ label: t.retryLabel,
781
+ onClick: c
782
+ })]
783
+ }),
784
+ !o && !s && /* @__PURE__ */ V("div", {
785
+ className: "flex flex-1 flex-col desktop:flex-row",
786
+ children: [
787
+ /* @__PURE__ */ V("div", {
788
+ role: "group",
789
+ "aria-label": t.detailsTitle,
790
+ className: r("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", $.detailsColumn),
791
+ children: [
792
+ /* @__PURE__ */ B("h2", {
793
+ className: I,
794
+ children: t.detailsTitle
795
+ }),
796
+ l && /* @__PURE__ */ V("div", {
797
+ className: "flex flex-col gap-1",
798
+ children: [/* @__PURE__ */ B("span", {
799
+ className: L,
800
+ children: t.descriptionLabel
801
+ }), /* @__PURE__ */ B("p", {
802
+ className: R,
803
+ children: l
804
+ })]
805
+ }),
806
+ d && /* @__PURE__ */ V("div", {
807
+ className: "flex flex-col gap-1",
808
+ children: [/* @__PURE__ */ B("span", {
809
+ className: L,
810
+ children: t.modelLabel
811
+ }), /* @__PURE__ */ B("p", {
812
+ className: R,
813
+ children: d
814
+ })]
815
+ }),
816
+ f && /* @__PURE__ */ V("div", {
817
+ className: "flex flex-col gap-1",
818
+ children: [/* @__PURE__ */ B("span", {
819
+ className: L,
820
+ children: t.repeatsLabel
821
+ }), /* @__PURE__ */ B("p", {
822
+ className: R,
823
+ children: f
824
+ })]
825
+ }),
826
+ g && /* @__PURE__ */ V("div", {
827
+ className: "flex flex-col gap-1",
828
+ children: [/* @__PURE__ */ B("span", {
829
+ className: L,
830
+ children: t.activeWindowLabel
831
+ }), /* @__PURE__ */ B("p", {
832
+ className: R,
833
+ children: g
834
+ })]
835
+ })
836
+ ]
837
+ }),
838
+ /* @__PURE__ */ V("div", {
839
+ className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
840
+ children: [/* @__PURE__ */ B("h2", {
841
+ className: I,
842
+ children: t.configurationTitle
843
+ }), /* @__PURE__ */ V("div", {
844
+ role: "group",
845
+ "aria-label": t.instructionsLabel,
846
+ className: "flex flex-col gap-1",
847
+ children: [/* @__PURE__ */ B("span", {
848
+ className: L,
849
+ children: t.instructionsLabel
850
+ }), b && U(b)]
851
+ })]
852
+ }),
853
+ /* @__PURE__ */ B("div", {
854
+ className: "flex w-full justify-center p-6 desktop:w-auto desktop:items-start",
855
+ children: /* @__PURE__ */ V("div", {
856
+ 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),
857
+ children: [
858
+ /* @__PURE__ */ B("h2", {
859
+ className: I,
860
+ children: t.historyTitle
861
+ }),
862
+ y && /* @__PURE__ */ B("p", {
863
+ className: r(z, $.subtitleText),
864
+ children: y
865
+ }),
866
+ t.historyLoadingMoreLabel && /* @__PURE__ */ B("span", {
867
+ role: "status",
868
+ "aria-live": "polite",
869
+ className: "sr-only",
870
+ children: w ? t.historyLoadingMoreLabel : ""
871
+ }),
872
+ C && S.length === 0 ? /* @__PURE__ */ B("ul", {
873
+ "aria-label": t.historyTitle,
874
+ children: G(E)
875
+ }) : D ? /* @__PURE__ */ V("div", {
876
+ className: "flex flex-col items-start gap-3",
877
+ children: [/* @__PURE__ */ B("p", {
878
+ className: r(R, $.subtitleText),
879
+ children: t.historyErrorLabel
880
+ }), /* @__PURE__ */ B(_, {
881
+ label: t.historyRetryLabel,
882
+ onClick: O
883
+ })]
884
+ }) : S.length === 0 ? /* @__PURE__ */ B("p", {
885
+ className: r(R, $.subtitleText),
886
+ children: t.historyEmptyLabel
887
+ }) : /* @__PURE__ */ V("ul", {
888
+ "aria-label": t.historyTitle,
889
+ children: [
890
+ S.map(W),
891
+ w && G(E),
892
+ /* @__PURE__ */ B("li", {
893
+ ref: H,
894
+ "aria-hidden": !0,
895
+ className: "h-px w-full"
896
+ })
897
+ ]
898
+ })
899
+ ]
900
+ })
901
+ })
902
+ ]
903
+ })
904
+ ]
905
+ });
592
906
  };
593
907
  //#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 };
908
+ 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 };