@epam/ai-dial-projects 1.3.0-dev.325 → 1.3.0-dev.331

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,38 +1,38 @@
1
- import { DeleteConfirmationDialog as e, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as t, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as n, MarkdownRenderer as r, PROHIBITED_CONVERSATION_NAME_CHARS_RE as i, PanelEmptyState as a, RequestStatus as o, TextRefinementField as s, buildCssVars as c, getAttachmentTypeFromMime as l, inferMimeTypeFromPath as u, mergeClasses as d, useAvailableHeightCap as f, useIsMobile as p, useTextRefinement as m } from "@epam/ai-dial-chat-shared";
2
- import { Button as h, ButtonAppearance as g, ButtonDropdown as _, ButtonVariant as v, CardShell as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, Dropdown as S, ElementSize as C, EllipsisTooltip as w, ErrorText as T, FileDropzone as E, FolderPath as D, GhostButton as O, GhostIconButton as k, Highlight as A, Input as ee, Label as j, LinkButton as M, LiveRegion as N, LiveRegionElement as P, LiveRegionPoliteness as F, MenuItemMark as I, NeutralButton as L, Popup as te, PopupSize as ne, Search as re, Spinner as ie } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowNarrowLeft as R, IconArrowsSort as ae, IconDotsVertical as z, IconDownload as oe, IconPencilMinus as B, IconPin as V, IconPinFilled as H, IconPlus as se, IconShare as ce, IconTrashX as le, IconWorldShare as U, createReactComponent as ue } from "@tabler/icons-react";
1
+ import { ActionMenu as e, DeleteConfirmationDialog as t, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as n, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as r, MarkdownRenderer as i, PROHIBITED_CONVERSATION_NAME_CHARS_RE as a, PanelEmptyState as o, RequestStatus as s, TextRefinementField as c, buildCssVars as l, getAttachmentTypeFromMime as u, inferMimeTypeFromPath as d, mergeClasses as f, useAvailableHeightCap as p, useIsMobile as m, useTextRefinement as h } from "@epam/ai-dial-chat-shared";
2
+ import { Button as g, ButtonAppearance as _, ButtonDropdown as v, ButtonVariant as y, CardShell as b, DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, EllipsisTooltip as w, ErrorText as T, FileDropzone as E, FolderPath as D, GhostButton as O, GhostIconButton as k, Highlight as A, Input as j, Label as M, LinkButton as N, LiveRegion as P, LiveRegionElement as F, LiveRegionPoliteness as I, MenuItemMark as L, NeutralButton as R, Popup as ee, PopupSize as te, Search as ne, Spinner as re } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowNarrowLeft as z, IconArrowsSort as ie, IconDotsVertical as B, IconDownload as ae, IconPencilMinus as V, IconPin as oe, IconPinFilled as H, IconPlus as se, IconShare as ce, IconTrashX as le, IconWorldShare as U, createReactComponent as ue } from "@tabler/icons-react";
4
4
  import { Suspense as de, lazy as fe, memo as W, useCallback as G, useEffect as pe, useId as K, useMemo as q, useRef as J, useState as Y } from "react";
5
5
  import { Fragment as me, jsx as X, jsxs as Z } from "react/jsx-runtime";
6
6
  import { AttachmentCard as he, FileDndOverlay as ge } from "@epam/ai-dial-attachment-input";
7
- import { BuilderFormContainer as _e } from "@epam/ai-dial-builder-form";
8
- import { LazyMarkdownEditor as ve } from "@epam/ai-dial-ui-kit/editors";
7
+ import { BuilderFormActionsOrder as _e, BuilderFormContainer as ve } from "@epam/ai-dial-builder-form";
8
+ import { LazyMarkdownEditor as ye } from "@epam/ai-dial-ui-kit/editors";
9
9
  //#region src/types/projects-sort-key.ts
10
- var ye = /* @__PURE__ */ function(e) {
10
+ var be = /* @__PURE__ */ function(e) {
11
11
  return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
12
- }({}), be = (e, t) => {
12
+ }({}), xe = (e, t) => {
13
13
  let n = t.trim().toLocaleLowerCase();
14
14
  return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
15
- }, xe = (e, t, n) => {
15
+ }, Se = (e, t, n) => {
16
16
  let r = new Intl.Collator(n, {
17
17
  sensitivity: "base",
18
18
  numeric: !0
19
19
  }), i = (e, t) => r.compare(e.name, t.name), a = (e, t) => Number(t.isPinned ?? !1) - Number(e.isPinned ?? !1);
20
- if (t === ye.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
- let o = t === ye.Oldest ? 1 : -1;
20
+ if (t === be.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
+ let o = t === be.Oldest ? 1 : -1;
22
22
  return [...e].sort((e, t) => {
23
23
  let n = a(e, t);
24
24
  return n === 0 ? e.updatedAt == null && t.updatedAt == null ? i(e, t) : e.updatedAt == null ? 1 : t.updatedAt == null ? -1 : (e.updatedAt - t.updatedAt) * o || i(e, t) : n;
25
25
  });
26
- }, Se = 60, Ce = 3600, we = 24 * Ce, Te = [
27
- ["year", 365 * we],
28
- ["month", 30 * we],
29
- ["week", 7 * we],
30
- ["day", we],
31
- ["hour", Ce],
32
- ["minute", Se]
33
- ], Ee = (e, t, n) => {
26
+ }, Ce = 60, we = 3600, Te = 24 * we, Ee = [
27
+ ["year", 365 * Te],
28
+ ["month", 30 * Te],
29
+ ["week", 7 * Te],
30
+ ["day", Te],
31
+ ["hour", we],
32
+ ["minute", Ce]
33
+ ], De = (e, t, n) => {
34
34
  let r = (t - e) / 1e3;
35
- for (let [e, t] of Te) {
35
+ for (let [e, t] of Ee) {
36
36
  let i = Math.floor(r / t);
37
37
  if (i >= 1) return new Intl.RelativeTimeFormat(n).format(-i, e);
38
38
  }
@@ -48,31 +48,31 @@ var ye = /* @__PURE__ */ function(e) {
48
48
  link: "_link_1gkfw_39",
49
49
  aboveLink: "_aboveLink_1gkfw_55",
50
50
  interactive: "_interactive_1gkfw_60"
51
- }, De = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Oe = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, ke = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, pinLabel: a, onTogglePin: o, href: s, onOpen: c, now: l, locale: u, updatedAtClassName: f, titleClassName: p, pathLabelClassName: m, pathLeafClassName: h }) => {
51
+ }, Oe = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], ke = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ae = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, pinLabel: a, onTogglePin: o, href: s, onOpen: c, now: l, locale: u, updatedAtClassName: d, titleClassName: p, pathLabelClassName: m, pathLeafClassName: h }) => {
52
52
  let g = /* @__PURE__ */ X(A, {
53
53
  text: e.name,
54
54
  query: t,
55
55
  maxLines: 1,
56
- className: d("min-w-0", p, Q.title, s != null && Q.aboveLink)
56
+ className: f("min-w-0", p, Q.title, s != null && Q.aboveLink)
57
57
  }), _ = /* @__PURE__ */ X(D, {
58
- segments: De(n, e.parentPath),
58
+ segments: Oe(n, e.parentPath),
59
59
  ariaLabel: r,
60
- labelClassName: d(m, Q.path),
61
- leafClassName: d(h, Q.path)
60
+ labelClassName: f(m, Q.path),
61
+ leafClassName: f(h, Q.path)
62
62
  }), v = J(null);
63
63
  return /* @__PURE__ */ X("li", {
64
64
  className: "flex min-w-0",
65
- children: /* @__PURE__ */ Z(y, {
65
+ children: /* @__PURE__ */ Z(b, {
66
66
  "aria-label": e.name,
67
- className: d("relative flex w-full min-w-0 flex-col gap-2", Q.card, s != null && "has-focus-visible:translate-y-[-3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", s != null && Q.interactive),
67
+ className: f("relative flex w-full min-w-0 flex-col gap-2", Q.card, s != null && "has-focus-visible:translate-y-[-3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", s != null && Q.interactive),
68
68
  children: [
69
69
  e.updatedAt != null && /* @__PURE__ */ X("time", {
70
70
  dateTime: new Date(e.updatedAt).toISOString(),
71
- className: d(f, Q.updatedAt, (e.isPinned || o != null) && "pe-6"),
72
- children: Ee(e.updatedAt, l, u)
71
+ className: f(d, Q.updatedAt, (e.isPinned || o != null) && "pe-6"),
72
+ children: De(e.updatedAt, l, u)
73
73
  }),
74
74
  /* @__PURE__ */ Z("div", {
75
- className: d("flex min-w-0 items-center", (e.isPinned || o != null) && "pe-6"),
75
+ className: f("flex min-w-0 items-center", (e.isPinned || o != null) && "pe-6"),
76
76
  children: [s == null ? /* @__PURE__ */ X("div", {
77
77
  className: "min-w-0 flex-1",
78
78
  children: g
@@ -80,14 +80,14 @@ var ye = /* @__PURE__ */ function(e) {
80
80
  ref: v,
81
81
  href: s,
82
82
  onClick: (t) => {
83
- c != null && Oe(t) && (t.preventDefault(), c(e.id));
83
+ c != null && ke(t) && (t.preventDefault(), c(e.id));
84
84
  },
85
- className: d("min-w-0 flex-1", Q.link),
85
+ className: f("min-w-0 flex-1", Q.link),
86
86
  children: g
87
87
  }), o == null ? e.isPinned && /* @__PURE__ */ Z("span", {
88
- className: d("absolute inset-e-5 top-5 flex", Q.pin),
88
+ className: f("absolute inset-e-5 top-5 flex", Q.pin),
89
89
  children: [/* @__PURE__ */ X(H, {
90
- size: b.SM,
90
+ size: x.SM,
91
91
  "aria-hidden": !0
92
92
  }), /* @__PURE__ */ X("span", {
93
93
  className: "sr-only",
@@ -96,17 +96,17 @@ var ye = /* @__PURE__ */ function(e) {
96
96
  }) : /* @__PURE__ */ X(k, {
97
97
  size: C.Small,
98
98
  icon: e.isPinned ? /* @__PURE__ */ X(H, {
99
- size: b.SM,
99
+ size: x.SM,
100
100
  "aria-hidden": !0
101
- }) : /* @__PURE__ */ X(V, {
102
- size: b.SM,
101
+ }) : /* @__PURE__ */ X(oe, {
102
+ size: x.SM,
103
103
  "aria-hidden": !0,
104
- stroke: x
104
+ stroke: S
105
105
  }),
106
106
  "aria-label": a,
107
107
  "aria-pressed": e.isPinned === !0,
108
108
  onClick: () => o(e.id, !e.isPinned),
109
- className: d("absolute inset-e-4 top-4", Q.pinToggle, !e.isPinned && Q.pinToggleIdle)
109
+ className: f("absolute inset-e-4 top-4", Q.pinToggle, !e.isPinned && Q.pinToggleIdle)
110
110
  })]
111
111
  }),
112
112
  s == null ? _ : /* @__PURE__ */ X("div", {
@@ -127,12 +127,12 @@ var ye = /* @__PURE__ */ function(e) {
127
127
  ]
128
128
  })
129
129
  });
130
- }, Ae = {
130
+ }, je = {
131
131
  container: "_container_4rer8_1",
132
132
  subtitle: "_subtitle_4rer8_5",
133
133
  sortButton: "_sortButton_4rer8_9"
134
- }, je = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: o, onTogglePin: s, onOpenProject: l, getProjectHref: u, searchQuery: f, onSearchQueryChange: m, sortKey: y, onSortKeyChange: S, labels: w, locale: T, styles: E }) => {
135
- let { colors: D, typography: k } = E ?? {}, A = k?.titleClassName ?? "dial-h1-text", ee = k?.subtitleClassName ?? "dial-body-text", j = k?.cardTitleClassName ?? "dial-body-semi-text", M = k?.pathLabelClassName ?? "dial-tiny-text", F = k?.pathLeafClassName ?? "dial-tiny-semi-text", L = k?.updatedAtClassName ?? "dial-tiny-text", te = k?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", ne = c({
134
+ }, Me = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onTogglePin: s, onOpenProject: c, getProjectHref: u, searchQuery: d, onSearchQueryChange: p, sortKey: h, onSortKeyChange: b, labels: w, locale: T, styles: E }) => {
135
+ let { colors: D, typography: k } = E ?? {}, A = k?.titleClassName ?? "dial-h1-text", j = k?.subtitleClassName ?? "dial-body-text", M = k?.cardTitleClassName ?? "dial-body-semi-text", N = k?.pathLabelClassName ?? "dial-tiny-text", I = k?.pathLeafClassName ?? "dial-tiny-semi-text", R = k?.updatedAtClassName ?? "dial-tiny-text", ee = k?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", te = l({
136
136
  "--pr-bg": D?.background,
137
137
  "--pr-subtitle-text": D?.subtitleText,
138
138
  "--pr-sort-text": D?.sortButtonText,
@@ -141,77 +141,77 @@ var ye = /* @__PURE__ */ function(e) {
141
141
  "--pr-updated-at-text": D?.updatedAtText,
142
142
  "--pr-path-text": D?.pathText,
143
143
  "--pr-card-focus-outline": D?.cardFocusOutline
144
- }), R = p(), z = q(() => Date.now(), [e]), oe = f.trim(), B = r.length > 0, V = B && e.length === 0, H = q(() => xe(be(e, f), y, T), [
144
+ }), z = m(), B = q(() => Date.now(), [e]), ae = d.trim(), V = r.length > 0, oe = V && e.length === 0, H = q(() => Se(xe(e, d), h, T), [
145
145
  e,
146
- f,
147
- y,
146
+ d,
147
+ h,
148
148
  T
149
- ]), ce = w.sortOptions.find((e) => e.value === y)?.label ?? w.sortLabel, le = q(() => w.sortOptions.map((e) => ({
149
+ ]), ce = w.sortOptions.find((e) => e.value === h)?.label ?? w.sortLabel, le = q(() => w.sortOptions.map((e) => ({
150
150
  key: e.value,
151
151
  label: e.label,
152
- mark: I.Check,
153
- checked: e.value === y,
154
- onClick: () => S(e.value)
152
+ mark: L.Check,
153
+ checked: e.value === h,
154
+ onClick: () => b(e.value)
155
155
  })), [
156
156
  w.sortOptions,
157
- y,
158
- S
157
+ h,
158
+ b
159
159
  ]), U = (e) => {
160
- m(e ?? "");
160
+ p(e ?? "");
161
161
  }, ue = () => {
162
- if (!t) return n ? w.errorLabel : B ? w.incompleteLabel : e.length === 0 ? w.emptyStateLabel : H.length === 0 ? w.noResultsLabel : w.resultCountLabel(H.length);
163
- }, de = (e, t) => o ? /* @__PURE__ */ X(h, {
162
+ if (!t) return n ? w.errorLabel : V ? w.incompleteLabel : e.length === 0 ? w.emptyStateLabel : H.length === 0 ? w.noResultsLabel : w.resultCountLabel(H.length);
163
+ }, de = (e, t) => a ? /* @__PURE__ */ X(g, {
164
164
  label: w.createProjectLabel,
165
165
  variant: e,
166
- onClick: o,
167
- className: d("shrink-0", t)
168
- }) : void 0, fe = () => t ? /* @__PURE__ */ X(ie, {}) : n || V ? /* @__PURE__ */ Z("div", {
166
+ onClick: a,
167
+ className: f("shrink-0", t)
168
+ }) : void 0, fe = () => t ? /* @__PURE__ */ X(re, {}) : n || oe ? /* @__PURE__ */ Z("div", {
169
169
  className: "flex flex-col items-center gap-3",
170
170
  children: [/* @__PURE__ */ X("p", {
171
- className: d(ee, Ae.subtitle),
171
+ className: f(j, je.subtitle),
172
172
  children: n ? w.errorLabel : w.incompleteLabel
173
173
  }), /* @__PURE__ */ X(O, {
174
174
  label: w.retryLabel,
175
175
  onClick: i
176
176
  })]
177
- }) : e.length === 0 ? /* @__PURE__ */ X(a, {
177
+ }) : e.length === 0 ? /* @__PURE__ */ X(o, {
178
178
  label: w.emptyStateLabel,
179
179
  description: w.emptyStateDescription,
180
- action: de(v.Secondary, "mt-2"),
180
+ action: de(y.Secondary, "mt-2"),
181
181
  containerClassName: G,
182
182
  labelClassName: "mt-3",
183
- descriptionClassName: te
184
- }) : H.length === 0 ? /* @__PURE__ */ X(a, {
183
+ descriptionClassName: ee
184
+ }) : H.length === 0 ? /* @__PURE__ */ X(o, {
185
185
  label: w.noResultsLabel,
186
186
  containerClassName: G,
187
187
  labelClassName: "mt-3"
188
188
  }) : /* @__PURE__ */ X("ul", {
189
189
  className: "m-0 grid w-full min-w-0 list-none grid-cols-1 gap-4 p-0 desktop:grid-cols-3 desktop:gap-5",
190
- children: H.map((e) => /* @__PURE__ */ X(ke, {
190
+ children: H.map((e) => /* @__PURE__ */ X(Ae, {
191
191
  project: e,
192
- searchQuery: oe,
192
+ searchQuery: ae,
193
193
  sourceLabel: w.sourceLabels[e.source],
194
194
  folderPathLabel: w.folderPathLabel,
195
195
  pinnedLabel: w.pinnedLabel ?? "Pinned",
196
196
  pinLabel: w.pinLabel ?? "Pin",
197
197
  onTogglePin: s,
198
198
  href: u?.(e.id),
199
- onOpen: l,
200
- now: z,
199
+ onOpen: c,
200
+ now: B,
201
201
  locale: T,
202
- updatedAtClassName: L,
203
- titleClassName: j,
204
- pathLabelClassName: M,
205
- pathLeafClassName: F
202
+ updatedAtClassName: R,
203
+ titleClassName: M,
204
+ pathLabelClassName: N,
205
+ pathLeafClassName: I
206
206
  }, e.id))
207
- }), W = t || n || V, G = "mt-6 p-3 desktop:mt-0";
207
+ }), W = t || n || oe, G = "mt-6 p-3 desktop:mt-0";
208
208
  return /* @__PURE__ */ Z("div", {
209
- style: ne,
210
- className: d("relative flex h-full w-full min-w-0 flex-col", Ae.container),
209
+ style: te,
210
+ className: f("relative flex size-full min-h-0 min-w-0 flex-1 flex-col", je.container),
211
211
  children: [/* @__PURE__ */ Z("div", {
212
212
  className: "flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-y-auto",
213
213
  children: [
214
- R ? /* @__PURE__ */ X("h1", {
214
+ z ? /* @__PURE__ */ X("h1", {
215
215
  className: "sr-only",
216
216
  children: w.title
217
217
  }) : /* @__PURE__ */ Z("div", {
@@ -219,136 +219,136 @@ var ye = /* @__PURE__ */ function(e) {
219
219
  children: [/* @__PURE__ */ Z("div", {
220
220
  className: "flex min-h-10 min-w-0 flex-1 flex-col justify-center gap-0.5",
221
221
  children: [/* @__PURE__ */ X("h1", {
222
- className: d("wrap-break-word", A),
222
+ className: f("wrap-break-word", A),
223
223
  children: w.title
224
224
  }), w.subtitle && /* @__PURE__ */ X("p", {
225
- className: d(ee, Ae.subtitle),
225
+ className: f(j, je.subtitle),
226
226
  children: w.subtitle
227
227
  })]
228
- }), de(v.Primary)]
228
+ }), de(y.Primary)]
229
229
  }),
230
230
  /* @__PURE__ */ Z("div", {
231
231
  className: "flex items-center gap-2 p-4 desktop:gap-3 desktop:px-8 desktop:pt-4 desktop:pb-5",
232
232
  children: [/* @__PURE__ */ X("div", {
233
233
  role: "search",
234
234
  className: "min-w-0 flex-1",
235
- children: /* @__PURE__ */ X(re, {
236
- value: f,
235
+ children: /* @__PURE__ */ X(ne, {
236
+ value: d,
237
237
  onChange: U,
238
238
  placeholder: w.searchPlaceholder,
239
239
  clearLabel: w.clearSearchLabel,
240
240
  "aria-label": w.searchAriaLabel,
241
- size: R ? C.Standard : C.Large
241
+ size: z ? C.Standard : C.Large
242
242
  })
243
243
  }), w.sortOptions.length > 0 && /* @__PURE__ */ X("div", {
244
244
  role: "group",
245
245
  "aria-label": w.sortLabel,
246
246
  className: "shrink-0",
247
- children: /* @__PURE__ */ X(_, {
247
+ children: /* @__PURE__ */ X(v, {
248
248
  items: le,
249
249
  label: ce,
250
- variant: v.Primary,
251
- appearance: g.Ghost,
252
- size: R ? C.Small : C.Standard,
253
- iconBefore: /* @__PURE__ */ X(ae, {
254
- size: R ? b.SM : b.MD,
250
+ variant: y.Primary,
251
+ appearance: _.Ghost,
252
+ size: z ? C.Small : C.Standard,
253
+ iconBefore: /* @__PURE__ */ X(ie, {
254
+ size: z ? x.SM : x.MD,
255
255
  "aria-hidden": !0,
256
- stroke: x
256
+ stroke: S
257
257
  }),
258
- className: d("desktop:px-3", Ae.sortButton)
258
+ className: f("desktop:px-3", je.sortButton)
259
259
  })
260
260
  })]
261
261
  }),
262
- /* @__PURE__ */ X(N, {
262
+ /* @__PURE__ */ X(P, {
263
263
  visuallyHidden: !0,
264
- as: P.Span,
264
+ as: F.Span,
265
265
  children: ue()
266
266
  }),
267
267
  /* @__PURE__ */ Z("div", {
268
268
  className: "flex w-full min-w-0 flex-1 flex-col items-center gap-4 px-4 pb-20 desktop:gap-5 desktop:px-8 desktop:pt-6 desktop:pb-8",
269
- children: [B && !t && !n && !V && /* @__PURE__ */ Z("div", {
269
+ children: [V && !t && !n && !oe && /* @__PURE__ */ Z("div", {
270
270
  className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
271
271
  children: [/* @__PURE__ */ X("p", {
272
- className: d(ee, Ae.subtitle),
272
+ className: f(j, je.subtitle),
273
273
  children: w.incompleteLabel
274
274
  }), /* @__PURE__ */ X(O, {
275
275
  label: w.retryLabel,
276
276
  onClick: i
277
277
  })]
278
278
  }), /* @__PURE__ */ X("div", {
279
- className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center", W && "flex-1 justify-center"),
279
+ className: f("flex w-full max-w-[1116px] min-w-0 flex-col items-center", W && "flex-1 justify-center"),
280
280
  children: fe()
281
281
  })]
282
282
  })
283
283
  ]
284
- }), R && o && /* @__PURE__ */ X(h, {
285
- variant: v.Primary,
284
+ }), z && a && /* @__PURE__ */ X(g, {
285
+ variant: y.Primary,
286
286
  iconBefore: /* @__PURE__ */ X(se, {
287
- size: b.LG,
287
+ size: x.LG,
288
288
  "aria-hidden": !0,
289
- stroke: x
289
+ stroke: S
290
290
  }),
291
291
  "aria-label": w.createProjectLabel,
292
- onClick: o,
292
+ onClick: a,
293
293
  className: "absolute inset-e-4 bottom-4 z-10 size-10 rounded-full px-0"
294
294
  })]
295
295
  });
296
- }, Me = /* @__PURE__ */ function(e) {
296
+ }, Ne = /* @__PURE__ */ function(e) {
297
297
  return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
298
- }({}), Ne = (e) => !!e.dataTransfer?.types.includes("Files"), Pe = (e) => {
298
+ }({}), Pe = (e) => !!e.dataTransfer?.types.includes("Files"), Fe = (e) => {
299
299
  let [t, n] = Y(!1), r = J(0);
300
300
  return {
301
301
  isDragActive: t,
302
302
  handlers: {
303
303
  onDragEnter: G((e) => {
304
- Ne(e) && (e.preventDefault(), r.current += 1, n(!0));
304
+ Pe(e) && (e.preventDefault(), r.current += 1, n(!0));
305
305
  }, []),
306
306
  onDragLeave: G((e) => {
307
- Ne(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
307
+ Pe(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
308
308
  }, []),
309
309
  onDragOver: G((e) => {
310
- Ne(e) && e.preventDefault();
310
+ Pe(e) && e.preventDefault();
311
311
  }, []),
312
312
  onDrop: G((t) => {
313
- if (!Ne(t)) return;
313
+ if (!Pe(t)) return;
314
314
  t.preventDefault(), r.current = 0, n(!1);
315
315
  let i = Array.from(t.dataTransfer?.files ?? []);
316
316
  i.length > 0 && e(i);
317
317
  }, [e])
318
318
  }
319
319
  };
320
- }, Fe = /* @__PURE__ */ function(e) {
320
+ }, Ie = /* @__PURE__ */ function(e) {
321
321
  return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
322
- }({}), Ie = /* @__PURE__ */ function(e) {
322
+ }({}), Le = /* @__PURE__ */ function(e) {
323
323
  return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
324
- }({}), Le = 255, Re = new RegExp(i.source, "u"), ze = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, Be = /* @__PURE__ */ new Set([
324
+ }({}), Re = 255, ze = new RegExp(a.source, "u"), Be = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, Ve = /* @__PURE__ */ new Set([
325
325
  ".",
326
326
  "..",
327
327
  "v",
328
328
  "files",
329
329
  ".dial-resource",
330
330
  ".dial-folder"
331
- ]), Ve = (e) => new TextEncoder().encode(e).length, He = (e) => {
331
+ ]), He = (e) => new TextEncoder().encode(e).length, Ue = (e) => {
332
332
  let t = e.trim();
333
- return t.length === 0 ? Ie.Required : Ve(t) > 255 ? Ie.TooLong : Re.test(t) || ze.test(t) ? Ie.InvalidCharacters : Be.has(t) ? Ie.Reserved : null;
334
- }, Ue = (e) => {
333
+ return t.length === 0 ? Le.Required : He(t) > 255 ? Le.TooLong : ze.test(t) || Be.test(t) ? Le.InvalidCharacters : Ve.has(t) ? Le.Reserved : null;
334
+ }, We = (e) => {
335
335
  let t = e.lastIndexOf(".");
336
336
  return t > 0 ? e.slice(t + 1).toLowerCase() : "";
337
- }, We = (e) => "isStored" in e && e.isStored, Ge = (e) => We(e) ? e.size : e.file.size, Ke = (e) => e.reduce((e, t) => e + Ge(t), 0), qe = 0, Je = () => (qe += 1, `project-context-${Date.now()}-${qe}`), Ye = (e) => {
338
- let t = e.type || u(e.name) || "application/octet-stream";
337
+ }, Ge = (e) => "isStored" in e && e.isStored, Ke = (e) => Ge(e) ? e.size : e.file.size, qe = (e) => e.reduce((e, t) => e + Ke(t), 0), Je = 0, Ye = () => (Je += 1, `project-context-${Date.now()}-${Je}`), Xe = (e) => {
338
+ let t = e.type || d(e.name) || "application/octet-stream";
339
339
  return {
340
- id: Je(),
340
+ id: Ye(),
341
341
  name: e.name,
342
342
  contentType: t,
343
- type: l(t),
344
- status: o.Idle,
343
+ type: u(t),
344
+ status: s.Idle,
345
345
  file: e
346
346
  };
347
- }, Xe = (e, t, n, r) => He(e.name) != null || e.name.trim() !== e.name ? Fe.InvalidName : r.allowedExtensions.includes(Ue(e.name)) ? t.has(e.name) ? Fe.Duplicate : e.size > r.maxFileBytes ? Fe.TooLarge : n + e.size > r.maxTotalBytes ? Fe.CapacityExceeded : null : Fe.UnsupportedType, Ze = (e, t, n) => {
348
- let r = new Set(t.map((e) => e.name)), i = Ke(t), a = [], o = [];
347
+ }, Ze = (e, t, n, r) => Ue(e.name) != null || e.name.trim() !== e.name ? Ie.InvalidName : r.allowedExtensions.includes(We(e.name)) ? t.has(e.name) ? Ie.Duplicate : e.size > r.maxFileBytes ? Ie.TooLarge : n + e.size > r.maxTotalBytes ? Ie.CapacityExceeded : null : Ie.UnsupportedType, Qe = (e, t, n) => {
348
+ let r = new Set(t.map((e) => e.name)), i = qe(t), a = [], o = [];
349
349
  for (let t of e) {
350
- let e = Xe(t, r, i, n);
351
- e == null ? (r.add(t.name), i += t.size, a.push(Ye(t))) : o.push({
350
+ let e = Ze(t, r, i, n);
351
+ e == null ? (r.add(t.name), i += t.size, a.push(Xe(t))) : o.push({
352
352
  name: t.name,
353
353
  reason: e
354
354
  });
@@ -357,56 +357,57 @@ var ye = /* @__PURE__ */ function(e) {
357
357
  accepted: a,
358
358
  rejected: o
359
359
  };
360
- }, Qe = (e, t) => {
360
+ }, $e = (e, t) => {
361
361
  let n = t.trim().toLowerCase();
362
362
  return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
363
- }, $e = {
364
- formColumn: "_formColumn_ub3na_1",
365
- dropZone: "_dropZone_ub3na_11",
366
- label: "_label_ub3na_15",
367
- link: "_link_ub3na_19"
368
- }, et = fe(async () => ({ default: (await ve()).MarkdownEditor })), tt = (e) => `Preview ${e}`, nt = ({ values: e, errors: r, onFieldChange: i, contextFiles: a, onContextFilesChange: o, onContextFileClick: l, selectedContextFileId: u, allowedExtensions: p, maxFileBytes: h, maxTotalBytes: g, onPickFromFileManager: _, onRefineInstructions: v, onBack: y, onCancel: S, onSubmit: C, isSubmitting: w = !1, labels: D, markdownEditorTheme: O, className: k, styles: A }) => {
369
- let M = K(), I = K(), L = K(), te = K(), ne = J(null), re = f(), [ae, z] = Y(!1), [oe, B] = Y([]), [V, H] = Y(""), se = m({
363
+ }, et = {
364
+ formColumn: "_formColumn_ru73x_1",
365
+ dropZone: "_dropZone_ru73x_11",
366
+ label: "_label_ru73x_20",
367
+ link: "_link_ru73x_24"
368
+ }, tt = fe(async () => ({ default: (await ye()).MarkdownEditor })), nt = (e) => `Preview ${e}`, rt = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, onContextFileClick: s, selectedContextFileId: u, allowedExtensions: d, maxFileBytes: m, maxTotalBytes: g, onPickFromFileManager: _, onRefineInstructions: v, onBack: y, onCancel: b, onSubmit: C, isSubmitting: w = !1, labels: D, markdownEditorTheme: O, className: k, styles: A }) => {
369
+ let N = K(), L = K(), R = K(), ee = K(), te = J(null), ne = p(), [ie, B] = Y(!1), [ae, V] = Y([]), [oe, H] = Y(""), se = h({
370
370
  value: e.instructions,
371
371
  onChange: (e) => i("instructions", e),
372
372
  onRefine: v,
373
373
  disabled: w
374
- }), ce = se.isPending, le = He(e.name), U = r.name ?? (ae && le != null ? D.nameErrors[le] : void 0), ue = le != null || w || ce;
374
+ }), ce = se.isPending, le = Ue(e.name), U = t.name ?? (ie && le != null ? D.nameErrors[le] : void 0), ue = le != null || w || ce;
375
375
  pe(() => {
376
- r.name && ne.current?.focus();
377
- }, [r.name]);
378
- let fe = q(() => p.map((e) => `.${e}`).join(","), [p]), W = (e) => {
376
+ t.name && te.current?.focus();
377
+ }, [t.name]);
378
+ let fe = q(() => d.map((e) => `.${e}`).join(","), [d]), W = (e) => {
379
379
  if (e.length === 0) return;
380
- let { accepted: t, rejected: n } = Ze(e, a, {
381
- allowedExtensions: p,
382
- maxFileBytes: h,
380
+ let { accepted: t, rejected: n } = Qe(e, a, {
381
+ allowedExtensions: d,
382
+ maxFileBytes: m,
383
383
  maxTotalBytes: g
384
384
  });
385
- B(n), t.length > 0 && o([...a, ...t]), H([t.length > 0 ? D.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => D.fileRejections[t](e))].filter(Boolean).join(" "));
386
- }, { isDragActive: G, handlers: me } = Pe(W), ve = D.openFileLabel ?? tt, ye = (e) => {
385
+ V(n), t.length > 0 && o([...a, ...t]), H([t.length > 0 ? D.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => D.fileRejections[t](e))].filter(Boolean).join(" "));
386
+ }, { isDragActive: G, handlers: me } = Fe(W), ye = D.openFileLabel ?? nt, be = (e) => {
387
387
  let t = a.find((t) => t.id === e);
388
- o(a.filter((t) => t.id !== e)), B([]), t && H(D.fileRemovedStatus(t.name));
389
- }, be = async (e) => {
388
+ o(a.filter((t) => t.id !== e)), V([]), t && H(D.fileRemovedStatus(t.name));
389
+ }, xe = async (e) => {
390
390
  if (e.preventDefault(), e.stopPropagation(), _) try {
391
391
  let e = await _();
392
392
  e && W(e);
393
393
  } catch {}
394
- }, xe = () => {
394
+ }, Se = () => {
395
395
  ue || C();
396
- }, { colors: Se, typography: Ce } = A ?? {}, we = Ce?.titleClassName ?? "dial-h1-text", Te = d(Ce?.labelClassName ?? "dial-tiny-semi-text", $e.label), Ee = Ce?.helperClassName ?? "dial-tiny-text", Q = c({
397
- "--pcf-label-text": Se?.labelText,
398
- "--pcf-link-text": Se?.linkText
399
- }), De = D.refinement, Oe = r.context, ke = [...oe.map(({ name: e, reason: t }) => D.fileRejections[t](e)), Oe].filter(Boolean).join("\n"), Ae = D.dropZoneLabel({
400
- fromDevice: /* @__PURE__ */ X("span", { className: $e.link }),
396
+ }, { colors: Ce, typography: we } = A ?? {}, Te = we?.titleClassName ?? "dial-h1-text", Ee = f(we?.labelClassName ?? "dial-tiny-semi-text", et.label), De = we?.helperClassName ?? "dial-tiny-text", Q = l({
397
+ "--pcf-label-text": Ce?.labelText,
398
+ "--pcf-link-text": Ce?.linkText,
399
+ "--pcf-dropzone-bg": Ce?.dropZoneBackground
400
+ }), Oe = D.refinement, ke = t.context, Ae = [...ae.map(({ name: e, reason: t }) => D.fileRejections[t](e)), ke].filter(Boolean).join("\n"), je = D.dropZoneLabel({
401
+ fromDevice: /* @__PURE__ */ X("span", { className: et.link }),
401
402
  fileManager: _ ? /* @__PURE__ */ X("button", {
402
403
  type: "button",
403
- className: $e.link,
404
+ className: et.link,
404
405
  disabled: w,
405
- onClick: (e) => void be(e)
406
+ onClick: (e) => void xe(e)
406
407
  }) : void 0
407
408
  });
408
409
  return /* @__PURE__ */ Z("div", {
409
- className: d("relative flex h-full min-h-0 w-full", k),
410
+ className: f("relative flex h-full min-h-0 w-full", k),
410
411
  ...me,
411
412
  children: [
412
413
  /* @__PURE__ */ X(ge, {
@@ -416,7 +417,7 @@ var ye = /* @__PURE__ */ function(e) {
416
417
  subtitle: D.dropOverlaySubtitle
417
418
  }
418
419
  }),
419
- /* @__PURE__ */ X(_e, {
420
+ /* @__PURE__ */ X(ve, {
420
421
  labels: {
421
422
  title: D.title,
422
423
  backButtonLabel: D.backLabel,
@@ -425,37 +426,38 @@ var ye = /* @__PURE__ */ function(e) {
425
426
  submittingLabel: D.submittingLabel ?? D.createLabel
426
427
  },
427
428
  onBack: y,
428
- onCancel: S,
429
- onSubmit: xe,
429
+ onCancel: b,
430
+ onSubmit: Se,
430
431
  isCancelDisabled: w,
431
432
  isSubmitDisabled: ue,
432
433
  isSubmitting: w,
433
- backIcon: /* @__PURE__ */ X(R, {
434
- size: b.LG,
435
- stroke: x,
434
+ footerActionsOrder: _e.SubmitFirst,
435
+ backIcon: /* @__PURE__ */ X(z, {
436
+ size: x.LG,
437
+ stroke: S,
436
438
  "aria-hidden": !0,
437
439
  className: "rtl:scale-x-[-1]"
438
440
  }),
439
441
  styles: {
440
- colors: { background: Se?.background },
442
+ colors: { background: Ce?.background },
441
443
  header: {
442
- colors: { borderColor: Se?.headerBorder },
443
- typography: { fontClassName: we }
444
+ colors: { borderColor: Ce?.headerBorder },
445
+ typography: { fontClassName: Te }
444
446
  },
445
447
  cssVars: Q
446
448
  },
447
449
  children: /* @__PURE__ */ Z("div", {
448
- className: d("mx-auto flex w-full max-w-262 min-w-0 flex-col gap-5 py-6", $e.formColumn),
450
+ className: f("mx-auto flex w-full max-w-262 min-w-0 flex-col gap-5 py-6", et.formColumn),
449
451
  children: [
450
452
  /* @__PURE__ */ Z("div", {
451
453
  className: "flex flex-col gap-1",
452
454
  children: [
453
- /* @__PURE__ */ X(ee, {
454
- id: M,
455
- inputRef: ne,
455
+ /* @__PURE__ */ X(j, {
456
+ id: N,
457
+ inputRef: te,
456
458
  value: e.name,
457
459
  onChange: (e) => i("name", e ?? ""),
458
- onBlur: () => z(!0),
460
+ onBlur: () => B(!0),
459
461
  placeholder: D.namePlaceholder,
460
462
  labelProps: {
461
463
  label: D.nameLabel,
@@ -465,42 +467,42 @@ var ye = /* @__PURE__ */ function(e) {
465
467
  "aria-required": !0,
466
468
  invalid: !!U,
467
469
  "aria-invalid": !!U,
468
- "aria-describedby": U ? I : void 0
470
+ "aria-describedby": U ? L : void 0
469
471
  }),
470
472
  /* @__PURE__ */ X(T, {
471
- announce: F.Assertive,
472
- id: I,
473
- className: Ee,
474
- text: r.name ?? ""
473
+ announce: I.Assertive,
474
+ id: L,
475
+ className: De,
476
+ text: t.name ?? ""
475
477
  }),
476
- U && !r.name && /* @__PURE__ */ X(T, {
477
- id: I,
478
- className: Ee,
478
+ U && !t.name && /* @__PURE__ */ X(T, {
479
+ id: L,
480
+ className: De,
479
481
  text: U
480
482
  })
481
483
  ]
482
484
  }),
483
- /* @__PURE__ */ X(s, {
485
+ /* @__PURE__ */ X(c, {
484
486
  isEnabled: !!v,
485
- fieldId: L,
487
+ fieldId: R,
486
488
  label: D.instructionsLabel,
487
- labelClassName: Te,
488
- labels: De,
489
+ labelClassName: Ee,
490
+ labels: Oe,
489
491
  refinement: se,
490
492
  disabled: w || ce,
491
493
  children: /* @__PURE__ */ Z("div", {
492
494
  className: "flex flex-1 flex-col gap-2",
493
- children: [!v && /* @__PURE__ */ X(j, {
494
- htmlFor: L,
495
- className: Te,
495
+ children: [!v && /* @__PURE__ */ X(M, {
496
+ htmlFor: R,
497
+ className: Ee,
496
498
  label: D.instructionsLabel
497
499
  }), /* @__PURE__ */ X("div", {
498
- ref: re,
499
- className: d("w-full", t, n),
500
+ ref: ne,
501
+ className: f("w-full", n, r),
500
502
  children: /* @__PURE__ */ X(de, {
501
- fallback: /* @__PURE__ */ X(ie, {}),
502
- children: /* @__PURE__ */ X(et, {
503
- id: L,
503
+ fallback: /* @__PURE__ */ X(re, {}),
504
+ children: /* @__PURE__ */ X(tt, {
505
+ id: R,
504
506
  value: e.instructions,
505
507
  onChange: (e) => {
506
508
  se.reset(), i("instructions", e);
@@ -514,16 +516,16 @@ var ye = /* @__PURE__ */ function(e) {
514
516
  })
515
517
  }),
516
518
  /* @__PURE__ */ Z("section", {
517
- "aria-labelledby": te,
519
+ "aria-labelledby": ee,
518
520
  className: "flex flex-col gap-2",
519
521
  children: [
520
522
  /* @__PURE__ */ X("h2", {
521
- id: te,
522
- className: Te,
523
+ id: ee,
524
+ className: Ee,
523
525
  children: D.contextLabel
524
526
  }),
525
527
  /* @__PURE__ */ X(E, {
526
- label: Ae,
528
+ label: je,
527
529
  ariaLabel: D.dropZoneAriaLabel,
528
530
  description: D.dropZoneHint,
529
531
  accept: fe,
@@ -531,13 +533,13 @@ var ye = /* @__PURE__ */ function(e) {
531
533
  disabled: w,
532
534
  onChange: W,
533
535
  onReject: W,
534
- errorText: ke || void 0,
535
- className: $e.dropZone
536
+ errorText: Ae || void 0,
537
+ className: et.dropZone
536
538
  }),
537
- /* @__PURE__ */ X(N, {
539
+ /* @__PURE__ */ X(P, {
538
540
  visuallyHidden: !0,
539
- politeness: F.Assertive,
540
- children: Oe
541
+ politeness: I.Assertive,
542
+ children: ke
541
543
  }),
542
544
  a.length > 0 && /* @__PURE__ */ X("ul", {
543
545
  className: "flex min-w-0 flex-wrap gap-2 pt-3",
@@ -545,12 +547,12 @@ var ye = /* @__PURE__ */ function(e) {
545
547
  className: "min-w-0",
546
548
  children: /* @__PURE__ */ X(he, {
547
549
  attachment: e,
548
- onClick: l,
549
- isSelected: l == null ? void 0 : e.id === u,
550
- onRemove: ye,
550
+ onClick: s,
551
+ isSelected: s == null ? void 0 : e.id === u,
552
+ onRemove: be,
551
553
  labels: {
552
554
  removeLabel: D.removeFileLabel(e.name),
553
- clickLabel: ve(e.name)
555
+ clickLabel: ye(e.name)
554
556
  }
555
557
  })
556
558
  }, e.id))
@@ -560,14 +562,14 @@ var ye = /* @__PURE__ */ function(e) {
560
562
  ]
561
563
  })
562
564
  }),
563
- /* @__PURE__ */ X(N, {
565
+ /* @__PURE__ */ X(P, {
564
566
  visuallyHidden: !0,
565
- as: P.Span,
566
- children: w ? D.creatingStatus : V
567
+ as: F.Span,
568
+ children: w ? D.creatingStatus : oe
567
569
  })
568
570
  ]
569
571
  });
570
- }, rt = ue("outline", "pin-off", "PinOff", [
572
+ }, it = ue("outline", "pin-off", "PinOff", [
571
573
  ["path", {
572
574
  d: "M3 3l18 18",
573
575
  key: "svg-0"
@@ -597,27 +599,27 @@ var ye = /* @__PURE__ */ function(e) {
597
599
  key: "svg-6"
598
600
  }]
599
601
  ]), $ = {
600
- container: "_container_16lvl_1",
601
- header: "_header_16lvl_5",
602
- title: "_title_16lvl_9",
603
- body: "_body_16lvl_13",
604
- secondary: "_secondary_16lvl_17",
605
- panel: "_panel_16lvl_21"
606
- }, it = (e) => ({
602
+ container: "_container_1j6j0_1",
603
+ header: "_header_1j6j0_7",
604
+ title: "_title_1j6j0_12",
605
+ body: "_body_1j6j0_16",
606
+ secondary: "_secondary_1j6j0_20",
607
+ panel: "_panel_1j6j0_24"
608
+ }, at = (e) => ({
607
609
  id: e.name,
608
610
  name: e.name,
609
611
  contentType: e.contentType,
610
- type: l(e.contentType),
611
- status: o.Idle
612
- }), at = W(({ project: e, isLoading: t = !1, hasError: n = !1, isNotFound: i = !1, isPinned: o, isPinPending: s = !1, contextSearchQuery: l, onContextSearchQueryChange: u, onBack: f, onTogglePin: p, onPublish: m, onEdit: h, onShare: g, onDelete: _, onDownload: v, onContextFileClick: y, selectedContextFileId: C, isDetailsStacked: T = !1, onRetry: E, onBrowseProjects: D, mainContent: A, mainContentLabel: ee = "Project content", labels: j, styles: M }) => {
613
- let { colors: F, typography: I } = M ?? {}, te = I?.titleClassName ?? "dial-h1-text", ne = I?.panelTitleClassName ?? "dial-body-semi-text", ae = I?.sectionTitleClassName ?? "dial-tiny-text", H = I?.bodyClassName ?? "dial-small-text", se = I?.helperClassName ?? "dial-tiny-text", ue = I?.instructionsHeadingClassName ?? "dial-small-semi-text", de = c({
614
- "--pv-bg": F?.background,
615
- "--pv-border": F?.border,
616
- "--pv-heading-text": F?.headingText,
617
- "--pv-body-text": F?.bodyText,
618
- "--pv-secondary-text": F?.secondaryText
619
- }), fe = q(() => e?.contextFiles ?? [], [e]), W = q(() => Qe(fe, l), [fe, l]), G = l.trim(), pe = K(), J = q(() => {
620
- let e = d("mb-1 mt-3 first:mt-0", ue);
612
+ type: u(e.contentType),
613
+ status: s.Idle
614
+ }), ot = W(({ project: t, isLoading: n = !1, hasError: r = !1, isNotFound: a = !1, isPinned: s, isPinPending: c = !1, contextSearchQuery: u, onContextSearchQueryChange: d, onBack: p, onTogglePin: m, onPublish: h, onEdit: g, onShare: _, onDelete: v, onDownload: y, onContextFileClick: b, selectedContextFileId: C, isDetailsStacked: T = !1, onRetry: E, onBrowseProjects: D, mainContent: A, mainContentLabel: j = "Project content", labels: M, styles: N }) => {
615
+ let { colors: I, typography: L } = N ?? {}, ee = L?.titleClassName ?? "dial-h1-text", te = L?.panelTitleClassName ?? "dial-body-semi-text", ie = L?.sectionTitleClassName ?? "dial-tiny-text", H = L?.bodyClassName ?? "dial-small-text", se = L?.helperClassName ?? "dial-tiny-text", ue = L?.instructionsHeadingClassName ?? "dial-small-semi-text", de = l({
616
+ "--pv-bg": I?.background,
617
+ "--pv-border": I?.border,
618
+ "--pv-heading-text": I?.headingText,
619
+ "--pv-body-text": I?.bodyText,
620
+ "--pv-secondary-text": I?.secondaryText
621
+ }), fe = q(() => t?.contextFiles ?? [], [t]), W = q(() => $e(fe, u), [fe, u]), G = u.trim(), pe = K(), J = q(() => {
622
+ let e = f("mb-1 mt-3 first:mt-0", ue);
621
623
  return {
622
624
  h1: e,
623
625
  h2: e,
@@ -630,207 +632,209 @@ var ye = /* @__PURE__ */ function(e) {
630
632
  ol: H
631
633
  };
632
634
  }, [H, ue]), Y = (e) => /* @__PURE__ */ X(e, {
633
- size: b.SM,
635
+ size: x.SM,
634
636
  "aria-hidden": !0,
635
- stroke: x
637
+ stroke: S
636
638
  }), ge = (e) => {
637
639
  let t = [];
638
- return e && m && t.push({
640
+ return e && h && t.push({
639
641
  key: "publish",
640
- label: j.publishLabel,
642
+ label: M.publishLabel,
641
643
  icon: Y(U),
642
- onClick: m
643
- }), e && h && t.push({
644
- key: "edit",
645
- label: j.editLabel,
646
- icon: Y(B),
647
644
  onClick: h
648
- }), g && t.push({
645
+ }), e && g && t.push({
646
+ key: "edit",
647
+ label: M.editLabel,
648
+ icon: Y(V),
649
+ onClick: g
650
+ }), _ && t.push({
649
651
  key: "share",
650
- label: j.shareLabel,
652
+ label: M.shareLabel,
651
653
  icon: Y(ce),
652
- onClick: g
654
+ onClick: _
653
655
  }), t.push({
654
656
  key: "download",
655
- label: j.downloadLabel,
656
- icon: Y(oe),
657
- onClick: v
658
- }), _ && t.push({
657
+ label: M.downloadLabel,
658
+ icon: Y(ae),
659
+ onClick: y
660
+ }), v && t.push({
659
661
  key: "delete",
660
- label: j.deleteLabel,
662
+ label: M.deleteLabel,
661
663
  icon: Y(le),
662
664
  danger: !0,
663
- onClick: _
665
+ onClick: v
664
666
  }), t;
665
- }, _e = (e, t) => /* @__PURE__ */ X("div", {
666
- className: t,
667
- children: /* @__PURE__ */ X(S, {
668
- items: ge(e),
667
+ }, _e = (t, n) => /* @__PURE__ */ X("div", {
668
+ className: n,
669
+ children: /* @__PURE__ */ X(e, {
670
+ items: ge(t),
671
+ title: M.moreActionsLabel,
672
+ closeLabel: M.closeLabel,
669
673
  matchReferenceWidth: !1,
670
674
  listClassName: "w-[200px]",
671
675
  children: /* @__PURE__ */ X(k, {
672
- icon: /* @__PURE__ */ X(z, {
673
- size: b.MD,
676
+ icon: /* @__PURE__ */ X(B, {
677
+ size: x.MD,
674
678
  "aria-hidden": !0,
675
- stroke: x
679
+ stroke: S
676
680
  }),
677
- "aria-label": j.moreActionsLabel
681
+ "aria-label": M.moreActionsLabel
678
682
  })
679
683
  })
680
684
  }), ve = () => {
681
- s || p();
682
- }, ye = () => t ? /* @__PURE__ */ X(ie, {}) : n ? /* @__PURE__ */ Z("div", {
685
+ c || m();
686
+ }, ye = () => n ? /* @__PURE__ */ X(re, {}) : r ? /* @__PURE__ */ Z("div", {
683
687
  className: "flex flex-col items-center gap-3",
684
688
  children: [/* @__PURE__ */ X("p", {
685
689
  "aria-hidden": !0,
686
- className: d(H, $.body),
687
- children: j.errorLabel
690
+ className: f(H, $.body),
691
+ children: M.errorLabel
688
692
  }), /* @__PURE__ */ X(O, {
689
- label: j.retryLabel,
693
+ label: M.retryLabel,
690
694
  onClick: E
691
695
  })]
692
696
  }) : /* @__PURE__ */ Z("div", {
693
697
  className: "flex flex-col items-center gap-3",
694
698
  children: [/* @__PURE__ */ X("p", {
695
- className: d(H, $.body),
696
- children: j.notFoundLabel
699
+ className: f(H, $.body),
700
+ children: M.notFoundLabel
697
701
  }), /* @__PURE__ */ X(O, {
698
- label: j.browseProjectsLabel,
702
+ label: M.browseProjectsLabel,
699
703
  onClick: D
700
704
  })]
701
705
  });
702
- if (t || n || i || e == null) return /* @__PURE__ */ Z("div", {
706
+ if (n || r || a || t == null) return /* @__PURE__ */ Z("div", {
703
707
  style: de,
704
- className: d("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
705
- children: [/* @__PURE__ */ X(N, {
708
+ className: f("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
709
+ children: [/* @__PURE__ */ X(P, {
706
710
  visuallyHidden: !0,
707
- children: !t && n && j.errorLabel
711
+ children: !n && r && M.errorLabel
708
712
  }), ye()]
709
713
  });
710
- let be = () => fe.length === 0 ? /* @__PURE__ */ X(a, { label: j.emptyContextLabel }) : /* @__PURE__ */ Z(me, { children: [
714
+ let be = () => fe.length === 0 ? /* @__PURE__ */ X(o, { label: M.emptyContextLabel }) : /* @__PURE__ */ Z(me, { children: [
711
715
  /* @__PURE__ */ X("div", {
712
716
  role: "search",
713
- children: /* @__PURE__ */ X(re, {
714
- value: l,
715
- onChange: (e) => u(e ?? ""),
716
- placeholder: j.contextSearchPlaceholder,
717
- clearLabel: j.clearSearchLabel,
718
- "aria-label": j.contextSearchAriaLabel
717
+ children: /* @__PURE__ */ X(ne, {
718
+ value: u,
719
+ onChange: (e) => d(e ?? ""),
720
+ placeholder: M.contextSearchPlaceholder,
721
+ clearLabel: M.clearSearchLabel,
722
+ "aria-label": M.contextSearchAriaLabel
719
723
  })
720
724
  }),
721
725
  W.length === 0 ? /* @__PURE__ */ X("p", {
722
- className: d(se, $.secondary),
723
- children: j.noContextMatchesLabel
726
+ className: f(se, $.secondary),
727
+ children: M.noContextMatchesLabel
724
728
  }) : /* @__PURE__ */ X("ul", {
725
729
  className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
726
730
  children: W.map((e) => /* @__PURE__ */ X("li", {
727
731
  className: "min-w-0",
728
732
  children: /* @__PURE__ */ X(he, {
729
- attachment: it(e),
733
+ attachment: at(e),
730
734
  searchQuery: G,
731
- onClick: y,
735
+ onClick: b,
732
736
  isSelected: e.name === C,
733
- labels: { clickLabel: j.openFileLabel(e.name) }
737
+ labels: { clickLabel: M.openFileLabel(e.name) }
734
738
  })
735
739
  }, e.name))
736
740
  }),
737
- /* @__PURE__ */ X(N, {
741
+ /* @__PURE__ */ X(P, {
738
742
  visuallyHidden: !0,
739
- as: P.Span,
740
- children: G === "" ? "" : j.contextResultCountLabel(W.length)
743
+ as: F.Span,
744
+ children: G === "" ? "" : M.contextResultCountLabel(W.length)
741
745
  })
742
746
  ] }), xe = !T;
743
747
  return /* @__PURE__ */ Z("div", {
744
748
  style: de,
745
- className: d("flex h-full w-full min-w-0 flex-col", $.container),
749
+ className: f("flex size-full min-h-0 min-w-0 flex-1 flex-col", $.container),
746
750
  children: [/* @__PURE__ */ Z("header", {
747
- className: d("flex min-w-0 shrink-0 items-center gap-2 px-4 py-3 desktop:px-8 desktop:py-4", $.header),
751
+ className: f("flex min-w-0 shrink-0 items-center gap-2 px-4 py-3 desktop:px-8 desktop:py-4", $.header),
748
752
  children: [
749
753
  /* @__PURE__ */ X(k, {
750
- icon: /* @__PURE__ */ X(R, {
751
- size: b.LG,
754
+ icon: /* @__PURE__ */ X(z, {
755
+ size: x.LG,
752
756
  className: "rtl:scale-x-[-1]",
753
757
  "aria-hidden": !0,
754
- stroke: x
758
+ stroke: S
755
759
  }),
756
- "aria-label": j.backLabel,
757
- onClick: f
760
+ "aria-label": M.backLabel,
761
+ onClick: p
758
762
  }),
759
763
  /* @__PURE__ */ X("h1", {
760
- className: d("min-w-0 flex-1", te, $.title),
761
- children: /* @__PURE__ */ X(w, { text: e.name })
764
+ className: f("min-w-0 flex-1", ee, $.title),
765
+ children: /* @__PURE__ */ X(w, { text: t.name })
762
766
  }),
763
767
  /* @__PURE__ */ X(O, {
764
- label: o ? j.unpinLabel : j.pinLabel,
765
- iconBefore: X(o ? rt : V, {
766
- size: b.MD,
768
+ label: s ? M.unpinLabel : M.pinLabel,
769
+ iconBefore: X(s ? it : oe, {
770
+ size: x.MD,
767
771
  "aria-hidden": !0,
768
- stroke: x
772
+ stroke: S
769
773
  }),
770
- "aria-disabled": s || void 0,
774
+ "aria-disabled": c || void 0,
771
775
  onClick: ve,
772
776
  className: "shrink-0"
773
777
  }),
774
- m && /* @__PURE__ */ X(L, {
775
- label: j.publishLabel,
778
+ h && /* @__PURE__ */ X(R, {
779
+ label: M.publishLabel,
776
780
  iconBefore: /* @__PURE__ */ X(U, {
777
- size: b.MD,
781
+ size: x.MD,
778
782
  "aria-hidden": !0,
779
- stroke: x
783
+ stroke: S
780
784
  }),
781
- onClick: m,
785
+ onClick: h,
782
786
  className: "hidden shrink-0 desktop:inline-flex"
783
787
  }),
784
- h && /* @__PURE__ */ X(L, {
785
- label: j.editLabel,
786
- iconBefore: /* @__PURE__ */ X(B, {
787
- size: b.MD,
788
+ g && /* @__PURE__ */ X(R, {
789
+ label: M.editLabel,
790
+ iconBefore: /* @__PURE__ */ X(V, {
791
+ size: x.MD,
788
792
  "aria-hidden": !0,
789
- stroke: x
793
+ stroke: S
790
794
  }),
791
- onClick: h,
795
+ onClick: g,
792
796
  className: "hidden shrink-0 desktop:inline-flex"
793
797
  }),
794
798
  _e(!1, "hidden desktop:block"),
795
799
  _e(!0, "desktop:hidden")
796
800
  ]
797
801
  }), /* @__PURE__ */ Z("div", {
798
- className: d("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto", xe && "desktop:flex-row desktop:overflow-hidden", A == null && xe && "desktop:justify-end"),
802
+ className: f("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto", xe && "desktop:flex-row desktop:overflow-hidden", A == null && xe && "desktop:justify-end"),
799
803
  children: [A != null && /* @__PURE__ */ X("section", {
800
- "aria-label": ee,
801
- className: d("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8", xe && "desktop:overflow-y-auto"),
804
+ "aria-label": j,
805
+ className: f("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8", xe && "desktop:overflow-y-auto"),
802
806
  children: /* @__PURE__ */ X("div", {
803
807
  className: "mx-auto flex w-full max-w-[748px] min-w-0 flex-col gap-5",
804
808
  children: A
805
809
  })
806
810
  }), /* @__PURE__ */ Z("aside", {
807
811
  "aria-labelledby": pe,
808
- className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8", xe && "desktop:w-[488px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s desktop:border-t-0", $.panel),
812
+ className: f("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8", xe && "desktop:w-[488px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s desktop:border-t-0", $.panel),
809
813
  children: [
810
814
  /* @__PURE__ */ X("h2", {
811
815
  id: pe,
812
- className: d(ne, $.title),
813
- children: j.detailsLabel
816
+ className: f(te, $.title),
817
+ children: M.detailsLabel
814
818
  }),
815
- e.description !== "" && /* @__PURE__ */ Z("section", {
819
+ t.description !== "" && /* @__PURE__ */ Z("section", {
816
820
  className: "flex min-w-0 flex-col gap-1",
817
821
  children: [/* @__PURE__ */ X("h3", {
818
- className: d(ae, $.secondary),
819
- children: j.descriptionLabel
822
+ className: f(ie, $.secondary),
823
+ children: M.descriptionLabel
820
824
  }), /* @__PURE__ */ X("p", {
821
- className: d("wrap-break-word whitespace-pre-line", H, $.body),
822
- children: e.description
825
+ className: f("wrap-break-word whitespace-pre-line", H, $.body),
826
+ children: t.description
823
827
  })]
824
828
  }),
825
- e.instructions !== "" && /* @__PURE__ */ Z("section", {
829
+ t.instructions !== "" && /* @__PURE__ */ Z("section", {
826
830
  className: "flex min-w-0 flex-col gap-1",
827
831
  children: [/* @__PURE__ */ X("h3", {
828
- className: d(ae, $.secondary),
829
- children: j.instructionsLabel
832
+ className: f(ie, $.secondary),
833
+ children: M.instructionsLabel
830
834
  }), /* @__PURE__ */ X("div", {
831
- className: d("min-w-0 wrap-break-word", H, $.body),
832
- children: /* @__PURE__ */ X(r, {
833
- content: e.instructions,
835
+ className: f("min-w-0 wrap-break-word", H, $.body),
836
+ children: /* @__PURE__ */ X(i, {
837
+ content: t.instructions,
834
838
  classNames: J
835
839
  })
836
840
  })]
@@ -838,77 +842,87 @@ var ye = /* @__PURE__ */ function(e) {
838
842
  /* @__PURE__ */ Z("section", {
839
843
  className: "flex min-w-0 flex-col gap-2",
840
844
  children: [/* @__PURE__ */ X("h3", {
841
- className: d(ae, $.secondary),
842
- children: j.contextLabel
845
+ className: f(ie, $.secondary),
846
+ children: M.contextLabel
843
847
  }), be()]
844
848
  })
845
849
  ]
846
850
  })]
847
851
  })]
848
852
  });
849
- }), ot = {
853
+ }), st = {
850
854
  row: "_row_1030u_1",
851
855
  readDot: "_readDot_1030u_6",
852
856
  unreadDot: "_unreadDot_1030u_10"
853
- }, st = ({ item: e, labels: t, rowTitleClassName: n, unreadRowTitleClassName: r, onOpen: i, onRename: a, onDelete: o }) => {
854
- let s = K(), [c, l] = Y(!1), u = e.isUnread === !0, f = q(() => [...a ? [{
857
+ }, ct = ({ item: t, labels: n, rowTitleClassName: r, unreadRowTitleClassName: i, onOpen: a, onRename: o, onDelete: s }) => {
858
+ let c = K(), [l, u] = Y(!1), d = t.isUnread === !0, p = q(() => [...o ? [{
855
859
  key: "rename",
856
- label: t.renameLabel,
857
- onClick: () => a(e.id)
858
- }] : [], ...o ? [{
860
+ label: n.renameLabel,
861
+ onClick: () => o(t.id)
862
+ }] : [], ...s ? [{
859
863
  key: "delete",
860
- label: t.deleteLabel,
864
+ label: n.deleteLabel,
861
865
  danger: !0,
862
- onClick: () => o(e.id)
866
+ onClick: () => s(t.id)
863
867
  }] : []], [
864
- e.id,
865
- t.deleteLabel,
866
- t.renameLabel,
867
- o,
868
- a
868
+ t.id,
869
+ n.deleteLabel,
870
+ n.renameLabel,
871
+ s,
872
+ o
869
873
  ]);
870
874
  return /* @__PURE__ */ Z("li", {
871
- className: d("group/row flex min-w-0 items-center gap-1 rounded-xl", ot.row),
875
+ className: f("group/row flex min-w-0 items-center gap-1 rounded-xl", st.row),
872
876
  children: [
873
877
  /* @__PURE__ */ Z("button", {
874
878
  type: "button",
875
- "aria-label": t.openLabel(e.title, e.authorName),
876
- "aria-describedby": u ? s : void 0,
879
+ "aria-label": n.openLabel(t.title, t.authorName),
880
+ "aria-describedby": d ? c : void 0,
877
881
  className: "flex min-w-0 flex-1 items-center gap-3 rounded-xl p-3 text-start focus-visible:outline-2 focus-visible:-outline-offset-2",
878
- onClick: () => i(e.id),
879
- children: [/* @__PURE__ */ X("span", {
880
- "aria-hidden": !0,
881
- className: "flex size-4 shrink-0 items-center justify-center",
882
- children: /* @__PURE__ */ X("span", { className: d("size-[7.11px] rounded-full", u ? ot.unreadDot : ot.readDot) })
883
- }), /* @__PURE__ */ X(w, {
884
- text: e.title,
885
- className: d("min-w-0 flex-1", u ? r : n)
886
- })]
882
+ onClick: () => a(t.id),
883
+ children: [
884
+ t.leading ?? /* @__PURE__ */ X("span", {
885
+ "aria-hidden": !0,
886
+ className: "flex size-4 shrink-0 items-center justify-center",
887
+ children: /* @__PURE__ */ X("span", { className: f("size-[7.11px] rounded-full", d ? st.unreadDot : st.readDot) })
888
+ }),
889
+ /* @__PURE__ */ X(w, {
890
+ text: t.title,
891
+ className: f("min-w-0 flex-1", d ? i : r)
892
+ }),
893
+ t.trailing ?? (d && t.leading != null && /* @__PURE__ */ X("span", {
894
+ "aria-hidden": !0,
895
+ className: "flex size-6 shrink-0 items-center justify-center",
896
+ children: /* @__PURE__ */ X("span", { className: f("size-[7.11px] rounded-full", st.unreadDot) })
897
+ }))
898
+ ]
887
899
  }),
888
- u && /* @__PURE__ */ X("span", {
889
- id: s,
900
+ d && /* @__PURE__ */ X("span", {
901
+ id: c,
890
902
  className: "sr-only",
891
- children: t.unreadLabel ?? "Unread"
903
+ children: n.unreadLabel ?? "Unread"
892
904
  }),
893
- f.length > 0 && /* @__PURE__ */ X(S, {
894
- items: f,
905
+ p.length > 0 && /* @__PURE__ */ X(e, {
906
+ items: p,
907
+ title: n.moreActionsLabel(t.title),
908
+ closeLabel: n.closeLabel,
895
909
  placement: "bottom-end",
896
- onOpenChange: l,
910
+ onOpenChange: u,
897
911
  children: /* @__PURE__ */ X(k, {
898
- "aria-label": t.moreActionsLabel(e.title),
912
+ "aria-label": n.moreActionsLabel(t.title),
899
913
  size: C.Small,
900
- className: d("me-2 shrink-0", !c && "desktop:opacity-0 desktop:group-focus-within/row:opacity-100 desktop:group-hover/row:opacity-100"),
901
- icon: /* @__PURE__ */ X(z, {
914
+ className: f("me-2 shrink-0", !l && "desktop:opacity-0 desktop:group-focus-within/row:opacity-100 desktop:group-hover/row:opacity-100"),
915
+ icon: /* @__PURE__ */ X(B, {
902
916
  "aria-hidden": !0,
903
- size: b.SM,
904
- stroke: x
917
+ size: x.SM,
918
+ stroke: S
905
919
  })
906
920
  })
907
921
  })
908
922
  ]
909
923
  });
910
- }, ct = W(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: o = !1, onLoadMore: s, isEmptyStateShown: l = !0, onOpen: u, onRename: f, onDelete: p, labels: m, typography: h, colors: g }) => {
911
- let _ = K(), v = h?.titleClassName ?? "dial-body-semi-text", y = h?.rowTitleClassName ?? "dial-body-text", b = h?.unreadRowTitleClassName ?? "dial-body-semi-text", x = q(() => c({
924
+ }, lt = W(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, isEmptyStateShown: c = !0, onOpen: u, onRename: d, onDelete: p, labels: m, typography: h, colors: g }) => {
925
+ let _ = K(), v = h?.titleClassName ?? "dial-body-semi-text", y = h?.rowTitleClassName ?? "dial-body-text", b = h?.unreadRowTitleClassName ?? "dial-body-semi-text", x = q(() => l({
912
926
  "--pcl-read-dot": g?.readDot,
913
927
  "--pcl-unread-dot": g?.unreadDot,
914
928
  "--pcl-row-hover": g?.rowHoverBackground
@@ -917,7 +931,7 @@ var ye = /* @__PURE__ */ function(e) {
917
931
  g?.unreadDot,
918
932
  g?.rowHoverBackground
919
933
  ]), S = h?.messageClassName ?? "dial-small-text", C = !t && !n && e.length === 0;
920
- return C && !l ? null : /* @__PURE__ */ Z("section", {
934
+ return C && !c ? null : /* @__PURE__ */ Z("section", {
921
935
  "aria-labelledby": C ? void 0 : _,
922
936
  "aria-label": C ? m.title : void 0,
923
937
  className: "flex min-w-0 flex-col gap-2 pt-3",
@@ -925,10 +939,10 @@ var ye = /* @__PURE__ */ function(e) {
925
939
  children: [
926
940
  !C && /* @__PURE__ */ X("h2", {
927
941
  id: _,
928
- className: d("m-0", v),
942
+ className: f("m-0", v),
929
943
  children: m.title
930
944
  }),
931
- /* @__PURE__ */ X(N, {
945
+ /* @__PURE__ */ X(P, {
932
946
  visuallyHidden: !0,
933
947
  children: t ? m.loadingLabel : n ? m.errorLabel : C ? /* @__PURE__ */ Z(me, { children: [
934
948
  /* @__PURE__ */ X("span", { children: m.emptyTitle }),
@@ -940,13 +954,13 @@ var ye = /* @__PURE__ */ function(e) {
940
954
  className: "flex justify-center py-6",
941
955
  children: /* @__PURE__ */ X("span", {
942
956
  "aria-hidden": !0,
943
- children: /* @__PURE__ */ X(ie, {})
957
+ children: /* @__PURE__ */ X(re, {})
944
958
  })
945
959
  }) : n ? /* @__PURE__ */ Z("div", {
946
960
  className: "flex flex-col items-center gap-3 py-6 text-center",
947
961
  children: [/* @__PURE__ */ X("p", {
948
962
  "aria-hidden": !0,
949
- className: d("m-0", S),
963
+ className: f("m-0", S),
950
964
  children: m.errorLabel
951
965
  }), /* @__PURE__ */ X(O, {
952
966
  label: m.retryLabel,
@@ -954,72 +968,72 @@ var ye = /* @__PURE__ */ function(e) {
954
968
  })]
955
969
  }) : C ? /* @__PURE__ */ X("div", {
956
970
  "aria-hidden": !0,
957
- children: /* @__PURE__ */ X(a, {
971
+ children: /* @__PURE__ */ X(o, {
958
972
  label: m.emptyTitle,
959
973
  description: m.emptyDescription
960
974
  })
961
975
  }) : /* @__PURE__ */ Z(me, { children: [/* @__PURE__ */ X("ul", {
962
976
  className: "m-0 flex min-w-0 list-none flex-col gap-2 p-0",
963
- children: e.map((e) => /* @__PURE__ */ X(st, {
977
+ children: e.map((e) => /* @__PURE__ */ X(ct, {
964
978
  item: e,
965
979
  labels: m,
966
980
  rowTitleClassName: y,
967
981
  unreadRowTitleClassName: b,
968
982
  onOpen: u,
969
- onRename: f,
983
+ onRename: d,
970
984
  onDelete: p
971
985
  }, e.id))
972
- }), i && s && /* @__PURE__ */ X(M, {
986
+ }), i && s && /* @__PURE__ */ X(N, {
973
987
  className: "self-start",
974
988
  label: m.loadMoreLabel ?? "See more",
975
- disabled: o,
989
+ disabled: a,
976
990
  onClick: s
977
991
  })] })
978
992
  ]
979
993
  });
980
- }), lt = W(({ composer: t, outputs: n, hasOutputs: r = !1, items: i, isLoading: a = !1, hasError: o = !1, onRetry: s, hasMore: c, isLoadingMore: l, onLoadMore: u, onOpen: d, onRename: f, onDelete: p, labels: m, listTypography: h, listColors: _ }) => {
981
- let y = K(), b = J(null), [x, S] = Y(null), [C, w] = Y(""), [T, E] = Y(), [D, O] = Y(!1), [k, A] = Y(null), [j, M] = Y(!1), N = J(null), P = G(() => {
982
- N.current = document.activeElement;
983
- }, []), F = G(() => {
984
- let e = N.current;
985
- N.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
986
- }, []), I = G((e) => {
987
- N.current = null, window.setTimeout(() => {
994
+ }), ut = W(({ composer: e, outputs: n, hasOutputs: r = !1, items: i, isLoading: a = !1, hasError: o = !1, onRetry: s, hasMore: c, isLoadingMore: l, onLoadMore: u, onOpen: d, onRename: f, onDelete: p, labels: m, listTypography: h, listColors: g }) => {
995
+ let v = K(), b = J(null), [x, S] = Y(null), [C, w] = Y(""), [T, E] = Y(), [D, O] = Y(!1), [k, A] = Y(null), [M, N] = Y(!1), P = J(null), F = G(() => {
996
+ P.current = document.activeElement;
997
+ }, []), I = G(() => {
998
+ let e = P.current;
999
+ P.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
1000
+ }, []), L = G((e) => {
1001
+ P.current = null, window.setTimeout(() => {
988
1002
  let t = b.current;
989
1003
  if (!t) return;
990
1004
  let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
991
1005
  r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
992
1006
  }, 0);
993
- }, []), L = G((e) => i.find((t) => t.id === e) ?? null, [i]);
1007
+ }, []), R = G((e) => i.find((t) => t.id === e) ?? null, [i]);
994
1008
  pe(() => {
995
1009
  let e = (e) => e != null && i.some((t) => t.id === e.id);
996
- x && !D && !e(x) && (S(null), I(0)), k && !j && !e(k) && (A(null), I(0));
1010
+ x && !D && !e(x) && (S(null), L(0)), k && !M && !e(k) && (A(null), L(0));
997
1011
  }, [
998
1012
  k,
999
- I,
1000
- j,
1013
+ L,
1014
+ M,
1001
1015
  D,
1002
1016
  i,
1003
1017
  x
1004
1018
  ]);
1005
- let re = G((e) => {
1006
- P();
1007
- let t = L(e);
1019
+ let ne = G((e) => {
1020
+ F();
1021
+ let t = R(e);
1008
1022
  S(t), w(t?.title ?? ""), E(void 0);
1009
- }, [L, P]), ie = G((e) => {
1010
- P(), A(L(e));
1011
- }, [L, P]), R = G(() => {
1012
- D || (S(null), F());
1013
- }, [D, F]), ae = G(() => {
1014
- j || (A(null), F());
1015
- }, [j, F]), z = G(async () => {
1023
+ }, [R, F]), re = G((e) => {
1024
+ F(), A(R(e));
1025
+ }, [R, F]), z = G(() => {
1026
+ D || (S(null), I());
1027
+ }, [D, I]), ie = G(() => {
1028
+ M || (A(null), I());
1029
+ }, [M, I]), B = G(async () => {
1016
1030
  if (!x || !f || D) return;
1017
1031
  let e = C.trim();
1018
1032
  if (!e) E(m.renameEmptyError);
1019
1033
  else {
1020
1034
  O(!0);
1021
1035
  try {
1022
- await f(x.id, e), S(null), F();
1036
+ await f(x.id, e), S(null), I();
1023
1037
  } catch {} finally {
1024
1038
  O(!1);
1025
1039
  }
@@ -1030,50 +1044,50 @@ var ye = /* @__PURE__ */ function(e) {
1030
1044
  f,
1031
1045
  x,
1032
1046
  C,
1033
- F
1034
- ]), oe = G((e) => {
1035
- e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), z());
1036
- }, [z]), B = G(async () => {
1047
+ I
1048
+ ]), ae = G((e) => {
1049
+ e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), B());
1050
+ }, [B]), V = G(async () => {
1037
1051
  if (!k || !p) return;
1038
1052
  let e = i.findIndex((e) => e.id === k.id);
1039
- M(!0);
1053
+ N(!0);
1040
1054
  try {
1041
- await p(k.id), A(null), I(Math.max(e, 0));
1055
+ await p(k.id), A(null), L(Math.max(e, 0));
1042
1056
  } catch {} finally {
1043
- M(!1);
1057
+ N(!1);
1044
1058
  }
1045
1059
  }, [
1046
1060
  k,
1047
- I,
1061
+ L,
1048
1062
  i,
1049
1063
  p
1050
- ]), V = q(() => [{
1064
+ ]), oe = q(() => [{
1051
1065
  label: m.renameCancelLabel ?? "Cancel",
1052
- variant: v.Primary,
1053
- appearance: g.Ghost,
1066
+ variant: y.Primary,
1067
+ appearance: _.Ghost,
1054
1068
  disabled: D,
1055
- onClick: R
1069
+ onClick: z
1056
1070
  }, {
1057
1071
  label: m.renameSaveLabel,
1058
- variant: v.Primary,
1072
+ variant: y.Primary,
1059
1073
  disabled: D,
1060
1074
  onClick: () => {
1061
- z();
1075
+ B();
1062
1076
  }
1063
1077
  }], [
1064
- R,
1065
1078
  z,
1079
+ B,
1066
1080
  D,
1067
1081
  m.renameCancelLabel,
1068
1082
  m.renameSaveLabel
1069
1083
  ]);
1070
1084
  return /* @__PURE__ */ Z(me, { children: [
1071
- t,
1085
+ e,
1072
1086
  n,
1073
1087
  /* @__PURE__ */ X("div", {
1074
1088
  ref: b,
1075
1089
  className: "contents",
1076
- children: /* @__PURE__ */ X(ct, {
1090
+ children: /* @__PURE__ */ X(lt, {
1077
1091
  items: i,
1078
1092
  isLoading: a,
1079
1093
  hasError: o,
@@ -1083,90 +1097,90 @@ var ye = /* @__PURE__ */ function(e) {
1083
1097
  onLoadMore: u,
1084
1098
  isEmptyStateShown: !r,
1085
1099
  onOpen: d,
1086
- onRename: f ? re : void 0,
1087
- onDelete: p ? ie : void 0,
1100
+ onRename: f ? ne : void 0,
1101
+ onDelete: p ? re : void 0,
1088
1102
  labels: m.list,
1089
1103
  typography: h,
1090
- colors: _
1104
+ colors: g
1091
1105
  })
1092
1106
  }),
1093
- x && /* @__PURE__ */ X(te, {
1107
+ x && /* @__PURE__ */ X(ee, {
1094
1108
  open: !0,
1095
1109
  header: m.renameTitle,
1096
- size: ne.Sm,
1097
- mainButtons: V,
1098
- onClose: R,
1110
+ size: te.Sm,
1111
+ mainButtons: oe,
1112
+ onClose: z,
1099
1113
  children: /* @__PURE__ */ X("div", {
1100
1114
  className: "px-6 py-4",
1101
- children: /* @__PURE__ */ X(ee, {
1102
- id: y,
1115
+ children: /* @__PURE__ */ X(j, {
1116
+ id: v,
1103
1117
  value: C,
1104
1118
  labelProps: { label: m.renameInputLabel },
1105
1119
  error: T,
1106
1120
  disabled: D,
1107
- onKeyDown: oe,
1121
+ onKeyDown: ae,
1108
1122
  onChange: (e) => {
1109
1123
  w(e ?? ""), E(void 0);
1110
1124
  }
1111
1125
  })
1112
1126
  })
1113
1127
  }),
1114
- k && /* @__PURE__ */ X(e, {
1128
+ k && /* @__PURE__ */ X(t, {
1115
1129
  open: !0,
1116
1130
  title: m.deleteTitle(k.title),
1117
1131
  names: [k.title],
1118
1132
  message: m.deleteDescription,
1119
1133
  labels: m.deleteDialog,
1120
- isLoading: j,
1134
+ isLoading: M,
1121
1135
  onConfirm: () => {
1122
- B();
1136
+ V();
1123
1137
  },
1124
- onClose: ae
1138
+ onClose: ie
1125
1139
  })
1126
1140
  ] });
1127
- }), ut = {
1141
+ }), dt = {
1128
1142
  title: "_title_17sbf_1",
1129
1143
  secondary: "_secondary_17sbf_5"
1130
- }, dt = 6, ft = (e) => ({
1144
+ }, ft = 6, pt = (e) => ({
1131
1145
  id: e.name,
1132
1146
  name: e.name,
1133
1147
  contentType: e.contentType,
1134
- type: l(e.contentType),
1135
- status: o.Idle
1136
- }), pt = W(({ items: e, onOpenOutput: t, selectedOutputName: n, hasError: r = !1, onRetry: i, previewLimit: a = dt, labels: o, styles: s }) => {
1137
- let l = K(), u = K(), f = J(null), p = J(!1), [m, h] = Y(!1), { colors: g, typography: _ } = s ?? {}, v = _?.titleClassName ?? "dial-body-semi-text", y = _?.helperClassName ?? "dial-tiny-text", b = o?.title ?? "Outputs", x = o?.errorLabel ?? "Could not load outputs", S = q(() => c({
1148
+ type: u(e.contentType),
1149
+ status: s.Idle
1150
+ }), mt = W(({ items: e, onOpenOutput: t, selectedOutputName: n, hasError: r = !1, onRetry: i, previewLimit: a = ft, labels: o, styles: s }) => {
1151
+ let c = K(), u = K(), d = J(null), p = J(!1), [m, h] = Y(!1), { colors: g, typography: _ } = s ?? {}, v = _?.titleClassName ?? "dial-body-semi-text", y = _?.helperClassName ?? "dial-tiny-text", b = o?.title ?? "Outputs", x = o?.errorLabel ?? "Could not load outputs", S = q(() => l({
1138
1152
  "--po-heading-text": g?.headingText,
1139
1153
  "--po-secondary-text": g?.secondaryText
1140
1154
  }), [g?.headingText, g?.secondaryText]), C = G(() => h((e) => !e), []), w = G(() => {
1141
1155
  p.current = !0, i?.();
1142
1156
  }, [i]);
1143
1157
  pe(() => {
1144
- !r && p.current && (p.current = !1, f.current?.focus());
1158
+ !r && p.current && (p.current = !1, d.current?.focus());
1145
1159
  }, [r]);
1146
- let T = r || e.length > 0, E = e.length > a, D = m || !E ? e : e.slice(0, a), k = o?.openOutputLabel ?? ((e) => `Preview ${e}`), A = o?.seeAllLabel?.(e.length) ?? `See all (${e.length})`, ee = o?.showLessLabel ?? "Show less";
1160
+ let T = r || e.length > 0, E = e.length > a, D = m || !E ? e : e.slice(0, a), k = o?.openOutputLabel ?? ((e) => `Preview ${e}`), A = o?.seeAllLabel?.(e.length) ?? `See all (${e.length})`, j = o?.showLessLabel ?? "Show less";
1147
1161
  return /* @__PURE__ */ Z("div", {
1148
1162
  className: "contents",
1149
1163
  style: S,
1150
1164
  children: [T && /* @__PURE__ */ Z("section", {
1151
- "aria-labelledby": l,
1165
+ "aria-labelledby": c,
1152
1166
  className: "flex min-w-0 flex-col gap-2 pt-3",
1153
1167
  children: [/* @__PURE__ */ Z("div", {
1154
1168
  className: "flex min-w-0 items-center justify-between gap-2",
1155
1169
  children: [/* @__PURE__ */ X("h2", {
1156
- ref: f,
1157
- id: l,
1170
+ ref: d,
1171
+ id: c,
1158
1172
  tabIndex: -1,
1159
- className: d("m-0", ut.title, v),
1173
+ className: f("m-0", dt.title, v),
1160
1174
  children: b
1161
- }), !r && E && /* @__PURE__ */ X(M, {
1162
- label: m ? ee : A,
1175
+ }), !r && E && /* @__PURE__ */ X(N, {
1176
+ label: m ? j : A,
1163
1177
  "aria-expanded": m,
1164
1178
  "aria-controls": u,
1165
1179
  onClick: C
1166
1180
  })]
1167
1181
  }), r ? /* @__PURE__ */ Z(me, { children: [/* @__PURE__ */ X("p", {
1168
1182
  "aria-hidden": !0,
1169
- className: d("m-0", ut.secondary, y),
1183
+ className: f("m-0", dt.secondary, y),
1170
1184
  children: x
1171
1185
  }), i && /* @__PURE__ */ X(O, {
1172
1186
  className: "self-start",
@@ -1174,31 +1188,31 @@ var ye = /* @__PURE__ */ function(e) {
1174
1188
  onClick: w
1175
1189
  })] }) : /* @__PURE__ */ X("ul", {
1176
1190
  id: u,
1177
- className: d("m-0 flex min-w-0 list-none gap-2 p-0", m ? "flex-wrap" : "flex-nowrap overflow-x-auto"),
1191
+ className: f("m-0 flex min-w-0 list-none gap-2 p-0", m ? "flex-wrap" : "flex-nowrap overflow-x-auto"),
1178
1192
  children: D.map((e) => /* @__PURE__ */ X("li", {
1179
1193
  className: "shrink-0",
1180
1194
  children: /* @__PURE__ */ X(he, {
1181
- attachment: ft(e),
1195
+ attachment: pt(e),
1182
1196
  onClick: t,
1183
1197
  isSelected: e.name === n,
1184
1198
  labels: { clickLabel: k(e.name) }
1185
1199
  })
1186
1200
  }, e.name))
1187
1201
  })]
1188
- }), /* @__PURE__ */ X(N, {
1202
+ }), /* @__PURE__ */ X(P, {
1189
1203
  visuallyHidden: !0,
1190
1204
  children: r ? x : ""
1191
1205
  })]
1192
1206
  });
1193
- }), mt = W(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ Z("nav", {
1207
+ }), ht = W(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ Z("nav", {
1194
1208
  "aria-label": i,
1195
- className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
1209
+ className: f("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
1196
1210
  children: [/* @__PURE__ */ X(k, {
1197
1211
  "aria-label": i,
1198
- icon: /* @__PURE__ */ X(R, {
1212
+ icon: /* @__PURE__ */ X(z, {
1199
1213
  "aria-hidden": !0,
1200
- size: b.MD,
1201
- stroke: x,
1214
+ size: x.MD,
1215
+ stroke: S,
1202
1216
  className: "rtl:scale-x-[-1]"
1203
1217
  }),
1204
1218
  onClick: n
@@ -1208,9 +1222,9 @@ var ye = /* @__PURE__ */ function(e) {
1208
1222
  className: "min-w-0 hover:underline focus-visible:underline",
1209
1223
  children: /* @__PURE__ */ X(w, {
1210
1224
  text: e,
1211
- className: d("min-w-0", o)
1225
+ className: f("min-w-0", o)
1212
1226
  })
1213
1227
  })]
1214
1228
  }));
1215
1229
  //#endregion
1216
- export { Fe as ContextFileRejection, Le as PROJECT_NAME_MAX_BYTES, mt as ProjectChatHeader, ct as ProjectConversationList, lt as ProjectConversationsPanel, nt as ProjectCreateForm, Ie as ProjectNameError, pt as ProjectOutputs, Me as ProjectSource, at as ProjectView, je as Projects, ye as ProjectsSortKey, Ze as checkContextFiles, Qe as filterContextFileItems, Ke as getContextFilesSize, We as isStoredContextFile, He as validateProjectName };
1230
+ export { Ie as ContextFileRejection, Re as PROJECT_NAME_MAX_BYTES, ht as ProjectChatHeader, lt as ProjectConversationList, ut as ProjectConversationsPanel, rt as ProjectCreateForm, Le as ProjectNameError, mt as ProjectOutputs, Ne as ProjectSource, ot as ProjectView, Me as Projects, be as ProjectsSortKey, Qe as checkContextFiles, $e as filterContextFileItems, qe as getContextFilesSize, Ge as isStoredContextFile, Ue as validateProjectName };