@epam/ai-dial-skill-editor 1.3.0-dev.28 → 1.3.0-dev.282

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/SkillCreateFolderDialog/SkillCreateFolderDialog.d.ts +5 -0
  2. package/components/SkillCreateFolderDialog/SkillCreateFolderDialog.d.ts.map +1 -0
  3. package/components/SkillEditor/SkillEditor.d.ts.map +1 -1
  4. package/components/SkillEditorDialog/SkillEditorDialog.d.ts +5 -0
  5. package/components/SkillEditorDialog/SkillEditorDialog.d.ts.map +1 -0
  6. package/components/SkillFileDropOverlay/SkillFileDropOverlay.d.ts +4 -0
  7. package/components/SkillFileDropOverlay/SkillFileDropOverlay.d.ts.map +1 -1
  8. package/components/SkillFileUploadDialog/SkillFileUploadDialog.d.ts +21 -1
  9. package/components/SkillFileUploadDialog/SkillFileUploadDialog.d.ts.map +1 -1
  10. package/components/SkillFilesSummary/SkillFilesSummary.d.ts +5 -0
  11. package/components/SkillFilesSummary/SkillFilesSummary.d.ts.map +1 -0
  12. package/hooks/useDraftFolder.d.ts +4 -0
  13. package/hooks/useDraftFolder.d.ts.map +1 -1
  14. package/index.css +3 -2
  15. package/index.js +1084 -813
  16. package/models/skill-create-folder-dialog-props.d.ts +27 -0
  17. package/models/skill-create-folder-dialog-props.d.ts.map +1 -0
  18. package/models/skill-editor-dialog-props.d.ts +36 -0
  19. package/models/skill-editor-dialog-props.d.ts.map +1 -0
  20. package/models/skill-editor-props.d.ts +63 -11
  21. package/models/skill-editor-props.d.ts.map +1 -1
  22. package/models/skill-files-summary-props.d.ts +19 -0
  23. package/models/skill-files-summary-props.d.ts.map +1 -0
  24. package/package.json +7 -7
  25. package/types/skill-add-source.d.ts +1 -3
  26. package/types/skill-add-source.d.ts.map +1 -1
  27. package/types/skill-file-conflict-resolution.d.ts +8 -0
  28. package/types/skill-file-conflict-resolution.d.ts.map +1 -0
  29. package/utils/file-tree.d.ts +6 -4
  30. package/utils/file-tree.d.ts.map +1 -1
  31. package/utils/icon.d.ts +2 -1
  32. package/utils/icon.d.ts.map +1 -1
package/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as t, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, TAG_INPUT_TAG_CLASS_NAME as i, TextRefinementField as a, buildCssVars as o, formatFileSize as s, mergeClasses as c, useAvailableHeightCap as l, useTextRefinement as u } from "@epam/ai-dial-chat-shared";
2
- import { Accordion as d, ButtonAppearance as f, ButtonDropdown as p, ButtonVariant as m, CaptionText as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, DangerIconButton as v, EditorThemes as y, ElementSize as b, ErrorText as x, FileDropzone as S, GhostButton as C, GhostIconButton as w, Input as T, Label as E, LinkButton as D, NeutralButton as O, Popup as k, PopupSize as ee, PrimaryButton as A, Select as te, Spinner as ne, TagInput as j, Textarea as M, TextareaResize as N } from "@epam/ai-dial-ui-kit";
3
- import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
4
- import { IconArrowNarrowLeft as L, IconDatabase as re, IconFileText as ie, IconFileZip as ae, IconFolderPlus as oe, IconPhoto as se, IconPlus as ce, IconTrashX as le, IconUpload as ue } from "@tabler/icons-react";
5
- import { Suspense as de, lazy as R, memo as fe, useCallback as z, useEffect as pe, useId as me, useMemo as B, useRef as V, useState as H } from "react";
6
- import { DialFileNodeType as he, DialFoldersTree as ge } from "@epam/ai-dial-react-file-manager";
7
- import { LazyMarkdownEditor as _e } from "@epam/ai-dial-ui-kit/editors";
1
+ import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as t, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, TAG_INPUT_TAG_CLASS_NAME as i, TextRefinementField as a, buildCssVars as o, formatFileSize as s, mergeClasses as c, useAvailableHeightCap as l, useControlErrorAssociation as u, useIsMobile as d, useTextRefinement as f } from "@epam/ai-dial-chat-shared";
2
+ import { Accordion as p, BottomSheet as m, ButtonAppearance as h, ButtonDropdown as g, ButtonVariant as _, CaptionText as v, DIAL_ICON_SIZE as y, DIAL_KIT_ICON_STROKE as b, DangerIconButton as x, EditorThemes as S, ElementSize as C, ErrorMessageNotification as w, ErrorText as T, FileDropzone as E, FileName as D, GhostButton as O, GhostIconButton as ee, Input as k, Label as A, LinkButton as te, LiveRegion as ne, LiveRegionElement as re, LiveRegionPoliteness as ie, NeutralButton as j, Popup as ae, PopupSize as oe, PrimaryButton as se, RadioGroup as ce, ResizeHandle as M, Select as le, Spinner as ue, TagInput as de, Textarea as fe, TextareaResize as pe } from "@epam/ai-dial-ui-kit";
3
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
4
+ import { IconArrowNarrowLeft as me, IconDatabase as he, IconFileZip as ge, IconFolderPlus as _e, IconPhoto as I, IconPlus as ve, IconTrashX as ye, IconUpload as be } from "@tabler/icons-react";
5
+ import { Suspense as xe, lazy as Se, memo as Ce, useCallback as L, useEffect as R, useId as we, useMemo as z, useRef as B, useState as V } from "react";
6
+ import { DialFileNodeType as Te, DialFoldersTree as Ee } from "@epam/ai-dial-react-file-manager";
7
+ import { LazyMarkdownEditor as De } from "@epam/ai-dial-ui-kit/editors";
8
8
  c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
9
9
  body: "_body_1xd7h_2",
10
10
  sideColumn: "_sideColumn_1xd7h_6",
@@ -12,310 +12,355 @@ c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
12
12
  }.sideColumn);
13
13
  //#endregion
14
14
  //#region ../builder-form/src/constants/public-class-names.ts
15
- var ve = {
15
+ var H = {
16
16
  layout: "dial-builder-form-layout",
17
17
  section: "dial-builder-form-section",
18
18
  metadataSection: "dial-builder-form-metadata-section",
19
19
  setupSection: "dial-builder-form-setup-section",
20
20
  asideSection: "dial-builder-form-aside-section"
21
- }, ye = {
21
+ }, Oe = {
22
22
  section: "_section_l1mnx_1",
23
23
  title: "_title_l1mnx_5"
24
- }, be = ({ title: e, children: t, styles: n, className: r }) => {
24
+ }, ke = ({ title: e, children: t, styles: n, className: r }) => {
25
25
  let i = o({
26
26
  "--es-border-color": n?.colors?.borderColor,
27
27
  "--es-title-color": n?.colors?.titleColor
28
28
  });
29
- return /* @__PURE__ */ I("section", {
30
- className: c("flex h-full flex-col gap-4 rounded border p-6", ye.section, r, ve.section),
29
+ return /* @__PURE__ */ F("section", {
30
+ className: c("flex h-full flex-col gap-4 rounded border p-6", Oe.section, r, H.section),
31
31
  style: i,
32
- children: [e != null && /* @__PURE__ */ F("h2", {
33
- className: c("dial-h3-text", ye.title),
32
+ children: [e != null && /* @__PURE__ */ P("h2", {
33
+ className: c(n?.typography?.titleClassName ?? "dial-h3-text", Oe.title),
34
34
  children: e
35
35
  }), t]
36
36
  });
37
- }, xe = {
37
+ }, U = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
38
+ let i = r != null && r > 0 ? r - 360 : n;
39
+ return Math.round(Math.min(Math.max(t, Math.min(n, i)), Math.max(t, Number.isFinite(e) ? e : t)));
40
+ }, Ae = {
38
41
  headerBorder: "_headerBorder_1adw2_1",
39
42
  footerBorder: "_footerBorder_1adw2_5",
40
43
  columnBorder: "_columnBorder_1adw2_10"
41
- }, Se = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, centerContent: a, rightContent: s, isSaving: l = !1, labels: u, styles: d, dir: f }) => {
42
- let p = me(), m = l ? u?.savingStatusLabel ?? "Saving" : "", h = o({
43
- "--el-header-border-color": d?.colors?.headerBorderColor,
44
- "--el-sidebar-border-color": d?.colors?.sidebarBorderColor
44
+ }, je = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, centerContent: a, rightContent: s, resizableLeftColumn: l, isSaving: u = !1, labels: d, styles: f, dir: p }) => {
45
+ let m = we(), h = u ? d?.savingStatusLabel ?? "Saving" : "", g = B(null), [_, v] = V(), x = l != null && a != null, S = l?.minWidth, C = l?.maxWidth, w = {
46
+ min: S,
47
+ max: C,
48
+ containerWidth: _
49
+ }, T = x ? U(l.width, w) : void 0, E = U(C ?? 640, w);
50
+ R(() => {
51
+ let e = g.current;
52
+ if (!x || e == null || typeof ResizeObserver > "u") return;
53
+ let t = new ResizeObserver(() => v(e.clientWidth));
54
+ return t.observe(e), () => t.disconnect();
55
+ }, [x]);
56
+ let D = o({
57
+ "--el-header-border-color": f?.colors?.headerBorderColor,
58
+ "--el-sidebar-border-color": f?.colors?.sidebarBorderColor
45
59
  });
46
- return /* @__PURE__ */ I("div", {
47
- dir: f,
48
- className: c("flex min-h-0 flex-1 flex-col", ve.layout),
49
- style: h,
60
+ return /* @__PURE__ */ F("div", {
61
+ dir: p,
62
+ className: c("flex min-h-0 flex-1 flex-col", H.layout),
63
+ style: D,
50
64
  children: [
51
- /* @__PURE__ */ F("span", {
52
- role: "status",
53
- "aria-live": "polite",
54
- className: "sr-only",
55
- id: p,
56
- children: m
65
+ /* @__PURE__ */ P(ne, {
66
+ visuallyHidden: !0,
67
+ as: re.Span,
68
+ id: m,
69
+ children: h
57
70
  }),
58
- /* @__PURE__ */ I("div", {
59
- className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", xe.headerBorder),
60
- children: [/* @__PURE__ */ I("div", {
71
+ /* @__PURE__ */ F("div", {
72
+ className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", Ae.headerBorder),
73
+ children: [/* @__PURE__ */ F("div", {
61
74
  className: "flex min-w-0 flex-1 items-center gap-2",
62
- children: [/* @__PURE__ */ F(w, {
63
- icon: /* @__PURE__ */ F(L, {
64
- size: g.LG,
65
- stroke: _,
75
+ children: [/* @__PURE__ */ P(ee, {
76
+ icon: /* @__PURE__ */ P(me, {
77
+ size: y.LG,
78
+ stroke: b,
66
79
  "aria-hidden": !0,
67
80
  className: "rtl:scale-x-[-1]"
68
81
  }),
69
82
  "aria-label": n,
70
83
  onClick: t
71
- }), /* @__PURE__ */ F("h1", {
72
- className: "dial-h2-text min-w-0 truncate",
84
+ }), /* @__PURE__ */ P("h1", {
85
+ className: c(f?.typography?.titleClassName ?? "dial-h2-text", "min-w-0 truncate"),
73
86
  children: e
74
87
  })]
75
- }), r != null && /* @__PURE__ */ F("div", {
88
+ }), r != null && /* @__PURE__ */ P("div", {
76
89
  className: "hidden shrink-0 items-center gap-2 desktop:flex",
77
90
  children: r
78
91
  })]
79
92
  }),
80
- /* @__PURE__ */ I("div", {
93
+ /* @__PURE__ */ F("div", {
94
+ ref: g,
81
95
  className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
82
96
  children: [
83
- /* @__PURE__ */ F("div", {
84
- className: c(a == null ? "desktop:flex-1" : "desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", a == null ? void 0 : xe.columnBorder),
97
+ /* @__PURE__ */ P("div", {
98
+ className: c(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !x && "desktop:w-[400px]", x && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", a == null ? void 0 : Ae.columnBorder),
99
+ style: T == null ? void 0 : { "--el-left-width": `${T}px` },
85
100
  children: i
86
101
  }),
87
- a != null && /* @__PURE__ */ F("div", {
102
+ x && T != null && /* @__PURE__ */ P("div", {
103
+ className: "relative hidden w-0 shrink-0 desktop:block",
104
+ children: /* @__PURE__ */ P(M, {
105
+ width: T,
106
+ minWidth: S ?? 280,
107
+ maxWidth: E,
108
+ defaultWidth: l.defaultWidth ?? 400,
109
+ onWidthChange: l.onWidthChange,
110
+ label: d?.resizeHandleLabel ?? "Resize columns",
111
+ tooltip: d?.resizeHandleTooltip ?? "Drag to resize"
112
+ })
113
+ }),
114
+ a != null && /* @__PURE__ */ P("div", {
88
115
  className: "desktop:flex desktop:min-h-0 desktop:flex-1 desktop:flex-col desktop:overflow-y-auto",
89
116
  children: a
90
117
  }),
91
- s != null && /* @__PURE__ */ F("div", {
92
- className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", xe.columnBorder),
118
+ s != null && /* @__PURE__ */ P("div", {
119
+ className: c("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", Ae.columnBorder),
93
120
  children: s
94
121
  })
95
122
  ]
96
123
  }),
97
- r != null && /* @__PURE__ */ F("div", {
98
- className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", xe.footerBorder),
124
+ r != null && /* @__PURE__ */ P("div", {
125
+ className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", Ae.footerBorder),
99
126
  children: r
100
127
  })
101
128
  ]
102
129
  });
103
- }, Ce = {
130
+ }, Me = {
104
131
  box: "_box_c9as8_1",
105
132
  icon: "_icon_c9as8_6",
106
133
  caption: "_caption_c9as8_10"
107
- }, we = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, styles: s, className: l }) => {
108
- let u = o({
109
- "--aa-box-bg": s?.colors?.boxBackgroundColor,
110
- "--aa-box-border": s?.colors?.boxBorderColor,
111
- "--aa-icon": s?.colors?.placeholderIconColor,
112
- "--aa-caption": s?.colors?.captionColor
134
+ }, W = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, captionClassName: s = "dial-tiny-text", styles: l, className: u }) => {
135
+ let d = o({
136
+ "--aa-box-bg": l?.colors?.boxBackgroundColor,
137
+ "--aa-box-border": l?.colors?.boxBorderColor,
138
+ "--aa-icon": l?.colors?.placeholderIconColor,
139
+ "--aa-caption": l?.colors?.captionColor
113
140
  });
114
- return /* @__PURE__ */ I("div", {
115
- className: c("flex flex-col gap-2", l),
116
- style: u,
117
- children: [/* @__PURE__ */ F(E, { label: e }), /* @__PURE__ */ I("div", {
141
+ return /* @__PURE__ */ F("div", {
142
+ className: c("flex flex-col gap-2", u),
143
+ style: d,
144
+ children: [/* @__PURE__ */ P(A, { label: e }), /* @__PURE__ */ F("div", {
118
145
  className: "flex items-start gap-3",
119
- children: [/* @__PURE__ */ F("div", {
120
- className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Ce.box),
121
- children: t ? /* @__PURE__ */ F("img", {
146
+ children: [/* @__PURE__ */ P("div", {
147
+ className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Me.box),
148
+ children: t ? /* @__PURE__ */ P("img", {
122
149
  src: t,
123
150
  alt: n,
124
151
  className: "h-16 w-16 object-cover"
125
- }) : /* @__PURE__ */ F(se, {
126
- size: g.LG,
127
- stroke: _,
152
+ }) : /* @__PURE__ */ P(I, {
153
+ size: y.LG,
154
+ stroke: b,
128
155
  "aria-hidden": !0,
129
- className: Ce.icon
156
+ className: Me.icon
130
157
  })
131
- }), /* @__PURE__ */ I("div", {
158
+ }), /* @__PURE__ */ F("div", {
132
159
  className: "flex flex-col gap-3",
133
- children: [/* @__PURE__ */ F(C, {
134
- size: b.Small,
135
- iconBefore: /* @__PURE__ */ F(ce, {
136
- size: g.SM,
137
- stroke: _,
160
+ children: [/* @__PURE__ */ P(O, {
161
+ size: C.Small,
162
+ iconBefore: /* @__PURE__ */ P(ve, {
163
+ size: y.SM,
164
+ stroke: b,
138
165
  "aria-hidden": !0
139
166
  }),
140
167
  className: "w-fit",
141
168
  label: r,
142
169
  onClick: a
143
- }), /* @__PURE__ */ F("span", {
144
- className: c("dial-tiny-text", Ce.caption),
170
+ }), /* @__PURE__ */ P("span", {
171
+ className: c(s, Me.caption),
145
172
  children: i
146
173
  })]
147
174
  })]
148
175
  })]
149
176
  });
150
- }, Te = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: o, labels: s }) => {
151
- let c = z((e) => e.length === 1 ? s.deleteConfirmTitleSingle : s.deleteConfirmTitleMultiple, [s.deleteConfirmTitleSingle, s.deleteConfirmTitleMultiple]), l = z((e) => /* @__PURE__ */ F("div", {
152
- className: "dial-small-text px-6 py-3",
153
- children: /* @__PURE__ */ F("p", {
154
- className: "mb-3 text-secondary",
155
- children: e.length === 1 ? /* @__PURE__ */ I(P, { children: [
156
- s.deleteConfirmSingleText,
177
+ }, Ne = {
178
+ confirmText: "_confirmText_19ec1_1",
179
+ confirmItem: "_confirmItem_19ec1_5"
180
+ }, Pe = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: s, labels: l, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
181
+ let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = L((e) => e.length === 1 ? l.deleteConfirmTitleSingle : l.deleteConfirmTitleMultiple, [l.deleteConfirmTitleSingle, l.deleteConfirmTitleMultiple]), h = L((e) => /* @__PURE__ */ P("div", {
182
+ className: c(u, "px-6 py-3"),
183
+ style: o({
184
+ "--apm-confirm-text": f,
185
+ "--apm-confirm-item-text": p
186
+ }),
187
+ children: /* @__PURE__ */ P("p", {
188
+ className: c("mb-3", Ne.confirmText),
189
+ children: e.length === 1 ? /* @__PURE__ */ F(N, { children: [
190
+ l.deleteConfirmSingleText,
157
191
  " ",
158
- /* @__PURE__ */ I("span", {
159
- className: "break-words text-primary",
192
+ /* @__PURE__ */ F("span", {
193
+ className: c("wrap-break-word", Ne.confirmItem),
160
194
  children: [
161
195
  "\"",
162
196
  e[0].split("/").pop(),
163
197
  "\"?"
164
198
  ]
165
199
  })
166
- ] }) : /* @__PURE__ */ I(P, { children: [
167
- s.deleteConfirmMultipleText,
200
+ ] }) : /* @__PURE__ */ F(N, { children: [
201
+ l.deleteConfirmMultipleText,
168
202
  " ",
169
- /* @__PURE__ */ I("span", {
170
- className: "text-primary",
203
+ /* @__PURE__ */ F("span", {
204
+ className: Ne.confirmItem,
171
205
  children: [
172
206
  e.length,
173
207
  " ",
174
- s.deleteConfirmItemsLabel
208
+ l.deleteConfirmItemsLabel
175
209
  ]
176
210
  })
177
211
  ] })
178
212
  })
179
213
  }), [
180
- s.deleteConfirmSingleText,
181
- s.deleteConfirmMultipleText,
182
- s.deleteConfirmItemsLabel
214
+ l.deleteConfirmSingleText,
215
+ l.deleteConfirmMultipleText,
216
+ l.deleteConfirmItemsLabel,
217
+ f,
218
+ p,
219
+ u
183
220
  ]);
184
- return /* @__PURE__ */ F(de, {
221
+ return /* @__PURE__ */ P(xe, {
185
222
  fallback: null,
186
- children: e && /* @__PURE__ */ F(i, {
223
+ children: e && /* @__PURE__ */ P(i, {
187
224
  isOpen: e,
188
225
  onClose: t,
189
226
  onAttach: n,
190
227
  bucket: r,
191
228
  allowedTypes: a,
192
- maxSelectableFileSize: o,
229
+ maxSelectableFileSize: s,
193
230
  maximumAttachmentsAmount: 1,
194
231
  canAttachFolders: !1,
195
- title: s.title,
196
- attachLabel: s.attachLabel,
197
- emptyTitle: s.emptyTitle,
198
- emptyDescription: s.emptyDescription,
199
- errorMessage: s.errorMessage,
200
- retryLabel: s.retryLabel,
201
- hiddenFilesLabel: s.hiddenFilesLabel,
202
- showHiddenFilesLabel: s.showHiddenFilesLabel,
203
- hideHiddenFilesLabel: s.hideHiddenFilesLabel,
204
- getSelectionLabel: s.getSelectionLabel,
205
- uploadFilesLabel: s.uploadFilesLabel,
206
- newFolderLabel: s.newFolderLabel,
207
- downloadLabel: s.downloadLabel,
208
- downloadingLabel: s.downloadingLabel,
209
- deleteLabel: s.deleteLabel,
210
- deletingLabel: s.deletingLabel,
211
- deleteConfirmTitle: c,
212
- deleteConfirmBody: l,
213
- deleteConfirmLabel: s.deleteConfirmLabel,
214
- deleteCancelLabel: s.deleteCancelLabel
232
+ title: l.title,
233
+ attachLabel: l.attachLabel,
234
+ emptyTitle: l.emptyTitle,
235
+ emptyDescription: l.emptyDescription,
236
+ errorMessage: l.errorMessage,
237
+ retryLabel: l.retryLabel,
238
+ hiddenFilesLabel: l.hiddenFilesLabel,
239
+ showHiddenFilesLabel: l.showHiddenFilesLabel,
240
+ hideHiddenFilesLabel: l.hideHiddenFilesLabel,
241
+ getSelectionLabel: l.getSelectionLabel,
242
+ uploadFilesLabel: l.uploadFilesLabel,
243
+ newFolderLabel: l.newFolderLabel,
244
+ downloadLabel: l.downloadLabel,
245
+ downloadingLabel: l.downloadingLabel,
246
+ deleteLabel: l.deleteLabel,
247
+ deletingLabel: l.deletingLabel,
248
+ deleteConfirmTitle: m,
249
+ deleteConfirmBody: h,
250
+ deleteConfirmLabel: l.deleteConfirmLabel,
251
+ deleteCancelLabel: l.deleteCancelLabel
215
252
  })
216
253
  });
217
- }, U = /* @__PURE__ */ function(e) {
254
+ }, G = /* @__PURE__ */ function(e) {
218
255
  return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
219
- }({}), Ee = [
256
+ }({}), Fe = [
220
257
  "avatar",
221
258
  "name",
222
259
  "version",
223
260
  "description",
224
261
  "locales",
225
262
  "tags"
226
- ], De = (e, t, n) => ({
263
+ ], Ie = {
264
+ summary: "_summary_1hlc9_1",
265
+ rowLabel: "_rowLabel_1hlc9_5"
266
+ }, Le = (e, t, n) => ({
227
267
  id: e,
228
268
  language: n.find((e) => !t.has(e.code))?.code ?? "",
229
269
  name: "",
230
270
  description: ""
231
- }), W = ({ value: e, onChange: t, availableLocaleOptions: n = [], labels: i, className: a, summaryClassName: o = "dial-body-text text-secondary", rowLabelClassName: s = "dial-tiny-lead-text text-secondary" }) => {
232
- let { summaryLabel: l, addLabel: u, editLabel: d, popupTitle: p, addLocaleLabel: h, localeRowLabel: y = "Locale", languageLabel: x, nameLabel: S, namePlaceholder: C, descriptionLabel: w, descriptionPlaceholder: E, deleteAriaLabel: O, cancelLabel: ee = "Cancel", saveLabel: A = "Save" } = i, [ne, j] = H(!1), [P, L] = H([]), re = V(0);
233
- pe(() => {
234
- ne && L(e.length > 0 ? e : [De(`locale-row-${++re.current}`, /* @__PURE__ */ new Set(), n)]);
271
+ }), Re = ({ value: e, onChange: t, availableLocaleOptions: n = [], labels: i, className: a, summaryClassName: s = "dial-body-text", rowLabelClassName: l = "dial-tiny-lead-text", colors: u }) => {
272
+ let d = o({
273
+ "--dlf-summary-text": u?.summaryText,
274
+ "--dlf-row-label-text": u?.rowLabelText
275
+ }), { summaryLabel: f, addLabel: p, editLabel: m, popupTitle: g, addLocaleLabel: v, localeRowLabel: S = "Locale", languageLabel: w, nameLabel: T, namePlaceholder: E, descriptionLabel: D, descriptionPlaceholder: O, deleteAriaLabel: ee, cancelLabel: A = "Cancel", saveLabel: ne = "Save" } = i, [re, ie] = V(!1), [j, oe] = V([]), se = B(0);
276
+ R(() => {
277
+ re && oe(e.length > 0 ? e : [Le(`locale-row-${++se.current}`, /* @__PURE__ */ new Set(), n)]);
235
278
  }, [
236
- ne,
279
+ re,
237
280
  e,
238
281
  n
239
282
  ]);
240
- let ie = () => j(!0), ae = () => j(!1), oe = () => {
241
- t(P.filter((e) => e.language && e.name)), j(!1);
242
- }, se = () => {
243
- let e = new Set(P.map((e) => e.language).filter(Boolean));
244
- L((t) => [...t, De(`locale-row-${++re.current}`, e, n)]);
245
- }, ue = (e, t) => {
246
- L((n) => n.map((n) => n.id === e ? {
283
+ let ce = () => ie(!0), M = () => ie(!1), ue = () => {
284
+ t(j.filter((e) => e.language && e.name)), ie(!1);
285
+ }, de = () => {
286
+ let e = new Set(j.map((e) => e.language).filter(Boolean));
287
+ oe((t) => [...t, Le(`locale-row-${++se.current}`, e, n)]);
288
+ }, N = (e, t) => {
289
+ oe((n) => n.map((n) => n.id === e ? {
247
290
  ...n,
248
291
  ...t
249
292
  } : n));
250
- }, de = (e) => {
251
- L((t) => t.filter((t) => t.id !== e));
252
- }, R = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), fe = P.some((e) => !e.language || !e.name);
253
- return n.length === 0 ? null : /* @__PURE__ */ I("div", {
293
+ }, me = (e) => {
294
+ oe((t) => t.filter((t) => t.id !== e));
295
+ }, he = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), ge = j.some((e) => !e.language || !e.name);
296
+ return n.length === 0 ? null : /* @__PURE__ */ F("div", {
254
297
  className: c("flex items-center gap-2", a),
298
+ style: d,
255
299
  children: [
256
- e.length > 0 && /* @__PURE__ */ F("span", {
257
- className: o,
258
- children: `${l}: ${e.map((e) => `[${R(e.language)}]`).join(", ")}`
300
+ e.length > 0 && /* @__PURE__ */ P("span", {
301
+ className: c(Ie.summary, s),
302
+ children: `${f}: ${e.map((e) => `[${he(e.language)}]`).join(", ")}`
259
303
  }),
260
- /* @__PURE__ */ F(D, {
261
- label: e.length > 0 ? d : u,
262
- iconBefore: /* @__PURE__ */ F(ce, {
263
- size: g.SM,
304
+ /* @__PURE__ */ P(te, {
305
+ label: e.length > 0 ? m : p,
306
+ iconBefore: /* @__PURE__ */ P(ve, {
307
+ size: y.SM,
264
308
  "aria-hidden": !0,
265
- stroke: _
309
+ stroke: b
266
310
  }),
267
- className: "!px-0",
268
- onClick: ie
311
+ className: "px-0!",
312
+ onClick: ce
269
313
  }),
270
- /* @__PURE__ */ F(k, {
271
- open: ne,
272
- header: p,
273
- onClose: ae,
314
+ /* @__PURE__ */ P(ae, {
315
+ open: re,
316
+ header: g,
317
+ onClose: M,
274
318
  mainButtons: [{
275
- label: ee,
276
- onClick: ae
277
- }, {
278
319
  label: A,
279
- variant: m.Primary,
280
- disabled: fe,
281
- onClick: oe
320
+ onClick: M
321
+ }, {
322
+ label: ne,
323
+ variant: _.Primary,
324
+ disabled: ge,
325
+ onClick: ue
282
326
  }],
283
- children: /* @__PURE__ */ I("div", {
327
+ children: /* @__PURE__ */ F("div", {
284
328
  className: "flex flex-col gap-8 px-6 py-3",
285
- children: [P.map((e, t) => {
286
- let i = new Set(P.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
287
- return /* @__PURE__ */ I("div", {
329
+ style: d,
330
+ children: [j.map((e, t) => {
331
+ let i = new Set(j.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
332
+ return /* @__PURE__ */ F("div", {
288
333
  className: "flex flex-col gap-2",
289
- children: [/* @__PURE__ */ I("div", {
334
+ children: [/* @__PURE__ */ F("div", {
290
335
  className: "flex items-center justify-between",
291
- children: [/* @__PURE__ */ I("span", {
292
- className: s,
336
+ children: [/* @__PURE__ */ F("span", {
337
+ className: c(Ie.rowLabel, l),
293
338
  children: [
294
- y,
339
+ S,
295
340
  " ",
296
341
  t + 1
297
342
  ]
298
- }), /* @__PURE__ */ F(v, {
299
- appearance: f.Ghost,
300
- size: b.Small,
301
- icon: /* @__PURE__ */ F(le, {
302
- size: g.SM,
343
+ }), /* @__PURE__ */ P(x, {
344
+ appearance: h.Ghost,
345
+ size: C.Small,
346
+ icon: /* @__PURE__ */ P(ye, {
347
+ size: y.SM,
303
348
  "aria-hidden": !0,
304
- stroke: _
349
+ stroke: b
305
350
  }),
306
- "aria-label": `${O} ${t + 1}`,
307
- onClick: () => de(e.id)
351
+ "aria-label": `${ee} ${t + 1}`,
352
+ onClick: () => me(e.id)
308
353
  })]
309
- }), /* @__PURE__ */ I("div", {
354
+ }), /* @__PURE__ */ F("div", {
310
355
  role: "group",
311
- "aria-label": `${y} ${t + 1}`,
356
+ "aria-label": `${S} ${t + 1}`,
312
357
  className: "flex flex-col gap-5",
313
- children: [/* @__PURE__ */ I("div", {
358
+ children: [/* @__PURE__ */ F("div", {
314
359
  className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
315
- children: [/* @__PURE__ */ F(te, {
360
+ children: [/* @__PURE__ */ P(le, {
316
361
  id: `${e.id}-language`,
317
362
  labelProps: {
318
- label: x,
363
+ label: w,
319
364
  required: !0
320
365
  },
321
366
  className: "desktop:shrink-0 desktop:basis-40",
@@ -325,86 +370,83 @@ var ve = {
325
370
  disabled: i.has(e.code)
326
371
  })),
327
372
  value: e.language,
328
- onChange: (t) => ue(e.id, { language: t })
329
- }), /* @__PURE__ */ F(T, {
373
+ onChange: (t) => N(e.id, { language: t })
374
+ }), /* @__PURE__ */ P(k, {
330
375
  id: `${e.id}-name`,
331
376
  containerClassName: "min-w-0 flex-1",
332
377
  required: !0,
333
378
  value: e.name,
334
- onChange: (t) => ue(e.id, { name: t ?? "" }),
379
+ onChange: (t) => N(e.id, { name: t ?? "" }),
335
380
  labelProps: {
336
- label: S,
381
+ label: T,
337
382
  required: !0
338
383
  },
339
- placeholder: C
384
+ placeholder: E
340
385
  })]
341
- }), /* @__PURE__ */ F(M, {
386
+ }), /* @__PURE__ */ P(fe, {
342
387
  id: `${e.id}-description`,
343
388
  className: r,
344
- resize: N.Vertical,
389
+ resize: pe.Vertical,
345
390
  value: e.description,
346
- onChange: (t) => ue(e.id, { description: t }),
347
- labelProps: { label: w },
348
- placeholder: E
391
+ onChange: (t) => N(e.id, { description: t }),
392
+ labelProps: { label: D },
393
+ placeholder: O
349
394
  })]
350
395
  })]
351
396
  }, e.id);
352
- }), /* @__PURE__ */ F(D, {
353
- label: h,
354
- iconBefore: /* @__PURE__ */ F(ce, {
355
- size: g.SM,
397
+ }), /* @__PURE__ */ P(te, {
398
+ label: v,
399
+ iconBefore: /* @__PURE__ */ P(ve, {
400
+ size: y.SM,
356
401
  "aria-hidden": !0,
357
- stroke: _
402
+ stroke: b
358
403
  }),
359
404
  className: "self-start",
360
- onClick: se,
361
- disabled: P.length >= n.length
405
+ onClick: de,
406
+ disabled: j.length >= n.length
362
407
  })]
363
408
  })
364
409
  })
365
410
  ]
366
411
  });
367
- }, Oe = "Add tags, comma separated", ke = "deployment-creation-form-description", G = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Ee, isNameReadOnly: m = !1, nameCaption: h, isDescriptionRequired: g = !1, renderDescription: _, focusRequestKey: v }) => {
368
- let y = V(null), b = V(null), x = V(null), S = V(!1), C = (e) => p.includes(e), w = C(U.Name), E = C(U.Version), D = !!(t.name || t.version || t.description), O = V(v);
369
- pe(() => {
412
+ }, ze = "Add tags, comma separated", Be = "deployment-creation-form-description", Ve = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Fe, isNameReadOnly: m = !1, nameReadOnlyTooltip: h, nameCaption: g, isDescriptionRequired: _ = !1, descriptionCaption: v, renderDescription: y, focusRequestKey: b }) => {
413
+ let x = B(null), S = B(null), C = B(null), w = B(!1), T = (e) => p.includes(e), E = T(G.Name), D = T(G.Version), O = !!(t.name || t.version || t.description), ee = B(b);
414
+ R(() => {
370
415
  let e = () => {
371
- t.name ? y.current?.focus() : t.version ? b.current?.focus() : t.description && x.current?.focus();
416
+ t.name ? x.current?.focus() : t.version ? S.current?.focus() : t.description && C.current?.focus();
372
417
  };
373
- if (v !== void 0) {
374
- v !== O.current && (O.current = v, e());
375
- return;
376
- }
377
- D && !S.current && e(), S.current = D;
418
+ b === void 0 ? (O && !w.current && e(), w.current = O) : b !== ee.current && (ee.current = b, e());
378
419
  }, [
379
- v,
380
- D,
420
+ b,
421
+ O,
381
422
  t.name,
382
423
  t.version,
383
424
  t.description
384
425
  ]);
385
- let k = /* @__PURE__ */ F(M, {
386
- id: ke,
387
- ref: x,
426
+ let A = /* @__PURE__ */ P(fe, {
427
+ id: Be,
428
+ ref: C,
388
429
  value: e.description,
389
430
  onChange: (e) => n({ description: e }),
390
- "aria-required": g || void 0,
391
- labelProps: _ ? void 0 : {
431
+ "aria-required": _ || void 0,
432
+ labelProps: y ? void 0 : {
392
433
  label: u.description.label,
393
- required: g
434
+ required: _
394
435
  },
395
436
  placeholder: u.description.placeholder,
437
+ caption: v,
396
438
  error: t.description || void 0,
397
439
  invalid: !!t.description,
398
- containerClassName: _ ? void 0 : d?.field,
440
+ containerClassName: y ? void 0 : d?.field,
399
441
  className: r,
400
- resize: N.Vertical
442
+ resize: pe.Vertical
401
443
  });
402
- return /* @__PURE__ */ I("div", {
444
+ return /* @__PURE__ */ F("div", {
403
445
  role: u.ariaLabel ? "group" : void 0,
404
446
  "aria-label": u.ariaLabel,
405
447
  className: c("flex flex-col gap-4", d?.root),
406
448
  children: [
407
- C(U.Avatar) && /* @__PURE__ */ F(we, {
449
+ T(G.Avatar) && /* @__PURE__ */ P(W, {
408
450
  label: u.iconUrl.label,
409
451
  avatarUrl: s,
410
452
  addAvatarLabel: u.iconUrl.addAvatarLabel,
@@ -412,27 +454,28 @@ var ve = {
412
454
  onAddAvatarClick: l,
413
455
  className: d?.field
414
456
  }),
415
- (w || E) && /* @__PURE__ */ I("div", {
457
+ (E || D) && /* @__PURE__ */ F("div", {
416
458
  className: c("flex items-start gap-4", d?.field),
417
- children: [w && /* @__PURE__ */ F(T, {
459
+ children: [E && /* @__PURE__ */ P(k, {
418
460
  id: "deployment-creation-form-name",
419
- inputRef: y,
461
+ inputRef: x,
420
462
  value: e.name,
421
463
  onChange: (e) => n({ name: e ?? "" }),
422
464
  onBlur: a,
423
- readOnly: m,
465
+ disabled: m,
466
+ tooltipText: m ? h : void 0,
424
467
  labelProps: {
425
468
  label: u.name.label,
426
469
  required: !0
427
470
  },
428
471
  placeholder: u.name.placeholder,
429
- caption: h,
472
+ caption: g,
430
473
  error: t.name || void 0,
431
474
  invalid: !!t.name,
432
- containerClassName: E ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
433
- }), E && /* @__PURE__ */ F(T, {
475
+ containerClassName: D ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
476
+ }), D && /* @__PURE__ */ P(k, {
434
477
  id: "deployment-creation-form-version",
435
- inputRef: b,
478
+ inputRef: S,
436
479
  value: e.version,
437
480
  onChange: (e) => n({ version: e ?? "" }),
438
481
  onBlur: o,
@@ -440,26 +483,27 @@ var ve = {
440
483
  placeholder: u.version.placeholder,
441
484
  error: t.version || void 0,
442
485
  invalid: !!t.version,
443
- containerClassName: w ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
486
+ containerClassName: E ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
444
487
  })]
445
488
  }),
446
- C(U.Description) && (_ ? /* @__PURE__ */ F("div", {
489
+ T(G.Description) && (y ? /* @__PURE__ */ P("div", {
447
490
  className: d?.field,
448
- children: _(k, ke)
449
- }) : k),
450
- C(U.Locales) && /* @__PURE__ */ F(W, {
491
+ children: y(A, Be)
492
+ }) : A),
493
+ T(G.Locales) && /* @__PURE__ */ P(Re, {
451
494
  value: e.otherLocales,
452
495
  onChange: (e) => n({ otherLocales: e }),
453
496
  availableLocaleOptions: f,
454
497
  labels: u.otherLocales,
455
- className: d?.field
498
+ className: d?.field,
499
+ colors: d?.localesColors
456
500
  }),
457
- C(U.Tags) && /* @__PURE__ */ F("div", {
501
+ T(G.Tags) && /* @__PURE__ */ P("div", {
458
502
  className: d?.field,
459
- children: /* @__PURE__ */ F(j, {
503
+ children: /* @__PURE__ */ P(de, {
460
504
  id: "deployment-creation-form-topics",
461
505
  labelProps: { label: u.topics.label },
462
- placeholder: u.topics.placeholder ?? Oe,
506
+ placeholder: u.topics.placeholder ?? ze,
463
507
  value: e.topics,
464
508
  onChange: (e) => n({ topics: e }),
465
509
  tagClassName: i
@@ -467,53 +511,58 @@ var ve = {
467
511
  })
468
512
  ]
469
513
  });
470
- }, Ae = "border-0 p-4 desktop:p-8", je = "desktop:flex-1", Me = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ne = fe(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, metadataSectionClassName: y, setupSectionClassName: b, labels: x, styles: S, dir: C }) => {
471
- let w = v == null ? null : /* @__PURE__ */ F("div", {
472
- role: "alert",
473
- className: Me,
514
+ }, He = "border-0 p-4 desktop:p-8", Ue = "desktop:flex-1", We = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ge = Ce(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, resizableLeftColumn: y, metadataSectionClassName: b, setupSectionClassName: x, labels: S, styles: C, dir: w }) => {
515
+ let T = /* @__PURE__ */ P(ne, {
516
+ politeness: ie.Assertive,
517
+ className: v == null ? void 0 : We,
474
518
  children: v
475
- }), T = p != null;
476
- return /* @__PURE__ */ F(Se, {
519
+ }), E = p != null;
520
+ return /* @__PURE__ */ P(je, {
477
521
  title: e,
478
522
  onBack: t,
479
- backAriaLabel: x?.backAriaLabel ?? "Back",
523
+ backAriaLabel: S?.backAriaLabel ?? "Back",
480
524
  isSaving: a,
481
- labels: { savingStatusLabel: x?.savingStatusLabel ?? "Saving" },
482
- rightContent: h == null ? void 0 : /* @__PURE__ */ F(be, {
525
+ resizableLeftColumn: y,
526
+ labels: {
527
+ savingStatusLabel: S?.savingStatusLabel ?? "Saving",
528
+ resizeHandleLabel: S?.resizeHandleLabel,
529
+ resizeHandleTooltip: S?.resizeHandleTooltip
530
+ },
531
+ rightContent: h == null ? void 0 : /* @__PURE__ */ P(ke, {
483
532
  title: g,
484
- styles: S?.section,
485
- className: c(Ae, _, ve.asideSection),
533
+ styles: C?.section,
534
+ className: c(He, _, H.asideSection),
486
535
  children: h
487
536
  }),
488
- styles: S?.layout,
489
- dir: C,
490
- actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(O, {
491
- label: x?.cancelLabel ?? "Cancel",
537
+ styles: C?.layout,
538
+ dir: w,
539
+ actions: /* @__PURE__ */ F(N, { children: [s, !l && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(j, {
540
+ label: S?.cancelLabel ?? "Cancel",
492
541
  disabled: a,
493
542
  onClick: n
494
- }), /* @__PURE__ */ F(A, {
543
+ }), /* @__PURE__ */ P(se, {
495
544
  label: i,
496
545
  disabled: a || o,
497
546
  onClick: r
498
547
  })] })] }),
499
- leftContent: /* @__PURE__ */ I(P, { children: [
500
- !T && w,
501
- /* @__PURE__ */ F(be, {
502
- title: d === null ? void 0 : d ?? x?.metadataTitle ?? "Metadata",
503
- styles: S?.section,
504
- className: c(Ae, y, ve.metadataSection),
548
+ leftContent: /* @__PURE__ */ F(N, { children: [
549
+ !E && T,
550
+ /* @__PURE__ */ P(ke, {
551
+ title: d === null ? void 0 : d ?? S?.metadataTitle ?? "Metadata",
552
+ styles: C?.section,
553
+ className: c(He, b, H.metadataSection),
505
554
  children: u
506
555
  }),
507
556
  f
508
557
  ] }),
509
- centerContent: T ? /* @__PURE__ */ I(P, { children: [w, /* @__PURE__ */ F(be, {
510
- title: m === null ? void 0 : m ?? x?.setupTitle ?? "Setup",
511
- styles: S?.section,
512
- className: c(Ae, je, b, ve.setupSection),
558
+ centerContent: E ? /* @__PURE__ */ F(N, { children: [T, /* @__PURE__ */ P(ke, {
559
+ title: m === null ? void 0 : m ?? S?.setupTitle ?? "Setup",
560
+ styles: C?.section,
561
+ className: c(He, Ue, x, H.setupSection),
513
562
  children: p
514
563
  })] }) : void 0
515
564
  });
516
- }), Pe = {
565
+ }), Ke = {
517
566
  name: {
518
567
  label: "Name",
519
568
  placeholder: "Enter name"
@@ -552,7 +601,7 @@ var ve = {
552
601
  saveLabel: "Save"
553
602
  },
554
603
  ariaLabel: "Metadata"
555
- }, Fe = {
604
+ }, qe = {
556
605
  title: "Add avatar",
557
606
  attachLabel: "Attach",
558
607
  emptyTitle: "This folder is empty",
@@ -576,86 +625,82 @@ var ve = {
576
625
  deleteConfirmItemsLabel: "items?",
577
626
  deleteConfirmLabel: "Delete",
578
627
  deleteCancelLabel: "Cancel"
579
- }, Ie = fe(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Ee, isNameReadOnly: c, nameCaption: l, isDescriptionRequired: u, renderDescription: d, focusRequestKey: f, labels: p }) => {
580
- let [m, h] = H(!1), g = B(() => a ? s : s.filter((e) => e !== U.Avatar), [a, s]), _ = e.iconUrl, v = a?.resolveIconUrl, y = B(() => v ? v(_) : void 0, [_, v]), b = z(() => h(!0), []), x = z(() => h(!1), []), S = a?.resolveAttachedIconUrl, C = z((e) => {
581
- let t = S?.(e);
582
- t && n({ iconUrl: t }), h(!1);
583
- }, [n, S]);
584
- return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(G, {
628
+ }, Je = Ce(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Fe, isNameReadOnly: c, nameReadOnlyTooltip: l, nameCaption: u, isDescriptionRequired: d, descriptionCaption: f, renderDescription: p, focusRequestKey: m, labels: h }) => {
629
+ let [g, _] = V(!1), v = z(() => a ? s : s.filter((e) => e !== G.Avatar), [a, s]), y = e.iconUrl, b = a?.resolveIconUrl, x = z(() => b ? b(y) : void 0, [y, b]), S = L(() => _(!0), []), C = L(() => _(!1), []), w = a?.resolveAttachedIconUrl, T = L((e) => {
630
+ let t = w?.(e);
631
+ t && n({ iconUrl: t }), _(!1);
632
+ }, [n, w]);
633
+ return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Ve, {
585
634
  values: e,
586
635
  errors: t,
587
636
  onChange: n,
588
637
  onNameBlur: r,
589
638
  onVersionBlur: i,
590
- iconPreviewUrl: y,
591
- onAddAvatarClick: b,
592
- labels: p?.form ?? Pe,
639
+ iconPreviewUrl: x,
640
+ onAddAvatarClick: S,
641
+ labels: h?.form ?? Ke,
593
642
  availableLocaleOptions: o,
594
- fields: g,
643
+ fields: v,
595
644
  isNameReadOnly: c,
596
- nameCaption: l,
597
- isDescriptionRequired: u,
598
- renderDescription: d,
599
- focusRequestKey: f
600
- }), a && /* @__PURE__ */ F(Te, {
601
- isOpen: m,
602
- onClose: x,
603
- onAttach: C,
645
+ nameReadOnlyTooltip: l,
646
+ nameCaption: u,
647
+ isDescriptionRequired: d,
648
+ descriptionCaption: f,
649
+ renderDescription: p,
650
+ focusRequestKey: m
651
+ }), a && /* @__PURE__ */ P(Pe, {
652
+ isOpen: g,
653
+ onClose: C,
654
+ onAttach: T,
604
655
  bucket: a.bucket,
605
656
  FileManagerModal: a.FileManagerModal,
606
657
  allowedMimeTypes: a.allowedMimeTypes,
607
658
  maxFileSizeBytes: a.maxFileSizeBytes,
608
- labels: p?.avatarPicker ?? Fe
659
+ labels: h?.avatarPicker ?? qe
609
660
  })] });
610
- }), Le = /* @__PURE__ */ function(e) {
661
+ }), Ye = /* @__PURE__ */ function(e) {
611
662
  return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
612
663
  }({});
613
- new Set([Le.TooLong, Le.ControlCharacters]);
664
+ Ye.TooLong, Ye.ControlCharacters;
614
665
  //#endregion
615
666
  //#region src/constants/public-class-names.ts
616
- var Re = {
667
+ var Xe = {
617
668
  root: "dial-skill-editor-root",
618
669
  refineFeedback: "dial-skill-editor-refine-feedback"
619
670
  }, K = "SKILL.md", q = /* @__PURE__ */ function(e) {
620
671
  return e.File = "file", e.Folder = "folder", e;
621
- }({}), ze = /* @__PURE__ */ function(e) {
622
- return e.Header = "header", e.Child = "child", e.Sibling = "sibling", e;
623
- }({}), J = (e) => {
672
+ }({}), Ze = /* @__PURE__ */ function(e) {
673
+ return e.Header = "header", e.Child = "child", e;
674
+ }({}), Qe = (e) => {
624
675
  let t = e.lastIndexOf("/");
625
676
  return t === -1 ? null : e.slice(0, t);
626
- }, Be = (e) => {
677
+ }, $e = (e) => {
627
678
  let t = e.lastIndexOf("/");
628
679
  return t === -1 ? e : e.slice(t + 1);
629
- }, Ve = (e) => {
680
+ }, et = (e) => {
630
681
  let t = /* @__PURE__ */ new Map(), n = (e) => {
631
682
  let n = t.get(e);
632
683
  if (n) return n;
633
684
  let r = {
634
685
  path: e,
635
- name: Be(e),
636
- nodeType: he.FOLDER,
637
- parentPath: J(e),
686
+ name: $e(e),
687
+ nodeType: Te.FOLDER,
688
+ parentPath: Qe(e),
638
689
  folderId: e,
639
690
  items: []
640
691
  };
641
692
  return t.set(e, r), r;
642
693
  };
643
- for (let r of e) {
644
- if (r.kind === q.Folder) {
645
- n(r.path).name = r.name;
646
- continue;
647
- }
648
- t.set(r.path, {
649
- path: r.path,
650
- name: r.name,
651
- nodeType: he.ITEM,
652
- parentPath: J(r.path),
653
- folderId: J(r.path) ?? ""
654
- });
655
- }
694
+ for (let r of e) r.kind === q.Folder ? n(r.path).name = r.name : t.set(r.path, {
695
+ path: r.path,
696
+ name: r.name,
697
+ nodeType: Te.ITEM,
698
+ parentPath: Qe(r.path),
699
+ folderId: Qe(r.path) ?? ""
700
+ });
656
701
  for (let t of [...e]) {
657
- let e = J(t.path);
658
- for (; e != null;) n(e), e = J(e);
702
+ let e = Qe(t.path);
703
+ for (; e != null;) n(e), e = Qe(e);
659
704
  }
660
705
  let r = [];
661
706
  for (let e of t.values()) {
@@ -667,14 +712,17 @@ var Re = {
667
712
  n ? n.items = [...n.items ?? [], e] : r.push(e);
668
713
  }
669
714
  return r;
670
- }, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e) => J(e) ?? "", We = (e, t) => {
715
+ }, tt = (e, t) => e ? `${e}/${t}` : t, nt = (e, t) => {
716
+ let n = e.lastIndexOf("/"), r = n === -1 ? "" : e.slice(0, n), i = e.slice(n + 1), a = i.lastIndexOf("."), o = a > 0, s = o ? i.slice(0, a) : i, c = o ? i.slice(a) : "", l = 1, u = tt(r, `${s} (${l})${c}`);
717
+ for (; t.has(u);) l += 1, u = tt(r, `${s} (${l})${c}`);
718
+ return u;
719
+ }, rt = (e, t) => {
671
720
  if (!t) return "";
672
721
  switch (e) {
673
- case ze.Child: return t.path;
674
- case ze.Sibling: return Ue(t.path);
675
- case ze.Header: return t.kind === q.Folder ? t.path : "";
722
+ case Ze.Child: return t.path;
723
+ case Ze.Header: return t.kind === q.Folder ? t.path : "";
676
724
  }
677
- }, Ge = (e, t) => {
725
+ }, it = (e, t) => {
678
726
  let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
679
727
  for (let { path: i } of e) {
680
728
  if (!i.startsWith(n) || i === t) continue;
@@ -682,29 +730,29 @@ var Re = {
682
730
  r.add(e.split("/")[0]);
683
731
  }
684
732
  return r;
685
- }, Ke = (e, t, n) => {
733
+ }, J = (e, t, n) => {
686
734
  let r = e.trim();
687
735
  if (!r) return n.required;
688
736
  if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
689
737
  if (t.has(r)) return n.duplicate;
690
- }, qe = "\\new-folder", Je = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
691
- let [o, s] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 : He(c, qe), d = B(() => u == null ? void 0 : {
738
+ }, at = "\\new-folder", ot = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
739
+ let [o, s] = V(null), c = o?.parentPath ?? null, l = B([]), u = c == null ? void 0 : tt(c, at), d = z(() => u == null ? void 0 : {
692
740
  path: u,
693
741
  name: n,
694
742
  kind: q.Folder
695
- }, [u, n]), f = z((n, i) => {
696
- let a = Ge(e, i);
697
- return i === "" && a.add(K), Ke(n, a, r) ?? t.validateFolderPath?.(He(i, n.trim()));
743
+ }, [u, n]), f = L((n, i) => {
744
+ let a = it(e, i);
745
+ return i === "" && a.add(K), J(n, a, r) ?? t.validateFolderPath?.(tt(i, n.trim()));
698
746
  }, [
699
747
  e,
700
748
  r,
701
749
  t
702
- ]), p = z((e, t) => {
750
+ ]), p = L((e, t) => {
703
751
  l.current = [], s({
704
752
  parentPath: e,
705
753
  pane: t
706
754
  }), e !== "" && i(e);
707
- }, [i]), m = z((e, t) => {
755
+ }, [i]), m = L((e, t) => {
708
756
  if (c == null || t.path !== u) return null;
709
757
  let n = f(e, c);
710
758
  return l.current = [...l.current.slice(-1), {
@@ -715,23 +763,24 @@ var Re = {
715
763
  c,
716
764
  u,
717
765
  f
718
- ]), h = z(() => {
766
+ ]), h = L(() => {
719
767
  l.current = [], s(null);
720
- }, []), g = z((e) => {
768
+ }, []), g = L((e, n) => {
769
+ let r = tt(n, e.trim());
770
+ t.onCreateFolder?.(r), n !== "" && i(n), a(r);
771
+ }, [
772
+ t,
773
+ i,
774
+ a
775
+ ]), _ = L((e) => {
721
776
  if (c == null) return;
722
- let [n] = l.current;
723
- if (l.current.length === 2 && n != null && !n.isValid && n.value !== e || f(e, c) != null) {
724
- h();
725
- return;
726
- }
727
- let r = He(c, e.trim());
728
- h(), t.onCreateFolder?.(r), a(r);
777
+ let [t] = l.current;
778
+ l.current.length === 2 && t != null && !t.isValid && t.value !== e || f(e, c) != null ? h() : (h(), g(e, c));
729
779
  }, [
730
780
  c,
731
781
  f,
732
782
  h,
733
- t,
734
- a
783
+ g
735
784
  ]);
736
785
  return {
737
786
  draftNode: d,
@@ -739,711 +788,933 @@ var Re = {
739
788
  draftPane: o?.pane,
740
789
  startDraft: p,
741
790
  handleValidate: m,
742
- handleSave: g,
743
- handleCancel: h
791
+ handleSave: _,
792
+ handleCancel: h,
793
+ validateNewFolder: f,
794
+ createFolder: g
744
795
  };
745
- }, Ye = (e) => !!e.dataTransfer?.types.includes("Files"), Xe = (e) => {
746
- let [t, n] = H(!1), r = V(0);
796
+ }, st = (e) => !!e.dataTransfer?.types.includes("Files"), ct = (e) => {
797
+ let [t, n] = V(!1), r = B(0);
747
798
  return {
748
799
  isDragActive: t,
749
800
  dropZoneHandlers: {
750
- onDragEnter: z((e) => {
751
- Ye(e) && (e.preventDefault(), r.current += 1, n(!0));
801
+ onDragEnter: L((e) => {
802
+ st(e) && (e.preventDefault(), r.current += 1, n(!0));
752
803
  }, []),
753
- onDragLeave: z((e) => {
754
- Ye(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
804
+ onDragLeave: L((e) => {
805
+ st(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
755
806
  }, []),
756
- onDragOver: z((e) => {
757
- Ye(e) && e.preventDefault();
807
+ onDragOver: L((e) => {
808
+ st(e) && e.preventDefault();
758
809
  }, []),
759
- onDrop: z((t) => {
760
- if (!Ye(t)) return;
810
+ onDrop: L((t) => {
811
+ if (!st(t)) return;
761
812
  t.preventDefault(), r.current = 0, n(!1);
762
813
  let i = Array.from(t.dataTransfer?.files ?? []);
763
814
  i.length > 0 && e(i);
764
815
  }, [e])
765
816
  }
766
817
  };
767
- }, Ze = /* @__PURE__ */ function(e) {
818
+ }, lt = /* @__PURE__ */ function(e) {
768
819
  return e.Files = "files", e.Archive = "archive", e;
769
820
  }({}), Y = /* @__PURE__ */ function(e) {
770
821
  return e.Mobile = "mobile", e.Desktop = "desktop", e;
771
- }({}), Qe = (e, t, n = g.MD) => /* @__PURE__ */ F(e, {
822
+ }({}), ut = (e, t, n = y.MD, r) => /* @__PURE__ */ P(e, {
772
823
  size: n,
773
824
  className: t,
825
+ style: r,
774
826
  "aria-hidden": !0,
775
- stroke: _
776
- }), $e = ({ isVisible: e, labels: t }) => {
777
- if (!e) return null;
778
- let n = t ?? {};
779
- return /* @__PURE__ */ F("div", {
780
- role: "status",
781
- "aria-live": "polite",
782
- className: c("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
783
- children: /* @__PURE__ */ I("div", {
827
+ stroke: b
828
+ }), dt = { footer: "_footer_hn1ri_7" }, ft = ({ isOpen: e, title: t, closeAriaLabel: n, onClose: r, confirmLabel: i, onConfirm: a, cancelLabel: s, onCancel: l, isConfirmDisabled: u = !1, isConfirming: f = !1, children: p, colors: g }) => {
829
+ let v = d(), y = f ? /* @__PURE__ */ P(ue, {
830
+ size: 16,
831
+ ariaLabel: ""
832
+ }) : void 0;
833
+ if (v) {
834
+ let d = o({
835
+ "--se-dialog-footer-bg": g?.footerBackground,
836
+ "--se-dialog-footer-border": g?.footerBorder
837
+ });
838
+ return /* @__PURE__ */ F(m, {
839
+ open: e,
840
+ title: t,
841
+ closeAriaLabel: n,
842
+ onClose: r,
843
+ children: [p, /* @__PURE__ */ F("div", {
844
+ className: c("sticky bottom-0 flex gap-3 border-t p-4", dt.footer),
845
+ style: d,
846
+ children: [/* @__PURE__ */ P(se, {
847
+ className: "flex-1",
848
+ label: i,
849
+ iconBefore: y,
850
+ disabled: u,
851
+ onClick: a
852
+ }), /* @__PURE__ */ P(j, {
853
+ className: "flex-1",
854
+ label: s,
855
+ onClick: l
856
+ })]
857
+ })]
858
+ });
859
+ }
860
+ return /* @__PURE__ */ P(ae, {
861
+ open: e,
862
+ header: t,
863
+ size: oe.Sm,
864
+ closeAriaLabel: n,
865
+ onClose: r,
866
+ mainButtons: [{
867
+ label: s,
868
+ variant: _.Primary,
869
+ appearance: h.Ghost,
870
+ onClick: l
871
+ }, {
872
+ label: i,
873
+ variant: _.Primary,
874
+ iconBefore: y,
875
+ onClick: a,
876
+ disabled: u
877
+ }],
878
+ children: p
879
+ });
880
+ }, pt = ({ isOpen: e, onClose: t, validateName: n, onCreate: r, title: i, nameLabel: a, namePlaceholder: o, createLabel: s, cancelLabel: c, closeAriaLabel: l, dialogColors: u }) => {
881
+ let d = we(), [f, p] = V(""), [m, h] = V(!1);
882
+ R(() => {
883
+ e && (p(""), h(!1));
884
+ }, [e]);
885
+ let g = m ? n(f) : void 0, _ = () => {
886
+ h(!0), n(f) ?? (r(f), t());
887
+ };
888
+ return /* @__PURE__ */ P(ft, {
889
+ isOpen: e,
890
+ title: i,
891
+ closeAriaLabel: l,
892
+ onClose: t,
893
+ confirmLabel: s,
894
+ onConfirm: _,
895
+ cancelLabel: c,
896
+ onCancel: t,
897
+ colors: u,
898
+ children: /* @__PURE__ */ P("form", {
899
+ className: "px-4 py-4 desktop:px-6",
900
+ onSubmit: (e) => {
901
+ e.preventDefault(), _();
902
+ },
903
+ children: /* @__PURE__ */ P(k, {
904
+ id: d,
905
+ labelProps: {
906
+ label: a,
907
+ htmlFor: d,
908
+ required: !0
909
+ },
910
+ value: f,
911
+ placeholder: o,
912
+ error: g,
913
+ invalid: g != null,
914
+ onChange: (e) => p(e ?? "")
915
+ })
916
+ })
917
+ });
918
+ }, mt = { icon: "_icon_1p1f5_1" }, ht = ({ isVisible: e, labels: t, titleClassName: n = "dial-h3-text", subtitleClassName: r = "dial-small-text" }) => {
919
+ let i = t ?? {}, a = i.dropOverlayTitle ?? "Upload files", o = i.dropOverlaySubtitle ?? "Drop files here to add them to this skill", s = /* @__PURE__ */ P(ne, {
920
+ visuallyHidden: !0,
921
+ as: re.Span,
922
+ children: e ? `${a}. ${o}` : ""
923
+ });
924
+ return e ? /* @__PURE__ */ F(N, { children: [s, /* @__PURE__ */ P("div", {
925
+ className: c("pointer-events-none absolute inset-0 z-100 flex items-center justify-center backdrop-blur-sm"),
926
+ children: /* @__PURE__ */ F("div", {
927
+ "aria-hidden": !0,
784
928
  className: "flex flex-col items-center text-center",
785
929
  children: [
786
- /* @__PURE__ */ F(ue, {
930
+ /* @__PURE__ */ P(be, {
787
931
  size: 100,
788
- className: "text-accent-primary",
932
+ className: mt.icon,
789
933
  "aria-hidden": !0,
790
- stroke: _
934
+ stroke: b
791
935
  }),
792
- /* @__PURE__ */ F("span", {
793
- className: "dial-h3-text mt-5",
794
- children: n.dropOverlayTitle ?? "Upload files"
936
+ /* @__PURE__ */ P("span", {
937
+ className: c("mt-5", n),
938
+ children: a
795
939
  }),
796
- /* @__PURE__ */ F("span", {
797
- className: "dial-small-text mt-4",
798
- children: n.dropOverlaySubtitle ?? "Drop files here to add them to this skill"
940
+ /* @__PURE__ */ P("span", {
941
+ className: c("mt-4", r),
942
+ children: o
799
943
  })
800
944
  ]
801
945
  })
802
- });
803
- }, et = /* @__PURE__ */ function(e) {
946
+ })] }) : s;
947
+ }, gt = {
948
+ card: "_card_1tr87_2",
949
+ label: "_label_1tr87_7",
950
+ fileName: "_fileName_1tr87_11",
951
+ header: "_header_1tr87_16"
952
+ }, _t = ({ label: e, fileName: t, isExpanded: n, onToggle: r, children: i, labelClassName: a = "dial-tiny-lead-text", fileNameClassName: o = "dial-small-text" }) => /* @__PURE__ */ P(p, {
953
+ expanded: n,
954
+ onToggle: r,
955
+ title: /* @__PURE__ */ P("span", {
956
+ className: c("block", gt.label, a),
957
+ children: e
958
+ }),
959
+ description: /* @__PURE__ */ P(D, {
960
+ name: t,
961
+ nameClassName: c(gt.fileName, o)
962
+ }),
963
+ className: c("rounded-lg border py-0 shadow-xs", gt.card),
964
+ headerClassName: c("gap-4 rounded-lg py-2 ps-3 pe-2 text-start [&>span]:flex-1 [&>span]:gap-1 [&>svg]:size-6", n ? "[&>svg]:-rotate-90" : "[&>svg]:rotate-90", gt.header),
965
+ contentClassName: "max-h-[416px] overflow-y-auto pt-4 pb-2 ps-3 pe-2",
966
+ children: i
967
+ }), vt = /* @__PURE__ */ function(e) {
804
968
  return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
805
- }({}), tt = /* @__PURE__ */ function(e) {
969
+ }({}), yt = /* @__PURE__ */ function(e) {
806
970
  return e.Valid = "valid", e.Invalid = "invalid", e;
807
- }({}), nt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), rt = ".zip,application/zip", it = 0, X = () => `skill-file-candidate-${++it}`, Z = (e, t, n) => ({
808
- id: X(),
971
+ }({}), X = /* @__PURE__ */ function(e) {
972
+ return e.Replace = "replace", e.Duplicate = "duplicate", e;
973
+ }({}), bt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), xt = {
974
+ invalidDropZone: "_invalidDropZone_j9j9q_1",
975
+ row: "_row_j9j9q_5"
976
+ }, St = ".zip,application/zip", Ct = [], wt = 0, Tt = () => `skill-file-candidate-${++wt}`, Z = (e, t, n) => ({
977
+ id: Tt(),
809
978
  file: e,
810
- path: He(n, t.replace(/\\/g, "/"))
811
- }), at = ({ isOpen: e, onClose: t, fileActions: n, mode: r = Ze.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, labels: c }) => {
812
- let l = c ?? {}, [u, d] = H([]), [p, h] = H(/* @__PURE__ */ new Map()), [g, v] = H([]), [y, b] = H(!1), [C, T] = H(), [E, D] = H(!1), [O, A] = H(), [te, j] = H(0), M = V(0), N = r === Ze.Archive, L = l.uploadArchiveErrorMessage ?? "Couldn't read this archive", re = me(), ae = (e) => {
813
- T(void 0), d((t) => [...t, ...e]);
814
- }, oe = async (e) => {
979
+ path: tt(n, t.replace(/\\/g, "/"))
980
+ }), Et = ({ isOpen: e, onClose: t, fileActions: n, mode: r = lt.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: l, existingFilePaths: u = Ct, onCommitted: d, messageClassName: f = "dial-small-text", rowCaptionClassName: p, labels: m, dialogColors: h, colors: g }) => {
981
+ let _ = m ?? {}, [y, x] = V([]), [S, C] = V([]), [w, O] = V(X.Replace), k = z(() => new Set(u), [u]), [A, te] = V(/* @__PURE__ */ new Map()), [j, ae] = V([]), [oe, se] = V(!1), [M, le] = V(), [de, fe] = V(!1), [pe, me] = V(), [he, ge] = V(0), _e = B(0), I = r === lt.Archive, ve = _.uploadArchiveErrorMessage ?? "Couldn't read this archive", be = we(), xe = we(), Se = we(), Ce = B(null), L = B(!1), Te = S[0]?.id;
982
+ R(() => {
983
+ e && (Te == null ? L.current && (L.current = !1, document.getElementById(xe)?.focus()) : (L.current = !0, Ce.current?.focus()));
984
+ }, [
985
+ Te,
986
+ e,
987
+ xe
988
+ ]);
989
+ let Ee = (e) => e.path !== "SKILL.md" && k.has(e.path), De = (e) => {
990
+ le(void 0), x((t) => [...t, ...e.filter((e) => !Ee(e))]), C((t) => [...t, ...e.filter(Ee)]);
991
+ }, H = (e) => {
992
+ let [t, ...n] = S;
993
+ t && (C(n), O(X.Replace), e != null && (le(void 0), x((r) => {
994
+ if (e === X.Replace) return [...r, {
995
+ ...t,
996
+ replacesExisting: !0
997
+ }];
998
+ let i = /* @__PURE__ */ new Set([
999
+ ...u,
1000
+ ...r.map((e) => e.path),
1001
+ ...n.map((e) => e.path)
1002
+ ]);
1003
+ return [...r, {
1004
+ ...t,
1005
+ path: nt(t.path, i)
1006
+ }];
1007
+ })));
1008
+ }, Oe = async (e) => {
815
1009
  let { extractArchive: t } = n;
816
1010
  if (!t) return;
817
- let r = M.current;
818
- A(void 0), j((e) => e + 1);
1011
+ let r = _e.current;
1012
+ me(void 0), ge((e) => e + 1);
819
1013
  try {
820
1014
  let n = await Promise.all(e.map((e) => t(e)));
821
- if (r !== M.current) return;
1015
+ if (r !== _e.current) return;
822
1016
  let a = n.flat();
823
1017
  if (a.length === 0) {
824
- A(l.uploadArchiveEmptyMessage ?? "This archive has no files");
1018
+ me(_.uploadArchiveEmptyMessage ?? "This archive has no files");
825
1019
  return;
826
1020
  }
827
- ae(a.map((e) => Z(e.file, e.path, i)));
1021
+ De(a.map((e) => Z(e.file, e.path, i)));
828
1022
  } catch {
829
- if (r !== M.current) return;
830
- A(L);
1023
+ if (r !== _e.current) return;
1024
+ me(ve);
831
1025
  } finally {
832
- r === M.current && j((e) => e - 1);
1026
+ r === _e.current && ge((e) => e - 1);
833
1027
  }
834
- }, se = (e) => {
835
- if (N) {
836
- oe(e);
837
- return;
838
- }
839
- ae(e.map((e) => Z(e, nt(e), i)));
840
- }, ce = (e) => {
841
- d((t) => t.filter((t) => t.id !== e));
1028
+ }, ke = (e) => {
1029
+ I ? Oe(e) : De(e.map((e) => Z(e, bt(e), i)));
1030
+ }, U = (e) => {
1031
+ x((t) => t.filter((t) => t.id !== e));
842
1032
  };
843
- pe(() => {
844
- e && (M.current += 1, d([...(a ?? []).map((e) => Z(e, nt(e), i)), ...(o ?? []).map((e) => Z(e.file, e.path, i))]), h(/* @__PURE__ */ new Map()), v([]), T(void 0), A(void 0), j(0));
845
- }, [e]), pe(() => {
1033
+ R(() => {
1034
+ if (!e) return;
1035
+ _e.current += 1;
1036
+ let t = [...(a ?? []).map((e) => Z(e, bt(e), i)), ...(l ?? []).map((e) => Z(e.file, e.path, i))];
1037
+ x(t.filter((e) => !Ee(e))), C(t.filter(Ee)), O(X.Replace), te(/* @__PURE__ */ new Map()), ae([]), le(void 0), me(void 0), ge(0);
1038
+ }, [e]), R(() => {
846
1039
  if (!e) return;
847
1040
  let t = !1;
848
- if (u.length === 0) {
849
- h(/* @__PURE__ */ new Map()), v([]);
850
- return;
851
- }
852
- return b(!0), n.validateBatch(u).then(({ results: e, batchErrors: n }) => {
853
- t || (h(new Map(e.map((e) => [e.candidateId, e]))), v(n.map((e) => e.message)));
1041
+ if (y.length === 0) te(/* @__PURE__ */ new Map()), ae([]);
1042
+ else return se(!0), n.validateBatch(y).then(({ results: e, batchErrors: n }) => {
1043
+ t || (te(new Map(e.map((e) => [e.candidateId, e]))), ae(n.map((e) => e.message)));
854
1044
  }).finally(() => {
855
- t || b(!1);
1045
+ t || se(!1);
856
1046
  }), () => {
857
1047
  t = !0;
858
1048
  };
859
- }, [u, e]);
860
- let ue = u.some((e) => p.get(e.id)?.status === tt.Invalid), de = u.length > 0 && u.every((e) => p.get(e.id)?.status === tt.Invalid), R = u.length > 0 && !ue && g.length === 0 && !y && !E && te === 0, fe = async () => {
861
- D(!0), T(void 0);
1049
+ }, [y, e]);
1050
+ let Ae = y.some((e) => A.get(e.id)?.status === yt.Invalid), je = y.length > 0 && y.every((e) => A.get(e.id)?.status === yt.Invalid), Me = [...j, ...y.flatMap((e) => {
1051
+ let t = A.get(e.id);
1052
+ return t?.status === yt.Invalid && t.error ? [`${e.path}: ${t.error}`] : [];
1053
+ })], W = y.length > 0 && !Ae && j.length === 0 && !oe && !de && he === 0, Ne = async () => {
1054
+ fe(!0), le(void 0);
862
1055
  try {
863
- let { results: e, batchErrors: r } = await n.validateBatch(u), i = new Map(e.map((e) => [e.candidateId, e]));
864
- if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status === tt.Invalid) || r.length > 0) return;
865
- let a = await n.commitBatch(u);
1056
+ let { results: e, batchErrors: r } = await n.validateBatch(y), i = new Map(e.map((e) => [e.candidateId, e]));
1057
+ if (te(i), ae(r.map((e) => e.message)), y.some((e) => i.get(e.id)?.status === yt.Invalid) || r.length > 0) return;
1058
+ let a = await n.commitBatch(y);
866
1059
  if (a.error) {
867
- T(a.error);
1060
+ le(a.error);
868
1061
  return;
869
1062
  }
870
- t();
1063
+ d?.(y), t();
871
1064
  } finally {
872
- D(!1);
1065
+ fe(!1);
873
1066
  }
874
- };
875
- return /* @__PURE__ */ F(k, {
876
- open: e,
877
- header: N ? l.uploadArchiveDialogTitle ?? "Upload archive from device" : l.uploadDialogTitle ?? "Upload files from device",
878
- size: ee.Sm,
879
- closeAriaLabel: l.uploadDialogCloseAriaLabel ?? "Close",
1067
+ }, Pe = _.uploadDialogCloseAriaLabel ?? "Close", G = _.uploadCancelLabel ?? "Cancel", [Fe] = S;
1068
+ if (Fe) {
1069
+ let t = _.uploadConflictTitle ?? "Replace or duplicate it?";
1070
+ return /* @__PURE__ */ P(ft, {
1071
+ isOpen: e,
1072
+ title: t,
1073
+ closeAriaLabel: Pe,
1074
+ onClose: () => H(null),
1075
+ confirmLabel: _.uploadConflictConfirmLabel ?? "Confirm",
1076
+ onConfirm: () => H(w),
1077
+ cancelLabel: G,
1078
+ onCancel: () => H(null),
1079
+ colors: h,
1080
+ children: /* @__PURE__ */ F("div", {
1081
+ className: "flex flex-col gap-4 px-4 py-4 desktop:px-6",
1082
+ children: [/* @__PURE__ */ P("p", {
1083
+ ref: Ce,
1084
+ tabIndex: -1,
1085
+ className: c("outline-hidden", f),
1086
+ children: _.uploadConflictMessage?.(Fe.path) ?? `Item with the same name "${Fe.path}" already exists.`
1087
+ }), /* @__PURE__ */ P(ce, {
1088
+ ariaLabel: t,
1089
+ value: w,
1090
+ onChange: (e) => O(e === X.Duplicate ? X.Duplicate : X.Replace),
1091
+ items: [{
1092
+ value: X.Replace,
1093
+ label: _.uploadConflictReplaceLabel ?? "Replace"
1094
+ }, {
1095
+ value: X.Duplicate,
1096
+ label: _.uploadConflictDuplicateLabel ?? "Duplicate"
1097
+ }]
1098
+ })]
1099
+ })
1100
+ });
1101
+ }
1102
+ return /* @__PURE__ */ P(ft, {
1103
+ isOpen: e,
1104
+ title: I ? _.uploadArchiveDialogTitle ?? "Upload archive from device" : _.uploadDialogTitle ?? "Upload files from device",
1105
+ closeAriaLabel: Pe,
880
1106
  onClose: t,
881
- mainButtons: [{
882
- label: l.uploadCancelLabel ?? "Cancel",
883
- variant: m.Primary,
884
- appearance: f.Ghost,
885
- onClick: t
886
- }, {
887
- label: l.uploadConfirmLabel ?? "Add",
888
- variant: m.Primary,
889
- iconBefore: E ? /* @__PURE__ */ F(ne, {
890
- size: 16,
891
- ariaLabel: ""
892
- }) : void 0,
893
- onClick: () => void fe(),
894
- disabled: !R
895
- }],
896
- children: /* @__PURE__ */ I("div", {
897
- className: "flex flex-col gap-4 px-6 py-4",
1107
+ confirmLabel: _.uploadConfirmLabel ?? "Add",
1108
+ onConfirm: () => void Ne(),
1109
+ isConfirmDisabled: !W,
1110
+ isConfirming: de,
1111
+ cancelLabel: G,
1112
+ onCancel: t,
1113
+ colors: h,
1114
+ children: /* @__PURE__ */ F("div", {
1115
+ className: "flex flex-col gap-4 px-4 py-4 desktop:px-6",
1116
+ style: o({
1117
+ "--se-upload-invalid-dropzone-border": g?.invalidDropZoneBorder,
1118
+ "--se-upload-row-border": g?.rowBorder
1119
+ }),
898
1120
  children: [
899
- /* @__PURE__ */ F(S, {
900
- label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
1121
+ /* @__PURE__ */ P(E, {
1122
+ label: /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
901
1123
  className: "desktop:hidden",
902
- children: N ? l.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : l.uploadDropZoneMobileLabel ?? "Click here to upload"
903
- }), /* @__PURE__ */ F("span", {
1124
+ children: I ? _.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : _.uploadDropZoneMobileLabel ?? "Click here to upload"
1125
+ }), /* @__PURE__ */ P("span", {
904
1126
  className: "hidden desktop:inline",
905
- children: N ? l.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : l.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
1127
+ children: I ? _.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : _.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
906
1128
  })] }),
907
- ariaLabel: l.uploadDropZoneAriaLabel ?? "Upload files",
1129
+ description: I ? _.uploadArchiveDropZoneDescription : _.uploadDropZoneDescription,
1130
+ id: xe,
1131
+ ariaLabel: _.uploadDropZoneAriaLabel ?? "Upload files",
908
1132
  multiple: !0,
909
- accept: N ? rt : void 0,
910
- className: de ? "border-error hover:border-error" : void 0,
911
- onChange: se,
912
- onReject: N ? () => A(L) : void 0
1133
+ accept: I ? St : void 0,
1134
+ className: je ? xt.invalidDropZone : void 0,
1135
+ onChange: ke,
1136
+ onReject: I ? () => me(ve) : void 0
913
1137
  }),
914
- te > 0 && /* @__PURE__ */ F(ne, { ariaLabel: l.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
915
- /* @__PURE__ */ F("div", {
916
- role: "alert",
917
- children: O && /* @__PURE__ */ F(x, { text: O })
1138
+ he > 0 && /* @__PURE__ */ P(ue, { ariaLabel: _.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
1139
+ /* @__PURE__ */ P(T, {
1140
+ text: pe,
1141
+ announce: ie.Assertive
918
1142
  }),
919
- /* @__PURE__ */ F("span", {
920
- role: "status",
921
- "aria-live": "polite",
922
- className: "sr-only",
923
- id: re,
924
- children: g.map((e) => `${l.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
1143
+ /* @__PURE__ */ P(ne, {
1144
+ visuallyHidden: !0,
1145
+ as: re.Span,
1146
+ id: be,
1147
+ children: Me.map((e) => `${_.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
925
1148
  }),
926
- g.map((e) => /* @__PURE__ */ F(x, { text: e }, e)),
927
- u.length > 0 && /* @__PURE__ */ F("ul", {
1149
+ j.map((e) => /* @__PURE__ */ P(T, { text: e }, e)),
1150
+ y.length > 0 && /* @__PURE__ */ P("ul", {
928
1151
  className: "flex flex-col gap-2",
929
- children: u.map((e) => {
930
- let t = p.get(e.id), n = t?.kind === et.Manifest, r = t?.status === tt.Invalid;
931
- return /* @__PURE__ */ I("li", {
932
- className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
933
- children: [
934
- /* @__PURE__ */ F(ie, {
935
- size: 20,
1152
+ children: y.map((e) => {
1153
+ let t = A.get(e.id), n = t?.kind === vt.Manifest, r = t?.status === yt.Invalid, i = r ? t?.error : void 0, a = `${Se}${e.id}`;
1154
+ return /* @__PURE__ */ F("li", {
1155
+ className: c("flex items-center gap-2 rounded-lg border p-2", xt.row),
1156
+ children: [/* @__PURE__ */ P(D, {
1157
+ name: e.path,
1158
+ className: "min-w-0 flex-1",
1159
+ details: /* @__PURE__ */ F(N, { children: [
1160
+ /* @__PURE__ */ P(v, {
1161
+ className: p,
1162
+ text: s(e.file.size)
1163
+ }),
1164
+ /* @__PURE__ */ P(T, {
1165
+ id: a,
1166
+ text: i
1167
+ }),
1168
+ n && !r && /* @__PURE__ */ P(v, {
1169
+ className: p,
1170
+ text: _.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
1171
+ }),
1172
+ e.replacesExisting && !r && /* @__PURE__ */ P(v, {
1173
+ className: p,
1174
+ text: _.uploadReplaceRowNote ?? "Will replace the existing file"
1175
+ })
1176
+ ] })
1177
+ }), /* @__PURE__ */ P(ee, {
1178
+ icon: /* @__PURE__ */ P(ye, {
1179
+ size: 16,
936
1180
  "aria-hidden": !0,
937
- stroke: _
1181
+ stroke: b
938
1182
  }),
939
- /* @__PURE__ */ I("div", {
940
- className: "flex min-w-0 flex-1 flex-col",
941
- children: [
942
- /* @__PURE__ */ F("span", {
943
- className: "dial-small-text truncate",
944
- children: e.path
945
- }),
946
- /* @__PURE__ */ F("span", {
947
- className: "dial-tiny-text text-secondary",
948
- children: s(e.file.size)
949
- }),
950
- r && t?.error && /* @__PURE__ */ F(x, { text: t.error }),
951
- n && !r && /* @__PURE__ */ F("span", {
952
- className: "dial-tiny-text text-secondary",
953
- children: l.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
954
- })
955
- ]
956
- }),
957
- /* @__PURE__ */ F(w, {
958
- icon: /* @__PURE__ */ F(le, {
959
- size: 16,
960
- "aria-hidden": !0,
961
- stroke: _
962
- }),
963
- "aria-label": l.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
964
- onClick: () => ce(e.id)
965
- })
966
- ]
1183
+ "aria-label": _.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
1184
+ "aria-describedby": i ? a : void 0,
1185
+ onClick: () => U(e.id)
1186
+ })]
967
1187
  }, e.id);
968
1188
  })
969
1189
  }),
970
- C && /* @__PURE__ */ F(x, { text: C })
1190
+ /* @__PURE__ */ P(T, {
1191
+ text: M,
1192
+ announce: ie.Assertive
1193
+ })
971
1194
  ]
972
1195
  })
973
1196
  });
974
- }, ot = {
975
- title: "_title_5md1a_1",
976
- helperText: "_helperText_5md1a_5",
977
- refineFeedback: "_refineFeedback_5md1a_9",
978
- refineError: "_refineError_5md1a_13"
979
- }, st = {
980
- mode: Ze.Files,
1197
+ }, Dt = {
1198
+ title: "_title_lgmx6_1",
1199
+ helperText: "_helperText_lgmx6_5",
1200
+ refineFeedback: "_refineFeedback_lgmx6_9",
1201
+ refineError: "_refineError_lgmx6_13",
1202
+ menuIcon: "_menuIcon_lgmx6_17"
1203
+ }, Ot = {
1204
+ mode: lt.Files,
981
1205
  targetFolderPath: ""
982
- }, ct = [U.Name, U.Description], lt = 24, ut = 300, dt = "desktop:px-8 desktop:py-6", ft = "desktop:px-8 desktop:py-6", pt = "gap-4 px-4 py-6 desktop:gap-5 desktop:px-8 desktop:py-6", mt = R(async () => {
983
- let { MarkdownEditor: e } = await _e();
1206
+ }, kt = [G.Name, G.Description], At = 24, jt = 300, Mt = "pb-0 desktop:px-8 desktop:py-6", Nt = "desktop:px-8 desktop:py-6", Pt = "gap-4 px-4 pt-5 pb-6 desktop:gap-5 desktop:px-8 desktop:py-6", Ft = Se(async () => {
1207
+ let { MarkdownEditor: e } = await De();
984
1208
  return { default: e };
985
- }), ht = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: _, expandedPaths: v, onExpandedPathsChange: S, isLoading: T = !1, hasLoadError: D = !1, isSubmitting: O = !1, errors: k, submitError: ee, conflict: te, onReloadLatest: j, isNameReadOnly: M = !1, onDirtyChange: N, onValuesChange: L, onRefineDescription: ie, onRefineInstructions: se, fileActions: R, supportingFileContent: fe, asideData: _e, onSubmit: ve, onCancel: ye, onBack: be, backAriaLabel: xe, title: Se, onRetry: Ce, onRetrySubmit: we, labels: Te, styles: U, dir: Ee, instructionsEditorTheme: De = y.light }) => {
986
- let [W, Oe] = H({
1209
+ }), Q = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: d, expandedPaths: p, onExpandedPathsChange: m, isLoading: x = !1, hasLoadError: E = !1, isSubmitting: D = !1, errors: k, submitError: te, conflict: ne, onReloadLatest: re, isNameReadOnly: ie = !1, onDirtyChange: j, onValuesChange: ae, onRefineDescription: oe, onRefineInstructions: ce, fileActions: M, supportingFileContent: le, asideData: de, onSubmit: fe, onCancel: pe, onBack: me, backAriaLabel: I, title: ve, onRetry: Se, onRetrySubmit: Ce, labels: De, styles: H, dir: Oe, instructionsEditorTheme: ke = S.light }) => {
1210
+ let [U, Ae] = V({
987
1211
  name: r?.name ?? "",
988
1212
  description: r?.description ?? "",
989
1213
  instructions: r?.instructions ?? ""
990
- }), ke = me(), G = V(void 0), Ae = l({
991
- bottomGap: lt,
992
- minHeight: ut
993
- }), je = V(W), Me = (e) => {
1214
+ }), je = we(), Me = we();
1215
+ u(() => document.getElementById(je), Me, !!k?.instructions);
1216
+ let W = B(void 0), Ne = l({
1217
+ bottomGap: At,
1218
+ minHeight: jt
1219
+ }), Pe = B(U), G = (e) => {
994
1220
  let t = {
995
- ...je.current,
1221
+ ...Pe.current,
996
1222
  ...e
997
1223
  };
998
- je.current = t, Oe(t), L?.(t);
1224
+ Pe.current = t, Ae(t), ae?.(t);
999
1225
  }, Fe = (e) => e ? async (t, n) => {
1000
- if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
1001
- G.current = n;
1226
+ if (W.current && !W.current.aborted) throw new DOMException("Busy", "AbortError");
1227
+ W.current = n;
1002
1228
  try {
1003
1229
  return await e(t, n);
1004
1230
  } finally {
1005
- G.current === n && (G.current = void 0);
1231
+ W.current === n && (W.current = void 0);
1006
1232
  }
1007
- } : void 0, Le = u({
1008
- value: W.description,
1009
- onChange: (e) => Me({ description: e }),
1010
- onRefine: Fe(ie),
1011
- disabled: O || T || D,
1233
+ } : void 0, Ie = f({
1234
+ value: U.description,
1235
+ onChange: (e) => G({ description: e }),
1236
+ onRefine: Fe(oe),
1237
+ disabled: D || x || E,
1012
1238
  resetKey: r
1013
- }), J = u({
1014
- value: W.instructions,
1015
- onChange: (e) => Me({ instructions: e }),
1016
- onRefine: Fe(se),
1017
- disabled: O || T || D,
1239
+ }), Le = f({
1240
+ value: U.instructions,
1241
+ onChange: (e) => G({ instructions: e }),
1242
+ onRefine: Fe(ce),
1243
+ disabled: D || x || E,
1018
1244
  resetKey: r
1019
- }), Be = Le.isPending || J.isPending, He = () => {
1020
- Le.reset(), J.reset();
1021
- }, Ue = () => {
1022
- He(), ye();
1023
- }, Ge = () => {
1024
- He(), be();
1025
- }, Ke = () => {
1026
- O || T || D || G.current && !G.current.aborted || ve(W);
1027
- }, qe = V(r), Ye = qe.current !== r, et = V(i);
1028
- pe(() => {
1029
- qe.current = r;
1245
+ }), Re = Ie.isPending || Le.isPending, ze = () => {
1246
+ Ie.reset(), Le.reset();
1247
+ }, Be = () => {
1248
+ ze(), pe();
1249
+ }, Ve = () => {
1250
+ ze(), me();
1251
+ }, He = () => {
1252
+ D || x || E || W.current && !W.current.aborted || fe(U);
1253
+ }, Ue = B(r), We = Ue.current !== r, qe = B(i), [Ye, Qe] = V(!1);
1254
+ R(() => {
1255
+ Ue.current = r;
1030
1256
  let e = {
1031
1257
  name: r?.name ?? "",
1032
1258
  description: r?.description ?? "",
1033
1259
  instructions: r?.instructions ?? ""
1034
1260
  };
1035
- je.current = e, Oe(e), et.current = i;
1261
+ Pe.current = e, Ae(e), qe.current = i, Qe(!1);
1036
1262
  }, [r]);
1037
- let tt = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), nt = V(!1);
1038
- pe(() => {
1039
- if (Ye) return;
1263
+ let $e = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), tt = B(!1);
1264
+ R(() => {
1265
+ if (We) return;
1040
1266
  let e = {
1041
1267
  name: r?.name ?? "",
1042
1268
  description: r?.description ?? "",
1043
1269
  instructions: r?.instructions ?? ""
1044
- }, t = JSON.stringify(W) !== JSON.stringify(e) || tt(i) !== tt(et.current);
1045
- t !== nt.current && (nt.current = t, N?.(t));
1270
+ }, t = JSON.stringify(U) !== JSON.stringify(e) || $e(i) !== $e(qe.current) || Ye;
1271
+ t !== tt.current && (tt.current = t, j?.(t));
1046
1272
  }, [
1047
- W,
1273
+ U,
1048
1274
  i,
1049
1275
  r,
1276
+ We,
1050
1277
  Ye,
1051
- N
1278
+ j
1052
1279
  ]);
1053
- let [rt, it] = H(K), X = s ?? rt, Z = z((e) => {
1054
- it(e), _?.(e);
1055
- }, [_]), [ht, gt] = H([]), _t = v ?? ht, vt = B(() => new Set(_t), [_t]), yt = z((e) => {
1280
+ let [nt, it] = V(K), J = s ?? nt, at = L((e) => {
1281
+ it(e), d?.(e);
1282
+ }, [d]), [st, dt] = V([]), ft = p ?? st, mt = z(() => new Set(ft), [ft]), gt = L((e) => {
1056
1283
  let t = [...e];
1057
- gt(t), S?.(t);
1058
- }, [S]), [bt, xt] = H(!1), [St, Ct] = H(st), wt = z((e) => {
1059
- Ct(e), xt(!0);
1060
- }, []), [Tt, Et] = H(!1), { isDragActive: Dt, dropZoneHandlers: Ot } = Xe(z((e) => {
1061
- bt || wt({
1062
- ...st,
1284
+ dt(t), m?.(t);
1285
+ }, [m]), [vt, yt] = V(!1), [X, bt] = V(Ot), xt = L((e) => {
1286
+ bt(e), yt(!0);
1287
+ }, []), [St, Ct] = V(!1), { isDragActive: wt, dropZoneHandlers: Tt } = ct(L((e) => {
1288
+ vt || xt({
1289
+ ...Ot,
1063
1290
  initialFiles: e
1064
1291
  });
1065
- }, [bt, wt])), Q = Te ?? {}, $ = U?.colors, kt = U?.typography ?? {}, At = kt.titleClassName ?? "dial-body-semi-text", jt = kt.helperTextClassName ?? "dial-tiny-semi-text", Mt = kt.removeIconClassName, Nt = kt.menuIconClassName ?? "text-secondary", Pt = o({
1066
- "--se-title-color": $?.title,
1067
- "--se-helper-text-color": $?.helperText,
1068
- "--se-refine-action-text": $?.refineActionText,
1069
- "--se-refine-error-text": $?.refineErrorText
1070
- }), Ft = {
1071
- feedbackClassName: c($?.refineActionText && ot.refineFeedback, kt.refineFeedbackClassName, Re.refineFeedback),
1072
- errorClassName: ot.refineError
1073
- }, It = {
1074
- layout: $?.border ? { colors: {
1075
- headerBorderColor: $.border,
1076
- sidebarBorderColor: $.border
1292
+ }, [vt, xt])), Z = De ?? {}, Q = H?.colors, $ = H?.typography ?? {}, It = $.titleClassName ?? "dial-body-semi-text", Lt = $.helperTextClassName ?? "dial-tiny-semi-text", Rt = $.removeIconClassName, zt = z(() => o({ "--se-menu-icon": Q?.menuIcon }), [Q?.menuIcon]), Bt = o({
1293
+ "--se-title-color": Q?.title,
1294
+ "--se-helper-text-color": Q?.helperText,
1295
+ "--se-refine-action-text": Q?.refineActionText,
1296
+ "--se-refine-error-text": Q?.refineErrorText,
1297
+ "--se-files-card-bg": Q?.filesCardBackground,
1298
+ "--se-files-card-border": Q?.filesCardBorder,
1299
+ "--se-drop-overlay-icon": Q?.dropOverlayIcon
1300
+ }), Vt = {
1301
+ footerBackground: Q?.dialogFooterBackground,
1302
+ footerBorder: Q?.dialogFooterBorder
1303
+ }, Ht = {
1304
+ feedbackClassName: c(Q?.refineActionText && Dt.refineFeedback, $.refineFeedbackClassName, Xe.refineFeedback),
1305
+ errorClassName: Dt.refineError
1306
+ }, Ut = {
1307
+ layout: Q?.border ? { colors: {
1308
+ headerBorderColor: Q.border,
1309
+ sidebarBorderColor: Q.border
1077
1310
  } } : void 0,
1078
- section: $?.title ? { colors: { titleColor: $.title } } : void 0
1079
- }, Lt = B(() => ({
1080
- required: Q.folderNameRequiredError ?? "Enter a folder name",
1081
- invalid: Q.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
1082
- duplicate: Q.folderNameDuplicateError ?? "An item with this name already exists here"
1311
+ section: Q?.title ? { colors: { titleColor: Q.title } } : void 0
1312
+ }, Wt = z(() => ({
1313
+ required: Z.folderNameRequiredError ?? "Enter a folder name",
1314
+ invalid: Z.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
1315
+ duplicate: Z.folderNameDuplicateError ?? "An item with this name already exists here"
1316
+ }), [
1317
+ Z.folderNameRequiredError,
1318
+ Z.folderNameInvalidError,
1319
+ Z.folderNameDuplicateError
1320
+ ]), Gt = L((e) => {
1321
+ mt.has(e) || gt(/* @__PURE__ */ new Set([...mt, e]));
1322
+ }, [mt, gt]), Kt = X.targetFolderPath, qt = z(() => ({
1323
+ ...M,
1324
+ commitBatch: async (e) => {
1325
+ let t = await M.commitBatch(e);
1326
+ return !t.error && Kt !== "" && Gt(Kt), t;
1327
+ }
1083
1328
  }), [
1084
- Q.folderNameRequiredError,
1085
- Q.folderNameInvalidError,
1086
- Q.folderNameDuplicateError
1087
- ]), Rt = z((e) => {
1088
- vt.has(e) || yt(new Set([...vt, e]));
1089
- }, [vt, yt]), zt = Je({
1329
+ M,
1330
+ Kt,
1331
+ Gt
1332
+ ]), Jt = ot({
1090
1333
  files: i,
1091
- fileActions: R,
1092
- defaultName: Q.newFolderDefaultName ?? "New folder",
1093
- messages: Lt,
1094
- onRevealFolder: Rt,
1095
- onCreated: Z
1096
- }), { draftNode: Bt, draftPath: Vt, draftPane: Ht } = zt, Ut = B(() => Ve([{
1334
+ fileActions: M,
1335
+ defaultName: Z.newFolderDefaultName ?? "New folder",
1336
+ messages: Wt,
1337
+ onRevealFolder: Gt,
1338
+ onCreated: at
1339
+ }), { draftNode: Yt, draftPath: Xt, draftPane: Zt } = Jt, Qt = z(() => et([{
1097
1340
  path: K,
1098
1341
  name: K,
1099
1342
  kind: q.File
1100
- }, ...i]), [i]), Wt = B(() => Bt ? Ve([
1343
+ }, ...i]), [i]), $t = z(() => Yt ? et([
1101
1344
  {
1102
1345
  path: K,
1103
1346
  name: K,
1104
1347
  kind: q.File
1105
1348
  },
1106
1349
  ...i,
1107
- Bt
1108
- ]) : Ut, [
1350
+ Yt
1351
+ ]) : Qt, [
1109
1352
  i,
1110
- Bt,
1111
- Ut
1112
- ]), Gt = B(() => i.find((e) => e.path === X), [i, X]), Kt = z((e) => {
1113
- e.path !== Vt && Z(e.path);
1114
- }, [Z, Vt]), qt = z((e) => {
1115
- R.onRemoveNode(e), X === e && Z(K);
1353
+ Yt,
1354
+ Qt
1355
+ ]), en = z(() => i.find((e) => e.path === J), [i, J]), tn = L((e) => {
1356
+ e.path !== Xt && at(e.path);
1357
+ }, [at, Xt]), nn = L((e) => {
1358
+ M.onRemoveNode(e), J === e && at(K);
1116
1359
  }, [
1117
- R,
1118
- X,
1119
- Z
1120
- ]), { startDraft: Jt } = zt, { onCreateFolder: Yt, extractArchive: Xt, pickFromFileSystem: Zt } = R, Qt = z(async (e) => {
1121
- if (!Zt) return;
1122
- let t = await Zt();
1123
- t?.length && wt({
1124
- mode: Ze.Files,
1360
+ M,
1361
+ J,
1362
+ at
1363
+ ]), { startDraft: rn } = Jt, { onCreateFolder: an, extractArchive: on, pickFromFileSystem: sn } = M, [cn, ln] = V(null), un = L((e, t) => {
1364
+ t === Y.Mobile ? ln(e) : rn(e, t);
1365
+ }, [rn]), dn = z(() => i.filter((e) => e.kind === q.File).map((e) => e.path), [i]), fn = L(async (e) => {
1366
+ if (!sn) return;
1367
+ let t = await sn();
1368
+ t?.length && xt({
1369
+ mode: lt.Files,
1125
1370
  targetFolderPath: e,
1126
1371
  initialEntries: t
1127
1372
  });
1128
- }, [Zt, wt]), $t = z((e, t) => {
1129
- let n = (e) => Qe(e, Nt), r = [];
1130
- return Yt && r.push({
1373
+ }, [sn, xt]), pn = L((e, t) => {
1374
+ let n = (e) => ut(e, Dt.menuIcon, void 0, zt), r = [];
1375
+ return an && r.push({
1131
1376
  key: "create-folder",
1132
- label: Q.createFolderLabel ?? "Create folder",
1133
- icon: n(oe),
1134
- onClick: () => Jt(e, t)
1377
+ label: Z.createFolderLabel ?? "Create folder",
1378
+ icon: n(_e),
1379
+ onClick: () => un(e, t)
1135
1380
  }), r.push({
1136
1381
  key: "upload-files",
1137
- label: Q.uploadFilesLabel ?? "Upload files from device",
1138
- icon: n(ue),
1139
- onClick: () => wt({
1140
- mode: Ze.Files,
1382
+ label: Z.uploadFilesLabel ?? "Upload files from device",
1383
+ icon: n(be),
1384
+ onClick: () => xt({
1385
+ mode: lt.Files,
1141
1386
  targetFolderPath: e
1142
1387
  })
1143
- }), Xt && r.push({
1388
+ }), on && r.push({
1144
1389
  key: "upload-archive",
1145
- label: Q.uploadArchiveLabel ?? "Upload archive from device",
1146
- icon: n(ae),
1147
- onClick: () => wt({
1148
- mode: Ze.Archive,
1390
+ label: Z.uploadArchiveLabel ?? "Upload archive from device",
1391
+ icon: n(ge),
1392
+ onClick: () => xt({
1393
+ mode: lt.Archive,
1149
1394
  targetFolderPath: e
1150
1395
  })
1151
- }), Zt && r.push({
1396
+ }), sn && r.push({
1152
1397
  key: "open-file-system",
1153
- label: Q.openFileSystemLabel ?? "Open DIAL file system",
1154
- icon: n(re),
1155
- onClick: () => void Qt(e)
1398
+ label: Z.openFileSystemLabel ?? "Open DIAL file system",
1399
+ icon: n(he),
1400
+ onClick: () => void fn(e)
1156
1401
  }), r;
1157
1402
  }, [
1158
- Nt,
1159
- Yt,
1160
- Xt,
1161
- Zt,
1162
- Q.createFolderLabel,
1163
- Q.uploadFilesLabel,
1164
- Q.uploadArchiveLabel,
1165
- Q.openFileSystemLabel,
1166
- Jt,
1167
- wt,
1168
- Qt
1169
- ]), en = B(() => {
1170
- let e = We(ze.Header, i.find((e) => e.path === X));
1403
+ zt,
1404
+ an,
1405
+ on,
1406
+ sn,
1407
+ Z.createFolderLabel,
1408
+ Z.uploadFilesLabel,
1409
+ Z.uploadArchiveLabel,
1410
+ Z.openFileSystemLabel,
1411
+ un,
1412
+ xt,
1413
+ fn
1414
+ ]), mn = z(() => {
1415
+ let e = rt(Ze.Header, i.find((e) => e.path === J));
1171
1416
  return {
1172
- [Y.Mobile]: $t(e, Y.Mobile),
1173
- [Y.Desktop]: $t(e, Y.Desktop)
1417
+ [Y.Mobile]: pn(e, Y.Mobile),
1418
+ [Y.Desktop]: pn(e, Y.Desktop)
1174
1419
  };
1175
1420
  }, [
1176
- $t,
1421
+ pn,
1177
1422
  i,
1178
- X
1179
- ]), tn = z((e, t) => {
1180
- if (e.path === Vt || e.nodeType !== he.FOLDER) return [];
1423
+ J
1424
+ ]), hn = L((e, t) => {
1425
+ if (e.path === Xt || e.nodeType !== Te.FOLDER) return [];
1181
1426
  let n = {
1182
1427
  path: e.path,
1183
1428
  name: e.name,
1184
1429
  kind: q.Folder
1185
- }, r = $t(We(ze.Child, n), t);
1430
+ }, r = pn(rt(Ze.Child, n), t);
1186
1431
  return r.push({
1187
- key: "add-sibling",
1188
- icon: Qe(ce),
1189
- label: Q.addSiblingLabel ?? "Add sibling",
1190
- children: $t(We(ze.Sibling, n), t)
1191
- }, {
1192
1432
  key: "delete",
1193
- label: Q.deleteLabel ?? "Delete",
1433
+ label: Z.deleteLabel ?? "Delete",
1194
1434
  danger: !0,
1195
- icon: Qe(le, Mt),
1196
- onClick: () => qt(e.path)
1435
+ icon: ut(ye, Rt),
1436
+ onClick: () => nn(e.path)
1197
1437
  }), r;
1198
1438
  }, [
1199
- Vt,
1200
- Q.addSiblingLabel,
1201
- Q.deleteLabel,
1202
- Mt,
1203
- $t,
1204
- qt
1205
- ]), nn = B(() => ({
1206
- [Y.Mobile]: (e) => tn(e, Y.Mobile),
1207
- [Y.Desktop]: (e) => tn(e, Y.Desktop)
1208
- }), [tn]), rn = z((e) => e.nodeType === he.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(w, {
1209
- size: b.Small,
1210
- icon: Qe(le, Mt, g.SM),
1211
- "aria-label": Q.deleteLabel ?? "Delete",
1212
- onClick: () => qt(e.path)
1439
+ Xt,
1440
+ Z.deleteLabel,
1441
+ Rt,
1442
+ pn,
1443
+ nn
1444
+ ]), gn = z(() => ({
1445
+ [Y.Mobile]: (e) => hn(e, Y.Mobile),
1446
+ [Y.Desktop]: (e) => hn(e, Y.Desktop)
1447
+ }), [hn]), _n = L((e) => e.nodeType === Te.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ P(ee, {
1448
+ size: C.Small,
1449
+ icon: ut(ye, Rt, y.SM),
1450
+ "aria-label": Z.deleteLabel ?? "Delete",
1451
+ onClick: () => nn(e.path)
1213
1452
  }), [
1214
- Q.deleteLabel,
1215
- Mt,
1216
- qt
1217
- ]), an = (e) => /* @__PURE__ */ I("div", {
1453
+ Z.deleteLabel,
1454
+ Rt,
1455
+ nn
1456
+ ]), vn = (e) => /* @__PURE__ */ F("div", {
1218
1457
  className: "flex flex-col gap-2 desktop:gap-5",
1219
- children: [/* @__PURE__ */ I("div", {
1458
+ children: [/* @__PURE__ */ F("div", {
1220
1459
  className: "flex items-center justify-between",
1221
- children: [/* @__PURE__ */ F("span", {
1222
- className: c(ot.title, At),
1223
- children: Q.filesHeading ?? "Files"
1224
- }), /* @__PURE__ */ F(p, {
1225
- label: Q.addLabel ?? "Add",
1226
- variant: m.Neutral,
1227
- appearance: f.Solid,
1228
- size: b.Small,
1229
- items: en[e]
1460
+ children: [/* @__PURE__ */ P("span", {
1461
+ className: c(Dt.title, It),
1462
+ children: Z.filesHeading ?? "Files"
1463
+ }), /* @__PURE__ */ P(g, {
1464
+ label: Z.addLabel ?? "Add",
1465
+ variant: _.Neutral,
1466
+ appearance: h.Solid,
1467
+ size: C.Small,
1468
+ items: mn[e]
1230
1469
  })]
1231
- }), /* @__PURE__ */ F("div", {
1470
+ }), /* @__PURE__ */ P("div", {
1232
1471
  role: "tree",
1233
- "aria-label": Q.filesTreeAriaLabel ?? "Skill files",
1234
- children: /* @__PURE__ */ F(ge, {
1235
- items: Ht === e ? Wt : Ut,
1472
+ "aria-label": Z.filesTreeAriaLabel ?? "Skill files",
1473
+ children: /* @__PURE__ */ P(Ee, {
1474
+ items: Zt === e ? $t : Qt,
1236
1475
  showFiles: !0,
1237
- selectedPath: X,
1238
- expandedPaths: vt,
1239
- onExpandedPathsChange: yt,
1240
- onItemClick: Kt,
1241
- getContextMenuItems: nn[e],
1242
- renderItemActions: rn,
1243
- renamedPath: Ht === e ? Vt : void 0,
1244
- onRenameSave: zt.handleSave,
1245
- onRenameCancel: zt.handleCancel,
1246
- onRenameValidate: zt.handleValidate,
1476
+ selectedPath: J,
1477
+ expandedPaths: mt,
1478
+ onExpandedPathsChange: gt,
1479
+ onItemClick: tn,
1480
+ getContextMenuItems: gn[e],
1481
+ renderItemActions: _n,
1482
+ renamedPath: Zt === e ? Xt : void 0,
1483
+ onRenameSave: Jt.handleSave,
1484
+ onRenameCancel: Jt.handleCancel,
1485
+ onRenameValidate: Jt.handleValidate,
1247
1486
  rootItemPath: ""
1248
1487
  })
1249
1488
  })]
1250
- }), on = B(() => ({
1251
- name: W.name,
1252
- description: W.description,
1489
+ }), yn = z(() => ({
1490
+ name: U.name,
1491
+ description: U.description,
1253
1492
  iconUrl: "",
1254
1493
  version: "",
1255
1494
  topics: [],
1256
1495
  otherLocales: []
1257
- }), [W.name, W.description]), sn = B(() => ({
1496
+ }), [U.name, U.description]), bn = z(() => ({
1258
1497
  name: k?.name,
1259
1498
  description: k?.description
1260
- }), [k?.name, k?.description]), cn = B(() => ({ form: {
1261
- ...Pe,
1499
+ }), [k?.name, k?.description]), xn = z(() => ({ form: {
1500
+ ...Ke,
1262
1501
  name: {
1263
- label: Q.nameLabel ?? "Name",
1264
- placeholder: Q.namePlaceholder ?? "good-morning-breakfast"
1502
+ label: Z.nameLabel ?? "Name",
1503
+ placeholder: Z.namePlaceholder ?? "good-morning-breakfast"
1265
1504
  },
1266
1505
  description: {
1267
- label: Q.descriptionLabel ?? "Description",
1268
- placeholder: Q.descriptionPlaceholder ?? "What this skill does and when to use it"
1506
+ label: Z.descriptionLabel ?? "Description",
1507
+ placeholder: Z.descriptionPlaceholder ?? "What this skill does and when to use it"
1269
1508
  },
1270
1509
  ariaLabel: void 0
1271
1510
  } }), [
1272
- Q.nameLabel,
1273
- Q.namePlaceholder,
1274
- Q.descriptionLabel,
1275
- Q.descriptionPlaceholder
1276
- ]), ln = (e) => {
1277
- e.name !== void 0 && Me({ name: e.name }), e.description !== void 0 && (Le.reset(), Me({ description: e.description }));
1278
- }, un = ie ? (e, t) => /* @__PURE__ */ F(a, {
1511
+ Z.nameLabel,
1512
+ Z.namePlaceholder,
1513
+ Z.descriptionLabel,
1514
+ Z.descriptionPlaceholder
1515
+ ]), Sn = (e) => {
1516
+ e.name !== void 0 && G({ name: e.name }), e.description !== void 0 && (Ie.reset(), G({ description: e.description }));
1517
+ }, Cn = oe ? (e, t) => /* @__PURE__ */ P(a, {
1279
1518
  isEnabled: !0,
1280
1519
  fieldId: t,
1281
1520
  required: !0,
1282
- label: Q.descriptionLabel ?? "Description",
1283
- labels: Q,
1284
- refinement: Le,
1285
- disabled: Be || O,
1286
- ...Ft,
1521
+ label: Z.descriptionLabel ?? "Description",
1522
+ labels: Z,
1523
+ refinement: Ie,
1524
+ disabled: Re || D,
1525
+ ...Ht,
1287
1526
  children: e
1288
- }) : void 0, dn = {
1289
- title: Se,
1290
- onBack: Ge,
1291
- onCancel: Ue,
1292
- onSubmit: Ke,
1293
- submitLabel: Q.createLabel ?? "Create",
1294
- isSubmitDisabled: Be || T || D,
1527
+ }) : void 0, wn = {
1528
+ title: ve,
1529
+ onBack: Ve,
1530
+ onCancel: Be,
1531
+ onSubmit: He,
1532
+ submitLabel: Z.createLabel ?? "Create",
1533
+ isSubmitDisabled: Re || x || E,
1295
1534
  labels: {
1296
- cancelLabel: Q.cancelLabel ?? "Cancel",
1297
- backAriaLabel: xe ?? "Back",
1298
- savingStatusLabel: Q.savingStatusLabel ?? "Saving"
1535
+ cancelLabel: Z.cancelLabel ?? "Cancel",
1536
+ backAriaLabel: I ?? "Back",
1537
+ savingStatusLabel: Z.savingStatusLabel ?? "Saving"
1299
1538
  },
1300
- styles: It,
1539
+ styles: Ut,
1301
1540
  metadataTitle: null
1302
1541
  };
1303
- if (T) return /* @__PURE__ */ F("div", {
1304
- dir: Ee,
1542
+ if (x) return /* @__PURE__ */ P("div", {
1543
+ dir: Oe,
1305
1544
  className: "relative flex min-h-0 flex-1 flex-col",
1306
- children: /* @__PURE__ */ F(Ne, {
1307
- ...dn,
1308
- metadata: /* @__PURE__ */ F("div", {
1309
- role: "status",
1310
- "aria-label": Q.loadingAriaLabel ?? "Loading skill",
1545
+ children: /* @__PURE__ */ P(Ge, {
1546
+ ...wn,
1547
+ metadata: /* @__PURE__ */ P("div", {
1311
1548
  className: "flex flex-1 items-center justify-center p-8",
1312
- children: /* @__PURE__ */ F(ne, {})
1549
+ children: /* @__PURE__ */ P(ue, { ariaLabel: Z.loadingAriaLabel ?? "Loading skill" })
1313
1550
  })
1314
1551
  })
1315
1552
  });
1316
- if (D) return /* @__PURE__ */ F("div", {
1317
- dir: Ee,
1553
+ if (E) return /* @__PURE__ */ P("div", {
1554
+ dir: Oe,
1318
1555
  className: "relative flex min-h-0 flex-1 flex-col",
1319
- children: /* @__PURE__ */ F(Ne, {
1320
- ...dn,
1321
- metadata: /* @__PURE__ */ I("div", {
1322
- role: "alert",
1323
- className: "flex flex-col items-center gap-4 p-8",
1324
- children: [/* @__PURE__ */ F(x, { text: Q.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ F(A, {
1325
- label: Q.retryLabel ?? "Retry",
1326
- onClick: Ce
1327
- })]
1556
+ children: /* @__PURE__ */ P(Ge, {
1557
+ ...wn,
1558
+ metadata: /* @__PURE__ */ P("div", {
1559
+ className: "p-8",
1560
+ children: /* @__PURE__ */ P(w, {
1561
+ message: Z.loadErrorMessage ?? "Couldn't load this skill. Please try again.",
1562
+ iconStroke: b,
1563
+ action: /* @__PURE__ */ P(se, {
1564
+ label: Z.retryLabel ?? "Retry",
1565
+ onClick: Se
1566
+ })
1567
+ })
1328
1568
  })
1329
1569
  })
1330
1570
  });
1331
- let fn = X === K, pn = fn ? K : Q.selectedFileHeading?.(Gt?.name ?? X) ?? Gt?.name ?? X, mn = ee != null || te != null ? /* @__PURE__ */ I("div", {
1571
+ let Tn = J === K, En = Tn ? K : Z.selectedFileHeading?.(en?.name ?? J) ?? en?.name ?? J, Dn = te != null || ne != null ? /* @__PURE__ */ F("div", {
1332
1572
  className: "flex flex-col gap-2",
1333
- children: [ee != null && /* @__PURE__ */ I("div", {
1573
+ children: [te != null && /* @__PURE__ */ F("div", {
1334
1574
  className: "flex items-center gap-2",
1335
- children: [/* @__PURE__ */ F(x, { text: ee }), we != null && /* @__PURE__ */ F(C, {
1336
- label: Q.retryLabel ?? "Retry",
1337
- onClick: we
1575
+ children: [/* @__PURE__ */ P(T, { text: te }), Ce != null && /* @__PURE__ */ P(O, {
1576
+ label: Z.retryLabel ?? "Retry",
1577
+ onClick: Ce
1338
1578
  })]
1339
- }), te != null && /* @__PURE__ */ I("div", {
1579
+ }), ne != null && /* @__PURE__ */ F("div", {
1340
1580
  className: "flex items-center gap-2",
1341
- children: [/* @__PURE__ */ F(x, { text: te.message }), /* @__PURE__ */ F(C, {
1342
- label: Q.reloadLatestLabel ?? "Reload latest",
1343
- onClick: j
1581
+ children: [/* @__PURE__ */ P(T, { text: ne.message }), /* @__PURE__ */ P(O, {
1582
+ label: Z.reloadLatestLabel ?? "Reload latest",
1583
+ onClick: re
1344
1584
  })]
1345
1585
  })]
1346
- }) : void 0, hn = /* @__PURE__ */ F(a, {
1347
- isEnabled: !!se,
1348
- fieldId: ke,
1586
+ }) : void 0, On = /* @__PURE__ */ P(a, {
1587
+ isEnabled: !!ce,
1588
+ fieldId: je,
1349
1589
  required: !0,
1350
- labelClassName: c(ot.helperText, jt),
1351
- label: Q.instructionsLabel ?? "Instructions",
1352
- labels: Q,
1353
- refinement: J,
1354
- disabled: Be || O,
1355
- ...Ft,
1356
- children: /* @__PURE__ */ I("div", {
1590
+ labelClassName: c(Dt.helperText, Lt),
1591
+ label: Z.instructionsLabel ?? "Instructions",
1592
+ labels: Z,
1593
+ refinement: Le,
1594
+ disabled: Re || D,
1595
+ ...Ht,
1596
+ children: /* @__PURE__ */ F("div", {
1357
1597
  className: "flex flex-1 flex-col gap-2",
1358
1598
  children: [
1359
- !se && /* @__PURE__ */ F(E, {
1360
- htmlFor: ke,
1361
- className: c(ot.helperText, jt),
1362
- label: Q.instructionsLabel ?? "Instructions",
1599
+ !ce && /* @__PURE__ */ P(A, {
1600
+ htmlFor: je,
1601
+ className: c(Dt.helperText, Lt),
1602
+ label: Z.instructionsLabel ?? "Instructions",
1363
1603
  required: !0
1364
1604
  }),
1365
- /* @__PURE__ */ F("div", {
1366
- ref: Ae,
1605
+ /* @__PURE__ */ P("div", {
1606
+ ref: Ne,
1367
1607
  className: c(t, e, n),
1368
- children: /* @__PURE__ */ F(de, {
1369
- fallback: /* @__PURE__ */ F(ne, { ariaLabel: Q.instructionsLoadingAriaLabel ?? "Loading" }),
1370
- children: /* @__PURE__ */ F(mt, {
1371
- id: ke,
1372
- ariaLabel: Q.instructionsLabel ?? "Instructions",
1373
- value: W.instructions,
1608
+ children: /* @__PURE__ */ P(xe, {
1609
+ fallback: /* @__PURE__ */ P(ue, { ariaLabel: Z.instructionsLoadingAriaLabel ?? "Loading" }),
1610
+ children: /* @__PURE__ */ P(Ft, {
1611
+ id: je,
1612
+ ariaLabel: Z.instructionsLabel ?? "Instructions",
1613
+ value: U.instructions,
1374
1614
  onChange: (e) => {
1375
- J.reset(), Me({ instructions: e });
1615
+ Le.reset(), G({ instructions: e });
1376
1616
  },
1377
- theme: De,
1617
+ theme: ke,
1378
1618
  showDragbar: !1,
1379
- placeholder: Q.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
1619
+ placeholder: Z.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
1380
1620
  })
1381
1621
  })
1382
1622
  }),
1383
- k?.instructions != null && /* @__PURE__ */ F(x, { text: k.instructions })
1623
+ k?.instructions != null && /* @__PURE__ */ P(T, {
1624
+ id: Me,
1625
+ text: k.instructions
1626
+ })
1384
1627
  ]
1385
1628
  })
1386
1629
  });
1387
- return /* @__PURE__ */ I("div", {
1388
- dir: Ee,
1389
- className: c("relative flex min-h-0 flex-1 flex-col", Re.root),
1390
- style: Pt,
1391
- ...Ot,
1630
+ return /* @__PURE__ */ F("div", {
1631
+ dir: Oe,
1632
+ className: c("relative flex min-h-0 min-w-0 flex-1 flex-col", Xe.root),
1633
+ style: Bt,
1634
+ ...Tt,
1392
1635
  children: [
1393
- /* @__PURE__ */ F($e, {
1394
- isVisible: Dt && !bt,
1395
- labels: Te
1636
+ /* @__PURE__ */ P(ht, {
1637
+ isVisible: wt && !vt,
1638
+ labels: De,
1639
+ titleClassName: $.dropOverlayTitleClassName,
1640
+ subtitleClassName: $.dropOverlaySubtitleClassName
1396
1641
  }),
1397
- /* @__PURE__ */ F(Ne, {
1398
- ...dn,
1399
- asideData: _e,
1400
- asideSectionClassName: ft,
1401
- isSubmitting: O,
1402
- metadataSectionClassName: dt,
1403
- metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
1642
+ /* @__PURE__ */ P(Ge, {
1643
+ ...wn,
1644
+ asideData: de,
1645
+ asideSectionClassName: Nt,
1646
+ isSubmitting: D,
1647
+ metadataSectionClassName: Mt,
1648
+ metadata: /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("div", {
1404
1649
  className: "desktop:hidden",
1405
- children: /* @__PURE__ */ F(d, {
1406
- title: Q.editingFileLabel ?? "Editing file",
1407
- description: Gt?.name ?? "SKILL.md",
1408
- expanded: Tt,
1409
- onToggle: Et,
1410
- ariaLabel: Q.editingFileLabel ?? "Editing file",
1411
- children: an(Y.Mobile)
1650
+ children: /* @__PURE__ */ P(_t, {
1651
+ label: Z.editingFileLabel ?? "Editing file",
1652
+ fileName: en?.name ?? "SKILL.md",
1653
+ isExpanded: St,
1654
+ onToggle: Ct,
1655
+ labelClassName: $.editingFileLabelClassName,
1656
+ fileNameClassName: $.editingFileNameClassName,
1657
+ children: vn(Y.Mobile)
1412
1658
  })
1413
- }), /* @__PURE__ */ F("div", {
1659
+ }), /* @__PURE__ */ P("div", {
1414
1660
  className: "hidden desktop:block",
1415
- children: an(Y.Desktop)
1661
+ children: vn(Y.Desktop)
1416
1662
  })] }),
1417
- alert: mn,
1418
- setupTitle: pn,
1419
- setupSectionClassName: pt,
1420
- setup: fn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ie, {
1421
- values: on,
1422
- errors: sn,
1423
- onChange: ln,
1424
- fields: ct,
1663
+ alert: Dn,
1664
+ setupTitle: En,
1665
+ setupSectionClassName: Pt,
1666
+ setup: Tn ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Je, {
1667
+ values: yn,
1668
+ errors: bn,
1669
+ onChange: Sn,
1670
+ fields: kt,
1425
1671
  isDescriptionRequired: !0,
1426
- isNameReadOnly: M,
1427
- nameCaption: k?.name ? void 0 : Q.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
1428
- renderDescription: un,
1429
- labels: cn
1430
- }), hn] }) : /* @__PURE__ */ F(P, { children: Gt?.kind === q.File && /* @__PURE__ */ F("div", {
1431
- className: "flex min-h-0 flex-1 flex-col",
1432
- children: fe ?? /* @__PURE__ */ F(h, { text: Q.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
1672
+ isNameReadOnly: ie,
1673
+ nameReadOnlyTooltip: Z.nameReadOnlyTooltip ?? "The skill name can't be changed after creation",
1674
+ nameCaption: k?.name ? void 0 : Z.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
1675
+ renderDescription: Cn,
1676
+ labels: xn
1677
+ }), On] }) : /* @__PURE__ */ P(N, { children: en?.kind === q.File && /* @__PURE__ */ P("div", {
1678
+ className: "flex h-[max(320px,60dvh)] min-h-0 min-w-0 flex-none flex-col desktop:h-auto desktop:flex-1",
1679
+ children: le ?? /* @__PURE__ */ P(v, { text: Z.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
1433
1680
  }) })
1434
1681
  }),
1435
- /* @__PURE__ */ F(at, {
1436
- isOpen: bt,
1437
- onClose: () => xt(!1),
1438
- fileActions: R,
1439
- mode: St.mode,
1440
- targetFolderPath: St.targetFolderPath,
1441
- initialFiles: St.initialFiles,
1442
- initialEntries: St.initialEntries,
1443
- labels: Te
1682
+ /* @__PURE__ */ P(Et, {
1683
+ isOpen: vt,
1684
+ onClose: () => yt(!1),
1685
+ fileActions: qt,
1686
+ mode: X.mode,
1687
+ targetFolderPath: X.targetFolderPath,
1688
+ initialFiles: X.initialFiles,
1689
+ initialEntries: X.initialEntries,
1690
+ existingFilePaths: dn,
1691
+ onCommitted: (e) => {
1692
+ e.some((e) => e.replacesExisting) && Qe(!0);
1693
+ },
1694
+ messageClassName: $.uploadMessageClassName,
1695
+ rowCaptionClassName: $.uploadRowCaptionClassName,
1696
+ labels: De,
1697
+ dialogColors: Vt,
1698
+ colors: {
1699
+ invalidDropZoneBorder: Q?.uploadInvalidDropZoneBorder,
1700
+ rowBorder: Q?.uploadRowBorder
1701
+ }
1702
+ }),
1703
+ /* @__PURE__ */ P(pt, {
1704
+ isOpen: cn != null,
1705
+ onClose: () => ln(null),
1706
+ validateName: (e) => Jt.validateNewFolder(e, cn ?? ""),
1707
+ onCreate: (e) => Jt.createFolder(e, cn ?? ""),
1708
+ title: Z.createFolderLabel ?? "Create folder",
1709
+ nameLabel: Z.createFolderNameLabel ?? "Name",
1710
+ namePlaceholder: Z.createFolderNamePlaceholder ?? "Enter folder name",
1711
+ createLabel: Z.createFolderConfirmLabel ?? "Create",
1712
+ cancelLabel: Z.cancelLabel ?? "Cancel",
1713
+ closeAriaLabel: Z.createFolderCloseAriaLabel ?? "Close",
1714
+ dialogColors: Vt
1444
1715
  })
1445
1716
  ]
1446
1717
  });
1447
1718
  };
1448
1719
  //#endregion
1449
- export { Re as SKILL_EDITOR_CLASS, ht as SkillEditor, et as SkillFileCandidateKind, q as SkillFileNodeKind, Ze as SkillFileUploadMode, tt as SkillFileValidationStatus };
1720
+ export { Xe as SKILL_EDITOR_CLASS, Q as SkillEditor, vt as SkillFileCandidateKind, q as SkillFileNodeKind, lt as SkillFileUploadMode, yt as SkillFileValidationStatus };