@epam/ai-dial-scheduled-tasks 1.1.0-dev.99 → 1.2.0-dev.1

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 (69) hide show
  1. package/components/ScheduledTaskCard/ScheduledTaskCard.d.ts +2 -2
  2. package/components/ScheduledTaskCard/ScheduledTaskCard.d.ts.map +1 -1
  3. package/components/ScheduledTaskCardGrid/ScheduledTaskCardGrid.d.ts.map +1 -1
  4. package/components/ScheduledTaskCardSkeleton/ScheduledTaskCardSkeleton.d.ts.map +1 -1
  5. package/components/ScheduledTaskConfigurationSection/ScheduledTaskConfigurationSection.d.ts +5 -0
  6. package/components/ScheduledTaskConfigurationSection/ScheduledTaskConfigurationSection.d.ts.map +1 -0
  7. package/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.d.ts +6 -5
  8. package/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.d.ts.map +1 -1
  9. package/components/ScheduledTaskDetailView/ScheduledTaskDetailView.d.ts +14 -0
  10. package/components/ScheduledTaskDetailView/ScheduledTaskDetailView.d.ts.map +1 -0
  11. package/components/ScheduledTaskDetailsSection/ScheduledTaskDetailsSection.d.ts +5 -0
  12. package/components/ScheduledTaskDetailsSection/ScheduledTaskDetailsSection.d.ts.map +1 -0
  13. package/components/ScheduledTaskDetailsSummary/ScheduledTaskDetailsSummary.d.ts +9 -0
  14. package/components/ScheduledTaskDetailsSummary/ScheduledTaskDetailsSummary.d.ts.map +1 -0
  15. package/components/ScheduledTaskHistorySection/ScheduledTaskHistorySection.d.ts +5 -0
  16. package/components/ScheduledTaskHistorySection/ScheduledTaskHistorySection.d.ts.map +1 -0
  17. package/components/ScheduledTaskRunHistoryList/ScheduledTaskRunHistoryList.d.ts +10 -0
  18. package/components/ScheduledTaskRunHistoryList/ScheduledTaskRunHistoryList.d.ts.map +1 -0
  19. package/components/ScheduledTasks/ScheduledTasks.d.ts +4 -3
  20. package/components/ScheduledTasks/ScheduledTasks.d.ts.map +1 -1
  21. package/index.css +1 -1
  22. package/index.d.ts +12 -7
  23. package/index.d.ts.map +1 -1
  24. package/index.js +962 -521
  25. package/models/scheduled-task-card-grid-props.d.ts +2 -14
  26. package/models/scheduled-task-card-grid-props.d.ts.map +1 -1
  27. package/models/scheduled-task-card-props.d.ts +17 -17
  28. package/models/scheduled-task-card-props.d.ts.map +1 -1
  29. package/models/scheduled-task-card-skeleton-props.d.ts +2 -2
  30. package/models/scheduled-task-card-skeleton-props.d.ts.map +1 -1
  31. package/models/scheduled-task-configuration-section-props.d.ts +13 -0
  32. package/models/scheduled-task-configuration-section-props.d.ts.map +1 -0
  33. package/models/scheduled-task-create-form-props.d.ts +64 -48
  34. package/models/scheduled-task-create-form-props.d.ts.map +1 -1
  35. package/models/scheduled-task-detail-view-props.d.ts +164 -0
  36. package/models/scheduled-task-detail-view-props.d.ts.map +1 -0
  37. package/models/scheduled-task-details-section-props.d.ts +30 -0
  38. package/models/scheduled-task-details-section-props.d.ts.map +1 -0
  39. package/models/scheduled-task-details-summary-props.d.ts +29 -0
  40. package/models/scheduled-task-details-summary-props.d.ts.map +1 -0
  41. package/models/scheduled-task-history-section-props.d.ts +68 -0
  42. package/models/scheduled-task-history-section-props.d.ts.map +1 -0
  43. package/models/scheduled-task-item.d.ts +2 -18
  44. package/models/scheduled-task-item.d.ts.map +1 -1
  45. package/models/scheduled-task-run-history-list-props.d.ts +82 -0
  46. package/models/scheduled-task-run-history-list-props.d.ts.map +1 -0
  47. package/models/scheduled-task-run-item.d.ts +19 -0
  48. package/models/scheduled-task-run-item.d.ts.map +1 -0
  49. package/models/scheduled-tasks-props.d.ts +15 -22
  50. package/models/scheduled-tasks-props.d.ts.map +1 -1
  51. package/package.json +10 -6
  52. package/test-setup.d.ts +10 -0
  53. package/test-setup.d.ts.map +1 -1
  54. package/types/scheduled-task-detail-tab.d.ts +10 -0
  55. package/types/scheduled-task-detail-tab.d.ts.map +1 -0
  56. package/types/scheduled-task-history-section-variant.d.ts +8 -0
  57. package/types/scheduled-task-history-section-variant.d.ts.map +1 -0
  58. package/types/scheduled-task-run-status.d.ts +12 -0
  59. package/types/scheduled-task-run-status.d.ts.map +1 -0
  60. package/types/scheduled-task-schedule.d.ts +5 -8
  61. package/types/scheduled-task-schedule.d.ts.map +1 -1
  62. package/types/scheduled-tasks-sort-key.d.ts +9 -5
  63. package/types/scheduled-tasks-sort-key.d.ts.map +1 -1
  64. package/utils/calendar-value.d.ts +4 -0
  65. package/utils/calendar-value.d.ts.map +1 -1
  66. package/components/ScheduledTaskSection/ScheduledTaskSection.d.ts +0 -5
  67. package/components/ScheduledTaskSection/ScheduledTaskSection.d.ts.map +0 -1
  68. package/models/scheduled-task-section-props.d.ts +0 -37
  69. package/models/scheduled-task-section-props.d.ts.map +0 -1
package/index.js CHANGED
@@ -1,596 +1,1037 @@
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";
7
- //#region src/models/scheduled-task-item.ts
8
- var R = /* @__PURE__ */ function(e) {
9
- return e.Shared = "shared", e.MyTasks = "myTasks", e;
10
- }({}), z = {
11
- title: "_title_14goq_1",
12
- description: "_description_14goq_5",
13
- schedulePill: "_schedulePill_14goq_9",
14
- scheduleLabel: "_scheduleLabel_14goq_14",
15
- locationLabel: "_locationLabel_14goq_18",
16
- locationLeaf: "_locationLeaf_14goq_22",
17
- newBadge: "_newBadge_14goq_26",
18
- locationDivider: "_locationDivider_14goq_31"
19
- }, B = ({ item: e, searchQuery: r = "", onEdit: i, onRunNow: a, onDelete: o, labels: s, styles: d, className: f }) => {
20
- let p = s?.newBadgeLabel ?? "NEW", m = s?.actionsLabel ?? "More actions", g = s?.editActionLabel ?? "Edit", _ = s?.runNowActionLabel ?? "Run now", b = s?.deleteActionLabel ?? "Delete", { colors: x, typography: S } = d ?? {}, C = S?.titleClassName ?? "dial-body-semi-text", w = S?.descriptionClassName ?? "dial-small-text", T = S?.scheduleLabelClassName ?? "dial-tiny-text", E = S?.locationLabelClassName ?? "dial-tiny-text", D = S?.locationLeafClassName ?? "dial-tiny-semi-text", j = S?.newBadgeClassName ?? "dial-tiny-semi-text", N = t({
21
- "--stc-title-text": x?.titleText,
22
- "--stc-desc-text": x?.descriptionText,
23
- "--stc-pill-bg": x?.schedulePillBackground,
24
- "--stc-pill-border": x?.schedulePillBorder,
25
- "--stc-schedule-label-text": x?.scheduleLabelText,
26
- "--stc-location-label-text": x?.locationLabelText,
27
- "--stc-location-leaf-text": x?.locationLeafText,
28
- "--stc-new-badge-bg": x?.newBadgeBackground,
29
- "--stc-new-badge-text": x?.newBadgeText,
30
- "--stc-location-divider-border": x?.locationDividerBorder
31
- }), P = [];
32
- return i && P.push({
33
- key: "edit",
34
- label: g,
35
- icon: /* @__PURE__ */ I(k, {
36
- size: l.SM,
37
- "aria-hidden": !0
38
- }),
39
- onClick: () => i(e.id)
40
- }), a && P.push({
41
- key: "runNow",
42
- label: _,
43
- icon: /* @__PURE__ */ I(A, {
44
- size: l.SM,
45
- "aria-hidden": !0
46
- }),
47
- onClick: () => a(e.id)
48
- }), o && P.push({
49
- key: "delete",
50
- label: b,
51
- icon: /* @__PURE__ */ I(M, {
52
- size: l.SM,
53
- "aria-hidden": !0
54
- }),
55
- danger: !0,
56
- onClick: () => o(e.id)
57
- }), /* @__PURE__ */ L(c, {
58
- role: "group",
1
+ import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t, MDMessageViewer as n, PanelEmptyState as r, buildCssVars as i, mergeClasses as a, useAvailableHeightCap as o, useIsMobile as s } from "@epam/ai-dial-chat-shared";
2
+ import { ButtonAppearance as c, ButtonDropdown as l, ButtonVariant as u, Calendar as d, CalendarMode as f, CardShell as p, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, ElementSize as g, FolderPath as _, GhostButton as v, GhostIconButton as y, Highlight as b, Input as x, Label as S, MenuItemMark as C, NeutralButton as w, NumberInput as ee, PrimaryButton as te, Search as T, Select as ne, Skeleton as E, SkeletonVariant as D, Spinner as O, Switch as k, Tabs as re, Textarea as A } from "@epam/ai-dial-ui-kit";
3
+ import { IconAlertTriangle as j, IconArrowLeft as ie, IconCircleCheck as M, IconCircleX as ae, IconClipboardX as N, IconPencilMinus as oe, IconPlayerPause as se, IconPlus as ce, IconTrashX as le } from "@tabler/icons-react";
4
+ import { Suspense as ue, lazy as de, useCallback as P, useEffect as F, useId as I, useLayoutEffect as L, useMemo as fe, useRef as R, useState as pe } from "react";
5
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
6
+ import { BuilderFormContainer as H } from "@epam/ai-dial-builder-form";
7
+ import { LazyMarkdownEditor as me } from "@epam/ai-dial-ui-kit/editors";
8
+ var U = {
9
+ title: "_title_1hxc3_1",
10
+ description: "_description_1hxc3_5",
11
+ schedulePill: "_schedulePill_1hxc3_9",
12
+ scheduleLabel: "_scheduleLabel_1hxc3_14",
13
+ locationLabel: "_locationLabel_1hxc3_18",
14
+ locationLeaf: "_locationLeaf_1hxc3_22",
15
+ newBadge: "_newBadge_1hxc3_26",
16
+ pausedPill: "_pausedPill_1hxc3_31",
17
+ pausedLabel: "_pausedLabel_1hxc3_36",
18
+ locationDivider: "_locationDivider_1hxc3_40"
19
+ }, he = ({ item: e, searchQuery: t = "", onCardClick: n, labels: r, styles: o, className: s }) => {
20
+ let c = r?.newBadgeLabel ?? "NEW", l = r?.pausedBadgeLabel ?? "Paused", { colors: u, typography: d } = o ?? {}, f = d?.titleClassName ?? "dial-body-semi-text", g = d?.descriptionClassName ?? "dial-small-text", v = d?.descriptionSizeClassName ?? "dial-tiny-text", y = d?.scheduleLabelClassName ?? "dial-tiny-text", x = d?.locationLabelClassName ?? "dial-tiny-text", S = d?.locationLeafClassName ?? "dial-tiny-semi-text", C = d?.newBadgeClassName ?? "dial-tiny-semi-text", w = d?.pausedBadgeClassName ?? "dial-tiny-text", ee = i({
21
+ "--stc-title-text": u?.titleText,
22
+ "--stc-desc-text": u?.descriptionText,
23
+ "--stc-pill-bg": u?.schedulePillBackground,
24
+ "--stc-pill-border": u?.schedulePillBorder,
25
+ "--stc-schedule-label-text": u?.scheduleLabelText,
26
+ "--stc-location-label-text": u?.locationLabelText,
27
+ "--stc-location-leaf-text": u?.locationLeafText,
28
+ "--stc-new-badge-bg": u?.newBadgeBackground,
29
+ "--stc-new-badge-text": u?.newBadgeText,
30
+ "--stc-location-divider-border": u?.locationDividerBorder,
31
+ "--stc-paused-bg": u?.pausedBadgeBackground,
32
+ "--stc-paused-border": u?.pausedBadgeBorder,
33
+ "--stc-paused-text": u?.pausedBadgeText
34
+ }), te = n ? {
35
+ tabIndex: 0,
36
+ onClick: () => n(e.id),
37
+ onKeyDown: (t) => {
38
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), n(e.id));
39
+ }
40
+ } : {};
41
+ return /* @__PURE__ */ V(p, {
42
+ role: n ? "button" : "group",
59
43
  "aria-label": e.displayName,
60
- style: N,
61
- className: n("h-[232px]", f),
44
+ style: ee,
45
+ className: a("h-[232px]", n && "cursor-pointer", s),
46
+ ...te,
62
47
  children: [
63
- /* @__PURE__ */ L("div", {
64
- className: "flex shrink-0 items-start justify-between gap-2",
65
- children: [/* @__PURE__ */ L("div", {
66
- className: "flex min-w-0 flex-1 items-center gap-2",
67
- children: [/* @__PURE__ */ I(v, {
68
- text: e.displayName,
69
- query: r,
70
- 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
75
- })]
76
- }), P.length > 0 && /* @__PURE__ */ I(u, {
77
- items: P,
78
- matchReferenceWidth: !1,
79
- placement: "bottom-end",
80
- children: /* @__PURE__ */ I(y, {
81
- icon: /* @__PURE__ */ I(O, {
82
- size: l.SM,
83
- "aria-hidden": !0
84
- }),
85
- "aria-label": m,
86
- className: "shrink-0"
87
- })
48
+ /* @__PURE__ */ V("div", {
49
+ className: "flex min-w-0 shrink-0 items-center gap-2",
50
+ children: [/* @__PURE__ */ B(b, {
51
+ text: e.displayName,
52
+ query: t,
53
+ maxLines: 1,
54
+ className: a(f, U.title)
55
+ }), e.isNew && /* @__PURE__ */ B("span", {
56
+ className: a("shrink-0 rounded-full px-2 py-0.5", C, U.newBadge),
57
+ children: c
88
58
  })]
89
59
  }),
90
- e.descriptionPreview && /* @__PURE__ */ I("p", {
91
- className: n("line-clamp-4 min-h-0 flex-1 overflow-hidden !leading-[22px]", w, z.description),
60
+ e.descriptionPreview && /* @__PURE__ */ B("p", {
61
+ className: a("line-clamp-4 min-h-0 flex-1 overflow-hidden", v, g, U.description),
92
62
  children: e.descriptionPreview
93
63
  }),
94
- /* @__PURE__ */ L("div", {
64
+ /* @__PURE__ */ V("div", {
95
65
  className: "mt-auto flex shrink-0 flex-col gap-3",
96
- children: [/* @__PURE__ */ I("div", {
66
+ children: [/* @__PURE__ */ B("div", {
97
67
  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),
68
+ children: e.isActive === !1 ? /* @__PURE__ */ V("span", {
69
+ className: a("inline-flex items-center gap-1.5 rounded-full border px-2 py-1", U.pausedPill, w, U.pausedLabel),
70
+ children: [/* @__PURE__ */ B(se, {
71
+ size: m.SM,
72
+ "aria-hidden": !0,
73
+ stroke: h
74
+ }), l]
75
+ }) : /* @__PURE__ */ B("span", {
76
+ className: a("inline-block rounded-lg border px-2 py-1", U.schedulePill, y, U.scheduleLabel),
100
77
  children: e.scheduleLabel
101
78
  })
102
- }), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */ I(h, {
79
+ }), e.locationSegments && e.locationSegments.length > 0 && /* @__PURE__ */ B(_, {
103
80
  segments: e.locationSegments,
104
- labelClassName: n(E, z.locationLabel),
105
- leafClassName: n(D, z.locationLeaf),
106
- className: n("pt-3", z.locationDivider)
81
+ labelClassName: a(x, U.locationLabel),
82
+ leafClassName: a(S, U.locationLeaf),
83
+ className: a("pt-3", U.locationDivider)
107
84
  })]
108
85
  })
109
86
  ]
110
87
  });
111
- }, V = [
88
+ }, ge = { card: "_card_11bez_1" }, _e = [
112
89
  "100%",
113
90
  "100%",
114
91
  "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", {
92
+ ], W = "var(--stcs-skeleton-bg)", G = ({ styles: e }) => /* @__PURE__ */ V(p, {
93
+ "aria-hidden": !0,
94
+ style: i({ "--stcs-skeleton-bg": e?.colors?.skeletonColor }),
95
+ className: a("h-[232px]", ge.card),
96
+ children: [
97
+ /* @__PURE__ */ B(E, {
98
+ variant: D.Rectangular,
99
+ width: "60%",
100
+ height: "20px",
101
+ color: W,
102
+ className: "shrink-0"
103
+ }),
104
+ /* @__PURE__ */ B("div", {
105
+ className: "flex min-h-0 flex-1 flex-col gap-3 overflow-hidden",
106
+ children: _e.map((e, t) => /* @__PURE__ */ B(E, {
107
+ variant: D.Rectangular,
108
+ width: e,
109
+ height: "16px",
110
+ color: W
111
+ }, t))
112
+ }),
113
+ /* @__PURE__ */ B(E, {
114
+ variant: D.Rectangular,
115
+ width: "110px",
116
+ height: "28px",
117
+ color: W,
118
+ className: "shrink-0 rounded-lg"
119
+ })
120
+ ]
121
+ }), ve = ({ items: e, searchQuery: t, onCardClick: n, labels: r, cardStyles: i, trailingSkeletonCount: a = 0, skeletonStyles: o }) => /* @__PURE__ */ V("div", {
147
122
  className: "grid grid-cols-1 gap-5 desktop:grid-cols-3",
148
- children: [e.map((e) => /* @__PURE__ */ I(B, {
123
+ children: [e.map((e) => /* @__PURE__ */ B(he, {
149
124
  item: e,
150
125
  searchQuery: t,
151
- onEdit: n,
152
- onRunNow: r,
153
- 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({
159
- "--sts-badge-bg": a?.colors?.countBadgeBackground,
160
- "--sts-badge-text": a?.colors?.countBadgeText
161
- });
162
- return /* @__PURE__ */ L("section", {
163
- ...e ? { "aria-label": e } : {},
164
- style: c,
165
- className: "flex flex-col gap-3",
166
- children: [e && /* @__PURE__ */ L("div", {
167
- className: "flex items-center gap-2 rtl:flex-row-reverse",
168
- children: [/* @__PURE__ */ I("h2", {
169
- className: o,
170
- children: e
171
- }), /* @__PURE__ */ I("span", {
172
- className: n("rounded-full px-2 py-0.5", s, W.countBadge),
173
- children: r
174
- })]
175
- }), i]
176
- });
177
- }, K = {
178
- container: "_container_sac6a_1",
179
- subtitle: "_subtitle_sac6a_5",
180
- sortButton: "_sortButton_sac6a_9"
181
- }, re = [R.Shared, R.MyTasks], ie = (e, t, n, r, i, a) => {
126
+ onCardClick: n,
127
+ labels: r,
128
+ styles: i
129
+ }, e.id)), Array.from({ length: a }, (e, t) => /* @__PURE__ */ B(G, { styles: o }, `skeleton-${t}`))]
130
+ }), K = {
131
+ container: "_container_1ct1h_2",
132
+ subtitle: "_subtitle_1ct1h_6",
133
+ sortButton: "_sortButton_1ct1h_10",
134
+ createButton: "_createButton_1ct1h_19",
135
+ sortControlHidden: "_sortControlHidden_1ct1h_40"
136
+ }, ye = (e, t, n, r, i, a) => {
182
137
  if (!e) return t ? a.loadingMoreLabel : n ? a.errorLabel : r > 0 ? `${r}` : i ? a.noResultsLabel : a.emptyStateLabel;
183
- }, q = (e) => {
138
+ }, be = (e) => {
184
139
  if (!e || e === document.body) return null;
185
140
  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({
189
- "--st-bg": M?.background,
190
- "--st-subtitle-text": M?.subtitleText,
191
- "--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)
198
- })).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);
200
- ee(() => {
201
- let e = J.current;
202
- if (!e || !x) return;
203
- let t = q(e.parentElement);
141
+ return t === "auto" || t === "scroll" || n === "auto" || n === "scroll" ? e : be(e.parentElement);
142
+ }, xe = ({ labels: e, onCreateClick: t, searchQuery: n, onSearchQueryChange: o, sortKey: s, onSortChange: d, items: f, isLoading: p = !1, error: _, onRetry: y, hasMore: b = !1, isLoadingMore: x = !1, skeletonCount: S = 6, onLoadMore: w, onCardClick: ee, banner: ne, styles: E }) => {
143
+ let { colors: D, typography: k } = E ?? {}, re = k?.titleClassName ?? "dial-h1-text", A = k?.subtitleClassName ?? "dial-body-text", j = i({
144
+ "--st-bg": D?.background,
145
+ "--st-subtitle-text": D?.subtitleText,
146
+ "--st-sort-text": D?.sortButtonText
147
+ }), ie = (e) => {
148
+ o(e ?? "");
149
+ }, [M, ae] = pe(!1), [N, oe] = pe(!1), se = R(null), le = P(() => {
150
+ oe(!0);
151
+ }, []), ue = P(() => {
152
+ oe(!1);
153
+ }, []);
154
+ L(() => {
155
+ let e = se.current;
156
+ N && M && e != null && e.offsetParent == null && ae(!1);
157
+ }, [N, M]);
158
+ let de = e.sortOptions.find((e) => e.value === s)?.label ?? e.sortLabel, I = fe(() => e.sortOptions.map((e) => ({
159
+ key: e.value,
160
+ label: e.label,
161
+ mark: C.Check,
162
+ checked: e.value === s,
163
+ onClick: () => d(e.value)
164
+ })), [
165
+ e.sortOptions,
166
+ s,
167
+ d
168
+ ]), z = ye(p, x, !!_, f.length, n.trim().length > 0, e), H = R(null);
169
+ F(() => {
170
+ let e = H.current;
171
+ if (!e || !w) return;
172
+ let t = be(e.parentElement);
204
173
  if (!t) return;
205
174
  let n = () => {
206
- if (y || p || !v) return;
175
+ if (x || p || !b) return;
207
176
  let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
208
- r.top < n.bottom && r.bottom > n.top && x();
177
+ r.top < n.bottom && r.bottom > n.top && w();
209
178
  };
210
179
  return t.addEventListener("scroll", n, { passive: !0 }), n(), () => t.removeEventListener("scroll", n);
211
180
  }, [
212
- v,
213
- y,
181
+ b,
182
+ x,
214
183
  p,
215
- x
184
+ w
216
185
  ]);
217
- let ae = () => {
218
- if (p) return /* @__PURE__ */ I(m, {});
219
- if (h) return /* @__PURE__ */ L("div", {
220
- 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: _
227
- })]
228
- });
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, {
234
- "aria-hidden": !0,
235
- size: P,
236
- stroke: 1
237
- }),
238
- label: r.emptyStateLabel
239
- });
240
- let t = H.length - 1;
241
- return /* @__PURE__ */ L("div", {
242
- 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,
248
- searchQuery: o,
249
- onEdit: C,
250
- onRunNow: O,
251
- onDelete: k,
252
- labels: r.cardLabels,
253
- trailingSkeletonCount: y && n === t ? b : 0,
254
- skeletonStyles: { colors: { skeletonColor: M?.skeletonColor } }
255
- })
256
- }, e.key)), /* @__PURE__ */ I("div", {
257
- ref: J,
258
- "aria-hidden": !0,
259
- className: "h-px w-full"
260
- })]
261
- });
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),
186
+ let me = () => p ? /* @__PURE__ */ B(O, {}) : _ ? /* @__PURE__ */ V("div", {
187
+ className: "flex flex-col items-center gap-3",
188
+ children: [/* @__PURE__ */ B("p", {
189
+ className: a(A, K.subtitle),
190
+ children: e.errorLabel
191
+ }), /* @__PURE__ */ B(v, {
192
+ label: e.retryLabel,
193
+ onClick: y
194
+ })]
195
+ }) : f.length === 0 ? n.trim() ? /* @__PURE__ */ B("p", {
196
+ className: a(A, K.subtitle),
197
+ children: e.noResultsLabel
198
+ }) : /* @__PURE__ */ B(r, { label: e.emptyStateLabel }) : /* @__PURE__ */ V("div", {
199
+ className: "flex w-full flex-col gap-6",
200
+ children: [/* @__PURE__ */ B(ve, {
201
+ items: f,
202
+ searchQuery: n,
203
+ onCardClick: ee,
204
+ labels: e.cardLabels,
205
+ trailingSkeletonCount: x ? S : 0,
206
+ skeletonStyles: { colors: { skeletonColor: D?.skeletonColor } }
207
+ }), /* @__PURE__ */ B("div", {
208
+ ref: H,
209
+ "aria-hidden": !0,
210
+ className: "h-px w-full"
211
+ })]
212
+ }), U = p || !!_ || f.length === 0;
213
+ return /* @__PURE__ */ V("div", {
214
+ style: j,
215
+ className: a("flex h-full w-full flex-col gap-6 overflow-y-auto px-8 py-4", K.container),
266
216
  children: [
267
- /* @__PURE__ */ L("div", {
217
+ /* @__PURE__ */ V("div", {
268
218
  className: "flex items-start justify-between gap-4",
269
- children: [/* @__PURE__ */ L("div", {
219
+ children: [/* @__PURE__ */ V("div", {
270
220
  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
221
+ children: [/* @__PURE__ */ B("h1", {
222
+ className: a("truncate", re),
223
+ children: e.title
224
+ }), /* @__PURE__ */ B("p", {
225
+ className: a("mt-1", A, K.subtitle),
226
+ children: e.subtitle
277
227
  })]
278
- }), /* @__PURE__ */ I(S, {
279
- label: r.createButtonLabel,
280
- iconBefore: /* @__PURE__ */ I(j, {
281
- size: l.SM,
282
- "aria-hidden": !0
228
+ }), /* @__PURE__ */ B(te, {
229
+ label: e.createButtonLabel,
230
+ textClassName: "hidden desktop:inline",
231
+ "aria-label": e.createButtonLabel,
232
+ iconBefore: /* @__PURE__ */ B(ce, {
233
+ size: m.SM,
234
+ "aria-hidden": !0,
235
+ stroke: h
283
236
  }),
284
- onClick: a,
285
- className: "shrink-0"
237
+ onClick: t,
238
+ className: a("shrink-0", K.createButton)
286
239
  })]
287
240
  }),
288
- /* @__PURE__ */ L("div", {
241
+ /* @__PURE__ */ V("div", {
289
242
  className: "flex flex-wrap items-center gap-3",
290
- children: [/* @__PURE__ */ I("div", {
243
+ children: [/* @__PURE__ */ B("div", {
244
+ role: "search",
291
245
  className: "flex-1",
292
- children: /* @__PURE__ */ I(i, {
293
- value: o,
294
- onChange: s,
295
- labels: {
296
- placeholder: r.searchPlaceholder,
297
- ariaLabel: r.searchAriaLabel,
298
- clearLabel: r.clearSearchLabel
299
- },
300
- iconSize: 18,
301
- iconStrokeWidth: 1.8,
302
- styles: {
303
- containerClassName: "h-[50px] w-full rounded-xl px-[18px]",
304
- inputClassName: "text-[15px]",
305
- clearButtonClassName: "size-11 desktop:size-auto"
306
- }
246
+ children: /* @__PURE__ */ B(T, {
247
+ value: n,
248
+ onChange: ie,
249
+ placeholder: e.searchPlaceholder,
250
+ clearLabel: e.clearSearchLabel,
251
+ "aria-label": e.searchAriaLabel,
252
+ size: g.Large,
253
+ onFocus: le,
254
+ onBlur: ue
307
255
  })
308
- }), r.sortOptions.length > 0 && /* @__PURE__ */ I(u, {
309
- matchReferenceWidth: !1,
310
- placement: "bottom-end",
311
- listClassName: "cp-dropdown-overlay",
312
- items: r.sortOptions.map((e) => ({
313
- key: e.key,
314
- label: /* @__PURE__ */ L("span", {
315
- className: "flex w-full items-center justify-between gap-2",
316
- children: [e.label, e.key === c && /* @__PURE__ */ I(E, {
317
- size: l.SM,
318
- "aria-hidden": !0
319
- })]
320
- }),
321
- onClick: () => d(e.key)
322
- })),
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, {
328
- size: 20,
329
- "aria-hidden": !0
330
- }),
331
- iconAfter: /* @__PURE__ */ I(D, {
332
- size: 20,
333
- "aria-hidden": !0
334
- })
256
+ }), e.sortOptions.length > 0 && /* @__PURE__ */ B("div", {
257
+ ref: se,
258
+ className: a(N && K.sortControlHidden),
259
+ children: /* @__PURE__ */ B(l, {
260
+ items: I,
261
+ label: de,
262
+ variant: u.Primary,
263
+ appearance: c.Ghost,
264
+ className: K.sortButton
335
265
  })
336
266
  })]
337
267
  }),
338
- /* @__PURE__ */ I("span", {
268
+ ne,
269
+ /* @__PURE__ */ B("span", {
339
270
  role: "status",
340
271
  "aria-live": "polite",
341
272
  className: "sr-only",
342
- children: W
273
+ children: z
343
274
  }),
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()
275
+ /* @__PURE__ */ B("div", {
276
+ className: a("mx-auto flex size-full w-full max-w-[1180px] flex-col", U && "items-center justify-center"),
277
+ children: me()
347
278
  })
348
279
  ]
349
280
  });
350
- }, ae = /* @__PURE__ */ function(e) {
281
+ }, Se = /* @__PURE__ */ function(e) {
351
282
  return e.FirstToRun = "firstToRun", e.LastToRun = "lastToRun", e.Newest = "newest", e.NameAZ = "nameAZ", e;
352
- }({}), oe = 500, Y = /* @__PURE__ */ function(e) {
353
- return e.Once = "once", e.Recurring = "recurring", e;
354
- }({}), X = /* @__PURE__ */ function(e) {
355
- 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) => {
283
+ }({}), Ce = 500, q = /* @__PURE__ */ function(e) {
284
+ return e.OneTime = "oneTime", e.Hourly = "hourly", e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e;
285
+ }({}), J = (e) => String(e).padStart(2, "0"), we = (e) => e ? new Date(e) : null, Te = (e) => {
357
286
  if (e == null) return "";
358
287
  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) => {
288
+ return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${J(t.getMonth() + 1)}-${J(t.getDate())}T${J(t.getHours())}:${J(t.getMinutes())}`;
289
+ }, Ee = (e) => {
290
+ if (!e) return null;
291
+ let [t, n, r] = e.split("-").map(Number);
292
+ return new Date(t, n - 1, r);
293
+ }, De = (e) => {
294
+ if (e == null) return "";
295
+ let t = e instanceof Date ? e : new Date(e);
296
+ return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${J(t.getMonth() + 1)}-${J(t.getDate())}`;
297
+ }, Oe = (e) => {
361
298
  let t = Number(e);
362
299
  return e && Number.isFinite(t) ? String(t + 1) : null;
363
- }, ue = (e) => {
300
+ }, ke = (e) => {
364
301
  let t = typeof e == "string" ? Number(e) : NaN;
365
302
  return Number.isFinite(t) ? String(t - 1) : "";
366
- }, Q = {
367
- container: "_container_1wply_1",
368
- header: "_header_1wply_5",
369
- detailsColumn: "_detailsColumn_1wply_9",
370
- sectionSubtitle: "_sectionSubtitle_1wply_13",
371
- 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", {
381
- 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", {
386
- className: "flex min-w-0 flex-1 items-center gap-2",
387
- children: [/* @__PURE__ */ I(_, {
388
- icon: /* @__PURE__ */ I(C, {
389
- size: l.LG,
390
- className: "rtl:scale-x-[-1]",
391
- "aria-hidden": !0
392
- }),
393
- "aria-label": e.backButtonLabel,
394
- onClick: p
395
- }), /* @__PURE__ */ I("h1", {
396
- className: n("truncate", E),
397
- children: e.pageTitle
303
+ }, Y = {
304
+ detailsColumn: "_detailsColumn_1mg3v_1",
305
+ sectionSubtitle: "_sectionSubtitle_1mg3v_5",
306
+ instructionsError: "_instructionsError_1mg3v_9"
307
+ }, Ae = de(async () => ({ default: (await me()).MarkdownEditor })), je = ({ labels: n, values: r, errors: s, modelSelector: c, modelLabelId: l, onFieldChange: u, onBack: p, onCancel: m, onSubmit: h, isSubmitting: g = !1, markdownEditorTheme: _, styles: v }) => {
308
+ let y = I(), b = o(), { colors: C, typography: w } = v ?? {}, te = w?.titleClassName ?? "dial-h1-text", T = w?.sectionTitleClassName ?? "dial-body-semi-text", E = w?.sectionSubtitleClassName ?? "dial-tiny-text", D = w?.instructionsLabelClassName ?? "dial-body-semi-text mb-1", k = w?.instructionsErrorClassName ?? "dial-small-text", re = i({
309
+ "--stcf-details-border": C?.detailsColumnBorder,
310
+ "--stcf-subtitle-text": C?.sectionSubtitleText,
311
+ "--stcf-error-text": C?.instructionsErrorText
312
+ }), j = g || !r.displayName.trim() || !r.modelId || !r.prompt.trim();
313
+ return /* @__PURE__ */ B(H, {
314
+ labels: {
315
+ title: n.pageTitle,
316
+ backButtonLabel: n.backButtonLabel,
317
+ cancelButtonLabel: n.cancelButtonLabel,
318
+ submitButtonLabel: n.createButtonLabel,
319
+ submittingLabel: n.submittingLabel ?? "Saving"
320
+ },
321
+ onBack: p,
322
+ onCancel: m,
323
+ onSubmit: h,
324
+ isCancelDisabled: g,
325
+ isSubmitDisabled: j,
326
+ isSubmitting: g,
327
+ styles: {
328
+ colors: { background: C?.background },
329
+ header: {
330
+ colors: { borderColor: C?.headerBorder },
331
+ typography: { fontClassName: te }
332
+ },
333
+ cssVars: re
334
+ },
335
+ left: /* @__PURE__ */ V("div", {
336
+ role: "group",
337
+ "aria-label": n.detailsSectionTitle,
338
+ className: a("flex flex-1 flex-col gap-5 border-e px-4 py-6 desktop:px-8", Y.detailsColumn),
339
+ children: [
340
+ /* @__PURE__ */ V("div", {
341
+ className: "flex flex-col gap-1",
342
+ children: [/* @__PURE__ */ B("h2", {
343
+ className: T,
344
+ children: n.detailsSectionTitle
345
+ }), /* @__PURE__ */ B("p", {
346
+ className: a(E, Y.sectionSubtitle),
347
+ children: n.detailsSectionSubtitle
348
+ })]
349
+ }),
350
+ /* @__PURE__ */ B(x, {
351
+ id: "scheduled-task-display-name",
352
+ value: r.displayName,
353
+ onChange: (e) => u("displayName", e ?? ""),
354
+ labelProps: {
355
+ label: n.displayNameLabel,
356
+ required: !0
357
+ },
358
+ invalid: !!s.displayName,
359
+ error: s.displayName
360
+ }),
361
+ /* @__PURE__ */ B(A, {
362
+ id: "scheduled-task-description",
363
+ value: r.description ?? "",
364
+ onChange: (e) => u("description", e),
365
+ labelProps: { label: n.descriptionLabel },
366
+ maxLength: 500,
367
+ invalid: !!s.description,
368
+ error: s.description,
369
+ caption: r.description ? `${r.description.length}/500` : void 0
370
+ }),
371
+ /* @__PURE__ */ V("div", {
372
+ className: "flex flex-col gap-1",
373
+ children: [
374
+ /* @__PURE__ */ B(S, {
375
+ id: l,
376
+ label: n.modelOrAgentLabel,
377
+ required: !0
378
+ }),
379
+ c,
380
+ s.modelId && /* @__PURE__ */ B("p", {
381
+ className: a(k, Y.instructionsError),
382
+ children: s.modelId
383
+ })
384
+ ]
385
+ }),
386
+ /* @__PURE__ */ V("div", {
387
+ className: "flex flex-col gap-3",
388
+ children: [
389
+ /* @__PURE__ */ B(ne, {
390
+ labelProps: { label: n.repeatLabel },
391
+ value: r.repeat,
392
+ onChange: (e) => u("repeat", e),
393
+ options: n.repeatOptions.map((e) => ({
394
+ value: e.key,
395
+ label: e.label
396
+ }))
397
+ }),
398
+ r.repeat === q.OneTime && /* @__PURE__ */ V("div", {
399
+ className: "flex flex-col gap-1",
400
+ children: [/* @__PURE__ */ B(d, {
401
+ id: "scheduled-task-run-at",
402
+ mode: f.DateTime,
403
+ value: we(r.runAt),
404
+ onChange: (e) => u("runAt", Te(e)),
405
+ labelProps: {
406
+ label: n.runAtLabel,
407
+ required: !0
408
+ },
409
+ invalid: !!s.runAt
410
+ }), s.runAt && /* @__PURE__ */ B("p", {
411
+ className: a(k, Y.instructionsError),
412
+ children: s.runAt
413
+ })]
414
+ }),
415
+ r.repeat !== q.OneTime && /* @__PURE__ */ V(z, { children: [
416
+ r.repeat !== q.Hourly && /* @__PURE__ */ V("div", {
417
+ className: "flex flex-col gap-1",
418
+ children: [/* @__PURE__ */ B(d, {
419
+ id: "scheduled-task-time",
420
+ mode: f.Time,
421
+ value: r.time,
422
+ onChange: (e) => u("time", typeof e == "string" ? e : ""),
423
+ labelProps: {
424
+ label: n.timeLabel,
425
+ required: !0
426
+ },
427
+ invalid: !!s.time
428
+ }), s.time && /* @__PURE__ */ B("p", {
429
+ className: a(k, Y.instructionsError),
430
+ children: s.time
431
+ })]
432
+ }),
433
+ r.repeat === q.Weekly && /* @__PURE__ */ V("div", {
434
+ className: "flex flex-col gap-1",
435
+ children: [/* @__PURE__ */ B(d, {
436
+ id: "scheduled-task-day-of-week",
437
+ mode: f.Weekday,
438
+ value: Oe(r.dayOfWeek),
439
+ onChange: (e) => u("dayOfWeek", ke(e)),
440
+ labelProps: {
441
+ label: n.dayOfWeekLabel,
442
+ required: !0
443
+ },
444
+ invalid: !!s.dayOfWeek
445
+ }), s.dayOfWeek && /* @__PURE__ */ B("p", {
446
+ className: a(k, Y.instructionsError),
447
+ children: s.dayOfWeek
448
+ })]
449
+ }),
450
+ r.repeat === q.Monthly && /* @__PURE__ */ B(x, {
451
+ id: "scheduled-task-day-of-month",
452
+ value: r.dayOfMonth ?? "",
453
+ onChange: (e) => u("dayOfMonth", e ?? ""),
454
+ labelProps: {
455
+ label: n.dayOfMonthLabel,
456
+ required: !0
457
+ },
458
+ invalid: !!s.dayOfMonth,
459
+ error: s.dayOfMonth
460
+ }),
461
+ r.repeat === q.Hourly && /* @__PURE__ */ B(ee, {
462
+ id: "scheduled-task-minute",
463
+ integer: !0,
464
+ min: 0,
465
+ max: 59,
466
+ value: r.minute ?? "",
467
+ onChange: (e) => u("minute", e == null ? "" : String(e)),
468
+ labelProps: {
469
+ label: n.minuteLabel,
470
+ required: !0
471
+ },
472
+ invalid: !!s.minute,
473
+ error: s.minute
474
+ }),
475
+ /* @__PURE__ */ V("div", {
476
+ className: "flex flex-row gap-3 desktop:flex-col",
477
+ children: [/* @__PURE__ */ V("div", {
478
+ className: "flex flex-1 flex-col gap-1",
479
+ children: [/* @__PURE__ */ B(d, {
480
+ id: "scheduled-task-start-date",
481
+ mode: f.Date,
482
+ value: Ee(r.startDate),
483
+ onChange: (e) => u("startDate", De(e)),
484
+ labelProps: { label: n.startDateLabel },
485
+ placeholder: n.startDatePlaceholder,
486
+ invalid: !!s.startDate
487
+ }), s.startDate && /* @__PURE__ */ B("p", {
488
+ className: a(k, Y.instructionsError),
489
+ children: s.startDate
490
+ })]
491
+ }), /* @__PURE__ */ V("div", {
492
+ className: "flex flex-1 flex-col gap-1",
493
+ children: [/* @__PURE__ */ B(d, {
494
+ id: "scheduled-task-end-date",
495
+ mode: f.Date,
496
+ value: Ee(r.endDate),
497
+ onChange: (e) => u("endDate", De(e)),
498
+ labelProps: { label: n.endDateLabel },
499
+ placeholder: n.endDatePlaceholder,
500
+ invalid: !!s.endDate
501
+ }), s.endDate && /* @__PURE__ */ B("p", {
502
+ className: a(k, Y.instructionsError),
503
+ children: s.endDate
504
+ })]
505
+ })]
506
+ })
507
+ ] })
508
+ ]
509
+ })
510
+ ]
511
+ }),
512
+ children: /* @__PURE__ */ V("div", {
513
+ role: "group",
514
+ "aria-label": n.configurationSectionTitle,
515
+ className: "flex flex-1 flex-col gap-5 px-4 py-6 desktop:px-8",
516
+ children: [/* @__PURE__ */ V("div", {
517
+ className: "flex flex-col gap-1",
518
+ children: [/* @__PURE__ */ B("h2", {
519
+ className: T,
520
+ children: n.configurationSectionTitle
521
+ }), /* @__PURE__ */ B("p", {
522
+ className: a(E, Y.sectionSubtitle),
523
+ children: n.configurationSectionSubtitle
398
524
  })]
399
- }), /* @__PURE__ */ L("div", {
400
- className: "flex items-center gap-2",
401
- children: [/* @__PURE__ */ I(x, {
402
- label: e.cancelButtonLabel,
403
- onClick: h,
404
- disabled: v
405
- }), /* @__PURE__ */ I(S, {
406
- label: e.createButtonLabel,
407
- onClick: g,
408
- disabled: M
525
+ }), /* @__PURE__ */ V("div", {
526
+ className: "flex flex-1 flex-col gap-1",
527
+ children: [
528
+ /* @__PURE__ */ B("label", {
529
+ htmlFor: y,
530
+ className: D,
531
+ children: n.instructionsLabel
532
+ }),
533
+ /* @__PURE__ */ B("div", {
534
+ ref: b,
535
+ className: a(e, t),
536
+ children: /* @__PURE__ */ B(ue, {
537
+ fallback: /* @__PURE__ */ B(O, {}),
538
+ children: /* @__PURE__ */ B(Ae, {
539
+ id: y,
540
+ value: r.prompt,
541
+ onChange: (e) => u("prompt", e),
542
+ height: 480,
543
+ theme: _
544
+ })
545
+ })
546
+ }),
547
+ s.prompt && /* @__PURE__ */ B("p", {
548
+ className: a(k, Y.instructionsError),
549
+ children: s.prompt
550
+ })
551
+ ]
552
+ })]
553
+ })
554
+ });
555
+ }, X = /* @__PURE__ */ function(e) {
556
+ return e.Details = "details", e.Configuration = "configuration", e.History = "history", e;
557
+ }({}), Me = /* @__PURE__ */ function(e) {
558
+ return e.Card = "card", e.Flow = "flow", e;
559
+ }({}), Ne = { subtitleText: "_subtitleText_1i4x2_3" }, Pe = ({ instructionsLabel: e, instructionsMarkdown: t, renderInstructions: r, fieldLabelClassName: i = "dial-tiny-text" }) => /* @__PURE__ */ V("div", {
560
+ role: "group",
561
+ "aria-label": e,
562
+ className: "flex flex-col gap-1",
563
+ children: [/* @__PURE__ */ B("span", {
564
+ className: a(i, Ne.subtitleText),
565
+ children: e
566
+ }), t && (r ? r(t) : /* @__PURE__ */ B(n, { content: t }))]
567
+ }), Fe = { subtitleText: "_subtitleText_1i4x2_3" }, Ie = ({ labels: e, description: t, modelLabel: n, repeatsLabel: r, activeWindowLabel: i, fieldLabelClassName: o = "dial-tiny-text", fieldValueClassName: s = "dial-small-text" }) => /* @__PURE__ */ V(z, { children: [
568
+ t && /* @__PURE__ */ V("div", {
569
+ className: "flex flex-col gap-1",
570
+ children: [/* @__PURE__ */ B("span", {
571
+ className: a(o, Fe.subtitleText),
572
+ children: e.descriptionLabel
573
+ }), /* @__PURE__ */ B("p", {
574
+ className: s,
575
+ children: t
576
+ })]
577
+ }),
578
+ n && /* @__PURE__ */ V("div", {
579
+ className: "flex flex-col gap-1",
580
+ children: [/* @__PURE__ */ B("span", {
581
+ className: a(o, Fe.subtitleText),
582
+ children: e.modelLabel
583
+ }), /* @__PURE__ */ B("p", {
584
+ className: s,
585
+ children: n
586
+ })]
587
+ }),
588
+ r && /* @__PURE__ */ V("div", {
589
+ className: "flex flex-col gap-1",
590
+ children: [/* @__PURE__ */ B("span", {
591
+ className: a(o, Fe.subtitleText),
592
+ children: e.repeatsLabel
593
+ }), /* @__PURE__ */ B("p", {
594
+ className: s,
595
+ children: r
596
+ })]
597
+ }),
598
+ i && /* @__PURE__ */ V("div", {
599
+ className: "flex flex-col gap-1",
600
+ children: [/* @__PURE__ */ B("span", {
601
+ className: a(o, Fe.subtitleText),
602
+ children: e.activeWindowLabel
603
+ }), /* @__PURE__ */ B("p", {
604
+ className: s,
605
+ children: i
606
+ })]
607
+ })
608
+ ] }), Z = /* @__PURE__ */ function(e) {
609
+ return e.Success = "success", e.Error = "error", e.InProgress = "inProgress", e.Missed = "missed", e;
610
+ }({}), Q = {
611
+ subtitleText: "_subtitleText_1bug5_1",
612
+ successIcon: "_successIcon_1bug5_5",
613
+ errorIcon: "_errorIcon_1bug5_9",
614
+ missedIcon: "_missedIcon_1bug5_13",
615
+ currentRun: "_currentRun_1bug5_17",
616
+ unreadDot: "_unreadDot_1bug5_21"
617
+ }, Le = ({ status: e }) => {
618
+ switch (e) {
619
+ case Z.Success: return /* @__PURE__ */ B(M, {
620
+ size: m.SM,
621
+ className: Q.successIcon,
622
+ "aria-hidden": !0,
623
+ stroke: h
624
+ });
625
+ case Z.Error: return /* @__PURE__ */ B(ae, {
626
+ size: m.SM,
627
+ className: Q.errorIcon,
628
+ "aria-hidden": !0,
629
+ stroke: h
630
+ });
631
+ case Z.InProgress: return /* @__PURE__ */ B("span", {
632
+ "aria-hidden": !0,
633
+ children: /* @__PURE__ */ B(O, { size: m.SM })
634
+ });
635
+ case Z.Missed: return /* @__PURE__ */ B(j, {
636
+ size: m.SM,
637
+ className: Q.missedIcon,
638
+ "aria-hidden": !0,
639
+ stroke: h
640
+ });
641
+ default: return null;
642
+ }
643
+ }, Re = ({ items: e, isLoading: t = !1, isLoadingMore: n = !1, skeletonCount: r = 6, error: o, onRetry: s, currentRunId: c, onRunClick: l, labels: u, footer: d, styles: f }) => {
644
+ let { colors: p, typography: m } = f ?? {}, g = m?.runTimestampClassName ?? "dial-small-text", _ = m?.subtitleClassName ?? "dial-body-text", y = u.unreadIndicatorLabel ?? "Unread", b = i({
645
+ "--strhl-success-icon": p?.successIconColor,
646
+ "--strhl-error-icon": p?.errorIconColor,
647
+ "--strhl-missed-icon": p?.missedIconColor,
648
+ "--strhl-subtitle-text": p?.subtitleTextColor,
649
+ "--strhl-current-run-bg": p?.currentRunBackground,
650
+ "--strhl-unread-dot": p?.unreadDotColor
651
+ }), x = (e) => {
652
+ let t = u.runStatusLabels[e.status], n = e.id === c, r = [e.isUnread ? y : void 0, n ? u.currentRunLabel : void 0].filter((e) => !!e), i = [`${t} ${e.timestampLabel}`, ...r].join(" — "), o = !!e.conversationId && !!l;
653
+ return /* @__PURE__ */ V("li", {
654
+ ...o ? {
655
+ role: "button",
656
+ tabIndex: 0,
657
+ onClick: () => l?.(e),
658
+ onKeyDown: (t) => {
659
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), l?.(e));
660
+ }
661
+ } : {},
662
+ "aria-label": i,
663
+ "aria-current": n ? "true" : void 0,
664
+ className: a("flex h-8 items-center justify-between gap-2 rounded-full pe-2 ps-5", n && Q.currentRun, o && "cursor-pointer"),
665
+ children: [/* @__PURE__ */ V("span", {
666
+ className: "flex items-center gap-2 truncate",
667
+ children: [/* @__PURE__ */ B("span", {
668
+ className: "relative flex size-3 shrink-0 items-center justify-center",
669
+ children: e.isUnread && /* @__PURE__ */ B("span", {
670
+ className: a("size-[5.33px] rounded-full", Q.unreadDot),
671
+ "aria-hidden": !0
672
+ })
673
+ }), /* @__PURE__ */ B("span", {
674
+ className: a(g, "truncate"),
675
+ children: e.timestampLabel
409
676
  })]
677
+ }), /* @__PURE__ */ B("span", {
678
+ className: "flex h-8 w-14 shrink-0 items-center justify-end",
679
+ children: /* @__PURE__ */ B(Le, { status: e.status })
410
680
  })]
411
- }), /* @__PURE__ */ L("div", {
412
- className: "flex flex-1 flex-col desktop:flex-row",
681
+ }, e.id);
682
+ }, S = (e) => Array.from({ length: e }, (e, t) => /* @__PURE__ */ V("li", {
683
+ "aria-hidden": "true",
684
+ className: "flex h-8 items-center justify-between gap-2 pe-2 ps-5",
685
+ children: [/* @__PURE__ */ B(E, {
686
+ variant: D.Rectangular,
687
+ width: "160px",
688
+ height: "16px"
689
+ }), /* @__PURE__ */ B(E, {
690
+ variant: D.Rectangular,
691
+ width: "16px",
692
+ height: "16px",
693
+ className: "shrink-0 rounded-full"
694
+ })]
695
+ }, `history-skeleton-${t}`));
696
+ return t && e.length === 0 ? /* @__PURE__ */ B("ul", {
697
+ style: b,
698
+ "aria-label": u.historyTitle,
699
+ className: "flex flex-col gap-0.5",
700
+ children: S(r)
701
+ }) : o && e.length === 0 ? /* @__PURE__ */ V("div", {
702
+ style: b,
703
+ className: "flex flex-col items-start gap-3",
704
+ children: [/* @__PURE__ */ B("p", {
705
+ role: "alert",
706
+ className: a(_, Q.subtitleText),
707
+ children: u.errorLabel
708
+ }), /* @__PURE__ */ B(v, {
709
+ label: u.retryLabel,
710
+ onClick: s
711
+ })]
712
+ }) : e.length === 0 ? /* @__PURE__ */ V("div", {
713
+ style: b,
714
+ className: "flex w-full flex-col items-center justify-center gap-2 py-4",
715
+ children: [/* @__PURE__ */ B(N, {
716
+ size: 44,
717
+ stroke: h,
718
+ className: Q.subtitleText,
719
+ "aria-hidden": !0
720
+ }), /* @__PURE__ */ B("p", {
721
+ role: "status",
722
+ className: g,
723
+ children: u.emptyLabel
724
+ })]
725
+ }) : /* @__PURE__ */ V("ul", {
726
+ style: b,
727
+ "aria-label": u.historyTitle,
728
+ className: "flex flex-col gap-0.5",
729
+ children: [
730
+ e.map(x),
731
+ n && S(r),
732
+ o ? /* @__PURE__ */ V("li", {
733
+ className: "flex flex-col items-start gap-3 px-5 py-2",
734
+ children: [/* @__PURE__ */ B("p", {
735
+ role: "alert",
736
+ className: a(_, Q.subtitleText),
737
+ children: u.errorLabel
738
+ }), /* @__PURE__ */ B(v, {
739
+ label: u.retryLabel,
740
+ onClick: s
741
+ })]
742
+ }) : d
743
+ ]
744
+ });
745
+ }, ze = {
746
+ historyCard: "_historyCard_qqobi_4",
747
+ subtitleText: "_subtitleText_qqobi_8"
748
+ }, Be = ({ variant: e, labels: t, nextRunLabel: n, items: r, isLoading: i = !1, isLoadingMore: o = !1, skeletonCount: s = 6, error: c, onRetry: l, hasMore: u = !1, onLoadMore: d, onRunClick: f, runTimestampClassName: p = "dial-small-text", sectionTitleClassName: m = "dial-body-semi-text", colors: h }) => {
749
+ let g = e === Me.Card, _ = g ? a("sticky bottom-0 z-10 rounded-b-xl px-6 pb-5 pt-2", ze.historyCard) : "pt-2", y = d && u && t.historyShowMoreLabel ? /* @__PURE__ */ B("li", {
750
+ className: _,
751
+ children: /* @__PURE__ */ B(v, {
752
+ label: t.historyShowMoreLabel,
753
+ onClick: d,
754
+ disabled: o
755
+ })
756
+ }) : void 0, b = n ? /* @__PURE__ */ B("p", {
757
+ className: a(p, ze.subtitleText),
758
+ children: n
759
+ }) : void 0, x = t.historyLoadingMoreLabel ? /* @__PURE__ */ B("span", {
760
+ role: "status",
761
+ "aria-live": "polite",
762
+ className: "sr-only",
763
+ children: o ? t.historyLoadingMoreLabel : ""
764
+ }) : void 0, S = /* @__PURE__ */ B(Re, {
765
+ items: r,
766
+ isLoading: i,
767
+ isLoadingMore: o,
768
+ skeletonCount: s,
769
+ error: c,
770
+ onRetry: l,
771
+ onRunClick: f,
772
+ labels: {
773
+ historyTitle: t.historyTitle,
774
+ emptyLabel: t.historyEmptyLabel,
775
+ errorLabel: t.historyErrorLabel,
776
+ retryLabel: t.historyRetryLabel,
777
+ runStatusLabels: t.runStatusLabels,
778
+ unreadIndicatorLabel: t.unreadIndicatorLabel
779
+ },
780
+ footer: y,
781
+ styles: {
782
+ typography: { runTimestampClassName: p },
783
+ colors: h
784
+ }
785
+ });
786
+ return g ? /* @__PURE__ */ V("div", {
787
+ className: a("flex max-h-[70vh] w-full flex-col overflow-y-auto rounded-xl shadow-md desktop:w-[360px]", ze.historyCard),
788
+ children: [/* @__PURE__ */ V("div", {
789
+ className: a("sticky top-0 z-10 flex flex-col gap-4 rounded-t-xl px-6 pb-2 pt-5", ze.historyCard),
413
790
  children: [
414
- /* @__PURE__ */ L("div", {
415
- role: "group",
416
- "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),
791
+ /* @__PURE__ */ B("h2", {
792
+ className: m,
793
+ children: t.historyTitle
794
+ }),
795
+ b,
796
+ x
797
+ ]
798
+ }), /* @__PURE__ */ B("div", {
799
+ className: "flex flex-1 flex-col gap-4 px-6 pb-2",
800
+ children: S
801
+ })]
802
+ }) : /* @__PURE__ */ V("div", {
803
+ className: "flex flex-col gap-4",
804
+ children: [
805
+ b,
806
+ x,
807
+ S
808
+ ]
809
+ });
810
+ }, $ = {
811
+ container: "_container_178k1_1",
812
+ header: "_header_178k1_8",
813
+ detailsColumn: "_detailsColumn_178k1_12",
814
+ subtitleText: "_subtitleText_178k1_16"
815
+ }, Ve = ({ labels: e, onBack: t, onEdit: n, onDelete: r, isDeleting: o = !1, isDeleted: c = !1, isActive: l, isActiveUpdating: d = !1, isActiveDisabled: f = !1, onActiveChange: p, displayName: g, isLoading: _ = !1, error: b, onRetry: x, description: S, modelLabel: C, repeatsLabel: ee, activeWindowLabel: te, nextRunLabel: T, instructionsMarkdown: ne, renderInstructions: E, runs: D, runsIsLoading: A = !1, runsIsLoadingMore: j = !1, runsSkeletonCount: M = 6, runsError: ae, onRunsRetry: N, runsHasMore: se = !1, onRunsLoadMore: ce, onRunClick: ue, styles: de }) => {
816
+ let { colors: P, typography: F } = de ?? {}, I = F?.titleClassName ?? "dial-h2-text", L = F?.sectionTitleClassName ?? "dial-body-semi-text", fe = F?.fieldLabelClassName ?? "dial-tiny-text", R = F?.fieldValueClassName ?? "dial-small-text", z = F?.runTimestampClassName ?? "dial-small-text", H = i({
817
+ "--stdv-bg": P?.background,
818
+ "--stdv-header-border": P?.headerBorder,
819
+ "--stdv-details-border": P?.detailsColumnBorder,
820
+ "--stdv-subtitle-text": P?.subtitleText,
821
+ "--stdv-history-bg": P?.historyCardBackground
822
+ }), me = s(), [U, he] = pe(X.Details), ge = [
823
+ {
824
+ id: X.Details,
825
+ label: e.detailsTitle
826
+ },
827
+ {
828
+ id: X.Configuration,
829
+ label: e.configurationTitle
830
+ },
831
+ {
832
+ id: X.History,
833
+ label: e.historyTitle
834
+ }
835
+ ], _e = ge.find((e) => e.id === U)?.label ?? e.detailsTitle, W = /* @__PURE__ */ B(Ie, {
836
+ labels: {
837
+ descriptionLabel: e.descriptionLabel,
838
+ modelLabel: e.modelLabel,
839
+ repeatsLabel: e.repeatsLabel,
840
+ activeWindowLabel: e.activeWindowLabel
841
+ },
842
+ description: S,
843
+ modelLabel: C,
844
+ repeatsLabel: ee,
845
+ activeWindowLabel: te,
846
+ fieldLabelClassName: fe,
847
+ fieldValueClassName: R
848
+ }), G = /* @__PURE__ */ B(Pe, {
849
+ instructionsLabel: e.instructionsLabel,
850
+ instructionsMarkdown: ne,
851
+ renderInstructions: E,
852
+ fieldLabelClassName: fe
853
+ }), ve = (t) => /* @__PURE__ */ B(Be, {
854
+ variant: t,
855
+ labels: {
856
+ historyTitle: e.historyTitle,
857
+ historyEmptyLabel: e.historyEmptyLabel,
858
+ historyErrorLabel: e.historyErrorLabel,
859
+ historyRetryLabel: e.historyRetryLabel,
860
+ historyLoadingMoreLabel: e.historyLoadingMoreLabel,
861
+ historyShowMoreLabel: e.historyShowMoreLabel,
862
+ runStatusLabels: e.runStatusLabels,
863
+ unreadIndicatorLabel: e.unreadIndicatorLabel
864
+ },
865
+ nextRunLabel: T,
866
+ items: D,
867
+ isLoading: A,
868
+ isLoadingMore: j,
869
+ skeletonCount: M,
870
+ error: ae,
871
+ onRetry: N,
872
+ hasMore: se,
873
+ onLoadMore: ce,
874
+ onRunClick: ue,
875
+ runTimestampClassName: z,
876
+ sectionTitleClassName: L,
877
+ colors: P
878
+ });
879
+ return /* @__PURE__ */ V("div", {
880
+ style: H,
881
+ className: a("flex h-full w-full flex-col overflow-y-auto", $.container),
882
+ children: [
883
+ /* @__PURE__ */ V("div", {
884
+ className: a("flex h-16 shrink-0 items-center justify-between gap-2 border-t px-8 desktop:border-b desktop:border-t-0", $.header),
885
+ children: [/* @__PURE__ */ V("div", {
886
+ className: "flex min-w-0 items-center gap-2",
418
887
  children: [
419
- /* @__PURE__ */ L("div", {
420
- className: "flex flex-col gap-1",
421
- children: [/* @__PURE__ */ I("h2", {
422
- className: D,
423
- children: e.detailsSectionTitle
424
- }), /* @__PURE__ */ I("p", {
425
- className: n(O, Q.sectionSubtitle),
426
- children: e.detailsSectionSubtitle
427
- })]
888
+ /* @__PURE__ */ B(y, {
889
+ icon: /* @__PURE__ */ B(ie, {
890
+ size: m.LG,
891
+ className: "rtl:scale-x-[-1]",
892
+ "aria-hidden": !0,
893
+ stroke: h
894
+ }),
895
+ "aria-label": e.backAriaLabel,
896
+ onClick: t
428
897
  }),
429
- /* @__PURE__ */ I(r, {
430
- id: "scheduled-task-display-name",
431
- value: i.displayName,
432
- onChange: (e) => f("displayName", e ?? ""),
433
- labelProps: {
434
- label: e.displayNameLabel,
435
- required: !0
436
- },
437
- invalid: !!c.displayName,
438
- error: c.displayName
898
+ /* @__PURE__ */ B("h1", {
899
+ className: a("hidden truncate desktop:block", I),
900
+ children: g
439
901
  }),
440
- /* @__PURE__ */ I(a, {
441
- id: "scheduled-task-description",
442
- value: i.description ?? "",
443
- onChange: (e) => f("description", e),
444
- labelProps: { label: e.descriptionLabel },
445
- maxLength: 500,
446
- invalid: !!c.description,
447
- error: c.description,
448
- caption: i.description ? `${i.description.length}/500` : void 0
902
+ c && /* @__PURE__ */ B("span", {
903
+ className: a("hidden shrink-0 desktop:inline", R, $.subtitleText),
904
+ children: e.deletedStateLabel
905
+ })
906
+ ]
907
+ }), /* @__PURE__ */ V("div", {
908
+ className: "flex shrink-0 items-center gap-2",
909
+ children: [
910
+ !c && l !== void 0 && /* @__PURE__ */ B(k, {
911
+ id: "scheduled-task-active-switch",
912
+ labelProps: { label: e.activeStatusLabel },
913
+ isOn: l,
914
+ disabled: d || f || o,
915
+ onChange: (e) => p?.(e)
449
916
  }),
450
- /* @__PURE__ */ I(d, {
451
- label: e.modelOrAgentLabel,
452
- required: !0,
453
- value: i.modelId,
454
- placeholder: e.modelPlaceholder,
455
- onChange: (e) => f("modelId", e),
456
- error: c.modelId,
457
- options: u.map((e) => ({
458
- value: e.id,
459
- label: e.label
460
- }))
917
+ !c && r && /* @__PURE__ */ B(v, {
918
+ variant: u.Danger,
919
+ label: e.deleteButtonLabel,
920
+ iconBefore: /* @__PURE__ */ B(le, {
921
+ size: m.SM,
922
+ "aria-hidden": !0,
923
+ stroke: h
924
+ }),
925
+ onClick: r,
926
+ disabled: o,
927
+ className: "shrink-0"
461
928
  }),
462
- /* @__PURE__ */ L("fieldset", {
463
- className: "flex flex-col gap-3",
464
- children: [
465
- /* @__PURE__ */ I("legend", {
466
- className: k,
467
- children: e.scheduleSectionLabel
468
- }),
469
- /* @__PURE__ */ I(d, {
470
- label: e.scheduleTypeAriaLabel,
471
- value: i.scheduleType,
472
- onChange: (e) => f("scheduleType", e),
473
- options: [{
474
- value: Y.Once,
475
- label: e.scheduleTypeOnceLabel
476
- }, {
477
- value: Y.Recurring,
478
- label: e.scheduleTypeRecurringLabel
479
- }]
480
- }),
481
- i.scheduleType === Y.Once && /* @__PURE__ */ L("div", {
482
- className: "flex flex-col gap-1",
483
- children: [/* @__PURE__ */ I(o, {
484
- 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
493
- })]
494
- }),
495
- i.scheduleType === Y.Recurring && /* @__PURE__ */ L(F, { children: [
496
- /* @__PURE__ */ I(d, {
497
- label: e.frequencyLabel,
498
- value: i.frequency,
499
- onChange: (e) => f("frequency", e),
500
- options: e.frequencyOptions.map((e) => ({
501
- value: e.key,
502
- label: e.label
503
- }))
504
- }),
505
- /* @__PURE__ */ L("div", {
506
- className: "flex flex-col gap-1",
507
- children: [/* @__PURE__ */ I(o, {
508
- 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
517
- })]
518
- }),
519
- i.frequency === X.Weekly && /* @__PURE__ */ L("div", {
520
- className: "flex flex-col gap-1",
521
- children: [/* @__PURE__ */ I(o, {
522
- 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
531
- })]
532
- }),
533
- i.frequency === X.Monthly && /* @__PURE__ */ I(r, {
534
- id: "scheduled-task-day-of-month",
535
- value: i.dayOfMonth ?? "",
536
- onChange: (e) => f("dayOfMonth", e ?? ""),
537
- labelProps: {
538
- label: e.dayOfMonthLabel,
539
- required: !0
540
- },
541
- invalid: !!c.dayOfMonth,
542
- error: c.dayOfMonth
543
- })
544
- ] })
545
- ]
929
+ !c && n && /* @__PURE__ */ B(w, {
930
+ label: e.editButtonLabel,
931
+ iconBefore: /* @__PURE__ */ B(oe, {
932
+ size: m.SM,
933
+ "aria-hidden": !0,
934
+ stroke: h
935
+ }),
936
+ onClick: n,
937
+ disabled: o,
938
+ className: "shrink-0"
546
939
  })
547
940
  ]
548
- }),
549
- /* @__PURE__ */ L("div", {
550
- role: "group",
551
- "aria-label": e.configurationSectionTitle,
552
- className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
553
- children: [/* @__PURE__ */ L("div", {
554
- className: "flex flex-col gap-1",
555
- children: [/* @__PURE__ */ I("h2", {
556
- className: D,
557
- children: e.configurationSectionTitle
558
- }), /* @__PURE__ */ I("p", {
559
- className: n(O, Q.sectionSubtitle),
560
- children: e.configurationSectionSubtitle
561
- })]
562
- }), /* @__PURE__ */ L("div", {
941
+ })]
942
+ }),
943
+ /* @__PURE__ */ V("div", {
944
+ className: "flex min-w-0 items-center gap-2 px-8 py-3 desktop:hidden",
945
+ children: [/* @__PURE__ */ B("h1", {
946
+ className: a("truncate", I),
947
+ children: g
948
+ }), c && /* @__PURE__ */ B("span", {
949
+ className: a("shrink-0", R, $.subtitleText),
950
+ children: e.deletedStateLabel
951
+ })]
952
+ }),
953
+ e.activeStatusAnnouncement != null && /* @__PURE__ */ B("span", {
954
+ role: "status",
955
+ "aria-live": "polite",
956
+ className: "sr-only",
957
+ children: e.activeStatusAnnouncement
958
+ }),
959
+ _ && /* @__PURE__ */ B("div", {
960
+ className: "flex flex-1 items-center justify-center",
961
+ children: /* @__PURE__ */ B(O, {})
962
+ }),
963
+ !_ && b && /* @__PURE__ */ V("div", {
964
+ className: "flex flex-1 flex-col items-center justify-center gap-3",
965
+ children: [/* @__PURE__ */ B("p", {
966
+ className: a(R, $.subtitleText),
967
+ children: e.errorLabel
968
+ }), /* @__PURE__ */ B(v, {
969
+ label: e.retryLabel,
970
+ onClick: x
971
+ })]
972
+ }),
973
+ !_ && !b && (me ? /* @__PURE__ */ V("div", {
974
+ className: "flex flex-1 flex-col",
975
+ children: [/* @__PURE__ */ B(re, {
976
+ ariaLabel: e.tabsAriaLabel ?? "Scheduled task sections",
977
+ className: "px-8",
978
+ tabs: ge,
979
+ activeTabId: U,
980
+ onTabChange: he
981
+ }), /* @__PURE__ */ B("div", {
982
+ role: "tabpanel",
983
+ "aria-label": _e,
984
+ className: "flex flex-1 flex-col gap-5 px-8 py-6",
985
+ children: U === X.Configuration ? G : U === X.History ? ve(Me.Flow) : W
986
+ })]
987
+ }) : /* @__PURE__ */ V("div", {
988
+ className: "flex flex-1 flex-col desktop:flex-row",
989
+ children: [
990
+ /* @__PURE__ */ V("div", {
563
991
  role: "group",
564
- "aria-label": e.instructionsLabel,
565
- className: "flex flex-1 flex-col gap-1",
566
- children: [
567
- /* @__PURE__ */ I("span", {
568
- className: k,
569
- children: e.instructionsLabel
570
- }),
571
- /* @__PURE__ */ I(N, {
572
- fallback: /* @__PURE__ */ I(m, {}),
573
- children: /* @__PURE__ */ I(de, {
574
- value: i.prompt,
575
- onChange: (e) => f("prompt", e),
576
- height: 480,
577
- theme: y
578
- })
579
- }),
580
- c.prompt && /* @__PURE__ */ I("p", {
581
- className: n(A, Q.instructionsError),
582
- children: c.prompt
583
- })
584
- ]
585
- })]
586
- }),
587
- /* @__PURE__ */ I("div", {
588
- "aria-hidden": !0,
589
- className: "hidden desktop:block desktop:w-[360px] desktop:shrink-0"
590
- })
591
- ]
992
+ "aria-label": e.detailsTitle,
993
+ className: a("flex w-full flex-col gap-5 border-e px-8 py-6 desktop:w-[360px] desktop:shrink-0", $.detailsColumn),
994
+ children: [/* @__PURE__ */ B("h2", {
995
+ className: L,
996
+ children: e.detailsTitle
997
+ }), W]
998
+ }),
999
+ /* @__PURE__ */ V("div", {
1000
+ className: "flex w-full min-w-0 flex-1 flex-col gap-5 px-8 py-6",
1001
+ children: [/* @__PURE__ */ B("h2", {
1002
+ className: L,
1003
+ children: e.configurationTitle
1004
+ }), G]
1005
+ }),
1006
+ /* @__PURE__ */ B("div", {
1007
+ className: "flex w-full justify-center p-6 desktop:w-auto desktop:items-start",
1008
+ children: ve(Me.Card)
1009
+ })
1010
+ ]
1011
+ }))
1012
+ ]
1013
+ });
1014
+ }, He = ({ modelLabel: e, instructionsLabel: t, modelDisplayName: r, instructionsMarkdown: i, renderInstructions: a, styles: o }) => {
1015
+ let s = o?.typography?.fieldLabelClassName ?? "dial-tiny-text", c = o?.typography?.fieldValueClassName ?? "dial-body-text";
1016
+ return /* @__PURE__ */ V("div", {
1017
+ className: "flex flex-col gap-3",
1018
+ children: [r && /* @__PURE__ */ V("div", {
1019
+ className: "flex flex-col gap-2",
1020
+ children: [/* @__PURE__ */ B("span", {
1021
+ className: s,
1022
+ children: e
1023
+ }), /* @__PURE__ */ B("p", {
1024
+ className: c,
1025
+ children: r
1026
+ })]
1027
+ }), i && /* @__PURE__ */ V("div", {
1028
+ className: "flex flex-col gap-2",
1029
+ children: [/* @__PURE__ */ B("span", {
1030
+ className: s,
1031
+ children: t
1032
+ }), ((e) => a ? a(e) : /* @__PURE__ */ B(n, { content: e }))(i)]
592
1033
  })]
593
1034
  });
594
1035
  };
595
1036
  //#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 };
1037
+ export { Ce as DESCRIPTION_MAX_LENGTH, he as ScheduledTaskCard, ve as ScheduledTaskCardGrid, G as ScheduledTaskCardSkeleton, je as ScheduledTaskCreateForm, Ve as ScheduledTaskDetailView, He as ScheduledTaskDetailsSummary, q as ScheduledTaskRepeat, Re as ScheduledTaskRunHistoryList, Z as ScheduledTaskRunStatus, xe as ScheduledTasks, Se as ScheduledTasksSortKey };