@epam/ai-dial-scheduled-tasks 1.1.0-dev.113 → 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.
Files changed (32) hide show
  1. package/components/ScheduledTaskCard/ScheduledTaskCard.d.ts.map +1 -1
  2. package/components/ScheduledTaskCardGrid/ScheduledTaskCardGrid.d.ts.map +1 -1
  3. package/components/ScheduledTaskCardSkeleton/ScheduledTaskCardSkeleton.d.ts.map +1 -1
  4. package/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.d.ts.map +1 -1
  5. package/components/ScheduledTaskDetailView/ScheduledTaskDetailView.d.ts +11 -0
  6. package/components/ScheduledTaskDetailView/ScheduledTaskDetailView.d.ts.map +1 -0
  7. package/components/ScheduledTasks/ScheduledTasks.d.ts.map +1 -1
  8. package/index.css +1 -1
  9. package/index.d.ts +5 -1
  10. package/index.d.ts.map +1 -1
  11. package/index.js +622 -310
  12. package/models/scheduled-task-card-grid-props.d.ts +2 -0
  13. package/models/scheduled-task-card-grid-props.d.ts.map +1 -1
  14. package/models/scheduled-task-card-props.d.ts +3 -1
  15. package/models/scheduled-task-card-props.d.ts.map +1 -1
  16. package/models/scheduled-task-create-form-props.d.ts +16 -0
  17. package/models/scheduled-task-create-form-props.d.ts.map +1 -1
  18. package/models/scheduled-task-detail-view-props.d.ts +130 -0
  19. package/models/scheduled-task-detail-view-props.d.ts.map +1 -0
  20. package/models/scheduled-task-item.d.ts +0 -9
  21. package/models/scheduled-task-item.d.ts.map +1 -1
  22. package/models/scheduled-task-run-item.d.ts +15 -0
  23. package/models/scheduled-task-run-item.d.ts.map +1 -0
  24. package/models/scheduled-tasks-props.d.ts +2 -0
  25. package/models/scheduled-tasks-props.d.ts.map +1 -1
  26. package/package.json +3 -3
  27. package/types/scheduled-task-run-status.d.ts +12 -0
  28. package/types/scheduled-task-run-status.d.ts.map +1 -0
  29. package/types/scheduled-tasks-sort-key.d.ts +9 -5
  30. package/types/scheduled-tasks-sort-key.d.ts.map +1 -1
  31. package/utils/calendar-value.d.ts +4 -0
  32. package/utils/calendar-value.d.ts.map +1 -1
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,191 +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 = [
127
+ }, G = { card: "_card_1a43j_1" }, re = [
112
128
  "100%",
113
129
  "100%",
114
130
  "61%"
115
- ], H = ({ styles: e }) => {
116
- let t = e?.colors?.skeletonColor ?? "var(--bg-layer-4)";
117
- return /* @__PURE__ */ L(c, {
118
- "aria-hidden": !0,
119
- className: "h-[232px]",
120
- children: [
121
- /* @__PURE__ */ I(f, {
122
- variant: p.Rectangular,
123
- width: "60%",
124
- height: "20px",
125
- color: t,
126
- className: "shrink-0"
127
- }),
128
- /* @__PURE__ */ I("div", {
129
- className: "flex min-h-0 flex-1 flex-col gap-3 overflow-hidden",
130
- children: V.map((e, n) => /* @__PURE__ */ I(f, {
131
- variant: p.Rectangular,
132
- width: e,
133
- height: "16px",
134
- color: t
135
- }, n))
136
- }),
137
- /* @__PURE__ */ I(f, {
138
- variant: p.Rectangular,
139
- width: "110px",
140
- height: "28px",
141
- color: t,
142
- className: "shrink-0 rounded-lg"
143
- })
144
- ]
145
- });
146
- }, U = ({ items: e, searchQuery: t, onEdit: n, onRunNow: r, onDelete: i, labels: a, cardStyles: o, trailingSkeletonCount: s = 0, skeletonStyles: c }) => /* @__PURE__ */ L("div", {
131
+ ], K = "var(--stcs-skeleton-bg)", ie = ({ styles: e }) => /* @__PURE__ */ V(l, {
132
+ "aria-hidden": !0,
133
+ style: n({ "--stcs-skeleton-bg": e?.colors?.skeletonColor }),
134
+ className: r("h-[232px]", G.card),
135
+ children: [
136
+ /* @__PURE__ */ B(p, {
137
+ variant: m.Rectangular,
138
+ width: "60%",
139
+ height: "20px",
140
+ color: K,
141
+ className: "shrink-0"
142
+ }),
143
+ /* @__PURE__ */ B("div", {
144
+ className: "flex min-h-0 flex-1 flex-col gap-3 overflow-hidden",
145
+ children: re.map((e, t) => /* @__PURE__ */ B(p, {
146
+ variant: m.Rectangular,
147
+ width: e,
148
+ height: "16px",
149
+ color: K
150
+ }, t))
151
+ }),
152
+ /* @__PURE__ */ B(p, {
153
+ variant: m.Rectangular,
154
+ width: "110px",
155
+ height: "28px",
156
+ color: K,
157
+ className: "shrink-0 rounded-lg"
158
+ })
159
+ ]
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", {
147
161
  className: "grid grid-cols-1 gap-5 desktop:grid-cols-3",
148
- children: [e.map((e) => /* @__PURE__ */ I(B, {
162
+ children: [e.map((e) => /* @__PURE__ */ B(W, {
149
163
  item: e,
150
164
  searchQuery: t,
151
165
  onEdit: n,
152
166
  onRunNow: r,
153
167
  onDelete: i,
154
- labels: a,
155
- styles: o
156
- }, e.id)), Array.from({ length: s }, (e, t) => /* @__PURE__ */ I(H, { styles: c }, `skeleton-${t}`))]
157
- }), W = { countBadge: "_countBadge_5ysac_1" }, G = ({ title: e, count: r, children: i, styles: a }) => {
158
- 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({
159
174
  "--sts-badge-bg": a?.colors?.countBadgeBackground,
160
175
  "--sts-badge-text": a?.colors?.countBadgeText
161
176
  });
162
- return /* @__PURE__ */ L("section", {
177
+ return /* @__PURE__ */ V("section", {
163
178
  ...e ? { "aria-label": e } : {},
164
179
  style: c,
165
180
  className: "flex flex-col gap-3",
166
- children: [e && /* @__PURE__ */ L("div", {
181
+ children: [e && /* @__PURE__ */ V("div", {
167
182
  className: "flex items-center gap-2 rtl:flex-row-reverse",
168
- children: [/* @__PURE__ */ I("h2", {
183
+ children: [/* @__PURE__ */ B("h2", {
169
184
  className: o,
170
185
  children: e
171
- }), /* @__PURE__ */ I("span", {
172
- className: n("rounded-full px-2 py-0.5", s, W.countBadge),
173
- children: r
186
+ }), /* @__PURE__ */ B("span", {
187
+ className: r("rounded-full px-2 py-0.5", s, oe.countBadge),
188
+ children: t
174
189
  })]
175
190
  }), i]
176
191
  });
177
- }, K = {
192
+ }, q = {
178
193
  container: "_container_sac6a_1",
179
194
  subtitle: "_subtitle_sac6a_5",
180
195
  sortButton: "_sortButton_sac6a_9"
181
- }, 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) => {
182
197
  if (!e) return t ? a.loadingMoreLabel : n ? a.errorLabel : r > 0 ? `${r}` : i ? a.noResultsLabel : a.emptyStateLabel;
183
- }, q = (e) => {
198
+ }, ue = (e) => {
184
199
  if (!e || e === document.body) return null;
185
200
  let { overflow: t, overflowY: n } = getComputedStyle(e);
186
- return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : q(e.parentElement);
187
- }, J = ({ 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 }) => {
188
- 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({
189
204
  "--st-bg": M?.background,
190
205
  "--st-subtitle-text": M?.subtitleText,
191
206
  "--st-sort-text": M?.sortButtonText
192
- }), V = r.sortOptions.find((e) => e.key === c)?.label ?? "", H = te(() => {
193
- let e = { [R.Shared]: r.sharedSectionTitle };
194
- return re.map((t) => ({
195
- key: t,
196
- title: e[t],
197
- 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)
198
213
  })).filter((e) => e.items.length > 0);
199
- }, [f, r.sharedSectionTitle]), W = ie(p, y, !!h, f.length, o.trim().length > 0, r), J = ne(null);
214
+ }, [f, e.sharedSectionTitle]), W = le(p, y, !!m, f.length, o.trim().length > 0, e), G = te(null);
200
215
  ee(() => {
201
- let e = J.current;
216
+ let e = G.current;
202
217
  if (!e || !x) return;
203
- let t = q(e.parentElement);
218
+ let t = ue(e.parentElement);
204
219
  if (!t) return;
205
220
  let n = () => {
206
221
  if (y || p || !v) return;
@@ -214,88 +229,89 @@ var R = /* @__PURE__ */ function(e) {
214
229
  p,
215
230
  x
216
231
  ]);
217
- let ae = () => {
218
- if (p) return /* @__PURE__ */ I(m, {});
219
- if (h) return /* @__PURE__ */ L("div", {
232
+ let re = () => {
233
+ if (p) return /* @__PURE__ */ B(h, {});
234
+ if (m) return /* @__PURE__ */ V("div", {
220
235
  className: "flex flex-col items-center gap-3",
221
- children: [/* @__PURE__ */ I("p", {
222
- className: n(z, K.subtitle),
223
- children: r.errorLabel
224
- }), /* @__PURE__ */ I(g, {
225
- label: r.retryLabel,
226
- 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
227
242
  })]
228
243
  });
229
- if (f.length === 0) return o.trim() ? /* @__PURE__ */ I("p", {
230
- className: n(z, K.subtitle),
231
- children: r.noResultsLabel
232
- }) : /* @__PURE__ */ I(e, {
233
- 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, {
234
249
  "aria-hidden": !0,
235
250
  size: P,
236
251
  stroke: 1
237
252
  }),
238
- label: r.emptyStateLabel
253
+ label: e.emptyStateLabel
239
254
  });
240
- let t = H.length - 1;
241
- return /* @__PURE__ */ L("div", {
255
+ let n = U.length - 1;
256
+ return /* @__PURE__ */ V("div", {
242
257
  className: "flex w-full flex-col gap-6",
243
- children: [H.map((e, n) => /* @__PURE__ */ I(G, {
244
- title: e.title,
245
- count: e.items.length,
246
- children: /* @__PURE__ */ I(U, {
247
- 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,
248
263
  searchQuery: o,
249
- onEdit: C,
250
- onRunNow: O,
251
- onDelete: k,
252
- labels: r.cardLabels,
253
- 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,
254
270
  skeletonStyles: { colors: { skeletonColor: M?.skeletonColor } }
255
271
  })
256
- }, e.key)), /* @__PURE__ */ I("div", {
257
- ref: J,
272
+ }, t.key)), /* @__PURE__ */ B("div", {
273
+ ref: G,
258
274
  "aria-hidden": !0,
259
275
  className: "h-px w-full"
260
276
  })]
261
277
  });
262
- }, oe = p || !!h || f.length === 0;
263
- return /* @__PURE__ */ L("div", {
264
- style: B,
265
- className: n("flex h-full w-full flex-col gap-6 overflow-y-auto px-8 py-4", K.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),
266
282
  children: [
267
- /* @__PURE__ */ L("div", {
283
+ /* @__PURE__ */ V("div", {
268
284
  className: "flex items-start justify-between gap-4",
269
- children: [/* @__PURE__ */ L("div", {
285
+ children: [/* @__PURE__ */ V("div", {
270
286
  className: "min-w-0 gap-2",
271
- children: [/* @__PURE__ */ I("h1", {
272
- className: n("truncate", F),
273
- children: r.title
274
- }), /* @__PURE__ */ I("p", {
275
- className: n("mt-1", z, K.subtitle),
276
- 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
277
293
  })]
278
- }), /* @__PURE__ */ I(S, {
279
- label: r.createButtonLabel,
280
- iconBefore: /* @__PURE__ */ I(j, {
281
- size: l.SM,
294
+ }), /* @__PURE__ */ B(C, {
295
+ label: e.createButtonLabel,
296
+ iconBefore: /* @__PURE__ */ B(F, {
297
+ size: u.SM,
282
298
  "aria-hidden": !0
283
299
  }),
284
- onClick: a,
300
+ onClick: i,
285
301
  className: "shrink-0"
286
302
  })]
287
303
  }),
288
- /* @__PURE__ */ L("div", {
304
+ /* @__PURE__ */ V("div", {
289
305
  className: "flex flex-wrap items-center gap-3",
290
- children: [/* @__PURE__ */ I("div", {
306
+ children: [/* @__PURE__ */ B("div", {
291
307
  className: "flex-1",
292
- children: /* @__PURE__ */ I(i, {
308
+ children: /* @__PURE__ */ B(a, {
293
309
  value: o,
294
310
  onChange: s,
295
311
  labels: {
296
- placeholder: r.searchPlaceholder,
297
- ariaLabel: r.searchAriaLabel,
298
- clearLabel: r.clearSearchLabel
312
+ placeholder: e.searchPlaceholder,
313
+ ariaLabel: e.searchAriaLabel,
314
+ clearLabel: e.clearSearchLabel
299
315
  },
300
316
  iconSize: 18,
301
317
  iconStrokeWidth: 1.8,
@@ -305,292 +321,588 @@ var R = /* @__PURE__ */ function(e) {
305
321
  clearButtonClassName: "size-11 desktop:size-auto"
306
322
  }
307
323
  })
308
- }), r.sortOptions.length > 0 && /* @__PURE__ */ I(u, {
324
+ }), e.sortOptions.length > 0 && /* @__PURE__ */ B(d, {
309
325
  matchReferenceWidth: !1,
310
326
  placement: "bottom-end",
311
327
  listClassName: "cp-dropdown-overlay",
312
- items: r.sortOptions.map((e) => ({
328
+ items: e.sortOptions.map((e) => ({
313
329
  key: e.key,
314
- label: /* @__PURE__ */ L("span", {
330
+ label: /* @__PURE__ */ V("span", {
315
331
  className: "flex w-full items-center justify-between gap-2",
316
- children: [e.label, e.key === c && /* @__PURE__ */ I(E, {
317
- size: l.SM,
332
+ children: [e.label, e.key === c && /* @__PURE__ */ B(O, {
333
+ size: u.SM,
318
334
  "aria-hidden": !0
319
335
  })]
320
336
  }),
321
- onClick: () => d(e.key)
337
+ onClick: () => l(e.key)
322
338
  })),
323
- children: /* @__PURE__ */ I(g, {
324
- label: V,
325
- "aria-label": r.sortLabel,
326
- className: n("rounded-[4px]", K.sortButton),
327
- 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, {
328
344
  size: 20,
329
345
  "aria-hidden": !0
330
346
  }),
331
- iconAfter: /* @__PURE__ */ I(D, {
347
+ iconAfter: /* @__PURE__ */ B(k, {
332
348
  size: 20,
333
349
  "aria-hidden": !0
334
350
  })
335
351
  })
336
352
  })]
337
353
  }),
338
- /* @__PURE__ */ I("span", {
354
+ /* @__PURE__ */ B("span", {
339
355
  role: "status",
340
356
  "aria-live": "polite",
341
357
  className: "sr-only",
342
358
  children: W
343
359
  }),
344
- /* @__PURE__ */ I("div", {
345
- className: n("mx-auto flex size-full w-full max-w-[1180px] flex-col", oe && "items-center justify-center"),
346
- children: ae()
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()
347
363
  })
348
364
  ]
349
365
  });
350
- }, ae = /* @__PURE__ */ function(e) {
366
+ }, fe = /* @__PURE__ */ function(e) {
351
367
  return e.FirstToRun = "firstToRun", e.LastToRun = "lastToRun", e.Newest = "newest", e.NameAZ = "nameAZ", e;
352
- }({}), oe = 500, Y = /* @__PURE__ */ function(e) {
368
+ }({}), pe = 500, J = /* @__PURE__ */ function(e) {
353
369
  return e.Once = "once", e.Recurring = "recurring", e;
354
- }({}), X = /* @__PURE__ */ function(e) {
370
+ }({}), Y = /* @__PURE__ */ function(e) {
355
371
  return e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e;
356
- }({}), Z = (e) => String(e).padStart(2, "0"), se = (e) => e ? new Date(e) : null, ce = (e) => {
372
+ }({}), X = (e) => String(e).padStart(2, "0"), me = (e) => e ? new Date(e) : null, he = (e) => {
357
373
  if (e == null) return "";
358
374
  let t = e instanceof Date ? e : new Date(e);
359
- return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${Z(t.getMonth() + 1)}-${Z(t.getDate())}T${Z(t.getHours())}:${Z(t.getMinutes())}`;
360
- }, le = (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) => {
361
385
  let t = Number(e);
362
386
  return e && Number.isFinite(t) ? String(t + 1) : null;
363
- }, ue = (e) => {
387
+ }, ye = (e) => {
364
388
  let t = typeof e == "string" ? Number(e) : NaN;
365
389
  return Number.isFinite(t) ? String(t - 1) : "";
366
- }, Q = {
390
+ }, Z = {
367
391
  container: "_container_1wply_1",
368
392
  header: "_header_1wply_5",
369
393
  detailsColumn: "_detailsColumn_1wply_9",
370
394
  sectionSubtitle: "_sectionSubtitle_1wply_13",
371
395
  instructionsError: "_instructionsError_1wply_17"
372
- }, $ = (e) => `${e} *`, de = P(async () => ({ default: (await b()).DialMarkdownEditor })), fe = ({ labels: e, values: i, errors: c, modelOptions: u, onFieldChange: f, onBack: p, onCancel: h, onSubmit: g, isSubmitting: v = !1, markdownEditorTheme: y, styles: b }) => {
373
- 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({
374
- "--stcf-bg": w?.background,
375
- "--stcf-header-border": w?.headerBorder,
376
- "--stcf-details-border": w?.detailsColumnBorder,
377
- "--stcf-subtitle-text": w?.sectionSubtitleText,
378
- "--stcf-error-text": w?.instructionsErrorText
379
- }), M = v || !i.displayName.trim() || !i.modelId || !i.prompt.trim();
380
- 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", {
381
405
  style: j,
382
- className: n("flex h-full w-full flex-col overflow-y-auto", Q.container),
383
- children: [/* @__PURE__ */ L("div", {
384
- className: n("flex h-16 items-center justify-between gap-6 border-b px-8", Q.header),
385
- 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", {
386
410
  className: "flex min-w-0 flex-1 items-center gap-2",
387
- children: [/* @__PURE__ */ I(_, {
388
- icon: /* @__PURE__ */ I(C, {
389
- size: l.LG,
411
+ children: [/* @__PURE__ */ B(v, {
412
+ icon: /* @__PURE__ */ B(T, {
413
+ size: u.LG,
390
414
  className: "rtl:scale-x-[-1]",
391
415
  "aria-hidden": !0
392
416
  }),
393
417
  "aria-label": e.backButtonLabel,
394
418
  onClick: p
395
- }), /* @__PURE__ */ I("h1", {
396
- className: n("truncate", E),
419
+ }), /* @__PURE__ */ B("h1", {
420
+ className: r("truncate", E),
397
421
  children: e.pageTitle
398
422
  })]
399
- }), /* @__PURE__ */ L("div", {
423
+ }), /* @__PURE__ */ V("div", {
400
424
  className: "flex items-center gap-2",
401
- children: [/* @__PURE__ */ I(x, {
425
+ children: [/* @__PURE__ */ B(S, {
402
426
  label: e.cancelButtonLabel,
403
- onClick: h,
404
- disabled: v
405
- }), /* @__PURE__ */ I(S, {
427
+ onClick: m,
428
+ disabled: _
429
+ }), /* @__PURE__ */ B(C, {
406
430
  label: e.createButtonLabel,
407
431
  onClick: g,
408
432
  disabled: M
409
433
  })]
410
434
  })]
411
- }), /* @__PURE__ */ L("div", {
435
+ }), /* @__PURE__ */ V("div", {
412
436
  className: "flex flex-1 flex-col desktop:flex-row",
413
437
  children: [
414
- /* @__PURE__ */ L("div", {
438
+ /* @__PURE__ */ V("div", {
415
439
  role: "group",
416
440
  "aria-label": e.detailsSectionTitle,
417
- 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),
418
442
  children: [
419
- /* @__PURE__ */ L("div", {
443
+ /* @__PURE__ */ V("div", {
420
444
  className: "flex flex-col gap-1",
421
- children: [/* @__PURE__ */ I("h2", {
445
+ children: [/* @__PURE__ */ B("h2", {
422
446
  className: D,
423
447
  children: e.detailsSectionTitle
424
- }), /* @__PURE__ */ I("p", {
425
- className: n(O, Q.sectionSubtitle),
448
+ }), /* @__PURE__ */ B("p", {
449
+ className: r(O, Z.sectionSubtitle),
426
450
  children: e.detailsSectionSubtitle
427
451
  })]
428
452
  }),
429
- /* @__PURE__ */ I(r, {
453
+ /* @__PURE__ */ B(i, {
430
454
  id: "scheduled-task-display-name",
431
- value: i.displayName,
432
- onChange: (e) => f("displayName", e ?? ""),
455
+ value: t.displayName,
456
+ onChange: (e) => d("displayName", e ?? ""),
433
457
  labelProps: {
434
458
  label: e.displayNameLabel,
435
459
  required: !0
436
460
  },
437
- invalid: !!c.displayName,
438
- error: c.displayName
461
+ invalid: !!a.displayName,
462
+ error: a.displayName
439
463
  }),
440
- /* @__PURE__ */ I(a, {
464
+ /* @__PURE__ */ B(o, {
441
465
  id: "scheduled-task-description",
442
- value: i.description ?? "",
443
- onChange: (e) => f("description", e),
466
+ value: t.description ?? "",
467
+ onChange: (e) => d("description", e),
444
468
  labelProps: { label: e.descriptionLabel },
445
469
  maxLength: 500,
446
- invalid: !!c.description,
447
- error: c.description,
448
- 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
449
473
  }),
450
- /* @__PURE__ */ I(d, {
474
+ /* @__PURE__ */ B(f, {
451
475
  label: e.modelOrAgentLabel,
452
476
  required: !0,
453
- value: i.modelId,
477
+ value: t.modelId,
454
478
  placeholder: e.modelPlaceholder,
455
- onChange: (e) => f("modelId", e),
456
- error: c.modelId,
457
- options: u.map((e) => ({
479
+ onChange: (e) => d("modelId", e),
480
+ error: a.modelId,
481
+ options: l.map((e) => ({
458
482
  value: e.id,
459
483
  label: e.label
460
484
  }))
461
485
  }),
462
- /* @__PURE__ */ L("fieldset", {
486
+ /* @__PURE__ */ V("fieldset", {
463
487
  className: "flex flex-col gap-3",
464
488
  children: [
465
- /* @__PURE__ */ I("legend", {
489
+ /* @__PURE__ */ B("legend", {
466
490
  className: k,
467
491
  children: e.scheduleSectionLabel
468
492
  }),
469
- /* @__PURE__ */ I(d, {
493
+ /* @__PURE__ */ B(f, {
470
494
  label: e.scheduleTypeAriaLabel,
471
- value: i.scheduleType,
472
- onChange: (e) => f("scheduleType", e),
495
+ value: t.scheduleType,
496
+ onChange: (e) => d("scheduleType", e),
473
497
  options: [{
474
- value: Y.Once,
498
+ value: J.Once,
475
499
  label: e.scheduleTypeOnceLabel
476
500
  }, {
477
- value: Y.Recurring,
501
+ value: J.Recurring,
478
502
  label: e.scheduleTypeRecurringLabel
479
503
  }]
480
504
  }),
481
- i.scheduleType === Y.Once && /* @__PURE__ */ L("div", {
505
+ t.scheduleType === J.Once && /* @__PURE__ */ V("div", {
482
506
  className: "flex flex-col gap-1",
483
- children: [/* @__PURE__ */ I(o, {
507
+ children: [/* @__PURE__ */ B(s, {
484
508
  id: "scheduled-task-run-at",
485
- mode: s.DateTime,
486
- value: se(i.runAt),
487
- onChange: (e) => f("runAt", ce(e)),
488
- label: $(e.runAtLabel),
489
- invalid: !!c.runAt
490
- }), c.runAt && /* @__PURE__ */ I("p", {
491
- className: n(A, Q.instructionsError),
492
- 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
493
517
  })]
494
518
  }),
495
- i.scheduleType === Y.Recurring && /* @__PURE__ */ L(F, { children: [
496
- /* @__PURE__ */ I(d, {
519
+ t.scheduleType === J.Recurring && /* @__PURE__ */ V(ne, { children: [
520
+ /* @__PURE__ */ B(f, {
497
521
  label: e.frequencyLabel,
498
- value: i.frequency,
499
- onChange: (e) => f("frequency", e),
522
+ value: t.frequency,
523
+ onChange: (e) => d("frequency", e),
500
524
  options: e.frequencyOptions.map((e) => ({
501
525
  value: e.key,
502
526
  label: e.label
503
527
  }))
504
528
  }),
505
- /* @__PURE__ */ L("div", {
529
+ /* @__PURE__ */ V("div", {
506
530
  className: "flex flex-col gap-1",
507
- children: [/* @__PURE__ */ I(o, {
531
+ children: [/* @__PURE__ */ B(s, {
508
532
  id: "scheduled-task-time",
509
- mode: s.Time,
510
- value: i.time,
511
- onChange: (e) => f("time", typeof e == "string" ? e : ""),
512
- label: $(e.timeLabel),
513
- invalid: !!c.time
514
- }), c.time && /* @__PURE__ */ I("p", {
515
- className: n(A, Q.instructionsError),
516
- 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
517
541
  })]
518
542
  }),
519
- i.frequency === X.Weekly && /* @__PURE__ */ L("div", {
543
+ t.frequency === Y.Weekly && /* @__PURE__ */ V("div", {
520
544
  className: "flex flex-col gap-1",
521
- children: [/* @__PURE__ */ I(o, {
545
+ children: [/* @__PURE__ */ B(s, {
522
546
  id: "scheduled-task-day-of-week",
523
- mode: s.Weekday,
524
- value: le(i.dayOfWeek),
525
- onChange: (e) => f("dayOfWeek", ue(e)),
526
- label: $(e.dayOfWeekLabel),
527
- invalid: !!c.dayOfWeek
528
- }), c.dayOfWeek && /* @__PURE__ */ I("p", {
529
- className: n(A, Q.instructionsError),
530
- 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
531
555
  })]
532
556
  }),
533
- i.frequency === X.Monthly && /* @__PURE__ */ I(r, {
557
+ t.frequency === Y.Monthly && /* @__PURE__ */ B(i, {
534
558
  id: "scheduled-task-day-of-month",
535
- value: i.dayOfMonth ?? "",
536
- onChange: (e) => f("dayOfMonth", e ?? ""),
559
+ value: t.dayOfMonth ?? "",
560
+ onChange: (e) => d("dayOfMonth", e ?? ""),
537
561
  labelProps: {
538
562
  label: e.dayOfMonthLabel,
539
563
  required: !0
540
564
  },
541
- invalid: !!c.dayOfMonth,
542
- 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
+ })]
543
599
  })
544
600
  ] })
545
601
  ]
546
602
  })
547
603
  ]
548
604
  }),
549
- /* @__PURE__ */ L("div", {
605
+ /* @__PURE__ */ V("div", {
550
606
  role: "group",
551
607
  "aria-label": e.configurationSectionTitle,
552
608
  className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
553
- children: [/* @__PURE__ */ L("div", {
609
+ children: [/* @__PURE__ */ V("div", {
554
610
  className: "flex flex-col gap-1",
555
- children: [/* @__PURE__ */ I("h2", {
611
+ children: [/* @__PURE__ */ B("h2", {
556
612
  className: D,
557
613
  children: e.configurationSectionTitle
558
- }), /* @__PURE__ */ I("p", {
559
- className: n(O, Q.sectionSubtitle),
614
+ }), /* @__PURE__ */ B("p", {
615
+ className: r(O, Z.sectionSubtitle),
560
616
  children: e.configurationSectionSubtitle
561
617
  })]
562
- }), /* @__PURE__ */ L("div", {
618
+ }), /* @__PURE__ */ V("div", {
563
619
  role: "group",
564
620
  "aria-label": e.instructionsLabel,
565
621
  className: "flex flex-1 flex-col gap-1",
566
622
  children: [
567
- /* @__PURE__ */ I("span", {
623
+ /* @__PURE__ */ B("span", {
568
624
  className: k,
569
625
  children: e.instructionsLabel
570
626
  }),
571
- /* @__PURE__ */ I(N, {
572
- fallback: /* @__PURE__ */ I(m, {}),
573
- children: /* @__PURE__ */ I(de, {
574
- value: i.prompt,
575
- 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),
576
632
  height: 480,
577
633
  theme: y
578
634
  })
579
635
  }),
580
- c.prompt && /* @__PURE__ */ I("p", {
581
- className: n(A, Q.instructionsError),
582
- children: c.prompt
636
+ a.prompt && /* @__PURE__ */ B("p", {
637
+ className: r(A, Z.instructionsError),
638
+ children: a.prompt
583
639
  })
584
640
  ]
585
641
  })]
586
642
  }),
587
- /* @__PURE__ */ I("div", {
643
+ /* @__PURE__ */ B("div", {
588
644
  "aria-hidden": !0,
589
645
  className: "hidden desktop:block desktop:w-[360px] desktop:shrink-0"
590
646
  })
591
647
  ]
592
648
  })]
593
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
+ });
594
906
  };
595
907
  //#endregion
596
- export { oe as DESCRIPTION_MAX_LENGTH, B as ScheduledTaskCard, U as ScheduledTaskCardGrid, H as ScheduledTaskCardSkeleton, fe as ScheduledTaskCreateForm, X as ScheduledTaskFrequency, Y as ScheduledTaskScheduleType, G as ScheduledTaskSection, R as ScheduledTaskSectionKey, J as ScheduledTasks, ae 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 };