@epam/ai-dial-attachment-input 1.0.0-dev.481 → 1.0.0-dev.486

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 (56) hide show
  1. package/components/AttachmentCard/AttachmentCard.d.ts +2 -1
  2. package/components/AttachmentCard/AttachmentCard.d.ts.map +1 -1
  3. package/components/AttachmentFileRow/AttachmentFileRow.d.ts +1 -1
  4. package/components/AttachmentFileRow/AttachmentFileRow.d.ts.map +1 -1
  5. package/components/AttachmentGroup/AttachmentGroup.d.ts +1 -1
  6. package/components/AttachmentGroup/AttachmentGroup.d.ts.map +1 -1
  7. package/components/AttachmentMoreTile/AttachmentMoreTile.d.ts +1 -1
  8. package/components/AttachmentMoreTile/AttachmentMoreTile.d.ts.map +1 -1
  9. package/components/AttachmentTray/AttachmentTray.d.ts +2 -1
  10. package/components/AttachmentTray/AttachmentTray.d.ts.map +1 -1
  11. package/components/FileDndOverlay/FileDndOverlay.d.ts +2 -1
  12. package/components/FileDndOverlay/FileDndOverlay.d.ts.map +1 -1
  13. package/constants/attachment-group.d.ts +5 -0
  14. package/constants/attachment-group.d.ts.map +1 -0
  15. package/constants/upload.d.ts +1 -0
  16. package/constants/upload.d.ts.map +1 -1
  17. package/hooks/useLazyImageLoad.d.ts +5 -0
  18. package/hooks/useLazyImageLoad.d.ts.map +1 -1
  19. package/index.css +1 -1
  20. package/index.d.ts +8 -14
  21. package/index.d.ts.map +1 -1
  22. package/index.js +266 -247
  23. package/models/{AttachmentCard.d.ts → attachment-card.d.ts} +47 -14
  24. package/models/attachment-card.d.ts.map +1 -0
  25. package/models/{AttachmentFileRow.d.ts → attachment-file-row.d.ts} +21 -7
  26. package/models/attachment-file-row.d.ts.map +1 -0
  27. package/models/{AttachmentGroup.d.ts → attachment-group.d.ts} +41 -11
  28. package/models/attachment-group.d.ts.map +1 -0
  29. package/models/{AttachmentMoreTile.d.ts → attachment-more-tile.d.ts} +3 -1
  30. package/models/attachment-more-tile.d.ts.map +1 -0
  31. package/models/{AttachmentTray.d.ts → attachment-tray.d.ts} +14 -9
  32. package/models/attachment-tray.d.ts.map +1 -0
  33. package/models/file-dnd-overlay.d.ts +41 -0
  34. package/models/file-dnd-overlay.d.ts.map +1 -0
  35. package/package.json +2 -2
  36. package/utils/attachment.d.ts +45 -0
  37. package/utils/attachment.d.ts.map +1 -0
  38. package/models/AttachmentCard.d.ts.map +0 -1
  39. package/models/AttachmentFileRow.d.ts.map +0 -1
  40. package/models/AttachmentGroup.d.ts.map +0 -1
  41. package/models/AttachmentMoreTile.d.ts.map +0 -1
  42. package/models/AttachmentTray.d.ts.map +0 -1
  43. package/models/FileDndOverlay.d.ts +0 -24
  44. package/models/FileDndOverlay.d.ts.map +0 -1
  45. package/utils/attachment-mime.d.ts +0 -20
  46. package/utils/attachment-mime.d.ts.map +0 -1
  47. package/utils/generateAttachmentId.d.ts +0 -6
  48. package/utils/generateAttachmentId.d.ts.map +0 -1
  49. package/utils/getAttachmentCardState.d.ts +0 -17
  50. package/utils/getAttachmentCardState.d.ts.map +0 -1
  51. package/utils/getAttachmentGroupLayout.d.ts +0 -23
  52. package/utils/getAttachmentGroupLayout.d.ts.map +0 -1
  53. package/utils/getAttachmentIcon.d.ts +0 -8
  54. package/utils/getAttachmentIcon.d.ts.map +0 -1
  55. package/utils/getNameWithoutExtension.d.ts +0 -5
  56. package/utils/getNameWithoutExtension.d.ts.map +0 -1
package/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, CodeBlockTheme as n, Highlight as r, MIME_TYPE_EXT_MAP as i, RequestStatus as a, buildCssVars as o, mergeClasses as s } from "@epam/ai-dial-chat-shared";
2
2
  import { DIAL_ICON_SIZE as c, DialGhostIconButton as l, DialSkeleton as u, DialSkeletonVariant as d, DialSpinner as f, ElementSize as p } from "@epam/ai-dial-ui-kit";
3
- import { IconChevronUp as m, IconClipboard as h, IconDownload as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as S, IconFileTypeDocx as C, IconFileTypeHtml as w, IconFileTypeJpg as T, IconFileTypeJs as E, IconFileTypeJsx as D, IconFileTypePdf as O, IconFileTypePhp as k, IconFileTypePng as A, IconFileTypePpt as j, IconFileTypeRs as M, IconFileTypeSql as N, IconFileTypeSvg as P, IconFileTypeTs as F, IconFileTypeTsx as I, IconFileTypeTxt as L, IconFileTypeVue as ee, IconFileTypeXls as te, IconFileTypeXml as ne, IconFileTypeZip as R, IconFileX as z, IconMusic as B, IconPaperclip as V, IconPhoto as H, IconReload as re, IconTerminal2 as ie, IconVideo as ae, IconX as oe } from "@tabler/icons-react";
4
- import { useCallback as U, useEffect as W, useMemo as se, useRef as ce, useState as G } from "react";
3
+ import { IconChevronUp as m, IconClipboard as h, IconDownload as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as S, IconFileTypeDocx as C, IconFileTypeHtml as w, IconFileTypeJpg as T, IconFileTypeJs as E, IconFileTypeJsx as D, IconFileTypePdf as O, IconFileTypePhp as k, IconFileTypePng as A, IconFileTypePpt as j, IconFileTypeRs as M, IconFileTypeSql as N, IconFileTypeSvg as P, IconFileTypeTs as F, IconFileTypeTsx as I, IconFileTypeTxt as L, IconFileTypeVue as R, IconFileTypeXls as z, IconFileTypeXml as ee, IconFileTypeZip as te, IconFileX as ne, IconMusic as B, IconPaperclip as re, IconPhoto as V, IconReload as ie, IconTerminal2 as H, IconVideo as U, IconX as ae } from "@tabler/icons-react";
4
+ import { useCallback as oe, useEffect as se, useMemo as ce, useRef as W, useState as G } from "react";
5
5
  import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
6
6
  //#region src/hooks/useLazyImageLoad.ts
7
7
  var Y = /* @__PURE__ */ function(e) {
8
8
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
9
9
  }({}), le = ({ enabled: e, src: t }) => {
10
- let n = ce(null), [r, i] = G("idle");
11
- return W(() => {
10
+ let n = W(null), [r, i] = G("idle");
11
+ return se(() => {
12
12
  i(e && t ? "loading" : "idle");
13
- }, [e, t]), W(() => {
13
+ }, [e, t]), se(() => {
14
14
  let r = n.current;
15
15
  if (!r || !e || !t) return;
16
16
  let a = () => i("loaded"), o = () => i("error");
@@ -22,18 +22,42 @@ var Y = /* @__PURE__ */ function(e) {
22
22
  imageLoadStatus: r
23
23
  };
24
24
  }, X = {
25
- card: "_card_1wsze_1",
26
- cardError: "_cardError_1wsze_6",
27
- cardSelected: "_cardSelected_1wsze_10",
28
- cardPrompt: "_cardPrompt_1wsze_15",
29
- cardPasted: "_cardPasted_1wsze_16",
30
- name: "_name_1wsze_20",
31
- meta: "_meta_1wsze_24",
32
- loadingOverlay: "_loadingOverlay_1wsze_28",
33
- actionBtn: "_actionBtn_1wsze_32",
34
- removeBtnImage: "_removeBtnImage_1wsze_43",
35
- hoverDownloadIcon: "_hoverDownloadIcon_1wsze_51"
36
- }, Z = (e) => {
25
+ card: "_card_ywrb5_1",
26
+ cardError: "_cardError_ywrb5_6",
27
+ cardSelected: "_cardSelected_ywrb5_10",
28
+ cardPrompt: "_cardPrompt_ywrb5_15",
29
+ cardPasted: "_cardPasted_ywrb5_16",
30
+ name: "_name_ywrb5_20",
31
+ meta: "_meta_ywrb5_24",
32
+ loadingOverlay: "_loadingOverlay_ywrb5_28",
33
+ actionBtn: "_actionBtn_ywrb5_32",
34
+ removeBtnImage: "_removeBtnImage_ywrb5_43",
35
+ hoverDownloadIcon: "_hoverDownloadIcon_ywrb5_51"
36
+ }, ue = 5, de = 4, Z = /* @__PURE__ */ function(e) {
37
+ return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
38
+ }({}), fe = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) => {
39
+ let t = e.lastIndexOf(".");
40
+ return t > 0 ? e.slice(0, t) : e;
41
+ }, me = {
42
+ image: "Image files",
43
+ audio: "Audio files",
44
+ video: "Video files",
45
+ text: "Text files"
46
+ }, he = (e) => e.map((e) => {
47
+ if (e.endsWith("/*")) {
48
+ let t = e.slice(0, -2);
49
+ return me[t] ?? `${t} files`;
50
+ }
51
+ let t = e.split("/")[1];
52
+ return t == null ? e.toUpperCase() : t.toUpperCase();
53
+ }).join(", "), ge = (e, t) => t.length === 0 ? !1 : t.some((t) => {
54
+ if (t === "*" || t === "*/*") return !0;
55
+ if (t.endsWith("/*")) {
56
+ let n = t.slice(0, -2);
57
+ return e.startsWith(`${n}/`);
58
+ }
59
+ return e === t;
60
+ }), _e = (e) => {
37
61
  if (!e) return _;
38
62
  if (e.startsWith("image/")) switch (e) {
39
63
  case "image/jpeg":
@@ -41,9 +65,9 @@ var Y = /* @__PURE__ */ function(e) {
41
65
  case "image/png": return A;
42
66
  case "image/svg+xml": return P;
43
67
  case "image/bmp": return y;
44
- default: return H;
68
+ default: return V;
45
69
  }
46
- if (e.startsWith("video/")) return ae;
70
+ if (e.startsWith("video/")) return U;
47
71
  if (e.startsWith("audio/")) return B;
48
72
  switch (e) {
49
73
  case "application/pdf": return O;
@@ -52,20 +76,20 @@ var Y = /* @__PURE__ */ function(e) {
52
76
  case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return C;
53
77
  case "application/vnd.ms-powerpoint": return j;
54
78
  case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return j;
55
- case "application/vnd.ms-excel": return te;
56
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return te;
79
+ case "application/vnd.ms-excel": return z;
80
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return z;
57
81
  case "application/zip":
58
82
  case "application/x-zip-compressed":
59
83
  case "application/x-rar-compressed":
60
84
  case "application/x-7z-compressed":
61
85
  case "application/gzip":
62
- case "application/x-tar": return R;
86
+ case "application/x-tar": return te;
63
87
  case "text/csv": return x;
64
88
  case "text/plain": return L;
65
89
  case "text/html":
66
90
  case "application/xhtml+xml": return w;
67
91
  case "text/xml":
68
- case "application/xml": return ne;
92
+ case "application/xml": return ee;
69
93
  case "application/sql":
70
94
  case "text/x-sql": return N;
71
95
  case "text/javascript":
@@ -79,29 +103,29 @@ var Y = /* @__PURE__ */ function(e) {
79
103
  case "application/x-php": return k;
80
104
  case "text/x-rustsrc":
81
105
  case "application/x-rust": return M;
82
- case "text/x-vue": return ee;
106
+ case "text/x-vue": return R;
83
107
  default: return _;
84
108
  }
85
- }, ue = (e) => {
109
+ }, ve = (e) => {
86
110
  let { type: n, contentType: r } = e;
87
- return n === t.Prompt ? ie : n === t.Pasted ? h : n === t.Image ? H : Z(r ?? "");
88
- }, de = (e) => {
111
+ return n === t.Prompt ? H : n === t.Pasted ? h : n === t.Image ? V : _e(r ?? "");
112
+ }, ye = (e) => {
89
113
  let t = e.toLowerCase().split(";")[0].trim(), n = i[t];
90
114
  if (n) return n;
91
115
  let r = t.split("/")[1];
92
116
  if (r && !r.startsWith("vnd.") && !r.includes("+")) return r;
93
- }, fe = (e) => {
117
+ }, be = (e) => {
94
118
  let { type: n, name: r, contentType: i } = e;
95
119
  if (n === t.Prompt) return "Prompt";
96
120
  if (n === t.Pasted) return "Pasted";
97
121
  if (n === t.Image) return "Image";
98
122
  if (i) {
99
- let e = de(i);
123
+ let e = ye(i);
100
124
  if (e) return `.${e}`;
101
125
  }
102
126
  let a = r.lastIndexOf(".");
103
127
  return a > 0 && a < r.length - 1 ? `.${r.slice(a + 1).toLowerCase()}` : r;
104
- }, pe = (e, n, r) => {
128
+ }, xe = (e, n, r) => {
105
129
  let { type: i, status: o, previewUrl: c, url: l } = e, u = o === a.Loading, d = o === a.Error, f = i === t.Image && !!(c ?? l) && !d, p = i === t.Audio && !d, m = s(X.card, d && X.cardError, n && X.cardSelected, !d && !n && i === t.Prompt && X.cardPrompt, !d && !n && i === t.Pasted && X.cardPasted);
106
130
  return {
107
131
  isLoading: u,
@@ -109,40 +133,49 @@ var Y = /* @__PURE__ */ function(e) {
109
133
  isImage: f,
110
134
  isAudio: p,
111
135
  areActionsVisible: d || r,
112
- BottomIcon: ue(e),
113
- typeLabel: fe(e),
136
+ BottomIcon: ve(e),
137
+ typeLabel: be(e),
114
138
  cardColorClass: m,
115
139
  removeBtnClass: f ? X.removeBtnImage : X.actionBtn
116
140
  };
117
- }, me = (e) => {
118
- let t = e.lastIndexOf(".");
119
- return t > 0 ? e.slice(0, t) : e;
120
- }, he = ({ attachment: n, searchQuery: i = "", onRemove: a, onRetry: m, onExpand: h, onClick: _, isSelected: v, shouldAlwaysShowActions: y, removeLabel: b = "Remove attachment", retryLabel: x = "Retry upload", clickLabel: S = "Open attachment", colors: C, typography: w, roundedClassName: T = "rounded-xl", showHoverDownloadIcon: E = !1, className: D }) => {
121
- let { id: O, name: k } = n, A = n.previewUrl ?? n.url, j = n.type === t.Pasted, M = j && h !== void 0, N = se(() => j ? k : me(k), [j, k]), P = o({
122
- "--ci-card-border": C?.border,
123
- "--ci-card-bg": C?.background,
124
- "--ci-card-name": C?.nameText,
125
- "--ci-card-meta": C?.metaText
126
- }), { isLoading: F, isError: I, isImage: L, isAudio: ee, areActionsVisible: te, BottomIcon: ne, typeLabel: R, cardColorClass: z, removeBtnClass: B } = se(() => pe(n, v ?? !1, y ?? !1), [
141
+ }, Se = (e, t) => e <= 0 ? {
142
+ layout: Z.None,
143
+ visibleCount: 0,
144
+ hiddenCount: 0
145
+ } : e < 5 || t ? {
146
+ layout: Z.AllVisible,
147
+ visibleCount: e,
148
+ hiddenCount: 0
149
+ } : {
150
+ layout: Z.Collapsed,
151
+ visibleCount: 4,
152
+ hiddenCount: e - 4
153
+ }, Ce = ({ attachment: n, searchQuery: i = "", onRemove: a, onRetry: m, onExpand: h, onClick: _, isSelected: v, shouldAlwaysShowActions: y, labels: b, styles: x, showHoverDownloadIcon: S = !1, className: C }) => {
154
+ let { removeLabel: w = "Remove attachment", retryLabel: T = "Retry upload", clickLabel: E = "Open attachment" } = b ?? {}, { colors: D, typography: O, roundedClassName: k = "rounded-xl" } = x ?? {}, { id: A, name: j } = n, M = n.previewUrl ?? n.url, N = n.type === t.Pasted, P = N && h !== void 0, F = ce(() => N ? j : pe(j), [N, j]), I = o({
155
+ "--ci-card-border": D?.border,
156
+ "--ci-card-bg": D?.background,
157
+ "--ci-card-name": D?.nameText,
158
+ "--ci-card-meta": D?.metaText
159
+ }), { isLoading: L, isError: R, isImage: z, isAudio: ee, areActionsVisible: te, BottomIcon: ne, typeLabel: B, cardColorClass: re, removeBtnClass: H } = ce(() => xe(n, v ?? !1, y ?? !1), [
127
160
  n,
128
161
  v,
129
162
  y
130
- ]), V = _ !== void 0 && !M && !F && !I, ie = M || V, { imageRef: ae, imageLoadStatus: U } = le({
131
- enabled: L,
132
- src: A
133
- }), W = () => {
134
- M && h ? h(O) : V && _ && _(O);
135
- }, ce = (e) => {
136
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), W());
163
+ ]), U = _ !== void 0 && !P && !L && !R, oe = P || U, { imageRef: se, imageLoadStatus: W } = le({
164
+ enabled: z,
165
+ src: M
166
+ }), G = () => {
167
+ P && h ? h(A) : U && _ && _(A);
168
+ }, ue = (e) => {
169
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), G());
137
170
  };
138
171
  if (ee) return /* @__PURE__ */ J("div", {
139
- style: P,
140
- className: s("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", T, z, D),
172
+ style: I,
173
+ className: s("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", k, re, C),
141
174
  children: [/* @__PURE__ */ J("div", {
142
175
  className: "flex items-center justify-between gap-2",
143
176
  children: [/* @__PURE__ */ q("span", {
144
177
  title: n.name,
145
- className: s(w?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.name),
178
+ className: s(O?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.name),
146
179
  children: i ? /* @__PURE__ */ q(r, {
147
180
  text: n.name,
148
181
  query: i,
@@ -154,10 +187,10 @@ var Y = /* @__PURE__ */ function(e) {
154
187
  "aria-hidden": !0
155
188
  }),
156
189
  size: p.Small,
157
- className: s("h-6 w-6 shrink-0 rounded", B),
158
- "aria-label": S,
190
+ className: s("h-6 w-6 shrink-0 rounded", H),
191
+ "aria-label": E,
159
192
  onClick: (e) => {
160
- e.stopPropagation(), _(O);
193
+ e.stopPropagation(), _(A);
161
194
  }
162
195
  })]
163
196
  }), n.playUrl && /* @__PURE__ */ q("audio", {
@@ -167,60 +200,60 @@ var Y = /* @__PURE__ */ function(e) {
167
200
  preload: "metadata"
168
201
  })]
169
202
  });
170
- let G = s("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", T, z, !L && "flex-col gap-3 p-3", ie && "cursor-pointer", D), Z = /* @__PURE__ */ J(K, { children: [
171
- L ? /* @__PURE__ */ J("div", {
203
+ let de = s("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", k, re, !z && "flex-col gap-3 p-3", oe && "cursor-pointer", C), Z = /* @__PURE__ */ J(K, { children: [
204
+ z ? /* @__PURE__ */ J("div", {
172
205
  className: "relative h-full w-full overflow-hidden",
173
- children: [U !== Y.Loaded && /* @__PURE__ */ q(u, {
206
+ children: [W !== Y.Loaded && /* @__PURE__ */ q(u, {
174
207
  variant: d.Rectangular,
175
208
  width: "100%",
176
209
  height: "100%",
177
- active: U === Y.Loading,
178
- overlay: /* @__PURE__ */ q(H, {
210
+ active: W === Y.Loading,
211
+ overlay: /* @__PURE__ */ q(V, {
179
212
  size: c.LG,
180
- className: w?.placeholderIconClassName ?? "text-secondary",
213
+ className: O?.placeholderIconClassName ?? "text-secondary",
181
214
  "aria-hidden": !0
182
215
  }),
183
- className: s("absolute inset-0", T)
216
+ className: s("absolute inset-0", k)
184
217
  }), /* @__PURE__ */ q("img", {
185
- ref: ae,
186
- src: A,
187
- alt: k,
218
+ ref: se,
219
+ src: M,
220
+ alt: j,
188
221
  loading: "lazy",
189
222
  decoding: "async",
190
- className: s("h-full w-full object-cover transition-opacity duration-200", U === Y.Loaded ? "opacity-100" : "opacity-0", T)
223
+ className: s("h-full w-full object-cover transition-opacity duration-200", W === Y.Loaded ? "opacity-100" : "opacity-0", k)
191
224
  })]
192
- }) : I ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J("div", {
225
+ }) : R ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J("div", {
193
226
  className: "flex flex-row items-center gap-1 overflow-hidden",
194
227
  children: [/* @__PURE__ */ q(ne, {
195
228
  size: c.SM,
196
229
  className: s("shrink-0", X.meta),
197
230
  "aria-hidden": !0
198
231
  }), /* @__PURE__ */ q("span", {
199
- title: R,
200
- className: s(w?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
201
- children: R
232
+ title: B,
233
+ className: s(O?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
234
+ children: B
202
235
  })]
203
236
  }), /* @__PURE__ */ q("div", {
204
237
  className: "min-w-0 flex-1",
205
238
  children: /* @__PURE__ */ q("div", {
206
- title: N,
207
- className: s(w?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", X.name),
239
+ title: F,
240
+ className: s(O?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", X.name),
208
241
  children: i ? /* @__PURE__ */ q(r, {
209
- text: N,
242
+ text: F,
210
243
  query: i,
211
244
  maxLines: 3
212
- }) : N
245
+ }) : F
213
246
  })
214
247
  })] }) : /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("div", {
215
248
  className: "min-w-0 flex-1",
216
249
  children: /* @__PURE__ */ q("div", {
217
- title: N,
218
- className: s(w?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", X.name),
250
+ title: F,
251
+ className: s(O?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", X.name),
219
252
  children: i ? /* @__PURE__ */ q(r, {
220
- text: N,
253
+ text: F,
221
254
  query: i,
222
255
  maxLines: 3
223
- }) : N
256
+ }) : F
224
257
  })
225
258
  }), /* @__PURE__ */ J("div", {
226
259
  className: "flex flex-row items-center gap-1 overflow-hidden",
@@ -229,47 +262,47 @@ var Y = /* @__PURE__ */ function(e) {
229
262
  className: s("shrink-0", X.meta),
230
263
  "aria-hidden": !0
231
264
  }), /* @__PURE__ */ q("span", {
232
- title: R,
233
- className: s(w?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
234
- children: R
265
+ title: B,
266
+ className: s(O?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
267
+ children: B
235
268
  })]
236
269
  })] }),
237
- F && /* @__PURE__ */ q("span", {
238
- className: s("absolute inset-0 flex items-center justify-center", T, X.loadingOverlay),
270
+ L && /* @__PURE__ */ q("span", {
271
+ className: s("absolute inset-0 flex items-center justify-center", k, X.loadingOverlay),
239
272
  children: /* @__PURE__ */ q(f, {
240
273
  size: 40,
241
274
  ariaLabel: "Loading attachment",
242
275
  className: "z-50"
243
276
  })
244
277
  }),
245
- !F && /* @__PURE__ */ J("div", {
278
+ !L && /* @__PURE__ */ J("div", {
246
279
  className: s("absolute end-1 top-1 flex gap-1 transition-opacity", te ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
247
280
  children: [
248
- I && m && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ q(l, {
249
- icon: /* @__PURE__ */ q(re, {
281
+ R && m && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ q(l, {
282
+ icon: /* @__PURE__ */ q(ie, {
250
283
  size: c.SM,
251
284
  "aria-hidden": !0
252
285
  }),
253
286
  size: p.Small,
254
- className: s("h-6 w-6 rounded", B),
255
- "aria-label": x,
287
+ className: s("h-6 w-6 rounded", H),
288
+ "aria-label": T,
256
289
  onClick: (e) => {
257
- e.stopPropagation(), m(O);
290
+ e.stopPropagation(), m(A);
258
291
  }
259
292
  }),
260
293
  a && /* @__PURE__ */ q(l, {
261
- icon: /* @__PURE__ */ q(oe, {
294
+ icon: /* @__PURE__ */ q(ae, {
262
295
  size: c.SM,
263
296
  "aria-hidden": !0
264
297
  }),
265
298
  size: p.Small,
266
- className: s("h-6 w-6 rounded", B),
267
- "aria-label": b,
299
+ className: s("h-6 w-6 rounded", H),
300
+ "aria-label": w,
268
301
  onClick: (e) => {
269
- e.stopPropagation(), a?.(O);
302
+ e.stopPropagation(), a?.(A);
270
303
  }
271
304
  }),
272
- E && !a && !I && /* @__PURE__ */ q(g, {
305
+ S && !a && !R && /* @__PURE__ */ q(g, {
273
306
  size: c.SM,
274
307
  "aria-hidden": !0,
275
308
  className: s("h-6 w-6 rounded-lg p-1", X.hoverDownloadIcon)
@@ -277,160 +310,151 @@ var Y = /* @__PURE__ */ function(e) {
277
310
  ]
278
311
  })
279
312
  ] });
280
- return ie ? /* @__PURE__ */ q("div", {
281
- style: P,
282
- className: G,
283
- onClick: W,
284
- onKeyDown: ce,
313
+ return oe ? /* @__PURE__ */ q("div", {
314
+ style: I,
315
+ className: de,
316
+ onClick: G,
317
+ onKeyDown: ue,
285
318
  tabIndex: 0,
286
319
  role: "button",
287
- "aria-label": V ? S : void 0,
320
+ "aria-label": U ? E : void 0,
288
321
  children: Z
289
322
  }) : /* @__PURE__ */ q("div", {
290
- style: P,
291
- className: G,
323
+ style: I,
324
+ className: de,
292
325
  children: Z
293
326
  });
294
- }, ge = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, ariaLabel: i = "Attached files", removeLabel: a, retryLabel: o, onAttachmentClick: c, clickLabel: l, className: u }) => e.length === 0 ? null : /* @__PURE__ */ q("div", {
295
- role: "list",
296
- "aria-label": i,
297
- className: s("flex w-full min-w-0 gap-2 overflow-x-auto", u),
298
- children: e.map((e) => /* @__PURE__ */ q("div", {
299
- role: "listitem",
300
- children: /* @__PURE__ */ q(he, {
301
- attachment: e,
302
- onRemove: t,
303
- onRetry: n,
304
- onExpand: r,
305
- removeLabel: a,
306
- retryLabel: o,
307
- onClick: c ? () => c(e) : void 0,
308
- clickLabel: l
309
- })
310
- }, e.id))
311
- }), _e = /* @__PURE__ */ function(e) {
312
- return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
313
- }({}), ve = 5, ye = 4, be = (e, t) => e <= 0 ? {
314
- layout: "none",
315
- visibleCount: 0,
316
- hiddenCount: 0
317
- } : e < 5 || t ? {
318
- layout: "all-visible",
319
- visibleCount: e,
320
- hiddenCount: 0
321
- } : {
322
- layout: "collapsed",
323
- visibleCount: 4,
324
- hiddenCount: e - 4
327
+ }, we = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a, className: o }) => {
328
+ let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = a ?? {};
329
+ return e.length === 0 ? null : /* @__PURE__ */ q("div", {
330
+ role: "list",
331
+ "aria-label": c,
332
+ className: s("flex w-full min-w-0 gap-2 overflow-x-auto", o),
333
+ children: e.map((e) => /* @__PURE__ */ q("div", {
334
+ role: "listitem",
335
+ children: /* @__PURE__ */ q(Ce, {
336
+ attachment: e,
337
+ onRemove: t,
338
+ onRetry: n,
339
+ onExpand: r,
340
+ labels: {
341
+ removeLabel: l,
342
+ retryLabel: u,
343
+ clickLabel: d
344
+ },
345
+ onClick: i ? () => i(e) : void 0
346
+ })
347
+ }, e.id))
348
+ });
325
349
  }, Q = {
326
- tile: "_tile_1x7ag_2",
327
- tileLight: "_tileLight_1x7ag_27",
328
- tileError: "_tileError_1x7ag_31",
329
- nameText: "_nameText_1x7ag_38",
330
- typeText: "_typeText_1x7ag_39",
331
- retryIcon: "_retryIcon_1x7ag_51",
332
- hoverIcon: "_hoverIcon_1x7ag_55",
333
- track: "_track_1x7ag_60",
334
- indeterminateFill: "_indeterminateFill_1x7ag_64",
335
- "attachment-tile-indeterminate": "_attachment-tile-indeterminate_1x7ag_1"
336
- }, xe = {
350
+ tile: "_tile_488nu_1",
351
+ tileLight: "_tileLight_488nu_12",
352
+ tileError: "_tileError_488nu_16",
353
+ nameText: "_nameText_488nu_23",
354
+ typeText: "_typeText_488nu_24",
355
+ retryIcon: "_retryIcon_488nu_36",
356
+ hoverIcon: "_hoverIcon_488nu_40",
357
+ track: "_track_488nu_45",
358
+ indeterminateFill: "_indeterminateFill_488nu_49",
359
+ "attachment-tile-indeterminate": "_attachment-tile-indeterminate_488nu_1"
360
+ }, Te = {
337
361
  [e.Network]: "Upload failed · network error",
338
362
  [e.UnsupportedType]: "Upload failed · unsupported file type"
339
- }, Se = ({ attachment: t, onClick: r, onRetry: i, clickLabel: o = "Download attachment", retryLabel: u = "Retry upload", theme: d = n.Dark, className: f }) => {
340
- let { id: m, name: h, status: _, errorReason: v } = t, y = _ === a.Loading, b = _ === a.Error, x = b && (v && xe[v] || "Upload failed"), { BottomIcon: S, typeLabel: C } = pe(t, !1, !1), w = !b && !y && r !== void 0, T = b && !!i && v !== e.UnsupportedType, E = w || T ? "pe-5" : void 0, D = () => {
341
- w && r?.(t);
342
- }, O = (e) => {
343
- (e.key === "Enter" || e.key === " ") && w && (e.preventDefault(), D());
344
- }, k = s("group relative flex size-[84px] flex-col justify-between gap-1 overflow-hidden rounded-xl border p-1.5", Q.tile, !b && d === n.Light && Q.tileLight, b && Q.tileError), A = /* @__PURE__ */ q("div", {
345
- title: h,
346
- className: s("dial-caption-text line-clamp-2 min-w-0 break-words", Q.nameText, !b && E),
347
- children: h
348
- }), j = /* @__PURE__ */ J("div", {
349
- className: s("flex items-center gap-1 overflow-hidden", b && E),
350
- children: [/* @__PURE__ */ q(S, {
363
+ }, Ee = ({ attachment: t, onClick: r, onRetry: i, labels: o, styles: u, theme: d = n.Dark, className: f }) => {
364
+ let { clickLabel: m = "Download attachment", retryLabel: h = "Retry upload", sizeLabel: _ } = o ?? {}, { nameClassName: v = "dial-caption-text", metaClassName: y = "dial-caption-text" } = u ?? {}, { id: b, name: x, status: S, errorReason: C } = t, w = S === a.Loading, T = S === a.Error, E = T && (C && Te[C] || "Upload failed"), { BottomIcon: D, typeLabel: O } = xe(t, !1, !1), k = !T && !w && r !== void 0, A = T && !!i && C !== e.UnsupportedType, j = k || A ? "pe-5" : void 0, M = () => {
365
+ k && r?.(t);
366
+ }, N = (e) => {
367
+ (e.key === "Enter" || e.key === " ") && k && (e.preventDefault(), M());
368
+ }, P = s("group relative flex size-[84px] flex-col justify-between gap-1 overflow-hidden rounded-xl border p-1.5", Q.tile, !T && d === n.Light && Q.tileLight, T && Q.tileError), F = /* @__PURE__ */ q("div", {
369
+ title: x,
370
+ className: s(v, "line-clamp-2 min-w-0 break-words", Q.nameText, !T && j),
371
+ children: x
372
+ }), I = /* @__PURE__ */ J("div", {
373
+ className: s("flex items-center gap-1 overflow-hidden", T && j),
374
+ children: [/* @__PURE__ */ q(D, {
351
375
  size: 16,
352
376
  className: Q.typeText,
353
377
  "aria-hidden": !0
354
378
  }), /* @__PURE__ */ q("span", {
355
- className: s("dial-caption-text truncate", Q.typeText),
356
- children: C
379
+ className: s(y, "truncate", Q.typeText),
380
+ children: _ ? `${O} · ${_}` : O
357
381
  })]
358
- }), M = /* @__PURE__ */ J(K, { children: [
359
- b ? /* @__PURE__ */ J(K, { children: [j, A] }) : /* @__PURE__ */ J(K, { children: [A, j] }),
360
- y && /* @__PURE__ */ q("div", {
382
+ }), L = /* @__PURE__ */ J(K, { children: [
383
+ T ? /* @__PURE__ */ J(K, { children: [I, F] }) : /* @__PURE__ */ J(K, { children: [F, I] }),
384
+ w && /* @__PURE__ */ q("div", {
361
385
  role: "progressbar",
362
386
  "aria-label": "Uploading",
363
387
  className: s("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", Q.track),
364
388
  children: /* @__PURE__ */ q("div", { className: s("h-full w-1/3 rounded-full", Q.indeterminateFill) })
365
389
  }),
366
- w && /* @__PURE__ */ q(g, {
390
+ k && /* @__PURE__ */ q(g, {
367
391
  size: c.SM,
368
392
  "aria-hidden": !0,
369
393
  className: s("absolute end-1 top-1 h-6 w-6 rounded-lg p-1 opacity-0 transition-opacity group-hover:opacity-100 mobile:opacity-100", Q.hoverIcon)
370
394
  }),
371
- T && /* @__PURE__ */ q(l, {
372
- icon: /* @__PURE__ */ q(re, {
395
+ A && /* @__PURE__ */ q(l, {
396
+ icon: /* @__PURE__ */ q(ie, {
373
397
  size: c.SM,
374
398
  "aria-hidden": !0
375
399
  }),
376
400
  size: p.Small,
377
401
  className: s("absolute end-1 top-1 h-6 w-6 rounded-lg", Q.retryIcon),
378
- "aria-label": u,
402
+ "aria-label": h,
379
403
  onClick: (e) => {
380
- e.stopPropagation(), i(m);
404
+ e.stopPropagation(), i(b);
381
405
  }
382
406
  })
383
407
  ] });
384
408
  return /* @__PURE__ */ q("div", {
385
409
  className: s("inline-flex", f),
386
- children: w ? /* @__PURE__ */ q("div", {
410
+ children: k ? /* @__PURE__ */ q("div", {
387
411
  role: "button",
388
412
  tabIndex: 0,
389
- "aria-label": o,
390
- onClick: D,
391
- onKeyDown: O,
392
- className: s(k, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
393
- children: M
413
+ "aria-label": m,
414
+ onClick: M,
415
+ onKeyDown: N,
416
+ className: s(P, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
417
+ children: L
394
418
  }) : /* @__PURE__ */ q("div", {
395
- className: k,
396
- title: x || void 0,
397
- children: M
419
+ className: P,
420
+ title: E || void 0,
421
+ children: L
398
422
  })
399
423
  });
400
- }, Ce = { tile: "_tile_kvom5_1" }, we = ({ count: e, onClick: t, ariaLabel: n, children: r, className: i }) => /* @__PURE__ */ q("button", {
424
+ }, De = { tile: "_tile_1s4d7_1" }, Oe = ({ count: e, onClick: t, ariaLabel: n, children: r, fontClassName: i = "dial-small-semi-text", className: a }) => /* @__PURE__ */ q("button", {
401
425
  type: "button",
402
426
  onClick: t,
403
427
  "aria-label": n ?? `Show ${e} more attachments`,
404
- className: s("dial-small-semi-text flex size-[84px] items-center justify-center rounded-xl border", Ce.tile, i),
428
+ className: s("flex size-[84px] items-center justify-center rounded-xl border", i, De.tile, a),
405
429
  children: r ?? /* @__PURE__ */ q("bdi", {
406
430
  dir: "ltr",
407
431
  children: `+${e}`
408
432
  })
409
433
  }), $ = {
410
- container: "_container_4zxg9_1",
411
- headerIcon: "_headerIcon_4zxg9_6",
412
- headerLabel: "_headerLabel_4zxg9_7",
413
- downloadAllButton: "_downloadAllButton_4zxg9_8",
414
- imageTile: "_imageTile_4zxg9_12"
415
- }, Te = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ee = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: o, ariaLabel: u = "Attachments", clickLabel: d = "Download attachment", retryLabel: f = "Retry upload", showLessLabel: p = "Show less", downloadAllLabel: h = "Download all", theme: v, className: y }) => {
416
- let [b, x] = G(!1), S = se(() => be(e.length, b), [e.length, b]);
434
+ container: "_container_7fktb_1",
435
+ headerIcon: "_headerIcon_7fktb_6",
436
+ headerLabel: "_headerLabel_7fktb_7",
437
+ downloadAllButton: "_downloadAllButton_7fktb_8",
438
+ imageTile: "_imageTile_7fktb_12"
439
+ }, ke = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ae = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: o, labels: u, styles: d, theme: f, className: p }) => {
440
+ let { ariaLabel: h = "Attachments", clickLabel: v = "Download attachment", retryLabel: y = "Retry upload", showLessLabel: b = "Show less", downloadAllLabel: x = "Download all" } = u ?? {}, { headerLabelClassName: S = "dial-tiny-semi-text" } = d ?? {}, [C, w] = G(!1), T = ce(() => Se(e.length, C), [e.length, C]);
417
441
  if (e.length === 0) return null;
418
- let C = e.some((e) => e.type === t.Image), w = e.some((e) => e.type !== t.Image), T = C && w, E = e.length >= 5, D = T ? V : C ? H : _, O = Te(e.length, "attachment"), k = e.slice(0, S.visibleCount);
442
+ let E = e.some((e) => e.type === t.Image), D = e.some((e) => e.type !== t.Image), O = E && D, k = e.length >= 5, A = O ? re : E ? V : _, j = ke(e.length, "attachment"), M = e.slice(0, T.visibleCount);
419
443
  return /* @__PURE__ */ J("div", {
420
444
  role: "group",
421
- "aria-label": u,
422
- className: s("rounded-2xl border p-3", E ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, y),
445
+ "aria-label": h,
446
+ className: s("rounded-2xl border p-3", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, p),
423
447
  children: [/* @__PURE__ */ J("div", {
424
448
  className: "mb-3 flex min-h-6 items-center gap-2",
425
449
  children: [
426
- /* @__PURE__ */ q(D, {
450
+ /* @__PURE__ */ q(A, {
427
451
  size: c.SM,
428
452
  className: s("shrink-0", $.headerIcon),
429
453
  "aria-hidden": !0
430
454
  }),
431
455
  /* @__PURE__ */ q("span", {
432
- className: s("dial-tiny-semi-text", $.headerLabel),
433
- children: O
456
+ className: s(S, $.headerLabel),
457
+ children: j
434
458
  }),
435
459
  e.length >= 2 && (r || n) && /* @__PURE__ */ q(l, {
436
460
  icon: /* @__PURE__ */ q(g, {
@@ -438,7 +462,7 @@ var Y = /* @__PURE__ */ function(e) {
438
462
  "aria-hidden": !0
439
463
  }),
440
464
  className: s("ms-auto h-6 w-6 rounded-lg", $.downloadAllButton),
441
- "aria-label": h,
465
+ "aria-label": x,
442
466
  onClick: () => {
443
467
  let t = e.filter((e) => e.status === a.Idle);
444
468
  r ? r(t) : t.forEach((e) => n?.(e));
@@ -447,43 +471,47 @@ var Y = /* @__PURE__ */ function(e) {
447
471
  ]
448
472
  }), /* @__PURE__ */ J("div", {
449
473
  role: "list",
450
- "aria-label": O,
451
- className: s("gap-3", E ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
474
+ "aria-label": j,
475
+ className: s("gap-3", k ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
452
476
  children: [
453
- k.map((e) => /* @__PURE__ */ q("div", {
477
+ M.map((e) => /* @__PURE__ */ q("div", {
454
478
  role: "listitem",
455
- children: e.type === t.Image ? /* @__PURE__ */ q(he, {
479
+ children: e.type === t.Image ? /* @__PURE__ */ q(Ce, {
456
480
  attachment: e,
457
481
  onClick: n ? () => n(e) : void 0,
458
482
  onRetry: i,
459
- clickLabel: d,
460
- retryLabel: f,
461
- roundedClassName: "rounded-xl",
483
+ labels: {
484
+ clickLabel: v,
485
+ retryLabel: y
486
+ },
487
+ styles: { roundedClassName: "rounded-xl" },
462
488
  showHoverDownloadIcon: !0,
463
489
  className: s("size-[84px]", $.imageTile)
464
- }) : /* @__PURE__ */ q(Se, {
490
+ }) : /* @__PURE__ */ q(Ee, {
465
491
  attachment: e,
466
- sizeLabel: o?.(e),
467
492
  onClick: n,
468
493
  onRetry: i,
469
- clickLabel: d,
470
- retryLabel: f,
471
- theme: v
494
+ labels: {
495
+ clickLabel: v,
496
+ retryLabel: y,
497
+ sizeLabel: o?.(e)
498
+ },
499
+ theme: f
472
500
  })
473
501
  }, e.id)),
474
- S.layout === _e.Collapsed && /* @__PURE__ */ q("div", {
502
+ T.layout === Z.Collapsed && /* @__PURE__ */ q("div", {
475
503
  role: "listitem",
476
- children: /* @__PURE__ */ q(we, {
477
- count: S.hiddenCount,
478
- onClick: () => x(!0)
504
+ children: /* @__PURE__ */ q(Oe, {
505
+ count: T.hiddenCount,
506
+ onClick: () => w(!0)
479
507
  })
480
508
  }),
481
- E && b && /* @__PURE__ */ q("div", {
509
+ k && C && /* @__PURE__ */ q("div", {
482
510
  role: "listitem",
483
- children: /* @__PURE__ */ q(we, {
511
+ children: /* @__PURE__ */ q(Oe, {
484
512
  count: 0,
485
- onClick: () => x(!1),
486
- ariaLabel: p,
513
+ onClick: () => w(!1),
514
+ ariaLabel: b,
487
515
  children: /* @__PURE__ */ q(m, {
488
516
  size: c.MD,
489
517
  "aria-hidden": !0
@@ -493,34 +521,44 @@ var Y = /* @__PURE__ */ function(e) {
493
521
  ]
494
522
  })]
495
523
  });
496
- }, De = ({ isVisible: e, isAttachmentsAllowed: t = !0, title: n, subtitle: r, iconClassName: i = "text-accent-primary", deniedIconClassName: a = "text-error", titleClassName: o = "heading-3 font-semibold", subtitleClassName: c = "dial-small-text" }) => {
524
+ }, je = {
525
+ overlay: "_overlay_wr7ez_1",
526
+ icon: "_icon_wr7ez_5",
527
+ deniedIcon: "_deniedIcon_wr7ez_9"
528
+ }, Me = ({ isVisible: e, isAttachmentsAllowed: t = !0, title: n, subtitle: r, styles: i }) => {
529
+ let { colors: a, typography: c } = i ?? {}, { titleClassName: l = "heading-3 font-semibold", subtitleClassName: u = "dial-small-text" } = c ?? {};
497
530
  if (!e) return null;
498
- let l = n ?? (t ? "Attach files" : "No attachments allowed"), u = r ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), d = t ? i : a, f = (e) => {
531
+ let d = o({
532
+ "--fd-bg": a?.background,
533
+ "--fd-icon": a?.icon,
534
+ "--fd-denied-icon": a?.deniedIcon
535
+ }), f = n ?? (t ? "Attach files" : "No attachments allowed"), p = r ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), m = t ? je.icon : je.deniedIcon, h = (e) => {
499
536
  e.preventDefault();
500
- }, p = t ? v : z;
537
+ }, g = t ? v : ne;
501
538
  return /* @__PURE__ */ q("div", {
502
- className: s("fixed inset-0 z-[9999] flex items-center justify-center bg-blackout backdrop-blur-sm", t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
503
- onDragOver: t ? void 0 : f,
504
- onDrop: t ? void 0 : f,
539
+ className: s("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", je.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
540
+ onDragOver: t ? void 0 : h,
541
+ onDrop: t ? void 0 : h,
542
+ style: d,
505
543
  children: /* @__PURE__ */ J("div", {
506
544
  className: "flex flex-col items-center text-center",
507
545
  children: [
508
- /* @__PURE__ */ q(p, {
546
+ /* @__PURE__ */ q(g, {
509
547
  size: 100,
510
- className: d
548
+ className: m
511
549
  }),
512
550
  /* @__PURE__ */ q("span", {
513
- className: s("mt-5", o),
514
- children: l
551
+ className: s("mt-5", l),
552
+ children: f
515
553
  }),
516
554
  /* @__PURE__ */ q("span", {
517
- className: s("mt-4", c),
518
- children: u
555
+ className: s("mt-4", u),
556
+ children: p
519
557
  })
520
558
  ]
521
559
  })
522
560
  });
523
- }, Oe = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, ke = (e, n) => ({ handlePaste: U((r) => {
561
+ }, Ne = (e, n) => ({ handlePaste: oe((r) => {
524
562
  if (!r.clipboardData) return;
525
563
  let i = Array.from(r.clipboardData.items).filter((e) => e.kind === "file" && e.type.startsWith("image/")), o = r.clipboardData.getData("text/plain").length > 0;
526
564
  if (i.length > 0 && !o) {
@@ -529,7 +567,7 @@ var Y = /* @__PURE__ */ function(e) {
529
567
  let r = e.getAsFile();
530
568
  if (!r) continue;
531
569
  let i = new File([r], "Screenshot.png", { type: r.type }), o = {
532
- id: Oe(),
570
+ id: fe(),
533
571
  name: "Screenshot.png",
534
572
  contentType: r.type,
535
573
  file: i,
@@ -545,7 +583,7 @@ var Y = /* @__PURE__ */ function(e) {
545
583
  let s = r.clipboardData.getData("text/plain");
546
584
  if (s.length > n) {
547
585
  let n = s.trim(), i = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || "Pasted text", o = new File([s], i, { type: "text/plain" }), c = {
548
- id: Oe(),
586
+ id: fe(),
549
587
  name: i,
550
588
  contentType: "text/plain",
551
589
  file: o,
@@ -554,25 +592,6 @@ var Y = /* @__PURE__ */ function(e) {
554
592
  };
555
593
  r.preventDefault(), e([c]);
556
594
  }
557
- }, [e, n]) }), Ae = {
558
- image: "Image files",
559
- audio: "Audio files",
560
- video: "Video files",
561
- text: "Text files"
562
- }, je = (e) => e.map((e) => {
563
- if (e.endsWith("/*")) {
564
- let t = e.slice(0, -2);
565
- return Ae[t] ?? `${t} files`;
566
- }
567
- let t = e.split("/")[1];
568
- return t == null ? e.toUpperCase() : t.toUpperCase();
569
- }).join(", "), Me = (e, t) => t.length === 0 ? !1 : t.some((t) => {
570
- if (t === "*" || t === "*/*") return !0;
571
- if (t.endsWith("/*")) {
572
- let n = t.slice(0, -2);
573
- return e.startsWith(`${n}/`);
574
- }
575
- return e === t;
576
- }), Ne = 100;
595
+ }, [e, n]) }), Pe = 100;
577
596
  //#endregion
578
- export { ye as ATTACHMENT_COLLAPSED_VISIBLE_COUNT, ve as ATTACHMENT_COLLAPSE_THRESHOLD, he as AttachmentCard, Se as AttachmentFileRow, Ee as AttachmentGroup, we as AttachmentMoreTile, _e as AttachmentTilesLayout, ge as AttachmentTray, De as FileDndOverlay, Y as LazyImageLoadStatus, Ne as MAX_UPLOADS_PER_MINUTE, Oe as generateAttachmentId, pe as getAttachmentCardState, Z as getAttachmentIcon, be as getAttachmentTilesPlan, de as getExtFromContentType, me as getNameWithoutExtension, Me as isMimeTypeAllowed, je as mimeTypesToExtensionLabels, ke as useClipboardPaste, le as useLazyImageLoad };
597
+ export { de as ATTACHMENT_COLLAPSED_VISIBLE_COUNT, ue as ATTACHMENT_COLLAPSE_THRESHOLD, Ce as AttachmentCard, Ee as AttachmentFileRow, Ae as AttachmentGroup, Oe as AttachmentMoreTile, Z as AttachmentTilesLayout, we as AttachmentTray, Me as FileDndOverlay, Y as LazyImageLoadStatus, Pe as MAX_UPLOADS_PER_MINUTE, fe as generateAttachmentId, xe as getAttachmentCardState, _e as getAttachmentIcon, Se as getAttachmentTilesPlan, ye as getExtFromContentType, pe as getNameWithoutExtension, ge as isMimeTypeAllowed, he as mimeTypesToExtensionLabels, Ne as useClipboardPaste, le as useLazyImageLoad };