@pantograph/vue 0.23.35 → 0.25.0

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 (120) hide show
  1. package/dist/ActionButton/index.js +1 -1
  2. package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-jhaE9j9X.js → ActionButton.vue_vue_type_script_setup_true_lang-CZTRz3hl.js} +2 -2
  3. package/dist/Alert/index.js +1 -1
  4. package/dist/{Alert.vue_vue_type_style_index_0_lang-89bXo9jG.js → Alert.vue_vue_type_style_index_0_lang-BNoDGnDR.js} +3 -3
  5. package/dist/Avatar/index.js +1 -1
  6. package/dist/{Avatar.vue_vue_type_style_index_0_lang-kaq1iN2X.js → Avatar.vue_vue_type_style_index_0_lang--OU5sgDR.js} +3 -3
  7. package/dist/AvatarGroup/index.js +1 -1
  8. package/dist/Badge/index.js +1 -1
  9. package/dist/{Badge.vue_vue_type_script_setup_true_lang-C6x4r-P7.js → Badge.vue_vue_type_script_setup_true_lang-ov_fhvSB.js} +2 -2
  10. package/dist/{BaseBadge.vue_vue_type_style_index_0_lang-CAdrPXmH.js → BaseBadge.vue_vue_type_style_index_0_lang-Cwko3Hlm.js} +1 -1
  11. package/dist/{BaseButton.vue_vue_type_style_index_0_lang-favf_C7t.js → BaseButton.vue_vue_type_style_index_0_lang-DV59KCrZ.js} +4 -4
  12. package/dist/Button/index.js +1 -1
  13. package/dist/{Button.vue_vue_type_script_setup_true_lang-DTZUw0pf.js → Button.vue_vue_type_script_setup_true_lang-CYE9whgK.js} +2 -2
  14. package/dist/Checkbox/index.js +1 -1
  15. package/dist/{Checkbox.vue_vue_type_style_index_0_lang-Dzren1pf.js → Checkbox.vue_vue_type_style_index_0_lang-B37LXBOT.js} +2 -2
  16. package/dist/CheckboxGroup/index.js +1 -1
  17. package/dist/Chip/index.js +2 -2
  18. package/dist/{Chip.vue_vue_type_style_index_0_lang-BPdU3Pgk.js → Chip.vue_vue_type_style_index_0_lang-B8XnEjIk.js} +2 -2
  19. package/dist/ChipGroup/index.js +1 -1
  20. package/dist/{ChipGroup.vue_vue_type_style_index_0_lang-D4A14AxB.js → ChipGroup.vue_vue_type_style_index_0_lang-CYarh7Jx.js} +2 -2
  21. package/dist/ColorPicker/index.js +1 -1
  22. package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-CAzVW3da.js → ColorPicker.vue_vue_type_style_index_0_lang-BhznZQOS.js} +3 -3
  23. package/dist/ColorSwatch/index.js +1 -1
  24. package/dist/{ColorSwatch-LVdDBugO.js → ColorSwatch-GhXGfFR9.js} +1 -1
  25. package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-htOyCGxU.js → ColorSwatch.vue_vue_type_style_index_0_lang-CXh-dgyg.js} +3 -3
  26. package/dist/ColorSwatchGroup/index.js +1 -1
  27. package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-Cv2D2XJ5.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-DMWiKVRG.js} +4 -4
  28. package/dist/ColorTrigger/index.js +1 -1
  29. package/dist/{ColorTrigger.vue_vue_type_style_index_0_lang-CNeFfFIE.js → ColorTrigger.vue_vue_type_style_index_0_lang-Cu8MO8RU.js} +3 -3
  30. package/dist/Combobox/index.js +1 -1
  31. package/dist/{Combobox.vue_vue_type_style_index_0_lang-Cj3maBpd.js → Combobox.vue_vue_type_style_index_0_lang-BsO5vzLB.js} +15 -15
  32. package/dist/Comment/CommentEditor.d.ts +9 -9
  33. package/dist/Comment/index.js +340 -1751
  34. package/dist/Comment/index.umd.cjs +1 -1
  35. package/dist/DataTable/index.js +1 -1
  36. package/dist/{DataTable.vue_vue_type_style_index_0_lang-CW2i09wf.js → DataTable.vue_vue_type_style_index_0_lang-DE97OF7f.js} +13 -13
  37. package/dist/DropZone/index.js +1 -1
  38. package/dist/{DropZone.vue_vue_type_style_index_0_lang-CF9qXlg0.js → DropZone.vue_vue_type_style_index_0_lang-gguAkRve.js} +2 -2
  39. package/dist/Empty/index.js +1 -1
  40. package/dist/{Empty.vue_vue_type_style_index_0_lang-BAbEBeZo.js → Empty.vue_vue_type_style_index_0_lang-YvYjr_zz.js} +1 -1
  41. package/dist/FloatButton/index.js +1 -1
  42. package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-PYw1Yz9o.js → FloatButton.vue_vue_type_script_setup_true_lang-Ck9ilRKa.js} +2 -2
  43. package/dist/Form/index.js +1 -1
  44. package/dist/GOPicker/index.js +1 -1
  45. package/dist/{GOPicker.vue_vue_type_style_index_0_lang-DVZ2wSgV.js → GOPicker.vue_vue_type_style_index_0_lang-D9A9w-Pa.js} +11 -11
  46. package/dist/GraphicalObject/index.js +1 -1
  47. package/dist/{GraphicalObject.vue_vue_type_script_setup_true_lang-C949W-Ro.js → GraphicalObject.vue_vue_type_script_setup_true_lang-CEul2ZDZ.js} +3 -3
  48. package/dist/GraphicalObjectGroup/index.js +1 -1
  49. package/dist/{GraphicalObjectGroup.vue_vue_type_style_index_0_lang-CYUJM_Vv.js → GraphicalObjectGroup.vue_vue_type_style_index_0_lang-lN6Gzj19.js} +2 -2
  50. package/dist/Icon/index.js +1 -1
  51. package/dist/{Icon.vue_vue_type_style_index_0_lang-BUvEzzua.js → Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js} +13 -13
  52. package/dist/IconButton/index.js +1 -1
  53. package/dist/{IconButton.vue_vue_type_script_setup_true_lang-BBnCpnF1.js → IconButton.vue_vue_type_script_setup_true_lang-BG-vYXAP.js} +2 -2
  54. package/dist/Image/index.js +1 -1
  55. package/dist/{Image.vue_vue_type_style_index_0_lang-UVOAmZXt.js → Image.vue_vue_type_style_index_0_lang-Bzg_B3NK.js} +2 -2
  56. package/dist/IndentLevel/index.js +1 -1
  57. package/dist/{IndentLevel.vue_vue_type_style_index_0_lang-59akXJBr.js → IndentLevel.vue_vue_type_style_index_0_lang-C7d2_3hI.js} +3 -3
  58. package/dist/Indicator/index.js +1 -1
  59. package/dist/{Indicator.vue_vue_type_script_setup_true_lang-AJV4EFOO.js → Indicator.vue_vue_type_script_setup_true_lang-DMYJ5Fn6.js} +2 -2
  60. package/dist/Input/index.js +1 -1
  61. package/dist/{Input.vue_vue_type_style_index_0_lang-D4aCRGW6.js → Input.vue_vue_type_style_index_0_lang-DkuxhdXR.js} +2 -2
  62. package/dist/Kbd/index.js +1 -1
  63. package/dist/{Kbd.vue_vue_type_style_index_0_lang-DpjuML9o.js → Kbd.vue_vue_type_style_index_0_lang-iUfSP9TC.js} +1 -1
  64. package/dist/Label/index.js +1 -1
  65. package/dist/Link/index.js +1 -1
  66. package/dist/{Link.vue_vue_type_style_index_0_lang-CsBkek74.js → Link.vue_vue_type_style_index_0_lang-TePg8XgW.js} +1 -1
  67. package/dist/Menu/index.js +1 -1
  68. package/dist/MenuItem/index.js +1 -1
  69. package/dist/{MenuItem.vue_vue_type_style_index_0_lang-DNlGDoyp.js → MenuItem.vue_vue_type_style_index_0_lang-D_lWThP0.js} +3 -3
  70. package/dist/Pagination/Pagination.d.ts +60 -0
  71. package/dist/Pagination/index.d.ts +2 -1
  72. package/dist/Pagination/index.js +6 -1
  73. package/dist/Pagination/index.umd.cjs +1 -1
  74. package/dist/Pagination.vue_vue_type_style_index_0_lang-CDaeQOJb.js +1 -0
  75. package/dist/Pagination.vue_vue_type_style_index_0_lang-D8oCaF6X.js +224 -0
  76. package/dist/Popover/index.js +1 -1
  77. package/dist/{Popover.vue_vue_type_style_index_0_lang-Bdu86hho.js → Popover.vue_vue_type_style_index_0_lang-DLboppFN.js} +1 -1
  78. package/dist/Progress/index.d.ts +3 -0
  79. package/dist/Progress/index.js +15 -0
  80. package/dist/Progress/index.umd.cjs +1 -0
  81. package/dist/Progress.vue_vue_type_style_index_0_lang-BEHOwYFc.js +447 -0
  82. package/dist/Progress.vue_vue_type_style_index_0_lang-WHi3Gv1W.js +1 -0
  83. package/dist/RadioGroup/index.js +1 -1
  84. package/dist/{RadioGroup.vue_vue_type_script_setup_true_lang-BVfQx8wD.js → RadioGroup.vue_vue_type_script_setup_true_lang-BEPTbeyN.js} +2 -2
  85. package/dist/ScrollContainer/index.js +1 -1
  86. package/dist/{ScrollContainer.vue_vue_type_style_index_0_lang-DGUSuq_n.js → ScrollContainer.vue_vue_type_style_index_0_lang-DqLbpFbD.js} +1 -1
  87. package/dist/Segmented/Segmented.d.ts +57 -0
  88. package/dist/Segmented/index.d.ts +2 -1
  89. package/dist/Segmented/index.js +6 -1
  90. package/dist/Segmented/index.umd.cjs +1 -1
  91. package/dist/Segmented.vue_vue_type_style_index_0_lang-B52Fuc2U.js +161 -0
  92. package/dist/Segmented.vue_vue_type_style_index_0_lang-BvBq13y7.js +1 -0
  93. package/dist/Select/index.js +1 -1
  94. package/dist/{Select.vue_vue_type_style_index_0_lang-D-dLDaBy.js → Select.vue_vue_type_style_index_0_lang-NsFWEuv3.js} +7 -7
  95. package/dist/Shortcut/index.js +1 -1
  96. package/dist/{Shortcut.vue_vue_type_style_index_0_lang-BXy0S1__.js → Shortcut.vue_vue_type_style_index_0_lang-D0pRaguA.js} +2 -2
  97. package/dist/Spinner/index.js +1 -1
  98. package/dist/{Spinner.vue_vue_type_style_index_0_lang-BacaASPe.js → Spinner.vue_vue_type_style_index_0_lang-Bx_MQ7lE.js} +1 -1
  99. package/dist/SubMenu/index.js +1 -1
  100. package/dist/Switch/index.js +1 -1
  101. package/dist/{Switch.vue_vue_type_style_index_0_lang--RYeL-jW.js → Switch.vue_vue_type_style_index_0_lang-CnwcbtZs.js} +2 -2
  102. package/dist/{THead.vue_vue_type_style_index_0_lang-DfOi9-Nh.js → THead.vue_vue_type_style_index_0_lang-BEFUWFjk.js} +1 -1
  103. package/dist/Table/index.js +1 -1
  104. package/dist/Textarea/index.js +1 -1
  105. package/dist/{Textarea.vue_vue_type_style_index_0_lang-CPto-5VY.js → Textarea.vue_vue_type_style_index_0_lang-DPWaIFuD.js} +3 -3
  106. package/dist/Tree/index.js +1 -1
  107. package/dist/{Tree.vue_vue_type_style_index_0_lang-D-mTy1Es.js → Tree.vue_vue_type_style_index_0_lang-Dh0qoB5W.js} +5 -5
  108. package/dist/Upload/index.d.ts +4 -1
  109. package/dist/Upload/index.js +14 -1
  110. package/dist/Upload/index.umd.cjs +1 -1
  111. package/dist/Upload.vue_vue_type_style_index_0_lang-6dbdVoDr.js +1 -0
  112. package/dist/Upload.vue_vue_type_style_index_0_lang-DXBaIH16.js +1008 -0
  113. package/dist/index.js +192 -162
  114. package/dist/index.umd.cjs +1 -1
  115. package/dist/{sortBy-BoHPhPoZ.js → sortBy-CUiSA46K.js} +16 -16
  116. package/dist/style/index.css +1 -1
  117. package/dist/{uniq-iuU6YkEW.js → uniq-Bk9D4jYg.js} +1 -1
  118. package/dist/{useInputDataStates-CJoP9BXy.js → useInputDataStates-RRZVY4Vg.js} +1 -1
  119. package/dist/utils/index.js +2 -2
  120. package/package.json +1 -1
@@ -0,0 +1,1008 @@
1
+ import { defineComponent as D, createElementBlock as O, openBlock as b, Fragment as pe, createBlock as z, createCommentVNode as R, createVNode as E, unref as l, normalizeClass as j, createSlots as je, withCtx as Q, computed as _, h as V, createElementVNode as ye, ref as ie, mergeProps as Ae, renderSlot as ae, normalizeProps as re, guardReactiveProps as le, useSlots as Oe, useAttrs as De, watch as ve, nextTick as qe, watchEffect as Me, readonly as Ne } from "vue";
2
+ import { createContext as ke } from "reka-ui";
3
+ import { getBemBlock as Ge, getBemElement as U, usePCId as ce, normCls as Ve, generateVariantClassList as N } from "@pantograph/utils";
4
+ import { a as ee, c as J, f as We } from "./index-BTuMaS--.js";
5
+ import { j as A, E as He, l as Je, t as x } from "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
6
+ import { cva as be } from "class-variance-authority";
7
+ import { _ as we } from "./Progress.vue_vue_type_style_index_0_lang-BEHOwYFc.js";
8
+ import { _ as Ke } from "./FloatButton.vue_vue_type_script_setup_true_lang-Ck9ilRKa.js";
9
+ import { _ as G } from "./IconButton.vue_vue_type_script_setup_true_lang-BG-vYXAP.js";
10
+ import { _ as Xe } from "./Image.vue_vue_type_style_index_0_lang-Bzg_B3NK.js";
11
+ import { g as q } from "./options-Bh1s18jm.js";
12
+ import { _ as Ye } from "./GraphicalObject.vue_vue_type_script_setup_true_lang-CEul2ZDZ.js";
13
+ const xe = Ge("upload"), Z = U(xe, "list"), F = U(Z, "item"), [K, Ze] = ke("Upload"), _e = (s, t) => {
14
+ if (s && t) {
15
+ const e = Array.isArray(t) ? t : t.split(","), o = s.name || "", n = s.type || "", c = n.replace(/\/.*$/, "");
16
+ return e.some((p) => {
17
+ const m = p.trim();
18
+ if (/^\*(?<temp1>\/\*)?$/.test(p))
19
+ return !0;
20
+ if (m.charAt(0) === ".") {
21
+ const d = o.toLowerCase(), a = m.toLowerCase();
22
+ let g = [a];
23
+ return (a === ".jpg" || a === ".jpeg") && (g = [".jpg", ".jpeg"]), g.some((u) => d.endsWith(u));
24
+ }
25
+ return /\/\*$/.test(m) ? c === m.replace(/\/.*$/, "") : !!(n === m || /^\w+$/.test(m));
26
+ });
27
+ }
28
+ return !0;
29
+ }, Qe = (s, t, e = 1 * 1024 * 1024) => {
30
+ const o = [];
31
+ let n = 0, c = 0;
32
+ for (; n < s.size; ) {
33
+ const p = Math.min(n + e, s.size), m = s.slice(n, p);
34
+ o.push({
35
+ chunk: m,
36
+ chunkSize: p - n,
37
+ index: c,
38
+ uid: t(),
39
+ status: "waiting"
40
+ }), n = p, c++;
41
+ }
42
+ return o;
43
+ }, Ce = (s, { getUid: t, chunkFile: e, chunkSize: o }) => {
44
+ if (ee(s)) {
45
+ let n;
46
+ if (s instanceof File)
47
+ n = s;
48
+ else
49
+ try {
50
+ n = new File(
51
+ [s],
52
+ s.name ?? "",
53
+ {
54
+ type: s.type ?? ""
55
+ }
56
+ );
57
+ } catch {
58
+ n = new Blob([s], {
59
+ type: s.type ?? ""
60
+ }), n.lastModified = (/* @__PURE__ */ new Date()).getTime(), n.name = s.name ?? "", n.webkitRelativePath = "";
61
+ }
62
+ if (ee(n) && n instanceof Blob) {
63
+ let c = [];
64
+ return e && (c = Qe(
65
+ n,
66
+ () => (t == null ? void 0 : t(!0)) ?? ce(void 0, !0),
67
+ o
68
+ )), {
69
+ uid: s.uid ?? (t == null ? void 0 : t()) ?? ce(void 0, !0),
70
+ originFileObj: n,
71
+ status: "waiting",
72
+ chunks: c != null && c.length && (c == null ? void 0 : c.length) > 1 ? c : void 0,
73
+ chunksCount: c != null && c.length && (c == null ? void 0 : c.length) > 1 ? c.length : void 0,
74
+ name: n == null ? void 0 : n.name,
75
+ type: n == null ? void 0 : n.type,
76
+ size: n == null ? void 0 : n.size,
77
+ lastModified: n == null ? void 0 : n.lastModified,
78
+ thumbUrl: void 0
79
+ };
80
+ }
81
+ }
82
+ }, et = (s, t) => {
83
+ if (ee(s))
84
+ return s instanceof Blob || s instanceof File ? Ce(s, t) : (!s.uid && !Object.isFrozen(s) && (s.uid = t.getUid()), s);
85
+ }, tt = ["error", "paused", "done", "uploading", "waiting"], ze = ["md", "lg", "xlg"], Fe = ["image", "card"], st = ["outline", "transparent"], oe = {
86
+ other: {
87
+ icon: "tabler:file-text",
88
+ fg: "primary",
89
+ bg: "primary-subtle"
90
+ },
91
+ text: {
92
+ icon: "tabler:file-typography",
93
+ fg: "primary",
94
+ bg: "primary-subtle"
95
+ },
96
+ image: {
97
+ icon: "tabler:photo",
98
+ fg: "primary",
99
+ bg: "primary-subtle"
100
+ },
101
+ video: {
102
+ icon: "tabler:video",
103
+ fg: "primary",
104
+ bg: "primary-subtle"
105
+ },
106
+ zip: {
107
+ icon: "tabler:file-zip",
108
+ fg: "primary",
109
+ bg: "primary-subtle"
110
+ },
111
+ pdf: {
112
+ icon: "tabler:file-type-pdf",
113
+ fg: "red",
114
+ bg: "red-subtle"
115
+ },
116
+ document: {
117
+ icon: "tabler:file-type-docx",
118
+ fg: "primary",
119
+ bg: "primary-subtle"
120
+ },
121
+ excel: {
122
+ icon: "tabler:file-type-csv",
123
+ fg: "green",
124
+ bg: "green-subtle"
125
+ }
126
+ }, nt = {
127
+ image: [
128
+ "3fr",
129
+ "arw",
130
+ "bmp",
131
+ "dib",
132
+ "cr2",
133
+ "crw",
134
+ "dng",
135
+ "gif",
136
+ "heic",
137
+ "heif",
138
+ "ico",
139
+ "jfif",
140
+ "jpe",
141
+ "jpeg",
142
+ "jpg",
143
+ "jp2",
144
+ "nef",
145
+ "png",
146
+ "raf",
147
+ "raw",
148
+ "rw2",
149
+ "sr2",
150
+ "svg",
151
+ "svg",
152
+ "tga",
153
+ "tif",
154
+ "tiff",
155
+ "wdp",
156
+ "webp"
157
+ ],
158
+ video: [
159
+ "3g2",
160
+ "3gp2",
161
+ "3gp",
162
+ "3gpp",
163
+ "asf",
164
+ "asx",
165
+ "avi",
166
+ "flv",
167
+ "m1v",
168
+ "m2v",
169
+ "mod",
170
+ "mp2v",
171
+ "mpa",
172
+ "mpe",
173
+ "mpv2",
174
+ "mpeg",
175
+ "mpegvideo",
176
+ "m2t",
177
+ "m2ts",
178
+ "tts",
179
+ "ts",
180
+ "mkv",
181
+ "mp4v",
182
+ "mp4",
183
+ "mov",
184
+ "m4v",
185
+ "mjpeg",
186
+ "mts",
187
+ "ogv",
188
+ "webm",
189
+ "wm",
190
+ "wmv",
191
+ "wmx",
192
+ "wvx"
193
+ ],
194
+ text: [
195
+ "addin",
196
+ "dtsconfig",
197
+ "vssettings",
198
+ "vstemplate",
199
+ "xml",
200
+ "xrm-ms",
201
+ "xsd",
202
+ "xsl",
203
+ "cd",
204
+ "cs",
205
+ "csproj",
206
+ "iss",
207
+ "py",
208
+ "pyw",
209
+ "rc",
210
+ "rc2",
211
+ "rct",
212
+ "sln",
213
+ "srt",
214
+ "txt",
215
+ "user",
216
+ "vb",
217
+ "vbproj",
218
+ "vdp",
219
+ "vdproj",
220
+ "vspscc",
221
+ "vsscc",
222
+ "vssscc",
223
+ "contact",
224
+ "css",
225
+ "group",
226
+ "html",
227
+ "htm",
228
+ "shtml",
229
+ "htc",
230
+ "ics",
231
+ "iqy",
232
+ "odc",
233
+ "sct",
234
+ "wsc",
235
+ "vcf",
236
+ "vtt"
237
+ ],
238
+ zip: ["zip", "7z", "rar", "tar.gz"],
239
+ document: ["doc", "docx", "odt", "rtf"],
240
+ excel: ["xls", "xlsx", "csv", "ods"],
241
+ pdf: ["pdf"]
242
+ }, Ie = (s) => {
243
+ if (s) {
244
+ for (const [t, e] of Object.entries(nt))
245
+ if (e.includes(s.toLowerCase()))
246
+ return t;
247
+ }
248
+ return "other";
249
+ }, Ue = (s = "") => {
250
+ const t = s.split("/"), o = t[t.length - 1].split(/#|\?/)[0];
251
+ return (/\.[^./\\]*$/.exec(o) || [""])[0];
252
+ }, de = (s) => {
253
+ var t, e, o;
254
+ return (o = (e = (t = s == null ? void 0 : s.split) == null ? void 0 : t.call(s, "/")) == null ? void 0 : e.pop) == null ? void 0 : o.call(e);
255
+ }, ot = (s) => {
256
+ var e;
257
+ let t = de((s == null ? void 0 : s.type) || ((e = s == null ? void 0 : s.originFileObj) == null ? void 0 : e.type));
258
+ if (s != null && s.url && !t)
259
+ try {
260
+ t = Ue(s == null ? void 0 : s.url);
261
+ } catch {
262
+ }
263
+ return t;
264
+ }, ue = (s) => Ie(s) === "image", Le = (s) => {
265
+ if (s.type && !s.thumbUrl)
266
+ return ue(de(s.type));
267
+ const t = s.thumbUrl || s.url || "", e = Ue(t);
268
+ return /^data:image\//.test(t) || ue(e) ? !0 : !(/^data:/.test(t) || e);
269
+ }, it = /* @__PURE__ */ D({
270
+ ...q("UploadListItemImage"),
271
+ __name: "UploadListItemImage",
272
+ setup(s) {
273
+ const t = K(), e = fe(), o = () => {
274
+ var n, c, p;
275
+ J((n = e.props.uploadFile) == null ? void 0 : n.cancel) && ((p = (c = e.props.uploadFile).cancel) == null || p.call(c)), t.remove(e.props.uploadFile);
276
+ };
277
+ return (n, c) => {
278
+ var p;
279
+ return b(), O(pe, null, [
280
+ l(e).props.uploadFile.status !== "waiting" ? (b(), z(Xe, {
281
+ key: 0,
282
+ src: l(Le)(l(e).props.uploadFile) ? l(e).props.uploadFile.thumbUrl ?? l(e).props.uploadFile.url : void 0,
283
+ aspectRatio: "1:1",
284
+ class: j(l(U)(l(F), "image")),
285
+ sizeRange: "xsm",
286
+ alt: l(e).label.value,
287
+ hovered: l(e).props.uploadFile.status === "uploading",
288
+ width: "100%"
289
+ }, je({ _: 2 }, [
290
+ ["error", "done"].includes(l(e).props.uploadFile.status) ? {
291
+ name: "actions",
292
+ fn: Q(() => [
293
+ l(e).props.uploadFile.status === "done" ? (b(), z(G, {
294
+ key: 0,
295
+ color: "neutral",
296
+ type: "ghost",
297
+ icon: "tabler:eye",
298
+ size: "sm",
299
+ onClick: c[0] || (c[0] = (m) => l(t).emit("preview", l(e).props.uploadFile))
300
+ })) : l(e).props.uploadFile.status === "error" ? (b(), z(G, {
301
+ key: 1,
302
+ color: "neutral",
303
+ type: "ghost",
304
+ icon: "tabler:reload",
305
+ size: "sm",
306
+ onClick: c[1] || (c[1] = (m) => l(t).resetRequest(l(e).props.uploadFile))
307
+ })) : R("", !0)
308
+ ]),
309
+ key: "0"
310
+ } : void 0
311
+ ]), 1032, ["src", "class", "alt", "hovered"])) : R("", !0),
312
+ ["uploading", "waiting"].includes(l(e).props.uploadFile.status) ? (b(), z(we, {
313
+ key: 1,
314
+ type: "circle",
315
+ size: l(t).progressSize.value,
316
+ class: j(l(U)(l(F), "progress")),
317
+ indeterminate: l(e).props.uploadFile.status === "waiting",
318
+ percent: ((p = l(e).props.uploadFile) == null ? void 0 : p.percent) ?? 0
319
+ }, null, 8, ["size", "class", "indeterminate", "percent"])) : R("", !0),
320
+ E(Ke, {
321
+ class: j(
322
+ l(Ve)(l(U)(l(F), "cancel"), "pantograph-tokens pantograph-dark")
323
+ ),
324
+ color: "neutral",
325
+ icon: "tabler:x",
326
+ size: "sm",
327
+ onClick: o
328
+ }, null, 8, ["class"])
329
+ ], 64);
330
+ };
331
+ }
332
+ }), at = /* @__PURE__ */ D({
333
+ ...q("UploadFileGO"),
334
+ __name: "UploadFileGO",
335
+ setup(s) {
336
+ const t = fe(), e = K(), o = _(() => Ie(ot(t.props.uploadFile))), n = _(() => J(e.props.getFileIcon) ? e.props.getFileIcon(t.props.uploadFile) : oe[o.value].icon), c = _(() => oe[o.value].fg), p = _(() => oe[o.value].bg), m = () => {
337
+ var u, y, L, S;
338
+ const g = (y = (u = e.slots).go) == null ? void 0 : y.call(u, { uploadFile: t.props.uploadFile });
339
+ return A(g) ? Le(t.props.uploadFile) ? V("img", {
340
+ class: U(F, "thumb"),
341
+ alt: t.props.uploadFile.name ?? "",
342
+ src: ((L = t.props.uploadFile) == null ? void 0 : L.thumbUrl) ?? ((S = t.props.uploadFile) == null ? void 0 : S.url)
343
+ }) : null : g;
344
+ }, d = () => {
345
+ var u, y;
346
+ const g = (y = (u = e.slots).goIcon) == null ? void 0 : y.call(u, { uploadFile: t.props.uploadFile });
347
+ return A(g) ? null : g;
348
+ }, a = () => V(
349
+ Ye,
350
+ {
351
+ size: e.goSize.value,
352
+ icon: n.value,
353
+ fg: c.value,
354
+ bg: p.value
355
+ },
356
+ {
357
+ default: m,
358
+ icon: d
359
+ }
360
+ );
361
+ return (g, u) => (b(), z(a));
362
+ }
363
+ }), rt = /* @__PURE__ */ D({
364
+ ...q("UploadListItemCard"),
365
+ __name: "UploadListItemCard",
366
+ setup(s) {
367
+ const t = K(), e = fe(), o = () => {
368
+ var g, u;
369
+ const d = (u = (g = t.slots).description) == null ? void 0 : u.call(g, { uploadFile: e.props.uploadFile });
370
+ let a;
371
+ if (A(d) || (a = d), e.props.uploadFile.description && (a = e.props.uploadFile.description), a)
372
+ return V("div", { class: U(F, "description") }, a);
373
+ }, n = () => {
374
+ var a, g;
375
+ const d = (g = (a = t.slots).title) == null ? void 0 : g.call(a, { uploadFile: e.props.uploadFile });
376
+ return A(d) ? e.label.value : d;
377
+ }, c = () => {
378
+ var d;
379
+ if (J(t.props.onDownload))
380
+ return t.props.onDownload(e.props.uploadFile);
381
+ if ((d = e.props.uploadFile) != null && d.url && typeof window < "u")
382
+ return window.open(e.props.uploadFile.url);
383
+ }, p = _(() => {
384
+ var d, a;
385
+ return (d = e.props.uploadFile) != null && d.percent && ((a = e.props.uploadFile) == null ? void 0 : a.status) !== "waiting" ? `${(e.props.uploadFile.percent ?? 0).toFixed(0)}%` : "waiting...";
386
+ }), m = (d, a) => {
387
+ var u, y, L, S;
388
+ const g = (y = (u = t.slots) == null ? void 0 : u.actions) == null ? void 0 : y.call(u, {
389
+ ...t,
390
+ uploadFile: e.props.uploadFile,
391
+ downloadFile: c
392
+ });
393
+ return A(g) ? (S = (L = a.slots) == null ? void 0 : L.default) == null ? void 0 : S.call(L, {}) : g;
394
+ };
395
+ return (d, a) => {
396
+ var g;
397
+ return b(), O(pe, null, [
398
+ l(t).props.go ? (b(), z(at, { key: 0 })) : R("", !0),
399
+ ["error", "done"].includes(l(e).props.uploadFile.status) ? (b(), O("div", {
400
+ key: 2,
401
+ class: j(l(U)(l(F), "content"))
402
+ }, [
403
+ ye("div", {
404
+ class: j(l(U)(l(F), "title"))
405
+ }, [
406
+ E(n)
407
+ ], 2),
408
+ l(e).props.uploadFile.status === "error" ? (b(), z(He, {
409
+ key: 0,
410
+ message: "Failed",
411
+ status: "error"
412
+ })) : l(t).props.size !== "md" ? (b(), z(o, { key: 1 })) : R("", !0)
413
+ ], 2)) : (b(), z(we, {
414
+ key: 1,
415
+ class: j(l(U)(l(F), "progress")),
416
+ percent: ((g = l(e).props.uploadFile) == null ? void 0 : g.percent) ?? 0,
417
+ label: l(e).label.value,
418
+ helperText: p.value
419
+ }, {
420
+ label: Q(() => [
421
+ E(n)
422
+ ]),
423
+ _: 1
424
+ }, 8, ["class", "percent", "label", "helperText"])),
425
+ E(m, null, {
426
+ default: Q(() => {
427
+ var u;
428
+ return [
429
+ l(e).props.uploadFile.status === "done" ? (b(), z(G, {
430
+ key: 0,
431
+ icon: "tabler:download",
432
+ size: "sm",
433
+ type: "ghost",
434
+ color: "neutral",
435
+ onClick: c
436
+ })) : R("", !0),
437
+ l(t).props.pausableChunked && l(e).props.uploadFile.status === "uploading" && ((u = l(e).props.uploadFile.chunks) != null && u.length) && l(J)(l(e).props.uploadFile.cancel) ? (b(), z(G, {
438
+ key: 1,
439
+ icon: "tabler:pause",
440
+ size: "sm",
441
+ type: "ghost",
442
+ color: "neutral",
443
+ onClick: l(e).props.uploadFile.cancel
444
+ }, null, 8, ["onClick"])) : l(t).canRunUpload(l(e).props.uploadFile) ? (b(), z(G, {
445
+ key: 2,
446
+ icon: ["paused", "waiting"].includes(l(e).props.uploadFile.status) ? "tabler:player-play" : "tabler:reload",
447
+ size: "sm",
448
+ type: "ghost",
449
+ color: "neutral",
450
+ onClick: a[0] || (a[0] = (y) => l(t).resetRequest(l(e).props.uploadFile))
451
+ }, null, 8, ["icon"])) : R("", !0),
452
+ E(G, {
453
+ icon: ["done", "error"].includes(l(e).props.uploadFile.status) ? "tabler:trash" : "tabler:x",
454
+ size: "sm",
455
+ type: "ghost",
456
+ color: "neutral",
457
+ onClick: a[1] || (a[1] = (y) => l(t).remove(l(e).props.uploadFile))
458
+ }, null, 8, ["icon"])
459
+ ];
460
+ }),
461
+ _: 1
462
+ })
463
+ ], 64);
464
+ };
465
+ }
466
+ }), [fe, lt] = ke("UploadItem"), ct = /* @__PURE__ */ D({
467
+ ...q("UploadListItem"),
468
+ __name: "UploadListItem",
469
+ props: {
470
+ uploadFile: {}
471
+ },
472
+ setup(s) {
473
+ const t = s, e = be(F, {
474
+ variants: {
475
+ size: N(ze, F),
476
+ listType: N(
477
+ Fe,
478
+ F
479
+ ),
480
+ type: N(st, F),
481
+ status: N(tt, F)
482
+ }
483
+ }), o = _(() => {
484
+ var p, m, d;
485
+ return ((p = t.uploadFile) == null ? void 0 : p.name) ?? ((d = (m = t.uploadFile) == null ? void 0 : m.originFileObj) == null ? void 0 : d.name);
486
+ }), n = K();
487
+ lt({
488
+ props: t,
489
+ label: o
490
+ });
491
+ const c = () => {
492
+ var m, d;
493
+ const p = (d = (m = n.slots).listItem) == null ? void 0 : d.call(m, { ...n, uploadFile: t.uploadFile });
494
+ return A(p) ? n.props.listType === "card" ? V(rt) : V(it) : p;
495
+ };
496
+ return (p, m) => {
497
+ var d;
498
+ return b(), O("div", {
499
+ class: j(
500
+ l(e)({
501
+ size: l(n).props.size,
502
+ listType: l(n).props.listType,
503
+ type: l(n).props.type,
504
+ status: (d = p.uploadFile) == null ? void 0 : d.status
505
+ })
506
+ )
507
+ }, [
508
+ E(c)
509
+ ], 2);
510
+ };
511
+ }
512
+ }), ut = /* @__PURE__ */ D({
513
+ ...q("UploadList"),
514
+ __name: "UploadList",
515
+ setup(s) {
516
+ const t = K(), e = be(Z, {
517
+ variants: {
518
+ size: N(ze, Z),
519
+ listType: N(Fe, Z)
520
+ }
521
+ }), o = () => {
522
+ var c, p;
523
+ const n = (p = (c = t.slots).list) == null ? void 0 : p.call(c, t);
524
+ return A(n) ? t.fileList.value.map(
525
+ (m) => V(ct, { uploadFile: m, key: m.uid })
526
+ ) : n;
527
+ };
528
+ return (n, c) => {
529
+ var p;
530
+ return (p = l(t).fileList.value) != null && p.length ? (b(), O("div", {
531
+ key: 0,
532
+ class: j(
533
+ l(e)({
534
+ size: l(t).props.size,
535
+ listType: l(t).props.listType
536
+ })
537
+ )
538
+ }, [
539
+ E(o)
540
+ ], 2)) : R("", !0);
541
+ };
542
+ }
543
+ }), pt = (s) => new Promise((t) => {
544
+ s.file((e) => {
545
+ s.fullPath && !e.webkitRelativePath && Object.defineProperty(e, "webkitRelativePath", {
546
+ value: s.fullPath.replace(/^\//, ""),
547
+ writable: !1
548
+ }), t(e);
549
+ });
550
+ }), dt = (s) => {
551
+ const t = s.createReader(), e = [];
552
+ return new Promise((o) => {
553
+ const n = () => {
554
+ t.readEntries((c) => {
555
+ c.length === 0 ? o(e) : (e.push(...c), n());
556
+ });
557
+ };
558
+ n();
559
+ });
560
+ }, ft = async (s) => {
561
+ const t = [], e = async (o) => {
562
+ if (o.isFile) {
563
+ const n = await pt(o);
564
+ t.push(n);
565
+ } else if (o.isDirectory) {
566
+ const n = await dt(o);
567
+ await Promise.all(n.map(e));
568
+ }
569
+ };
570
+ return await Promise.all(
571
+ s.map((o) => {
572
+ var c;
573
+ const n = (c = o.webkitGetAsEntry) == null ? void 0 : c.call(o);
574
+ if (n)
575
+ return e(n);
576
+ })
577
+ ), t;
578
+ }, mt = ["accept", "webkitdirectory", "multiple", "value"], gt = /* @__PURE__ */ D({
579
+ ...q("UploadTrigger"),
580
+ __name: "UploadTrigger",
581
+ props: {
582
+ directory: { type: Boolean },
583
+ multiple: { type: Boolean },
584
+ disabled: { type: Boolean },
585
+ accept: {}
586
+ },
587
+ emits: ["addFiles"],
588
+ setup(s, { emit: t }) {
589
+ const e = t, o = s, n = ie(), c = (u) => {
590
+ const { files: y } = u.target;
591
+ e("addFiles", Array.prototype.slice.call(y)), p.value && (p.value.value = "");
592
+ }, p = ie(), m = () => {
593
+ var u;
594
+ (u = p.value) == null || u.click();
595
+ }, d = (u) => {
596
+ u.key === "Enter" && m();
597
+ }, a = async (u) => {
598
+ if (u.preventDefault(), u.type === "dragover")
599
+ return;
600
+ let y = [];
601
+ u.dataTransfer && (o.directory ? y = await ft(Array.prototype.slice.call(u.dataTransfer.items)) : y = Array.prototype.slice.call(u.dataTransfer.files)), o.multiple || (y = y.slice(0, 1)), e(
602
+ "addFiles",
603
+ y.filter((L) => _e(L, o.accept))
604
+ );
605
+ }, g = _(() => o.disabled ? {} : {
606
+ onClick: m,
607
+ onKeydown: d,
608
+ onDrop: a,
609
+ onDragover: a,
610
+ tabindex: "0"
611
+ });
612
+ return (u, y) => (b(), O("div", Ae({ class: "uploadTrigger w-fit inline" }, g.value), [
613
+ ae(u.$slots, "default", re(le({ ...g.value, disabled: u.disabled }))),
614
+ ye("input", {
615
+ type: "file",
616
+ accept: u.accept,
617
+ webkitdirectory: u.directory,
618
+ multiple: u.multiple,
619
+ value: n.value,
620
+ onChange: c,
621
+ ref_key: "inputRef",
622
+ ref: p,
623
+ style: { display: "none" }
624
+ }, null, 40, mt)
625
+ ], 16));
626
+ }
627
+ }), B = 200;
628
+ function ht(s) {
629
+ return new Promise((t) => {
630
+ if (!s.type || !ue(de(s.type))) {
631
+ t("");
632
+ return;
633
+ }
634
+ const e = document.createElement("canvas");
635
+ e.width = B, e.height = B, e.style.cssText = `position: fixed; left: 0; top: 0; width: ${B}px; height: ${B}px; z-index: 9999; display: none;`, document.body.appendChild(e);
636
+ const o = e.getContext("2d"), n = new Image();
637
+ if (n.onload = () => {
638
+ const { width: c, height: p } = n;
639
+ let m = B, d = B, a = 0, g = 0;
640
+ c > p ? (d = p * (B / c), g = -(d - m) / 2) : (m = c * (B / p), a = -(m - d) / 2), o.drawImage(n, a, g, m, d);
641
+ const u = e.toDataURL();
642
+ document.body.removeChild(e), t(u);
643
+ }, n.crossOrigin = "anonymous", s.type.startsWith("image/svg+xml")) {
644
+ const c = new FileReader();
645
+ c.addEventListener("load", () => {
646
+ c.result && (n.src = c.result);
647
+ }), c.readAsDataURL(s);
648
+ } else
649
+ n.src = window.URL.createObjectURL(s);
650
+ });
651
+ }
652
+ const Lt = /* @__PURE__ */ D({
653
+ ...q("Upload", !1),
654
+ __name: "Upload",
655
+ props: {
656
+ onDownload: {},
657
+ parallelUpload: { type: Boolean },
658
+ uploadOnSelect: { type: Boolean, default: !0 },
659
+ pausableChunked: { type: Boolean },
660
+ noTrigger: { type: Boolean },
661
+ fileList: {},
662
+ size: { default: "md" },
663
+ chunkSize: {},
664
+ listType: { default: "card" },
665
+ type: { default: "outline" },
666
+ go: { type: Boolean, default: !0 },
667
+ maxCount: {},
668
+ action: {},
669
+ getFileIcon: {},
670
+ directory: { type: Boolean },
671
+ multiple: { type: Boolean, default: !0 },
672
+ disabled: { type: Boolean },
673
+ accept: {}
674
+ },
675
+ emits: ["update:fileList", "change", "preview", "createRequest", "resetRequest", "remove"],
676
+ setup(s, { expose: t, emit: e }) {
677
+ const o = s, n = e, c = Oe(), p = De(), m = U(xe, "file"), d = (i) => ce(i ? U(m, "chunk") : m, !0), a = ie([]), g = _(() => o.listType !== "image" && o.pausableChunked);
678
+ let u = !1;
679
+ ve(
680
+ () => o.fileList,
681
+ (i) => {
682
+ var h, k;
683
+ u = !0, a.value = (k = (h = i ?? []) == null ? void 0 : h.map) == null ? void 0 : k.call(h, (C) => {
684
+ if (C && ee(C))
685
+ return et(C, {
686
+ getUid: d,
687
+ chunkFile: g.value,
688
+ chunkSize: o.chunkSize
689
+ });
690
+ }).filter(Boolean), qe(() => u = !1);
691
+ },
692
+ { immediate: !0, deep: !0 }
693
+ ), ve(
694
+ a,
695
+ (i) => {
696
+ u || n("update:fileList", i ?? []);
697
+ },
698
+ { immediate: !0, deep: !0 }
699
+ );
700
+ const y = _(() => o.maxCount ? Number(o.maxCount) : 0), L = (i) => {
701
+ if (i) {
702
+ const h = a.value.findIndex(
703
+ (k) => k.uid && i.uid && k.uid === i.uid
704
+ );
705
+ h === -1 && (!y.value || y.value > a.value.length) ? a.value.push(i) : h > -1 && a.value.splice(h, 0, i), n("change", {
706
+ file: x(i),
707
+ fileList: x(a.value),
708
+ event: "add"
709
+ });
710
+ }
711
+ }, S = _(
712
+ () => o.accept ?? o.listType === "image" ? "image/*" : void 0
713
+ ), me = (i) => {
714
+ We(i) && i.filter((h) => !o.directory || _e(h, S.value)).forEach((h) => {
715
+ L(
716
+ Ce(h, {
717
+ getUid: d,
718
+ chunkFile: g.value,
719
+ chunkSize: o.chunkSize
720
+ })
721
+ );
722
+ });
723
+ }, te = _(
724
+ () => {
725
+ var i;
726
+ return o.uploadOnSelect || o.listType === "image" ? ((i = a.value) == null ? void 0 : i.filter(
727
+ (h) => h.status === "waiting" && h.originFileObj
728
+ )) ?? [] : [];
729
+ }
730
+ ), X = _(
731
+ () => {
732
+ var i;
733
+ return ((i = a.value) == null ? void 0 : i.filter(
734
+ (h) => h.status === "uploading" && (h == null ? void 0 : h.cancel)
735
+ )) ?? [];
736
+ }
737
+ ), $ = (i, h) => {
738
+ if (i && h) {
739
+ const k = a.value.findIndex((C) => C.uid === i);
740
+ k > -1 && (a.value[k] = {
741
+ ...a.value[k],
742
+ ...h
743
+ });
744
+ }
745
+ }, Y = async (i) => {
746
+ var h, k, C, ge;
747
+ if (i.uid && a.value) {
748
+ const T = a.value.find((M) => M.uid === i.uid);
749
+ if (T && J(o.action) && (!X.value.length || o.parallelUpload || g.value && ((h = T.chunks) != null && h.length) && T.chunks.length > 1 && T.status === "uploading" && T.chunks.some((M) => M.status === "waiting"))) {
750
+ const M = new AbortController(), Be = () => {
751
+ const v = () => M.abort(), r = x(T);
752
+ if (g.value && r.chunks && r.chunks.length > 1) {
753
+ const f = r.chunks.findIndex((I) => I.status === "waiting");
754
+ f > -1 && (r.chunks[f] = {
755
+ ...r.chunks[f],
756
+ status: "uploading",
757
+ cancel: v
758
+ });
759
+ }
760
+ $(r.uid, {
761
+ ...r,
762
+ status: "uploading",
763
+ cancel: v
764
+ });
765
+ };
766
+ let w = {
767
+ signal: M.signal,
768
+ onUploadProgress(v) {
769
+ },
770
+ uid: i.uid
771
+ };
772
+ if (g.value && T.chunks && T.chunks.length > 1 && T.chunks.some((v) => v.status === "waiting")) {
773
+ const v = T.chunks.find((r) => r.status === "waiting");
774
+ v != null && v.uid && (w = {
775
+ ...w,
776
+ ...Je(v, "chunk", "chunkSiz", "index"),
777
+ chunk_uid: v.uid,
778
+ onUploadProgress(r) {
779
+ var I, W, P, he;
780
+ const f = x(
781
+ a.value.find((H) => H.uid === i.uid)
782
+ );
783
+ if (f) {
784
+ const H = (I = f.chunks) == null ? void 0 : I.findIndex(
785
+ (ne) => ne.uid === v.uid
786
+ );
787
+ H !== void 0 && ((W = f.chunks) != null && W[H]) && (f.chunks[H].percent = Math.round(
788
+ r.loaded * 100 / r.total
789
+ )), (P = f.chunks) != null && P.length && ((he = f.chunks) == null ? void 0 : he.length) > 1 ? f.percent = Math.min(
790
+ Math.max(
791
+ f.chunks.reduce((ne, Ee) => ne + (Ee.percent ?? 0), 0) / (100 * f.chunks.length),
792
+ 0
793
+ ),
794
+ 100
795
+ ) : f.percent = Math.round(r.loaded * 100 / r.total), $(f.uid, f);
796
+ }
797
+ }
798
+ });
799
+ } else
800
+ w = {
801
+ ...w,
802
+ file: T.originFileObj,
803
+ onUploadProgress(v) {
804
+ const r = x(
805
+ a.value.find((f) => f.uid === i.uid)
806
+ );
807
+ r && $(r.uid, {
808
+ percent: Math.round(v.loaded * 100 / v.total)
809
+ });
810
+ }
811
+ };
812
+ if (Be(), w.file || w.chunk) {
813
+ n("createRequest", i), n("change", {
814
+ file: x(i),
815
+ fileList: x(a.value),
816
+ event: "upload"
817
+ });
818
+ try {
819
+ let v = await o.action(w);
820
+ try {
821
+ typeof v == "string" && (v = JSON.parse(v));
822
+ } catch {
823
+ }
824
+ let r = x(
825
+ a.value.find((f) => f.uid === w.uid)
826
+ );
827
+ if (r) {
828
+ let f = !1;
829
+ if (w.chunk_uid && ((k = r.chunks) != null && k.length) && r.chunks.length > 1) {
830
+ const I = r.chunks.findIndex(
831
+ (P) => P.uid === w.chunk_uid
832
+ );
833
+ r.chunks[I] && (r.chunks[I] = {
834
+ ...r.chunks[I],
835
+ cancel: void 0,
836
+ status: "done",
837
+ response: v ?? void 0
838
+ });
839
+ const W = r.chunks.every((P) => P.status === "done") ? "done" : "uploading";
840
+ W === "done" ? r = {
841
+ ...r,
842
+ cancel: void 0,
843
+ status: W
844
+ } : r.chunks.some((P) => P.status === "waiting") && (f = !0);
845
+ } else
846
+ r = {
847
+ ...r,
848
+ cancel: void 0,
849
+ status: "done",
850
+ response: v ?? void 0
851
+ };
852
+ $(w.uid, r), f && await Y(r);
853
+ }
854
+ } catch (v) {
855
+ if (v.name === "CanceledError") {
856
+ let r = x(
857
+ a.value.find((f) => f.uid === w.uid)
858
+ );
859
+ if (r) {
860
+ if (w.chunk_uid && ((C = r.chunks) != null && C.length) && r.chunks.length > 1) {
861
+ const f = r.chunks.findIndex(
862
+ (I) => I.uid === w.chunk_uid
863
+ );
864
+ r.chunks[f] && (r.chunks[f] = {
865
+ ...r.chunks[f],
866
+ cancel: void 0,
867
+ status: "waiting"
868
+ }), r = {
869
+ ...r,
870
+ cancel: void 0,
871
+ status: "paused"
872
+ }, n("change", {
873
+ file: x(r),
874
+ fileList: x(a.value),
875
+ event: "paused"
876
+ });
877
+ } else
878
+ r = {
879
+ ...r,
880
+ cancel: void 0,
881
+ status: "error"
882
+ }, n("change", {
883
+ file: x(r),
884
+ fileList: x(a.value),
885
+ event: "cancel"
886
+ });
887
+ $(w.uid, r);
888
+ }
889
+ } else {
890
+ let r = x(
891
+ a.value.find((f) => f.uid === w.uid)
892
+ );
893
+ if (r) {
894
+ if (w.chunk_uid && ((ge = r.chunks) != null && ge.length) && r.chunks.length > 1) {
895
+ const f = r.chunks.findIndex(
896
+ (I) => I.uid === w.chunk_uid
897
+ );
898
+ r.chunks[f] && (r.chunks[f] = {
899
+ ...r.chunks[f],
900
+ cancel: void 0,
901
+ status: "waiting"
902
+ });
903
+ }
904
+ r = {
905
+ ...r,
906
+ cancel: void 0,
907
+ status: "error",
908
+ error: v,
909
+ percent: 0
910
+ }, n("change", {
911
+ file: x(r),
912
+ fileList: x(a.value),
913
+ event: "failed"
914
+ }), $(w.uid, r);
915
+ }
916
+ }
917
+ }
918
+ }
919
+ }
920
+ }
921
+ }, Te = async (i) => {
922
+ if (i.uid && a.value)
923
+ return $(i.uid, { status: "waiting" }), n("resetRequest", i), Y(i);
924
+ }, Re = async (i) => {
925
+ if (i.uid && a.value) {
926
+ const h = x(a.value ?? []), k = h.findIndex((C) => C.uid === i.uid);
927
+ k > -1 && h[k] && (h.splice(k, 1), a.value = h, n("remove", i), n("change", {
928
+ file: x(i),
929
+ fileList: x(a.value),
930
+ event: "remove"
931
+ }));
932
+ }
933
+ }, Se = (i) => !!((o.parallelUpload || !X.value.length) && (i.status === "paused" || i.status === "error" || (!o.uploadOnSelect || o.listType === "image") && i.status === "waiting")), $e = _(() => {
934
+ switch (o.size) {
935
+ case "xlg":
936
+ return "md";
937
+ default:
938
+ return "sm";
939
+ }
940
+ });
941
+ Me(() => {
942
+ (o.parallelUpload && te.value.length || !X.value.length) && te.value.forEach(Y), (a.value || []).forEach((i, h) => {
943
+ typeof document > "u" || typeof window > "u" || !window.FileReader || !window.File || !(i.originFileObj instanceof File || i.originFileObj instanceof Blob) || i.thumbUrl !== void 0 || (i.thumbUrl = "", ht(i.originFileObj).then((k) => {
944
+ const C = k || "";
945
+ C !== i.thumbUrl && $(i == null ? void 0 : i.uid, {
946
+ thumbUrl: C
947
+ });
948
+ }));
949
+ });
950
+ });
951
+ const Pe = _(() => {
952
+ switch (o.size) {
953
+ case "xlg":
954
+ return "sm";
955
+ case "lg":
956
+ return "xsm";
957
+ default:
958
+ return "x2sm";
959
+ }
960
+ }), se = {
961
+ props: o,
962
+ attrs: p,
963
+ slots: c,
964
+ emit: n,
965
+ fileList: Ne(a),
966
+ progressSize: Pe,
967
+ uploadableFiles: te,
968
+ uploadingFiles: X,
969
+ createRequest: Y,
970
+ resetRequest: Te,
971
+ canRunUpload: Se,
972
+ remove: Re,
973
+ goSize: $e,
974
+ addFiles: me
975
+ };
976
+ return Ze(se), t(se), (i, h) => (b(), O(pe, null, [
977
+ i.noTrigger ? R("", !0) : (b(), z(gt, {
978
+ key: 0,
979
+ multiple: i.multiple,
980
+ directory: i.directory,
981
+ disabled: i.disabled,
982
+ accept: S.value,
983
+ onAddFiles: me
984
+ }, {
985
+ default: Q((k) => [
986
+ ae(i.$slots, "default", re(le(k)))
987
+ ]),
988
+ _: 3
989
+ }, 8, ["multiple", "directory", "disabled", "accept"])),
990
+ ae(i.$slots, "list", re(le(se)), () => [
991
+ E(ut)
992
+ ])
993
+ ], 64));
994
+ }
995
+ });
996
+ export {
997
+ tt as U,
998
+ Lt as _,
999
+ gt as a,
1000
+ Z as b,
1001
+ F as c,
1002
+ ze as d,
1003
+ Fe as e,
1004
+ st as f,
1005
+ K as i,
1006
+ Ze as p,
1007
+ xe as u
1008
+ };