@gsc-basic/utils 1.0.2 → 1.0.4

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 (3) hide show
  1. package/dist/index.cjs +1 -1381
  2. package/dist/index.js +1 -1275
  3. package/package.json +1 -2
package/dist/index.cjs CHANGED
@@ -1,1381 +1 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/index.js
30
- var src_exports = {};
31
- __export(src_exports, {
32
- AesEncryption: () => AesEncryption,
33
- IfActivity: () => IfActivity,
34
- addClass: () => addClass,
35
- addLocationListener: () => addLocationListener,
36
- addResizeListener: () => addResizeListener,
37
- buildBEM: () => buildBEM,
38
- buildShortUUID: () => buildShortUUID,
39
- buildUUID: () => buildUUID,
40
- createBEM: () => createBEM,
41
- createNamespace: () => createNamespace,
42
- createSearchReg: () => createSearchReg,
43
- dataURLtoBlob: () => dataURLtoBlob,
44
- decodeByBase64: () => decodeByBase64,
45
- deepMerge: () => deepMerge,
46
- domOffEvent: () => off,
47
- domOnEvent: () => on,
48
- downloadByBase64: () => downloadByBase64,
49
- downloadByData: () => downloadByData,
50
- downloadByOnlineUrl: () => downloadByOnlineUrl,
51
- downloadByUrl: () => downloadByUrl,
52
- downloadPercent: () => downloadPercent,
53
- enableTransitions: () => enableTransitions,
54
- encryptByBase64: () => encryptByBase64,
55
- encryptByMd5: () => encryptByMd5,
56
- escapeStringRegexp: () => escapeStringRegexp,
57
- extendSlots: () => extendSlots,
58
- filterTree: () => filter,
59
- findNode: () => findNode,
60
- findNodeAll: () => findNodeAll,
61
- findPath: () => findPath,
62
- findPathAll: () => findPathAll,
63
- forEachTree: () => forEach,
64
- getActualWidthOfChars: () => getActualWidthOfChars,
65
- getBoundingClientRect: () => getBoundingClientRect,
66
- getPopupContainer: () => getPopupContainer,
67
- getRawRoute: () => getRawRoute,
68
- getSlot: () => getSlot,
69
- getViewportOffset: () => getViewportOffset,
70
- hackCss: () => hackCss,
71
- hasClass: () => hasClass,
72
- highlightHtml: () => highlightHtml,
73
- is: () => is,
74
- isBrowser: () => isBrowser,
75
- isChineseText: () => isChineseText,
76
- isChrome: () => isChrome,
77
- isClient: () => isClient,
78
- isIterableArray: () => isIterableArray,
79
- isMatch: () => isMatch,
80
- isObject: () => isObject,
81
- isPositiveInteger: () => isPositiveInteger,
82
- isSafari: () => isSafari,
83
- isServer: () => isServer,
84
- isSupportNativeEllipsis: () => isSupportNativeEllipsis,
85
- isSupportResizeObserver: () => isSupportResizeObserver,
86
- isUrl: () => isUrl,
87
- loadScript: () => loadScript,
88
- matcher: () => matcher,
89
- openWindow: () => openWindow,
90
- regexpMap: () => regexpMap,
91
- removeClass: () => removeClass,
92
- removeResizeListener: () => removeResizeListener,
93
- setCssVar: () => setCssVar,
94
- setObjToUrlParams: () => setObjToUrlParams,
95
- treeMap: () => treeMap,
96
- treeMapEach: () => treeMapEach,
97
- triggerWindowResize: () => triggerWindowResize,
98
- unloadScript: () => unloadScript,
99
- unsetAllProperty: () => unsetAllProperty,
100
- urlToBase64: () => urlToBase64,
101
- useRafThrottle: () => useRafThrottle,
102
- withInstall: () => withInstall
103
- });
104
- module.exports = __toCommonJS(src_exports);
105
-
106
- // src/common.js
107
- var import_lodash_es = require("lodash-es");
108
-
109
- // src/regexp.js
110
- var regexpMap = {
111
- // 手机号(mobile phone)中国(宽松), 只要是13,14,15,16,17,18,19开头即可
112
- mobile: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
113
- // 座机(tel phone)电话(国内),如: 0341-86091234
114
- tel: /^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,
115
- // 数字和字母组成
116
- numAndLetter: /^[A-Z0-9]+$/i,
117
- // 密码强度校验,最少6位,包括至少1个大写字母,1个小写字母,1个数字,1个特殊字符
118
- password: /^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,
119
- // email(支持中文邮箱)
120
- email: /^[A-Z0-9\u4E00-\u9FA5]+@[\w-]+(?:\.[\w-]+)+$/i,
121
- // 邮政编码(中国)
122
- postalCode: /^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,
123
- // 身份证号(2代,18位数字),最后一位是校验位,可能为数字或字符X
124
- identityCard: /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,
125
- // IP地址--ip-v4[:端口]
126
- ip: /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,
127
- // URL
128
- url: /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,
129
- // 是否为https url
130
- httpsUrl: /^https:\/\//,
131
- // 域名(非网址, 不包含协议)
132
- domain: /^([0-9a-z-]+\.)+([a-z]{2,})$/i,
133
- // 车牌号(新能源+非新能源)
134
- plateNumber: /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,
135
- // md5格式(32位)
136
- md5: /^[a-f0-9]{32}$/i,
137
- // base64格式
138
- base64: /^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,
139
- // GUID/UUID
140
- uuid: /^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,
141
- // 版本号(version)格式必须为X.Y.Z
142
- version: /^\d+(?:\.\d+){2}$/,
143
- // 视频(video)链接地址(视频格式可按需增删)
144
- videoUrl: /^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,
145
- // 图片(image)链接地址(图片格式可按需增删)
146
- imageUrl: /^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,
147
- // 中文
148
- chinese: /^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,
149
- itcode: /^[a-z]+\d*$/i
150
- };
151
-
152
- // src/is.js
153
- var toString = Object.prototype.toString;
154
- function is(val, type) {
155
- return toString.call(val) === `[object ${type}]`;
156
- }
157
- function isObject(val) {
158
- return val !== null && is(val, "Object");
159
- }
160
- function isUrl(path) {
161
- return regexpMap.url.test(path);
162
- }
163
- function isIterableArray(val) {
164
- return Array.isArray(val) && val.length > 0;
165
- }
166
- function isPositiveInteger(num) {
167
- return Number.isInteger(num) && num >= 0;
168
- }
169
- var isServer = typeof window === "undefined";
170
- var isClient = !isServer;
171
- var isChrome = isClient && window.navigator.userAgent.toLowerCase().includes("chrome");
172
- var isSafari = isClient && window.navigator.userAgent.toLowerCase().includes("safari");
173
- var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
174
- var isSupportNativeEllipsis = isBrowser && typeof document.body.style.lineClamp !== "undefined";
175
- var isSupportResizeObserver = isBrowser && typeof ResizeObserver !== "undefined";
176
- var isChineseText = (text) => {
177
- return regexpMap.chinese.test(text);
178
- };
179
-
180
- // src/common.js
181
- var withInstall = (component, alias) => {
182
- const comp = component;
183
- comp.install = (app) => {
184
- app.component(comp.name || comp.displayName, component);
185
- if (alias) {
186
- app.config.globalProperties[alias] = component;
187
- }
188
- };
189
- return component;
190
- };
191
- function getRawRoute(route) {
192
- if (!route) {
193
- return route;
194
- }
195
- const { matched, ...opt } = route;
196
- return {
197
- ...opt,
198
- matched: matched ? matched.map((item) => ({
199
- meta: item.meta,
200
- name: item.name,
201
- path: item.path
202
- })) : void 0
203
- };
204
- }
205
- function openWindow(url, opt) {
206
- const { target = "__blank", noopener = true, noreferrer = true } = opt || {};
207
- const feature = [];
208
- noopener && feature.push("noopener=yes");
209
- noreferrer && feature.push("noreferrer=yes");
210
- window.open(url, target, feature.join(","));
211
- }
212
- function deepMerge(source, target, mergeArrays = "replace") {
213
- if (!target) {
214
- return source;
215
- }
216
- if (!source) {
217
- return target;
218
- }
219
- return (0, import_lodash_es.mergeWith)(source, target, (sourceValue, targetValue) => {
220
- if ((0, import_lodash_es.isArray)(targetValue) && (0, import_lodash_es.isArray)(sourceValue)) {
221
- switch (mergeArrays) {
222
- case "union":
223
- return (0, import_lodash_es.unionWith)(sourceValue, targetValue, import_lodash_es.isEqual);
224
- case "intersection":
225
- return (0, import_lodash_es.intersectionWith)(sourceValue, targetValue, import_lodash_es.isEqual);
226
- case "concat":
227
- return sourceValue.concat(targetValue);
228
- case "replace":
229
- return targetValue;
230
- default:
231
- throw new Error(`Unknown merge array strategy: ${mergeArrays}`);
232
- }
233
- }
234
- if (isObject(targetValue) && isObject(sourceValue)) {
235
- return deepMerge(sourceValue, targetValue, mergeArrays);
236
- }
237
- return void 0;
238
- });
239
- }
240
- function getPopupContainer(node) {
241
- return (node == null ? void 0 : node.parentNode) ?? document.body;
242
- }
243
- function setObjToUrlParams(baseUrl, obj) {
244
- if (!isIterableArray(Object.keys(obj))) {
245
- return baseUrl;
246
- }
247
- let parameters = "";
248
- for (const key in obj) {
249
- parameters += `${key}=${encodeURIComponent(obj[key])}&`;
250
- }
251
- parameters = parameters.replace(/&$/, "");
252
- return /\?$/.test(baseUrl) ? baseUrl + parameters : baseUrl.replace(/\/?$/, "?") + parameters;
253
- }
254
- function unsetAllProperty(params) {
255
- if ((0, import_lodash_es.isPlainObject)(params)) {
256
- Object.keys(params).forEach((key) => {
257
- Reflect.deleteProperty(params, key);
258
- });
259
- }
260
- }
261
- function transform(c) {
262
- const code = ["$", "(", ")", "*", "+", ".", "[", "]", "?", "\\", "^", "{", "}", "|"];
263
- return code.includes(c) ? `\\${c}` : c;
264
- }
265
- function createSearchReg(key) {
266
- const keys = [...key].map((item) => transform(item));
267
- const str = ["", ...keys, ""].join(".*");
268
- return new RegExp(str, "i");
269
- }
270
- function getActualWidthOfChars(text = "", options = {}) {
271
- const {
272
- size = 14,
273
- family = getComputedStyle(document.documentElement).getPropertyValue("--vxe-font-family") || "sans-serif"
274
- } = options;
275
- const canvas = document.createElement("canvas");
276
- const ctx = canvas.getContext("2d");
277
- ctx.font = `${size}px ${family}`;
278
- const metrics = ctx.measureText(text);
279
- const actual = Math.abs(metrics.actualBoundingBoxLeft) + Math.abs(metrics.actualBoundingBoxRight);
280
- return Math.ceil(Math.max(metrics.width, actual));
281
- }
282
-
283
- // src/bem.js
284
- function genBem(name, mods) {
285
- if (!mods) {
286
- return "";
287
- }
288
- if (typeof mods === "string") {
289
- return ` ${name}--${mods}`;
290
- }
291
- if (Array.isArray(mods)) {
292
- return mods.reduce((ret, item) => ret + genBem(name, item), "");
293
- }
294
- return Object.keys(mods).reduce((ret, key) => ret + (mods[key] ? genBem(name, key) : ""), "");
295
- }
296
- function buildBEM(name) {
297
- return (el, mods) => {
298
- if (el && typeof el !== "string") {
299
- mods = el;
300
- el = "";
301
- }
302
- el = el ? `${name}__${el}` : name;
303
- return `${el}${genBem(el, mods)}`;
304
- };
305
- }
306
- function createBEM(name, prefixCls = "gsc") {
307
- return [buildBEM(`${prefixCls}-${name}`)];
308
- }
309
- function createNamespace(name, prefixCls = "gsc") {
310
- const prefixedName = `${prefixCls}-${name}`;
311
- return [prefixedName, buildBEM(prefixedName)];
312
- }
313
-
314
- // src/cipher.js
315
- var import_aes = require("crypto-js/aes");
316
- var import_enc_utf8 = __toESM(require("crypto-js/enc-utf8"), 1);
317
- var import_pad_pkcs7 = __toESM(require("crypto-js/pad-pkcs7"), 1);
318
- var import_mode_ecb = __toESM(require("crypto-js/mode-ecb"), 1);
319
- var import_md5 = __toESM(require("crypto-js/md5"), 1);
320
- var import_enc_base64 = __toESM(require("crypto-js/enc-base64"), 1);
321
- var AesEncryption = class {
322
- constructor(opt) {
323
- const { key, iv } = opt;
324
- if (key) {
325
- this.key = (0, import_enc_utf8.parse)(key);
326
- }
327
- if (iv) {
328
- this.iv = (0, import_enc_utf8.parse)(iv);
329
- }
330
- }
331
- get getOptions() {
332
- return {
333
- mode: import_mode_ecb.default,
334
- padding: import_pad_pkcs7.default,
335
- iv: this.iv
336
- };
337
- }
338
- encryptByAES(cipherText) {
339
- return (0, import_aes.encrypt)(cipherText, this.key, this.getOptions).toString();
340
- }
341
- decryptByAES(cipherText) {
342
- return (0, import_aes.decrypt)(cipherText, this.key, this.getOptions).toString(import_enc_utf8.default);
343
- }
344
- };
345
- function encryptByBase64(cipherText) {
346
- return import_enc_utf8.default.parse(cipherText).toString(import_enc_base64.default);
347
- }
348
- function decodeByBase64(cipherText) {
349
- return import_enc_base64.default.parse(cipherText).toString(import_enc_utf8.default);
350
- }
351
- function encryptByMd5(password) {
352
- return (0, import_md5.default)(password).toString();
353
- }
354
-
355
- // src/domUtils.js
356
- var import_lodash_es2 = require("lodash-es");
357
- var docEle = document.documentElement;
358
- var enableTransitions = () => {
359
- return "startViewTransition" in document && window.matchMedia("(prefers-reduced-motion: no-preference)").matches;
360
- };
361
- function getBoundingClientRect(element) {
362
- if (!element || !element.getBoundingClientRect) {
363
- return 0;
364
- }
365
- return element.getBoundingClientRect();
366
- }
367
- function trim(string) {
368
- return (string || "").replace(/^\s+|\s+$/g, "");
369
- }
370
- function hasClass(el, cls) {
371
- if (!el || !cls) {
372
- return false;
373
- }
374
- if (cls.includes(" ")) {
375
- throw new Error("className should not contain space.");
376
- }
377
- if (el.classList) {
378
- return el.classList.contains(cls);
379
- } else {
380
- return ` ${el.className} `.includes(` ${cls} `);
381
- }
382
- }
383
- function setCssVar(prop, val, dom = docEle) {
384
- dom.style.setProperty(prop, val);
385
- }
386
- function addClass(el, cls) {
387
- if (!el) {
388
- return;
389
- }
390
- let curClass = el.className;
391
- const classes = (cls || "").split(" ");
392
- for (let i = 0, j = classes.length; i < j; i++) {
393
- const clsName = classes[i];
394
- if (!clsName) {
395
- continue;
396
- }
397
- if (el.classList) {
398
- el.classList.add(clsName);
399
- } else if (!hasClass(el, clsName)) {
400
- curClass += ` ${clsName}`;
401
- }
402
- }
403
- if (!el.classList) {
404
- el.className = curClass;
405
- }
406
- }
407
- function removeClass(el, cls) {
408
- if (!el || !cls) {
409
- return;
410
- }
411
- const classes = cls.split(" ");
412
- let curClass = ` ${el.className} `;
413
- for (let i = 0, j = classes.length; i < j; i++) {
414
- const clsName = classes[i];
415
- if (!clsName) {
416
- continue;
417
- }
418
- if (el.classList) {
419
- el.classList.remove(clsName);
420
- } else if (hasClass(el, clsName)) {
421
- curClass = curClass.replace(` ${clsName} `, " ");
422
- }
423
- }
424
- if (!el.classList) {
425
- el.className = trim(curClass);
426
- }
427
- }
428
- function getViewportOffset(element) {
429
- const doc = document.documentElement;
430
- const docScrollLeft = doc.scrollLeft;
431
- const docScrollTop = doc.scrollTop;
432
- const docClientLeft = doc.clientLeft;
433
- const docClientTop = doc.clientTop;
434
- const pageXOffset = window.scrollX;
435
- const pageYOffset = window.scrollY;
436
- const box = getBoundingClientRect(element);
437
- const { left: retLeft, top: rectTop, width: rectWidth, height: rectHeight } = box;
438
- const scrollLeft = (pageXOffset || docScrollLeft) - (docClientLeft || 0);
439
- const scrollTop = (pageYOffset || docScrollTop) - (docClientTop || 0);
440
- const offsetLeft = retLeft + pageXOffset;
441
- const offsetTop = rectTop + pageYOffset;
442
- const left = offsetLeft - scrollLeft;
443
- const top = offsetTop - scrollTop;
444
- const clientWidth = window.document.documentElement.clientWidth;
445
- const clientHeight = window.document.documentElement.clientHeight;
446
- return {
447
- left,
448
- top,
449
- right: clientWidth - rectWidth - left,
450
- bottom: clientHeight - rectHeight - top,
451
- rightIncludeBody: clientWidth - left,
452
- bottomIncludeBody: clientHeight - top
453
- };
454
- }
455
- function hackCss(attr, value) {
456
- const prefix = ["webkit", "Moz", "ms", "OT"];
457
- const styleObj = {};
458
- prefix.forEach((item) => {
459
- styleObj[`${item}${(0, import_lodash_es2.upperFirst)(attr)}`] = value;
460
- });
461
- return {
462
- ...styleObj,
463
- [attr]: value
464
- };
465
- }
466
- function on(element, event, handler) {
467
- if (element && event && handler) {
468
- element.addEventListener(event, handler, false);
469
- }
470
- }
471
- function off(element, event, handler) {
472
- if (element && event && handler) {
473
- element.removeEventListener(event, handler, false);
474
- }
475
- }
476
- function useRafThrottle(fn) {
477
- let locked = false;
478
- return function(...args) {
479
- if (locked) {
480
- return;
481
- }
482
- locked = true;
483
- window.requestAnimationFrame(() => {
484
- fn.apply(this, args);
485
- locked = false;
486
- });
487
- };
488
- }
489
-
490
- // src/event.js
491
- var import_resize_observer_polyfill = __toESM(require("resize-observer-polyfill"), 1);
492
- function resizeHandler(entries) {
493
- for (const entry of entries) {
494
- const listeners = entry.target.__resizeListeners__ || [];
495
- if (listeners.length) {
496
- listeners.forEach((fn) => {
497
- fn();
498
- });
499
- }
500
- }
501
- }
502
- function addResizeListener(element, fn) {
503
- if (isServer) {
504
- return;
505
- }
506
- if (!element.__resizeListeners__) {
507
- element.__resizeListeners__ = [];
508
- element.__ro__ = new import_resize_observer_polyfill.default(resizeHandler);
509
- element.__ro__.observe(element);
510
- }
511
- element.__resizeListeners__.push(fn);
512
- }
513
- function removeResizeListener(element, fn) {
514
- if (!element || !element.__resizeListeners__) {
515
- return;
516
- }
517
- element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
518
- if (!element.__resizeListeners__.length) {
519
- element.__ro__.disconnect();
520
- element.__ro__ = null;
521
- element.__resizeListeners__ = null;
522
- }
523
- }
524
- function triggerWindowResize() {
525
- const event = new Event("resize", { bubbles: true, cancelable: true });
526
- window.dispatchEvent(event);
527
- }
528
- function addLocationListener(fn, options = {}) {
529
- function addEvent(type) {
530
- const original = window.history[type];
531
- return function(...args) {
532
- const e = new Event(type);
533
- e.arguments = args;
534
- window.dispatchEvent(e);
535
- return original.apply(this, args);
536
- };
537
- }
538
- ;
539
- window.history.pushState = addEvent("pushState");
540
- window.history.replaceState = addEvent("replaceState");
541
- window.addEventListener("popstate", fn, options);
542
- window.addEventListener("hashchange", fn, options);
543
- window.addEventListener("replaceState", fn, options);
544
- window.addEventListener("pushState", fn, options);
545
- return {
546
- removeListener: () => {
547
- window.removeEventListener("popstate", fn, options);
548
- window.removeEventListener("hashchange", fn, options);
549
- window.removeEventListener("replaceState", fn, options);
550
- window.removeEventListener("pushState", fn, options);
551
- }
552
- };
553
- }
554
-
555
- // src/file.js
556
- var import_lodash_es3 = require("lodash-es");
557
- function dataURLtoBlob(base64Buf) {
558
- const arr = base64Buf.split(",");
559
- const typeItem = arr[0];
560
- const mime = typeItem.match(/:(.*?);/)[1];
561
- const bstr = window.atob(arr[1]);
562
- let n = bstr.length;
563
- const u8arr = new Uint8Array(n);
564
- while (n--) {
565
- u8arr[n] = bstr.charCodeAt(n);
566
- }
567
- return new Blob([u8arr], { type: mime });
568
- }
569
- function urlToBase64(url, mineType) {
570
- return new Promise((resolve, reject) => {
571
- let canvas = document.createElement("CANVAS");
572
- const ctx = canvas.getContext("2d");
573
- const img = new Image();
574
- img.crossOrigin = "";
575
- img.onload = function() {
576
- if (!canvas || !ctx) {
577
- return reject();
578
- }
579
- canvas.height = img.height;
580
- canvas.width = img.width;
581
- ctx.drawImage(img, 0, 0);
582
- const dataURL = canvas.toDataURL(mineType || "image/png");
583
- canvas = null;
584
- resolve(dataURL);
585
- };
586
- img.src = url;
587
- });
588
- }
589
- function downloadPercent(event) {
590
- const { loaded, total } = event;
591
- if (total <= 0 || (0, import_lodash_es3.isNil)(total)) {
592
- return 0;
593
- }
594
- const percent = loaded / total;
595
- return (0, import_lodash_es3.round)((percent > 1 ? 1 : percent) * 100);
596
- }
597
- function downloadByOnlineUrl(url, filename, mime, bom) {
598
- urlToBase64(url).then((base64) => {
599
- downloadByBase64(base64, filename, mime, bom);
600
- });
601
- }
602
- function downloadByBase64(buf, filename, mime, bom) {
603
- const base64Buf = dataURLtoBlob(buf);
604
- downloadByData(base64Buf, filename, mime, bom);
605
- }
606
- function downloadByData(data, filename, mime, bom) {
607
- const blobData = typeof bom !== "undefined" ? [bom, data] : [data];
608
- const blob = new Blob(blobData, { type: mime || "application/octet-stream" });
609
- if (typeof window.navigator.msSaveBlob !== "undefined") {
610
- window.navigator.msSaveBlob(blob, filename);
611
- } else {
612
- const blobURL = window.URL.createObjectURL(blob);
613
- const tempLink = document.createElement("a");
614
- tempLink.style.display = "none";
615
- tempLink.href = blobURL;
616
- tempLink.setAttribute("download", filename);
617
- if (typeof tempLink.download === "undefined") {
618
- tempLink.setAttribute("target", "_blank");
619
- }
620
- document.body.appendChild(tempLink);
621
- tempLink.click();
622
- document.body.removeChild(tempLink);
623
- window.URL.revokeObjectURL(blobURL);
624
- }
625
- }
626
- function downloadByUrl({ url, target = "_blank", fileName }) {
627
- if (/iP/.test(window.navigator.userAgent)) {
628
- return false;
629
- }
630
- if (isChrome || isSafari) {
631
- const link = document.createElement("a");
632
- link.href = url;
633
- link.download = fileName || url.substring(url.lastIndexOf("/") + 1, url.length);
634
- link.style.display = "none";
635
- document.body.appendChild(link);
636
- link.click();
637
- document.body.removeChild(link);
638
- return true;
639
- }
640
- if (!url.includes("?")) {
641
- url += "?download";
642
- }
643
- openWindow(url, { target });
644
- return true;
645
- }
646
-
647
- // src/highlightHtml.js
648
- var getKeywordIndexList = (content, keyword, flags = "ig") => {
649
- const reg = new RegExp(keyword, flags);
650
- const res = content.matchAll(reg);
651
- const arr = [...res];
652
- const allIndexArr = arr.map((e) => ({
653
- index: e.index,
654
- subString: e["0"]
655
- }));
656
- return allIndexArr;
657
- };
658
- function humpToLine(name) {
659
- return name.replace(/([A-Z])/g, "-$1").toLowerCase();
660
- }
661
- var renderNodeTag = (subStr, option) => {
662
- const s = subStr;
663
- if (!option) {
664
- return s;
665
- }
666
- const { tagName = "mark", bgColor, color, style = {}, renderHighlightKeyword } = option;
667
- if (typeof renderHighlightKeyword === "function") {
668
- return renderHighlightKeyword(subStr);
669
- }
670
- style.backgroundColor = bgColor;
671
- style.color = color;
672
- const styleContent = Object.keys(style).map((k) => `${humpToLine(k)}:${style[k]}`).join(";");
673
- const styleStr = `style="${styleContent}"`;
674
- return `<${tagName} ${styleStr}>${s}</${tagName}>`;
675
- };
676
- var renderHighlightHtml = (content, list) => {
677
- let str = "";
678
- list.forEach((item) => {
679
- const { start, end, option } = item;
680
- const s = content.slice(start, end);
681
- const subStr = renderNodeTag(s, option);
682
- str += subStr;
683
- item.subString = subStr;
684
- });
685
- return str;
686
- };
687
- var parseHighlightIndex = (content, keywords) => {
688
- const result = [];
689
- keywords.forEach((keywordOption) => {
690
- let option = { keyword: "" };
691
- if (typeof keywordOption === "string") {
692
- option = { keyword: keywordOption };
693
- } else {
694
- option = keywordOption;
695
- }
696
- const { keyword, caseSensitive = true } = option;
697
- const indexList = getKeywordIndexList(content, keyword, caseSensitive ? "g" : "gi");
698
- const res = {
699
- keyword,
700
- indexList,
701
- option
702
- };
703
- result.push(res);
704
- });
705
- return result;
706
- };
707
- var parseHighlightString = (content, keywords) => {
708
- const result = parseHighlightIndex(content, keywords);
709
- const splitList = [];
710
- const findSplitIndex = (index, len) => {
711
- for (let i = 0; i < splitList.length; i++) {
712
- const cur = splitList[i];
713
- if (index > cur.start && index < cur.end || index + len > cur.start && index + len < cur.end || cur.start > index && cur.start < index + len || cur.end > index && cur.end < index + len || index === cur.start && index + len === cur.end) {
714
- return -1;
715
- }
716
- if (index + len <= cur.start) {
717
- return i;
718
- }
719
- }
720
- return splitList.length;
721
- };
722
- result.forEach(({ indexList, option }) => {
723
- indexList.forEach((e) => {
724
- const { index, subString } = e;
725
- const item = {
726
- start: index,
727
- end: index + subString.length,
728
- option
729
- };
730
- const splitIndex = findSplitIndex(index, subString.length);
731
- if (splitIndex !== -1) {
732
- splitList.splice(splitIndex, 0, item);
733
- }
734
- });
735
- });
736
- const list = [];
737
- splitList.forEach((cur, i) => {
738
- const { start, end } = cur;
739
- const next = splitList[i + 1];
740
- if (i === 0 && start > 0) {
741
- list.push({ start: 0, end: start, subString: content.slice(0, start) });
742
- }
743
- list.push({ ...cur, subString: content.slice(start, end) });
744
- if ((next == null ? void 0 : next.start) > end) {
745
- list.push({
746
- start: end,
747
- end: next.start,
748
- subString: content.slice(end, next.start)
749
- });
750
- }
751
- if (i === splitList.length - 1 && end < content.length - 1) {
752
- list.push({
753
- start: end,
754
- end: content.length - 1,
755
- subString: content.slice(end, content.length)
756
- });
757
- }
758
- });
759
- return list;
760
- };
761
- var highlightHtml = (content, keywords) => {
762
- const splitList = parseHighlightString(content, keywords);
763
- return {
764
- highText: renderHighlightHtml(content, splitList),
765
- highList: splitList
766
- };
767
- };
768
-
769
- // src/ifActivity.js
770
- var import_worker_timers = require("worker-timers");
771
- var STATUS_ACTIVE = "active";
772
- var STATUS_IDLE = "idle";
773
- var STATUS_HIDDEN = "hidden";
774
- var DOC_HIDDEN;
775
- var VISIBILITY_CHANGE_EVENT;
776
- var setListener;
777
- var store = {};
778
- var Events = {
779
- attach(event, callback) {
780
- if (!store[event]) {
781
- store[event] = [];
782
- }
783
- store[event].push(callback);
784
- },
785
- fire(event, args = []) {
786
- if (store[event]) {
787
- store[event].forEach((callback) => {
788
- callback(...args);
789
- });
790
- }
791
- },
792
- remove(event, callback) {
793
- if (!callback) {
794
- Reflect.deleteProperty(store, event);
795
- }
796
- if (store[event]) {
797
- store[event] = store[event].filter((savedCallback) => {
798
- return callback !== savedCallback;
799
- });
800
- }
801
- },
802
- dom(element, event, callback) {
803
- if (!setListener) {
804
- if (element.addEventListener) {
805
- setListener = (el, ev, fn) => {
806
- return el.addEventListener(ev, fn, false);
807
- };
808
- } else if (typeof element.attachEvent === "function") {
809
- setListener = (el, ev, fn) => {
810
- return el.attachEvent(`on${ev}`, fn, false);
811
- };
812
- } else {
813
- setListener = (el, ev, fn) => {
814
- return el[`on${ev}`] = fn;
815
- };
816
- }
817
- }
818
- return setListener(element, event, callback);
819
- }
820
- };
821
- var Timer = class {
822
- constructor(activity, seconds, callback) {
823
- this.activity = activity;
824
- this.seconds = seconds;
825
- this.callback = callback;
826
- this.stopped = false;
827
- this.start();
828
- this.activity.on("statusChanged", (data) => {
829
- if (this.stopped === false) {
830
- if (data.status === STATUS_ACTIVE) {
831
- this.start();
832
- } else {
833
- this.pause();
834
- }
835
- }
836
- });
837
- }
838
- start() {
839
- this.stopped = false;
840
- (0, import_worker_timers.clearInterval)(this.token);
841
- this.token = (0, import_worker_timers.setInterval)(this.callback, this.seconds * 1e3);
842
- }
843
- stop() {
844
- this.stopped = true;
845
- (0, import_worker_timers.clearInterval)(this.token);
846
- }
847
- resume() {
848
- this.start();
849
- }
850
- pause() {
851
- this.stop();
852
- }
853
- };
854
- var IfActivity = class {
855
- constructor() {
856
- this.status = STATUS_ACTIVE;
857
- this.timers = [];
858
- this.idleTime = 3e4;
859
- this.isLegacyModeOn = false;
860
- if (document.hidden !== void 0) {
861
- DOC_HIDDEN = "hidden";
862
- VISIBILITY_CHANGE_EVENT = "visibilitychange";
863
- } else if (document.mozHidden !== void 0) {
864
- DOC_HIDDEN = "mozHidden";
865
- VISIBILITY_CHANGE_EVENT = "mozvisibilitychange";
866
- } else if (document.msHidden !== void 0) {
867
- DOC_HIDDEN = "msHidden";
868
- VISIBILITY_CHANGE_EVENT = "msvisibilitychange";
869
- } else if (document.webkitHidden !== void 0) {
870
- DOC_HIDDEN = "webkitHidden";
871
- VISIBILITY_CHANGE_EVENT = "webkitvisibilitychange";
872
- }
873
- if (DOC_HIDDEN === void 0) {
874
- this.legacyMode();
875
- } else {
876
- const trackChange = () => {
877
- if (document[DOC_HIDDEN]) {
878
- this.blur();
879
- } else {
880
- this.focus();
881
- }
882
- };
883
- trackChange();
884
- Events.dom(document, VISIBILITY_CHANGE_EVENT, trackChange);
885
- }
886
- this.startIdleTimer();
887
- this.trackIdleStatus();
888
- }
889
- legacyMode() {
890
- if (this.isLegacyModeOn) {
891
- return;
892
- }
893
- Events.dom(window, "blur", () => {
894
- return this.blur();
895
- });
896
- Events.dom(window, "focus", () => {
897
- return this.focus();
898
- });
899
- this.isLegacyModeOn = true;
900
- }
901
- startIdleTimer(event) {
902
- if (event instanceof MouseEvent && event.movementX === 0 && event.movementY === 0) {
903
- return;
904
- }
905
- this.timers.map(import_worker_timers.clearTimeout);
906
- this.timers.length = 0;
907
- if (this.status === STATUS_IDLE) {
908
- this.wakeUp();
909
- }
910
- this.idleStartedTime = +/* @__PURE__ */ new Date();
911
- this.timers.push(
912
- (0, import_worker_timers.setTimeout)(() => {
913
- if (this.status === STATUS_ACTIVE || this.status === STATUS_HIDDEN) {
914
- return this.idle();
915
- }
916
- }, this.idleTime)
917
- );
918
- }
919
- trackIdleStatus() {
920
- Events.dom(document, "mousemove", this.startIdleTimer.bind(this));
921
- Events.dom(document, "mousedown", this.startIdleTimer.bind(this));
922
- Events.dom(document, "keyup", this.startIdleTimer.bind(this));
923
- Events.dom(document, "touchstart", this.startIdleTimer.bind(this));
924
- Events.dom(window, "scroll", this.startIdleTimer.bind(this));
925
- this.focus(this.startIdleTimer.bind(this));
926
- }
927
- on(event, callback) {
928
- Events.attach(event, callback);
929
- return this;
930
- }
931
- // will remove events
932
- off(event, callback) {
933
- Events.remove(event, callback);
934
- return this;
935
- }
936
- setIdleDuration(seconds) {
937
- this.idleTime = seconds * 1e3;
938
- this.startIdleTimer();
939
- return this;
940
- }
941
- getIdleDuration() {
942
- return this.idleTime;
943
- }
944
- getIdleInfo() {
945
- const now = +/* @__PURE__ */ new Date();
946
- let res;
947
- if (this.status === STATUS_IDLE) {
948
- res = {
949
- isIdle: true,
950
- idleFor: now - this.idleStartedTime,
951
- timeLeft: 0,
952
- timeLeftPer: 100
953
- };
954
- } else {
955
- const timeLeft = this.idleStartedTime + this.idleTime - now;
956
- res = {
957
- isIdle: false,
958
- idleFor: now - this.idleStartedTime,
959
- timeLeft,
960
- timeLeftPer: Number.parseFloat((100 - timeLeft * 100 / this.idleTime).toFixed(2))
961
- };
962
- }
963
- return res;
964
- }
965
- idle(callback) {
966
- if (callback) {
967
- this.on("idle", callback);
968
- } else {
969
- this.status = STATUS_IDLE;
970
- Events.fire("idle");
971
- Events.fire("statusChanged", [{ status: this.status }]);
972
- }
973
- return this;
974
- }
975
- blur(callback) {
976
- if (callback) {
977
- this.on("blur", callback);
978
- } else {
979
- this.status = STATUS_HIDDEN;
980
- Events.fire("blur");
981
- Events.fire("statusChanged", [{ status: this.status }]);
982
- }
983
- return this;
984
- }
985
- focus(callback) {
986
- if (callback) {
987
- this.on("focus", callback);
988
- } else if (this.status !== STATUS_ACTIVE) {
989
- this.status = STATUS_ACTIVE;
990
- Events.fire("focus");
991
- Events.fire("wakeUp");
992
- Events.fire("statusChanged", [{ status: this.status }]);
993
- }
994
- return this;
995
- }
996
- wakeUp(callback) {
997
- if (callback) {
998
- this.on("wakeUp", callback);
999
- } else if (this.status !== STATUS_ACTIVE) {
1000
- this.status = STATUS_ACTIVE;
1001
- Events.fire("wakeUp");
1002
- Events.fire("statusChanged", [{ status: this.status }]);
1003
- }
1004
- return this;
1005
- }
1006
- // 页面活跃时执行定时器
1007
- onEvery(seconds, callback) {
1008
- return new Timer(this, seconds, callback);
1009
- }
1010
- now(check) {
1011
- if (check !== void 0) {
1012
- return this.status === check;
1013
- }
1014
- return this.status === STATUS_ACTIVE;
1015
- }
1016
- };
1017
-
1018
- // src/jsxHelper.js
1019
- var import_lodash_es4 = require("lodash-es");
1020
- function getSlot(slots, slot = "default", data) {
1021
- if (!slots || !Reflect.has(slots, slot)) {
1022
- return null;
1023
- }
1024
- if (!(0, import_lodash_es4.isFunction)(slots[slot])) {
1025
- return null;
1026
- }
1027
- const slotFn = slots[slot];
1028
- if (!slotFn) {
1029
- return null;
1030
- }
1031
- return slotFn(data);
1032
- }
1033
- function extendSlots(slots, excludeKeys = []) {
1034
- const slotKeys = Object.keys(slots);
1035
- const ret = {};
1036
- slotKeys.forEach((key) => {
1037
- if (excludeKeys.includes(key)) {
1038
- return null;
1039
- }
1040
- ret[key] = (data) => getSlot(slots, key, data);
1041
- });
1042
- return ret;
1043
- }
1044
-
1045
- // src/loadScript.js
1046
- function loadScript(src, { type = "text/javascript" } = {}) {
1047
- return new Promise((resolve, reject) => {
1048
- let shouldAppend = false;
1049
- let el = document.querySelector(`script[src="${src}"]`);
1050
- if (!el) {
1051
- el = document.createElement("script");
1052
- el.type = type;
1053
- el.async = true;
1054
- el.src = src;
1055
- shouldAppend = true;
1056
- } else if (el.hasAttribute("data-loaded")) {
1057
- resolve({ el });
1058
- return;
1059
- }
1060
- el.addEventListener("error", reject);
1061
- el.addEventListener("abort", reject);
1062
- el.addEventListener("load", () => {
1063
- el.setAttribute("data-loaded", true);
1064
- resolve({ el });
1065
- });
1066
- if (shouldAppend) {
1067
- document.head.appendChild(el);
1068
- }
1069
- });
1070
- }
1071
- function unloadScript(src) {
1072
- return new Promise((resolve, reject) => {
1073
- const el = document.querySelector(`script[src="${src}"]`);
1074
- if (!el) {
1075
- reject();
1076
- return;
1077
- }
1078
- document.head.removeChild(el);
1079
- resolve();
1080
- });
1081
- }
1082
-
1083
- // src/matcher.js
1084
- function matcher(inputs, patterns, options) {
1085
- return baseMatcher(inputs, patterns, options, false);
1086
- }
1087
- function isMatch(inputs, patterns, options) {
1088
- return baseMatcher(inputs, patterns, options, true).length > 0;
1089
- }
1090
- function escapeStringRegexp(value) {
1091
- if (typeof value !== "string") {
1092
- return value;
1093
- }
1094
- return value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
1095
- }
1096
- var regexpCache = /* @__PURE__ */ new Map();
1097
- function sanitizeArray(input, inputName) {
1098
- if (!Array.isArray(input)) {
1099
- switch (typeof input) {
1100
- case "string":
1101
- input = [input];
1102
- break;
1103
- case "undefined":
1104
- input = [];
1105
- break;
1106
- default:
1107
- throw new TypeError(
1108
- `Expected '${inputName}' to be a string or an array, but got a type of '${typeof input}'`
1109
- );
1110
- }
1111
- }
1112
- return input.filter((string) => {
1113
- if (typeof string !== "string") {
1114
- if (typeof string === "undefined") {
1115
- return false;
1116
- }
1117
- throw new TypeError(
1118
- `Expected '${inputName}' to be an array of strings, but found a type of '${typeof string}' in the array`
1119
- );
1120
- }
1121
- return true;
1122
- });
1123
- }
1124
- function makeRegexp(pattern, options) {
1125
- options = {
1126
- caseSensitive: false,
1127
- ...options
1128
- };
1129
- const cacheKey = pattern + JSON.stringify(options);
1130
- if (regexpCache.has(cacheKey)) {
1131
- return regexpCache.get(cacheKey);
1132
- }
1133
- const negated = pattern[0] === "!";
1134
- if (negated) {
1135
- pattern = pattern.slice(1);
1136
- }
1137
- pattern = escapeStringRegexp(pattern).replace(/\\\*/g, "[\\s\\S]*");
1138
- const regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? "" : "i");
1139
- regexp.negated = negated;
1140
- regexpCache.set(cacheKey, regexp);
1141
- return regexp;
1142
- }
1143
- function baseMatcher(inputs, patterns, options, firstMatchOnly) {
1144
- inputs = sanitizeArray(inputs, "inputs");
1145
- patterns = sanitizeArray(patterns, "patterns");
1146
- if (patterns.length === 0) {
1147
- return [];
1148
- }
1149
- patterns = patterns.map((pattern) => makeRegexp(pattern, options));
1150
- const { allPatterns } = options || {};
1151
- const result = [];
1152
- for (const input of inputs) {
1153
- let matches;
1154
- const didFit = [...patterns].fill(false);
1155
- for (const [index, pattern] of patterns.entries()) {
1156
- if (pattern.test(input)) {
1157
- didFit[index] = true;
1158
- matches = !pattern.negated;
1159
- if (!matches) {
1160
- break;
1161
- }
1162
- }
1163
- }
1164
- if (!(matches === false || matches === void 0 && patterns.some((pattern) => !pattern.negated) || allPatterns && didFit.some((yes, index) => !yes && !patterns[index].negated))) {
1165
- result.push(input);
1166
- if (firstMatchOnly) {
1167
- break;
1168
- }
1169
- }
1170
- }
1171
- return result;
1172
- }
1173
-
1174
- // src/treeHelper.js
1175
- var DEFAULT_CONFIG = {
1176
- id: "id",
1177
- children: "children",
1178
- pid: "pid"
1179
- };
1180
- var getConfig = (config) => Object.assign({}, DEFAULT_CONFIG, config);
1181
- function findNode(tree, func, config = {}) {
1182
- config = getConfig(config);
1183
- const { children } = config;
1184
- const list = [...tree];
1185
- for (const node of list) {
1186
- if (func(node)) {
1187
- return node;
1188
- }
1189
- node[children] && list.push(...node[children]);
1190
- }
1191
- return null;
1192
- }
1193
- function findNodeAll(tree, func, config = {}) {
1194
- config = getConfig(config);
1195
- const { children } = config;
1196
- const list = [...tree];
1197
- const result = [];
1198
- for (const node of list) {
1199
- func(node) && result.push(node);
1200
- node[children] && list.push(...node[children]);
1201
- }
1202
- return result;
1203
- }
1204
- function findPath(tree, func, config = {}) {
1205
- config = getConfig(config);
1206
- const path = [];
1207
- const list = [...tree];
1208
- const visitedSet = /* @__PURE__ */ new Set();
1209
- const { children } = config;
1210
- while (list.length) {
1211
- const node = list[0];
1212
- if (visitedSet.has(node)) {
1213
- path.pop();
1214
- list.shift();
1215
- } else {
1216
- visitedSet.add(node);
1217
- node[children] && list.unshift(...node[children]);
1218
- path.push(node);
1219
- if (func(node)) {
1220
- return path;
1221
- }
1222
- }
1223
- }
1224
- return null;
1225
- }
1226
- function findPathAll(tree, func, config = {}) {
1227
- config = getConfig(config);
1228
- const path = [];
1229
- const list = [...tree];
1230
- const result = [];
1231
- const visitedSet = /* @__PURE__ */ new Set();
1232
- const { children } = config;
1233
- while (list.length) {
1234
- const node = list[0];
1235
- if (visitedSet.has(node)) {
1236
- path.pop();
1237
- list.shift();
1238
- } else {
1239
- visitedSet.add(node);
1240
- node[children] && list.unshift(...node[children]);
1241
- path.push(node);
1242
- func(node) && result.push([...path]);
1243
- }
1244
- }
1245
- return result;
1246
- }
1247
- function filter(tree, func, config = {}) {
1248
- config = getConfig(config);
1249
- const children = config.children;
1250
- function listFilter(list) {
1251
- return list.map((node) => ({ ...node })).filter((node) => {
1252
- node[children] = node[children] && listFilter(node[children]);
1253
- return func(node) || node[children] && node[children].length;
1254
- });
1255
- }
1256
- return listFilter(tree);
1257
- }
1258
- function forEach(tree, func, config = {}) {
1259
- config = getConfig(config);
1260
- const list = [...tree];
1261
- const { children } = config;
1262
- for (let i = 0; i < list.length; i++) {
1263
- if (func(list[i])) {
1264
- return;
1265
- }
1266
- children && list[i][children] && list.splice(i + 1, 0, ...list[i][children]);
1267
- }
1268
- }
1269
- function treeMap(treeData, opt) {
1270
- return treeData.map((item) => treeMapEach(item, opt));
1271
- }
1272
- function treeMapEach(data, { children = "children", conversion }) {
1273
- const haveChildren = Array.isArray(data[children]) && data[children].length > 0;
1274
- const conversionData = conversion(data) || {};
1275
- if (haveChildren) {
1276
- return {
1277
- ...conversionData,
1278
- [children]: data[children].map(
1279
- (i) => treeMapEach(i, {
1280
- children,
1281
- conversion
1282
- })
1283
- )
1284
- };
1285
- } else {
1286
- return {
1287
- ...conversionData
1288
- };
1289
- }
1290
- }
1291
-
1292
- // src/uuid.js
1293
- var import_uuid = require("uuid");
1294
- function buildUUID({ native = true } = {}) {
1295
- var _a, _b;
1296
- if (!native) {
1297
- return (0, import_uuid.v4)();
1298
- }
1299
- return ((_b = (_a = window.crypto) == null ? void 0 : _a.randomUUID) == null ? void 0 : _b.call(_a)) ?? (0, import_uuid.v4)();
1300
- }
1301
- var unique = 0;
1302
- function buildShortUUID(prefix = "") {
1303
- const time = Date.now();
1304
- const random = Math.floor(Math.random() * 1e9);
1305
- unique++;
1306
- return `${prefix}_${random}${unique}${String(time)}`;
1307
- }
1308
- // Annotate the CommonJS export names for ESM import in node:
1309
- 0 && (module.exports = {
1310
- AesEncryption,
1311
- IfActivity,
1312
- addClass,
1313
- addLocationListener,
1314
- addResizeListener,
1315
- buildBEM,
1316
- buildShortUUID,
1317
- buildUUID,
1318
- createBEM,
1319
- createNamespace,
1320
- createSearchReg,
1321
- dataURLtoBlob,
1322
- decodeByBase64,
1323
- deepMerge,
1324
- domOffEvent,
1325
- domOnEvent,
1326
- downloadByBase64,
1327
- downloadByData,
1328
- downloadByOnlineUrl,
1329
- downloadByUrl,
1330
- downloadPercent,
1331
- enableTransitions,
1332
- encryptByBase64,
1333
- encryptByMd5,
1334
- escapeStringRegexp,
1335
- extendSlots,
1336
- filterTree,
1337
- findNode,
1338
- findNodeAll,
1339
- findPath,
1340
- findPathAll,
1341
- forEachTree,
1342
- getActualWidthOfChars,
1343
- getBoundingClientRect,
1344
- getPopupContainer,
1345
- getRawRoute,
1346
- getSlot,
1347
- getViewportOffset,
1348
- hackCss,
1349
- hasClass,
1350
- highlightHtml,
1351
- is,
1352
- isBrowser,
1353
- isChineseText,
1354
- isChrome,
1355
- isClient,
1356
- isIterableArray,
1357
- isMatch,
1358
- isObject,
1359
- isPositiveInteger,
1360
- isSafari,
1361
- isServer,
1362
- isSupportNativeEllipsis,
1363
- isSupportResizeObserver,
1364
- isUrl,
1365
- loadScript,
1366
- matcher,
1367
- openWindow,
1368
- regexpMap,
1369
- removeClass,
1370
- removeResizeListener,
1371
- setCssVar,
1372
- setObjToUrlParams,
1373
- treeMap,
1374
- treeMapEach,
1375
- triggerWindowResize,
1376
- unloadScript,
1377
- unsetAllProperty,
1378
- urlToBase64,
1379
- useRafThrottle,
1380
- withInstall
1381
- });
1
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function o(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}function a(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function u(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function c(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function s(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,u;try{for(n=n.call(e);!(i=(a=n.next()).done);i=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){o=true;u=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw u}}return r}function f(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){a(e,t,n[t])})}return e}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{h(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function v(e,t){if(e==null)return{};var n=y(e,t);var r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++){r=o[i];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function y(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var i,o;for(o=0;o<r.length;o++){i=r[o];if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function g(e,n){return t(e)||s(e,n)||b(e,n)||f()}function m(e){return n(e)||c(e)||b(e)||d()}function w(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function b(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}var _=Object.create;var S=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var C=function(e,t){return function(){return e&&(t=e(e=0)),t}};var O=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}},A=function(e,t){for(var n in t)S(e,n,{get:t[n],enumerable:!0})},D=function(e,t,n,r){var i=true,o=false,a=undefined;if(t&&(typeof t==="undefined"?"undefined":w(t))=="object"||typeof t=="function")try{var u=function(){var i=s.value;!E.call(e,i)&&i!==n&&S(e,i,{get:function(){return t[i]},enumerable:!(r=x(t,i))||r.enumerable})};for(var c=B(t)[Symbol.iterator](),s;!(i=(s=c.next()).done);i=true)u()}catch(e){o=true;a=e}finally{try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}}return e};var z=function(e,t,n){return n=e!=null?_(k(e)):{},D(t||!e||!e.__esModule?S(n,"default",{value:e,enumerable:!0}):n,e)},R=function(e){return D(S({},"__esModule",{value:!0}),e)};var L=C(function(){});var P=O(function(e,t){L();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r():typeof define=="function"&&define.amd?define([],r):n.CryptoJS=r()})(e,function(){var e=e||function(e,t){var n;if((typeof window==="undefined"?"undefined":w(window))<"u"&&window.crypto&&(n=window.crypto),(typeof self==="undefined"?"undefined":w(self))<"u"&&self.crypto&&(n=self.crypto),(typeof globalThis==="undefined"?"undefined":w(globalThis))<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&(typeof window==="undefined"?"undefined":w(window))<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&(typeof global==="undefined"?"undefined":w(global))<"u"&&global.crypto&&(n=global.crypto),!n&&typeof require=="function")try{n=require("crypto")}catch(e){}var r=function e(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},u=a.Base=function(){return{extend:function e(e){var t=i(this);return e&&t.mixIn(e),(!t.hasOwnProperty("init")||this.init===t.init)&&(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function e(){var e=this.extend();return e.init.apply(e,arguments),e},init:function e(){},mixIn:function e(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function e(){return this.init.prototype.extend(this)}}}(),c=a.WordArray=u.extend({init:function e(e,n){e=this.words=e||[],n!=t?this.sigBytes=n:this.sigBytes=e.length*4},toString:function e(e){return(e||f).stringify(this)},concat:function e(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var u=0;u<i;u+=4)t[r+u>>>2]=n[u>>>2];return this.sigBytes+=i,this},clamp:function t(){var t=this.words,n=this.sigBytes;t[n>>>2]&=0xffffffff<<32-n%4*8,t.length=e.ceil(n/4)},clone:function e(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function e(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new c.init(t,e)}}),s=o.enc={},f=s.Hex={stringify:function e(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((o&15).toString(16))}return r.join("")},parse:function e(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},d=s.Latin1={stringify:function e(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function e(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new c.init(n,t)}},l=s.Utf8={stringify:function e(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function e(e){return d.parse(unescape(encodeURIComponent(e)))}},h=a.BufferedBlockAlgorithm=u.extend({reset:function e(){this._data=new c.init,this._nDataBytes=0},_append:function e(e){typeof e=="string"&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function t(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,u=a*4,s=o/u;t?s=e.ceil(s):s=e.max((s|0)-this._minBufferSize,0);var f=s*a,d=e.min(f*4,o);if(f){for(var l=0;l<f;l+=a)this._doProcessBlock(i,l);n=i.splice(0,f),r.sigBytes-=d}return new c.init(n,d)},clone:function e(){var e=u.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=a.Hasher=h.extend({cfg:u.extend(),init:function e(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function e(){h.reset.call(this),this._doReset()},update:function e(e){return this._append(e),this._process(),this},finalize:function e(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:512/32,_createHelper:function e(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function e(e){return function(t,n){return new v.HMAC.init(e,n).finalize(t)}}}),v=o.algo={};return o}(Math);return e})});var M=O(function(e,t){L();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=t.enc,o=i.Base64={stringify:function e(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var a=t[o>>>2]>>>24-o%4*8&255,u=t[o+1>>>2]>>>24-(o+1)%4*8&255,c=t[o+2>>>2]>>>24-(o+2)%4*8&255,s=a<<16|u<<8|c,f=0;f<4&&o+f*.75<n;f++)i.push(r.charAt(s>>>6*(3-f)&63));var d=r.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function e(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i<n.length;i++)r[n.charCodeAt(i)]=i}var o=n.charAt(64);if(o){var u=e.indexOf(o);u!==-1&&(t=u)}return a(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function a(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var u=n[e.charCodeAt(a-1)]<<a%4*2,c=n[e.charCodeAt(a)]>>>6-a%4*2,s=u|c;i[o>>>2]|=s<<24-o%4*8,o++}return r.create(i,o)}}(),e.enc.Base64})});var j=O(function(e,t){L();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.algo,u=[];(function(){for(var e=0;e<64;e++)u[e]=t.abs(t.sin(e+1))*0x100000000|0})();var c=a.MD5=o.extend({_doReset:function e(){this._hash=new i.init([0x67452301,0xefcdab89,0x98badcfe,0x10325476])},_doProcessBlock:function e(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&0xff00ff|(i<<24|i>>>8)&0xff00ff00}var o=this._hash.words,a=e[t+0],c=e[t+1],h=e[t+2],p=e[t+3],v=e[t+4],y=e[t+5],g=e[t+6],m=e[t+7],w=e[t+8],b=e[t+9],_=e[t+10],S=e[t+11],x=e[t+12],B=e[t+13],k=e[t+14],E=e[t+15],C=o[0],O=o[1],A=o[2],D=o[3];C=s(C,O,A,D,a,7,u[0]),D=s(D,C,O,A,c,12,u[1]),A=s(A,D,C,O,h,17,u[2]),O=s(O,A,D,C,p,22,u[3]),C=s(C,O,A,D,v,7,u[4]),D=s(D,C,O,A,y,12,u[5]),A=s(A,D,C,O,g,17,u[6]),O=s(O,A,D,C,m,22,u[7]),C=s(C,O,A,D,w,7,u[8]),D=s(D,C,O,A,b,12,u[9]),A=s(A,D,C,O,_,17,u[10]),O=s(O,A,D,C,S,22,u[11]),C=s(C,O,A,D,x,7,u[12]),D=s(D,C,O,A,B,12,u[13]),A=s(A,D,C,O,k,17,u[14]),O=s(O,A,D,C,E,22,u[15]),C=f(C,O,A,D,c,5,u[16]),D=f(D,C,O,A,g,9,u[17]),A=f(A,D,C,O,S,14,u[18]),O=f(O,A,D,C,a,20,u[19]),C=f(C,O,A,D,y,5,u[20]),D=f(D,C,O,A,_,9,u[21]),A=f(A,D,C,O,E,14,u[22]),O=f(O,A,D,C,v,20,u[23]),C=f(C,O,A,D,b,5,u[24]),D=f(D,C,O,A,k,9,u[25]),A=f(A,D,C,O,p,14,u[26]),O=f(O,A,D,C,w,20,u[27]),C=f(C,O,A,D,B,5,u[28]),D=f(D,C,O,A,h,9,u[29]),A=f(A,D,C,O,m,14,u[30]),O=f(O,A,D,C,x,20,u[31]),C=d(C,O,A,D,y,4,u[32]),D=d(D,C,O,A,w,11,u[33]),A=d(A,D,C,O,S,16,u[34]),O=d(O,A,D,C,k,23,u[35]),C=d(C,O,A,D,c,4,u[36]),D=d(D,C,O,A,v,11,u[37]),A=d(A,D,C,O,m,16,u[38]),O=d(O,A,D,C,_,23,u[39]),C=d(C,O,A,D,B,4,u[40]),D=d(D,C,O,A,a,11,u[41]),A=d(A,D,C,O,p,16,u[42]),O=d(O,A,D,C,g,23,u[43]),C=d(C,O,A,D,b,4,u[44]),D=d(D,C,O,A,x,11,u[45]),A=d(A,D,C,O,E,16,u[46]),O=d(O,A,D,C,h,23,u[47]),C=l(C,O,A,D,a,6,u[48]),D=l(D,C,O,A,m,10,u[49]),A=l(A,D,C,O,k,15,u[50]),O=l(O,A,D,C,y,21,u[51]),C=l(C,O,A,D,x,6,u[52]),D=l(D,C,O,A,p,10,u[53]),A=l(A,D,C,O,_,15,u[54]),O=l(O,A,D,C,c,21,u[55]),C=l(C,O,A,D,w,6,u[56]),D=l(D,C,O,A,E,10,u[57]),A=l(A,D,C,O,g,15,u[58]),O=l(O,A,D,C,B,21,u[59]),C=l(C,O,A,D,v,6,u[60]),D=l(D,C,O,A,S,10,u[61]),A=l(A,D,C,O,h,15,u[62]),O=l(O,A,D,C,b,21,u[63]),o[0]=o[0]+C|0,o[1]=o[1]+O|0,o[2]=o[2]+A|0,o[3]=o[3]+D|0},_doFinalize:function e(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/0x100000000),a=r;n[(i+64>>>9<<4)+15]=(o<<8|o>>>24)&0xff00ff|(o<<24|o>>>8)&0xff00ff00,n[(i+64>>>9<<4)+14]=(a<<8|a>>>24)&0xff00ff|(a<<24|a>>>8)&0xff00ff00,e.sigBytes=(n.length+1)*4,this._process();for(var u=this._hash,c=u.words,s=0;s<4;s++){var f=c[s];c[s]=(f<<8|f>>>24)&0xff00ff|(f<<24|f>>>8)&0xff00ff00}return u},clone:function e(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function s(e,t,n,r,i,o,a){var u=e+(t&n|~t&r)+i+a;return(u<<o|u>>>32-o)+t}function f(e,t,n,r,i,o,a){var u=e+(t&r|n&~r)+i+a;return(u<<o|u>>>32-o)+t}function d(e,t,n,r,i,o,a){var u=e+(t^n^r)+i+a;return(u<<o|u>>>32-o)+t}function l(e,t,n,r,i,o,a){var u=e+(n^(t|~r))+i+a;return(u<<o|u>>>32-o)+t}n.MD5=o._createHelper(c),n.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5})});var I=O(function(e,t){L();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,o=t.algo,a=[],u=o.SHA1=i.extend({_doReset:function e(){this._hash=new r.init([0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0])},_doProcessBlock:function e(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],u=n[3],c=n[4],s=0;s<80;s++){if(s<16)a[s]=e[t+s]|0;else{var f=a[s-3]^a[s-8]^a[s-14]^a[s-16];a[s]=f<<1|f>>>31}var d=(r<<5|r>>>27)+c+a[s];s<20?d+=(i&o|~i&u)+0x5a827999:s<40?d+=(i^o^u)+0x6ed9eba1:s<60?d+=(i&o|i&u|o&u)-0x70e44324:d+=(i^o^u)-0x359d3e2a,c=u,u=o,o=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+u|0,n[4]=n[4]+c|0},_doFinalize:function e(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/0x100000000),t[(r+64>>>9<<4)+15]=n,e.sigBytes=t.length*4,this._process(),this._hash},clone:function e(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(u),t.HmacSHA1=i._createHmacHelper(u)}(),e.SHA1})});var F=O(function(e,t){L();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){(function(){var t=e,n=t.lib,r=n.Base,i=t.enc,o=i.Utf8,a=t.algo,u=a.HMAC=r.extend({init:function e(e,t){e=this._hasher=new e.init,typeof t=="string"&&(t=o.parse(t));var n=e.blockSize,r=n*4;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),u=i.words,c=a.words,s=0;s<n;s++)u[s]^=0x5c5c5c5c,c[s]^=0x36363636;i.sigBytes=a.sigBytes=r,this.reset()},reset:function e(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function e(e){return this._hasher.update(e),this},finalize:function e(e){var t=this._hasher,n=t.finalize(e);t.reset();var r=t.finalize(this._oKey.clone().concat(n));return r}})})()})});var T=O(function(e,t){L();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P(),I(),F()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],r):r(n.CryptoJS)})(e,function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,o=t.algo,a=o.MD5,u=o.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:a,iterations:1}),init:function e(e){this.cfg=this.cfg.extend(e)},compute:function e(e,t){for(var n,r=this.cfg,o=r.hasher.create(),a=i.create(),u=a.words,c=r.keySize,s=r.iterations;u.length<c;){n&&o.update(n),n=o.update(e).finalize(t),o.reset();for(var f=1;f<s;f++)n=o.finalize(n),o.reset();a.concat(n)}return a.sigBytes=c*4,a}});t.EvpKDF=function(e,t,n){return u.create(n).compute(e,t)}}(),e.EvpKDF})});var U=O(function(e,t){L();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P(),T()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],r):r(n.CryptoJS)})(e,function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,o=r.WordArray,a=r.BufferedBlockAlgorithm,u=n.enc,c=u.Utf8,s=u.Base64,f=n.algo,d=f.EvpKDF,l=r.Cipher=a.extend({cfg:i.extend(),createEncryptor:function e(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function e(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function e(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function e(){a.reset.call(this),this._doReset()},process:function e(e){return this._append(e),this._process()},finalize:function e(e){e&&this._append(e);var t=this._doFinalize();return t},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return typeof e=="string"?E:x}return function(t){return{encrypt:function n(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function n(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()}),h=r.StreamCipher=l.extend({_doFinalize:function e(){var e=this._process(!0);return e},blockSize:1}),p=n.mode={},v=r.BlockCipherMode=i.extend({createEncryptor:function e(e,t){return this.Encryptor.create(e,t)},createDecryptor:function e(e,t){return this.Decryptor.create(e,t)},init:function e(e,t){this._cipher=e,this._iv=t}}),y=p.CBC=function(){var e=v.extend();e.Encryptor=e.extend({processBlock:function e(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function e(e,t){var r=this._cipher,i=r.blockSize,o=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=o}});function n(e,n,r){var i,o=this._iv;o?(i=o,this._iv=t):i=this._prevBlock;for(var a=0;a<r;a++)e[n+a]^=i[a]}return e}(),g=n.pad={},m=g.Pkcs7={pad:function e(e,t){for(var n=t*4,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,a=[],u=0;u<r;u+=4)a.push(i);var c=o.create(a,r);e.concat(c)},unpad:function e(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},w=r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:y,padding:m}),reset:function e(){var e;l.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function e(e,t){this._mode.processBlock(e,t)},_doFinalize:function e(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:128/32}),b=r.CipherParams=i.extend({init:function e(e){this.mixIn(e)},toString:function e(e){return(e||this.formatter).stringify(this)}}),_=n.format={},S=_.OpenSSL={stringify:function e(e){var t,n=e.ciphertext,r=e.salt;return r?t=o.create([0x53616c74,0x65645f5f]).concat(r).concat(n):t=n,t.toString(s)},parse:function e(e){var t,n=s.parse(e),r=n.words;return r[0]==0x53616c74&&r[1]==0x65645f5f&&(t=o.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),b.create({ciphertext:n,salt:t})}},x=r.SerializableCipher=i.extend({cfg:i.extend({format:S}),encrypt:function e(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),a=i.cfg;return b.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function e(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=e.createDecryptor(n,r).finalize(t.ciphertext);return i},_parse:function e(e,t){return typeof e=="string"?t.parse(e,this):e}}),B=n.kdf={},k=B.OpenSSL={execute:function e(e,t,n,r,i){if(r||(r=o.random(64/8)),i)var a=d.create({keySize:t+n,hasher:i}).compute(e,r);else var a=d.create({keySize:t+n}).compute(e,r);var u=o.create(a.words.slice(t),n*4);return a.sigBytes=t*4,b.create({key:a,iv:u,salt:r})}},E=r.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:k}),encrypt:function e(e,t,n,r){r=this.cfg.extend(r);var i=r.kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=i.iv;var o=x.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function e(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);r.iv=i.iv;var o=x.decrypt.call(this,e,t,i.key,r);return o}})}()})});var H=O(function(e,t){L();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P(),M(),j(),T(),U()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],r):r(n.CryptoJS)})(e,function(e){return function(){var t=e,n=t.lib,r=n.BlockCipher,i=t.algo,o=[],a=[],u=[],c=[],s=[],f=[],d=[],l=[],h=[],p=[];(function(){for(var e=[],t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var n=0,r=0,t=0;t<256;t++){var i=r^r<<1^r<<2^r<<3^r<<4;i=i>>>8^i&255^99,o[n]=i,a[i]=n;var v=e[n],y=e[v],g=e[y],m=e[i]*257^i*0x1010100;u[n]=m<<24|m>>>8,c[n]=m<<16|m>>>16,s[n]=m<<8|m>>>24,f[n]=m;var m=g*0x1010101^y*65537^v*257^n*0x1010100;d[i]=m<<24|m>>>8,l[i]=m<<16|m>>>16,h[i]=m<<8|m>>>24,p[i]=m,n?(n=v^e[e[e[g^v]]],r^=e[e[r]]):n=r=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],y=i.AES=r.extend({_doReset:function e(){var e;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var t=this._keyPriorReset=this._key,n=t.words,r=t.sigBytes/4,i=this._nRounds=r+6,a=(i+1)*4,u=this._keySchedule=[],c=0;c<a;c++)c<r?u[c]=n[c]:(e=u[c-1],c%r?r>6&&c%r==4&&(e=o[e>>>24]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[e&255]):(e=e<<8|e>>>24,e=o[e>>>24]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[e&255],e^=v[c/r|0]<<24),u[c]=u[c-r]^e);for(var s=this._invKeySchedule=[],f=0;f<a;f++){var c=a-f;if(f%4)var e=u[c];else var e=u[c-4];f<4||c<=4?s[f]=e:s[f]=d[o[e>>>24]]^l[o[e>>>16&255]]^h[o[e>>>8&255]]^p[o[e&255]]}}},encryptBlock:function e(e,t){this._doCryptBlock(e,t,this._keySchedule,u,c,s,f,o)},decryptBlock:function e(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,d,l,h,p,a);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function e(e,t,n,r,i,o,a,u){for(var c=this._nRounds,s=e[t]^n[0],f=e[t+1]^n[1],d=e[t+2]^n[2],l=e[t+3]^n[3],h=4,p=1;p<c;p++){var v=r[s>>>24]^i[f>>>16&255]^o[d>>>8&255]^a[l&255]^n[h++],y=r[f>>>24]^i[d>>>16&255]^o[l>>>8&255]^a[s&255]^n[h++],g=r[d>>>24]^i[l>>>16&255]^o[s>>>8&255]^a[f&255]^n[h++],m=r[l>>>24]^i[s>>>16&255]^o[f>>>8&255]^a[d&255]^n[h++];s=v,f=y,d=g,l=m}var v=(u[s>>>24]<<24|u[f>>>16&255]<<16|u[d>>>8&255]<<8|u[l&255])^n[h++],y=(u[f>>>24]<<24|u[d>>>16&255]<<16|u[l>>>8&255]<<8|u[s&255])^n[h++],g=(u[d>>>24]<<24|u[l>>>16&255]<<16|u[s>>>8&255]<<8|u[f&255])^n[h++],m=(u[l>>>24]<<24|u[s>>>16&255]<<16|u[f>>>8&255]<<8|u[d&255])^n[h++];e[t]=v,e[t+1]=y,e[t+2]=g,e[t+3]=m},keySize:256/32});t.AES=r._createHelper(y)}(),e.AES})});var N=O(function(e,t){L();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){return e.enc.Utf8})});var $=O(function(e,t){L();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P(),U()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],r):r(n.CryptoJS)})(e,function(e){return e.pad.Pkcs7})});var W=O(function(e,t){L();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(P(),U()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],r):r(n.CryptoJS)})(e,function(e){return e.mode.ECB=function(){var t=e.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function e(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function e(e,t){this._cipher.decryptBlock(e,t)}}),t}(),e.mode.ECB})});var J={};A(J,{AesEncryption:function(){return eO},IfActivity:function(){return th},ResizeObserver:function(){return eq.default},addClass:function(){return eT},addLocationListener:function(){return eY},addResizeListener:function(){return eV},buildBEM:function(){return ew},buildShortUUID:function(){return tT},buildUUID:function(){return tI},createBEM:function(){return eb},createNamespace:function(){return e_},createSearchReg:function(){return ey},dataURLtoBlob:function(){return eQ},decodeByBase64:function(){return eD},deepMerge:function(){return ed},domOffEvent:function(){return eW},domOnEvent:function(){return e$},downloadByBase64:function(){return e4},downloadByData:function(){return e5},downloadByOnlineUrl:function(){return e2},downloadByUrl:function(){return e6},downloadPercent:function(){return e1},enableTransitions:function(){return eP},encryptByBase64:function(){return eA},encryptByMd5:function(){return ez},escapeStringRegexp:function(){return t_},extendSlots:function(){return ty},filterTree:function(){return tR},findNode:function(){return tO},findNodeAll:function(){return tA},findPath:function(){return tD},findPathAll:function(){return tz},forEachTree:function(){return tL},getActualWidthOfChars:function(){return eg},getBoundingClientRect:function(){return eM},getPopupContainer:function(){return el},getRawRoute:function(){return es},getSlot:function(){return tv},getViewportOffset:function(){return eH},hackCss:function(){return eN},hasClass:function(){return eI},highlightHtml:function(){return tn},is:function(){return X},isBrowser:function(){return ei},isChineseText:function(){return eu},isChrome:function(){return en},isClient:function(){return et},isIterableArray:function(){return G},isMatch:function(){return tb},isObject:function(){return Z},isPositiveInteger:function(){return Q},isSafari:function(){return er},isServer:function(){return ee},isSupportNativeEllipsis:function(){return eo},isSupportResizeObserver:function(){return ea},isUrl:function(){return Y},loadScript:function(){return tg},matcher:function(){return tw},openWindow:function(){return ef},regexpMap:function(){return K},removeClass:function(){return eU},removeResizeListener:function(){return eX},setCssVar:function(){return eF},setObjToUrlParams:function(){return eh},treeMap:function(){return tP},treeMapEach:function(){return tM},triggerWindowResize:function(){return eZ},unloadScript:function(){return tm},unsetAllProperty:function(){return ep},urlToBase64:function(){return e0},useRafThrottle:function(){return eJ},withInstall:function(){return ec}});module.exports=R(J);L();L();var q=require("lodash-es");L();L();var K={mobile:/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,tel:/^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,numAndLetter:/^[A-Z0-9]+$/i,password:/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,email:/^[A-Z0-9\u4E00-\u9FA5]+@[\w-]+(?:\.[\w-]+)+$/i,postalCode:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,identityCard:/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,ip:/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,url:/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,httpsUrl:/^https:\/\//,domain:/^([0-9a-z-]+\.)+([a-z]{2,})$/i,plateNumber:/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,md5:/^[a-f0-9]{32}$/i,base64:/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,uuid:/^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,version:/^\d+(?:\.\d+){2}$/,videoUrl:/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,imageUrl:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,chinese:/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,itcode:/^[a-z]+\d*$/i};var V=Object.prototype.toString;function X(e,t){return V.call(e)==="[object ".concat(t,"]")}function Z(e){return e!==null&&X(e,"Object")}function Y(e){return K.url.test(e)}function G(e){return Array.isArray(e)&&e.length>0}function Q(e){return Number.isInteger(e)&&e>=0}var ee=(typeof window==="undefined"?"undefined":w(window))>"u",et=!ee,en=et&&window.navigator.userAgent.toLowerCase().includes("chrome"),er=et&&window.navigator.userAgent.toLowerCase().includes("safari"),ei=(typeof window==="undefined"?"undefined":w(window))<"u"&&(typeof document==="undefined"?"undefined":w(document))<"u",eo=ei&&w(document.body.style.lineClamp)<"u",ea=ei&&(typeof ResizeObserver==="undefined"?"undefined":w(ResizeObserver))<"u",eu=function(e){return K.chinese.test(e)};var ec=function(e,t){var n=e;return n.install=function(r){r.component(n.name||n.displayName,e),t&&(r.config.globalProperties[t]=e)},e};function es(e){if(!e)return e;var t=e.matched,n=v(e,["matched"]);return p(l({},n),{matched:t?t.map(function(e){return{meta:e.meta,name:e.name,path:e.path}}):void 0})}function ef(e,t){var n=t||{},r=n.target,i=r===void 0?"__blank":r,o=n.noopener,a=o===void 0?!0:o,u=n.noreferrer,c=u===void 0?!0:u,s=[];a&&s.push("noopener=yes"),c&&s.push("noreferrer=yes"),window.open(e,i,s.join(","))}function ed(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"replace";return t?e?(0,q.mergeWith)(e,t,function(e,t){if((0,q.isArray)(t)&&(0,q.isArray)(e))switch(n){case"union":return(0,q.unionWith)(e,t,q.isEqual);case"intersection":return(0,q.intersectionWith)(e,t,q.isEqual);case"concat":return e.concat(t);case"replace":return t;default:throw new Error("Unknown merge array strategy: ".concat(n))}if(Z(t)&&Z(e))return ed(e,t,n)}):t:e}function el(e){var t;return(t=e===null||e===void 0?void 0:e.parentNode)!==null&&t!==void 0?t:document.body}function eh(e,t){if(!G(Object.keys(t)))return e;var n="";for(var r in t)n+="".concat(r,"=").concat(encodeURIComponent(t[r]),"&");return n=n.replace(/&$/,""),/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n}function ep(e){(0,q.isPlainObject)(e)&&Object.keys(e).forEach(function(t){Reflect.deleteProperty(e,t)})}function ev(e){return["$","(",")","*","+",".","[","]","?","\\","^","{","}","|"].includes(e)?"\\".concat(e):e}function ey(e){var t=[""].concat(m(m(e).map(function(e){return ev(e)})),[""]).join(".*");return new RegExp(t,"i")}function eg(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=t.size,r=n===void 0?14:n,i=t.family,o=i===void 0?getComputedStyle(document.documentElement).getPropertyValue("--vxe-font-family")||"sans-serif":i,a=document.createElement("canvas").getContext("2d");a.font="".concat(r,"px ").concat(o);var u=a.measureText(e),c=Math.abs(u.actualBoundingBoxLeft)+Math.abs(u.actualBoundingBoxRight);return Math.ceil(Math.max(u.width,c))}L();function em(e,t){return t?typeof t=="string"?" ".concat(e,"--").concat(t):Array.isArray(t)?t.reduce(function(t,n){return t+em(e,n)},""):Object.keys(t).reduce(function(n,r){return n+(t[r]?em(e,r):"")},""):""}function ew(e){return function(t,n){return t&&typeof t!="string"&&(n=t,t=""),t=t?"".concat(e,"__").concat(t):e,"".concat(t).concat(em(t,n))}}function eb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"gsc";return[ew("".concat(t,"-").concat(e))]}function e_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"gsc";var n="".concat(t,"-").concat(e);return[n,ew(n)]}L();var eS=z(H(),1),ex=z(N(),1),eB=z($(),1),ek=z(W(),1),eE=z(j(),1),eC=z(M(),1),eO=/*#__PURE__*/function(){"use strict";function e(t){r(this,e);var n=t.key,i=t.iv;n&&(this.key=(0,ex.parse)(n)),i&&(this.iv=(0,ex.parse)(i))}o(e,[{key:"getOptions",get:function e(){return{mode:ek.default,padding:eB.default,iv:this.iv}}},{key:"encryptByAES",value:function e(e){return(0,eS.encrypt)(e,this.key,this.getOptions).toString()}},{key:"decryptByAES",value:function e(e){return(0,eS.decrypt)(e,this.key,this.getOptions).toString(ex.default)}}]);return e}();function eA(e){return ex.default.parse(e).toString(eC.default)}function eD(e){return eC.default.parse(e).toString(ex.default)}function ez(e){return(0,eE.default)(e).toString()}L();var eR=require("lodash-es"),eL=function(){return document.documentElement},eP=function(){return"startViewTransition"in document&&window.matchMedia("(prefers-reduced-motion: no-preference)").matches};function eM(e){return!e||!e.getBoundingClientRect?0:e.getBoundingClientRect()}function ej(e){return(e||"").replace(/^\s+|\s+$/g,"")}function eI(e,t){if(!e||!t)return!1;if(t.includes(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):" ".concat(e.className," ").includes(" ".concat(t," "))}function eF(e,t,n){n||(n=eL()),n.style.setProperty(e,t)}function eT(e,t){if(!e)return;var n=e.className,r=(t||"").split(" ");for(var i=0,o=r.length;i<o;i++){var a=r[i];a&&(e.classList?e.classList.add(a):eI(e,a)||(n+=" ".concat(a)))}e.classList||(e.className=n)}function eU(e,t){if(!e||!t)return;var n=t.split(" "),r=" ".concat(e.className," ");for(var i=0,o=n.length;i<o;i++){var a=n[i];a&&(e.classList?e.classList.remove(a):eI(e,a)&&(r=r.replace(" ".concat(a," ")," ")))}e.classList||(e.className=ej(r))}function eH(e){var t=document.documentElement,n=t.scrollLeft,r=t.scrollTop,i=t.clientLeft,o=t.clientTop,a=window.scrollX,u=window.scrollY,c=eM(e),s=c.left,f=c.top,d=c.width,l=c.height,h=(a||n)-(i||0),p=(u||r)-(o||0),v=s+a,y=f+u,g=v-h,m=y-p,w=window.document.documentElement.clientWidth,b=window.document.documentElement.clientHeight;return{left:g,top:m,right:w-d-g,bottom:b-l-m,rightIncludeBody:w-g,bottomIncludeBody:b-m}}function eN(e,t){var n=["webkit","Moz","ms","OT"],r={};return n.forEach(function(n){r["".concat(n).concat((0,eR.upperFirst)(e))]=t}),p(l({},r),a({},e,t))}function e$(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}function eW(e,t,n){e&&t&&n&&e.removeEventListener(t,n,!1)}function eJ(e){var t=!1;return function(){var n=this;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++){i[o]=arguments[o]}t||(t=!0,window.requestAnimationFrame(function(){e.apply(n,i),t=!1}))}}L();var eq=z(require("resize-observer-polyfill"),1);function eK(e){var t=true,n=false,r=undefined;try{for(var i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;var u=a.target.__resizeListeners__||[];u.length&&u.forEach(function(e){e()})}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}}function eV(e,t){ee||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new eq.default(eK),e.__ro__.observe(e)),e.__resizeListeners__.push(t))}function eX(e,t){!e||!e.__resizeListeners__||(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.__ro__.disconnect(),e.__ro__=null,e.__resizeListeners__=null))}function eZ(){var e=new Event("resize",{bubbles:!0,cancelable:!0});window.dispatchEvent(e)}function eY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};function n(e){var t=window.history[e];return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++){r[i]=arguments[i]}var o=new Event(e);return o.arguments=r,window.dispatchEvent(o),t.apply(this,r)}}return window.history.pushState=n("pushState"),window.history.replaceState=n("replaceState"),window.addEventListener("popstate",e,t),window.addEventListener("hashchange",e,t),window.addEventListener("replaceState",e,t),window.addEventListener("pushState",e,t),{removeListener:function(){window.removeEventListener("popstate",e,t),window.removeEventListener("hashchange",e,t),window.removeEventListener("replaceState",e,t),window.removeEventListener("pushState",e,t)}}}L();var eG=require("lodash-es");function eQ(e){var t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=window.atob(t[1]),i=r.length,o=new Uint8Array(i);for(;i--;)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}function e0(e,t){return new Promise(function(n,r){var i=document.createElement("CANVAS"),o=i.getContext("2d"),a=new Image;a.crossOrigin="",a.onload=function(){if(!i||!o)return r();i.height=a.height,i.width=a.width,o.drawImage(a,0,0);var e=i.toDataURL(t||"image/png");i=null,n(e)},a.src=e})}function e1(e){var t=e.loaded,n=e.total;if(n<=0||(0,eG.isNil)(n))return 0;var r=t/n;return(0,eG.round)((r>1?1:r)*100)}function e2(e,t,n,r){e0(e).then(function(e){e4(e,t,n,r)})}function e4(e,t,n,r){var i=eQ(e);e5(i,t,n,r)}function e5(e,t,n,r){var i=(typeof r==="undefined"?"undefined":w(r))<"u"?[r,e]:[e],o=new Blob(i,{type:n||"application/octet-stream"});if(w(window.navigator.msSaveBlob)<"u")window.navigator.msSaveBlob(o,t);else{var a=window.URL.createObjectURL(o),u=document.createElement("a");u.style.display="none",u.href=a,u.setAttribute("download",t),w(u.download)>"u"&&u.setAttribute("target","_blank"),document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(a)}}function e6(e){var t=e.url,n=e.target,r=n===void 0?"_blank":n,i=e.fileName;if(/iP/.test(window.navigator.userAgent))return!1;if(en||er){var o=document.createElement("a");return o.href=t,o.download=i||t.substring(t.lastIndexOf("/")+1,t.length),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),!0}return t.includes("?")||(t+="?download"),ef(t,{target:r}),!0}L();var e8=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"ig";var r=new RegExp(t,n);return m(e.matchAll(r)).map(function(e){return{index:e.index,subString:e[0]}})};function e3(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}var e9=function(e,t){var n=e;if(!t)return n;var r=t.tagName,i=r===void 0?"mark":r,o=t.bgColor,a=t.color,u=t.style,c=u===void 0?{}:u,s=t.renderHighlightKeyword;if(typeof s=="function")return s(e);c.backgroundColor=o,c.color=a;var f='style="'.concat(Object.keys(c).map(function(e){return"".concat(e3(e),":").concat(c[e])}).join(";"),'"');return"<".concat(i," ").concat(f,">").concat(n,"</").concat(i,">")},e7=function(e,t){var n="";return t.forEach(function(t){var r=t.start,i=t.end,o=t.option,a=e.slice(r,i),u=e9(a,o);n+=u,t.subString=u}),n},te=function(e,t){var n=[];return t.forEach(function(t){var r={keyword:""};typeof t=="string"?r={keyword:t}:r=t;var i=r.keyword,o=r.caseSensitive,a=o===void 0?!0:o,u=e8(e,i,a?"g":"gi"),c={keyword:i,indexList:u,option:r};n.push(c)}),n},tt=function(e,t){var n=te(e,t),r=[],i=function(e,t){for(var n=0;n<r.length;n++){var i=r[n];if(e>i.start&&e<i.end||e+t>i.start&&e+t<i.end||i.start>e&&i.start<e+t||i.end>e&&i.end<e+t||e===i.start&&e+t===i.end)return-1;if(e+t<=i.start)return n}return r.length};n.forEach(function(e){var t=e.indexList,n=e.option;t.forEach(function(e){var t=e.index,o=e.subString,a={start:t,end:t+o.length,option:n},u=i(t,o.length);u!==-1&&r.splice(u,0,a)})});var o=[];return r.forEach(function(t,n){var i=t.start,a=t.end,u=r[n+1];n===0&&i>0&&o.push({start:0,end:i,subString:e.slice(0,i)}),o.push(p(l({},t),{subString:e.slice(i,a)})),(u===null||u===void 0?void 0:u.start)>a&&o.push({start:a,end:u.start,subString:e.slice(a,u.start)}),n===r.length-1&&a<e.length-1&&o.push({start:a,end:e.length-1,subString:e.slice(a,e.length)})}),o},tn=function(e,t){var n=tt(e,t);return{highText:e7(e,n),highList:n}};L();var tr=require("worker-timers"),ti="active",to="idle",ta="hidden",tu,tc,ts,tf={},td={attach:function e(e,t){tf[e]||(tf[e]=[]),tf[e].push(t)},fire:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];tf[e]&&tf[e].forEach(function(e){e.apply(void 0,m(t))})},remove:function e(e,t){t||Reflect.deleteProperty(tf,e),tf[e]&&(tf[e]=tf[e].filter(function(e){return t!==e}))},dom:function e(e,t,n){return ts||(e.addEventListener?ts=function(e,t,n){return e.addEventListener(t,n,!1)}:typeof e.attachEvent=="function"?ts=function(e,t,n){return e.attachEvent("on".concat(t),n,!1)}:ts=function(e,t,n){return e["on".concat(t)]=n}),ts(e,t,n)}},tl=/*#__PURE__*/function(){"use strict";function e(t,n,i){var o=this;r(this,e);this.activity=t,this.seconds=n,this.callback=i,this.stopped=!1,this.start(),this.activity.on("statusChanged",function(e){o.stopped===!1&&(e.status===ti?o.start():o.pause())})}o(e,[{key:"start",value:function e(){this.stopped=!1,(0,tr.clearInterval)(this.token),this.token=(0,tr.setInterval)(this.callback,this.seconds*1e3)}},{key:"stop",value:function e(){this.stopped=!0,(0,tr.clearInterval)(this.token)}},{key:"resume",value:function e(){this.start()}},{key:"pause",value:function e(){this.stop()}}]);return e}(),th=/*#__PURE__*/function(){"use strict";function e(){var t=this;r(this,e);if(this.status=ti,this.timers=[],this.idleTime=3e4,this.isLegacyModeOn=!1,document.hidden!==void 0?(tu="hidden",tc="visibilitychange"):document.mozHidden!==void 0?(tu="mozHidden",tc="mozvisibilitychange"):document.msHidden!==void 0?(tu="msHidden",tc="msvisibilitychange"):document.webkitHidden!==void 0&&(tu="webkitHidden",tc="webkitvisibilitychange"),tu===void 0)this.legacyMode();else{var n=function(){document[tu]?t.blur():t.focus()};n(),td.dom(document,tc,n)}this.startIdleTimer(),this.trackIdleStatus()}o(e,[{key:"legacyMode",value:function e(){var e=this;this.isLegacyModeOn||(td.dom(window,"blur",function(){return e.blur()}),td.dom(window,"focus",function(){return e.focus()}),this.isLegacyModeOn=!0)}},{key:"startIdleTimer",value:function e(e){var t=this;u(e,MouseEvent)&&e.movementX===0&&e.movementY===0||(this.timers.map(tr.clearTimeout),this.timers.length=0,this.status===to&&this.wakeUp(),this.idleStartedTime=+new Date,this.timers.push((0,tr.setTimeout)(function(){if(t.status===ti||t.status===ta)return t.idle()},this.idleTime)))}},{key:"trackIdleStatus",value:function e(){td.dom(document,"mousemove",this.startIdleTimer.bind(this)),td.dom(document,"mousedown",this.startIdleTimer.bind(this)),td.dom(document,"keyup",this.startIdleTimer.bind(this)),td.dom(document,"touchstart",this.startIdleTimer.bind(this)),td.dom(window,"scroll",this.startIdleTimer.bind(this)),this.focus(this.startIdleTimer.bind(this))}},{key:"on",value:function e(e,t){return td.attach(e,t),this}},{key:"off",value:function e(e,t){return td.remove(e,t),this}},{key:"setIdleDuration",value:function e(e){return this.idleTime=e*1e3,this.startIdleTimer(),this}},{key:"getIdleDuration",value:function e(){return this.idleTime}},{key:"getIdleInfo",value:function e(){var e=+new Date,t;if(this.status===to)t={isIdle:!0,idleFor:e-this.idleStartedTime,timeLeft:0,timeLeftPer:100};else{var n=this.idleStartedTime+this.idleTime-e;t={isIdle:!1,idleFor:e-this.idleStartedTime,timeLeft:n,timeLeftPer:Number.parseFloat((100-n*100/this.idleTime).toFixed(2))}}return t}},{key:"idle",value:function e(e){return e?this.on("idle",e):(this.status=to,td.fire("idle"),td.fire("statusChanged",[{status:this.status}])),this}},{key:"blur",value:function e(e){return e?this.on("blur",e):(this.status=ta,td.fire("blur"),td.fire("statusChanged",[{status:this.status}])),this}},{key:"focus",value:function e(e){return e?this.on("focus",e):this.status!==ti&&(this.status=ti,td.fire("focus"),td.fire("wakeUp"),td.fire("statusChanged",[{status:this.status}])),this}},{key:"wakeUp",value:function e(e){return e?this.on("wakeUp",e):this.status!==ti&&(this.status=ti,td.fire("wakeUp"),td.fire("statusChanged",[{status:this.status}])),this}},{key:"onEvery",value:function e(e,t){return new tl(this,e,t)}},{key:"now",value:function e(e){return e!==void 0?this.status===e:this.status===ti}}]);return e}();L();var tp=require("lodash-es");function tv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0;if(!e||!Reflect.has(e,t)||!(0,tp.isFunction)(e[t]))return null;var r=e[t];return r?r(n):null}function ty(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];var n=Object.keys(e),r={};return n.forEach(function(n){if(t.includes(n))return null;r[n]=function(t){return tv(e,n,t)}}),r}L();function tg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.type,r=n===void 0?"text/javascript":n;return new Promise(function(t,n){var i=!1,o=document.querySelector('script[src="'.concat(e,'"]'));if(!o)o=document.createElement("script"),o.type=r,o.async=!0,o.src=e,i=!0;else if(o.hasAttribute("data-loaded")){t({el:o});return}o.addEventListener("error",n),o.addEventListener("abort",n),o.addEventListener("load",function(){o.setAttribute("data-loaded",!0),t({el:o})}),i&&document.head.appendChild(o)})}function tm(e){return new Promise(function(t,n){var r=document.querySelector('script[src="'.concat(e,'"]'));if(!r){n();return}document.head.removeChild(r),t()})}L();function tw(e,t,n){return tk(e,t,n,!1)}function tb(e,t,n){return tk(e,t,n,!0).length>0}function t_(e){return typeof e!="string"?e:e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var tS=new Map;function tx(e,t){if(!Array.isArray(e))switch(typeof e==="undefined"?"undefined":w(e)){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError("Expected '".concat(t,"' to be a string or an array, but got a type of '").concat(typeof e==="undefined"?"undefined":w(e),"'"))}return e.filter(function(e){if(typeof e!="string"){if((typeof e==="undefined"?"undefined":w(e))>"u")return!1;throw new TypeError("Expected '".concat(t,"' to be an array of strings, but found a type of '").concat(typeof e==="undefined"?"undefined":w(e),"' in the array"))}return!0})}function tB(e,t){t=l({caseSensitive:!1},t);var n=e+JSON.stringify(t);if(tS.has(n))return tS.get(n);var r=e[0]==="!";r&&(e=e.slice(1)),e=t_(e).replace(/\\\*/g,"[\\s\\S]*");var i=new RegExp("^".concat(e,"$"),t.caseSensitive?"":"i");return i.negated=r,tS.set(n,i),i}function tk(e,t,n,r){if(e=tx(e,"inputs"),t=tx(t,"patterns"),t.length===0)return[];t=t.map(function(e){return tB(e,n)});var i=n||{},o=i.allPatterns,a=[];var u=true,c=false,s=undefined;try{for(var f=e[Symbol.iterator](),d;!(u=(d=f.next()).done);u=true){var l=d.value;var h=void 0,p=m(t).fill(!1);var v=true,y=false,w=undefined;try{for(var b=t.entries()[Symbol.iterator](),_;!(v=(_=b.next()).done);v=true){var S=g(_.value,2),x=S[0],B=S[1];if(B.test(l)&&(p[x]=!0,h=!B.negated,!h))break}}catch(e){y=true;w=e}finally{try{if(!v&&b.return!=null){b.return()}}finally{if(y){throw w}}}if(!(h===!1||h===void 0&&t.some(function(e){return!e.negated})||o&&p.some(function(e,n){return!e&&!t[n].negated}))&&(a.push(l),r))break}}catch(e){c=true;s=e}finally{try{if(!u&&f.return!=null){f.return()}}finally{if(c){throw s}}}return a}L();var tE={id:"id",children:"children",pid:"pid"},tC=function(e){return Object.assign({},tE,e)};function tO(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tC(n);var r=n.children,i=m(e);var o=true,a=false,u=undefined;try{for(var c=i[Symbol.iterator](),s;!(o=(s=c.next()).done);o=true){var f=s.value;var d;if(t(f))return f;f[r]&&(d=i).push.apply(d,m(f[r]))}}catch(e){a=true;u=e}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw u}}}return null}function tA(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r;n=tC(n);var i=n.children,o=m(e),a=[];var u=true,c=false,s=undefined;try{for(var f=o[Symbol.iterator](),d;!(u=(d=f.next()).done);u=true){var l=d.value;t(l)&&a.push(l),l[i]&&(r=o).push.apply(r,m(l[i]))}}catch(e){c=true;s=e}finally{try{if(!u&&f.return!=null){f.return()}}finally{if(c){throw s}}}return a}function tD(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tC(n);var r=[],i=m(e),o=new Set,a=n.children;for(;i.length;){var u;var c=i[0];if(o.has(c))r.pop(),i.shift();else if(o.add(c),c[a]&&(u=i).unshift.apply(u,m(c[a])),r.push(c),t(c))return r}return null}function tz(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tC(n);var r=[],i=m(e),o=[],a=new Set,u=n.children;for(;i.length;){var c;var s=i[0];a.has(s)?(r.pop(),i.shift()):(a.add(s),s[u]&&(c=i).unshift.apply(c,m(s[u])),r.push(s),t(s)&&o.push(m(r)))}return o}function tR(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tC(n);var r=n.children;function i(e){return e.map(function(e){return l({},e)}).filter(function(e){return e[r]=e[r]&&i(e[r]),t(e)||e[r]&&e[r].length})}return i(e)}function tL(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tC(n);var r=m(e),i=n.children;for(var o=0;o<r.length;o++){var a;if(t(r[o]))return;i&&r[o][i]&&(a=r).splice.apply(a,[o+1,0].concat(m(r[o][i])))}}function tP(e,t){return e.map(function(e){return tM(e,t)})}function tM(e,t){var n=t.children,r=n===void 0?"children":n,i=t.conversion;var o=Array.isArray(e[r])&&e[r].length>0,u=i(e)||{};return o?p(l({},u),a({},r,e[r].map(function(e){return tM(e,{children:r,conversion:i})}))):l({},u)}L();var tj=require("uuid");function tI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.native,n=t===void 0?!0:t;var r,i;var o;return n?(o=(i=window.crypto)===null||i===void 0?void 0:(r=i.randomUUID)===null||r===void 0?void 0:r.call(i))!==null&&o!==void 0?o:(0,tj.v4)():(0,tj.v4)()}var tF=0;function tT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var t=Date.now(),n=Math.floor(Math.random()*1e9);return tF++,"".concat(e,"_").concat(n).concat(tF).concat(String(t))}0&&(module.exports={AesEncryption:AesEncryption,IfActivity:IfActivity,ResizeObserver:ResizeObserver,addClass:addClass,addLocationListener:addLocationListener,addResizeListener:addResizeListener,buildBEM:buildBEM,buildShortUUID:buildShortUUID,buildUUID:buildUUID,createBEM:createBEM,createNamespace:createNamespace,createSearchReg:createSearchReg,dataURLtoBlob:dataURLtoBlob,decodeByBase64:decodeByBase64,deepMerge:deepMerge,domOffEvent:domOffEvent,domOnEvent:domOnEvent,downloadByBase64:downloadByBase64,downloadByData:downloadByData,downloadByOnlineUrl:downloadByOnlineUrl,downloadByUrl:downloadByUrl,downloadPercent:downloadPercent,enableTransitions:enableTransitions,encryptByBase64:encryptByBase64,encryptByMd5:encryptByMd5,escapeStringRegexp:escapeStringRegexp,extendSlots:extendSlots,filterTree:filterTree,findNode:findNode,findNodeAll:findNodeAll,findPath:findPath,findPathAll:findPathAll,forEachTree:forEachTree,getActualWidthOfChars:getActualWidthOfChars,getBoundingClientRect:getBoundingClientRect,getPopupContainer:getPopupContainer,getRawRoute:getRawRoute,getSlot:getSlot,getViewportOffset:getViewportOffset,hackCss:hackCss,hasClass:hasClass,highlightHtml:highlightHtml,is:is,isBrowser:isBrowser,isChineseText:isChineseText,isChrome:isChrome,isClient:isClient,isIterableArray:isIterableArray,isMatch:isMatch,isObject:isObject,isPositiveInteger:isPositiveInteger,isSafari:isSafari,isServer:isServer,isSupportNativeEllipsis:isSupportNativeEllipsis,isSupportResizeObserver:isSupportResizeObserver,isUrl:isUrl,loadScript:loadScript,matcher:matcher,openWindow:openWindow,regexpMap:regexpMap,removeClass:removeClass,removeResizeListener:removeResizeListener,setCssVar:setCssVar,setObjToUrlParams:setObjToUrlParams,treeMap:treeMap,treeMapEach:treeMapEach,triggerWindowResize:triggerWindowResize,unloadScript:unloadScript,unsetAllProperty:unsetAllProperty,urlToBase64:urlToBase64,useRafThrottle:useRafThrottle,withInstall:withInstall});