@jt-home/mfe-components 1.0.42 → 1.0.44
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/JtAttachmentPreview/index.cjs +1 -1
- package/dist/JtAttachmentPreview/index.mjs +1 -1
- package/dist/{index-moF0d2Ee.js → index-BXyTJFiJ.js} +418 -328
- package/dist/index-CoLqaicq.cjs +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +100 -100
- package/dist/style.css +1 -1
- package/dist/types/locale/index.d.ts +3 -3
- package/dist/types/locale/types.d.ts +1 -0
- package/package.json +99 -99
- package/readme.md +694 -694
- package/dist/index-c8YlthVt.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as A, isRef as
|
|
1
|
+
import { ref as A, isRef as le, watch as $, defineComponent as E, openBlock as I, createElementBlock as O, createElementVNode as V, onBeforeUnmount as q, h as a, computed as j, onMounted as ee, nextTick as pe, render as _ } from "vue";
|
|
2
2
|
import { ElIcon as N } from "element-plus";
|
|
3
|
-
const
|
|
3
|
+
const he = {
|
|
4
4
|
common: {
|
|
5
5
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js 无法读取该文件,已切换为浏览器内置预览",
|
|
6
6
|
PDF加载中___: "PDF 加载中...",
|
|
@@ -11,6 +11,7 @@ const ve = {
|
|
|
11
11
|
信息: "信息",
|
|
12
12
|
"信息集不能为空,最后一条数据不可删除": "信息集不能为空,最后一条数据不可删除",
|
|
13
13
|
共: "共",
|
|
14
|
+
"共{total}条记录": "共 {total} 条记录",
|
|
14
15
|
关闭: "关闭",
|
|
15
16
|
删除: "删除",
|
|
16
17
|
加载中___: "加载中...",
|
|
@@ -55,7 +56,7 @@ const ve = {
|
|
|
55
56
|
附件预览: "附件预览",
|
|
56
57
|
附件预览未初始化: "附件预览未初始化"
|
|
57
58
|
}
|
|
58
|
-
},
|
|
59
|
+
}, ge = {
|
|
59
60
|
common: {
|
|
60
61
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js cannot read the file. It has been switched to browser built-in preview",
|
|
61
62
|
PDF加载中___: "PDF loading...",
|
|
@@ -66,6 +67,7 @@ const ve = {
|
|
|
66
67
|
信息: "information",
|
|
67
68
|
"信息集不能为空,最后一条数据不可删除": "The information set cannot be empty, and the last piece of data cannot be deleted",
|
|
68
69
|
共: "total of",
|
|
70
|
+
"共{total}条记录": "Total {total} records",
|
|
69
71
|
关闭: "closed",
|
|
70
72
|
删除: "delete",
|
|
71
73
|
加载中___: "Loading...",
|
|
@@ -110,7 +112,7 @@ const ve = {
|
|
|
110
112
|
附件预览: "Attachment Preview",
|
|
111
113
|
附件预览未初始化: "Attachment preview not initialized"
|
|
112
114
|
}
|
|
113
|
-
},
|
|
115
|
+
}, we = {
|
|
114
116
|
common: {
|
|
115
117
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js ไม่สามารถอ่านไฟล์ได้ เปลี่ยนเป็นตัวอย่างในตัวเบราว์เซอร์",
|
|
116
118
|
PDF加载中___: "กําลังโหลดไฟล์ PDF ...",
|
|
@@ -121,6 +123,7 @@ const ve = {
|
|
|
121
123
|
信息: "ข้อมูล",
|
|
122
124
|
"信息集不能为空,最后一条数据不可删除": "ชุดข้อมูลไม่สามารถว่างเปล่าได้ ข้อมูลสุดท้ายไม่สามารถลบได้",
|
|
123
125
|
共: "รวมทั้งหมด",
|
|
126
|
+
"共{total}条记录": "ทั้งหมด {total} รายการ",
|
|
124
127
|
关闭: "ปิด",
|
|
125
128
|
删除: "ลบ",
|
|
126
129
|
加载中___: "กําลังโหลด ...",
|
|
@@ -165,7 +168,7 @@ const ve = {
|
|
|
165
168
|
附件预览: "เอกสารแนบตัวอย่าง",
|
|
166
169
|
附件预览未初始化: "การแสดงตัวอย่างของสิ่งที่แนบมาไม่ได้เริ่มต้น"
|
|
167
170
|
}
|
|
168
|
-
},
|
|
171
|
+
}, ye = {
|
|
169
172
|
common: {
|
|
170
173
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js không thể đọc tập tin, đã chuyển sang trình duyệt built-in xem trước",
|
|
171
174
|
PDF加载中___: "Đang tải PDF...",
|
|
@@ -176,6 +179,7 @@ const ve = {
|
|
|
176
179
|
信息: "thông tin / thông tin / thông tin",
|
|
177
180
|
"信息集不能为空,最后一条数据不可删除": "Bộ thông tin không thể trống, dữ liệu cuối cùng không thể bị xóa",
|
|
178
181
|
共: "tổng cộng",
|
|
182
|
+
"共{total}条记录": "Tổng {total} bản ghi",
|
|
179
183
|
关闭: "Đóng cửa đi",
|
|
180
184
|
删除: "Xóa bỏ nó đi",
|
|
181
185
|
加载中___: "Đang tải...",
|
|
@@ -220,7 +224,7 @@ const ve = {
|
|
|
220
224
|
附件预览: "Xem trước tệp đính kèm",
|
|
221
225
|
附件预览未初始化: "Bản xem trước đính kèm không được khởi tạo"
|
|
222
226
|
}
|
|
223
|
-
},
|
|
227
|
+
}, be = {
|
|
224
228
|
common: {
|
|
225
229
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js no puede leer este archivo, cambió a la vista previa integrada del navegador",
|
|
226
230
|
PDF加载中___: "Carga de PDF...",
|
|
@@ -231,6 +235,7 @@ const ve = {
|
|
|
231
235
|
信息: "Información",
|
|
232
236
|
"信息集不能为空,最后一条数据不可删除": "El conjunto de información no puede estar vacío, el último elemento de datos no se puede eliminar.",
|
|
233
237
|
共: "Total",
|
|
238
|
+
"共{total}条记录": "Total {total} registros",
|
|
234
239
|
关闭: "Cierre",
|
|
235
240
|
删除: "Eliminación",
|
|
236
241
|
加载中___: "Loading...",
|
|
@@ -275,7 +280,7 @@ const ve = {
|
|
|
275
280
|
附件预览: "Anexo Preview",
|
|
276
281
|
附件预览未初始化: "Anexo Preview no inicializado"
|
|
277
282
|
}
|
|
278
|
-
},
|
|
283
|
+
}, ke = {
|
|
279
284
|
common: {
|
|
280
285
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js tidak dapat membaca file ini, telah beralih ke pratinjau built-in browser",
|
|
281
286
|
PDF加载中___: "PDF sedang memuat...",
|
|
@@ -286,6 +291,7 @@ const ve = {
|
|
|
286
291
|
信息: "Informasi:",
|
|
287
292
|
"信息集不能为空,最后一条数据不可删除": "Set informasi tidak dapat kosong, data terakhir tidak dapat dihapus, dan data terakhir tidak dapat dihapus.",
|
|
288
293
|
共: "bersama-sama",
|
|
294
|
+
"共{total}条记录": "Total {total} catatan",
|
|
289
295
|
关闭: "Penutupan",
|
|
290
296
|
删除: "Penghapusan",
|
|
291
297
|
加载中___: "sedang dimuat...",
|
|
@@ -341,6 +347,7 @@ const ve = {
|
|
|
341
347
|
信息: "Information",
|
|
342
348
|
"信息集不能为空,最后一条数据不可删除": "Der Datensatz kann nicht leer sein, die letzten Daten können nicht gelöscht werden.",
|
|
343
349
|
共: "gemeinsam",
|
|
350
|
+
"共{total}条记录": "Insgesamt {total} Einträge",
|
|
344
351
|
关闭: "Schließen",
|
|
345
352
|
删除: "Löschen",
|
|
346
353
|
加载中___: "geladen...",
|
|
@@ -385,7 +392,7 @@ const ve = {
|
|
|
385
392
|
附件预览: "Anhang Vorschau",
|
|
386
393
|
附件预览未初始化: "Anlage Vorschau nicht initialisiert"
|
|
387
394
|
}
|
|
388
|
-
},
|
|
395
|
+
}, Pe = {
|
|
389
396
|
common: {
|
|
390
397
|
"PDF_js无法读取该文件,已切换为浏览器内置预览": "O PDF.js não pode ler o arquivo, mudou para a visualização integrada do navegador",
|
|
391
398
|
PDF加载中___: "PDF Carregando...",
|
|
@@ -396,6 +403,7 @@ const ve = {
|
|
|
396
403
|
信息: "Informações",
|
|
397
404
|
"信息集不能为空,最后一条数据不可删除": "O conjunto de informações não pode estar vazio, o último item de dados não pode ser excluído",
|
|
398
405
|
共: "Total",
|
|
406
|
+
"共{total}条记录": "Total de {total} registros",
|
|
399
407
|
关闭: "Fechamento",
|
|
400
408
|
删除: "Exclusão",
|
|
401
409
|
加载中___: "Loading...",
|
|
@@ -440,151 +448,178 @@ const ve = {
|
|
|
440
448
|
附件预览: "Anexo Preview",
|
|
441
449
|
附件预览未初始化: "Anexo Preview não inicializado"
|
|
442
450
|
}
|
|
443
|
-
},
|
|
444
|
-
"zh-cn":
|
|
445
|
-
en:
|
|
446
|
-
th:
|
|
447
|
-
vi:
|
|
448
|
-
es:
|
|
449
|
-
id:
|
|
451
|
+
}, Ae = {}, De = {
|
|
452
|
+
"zh-cn": he,
|
|
453
|
+
en: ge,
|
|
454
|
+
th: we,
|
|
455
|
+
vi: ye,
|
|
456
|
+
es: be,
|
|
457
|
+
id: ke,
|
|
450
458
|
de: _e,
|
|
451
|
-
pt:
|
|
452
|
-
km:
|
|
453
|
-
},
|
|
454
|
-
zh: "zh-cn",
|
|
455
|
-
"
|
|
456
|
-
"
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
459
|
+
pt: Pe,
|
|
460
|
+
km: Ae
|
|
461
|
+
}, S = [
|
|
462
|
+
{ key: "zh", label: "简体中文", displayLabel: "简体中文", elementPlusLocale: "zh-cn" },
|
|
463
|
+
{ key: "en", label: "英语", displayLabel: "English", elementPlusLocale: "en" },
|
|
464
|
+
{ key: "th", label: "泰语", displayLabel: "ไทย", elementPlusLocale: "th" },
|
|
465
|
+
{ key: "vi", label: "越南语", displayLabel: "Tiếng Việt", elementPlusLocale: "vi" },
|
|
466
|
+
{ key: "pt", label: "葡萄牙语", displayLabel: "Português", elementPlusLocale: "pt" },
|
|
467
|
+
{ key: "id", label: "印尼语", displayLabel: "Bahasa Indonesia", elementPlusLocale: "id" },
|
|
468
|
+
{ key: "de", label: "德语", displayLabel: "Deutsch", elementPlusLocale: "de" },
|
|
469
|
+
{ key: "es", label: "西班牙语", displayLabel: "Español", elementPlusLocale: "es" },
|
|
470
|
+
{ key: "km", label: "柬埔寨语", displayLabel: "ភាសាខ្មែរ", elementPlusLocale: "km" }
|
|
471
|
+
];
|
|
472
|
+
Object.freeze(
|
|
473
|
+
Object.fromEntries(S.map((e) => [e.key, e.elementPlusLocale]))
|
|
474
|
+
);
|
|
475
|
+
function Le(e, t = {}) {
|
|
476
|
+
const n = t.fallback ?? "zh", o = Ee(t.languageList), i = e.toLowerCase();
|
|
477
|
+
return o.find((l) => l.key === i) ?? o.find((l) => l.key === n) ?? S[0];
|
|
478
|
+
}
|
|
479
|
+
function je(e, t = {}) {
|
|
480
|
+
return Le(e, t).elementPlusLocale;
|
|
481
|
+
}
|
|
482
|
+
function Ee(e) {
|
|
483
|
+
return e != null && e.length ? e.map((t) => {
|
|
484
|
+
const n = t.key ?? t.value, o = S.find((i) => i.key === n) ?? S[0];
|
|
485
|
+
return {
|
|
486
|
+
...o,
|
|
487
|
+
...t,
|
|
488
|
+
key: o.key,
|
|
489
|
+
elementPlusLocale: t.elementPlusLocale ?? o.elementPlusLocale
|
|
490
|
+
};
|
|
491
|
+
}) : S;
|
|
492
|
+
}
|
|
493
|
+
const xe = {
|
|
494
|
+
"zh-hans": "zh",
|
|
495
|
+
"zh-cn": "zh",
|
|
496
|
+
cn: "zh",
|
|
460
497
|
"en-us": "en",
|
|
461
|
-
th_th: "th",
|
|
462
498
|
"th-th": "th",
|
|
463
|
-
vi_vn: "vi",
|
|
464
499
|
"vi-vn": "vi",
|
|
465
|
-
es_es: "es",
|
|
466
500
|
"es-es": "es",
|
|
467
|
-
id_id: "id",
|
|
468
501
|
"id-id": "id",
|
|
469
|
-
de_de: "de",
|
|
470
502
|
"de-de": "de",
|
|
471
|
-
pt_pt: "pt",
|
|
472
503
|
"pt-pt": "pt",
|
|
473
|
-
pt_br: "pt",
|
|
474
504
|
"pt-br": "pt",
|
|
475
|
-
km_kh: "km",
|
|
476
505
|
"km-kh": "km"
|
|
477
506
|
};
|
|
478
|
-
function
|
|
507
|
+
function U(e) {
|
|
479
508
|
const t = String(e || "zh-cn").trim().toLowerCase().replace(/_/g, "-");
|
|
480
|
-
return
|
|
509
|
+
return je(xe[t] || t) || "zh-cn";
|
|
481
510
|
}
|
|
482
|
-
const
|
|
483
|
-
let
|
|
484
|
-
function
|
|
485
|
-
|
|
511
|
+
const B = A("zh-cn");
|
|
512
|
+
let W;
|
|
513
|
+
function te() {
|
|
514
|
+
W?.(), W = void 0;
|
|
486
515
|
}
|
|
487
|
-
function
|
|
488
|
-
return e ? typeof e == "function" ?
|
|
516
|
+
function oe(e) {
|
|
517
|
+
return e ? typeof e == "function" ? U(e()) : le(e) ? U(e.value) : U(e) : B.value;
|
|
489
518
|
}
|
|
490
|
-
function
|
|
519
|
+
function Re(e, t) {
|
|
491
520
|
if (e)
|
|
492
|
-
return t.split(".").reduce((n,
|
|
521
|
+
return t.split(".").reduce((n, o) => {
|
|
493
522
|
if (!(!n || typeof n != "object"))
|
|
494
|
-
return n[
|
|
523
|
+
return n[o];
|
|
495
524
|
}, e);
|
|
496
525
|
}
|
|
497
|
-
function
|
|
498
|
-
const n =
|
|
526
|
+
function re(e, t) {
|
|
527
|
+
const n = Re(De[e], t);
|
|
499
528
|
return typeof n == "string" ? n : void 0;
|
|
500
529
|
}
|
|
501
|
-
function
|
|
502
|
-
|
|
530
|
+
function Ce(e, t) {
|
|
531
|
+
return t ? e.replace(/\{(\w+)\}/g, (n, o) => {
|
|
532
|
+
const i = t[o];
|
|
533
|
+
return i == null ? n : String(i);
|
|
534
|
+
}) : e;
|
|
503
535
|
}
|
|
504
|
-
function
|
|
505
|
-
|
|
536
|
+
function st(e) {
|
|
537
|
+
te(), B.value = U(e);
|
|
506
538
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
539
|
+
function ct() {
|
|
540
|
+
return B.value;
|
|
509
541
|
}
|
|
510
|
-
function
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
542
|
+
function ut() {
|
|
543
|
+
te(), B.value = "zh-cn";
|
|
544
|
+
}
|
|
545
|
+
function dt(e, t = {}) {
|
|
546
|
+
if (te(), t.locale) {
|
|
547
|
+
if (typeof t.locale == "function" || le(t.locale)) {
|
|
548
|
+
W = $(
|
|
549
|
+
() => oe(t.locale),
|
|
515
550
|
(n) => {
|
|
516
|
-
|
|
551
|
+
B.value = n;
|
|
517
552
|
},
|
|
518
553
|
{ immediate: !0, flush: "sync" }
|
|
519
554
|
);
|
|
520
555
|
return;
|
|
521
556
|
}
|
|
522
|
-
|
|
557
|
+
B.value = oe(t.locale);
|
|
523
558
|
}
|
|
524
559
|
}
|
|
525
|
-
function s(e, t = e) {
|
|
526
|
-
const
|
|
527
|
-
return
|
|
560
|
+
function s(e, t = e, n) {
|
|
561
|
+
const o = t || e, i = B.value, l = re(i, e) || re("zh-cn", e) || o || e;
|
|
562
|
+
return Ce(l, n);
|
|
528
563
|
}
|
|
529
564
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
530
|
-
var
|
|
565
|
+
var Be = /* @__PURE__ */ E({
|
|
531
566
|
name: "Download",
|
|
532
567
|
__name: "download",
|
|
533
568
|
setup(e) {
|
|
534
|
-
return (t, n) => (
|
|
569
|
+
return (t, n) => (I(), O("svg", {
|
|
535
570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
536
571
|
viewBox: "0 0 1024 1024"
|
|
537
572
|
}, [
|
|
538
|
-
|
|
573
|
+
V("path", {
|
|
539
574
|
fill: "currentColor",
|
|
540
575
|
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
|
|
541
576
|
})
|
|
542
577
|
]));
|
|
543
578
|
}
|
|
544
|
-
}),
|
|
579
|
+
}), Te = Be, ze = /* @__PURE__ */ E({
|
|
545
580
|
name: "RefreshLeft",
|
|
546
581
|
__name: "refresh-left",
|
|
547
582
|
setup(e) {
|
|
548
|
-
return (t, n) => (
|
|
583
|
+
return (t, n) => (I(), O("svg", {
|
|
549
584
|
xmlns: "http://www.w3.org/2000/svg",
|
|
550
585
|
viewBox: "0 0 1024 1024"
|
|
551
586
|
}, [
|
|
552
|
-
|
|
587
|
+
V("path", {
|
|
553
588
|
fill: "currentColor",
|
|
554
589
|
d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
|
|
555
590
|
})
|
|
556
591
|
]));
|
|
557
592
|
}
|
|
558
|
-
}),
|
|
593
|
+
}), Fe = ze, Me = /* @__PURE__ */ E({
|
|
559
594
|
name: "ZoomIn",
|
|
560
595
|
__name: "zoom-in",
|
|
561
596
|
setup(e) {
|
|
562
|
-
return (t, n) => (
|
|
597
|
+
return (t, n) => (I(), O("svg", {
|
|
563
598
|
xmlns: "http://www.w3.org/2000/svg",
|
|
564
599
|
viewBox: "0 0 1024 1024"
|
|
565
600
|
}, [
|
|
566
|
-
|
|
601
|
+
V("path", {
|
|
567
602
|
fill: "currentColor",
|
|
568
603
|
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
|
|
569
604
|
})
|
|
570
605
|
]));
|
|
571
606
|
}
|
|
572
|
-
}),
|
|
607
|
+
}), Se = Me, Je = /* @__PURE__ */ E({
|
|
573
608
|
name: "ZoomOut",
|
|
574
609
|
__name: "zoom-out",
|
|
575
610
|
setup(e) {
|
|
576
|
-
return (t, n) => (
|
|
611
|
+
return (t, n) => (I(), O("svg", {
|
|
577
612
|
xmlns: "http://www.w3.org/2000/svg",
|
|
578
613
|
viewBox: "0 0 1024 1024"
|
|
579
614
|
}, [
|
|
580
|
-
|
|
615
|
+
V("path", {
|
|
581
616
|
fill: "currentColor",
|
|
582
617
|
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
|
|
583
618
|
})
|
|
584
619
|
]));
|
|
585
620
|
}
|
|
586
|
-
}),
|
|
587
|
-
const
|
|
621
|
+
}), Ne = Je;
|
|
622
|
+
const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAAAAaVBMVEUAAABWapNVapKeqsLJztx3hKnGzN2yu8////9XapWcqMGps8lXapVYa5RWaZWps8lfcJjS1+KjrsVXapWapr////9sfaKrtMrV2uWBj7B4iKqWob1wgaXr7fOBj6/Ax9dhc5yhq8OKl7Wba+6tAAAAE3RSTlMAgGDuDyVLoYDe2XuXRb68cy6e4BCQEAAAAyZJREFUeNrt29tyokAUheGOQjIoeMhuCQ4e0Pd/yCE1STU4mGq7bXqzZ/23ufoqYblTqkIIIYQQQggNlM42Lzctf5nMD22bKQYVOQ30sTPt6dEO74mKXLoiCgDTi1RFbUMUBhZXluQUDKbnWxWtjMLB2pYqUjmFg8WUzSg0TL+rCKVZeJheRJj9DYWHRRnHbBSYnr+qcSsoKCyeLKcfK/emc2UqH4LFGMcVWVftTC4w/TbmhGQjwvR6RBmNAbMYx4nD7k/I1GF3ZZOH3RtHAbDhcZQAG5SJgOn1Vt0mAzYwIUJgvjJ/2OVo2pcmcoQZWehxpBGue5sJEQTryyTBeuMoCtadEFmwjkwYzIyjNJief02IONj3OAqE/ZVJhJnZj3RS1c4nld04ijiC/5EJhbUyobBWJhT2OY5CYa1MKKyVCYXpdSIUphdbobB2HIXCWplQmJGFhZUn07kyNaFgbUsx1/1tb1Jh+i1hDmu0Y+uEN4xqV9ki5Q27atfmKWtYqd1lW84wqj1kr5xhB+3RkjGMrl4yxrCm9pG984V5ytZJINjpY7hmLNki5XjdP0fGFkZ0qL1kfGEt7erzgsYY1lYefrtWsIZ5NAMMMBNg9gEGmD3sejbVnRpyjAvs5rr3DzDAAOsEmH2AAQZYJ8Ds4wJrSlN1NE3+CDYJu+5NgNkHGGCAdQLMPsAAA0zuEQyYbYABBlgnwOwDDDDAOvVhl5NJ1Fu1O6lHMGA/xQl2rPodpcBq6gfYYIABBpgJsAdiBDvX/cTAxF4egNkEWGDY5Q5s8v9onoZdR3KNC4yOg7AzOccFNvi36POJIy4wqgZgF/KIC6yporuCwNrq/nNW7ckzLjCi/bO//MEF9mCAAQYYYDwCDDAmAQYYkwADjEmAAcYkwABjEmCAMQkwwJgEGGBMAgwwJgEGGJMAA4xJgAHGJMD+B1hGE6hwgK1oAqUOsJz4lymHCuJfrpTM9SicYC/EvUw5lRD3Psde4lP29YSJG8bse+ulvZZ5uFTCV5YZl6hpXKXKs5TlL22jnlCaM7uHV7NEPam02LwwaVYkCiGEEEIIITTUH1Fqd5V0WMtQAAAAAElFTkSuQmCC", Ye = "data:image/png;base64,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", Ie = /* @__PURE__ */ new Set([
|
|
588
623
|
"jpg",
|
|
589
624
|
"jpeg",
|
|
590
625
|
"png",
|
|
@@ -594,7 +629,7 @@ const Fe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
594
629
|
"svg",
|
|
595
630
|
"avif",
|
|
596
631
|
"ico"
|
|
597
|
-
]),
|
|
632
|
+
]), Oe = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), Ve = /* @__PURE__ */ new Set([
|
|
598
633
|
"mp3",
|
|
599
634
|
"wav",
|
|
600
635
|
"ogg",
|
|
@@ -602,7 +637,7 @@ const Fe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
602
637
|
"m4a",
|
|
603
638
|
"aac",
|
|
604
639
|
"flac"
|
|
605
|
-
]),
|
|
640
|
+
]), qe = /* @__PURE__ */ new Set([
|
|
606
641
|
"html",
|
|
607
642
|
"htm",
|
|
608
643
|
"txt",
|
|
@@ -611,7 +646,7 @@ const Fe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
611
646
|
"csv",
|
|
612
647
|
"md",
|
|
613
648
|
"log"
|
|
614
|
-
]),
|
|
649
|
+
]), Ge = /* @__PURE__ */ new Set([
|
|
615
650
|
"doc",
|
|
616
651
|
"docx",
|
|
617
652
|
"xls",
|
|
@@ -621,24 +656,37 @@ const Fe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
|
|
|
621
656
|
"zip",
|
|
622
657
|
"rar",
|
|
623
658
|
"7z"
|
|
624
|
-
])
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
659
|
+
]), Q = {
|
|
660
|
+
component: "JtAttachmentPreview",
|
|
661
|
+
marker: "2026-06-25-download-fix-recheck",
|
|
662
|
+
source: "@jt-home/mfe-components/src/components/JtAttachmentPreview/index.ts",
|
|
663
|
+
pdfLoadMode: "fetch-bytes-then-pdfjs-data",
|
|
664
|
+
previewDownloadMode: "blob-only-no-raw-url-fallback"
|
|
665
|
+
};
|
|
666
|
+
function k(e, t) {
|
|
667
|
+
console.info(`[JtAttachmentPreview DEBUG ${Q.marker}] ${e}`, {
|
|
668
|
+
...Q,
|
|
669
|
+
...t
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ = Q, k("module-loaded"));
|
|
673
|
+
let P = null, H = null, Y = null;
|
|
674
|
+
async function He() {
|
|
675
|
+
return H || (H = Promise.all([
|
|
628
676
|
import("./pdf-BmBuG7of.js"),
|
|
629
677
|
import("./pdf.worker.min-4PI-nNLo.js")
|
|
630
|
-
]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))),
|
|
678
|
+
]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))), H;
|
|
631
679
|
}
|
|
632
|
-
function
|
|
680
|
+
function Ke(e) {
|
|
633
681
|
return typeof e == "string" ? { url: e } : e;
|
|
634
682
|
}
|
|
635
|
-
function
|
|
683
|
+
function se(e) {
|
|
636
684
|
const [t] = e.split(/[?#]/);
|
|
637
685
|
return t ?? "";
|
|
638
686
|
}
|
|
639
|
-
function
|
|
687
|
+
function ne(e, t) {
|
|
640
688
|
if (t?.trim()) return t.trim();
|
|
641
|
-
const n =
|
|
689
|
+
const n = se(e).split("/").filter(Boolean).pop();
|
|
642
690
|
if (!n) return s("common.附件预览");
|
|
643
691
|
try {
|
|
644
692
|
return decodeURIComponent(n);
|
|
@@ -646,69 +694,81 @@ function $(e, t) {
|
|
|
646
694
|
return n;
|
|
647
695
|
}
|
|
648
696
|
}
|
|
649
|
-
function
|
|
650
|
-
return
|
|
697
|
+
function X(e) {
|
|
698
|
+
return se(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
|
|
651
699
|
}
|
|
652
|
-
function
|
|
700
|
+
function We(e) {
|
|
653
701
|
return e?.trim().replace(/^\./, "").toLowerCase() ?? "";
|
|
654
702
|
}
|
|
655
|
-
function
|
|
656
|
-
const t =
|
|
657
|
-
return
|
|
703
|
+
function Qe(e) {
|
|
704
|
+
const t = We(e);
|
|
705
|
+
return Ie.has(t) ? "image" : t === "pdf" ? "pdf" : Oe.has(t) ? "video" : Ve.has(t) ? "audio" : qe.has(t) ? "iframe" : Ge.has(t) ? "unsupported" : "unknown";
|
|
658
706
|
}
|
|
659
|
-
function
|
|
707
|
+
function ae(e) {
|
|
660
708
|
const t = e.toLowerCase().split(";")[0]?.trim() ?? "";
|
|
661
709
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("text/") ? "iframe" : "unknown";
|
|
662
710
|
}
|
|
663
|
-
function
|
|
711
|
+
function ce(e) {
|
|
664
712
|
if (!e.url.trim()) return "empty";
|
|
665
713
|
if (e.mode && e.mode !== "auto") return e.mode;
|
|
666
714
|
if (e.mimeType) {
|
|
667
|
-
const n =
|
|
715
|
+
const n = ae(e.mimeType);
|
|
668
716
|
if (n !== "unknown") return n;
|
|
669
717
|
}
|
|
670
|
-
const t =
|
|
671
|
-
e.extension ||
|
|
718
|
+
const t = Qe(
|
|
719
|
+
e.extension || X(e.name || "") || X(e.url)
|
|
672
720
|
);
|
|
673
721
|
return t !== "unknown" ? t : "unknown";
|
|
674
722
|
}
|
|
675
|
-
async function
|
|
723
|
+
async function Xe(e) {
|
|
676
724
|
try {
|
|
677
725
|
const n = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
|
|
678
|
-
return
|
|
726
|
+
return ae(n);
|
|
679
727
|
} catch {
|
|
680
728
|
return "unknown";
|
|
681
729
|
}
|
|
682
730
|
}
|
|
683
|
-
async function
|
|
731
|
+
async function ue(e) {
|
|
684
732
|
const t = await fetch(e);
|
|
685
733
|
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
686
734
|
return t.blob();
|
|
687
735
|
}
|
|
688
|
-
async function
|
|
736
|
+
async function Ze(e) {
|
|
737
|
+
k("fetch-pdf-bytes-start", {
|
|
738
|
+
url: e
|
|
739
|
+
});
|
|
689
740
|
const t = await fetch(e);
|
|
690
741
|
if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
|
|
691
|
-
|
|
742
|
+
const n = new Uint8Array(await t.arrayBuffer());
|
|
743
|
+
return k("fetch-pdf-bytes-done", {
|
|
744
|
+
url: e,
|
|
745
|
+
byteLength: n.byteLength,
|
|
746
|
+
contentType: t.headers.get("content-type") ?? ""
|
|
747
|
+
}), n;
|
|
692
748
|
}
|
|
693
|
-
function
|
|
694
|
-
const n =
|
|
749
|
+
function $e(e, t) {
|
|
750
|
+
const n = X(t);
|
|
695
751
|
return n === "doc" || n === "docx" ? "W" : n === "xls" || n === "xlsx" ? "X" : n === "ppt" || n === "pptx" ? "P" : n === "zip" || n === "rar" || n === "7z" ? "ZIP" : e === "pdf" ? "PDF" : "FILE";
|
|
696
752
|
}
|
|
697
|
-
function
|
|
753
|
+
function de(e, t, n, o = !1) {
|
|
698
754
|
return a(
|
|
699
755
|
"button",
|
|
700
756
|
{
|
|
701
757
|
class: n,
|
|
702
758
|
type: "button",
|
|
703
759
|
onClick: () => {
|
|
704
|
-
|
|
760
|
+
k("download-button-click", {
|
|
761
|
+
url: e,
|
|
762
|
+
downloadName: t,
|
|
763
|
+
fallbackToRawUrl: o
|
|
764
|
+
}), fe(e, t, { fallbackToRawUrl: o });
|
|
705
765
|
}
|
|
706
766
|
},
|
|
707
767
|
[
|
|
708
768
|
a(
|
|
709
769
|
N,
|
|
710
770
|
{ class: "jt-attachment-preview-service__download-icon" },
|
|
711
|
-
() => a(
|
|
771
|
+
() => a(Te)
|
|
712
772
|
),
|
|
713
773
|
a(
|
|
714
774
|
"span",
|
|
@@ -718,10 +778,10 @@ function ce(e, t, n) {
|
|
|
718
778
|
]
|
|
719
779
|
);
|
|
720
780
|
}
|
|
721
|
-
function
|
|
781
|
+
function K(e) {
|
|
722
782
|
return e === "image" || e === "pdf";
|
|
723
783
|
}
|
|
724
|
-
function
|
|
784
|
+
function me(e) {
|
|
725
785
|
return a(
|
|
726
786
|
"div",
|
|
727
787
|
{ class: "jt-attachment-preview-service__preview-fallback" },
|
|
@@ -747,19 +807,36 @@ function le(e) {
|
|
|
747
807
|
]
|
|
748
808
|
);
|
|
749
809
|
}
|
|
750
|
-
function
|
|
810
|
+
function Z(e, t) {
|
|
751
811
|
const n = document.createElement("a");
|
|
752
812
|
n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), n.remove();
|
|
753
813
|
}
|
|
754
|
-
async function
|
|
814
|
+
async function fe(e, t, n = {}) {
|
|
815
|
+
k("download-start", {
|
|
816
|
+
url: e,
|
|
817
|
+
downloadName: t,
|
|
818
|
+
fallbackToRawUrl: !!n.fallbackToRawUrl
|
|
819
|
+
});
|
|
820
|
+
let o = "";
|
|
755
821
|
try {
|
|
756
|
-
const
|
|
757
|
-
|
|
822
|
+
const i = await ue(e);
|
|
823
|
+
o = URL.createObjectURL(i), k("download-blob-ready", {
|
|
824
|
+
url: e,
|
|
825
|
+
downloadName: t,
|
|
826
|
+
blobType: i.type,
|
|
827
|
+
blobSize: i.size
|
|
828
|
+
}), Z(o, t);
|
|
758
829
|
} catch {
|
|
759
|
-
|
|
830
|
+
k("download-blob-failed", {
|
|
831
|
+
url: e,
|
|
832
|
+
downloadName: t,
|
|
833
|
+
fallbackToRawUrl: !!n.fallbackToRawUrl
|
|
834
|
+
}), n.fallbackToRawUrl && Z(e, t);
|
|
835
|
+
} finally {
|
|
836
|
+
o && window.setTimeout(() => URL.revokeObjectURL(o), 1e3);
|
|
760
837
|
}
|
|
761
838
|
}
|
|
762
|
-
const
|
|
839
|
+
const et = E({
|
|
763
840
|
name: "JtAttachmentPreviewPdfCanvas",
|
|
764
841
|
props: {
|
|
765
842
|
url: {
|
|
@@ -784,81 +861,83 @@ const Ke = L({
|
|
|
784
861
|
previewError: (e) => e instanceof Event
|
|
785
862
|
},
|
|
786
863
|
setup(e, { emit: t }) {
|
|
787
|
-
const n = A("loading"),
|
|
788
|
-
let m = null,
|
|
789
|
-
async function
|
|
864
|
+
const n = A("loading"), o = A([]), i = A([]), l = /* @__PURE__ */ new Map(), c = A("");
|
|
865
|
+
let m = null, b = [], f = 0;
|
|
866
|
+
async function v(r, u) {
|
|
790
867
|
if (!u) return null;
|
|
791
|
-
const
|
|
792
|
-
return !Array.isArray(
|
|
868
|
+
const g = typeof u == "string" ? await r.getDestination(u) : u;
|
|
869
|
+
return !Array.isArray(g) || !g[0] ? null : await r.getPageIndex(g[0]) + 1;
|
|
793
870
|
}
|
|
794
|
-
async function
|
|
871
|
+
async function x(r, u, g = 0) {
|
|
795
872
|
if (!u?.length) return [];
|
|
796
|
-
const
|
|
797
|
-
for (const
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
title:
|
|
801
|
-
pageNumber:
|
|
802
|
-
level:
|
|
873
|
+
const w = [];
|
|
874
|
+
for (const L of u) {
|
|
875
|
+
const T = await v(r, L.dest);
|
|
876
|
+
w.push({
|
|
877
|
+
title: L.title || s("common.未命名标题"),
|
|
878
|
+
pageNumber: T,
|
|
879
|
+
level: g
|
|
803
880
|
});
|
|
804
|
-
const
|
|
805
|
-
|
|
881
|
+
const R = await x(r, L.items, g + 1);
|
|
882
|
+
w.push(...R);
|
|
806
883
|
}
|
|
807
|
-
return
|
|
884
|
+
return w;
|
|
808
885
|
}
|
|
809
|
-
function
|
|
810
|
-
|
|
811
|
-
for (const
|
|
812
|
-
|
|
813
|
-
|
|
886
|
+
function h() {
|
|
887
|
+
f += 1;
|
|
888
|
+
for (const r of b)
|
|
889
|
+
r.cancel();
|
|
890
|
+
b = [], m?.destroy(), m = null, l.clear();
|
|
814
891
|
}
|
|
815
|
-
async function
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
n.value = "loading",
|
|
892
|
+
async function D() {
|
|
893
|
+
h();
|
|
894
|
+
const r = f;
|
|
895
|
+
n.value = "loading", c.value = "", o.value = [], i.value = [];
|
|
819
896
|
try {
|
|
820
|
-
const u = await
|
|
821
|
-
if (
|
|
822
|
-
const
|
|
823
|
-
if (
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
897
|
+
const u = await He();
|
|
898
|
+
if (r !== f) return;
|
|
899
|
+
const g = await Ze(e.url);
|
|
900
|
+
if (r !== f) return;
|
|
901
|
+
k("render-pdf-get-document-data", {
|
|
902
|
+
byteLength: g.byteLength
|
|
903
|
+
}), m = u.getDocument({ data: g });
|
|
904
|
+
const w = await m.promise;
|
|
905
|
+
if (r !== f) return;
|
|
906
|
+
o.value = Array.from(
|
|
907
|
+
{ length: w.numPages },
|
|
908
|
+
(R, C) => C + 1
|
|
909
|
+
), i.value = await x(
|
|
910
|
+
w,
|
|
911
|
+
await w.getOutline()
|
|
912
|
+
), await pe();
|
|
913
|
+
const L = l.values().next().value, T = Math.max(
|
|
914
|
+
(L?.parentElement?.clientWidth ?? 800) - 32,
|
|
836
915
|
320
|
|
837
916
|
);
|
|
838
|
-
for (const
|
|
839
|
-
if (
|
|
840
|
-
const C = await
|
|
841
|
-
if (!
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
const
|
|
845
|
-
canvas:
|
|
846
|
-
canvasContext:
|
|
847
|
-
viewport:
|
|
917
|
+
for (const R of o.value) {
|
|
918
|
+
if (r !== f) return;
|
|
919
|
+
const C = await w.getPage(R), y = l.get(R), z = y?.getContext("2d");
|
|
920
|
+
if (!y || !z) continue;
|
|
921
|
+
const G = C.getViewport({ scale: 1 }), d = Math.min(T / G.width, 2), F = C.getViewport({ scale: d }), J = window.devicePixelRatio || 1;
|
|
922
|
+
y.width = Math.floor(F.width * J), y.height = Math.floor(F.height * J), y.style.width = `${Math.floor(F.width)}px`, y.style.height = `${Math.floor(F.height)}px`, z.setTransform(J, 0, 0, J, 0, 0);
|
|
923
|
+
const ie = C.render({
|
|
924
|
+
canvas: y,
|
|
925
|
+
canvasContext: z,
|
|
926
|
+
viewport: F
|
|
848
927
|
});
|
|
849
|
-
|
|
928
|
+
b.push(ie), await ie.promise;
|
|
850
929
|
}
|
|
851
|
-
if (
|
|
930
|
+
if (r !== f) return;
|
|
852
931
|
n.value = "ready", t("previewLoad", new Event("load"));
|
|
853
932
|
} catch (u) {
|
|
854
|
-
if (
|
|
855
|
-
n.value = "error",
|
|
933
|
+
if (r !== f) return;
|
|
934
|
+
n.value = "error", c.value = u instanceof Error ? u.message : s("common.PDF加载失败"), t("previewError", new Event("error"));
|
|
856
935
|
}
|
|
857
936
|
}
|
|
858
|
-
|
|
859
|
-
function p(
|
|
860
|
-
if (!
|
|
861
|
-
|
|
937
|
+
$(() => e.url, D, { immediate: !0 }), q(h);
|
|
938
|
+
function p(r) {
|
|
939
|
+
if (!r) return;
|
|
940
|
+
l.get(r)?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
862
941
|
}
|
|
863
942
|
return () => a("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
|
|
864
943
|
n.value === "loading" ? a(
|
|
@@ -867,8 +946,8 @@ const Ke = L({
|
|
|
867
946
|
s("common.PDF加载中___")
|
|
868
947
|
) : null,
|
|
869
948
|
n.value === "error" ? a("div", { class: "jt-attachment-preview-service__pdf-state" }, [
|
|
870
|
-
|
|
871
|
-
icon:
|
|
949
|
+
me({
|
|
950
|
+
icon: Ye,
|
|
872
951
|
name: e.name
|
|
873
952
|
})
|
|
874
953
|
]) : null,
|
|
@@ -900,18 +979,18 @@ const Ke = L({
|
|
|
900
979
|
class: "jt-attachment-preview-service__pdf-outline-list"
|
|
901
980
|
},
|
|
902
981
|
i.value.map(
|
|
903
|
-
(
|
|
982
|
+
(r, u) => a(
|
|
904
983
|
"button",
|
|
905
984
|
{
|
|
906
|
-
key: `${
|
|
985
|
+
key: `${r.title}-${u}`,
|
|
907
986
|
class: "jt-attachment-preview-service__pdf-outline-item",
|
|
908
|
-
style: { paddingLeft: `${12 +
|
|
987
|
+
style: { paddingLeft: `${12 + r.level * 14}px` },
|
|
909
988
|
type: "button",
|
|
910
|
-
disabled: !
|
|
911
|
-
title:
|
|
912
|
-
onClick: () => p(
|
|
989
|
+
disabled: !r.pageNumber,
|
|
990
|
+
title: r.title,
|
|
991
|
+
onClick: () => p(r.pageNumber)
|
|
913
992
|
},
|
|
914
|
-
|
|
993
|
+
r.title
|
|
915
994
|
)
|
|
916
995
|
)
|
|
917
996
|
)
|
|
@@ -920,11 +999,11 @@ const Ke = L({
|
|
|
920
999
|
a(
|
|
921
1000
|
"div",
|
|
922
1001
|
{ class: "jt-attachment-preview-service__pdf-pages" },
|
|
923
|
-
|
|
924
|
-
(
|
|
925
|
-
key:
|
|
1002
|
+
o.value.map(
|
|
1003
|
+
(r) => a("canvas", {
|
|
1004
|
+
key: r,
|
|
926
1005
|
ref: (u) => {
|
|
927
|
-
u instanceof HTMLCanvasElement &&
|
|
1006
|
+
u instanceof HTMLCanvasElement && l.set(r, u);
|
|
928
1007
|
},
|
|
929
1008
|
class: "jt-attachment-preview-service__pdf-page"
|
|
930
1009
|
})
|
|
@@ -934,7 +1013,7 @@ const Ke = L({
|
|
|
934
1013
|
)
|
|
935
1014
|
]);
|
|
936
1015
|
}
|
|
937
|
-
}),
|
|
1016
|
+
}), tt = E({
|
|
938
1017
|
name: "JtAttachmentPreviewImageTransform",
|
|
939
1018
|
props: {
|
|
940
1019
|
url: {
|
|
@@ -963,65 +1042,65 @@ const Ke = L({
|
|
|
963
1042
|
previewError: (e) => e instanceof Event
|
|
964
1043
|
},
|
|
965
1044
|
setup(e, { emit: t }) {
|
|
966
|
-
const n = A(null),
|
|
967
|
-
let
|
|
968
|
-
const
|
|
1045
|
+
const n = A(null), o = A("ready"), i = A(1), l = A(!1);
|
|
1046
|
+
let c = 0, m = 0, b = 0, f = 0, v = 0, x = 0, h = 0;
|
|
1047
|
+
const D = j(
|
|
969
1048
|
() => ({
|
|
970
1049
|
"--jt-attachment-preview-service-image-fit": e.fit,
|
|
971
|
-
transform: `translate(${
|
|
1050
|
+
transform: `translate(${c}px, ${m}px) scale(${i.value})`
|
|
972
1051
|
})
|
|
973
1052
|
);
|
|
974
1053
|
function p() {
|
|
975
|
-
n.value && (n.value.style.transform = `translate(${
|
|
1054
|
+
n.value && (n.value.style.transform = `translate(${c}px, ${m}px) scale(${i.value})`);
|
|
976
1055
|
}
|
|
977
|
-
function
|
|
978
|
-
|
|
979
|
-
|
|
1056
|
+
function r() {
|
|
1057
|
+
h || (h = window.requestAnimationFrame(() => {
|
|
1058
|
+
h = 0, p();
|
|
980
1059
|
}));
|
|
981
1060
|
}
|
|
982
1061
|
function u(d) {
|
|
983
|
-
i.value = Math.min(Math.max(Number(d.toFixed(2)), 0.2), 5), i.value <= 1 && (
|
|
1062
|
+
i.value = Math.min(Math.max(Number(d.toFixed(2)), 0.2), 5), i.value <= 1 && (c = 0, m = 0), p();
|
|
984
1063
|
}
|
|
985
|
-
function
|
|
1064
|
+
function g() {
|
|
986
1065
|
u(i.value + 0.2);
|
|
987
1066
|
}
|
|
988
|
-
function
|
|
1067
|
+
function w() {
|
|
989
1068
|
const d = Math.max(Number((i.value - 0.2).toFixed(2)), 0.2);
|
|
990
|
-
i.value = d, d <= 1 && (
|
|
1069
|
+
i.value = d, d <= 1 && (c = 0, m = 0), p();
|
|
991
1070
|
}
|
|
992
|
-
function
|
|
993
|
-
|
|
1071
|
+
function L() {
|
|
1072
|
+
c = 0, m = 0, u(1);
|
|
994
1073
|
}
|
|
995
|
-
function
|
|
996
|
-
|
|
1074
|
+
function T(d) {
|
|
1075
|
+
o.value = "ready", t("previewLoad", d);
|
|
997
1076
|
}
|
|
998
|
-
function
|
|
999
|
-
|
|
1077
|
+
function R(d) {
|
|
1078
|
+
o.value = "error", t("previewError", d);
|
|
1000
1079
|
}
|
|
1001
1080
|
function C(d) {
|
|
1002
|
-
i.value <= 1 || (d.preventDefault(),
|
|
1081
|
+
i.value <= 1 || (d.preventDefault(), l.value = !0, b = d.clientX, f = d.clientY, v = c, x = m, window.addEventListener("pointermove", y), window.addEventListener("pointerup", z, { once: !0 }));
|
|
1003
1082
|
}
|
|
1004
|
-
function
|
|
1005
|
-
|
|
1083
|
+
function y(d) {
|
|
1084
|
+
l.value && (c = v + d.clientX - b, m = x + d.clientY - f, r());
|
|
1006
1085
|
}
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1086
|
+
function z() {
|
|
1087
|
+
l.value = !1, window.removeEventListener("pointermove", y);
|
|
1009
1088
|
}
|
|
1010
|
-
function
|
|
1089
|
+
function G(d) {
|
|
1011
1090
|
d.preventDefault(), u(i.value + (d.deltaY < 0 ? 0.1 : -0.1));
|
|
1012
1091
|
}
|
|
1013
|
-
return
|
|
1092
|
+
return ee(p), $(
|
|
1014
1093
|
() => e.url,
|
|
1015
1094
|
() => {
|
|
1016
|
-
|
|
1095
|
+
o.value = "ready", L();
|
|
1017
1096
|
}
|
|
1018
|
-
),
|
|
1019
|
-
window.removeEventListener("pointermove",
|
|
1097
|
+
), q(() => {
|
|
1098
|
+
window.removeEventListener("pointermove", y), h && window.cancelAnimationFrame(h);
|
|
1020
1099
|
}), () => a(
|
|
1021
1100
|
"div",
|
|
1022
1101
|
{ class: "jt-attachment-preview-service__image-viewer" },
|
|
1023
|
-
|
|
1024
|
-
icon:
|
|
1102
|
+
o.value === "error" ? me({
|
|
1103
|
+
icon: Ue,
|
|
1025
1104
|
name: e.name
|
|
1026
1105
|
}) : [
|
|
1027
1106
|
a("img", {
|
|
@@ -1030,15 +1109,15 @@ const Ke = L({
|
|
|
1030
1109
|
"jt-attachment-preview-service__media",
|
|
1031
1110
|
"jt-attachment-preview-service__image",
|
|
1032
1111
|
i.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
|
|
1033
|
-
|
|
1112
|
+
l.value ? "jt-attachment-preview-service__image--dragging" : ""
|
|
1034
1113
|
],
|
|
1035
1114
|
src: e.url,
|
|
1036
1115
|
alt: e.name,
|
|
1037
|
-
style:
|
|
1038
|
-
onLoad:
|
|
1039
|
-
onError:
|
|
1116
|
+
style: D.value,
|
|
1117
|
+
onLoad: T,
|
|
1118
|
+
onError: R,
|
|
1040
1119
|
onPointerdown: C,
|
|
1041
|
-
onWheel:
|
|
1120
|
+
onWheel: G,
|
|
1042
1121
|
onDragstart: (d) => d.preventDefault(),
|
|
1043
1122
|
draggable: !1
|
|
1044
1123
|
}),
|
|
@@ -1052,9 +1131,9 @@ const Ke = L({
|
|
|
1052
1131
|
class: "jt-attachment-preview-service__image-tool",
|
|
1053
1132
|
type: "button",
|
|
1054
1133
|
title: s("common.缩小"),
|
|
1055
|
-
onClick:
|
|
1134
|
+
onClick: w
|
|
1056
1135
|
},
|
|
1057
|
-
[a(N, () => a(
|
|
1136
|
+
[a(N, () => a(Ne))]
|
|
1058
1137
|
),
|
|
1059
1138
|
a(
|
|
1060
1139
|
"span",
|
|
@@ -1067,9 +1146,9 @@ const Ke = L({
|
|
|
1067
1146
|
class: "jt-attachment-preview-service__image-tool",
|
|
1068
1147
|
type: "button",
|
|
1069
1148
|
title: s("common.放大"),
|
|
1070
|
-
onClick:
|
|
1149
|
+
onClick: g
|
|
1071
1150
|
},
|
|
1072
|
-
[a(N, () => a(
|
|
1151
|
+
[a(N, () => a(Se))]
|
|
1073
1152
|
),
|
|
1074
1153
|
a(
|
|
1075
1154
|
"button",
|
|
@@ -1077,16 +1156,16 @@ const Ke = L({
|
|
|
1077
1156
|
class: "jt-attachment-preview-service__image-tool",
|
|
1078
1157
|
type: "button",
|
|
1079
1158
|
title: s("common.复位"),
|
|
1080
|
-
onClick:
|
|
1159
|
+
onClick: L
|
|
1081
1160
|
},
|
|
1082
|
-
[a(N, () => a(
|
|
1161
|
+
[a(N, () => a(Fe))]
|
|
1083
1162
|
)
|
|
1084
1163
|
]
|
|
1085
1164
|
)
|
|
1086
1165
|
]
|
|
1087
1166
|
);
|
|
1088
1167
|
}
|
|
1089
|
-
}),
|
|
1168
|
+
}), nt = E({
|
|
1090
1169
|
name: "JtAttachmentPreviewService",
|
|
1091
1170
|
props: {
|
|
1092
1171
|
options: {
|
|
@@ -1100,36 +1179,36 @@ const Ke = L({
|
|
|
1100
1179
|
},
|
|
1101
1180
|
setup(e) {
|
|
1102
1181
|
const t = j(
|
|
1103
|
-
() =>
|
|
1182
|
+
() => ne(e.options.url, e.options.name)
|
|
1104
1183
|
), n = j(
|
|
1105
1184
|
() => e.options.downloadName || t.value
|
|
1106
|
-
),
|
|
1107
|
-
() =>
|
|
1108
|
-
),
|
|
1185
|
+
), o = j(() => ce(e.options)), i = j(
|
|
1186
|
+
() => $e(o.value, e.options.url)
|
|
1187
|
+
), l = j(
|
|
1109
1188
|
() => ({
|
|
1110
1189
|
zIndex: e.options.zIndex ?? 3e3,
|
|
1111
1190
|
"--jt-attachment-preview-service-image-fit": e.options.fit ?? "contain"
|
|
1112
1191
|
})
|
|
1113
1192
|
);
|
|
1114
|
-
function
|
|
1193
|
+
function c() {
|
|
1115
1194
|
e.options.onClose?.(), e.onDestroy();
|
|
1116
1195
|
}
|
|
1117
|
-
function m(
|
|
1118
|
-
|
|
1196
|
+
function m(v) {
|
|
1197
|
+
v.key === "Escape" && e.options.closeOnPressEscape !== !1 && c();
|
|
1119
1198
|
}
|
|
1120
|
-
function
|
|
1121
|
-
e.options.onLoad?.(
|
|
1199
|
+
function b(v) {
|
|
1200
|
+
e.options.onLoad?.(v);
|
|
1122
1201
|
}
|
|
1123
|
-
function v
|
|
1124
|
-
e.options.onError?.(
|
|
1202
|
+
function f(v) {
|
|
1203
|
+
e.options.onError?.(v);
|
|
1125
1204
|
}
|
|
1126
|
-
return
|
|
1205
|
+
return ee(() => {
|
|
1127
1206
|
document.addEventListener("keydown", m), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1128
|
-
}),
|
|
1207
|
+
}), q(() => {
|
|
1129
1208
|
document.removeEventListener("keydown", m), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1130
1209
|
}), () => {
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1210
|
+
const v = e.options.downloadable === !1 ? [] : [
|
|
1211
|
+
de(
|
|
1133
1212
|
e.options.url,
|
|
1134
1213
|
n.value,
|
|
1135
1214
|
"jt-attachment-preview-service__top-download"
|
|
@@ -1137,7 +1216,7 @@ const Ke = L({
|
|
|
1137
1216
|
];
|
|
1138
1217
|
return a(
|
|
1139
1218
|
"div",
|
|
1140
|
-
{ class: "jt-attachment-preview-service", style:
|
|
1219
|
+
{ class: "jt-attachment-preview-service", style: l.value },
|
|
1141
1220
|
[
|
|
1142
1221
|
a("div", { class: "jt-attachment-preview-service__modal" }, [
|
|
1143
1222
|
a("div", { class: "jt-attachment-preview-service__header" }, [
|
|
@@ -1153,14 +1232,14 @@ const Ke = L({
|
|
|
1153
1232
|
"div",
|
|
1154
1233
|
{ class: "jt-attachment-preview-service__header-actions" },
|
|
1155
1234
|
[
|
|
1156
|
-
...
|
|
1235
|
+
...v,
|
|
1157
1236
|
a(
|
|
1158
1237
|
"button",
|
|
1159
1238
|
{
|
|
1160
1239
|
class: "jt-attachment-preview-service__close",
|
|
1161
1240
|
type: "button",
|
|
1162
1241
|
"aria-label": s("common.关闭"),
|
|
1163
|
-
onClick:
|
|
1242
|
+
onClick: c
|
|
1164
1243
|
},
|
|
1165
1244
|
"×"
|
|
1166
1245
|
)
|
|
@@ -1168,16 +1247,16 @@ const Ke = L({
|
|
|
1168
1247
|
)
|
|
1169
1248
|
]),
|
|
1170
1249
|
a("div", { class: "jt-attachment-preview-service__body" }, [
|
|
1171
|
-
|
|
1172
|
-
type:
|
|
1250
|
+
at({
|
|
1251
|
+
type: o.value,
|
|
1173
1252
|
url: e.options.url,
|
|
1174
1253
|
name: t.value,
|
|
1175
1254
|
downloadName: n.value,
|
|
1176
1255
|
sandbox: e.options.sandbox,
|
|
1177
1256
|
iconText: i.value,
|
|
1178
1257
|
downloadable: e.options.downloadable !== !1,
|
|
1179
|
-
onLoad:
|
|
1180
|
-
onError:
|
|
1258
|
+
onLoad: b,
|
|
1259
|
+
onError: f
|
|
1181
1260
|
})
|
|
1182
1261
|
])
|
|
1183
1262
|
])
|
|
@@ -1185,7 +1264,7 @@ const Ke = L({
|
|
|
1185
1264
|
);
|
|
1186
1265
|
};
|
|
1187
1266
|
}
|
|
1188
|
-
}), M =
|
|
1267
|
+
}), M = E({
|
|
1189
1268
|
name: "JtAttachmentPreviewDetectingService",
|
|
1190
1269
|
props: {
|
|
1191
1270
|
options: {
|
|
@@ -1211,19 +1290,19 @@ const Ke = L({
|
|
|
1211
1290
|
},
|
|
1212
1291
|
setup(e) {
|
|
1213
1292
|
const t = j(
|
|
1214
|
-
() =>
|
|
1293
|
+
() => ne(e.options.url, e.options.name)
|
|
1215
1294
|
), n = j(() => ({
|
|
1216
1295
|
zIndex: e.options.zIndex ?? 3e3
|
|
1217
1296
|
}));
|
|
1218
|
-
function
|
|
1297
|
+
function o() {
|
|
1219
1298
|
e.options.onClose?.(), e.onDestroy();
|
|
1220
1299
|
}
|
|
1221
|
-
function i(
|
|
1222
|
-
|
|
1300
|
+
function i(l) {
|
|
1301
|
+
l.key === "Escape" && e.options.closeOnPressEscape !== !1 && o();
|
|
1223
1302
|
}
|
|
1224
|
-
return
|
|
1303
|
+
return ee(() => {
|
|
1225
1304
|
document.addEventListener("keydown", i), document.body.classList.add("jt-attachment-preview-service-lock");
|
|
1226
|
-
}),
|
|
1305
|
+
}), q(() => {
|
|
1227
1306
|
document.removeEventListener("keydown", i), document.body.classList.remove("jt-attachment-preview-service-lock");
|
|
1228
1307
|
}), () => a(
|
|
1229
1308
|
"div",
|
|
@@ -1249,7 +1328,7 @@ const Ke = L({
|
|
|
1249
1328
|
class: "jt-attachment-preview-service__close",
|
|
1250
1329
|
type: "button",
|
|
1251
1330
|
"aria-label": s("common.关闭"),
|
|
1252
|
-
onClick:
|
|
1331
|
+
onClick: o
|
|
1253
1332
|
},
|
|
1254
1333
|
"×"
|
|
1255
1334
|
)
|
|
@@ -1278,12 +1357,12 @@ const Ke = L({
|
|
|
1278
1357
|
);
|
|
1279
1358
|
}
|
|
1280
1359
|
});
|
|
1281
|
-
function
|
|
1360
|
+
function at(e) {
|
|
1282
1361
|
return e.type === "empty" ? a(
|
|
1283
1362
|
"div",
|
|
1284
1363
|
{ class: "jt-attachment-preview-service__empty" },
|
|
1285
1364
|
s("common.暂无附件")
|
|
1286
|
-
) : e.type === "image" ? a(
|
|
1365
|
+
) : e.type === "image" ? a(tt, {
|
|
1287
1366
|
url: e.url,
|
|
1288
1367
|
name: e.name,
|
|
1289
1368
|
downloadName: e.downloadName,
|
|
@@ -1302,7 +1381,7 @@ function Qe(e) {
|
|
|
1302
1381
|
controls: !0,
|
|
1303
1382
|
onLoadeddata: e.onLoad,
|
|
1304
1383
|
onError: e.onError
|
|
1305
|
-
}) : e.type === "pdf" ? a(
|
|
1384
|
+
}) : e.type === "pdf" ? a(et, {
|
|
1306
1385
|
url: e.url,
|
|
1307
1386
|
name: e.name,
|
|
1308
1387
|
downloadName: e.downloadName,
|
|
@@ -1336,147 +1415,158 @@ function Qe(e) {
|
|
|
1336
1415
|
},
|
|
1337
1416
|
e.name
|
|
1338
1417
|
),
|
|
1339
|
-
e.downloadable ?
|
|
1418
|
+
e.downloadable ? de(
|
|
1340
1419
|
e.url,
|
|
1341
1420
|
e.downloadName,
|
|
1342
1421
|
"jt-attachment-preview-service__primary-download"
|
|
1343
1422
|
) : null
|
|
1344
1423
|
]);
|
|
1345
1424
|
}
|
|
1346
|
-
function
|
|
1425
|
+
function ve(e) {
|
|
1347
1426
|
if (typeof document > "u")
|
|
1348
1427
|
return { close: () => {
|
|
1349
1428
|
} };
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1429
|
+
k("open-called", {
|
|
1430
|
+
rawOptions: typeof e == "string" ? e : { ...e }
|
|
1431
|
+
}), P?.close();
|
|
1432
|
+
const t = Ke(e), n = t.downloadName || ne(t.url, t.name);
|
|
1433
|
+
let o = !1, i = null, l = null;
|
|
1434
|
+
const c = () => {
|
|
1435
|
+
o = !0, i && (_(null, i), i.remove(), i = null), l && (URL.revokeObjectURL(l), l = null), P?.close === c && (P = null);
|
|
1355
1436
|
};
|
|
1356
1437
|
function m() {
|
|
1357
|
-
|
|
1358
|
-
a(
|
|
1438
|
+
o || (i || (i = document.createElement("div"), document.body.appendChild(i)), _(
|
|
1439
|
+
a(nt, {
|
|
1359
1440
|
options: t,
|
|
1360
|
-
onDestroy:
|
|
1441
|
+
onDestroy: c
|
|
1361
1442
|
}),
|
|
1362
1443
|
i
|
|
1363
1444
|
));
|
|
1364
1445
|
}
|
|
1365
|
-
function
|
|
1366
|
-
|
|
1446
|
+
function b() {
|
|
1447
|
+
o || (i || (i = document.createElement("div"), document.body.appendChild(i)), _(
|
|
1367
1448
|
a(M, {
|
|
1368
1449
|
options: t,
|
|
1369
|
-
onDestroy:
|
|
1450
|
+
onDestroy: c
|
|
1370
1451
|
}),
|
|
1371
1452
|
i
|
|
1372
1453
|
));
|
|
1373
1454
|
}
|
|
1374
|
-
function
|
|
1375
|
-
i && (
|
|
1455
|
+
function f() {
|
|
1456
|
+
i && (_(null, i), i.remove(), i = null);
|
|
1376
1457
|
}
|
|
1377
|
-
function
|
|
1378
|
-
|
|
1458
|
+
function v() {
|
|
1459
|
+
o || fe(t.url, n, {
|
|
1460
|
+
fallbackToRawUrl: !0
|
|
1461
|
+
});
|
|
1379
1462
|
}
|
|
1380
|
-
function
|
|
1381
|
-
if (
|
|
1382
|
-
const p = URL.createObjectURL(
|
|
1383
|
-
|
|
1463
|
+
function x(D) {
|
|
1464
|
+
if (o) return;
|
|
1465
|
+
const p = URL.createObjectURL(D);
|
|
1466
|
+
Z(p, n), URL.revokeObjectURL(p);
|
|
1384
1467
|
}
|
|
1385
|
-
const
|
|
1386
|
-
return
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1468
|
+
const h = ce(t);
|
|
1469
|
+
return k("type-resolved", {
|
|
1470
|
+
resolvedType: h,
|
|
1471
|
+
url: t.url,
|
|
1472
|
+
name: t.name,
|
|
1473
|
+
mode: t.mode,
|
|
1474
|
+
mimeType: t.mimeType,
|
|
1475
|
+
extension: t.extension
|
|
1476
|
+
}), K(h) ? m() : h === "unknown" ? (b(), Xe(t.url).then(async (D) => {
|
|
1477
|
+
if (!o) {
|
|
1478
|
+
if (K(D)) {
|
|
1479
|
+
t.mode = D, m();
|
|
1390
1480
|
return;
|
|
1391
1481
|
}
|
|
1392
1482
|
try {
|
|
1393
|
-
const p = await
|
|
1394
|
-
if (
|
|
1395
|
-
|
|
1483
|
+
const p = await ue(t.url), r = ae(p.type);
|
|
1484
|
+
if (K(r)) {
|
|
1485
|
+
l = URL.createObjectURL(p), t.url = l, t.mode = r, m();
|
|
1396
1486
|
return;
|
|
1397
1487
|
}
|
|
1398
|
-
|
|
1488
|
+
f(), x(p);
|
|
1399
1489
|
} catch {
|
|
1400
|
-
|
|
1490
|
+
f(), v();
|
|
1401
1491
|
}
|
|
1402
1492
|
}
|
|
1403
|
-
})) :
|
|
1493
|
+
})) : v(), P = { close: c }, P;
|
|
1404
1494
|
}
|
|
1405
|
-
function
|
|
1495
|
+
function it(e) {
|
|
1406
1496
|
Y = e;
|
|
1407
1497
|
}
|
|
1408
|
-
function
|
|
1498
|
+
function ot(e) {
|
|
1409
1499
|
if (typeof document > "u")
|
|
1410
1500
|
return { close: () => {
|
|
1411
1501
|
} };
|
|
1412
|
-
|
|
1502
|
+
P?.close();
|
|
1413
1503
|
let t = !1, n = document.createElement("div");
|
|
1414
1504
|
document.body.appendChild(n);
|
|
1415
|
-
const
|
|
1416
|
-
t = !0, n && (
|
|
1417
|
-
}, i = { close:
|
|
1418
|
-
return
|
|
1505
|
+
const o = () => {
|
|
1506
|
+
t = !0, n && (_(null, n), n.remove(), n = null), P?.close === o && (P = null);
|
|
1507
|
+
}, i = { close: o };
|
|
1508
|
+
return P = i, Y ? (_(
|
|
1419
1509
|
a(M, {
|
|
1420
1510
|
options: { url: "", name: s("common.附件预览") },
|
|
1421
1511
|
title: s("common.正在获取文件信息"),
|
|
1422
1512
|
desc: s("common.请稍候,获取完成后将自动预览或下载"),
|
|
1423
1513
|
spinning: !0,
|
|
1424
|
-
onDestroy:
|
|
1514
|
+
onDestroy: o
|
|
1425
1515
|
}),
|
|
1426
1516
|
n
|
|
1427
|
-
), Y.request(e).then((
|
|
1517
|
+
), Y.request(e).then((l) => {
|
|
1428
1518
|
if (t) return;
|
|
1429
|
-
const
|
|
1430
|
-
if (!
|
|
1431
|
-
|
|
1519
|
+
const c = Y?.mapResponse(l, e);
|
|
1520
|
+
if (!c?.url) {
|
|
1521
|
+
_(
|
|
1432
1522
|
a(M, {
|
|
1433
1523
|
options: { url: "", name: s("common.附件预览") },
|
|
1434
1524
|
title: s("common.文件信息缺少URL"),
|
|
1435
1525
|
desc: s("common.请检查mapResponse是否返回了url字段"),
|
|
1436
1526
|
spinning: !1,
|
|
1437
|
-
onDestroy:
|
|
1527
|
+
onDestroy: o
|
|
1438
1528
|
}),
|
|
1439
1529
|
n
|
|
1440
1530
|
);
|
|
1441
1531
|
return;
|
|
1442
1532
|
}
|
|
1443
|
-
|
|
1444
|
-
}).catch((
|
|
1533
|
+
ve(c);
|
|
1534
|
+
}).catch((l) => {
|
|
1445
1535
|
if (t) return;
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1536
|
+
const c = l instanceof Error ? l.message : s("common.接口请求失败");
|
|
1537
|
+
_(
|
|
1448
1538
|
a(M, {
|
|
1449
1539
|
options: { url: "", name: s("common.附件预览") },
|
|
1450
1540
|
title: s("common.文件信息获取失败"),
|
|
1451
|
-
desc:
|
|
1541
|
+
desc: c,
|
|
1452
1542
|
spinning: !1,
|
|
1453
|
-
onDestroy:
|
|
1543
|
+
onDestroy: o
|
|
1454
1544
|
}),
|
|
1455
1545
|
n
|
|
1456
1546
|
);
|
|
1457
|
-
}), i) : (
|
|
1547
|
+
}), i) : (_(
|
|
1458
1548
|
a(M, {
|
|
1459
1549
|
options: { url: "", name: s("common.附件预览") },
|
|
1460
1550
|
title: s("common.附件预览未初始化"),
|
|
1461
1551
|
desc: s("common.请先调用setupJtAttachmentPreview注册请求配置"),
|
|
1462
1552
|
spinning: !1,
|
|
1463
|
-
onDestroy:
|
|
1553
|
+
onDestroy: o
|
|
1464
1554
|
}),
|
|
1465
1555
|
n
|
|
1466
1556
|
), i);
|
|
1467
1557
|
}
|
|
1468
|
-
const
|
|
1469
|
-
openByParams:
|
|
1470
|
-
setup:
|
|
1558
|
+
const mt = Object.assign(ve, {
|
|
1559
|
+
openByParams: ot,
|
|
1560
|
+
setup: it
|
|
1471
1561
|
});
|
|
1472
1562
|
export {
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1563
|
+
mt as J,
|
|
1564
|
+
ot as a,
|
|
1565
|
+
it as b,
|
|
1566
|
+
ct as g,
|
|
1567
|
+
dt as i,
|
|
1568
|
+
U as n,
|
|
1569
|
+
ut as r,
|
|
1570
|
+
st as s,
|
|
1481
1571
|
s as t
|
|
1482
1572
|
};
|