@das-fed/ui 7.0.0-zhaohang.6 → 7.0.0-zhongshen.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/esm-map.json +28 -1
  2. package/package.json +12 -5
  3. package/packages/business-components/ai-panel/i18n/index.d.ts +244 -0
  4. package/packages/business-components/ai-panel/index-CD2YNg3j.js +5856 -0
  5. package/packages/business-components/ai-panel/index-CD2YNg3j.js.gz +0 -0
  6. package/packages/business-components/ai-panel/index-CJeKTaAS.js +60 -0
  7. package/packages/business-components/ai-panel/index-CJeKTaAS.js.gz +0 -0
  8. package/packages/business-components/ai-panel/index-DWHxqEh3.js +180 -0
  9. package/packages/business-components/ai-panel/index-DWHxqEh3.js.gz +0 -0
  10. package/packages/business-components/ai-panel/index.js +9 -0
  11. package/packages/business-components/ai-panel/src/dasAI/apis.d.ts +17 -0
  12. package/packages/business-components/ai-panel/src/dasAI/components/addNew/index.vue.d.ts +6 -0
  13. package/packages/business-components/ai-panel/src/dasAI/components/deleteDialog/index.d.ts +7 -0
  14. package/packages/business-components/ai-panel/src/dasAI/components/deleteDialog/index.vue.d.ts +12 -0
  15. package/packages/business-components/ai-panel/src/dasAI/components/folderDialog/index.d.ts +6 -0
  16. package/packages/business-components/ai-panel/src/dasAI/components/sender/components/senderOpt.vue.d.ts +2 -0
  17. package/packages/business-components/ai-panel/src/dasAI/hooks/audio.d.ts +8 -0
  18. package/packages/business-components/ai-panel/src/dasAI/hooks/knowbase.d.ts +4 -0
  19. package/packages/business-components/ai-panel/src/dasAI/index.vue.d.ts +16 -0
  20. package/packages/business-components/ai-panel/src/dasAI/store/index.d.ts +21 -0
  21. package/packages/business-components/ai-panel/src/index.vue.d.ts +31 -0
  22. package/packages/business-components/ai-panel/src/type.d.ts +13 -0
  23. package/packages/business-components/ai-panel/style.css +1 -0
  24. package/packages/business-components/ai-panel/style.css.gz +0 -0
  25. package/packages/business-components/change-pwd/index.js +13 -10
  26. package/packages/business-components/change-pwd/index.js.gz +0 -0
  27. package/packages/business-components/change-pwd/style.css +1 -1
  28. package/packages/business-components/device-panel/index.js +2819 -2799
  29. package/packages/business-components/device-panel/index.js.gz +0 -0
  30. package/packages/business-components/device-panel/src/components/alarmDevicePanel/index.vue.d.ts +1 -1
  31. package/packages/business-components/device-panel/src/components/alarmDevicePanel/linkDialog.vue.d.ts +1 -1
  32. package/packages/business-components/device-panel/src/components/devicePanelModal/linkDialog.vue.d.ts +1 -1
  33. package/packages/business-components/device-panel/style.css +1 -1
  34. package/packages/business-components/device-panel/style.css.gz +0 -0
  35. package/packages/business-components/index.d.ts +1 -0
  36. package/packages/business-components/index.js +1 -0
  37. package/packages/business-components/layout-breadcrumb/index.js +57 -57
  38. package/packages/business-components/layout-breadcrumb/index.js.gz +0 -0
  39. package/packages/business-components/model-table-dialog/index.d.ts +9 -9
  40. package/packages/business-components/model-table-dialog/src/Index.vue.d.ts +3 -3
  41. package/packages/business-components/payment/index.js +8 -8
  42. package/packages/business-components/payment/index.js.gz +0 -0
  43. package/packages/business-components/process-search-form/hooks/useService.d.ts +1 -1
  44. package/packages/business-components/user-org-dialog/index.js +2 -2
  45. package/packages/business-components/user-org-dialog/index.js.gz +0 -0
  46. package/packages/business-components/user-org-dialog/style.css +1 -1
  47. package/packages/business-components/user-org-dialog/style.css.gz +0 -0
  48. package/packages/business-components/video-dialog/index.d.ts +5 -0
  49. package/packages/business-components/video-dialog/index.js +378 -332
  50. package/packages/business-components/video-dialog/index.js.gz +0 -0
  51. package/packages/business-components/video-dialog/src/component/Player/index.vue.d.ts +3 -0
  52. package/packages/business-components/video-dialog/src/hooks/use-video/PlayerProvider.d.ts +11 -1
  53. package/packages/business-components/video-dialog/src/index.vue.d.ts +1 -0
  54. package/packages/business-components/video-dialog/src/type.d.ts +2 -0
  55. package/packages/business-components/video-dialog/style.css +1 -1
  56. package/packages/business-components/video-dialog/style.css.gz +0 -0
  57. package/packages/components/dimple-layout/index.js +1 -1
  58. package/packages/components/dimple-layout/index.js.gz +0 -0
  59. package/packages/components/hls-player/i18n/index.d.ts +13 -0
  60. package/packages/components/hls-player/index.d.ts +172 -0
  61. package/packages/components/hls-player/index.js +21183 -0
  62. package/packages/components/hls-player/index.js.gz +0 -0
  63. package/packages/components/hls-player/src/das-hls-player.vue.d.ts +47 -0
  64. package/packages/components/hls-player/src/type.d.ts +33 -0
  65. package/packages/components/hls-player/style.css +1 -0
  66. package/packages/components/hls-player/style.css.gz +0 -0
  67. package/packages/components/image-upload/index.d.ts +2 -0
  68. package/packages/components/image-upload/index.js +770 -114
  69. package/packages/components/image-upload/index.js.gz +0 -0
  70. package/packages/components/image-upload/src/Index.vue.d.ts +2 -0
  71. package/packages/components/image-upload/src/hooks/use-compress-image.d.ts +1 -0
  72. package/packages/components/image-upload/src/type.d.ts +6 -0
  73. package/packages/components/image-upload/style.css +1 -1
  74. package/packages/components/image-upload/style.css.gz +0 -0
  75. package/packages/components/image-viewer/index.d.ts +6 -2
  76. package/packages/components/image-viewer/index.js +1117 -432
  77. package/packages/components/image-viewer/index.js.gz +0 -0
  78. package/packages/components/image-viewer/src/Index.vue.d.ts +6 -2
  79. package/packages/components/image-viewer/src/hooks/use-compress-image.d.ts +1 -0
  80. package/packages/components/image-viewer/src/hooks/use-imageViewer.d.ts +1 -0
  81. package/packages/components/image-viewer/src/type.d.ts +9 -0
  82. package/packages/components/image-viewer/style.css +1 -1
  83. package/packages/components/image-viewer/style.css.gz +0 -0
  84. package/packages/components/index.d.ts +1 -0
  85. package/packages/components/index.js +1 -0
  86. package/packages/components/input-dialog-select/index.d.ts +0 -1
  87. package/packages/components/input-dialog-select/index.js +17 -17
  88. package/packages/components/input-dialog-select/index.js.gz +0 -0
  89. package/packages/components/input-dialog-select/src/Index.vue.d.ts +0 -1
  90. package/packages/components/input-dialog-select/style.css +1 -1
  91. package/packages/components/input-dialog-select/style.css.gz +0 -0
  92. package/packages/components/radio-tabs/index.js +1 -1
  93. package/packages/components/radio-tabs/index.js.gz +0 -0
  94. package/packages/components/radio-tabs/style.css +1 -1
  95. package/packages/components/radio-tabs/style.css.gz +0 -0
  96. package/packages/components/scrollbar/index.js +1 -1
  97. package/packages/components/scrollbar/index.js.gz +0 -0
  98. package/packages/components/scrollbar/style.css +1 -1
  99. package/packages/components/scrollbar/style.css.gz +0 -0
  100. package/packages/components/select/index.js +58 -57
  101. package/packages/components/select/index.js.gz +0 -0
  102. package/packages/components/select/src/type.d.ts +2 -0
  103. package/packages/components/select/style.css +1 -1
  104. package/packages/components/select/style.css.gz +0 -0
  105. package/packages/components/select-list/index.d.ts +3 -3
  106. package/packages/components/select-list/index.js +390 -377
  107. package/packages/components/select-list/index.js.gz +0 -0
  108. package/packages/components/select-list/src/Index.vue.d.ts +4 -3
  109. package/packages/components/select-list/src/hooks/use-select-list.d.ts +1 -0
  110. package/packages/components/select-list/src/type.d.ts +1 -1
  111. package/packages/components/select-list/style.css +1 -1
  112. package/packages/components/select-list/style.css.gz +0 -0
  113. package/packages/components/table/style.css +1 -1
  114. package/packages/components/table/style.css.gz +0 -0
  115. package/packages/components/tree/index.js +90 -86
  116. package/packages/components/tree/index.js.gz +0 -0
  117. package/packages/components/tree-select/index.js +1 -0
  118. package/packages/components/tree-select/index.js.gz +0 -0
  119. package/packages/components/tree-select/src/App.vue.d.ts +2 -0
  120. package/packages/components/tree-select/src/hooks/use-tree-select.d.ts +2 -0
  121. package/packages/components/tree-table/index.js +291 -263
  122. package/packages/components/tree-table/index.js.gz +0 -0
  123. package/packages/components/tree-table/src/hooks/use-five.d.ts +4 -0
  124. package/packages/components/tree-table/src/hooks/use-four.d.ts +4 -0
  125. package/packages/components/tree-table/src/type.d.ts +1 -1
  126. package/packages/components/tree-table/style.css +1 -1
  127. package/packages/components/tree-table/style.css.gz +0 -0
  128. package/packages/icons/audioing/index.d.ts +1 -0
  129. package/packages/icons/audioing/index.js +17 -0
  130. package/packages/icons/audioing/index.js.gz +0 -0
  131. package/packages/icons/audioing/index.vue.d.ts +19 -0
  132. package/packages/icons/bobaoguanbi/index.d.ts +1 -0
  133. package/packages/icons/bobaoguanbi/index.js +17 -0
  134. package/packages/icons/bobaoguanbi/index.js.gz +0 -0
  135. package/packages/icons/bobaoguanbi/index.vue.d.ts +19 -0
  136. package/packages/icons/bobaokaiqi/index.d.ts +1 -0
  137. package/packages/icons/bobaokaiqi/index.js +17 -0
  138. package/packages/icons/bobaokaiqi/index.js.gz +0 -0
  139. package/packages/icons/bobaokaiqi/index.vue.d.ts +19 -0
  140. package/packages/icons/cankaoneirong/index.d.ts +1 -0
  141. package/packages/icons/cankaoneirong/index.js +22 -0
  142. package/packages/icons/cankaoneirong/index.js.gz +0 -0
  143. package/packages/icons/cankaoneirong/index.vue.d.ts +19 -0
  144. package/packages/icons/closeaudio/index.d.ts +1 -0
  145. package/packages/icons/closeaudio/index.js +17 -0
  146. package/packages/icons/closeaudio/index.js.gz +0 -0
  147. package/packages/icons/closeaudio/index.vue.d.ts +19 -0
  148. package/packages/icons/fasong/index.d.ts +1 -0
  149. package/packages/icons/fasong/index.js +22 -0
  150. package/packages/icons/fasong/index.js.gz +0 -0
  151. package/packages/icons/fasong/index.vue.d.ts +19 -0
  152. package/packages/icons/fresh/index.d.ts +1 -0
  153. package/packages/icons/fresh/index.js +22 -0
  154. package/packages/icons/fresh/index.js.gz +0 -0
  155. package/packages/icons/fresh/index.vue.d.ts +19 -0
  156. package/packages/icons/fuzhineirong/index.d.ts +1 -0
  157. package/packages/icons/fuzhineirong/index.js +22 -0
  158. package/packages/icons/fuzhineirong/index.js.gz +0 -0
  159. package/packages/icons/fuzhineirong/index.vue.d.ts +19 -0
  160. package/packages/icons/huida/index.d.ts +1 -0
  161. package/packages/icons/huida/index.js +22 -0
  162. package/packages/icons/huida/index.js.gz +0 -0
  163. package/packages/icons/huida/index.vue.d.ts +19 -0
  164. package/packages/icons/huidaodibu/index.d.ts +1 -0
  165. package/packages/icons/huidaodibu/index.js +22 -0
  166. package/packages/icons/huidaodibu/index.js.gz +0 -0
  167. package/packages/icons/huidaodibu/index.vue.d.ts +19 -0
  168. package/packages/icons/index.d.ts +23 -0
  169. package/packages/icons/index.js +23 -0
  170. package/packages/icons/intnet/index.d.ts +1 -0
  171. package/packages/icons/intnet/index.js +17 -0
  172. package/packages/icons/intnet/index.js.gz +0 -0
  173. package/packages/icons/intnet/index.vue.d.ts +19 -0
  174. package/packages/icons/know/index.d.ts +1 -0
  175. package/packages/icons/know/index.js +17 -0
  176. package/packages/icons/know/index.js.gz +0 -0
  177. package/packages/icons/know/index.vue.d.ts +19 -0
  178. package/packages/icons/knowed/index.d.ts +1 -0
  179. package/packages/icons/knowed/index.js +17 -0
  180. package/packages/icons/knowed/index.js.gz +0 -0
  181. package/packages/icons/knowed/index.vue.d.ts +19 -0
  182. package/packages/icons/knowopen/index.d.ts +1 -0
  183. package/packages/icons/knowopen/index.js +17 -0
  184. package/packages/icons/knowopen/index.js.gz +0 -0
  185. package/packages/icons/knowopen/index.vue.d.ts +19 -0
  186. package/packages/icons/lianjie/index.d.ts +1 -0
  187. package/packages/icons/lianjie/index.js +22 -0
  188. package/packages/icons/lianjie/index.js.gz +0 -0
  189. package/packages/icons/lianjie/index.vue.d.ts +19 -0
  190. package/packages/icons/lishihuihua/index.d.ts +1 -0
  191. package/packages/icons/lishihuihua/index.js +22 -0
  192. package/packages/icons/lishihuihua/index.js.gz +0 -0
  193. package/packages/icons/lishihuihua/index.vue.d.ts +19 -0
  194. package/packages/icons/qingkong/index.d.ts +1 -0
  195. package/packages/icons/qingkong/index.js +22 -0
  196. package/packages/icons/qingkong/index.js.gz +0 -0
  197. package/packages/icons/qingkong/index.vue.d.ts +19 -0
  198. package/packages/icons/select2/index.d.ts +1 -0
  199. package/packages/icons/select2/index.js +17 -0
  200. package/packages/icons/select2/index.vue.d.ts +19 -0
  201. package/packages/icons/shendusikao/index.d.ts +1 -0
  202. package/packages/icons/shendusikao/index.js +22 -0
  203. package/packages/icons/shendusikao/index.js.gz +0 -0
  204. package/packages/icons/shendusikao/index.vue.d.ts +19 -0
  205. package/packages/icons/tianjiaxinhuati/index.d.ts +1 -0
  206. package/packages/icons/tianjiaxinhuati/index.js +22 -0
  207. package/packages/icons/tianjiaxinhuati/index.js.gz +0 -0
  208. package/packages/icons/tianjiaxinhuati/index.vue.d.ts +19 -0
  209. package/packages/icons/yingyong/index.d.ts +1 -0
  210. package/packages/icons/yingyong/index.js +17 -0
  211. package/packages/icons/yingyong/index.js.gz +0 -0
  212. package/packages/icons/yingyong/index.vue.d.ts +19 -0
  213. package/packages/icons/yuyin/index.d.ts +1 -0
  214. package/packages/icons/yuyin/index.js +17 -0
  215. package/packages/icons/yuyin/index.js.gz +0 -0
  216. package/packages/icons/yuyin/index.vue.d.ts +19 -0
  217. package/packages/icons/zhongxinshengcheng/index.d.ts +1 -0
  218. package/packages/icons/zhongxinshengcheng/index.js +22 -0
  219. package/packages/icons/zhongxinshengcheng/index.js.gz +0 -0
  220. package/packages/icons/zhongxinshengcheng/index.vue.d.ts +19 -0
@@ -1,71 +1,723 @@
1
1
  import '@das-fed/ui/packages/components/image-upload/style.css';
2
- import { withInstall as R } from "@das-fed/utils/with-install/index";
3
- import { currentLang as U, i18n as $, t as w, setI18nRule as K } from "@das-fed/web/packages/i18n/index";
4
- import { getVar as k, setThemeRule as W } from "@das-fed/web/packages/theme/index";
5
- import { computed as z, defineComponent as P, createElementBlock as H, openBlock as L, createCommentVNode as B, withDirectives as N, createVNode as m, unref as o, normalizeClass as O, withCtx as g, createElementVNode as v, toDisplayString as S, vShow as I, createTextVNode as q } from "vue";
6
- import { UploadDragger as G, Upload as J } from "ant-design-vue";
2
+ import { withInstall as Ie } from "@das-fed/utils/with-install/index";
3
+ import { currentLang as ge, i18n as ve, t as G, setI18nRule as Pe } from "@das-fed/web/packages/i18n/index";
4
+ import { getVar as L, setThemeRule as Se } from "@das-fed/web/packages/theme/index";
5
+ import { computed as X, defineComponent as je, createElementBlock as Le, openBlock as _e, createCommentVNode as ye, withDirectives as K, createVNode as O, unref as v, normalizeClass as Ne, withCtx as R, createElementVNode as z, toDisplayString as Y, vShow as q, createTextVNode as We } from "vue";
6
+ import { UploadDragger as He, Upload as Ve } from "ant-design-vue";
7
7
  import "ant-design-vue/es/upload/style/css";
8
- import { DasSpin as Q } from "@das-fed/ui/packages/components/spin/index";
9
- import { DasButton as X } from "@das-fed/ui/packages/components/button/index";
10
- import { DasIconAddto as Y } from "@das-fed/ui/packages/icons/addto/index";
11
- import { DasIconWarning as Z } from "@das-fed/ui/packages/icons/warning/index";
12
- import { DasMessage as M } from "@das-fed/ui/packages/components/message/index";
13
- import { getFileExtension as ee } from "@das-fed/utils/common-tools";
14
- import { useModelValue as ae } from "@das-fed/utils/vue";
8
+ import { DasSpin as $e } from "@das-fed/ui/packages/components/spin/index";
9
+ import { DasButton as Ge } from "@das-fed/ui/packages/components/button/index";
10
+ import { DasIconAddto as Xe } from "@das-fed/ui/packages/icons/addto/index";
11
+ import { DasIconWarning as Ke } from "@das-fed/ui/packages/icons/warning/index";
12
+ import { DasMessage as be } from "@das-fed/ui/packages/components/message/index";
13
+ import { getFileExtension as Ye } from "@das-fed/utils/common-tools";
14
+ import { useModelValue as we } from "@das-fed/utils/vue";
15
15
  import "@das-fed/ui/packages/global/theme";
16
- const oe = () => ({ size2B: (t) => {
17
- isNaN(Number(t)) ? t = t.toString() : t = t + "M";
18
- const i = Number(t.slice(0, -1)), n = t[t.length - 1].toUpperCase(), s = 1024, f = {
19
- M: s * s,
20
- K: s,
16
+ const qe = () => ({ size2B: (e) => {
17
+ isNaN(Number(e)) ? e = e.toString() : e = e + "M";
18
+ const a = Number(e.slice(0, -1)), r = e[e.length - 1].toUpperCase(), i = 1024, o = {
19
+ M: i * i,
20
+ K: i,
21
21
  B: 1
22
22
  };
23
- return { finalSize: i * f[n], sizeText: t };
24
- } }), te = (a, t) => {
25
- const i = ae(a, "status"), { size2B: n } = oe(), s = [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".mpeg", ".webm"], f = [".mp3", ".wav", ".aac", ".flac", ".ogg", ".alff", ".wma", ".m4a"], r = z(() => {
26
- var d;
27
- let e = a.accept ? (d = a.accept) == null ? void 0 : d.split(",") : [];
28
- return e.includes("image/jpg") && !e.includes("image/jpeg") && e.push("image/jpeg"), e.includes(".jpg") && !e.includes(".jpeg") && e.push(".jpeg"), a.acceptVideo && (e = [...e, ...s]), a.acceptAudio && (e = [...e, ...f]), e.join(",");
29
- }), C = z(() => i.value === "uploading"), y = z(() => i.value === "error");
30
- return { isAccept: r, uploadStatus: i, loading: C, errored: y, beforeupload: (e) => {
31
- var x, T, V;
32
- if (a.maxSize) {
33
- const { finalSize: c, sizeText: u } = n(a.maxSize);
34
- if (e.size > c) {
35
- const h = a.acceptAudio || a.acceptVideo ? "das-ui-import-upload-key4" : "das-ui-import-upload-key3", p = U.value === "zh-CN" ? "、" : ", ", b = $(
36
- h,
37
- u,
38
- ((V = (T = (x = r.value) == null ? void 0 : x.toUpperCase()) == null ? void 0 : T.replaceAll(".", "")) == null ? void 0 : V.replaceAll(",", p)) ?? ""
39
- ).value, A = a.errorMessage || b;
40
- return M.warning(A), t("update:status", "normal"), i.value = "normal", !1;
23
+ return { finalSize: a * o[r], sizeText: e };
24
+ } });
25
+ /*!
26
+ * Compressor.js v1.2.1
27
+ * https://fengyuanchen.github.io/compressorjs
28
+ *
29
+ * Copyright 2018-present Chen Fengyuan
30
+ * Released under the MIT license
31
+ *
32
+ * Date: 2023-02-28T14:09:41.732Z
33
+ */
34
+ function xe(t, e) {
35
+ var a = Object.keys(t);
36
+ if (Object.getOwnPropertySymbols) {
37
+ var r = Object.getOwnPropertySymbols(t);
38
+ e && (r = r.filter(function(i) {
39
+ return Object.getOwnPropertyDescriptor(t, i).enumerable;
40
+ })), a.push.apply(a, r);
41
+ }
42
+ return a;
43
+ }
44
+ function j(t) {
45
+ for (var e = 1; e < arguments.length; e++) {
46
+ var a = arguments[e] != null ? arguments[e] : {};
47
+ e % 2 ? xe(Object(a), !0).forEach(function(r) {
48
+ Ze(t, r, a[r]);
49
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : xe(Object(a)).forEach(function(r) {
50
+ Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
51
+ });
52
+ }
53
+ return t;
54
+ }
55
+ function Je(t, e) {
56
+ if (!(t instanceof e))
57
+ throw new TypeError("Cannot call a class as a function");
58
+ }
59
+ function Ce(t, e) {
60
+ for (var a = 0; a < e.length; a++) {
61
+ var r = e[a];
62
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, De(r.key), r);
63
+ }
64
+ }
65
+ function Qe(t, e, a) {
66
+ return e && Ce(t.prototype, e), a && Ce(t, a), Object.defineProperty(t, "prototype", {
67
+ writable: !1
68
+ }), t;
69
+ }
70
+ function Ze(t, e, a) {
71
+ return e = De(e), e in t ? Object.defineProperty(t, e, {
72
+ value: a,
73
+ enumerable: !0,
74
+ configurable: !0,
75
+ writable: !0
76
+ }) : t[e] = a, t;
77
+ }
78
+ function _() {
79
+ return _ = Object.assign ? Object.assign.bind() : function(t) {
80
+ for (var e = 1; e < arguments.length; e++) {
81
+ var a = arguments[e];
82
+ for (var r in a)
83
+ Object.prototype.hasOwnProperty.call(a, r) && (t[r] = a[r]);
84
+ }
85
+ return t;
86
+ }, _.apply(this, arguments);
87
+ }
88
+ function et(t, e) {
89
+ if (typeof t != "object" || t === null) return t;
90
+ var a = t[Symbol.toPrimitive];
91
+ if (a !== void 0) {
92
+ var r = a.call(t, e);
93
+ if (typeof r != "object") return r;
94
+ throw new TypeError("@@toPrimitive must return a primitive value.");
95
+ }
96
+ return String(t);
97
+ }
98
+ function De(t) {
99
+ var e = et(t, "string");
100
+ return typeof e == "symbol" ? e : String(e);
101
+ }
102
+ var Te = { exports: {} };
103
+ (function(t) {
104
+ typeof window > "u" || function(e) {
105
+ var a = e.HTMLCanvasElement && e.HTMLCanvasElement.prototype, r = e.Blob && function() {
106
+ try {
107
+ return !!new Blob();
108
+ } catch {
109
+ return !1;
110
+ }
111
+ }(), i = r && e.Uint8Array && function() {
112
+ try {
113
+ return new Blob([new Uint8Array(100)]).size === 100;
114
+ } catch {
115
+ return !1;
116
+ }
117
+ }(), o = e.BlobBuilder || e.WebKitBlobBuilder || e.MozBlobBuilder || e.MSBlobBuilder, m = /^data:((.*?)(;charset=.*?)?)(;base64)?,/, n = (r || o) && e.atob && e.ArrayBuffer && e.Uint8Array && function(c) {
118
+ var u, f, s, h, p, l, w, g, y;
119
+ if (u = c.match(m), !u)
120
+ throw new Error("invalid data URI");
121
+ for (f = u[2] ? u[1] : "text/plain" + (u[3] || ";charset=US-ASCII"), s = !!u[4], h = c.slice(u[0].length), s ? p = atob(h) : p = decodeURIComponent(h), l = new ArrayBuffer(p.length), w = new Uint8Array(l), g = 0; g < p.length; g += 1)
122
+ w[g] = p.charCodeAt(g);
123
+ return r ? new Blob([i ? w : l], {
124
+ type: f
125
+ }) : (y = new o(), y.append(l), y.getBlob(f));
126
+ };
127
+ e.HTMLCanvasElement && !a.toBlob && (a.mozGetAsFile ? a.toBlob = function(c, u, f) {
128
+ var s = this;
129
+ setTimeout(function() {
130
+ f && a.toDataURL && n ? c(n(s.toDataURL(u, f))) : c(s.mozGetAsFile("blob", u));
131
+ });
132
+ } : a.toDataURL && n && (a.msToBlob ? a.toBlob = function(c, u, f) {
133
+ var s = this;
134
+ setTimeout(function() {
135
+ (u && u !== "image/png" || f) && a.toDataURL && n ? c(n(s.toDataURL(u, f))) : c(s.msToBlob(u));
136
+ });
137
+ } : a.toBlob = function(c, u, f) {
138
+ var s = this;
139
+ setTimeout(function() {
140
+ c(n(s.toDataURL(u, f)));
141
+ });
142
+ })), t.exports ? t.exports = n : e.dataURLtoBlob = n;
143
+ }(window);
144
+ })(Te);
145
+ var Be = Te.exports, tt = function(e) {
146
+ return typeof Blob > "u" ? !1 : e instanceof Blob || Object.prototype.toString.call(e) === "[object Blob]";
147
+ }, Ae = {
148
+ /**
149
+ * Indicates if output the original image instead of the compressed one
150
+ * when the size of the compressed image is greater than the original one's
151
+ * @type {boolean}
152
+ */
153
+ strict: !0,
154
+ /**
155
+ * Indicates if read the image's Exif Orientation information,
156
+ * and then rotate or flip the image automatically.
157
+ * @type {boolean}
158
+ */
159
+ checkOrientation: !0,
160
+ /**
161
+ * Indicates if retain the image's Exif information after compressed.
162
+ * @type {boolean}
163
+ */
164
+ retainExif: !1,
165
+ /**
166
+ * The max width of the output image.
167
+ * @type {number}
168
+ */
169
+ maxWidth: 1 / 0,
170
+ /**
171
+ * The max height of the output image.
172
+ * @type {number}
173
+ */
174
+ maxHeight: 1 / 0,
175
+ /**
176
+ * The min width of the output image.
177
+ * @type {number}
178
+ */
179
+ minWidth: 0,
180
+ /**
181
+ * The min height of the output image.
182
+ * @type {number}
183
+ */
184
+ minHeight: 0,
185
+ /**
186
+ * The width of the output image.
187
+ * If not specified, the natural width of the source image will be used.
188
+ * @type {number}
189
+ */
190
+ width: void 0,
191
+ /**
192
+ * The height of the output image.
193
+ * If not specified, the natural height of the source image will be used.
194
+ * @type {number}
195
+ */
196
+ height: void 0,
197
+ /**
198
+ * Sets how the size of the image should be resized to the container
199
+ * specified by the `width` and `height` options.
200
+ * @type {string}
201
+ */
202
+ resize: "none",
203
+ /**
204
+ * The quality of the output image.
205
+ * It must be a number between `0` and `1`,
206
+ * and only available for `image/jpeg` and `image/webp` images.
207
+ * Check out {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob canvas.toBlob}.
208
+ * @type {number}
209
+ */
210
+ quality: 0.8,
211
+ /**
212
+ * The mime type of the output image.
213
+ * By default, the original mime type of the source image file will be used.
214
+ * @type {string}
215
+ */
216
+ mimeType: "auto",
217
+ /**
218
+ * Files whose file type is included in this list,
219
+ * and whose file size exceeds the `convertSize` value will be converted to JPEGs.
220
+ * @type {string|Array}
221
+ */
222
+ convertTypes: ["image/png"],
223
+ /**
224
+ * PNG files over this size (5 MB by default) will be converted to JPEGs.
225
+ * To disable this, just set the value to `Infinity`.
226
+ * @type {number}
227
+ */
228
+ convertSize: 5e6,
229
+ /**
230
+ * The hook function to execute before draw the image into the canvas for compression.
231
+ * @type {Function}
232
+ * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.
233
+ * @param {HTMLCanvasElement} canvas - The canvas for compression.
234
+ * @example
235
+ * function (context, canvas) {
236
+ * context.fillStyle = '#fff';
237
+ * }
238
+ */
239
+ beforeDraw: null,
240
+ /**
241
+ * The hook function to execute after drew the image into the canvas for compression.
242
+ * @type {Function}
243
+ * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.
244
+ * @param {HTMLCanvasElement} canvas - The canvas for compression.
245
+ * @example
246
+ * function (context, canvas) {
247
+ * context.filter = 'grayscale(100%)';
248
+ * }
249
+ */
250
+ drew: null,
251
+ /**
252
+ * The hook function to execute when success to compress the image.
253
+ * @type {Function}
254
+ * @param {File} file - The compressed image File object.
255
+ * @example
256
+ * function (file) {
257
+ * console.log(file);
258
+ * }
259
+ */
260
+ success: null,
261
+ /**
262
+ * The hook function to execute when fail to compress the image.
263
+ * @type {Function}
264
+ * @param {Error} err - An Error object.
265
+ * @example
266
+ * function (err) {
267
+ * console.log(err.message);
268
+ * }
269
+ */
270
+ error: null
271
+ }, at = typeof window < "u" && typeof window.document < "u", U = at ? window : {}, N = function(e) {
272
+ return e > 0 && e < 1 / 0;
273
+ }, rt = Array.prototype.slice;
274
+ function Z(t) {
275
+ return Array.from ? Array.from(t) : rt.call(t);
276
+ }
277
+ var it = /^image\/.+$/;
278
+ function Q(t) {
279
+ return it.test(t);
280
+ }
281
+ function ot(t) {
282
+ var e = Q(t) ? t.substr(6) : "";
283
+ return e === "jpeg" && (e = "jpg"), ".".concat(e);
284
+ }
285
+ var Oe = String.fromCharCode;
286
+ function nt(t, e, a) {
287
+ var r = "", i;
288
+ for (a += e, i = e; i < a; i += 1)
289
+ r += Oe(t.getUint8(i));
290
+ return r;
291
+ }
292
+ var st = U.btoa;
293
+ function ke(t, e) {
294
+ for (var a = [], r = 8192, i = new Uint8Array(t); i.length > 0; )
295
+ a.push(Oe.apply(null, Z(i.subarray(0, r)))), i = i.subarray(r);
296
+ return "data:".concat(e, ";base64,").concat(st(a.join("")));
297
+ }
298
+ function lt(t) {
299
+ var e = new DataView(t), a;
300
+ try {
301
+ var r, i, o;
302
+ if (e.getUint8(0) === 255 && e.getUint8(1) === 216)
303
+ for (var m = e.byteLength, n = 2; n + 1 < m; ) {
304
+ if (e.getUint8(n) === 255 && e.getUint8(n + 1) === 225) {
305
+ i = n;
306
+ break;
307
+ }
308
+ n += 1;
309
+ }
310
+ if (i) {
311
+ var c = i + 4, u = i + 10;
312
+ if (nt(e, c, 4) === "Exif") {
313
+ var f = e.getUint16(u);
314
+ if (r = f === 18761, (r || f === 19789) && e.getUint16(u + 2, r) === 42) {
315
+ var s = e.getUint32(u + 4, r);
316
+ s >= 8 && (o = u + s);
317
+ }
318
+ }
319
+ }
320
+ if (o) {
321
+ var h = e.getUint16(o, r), p, l;
322
+ for (l = 0; l < h; l += 1)
323
+ if (p = o + l * 12 + 2, e.getUint16(p, r) === 274) {
324
+ p += 8, a = e.getUint16(p, r), e.setUint16(p, 1, r);
325
+ break;
326
+ }
327
+ }
328
+ } catch {
329
+ a = 1;
330
+ }
331
+ return a;
332
+ }
333
+ function ct(t) {
334
+ var e = 0, a = 1, r = 1;
335
+ switch (t) {
336
+ case 2:
337
+ a = -1;
338
+ break;
339
+ case 3:
340
+ e = -180;
341
+ break;
342
+ case 4:
343
+ r = -1;
344
+ break;
345
+ case 5:
346
+ e = 90, r = -1;
347
+ break;
348
+ case 6:
349
+ e = 90;
350
+ break;
351
+ case 7:
352
+ e = 90, a = -1;
353
+ break;
354
+ case 8:
355
+ e = -90;
356
+ break;
357
+ }
358
+ return {
359
+ rotate: e,
360
+ scaleX: a,
361
+ scaleY: r
362
+ };
363
+ }
364
+ var ut = /\.\d*(?:0|9){12}\d*$/;
365
+ function Ee(t) {
366
+ var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e11;
367
+ return ut.test(t) ? Math.round(t * e) / e : t;
368
+ }
369
+ function I(t) {
370
+ var e = t.aspectRatio, a = t.height, r = t.width, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "none", o = N(r), m = N(a);
371
+ if (o && m) {
372
+ var n = a * e;
373
+ (i === "contain" || i === "none") && n > r || i === "cover" && n < r ? a = r / e : r = a * e;
374
+ } else o ? a = r / e : m && (r = a * e);
375
+ return {
376
+ width: r,
377
+ height: a
378
+ };
379
+ }
380
+ function mt(t) {
381
+ for (var e = Z(new Uint8Array(t)), a = e.length, r = [], i = 0; i + 3 < a; ) {
382
+ var o = e[i], m = e[i + 1];
383
+ if (o === 255 && m === 218)
384
+ break;
385
+ if (o === 255 && m === 216)
386
+ i += 2;
387
+ else {
388
+ var n = e[i + 2] * 256 + e[i + 3], c = i + n + 2, u = e.slice(i, c);
389
+ r.push(u), i = c;
390
+ }
391
+ }
392
+ return r.reduce(function(f, s) {
393
+ return s[0] === 255 && s[1] === 225 ? f.concat(s) : f;
394
+ }, []);
395
+ }
396
+ function ft(t, e) {
397
+ var a = Z(new Uint8Array(t));
398
+ if (a[2] !== 255 || a[3] !== 224)
399
+ return t;
400
+ var r = a[4] * 256 + a[5], i = [255, 216].concat(e, a.slice(4 + r));
401
+ return new Uint8Array(i);
402
+ }
403
+ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$/, ht = U.Compressor, gt = /* @__PURE__ */ function() {
404
+ function t(e, a) {
405
+ Je(this, t), this.file = e, this.exif = [], this.image = new Image(), this.options = j(j({}, Ae), a), this.aborted = !1, this.result = null, this.init();
406
+ }
407
+ return Qe(t, [{
408
+ key: "init",
409
+ value: function() {
410
+ var a = this, r = this.file, i = this.options;
411
+ if (!tt(r)) {
412
+ this.fail(new Error("The first argument must be a File or Blob object."));
413
+ return;
414
+ }
415
+ var o = r.type;
416
+ if (!Q(o)) {
417
+ this.fail(new Error("The first argument must be an image File or Blob object."));
418
+ return;
419
+ }
420
+ if (!D || !J) {
421
+ this.fail(new Error("The current browser does not support image compression."));
422
+ return;
423
+ }
424
+ dt || (i.checkOrientation = !1, i.retainExif = !1);
425
+ var m = o === "image/jpeg", n = m && i.checkOrientation, c = m && i.retainExif;
426
+ if (D && !n && !c)
427
+ this.load({
428
+ url: D.createObjectURL(r)
429
+ });
430
+ else {
431
+ var u = new J();
432
+ this.reader = u, u.onload = function(f) {
433
+ var s = f.target, h = s.result, p = {}, l = 1;
434
+ n && (l = lt(h), l > 1 && _(p, ct(l))), c && (a.exif = mt(h)), n || c ? !D || l > 1 ? p.url = ke(h, o) : p.url = D.createObjectURL(r) : p.url = h, a.load(p);
435
+ }, u.onabort = function() {
436
+ a.fail(new Error("Aborted to read the image with FileReader."));
437
+ }, u.onerror = function() {
438
+ a.fail(new Error("Failed to read the image with FileReader."));
439
+ }, u.onloadend = function() {
440
+ a.reader = null;
441
+ }, n || c ? u.readAsArrayBuffer(r) : u.readAsDataURL(r);
41
442
  }
42
443
  }
43
- const d = () => (i.value = "uploading", t("update:status", "uploading"), t("image-upload", e), !1);
44
- if (a.customCheck) {
45
- const c = a.customCheck(e);
46
- if (c instanceof Promise)
47
- return new Promise(async (u, h) => {
48
- let p;
444
+ }, {
445
+ key: "load",
446
+ value: function(a) {
447
+ var r = this, i = this.file, o = this.image;
448
+ o.onload = function() {
449
+ r.draw(j(j({}, a), {}, {
450
+ naturalWidth: o.naturalWidth,
451
+ naturalHeight: o.naturalHeight
452
+ }));
453
+ }, o.onabort = function() {
454
+ r.fail(new Error("Aborted to load the image."));
455
+ }, o.onerror = function() {
456
+ r.fail(new Error("Failed to load the image."));
457
+ }, U.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(U.navigator.userAgent) && (o.crossOrigin = "anonymous"), o.alt = i.name, o.src = a.url;
458
+ }
459
+ }, {
460
+ key: "draw",
461
+ value: function(a) {
462
+ var r = this, i = a.naturalWidth, o = a.naturalHeight, m = a.rotate, n = m === void 0 ? 0 : m, c = a.scaleX, u = c === void 0 ? 1 : c, f = a.scaleY, s = f === void 0 ? 1 : f, h = this.file, p = this.image, l = this.options, w = document.createElement("canvas"), g = w.getContext("2d"), y = Math.abs(n) % 180 === 90, C = (l.resize === "contain" || l.resize === "cover") && N(l.width) && N(l.height), x = Math.max(l.maxWidth, 0) || 1 / 0, B = Math.max(l.maxHeight, 0) || 1 / 0, A = Math.max(l.minWidth, 0) || 0, k = Math.max(l.minHeight, 0) || 0, E = i / o, b = l.width, d = l.height;
463
+ if (y) {
464
+ var P = [B, x];
465
+ x = P[0], B = P[1];
466
+ var S = [k, A];
467
+ A = S[0], k = S[1];
468
+ var ee = [d, b];
469
+ b = ee[0], d = ee[1];
470
+ }
471
+ C && (E = b / d);
472
+ var te = I({
473
+ aspectRatio: E,
474
+ width: x,
475
+ height: B
476
+ }, "contain");
477
+ x = te.width, B = te.height;
478
+ var ae = I({
479
+ aspectRatio: E,
480
+ width: A,
481
+ height: k
482
+ }, "cover");
483
+ if (A = ae.width, k = ae.height, C) {
484
+ var re = I({
485
+ aspectRatio: E,
486
+ width: b,
487
+ height: d
488
+ }, l.resize);
489
+ b = re.width, d = re.height;
490
+ } else {
491
+ var ie = I({
492
+ aspectRatio: E,
493
+ width: b,
494
+ height: d
495
+ }), oe = ie.width;
496
+ b = oe === void 0 ? i : oe;
497
+ var ne = ie.height;
498
+ d = ne === void 0 ? o : ne;
499
+ }
500
+ b = Math.floor(Ee(Math.min(Math.max(b, A), x))), d = Math.floor(Ee(Math.min(Math.max(d, k), B)));
501
+ var Re = -b / 2, Me = -d / 2, Fe = b, ze = d, W = [];
502
+ if (C) {
503
+ var se = 0, le = 0, H = i, V = o, ce = I({
504
+ aspectRatio: E,
505
+ width: i,
506
+ height: o
507
+ }, {
508
+ contain: "cover",
509
+ cover: "contain"
510
+ }[l.resize]);
511
+ H = ce.width, V = ce.height, se = (i - H) / 2, le = (o - V) / 2, W.push(se, le, H, V);
512
+ }
513
+ if (W.push(Re, Me, Fe, ze), y) {
514
+ var ue = [d, b];
515
+ b = ue[0], d = ue[1];
516
+ }
517
+ w.width = b, w.height = d, Q(l.mimeType) || (l.mimeType = h.type);
518
+ var me = "transparent";
519
+ h.size > l.convertSize && l.convertTypes.indexOf(l.mimeType) >= 0 && (l.mimeType = "image/jpeg");
520
+ var fe = l.mimeType === "image/jpeg";
521
+ if (fe && (me = "#fff"), g.fillStyle = me, g.fillRect(0, 0, b, d), l.beforeDraw && l.beforeDraw.call(this, g, w), !this.aborted && (g.save(), g.translate(b / 2, d / 2), g.rotate(n * Math.PI / 180), g.scale(u, s), g.drawImage.apply(g, [p].concat(W)), g.restore(), l.drew && l.drew.call(this, g, w), !this.aborted)) {
522
+ var de = function(M) {
523
+ if (!r.aborted) {
524
+ var pe = function(F) {
525
+ return r.done({
526
+ naturalWidth: i,
527
+ naturalHeight: o,
528
+ result: F
529
+ });
530
+ };
531
+ if (M && fe && l.retainExif && r.exif && r.exif.length > 0) {
532
+ var he = function(F) {
533
+ return pe(Be(ke(ft(F, r.exif), l.mimeType)));
534
+ };
535
+ if (M.arrayBuffer)
536
+ M.arrayBuffer().then(he).catch(function() {
537
+ r.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."));
538
+ });
539
+ else {
540
+ var T = new J();
541
+ r.reader = T, T.onload = function($) {
542
+ var F = $.target;
543
+ he(F.result);
544
+ }, T.onabort = function() {
545
+ r.fail(new Error("Aborted to read the compressed image with FileReader."));
546
+ }, T.onerror = function() {
547
+ r.fail(new Error("Failed to read the compressed image with FileReader."));
548
+ }, T.onloadend = function() {
549
+ r.reader = null;
550
+ }, T.readAsArrayBuffer(M);
551
+ }
552
+ } else
553
+ pe(M);
554
+ }
555
+ };
556
+ w.toBlob ? w.toBlob(de, l.mimeType, l.quality) : de(Be(w.toDataURL(l.mimeType, l.quality)));
557
+ }
558
+ }
559
+ }, {
560
+ key: "done",
561
+ value: function(a) {
562
+ var r = a.naturalWidth, i = a.naturalHeight, o = a.result, m = this.file, n = this.image, c = this.options;
563
+ if (D && n.src.indexOf("blob:") === 0 && D.revokeObjectURL(n.src), o)
564
+ if (c.strict && !c.retainExif && o.size > m.size && c.mimeType === m.type && !(c.width > r || c.height > i || c.minWidth > r || c.minHeight > i || c.maxWidth < r || c.maxHeight < i))
565
+ o = m;
566
+ else {
567
+ var u = /* @__PURE__ */ new Date();
568
+ o.lastModified = u.getTime(), o.lastModifiedDate = u, o.name = m.name, o.name && o.type !== m.type && (o.name = o.name.replace(pt, ot(o.type)));
569
+ }
570
+ else
571
+ o = m;
572
+ this.result = o, c.success && c.success.call(this, o);
573
+ }
574
+ }, {
575
+ key: "fail",
576
+ value: function(a) {
577
+ var r = this.options;
578
+ if (r.error)
579
+ r.error.call(this, a);
580
+ else
581
+ throw a;
582
+ }
583
+ }, {
584
+ key: "abort",
585
+ value: function() {
586
+ this.aborted || (this.aborted = !0, this.reader ? this.reader.abort() : this.image.complete ? this.fail(new Error("The compression process has been aborted.")) : (this.image.onload = null, this.image.onabort()));
587
+ }
588
+ /**
589
+ * Get the no conflict compressor class.
590
+ * @returns {Compressor} The compressor class.
591
+ */
592
+ }], [{
593
+ key: "noConflict",
594
+ value: function() {
595
+ return window.Compressor = ht, t;
596
+ }
597
+ /**
598
+ * Change the default options.
599
+ * @param {Object} options - The new default options.
600
+ */
601
+ }, {
602
+ key: "setDefaults",
603
+ value: function(a) {
604
+ _(Ae, a);
605
+ }
606
+ }]), t;
607
+ }();
608
+ const vt = (t, e) => new Promise((a, r) => {
609
+ if (t.size <= e)
610
+ return t;
611
+ const i = e / t.size, o = Math.max(0.5, Math.min(0.9, 0.8 * i)), m = Math.max(800, Math.min(1920, 1920 * Math.sqrt(i)));
612
+ Ue(t, o, m, m, (n) => {
613
+ n.size <= e ? a(n) : Ue(
614
+ n,
615
+ Math.max(0.4, o - 0.2),
616
+ // 降低质量
617
+ Math.max(640, m * 0.8),
618
+ // 缩小尺寸
619
+ Math.max(640, m * 0.8),
620
+ a,
621
+ r,
622
+ t
623
+ // 传递原始文件用于错误处理
624
+ );
625
+ }, r, t);
626
+ }), Ue = (t, e, a, r, i, o, m) => {
627
+ new gt(t, {
628
+ quality: e,
629
+ maxWidth: a,
630
+ maxHeight: r,
631
+ convertSize: 1 / 0,
632
+ success(n) {
633
+ try {
634
+ const c = new File([n], t.name, {
635
+ type: n.type || t.type,
636
+ lastModified: Date.now()
637
+ });
638
+ i(c);
639
+ } catch (c) {
640
+ o({
641
+ message: "文件转换失败",
642
+ error: c,
643
+ original: m || t
644
+ });
645
+ }
646
+ },
647
+ error(n) {
648
+ o({
649
+ message: "图片压缩失败",
650
+ error: n,
651
+ original: m || t
652
+ });
653
+ }
654
+ });
655
+ }, yt = (t, e) => {
656
+ const a = we(t, "status"), { size2B: r } = qe(), i = we(t, "isOverMaxLimitCompressImg"), o = [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".mpeg", ".webm"], m = [".mp3", ".wav", ".aac", ".flac", ".ogg", ".alff", ".wma", ".m4a"], n = X(() => {
657
+ var h;
658
+ let s = t.accept ? (h = t.accept) == null ? void 0 : h.split(",") : [];
659
+ return s.includes("image/jpg") && !s.includes("image/jpeg") && s.push("image/jpeg"), s.includes(".jpg") && !s.includes(".jpeg") && s.push(".jpeg"), t.acceptVideo && (s = [...s, ...o]), t.acceptAudio && (s = [...s, ...m]), s.join(",");
660
+ }), c = X(() => a.value === "uploading"), u = X(() => a.value === "error");
661
+ return { isAccept: n, uploadStatus: a, loading: c, errored: u, beforeupload: (s) => {
662
+ var l, w, g;
663
+ if (t.maxSize) {
664
+ const { finalSize: y, sizeText: C } = r(t.maxSize);
665
+ if (s.size > y && !i.value) {
666
+ const x = t.acceptAudio || t.acceptVideo ? "das-ui-import-upload-key4" : "das-ui-import-upload-key3", B = ge.value === "zh-CN" ? "、" : ", ", A = ve(
667
+ x,
668
+ C,
669
+ ((g = (w = (l = n.value) == null ? void 0 : l.toUpperCase()) == null ? void 0 : w.replaceAll(".", "")) == null ? void 0 : g.replaceAll(",", B)) ?? ""
670
+ ).value, k = t.errorMessage || A;
671
+ return be.warning(k), e("update:status", "normal"), a.value = "normal", !1;
672
+ }
673
+ }
674
+ const h = [
675
+ "image/jpeg",
676
+ "image/png",
677
+ "image/webp",
678
+ "image/gif",
679
+ "image/bmp",
680
+ "image/tiff",
681
+ "image/svg+xml"
682
+ ], p = async () => {
683
+ a.value = "uploading";
684
+ let y = s;
685
+ if (t.maxSize) {
686
+ const { finalSize: C } = r(t.maxSize);
687
+ if (s.size > C && i.value && h.includes(s.type))
688
+ try {
689
+ y = await vt(s, C);
690
+ } catch (x) {
691
+ y = (x == null ? void 0 : x.original) || s;
692
+ }
693
+ }
694
+ return e("update:status", "uploading"), e("image-upload", y), !1;
695
+ };
696
+ if (t.customCheck) {
697
+ const y = t.customCheck(s);
698
+ if (y instanceof Promise)
699
+ return new Promise(async (C, x) => {
700
+ let B;
49
701
  try {
50
- p = await c.then();
702
+ B = await y.then();
51
703
  } catch {
52
- p = !1;
704
+ B = !1;
53
705
  }
54
- p ? d() : h(!1);
706
+ B ? p() : x(!1);
55
707
  });
56
- if (!c)
57
- return t("update:status", "normal"), i.value = "normal", !1;
58
- } else if (r.value) {
59
- const c = r.value.split(",").filter((l) => l.trim().startsWith(".")).map((l) => l.trim()), u = r.value.split(",").filter((l) => !l.trim().startsWith(".")).map((l) => l.trim()), h = ee(e.name), p = c.includes(h);
60
- let b = u.includes("image/*") && e.type.split("/")[0].trim() === "image", A = u.includes("video/*") && e.type.split("/")[0].trim() === "video", j = u.includes("audio/*") && e.type.split("/")[0].trim() === "audio", D = u.includes(e.type) || b || A || j;
61
- if (!p && !D) {
62
- const l = a.acceptAudio || a.acceptVideo ? "das-ui-import-upload-key2" : "das-ui-import-upload-key1", E = U.value === "zh-CN" ? "、" : ", ", F = a.errorMessage || $(l, r.value.toUpperCase().replaceAll(".", "").replaceAll(",", E)).value;
63
- return M.warning(F), !1;
708
+ if (!y)
709
+ return e("update:status", "normal"), a.value = "normal", !1;
710
+ } else if (n.value) {
711
+ const y = n.value.split(",").filter((d) => d.trim().startsWith(".")).map((d) => d.trim()), C = n.value.split(",").filter((d) => !d.trim().startsWith(".")).map((d) => d.trim()), x = Ye(s.name), B = y.includes(x);
712
+ let A = C.includes("image/*") && s.type.split("/")[0].trim() === "image", k = C.includes("video/*") && s.type.split("/")[0].trim() === "video", E = C.includes("audio/*") && s.type.split("/")[0].trim() === "audio", b = C.includes(s.type) || A || k || E;
713
+ if (!B && !b) {
714
+ const d = t.acceptAudio || t.acceptVideo ? "das-ui-import-upload-key2" : "das-ui-import-upload-key1", P = ge.value === "zh-CN" ? "、" : ", ", S = t.errorMessage || ve(d, n.value.toUpperCase().replaceAll(".", "").replaceAll(",", P)).value;
715
+ return be.warning(S), !1;
64
716
  }
65
717
  }
66
- return d();
718
+ return p();
67
719
  } };
68
- }, ie = { class: "das-ui-image-upload" }, se = { class: "das-ui-image-upload-dragger-context" }, re = { class: "text" }, le = { class: "das-ui-image-upload-error-container" }, ne = { class: "tips-container" }, de = { class: "text" }, ce = /* @__PURE__ */ P({
720
+ }, bt = { class: "das-ui-image-upload" }, wt = { class: "das-ui-image-upload-dragger-context" }, xt = { class: "text" }, Ct = { class: "das-ui-image-upload-error-container" }, Bt = { class: "tips-container" }, At = { class: "text" }, kt = /* @__PURE__ */ je({
69
721
  __name: "Index",
70
722
  props: {
71
723
  maxCount: { default: 1 },
@@ -77,38 +729,41 @@ const oe = () => ({ size2B: (t) => {
77
729
  acceptAudio: { type: Boolean },
78
730
  maxSize: {},
79
731
  customCheck: {},
80
- autoContentType: { type: Boolean }
732
+ autoContentType: { type: Boolean },
733
+ openFileDialogOnClick: { type: Boolean, default: !0 },
734
+ isOverMaxLimitCompressImg: { type: Boolean, default: !1 }
81
735
  },
82
736
  emits: ["update:status", "image-upload"],
83
- setup(a, { emit: t }) {
84
- const i = a, n = t, { isAccept: s, uploadStatus: f, loading: r, errored: C, beforeupload: y } = te(i, n);
85
- return (_, e) => (L(), H("div", ie, [
86
- B(" 图片上传组件 "),
87
- N(m(o(Q), {
88
- class: O([{ "loading-border": o(r) }]),
737
+ setup(t, { emit: e }) {
738
+ const a = t, r = e, { isAccept: i, uploadStatus: o, loading: m, errored: n, beforeupload: c } = yt(a, r);
739
+ return (u, f) => (_e(), Le("div", bt, [
740
+ ye(" 图片上传组件 "),
741
+ K(O(v($e), {
742
+ class: Ne([{ "loading-border": v(m) }]),
89
743
  type: "component",
90
- spinning: o(r)
744
+ spinning: v(m)
91
745
  }, {
92
- default: g(() => [
93
- m(o(G), {
746
+ default: R(() => [
747
+ O(v(He), {
94
748
  class: "das-ui-image-upload-dragger",
95
- accept: o(s),
96
- "max-count": _.maxCount,
97
- "before-upload": o(y)
749
+ accept: v(i),
750
+ "max-count": u.maxCount,
751
+ "before-upload": v(c),
752
+ openFileDialogOnClick: u.openFileDialogOnClick
98
753
  }, {
99
- itemRender: g(({ file: d, actions: x }) => e[0] || (e[0] = [])),
100
- default: g(() => [
101
- N(v(
754
+ itemRender: R(({ file: s, actions: h }) => f[0] || (f[0] = [])),
755
+ default: R(() => [
756
+ K(z(
102
757
  "div",
103
- se,
758
+ wt,
104
759
  [
105
- m(o(Y), {
106
- iconColor: o(k)("--das-ui-color-secondary")
760
+ O(v(Xe), {
761
+ iconColor: v(L)("--das-ui-color-secondary")
107
762
  }, null, 8, ["iconColor"]),
108
- v(
763
+ z(
109
764
  "div",
110
- re,
111
- S(_.message || o(w)("das-image-upload-text")),
765
+ xt,
766
+ Y(u.message || v(G)("das-image-upload-text")),
112
767
  1
113
768
  /* TEXT */
114
769
  )
@@ -116,50 +771,51 @@ const oe = () => ({ size2B: (t) => {
116
771
  512
117
772
  /* NEED_PATCH */
118
773
  ), [
119
- [I, o(f) === "normal"]
774
+ [q, v(o) === "normal"]
120
775
  ])
121
776
  ]),
122
777
  _: 1
123
778
  /* STABLE */
124
- }, 8, ["accept", "max-count", "before-upload"])
779
+ }, 8, ["accept", "max-count", "before-upload", "openFileDialogOnClick"])
125
780
  ]),
126
781
  _: 1
127
782
  /* STABLE */
128
783
  }, 8, ["class", "spinning"]), [
129
- [I, !o(C)]
784
+ [q, !v(n)]
130
785
  ]),
131
- B(" 错误状态 "),
132
- N(v(
786
+ ye(" 错误状态 "),
787
+ K(z(
133
788
  "div",
134
- le,
789
+ Ct,
135
790
  [
136
- v("div", ne, [
137
- m(o(Z), {
138
- iconColor: o(k)("--das-ui-color-danger"),
791
+ z("div", Bt, [
792
+ O(v(Ke), {
793
+ iconColor: v(L)("--das-ui-color-danger"),
139
794
  size: "small"
140
795
  }, null, 8, ["iconColor"]),
141
- v(
796
+ z(
142
797
  "div",
143
- de,
144
- S(o(w)("das-image-upload-fail")),
798
+ At,
799
+ Y(v(G)("das-image-upload-fail")),
145
800
  1
146
801
  /* TEXT */
147
802
  )
148
803
  ]),
149
- m(o(J), {
150
- accept: o(s),
151
- "before-upload": o(y),
152
- "max-count": _.maxCount
804
+ O(v(Ve), {
805
+ accept: v(i),
806
+ "before-upload": v(c),
807
+ "max-count": u.maxCount,
808
+ openFileDialogOnClick: u.openFileDialogOnClick
153
809
  }, {
154
- itemRender: g(({ file: d, actions: x }) => e[1] || (e[1] = [])),
155
- default: g(() => [
156
- m(o(X), {
810
+ itemRender: R(({ file: s, actions: h }) => f[1] || (f[1] = [])),
811
+ default: R(() => [
812
+ O(v(Ge), {
157
813
  "btn-type": "primary-text",
158
814
  block: ""
159
815
  }, {
160
- default: g(() => [
161
- q(
162
- S(o(w)("das-image-upload-reupload")),
816
+ default: R(() => [
817
+ We(
818
+ Y(v(G)("das-image-upload-reupload")),
163
819
  1
164
820
  /* TEXT */
165
821
  )
@@ -170,21 +826,21 @@ const oe = () => ({ size2B: (t) => {
170
826
  ]),
171
827
  _: 1
172
828
  /* STABLE */
173
- }, 8, ["accept", "before-upload", "max-count"])
829
+ }, 8, ["accept", "before-upload", "max-count", "openFileDialogOnClick"])
174
830
  ],
175
831
  512
176
832
  /* NEED_PATCH */
177
833
  ), [
178
- [I, o(C)]
834
+ [q, v(n)]
179
835
  ])
180
836
  ]));
181
837
  }
182
- }), ue = (a, t) => {
183
- const i = a.__vccOpts || a;
184
- for (const [n, s] of t)
185
- i[n] = s;
186
- return i;
187
- }, pe = /* @__PURE__ */ ue(ce, [["__scopeId", "data-v-5821ad3e"]]), me = {
838
+ }), Et = (t, e) => {
839
+ const a = t.__vccOpts || t;
840
+ for (const [r, i] of e)
841
+ a[r] = i;
842
+ return a;
843
+ }, Ut = /* @__PURE__ */ Et(kt, [["__scopeId", "data-v-29473013"]]), Dt = {
188
844
  "das-ui-import-upload-key1": {
189
845
  "zh-CN": "上传的图片格式只能是$0",
190
846
  en: "The uploaded picture format can only be $0",
@@ -208,16 +864,16 @@ const oe = () => ({ size2B: (t) => {
208
864
  "das-image-upload-text": { "zh-CN": "上传图片", en: "Upload Image", _appCode: "framework" },
209
865
  "das-image-upload-reupload": { "zh-CN": "重新上传", en: "Re-upload", _appCode: "framework" },
210
866
  "das-image-upload-fail": { "zh-CN": "上传失败", en: "Uploaded Failed", _appCode: "framework" }
211
- }, ge = {
867
+ }, Tt = {
212
868
  "--das-ui-image-upload-bgcolor": { light: "#FAFAFA" },
213
869
  "--das-ui-image-upload-border-color": { light: "#E5E5E5" },
214
- "--das-ui-image-upload-bgcolor-hover": { light: k("--das-ui-color-primary-level1") },
870
+ "--das-ui-image-upload-bgcolor-hover": { light: L("--das-ui-color-primary-level1") },
215
871
  "--das-ui-image-upload-border-color-hover": { light: "#5582F3" },
216
- "--das-ui-image-upload-border-color-error": { light: k("--das-ui-color-danger-level2") }
217
- }, Ie = R(pe);
218
- K(me);
219
- W(ge);
872
+ "--das-ui-image-upload-border-color-error": { light: L("--das-ui-color-danger-level2") }
873
+ }, $t = Ie(Ut);
874
+ Pe(Dt);
875
+ Se(Tt);
220
876
  export {
221
- Ie as DasImageUpload,
222
- Ie as default
877
+ $t as DasImageUpload,
878
+ $t as default
223
879
  };