@huyooo/file-explorer-frontend-vue 0.4.2
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/dist/components/Breadcrumb.vue.d.ts +11 -0
- package/dist/components/Breadcrumb.vue.d.ts.map +1 -0
- package/dist/components/CompressDialog.vue.d.ts +16 -0
- package/dist/components/CompressDialog.vue.d.ts.map +1 -0
- package/dist/components/ContextMenu.vue.d.ts +18 -0
- package/dist/components/ContextMenu.vue.d.ts.map +1 -0
- package/dist/components/FileGrid.vue.d.ts +40 -0
- package/dist/components/FileGrid.vue.d.ts.map +1 -0
- package/dist/components/FileIcon.vue.d.ts +13 -0
- package/dist/components/FileIcon.vue.d.ts.map +1 -0
- package/dist/components/FileInfoDialog.vue.d.ts +14 -0
- package/dist/components/FileInfoDialog.vue.d.ts.map +1 -0
- package/dist/components/FileList.vue.d.ts +37 -0
- package/dist/components/FileList.vue.d.ts.map +1 -0
- package/dist/components/FileListView.vue.d.ts +43 -0
- package/dist/components/FileListView.vue.d.ts.map +1 -0
- package/dist/components/FileSidebar.vue.d.ts +17 -0
- package/dist/components/FileSidebar.vue.d.ts.map +1 -0
- package/dist/components/ProgressDialog.vue.d.ts +28 -0
- package/dist/components/ProgressDialog.vue.d.ts.map +1 -0
- package/dist/components/SortIndicator.vue.d.ts +6 -0
- package/dist/components/SortIndicator.vue.d.ts.map +1 -0
- package/dist/components/StatusBar.vue.d.ts +27 -0
- package/dist/components/StatusBar.vue.d.ts.map +1 -0
- package/dist/components/Toolbar.vue.d.ts +60 -0
- package/dist/components/Toolbar.vue.d.ts.map +1 -0
- package/dist/components/Window.vue.d.ts +65 -0
- package/dist/components/Window.vue.d.ts.map +1 -0
- package/dist/composables/useApplicationIcon.d.ts +16 -0
- package/dist/composables/useApplicationIcon.d.ts.map +1 -0
- package/dist/composables/useDragAndDrop.d.ts +14 -0
- package/dist/composables/useDragAndDrop.d.ts.map +1 -0
- package/dist/composables/useMediaPlayer.d.ts +24 -0
- package/dist/composables/useMediaPlayer.d.ts.map +1 -0
- package/dist/composables/useSelection.d.ts +15 -0
- package/dist/composables/useSelection.d.ts.map +1 -0
- package/dist/composables/useWindowDrag.d.ts +18 -0
- package/dist/composables/useWindowDrag.d.ts.map +1 -0
- package/dist/composables/useWindowResize.d.ts +12 -0
- package/dist/composables/useWindowResize.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4051 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +268 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/fileTypeIcon.d.ts +6 -0
- package/dist/utils/fileTypeIcon.d.ts.map +1 -0
- package/dist/utils/folderTypeIcon.d.ts +14 -0
- package/dist/utils/folderTypeIcon.d.ts.map +1 -0
- package/package.json +55 -0
- package/src/components/Breadcrumb.vue +111 -0
- package/src/components/CompressDialog.vue +478 -0
- package/src/components/ContextMenu.vue +550 -0
- package/src/components/FileGrid.vue +504 -0
- package/src/components/FileIcon.vue +132 -0
- package/src/components/FileInfoDialog.vue +465 -0
- package/src/components/FileList.vue +421 -0
- package/src/components/FileListView.vue +321 -0
- package/src/components/FileSidebar.vue +158 -0
- package/src/components/ProgressDialog.vue +368 -0
- package/src/components/SortIndicator.vue +22 -0
- package/src/components/StatusBar.vue +43 -0
- package/src/components/Toolbar.vue +271 -0
- package/src/components/Window.vue +561 -0
- package/src/composables/useApplicationIcon.ts +79 -0
- package/src/composables/useDragAndDrop.ts +103 -0
- package/src/composables/useMediaPlayer.ts +174 -0
- package/src/composables/useSelection.ts +107 -0
- package/src/composables/useWindowDrag.ts +66 -0
- package/src/composables/useWindowResize.ts +134 -0
- package/src/index.ts +32 -0
- package/src/types/index.ts +273 -0
- package/src/utils/fileTypeIcon.ts +309 -0
- package/src/utils/folderTypeIcon.ts +132 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4051 @@
|
|
|
1
|
+
import { defineComponent as G, ref as M, shallowRef as ft, onMounted as Me, watch as J, onUnmounted as se, h as Le, nextTick as Se, computed as U, createElementBlock as x, openBlock as h, normalizeClass as B, createVNode as N, unref as P, withModifiers as H, Fragment as q, renderList as Y, createElementVNode as u, createBlock as W, createCommentVNode as O, withKeys as he, toDisplayString as T, createTextVNode as te, renderSlot as ee, Teleport as ae, normalizeStyle as ve, withDirectives as ie, vModelText as mt, vModelSelect as pt, vModelRadio as gt, vModelDynamic as ht, vModelCheckbox as vt, resolveDynamicComponent as bt } from "vue";
|
|
2
|
+
import { FolderOpen as Ye, X as ye, Minus as yt, Maximize2 as wt, Archive as Je, FileArchive as kt, XCircle as xt, CheckCircle as It, Loader2 as Ct, File as $t, HardDrive as Et, MapPin as Pe, Clock as jt } from "lucide-vue-next";
|
|
3
|
+
const w = {
|
|
4
|
+
FOLDER: "folder",
|
|
5
|
+
FILE: "file",
|
|
6
|
+
IMAGE: "image",
|
|
7
|
+
VIDEO: "video",
|
|
8
|
+
MUSIC: "music",
|
|
9
|
+
DOCUMENT: "document",
|
|
10
|
+
CODE: "code",
|
|
11
|
+
TEXT: "text",
|
|
12
|
+
PDF: "pdf",
|
|
13
|
+
ARCHIVE: "archive",
|
|
14
|
+
APPLICATION: "application",
|
|
15
|
+
UNKNOWN: "unknown"
|
|
16
|
+
}, Ze = /^[a-z0-9]+(-[a-z0-9]+)*$/, we = (e, s, t, i = "") => {
|
|
17
|
+
const n = e.split(":");
|
|
18
|
+
if (e.slice(0, 1) === "@") {
|
|
19
|
+
if (n.length < 2 || n.length > 3)
|
|
20
|
+
return null;
|
|
21
|
+
i = n.shift().slice(1);
|
|
22
|
+
}
|
|
23
|
+
if (n.length > 3 || !n.length)
|
|
24
|
+
return null;
|
|
25
|
+
if (n.length > 1) {
|
|
26
|
+
const p = n.pop(), c = n.pop(), a = {
|
|
27
|
+
// Allow provider without '@': "provider:prefix:name"
|
|
28
|
+
provider: n.length > 0 ? n[0] : i,
|
|
29
|
+
prefix: c,
|
|
30
|
+
name: p
|
|
31
|
+
};
|
|
32
|
+
return s && !me(a) ? null : a;
|
|
33
|
+
}
|
|
34
|
+
const o = n[0], l = o.split("-");
|
|
35
|
+
if (l.length > 1) {
|
|
36
|
+
const p = {
|
|
37
|
+
provider: i,
|
|
38
|
+
prefix: l.shift(),
|
|
39
|
+
name: l.join("-")
|
|
40
|
+
};
|
|
41
|
+
return s && !me(p) ? null : p;
|
|
42
|
+
}
|
|
43
|
+
if (t && i === "") {
|
|
44
|
+
const p = {
|
|
45
|
+
provider: i,
|
|
46
|
+
prefix: "",
|
|
47
|
+
name: o
|
|
48
|
+
};
|
|
49
|
+
return s && !me(p, t) ? null : p;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}, me = (e, s) => e ? !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
|
|
53
|
+
// Check name: cannot be empty
|
|
54
|
+
((s && e.prefix === "" || e.prefix) && e.name) : !1, et = Object.freeze(
|
|
55
|
+
{
|
|
56
|
+
left: 0,
|
|
57
|
+
top: 0,
|
|
58
|
+
width: 16,
|
|
59
|
+
height: 16
|
|
60
|
+
}
|
|
61
|
+
), be = Object.freeze({
|
|
62
|
+
rotate: 0,
|
|
63
|
+
vFlip: !1,
|
|
64
|
+
hFlip: !1
|
|
65
|
+
}), ke = Object.freeze({
|
|
66
|
+
...et,
|
|
67
|
+
...be
|
|
68
|
+
}), Ce = Object.freeze({
|
|
69
|
+
...ke,
|
|
70
|
+
body: "",
|
|
71
|
+
hidden: !1
|
|
72
|
+
});
|
|
73
|
+
function Mt(e, s) {
|
|
74
|
+
const t = {};
|
|
75
|
+
!e.hFlip != !s.hFlip && (t.hFlip = !0), !e.vFlip != !s.vFlip && (t.vFlip = !0);
|
|
76
|
+
const i = ((e.rotate || 0) + (s.rotate || 0)) % 4;
|
|
77
|
+
return i && (t.rotate = i), t;
|
|
78
|
+
}
|
|
79
|
+
function Ae(e, s) {
|
|
80
|
+
const t = Mt(e, s);
|
|
81
|
+
for (const i in Ce)
|
|
82
|
+
i in be ? i in e && !(i in t) && (t[i] = be[i]) : i in s ? t[i] = s[i] : i in e && (t[i] = e[i]);
|
|
83
|
+
return t;
|
|
84
|
+
}
|
|
85
|
+
function St(e, s) {
|
|
86
|
+
const t = e.icons, i = e.aliases || /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null);
|
|
87
|
+
function o(l) {
|
|
88
|
+
if (t[l])
|
|
89
|
+
return n[l] = [];
|
|
90
|
+
if (!(l in n)) {
|
|
91
|
+
n[l] = null;
|
|
92
|
+
const p = i[l] && i[l].parent, c = p && o(p);
|
|
93
|
+
c && (n[l] = [p].concat(c));
|
|
94
|
+
}
|
|
95
|
+
return n[l];
|
|
96
|
+
}
|
|
97
|
+
return Object.keys(t).concat(Object.keys(i)).forEach(o), n;
|
|
98
|
+
}
|
|
99
|
+
function Dt(e, s, t) {
|
|
100
|
+
const i = e.icons, n = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
101
|
+
let o = {};
|
|
102
|
+
function l(p) {
|
|
103
|
+
o = Ae(
|
|
104
|
+
i[p] || n[p],
|
|
105
|
+
o
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
return l(s), t.forEach(l), Ae(e, o);
|
|
109
|
+
}
|
|
110
|
+
function tt(e, s) {
|
|
111
|
+
const t = [];
|
|
112
|
+
if (typeof e != "object" || typeof e.icons != "object")
|
|
113
|
+
return t;
|
|
114
|
+
e.not_found instanceof Array && e.not_found.forEach((n) => {
|
|
115
|
+
s(n, null), t.push(n);
|
|
116
|
+
});
|
|
117
|
+
const i = St(e);
|
|
118
|
+
for (const n in i) {
|
|
119
|
+
const o = i[n];
|
|
120
|
+
o && (s(n, Dt(e, n, o)), t.push(n));
|
|
121
|
+
}
|
|
122
|
+
return t;
|
|
123
|
+
}
|
|
124
|
+
const zt = {
|
|
125
|
+
provider: "",
|
|
126
|
+
aliases: {},
|
|
127
|
+
not_found: {},
|
|
128
|
+
...et
|
|
129
|
+
};
|
|
130
|
+
function xe(e, s) {
|
|
131
|
+
for (const t in s)
|
|
132
|
+
if (t in e && typeof e[t] != typeof s[t])
|
|
133
|
+
return !1;
|
|
134
|
+
return !0;
|
|
135
|
+
}
|
|
136
|
+
function nt(e) {
|
|
137
|
+
if (typeof e != "object" || e === null)
|
|
138
|
+
return null;
|
|
139
|
+
const s = e;
|
|
140
|
+
if (typeof s.prefix != "string" || !e.icons || typeof e.icons != "object" || !xe(e, zt))
|
|
141
|
+
return null;
|
|
142
|
+
const t = s.icons;
|
|
143
|
+
for (const n in t) {
|
|
144
|
+
const o = t[n];
|
|
145
|
+
if (
|
|
146
|
+
// Name cannot be empty
|
|
147
|
+
!n || // Must have body
|
|
148
|
+
typeof o.body != "string" || // Check other props
|
|
149
|
+
!xe(
|
|
150
|
+
o,
|
|
151
|
+
Ce
|
|
152
|
+
)
|
|
153
|
+
)
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
const i = s.aliases || /* @__PURE__ */ Object.create(null);
|
|
157
|
+
for (const n in i) {
|
|
158
|
+
const o = i[n], l = o.parent;
|
|
159
|
+
if (
|
|
160
|
+
// Name cannot be empty
|
|
161
|
+
!n || // Parent must be set and point to existing icon
|
|
162
|
+
typeof l != "string" || !t[l] && !i[l] || // Check other props
|
|
163
|
+
!xe(
|
|
164
|
+
o,
|
|
165
|
+
Ce
|
|
166
|
+
)
|
|
167
|
+
)
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
return s;
|
|
171
|
+
}
|
|
172
|
+
const Fe = /* @__PURE__ */ Object.create(null);
|
|
173
|
+
function Ot(e, s) {
|
|
174
|
+
return {
|
|
175
|
+
provider: e,
|
|
176
|
+
prefix: s,
|
|
177
|
+
icons: /* @__PURE__ */ Object.create(null),
|
|
178
|
+
missing: /* @__PURE__ */ new Set()
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function ne(e, s) {
|
|
182
|
+
const t = Fe[e] || (Fe[e] = /* @__PURE__ */ Object.create(null));
|
|
183
|
+
return t[s] || (t[s] = Ot(e, s));
|
|
184
|
+
}
|
|
185
|
+
function st(e, s) {
|
|
186
|
+
return nt(s) ? tt(s, (t, i) => {
|
|
187
|
+
i ? e.icons[t] = i : e.missing.add(t);
|
|
188
|
+
}) : [];
|
|
189
|
+
}
|
|
190
|
+
function Tt(e, s, t) {
|
|
191
|
+
try {
|
|
192
|
+
if (typeof t.body == "string")
|
|
193
|
+
return e.icons[s] = { ...t }, !0;
|
|
194
|
+
} catch {
|
|
195
|
+
}
|
|
196
|
+
return !1;
|
|
197
|
+
}
|
|
198
|
+
let re = !1;
|
|
199
|
+
function it(e) {
|
|
200
|
+
return typeof e == "boolean" && (re = e), re;
|
|
201
|
+
}
|
|
202
|
+
function Lt(e) {
|
|
203
|
+
const s = typeof e == "string" ? we(e, !0, re) : e;
|
|
204
|
+
if (s) {
|
|
205
|
+
const t = ne(s.provider, s.prefix), i = s.name;
|
|
206
|
+
return t.icons[i] || (t.missing.has(i) ? null : void 0);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function Pt(e, s) {
|
|
210
|
+
const t = we(e, !0, re);
|
|
211
|
+
if (!t)
|
|
212
|
+
return !1;
|
|
213
|
+
const i = ne(t.provider, t.prefix);
|
|
214
|
+
return s ? Tt(i, t.name, s) : (i.missing.add(t.name), !0);
|
|
215
|
+
}
|
|
216
|
+
function At(e, s) {
|
|
217
|
+
if (typeof e != "object")
|
|
218
|
+
return !1;
|
|
219
|
+
if (typeof s != "string" && (s = e.provider || ""), re && !s && !e.prefix) {
|
|
220
|
+
let n = !1;
|
|
221
|
+
return nt(e) && (e.prefix = "", tt(e, (o, l) => {
|
|
222
|
+
Pt(o, l) && (n = !0);
|
|
223
|
+
})), n;
|
|
224
|
+
}
|
|
225
|
+
const t = e.prefix;
|
|
226
|
+
if (!me({
|
|
227
|
+
prefix: t,
|
|
228
|
+
name: "a"
|
|
229
|
+
}))
|
|
230
|
+
return !1;
|
|
231
|
+
const i = ne(s, t);
|
|
232
|
+
return !!st(i, e);
|
|
233
|
+
}
|
|
234
|
+
const ot = Object.freeze({
|
|
235
|
+
width: null,
|
|
236
|
+
height: null
|
|
237
|
+
}), lt = Object.freeze({
|
|
238
|
+
// Dimensions
|
|
239
|
+
...ot,
|
|
240
|
+
// Transformations
|
|
241
|
+
...be
|
|
242
|
+
}), Ft = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Nt = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
243
|
+
function Ne(e, s, t) {
|
|
244
|
+
if (s === 1)
|
|
245
|
+
return e;
|
|
246
|
+
if (t = t || 100, typeof e == "number")
|
|
247
|
+
return Math.ceil(e * s * t) / t;
|
|
248
|
+
if (typeof e != "string")
|
|
249
|
+
return e;
|
|
250
|
+
const i = e.split(Ft);
|
|
251
|
+
if (i === null || !i.length)
|
|
252
|
+
return e;
|
|
253
|
+
const n = [];
|
|
254
|
+
let o = i.shift(), l = Nt.test(o);
|
|
255
|
+
for (; ; ) {
|
|
256
|
+
if (l) {
|
|
257
|
+
const p = parseFloat(o);
|
|
258
|
+
isNaN(p) ? n.push(o) : n.push(Math.ceil(p * s * t) / t);
|
|
259
|
+
} else
|
|
260
|
+
n.push(o);
|
|
261
|
+
if (o = i.shift(), o === void 0)
|
|
262
|
+
return n.join("");
|
|
263
|
+
l = !l;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function Ut(e, s = "defs") {
|
|
267
|
+
let t = "";
|
|
268
|
+
const i = e.indexOf("<" + s);
|
|
269
|
+
for (; i >= 0; ) {
|
|
270
|
+
const n = e.indexOf(">", i), o = e.indexOf("</" + s);
|
|
271
|
+
if (n === -1 || o === -1)
|
|
272
|
+
break;
|
|
273
|
+
const l = e.indexOf(">", o);
|
|
274
|
+
if (l === -1)
|
|
275
|
+
break;
|
|
276
|
+
t += e.slice(n + 1, o).trim(), e = e.slice(0, i).trim() + e.slice(l + 1);
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
defs: t,
|
|
280
|
+
content: e
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
function Rt(e, s) {
|
|
284
|
+
return e ? "<defs>" + e + "</defs>" + s : s;
|
|
285
|
+
}
|
|
286
|
+
function Ht(e, s, t) {
|
|
287
|
+
const i = Ut(e);
|
|
288
|
+
return Rt(i.defs, s + i.content + t);
|
|
289
|
+
}
|
|
290
|
+
const Wt = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
291
|
+
function Bt(e, s) {
|
|
292
|
+
const t = {
|
|
293
|
+
...ke,
|
|
294
|
+
...e
|
|
295
|
+
}, i = {
|
|
296
|
+
...lt,
|
|
297
|
+
...s
|
|
298
|
+
}, n = {
|
|
299
|
+
left: t.left,
|
|
300
|
+
top: t.top,
|
|
301
|
+
width: t.width,
|
|
302
|
+
height: t.height
|
|
303
|
+
};
|
|
304
|
+
let o = t.body;
|
|
305
|
+
[t, i].forEach((b) => {
|
|
306
|
+
const y = [], S = b.hFlip, z = b.vFlip;
|
|
307
|
+
let C = b.rotate;
|
|
308
|
+
S ? z ? C += 2 : (y.push(
|
|
309
|
+
"translate(" + (n.width + n.left).toString() + " " + (0 - n.top).toString() + ")"
|
|
310
|
+
), y.push("scale(-1 1)"), n.top = n.left = 0) : z && (y.push(
|
|
311
|
+
"translate(" + (0 - n.left).toString() + " " + (n.height + n.top).toString() + ")"
|
|
312
|
+
), y.push("scale(1 -1)"), n.top = n.left = 0);
|
|
313
|
+
let v;
|
|
314
|
+
switch (C < 0 && (C -= Math.floor(C / 4) * 4), C = C % 4, C) {
|
|
315
|
+
case 1:
|
|
316
|
+
v = n.height / 2 + n.top, y.unshift(
|
|
317
|
+
"rotate(90 " + v.toString() + " " + v.toString() + ")"
|
|
318
|
+
);
|
|
319
|
+
break;
|
|
320
|
+
case 2:
|
|
321
|
+
y.unshift(
|
|
322
|
+
"rotate(180 " + (n.width / 2 + n.left).toString() + " " + (n.height / 2 + n.top).toString() + ")"
|
|
323
|
+
);
|
|
324
|
+
break;
|
|
325
|
+
case 3:
|
|
326
|
+
v = n.width / 2 + n.left, y.unshift(
|
|
327
|
+
"rotate(-90 " + v.toString() + " " + v.toString() + ")"
|
|
328
|
+
);
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
C % 2 === 1 && (n.left !== n.top && (v = n.left, n.left = n.top, n.top = v), n.width !== n.height && (v = n.width, n.width = n.height, n.height = v)), y.length && (o = Ht(
|
|
332
|
+
o,
|
|
333
|
+
'<g transform="' + y.join(" ") + '">',
|
|
334
|
+
"</g>"
|
|
335
|
+
));
|
|
336
|
+
});
|
|
337
|
+
const l = i.width, p = i.height, c = n.width, a = n.height;
|
|
338
|
+
let d, f;
|
|
339
|
+
l === null ? (f = p === null ? "1em" : p === "auto" ? a : p, d = Ne(f, c / a)) : (d = l === "auto" ? c : l, f = p === null ? Ne(d, a / c) : p === "auto" ? a : p);
|
|
340
|
+
const r = {}, I = (b, y) => {
|
|
341
|
+
Wt(y) || (r[b] = y.toString());
|
|
342
|
+
};
|
|
343
|
+
I("width", d), I("height", f);
|
|
344
|
+
const g = [n.left, n.top, c, a];
|
|
345
|
+
return r.viewBox = g.join(" "), {
|
|
346
|
+
attributes: r,
|
|
347
|
+
viewBox: g,
|
|
348
|
+
body: o
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
const Vt = /\sid="(\S+)"/g, _t = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
352
|
+
let qt = 0;
|
|
353
|
+
function Gt(e, s = _t) {
|
|
354
|
+
const t = [];
|
|
355
|
+
let i;
|
|
356
|
+
for (; i = Vt.exec(e); )
|
|
357
|
+
t.push(i[1]);
|
|
358
|
+
if (!t.length)
|
|
359
|
+
return e;
|
|
360
|
+
const n = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
361
|
+
return t.forEach((o) => {
|
|
362
|
+
const l = typeof s == "function" ? s(o) : s + (qt++).toString(), p = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
363
|
+
e = e.replace(
|
|
364
|
+
// Allowed characters before id: [#;"]
|
|
365
|
+
// Allowed characters after id: [)"], .[a-z]
|
|
366
|
+
new RegExp('([#;"])(' + p + ')([")]|\\.[a-z])', "g"),
|
|
367
|
+
"$1" + l + n + "$3"
|
|
368
|
+
);
|
|
369
|
+
}), e = e.replace(new RegExp(n, "g"), ""), e;
|
|
370
|
+
}
|
|
371
|
+
const $e = /* @__PURE__ */ Object.create(null);
|
|
372
|
+
function Kt(e, s) {
|
|
373
|
+
$e[e] = s;
|
|
374
|
+
}
|
|
375
|
+
function Ee(e) {
|
|
376
|
+
return $e[e] || $e[""];
|
|
377
|
+
}
|
|
378
|
+
function De(e) {
|
|
379
|
+
let s;
|
|
380
|
+
if (typeof e.resources == "string")
|
|
381
|
+
s = [e.resources];
|
|
382
|
+
else if (s = e.resources, !(s instanceof Array) || !s.length)
|
|
383
|
+
return null;
|
|
384
|
+
return {
|
|
385
|
+
// API hosts
|
|
386
|
+
resources: s,
|
|
387
|
+
// Root path
|
|
388
|
+
path: e.path || "/",
|
|
389
|
+
// URL length limit
|
|
390
|
+
maxURL: e.maxURL || 500,
|
|
391
|
+
// Timeout before next host is used.
|
|
392
|
+
rotate: e.rotate || 750,
|
|
393
|
+
// Timeout before failing query.
|
|
394
|
+
timeout: e.timeout || 5e3,
|
|
395
|
+
// Randomise default API end point.
|
|
396
|
+
random: e.random === !0,
|
|
397
|
+
// Start index
|
|
398
|
+
index: e.index || 0,
|
|
399
|
+
// Receive data after time out (used if time out kicks in first, then API module sends data anyway).
|
|
400
|
+
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
const ze = /* @__PURE__ */ Object.create(null), oe = [
|
|
404
|
+
"https://api.simplesvg.com",
|
|
405
|
+
"https://api.unisvg.com"
|
|
406
|
+
], pe = [];
|
|
407
|
+
for (; oe.length > 0; )
|
|
408
|
+
oe.length === 1 || Math.random() > 0.5 ? pe.push(oe.shift()) : pe.push(oe.pop());
|
|
409
|
+
ze[""] = De({
|
|
410
|
+
resources: ["https://api.iconify.design"].concat(pe)
|
|
411
|
+
});
|
|
412
|
+
function Qt(e, s) {
|
|
413
|
+
const t = De(s);
|
|
414
|
+
return t === null ? !1 : (ze[e] = t, !0);
|
|
415
|
+
}
|
|
416
|
+
function Oe(e) {
|
|
417
|
+
return ze[e];
|
|
418
|
+
}
|
|
419
|
+
const Xt = () => {
|
|
420
|
+
let e;
|
|
421
|
+
try {
|
|
422
|
+
if (e = fetch, typeof e == "function")
|
|
423
|
+
return e;
|
|
424
|
+
} catch {
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
let Ue = Xt();
|
|
428
|
+
function Yt(e, s) {
|
|
429
|
+
const t = Oe(e);
|
|
430
|
+
if (!t)
|
|
431
|
+
return 0;
|
|
432
|
+
let i;
|
|
433
|
+
if (!t.maxURL)
|
|
434
|
+
i = 0;
|
|
435
|
+
else {
|
|
436
|
+
let n = 0;
|
|
437
|
+
t.resources.forEach((l) => {
|
|
438
|
+
n = Math.max(n, l.length);
|
|
439
|
+
});
|
|
440
|
+
const o = s + ".json?icons=";
|
|
441
|
+
i = t.maxURL - n - t.path.length - o.length;
|
|
442
|
+
}
|
|
443
|
+
return i;
|
|
444
|
+
}
|
|
445
|
+
function Jt(e) {
|
|
446
|
+
return e === 404;
|
|
447
|
+
}
|
|
448
|
+
const Zt = (e, s, t) => {
|
|
449
|
+
const i = [], n = Yt(e, s), o = "icons";
|
|
450
|
+
let l = {
|
|
451
|
+
type: o,
|
|
452
|
+
provider: e,
|
|
453
|
+
prefix: s,
|
|
454
|
+
icons: []
|
|
455
|
+
}, p = 0;
|
|
456
|
+
return t.forEach((c, a) => {
|
|
457
|
+
p += c.length + 1, p >= n && a > 0 && (i.push(l), l = {
|
|
458
|
+
type: o,
|
|
459
|
+
provider: e,
|
|
460
|
+
prefix: s,
|
|
461
|
+
icons: []
|
|
462
|
+
}, p = c.length), l.icons.push(c);
|
|
463
|
+
}), i.push(l), i;
|
|
464
|
+
};
|
|
465
|
+
function en(e) {
|
|
466
|
+
if (typeof e == "string") {
|
|
467
|
+
const s = Oe(e);
|
|
468
|
+
if (s)
|
|
469
|
+
return s.path;
|
|
470
|
+
}
|
|
471
|
+
return "/";
|
|
472
|
+
}
|
|
473
|
+
const tn = (e, s, t) => {
|
|
474
|
+
if (!Ue) {
|
|
475
|
+
t("abort", 424);
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
let i = en(s.provider);
|
|
479
|
+
switch (s.type) {
|
|
480
|
+
case "icons": {
|
|
481
|
+
const o = s.prefix, p = s.icons.join(","), c = new URLSearchParams({
|
|
482
|
+
icons: p
|
|
483
|
+
});
|
|
484
|
+
i += o + ".json?" + c.toString();
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
case "custom": {
|
|
488
|
+
const o = s.uri;
|
|
489
|
+
i += o.slice(0, 1) === "/" ? o.slice(1) : o;
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
492
|
+
default:
|
|
493
|
+
t("abort", 400);
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
let n = 503;
|
|
497
|
+
Ue(e + i).then((o) => {
|
|
498
|
+
const l = o.status;
|
|
499
|
+
if (l !== 200) {
|
|
500
|
+
setTimeout(() => {
|
|
501
|
+
t(Jt(l) ? "abort" : "next", l);
|
|
502
|
+
});
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
return n = 501, o.json();
|
|
506
|
+
}).then((o) => {
|
|
507
|
+
if (typeof o != "object" || o === null) {
|
|
508
|
+
setTimeout(() => {
|
|
509
|
+
o === 404 ? t("abort", o) : t("next", n);
|
|
510
|
+
});
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
setTimeout(() => {
|
|
514
|
+
t("success", o);
|
|
515
|
+
});
|
|
516
|
+
}).catch(() => {
|
|
517
|
+
t("next", n);
|
|
518
|
+
});
|
|
519
|
+
}, nn = {
|
|
520
|
+
prepare: Zt,
|
|
521
|
+
send: tn
|
|
522
|
+
};
|
|
523
|
+
function sn(e) {
|
|
524
|
+
const s = {
|
|
525
|
+
loaded: [],
|
|
526
|
+
missing: [],
|
|
527
|
+
pending: []
|
|
528
|
+
}, t = /* @__PURE__ */ Object.create(null);
|
|
529
|
+
e.sort((n, o) => n.provider !== o.provider ? n.provider.localeCompare(o.provider) : n.prefix !== o.prefix ? n.prefix.localeCompare(o.prefix) : n.name.localeCompare(o.name));
|
|
530
|
+
let i = {
|
|
531
|
+
provider: "",
|
|
532
|
+
prefix: "",
|
|
533
|
+
name: ""
|
|
534
|
+
};
|
|
535
|
+
return e.forEach((n) => {
|
|
536
|
+
if (i.name === n.name && i.prefix === n.prefix && i.provider === n.provider)
|
|
537
|
+
return;
|
|
538
|
+
i = n;
|
|
539
|
+
const o = n.provider, l = n.prefix, p = n.name, c = t[o] || (t[o] = /* @__PURE__ */ Object.create(null)), a = c[l] || (c[l] = ne(o, l));
|
|
540
|
+
let d;
|
|
541
|
+
p in a.icons ? d = s.loaded : l === "" || a.missing.has(p) ? d = s.missing : d = s.pending;
|
|
542
|
+
const f = {
|
|
543
|
+
provider: o,
|
|
544
|
+
prefix: l,
|
|
545
|
+
name: p
|
|
546
|
+
};
|
|
547
|
+
d.push(f);
|
|
548
|
+
}), s;
|
|
549
|
+
}
|
|
550
|
+
function rt(e, s) {
|
|
551
|
+
e.forEach((t) => {
|
|
552
|
+
const i = t.loaderCallbacks;
|
|
553
|
+
i && (t.loaderCallbacks = i.filter((n) => n.id !== s));
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
function on(e) {
|
|
557
|
+
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
558
|
+
e.pendingCallbacksFlag = !1;
|
|
559
|
+
const s = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
560
|
+
if (!s.length)
|
|
561
|
+
return;
|
|
562
|
+
let t = !1;
|
|
563
|
+
const i = e.provider, n = e.prefix;
|
|
564
|
+
s.forEach((o) => {
|
|
565
|
+
const l = o.icons, p = l.pending.length;
|
|
566
|
+
l.pending = l.pending.filter((c) => {
|
|
567
|
+
if (c.prefix !== n)
|
|
568
|
+
return !0;
|
|
569
|
+
const a = c.name;
|
|
570
|
+
if (e.icons[a])
|
|
571
|
+
l.loaded.push({
|
|
572
|
+
provider: i,
|
|
573
|
+
prefix: n,
|
|
574
|
+
name: a
|
|
575
|
+
});
|
|
576
|
+
else if (e.missing.has(a))
|
|
577
|
+
l.missing.push({
|
|
578
|
+
provider: i,
|
|
579
|
+
prefix: n,
|
|
580
|
+
name: a
|
|
581
|
+
});
|
|
582
|
+
else
|
|
583
|
+
return t = !0, !0;
|
|
584
|
+
return !1;
|
|
585
|
+
}), l.pending.length !== p && (t || rt([e], o.id), o.callback(
|
|
586
|
+
l.loaded.slice(0),
|
|
587
|
+
l.missing.slice(0),
|
|
588
|
+
l.pending.slice(0),
|
|
589
|
+
o.abort
|
|
590
|
+
));
|
|
591
|
+
});
|
|
592
|
+
}));
|
|
593
|
+
}
|
|
594
|
+
let ln = 0;
|
|
595
|
+
function rn(e, s, t) {
|
|
596
|
+
const i = ln++, n = rt.bind(null, t, i);
|
|
597
|
+
if (!s.pending.length)
|
|
598
|
+
return n;
|
|
599
|
+
const o = {
|
|
600
|
+
id: i,
|
|
601
|
+
icons: s,
|
|
602
|
+
callback: e,
|
|
603
|
+
abort: n
|
|
604
|
+
};
|
|
605
|
+
return t.forEach((l) => {
|
|
606
|
+
(l.loaderCallbacks || (l.loaderCallbacks = [])).push(o);
|
|
607
|
+
}), n;
|
|
608
|
+
}
|
|
609
|
+
function an(e, s = !0, t = !1) {
|
|
610
|
+
const i = [];
|
|
611
|
+
return e.forEach((n) => {
|
|
612
|
+
const o = typeof n == "string" ? we(n, s, t) : n;
|
|
613
|
+
o && i.push(o);
|
|
614
|
+
}), i;
|
|
615
|
+
}
|
|
616
|
+
var cn = {
|
|
617
|
+
resources: [],
|
|
618
|
+
index: 0,
|
|
619
|
+
timeout: 2e3,
|
|
620
|
+
rotate: 750,
|
|
621
|
+
random: !1,
|
|
622
|
+
dataAfterTimeout: !1
|
|
623
|
+
};
|
|
624
|
+
function un(e, s, t, i) {
|
|
625
|
+
const n = e.resources.length, o = e.random ? Math.floor(Math.random() * n) : e.index;
|
|
626
|
+
let l;
|
|
627
|
+
if (e.random) {
|
|
628
|
+
let j = e.resources.slice(0);
|
|
629
|
+
for (l = []; j.length > 1; ) {
|
|
630
|
+
const m = Math.floor(Math.random() * j.length);
|
|
631
|
+
l.push(j[m]), j = j.slice(0, m).concat(j.slice(m + 1));
|
|
632
|
+
}
|
|
633
|
+
l = l.concat(j);
|
|
634
|
+
} else
|
|
635
|
+
l = e.resources.slice(o).concat(e.resources.slice(0, o));
|
|
636
|
+
const p = Date.now();
|
|
637
|
+
let c = "pending", a = 0, d, f = null, r = [], I = [];
|
|
638
|
+
typeof i == "function" && I.push(i);
|
|
639
|
+
function g() {
|
|
640
|
+
f && (clearTimeout(f), f = null);
|
|
641
|
+
}
|
|
642
|
+
function b() {
|
|
643
|
+
c === "pending" && (c = "aborted"), g(), r.forEach((j) => {
|
|
644
|
+
j.status === "pending" && (j.status = "aborted");
|
|
645
|
+
}), r = [];
|
|
646
|
+
}
|
|
647
|
+
function y(j, m) {
|
|
648
|
+
m && (I = []), typeof j == "function" && I.push(j);
|
|
649
|
+
}
|
|
650
|
+
function S() {
|
|
651
|
+
return {
|
|
652
|
+
startTime: p,
|
|
653
|
+
payload: s,
|
|
654
|
+
status: c,
|
|
655
|
+
queriesSent: a,
|
|
656
|
+
queriesPending: r.length,
|
|
657
|
+
subscribe: y,
|
|
658
|
+
abort: b
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
function z() {
|
|
662
|
+
c = "failed", I.forEach((j) => {
|
|
663
|
+
j(void 0, d);
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
function C() {
|
|
667
|
+
r.forEach((j) => {
|
|
668
|
+
j.status === "pending" && (j.status = "aborted");
|
|
669
|
+
}), r = [];
|
|
670
|
+
}
|
|
671
|
+
function v(j, m, $) {
|
|
672
|
+
const k = m !== "success";
|
|
673
|
+
switch (r = r.filter((A) => A !== j), c) {
|
|
674
|
+
case "pending":
|
|
675
|
+
break;
|
|
676
|
+
case "failed":
|
|
677
|
+
if (k || !e.dataAfterTimeout)
|
|
678
|
+
return;
|
|
679
|
+
break;
|
|
680
|
+
default:
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
if (m === "abort") {
|
|
684
|
+
d = $, z();
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
if (k) {
|
|
688
|
+
d = $, r.length || (l.length ? L() : z());
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
if (g(), C(), !e.random) {
|
|
692
|
+
const A = e.resources.indexOf(j.resource);
|
|
693
|
+
A !== -1 && A !== e.index && (e.index = A);
|
|
694
|
+
}
|
|
695
|
+
c = "completed", I.forEach((A) => {
|
|
696
|
+
A($);
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
function L() {
|
|
700
|
+
if (c !== "pending")
|
|
701
|
+
return;
|
|
702
|
+
g();
|
|
703
|
+
const j = l.shift();
|
|
704
|
+
if (j === void 0) {
|
|
705
|
+
if (r.length) {
|
|
706
|
+
f = setTimeout(() => {
|
|
707
|
+
g(), c === "pending" && (C(), z());
|
|
708
|
+
}, e.timeout);
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
z();
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
const m = {
|
|
715
|
+
status: "pending",
|
|
716
|
+
resource: j,
|
|
717
|
+
callback: ($, k) => {
|
|
718
|
+
v(m, $, k);
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
r.push(m), a++, f = setTimeout(L, e.rotate), t(j, s, m.callback);
|
|
722
|
+
}
|
|
723
|
+
return setTimeout(L), S;
|
|
724
|
+
}
|
|
725
|
+
function at(e) {
|
|
726
|
+
const s = {
|
|
727
|
+
...cn,
|
|
728
|
+
...e
|
|
729
|
+
};
|
|
730
|
+
let t = [];
|
|
731
|
+
function i() {
|
|
732
|
+
t = t.filter((p) => p().status === "pending");
|
|
733
|
+
}
|
|
734
|
+
function n(p, c, a) {
|
|
735
|
+
const d = un(
|
|
736
|
+
s,
|
|
737
|
+
p,
|
|
738
|
+
c,
|
|
739
|
+
(f, r) => {
|
|
740
|
+
i(), a && a(f, r);
|
|
741
|
+
}
|
|
742
|
+
);
|
|
743
|
+
return t.push(d), d;
|
|
744
|
+
}
|
|
745
|
+
function o(p) {
|
|
746
|
+
return t.find((c) => p(c)) || null;
|
|
747
|
+
}
|
|
748
|
+
return {
|
|
749
|
+
query: n,
|
|
750
|
+
find: o,
|
|
751
|
+
setIndex: (p) => {
|
|
752
|
+
s.index = p;
|
|
753
|
+
},
|
|
754
|
+
getIndex: () => s.index,
|
|
755
|
+
cleanup: i
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
function Re() {
|
|
759
|
+
}
|
|
760
|
+
const Ie = /* @__PURE__ */ Object.create(null);
|
|
761
|
+
function dn(e) {
|
|
762
|
+
if (!Ie[e]) {
|
|
763
|
+
const s = Oe(e);
|
|
764
|
+
if (!s)
|
|
765
|
+
return;
|
|
766
|
+
const t = at(s), i = {
|
|
767
|
+
config: s,
|
|
768
|
+
redundancy: t
|
|
769
|
+
};
|
|
770
|
+
Ie[e] = i;
|
|
771
|
+
}
|
|
772
|
+
return Ie[e];
|
|
773
|
+
}
|
|
774
|
+
function fn(e, s, t) {
|
|
775
|
+
let i, n;
|
|
776
|
+
if (typeof e == "string") {
|
|
777
|
+
const o = Ee(e);
|
|
778
|
+
if (!o)
|
|
779
|
+
return t(void 0, 424), Re;
|
|
780
|
+
n = o.send;
|
|
781
|
+
const l = dn(e);
|
|
782
|
+
l && (i = l.redundancy);
|
|
783
|
+
} else {
|
|
784
|
+
const o = De(e);
|
|
785
|
+
if (o) {
|
|
786
|
+
i = at(o);
|
|
787
|
+
const l = e.resources ? e.resources[0] : "", p = Ee(l);
|
|
788
|
+
p && (n = p.send);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
return !i || !n ? (t(void 0, 424), Re) : i.query(s, n, t)().abort;
|
|
792
|
+
}
|
|
793
|
+
function He() {
|
|
794
|
+
}
|
|
795
|
+
function mn(e) {
|
|
796
|
+
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
797
|
+
e.iconsLoaderFlag = !1, on(e);
|
|
798
|
+
}));
|
|
799
|
+
}
|
|
800
|
+
function pn(e) {
|
|
801
|
+
const s = [], t = [];
|
|
802
|
+
return e.forEach((i) => {
|
|
803
|
+
(i.match(Ze) ? s : t).push(i);
|
|
804
|
+
}), {
|
|
805
|
+
valid: s,
|
|
806
|
+
invalid: t
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
function le(e, s, t) {
|
|
810
|
+
function i() {
|
|
811
|
+
const n = e.pendingIcons;
|
|
812
|
+
s.forEach((o) => {
|
|
813
|
+
n && n.delete(o), e.icons[o] || e.missing.add(o);
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
if (t && typeof t == "object")
|
|
817
|
+
try {
|
|
818
|
+
if (!st(e, t).length) {
|
|
819
|
+
i();
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
} catch (n) {
|
|
823
|
+
console.error(n);
|
|
824
|
+
}
|
|
825
|
+
i(), mn(e);
|
|
826
|
+
}
|
|
827
|
+
function We(e, s) {
|
|
828
|
+
e instanceof Promise ? e.then((t) => {
|
|
829
|
+
s(t);
|
|
830
|
+
}).catch(() => {
|
|
831
|
+
s(null);
|
|
832
|
+
}) : s(e);
|
|
833
|
+
}
|
|
834
|
+
function gn(e, s) {
|
|
835
|
+
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(s).sort() : e.iconsToLoad = s, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
836
|
+
e.iconsQueueFlag = !1;
|
|
837
|
+
const { provider: t, prefix: i } = e, n = e.iconsToLoad;
|
|
838
|
+
if (delete e.iconsToLoad, !n || !n.length)
|
|
839
|
+
return;
|
|
840
|
+
const o = e.loadIcon;
|
|
841
|
+
if (e.loadIcons && (n.length > 1 || !o)) {
|
|
842
|
+
We(
|
|
843
|
+
e.loadIcons(n, i, t),
|
|
844
|
+
(d) => {
|
|
845
|
+
le(e, n, d);
|
|
846
|
+
}
|
|
847
|
+
);
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
if (o) {
|
|
851
|
+
n.forEach((d) => {
|
|
852
|
+
const f = o(d, i, t);
|
|
853
|
+
We(f, (r) => {
|
|
854
|
+
const I = r ? {
|
|
855
|
+
prefix: i,
|
|
856
|
+
icons: {
|
|
857
|
+
[d]: r
|
|
858
|
+
}
|
|
859
|
+
} : null;
|
|
860
|
+
le(e, [d], I);
|
|
861
|
+
});
|
|
862
|
+
});
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
const { valid: l, invalid: p } = pn(n);
|
|
866
|
+
if (p.length && le(e, p, null), !l.length)
|
|
867
|
+
return;
|
|
868
|
+
const c = i.match(Ze) ? Ee(t) : null;
|
|
869
|
+
if (!c) {
|
|
870
|
+
le(e, l, null);
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
c.prepare(t, i, l).forEach((d) => {
|
|
874
|
+
fn(t, d, (f) => {
|
|
875
|
+
le(e, d.icons, f);
|
|
876
|
+
});
|
|
877
|
+
});
|
|
878
|
+
}));
|
|
879
|
+
}
|
|
880
|
+
const hn = (e, s) => {
|
|
881
|
+
const t = an(e, !0, it()), i = sn(t);
|
|
882
|
+
if (!i.pending.length) {
|
|
883
|
+
let c = !0;
|
|
884
|
+
return s && setTimeout(() => {
|
|
885
|
+
c && s(
|
|
886
|
+
i.loaded,
|
|
887
|
+
i.missing,
|
|
888
|
+
i.pending,
|
|
889
|
+
He
|
|
890
|
+
);
|
|
891
|
+
}), () => {
|
|
892
|
+
c = !1;
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
const n = /* @__PURE__ */ Object.create(null), o = [];
|
|
896
|
+
let l, p;
|
|
897
|
+
return i.pending.forEach((c) => {
|
|
898
|
+
const { provider: a, prefix: d } = c;
|
|
899
|
+
if (d === p && a === l)
|
|
900
|
+
return;
|
|
901
|
+
l = a, p = d, o.push(ne(a, d));
|
|
902
|
+
const f = n[a] || (n[a] = /* @__PURE__ */ Object.create(null));
|
|
903
|
+
f[d] || (f[d] = []);
|
|
904
|
+
}), i.pending.forEach((c) => {
|
|
905
|
+
const { provider: a, prefix: d, name: f } = c, r = ne(a, d), I = r.pendingIcons || (r.pendingIcons = /* @__PURE__ */ new Set());
|
|
906
|
+
I.has(f) || (I.add(f), n[a][d].push(f));
|
|
907
|
+
}), o.forEach((c) => {
|
|
908
|
+
const a = n[c.provider][c.prefix];
|
|
909
|
+
a.length && gn(c, a);
|
|
910
|
+
}), s ? rn(s, i, o) : He;
|
|
911
|
+
};
|
|
912
|
+
function vn(e, s) {
|
|
913
|
+
const t = {
|
|
914
|
+
...e
|
|
915
|
+
};
|
|
916
|
+
for (const i in s) {
|
|
917
|
+
const n = s[i], o = typeof n;
|
|
918
|
+
i in ot ? (n === null || n && (o === "string" || o === "number")) && (t[i] = n) : o === typeof t[i] && (t[i] = i === "rotate" ? n % 4 : n);
|
|
919
|
+
}
|
|
920
|
+
return t;
|
|
921
|
+
}
|
|
922
|
+
const bn = /[\s,]+/;
|
|
923
|
+
function yn(e, s) {
|
|
924
|
+
s.split(bn).forEach((t) => {
|
|
925
|
+
switch (t.trim()) {
|
|
926
|
+
case "horizontal":
|
|
927
|
+
e.hFlip = !0;
|
|
928
|
+
break;
|
|
929
|
+
case "vertical":
|
|
930
|
+
e.vFlip = !0;
|
|
931
|
+
break;
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
function wn(e, s = 0) {
|
|
936
|
+
const t = e.replace(/^-?[0-9.]*/, "");
|
|
937
|
+
function i(n) {
|
|
938
|
+
for (; n < 0; )
|
|
939
|
+
n += 4;
|
|
940
|
+
return n % 4;
|
|
941
|
+
}
|
|
942
|
+
if (t === "") {
|
|
943
|
+
const n = parseInt(e);
|
|
944
|
+
return isNaN(n) ? 0 : i(n);
|
|
945
|
+
} else if (t !== e) {
|
|
946
|
+
let n = 0;
|
|
947
|
+
switch (t) {
|
|
948
|
+
case "%":
|
|
949
|
+
n = 25;
|
|
950
|
+
break;
|
|
951
|
+
case "deg":
|
|
952
|
+
n = 90;
|
|
953
|
+
}
|
|
954
|
+
if (n) {
|
|
955
|
+
let o = parseFloat(e.slice(0, e.length - t.length));
|
|
956
|
+
return isNaN(o) ? 0 : (o = o / n, o % 1 === 0 ? i(o) : 0);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return s;
|
|
960
|
+
}
|
|
961
|
+
function kn(e, s) {
|
|
962
|
+
let t = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
963
|
+
for (const i in s)
|
|
964
|
+
t += " " + i + '="' + s[i] + '"';
|
|
965
|
+
return '<svg xmlns="http://www.w3.org/2000/svg"' + t + ">" + e + "</svg>";
|
|
966
|
+
}
|
|
967
|
+
function xn(e) {
|
|
968
|
+
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
969
|
+
}
|
|
970
|
+
function In(e) {
|
|
971
|
+
return "data:image/svg+xml," + xn(e);
|
|
972
|
+
}
|
|
973
|
+
function Cn(e) {
|
|
974
|
+
return 'url("' + In(e) + '")';
|
|
975
|
+
}
|
|
976
|
+
const Be = {
|
|
977
|
+
...lt,
|
|
978
|
+
inline: !1
|
|
979
|
+
}, $n = {
|
|
980
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
981
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
982
|
+
"aria-hidden": !0,
|
|
983
|
+
role: "img"
|
|
984
|
+
}, En = {
|
|
985
|
+
display: "inline-block"
|
|
986
|
+
}, je = {
|
|
987
|
+
backgroundColor: "currentColor"
|
|
988
|
+
}, ct = {
|
|
989
|
+
backgroundColor: "transparent"
|
|
990
|
+
}, Ve = {
|
|
991
|
+
Image: "var(--svg)",
|
|
992
|
+
Repeat: "no-repeat",
|
|
993
|
+
Size: "100% 100%"
|
|
994
|
+
}, _e = {
|
|
995
|
+
webkitMask: je,
|
|
996
|
+
mask: je,
|
|
997
|
+
background: ct
|
|
998
|
+
};
|
|
999
|
+
for (const e in _e) {
|
|
1000
|
+
const s = _e[e];
|
|
1001
|
+
for (const t in Ve)
|
|
1002
|
+
s[e + t] = Ve[t];
|
|
1003
|
+
}
|
|
1004
|
+
const ge = {};
|
|
1005
|
+
["horizontal", "vertical"].forEach((e) => {
|
|
1006
|
+
const s = e.slice(0, 1) + "Flip";
|
|
1007
|
+
ge[e + "-flip"] = s, ge[e.slice(0, 1) + "-flip"] = s, ge[e + "Flip"] = s;
|
|
1008
|
+
});
|
|
1009
|
+
function qe(e) {
|
|
1010
|
+
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1011
|
+
}
|
|
1012
|
+
const Ge = (e, s) => {
|
|
1013
|
+
const t = vn(Be, s), i = { ...$n }, n = s.mode || "svg", o = {}, l = s.style, p = typeof l == "object" && !(l instanceof Array) ? l : {};
|
|
1014
|
+
for (let b in s) {
|
|
1015
|
+
const y = s[b];
|
|
1016
|
+
if (y !== void 0)
|
|
1017
|
+
switch (b) {
|
|
1018
|
+
// Properties to ignore
|
|
1019
|
+
case "icon":
|
|
1020
|
+
case "style":
|
|
1021
|
+
case "onLoad":
|
|
1022
|
+
case "mode":
|
|
1023
|
+
case "ssr":
|
|
1024
|
+
break;
|
|
1025
|
+
// Boolean attributes
|
|
1026
|
+
case "inline":
|
|
1027
|
+
case "hFlip":
|
|
1028
|
+
case "vFlip":
|
|
1029
|
+
t[b] = y === !0 || y === "true" || y === 1;
|
|
1030
|
+
break;
|
|
1031
|
+
// Flip as string: 'horizontal,vertical'
|
|
1032
|
+
case "flip":
|
|
1033
|
+
typeof y == "string" && yn(t, y);
|
|
1034
|
+
break;
|
|
1035
|
+
// Color: override style
|
|
1036
|
+
case "color":
|
|
1037
|
+
o.color = y;
|
|
1038
|
+
break;
|
|
1039
|
+
// Rotation as string
|
|
1040
|
+
case "rotate":
|
|
1041
|
+
typeof y == "string" ? t[b] = wn(y) : typeof y == "number" && (t[b] = y);
|
|
1042
|
+
break;
|
|
1043
|
+
// Remove aria-hidden
|
|
1044
|
+
case "ariaHidden":
|
|
1045
|
+
case "aria-hidden":
|
|
1046
|
+
y !== !0 && y !== "true" && delete i["aria-hidden"];
|
|
1047
|
+
break;
|
|
1048
|
+
default: {
|
|
1049
|
+
const S = ge[b];
|
|
1050
|
+
S ? (y === !0 || y === "true" || y === 1) && (t[S] = !0) : Be[b] === void 0 && (i[b] = y);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
const c = Bt(e, t), a = c.attributes;
|
|
1055
|
+
if (t.inline && (o.verticalAlign = "-0.125em"), n === "svg") {
|
|
1056
|
+
i.style = {
|
|
1057
|
+
...o,
|
|
1058
|
+
...p
|
|
1059
|
+
}, Object.assign(i, a);
|
|
1060
|
+
let b = 0, y = s.id;
|
|
1061
|
+
return typeof y == "string" && (y = y.replace(/-/g, "_")), i.innerHTML = Gt(c.body, y ? () => y + "ID" + b++ : "iconifyVue"), Le("svg", i);
|
|
1062
|
+
}
|
|
1063
|
+
const { body: d, width: f, height: r } = e, I = n === "mask" || (n === "bg" ? !1 : d.indexOf("currentColor") !== -1), g = kn(d, {
|
|
1064
|
+
...a,
|
|
1065
|
+
width: f + "",
|
|
1066
|
+
height: r + ""
|
|
1067
|
+
});
|
|
1068
|
+
return i.style = {
|
|
1069
|
+
...o,
|
|
1070
|
+
"--svg": Cn(g),
|
|
1071
|
+
width: qe(a.width),
|
|
1072
|
+
height: qe(a.height),
|
|
1073
|
+
...En,
|
|
1074
|
+
...I ? je : ct,
|
|
1075
|
+
...p
|
|
1076
|
+
}, Le("span", i);
|
|
1077
|
+
};
|
|
1078
|
+
it(!0);
|
|
1079
|
+
Kt("", nn);
|
|
1080
|
+
if (typeof document < "u" && typeof window < "u") {
|
|
1081
|
+
const e = window;
|
|
1082
|
+
if (e.IconifyPreload !== void 0) {
|
|
1083
|
+
const s = e.IconifyPreload, t = "Invalid IconifyPreload syntax.";
|
|
1084
|
+
typeof s == "object" && s !== null && (s instanceof Array ? s : [s]).forEach((i) => {
|
|
1085
|
+
try {
|
|
1086
|
+
// Check if item is an object and not null/array
|
|
1087
|
+
(typeof i != "object" || i === null || i instanceof Array || // Check for 'icons' and 'prefix'
|
|
1088
|
+
typeof i.icons != "object" || typeof i.prefix != "string" || // Add icon set
|
|
1089
|
+
!At(i)) && console.error(t);
|
|
1090
|
+
} catch {
|
|
1091
|
+
console.error(t);
|
|
1092
|
+
}
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
if (e.IconifyProviders !== void 0) {
|
|
1096
|
+
const s = e.IconifyProviders;
|
|
1097
|
+
if (typeof s == "object" && s !== null)
|
|
1098
|
+
for (let t in s) {
|
|
1099
|
+
const i = "IconifyProviders[" + t + "] is invalid.";
|
|
1100
|
+
try {
|
|
1101
|
+
const n = s[t];
|
|
1102
|
+
if (typeof n != "object" || !n || n.resources === void 0)
|
|
1103
|
+
continue;
|
|
1104
|
+
Qt(t, n) || console.error(i);
|
|
1105
|
+
} catch {
|
|
1106
|
+
console.error(i);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
const jn = {
|
|
1112
|
+
...ke,
|
|
1113
|
+
body: ""
|
|
1114
|
+
}, _ = G((e, { emit: s }) => {
|
|
1115
|
+
const t = M(null);
|
|
1116
|
+
function i() {
|
|
1117
|
+
var a, d;
|
|
1118
|
+
t.value && ((d = (a = t.value).abort) == null || d.call(a), t.value = null);
|
|
1119
|
+
}
|
|
1120
|
+
const n = M(!!e.ssr), o = M(""), l = ft(null);
|
|
1121
|
+
function p() {
|
|
1122
|
+
const a = e.icon;
|
|
1123
|
+
if (typeof a == "object" && a !== null && typeof a.body == "string")
|
|
1124
|
+
return o.value = "", {
|
|
1125
|
+
data: a
|
|
1126
|
+
};
|
|
1127
|
+
let d;
|
|
1128
|
+
if (typeof a != "string" || (d = we(a, !1, !0)) === null)
|
|
1129
|
+
return null;
|
|
1130
|
+
let f = Lt(d);
|
|
1131
|
+
if (!f) {
|
|
1132
|
+
const g = t.value;
|
|
1133
|
+
return (!g || g.name !== a) && (f === null ? t.value = {
|
|
1134
|
+
name: a
|
|
1135
|
+
} : t.value = {
|
|
1136
|
+
name: a,
|
|
1137
|
+
abort: hn([d], c)
|
|
1138
|
+
}), null;
|
|
1139
|
+
}
|
|
1140
|
+
i(), o.value !== a && (o.value = a, Se(() => {
|
|
1141
|
+
s("load", a);
|
|
1142
|
+
}));
|
|
1143
|
+
const r = e.customise;
|
|
1144
|
+
if (r) {
|
|
1145
|
+
f = Object.assign({}, f);
|
|
1146
|
+
const g = r(f.body, d.name, d.prefix, d.provider);
|
|
1147
|
+
typeof g == "string" && (f.body = g);
|
|
1148
|
+
}
|
|
1149
|
+
const I = ["iconify"];
|
|
1150
|
+
return d.prefix !== "" && I.push("iconify--" + d.prefix), d.provider !== "" && I.push("iconify--" + d.provider), { data: f, classes: I };
|
|
1151
|
+
}
|
|
1152
|
+
function c() {
|
|
1153
|
+
var d;
|
|
1154
|
+
const a = p();
|
|
1155
|
+
a ? a.data !== ((d = l.value) == null ? void 0 : d.data) && (l.value = a) : l.value = null;
|
|
1156
|
+
}
|
|
1157
|
+
return n.value ? c() : Me(() => {
|
|
1158
|
+
n.value = !0, c();
|
|
1159
|
+
}), J(() => e.icon, c), se(i), () => {
|
|
1160
|
+
const a = l.value;
|
|
1161
|
+
if (!a)
|
|
1162
|
+
return Ge(jn, e);
|
|
1163
|
+
let d = e;
|
|
1164
|
+
return a.classes && (d = {
|
|
1165
|
+
...e,
|
|
1166
|
+
class: a.classes.join(" ")
|
|
1167
|
+
}), Ge({
|
|
1168
|
+
...ke,
|
|
1169
|
+
...a.data
|
|
1170
|
+
}, d);
|
|
1171
|
+
};
|
|
1172
|
+
}, {
|
|
1173
|
+
props: [
|
|
1174
|
+
// Icon and render mode
|
|
1175
|
+
"icon",
|
|
1176
|
+
"mode",
|
|
1177
|
+
"ssr",
|
|
1178
|
+
// Layout and style
|
|
1179
|
+
"width",
|
|
1180
|
+
"height",
|
|
1181
|
+
"style",
|
|
1182
|
+
"color",
|
|
1183
|
+
"inline",
|
|
1184
|
+
// Transformations
|
|
1185
|
+
"rotate",
|
|
1186
|
+
"hFlip",
|
|
1187
|
+
"horizontalFlip",
|
|
1188
|
+
"vFlip",
|
|
1189
|
+
"verticalFlip",
|
|
1190
|
+
"flip",
|
|
1191
|
+
// Misc
|
|
1192
|
+
"id",
|
|
1193
|
+
"ariaHidden",
|
|
1194
|
+
"customise",
|
|
1195
|
+
"title"
|
|
1196
|
+
],
|
|
1197
|
+
emits: ["load"]
|
|
1198
|
+
}), Ke = /* @__PURE__ */ new Set([
|
|
1199
|
+
"3d",
|
|
1200
|
+
"actionscript",
|
|
1201
|
+
"ada",
|
|
1202
|
+
"adobe-illustrator",
|
|
1203
|
+
"adobe-photoshop",
|
|
1204
|
+
"android",
|
|
1205
|
+
"angular",
|
|
1206
|
+
"applescript",
|
|
1207
|
+
"arduino",
|
|
1208
|
+
"asciidoc",
|
|
1209
|
+
"assembly",
|
|
1210
|
+
"astro",
|
|
1211
|
+
"audio",
|
|
1212
|
+
"aurelia",
|
|
1213
|
+
"babel",
|
|
1214
|
+
"ballerina",
|
|
1215
|
+
"bazel",
|
|
1216
|
+
"biome",
|
|
1217
|
+
"blender",
|
|
1218
|
+
"bower",
|
|
1219
|
+
"bun",
|
|
1220
|
+
"c",
|
|
1221
|
+
"cabal",
|
|
1222
|
+
"caddy",
|
|
1223
|
+
"cake",
|
|
1224
|
+
"certificate",
|
|
1225
|
+
"changelog",
|
|
1226
|
+
"circleci",
|
|
1227
|
+
"claude",
|
|
1228
|
+
"clojure",
|
|
1229
|
+
"cmake",
|
|
1230
|
+
"cobol",
|
|
1231
|
+
"coffee",
|
|
1232
|
+
"command",
|
|
1233
|
+
"conduct",
|
|
1234
|
+
"contributing",
|
|
1235
|
+
"controller",
|
|
1236
|
+
"copilot",
|
|
1237
|
+
"cpp",
|
|
1238
|
+
"crystal",
|
|
1239
|
+
"csharp",
|
|
1240
|
+
"css",
|
|
1241
|
+
"css-map",
|
|
1242
|
+
"cucumber",
|
|
1243
|
+
"cuda",
|
|
1244
|
+
"cursor",
|
|
1245
|
+
"cypress",
|
|
1246
|
+
"d",
|
|
1247
|
+
"dart",
|
|
1248
|
+
"database",
|
|
1249
|
+
"deno",
|
|
1250
|
+
"dependabot",
|
|
1251
|
+
"diff",
|
|
1252
|
+
"django",
|
|
1253
|
+
"docker",
|
|
1254
|
+
"document",
|
|
1255
|
+
"drawio",
|
|
1256
|
+
"drizzle",
|
|
1257
|
+
"editorconfig",
|
|
1258
|
+
"ejs",
|
|
1259
|
+
"elixir",
|
|
1260
|
+
"elm",
|
|
1261
|
+
"email",
|
|
1262
|
+
"ember",
|
|
1263
|
+
"epub",
|
|
1264
|
+
"erlang",
|
|
1265
|
+
"esbuild",
|
|
1266
|
+
"eslint",
|
|
1267
|
+
"excalidraw",
|
|
1268
|
+
"exe",
|
|
1269
|
+
"favicon",
|
|
1270
|
+
"figma",
|
|
1271
|
+
"firebase",
|
|
1272
|
+
"flash",
|
|
1273
|
+
"flow",
|
|
1274
|
+
"font",
|
|
1275
|
+
"forth",
|
|
1276
|
+
"fortran",
|
|
1277
|
+
"freemarker",
|
|
1278
|
+
"fsharp",
|
|
1279
|
+
"gamemaker",
|
|
1280
|
+
"gatsby",
|
|
1281
|
+
"gcp",
|
|
1282
|
+
"gemfile",
|
|
1283
|
+
"gemini",
|
|
1284
|
+
"git",
|
|
1285
|
+
"gitlab",
|
|
1286
|
+
"gleam",
|
|
1287
|
+
"go",
|
|
1288
|
+
"go-mod",
|
|
1289
|
+
"godot",
|
|
1290
|
+
"gradle",
|
|
1291
|
+
"graphql",
|
|
1292
|
+
"groovy",
|
|
1293
|
+
"grunt",
|
|
1294
|
+
"gulp",
|
|
1295
|
+
"h",
|
|
1296
|
+
"haml",
|
|
1297
|
+
"handlebars",
|
|
1298
|
+
"hardhat",
|
|
1299
|
+
"haskell",
|
|
1300
|
+
"haxe",
|
|
1301
|
+
"hcl",
|
|
1302
|
+
"helm",
|
|
1303
|
+
"hjson",
|
|
1304
|
+
"hosts",
|
|
1305
|
+
"hpp",
|
|
1306
|
+
"html",
|
|
1307
|
+
"http",
|
|
1308
|
+
"husky",
|
|
1309
|
+
"i18n",
|
|
1310
|
+
"image",
|
|
1311
|
+
"imba",
|
|
1312
|
+
"ionic",
|
|
1313
|
+
"jar",
|
|
1314
|
+
"java",
|
|
1315
|
+
"javaclass",
|
|
1316
|
+
"javascript",
|
|
1317
|
+
"javascript-map",
|
|
1318
|
+
"jenkins",
|
|
1319
|
+
"jest",
|
|
1320
|
+
"jinja",
|
|
1321
|
+
"jsconfig",
|
|
1322
|
+
"json",
|
|
1323
|
+
"julia",
|
|
1324
|
+
"jupyter",
|
|
1325
|
+
"just",
|
|
1326
|
+
"karma",
|
|
1327
|
+
"key",
|
|
1328
|
+
"kotlin",
|
|
1329
|
+
"kubernetes",
|
|
1330
|
+
"laravel",
|
|
1331
|
+
"lean",
|
|
1332
|
+
"lefthook",
|
|
1333
|
+
"lerna",
|
|
1334
|
+
"less",
|
|
1335
|
+
"lib",
|
|
1336
|
+
"license",
|
|
1337
|
+
"lighthouse",
|
|
1338
|
+
"liquid",
|
|
1339
|
+
"lisp",
|
|
1340
|
+
"livescript",
|
|
1341
|
+
"lock",
|
|
1342
|
+
"log",
|
|
1343
|
+
"lua",
|
|
1344
|
+
"luau",
|
|
1345
|
+
"makefile",
|
|
1346
|
+
"markdown",
|
|
1347
|
+
"markdownlint",
|
|
1348
|
+
"matlab",
|
|
1349
|
+
"maven",
|
|
1350
|
+
"mdx",
|
|
1351
|
+
"mercurial",
|
|
1352
|
+
"mermaid",
|
|
1353
|
+
"meson",
|
|
1354
|
+
"minecraft",
|
|
1355
|
+
"mjml",
|
|
1356
|
+
"mocha",
|
|
1357
|
+
"mojo",
|
|
1358
|
+
"nest",
|
|
1359
|
+
"netlify",
|
|
1360
|
+
"next",
|
|
1361
|
+
"nginx",
|
|
1362
|
+
"nim",
|
|
1363
|
+
"nix",
|
|
1364
|
+
"nodejs",
|
|
1365
|
+
"nodemon",
|
|
1366
|
+
"npm",
|
|
1367
|
+
"nuget",
|
|
1368
|
+
"nunjucks",
|
|
1369
|
+
"nuxt",
|
|
1370
|
+
"nx",
|
|
1371
|
+
"objective-c",
|
|
1372
|
+
"objective-cpp",
|
|
1373
|
+
"ocaml",
|
|
1374
|
+
"odin",
|
|
1375
|
+
"openapi",
|
|
1376
|
+
"opentofu",
|
|
1377
|
+
"pascal",
|
|
1378
|
+
"pdf",
|
|
1379
|
+
"perl",
|
|
1380
|
+
"php",
|
|
1381
|
+
"phpstan",
|
|
1382
|
+
"phpunit",
|
|
1383
|
+
"pipeline",
|
|
1384
|
+
"playwright",
|
|
1385
|
+
"pnpm",
|
|
1386
|
+
"postcss",
|
|
1387
|
+
"powerpoint",
|
|
1388
|
+
"powershell",
|
|
1389
|
+
"prettier",
|
|
1390
|
+
"prisma",
|
|
1391
|
+
"processing",
|
|
1392
|
+
"prolog",
|
|
1393
|
+
"proto",
|
|
1394
|
+
"pug",
|
|
1395
|
+
"puppet",
|
|
1396
|
+
"purescript",
|
|
1397
|
+
"python",
|
|
1398
|
+
"pytorch",
|
|
1399
|
+
"quasar",
|
|
1400
|
+
"r",
|
|
1401
|
+
"racket",
|
|
1402
|
+
"razor",
|
|
1403
|
+
"react",
|
|
1404
|
+
"react-ts",
|
|
1405
|
+
"readme",
|
|
1406
|
+
"reason",
|
|
1407
|
+
"remark",
|
|
1408
|
+
"remix",
|
|
1409
|
+
"renovate",
|
|
1410
|
+
"replit",
|
|
1411
|
+
"rescript",
|
|
1412
|
+
"riot",
|
|
1413
|
+
"roadmap",
|
|
1414
|
+
"robot",
|
|
1415
|
+
"robots",
|
|
1416
|
+
"rollup",
|
|
1417
|
+
"routing",
|
|
1418
|
+
"rspec",
|
|
1419
|
+
"rubocop",
|
|
1420
|
+
"ruby",
|
|
1421
|
+
"ruff",
|
|
1422
|
+
"rust",
|
|
1423
|
+
"salt",
|
|
1424
|
+
"san",
|
|
1425
|
+
"sas",
|
|
1426
|
+
"sass",
|
|
1427
|
+
"sbt",
|
|
1428
|
+
"scala",
|
|
1429
|
+
"scheme",
|
|
1430
|
+
"search",
|
|
1431
|
+
"sentry",
|
|
1432
|
+
"sequelize",
|
|
1433
|
+
"serverless",
|
|
1434
|
+
"settings",
|
|
1435
|
+
"shader",
|
|
1436
|
+
"shellcheck",
|
|
1437
|
+
"sketch",
|
|
1438
|
+
"slim",
|
|
1439
|
+
"slint",
|
|
1440
|
+
"smarty",
|
|
1441
|
+
"snakemake",
|
|
1442
|
+
"snapcraft",
|
|
1443
|
+
"snyk",
|
|
1444
|
+
"solidity",
|
|
1445
|
+
"spwn",
|
|
1446
|
+
"stackblitz",
|
|
1447
|
+
"stan",
|
|
1448
|
+
"stencil",
|
|
1449
|
+
"storybook",
|
|
1450
|
+
"stryker",
|
|
1451
|
+
"stylelint",
|
|
1452
|
+
"stylus",
|
|
1453
|
+
"sublime",
|
|
1454
|
+
"subtitles",
|
|
1455
|
+
"supabase",
|
|
1456
|
+
"svelte",
|
|
1457
|
+
"svg",
|
|
1458
|
+
"svgo",
|
|
1459
|
+
"swagger",
|
|
1460
|
+
"swc",
|
|
1461
|
+
"swift",
|
|
1462
|
+
"tailwindcss",
|
|
1463
|
+
"taskfile",
|
|
1464
|
+
"tauri",
|
|
1465
|
+
"tcl",
|
|
1466
|
+
"teal",
|
|
1467
|
+
"templ",
|
|
1468
|
+
"template",
|
|
1469
|
+
"terraform",
|
|
1470
|
+
"test-js",
|
|
1471
|
+
"test-jsx",
|
|
1472
|
+
"test-ts",
|
|
1473
|
+
"tex",
|
|
1474
|
+
"todo",
|
|
1475
|
+
"toml",
|
|
1476
|
+
"travis",
|
|
1477
|
+
"tree",
|
|
1478
|
+
"tsconfig",
|
|
1479
|
+
"tsdoc",
|
|
1480
|
+
"turborepo",
|
|
1481
|
+
"twig",
|
|
1482
|
+
"typescript",
|
|
1483
|
+
"typescript-def",
|
|
1484
|
+
"unity",
|
|
1485
|
+
"unocss",
|
|
1486
|
+
"vagrant",
|
|
1487
|
+
"vanilla-extract",
|
|
1488
|
+
"vercel",
|
|
1489
|
+
"verilog",
|
|
1490
|
+
"video",
|
|
1491
|
+
"vim",
|
|
1492
|
+
"vite",
|
|
1493
|
+
"vitest",
|
|
1494
|
+
"vlang",
|
|
1495
|
+
"vscode",
|
|
1496
|
+
"vue",
|
|
1497
|
+
"vue-config",
|
|
1498
|
+
"wakatime",
|
|
1499
|
+
"wallaby",
|
|
1500
|
+
"webassembly",
|
|
1501
|
+
"webhint",
|
|
1502
|
+
"webpack",
|
|
1503
|
+
"windicss",
|
|
1504
|
+
"word",
|
|
1505
|
+
"wrangler",
|
|
1506
|
+
"wxt",
|
|
1507
|
+
"xaml",
|
|
1508
|
+
"xmake",
|
|
1509
|
+
"xml",
|
|
1510
|
+
"yaml",
|
|
1511
|
+
"yarn",
|
|
1512
|
+
"zig",
|
|
1513
|
+
"zip"
|
|
1514
|
+
]), Qe = {
|
|
1515
|
+
// JavaScript/TypeScript
|
|
1516
|
+
js: "javascript",
|
|
1517
|
+
mjs: "javascript",
|
|
1518
|
+
cjs: "javascript",
|
|
1519
|
+
jsx: "react",
|
|
1520
|
+
ts: "typescript",
|
|
1521
|
+
mts: "typescript",
|
|
1522
|
+
cts: "typescript",
|
|
1523
|
+
tsx: "react-ts",
|
|
1524
|
+
// 前端框架
|
|
1525
|
+
vue: "vue",
|
|
1526
|
+
svelte: "svelte",
|
|
1527
|
+
astro: "astro",
|
|
1528
|
+
// 后端语言
|
|
1529
|
+
py: "python",
|
|
1530
|
+
pyw: "python",
|
|
1531
|
+
pyi: "python",
|
|
1532
|
+
pyc: "python",
|
|
1533
|
+
java: "java",
|
|
1534
|
+
class: "javaclass",
|
|
1535
|
+
jar: "jar",
|
|
1536
|
+
c: "c",
|
|
1537
|
+
h: "h",
|
|
1538
|
+
cpp: "cpp",
|
|
1539
|
+
cc: "cpp",
|
|
1540
|
+
cxx: "cpp",
|
|
1541
|
+
hpp: "hpp",
|
|
1542
|
+
hh: "hpp",
|
|
1543
|
+
hxx: "hpp",
|
|
1544
|
+
cs: "csharp",
|
|
1545
|
+
csx: "csharp",
|
|
1546
|
+
go: "go",
|
|
1547
|
+
rs: "rust",
|
|
1548
|
+
php: "php",
|
|
1549
|
+
phtml: "php",
|
|
1550
|
+
rb: "ruby",
|
|
1551
|
+
rake: "ruby",
|
|
1552
|
+
swift: "swift",
|
|
1553
|
+
kt: "kotlin",
|
|
1554
|
+
kts: "kotlin",
|
|
1555
|
+
scala: "scala",
|
|
1556
|
+
dart: "dart",
|
|
1557
|
+
lua: "lua",
|
|
1558
|
+
luau: "luau",
|
|
1559
|
+
r: "r",
|
|
1560
|
+
rdata: "r",
|
|
1561
|
+
rds: "r",
|
|
1562
|
+
pl: "perl",
|
|
1563
|
+
pm: "perl",
|
|
1564
|
+
sh: "command",
|
|
1565
|
+
bash: "command",
|
|
1566
|
+
zsh: "command",
|
|
1567
|
+
fish: "command",
|
|
1568
|
+
ps1: "powershell",
|
|
1569
|
+
psm1: "powershell",
|
|
1570
|
+
psd1: "powershell",
|
|
1571
|
+
bat: "command",
|
|
1572
|
+
cmd: "command",
|
|
1573
|
+
// 样式
|
|
1574
|
+
css: "css",
|
|
1575
|
+
scss: "sass",
|
|
1576
|
+
sass: "sass",
|
|
1577
|
+
less: "less",
|
|
1578
|
+
styl: "stylus",
|
|
1579
|
+
// 标记/配置
|
|
1580
|
+
html: "html",
|
|
1581
|
+
htm: "html",
|
|
1582
|
+
xhtml: "html",
|
|
1583
|
+
xml: "xml",
|
|
1584
|
+
xsl: "xml",
|
|
1585
|
+
xslt: "xml",
|
|
1586
|
+
json: "json",
|
|
1587
|
+
jsonc: "json",
|
|
1588
|
+
json5: "json",
|
|
1589
|
+
yaml: "yaml",
|
|
1590
|
+
yml: "yaml",
|
|
1591
|
+
toml: "toml",
|
|
1592
|
+
ini: "settings",
|
|
1593
|
+
conf: "settings",
|
|
1594
|
+
config: "settings",
|
|
1595
|
+
// 文档
|
|
1596
|
+
md: "markdown",
|
|
1597
|
+
markdown: "markdown",
|
|
1598
|
+
mdx: "mdx",
|
|
1599
|
+
txt: "document",
|
|
1600
|
+
pdf: "pdf",
|
|
1601
|
+
doc: "word",
|
|
1602
|
+
docx: "word",
|
|
1603
|
+
dot: "word",
|
|
1604
|
+
dotx: "word",
|
|
1605
|
+
odt: "word",
|
|
1606
|
+
xls: "table",
|
|
1607
|
+
xlsx: "table",
|
|
1608
|
+
xlsm: "table",
|
|
1609
|
+
ods: "table",
|
|
1610
|
+
csv: "table",
|
|
1611
|
+
ppt: "powerpoint",
|
|
1612
|
+
pptx: "powerpoint",
|
|
1613
|
+
odp: "powerpoint",
|
|
1614
|
+
// 图片
|
|
1615
|
+
jpg: "image",
|
|
1616
|
+
jpeg: "image",
|
|
1617
|
+
png: "image",
|
|
1618
|
+
gif: "image",
|
|
1619
|
+
webp: "image",
|
|
1620
|
+
ico: "image",
|
|
1621
|
+
bmp: "image",
|
|
1622
|
+
tiff: "image",
|
|
1623
|
+
tif: "image",
|
|
1624
|
+
heic: "image",
|
|
1625
|
+
heif: "image",
|
|
1626
|
+
svg: "svg",
|
|
1627
|
+
psd: "adobe-photoshop",
|
|
1628
|
+
ai: "adobe-illustrator",
|
|
1629
|
+
sketch: "sketch",
|
|
1630
|
+
fig: "figma",
|
|
1631
|
+
figma: "figma",
|
|
1632
|
+
// 视频/音频
|
|
1633
|
+
mp4: "video",
|
|
1634
|
+
mov: "video",
|
|
1635
|
+
avi: "video",
|
|
1636
|
+
mkv: "video",
|
|
1637
|
+
webm: "video",
|
|
1638
|
+
flv: "video",
|
|
1639
|
+
wmv: "video",
|
|
1640
|
+
m4v: "video",
|
|
1641
|
+
"3gp": "video",
|
|
1642
|
+
mpeg: "video",
|
|
1643
|
+
mpg: "video",
|
|
1644
|
+
mp3: "audio",
|
|
1645
|
+
wav: "audio",
|
|
1646
|
+
flac: "audio",
|
|
1647
|
+
aac: "audio",
|
|
1648
|
+
ogg: "audio",
|
|
1649
|
+
wma: "audio",
|
|
1650
|
+
m4a: "audio",
|
|
1651
|
+
aiff: "audio",
|
|
1652
|
+
// 压缩
|
|
1653
|
+
zip: "zip",
|
|
1654
|
+
rar: "zip",
|
|
1655
|
+
"7z": "zip",
|
|
1656
|
+
tar: "zip",
|
|
1657
|
+
gz: "zip",
|
|
1658
|
+
bz2: "zip",
|
|
1659
|
+
xz: "zip",
|
|
1660
|
+
tgz: "zip",
|
|
1661
|
+
tbz2: "zip",
|
|
1662
|
+
// 数据库
|
|
1663
|
+
sql: "database",
|
|
1664
|
+
db: "database",
|
|
1665
|
+
sqlite: "database",
|
|
1666
|
+
sqlite3: "database",
|
|
1667
|
+
prisma: "prisma",
|
|
1668
|
+
// 其他
|
|
1669
|
+
log: "log",
|
|
1670
|
+
lock: "lock",
|
|
1671
|
+
env: "settings",
|
|
1672
|
+
graphql: "graphql",
|
|
1673
|
+
gql: "graphql",
|
|
1674
|
+
proto: "proto",
|
|
1675
|
+
wasm: "webassembly",
|
|
1676
|
+
zig: "zig",
|
|
1677
|
+
nim: "nim",
|
|
1678
|
+
nix: "nix",
|
|
1679
|
+
hcl: "hcl",
|
|
1680
|
+
tf: "terraform",
|
|
1681
|
+
sol: "solidity",
|
|
1682
|
+
ex: "elixir",
|
|
1683
|
+
exs: "elixir",
|
|
1684
|
+
erl: "erlang",
|
|
1685
|
+
hrl: "erlang",
|
|
1686
|
+
hs: "haskell",
|
|
1687
|
+
lhs: "haskell",
|
|
1688
|
+
ml: "ocaml",
|
|
1689
|
+
mli: "ocaml",
|
|
1690
|
+
clj: "clojure",
|
|
1691
|
+
cljs: "clojure",
|
|
1692
|
+
cljc: "clojure",
|
|
1693
|
+
lisp: "lisp",
|
|
1694
|
+
lsp: "lisp",
|
|
1695
|
+
el: "lisp",
|
|
1696
|
+
vim: "vim",
|
|
1697
|
+
dockerfile: "docker"
|
|
1698
|
+
}, Xe = {
|
|
1699
|
+
// Git
|
|
1700
|
+
".gitignore": "git",
|
|
1701
|
+
".gitattributes": "git",
|
|
1702
|
+
".gitmodules": "git",
|
|
1703
|
+
".gitkeep": "git",
|
|
1704
|
+
// 环境
|
|
1705
|
+
".env": "settings",
|
|
1706
|
+
".env.local": "settings",
|
|
1707
|
+
".env.development": "settings",
|
|
1708
|
+
".env.production": "settings",
|
|
1709
|
+
".env.test": "settings",
|
|
1710
|
+
".env.example": "settings",
|
|
1711
|
+
// Node/包管理
|
|
1712
|
+
"package.json": "nodejs",
|
|
1713
|
+
"package-lock.json": "npm",
|
|
1714
|
+
"yarn.lock": "yarn",
|
|
1715
|
+
".yarnrc": "yarn",
|
|
1716
|
+
".yarnrc.yml": "yarn",
|
|
1717
|
+
"pnpm-lock.yaml": "pnpm",
|
|
1718
|
+
".pnpmfile.cjs": "pnpm",
|
|
1719
|
+
"bun.lockb": "bun",
|
|
1720
|
+
"bunfig.toml": "bun",
|
|
1721
|
+
// Python
|
|
1722
|
+
"requirements.txt": "python",
|
|
1723
|
+
pipfile: "python",
|
|
1724
|
+
"pipfile.lock": "python",
|
|
1725
|
+
"pyproject.toml": "python",
|
|
1726
|
+
"poetry.lock": "python",
|
|
1727
|
+
"setup.py": "python",
|
|
1728
|
+
// Rust
|
|
1729
|
+
"cargo.toml": "rust",
|
|
1730
|
+
"cargo.lock": "rust",
|
|
1731
|
+
// Go
|
|
1732
|
+
"go.mod": "go-mod",
|
|
1733
|
+
"go.sum": "go-mod",
|
|
1734
|
+
"go.work": "go-mod",
|
|
1735
|
+
// PHP
|
|
1736
|
+
"composer.json": "php",
|
|
1737
|
+
"composer.lock": "php",
|
|
1738
|
+
// Ruby
|
|
1739
|
+
gemfile: "gemfile",
|
|
1740
|
+
"gemfile.lock": "gemfile",
|
|
1741
|
+
rakefile: "ruby",
|
|
1742
|
+
// Docker
|
|
1743
|
+
dockerfile: "docker",
|
|
1744
|
+
"docker-compose.yml": "docker",
|
|
1745
|
+
"docker-compose.yaml": "docker",
|
|
1746
|
+
".dockerignore": "docker",
|
|
1747
|
+
// 构建工具
|
|
1748
|
+
makefile: "makefile",
|
|
1749
|
+
gnumakefile: "makefile",
|
|
1750
|
+
"cmakelists.txt": "cmake",
|
|
1751
|
+
"build.gradle": "gradle",
|
|
1752
|
+
"build.gradle.kts": "gradle",
|
|
1753
|
+
"settings.gradle": "gradle",
|
|
1754
|
+
"pom.xml": "maven",
|
|
1755
|
+
// 配置
|
|
1756
|
+
"tsconfig.json": "tsconfig",
|
|
1757
|
+
"jsconfig.json": "jsconfig",
|
|
1758
|
+
".prettierrc": "prettier",
|
|
1759
|
+
".prettierrc.json": "prettier",
|
|
1760
|
+
".prettierrc.js": "prettier",
|
|
1761
|
+
".prettierignore": "prettier",
|
|
1762
|
+
"prettier.config.js": "prettier",
|
|
1763
|
+
".eslintrc": "eslint",
|
|
1764
|
+
".eslintrc.json": "eslint",
|
|
1765
|
+
".eslintrc.js": "eslint",
|
|
1766
|
+
".eslintignore": "eslint",
|
|
1767
|
+
"eslint.config.js": "eslint",
|
|
1768
|
+
"eslint.config.mjs": "eslint",
|
|
1769
|
+
".editorconfig": "editorconfig",
|
|
1770
|
+
"vite.config.ts": "vite",
|
|
1771
|
+
"vite.config.js": "vite",
|
|
1772
|
+
"webpack.config.js": "webpack",
|
|
1773
|
+
"webpack.config.ts": "webpack",
|
|
1774
|
+
"rollup.config.js": "rollup",
|
|
1775
|
+
"rollup.config.ts": "rollup",
|
|
1776
|
+
"esbuild.config.js": "esbuild",
|
|
1777
|
+
"tailwind.config.js": "tailwindcss",
|
|
1778
|
+
"tailwind.config.ts": "tailwindcss",
|
|
1779
|
+
"postcss.config.js": "postcss",
|
|
1780
|
+
"postcss.config.cjs": "postcss",
|
|
1781
|
+
"babel.config.js": "babel",
|
|
1782
|
+
".babelrc": "babel",
|
|
1783
|
+
"jest.config.js": "jest",
|
|
1784
|
+
"jest.config.ts": "jest",
|
|
1785
|
+
"vitest.config.ts": "vitest",
|
|
1786
|
+
"vitest.config.js": "vitest",
|
|
1787
|
+
"playwright.config.ts": "playwright",
|
|
1788
|
+
"playwright.config.js": "playwright",
|
|
1789
|
+
"cypress.config.ts": "cypress",
|
|
1790
|
+
"cypress.config.js": "cypress",
|
|
1791
|
+
".swcrc": "swc",
|
|
1792
|
+
"swc.config.js": "swc",
|
|
1793
|
+
"turbo.json": "turborepo",
|
|
1794
|
+
"nx.json": "nx",
|
|
1795
|
+
"biome.json": "biome",
|
|
1796
|
+
".nvmrc": "nodejs",
|
|
1797
|
+
".node-version": "nodejs",
|
|
1798
|
+
// 框架配置
|
|
1799
|
+
"nuxt.config.ts": "nuxt",
|
|
1800
|
+
"nuxt.config.js": "nuxt",
|
|
1801
|
+
"next.config.js": "next",
|
|
1802
|
+
"next.config.mjs": "next",
|
|
1803
|
+
"next.config.ts": "next",
|
|
1804
|
+
"svelte.config.js": "svelte",
|
|
1805
|
+
"astro.config.mjs": "astro",
|
|
1806
|
+
"astro.config.ts": "astro",
|
|
1807
|
+
"vue.config.js": "vue-config",
|
|
1808
|
+
"angular.json": "angular",
|
|
1809
|
+
"nest-cli.json": "nest",
|
|
1810
|
+
"tauri.conf.json": "tauri",
|
|
1811
|
+
// CI/CD
|
|
1812
|
+
".travis.yml": "travis",
|
|
1813
|
+
".gitlab-ci.yml": "gitlab",
|
|
1814
|
+
"vercel.json": "vercel",
|
|
1815
|
+
"netlify.toml": "netlify",
|
|
1816
|
+
// 其他
|
|
1817
|
+
license: "license",
|
|
1818
|
+
"license.md": "license",
|
|
1819
|
+
"license.txt": "license",
|
|
1820
|
+
readme: "readme",
|
|
1821
|
+
"readme.md": "readme",
|
|
1822
|
+
"readme.txt": "readme",
|
|
1823
|
+
changelog: "changelog",
|
|
1824
|
+
"changelog.md": "changelog",
|
|
1825
|
+
".npmrc": "npm",
|
|
1826
|
+
".npmignore": "npm",
|
|
1827
|
+
"robots.txt": "robots",
|
|
1828
|
+
".htaccess": "nginx",
|
|
1829
|
+
vagrantfile: "vagrant",
|
|
1830
|
+
".stylelintrc": "stylelint",
|
|
1831
|
+
".stylelintrc.json": "stylelint",
|
|
1832
|
+
"nodemon.json": "nodemon",
|
|
1833
|
+
".huskyrc": "husky",
|
|
1834
|
+
"renovate.json": "renovate",
|
|
1835
|
+
".snyk": "snyk",
|
|
1836
|
+
"deno.json": "deno",
|
|
1837
|
+
"deno.jsonc": "deno"
|
|
1838
|
+
};
|
|
1839
|
+
function ut(e, s) {
|
|
1840
|
+
const t = e.toLowerCase();
|
|
1841
|
+
if (Xe[t]) {
|
|
1842
|
+
const o = Xe[t];
|
|
1843
|
+
if (Ke.has(o))
|
|
1844
|
+
return `material-icon-theme:${o}`;
|
|
1845
|
+
}
|
|
1846
|
+
if (t === "dockerfile" || t.startsWith("dockerfile."))
|
|
1847
|
+
return "material-icon-theme:docker";
|
|
1848
|
+
if (t === ".env" || t.startsWith(".env."))
|
|
1849
|
+
return "material-icon-theme:settings";
|
|
1850
|
+
const i = e.lastIndexOf("."), n = i > 0 ? e.substring(i + 1).toLowerCase() : "";
|
|
1851
|
+
if (n === "ts" || n === "js") {
|
|
1852
|
+
const o = e.substring(0, i).toLowerCase();
|
|
1853
|
+
if (o.endsWith(".d"))
|
|
1854
|
+
return "material-icon-theme:typescript-def";
|
|
1855
|
+
if (o.endsWith(".test") || o.endsWith(".spec"))
|
|
1856
|
+
return n === "ts" ? "material-icon-theme:test-ts" : "material-icon-theme:test-js";
|
|
1857
|
+
}
|
|
1858
|
+
if (n === "jsx" || n === "tsx") {
|
|
1859
|
+
const o = e.substring(0, i).toLowerCase();
|
|
1860
|
+
if (o.endsWith(".test") || o.endsWith(".spec"))
|
|
1861
|
+
return n === "tsx" ? "material-icon-theme:test-ts" : "material-icon-theme:test-jsx";
|
|
1862
|
+
}
|
|
1863
|
+
if (n && Qe[n]) {
|
|
1864
|
+
const o = Qe[n];
|
|
1865
|
+
if (Ke.has(o))
|
|
1866
|
+
return `material-icon-theme:${o}`;
|
|
1867
|
+
}
|
|
1868
|
+
return s ? Mn(s) : "material-icon-theme:document";
|
|
1869
|
+
}
|
|
1870
|
+
function Mn(e) {
|
|
1871
|
+
switch (e) {
|
|
1872
|
+
case w.IMAGE:
|
|
1873
|
+
return "material-icon-theme:image";
|
|
1874
|
+
case w.VIDEO:
|
|
1875
|
+
return "material-icon-theme:video";
|
|
1876
|
+
case w.MUSIC:
|
|
1877
|
+
return "material-icon-theme:audio";
|
|
1878
|
+
case w.CODE:
|
|
1879
|
+
return "material-icon-theme:javascript";
|
|
1880
|
+
case w.TEXT:
|
|
1881
|
+
return "material-icon-theme:document";
|
|
1882
|
+
case w.DOCUMENT:
|
|
1883
|
+
return "material-icon-theme:word";
|
|
1884
|
+
case w.PDF:
|
|
1885
|
+
return "material-icon-theme:pdf";
|
|
1886
|
+
case w.ARCHIVE:
|
|
1887
|
+
return "material-icon-theme:zip";
|
|
1888
|
+
case w.APPLICATION:
|
|
1889
|
+
return "material-icon-theme:exe";
|
|
1890
|
+
default:
|
|
1891
|
+
return "material-icon-theme:document";
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
const Sn = /* @__PURE__ */ new Set([
|
|
1895
|
+
"admin",
|
|
1896
|
+
"android",
|
|
1897
|
+
"angular",
|
|
1898
|
+
"animation",
|
|
1899
|
+
"ansible",
|
|
1900
|
+
"api",
|
|
1901
|
+
"apollo",
|
|
1902
|
+
"app",
|
|
1903
|
+
"archive",
|
|
1904
|
+
"astro",
|
|
1905
|
+
"atom",
|
|
1906
|
+
"attachment",
|
|
1907
|
+
"audio",
|
|
1908
|
+
"aurelia",
|
|
1909
|
+
"aws",
|
|
1910
|
+
"azure-pipelines",
|
|
1911
|
+
"backup",
|
|
1912
|
+
"base",
|
|
1913
|
+
"batch",
|
|
1914
|
+
"benchmark",
|
|
1915
|
+
"bibliography",
|
|
1916
|
+
"bicep",
|
|
1917
|
+
"blender",
|
|
1918
|
+
"bloc",
|
|
1919
|
+
"bower",
|
|
1920
|
+
"buildkite",
|
|
1921
|
+
"cart",
|
|
1922
|
+
"changesets",
|
|
1923
|
+
"ci",
|
|
1924
|
+
"circleci",
|
|
1925
|
+
"class",
|
|
1926
|
+
"claude",
|
|
1927
|
+
"client",
|
|
1928
|
+
"cline",
|
|
1929
|
+
"cloud-functions",
|
|
1930
|
+
"cloudflare",
|
|
1931
|
+
"cluster",
|
|
1932
|
+
"cobol",
|
|
1933
|
+
"command",
|
|
1934
|
+
"components",
|
|
1935
|
+
"config",
|
|
1936
|
+
"connection",
|
|
1937
|
+
"console",
|
|
1938
|
+
"constant",
|
|
1939
|
+
"container",
|
|
1940
|
+
"content",
|
|
1941
|
+
"context",
|
|
1942
|
+
"contract",
|
|
1943
|
+
"controller",
|
|
1944
|
+
"core",
|
|
1945
|
+
"coverage",
|
|
1946
|
+
"css",
|
|
1947
|
+
"cue",
|
|
1948
|
+
"cursor",
|
|
1949
|
+
"custom",
|
|
1950
|
+
"cypress",
|
|
1951
|
+
"dal",
|
|
1952
|
+
"dart",
|
|
1953
|
+
"database",
|
|
1954
|
+
"debug",
|
|
1955
|
+
"decorators",
|
|
1956
|
+
"delta",
|
|
1957
|
+
"desktop",
|
|
1958
|
+
"directive",
|
|
1959
|
+
"dist",
|
|
1960
|
+
"docker",
|
|
1961
|
+
"docs",
|
|
1962
|
+
"download",
|
|
1963
|
+
"drizzle",
|
|
1964
|
+
"dump",
|
|
1965
|
+
"element",
|
|
1966
|
+
"enum",
|
|
1967
|
+
"environment",
|
|
1968
|
+
"error",
|
|
1969
|
+
"eslint",
|
|
1970
|
+
"event",
|
|
1971
|
+
"examples",
|
|
1972
|
+
"expo",
|
|
1973
|
+
"export",
|
|
1974
|
+
"fastlane",
|
|
1975
|
+
"favicon",
|
|
1976
|
+
"features",
|
|
1977
|
+
"filter",
|
|
1978
|
+
"firebase",
|
|
1979
|
+
"firestore",
|
|
1980
|
+
"flow",
|
|
1981
|
+
"flutter",
|
|
1982
|
+
"font",
|
|
1983
|
+
"forgejo",
|
|
1984
|
+
"functions",
|
|
1985
|
+
"gamemaker",
|
|
1986
|
+
"generator",
|
|
1987
|
+
"gh-workflows",
|
|
1988
|
+
"git",
|
|
1989
|
+
"gitea",
|
|
1990
|
+
"github",
|
|
1991
|
+
"gitlab",
|
|
1992
|
+
"global",
|
|
1993
|
+
"godot",
|
|
1994
|
+
"gradle",
|
|
1995
|
+
"graphql",
|
|
1996
|
+
"guard",
|
|
1997
|
+
"gulp",
|
|
1998
|
+
"helm",
|
|
1999
|
+
"helper",
|
|
2000
|
+
"home",
|
|
2001
|
+
"hook",
|
|
2002
|
+
"husky",
|
|
2003
|
+
"i18n",
|
|
2004
|
+
"images",
|
|
2005
|
+
"import",
|
|
2006
|
+
"include",
|
|
2007
|
+
"input",
|
|
2008
|
+
"intellij",
|
|
2009
|
+
"interceptor",
|
|
2010
|
+
"interface",
|
|
2011
|
+
"ios",
|
|
2012
|
+
"java",
|
|
2013
|
+
"javascript",
|
|
2014
|
+
"jinja",
|
|
2015
|
+
"job",
|
|
2016
|
+
"json",
|
|
2017
|
+
"jupyter",
|
|
2018
|
+
"keys",
|
|
2019
|
+
"kubernetes",
|
|
2020
|
+
"kusto",
|
|
2021
|
+
"layout",
|
|
2022
|
+
"lefthook",
|
|
2023
|
+
"less",
|
|
2024
|
+
"lib",
|
|
2025
|
+
"license",
|
|
2026
|
+
"link",
|
|
2027
|
+
"linux",
|
|
2028
|
+
"liquibase",
|
|
2029
|
+
"log",
|
|
2030
|
+
"lottie",
|
|
2031
|
+
"lua",
|
|
2032
|
+
"luau",
|
|
2033
|
+
"macos",
|
|
2034
|
+
"mail",
|
|
2035
|
+
"mappings",
|
|
2036
|
+
"markdown",
|
|
2037
|
+
"mercurial",
|
|
2038
|
+
"messages",
|
|
2039
|
+
"meta",
|
|
2040
|
+
"metro",
|
|
2041
|
+
"middleware",
|
|
2042
|
+
"migrations",
|
|
2043
|
+
"mjml",
|
|
2044
|
+
"mobile",
|
|
2045
|
+
"mock",
|
|
2046
|
+
"mojo",
|
|
2047
|
+
"molecule",
|
|
2048
|
+
"moon",
|
|
2049
|
+
"netlify",
|
|
2050
|
+
"next",
|
|
2051
|
+
"ngrx-store",
|
|
2052
|
+
"node",
|
|
2053
|
+
"nuxt",
|
|
2054
|
+
"obsidian",
|
|
2055
|
+
"organism",
|
|
2056
|
+
"other",
|
|
2057
|
+
"packages",
|
|
2058
|
+
"pdf",
|
|
2059
|
+
"pdm",
|
|
2060
|
+
"php",
|
|
2061
|
+
"phpmailer",
|
|
2062
|
+
"pipe",
|
|
2063
|
+
"plastic",
|
|
2064
|
+
"plugin",
|
|
2065
|
+
"policy",
|
|
2066
|
+
"powershell",
|
|
2067
|
+
"prisma",
|
|
2068
|
+
"private",
|
|
2069
|
+
"project",
|
|
2070
|
+
"prompts",
|
|
2071
|
+
"proto",
|
|
2072
|
+
"public",
|
|
2073
|
+
"python",
|
|
2074
|
+
"pytorch",
|
|
2075
|
+
"quasar",
|
|
2076
|
+
"queue",
|
|
2077
|
+
"react-components",
|
|
2078
|
+
"redux-reducer",
|
|
2079
|
+
"repository",
|
|
2080
|
+
"resolver",
|
|
2081
|
+
"resource",
|
|
2082
|
+
"review",
|
|
2083
|
+
"robot",
|
|
2084
|
+
"routes",
|
|
2085
|
+
"rules",
|
|
2086
|
+
"rust",
|
|
2087
|
+
"salt",
|
|
2088
|
+
"sandbox",
|
|
2089
|
+
"sass",
|
|
2090
|
+
"scala",
|
|
2091
|
+
"scons",
|
|
2092
|
+
"scripts",
|
|
2093
|
+
"secure",
|
|
2094
|
+
"seeders",
|
|
2095
|
+
"server",
|
|
2096
|
+
"serverless",
|
|
2097
|
+
"shader",
|
|
2098
|
+
"shared",
|
|
2099
|
+
"simulations",
|
|
2100
|
+
"snapcraft",
|
|
2101
|
+
"snippet",
|
|
2102
|
+
"src",
|
|
2103
|
+
"src-tauri",
|
|
2104
|
+
"stack",
|
|
2105
|
+
"stencil",
|
|
2106
|
+
"store",
|
|
2107
|
+
"storybook",
|
|
2108
|
+
"stylus",
|
|
2109
|
+
"sublime",
|
|
2110
|
+
"supabase",
|
|
2111
|
+
"svelte",
|
|
2112
|
+
"svg",
|
|
2113
|
+
"syntax",
|
|
2114
|
+
"target",
|
|
2115
|
+
"taskfile",
|
|
2116
|
+
"tasks",
|
|
2117
|
+
"television",
|
|
2118
|
+
"temp",
|
|
2119
|
+
"template",
|
|
2120
|
+
"terraform",
|
|
2121
|
+
"test",
|
|
2122
|
+
"theme",
|
|
2123
|
+
"toc",
|
|
2124
|
+
"tools",
|
|
2125
|
+
"trash",
|
|
2126
|
+
"trigger",
|
|
2127
|
+
"turborepo",
|
|
2128
|
+
"typescript",
|
|
2129
|
+
"ui",
|
|
2130
|
+
"unity",
|
|
2131
|
+
"update",
|
|
2132
|
+
"upload",
|
|
2133
|
+
"utils",
|
|
2134
|
+
"vercel",
|
|
2135
|
+
"verdaccio",
|
|
2136
|
+
"video",
|
|
2137
|
+
"views",
|
|
2138
|
+
"vm",
|
|
2139
|
+
"vscode",
|
|
2140
|
+
"vue",
|
|
2141
|
+
"vue-directives",
|
|
2142
|
+
"vuepress",
|
|
2143
|
+
"vuex-store",
|
|
2144
|
+
"wakatime",
|
|
2145
|
+
"webpack",
|
|
2146
|
+
"windows",
|
|
2147
|
+
"wordpress",
|
|
2148
|
+
"yarn",
|
|
2149
|
+
"zeabur"
|
|
2150
|
+
]), Dn = {
|
|
2151
|
+
// 复数/变体
|
|
2152
|
+
tests: "test",
|
|
2153
|
+
__tests__: "test",
|
|
2154
|
+
__test__: "test",
|
|
2155
|
+
spec: "test",
|
|
2156
|
+
specs: "test",
|
|
2157
|
+
script: "scripts",
|
|
2158
|
+
configs: "config",
|
|
2159
|
+
configuration: "config",
|
|
2160
|
+
configurations: "config",
|
|
2161
|
+
route: "routes",
|
|
2162
|
+
routing: "routes",
|
|
2163
|
+
stories: "storybook",
|
|
2164
|
+
story: "storybook",
|
|
2165
|
+
templates: "template",
|
|
2166
|
+
themes: "theme",
|
|
2167
|
+
videos: "video",
|
|
2168
|
+
imgs: "images",
|
|
2169
|
+
img: "images",
|
|
2170
|
+
image: "images",
|
|
2171
|
+
fonts: "font",
|
|
2172
|
+
styles: "css",
|
|
2173
|
+
style: "css",
|
|
2174
|
+
styling: "css",
|
|
2175
|
+
stylesheets: "css",
|
|
2176
|
+
view: "views",
|
|
2177
|
+
pages: "views",
|
|
2178
|
+
page: "views",
|
|
2179
|
+
layouts: "layout",
|
|
2180
|
+
models: "database",
|
|
2181
|
+
model: "database",
|
|
2182
|
+
modules: "lib",
|
|
2183
|
+
module: "lib",
|
|
2184
|
+
mods: "lib",
|
|
2185
|
+
plugins: "plugin",
|
|
2186
|
+
addons: "plugin",
|
|
2187
|
+
extensions: "plugin",
|
|
2188
|
+
middlewares: "middleware",
|
|
2189
|
+
helpers: "helper",
|
|
2190
|
+
utilities: "utils",
|
|
2191
|
+
util: "utils",
|
|
2192
|
+
tool: "tools",
|
|
2193
|
+
tooling: "tools",
|
|
2194
|
+
resources: "resource",
|
|
2195
|
+
res: "resource",
|
|
2196
|
+
assets: "resource",
|
|
2197
|
+
asset: "resource",
|
|
2198
|
+
hooks: "hook",
|
|
2199
|
+
composables: "hook",
|
|
2200
|
+
mocks: "mock",
|
|
2201
|
+
__mocks__: "mock",
|
|
2202
|
+
fixtures: "mock",
|
|
2203
|
+
__fixtures__: "mock",
|
|
2204
|
+
logs: "log",
|
|
2205
|
+
uploads: "upload",
|
|
2206
|
+
function: "functions",
|
|
2207
|
+
func: "functions",
|
|
2208
|
+
fns: "functions",
|
|
2209
|
+
services: "server",
|
|
2210
|
+
service: "server",
|
|
2211
|
+
component: "components",
|
|
2212
|
+
comp: "components",
|
|
2213
|
+
comps: "components",
|
|
2214
|
+
controllers: "controller",
|
|
2215
|
+
// 常见变体
|
|
2216
|
+
source: "src",
|
|
2217
|
+
sources: "src",
|
|
2218
|
+
distribution: "dist",
|
|
2219
|
+
build: "dist",
|
|
2220
|
+
builds: "dist",
|
|
2221
|
+
out: "dist",
|
|
2222
|
+
output: "dist",
|
|
2223
|
+
documentation: "docs",
|
|
2224
|
+
doc: "docs",
|
|
2225
|
+
document: "docs",
|
|
2226
|
+
documents: "docs",
|
|
2227
|
+
static: "public",
|
|
2228
|
+
statics: "public",
|
|
2229
|
+
publics: "public",
|
|
2230
|
+
libs: "lib",
|
|
2231
|
+
library: "lib",
|
|
2232
|
+
vendor: "lib",
|
|
2233
|
+
vendors: "lib",
|
|
2234
|
+
bin: "scripts",
|
|
2235
|
+
binaries: "scripts",
|
|
2236
|
+
tmp: "temp",
|
|
2237
|
+
temporary: "temp",
|
|
2238
|
+
cache: "temp",
|
|
2239
|
+
caches: "temp",
|
|
2240
|
+
".cache": "temp",
|
|
2241
|
+
".turbo": "temp",
|
|
2242
|
+
types: "typescript",
|
|
2243
|
+
"@types": "typescript",
|
|
2244
|
+
typings: "typescript",
|
|
2245
|
+
dts: "typescript",
|
|
2246
|
+
locales: "i18n",
|
|
2247
|
+
locale: "i18n",
|
|
2248
|
+
lang: "i18n",
|
|
2249
|
+
languages: "i18n",
|
|
2250
|
+
translations: "i18n",
|
|
2251
|
+
db: "database",
|
|
2252
|
+
databases: "database",
|
|
2253
|
+
sql: "database",
|
|
2254
|
+
queries: "database",
|
|
2255
|
+
migration: "migrations",
|
|
2256
|
+
seeds: "seeders",
|
|
2257
|
+
seed: "seeders",
|
|
2258
|
+
// 技术栈
|
|
2259
|
+
".vscode": "vscode",
|
|
2260
|
+
".github": "github",
|
|
2261
|
+
".gitlab": "gitlab",
|
|
2262
|
+
".circleci": "circleci",
|
|
2263
|
+
".husky": "husky",
|
|
2264
|
+
".docker": "docker",
|
|
2265
|
+
node_modules: "node",
|
|
2266
|
+
scss: "sass",
|
|
2267
|
+
renderer: "client",
|
|
2268
|
+
frontend: "client",
|
|
2269
|
+
web: "client",
|
|
2270
|
+
webapp: "client",
|
|
2271
|
+
website: "client",
|
|
2272
|
+
backend: "server",
|
|
2273
|
+
main: "server",
|
|
2274
|
+
preload: "scripts",
|
|
2275
|
+
".idea": "intellij",
|
|
2276
|
+
".git": "git",
|
|
2277
|
+
k8s: "kubernetes",
|
|
2278
|
+
kube: "kubernetes",
|
|
2279
|
+
mongo: "database",
|
|
2280
|
+
mongodb: "database",
|
|
2281
|
+
mysql: "database",
|
|
2282
|
+
postgres: "database",
|
|
2283
|
+
api: "api",
|
|
2284
|
+
apis: "api",
|
|
2285
|
+
interfaces: "interface",
|
|
2286
|
+
notebook: "jupyter",
|
|
2287
|
+
notebooks: "jupyter",
|
|
2288
|
+
ipynb: "jupyter",
|
|
2289
|
+
notification: "messages",
|
|
2290
|
+
notifications: "messages",
|
|
2291
|
+
env: "environment",
|
|
2292
|
+
envs: "environment",
|
|
2293
|
+
redux: "redux-reducer",
|
|
2294
|
+
store: "store",
|
|
2295
|
+
stores: "store",
|
|
2296
|
+
electron: "desktop",
|
|
2297
|
+
tauri: "src-tauri"
|
|
2298
|
+
};
|
|
2299
|
+
function zn(e) {
|
|
2300
|
+
const s = (e || "").trim();
|
|
2301
|
+
if (!s) return;
|
|
2302
|
+
const t = s.replace(/[\\/]+$/, "").toLowerCase(), i = Dn[t] ?? t;
|
|
2303
|
+
if (Sn.has(i))
|
|
2304
|
+
return `material-icon-theme:folder-${i}`;
|
|
2305
|
+
}
|
|
2306
|
+
const On = /* @__PURE__ */ G({
|
|
2307
|
+
__name: "FileIcon",
|
|
2308
|
+
props: {
|
|
2309
|
+
type: {},
|
|
2310
|
+
name: {},
|
|
2311
|
+
className: { default: "" },
|
|
2312
|
+
size: { default: 24 }
|
|
2313
|
+
},
|
|
2314
|
+
setup(e) {
|
|
2315
|
+
const s = e, t = U(() => {
|
|
2316
|
+
if (s.type === w.FOLDER)
|
|
2317
|
+
return (s.name ? zn(s.name) : void 0) ?? "flat-color-icons:folder";
|
|
2318
|
+
if (s.name)
|
|
2319
|
+
return ut(s.name, s.type);
|
|
2320
|
+
switch (s.type) {
|
|
2321
|
+
case w.IMAGE:
|
|
2322
|
+
return "material-icon-theme:image";
|
|
2323
|
+
case w.TEXT:
|
|
2324
|
+
return "material-icon-theme:document";
|
|
2325
|
+
case w.CODE:
|
|
2326
|
+
return "material-icon-theme:javascript";
|
|
2327
|
+
case w.MUSIC:
|
|
2328
|
+
return "material-icon-theme:audio";
|
|
2329
|
+
case w.VIDEO:
|
|
2330
|
+
return "material-icon-theme:video";
|
|
2331
|
+
case w.PDF:
|
|
2332
|
+
return "material-icon-theme:pdf";
|
|
2333
|
+
case w.DOCUMENT:
|
|
2334
|
+
return "material-icon-theme:word";
|
|
2335
|
+
case w.APPLICATION:
|
|
2336
|
+
return "material-icon-theme:exe";
|
|
2337
|
+
case w.ARCHIVE:
|
|
2338
|
+
return "material-icon-theme:zip";
|
|
2339
|
+
default:
|
|
2340
|
+
return "material-icon-theme:document";
|
|
2341
|
+
}
|
|
2342
|
+
}), i = U(() => {
|
|
2343
|
+
const n = "file-icon";
|
|
2344
|
+
switch (s.type) {
|
|
2345
|
+
case w.FOLDER:
|
|
2346
|
+
return `${n} file-icon--folder`;
|
|
2347
|
+
case w.IMAGE:
|
|
2348
|
+
return `${n} file-icon--image`;
|
|
2349
|
+
case w.TEXT:
|
|
2350
|
+
return `${n} file-icon--text`;
|
|
2351
|
+
case w.CODE:
|
|
2352
|
+
return `${n} file-icon--code`;
|
|
2353
|
+
case w.MUSIC:
|
|
2354
|
+
return `${n} file-icon--music`;
|
|
2355
|
+
case w.VIDEO:
|
|
2356
|
+
return `${n} file-icon--video`;
|
|
2357
|
+
case w.PDF:
|
|
2358
|
+
case w.DOCUMENT:
|
|
2359
|
+
return `${n} file-icon--pdf`;
|
|
2360
|
+
case w.APPLICATION:
|
|
2361
|
+
return `${n} file-icon--application`;
|
|
2362
|
+
case w.ARCHIVE:
|
|
2363
|
+
return `${n} file-icon--archive`;
|
|
2364
|
+
default:
|
|
2365
|
+
return `${n} file-icon--default`;
|
|
2366
|
+
}
|
|
2367
|
+
});
|
|
2368
|
+
return (n, o) => (h(), x("div", {
|
|
2369
|
+
class: B(e.className)
|
|
2370
|
+
}, [
|
|
2371
|
+
N(P(_), {
|
|
2372
|
+
icon: t.value,
|
|
2373
|
+
width: e.size,
|
|
2374
|
+
height: e.size,
|
|
2375
|
+
class: B(i.value)
|
|
2376
|
+
}, null, 8, ["icon", "width", "height", "class"])
|
|
2377
|
+
], 2));
|
|
2378
|
+
}
|
|
2379
|
+
}), K = (e, s) => {
|
|
2380
|
+
const t = e.__vccOpts || e;
|
|
2381
|
+
for (const [i, n] of s)
|
|
2382
|
+
t[i] = n;
|
|
2383
|
+
return t;
|
|
2384
|
+
}, dt = /* @__PURE__ */ K(On, [["__scopeId", "data-v-25d349c6"]]), Tn = ["draggable", "onDragstart", "onDragover", "onDrop", "onClick", "onDblclick", "onContextmenu"], Ln = { class: "file-grid-item-icon" }, Pn = ["src", "alt"], An = {
|
|
2385
|
+
key: 0,
|
|
2386
|
+
class: "file-grid-item-thumbnail file-grid-item-thumbnail--video"
|
|
2387
|
+
}, Fn = ["src", "alt", "onError"], Nn = ["src", "alt", "onError"], Un = { class: "file-grid-item-name-wrapper" }, Rn = ["value", "onBlur"], Hn = ["onClick", "title"], Wn = { class: "file-grid-item-name-base" }, Bn = { class: "file-grid-item-name-ext" }, Vn = /* @__PURE__ */ G({
|
|
2388
|
+
__name: "FileGrid",
|
|
2389
|
+
props: {
|
|
2390
|
+
items: {},
|
|
2391
|
+
selectedIds: {},
|
|
2392
|
+
editingId: {},
|
|
2393
|
+
dragOverId: {},
|
|
2394
|
+
getAppIconUrl: { type: Function }
|
|
2395
|
+
},
|
|
2396
|
+
emits: ["select", "open", "contextMenu", "contextMenuEmpty", "nameClick", "rename", "renameCancel", "dragStart", "dragOver", "dragLeave", "drop", "thumbnailError"],
|
|
2397
|
+
setup(e, { emit: s }) {
|
|
2398
|
+
function t(r, I) {
|
|
2399
|
+
if (I)
|
|
2400
|
+
return { baseName: r, ext: "" };
|
|
2401
|
+
const g = r.lastIndexOf(".");
|
|
2402
|
+
return g <= 0 ? { baseName: r, ext: "" } : {
|
|
2403
|
+
baseName: r.substring(0, g),
|
|
2404
|
+
ext: r.substring(g)
|
|
2405
|
+
};
|
|
2406
|
+
}
|
|
2407
|
+
const i = /* @__PURE__ */ new Map();
|
|
2408
|
+
function n(r) {
|
|
2409
|
+
const I = `${r.id}-${r.name}`;
|
|
2410
|
+
return i.has(I) || i.set(I, t(r.name, r.type === w.FOLDER)), i.get(I);
|
|
2411
|
+
}
|
|
2412
|
+
const o = e, l = s, p = (r) => {
|
|
2413
|
+
r.target.closest(".file-grid-item") || l("contextMenuEmpty", r);
|
|
2414
|
+
}, c = (r) => {
|
|
2415
|
+
var I;
|
|
2416
|
+
return r.type === w.APPLICATION && ((I = o.getAppIconUrl) != null && I.call(o, r)) ? !0 : r.type === w.IMAGE || r.type === w.VIDEO ? !!r.thumbnailUrl : !1;
|
|
2417
|
+
}, a = (r, I) => {
|
|
2418
|
+
const b = I.target.value.trim();
|
|
2419
|
+
b && b !== r.name ? l("rename", r, b) : l("renameCancel", r);
|
|
2420
|
+
}, d = (r) => {
|
|
2421
|
+
r.target.blur();
|
|
2422
|
+
}, f = (r) => {
|
|
2423
|
+
const I = r.target, g = o.items.find((b) => b.id === o.editingId);
|
|
2424
|
+
g && (I.value = g.name), I.blur();
|
|
2425
|
+
};
|
|
2426
|
+
return (r, I) => (h(), x("div", {
|
|
2427
|
+
class: "file-grid",
|
|
2428
|
+
onContextmenu: H(p, ["prevent"])
|
|
2429
|
+
}, [
|
|
2430
|
+
(h(!0), x(q, null, Y(e.items, (g) => {
|
|
2431
|
+
var b;
|
|
2432
|
+
return h(), x("div", {
|
|
2433
|
+
key: g.id,
|
|
2434
|
+
draggable: e.editingId !== g.id,
|
|
2435
|
+
onDragstart: (y) => r.$emit("dragStart", y, g),
|
|
2436
|
+
onDragover: H((y) => r.$emit("dragOver", y, g), ["prevent"]),
|
|
2437
|
+
onDragleave: I[0] || (I[0] = (y) => r.$emit("dragLeave", y)),
|
|
2438
|
+
onDrop: H((y) => r.$emit("drop", y, g), ["prevent"]),
|
|
2439
|
+
onClick: H((y) => r.$emit("select", g, y), ["stop"]),
|
|
2440
|
+
onDblclick: H((y) => r.$emit("open", g), ["stop"]),
|
|
2441
|
+
onContextmenu: H((y) => r.$emit("contextMenu", g, y), ["prevent", "stop"]),
|
|
2442
|
+
class: B([
|
|
2443
|
+
"file-grid-item",
|
|
2444
|
+
e.selectedIds.has(g.id) && e.editingId !== g.id ? "file-grid-item--selected" : e.dragOverId === g.id ? "file-grid-item--drag-over" : "file-grid-item--normal"
|
|
2445
|
+
])
|
|
2446
|
+
}, [
|
|
2447
|
+
u("div", Ln, [
|
|
2448
|
+
g.type === P(w).APPLICATION && ((b = e.getAppIconUrl) != null && b.call(e, g)) ? (h(), x("img", {
|
|
2449
|
+
key: 0,
|
|
2450
|
+
src: e.getAppIconUrl(g),
|
|
2451
|
+
alt: g.name,
|
|
2452
|
+
class: B([
|
|
2453
|
+
"file-grid-item-thumbnail file-grid-item-thumbnail--application",
|
|
2454
|
+
e.selectedIds.has(g.id) && e.editingId !== g.id ? "file-grid-item-thumbnail--selected" : ""
|
|
2455
|
+
])
|
|
2456
|
+
}, null, 10, Pn)) : c(g) ? (h(), x(q, { key: 1 }, [
|
|
2457
|
+
g.type === P(w).VIDEO && g.thumbnailUrl ? (h(), x("div", An, [
|
|
2458
|
+
u("img", {
|
|
2459
|
+
src: g.thumbnailUrl,
|
|
2460
|
+
class: "file-grid-item-thumbnail",
|
|
2461
|
+
alt: g.name,
|
|
2462
|
+
onError: (y) => r.$emit("thumbnailError", g, y)
|
|
2463
|
+
}, null, 40, Fn),
|
|
2464
|
+
I[1] || (I[1] = u("div", { class: "file-grid-item-video-play" }, [
|
|
2465
|
+
u("div", { class: "file-grid-item-video-play-icon" })
|
|
2466
|
+
], -1))
|
|
2467
|
+
])) : g.thumbnailUrl ? (h(), x("img", {
|
|
2468
|
+
key: 1,
|
|
2469
|
+
src: g.thumbnailUrl,
|
|
2470
|
+
alt: g.name,
|
|
2471
|
+
class: "file-grid-item-thumbnail",
|
|
2472
|
+
onError: (y) => r.$emit("thumbnailError", g, y)
|
|
2473
|
+
}, null, 40, Nn)) : O("", !0)
|
|
2474
|
+
], 64)) : (h(), W(dt, {
|
|
2475
|
+
key: 2,
|
|
2476
|
+
type: g.type,
|
|
2477
|
+
name: g.name,
|
|
2478
|
+
size: 48
|
|
2479
|
+
}, null, 8, ["type", "name"]))
|
|
2480
|
+
]),
|
|
2481
|
+
u("div", Un, [
|
|
2482
|
+
e.editingId === g.id ? (h(), x("input", {
|
|
2483
|
+
key: 0,
|
|
2484
|
+
type: "text",
|
|
2485
|
+
class: "file-grid-item-rename-input",
|
|
2486
|
+
value: g.name,
|
|
2487
|
+
onBlur: (y) => a(g, y),
|
|
2488
|
+
onKeydown: [
|
|
2489
|
+
he(d, ["enter"]),
|
|
2490
|
+
he(f, ["escape"])
|
|
2491
|
+
],
|
|
2492
|
+
ref_for: !0,
|
|
2493
|
+
ref: "renameInput",
|
|
2494
|
+
autofocus: ""
|
|
2495
|
+
}, null, 40, Rn)) : (h(), x("span", {
|
|
2496
|
+
key: 1,
|
|
2497
|
+
onClick: H((y) => r.$emit("nameClick", g, y), ["stop"]),
|
|
2498
|
+
class: B([
|
|
2499
|
+
"file-grid-item-name",
|
|
2500
|
+
e.selectedIds.has(g.id) ? "file-grid-item-name--selected" : ""
|
|
2501
|
+
]),
|
|
2502
|
+
title: g.name
|
|
2503
|
+
}, [
|
|
2504
|
+
n(g).ext ? (h(), x(q, { key: 0 }, [
|
|
2505
|
+
u("span", Wn, T(n(g).baseName), 1),
|
|
2506
|
+
u("span", Bn, T(n(g).ext), 1)
|
|
2507
|
+
], 64)) : (h(), x(q, { key: 1 }, [
|
|
2508
|
+
te(T(g.name), 1)
|
|
2509
|
+
], 64))
|
|
2510
|
+
], 10, Hn))
|
|
2511
|
+
])
|
|
2512
|
+
], 42, Tn);
|
|
2513
|
+
}), 128))
|
|
2514
|
+
], 32));
|
|
2515
|
+
}
|
|
2516
|
+
}), _n = /* @__PURE__ */ K(Vn, [["__scopeId", "data-v-c7f13402"]]), qn = { class: "sort-indicator" }, Gn = /* @__PURE__ */ G({
|
|
2517
|
+
__name: "SortIndicator",
|
|
2518
|
+
props: {
|
|
2519
|
+
direction: {}
|
|
2520
|
+
},
|
|
2521
|
+
setup(e) {
|
|
2522
|
+
return (s, t) => (h(), x("span", qn, [
|
|
2523
|
+
N(P(_), {
|
|
2524
|
+
icon: e.direction === "asc" ? "lucide:chevron-up" : "lucide:chevron-down",
|
|
2525
|
+
width: 12,
|
|
2526
|
+
height: 12
|
|
2527
|
+
}, null, 8, ["icon"])
|
|
2528
|
+
]));
|
|
2529
|
+
}
|
|
2530
|
+
}), de = /* @__PURE__ */ K(Gn, [["__scopeId", "data-v-6757236d"]]), Kn = { class: "file-list-table" }, Qn = { class: "file-list-header" }, Xn = { class: "file-list-body" }, Yn = ["draggable", "onDragstart", "onDragover", "onDrop", "onClick", "onDblclick", "onContextmenu"], Jn = { class: "file-list-cell file-list-cell--name" }, Zn = ["value", "onBlur"], es = ["onClick"], ts = /* @__PURE__ */ G({
|
|
2531
|
+
__name: "FileList",
|
|
2532
|
+
props: {
|
|
2533
|
+
items: {},
|
|
2534
|
+
selectedIds: {},
|
|
2535
|
+
sortConfig: {},
|
|
2536
|
+
editingId: {},
|
|
2537
|
+
dragOverId: {}
|
|
2538
|
+
},
|
|
2539
|
+
emits: ["select", "open", "contextMenu", "contextMenuEmpty", "nameClick", "rename", "renameCancel", "sort", "dragStart", "dragOver", "dragLeave", "drop"],
|
|
2540
|
+
setup(e, { emit: s }) {
|
|
2541
|
+
const t = e, i = s, n = (a) => {
|
|
2542
|
+
a.target.closest("tr") || i("contextMenuEmpty", a);
|
|
2543
|
+
}, o = (a) => ({
|
|
2544
|
+
[w.FOLDER]: "文件夹",
|
|
2545
|
+
[w.FILE]: "文件",
|
|
2546
|
+
[w.IMAGE]: "图片",
|
|
2547
|
+
[w.VIDEO]: "视频",
|
|
2548
|
+
[w.MUSIC]: "音频",
|
|
2549
|
+
[w.DOCUMENT]: "文档",
|
|
2550
|
+
[w.CODE]: "代码",
|
|
2551
|
+
[w.TEXT]: "文本",
|
|
2552
|
+
[w.PDF]: "PDF",
|
|
2553
|
+
[w.ARCHIVE]: "压缩包",
|
|
2554
|
+
[w.APPLICATION]: "应用程序",
|
|
2555
|
+
[w.UNKNOWN]: "未知"
|
|
2556
|
+
})[a] || a, l = (a, d) => {
|
|
2557
|
+
const r = d.target.value.trim();
|
|
2558
|
+
r && r !== a.name ? i("rename", a, r) : i("renameCancel", a);
|
|
2559
|
+
}, p = (a) => {
|
|
2560
|
+
a.target.blur();
|
|
2561
|
+
}, c = (a) => {
|
|
2562
|
+
const d = a.target, f = t.items.find((r) => r.id === t.editingId);
|
|
2563
|
+
f && (d.value = f.name), d.blur();
|
|
2564
|
+
};
|
|
2565
|
+
return (a, d) => {
|
|
2566
|
+
var f, r, I, g;
|
|
2567
|
+
return h(), x("div", {
|
|
2568
|
+
class: "file-list",
|
|
2569
|
+
onContextmenu: H(n, ["prevent"])
|
|
2570
|
+
}, [
|
|
2571
|
+
u("table", Kn, [
|
|
2572
|
+
u("thead", Qn, [
|
|
2573
|
+
u("tr", null, [
|
|
2574
|
+
u("th", {
|
|
2575
|
+
class: "file-list-header-cell file-list-header-cell--name",
|
|
2576
|
+
onClick: d[0] || (d[0] = (b) => a.$emit("sort", "name"))
|
|
2577
|
+
}, [
|
|
2578
|
+
d[5] || (d[5] = te(" 名称 ", -1)),
|
|
2579
|
+
((f = e.sortConfig) == null ? void 0 : f.field) === "name" ? (h(), W(de, {
|
|
2580
|
+
key: 0,
|
|
2581
|
+
direction: e.sortConfig.direction
|
|
2582
|
+
}, null, 8, ["direction"])) : O("", !0)
|
|
2583
|
+
]),
|
|
2584
|
+
u("th", {
|
|
2585
|
+
class: "file-list-header-cell",
|
|
2586
|
+
onClick: d[1] || (d[1] = (b) => a.$emit("sort", "dateModified"))
|
|
2587
|
+
}, [
|
|
2588
|
+
d[6] || (d[6] = te(" 修改日期 ", -1)),
|
|
2589
|
+
((r = e.sortConfig) == null ? void 0 : r.field) === "dateModified" ? (h(), W(de, {
|
|
2590
|
+
key: 0,
|
|
2591
|
+
direction: e.sortConfig.direction
|
|
2592
|
+
}, null, 8, ["direction"])) : O("", !0)
|
|
2593
|
+
]),
|
|
2594
|
+
u("th", {
|
|
2595
|
+
class: "file-list-header-cell",
|
|
2596
|
+
onClick: d[2] || (d[2] = (b) => a.$emit("sort", "size"))
|
|
2597
|
+
}, [
|
|
2598
|
+
d[7] || (d[7] = te(" 大小 ", -1)),
|
|
2599
|
+
((I = e.sortConfig) == null ? void 0 : I.field) === "size" ? (h(), W(de, {
|
|
2600
|
+
key: 0,
|
|
2601
|
+
direction: e.sortConfig.direction
|
|
2602
|
+
}, null, 8, ["direction"])) : O("", !0)
|
|
2603
|
+
]),
|
|
2604
|
+
u("th", {
|
|
2605
|
+
class: "file-list-header-cell",
|
|
2606
|
+
onClick: d[3] || (d[3] = (b) => a.$emit("sort", "type"))
|
|
2607
|
+
}, [
|
|
2608
|
+
d[8] || (d[8] = te(" 类型 ", -1)),
|
|
2609
|
+
((g = e.sortConfig) == null ? void 0 : g.field) === "type" ? (h(), W(de, {
|
|
2610
|
+
key: 0,
|
|
2611
|
+
direction: e.sortConfig.direction
|
|
2612
|
+
}, null, 8, ["direction"])) : O("", !0)
|
|
2613
|
+
])
|
|
2614
|
+
])
|
|
2615
|
+
]),
|
|
2616
|
+
u("tbody", Xn, [
|
|
2617
|
+
(h(!0), x(q, null, Y(e.items, (b, y) => (h(), x("tr", {
|
|
2618
|
+
key: b.id,
|
|
2619
|
+
draggable: e.editingId !== b.id,
|
|
2620
|
+
onDragstart: (S) => a.$emit("dragStart", S, b),
|
|
2621
|
+
onDragover: H((S) => a.$emit("dragOver", S, b), ["prevent"]),
|
|
2622
|
+
onDragleave: d[4] || (d[4] = (S) => a.$emit("dragLeave", S)),
|
|
2623
|
+
onDrop: H((S) => a.$emit("drop", S, b), ["prevent"]),
|
|
2624
|
+
onClick: H((S) => a.$emit("select", b, S), ["stop"]),
|
|
2625
|
+
onDblclick: H((S) => a.$emit("open", b), ["stop"]),
|
|
2626
|
+
onContextmenu: H((S) => a.$emit("contextMenu", b, S), ["prevent", "stop"]),
|
|
2627
|
+
class: B([
|
|
2628
|
+
"file-list-row",
|
|
2629
|
+
e.selectedIds.has(b.id) ? "file-list-row--selected" : e.dragOverId === b.id ? "file-list-row--drag-over" : y % 2 === 0 ? "file-list-row--even" : "file-list-row--odd"
|
|
2630
|
+
])
|
|
2631
|
+
}, [
|
|
2632
|
+
u("td", Jn, [
|
|
2633
|
+
N(dt, {
|
|
2634
|
+
type: b.type,
|
|
2635
|
+
name: b.name,
|
|
2636
|
+
size: 16
|
|
2637
|
+
}, null, 8, ["type", "name"]),
|
|
2638
|
+
e.editingId === b.id ? (h(), x("input", {
|
|
2639
|
+
key: 0,
|
|
2640
|
+
type: "text",
|
|
2641
|
+
class: "file-list-rename-input",
|
|
2642
|
+
value: b.name,
|
|
2643
|
+
onBlur: (S) => l(b, S),
|
|
2644
|
+
onKeydown: [
|
|
2645
|
+
he(p, ["enter"]),
|
|
2646
|
+
he(c, ["escape"])
|
|
2647
|
+
],
|
|
2648
|
+
autofocus: ""
|
|
2649
|
+
}, null, 40, Zn)) : (h(), x("span", {
|
|
2650
|
+
key: 1,
|
|
2651
|
+
onClick: H((S) => a.$emit("nameClick", b, S), ["stop"]),
|
|
2652
|
+
class: B([
|
|
2653
|
+
"file-list-name",
|
|
2654
|
+
e.selectedIds.has(b.id) ? "file-list-name--selected" : ""
|
|
2655
|
+
])
|
|
2656
|
+
}, T(b.name), 11, es))
|
|
2657
|
+
]),
|
|
2658
|
+
u("td", {
|
|
2659
|
+
class: B(["file-list-cell", e.selectedIds.has(b.id) ? "file-list-cell--selected" : ""])
|
|
2660
|
+
}, T(b.dateModified || "--"), 3),
|
|
2661
|
+
u("td", {
|
|
2662
|
+
class: B(["file-list-cell file-list-cell--size", e.selectedIds.has(b.id) ? "file-list-cell--selected" : ""])
|
|
2663
|
+
}, T(b.size || "--"), 3),
|
|
2664
|
+
u("td", {
|
|
2665
|
+
class: B(["file-list-cell", e.selectedIds.has(b.id) ? "file-list-cell--selected" : ""])
|
|
2666
|
+
}, T(o(b.type)), 3)
|
|
2667
|
+
], 42, Yn))), 128))
|
|
2668
|
+
])
|
|
2669
|
+
])
|
|
2670
|
+
], 32);
|
|
2671
|
+
};
|
|
2672
|
+
}
|
|
2673
|
+
}), ns = /* @__PURE__ */ K(ts, [["__scopeId", "data-v-c6cf2ecb"]]), ss = {
|
|
2674
|
+
key: 0,
|
|
2675
|
+
class: "file-list-view-loading"
|
|
2676
|
+
}, is = {
|
|
2677
|
+
key: 1,
|
|
2678
|
+
class: "file-list-view-empty"
|
|
2679
|
+
}, os = /* @__PURE__ */ G({
|
|
2680
|
+
__name: "FileListView",
|
|
2681
|
+
props: {
|
|
2682
|
+
items: {},
|
|
2683
|
+
viewMode: { default: "grid" },
|
|
2684
|
+
loading: { type: Boolean, default: !1 },
|
|
2685
|
+
adapter: {},
|
|
2686
|
+
currentPath: {},
|
|
2687
|
+
getAppIconUrl: {}
|
|
2688
|
+
},
|
|
2689
|
+
emits: ["open", "selection-change", "context-menu", "context-menu-empty", "rename", "sort-change", "move"],
|
|
2690
|
+
setup(e, { expose: s, emit: t }) {
|
|
2691
|
+
const i = e, n = t, o = M(/* @__PURE__ */ new Set()), l = M(null), p = M(null), c = M({ field: "name", direction: "asc" }), a = U(
|
|
2692
|
+
() => i.items.filter((E) => o.value.has(E.id))
|
|
2693
|
+
), d = (E, D) => {
|
|
2694
|
+
if (D.metaKey || D.ctrlKey) {
|
|
2695
|
+
const F = new Set(o.value);
|
|
2696
|
+
F.has(E.id) ? F.delete(E.id) : F.add(E.id), o.value = F;
|
|
2697
|
+
} else if (D.shiftKey && o.value.size > 0) {
|
|
2698
|
+
const F = Array.from(o.value).pop(), V = i.items.findIndex((Z) => Z.id === F), Q = i.items.findIndex((Z) => Z.id === E.id), ce = Math.min(V, Q), ue = Math.max(V, Q), Te = /* @__PURE__ */ new Set();
|
|
2699
|
+
for (let Z = ce; Z <= ue; Z++)
|
|
2700
|
+
Te.add(i.items[Z].id);
|
|
2701
|
+
o.value = Te;
|
|
2702
|
+
} else
|
|
2703
|
+
o.value = /* @__PURE__ */ new Set([E.id]);
|
|
2704
|
+
n("selection-change", o.value, a.value);
|
|
2705
|
+
}, f = (E) => {
|
|
2706
|
+
E.target === E.currentTarget && r();
|
|
2707
|
+
}, r = () => {
|
|
2708
|
+
o.value = /* @__PURE__ */ new Set(), n("selection-change", o.value, []);
|
|
2709
|
+
}, I = (E) => {
|
|
2710
|
+
n("open", E);
|
|
2711
|
+
}, g = (E, D) => {
|
|
2712
|
+
o.value.has(E.id) || (o.value = /* @__PURE__ */ new Set([E.id]), n("selection-change", o.value, [E])), n("context-menu", D, E);
|
|
2713
|
+
}, b = (E) => {
|
|
2714
|
+
const D = E.target;
|
|
2715
|
+
!D.closest(".file-grid-item") && !D.closest(".file-list-row") && (r(), n("context-menu-empty", E));
|
|
2716
|
+
}, y = (E) => {
|
|
2717
|
+
r(), n("context-menu-empty", E);
|
|
2718
|
+
}, S = (E, D) => {
|
|
2719
|
+
o.value.has(E.id) && o.value.size === 1 && setTimeout(() => {
|
|
2720
|
+
o.value.has(E.id) && (l.value = E.id);
|
|
2721
|
+
}, 500);
|
|
2722
|
+
}, z = (E, D) => {
|
|
2723
|
+
D && D !== E.name && n("rename", E, D), l.value = null;
|
|
2724
|
+
}, C = () => {
|
|
2725
|
+
l.value = null;
|
|
2726
|
+
}, v = (E) => {
|
|
2727
|
+
c.value.field === E ? c.value.direction = c.value.direction === "asc" ? "desc" : "asc" : (c.value.field = E, c.value.direction = "asc"), n("sort-change", { ...c.value });
|
|
2728
|
+
}, L = (E, D) => {
|
|
2729
|
+
var F;
|
|
2730
|
+
o.value.has(D.id) || (o.value = /* @__PURE__ */ new Set([D.id]), n("selection-change", o.value, [D])), (F = E.dataTransfer) == null || F.setData("text/plain", JSON.stringify([...o.value]));
|
|
2731
|
+
}, j = (E, D) => {
|
|
2732
|
+
D.type === w.FOLDER && !o.value.has(D.id) && (p.value = D.id);
|
|
2733
|
+
}, m = () => {
|
|
2734
|
+
p.value = null;
|
|
2735
|
+
}, $ = (E, D) => {
|
|
2736
|
+
var V;
|
|
2737
|
+
if (p.value = null, D.type !== w.FOLDER) return;
|
|
2738
|
+
const F = (V = E.dataTransfer) == null ? void 0 : V.getData("text/plain");
|
|
2739
|
+
if (F)
|
|
2740
|
+
try {
|
|
2741
|
+
const Q = JSON.parse(F);
|
|
2742
|
+
if (Q.includes(D.id)) return;
|
|
2743
|
+
n("move", Q, D.id), r();
|
|
2744
|
+
} catch (Q) {
|
|
2745
|
+
console.error("拖拽解析失败:", Q);
|
|
2746
|
+
}
|
|
2747
|
+
};
|
|
2748
|
+
return s({
|
|
2749
|
+
clearSelection: r,
|
|
2750
|
+
startRename: (E) => {
|
|
2751
|
+
l.value = E;
|
|
2752
|
+
},
|
|
2753
|
+
selectAll: () => {
|
|
2754
|
+
o.value = new Set(i.items.map((E) => E.id)), n("selection-change", o.value, i.items);
|
|
2755
|
+
},
|
|
2756
|
+
selectedIds: o,
|
|
2757
|
+
selectedItems: a
|
|
2758
|
+
}), (E, D) => (h(), x("div", {
|
|
2759
|
+
class: "file-list-view",
|
|
2760
|
+
onClick: f,
|
|
2761
|
+
onContextmenu: H(b, ["prevent"])
|
|
2762
|
+
}, [
|
|
2763
|
+
e.loading ? (h(), x("div", ss, [...D[0] || (D[0] = [
|
|
2764
|
+
u("div", { class: "file-list-view-spinner" }, null, -1),
|
|
2765
|
+
u("p", null, "加载中...", -1)
|
|
2766
|
+
])])) : e.items.length === 0 ? (h(), x("div", is, [
|
|
2767
|
+
N(P(Ye), {
|
|
2768
|
+
size: 64,
|
|
2769
|
+
class: "file-list-view-empty-icon"
|
|
2770
|
+
}),
|
|
2771
|
+
D[1] || (D[1] = u("p", null, "文件夹为空", -1))
|
|
2772
|
+
])) : e.viewMode === "grid" ? (h(), W(_n, {
|
|
2773
|
+
key: 2,
|
|
2774
|
+
items: e.items,
|
|
2775
|
+
"selected-ids": o.value,
|
|
2776
|
+
"editing-id": l.value,
|
|
2777
|
+
"drag-over-id": p.value,
|
|
2778
|
+
"get-app-icon-url": e.getAppIconUrl,
|
|
2779
|
+
onSelect: d,
|
|
2780
|
+
onOpen: I,
|
|
2781
|
+
onContextMenu: g,
|
|
2782
|
+
onContextMenuEmpty: y,
|
|
2783
|
+
onNameClick: S,
|
|
2784
|
+
onRename: z,
|
|
2785
|
+
onRenameCancel: C,
|
|
2786
|
+
onDragStart: L,
|
|
2787
|
+
onDragOver: j,
|
|
2788
|
+
onDragLeave: m,
|
|
2789
|
+
onDrop: $
|
|
2790
|
+
}, null, 8, ["items", "selected-ids", "editing-id", "drag-over-id", "get-app-icon-url"])) : (h(), W(ns, {
|
|
2791
|
+
key: 3,
|
|
2792
|
+
items: e.items,
|
|
2793
|
+
"selected-ids": o.value,
|
|
2794
|
+
"editing-id": l.value,
|
|
2795
|
+
"drag-over-id": p.value,
|
|
2796
|
+
"sort-config": c.value,
|
|
2797
|
+
onSelect: d,
|
|
2798
|
+
onOpen: I,
|
|
2799
|
+
onContextMenu: g,
|
|
2800
|
+
onContextMenuEmpty: y,
|
|
2801
|
+
onNameClick: S,
|
|
2802
|
+
onRename: z,
|
|
2803
|
+
onRenameCancel: C,
|
|
2804
|
+
onSort: v,
|
|
2805
|
+
onDragStart: L,
|
|
2806
|
+
onDragOver: j,
|
|
2807
|
+
onDragLeave: m,
|
|
2808
|
+
onDrop: $
|
|
2809
|
+
}, null, 8, ["items", "selected-ids", "editing-id", "drag-over-id", "sort-config"]))
|
|
2810
|
+
], 32));
|
|
2811
|
+
}
|
|
2812
|
+
}), io = /* @__PURE__ */ K(os, [["__scopeId", "data-v-4c583360"]]), ls = { class: "file-sidebar" }, rs = { class: "file-sidebar-section-title" }, as = { class: "file-sidebar-list" }, cs = ["onClick"], us = /* @__PURE__ */ G({
|
|
2813
|
+
__name: "FileSidebar",
|
|
2814
|
+
props: {
|
|
2815
|
+
sections: {},
|
|
2816
|
+
activeId: {}
|
|
2817
|
+
},
|
|
2818
|
+
emits: ["navigate"],
|
|
2819
|
+
setup(e, { emit: s }) {
|
|
2820
|
+
const t = s, i = (o) => o ? o.includes(":") ? o : `lucide:${o.toLowerCase()}` : "mdi:folder", n = (o) => {
|
|
2821
|
+
t("navigate", o);
|
|
2822
|
+
};
|
|
2823
|
+
return (o, l) => (h(), x("div", ls, [
|
|
2824
|
+
(h(!0), x(q, null, Y(e.sections, (p) => (h(), x("div", {
|
|
2825
|
+
key: p.id,
|
|
2826
|
+
class: "file-sidebar-section"
|
|
2827
|
+
}, [
|
|
2828
|
+
u("div", rs, T(p.title), 1),
|
|
2829
|
+
u("ul", as, [
|
|
2830
|
+
(h(!0), x(q, null, Y(p.items, (c) => (h(), x("li", {
|
|
2831
|
+
key: c.id,
|
|
2832
|
+
onClick: (a) => n(c),
|
|
2833
|
+
class: B([
|
|
2834
|
+
"file-sidebar-item",
|
|
2835
|
+
e.activeId === c.id ? "file-sidebar-item--active" : ""
|
|
2836
|
+
])
|
|
2837
|
+
}, [
|
|
2838
|
+
N(P(_), {
|
|
2839
|
+
icon: i(c.icon),
|
|
2840
|
+
width: 18,
|
|
2841
|
+
height: 18,
|
|
2842
|
+
class: B(e.activeId === c.id ? "file-sidebar-item-icon--active" : "file-sidebar-item-icon")
|
|
2843
|
+
}, null, 8, ["icon", "class"]),
|
|
2844
|
+
u("span", null, T(c.label), 1)
|
|
2845
|
+
], 10, cs))), 128))
|
|
2846
|
+
])
|
|
2847
|
+
]))), 128))
|
|
2848
|
+
]));
|
|
2849
|
+
}
|
|
2850
|
+
}), oo = /* @__PURE__ */ K(us, [["__scopeId", "data-v-f672ee42"]]), ds = { class: "file-breadcrumb" }, fs = ["onClick"], ms = /* @__PURE__ */ G({
|
|
2851
|
+
__name: "Breadcrumb",
|
|
2852
|
+
props: {
|
|
2853
|
+
items: {}
|
|
2854
|
+
},
|
|
2855
|
+
emits: ["navigate"],
|
|
2856
|
+
setup(e, { emit: s }) {
|
|
2857
|
+
const t = e, i = s, n = (o, l) => {
|
|
2858
|
+
l < t.items.length - 1 && i("navigate", o, l);
|
|
2859
|
+
};
|
|
2860
|
+
return (o, l) => (h(), x("div", ds, [
|
|
2861
|
+
(h(!0), x(q, null, Y(e.items, (p, c) => (h(), x("span", {
|
|
2862
|
+
key: p.id,
|
|
2863
|
+
class: "file-breadcrumb-item"
|
|
2864
|
+
}, [
|
|
2865
|
+
u("span", {
|
|
2866
|
+
onClick: (a) => n(p, c),
|
|
2867
|
+
class: B([
|
|
2868
|
+
"file-breadcrumb-link",
|
|
2869
|
+
c === e.items.length - 1 ? "file-breadcrumb-link--current" : ""
|
|
2870
|
+
])
|
|
2871
|
+
}, T(p.name), 11, fs),
|
|
2872
|
+
c < e.items.length - 1 ? (h(), W(P(_), {
|
|
2873
|
+
key: 0,
|
|
2874
|
+
icon: "lucide:chevron-right",
|
|
2875
|
+
width: 14,
|
|
2876
|
+
height: 14,
|
|
2877
|
+
class: "file-breadcrumb-separator"
|
|
2878
|
+
})) : O("", !0)
|
|
2879
|
+
]))), 128))
|
|
2880
|
+
]));
|
|
2881
|
+
}
|
|
2882
|
+
}), ps = /* @__PURE__ */ K(ms, [["__scopeId", "data-v-632c82e3"]]), gs = { class: "file-toolbar-nav" }, hs = ["disabled"], vs = ["disabled"], bs = { class: "file-toolbar-breadcrumb" }, ys = {
|
|
2883
|
+
key: 0,
|
|
2884
|
+
class: "file-toolbar-custom"
|
|
2885
|
+
}, ws = { class: "file-toolbar-actions" }, ks = {
|
|
2886
|
+
key: 0,
|
|
2887
|
+
class: "file-toolbar-search"
|
|
2888
|
+
}, xs = ["value"], Is = {
|
|
2889
|
+
key: 1,
|
|
2890
|
+
class: "file-toolbar-view-toggle"
|
|
2891
|
+
}, Cs = /* @__PURE__ */ G({
|
|
2892
|
+
__name: "Toolbar",
|
|
2893
|
+
props: {
|
|
2894
|
+
canGoBack: { type: Boolean, default: !1 },
|
|
2895
|
+
canGoForward: { type: Boolean, default: !1 },
|
|
2896
|
+
breadcrumbs: { default: () => [] },
|
|
2897
|
+
viewMode: { default: "grid" },
|
|
2898
|
+
searchQuery: { default: "" },
|
|
2899
|
+
showSearch: { type: Boolean, default: !1 },
|
|
2900
|
+
showViewToggle: { type: Boolean, default: !0 },
|
|
2901
|
+
draggable: { type: Boolean, default: !1 }
|
|
2902
|
+
},
|
|
2903
|
+
emits: ["back", "forward", "breadcrumb-navigate", "update:viewMode", "update:searchQuery"],
|
|
2904
|
+
setup(e, { emit: s }) {
|
|
2905
|
+
const t = s;
|
|
2906
|
+
return (i, n) => (h(), x("div", {
|
|
2907
|
+
class: B(["file-toolbar", { "file-toolbar--draggable": e.draggable }])
|
|
2908
|
+
}, [
|
|
2909
|
+
u("div", gs, [
|
|
2910
|
+
u("button", {
|
|
2911
|
+
class: "file-toolbar-button",
|
|
2912
|
+
onClick: n[0] || (n[0] = (o) => t("back")),
|
|
2913
|
+
disabled: !e.canGoBack,
|
|
2914
|
+
title: "后退"
|
|
2915
|
+
}, [
|
|
2916
|
+
N(P(_), {
|
|
2917
|
+
icon: "lucide:chevron-left",
|
|
2918
|
+
width: 18,
|
|
2919
|
+
height: 18
|
|
2920
|
+
})
|
|
2921
|
+
], 8, hs),
|
|
2922
|
+
u("button", {
|
|
2923
|
+
class: "file-toolbar-button",
|
|
2924
|
+
onClick: n[1] || (n[1] = (o) => t("forward")),
|
|
2925
|
+
disabled: !e.canGoForward,
|
|
2926
|
+
title: "前进"
|
|
2927
|
+
}, [
|
|
2928
|
+
N(P(_), {
|
|
2929
|
+
icon: "lucide:chevron-right",
|
|
2930
|
+
width: 18,
|
|
2931
|
+
height: 18
|
|
2932
|
+
})
|
|
2933
|
+
], 8, vs)
|
|
2934
|
+
]),
|
|
2935
|
+
u("div", bs, [
|
|
2936
|
+
ee(i.$slots, "breadcrumb", {}, () => [
|
|
2937
|
+
e.breadcrumbs.length > 0 ? (h(), W(ps, {
|
|
2938
|
+
key: 0,
|
|
2939
|
+
items: e.breadcrumbs,
|
|
2940
|
+
onNavigate: n[2] || (n[2] = (o) => t("breadcrumb-navigate", o))
|
|
2941
|
+
}, null, 8, ["items"])) : O("", !0)
|
|
2942
|
+
], !0)
|
|
2943
|
+
]),
|
|
2944
|
+
i.$slots.default ? (h(), x("div", ys, [
|
|
2945
|
+
ee(i.$slots, "default", {}, void 0, !0)
|
|
2946
|
+
])) : O("", !0),
|
|
2947
|
+
u("div", ws, [
|
|
2948
|
+
e.showSearch ? (h(), x("div", ks, [
|
|
2949
|
+
N(P(_), {
|
|
2950
|
+
icon: "lucide:search",
|
|
2951
|
+
width: 16,
|
|
2952
|
+
height: 16,
|
|
2953
|
+
class: "file-toolbar-search-icon"
|
|
2954
|
+
}),
|
|
2955
|
+
u("input", {
|
|
2956
|
+
type: "text",
|
|
2957
|
+
value: e.searchQuery,
|
|
2958
|
+
onInput: n[3] || (n[3] = (o) => t("update:searchQuery", o.target.value)),
|
|
2959
|
+
placeholder: "搜索",
|
|
2960
|
+
class: "file-toolbar-search-input"
|
|
2961
|
+
}, null, 40, xs)
|
|
2962
|
+
])) : O("", !0),
|
|
2963
|
+
e.showViewToggle ? (h(), x("div", Is, [
|
|
2964
|
+
u("button", {
|
|
2965
|
+
onClick: n[4] || (n[4] = (o) => t("update:viewMode", "grid")),
|
|
2966
|
+
class: B(["file-toolbar-button", e.viewMode === "grid" ? "file-toolbar-button--active" : ""]),
|
|
2967
|
+
title: "网格视图"
|
|
2968
|
+
}, [
|
|
2969
|
+
N(P(_), {
|
|
2970
|
+
icon: "lucide:layout-grid",
|
|
2971
|
+
width: 18,
|
|
2972
|
+
height: 18
|
|
2973
|
+
})
|
|
2974
|
+
], 2),
|
|
2975
|
+
u("button", {
|
|
2976
|
+
onClick: n[5] || (n[5] = (o) => t("update:viewMode", "list")),
|
|
2977
|
+
class: B(["file-toolbar-button", e.viewMode === "list" ? "file-toolbar-button--active" : ""]),
|
|
2978
|
+
title: "列表视图"
|
|
2979
|
+
}, [
|
|
2980
|
+
N(P(_), {
|
|
2981
|
+
icon: "lucide:list",
|
|
2982
|
+
width: 18,
|
|
2983
|
+
height: 18
|
|
2984
|
+
})
|
|
2985
|
+
], 2)
|
|
2986
|
+
])) : O("", !0),
|
|
2987
|
+
ee(i.$slots, "actions", {}, void 0, !0)
|
|
2988
|
+
])
|
|
2989
|
+
], 2));
|
|
2990
|
+
}
|
|
2991
|
+
}), lo = /* @__PURE__ */ K(Cs, [["__scopeId", "data-v-d9b74270"]]), $s = { class: "file-status-bar" }, Es = { key: 0 }, js = /* @__PURE__ */ G({
|
|
2992
|
+
__name: "StatusBar",
|
|
2993
|
+
props: {
|
|
2994
|
+
itemCount: { default: 0 },
|
|
2995
|
+
selectedCount: { default: 0 }
|
|
2996
|
+
},
|
|
2997
|
+
setup(e) {
|
|
2998
|
+
return (s, t) => (h(), x("div", $s, [
|
|
2999
|
+
ee(s.$slots, "default", {}, () => [
|
|
3000
|
+
u("span", null, T(e.itemCount) + " 个项目", 1),
|
|
3001
|
+
e.selectedCount > 0 ? (h(), x("span", Es, " • 已选择 " + T(e.selectedCount) + " 个", 1)) : O("", !0)
|
|
3002
|
+
], !0)
|
|
3003
|
+
]));
|
|
3004
|
+
}
|
|
3005
|
+
}), ro = /* @__PURE__ */ K(js, [["__scopeId", "data-v-f63c7226"]]), Ms = {
|
|
3006
|
+
key: 0,
|
|
3007
|
+
class: "context-menu-container"
|
|
3008
|
+
}, Ss = {
|
|
3009
|
+
key: 0,
|
|
3010
|
+
class: "context-menu-separator"
|
|
3011
|
+
}, Ds = ["onClick", "onMouseenter"], zs = { class: "context-menu-item-label" }, Os = {
|
|
3012
|
+
key: 2,
|
|
3013
|
+
class: "context-menu-item-shortcut"
|
|
3014
|
+
}, Ts = {
|
|
3015
|
+
key: 0,
|
|
3016
|
+
class: "context-menu-separator"
|
|
3017
|
+
}, Ls = ["onClick"], Ps = { class: "context-menu-item-label" }, As = {
|
|
3018
|
+
key: 2,
|
|
3019
|
+
class: "context-menu-item-shortcut"
|
|
3020
|
+
}, R = 8, X = 220, Fs = 32, Ns = 9, Us = 8, fe = 0, Rs = /* @__PURE__ */ G({
|
|
3021
|
+
__name: "ContextMenu",
|
|
3022
|
+
props: {
|
|
3023
|
+
visible: { type: Boolean },
|
|
3024
|
+
x: {},
|
|
3025
|
+
y: {},
|
|
3026
|
+
options: {}
|
|
3027
|
+
},
|
|
3028
|
+
emits: ["close", "select"],
|
|
3029
|
+
setup(e, { emit: s }) {
|
|
3030
|
+
const t = e, i = s;
|
|
3031
|
+
function n(m) {
|
|
3032
|
+
let $ = Us;
|
|
3033
|
+
for (const k of m)
|
|
3034
|
+
$ += k.separator ? Ns : Fs;
|
|
3035
|
+
return $;
|
|
3036
|
+
}
|
|
3037
|
+
function o(m, $, k) {
|
|
3038
|
+
const A = window.innerWidth, E = window.innerHeight;
|
|
3039
|
+
let D = m, F = $;
|
|
3040
|
+
const V = A - m, Q = m;
|
|
3041
|
+
V < X + R && (Q >= X + R ? D = m - X : V > Q ? D = A - X - R : D = R);
|
|
3042
|
+
const ce = E - $, ue = $;
|
|
3043
|
+
return ce < k + R && (ue >= k + R ? F = $ - k : ce > ue ? F = E - k - R : F = R), D = Math.max(R, Math.min(D, A - X - R)), F = Math.max(R, Math.min(F, E - k - R)), { x: D, y: F };
|
|
3044
|
+
}
|
|
3045
|
+
function l(m, $) {
|
|
3046
|
+
const k = window.innerWidth, A = window.innerHeight, E = k - m.right, D = m.left;
|
|
3047
|
+
let F, V;
|
|
3048
|
+
return E >= X + fe + R ? F = m.right + fe : D >= X + fe + R ? F = m.left - X - fe : E > D ? F = k - X - R : F = R, V = m.top, V + $ > A - R && (V = A - $ - R), V < R && (V = R), { x: F, y: V };
|
|
3049
|
+
}
|
|
3050
|
+
const p = M(null), c = M(null), a = M(null), d = M(/* @__PURE__ */ new Map()), f = U(() => {
|
|
3051
|
+
const m = n(t.options);
|
|
3052
|
+
return o(t.x, t.y, m);
|
|
3053
|
+
}), r = U(() => ({
|
|
3054
|
+
left: `${f.value.x}px`,
|
|
3055
|
+
top: `${f.value.y}px`
|
|
3056
|
+
})), I = U(() => a.value ? {
|
|
3057
|
+
left: `${a.value.x}px`,
|
|
3058
|
+
top: `${a.value.y}px`
|
|
3059
|
+
} : {}), g = U(() => c.value ? t.options.find((m) => m.id === c.value && m.children && m.children.length > 0) : null), b = (m, $) => {
|
|
3060
|
+
$ && $ instanceof HTMLElement ? d.value.set(m, $) : d.value.delete(m);
|
|
3061
|
+
}, y = (m) => m.children && m.children.length > 0;
|
|
3062
|
+
J(c, (m) => {
|
|
3063
|
+
if (!m || !g.value) {
|
|
3064
|
+
a.value = null;
|
|
3065
|
+
return;
|
|
3066
|
+
}
|
|
3067
|
+
Se(() => {
|
|
3068
|
+
var E;
|
|
3069
|
+
const $ = d.value.get(m);
|
|
3070
|
+
if (!$ || !((E = g.value) != null && E.children)) {
|
|
3071
|
+
a.value = null;
|
|
3072
|
+
return;
|
|
3073
|
+
}
|
|
3074
|
+
const k = $.getBoundingClientRect(), A = n(g.value.children);
|
|
3075
|
+
a.value = l(k, A);
|
|
3076
|
+
});
|
|
3077
|
+
}), J(() => t.visible, (m) => {
|
|
3078
|
+
m || (c.value = null, a.value = null);
|
|
3079
|
+
});
|
|
3080
|
+
const S = (m) => {
|
|
3081
|
+
const $ = m.target, k = document.querySelector(".context-menu-container");
|
|
3082
|
+
k && k.contains($) || i("close");
|
|
3083
|
+
}, z = (m) => {
|
|
3084
|
+
m.key === "Escape" && i("close");
|
|
3085
|
+
};
|
|
3086
|
+
J(() => t.visible, (m) => {
|
|
3087
|
+
m ? (document.addEventListener("mousedown", S), document.addEventListener("keydown", z)) : (document.removeEventListener("mousedown", S), document.removeEventListener("keydown", z));
|
|
3088
|
+
}, { immediate: !0 }), se(() => {
|
|
3089
|
+
document.removeEventListener("mousedown", S), document.removeEventListener("keydown", z);
|
|
3090
|
+
});
|
|
3091
|
+
const C = (m) => {
|
|
3092
|
+
m.disabled || m.children && m.children.length > 0 || (m.action && m.action(), i("select", m), i("close"));
|
|
3093
|
+
}, v = (m) => {
|
|
3094
|
+
m.children && m.children.length > 0 ? c.value = m.id : c.value = null;
|
|
3095
|
+
}, L = () => {
|
|
3096
|
+
}, j = () => {
|
|
3097
|
+
c.value = null;
|
|
3098
|
+
};
|
|
3099
|
+
return (m, $) => (h(), W(ae, { to: "body" }, [
|
|
3100
|
+
e.visible ? (h(), x("div", Ms, [
|
|
3101
|
+
u("div", {
|
|
3102
|
+
ref_key: "menuRef",
|
|
3103
|
+
ref: p,
|
|
3104
|
+
class: "context-menu",
|
|
3105
|
+
style: ve(r.value)
|
|
3106
|
+
}, [
|
|
3107
|
+
(h(!0), x(q, null, Y(e.options, (k, A) => (h(), x(q, {
|
|
3108
|
+
key: k.id || A
|
|
3109
|
+
}, [
|
|
3110
|
+
k.separator ? (h(), x("div", Ss)) : (h(), x("div", {
|
|
3111
|
+
key: 1,
|
|
3112
|
+
ref_for: !0,
|
|
3113
|
+
ref: (E) => b(k.id, E),
|
|
3114
|
+
class: B([
|
|
3115
|
+
"context-menu-item",
|
|
3116
|
+
k.disabled ? "context-menu-item--disabled" : "",
|
|
3117
|
+
k.danger ? "context-menu-item--danger" : "",
|
|
3118
|
+
y(k) ? "context-menu-item--has-children" : "",
|
|
3119
|
+
c.value === k.id ? "context-menu-item--active" : ""
|
|
3120
|
+
]),
|
|
3121
|
+
onClick: (E) => C(k),
|
|
3122
|
+
onMouseenter: (E) => v(k)
|
|
3123
|
+
}, [
|
|
3124
|
+
k.icon ? (h(), W(P(_), {
|
|
3125
|
+
key: 0,
|
|
3126
|
+
icon: k.icon,
|
|
3127
|
+
width: "16",
|
|
3128
|
+
height: "16",
|
|
3129
|
+
class: "context-menu-item-icon"
|
|
3130
|
+
}, null, 8, ["icon"])) : O("", !0),
|
|
3131
|
+
u("span", zs, T(k.label), 1),
|
|
3132
|
+
k.checked ? (h(), W(P(_), {
|
|
3133
|
+
key: 1,
|
|
3134
|
+
icon: "lucide:check",
|
|
3135
|
+
width: "14",
|
|
3136
|
+
height: "14",
|
|
3137
|
+
class: "context-menu-item-check"
|
|
3138
|
+
})) : O("", !0),
|
|
3139
|
+
k.shortcut && !y(k) ? (h(), x("span", Os, T(k.shortcut), 1)) : O("", !0),
|
|
3140
|
+
y(k) ? (h(), W(P(_), {
|
|
3141
|
+
key: 3,
|
|
3142
|
+
icon: "lucide:chevron-right",
|
|
3143
|
+
width: "14",
|
|
3144
|
+
height: "14",
|
|
3145
|
+
class: "context-menu-item-arrow"
|
|
3146
|
+
})) : O("", !0)
|
|
3147
|
+
], 42, Ds))
|
|
3148
|
+
], 64))), 128))
|
|
3149
|
+
], 4),
|
|
3150
|
+
g.value && a.value ? (h(), x("div", {
|
|
3151
|
+
key: 0,
|
|
3152
|
+
class: "context-menu context-menu-submenu",
|
|
3153
|
+
style: ve(I.value),
|
|
3154
|
+
onMouseenter: L,
|
|
3155
|
+
onMouseleave: j
|
|
3156
|
+
}, [
|
|
3157
|
+
(h(!0), x(q, null, Y(g.value.children, (k, A) => (h(), x(q, {
|
|
3158
|
+
key: k.id || A
|
|
3159
|
+
}, [
|
|
3160
|
+
k.separator ? (h(), x("div", Ts)) : (h(), x("div", {
|
|
3161
|
+
key: 1,
|
|
3162
|
+
class: B([
|
|
3163
|
+
"context-menu-item",
|
|
3164
|
+
k.disabled ? "context-menu-item--disabled" : "",
|
|
3165
|
+
k.danger ? "context-menu-item--danger" : ""
|
|
3166
|
+
]),
|
|
3167
|
+
onClick: (E) => C(k)
|
|
3168
|
+
}, [
|
|
3169
|
+
k.icon ? (h(), W(P(_), {
|
|
3170
|
+
key: 0,
|
|
3171
|
+
icon: k.icon,
|
|
3172
|
+
width: "16",
|
|
3173
|
+
height: "16",
|
|
3174
|
+
class: "context-menu-item-icon"
|
|
3175
|
+
}, null, 8, ["icon"])) : O("", !0),
|
|
3176
|
+
u("span", Ps, T(k.label), 1),
|
|
3177
|
+
k.checked ? (h(), W(P(_), {
|
|
3178
|
+
key: 1,
|
|
3179
|
+
icon: "lucide:check",
|
|
3180
|
+
width: "14",
|
|
3181
|
+
height: "14",
|
|
3182
|
+
class: "context-menu-item-check"
|
|
3183
|
+
})) : O("", !0),
|
|
3184
|
+
k.shortcut ? (h(), x("span", As, T(k.shortcut), 1)) : O("", !0)
|
|
3185
|
+
], 10, Ls))
|
|
3186
|
+
], 64))), 128))
|
|
3187
|
+
], 36)) : O("", !0)
|
|
3188
|
+
])) : O("", !0)
|
|
3189
|
+
]));
|
|
3190
|
+
}
|
|
3191
|
+
}), ao = /* @__PURE__ */ K(Rs, [["__scopeId", "data-v-503c7155"]]);
|
|
3192
|
+
function Hs() {
|
|
3193
|
+
const e = M({ x: 0, y: 0 }), s = M(!1), t = (o) => {
|
|
3194
|
+
s.value && (e.value = {
|
|
3195
|
+
x: e.value.x + o.movementX,
|
|
3196
|
+
y: e.value.y + o.movementY
|
|
3197
|
+
});
|
|
3198
|
+
}, i = () => {
|
|
3199
|
+
s.value = !1;
|
|
3200
|
+
}, n = (o) => {
|
|
3201
|
+
const l = o.target;
|
|
3202
|
+
l.closest(".draggable-area") && !l.closest("button") && (o.preventDefault(), s.value = !0);
|
|
3203
|
+
};
|
|
3204
|
+
return J(s, (o) => {
|
|
3205
|
+
o ? (window.addEventListener("mousemove", t), window.addEventListener("mouseup", i)) : (window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", i));
|
|
3206
|
+
}), se(() => {
|
|
3207
|
+
window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", i);
|
|
3208
|
+
}), {
|
|
3209
|
+
position: e,
|
|
3210
|
+
isDragging: s,
|
|
3211
|
+
startDrag: n
|
|
3212
|
+
};
|
|
3213
|
+
}
|
|
3214
|
+
function Ws(e, s, t, i, n, o) {
|
|
3215
|
+
const l = M(e), p = M(s), c = M(!1), a = M(null), d = M(0), f = M(0), r = M(0), I = M(0), g = (z) => {
|
|
3216
|
+
if (!c.value || !a.value) return;
|
|
3217
|
+
const C = z.clientX - d.value, v = z.clientY - f.value;
|
|
3218
|
+
let L = r.value, j = I.value;
|
|
3219
|
+
const m = a.value;
|
|
3220
|
+
m.includes("e") ? L = Math.min(Math.max(r.value + C, t), n) : m.includes("w") && (L = Math.min(Math.max(r.value - C, t), n)), m.includes("s") ? j = Math.min(Math.max(I.value + v, i), o) : m.includes("n") && (j = Math.min(Math.max(I.value - v, i), o)), l.value = L, p.value = j;
|
|
3221
|
+
}, b = () => {
|
|
3222
|
+
c.value = !1, a.value = null;
|
|
3223
|
+
}, y = (z, C, v, L) => {
|
|
3224
|
+
z.preventDefault(), z.stopPropagation(), c.value = !0, a.value = C, d.value = z.clientX, f.value = z.clientY, r.value = v, I.value = L;
|
|
3225
|
+
}, S = (z) => ({
|
|
3226
|
+
n: "n-resize",
|
|
3227
|
+
s: "s-resize",
|
|
3228
|
+
e: "e-resize",
|
|
3229
|
+
w: "w-resize",
|
|
3230
|
+
ne: "ne-resize",
|
|
3231
|
+
nw: "nw-resize",
|
|
3232
|
+
se: "se-resize",
|
|
3233
|
+
sw: "sw-resize"
|
|
3234
|
+
})[z];
|
|
3235
|
+
return J(c, (z) => {
|
|
3236
|
+
z ? (window.addEventListener("mousemove", g), window.addEventListener("mouseup", b), document.body.style.cursor = S(a.value || "se"), document.body.style.userSelect = "none") : (window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", b), document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
3237
|
+
}), se(() => {
|
|
3238
|
+
window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", b), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
3239
|
+
}), {
|
|
3240
|
+
width: l,
|
|
3241
|
+
height: p,
|
|
3242
|
+
isResizing: c,
|
|
3243
|
+
startResize: y
|
|
3244
|
+
};
|
|
3245
|
+
}
|
|
3246
|
+
const Bs = { class: "window-controls" }, Vs = { class: "window-title-info" }, _s = { class: "window-title-text" }, qs = { class: "window-title-actions" }, Gs = { class: "window-content" }, Ks = /* @__PURE__ */ G({
|
|
3247
|
+
__name: "Window",
|
|
3248
|
+
props: {
|
|
3249
|
+
title: {},
|
|
3250
|
+
showTitleBar: { type: Boolean, default: !0 },
|
|
3251
|
+
showMinimize: { type: Boolean, default: !1 },
|
|
3252
|
+
showMaximize: { type: Boolean, default: !1 },
|
|
3253
|
+
draggable: { type: Boolean, default: !0 },
|
|
3254
|
+
resizable: { type: Boolean, default: !0 },
|
|
3255
|
+
width: { default: "auto" },
|
|
3256
|
+
height: { default: "auto" },
|
|
3257
|
+
minWidth: { default: 300 },
|
|
3258
|
+
minHeight: { default: 200 },
|
|
3259
|
+
maxWidth: { default: "80vw" },
|
|
3260
|
+
maxHeight: { default: "80vh" },
|
|
3261
|
+
closeOnBackdrop: { type: Boolean, default: !0 },
|
|
3262
|
+
fitContent: { type: Boolean, default: !1 }
|
|
3263
|
+
},
|
|
3264
|
+
emits: ["close", "minimize", "maximize"],
|
|
3265
|
+
setup(e, { emit: s }) {
|
|
3266
|
+
const t = e, i = s, n = M(null), o = t.draggable ? Hs() : null, l = U(() => t.fitContent || t.width === "auto" || t.width === "fit-content" || t.height === "auto" || t.height === "fit-content"), p = () => {
|
|
3267
|
+
if (l.value)
|
|
3268
|
+
return { initialWidth: 0, initialHeight: 0 };
|
|
3269
|
+
const m = 600, $ = 500;
|
|
3270
|
+
let k = m, A = $;
|
|
3271
|
+
return t.width !== "auto" && t.width !== "fit-content" && (k = typeof t.width == "number" ? t.width : parseInt(t.width)), t.height !== "auto" && t.height !== "fit-content" && (A = typeof t.height == "number" ? t.height : parseInt(t.height)), { initialWidth: k, initialHeight: A };
|
|
3272
|
+
}, c = (m, $) => typeof m == "number" ? m : m.endsWith("px") ? parseInt(m) : m.endsWith("vw") ? parseInt(m) / 100 * window.innerWidth : m.endsWith("vh") ? parseInt(m) / 100 * window.innerHeight : $, { initialWidth: a, initialHeight: d } = p(), f = c(t.minWidth, 500), r = c(t.minHeight, 350), I = c(t.maxWidth, window.innerWidth * 0.8), g = c(t.maxHeight, window.innerHeight * 0.8), b = t.resizable ? Ws(a, d, f, r, I, g) : null, y = U(() => {
|
|
3273
|
+
const m = {
|
|
3274
|
+
left: "50%",
|
|
3275
|
+
top: "50%"
|
|
3276
|
+
};
|
|
3277
|
+
let $ = "-50%", k = "-50%";
|
|
3278
|
+
return t.draggable && o && ($ = `calc(-50% + ${o.position.value.x}px)`, k = `calc(-50% + ${o.position.value.y}px)`), m.transform = `translate(${$}, ${k})`, m.transformOrigin = "center center", l.value ? t.resizable && b && b.width.value > 0 && (m.width = `${b.width.value}px`, m.height = `${b.height.value}px`) : t.resizable && b ? (m.width = `${b.width.value}px`, m.height = `${b.height.value}px`) : (t.width !== "auto" && t.width !== "fit-content" && (m.width = typeof t.width == "number" ? `${t.width}px` : t.width), t.height !== "auto" && t.height !== "fit-content" && (m.height = typeof t.height == "number" ? `${t.height}px` : t.height)), t.minWidth && (m.minWidth = typeof t.minWidth == "number" ? `${t.minWidth}px` : t.minWidth), t.minHeight && (m.minHeight = typeof t.minHeight == "number" ? `${t.minHeight}px` : t.minHeight), t.maxWidth && (m.maxWidth = typeof t.maxWidth == "number" ? `${t.maxWidth}px` : t.maxWidth), t.maxHeight && (m.maxHeight = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight), m;
|
|
3279
|
+
}), S = (m) => {
|
|
3280
|
+
t.closeOnBackdrop && m.target === m.currentTarget && i("close");
|
|
3281
|
+
}, z = (m) => {
|
|
3282
|
+
t.draggable && o && o.startDrag(m);
|
|
3283
|
+
}, C = () => {
|
|
3284
|
+
i("close");
|
|
3285
|
+
}, v = () => {
|
|
3286
|
+
i("minimize");
|
|
3287
|
+
}, L = () => {
|
|
3288
|
+
i("maximize");
|
|
3289
|
+
}, j = (m, $) => {
|
|
3290
|
+
if (!t.resizable || !b || !n.value) return;
|
|
3291
|
+
const k = n.value.getBoundingClientRect(), A = k.width, E = k.height;
|
|
3292
|
+
b.startResize(m, $, A, E);
|
|
3293
|
+
};
|
|
3294
|
+
return Me(() => {
|
|
3295
|
+
const m = ($) => {
|
|
3296
|
+
$.key === "Escape" && ($.preventDefault(), i("close"));
|
|
3297
|
+
};
|
|
3298
|
+
window.addEventListener("keydown", m), se(() => {
|
|
3299
|
+
window.removeEventListener("keydown", m);
|
|
3300
|
+
});
|
|
3301
|
+
}), (m, $) => (h(), W(ae, { to: "body" }, [
|
|
3302
|
+
u("div", {
|
|
3303
|
+
class: "window-overlay",
|
|
3304
|
+
onClick: S
|
|
3305
|
+
}, [
|
|
3306
|
+
u("div", {
|
|
3307
|
+
ref_key: "windowContainerRef",
|
|
3308
|
+
ref: n,
|
|
3309
|
+
class: "window-container",
|
|
3310
|
+
style: ve(y.value),
|
|
3311
|
+
onClick: $[8] || ($[8] = H(() => {
|
|
3312
|
+
}, ["stop"]))
|
|
3313
|
+
}, [
|
|
3314
|
+
e.showTitleBar ? (h(), x("div", {
|
|
3315
|
+
key: 0,
|
|
3316
|
+
class: "window-title-bar draggable-area",
|
|
3317
|
+
onMousedown: z
|
|
3318
|
+
}, [
|
|
3319
|
+
u("div", Bs, [
|
|
3320
|
+
u("button", {
|
|
3321
|
+
onClick: H(C, ["stop"]),
|
|
3322
|
+
class: "window-control-button window-control-button--close"
|
|
3323
|
+
}, [
|
|
3324
|
+
N(P(ye), {
|
|
3325
|
+
size: 7,
|
|
3326
|
+
class: "window-control-icon"
|
|
3327
|
+
})
|
|
3328
|
+
]),
|
|
3329
|
+
e.showMinimize ? (h(), x("button", {
|
|
3330
|
+
key: 0,
|
|
3331
|
+
onClick: H(v, ["stop"]),
|
|
3332
|
+
class: "window-control-button window-control-button--minimize"
|
|
3333
|
+
}, [
|
|
3334
|
+
N(P(yt), {
|
|
3335
|
+
size: 7,
|
|
3336
|
+
class: "window-control-icon"
|
|
3337
|
+
})
|
|
3338
|
+
])) : O("", !0),
|
|
3339
|
+
e.showMaximize ? (h(), x("button", {
|
|
3340
|
+
key: 1,
|
|
3341
|
+
onClick: H(L, ["stop"]),
|
|
3342
|
+
class: "window-control-button window-control-button--maximize"
|
|
3343
|
+
}, [
|
|
3344
|
+
N(P(wt), {
|
|
3345
|
+
size: 7,
|
|
3346
|
+
class: "window-control-icon"
|
|
3347
|
+
})
|
|
3348
|
+
])) : O("", !0)
|
|
3349
|
+
]),
|
|
3350
|
+
u("div", Vs, [
|
|
3351
|
+
ee(m.$slots, "title", {}, () => [
|
|
3352
|
+
u("span", _s, T(e.title), 1)
|
|
3353
|
+
], !0)
|
|
3354
|
+
]),
|
|
3355
|
+
u("div", qs, [
|
|
3356
|
+
ee(m.$slots, "actions", {}, void 0, !0)
|
|
3357
|
+
])
|
|
3358
|
+
], 32)) : O("", !0),
|
|
3359
|
+
u("div", Gs, [
|
|
3360
|
+
ee(m.$slots, "default", {}, void 0, !0)
|
|
3361
|
+
]),
|
|
3362
|
+
e.resizable ? (h(), x(q, { key: 1 }, [
|
|
3363
|
+
u("div", {
|
|
3364
|
+
class: "window-resize-handle window-resize-handle--n",
|
|
3365
|
+
onMousedown: $[0] || ($[0] = (k) => j(k, "n"))
|
|
3366
|
+
}, null, 32),
|
|
3367
|
+
u("div", {
|
|
3368
|
+
class: "window-resize-handle window-resize-handle--s",
|
|
3369
|
+
onMousedown: $[1] || ($[1] = (k) => j(k, "s"))
|
|
3370
|
+
}, null, 32),
|
|
3371
|
+
u("div", {
|
|
3372
|
+
class: "window-resize-handle window-resize-handle--e",
|
|
3373
|
+
onMousedown: $[2] || ($[2] = (k) => j(k, "e"))
|
|
3374
|
+
}, null, 32),
|
|
3375
|
+
u("div", {
|
|
3376
|
+
class: "window-resize-handle window-resize-handle--w",
|
|
3377
|
+
onMousedown: $[3] || ($[3] = (k) => j(k, "w"))
|
|
3378
|
+
}, null, 32),
|
|
3379
|
+
u("div", {
|
|
3380
|
+
class: "window-resize-handle window-resize-handle--ne",
|
|
3381
|
+
onMousedown: $[4] || ($[4] = (k) => j(k, "ne"))
|
|
3382
|
+
}, null, 32),
|
|
3383
|
+
u("div", {
|
|
3384
|
+
class: "window-resize-handle window-resize-handle--nw",
|
|
3385
|
+
onMousedown: $[5] || ($[5] = (k) => j(k, "nw"))
|
|
3386
|
+
}, null, 32),
|
|
3387
|
+
u("div", {
|
|
3388
|
+
class: "window-resize-handle window-resize-handle--se",
|
|
3389
|
+
onMousedown: $[6] || ($[6] = (k) => j(k, "se"))
|
|
3390
|
+
}, null, 32),
|
|
3391
|
+
u("div", {
|
|
3392
|
+
class: "window-resize-handle window-resize-handle--sw",
|
|
3393
|
+
onMousedown: $[7] || ($[7] = (k) => j(k, "sw"))
|
|
3394
|
+
}, null, 32)
|
|
3395
|
+
], 64)) : O("", !0)
|
|
3396
|
+
], 4)
|
|
3397
|
+
])
|
|
3398
|
+
]));
|
|
3399
|
+
}
|
|
3400
|
+
}), co = /* @__PURE__ */ K(Ks, [["__scopeId", "data-v-3fda0df7"]]), Qs = { class: "compress-dialog-header" }, Xs = { class: "compress-dialog-title" }, Ys = { class: "compress-dialog-content" }, Js = { class: "compress-dialog-info" }, Zs = { class: "compress-dialog-field" }, ei = { class: "compress-dialog-input-group" }, ti = { class: "compress-dialog-ext" }, ni = { class: "compress-dialog-field" }, si = ["value"], ii = { class: "compress-dialog-field" }, oi = { class: "compress-dialog-levels" }, li = ["value"], ri = { class: "compress-dialog-level-label" }, ai = { class: "compress-dialog-level-desc" }, ci = {
|
|
3401
|
+
key: 0,
|
|
3402
|
+
class: "compress-dialog-field"
|
|
3403
|
+
}, ui = { class: "compress-dialog-input-group" }, di = ["type"], fi = { class: "compress-dialog-field compress-dialog-checkbox" }, mi = { class: "compress-dialog-preview" }, pi = { class: "compress-dialog-preview-path" }, gi = { class: "compress-dialog-footer" }, hi = ["disabled"], vi = /* @__PURE__ */ G({
|
|
3404
|
+
__name: "CompressDialog",
|
|
3405
|
+
props: {
|
|
3406
|
+
visible: { type: Boolean },
|
|
3407
|
+
filePaths: {},
|
|
3408
|
+
outputDir: {}
|
|
3409
|
+
},
|
|
3410
|
+
emits: ["confirm", "cancel"],
|
|
3411
|
+
setup(e, { emit: s }) {
|
|
3412
|
+
const t = e, i = s, n = [
|
|
3413
|
+
{ value: "zip", label: "ZIP", ext: ".zip" },
|
|
3414
|
+
{ value: "tgz", label: "TAR.GZ (gzip)", ext: ".tar.gz" },
|
|
3415
|
+
{ value: "tarbz2", label: "TAR.BZ2 (bzip2)", ext: ".tar.bz2" },
|
|
3416
|
+
{ value: "tar", label: "TAR (无压缩)", ext: ".tar" }
|
|
3417
|
+
], o = [
|
|
3418
|
+
{ value: "fast", label: "快速", desc: "压缩速度快,文件较大" },
|
|
3419
|
+
{ value: "normal", label: "标准", desc: "平衡速度和大小" },
|
|
3420
|
+
{ value: "best", label: "最佳", desc: "文件最小,速度较慢" }
|
|
3421
|
+
], l = M("zip"), p = M("normal"), c = M(""), a = M(!1), d = M(""), f = M(!1), r = U(() => t.filePaths.length === 0 ? "archive" : t.filePaths.length === 1 ? (t.filePaths[0].split("/").pop() || "archive").replace(/\.[^.]+$/, "") : "压缩文件"), I = U(() => t.filePaths.length === 1 ? t.filePaths[0].split("/").pop() : `${t.filePaths.length} 个项目`), g = U(() => {
|
|
3422
|
+
var z;
|
|
3423
|
+
return ((z = n.find((C) => C.value === l.value)) == null ? void 0 : z.ext) || ".zip";
|
|
3424
|
+
}), b = U(() => `${t.outputDir}/${c.value}${g.value}`), y = U(() => !1);
|
|
3425
|
+
J(() => t.visible, (z) => {
|
|
3426
|
+
z && (c.value = r.value, l.value = "zip", p.value = "normal", a.value = !1, d.value = "");
|
|
3427
|
+
});
|
|
3428
|
+
const S = () => {
|
|
3429
|
+
i("confirm", {
|
|
3430
|
+
format: l.value,
|
|
3431
|
+
level: p.value,
|
|
3432
|
+
outputName: c.value + g.value,
|
|
3433
|
+
deleteSource: a.value
|
|
3434
|
+
});
|
|
3435
|
+
};
|
|
3436
|
+
return (z, C) => (h(), W(ae, { to: "body" }, [
|
|
3437
|
+
e.visible ? (h(), x("div", {
|
|
3438
|
+
key: 0,
|
|
3439
|
+
class: "compress-dialog-overlay",
|
|
3440
|
+
onClick: C[9] || (C[9] = (v) => i("cancel"))
|
|
3441
|
+
}, [
|
|
3442
|
+
u("div", {
|
|
3443
|
+
class: "compress-dialog",
|
|
3444
|
+
onClick: C[8] || (C[8] = H(() => {
|
|
3445
|
+
}, ["stop"]))
|
|
3446
|
+
}, [
|
|
3447
|
+
u("div", Qs, [
|
|
3448
|
+
u("div", Xs, [
|
|
3449
|
+
N(P(Je), { size: 20 }),
|
|
3450
|
+
C[10] || (C[10] = u("span", null, "压缩文件", -1))
|
|
3451
|
+
]),
|
|
3452
|
+
u("button", {
|
|
3453
|
+
class: "compress-dialog-close",
|
|
3454
|
+
onClick: C[0] || (C[0] = (v) => i("cancel"))
|
|
3455
|
+
}, [
|
|
3456
|
+
N(P(ye), { size: 18 })
|
|
3457
|
+
])
|
|
3458
|
+
]),
|
|
3459
|
+
u("div", Ys, [
|
|
3460
|
+
u("div", Js, [
|
|
3461
|
+
N(P(kt), { size: 16 }),
|
|
3462
|
+
u("span", null, T(I.value), 1)
|
|
3463
|
+
]),
|
|
3464
|
+
u("div", Zs, [
|
|
3465
|
+
C[11] || (C[11] = u("label", null, "文件名", -1)),
|
|
3466
|
+
u("div", ei, [
|
|
3467
|
+
ie(u("input", {
|
|
3468
|
+
type: "text",
|
|
3469
|
+
"onUpdate:modelValue": C[1] || (C[1] = (v) => c.value = v),
|
|
3470
|
+
placeholder: "输入文件名"
|
|
3471
|
+
}, null, 512), [
|
|
3472
|
+
[mt, c.value]
|
|
3473
|
+
]),
|
|
3474
|
+
u("span", ti, T(g.value), 1)
|
|
3475
|
+
])
|
|
3476
|
+
]),
|
|
3477
|
+
u("div", ni, [
|
|
3478
|
+
C[12] || (C[12] = u("label", null, "压缩格式", -1)),
|
|
3479
|
+
ie(u("select", {
|
|
3480
|
+
"onUpdate:modelValue": C[2] || (C[2] = (v) => l.value = v)
|
|
3481
|
+
}, [
|
|
3482
|
+
(h(), x(q, null, Y(n, (v) => u("option", {
|
|
3483
|
+
key: v.value,
|
|
3484
|
+
value: v.value
|
|
3485
|
+
}, T(v.label), 9, si)), 64))
|
|
3486
|
+
], 512), [
|
|
3487
|
+
[pt, l.value]
|
|
3488
|
+
])
|
|
3489
|
+
]),
|
|
3490
|
+
u("div", ii, [
|
|
3491
|
+
C[13] || (C[13] = u("label", null, "压缩级别", -1)),
|
|
3492
|
+
u("div", oi, [
|
|
3493
|
+
(h(), x(q, null, Y(o, (v) => u("label", {
|
|
3494
|
+
key: v.value,
|
|
3495
|
+
class: "compress-dialog-level"
|
|
3496
|
+
}, [
|
|
3497
|
+
ie(u("input", {
|
|
3498
|
+
type: "radio",
|
|
3499
|
+
name: "level",
|
|
3500
|
+
value: v.value,
|
|
3501
|
+
"onUpdate:modelValue": C[3] || (C[3] = (L) => p.value = L)
|
|
3502
|
+
}, null, 8, li), [
|
|
3503
|
+
[gt, p.value]
|
|
3504
|
+
]),
|
|
3505
|
+
u("span", ri, T(v.label), 1),
|
|
3506
|
+
u("span", ai, T(v.desc), 1)
|
|
3507
|
+
])), 64))
|
|
3508
|
+
])
|
|
3509
|
+
]),
|
|
3510
|
+
y.value ? (h(), x("div", ci, [
|
|
3511
|
+
C[14] || (C[14] = u("label", null, "密码保护(可选)", -1)),
|
|
3512
|
+
u("div", ui, [
|
|
3513
|
+
ie(u("input", {
|
|
3514
|
+
type: f.value ? "text" : "password",
|
|
3515
|
+
"onUpdate:modelValue": C[4] || (C[4] = (v) => d.value = v),
|
|
3516
|
+
placeholder: "设置密码"
|
|
3517
|
+
}, null, 8, di), [
|
|
3518
|
+
[ht, d.value]
|
|
3519
|
+
]),
|
|
3520
|
+
u("button", {
|
|
3521
|
+
type: "button",
|
|
3522
|
+
class: "compress-dialog-toggle-password",
|
|
3523
|
+
onClick: C[5] || (C[5] = (v) => f.value = !f.value)
|
|
3524
|
+
}, T(f.value ? "隐藏" : "显示"), 1)
|
|
3525
|
+
])
|
|
3526
|
+
])) : O("", !0),
|
|
3527
|
+
u("div", fi, [
|
|
3528
|
+
u("label", null, [
|
|
3529
|
+
ie(u("input", {
|
|
3530
|
+
type: "checkbox",
|
|
3531
|
+
"onUpdate:modelValue": C[6] || (C[6] = (v) => a.value = v)
|
|
3532
|
+
}, null, 512), [
|
|
3533
|
+
[vt, a.value]
|
|
3534
|
+
]),
|
|
3535
|
+
C[15] || (C[15] = u("span", null, "压缩后删除源文件", -1))
|
|
3536
|
+
])
|
|
3537
|
+
]),
|
|
3538
|
+
u("div", mi, [
|
|
3539
|
+
C[16] || (C[16] = u("span", { class: "compress-dialog-preview-label" }, "输出位置:", -1)),
|
|
3540
|
+
u("span", pi, T(b.value), 1)
|
|
3541
|
+
])
|
|
3542
|
+
]),
|
|
3543
|
+
u("div", gi, [
|
|
3544
|
+
u("button", {
|
|
3545
|
+
class: "compress-dialog-btn compress-dialog-btn-cancel",
|
|
3546
|
+
onClick: C[7] || (C[7] = (v) => i("cancel"))
|
|
3547
|
+
}, " 取消 "),
|
|
3548
|
+
u("button", {
|
|
3549
|
+
class: "compress-dialog-btn compress-dialog-btn-confirm",
|
|
3550
|
+
onClick: S,
|
|
3551
|
+
disabled: !c.value.trim()
|
|
3552
|
+
}, " 压缩 ", 8, hi)
|
|
3553
|
+
])
|
|
3554
|
+
])
|
|
3555
|
+
])) : O("", !0)
|
|
3556
|
+
]));
|
|
3557
|
+
}
|
|
3558
|
+
}), uo = /* @__PURE__ */ K(vi, [["__scopeId", "data-v-17513e3f"]]), bi = {
|
|
3559
|
+
key: 0,
|
|
3560
|
+
class: "progress-dialog-overlay"
|
|
3561
|
+
}, yi = { class: "progress-dialog" }, wi = { class: "progress-dialog-header" }, ki = { class: "progress-dialog-title" }, xi = { class: "progress-dialog-content" }, Ii = { class: "progress-dialog-status" }, Ci = {
|
|
3562
|
+
key: 0,
|
|
3563
|
+
class: "progress-dialog-bar-container"
|
|
3564
|
+
}, $i = { class: "progress-dialog-bar" }, Ei = { class: "progress-dialog-percent" }, ji = {
|
|
3565
|
+
key: 1,
|
|
3566
|
+
class: "progress-dialog-current-file"
|
|
3567
|
+
}, Mi = {
|
|
3568
|
+
key: 2,
|
|
3569
|
+
class: "progress-dialog-count"
|
|
3570
|
+
}, Si = {
|
|
3571
|
+
key: 3,
|
|
3572
|
+
class: "progress-dialog-error"
|
|
3573
|
+
}, Di = {
|
|
3574
|
+
key: 4,
|
|
3575
|
+
class: "progress-dialog-output"
|
|
3576
|
+
}, zi = { class: "progress-dialog-output-path" }, Oi = { class: "progress-dialog-footer" }, Ti = /* @__PURE__ */ G({
|
|
3577
|
+
__name: "ProgressDialog",
|
|
3578
|
+
props: {
|
|
3579
|
+
visible: { type: Boolean },
|
|
3580
|
+
progress: {}
|
|
3581
|
+
},
|
|
3582
|
+
emits: ["cancel", "close", "openFolder"],
|
|
3583
|
+
setup(e, { emit: s }) {
|
|
3584
|
+
const t = e, i = s, n = U(() => t.progress.type === "compress" ? "压缩文件" : "解压文件"), o = U(() => t.progress.status === "success" || t.progress.status === "error"), l = U(() => {
|
|
3585
|
+
switch (t.progress.status) {
|
|
3586
|
+
case "processing":
|
|
3587
|
+
return Ct;
|
|
3588
|
+
case "success":
|
|
3589
|
+
return It;
|
|
3590
|
+
case "error":
|
|
3591
|
+
return xt;
|
|
3592
|
+
default:
|
|
3593
|
+
return Je;
|
|
3594
|
+
}
|
|
3595
|
+
}), p = U(() => {
|
|
3596
|
+
switch (t.progress.status) {
|
|
3597
|
+
case "processing":
|
|
3598
|
+
return "progress-dialog-icon-spin";
|
|
3599
|
+
case "success":
|
|
3600
|
+
return "progress-dialog-icon-success";
|
|
3601
|
+
case "error":
|
|
3602
|
+
return "progress-dialog-icon-error";
|
|
3603
|
+
default:
|
|
3604
|
+
return "";
|
|
3605
|
+
}
|
|
3606
|
+
}), c = U(() => {
|
|
3607
|
+
switch (t.progress.status) {
|
|
3608
|
+
case "pending":
|
|
3609
|
+
return "准备中...";
|
|
3610
|
+
case "processing":
|
|
3611
|
+
return t.progress.type === "compress" ? "正在压缩..." : "正在解压...";
|
|
3612
|
+
case "success":
|
|
3613
|
+
return t.progress.type === "compress" ? "压缩完成" : "解压完成";
|
|
3614
|
+
case "error":
|
|
3615
|
+
return "操作失败";
|
|
3616
|
+
default:
|
|
3617
|
+
return "";
|
|
3618
|
+
}
|
|
3619
|
+
}), a = () => {
|
|
3620
|
+
o.value ? i("close") : i("cancel");
|
|
3621
|
+
};
|
|
3622
|
+
return (d, f) => (h(), W(ae, { to: "body" }, [
|
|
3623
|
+
e.visible ? (h(), x("div", bi, [
|
|
3624
|
+
u("div", yi, [
|
|
3625
|
+
u("div", wi, [
|
|
3626
|
+
u("div", ki, [
|
|
3627
|
+
(h(), W(bt(l.value), {
|
|
3628
|
+
size: 24,
|
|
3629
|
+
class: B(p.value)
|
|
3630
|
+
}, null, 8, ["class"])),
|
|
3631
|
+
u("span", null, T(n.value), 1)
|
|
3632
|
+
]),
|
|
3633
|
+
o.value ? (h(), x("button", {
|
|
3634
|
+
key: 0,
|
|
3635
|
+
class: "progress-dialog-close",
|
|
3636
|
+
onClick: a
|
|
3637
|
+
}, [
|
|
3638
|
+
N(P(ye), { size: 18 })
|
|
3639
|
+
])) : O("", !0)
|
|
3640
|
+
]),
|
|
3641
|
+
u("div", xi, [
|
|
3642
|
+
u("div", Ii, T(c.value), 1),
|
|
3643
|
+
e.progress.status === "processing" ? (h(), x("div", Ci, [
|
|
3644
|
+
u("div", $i, [
|
|
3645
|
+
u("div", {
|
|
3646
|
+
class: "progress-dialog-bar-fill",
|
|
3647
|
+
style: ve({ width: `${e.progress.percent}%` })
|
|
3648
|
+
}, null, 4)
|
|
3649
|
+
]),
|
|
3650
|
+
u("span", Ei, T(e.progress.percent) + "%", 1)
|
|
3651
|
+
])) : O("", !0),
|
|
3652
|
+
e.progress.currentFile && e.progress.status === "processing" ? (h(), x("div", ji, T(e.progress.currentFile), 1)) : O("", !0),
|
|
3653
|
+
e.progress.totalCount && e.progress.totalCount > 0 && e.progress.status === "processing" ? (h(), x("div", Mi, T(e.progress.processedCount || 0) + " / " + T(e.progress.totalCount) + " 个文件 ", 1)) : O("", !0),
|
|
3654
|
+
e.progress.error ? (h(), x("div", Si, T(e.progress.error), 1)) : O("", !0),
|
|
3655
|
+
e.progress.status === "success" && e.progress.outputPath ? (h(), x("div", Di, [
|
|
3656
|
+
f[2] || (f[2] = u("span", { class: "progress-dialog-output-label" }, "输出位置:", -1)),
|
|
3657
|
+
u("span", zi, T(e.progress.outputPath), 1)
|
|
3658
|
+
])) : O("", !0)
|
|
3659
|
+
]),
|
|
3660
|
+
u("div", Oi, [
|
|
3661
|
+
e.progress.status === "processing" ? (h(), x("button", {
|
|
3662
|
+
key: 0,
|
|
3663
|
+
class: "progress-dialog-btn progress-dialog-btn-cancel",
|
|
3664
|
+
onClick: f[0] || (f[0] = (r) => i("cancel"))
|
|
3665
|
+
}, " 取消 ")) : O("", !0),
|
|
3666
|
+
e.progress.status === "success" && e.progress.outputPath ? (h(), x("button", {
|
|
3667
|
+
key: 1,
|
|
3668
|
+
class: "progress-dialog-btn progress-dialog-btn-folder",
|
|
3669
|
+
onClick: f[1] || (f[1] = (r) => i("openFolder", e.progress.outputPath))
|
|
3670
|
+
}, [
|
|
3671
|
+
N(P(Ye), { size: 16 }),
|
|
3672
|
+
f[3] || (f[3] = te(" 打开文件夹 ", -1))
|
|
3673
|
+
])) : O("", !0),
|
|
3674
|
+
o.value ? (h(), x("button", {
|
|
3675
|
+
key: 2,
|
|
3676
|
+
class: "progress-dialog-btn progress-dialog-btn-close",
|
|
3677
|
+
onClick: a
|
|
3678
|
+
}, " 关闭 ")) : O("", !0)
|
|
3679
|
+
])
|
|
3680
|
+
])
|
|
3681
|
+
])) : O("", !0)
|
|
3682
|
+
]));
|
|
3683
|
+
}
|
|
3684
|
+
}), fo = /* @__PURE__ */ K(Ti, [["__scopeId", "data-v-fb52c3ea"]]), Li = { class: "file-info-dialog" }, Pi = { class: "file-info-dialog-header" }, Ai = { class: "file-info-dialog-title" }, Fi = ["title"], Ni = { class: "file-info-dialog-content" }, Ui = { class: "file-info-row" }, Ri = { class: "file-info-label" }, Hi = { class: "file-info-value" }, Wi = {
|
|
3685
|
+
key: 0,
|
|
3686
|
+
class: "file-info-row"
|
|
3687
|
+
}, Bi = { class: "file-info-label" }, Vi = { class: "file-info-value" }, _i = { class: "file-info-row" }, qi = { class: "file-info-label" }, Gi = ["title"], Ki = { class: "file-info-row" }, Qi = { class: "file-info-label" }, Xi = ["title"], Yi = {
|
|
3688
|
+
key: 1,
|
|
3689
|
+
class: "file-info-row"
|
|
3690
|
+
}, Ji = { class: "file-info-label" }, Zi = { class: "file-info-value" }, eo = { class: "file-info-dialog-footer" }, to = /* @__PURE__ */ G({
|
|
3691
|
+
__name: "FileInfoDialog",
|
|
3692
|
+
props: {
|
|
3693
|
+
visible: { type: Boolean },
|
|
3694
|
+
item: {}
|
|
3695
|
+
},
|
|
3696
|
+
emits: ["close"],
|
|
3697
|
+
setup(e, { emit: s }) {
|
|
3698
|
+
const t = e, i = s;
|
|
3699
|
+
function n(f, r) {
|
|
3700
|
+
if (f === w.FOLDER)
|
|
3701
|
+
return "flat-color-icons:folder";
|
|
3702
|
+
if (r)
|
|
3703
|
+
return ut(r, f);
|
|
3704
|
+
switch (f) {
|
|
3705
|
+
case w.IMAGE:
|
|
3706
|
+
return "material-icon-theme:image";
|
|
3707
|
+
case w.VIDEO:
|
|
3708
|
+
return "material-icon-theme:video";
|
|
3709
|
+
case w.MUSIC:
|
|
3710
|
+
return "material-icon-theme:audio";
|
|
3711
|
+
case w.DOCUMENT:
|
|
3712
|
+
return "material-icon-theme:word";
|
|
3713
|
+
case w.CODE:
|
|
3714
|
+
return "material-icon-theme:javascript";
|
|
3715
|
+
case w.ARCHIVE:
|
|
3716
|
+
return "material-icon-theme:zip";
|
|
3717
|
+
default:
|
|
3718
|
+
return "material-icon-theme:document";
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
function o(f) {
|
|
3722
|
+
switch (f) {
|
|
3723
|
+
case w.FOLDER:
|
|
3724
|
+
return "file-info-icon--folder";
|
|
3725
|
+
case w.IMAGE:
|
|
3726
|
+
return "file-info-icon--image";
|
|
3727
|
+
case w.VIDEO:
|
|
3728
|
+
return "file-info-icon--video";
|
|
3729
|
+
case w.MUSIC:
|
|
3730
|
+
return "file-info-icon--music";
|
|
3731
|
+
case w.DOCUMENT:
|
|
3732
|
+
return "file-info-icon--document";
|
|
3733
|
+
case w.CODE:
|
|
3734
|
+
return "file-info-icon--code";
|
|
3735
|
+
case w.ARCHIVE:
|
|
3736
|
+
return "file-info-icon--archive";
|
|
3737
|
+
default:
|
|
3738
|
+
return "file-info-icon--file";
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
function l(f, r) {
|
|
3742
|
+
switch (f) {
|
|
3743
|
+
case w.FOLDER:
|
|
3744
|
+
return "文件夹";
|
|
3745
|
+
case w.IMAGE:
|
|
3746
|
+
return `图片${r ? ` (${r.toUpperCase()})` : ""}`;
|
|
3747
|
+
case w.VIDEO:
|
|
3748
|
+
return `视频${r ? ` (${r.toUpperCase()})` : ""}`;
|
|
3749
|
+
case w.MUSIC:
|
|
3750
|
+
return `音频${r ? ` (${r.toUpperCase()})` : ""}`;
|
|
3751
|
+
case w.DOCUMENT:
|
|
3752
|
+
return `文档${r ? ` (${r.toUpperCase()})` : ""}`;
|
|
3753
|
+
case w.CODE:
|
|
3754
|
+
return `代码文件${r ? ` (${r.toUpperCase()})` : ""}`;
|
|
3755
|
+
case w.ARCHIVE:
|
|
3756
|
+
return `压缩包${r ? ` (${r.toUpperCase()})` : ""}`;
|
|
3757
|
+
default:
|
|
3758
|
+
return r ? `${r.toUpperCase()} 文件` : "文件";
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
const p = U(() => {
|
|
3762
|
+
if (!t.item) return;
|
|
3763
|
+
const f = t.item.name.lastIndexOf(".");
|
|
3764
|
+
if (!(f === -1 || f === 0))
|
|
3765
|
+
return t.item.name.substring(f + 1).toLowerCase();
|
|
3766
|
+
}), c = U(() => {
|
|
3767
|
+
if (!t.item) return "";
|
|
3768
|
+
const f = t.item.id.lastIndexOf("/");
|
|
3769
|
+
return f === -1 ? t.item.id : t.item.id.substring(0, f) || "/";
|
|
3770
|
+
});
|
|
3771
|
+
function a(f) {
|
|
3772
|
+
f.target === f.currentTarget && i("close");
|
|
3773
|
+
}
|
|
3774
|
+
function d(f) {
|
|
3775
|
+
f.key === "Escape" && t.visible && i("close");
|
|
3776
|
+
}
|
|
3777
|
+
return Me(() => {
|
|
3778
|
+
document.addEventListener("keydown", d);
|
|
3779
|
+
}), se(() => {
|
|
3780
|
+
document.removeEventListener("keydown", d);
|
|
3781
|
+
}), (f, r) => (h(), W(ae, { to: "body" }, [
|
|
3782
|
+
e.visible && e.item ? (h(), x("div", {
|
|
3783
|
+
key: 0,
|
|
3784
|
+
class: "file-info-dialog-overlay",
|
|
3785
|
+
onClick: a
|
|
3786
|
+
}, [
|
|
3787
|
+
u("div", Li, [
|
|
3788
|
+
u("div", Pi, [
|
|
3789
|
+
u("div", Ai, [
|
|
3790
|
+
N(P(_), {
|
|
3791
|
+
icon: n(e.item.type, e.item.name),
|
|
3792
|
+
width: "48",
|
|
3793
|
+
height: "48",
|
|
3794
|
+
class: B(["file-info-icon", o(e.item.type)])
|
|
3795
|
+
}, null, 8, ["icon", "class"]),
|
|
3796
|
+
u("span", {
|
|
3797
|
+
class: "file-info-dialog-name",
|
|
3798
|
+
title: e.item.name
|
|
3799
|
+
}, T(e.item.name), 9, Fi)
|
|
3800
|
+
]),
|
|
3801
|
+
u("button", {
|
|
3802
|
+
class: "file-info-dialog-close",
|
|
3803
|
+
onClick: r[0] || (r[0] = (I) => i("close"))
|
|
3804
|
+
}, [
|
|
3805
|
+
N(P(ye), { size: 18 })
|
|
3806
|
+
])
|
|
3807
|
+
]),
|
|
3808
|
+
u("div", Ni, [
|
|
3809
|
+
u("div", Ui, [
|
|
3810
|
+
u("div", Ri, [
|
|
3811
|
+
N(P($t), { size: 14 }),
|
|
3812
|
+
r[2] || (r[2] = u("span", null, "类型", -1))
|
|
3813
|
+
]),
|
|
3814
|
+
u("div", Hi, T(l(e.item.type, p.value)), 1)
|
|
3815
|
+
]),
|
|
3816
|
+
e.item.type !== P(w).FOLDER && e.item.size ? (h(), x("div", Wi, [
|
|
3817
|
+
u("div", Bi, [
|
|
3818
|
+
N(P(Et), { size: 14 }),
|
|
3819
|
+
r[3] || (r[3] = u("span", null, "大小", -1))
|
|
3820
|
+
]),
|
|
3821
|
+
u("div", Vi, T(e.item.size), 1)
|
|
3822
|
+
])) : O("", !0),
|
|
3823
|
+
u("div", _i, [
|
|
3824
|
+
u("div", qi, [
|
|
3825
|
+
N(P(Pe), { size: 14 }),
|
|
3826
|
+
r[4] || (r[4] = u("span", null, "位置", -1))
|
|
3827
|
+
]),
|
|
3828
|
+
u("div", {
|
|
3829
|
+
class: "file-info-value file-info-value--path",
|
|
3830
|
+
title: c.value
|
|
3831
|
+
}, T(c.value), 9, Gi)
|
|
3832
|
+
]),
|
|
3833
|
+
u("div", Ki, [
|
|
3834
|
+
u("div", Qi, [
|
|
3835
|
+
N(P(Pe), { size: 14 }),
|
|
3836
|
+
r[5] || (r[5] = u("span", null, "完整路径", -1))
|
|
3837
|
+
]),
|
|
3838
|
+
u("div", {
|
|
3839
|
+
class: "file-info-value file-info-value--path",
|
|
3840
|
+
title: e.item.id
|
|
3841
|
+
}, T(e.item.id), 9, Xi)
|
|
3842
|
+
]),
|
|
3843
|
+
e.item.dateModified ? (h(), x("div", Yi, [
|
|
3844
|
+
u("div", Ji, [
|
|
3845
|
+
N(P(jt), { size: 14 }),
|
|
3846
|
+
r[6] || (r[6] = u("span", null, "修改时间", -1))
|
|
3847
|
+
]),
|
|
3848
|
+
u("div", Zi, T(e.item.dateModified), 1)
|
|
3849
|
+
])) : O("", !0)
|
|
3850
|
+
]),
|
|
3851
|
+
u("div", eo, [
|
|
3852
|
+
u("button", {
|
|
3853
|
+
class: "file-info-dialog-btn",
|
|
3854
|
+
onClick: r[1] || (r[1] = (I) => i("close"))
|
|
3855
|
+
}, " 关闭 ")
|
|
3856
|
+
])
|
|
3857
|
+
])
|
|
3858
|
+
])) : O("", !0)
|
|
3859
|
+
]));
|
|
3860
|
+
}
|
|
3861
|
+
}), mo = /* @__PURE__ */ K(to, [["__scopeId", "data-v-f90691ea"]]);
|
|
3862
|
+
function po() {
|
|
3863
|
+
const e = M(/* @__PURE__ */ new Set()), s = M(null), t = M(null), i = () => {
|
|
3864
|
+
e.value = /* @__PURE__ */ new Set(), s.value = null;
|
|
3865
|
+
};
|
|
3866
|
+
return {
|
|
3867
|
+
selectedIds: e,
|
|
3868
|
+
lastSelectedId: s,
|
|
3869
|
+
editingId: t,
|
|
3870
|
+
clearSelection: i,
|
|
3871
|
+
selectItem: (c, a, d = !1, f = !1) => {
|
|
3872
|
+
if (!c) {
|
|
3873
|
+
i();
|
|
3874
|
+
return;
|
|
3875
|
+
}
|
|
3876
|
+
if (f && s.value) {
|
|
3877
|
+
const r = a.findIndex((g) => g.id === s.value), I = a.findIndex((g) => g.id === c);
|
|
3878
|
+
if (r !== -1 && I !== -1) {
|
|
3879
|
+
const g = Math.min(r, I), b = Math.max(r, I), y = new Set(d ? e.value : []);
|
|
3880
|
+
for (let S = g; S <= b; S++) {
|
|
3881
|
+
const z = a[S];
|
|
3882
|
+
z && y.add(z.id);
|
|
3883
|
+
}
|
|
3884
|
+
e.value = y;
|
|
3885
|
+
return;
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
if (d) {
|
|
3889
|
+
const r = new Set(e.value);
|
|
3890
|
+
r.has(c) ? r.delete(c) : r.add(c), s.value = c, e.value = r;
|
|
3891
|
+
return;
|
|
3892
|
+
}
|
|
3893
|
+
s.value = c, e.value = /* @__PURE__ */ new Set([c]);
|
|
3894
|
+
},
|
|
3895
|
+
selectAll: (c) => {
|
|
3896
|
+
e.value = new Set(c.map((a) => a.id));
|
|
3897
|
+
},
|
|
3898
|
+
setEditing: (c) => {
|
|
3899
|
+
t.value = c;
|
|
3900
|
+
},
|
|
3901
|
+
isSelected: (c) => e.value.has(c)
|
|
3902
|
+
};
|
|
3903
|
+
}
|
|
3904
|
+
function go(e, s, t) {
|
|
3905
|
+
const i = M(null), n = M(!1);
|
|
3906
|
+
return {
|
|
3907
|
+
dragOverId: i,
|
|
3908
|
+
isDragging: n,
|
|
3909
|
+
handleDragStart: (d, f) => {
|
|
3910
|
+
if (!d.dataTransfer) return;
|
|
3911
|
+
const r = e();
|
|
3912
|
+
r.has(f) || s(f, !1, !1);
|
|
3913
|
+
const I = r.has(f) ? r : /* @__PURE__ */ new Set([f]);
|
|
3914
|
+
d.dataTransfer.setData("text/plain", JSON.stringify([...I])), d.dataTransfer.effectAllowed = "move", n.value = !0;
|
|
3915
|
+
},
|
|
3916
|
+
handleDragOver: (d, f) => {
|
|
3917
|
+
n.value && f.type === w.FOLDER && (e().has(f.id) || (d.preventDefault(), i.value = f.id));
|
|
3918
|
+
},
|
|
3919
|
+
handleDragLeave: () => {
|
|
3920
|
+
i.value = null;
|
|
3921
|
+
},
|
|
3922
|
+
handleDrop: (d, f) => {
|
|
3923
|
+
if (i.value = null, n.value = !1, !d.dataTransfer || f.type !== w.FOLDER) return;
|
|
3924
|
+
const r = d.dataTransfer.getData("text/plain");
|
|
3925
|
+
if (r)
|
|
3926
|
+
try {
|
|
3927
|
+
const I = JSON.parse(r), g = new Set(I);
|
|
3928
|
+
if (g.has(f.id)) return;
|
|
3929
|
+
t(f.id, g);
|
|
3930
|
+
} catch {
|
|
3931
|
+
}
|
|
3932
|
+
},
|
|
3933
|
+
handleDragEnd: () => {
|
|
3934
|
+
i.value = null, n.value = !1;
|
|
3935
|
+
}
|
|
3936
|
+
};
|
|
3937
|
+
}
|
|
3938
|
+
function ho(e, s) {
|
|
3939
|
+
const t = M(!1), i = M(0), n = M(0), o = M(0), l = M(!1), p = M(1), c = M(1), a = M(!1), d = e === w.MUSIC, f = () => {
|
|
3940
|
+
const v = s();
|
|
3941
|
+
if (v) {
|
|
3942
|
+
const L = v.currentTime, j = v.duration;
|
|
3943
|
+
n.value = L, j && !isNaN(j) && (o.value = j, i.value = L / j * 100);
|
|
3944
|
+
}
|
|
3945
|
+
};
|
|
3946
|
+
return {
|
|
3947
|
+
isPlaying: t,
|
|
3948
|
+
progress: i,
|
|
3949
|
+
currentTime: n,
|
|
3950
|
+
duration: o,
|
|
3951
|
+
isMuted: l,
|
|
3952
|
+
volume: p,
|
|
3953
|
+
showControls: a,
|
|
3954
|
+
isAudio: d,
|
|
3955
|
+
togglePlay: () => {
|
|
3956
|
+
const v = s();
|
|
3957
|
+
v && (t.value ? (v.pause(), t.value = !1) : (v.play(), t.value = !0));
|
|
3958
|
+
},
|
|
3959
|
+
toggleMute: () => {
|
|
3960
|
+
const v = s();
|
|
3961
|
+
if (v)
|
|
3962
|
+
if (l.value) {
|
|
3963
|
+
const L = c.value || 1;
|
|
3964
|
+
v.volume = L, v.muted = !1, p.value = L, l.value = !1;
|
|
3965
|
+
} else
|
|
3966
|
+
c.value = p.value, v.volume = 0, v.muted = !0, p.value = 0, l.value = !0;
|
|
3967
|
+
},
|
|
3968
|
+
handleVolumeChange: (v) => {
|
|
3969
|
+
p.value = v;
|
|
3970
|
+
const L = s();
|
|
3971
|
+
L && (L.volume = v, v === 0 ? (l.value = !0, L.muted = !0) : (l.value = !1, L.muted = !1));
|
|
3972
|
+
},
|
|
3973
|
+
seekTo: (v) => {
|
|
3974
|
+
const L = s();
|
|
3975
|
+
L && o.value && (L.currentTime = v, n.value = v, i.value = v / o.value * 100);
|
|
3976
|
+
},
|
|
3977
|
+
formatTime: (v) => {
|
|
3978
|
+
if (isNaN(v)) return "0:00";
|
|
3979
|
+
const L = Math.floor(v / 60), j = Math.floor(v % 60);
|
|
3980
|
+
return `${L}:${j.toString().padStart(2, "0")}`;
|
|
3981
|
+
},
|
|
3982
|
+
autoPlay: () => {
|
|
3983
|
+
Se(() => {
|
|
3984
|
+
const v = s();
|
|
3985
|
+
(e === w.VIDEO || d) && v && (v.volume = p.value, v.play().catch(() => {
|
|
3986
|
+
}), t.value = !0);
|
|
3987
|
+
});
|
|
3988
|
+
},
|
|
3989
|
+
setupMediaListeners: () => {
|
|
3990
|
+
const v = s();
|
|
3991
|
+
v && (v.addEventListener("timeupdate", f), v.addEventListener("loadedmetadata", f), v.addEventListener("ended", () => {
|
|
3992
|
+
t.value = !1;
|
|
3993
|
+
}));
|
|
3994
|
+
},
|
|
3995
|
+
cleanupMediaListeners: () => {
|
|
3996
|
+
const v = s();
|
|
3997
|
+
v && (v.removeEventListener("timeupdate", f), v.removeEventListener("loadedmetadata", f));
|
|
3998
|
+
},
|
|
3999
|
+
updateProgress: f
|
|
4000
|
+
};
|
|
4001
|
+
}
|
|
4002
|
+
function vo(e) {
|
|
4003
|
+
const s = /* @__PURE__ */ new Map(), t = M(/* @__PURE__ */ new Map()), i = async (o) => {
|
|
4004
|
+
if (!(o.type !== w.APPLICATION || !o.id)) {
|
|
4005
|
+
if (s.has(o.id)) {
|
|
4006
|
+
const l = s.get(o.id);
|
|
4007
|
+
l && t.value.set(o.id, l);
|
|
4008
|
+
return;
|
|
4009
|
+
}
|
|
4010
|
+
if (!t.value.has(o.id) && typeof window.fileExplorerAPI < "u" && window.fileExplorerAPI.getApplicationIcon)
|
|
4011
|
+
try {
|
|
4012
|
+
const l = await window.fileExplorerAPI.getApplicationIcon(o.id);
|
|
4013
|
+
l && (s.set(o.id, l), t.value.set(o.id, l));
|
|
4014
|
+
} catch (l) {
|
|
4015
|
+
console.error(`Failed to load application icon for ${o.name}:`, l);
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
};
|
|
4019
|
+
return J(e, (o) => {
|
|
4020
|
+
o.forEach((l) => {
|
|
4021
|
+
l.type === w.APPLICATION && !t.value.has(l.id) && i(l);
|
|
4022
|
+
});
|
|
4023
|
+
}, { immediate: !0, deep: !0 }), {
|
|
4024
|
+
getAppIconUrl: (o) => t.value.get(o.id),
|
|
4025
|
+
loadApplicationIcon: i
|
|
4026
|
+
};
|
|
4027
|
+
}
|
|
4028
|
+
export {
|
|
4029
|
+
ps as Breadcrumb,
|
|
4030
|
+
uo as CompressDialog,
|
|
4031
|
+
ao as ContextMenu,
|
|
4032
|
+
_n as FileGrid,
|
|
4033
|
+
dt as FileIcon,
|
|
4034
|
+
mo as FileInfoDialog,
|
|
4035
|
+
ns as FileList,
|
|
4036
|
+
io as FileListView,
|
|
4037
|
+
oo as FileSidebar,
|
|
4038
|
+
w as FileType,
|
|
4039
|
+
fo as ProgressDialog,
|
|
4040
|
+
de as SortIndicator,
|
|
4041
|
+
ro as StatusBar,
|
|
4042
|
+
lo as Toolbar,
|
|
4043
|
+
co as Window,
|
|
4044
|
+
vo as useApplicationIcon,
|
|
4045
|
+
go as useDragAndDrop,
|
|
4046
|
+
ho as useMediaPlayer,
|
|
4047
|
+
po as useSelection,
|
|
4048
|
+
Hs as useWindowDrag,
|
|
4049
|
+
Ws as useWindowResize
|
|
4050
|
+
};
|
|
4051
|
+
//# sourceMappingURL=index.js.map
|