sculp-js 1.11.0 → 1.11.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/lib/cjs/array.js +1 -1
  2. package/lib/cjs/async.js +1 -1
  3. package/lib/cjs/base64.js +1 -1
  4. package/lib/cjs/clipboard.js +31 -11
  5. package/lib/cjs/cloneDeep.js +1 -1
  6. package/lib/cjs/cookie.js +1 -1
  7. package/lib/cjs/date.js +1 -1
  8. package/lib/cjs/dom.js +1 -1
  9. package/lib/cjs/download.js +1 -1
  10. package/lib/cjs/easing.js +1 -1
  11. package/lib/cjs/file.js +1 -2
  12. package/lib/cjs/func.js +1 -1
  13. package/lib/cjs/index.js +1 -1
  14. package/lib/cjs/isEqual.js +1 -1
  15. package/lib/cjs/math.js +1 -1
  16. package/lib/cjs/number.js +1 -1
  17. package/lib/cjs/object.js +1 -1
  18. package/lib/cjs/path.js +1 -1
  19. package/lib/cjs/qs.js +1 -1
  20. package/lib/cjs/random.js +1 -1
  21. package/lib/cjs/string.js +1 -1
  22. package/lib/cjs/tooltip.js +1 -1
  23. package/lib/cjs/tree.js +1 -1
  24. package/lib/cjs/type.js +1 -1
  25. package/lib/cjs/unique.js +1 -1
  26. package/lib/cjs/url.js +1 -1
  27. package/lib/cjs/validator.js +1 -1
  28. package/lib/cjs/variable.js +1 -1
  29. package/lib/cjs/watermark.js +1 -1
  30. package/lib/cjs/we-decode.js +1 -1
  31. package/lib/es/array.js +1 -1
  32. package/lib/es/async.js +1 -1
  33. package/lib/es/base64.js +1 -1
  34. package/lib/es/clipboard.js +31 -11
  35. package/lib/es/cloneDeep.js +1 -1
  36. package/lib/es/cookie.js +1 -1
  37. package/lib/es/date.js +1 -1
  38. package/lib/es/dom.js +1 -1
  39. package/lib/es/download.js +1 -1
  40. package/lib/es/easing.js +1 -1
  41. package/lib/es/file.js +1 -2
  42. package/lib/es/func.js +1 -1
  43. package/lib/es/index.js +1 -1
  44. package/lib/es/isEqual.js +1 -1
  45. package/lib/es/math.js +1 -1
  46. package/lib/es/number.js +1 -1
  47. package/lib/es/object.js +1 -1
  48. package/lib/es/path.js +1 -1
  49. package/lib/es/qs.js +1 -1
  50. package/lib/es/random.js +1 -1
  51. package/lib/es/string.js +1 -1
  52. package/lib/es/tooltip.js +1 -1
  53. package/lib/es/tree.js +1 -1
  54. package/lib/es/type.js +1 -1
  55. package/lib/es/unique.js +1 -1
  56. package/lib/es/url.js +1 -1
  57. package/lib/es/validator.js +1 -1
  58. package/lib/es/variable.js +1 -1
  59. package/lib/es/watermark.js +1 -1
  60. package/lib/es/we-decode.js +1 -1
  61. package/lib/index.d.ts +1 -1
  62. package/lib/umd/index.js +2 -2
  63. package/package.json +1 -1
package/lib/cjs/array.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/async.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/base64.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -39,20 +39,15 @@ function copyText(text, options) {
39
39
  */
40
40
  function fallbackCopyText(text, options) {
41
41
  const { successCallback = void 0, failCallback = void 0 } = type.isNullOrUnDef(options) ? {} : options;
42
- const textEl = document.createElement('textarea');
43
- textEl.style.position = 'absolute';
44
- textEl.style.top = '-9999px';
45
- textEl.style.left = '-9999px';
46
- textEl.style.opacity = '0';
47
- textEl.value = text;
42
+ const textEl = createFakeElement(text);
48
43
  document.body.appendChild(textEl);
49
- textEl.focus({ preventScroll: true });
44
+ // textEl.focus({ preventScroll: true });
50
45
  textEl.select();
46
+ // textEl.setSelectionRange(0, text.length); // iOS 兼容
51
47
  try {
52
- document.execCommand('copy');
53
- textEl.blur();
48
+ const res = document.execCommand('copy');
54
49
  if (type.isFunction(successCallback)) {
55
- successCallback();
50
+ successCallback(res);
56
51
  }
57
52
  }
58
53
  catch (err) {
@@ -62,8 +57,33 @@ function fallbackCopyText(text, options) {
62
57
  }
63
58
  finally {
64
59
  document.body.removeChild(textEl);
60
+ window.getSelection()?.removeAllRanges(); // 清除选区
65
61
  }
66
62
  }
63
+ /**
64
+ * Creates a fake textarea element with a value.
65
+ * @param {String} value
66
+ * @return {HTMLElement}
67
+ */
68
+ function createFakeElement(value) {
69
+ const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
70
+ const fakeElement = document.createElement('textarea');
71
+ // Prevent zooming on iOS
72
+ fakeElement.style.fontSize = '12pt';
73
+ // Reset box model
74
+ fakeElement.style.border = '0';
75
+ fakeElement.style.padding = '0';
76
+ fakeElement.style.margin = '0';
77
+ // Move element out of screen horizontally
78
+ fakeElement.style.position = 'absolute';
79
+ fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px';
80
+ // Move element to the same position vertically
81
+ const yPosition = window.pageYOffset || document.documentElement.scrollTop;
82
+ fakeElement.style.top = `${yPosition}px`;
83
+ fakeElement.setAttribute('readonly', '');
84
+ fakeElement.value = value;
85
+ return fakeElement;
86
+ }
67
87
 
68
88
  exports.copyText = copyText;
69
89
  exports.fallbackCopyText = fallbackCopyText;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/cookie.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/date.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/easing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/file.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -34,7 +34,6 @@ function chooseLocalFile(accept, changeCb) {
34
34
  changeCb(e.target.files);
35
35
  setTimeout(() => document.body.removeChild(inputObj));
36
36
  };
37
- return inputObj;
38
37
  }
39
38
  /**
40
39
  * 计算图片压缩后的尺寸
package/lib/cjs/func.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/number.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/object.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/path.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/qs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/random.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/string.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/tree.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/type.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/unique.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/cjs/url.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/array.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/async.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/base64.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -37,20 +37,15 @@ function copyText(text, options) {
37
37
  */
38
38
  function fallbackCopyText(text, options) {
39
39
  const { successCallback = void 0, failCallback = void 0 } = isNullOrUnDef(options) ? {} : options;
40
- const textEl = document.createElement('textarea');
41
- textEl.style.position = 'absolute';
42
- textEl.style.top = '-9999px';
43
- textEl.style.left = '-9999px';
44
- textEl.style.opacity = '0';
45
- textEl.value = text;
40
+ const textEl = createFakeElement(text);
46
41
  document.body.appendChild(textEl);
47
- textEl.focus({ preventScroll: true });
42
+ // textEl.focus({ preventScroll: true });
48
43
  textEl.select();
44
+ // textEl.setSelectionRange(0, text.length); // iOS 兼容
49
45
  try {
50
- document.execCommand('copy');
51
- textEl.blur();
46
+ const res = document.execCommand('copy');
52
47
  if (isFunction(successCallback)) {
53
- successCallback();
48
+ successCallback(res);
54
49
  }
55
50
  }
56
51
  catch (err) {
@@ -60,7 +55,32 @@ function fallbackCopyText(text, options) {
60
55
  }
61
56
  finally {
62
57
  document.body.removeChild(textEl);
58
+ window.getSelection()?.removeAllRanges(); // 清除选区
63
59
  }
64
60
  }
61
+ /**
62
+ * Creates a fake textarea element with a value.
63
+ * @param {String} value
64
+ * @return {HTMLElement}
65
+ */
66
+ function createFakeElement(value) {
67
+ const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
68
+ const fakeElement = document.createElement('textarea');
69
+ // Prevent zooming on iOS
70
+ fakeElement.style.fontSize = '12pt';
71
+ // Reset box model
72
+ fakeElement.style.border = '0';
73
+ fakeElement.style.padding = '0';
74
+ fakeElement.style.margin = '0';
75
+ // Move element out of screen horizontally
76
+ fakeElement.style.position = 'absolute';
77
+ fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px';
78
+ // Move element to the same position vertically
79
+ const yPosition = window.pageYOffset || document.documentElement.scrollTop;
80
+ fakeElement.style.top = `${yPosition}px`;
81
+ fakeElement.setAttribute('readonly', '');
82
+ fakeElement.value = value;
83
+ return fakeElement;
84
+ }
65
85
 
66
86
  export { copyText, fallbackCopyText };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/cookie.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/date.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/easing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/file.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -32,7 +32,6 @@ function chooseLocalFile(accept, changeCb) {
32
32
  changeCb(e.target.files);
33
33
  setTimeout(() => document.body.removeChild(inputObj));
34
34
  };
35
- return inputObj;
36
35
  }
37
36
  /**
38
37
  * 计算图片压缩后的尺寸
package/lib/es/func.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/isEqual.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/number.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/object.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/path.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/qs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/random.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/string.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/tooltip.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/tree.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/type.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/unique.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/url.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/index.d.ts CHANGED
@@ -606,7 +606,7 @@ declare function supportCanvas(): boolean;
606
606
  * @param {Function} changeCb 选择文件回调
607
607
  * @returns {HTMLInputElement}
608
608
  */
609
- declare function chooseLocalFile(accept: string, changeCb: (FileList: any) => any): HTMLInputElement;
609
+ declare function chooseLocalFile(accept: string, changeCb: (FileList: any) => any): void;
610
610
  type ImageType = 'image/jpeg' | 'image/png' | 'image/webp';
611
611
  interface ICompressOptions {
612
612
  /** 压缩质量 0 ~ 1 之间*/
package/lib/umd/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * sculp-js v1.11.0
2
+ * sculp-js v1.11.1-alpha.0
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).sculpJs={})}(this,(function(e){"use strict";function t(e,t,n=!1){if(n)for(let n=e.length-1;n>=0;n--){const r=t(e[n],n,e);if(!1===r)break}else for(let n=0,r=e.length;n<r;n++){const r=t(e[n],n,e);if(!1===r)break}e=null}const{toString:n,hasOwnProperty:r,propertyIsEnumerable:o}=Object.prototype;function i(e,t){return r.call(e,t)}function s(e){return!!g(e)||(!!c(e)||!!h(e)&&i(e,"length"))}function a(e){return n.call(e).slice(8,-1)}const c=e=>"string"==typeof e,l=e=>"boolean"==typeof e,u=e=>"number"==typeof e&&!Number.isNaN(e),d=e=>void 0===e,f=e=>null===e;function p(e){return d(e)||f(e)}const h=e=>"Object"===a(e),g=e=>Array.isArray(e),m=e=>"function"==typeof e,y=e=>Number.isNaN(e),b=e=>"Date"===a(e);function w(e){if(p(e)||Number.isNaN(e))return!0;const t=a(e);return s(e)||"Arguments"===t?!e.length:"Set"===t||"Map"===t?!e.size:!Object.keys(e).length}function x(e,t){const{successCallback:n,failCallback:r}=p(t)?{}:t,o=document.createElement("textarea");o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.opacity="0",o.value=e,document.body.appendChild(o),o.focus({preventScroll:!0}),o.select();try{document.execCommand("copy"),o.blur(),m(n)&&n()}catch(e){m(r)&&r(e)}finally{document.body.removeChild(o)}}function S(e,t,n){const r=[],o="expires";if(r.push([e,encodeURIComponent(t)]),u(n)){const e=new Date;e.setTime(e.getTime()+n),r.push([o,e.toUTCString()])}else b(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const A=e=>b(e)&&!y(e.getTime()),E=e=>{if(!c(e))return;const t=e.replace(/-/g,"/");return new Date(t)},v=e=>{if(!c(e))return;const t=/([+-])(\d\d)(\d\d)$/,n=t.exec(e);if(!n)return;const r=e.replace(t,"Z"),o=new Date(r);if(!A(o))return;const[,i,s,a]=n,l=parseInt(s,10),u=parseInt(a,10),d=(e,t)=>"+"===i?e-t:e+t;return o.setHours(d(o.getHours(),l)),o.setMinutes(d(o.getMinutes(),u)),o};function F(e){const t=new Date(e);if(A(t))return t;const n=E(e);if(A(n))return n;const r=v(e);if(A(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function C(e){const t=F(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}function j(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $=.1,T="function"==typeof Float32Array;function I(e,t){return 1-3*t+3*e}function R(e,t){return 3*t-6*e}function O(e){return 3*e}function D(e,t,n){return((I(t,n)*e+R(t,n))*e+O(t))*e}function M(e,t,n){return 3*I(t,n)*e*e+2*R(t,n)*e+O(t)}function L(e){return e}var N=j((function(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===r)return L;for(var o=T?new Float32Array(11):new Array(11),i=0;i<11;++i)o[i]=D(i*$,e,n);function s(t){for(var r=0,i=1;10!==i&&o[i]<=t;++i)r+=$;--i;var s=r+(t-o[i])/(o[i+1]-o[i])*$,a=M(s,e,n);return a>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var i=M(t,n,r);if(0===i)return t;t-=(D(t,n,r)-e)/i}return t}(t,s,e,n):0===a?s:function(e,t,n,r,o){var i,s,a=0;do{(i=D(s=t+(n-t)/2,r,o)-e)>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<10);return s}(t,r,r+$,e,n)}return function(e){return 0===e?0:1===e?1:D(s(e),t,r)}}));const P={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};const B=e=>{if(!h(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function k(e,t){for(const n in e)if(i(e,n)&&!1===t(e[n],n))break;e=null}function U(e,t){const n={};return k(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const H=(e,t,n)=>{if(d(n))return t;if(a(t)!==a(n))return g(n)?H(e,[],n):h(n)?H(e,{},n):n;if(B(n)){const r=e.get(n);return r||(e.set(n,t),k(n,((n,r)=>{t[r]=H(e,t[r],n)})),t)}if(g(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=H(e,t[r],n)})),t)}return n};function z(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=H(n,e,o)}return n.clear(),e}function W(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const q="0123456789",_="abcdefghijklmnopqrstuvwxyz",G="ABCDEFGHIJKLMNOPQRSTUVWXYZ",V=/%[%sdo]/g;const Y=/\${(.*?)}/g;const K=(e,t)=>{e.split(/\s+/g).forEach(t)};const X=(e,t,n)=>{h(t)?k(t,((t,n)=>{X(e,n,t)})):e.style.setProperty(W(t),n)};function J(e,t=14,n=!0){let r=0;if(console.assert(c(e),`${e} 不是有效的字符串`),c(e)&&e.length>0){const o="getStrWidth1494304949567";let i=document.querySelector(`#${o}`);if(!i){const n=document.createElement("span");n.id=o,n.style.fontSize=t+"px",n.style.whiteSpace="nowrap",n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.textContent=e,document.body.appendChild(n),i=n}i.textContent=e,r=i.offsetWidth,n&&i.remove()}return r}const Z=e=>{const t=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/\.{3,}/g,"..").replace(/\/\.\//g,"/").split("/").map((e=>e.trim())),n=e=>".."===e,r=[];let o=!1;const i=e=>{r.push(e)};return t.forEach((e=>{const t=(e=>"."===e)(e),s=n(e);return o?t?void 0:s?(()=>{if(0===r.length)return;const e=r[r.length-1];n(e)?r.push(".."):r.pop()})():void i(e):(i(e),void(o=!t&&!s))})),r.join("/")},Q=(e,...t)=>Z([e,...t].join("/"));function ee(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())d(n[e])?n[e]=r:g(n[e])||(n[e]=t.getAll(e));return n}const te=e=>c(e)?e:u(e)?String(e):l(e)?e?"true":"false":b(e)?e.toISOString():null;function ne(e,t=te){const n=new URLSearchParams;return k(e,((e,r)=>{if(g(e))e.forEach((e=>{const o=t(e);null!==o&&n.append(r.toString(),o)}));else{const o=t(e);if(null===o)return;n.set(r.toString(),o)}})),n.toString()}const re=(e,t=!0)=>{let n=null;m(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:a,hostname:c,hash:l,search:u,pathname:d}=n,f=Q("/",d),p=o&&i?`${o}:${i}`:"",h=u.replace(/^\?/,"");return n=null,{protocol:r,auth:p,username:o,password:i,host:s,port:a,hostname:c,hash:l,search:u,searchParams:ee(h),query:h,pathname:f,path:`${f}${u}`,href:e}},oe=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,a=n?`${n}@`:"",c=ne(i),l=c?`?${c}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${a}${r}${o}${l}${u}`},ie=(e,t)=>{const n=re(e);return Object.assign(n.searchParams,t),oe(n)};function se(e,t,n){const r=document.createElement("a");r.download=t,r.style.display="none",r.href=e,document.body.appendChild(r),r.click(),setTimeout((()=>{document.body.removeChild(r),m(n)&&n()}))}function ae(e,t,n){const r=URL.createObjectURL(e);se(r,t),setTimeout((()=>{URL.revokeObjectURL(r),m(n)&&n()}))}function ce(){return!!document.createElement("canvas").getContext}function le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r}){let o=n,i=r;return(n>e||r>t)&&(n/r>e/t?(o=e,i=Math.round(e*(r/n))):(i=t,o=Math.round(t*(n/r)))),{width:o,height:i}}function ue(e){return"undefined"!=typeof globalThis?globalThis[e]:"undefined"!=typeof window?window[e]:"undefined"!=typeof global?global[e]:"undefined"!=typeof self?self[e]:void 0}const de=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),fe=`${q}${G}${_}`;const pe=`${q}${G}${_}`,he="undefined"!=typeof BigInt,ge=()=>ue("JSBI"),me=e=>he?BigInt(e):ge().BigInt(e);function ye(e,t=pe){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!he)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=me(e);const r=[],{length:o}=t,i=me(o),s=()=>{const e=Number(((e,t)=>he?e%t:ge().remainder(e,t))(n,i));n=((e,t)=>he?e/t:ge().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const be=(e,t,n={ratio:1e3,decimals:0,separator:" "})=>{const{ratio:r=1e3,decimals:o=0,separator:i=" "}=n,{length:s}=t;if(0===s)throw new Error("At least one unit is required");let a=Number(e),c=0;for(;a>=r&&c<s-1;)a/=r,c++;const l=a.toFixed(o),u=t[c];return String(l)+i+u};function we(e,t){if(p(t))return parseInt(String(e)).toLocaleString();let n=0;if(!u(t))throw new Error("Decimals must be a positive number not less than zero");return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let xe=0,Se=0;const Ae=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==Se&&(Se=t,xe=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${de(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(xe,5);return xe++,`${n}${r}${i}`},Ee=e=>e[de(0,e.length-1)];function ve(e,t,n){let r=250,o=13;const i=e.children[0];J(t,12)<230?(i.style.maxWidth=J(t,12)+20+50+"px",r=n.clientX+(J(t,12)+50)-document.body.offsetWidth):(i.style.maxWidth="250px",r=n.clientX+230-document.body.offsetWidth),i.innerHTML=t,r>0&&(o-=r),e.style.top=n.clientY+23+"px",e.style.left=n.clientX+o+"px",e.style.maxWidth="250px";const s=e.getBoundingClientRect().top+i.offsetHeight-document.body.offsetHeight;s>0&&(e.style.top=n.clientY-s+"px")}const Fe={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=c(e)?document.querySelector(e):e;if(!i)throw new Error(`${e} is not valid Html Element or element selector`);let s=null;const a="style-tooltip-inner1494304949567";if(!document.querySelector(`#${a}`)){const e=document.createElement("style");e.type="text/css",e.id=a,e.innerHTML=`\n .tooltip-inner1494304949567 {\n max-width: 250px;\n padding: 3px 8px;\n color: ${o};\n text-decoration: none;\n border-radius: 4px;\n text-align: left;\n background-color: ${r};\n }\n `,document.querySelector("head").appendChild(e)}if(s=document.querySelector("#customTitle1494304949567"),s)ve(s,t,n);else{const e=document.createElement("div");e.id="customTitle1494304949567",e.style.cssText="z-index: 99999999; visibility: hidden; position: absolute;",e.innerHTML='<div class="tooltip-inner1494304949567" style="word-wrap: break-word; max-width: 44px;">皮肤</div>',i.appendChild(e),s=document.querySelector("#customTitle1494304949567"),t&&(ve(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=c(e)?document.querySelector(e):e,n=document.querySelector("#customTitle1494304949567");t&&n&&t.removeChild(n)}},Ce={keyField:"key",childField:"children",pidField:"pid"},je={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};const $e=(e,t)=>{let n=0;const r=e.toString(),o=t.toString();return void 0!==r.split(".")[1]&&(n+=r.split(".")[1].length),void 0!==o.split(".")[1]&&(n+=o.split(".")[1].length),Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},Te=(e,t)=>{let n=0,r=0,o=0;try{n=e.toString().split(".")[1].length}catch(e){n=0}try{r=t.toString().split(".")[1].length}catch(e){r=0}return o=10**Math.max(n,r),($e(e,o)+$e(t,o))/o};const Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Oe(e){let t,n,r,o,i="",s=0;const a=(e=String(e)).length,c=a%3;for(;s<a;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");t=n<<16|r<<8|o,i+=Ie.charAt(t>>18&63)+Ie.charAt(t>>12&63)+Ie.charAt(t>>6&63)+Ie.charAt(63&t)}return c?i.slice(0,c-3)+"===".substring(c):i}function De(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Re.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");let t,n,r,o="",i=0;for(const s=(e+="==".slice(2-(3&e.length))).length;i<s;)t=Ie.indexOf(e.charAt(i++))<<18|Ie.indexOf(e.charAt(i++))<<12|(n=Ie.indexOf(e.charAt(i++)))<<6|(r=Ie.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}const Me=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Le=/^(?:(?:\+|00)86)?1\d{10}$/,Ne=/^(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|7[1]|8[1-2]|9[1])\d{4}(18|19|20)\d{2}[01]\d[0123]\d{4}[\dxX]$/,Pe=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Be=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,ke=/^(?:(?:\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])$/,Ue=/^(([\da-fA-F]{1,4}:){7}[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,7}:|([\da-fA-F]{1,4}:){1,6}:[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,5}(:[\da-fA-F]{1,4}){1,2}|([\da-fA-F]{1,4}:){1,4}(:[\da-fA-F]{1,4}){1,3}|([\da-fA-F]{1,4}:){1,3}(:[\da-fA-F]{1,4}){1,4}|([\da-fA-F]{1,4}:){1,2}(:[\da-fA-F]{1,4}){1,5}|[\da-fA-F]{1,4}:((:[\da-fA-F]{1,4}){1,6})|:((:[\da-fA-F]{1,4}){1,7}|:)|fe80:(:[\da-fA-F]{0,4}){0,4}%[\da-zA-Z]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d)|([\da-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d))$/i,He=/^(-?[1-9]\d*|0)$/,ze=e=>He.test(e),We=/^-?([1-9]\d*|0)\.\d*[1-9]$/,qe=e=>We.test(e),_e=/^\d+$/;function Ge(e){return[...new Set(e.trim().split(""))].join("")}function Ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ye(e,t){return new RegExp(`${Ve(e.trim())}\\s*([^${Ve(Ge(e))}${Ve(Ge(t))}\\s]*)\\s*${t.trim()}`,"g")}function Ke(e,t,n=new WeakMap){if(Object.is(e,t))return!0;const r=Object.prototype.toString.call(e);if(r!==Object.prototype.toString.call(t))return!1;if(h(e)&&h(t)){if(n.has(e))return n.get(e)===t;n.set(e,t),n.set(t,e)}switch(r){case"[object Date]":return e.getTime()===t.getTime();case"[object RegExp]":return e.toString()===t.toString();case"[object Map]":return function(e,t,n){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Ke(o,t.get(r),n))return!1;return!0}(e,t,n);case"[object Set]":return function(e,t,n){if(e.size!==t.size)return!1;for(const r of e){let e=!1;for(const o of t)if(Ke(r,o,n)){e=!0;break}if(!e)return!1}return!0}(e,t,n);case"[object ArrayBuffer]":return function(e,t){return e.byteLength===t.byteLength&&new DataView(e).getInt32(0)===new DataView(t).getInt32(0)}(e,t);case"[object DataView]":return function(e,t,n){return e.byteLength===t.byteLength&&Ke(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n)}(e,t,n);case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":return function(e,t,n){return e.byteLength===t.byteLength&&Ke(Array.from(e),Array.from(t),n)}(e,t,n);case"[object Object]":return Xe(e,t,n);case"[object Array]":return function(e,t,n){const r=Object.keys(e).map(Number),o=Object.keys(t).map(Number);if(r.length!==o.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Ke(e[r],t[r],n))return!1;return Xe(e,t,n)}(e,t,n)}return!1}function Xe(e,t,n){const r=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(r.length!==o.length)return!1;for(const i of r){if(!o.includes(i))return!1;if(!Ke(e[i],t[i],n))return!1}return Object.getPrototypeOf(e)===Object.getPrototypeOf(t)}e.EMAIL_REGEX=Me,e.HEX_POOL=pe,e.HTTP_URL_REGEX=Be,e.IPV4_REGEX=ke,e.IPV6_REGEX=Ue,e.PHONE_REGEX=Le,e.STRING_ARABIC_NUMERALS=q,e.STRING_LOWERCASE_ALPHA=_,e.STRING_POOL=fe,e.STRING_UPPERCASE_ALPHA=G,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Pe,e.add=Te,e.addClass=function(e,t){K(t,(t=>e.classList.add(t)))},e.arrayEach=t,e.arrayEachAsync=async function(e,t,n=!1){if(n)for(let n=e.length-1;n>=0&&!1!==await t(e[n],n);n--);else for(let n=0,r=e.length;n<r&&!1!==await t(e[n],n);n++);},e.arrayInsertBefore=function(e,t,n){if(t===n||t+1===n)return;const[r]=e.splice(t,1),o=n<t?n:n-1;e.splice(o,0,r)},e.arrayLike=s,e.arrayRemove=function(e,n){const r=[],o=n;return t(e,((e,t)=>{o(e,t)&&r.push(t)})),r.forEach(((t,n)=>{e.splice(t-n,1)})),e},e.asyncMap=function(e,t,n=1/0){return new Promise(((r,o)=>{const i=e[Symbol.iterator](),s=Math.min(e.length,n),a=[];let c,l=0,u=0;const d=()=>{if(c)return o(c);const n=i.next();if(n.done)return void(l===e.length&&r(a));const s=u++;t(n.value,s,e).then((e=>{l++,a[s]=e,d()})).catch((e=>{c=e,d()}))};for(let e=0;e<s;e++)d()}))},e.calculateDate=function(e,t,n="-"){const r=new Date(e),o=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()+864e5*parseInt(String(t)),i=new Date(o);return i.getFullYear()+n+String(i.getMonth()+1).padStart(2,"0")+"-"+String(i.getDate()).padStart(2,"0")},e.calculateDateTime=function(e,t,n="-",r=":"){const o=new Date(e),i=n,s=r,a=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),c=new Date(a);return c.getFullYear()+i+String(c.getMonth()+1).padStart(2,"0")+i+String(c.getDate()).padStart(2,"0")+" "+String(c.getHours()).padStart(2,"0")+s+String(c.getMinutes()).padStart(2,"0")+s+String(c.getSeconds()).padStart(2,"0")},e.chooseLocalFile=function(e,t){const n=document.createElement("input");return n.setAttribute("id",String(Date.now())),n.setAttribute("type","file"),n.setAttribute("style","visibility:hidden"),n.setAttribute("accept",e),document.body.appendChild(n),n.click(),n.onchange=e=>{t(e.target.files),setTimeout((()=>document.body.removeChild(n)))},n},e.cloneDeep=function e(t,n=new WeakMap){if(null===t||"object"!=typeof t)return t;if(n.has(t))return n.get(t);if(t instanceof ArrayBuffer){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),n.set(t,e),e}if(ArrayBuffer.isView(t)){return new(0,t.constructor)(e(t.buffer,n),t.byteOffset,t.length)}if(t instanceof Date){const e=new Date(t.getTime());return n.set(t,e),e}if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,n.set(t,e),e}if(t instanceof Map){const r=new Map;return n.set(t,r),t.forEach(((t,o)=>{r.set(e(o,n),e(t,n))})),r}if(t instanceof Set){const r=new Set;return n.set(t,r),t.forEach((t=>{r.add(e(t,n))})),r}if(Array.isArray(t)){const r=new Array(t.length);n.set(t,r);for(let o=0,i=t.length;o<i;o++)o in t&&(r[o]=e(t[o],n));const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o))Object.defineProperty(r,t,{...o[t],value:e(o[t].value,n)});return r}const r=Object.create(Object.getPrototypeOf(t));n.set(t,r);const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o)){const i=o[t];"value"in i?i.value=e(i.value,n):(i.get&&(i.get=e(i.get,n)),i.set&&(i.set=e(i.set,n))),Object.defineProperty(r,t,i)}return r},e.compressImg=function e(t,n={mime:"image/jpeg",minFileSizeKB:50}){if(!(t instanceof File||t instanceof FileList))throw new Error(`${t} require be File or FileList`);if(!ce())throw new Error("Current runtime environment not support Canvas");const{quality:r,mime:o="image/jpeg",maxSize:i,minFileSizeKB:s=50}=h(n)?n:{};let a,c=r;if(r)c=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));c=e<s?1:e<1024?.85:e<5120?.8:.75}return u(i)&&(a=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:a,mime:o,quality:c})))):t instanceof File?new Promise((e=>{const n=[...t.name.split(".").slice(0,-1),{"image/webp":"webp","image/jpeg":"jpg","image/png":"png"}[o]].join("."),r=+parseInt((t.size/1024).toFixed(2));if(r<s)e({file:t});else{const i=new FileReader;i.onload=({target:{result:i}})=>{const s=new Image;s.onload=()=>{const l=document.createElement("canvas"),d=l.getContext("2d"),f=s.width,p=s.height,{width:h,height:g}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(u(t)){const{width:e,height:s}=le({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:a}=le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<5120){const e=1400,t=1400,{width:s,height:a}=le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<10240){const e=1600,t=1600,{width:s,height:a}=le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:a}=le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}return{width:o,height:i}}({sizeKB:r,maxSize:a,originWidth:f,originHeight:p});l.width=h,l.height=g,d.clearRect(0,0,h,g),d.drawImage(s,0,0,h,g);const m=l.toDataURL(o,c),y=atob(m.split(",")[1]);let b=y.length;const w=new Uint8Array(new ArrayBuffer(b));for(;b--;)w[b]=y.charCodeAt(b);const x=new File([w],n,{type:o});e({file:x,bufferArray:w,origin:t,beforeSrc:i,afterSrc:m,beforeKB:r,afterKB:Number((x.size/1024).toFixed(2))})},s.src=i},i.readAsDataURL(t)}})):Promise.resolve(null)},e.cookieDel=e=>S(e,"",-1),e.cookieGet=function(e){const{cookie:t}=document;if(!t)return"";const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t],[o,i=""]=r.split("=");if(o===e)return decodeURIComponent(i)}return""},e.cookieSet=S,e.copyText=function(e,t){const{successCallback:n,failCallback:r}=p(t)?{}:t;navigator.clipboard?navigator.clipboard.writeText(e).then((()=>{m(n)&&n()})).catch((n=>{x(e,t)})):x(e,t)},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:i}=p(n)?{successCode:200,successCallback:void 0,failCallback:void 0}:n,s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(){if(s.status===r)ae(s.response,t,o);else if(m(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(c(t)&&t.includes("application/json")){const t=new FileReader;t.onload=()=>{i({status:e,response:t.result})},t.readAsText(s.response)}else i(s)}},s.onerror=e=>{m(i)&&i({status:0,code:"ERROR_CONNECTION_REFUSED"})},s.send()},e.dateParse=F,e.dateToEnd=function(e){const t=C(e);return t.setDate(t.getDate()+1),F(t.getTime()-1)},e.dateToStart=C,e.debounce=(e,t)=>{let n,r=!1;const o=function(...o){r||(clearTimeout(n),n=setTimeout((()=>{e.call(this,...o)}),t))};return o.cancel=()=>{clearTimeout(n),r=!0},o},e.decodeFromBase64=function(e){const t=p(ue("atob"))?De(e):ue("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return p(ue("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(ue("TextDecoder"))("utf-8").decode(r)},e.divide=(e,t)=>{let n=0,r=0,o=0,i=0;return void 0!==e.toString().split(".")[1]&&(n=e.toString().split(".")[1].length),void 0!==t.toString().split(".")[1]&&(r=t.toString().split(".")[1].length),o=Number(e.toString().replace(".","")),i=Number(t.toString().replace(".","")),o/i*Math.pow(10,r-n)},e.downloadBlob=ae,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){ae(new Blob([JSON.stringify(e,null,4)]),n)}else{if(!r||!r.length)throw new Error("未传入表头数据");if(!Array.isArray(e))throw new Error("data error! expected array!");const o=r.join(",")+"\n";let i="";e.forEach((e=>{i+=Object.values(e).join(",\t")+",\n"}));se("data:"+{csv:"text/csv",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}[t]+";charset=utf-8,\ufeff"+encodeURIComponent(o+i),n)}},e.downloadHref=se,e.downloadURL=function(e,t){window.open(t?ie(e,t):e)},e.encodeToBase64=function(e){const t=p(ue("TextEncoder"))?function(e){const t=encodeURIComponent(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(e):(new(ue("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return p(ue("btoa"))?Oe(n):ue("btoa")(n)},e.escapeRegExp=Ve,e.executeInScope=function(e,t={}){const n=Object.keys(t),r=n.map((e=>t[e]));try{return new Function(...n,`return (() => { ${e} })()`)(...r)}catch(e){throw new Error(`代码执行失败: ${e.message}`)}},e.fallbackCopyText=x,e.flatTree=function e(n,r=Ce){const{childField:o,keyField:s,pidField:a}=r;let c=[];return t(n,(t=>{const n={...t,[o]:[]};if(i(n,o)&&delete n[o],c.push(n),t[o]){const n=t[o].map((e=>({...e,[a]:t[s]||e.pid})));c=c.concat(e(n,r))}})),c},e.forEachDeep=function(e,t,n="children",r=!1){let o=!1;const i=(s,a,c=0)=>{if(r)for(let r=s.length-1;r>=0&&!o;r--){const l=t(s[r],r,s,e,a,c);if(!1===l){o=!0;break}!0!==l&&s[r]&&Array.isArray(s[r][n])&&i(s[r][n],s[r],c+1)}else for(let r=0,l=s.length;r<l&&!o;r++){const l=t(s[r],r,s,e,a,c);if(!1===l){o=!0;break}!0!==l&&s[r]&&Array.isArray(s[r][n])&&i(s[r][n],s[r],c+1)}};i(e,null),e=null},e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=F(e);let r,o=t;const i={"Y+":`${n.getFullYear()}`,"y+":`${n.getFullYear()}`,"M+":`${n.getMonth()+1}`,"D+":`${n.getDate()}`,"d+":`${n.getDate()}`,"H+":`${n.getHours()}`,"m+":`${n.getMinutes()}`,"s+":`${n.getSeconds()}`,"S+":`${n.getMilliseconds()}`,"w+":["周日","周一","周二","周三","周四","周五","周六"][n.getDay()]};for(const e in i)r=new RegExp("("+e+")").exec(o),r&&(o=o.replace(r[1],1===r[1].length?i[e]:i[e].padStart(r[1].length,"0")));return o},e.formatMoney=we,e.formatNumber=we,e.formatTree=function(e,n=Ce){const{keyField:r,childField:o,pidField:i}=n,s=[],a={};return t(e,(e=>{a[e[r]]=e})),t(e,(e=>{const t=a[e[i]];t?(t[o]||(t[o]=[])).push(e):s.push(e)})),e=null,s},e.fuzzySearchTree=function e(n,r,o=je){if(!i(r,"filter")&&(!i(r,"keyword")||w(r.keyword)))return n;const s=[];return t(n,(t=>{const n=t[o.childField]&&t[o.childField].length>0?e(t[o.childField]||[],r,o):[];((i(r,"filter")?r.filter(t):o.ignoreCase?t[o.nameField].toLowerCase().includes(r.keyword.toLowerCase()):t[o.nameField].includes(r.keyword))||n.length>0)&&(t[o.childField]?n.length>0?s.push({...t,[o.childField]:n}):o.removeEmptyChild?(t[o.childField]&&delete t[o.childField],s.push({...t})):s.push({...t,[o.childField]:[]}):(t[o.childField]&&delete t[o.childField],s.push({...t})))})),s},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:a="middle",font:l="20px PingFangSC-Medium,PingFang SC",fillStyle:u="rgba(189, 177, 167, .3)",rotate:d=-20,zIndex:f=2147483647,watermarkId:h="__wm"}=p(n)?{}:n,g=c(r)?document.querySelector(r):r;if(!g)throw new Error(`${r} is not valid Html Element or element selector`);const m=document.createElement("canvas");m.setAttribute("width",o),m.setAttribute("height",i);const y=m.getContext("2d");y.textAlign=s,y.textBaseline=a,y.font=l,y.fillStyle=u,y.rotate(Math.PI/180*d),y.fillText(t,parseFloat(o)/4,parseFloat(i)/2);const b=m.toDataURL(),w=document.querySelector(`#${h}`),x=w||document.createElement("div"),S=`opacity: 1 !important; display: block !important; visibility: visible !important; position:absolute; left:0; top:0; width:100%; height:100%; z-index:${f}; pointer-events:none; background-repeat:repeat; background-image:url('${b}')`;x.setAttribute("style",S),x.setAttribute("id",h),x.classList.add("nav-height"),w||(g.style.position="relative",g.appendChild(x));const A=window.MutationObserver||window.WebKitMutationObserver;if(A){let r=new A((function(){const o=document.querySelector(`#${h}`);if(o){const{opacity:i,zIndex:s,display:a,visibility:c}=(e=>{const t=getComputedStyle(e);return{opacity:t.getPropertyValue("opacity"),zIndex:t.getPropertyValue("z-index"),display:t.getPropertyValue("display"),visibility:t.getPropertyValue("visibility")}})(o);(o&&o.getAttribute("style")!==S||!o||"1"!==i||"2147483647"!==s||"block"!==a||"visible"!==c)&&(r.disconnect(),r=null,g.removeChild(o),e(t,n))}else r.disconnect(),r=null,e(t,n)}));r.observe(g,{attributes:!0,subtree:!0,childList:!0})}},e.getComputedCssVal=function(e,t,n=!0){const r=getComputedStyle(e).getPropertyValue(t)??"";return n?Number(r.replace(/([0-9]*)(.*)/g,"$1")):r},e.getGlobal=ue,e.getStrWidthPx=J,e.getStyle=function(e,t){return getComputedStyle(e).getPropertyValue(t)},e.hasClass=function(e,t){if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},e.humanFileSize=function(e,t={decimals:0,si:!1,separator:" "}){const{decimals:n=0,si:r=!1,separator:o=" ",baseUnit:i,maxUnit:s}=t;let a=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!p(i)){const e=a.findIndex((e=>e===i));-1!==e&&(a=a.slice(e))}if(!p(s)){const e=a.findIndex((e=>e===s));-1!==e&&a.splice(e+1)}return be(e,a,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=g,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=l,e.isDate=b,e.isDigit=e=>_e.test(e),e.isEmail=e=>Me.test(e),e.isEmpty=w,e.isEqual=function(e,t){return Ke(e,t)},e.isError=e=>"Error"===a(e),e.isFloat=qe,e.isFunction=m,e.isIdNo=e=>{if(!Ne.test(e))return!1;const t=Number(e.slice(6,10)),n=Number(e.slice(10,12)),r=Number(e.slice(12,14)),o=new Date(t,n-1,r);if(!(o.getFullYear()===t&&o.getMonth()+1===n&&o.getDate()===r))return!1;const i=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let s=0;for(let t=0;t<17;t++)s+=Number(e.slice(t,t+1))*i[t];return["1","0","X","9","8","7","6","5","4","3","2"][s%11]===e.slice(-1)},e.isInteger=ze,e.isIpV4=e=>ke.test(e),e.isIpV6=e=>Ue.test(e),e.isJsonString=function(e){try{const t=JSON.parse(e);return"object"==typeof t&&null!==t&&t}catch(e){return!1}},e.isNaN=y,e.isNull=f,e.isNullOrUnDef=p,e.isNullish=p,e.isNumber=u,e.isNumerical=e=>ze(e)||qe(e),e.isObject=h,e.isPhone=e=>Le.test(e),e.isPlainObject=B,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===a(e),e.isString=c,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=d,e.isUrl=(e,t=!1)=>(t?Pe:Be).test(e),e.isValidDate=A,e.mapDeep=function(e,t,n="children",r=!1){let o=!1;const i=[],s=(i,a,c,l=0)=>{if(r)for(let r=i.length-1;r>=0&&!o;r--){const u=t(i[r],r,i,e,a,l);if(!1===u){o=!0;break}!0!==u&&(c.push(U(u,[n])),i[r]&&Array.isArray(i[r][n])?(c[c.length-1][n]=[],s(i[r][n],i[r],c[c.length-1][n],l+1)):delete u[n])}else for(let r=0;r<i.length&&!o;r++){const u=t(i[r],r,i,e,a,l);if(!1===u){o=!0;break}!0!==u&&(c.push(U(u,[n])),i[r]&&Array.isArray(i[r][n])?(c[c.length-1][n]=[],s(i[r][n],i[r],c[c.length-1][n],l+1)):delete u[n])}};return s(e,null,i),e=null,i},e.multiply=$e,e.numberAbbr=be,e.numberToHex=ye,e.objectAssign=z,e.objectEach=k,e.objectEachAsync=async function(e,t){for(const n in e)if(i(e,n)&&!1===await t(e[n],n))break},e.objectFill=function(e,t,n){const r=n||((e,t,n)=>void 0===e[n]);return k(t,((n,o)=>{r(e,t,o)&&(e[o]=n)})),e},e.objectGet=function(e,t,n=!1){const r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".");let o=e,s=0;for(let e=r.length;s<e-1;++s){const e=r[s];if(u(Number(e))&&Array.isArray(o))o=o[e];else{if(!h(o)||!i(o,e)){if(o=void 0,n)throw new Error("[Object] objectGet path 路径不正确");break}o=o[e]}}return{p:o,k:o?r[s]:void 0,v:o?o[r[s]]:void 0}},e.objectHas=i,e.objectMap=function(e,t){const n={};for(const r in e)i(e,r)&&(n[r]=t(e[r],r));return e=null,n},e.objectMerge=z,e.objectOmit=U,e.objectPick=function(e,t){const n={};return k(e,((e,r)=>{t.includes(r)&&(n[r]=e)})),e=null,n},e.once=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.call(this,...r)),t}},e.parseQueryParams=function(e=location.search){const t={};return Array.from(e.matchAll(/[&?]?([^=&]+)=?([^=&]*)/g)).forEach(((e,n)=>{t[e[1]]?"string"==typeof t[e[1]]?t[e[1]]=[t[e[1]],e[2]]:t[e[1]].push(e[2]):t[e[1]]=e[2]})),t},e.parseVarFromString=function(e,t="{",n="}"){return Array.from(e.matchAll(Ye(t,n))).map((e=>p(e)?void 0:e[1]))},e.pathJoin=Q,e.pathNormalize=Z,e.qsParse=ee,e.qsStringify=ne,e.randomNumber=de,e.randomString=(e,t)=>{let n=0,r=fe;c(t)?(n=e,r=t):u(e)?n=e:c(e)&&(r=e);let o=Math.max(n,1),i="";const s=r.length-1;if(s<2)throw new Error("字符串池长度不能少于 2");for(;o--;){i+=r[de(0,s)]}return i},e.randomUuid=function(){if("undefined"==typeof URL||!URL.createObjectURL||"undefined"==typeof Blob){const e="0123456789abcdef",t="xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx";let n="";for(let r=0;r<t.length;r++){const o=de(0,15);n+="-"==t[r]||"4"==t[r]?t[r]:e[o]}return n}return/[^/]+$/.exec(URL.createObjectURL(new Blob).slice())[0]},e.removeClass=function(e,t){K(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Ye(n,r)),(function(e,n){return i(t,n)?t[n]:e}))},e.searchTreeById=function(e,t,n){const{children:r="children",id:o="id"}=n||{},i=(e,t,n)=>e.reduce(((e,s)=>{const a=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...a&&a.length?i(a,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let a=[t],c=[s];for(;n&&n.parentId;)a=[n.parentId,...a],c=[n.parent,...c],n=e.find((e=>e[o]===n.parentId));return[a,c]})(i(e))},e.setGlobal=function(e,t){if("undefined"!=typeof globalThis)globalThis[e]=t;else if("undefined"!=typeof window)window[e]=t;else if("undefined"!=typeof global)global[e]=t;else{if("undefined"==typeof self)throw new SyntaxError("当前环境下无法设置全局属性");self[e]=t}},e.setStyle=X,e.smoothScroll=function(e){return new Promise((n=>{const r={el:document,to:0,duration:567,easing:"ease"},{el:o,to:i,duration:s,easing:a}=z(r,e),c=document.documentElement,l=document.body,u=o===window||o===document||o===c||o===l?[c,l]:[o];let d;const f=(()=>{let e=0;return t(u,(t=>{if("scrollTop"in t)return e=t.scrollTop,!1})),e})(),p=i-f,h=function(e){let t;if(g(e))t=N(...e);else{const n=P[e];if(!n)throw new Error(`${e} 缓冲函数未定义`);t=N(...n)}return e=>t(Math.max(0,Math.min(e,1)))}(a),m=()=>{const e=performance.now(),t=(d?e-d:0)/s,r=h(t);var o;d||(d=e),o=f+p*r,u.forEach((e=>{"scrollTop"in e&&(e.scrollTop=o)})),t>=1?n():requestAnimationFrame(m)};m()}))},e.stringAssign=(e,t)=>e.replace(Y,((e,n)=>((e,t)=>{try{return new Function(`with(arguments[0]){if(arguments[0].${e} === undefined)throw "";return String(arguments[0].${e})}`)(t)}catch(t){throw new SyntaxError(`无法执行表达式:${e}`)}})(n,t))),e.stringCamelCase=function(e,t){let n=e;return t&&(n=e.replace(/^./,(e=>e.toUpperCase()))),n.replace(/[\s_-](.)/g,((e,t)=>t.toUpperCase()))},e.stringEscapeHtml=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};return e.replace(/[&<>"]/g,(e=>t[e]))},e.stringFill=(e,t=" ")=>new Array(e).fill(t).join(""),e.stringFormat=function(e,...t){let n=0;return[e.replace(V,(e=>{const r=t[n++];switch(e){case"%%":return n--,"%";default:case"%s":return String(r);case"%d":return String(Number(r));case"%o":return JSON.stringify(r)}})),...t.splice(n).map(String)].join(" ")},e.stringKebabCase=W,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>Te(e,-t),e.supportCanvas=ce,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const a=Date.now(),c=()=>{i=a,e.call(this,...s)};if(0===i)return n?c():void(i=a);i+t-a>0?(clearTimeout(r),r=setTimeout((()=>c()),t)):c()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=Fe,e.typeIs=a,e.uniqueNumber=Ae,e.uniqueString=(e,t)=>{let n=0,r=pe;c(t)?(n=e,r=t):u(e)?n=e:c(e)&&(r=e);let o=ye(Ae(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=Ee(r);return o},e.uniqueSymbol=Ge,e.urlDelParams=(e,t)=>{const n=re(e);return t.forEach((e=>delete n.searchParams[e])),oe(n)},e.urlParse=re,e.urlSetParams=ie,e.urlStringify=oe,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=De,e.weBtoa=Oe}));
6
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).sculpJs={})}(this,(function(e){"use strict";function t(e,t,n=!1){if(n)for(let n=e.length-1;n>=0;n--){const r=t(e[n],n,e);if(!1===r)break}else for(let n=0,r=e.length;n<r;n++){const r=t(e[n],n,e);if(!1===r)break}e=null}const{toString:n,hasOwnProperty:r,propertyIsEnumerable:o}=Object.prototype;function i(e,t){return r.call(e,t)}function s(e){return!!g(e)||(!!c(e)||!!h(e)&&i(e,"length"))}function a(e){return n.call(e).slice(8,-1)}const c=e=>"string"==typeof e,l=e=>"boolean"==typeof e,u=e=>"number"==typeof e&&!Number.isNaN(e),d=e=>void 0===e,f=e=>null===e;function p(e){return d(e)||f(e)}const h=e=>"Object"===a(e),g=e=>Array.isArray(e),m=e=>"function"==typeof e,y=e=>Number.isNaN(e),b=e=>"Date"===a(e);function w(e){if(p(e)||Number.isNaN(e))return!0;const t=a(e);return s(e)||"Arguments"===t?!e.length:"Set"===t||"Map"===t?!e.size:!Object.keys(e).length}function x(e,t){const{successCallback:n,failCallback:r}=p(t)?{}:t,o=function(e){const t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";const r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top=`${r}px`,n.setAttribute("readonly",""),n.value=e,n}(e);document.body.appendChild(o),o.select();try{const e=document.execCommand("copy");m(n)&&n(e)}catch(e){m(r)&&r(e)}finally{document.body.removeChild(o),window.getSelection()?.removeAllRanges()}}function S(e,t,n){const r=[],o="expires";if(r.push([e,encodeURIComponent(t)]),u(n)){const e=new Date;e.setTime(e.getTime()+n),r.push([o,e.toUTCString()])}else b(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const A=e=>b(e)&&!y(e.getTime()),E=e=>{if(!c(e))return;const t=e.replace(/-/g,"/");return new Date(t)},v=e=>{if(!c(e))return;const t=/([+-])(\d\d)(\d\d)$/,n=t.exec(e);if(!n)return;const r=e.replace(t,"Z"),o=new Date(r);if(!A(o))return;const[,i,s,a]=n,l=parseInt(s,10),u=parseInt(a,10),d=(e,t)=>"+"===i?e-t:e+t;return o.setHours(d(o.getHours(),l)),o.setMinutes(d(o.getMinutes(),u)),o};function F(e){const t=new Date(e);if(A(t))return t;const n=E(e);if(A(n))return n;const r=v(e);if(A(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function C(e){const t=F(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}function j(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $=.1,T="function"==typeof Float32Array;function R(e,t){return 1-3*t+3*e}function I(e,t){return 3*t-6*e}function O(e){return 3*e}function D(e,t,n){return((R(t,n)*e+I(t,n))*e+O(t))*e}function M(e,t,n){return 3*R(t,n)*e*e+2*I(t,n)*e+O(t)}function L(e){return e}var N=j((function(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===r)return L;for(var o=T?new Float32Array(11):new Array(11),i=0;i<11;++i)o[i]=D(i*$,e,n);function s(t){for(var r=0,i=1;10!==i&&o[i]<=t;++i)r+=$;--i;var s=r+(t-o[i])/(o[i+1]-o[i])*$,a=M(s,e,n);return a>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var i=M(t,n,r);if(0===i)return t;t-=(D(t,n,r)-e)/i}return t}(t,s,e,n):0===a?s:function(e,t,n,r,o){var i,s,a=0;do{(i=D(s=t+(n-t)/2,r,o)-e)>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<10);return s}(t,r,r+$,e,n)}return function(e){return 0===e?0:1===e?1:D(s(e),t,r)}}));const P={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};const B=e=>{if(!h(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function k(e,t){for(const n in e)if(i(e,n)&&!1===t(e[n],n))break;e=null}function U(e,t){const n={};return k(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const H=(e,t,n)=>{if(d(n))return t;if(a(t)!==a(n))return g(n)?H(e,[],n):h(n)?H(e,{},n):n;if(B(n)){const r=e.get(n);return r||(e.set(n,t),k(n,((n,r)=>{t[r]=H(e,t[r],n)})),t)}if(g(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=H(e,t[r],n)})),t)}return n};function z(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=H(n,e,o)}return n.clear(),e}function W(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const q="0123456789",_="abcdefghijklmnopqrstuvwxyz",G="ABCDEFGHIJKLMNOPQRSTUVWXYZ",V=/%[%sdo]/g;const Y=/\${(.*?)}/g;const K=(e,t)=>{e.split(/\s+/g).forEach(t)};const X=(e,t,n)=>{h(t)?k(t,((t,n)=>{X(e,n,t)})):e.style.setProperty(W(t),n)};function J(e,t=14,n=!0){let r=0;if(console.assert(c(e),`${e} 不是有效的字符串`),c(e)&&e.length>0){const o="getStrWidth1494304949567";let i=document.querySelector(`#${o}`);if(!i){const n=document.createElement("span");n.id=o,n.style.fontSize=t+"px",n.style.whiteSpace="nowrap",n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.textContent=e,document.body.appendChild(n),i=n}i.textContent=e,r=i.offsetWidth,n&&i.remove()}return r}const Z=e=>{const t=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/\.{3,}/g,"..").replace(/\/\.\//g,"/").split("/").map((e=>e.trim())),n=e=>".."===e,r=[];let o=!1;const i=e=>{r.push(e)};return t.forEach((e=>{const t=(e=>"."===e)(e),s=n(e);return o?t?void 0:s?(()=>{if(0===r.length)return;const e=r[r.length-1];n(e)?r.push(".."):r.pop()})():void i(e):(i(e),void(o=!t&&!s))})),r.join("/")},Q=(e,...t)=>Z([e,...t].join("/"));function ee(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())d(n[e])?n[e]=r:g(n[e])||(n[e]=t.getAll(e));return n}const te=e=>c(e)?e:u(e)?String(e):l(e)?e?"true":"false":b(e)?e.toISOString():null;function ne(e,t=te){const n=new URLSearchParams;return k(e,((e,r)=>{if(g(e))e.forEach((e=>{const o=t(e);null!==o&&n.append(r.toString(),o)}));else{const o=t(e);if(null===o)return;n.set(r.toString(),o)}})),n.toString()}const re=(e,t=!0)=>{let n=null;m(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:a,hostname:c,hash:l,search:u,pathname:d}=n,f=Q("/",d),p=o&&i?`${o}:${i}`:"",h=u.replace(/^\?/,"");return n=null,{protocol:r,auth:p,username:o,password:i,host:s,port:a,hostname:c,hash:l,search:u,searchParams:ee(h),query:h,pathname:f,path:`${f}${u}`,href:e}},oe=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,a=n?`${n}@`:"",c=ne(i),l=c?`?${c}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${a}${r}${o}${l}${u}`},ie=(e,t)=>{const n=re(e);return Object.assign(n.searchParams,t),oe(n)};function se(e,t,n){const r=document.createElement("a");r.download=t,r.style.display="none",r.href=e,document.body.appendChild(r),r.click(),setTimeout((()=>{document.body.removeChild(r),m(n)&&n()}))}function ae(e,t,n){const r=URL.createObjectURL(e);se(r,t),setTimeout((()=>{URL.revokeObjectURL(r),m(n)&&n()}))}function ce(){return!!document.createElement("canvas").getContext}function le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r}){let o=n,i=r;return(n>e||r>t)&&(n/r>e/t?(o=e,i=Math.round(e*(r/n))):(i=t,o=Math.round(t*(n/r)))),{width:o,height:i}}function ue(e){return"undefined"!=typeof globalThis?globalThis[e]:"undefined"!=typeof window?window[e]:"undefined"!=typeof global?global[e]:"undefined"!=typeof self?self[e]:void 0}const de=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),fe=`${q}${G}${_}`;const pe=`${q}${G}${_}`,he="undefined"!=typeof BigInt,ge=()=>ue("JSBI"),me=e=>he?BigInt(e):ge().BigInt(e);function ye(e,t=pe){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!he)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=me(e);const r=[],{length:o}=t,i=me(o),s=()=>{const e=Number(((e,t)=>he?e%t:ge().remainder(e,t))(n,i));n=((e,t)=>he?e/t:ge().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const be=(e,t,n={ratio:1e3,decimals:0,separator:" "})=>{const{ratio:r=1e3,decimals:o=0,separator:i=" "}=n,{length:s}=t;if(0===s)throw new Error("At least one unit is required");let a=Number(e),c=0;for(;a>=r&&c<s-1;)a/=r,c++;const l=a.toFixed(o),u=t[c];return String(l)+i+u};function we(e,t){if(p(t))return parseInt(String(e)).toLocaleString();let n=0;if(!u(t))throw new Error("Decimals must be a positive number not less than zero");return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let xe=0,Se=0;const Ae=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==Se&&(Se=t,xe=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${de(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(xe,5);return xe++,`${n}${r}${i}`},Ee=e=>e[de(0,e.length-1)];function ve(e,t,n){let r=250,o=13;const i=e.children[0];J(t,12)<230?(i.style.maxWidth=J(t,12)+20+50+"px",r=n.clientX+(J(t,12)+50)-document.body.offsetWidth):(i.style.maxWidth="250px",r=n.clientX+230-document.body.offsetWidth),i.innerHTML=t,r>0&&(o-=r),e.style.top=n.clientY+23+"px",e.style.left=n.clientX+o+"px",e.style.maxWidth="250px";const s=e.getBoundingClientRect().top+i.offsetHeight-document.body.offsetHeight;s>0&&(e.style.top=n.clientY-s+"px")}const Fe={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=c(e)?document.querySelector(e):e;if(!i)throw new Error(`${e} is not valid Html Element or element selector`);let s=null;const a="style-tooltip-inner1494304949567";if(!document.querySelector(`#${a}`)){const e=document.createElement("style");e.type="text/css",e.id=a,e.innerHTML=`\n .tooltip-inner1494304949567 {\n max-width: 250px;\n padding: 3px 8px;\n color: ${o};\n text-decoration: none;\n border-radius: 4px;\n text-align: left;\n background-color: ${r};\n }\n `,document.querySelector("head").appendChild(e)}if(s=document.querySelector("#customTitle1494304949567"),s)ve(s,t,n);else{const e=document.createElement("div");e.id="customTitle1494304949567",e.style.cssText="z-index: 99999999; visibility: hidden; position: absolute;",e.innerHTML='<div class="tooltip-inner1494304949567" style="word-wrap: break-word; max-width: 44px;">皮肤</div>',i.appendChild(e),s=document.querySelector("#customTitle1494304949567"),t&&(ve(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=c(e)?document.querySelector(e):e,n=document.querySelector("#customTitle1494304949567");t&&n&&t.removeChild(n)}},Ce={keyField:"key",childField:"children",pidField:"pid"},je={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};const $e=(e,t)=>{let n=0;const r=e.toString(),o=t.toString();return void 0!==r.split(".")[1]&&(n+=r.split(".")[1].length),void 0!==o.split(".")[1]&&(n+=o.split(".")[1].length),Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},Te=(e,t)=>{let n=0,r=0,o=0;try{n=e.toString().split(".")[1].length}catch(e){n=0}try{r=t.toString().split(".")[1].length}catch(e){r=0}return o=10**Math.max(n,r),($e(e,o)+$e(t,o))/o};const Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ie=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Oe(e){let t,n,r,o,i="",s=0;const a=(e=String(e)).length,c=a%3;for(;s<a;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");t=n<<16|r<<8|o,i+=Re.charAt(t>>18&63)+Re.charAt(t>>12&63)+Re.charAt(t>>6&63)+Re.charAt(63&t)}return c?i.slice(0,c-3)+"===".substring(c):i}function De(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Ie.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");let t,n,r,o="",i=0;for(const s=(e+="==".slice(2-(3&e.length))).length;i<s;)t=Re.indexOf(e.charAt(i++))<<18|Re.indexOf(e.charAt(i++))<<12|(n=Re.indexOf(e.charAt(i++)))<<6|(r=Re.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}const Me=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Le=/^(?:(?:\+|00)86)?1\d{10}$/,Ne=/^(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|7[1]|8[1-2]|9[1])\d{4}(18|19|20)\d{2}[01]\d[0123]\d{4}[\dxX]$/,Pe=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Be=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,ke=/^(?:(?:\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])$/,Ue=/^(([\da-fA-F]{1,4}:){7}[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,7}:|([\da-fA-F]{1,4}:){1,6}:[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,5}(:[\da-fA-F]{1,4}){1,2}|([\da-fA-F]{1,4}:){1,4}(:[\da-fA-F]{1,4}){1,3}|([\da-fA-F]{1,4}:){1,3}(:[\da-fA-F]{1,4}){1,4}|([\da-fA-F]{1,4}:){1,2}(:[\da-fA-F]{1,4}){1,5}|[\da-fA-F]{1,4}:((:[\da-fA-F]{1,4}){1,6})|:((:[\da-fA-F]{1,4}){1,7}|:)|fe80:(:[\da-fA-F]{0,4}){0,4}%[\da-zA-Z]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d)|([\da-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d))$/i,He=/^(-?[1-9]\d*|0)$/,ze=e=>He.test(e),We=/^-?([1-9]\d*|0)\.\d*[1-9]$/,qe=e=>We.test(e),_e=/^\d+$/;function Ge(e){return[...new Set(e.trim().split(""))].join("")}function Ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ye(e,t){return new RegExp(`${Ve(e.trim())}\\s*([^${Ve(Ge(e))}${Ve(Ge(t))}\\s]*)\\s*${t.trim()}`,"g")}function Ke(e,t,n=new WeakMap){if(Object.is(e,t))return!0;const r=Object.prototype.toString.call(e);if(r!==Object.prototype.toString.call(t))return!1;if(h(e)&&h(t)){if(n.has(e))return n.get(e)===t;n.set(e,t),n.set(t,e)}switch(r){case"[object Date]":return e.getTime()===t.getTime();case"[object RegExp]":return e.toString()===t.toString();case"[object Map]":return function(e,t,n){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Ke(o,t.get(r),n))return!1;return!0}(e,t,n);case"[object Set]":return function(e,t,n){if(e.size!==t.size)return!1;for(const r of e){let e=!1;for(const o of t)if(Ke(r,o,n)){e=!0;break}if(!e)return!1}return!0}(e,t,n);case"[object ArrayBuffer]":return function(e,t){return e.byteLength===t.byteLength&&new DataView(e).getInt32(0)===new DataView(t).getInt32(0)}(e,t);case"[object DataView]":return function(e,t,n){return e.byteLength===t.byteLength&&Ke(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n)}(e,t,n);case"[object Int8Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Int16Array]":case"[object Uint16Array]":case"[object Int32Array]":case"[object Uint32Array]":case"[object Float32Array]":case"[object Float64Array]":return function(e,t,n){return e.byteLength===t.byteLength&&Ke(Array.from(e),Array.from(t),n)}(e,t,n);case"[object Object]":return Xe(e,t,n);case"[object Array]":return function(e,t,n){const r=Object.keys(e).map(Number),o=Object.keys(t).map(Number);if(r.length!==o.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Ke(e[r],t[r],n))return!1;return Xe(e,t,n)}(e,t,n)}return!1}function Xe(e,t,n){const r=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(r.length!==o.length)return!1;for(const i of r){if(!o.includes(i))return!1;if(!Ke(e[i],t[i],n))return!1}return Object.getPrototypeOf(e)===Object.getPrototypeOf(t)}e.EMAIL_REGEX=Me,e.HEX_POOL=pe,e.HTTP_URL_REGEX=Be,e.IPV4_REGEX=ke,e.IPV6_REGEX=Ue,e.PHONE_REGEX=Le,e.STRING_ARABIC_NUMERALS=q,e.STRING_LOWERCASE_ALPHA=_,e.STRING_POOL=fe,e.STRING_UPPERCASE_ALPHA=G,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Pe,e.add=Te,e.addClass=function(e,t){K(t,(t=>e.classList.add(t)))},e.arrayEach=t,e.arrayEachAsync=async function(e,t,n=!1){if(n)for(let n=e.length-1;n>=0&&!1!==await t(e[n],n);n--);else for(let n=0,r=e.length;n<r&&!1!==await t(e[n],n);n++);},e.arrayInsertBefore=function(e,t,n){if(t===n||t+1===n)return;const[r]=e.splice(t,1),o=n<t?n:n-1;e.splice(o,0,r)},e.arrayLike=s,e.arrayRemove=function(e,n){const r=[],o=n;return t(e,((e,t)=>{o(e,t)&&r.push(t)})),r.forEach(((t,n)=>{e.splice(t-n,1)})),e},e.asyncMap=function(e,t,n=1/0){return new Promise(((r,o)=>{const i=e[Symbol.iterator](),s=Math.min(e.length,n),a=[];let c,l=0,u=0;const d=()=>{if(c)return o(c);const n=i.next();if(n.done)return void(l===e.length&&r(a));const s=u++;t(n.value,s,e).then((e=>{l++,a[s]=e,d()})).catch((e=>{c=e,d()}))};for(let e=0;e<s;e++)d()}))},e.calculateDate=function(e,t,n="-"){const r=new Date(e),o=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()+864e5*parseInt(String(t)),i=new Date(o);return i.getFullYear()+n+String(i.getMonth()+1).padStart(2,"0")+"-"+String(i.getDate()).padStart(2,"0")},e.calculateDateTime=function(e,t,n="-",r=":"){const o=new Date(e),i=n,s=r,a=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),c=new Date(a);return c.getFullYear()+i+String(c.getMonth()+1).padStart(2,"0")+i+String(c.getDate()).padStart(2,"0")+" "+String(c.getHours()).padStart(2,"0")+s+String(c.getMinutes()).padStart(2,"0")+s+String(c.getSeconds()).padStart(2,"0")},e.chooseLocalFile=function(e,t){const n=document.createElement("input");n.setAttribute("id",String(Date.now())),n.setAttribute("type","file"),n.setAttribute("style","visibility:hidden"),n.setAttribute("accept",e),document.body.appendChild(n),n.click(),n.onchange=e=>{t(e.target.files),setTimeout((()=>document.body.removeChild(n)))}},e.cloneDeep=function e(t,n=new WeakMap){if(null===t||"object"!=typeof t)return t;if(n.has(t))return n.get(t);if(t instanceof ArrayBuffer){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),n.set(t,e),e}if(ArrayBuffer.isView(t)){return new(0,t.constructor)(e(t.buffer,n),t.byteOffset,t.length)}if(t instanceof Date){const e=new Date(t.getTime());return n.set(t,e),e}if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,n.set(t,e),e}if(t instanceof Map){const r=new Map;return n.set(t,r),t.forEach(((t,o)=>{r.set(e(o,n),e(t,n))})),r}if(t instanceof Set){const r=new Set;return n.set(t,r),t.forEach((t=>{r.add(e(t,n))})),r}if(Array.isArray(t)){const r=new Array(t.length);n.set(t,r);for(let o=0,i=t.length;o<i;o++)o in t&&(r[o]=e(t[o],n));const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o))Object.defineProperty(r,t,{...o[t],value:e(o[t].value,n)});return r}const r=Object.create(Object.getPrototypeOf(t));n.set(t,r);const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o)){const i=o[t];"value"in i?i.value=e(i.value,n):(i.get&&(i.get=e(i.get,n)),i.set&&(i.set=e(i.set,n))),Object.defineProperty(r,t,i)}return r},e.compressImg=function e(t,n={mime:"image/jpeg",minFileSizeKB:50}){if(!(t instanceof File||t instanceof FileList))throw new Error(`${t} require be File or FileList`);if(!ce())throw new Error("Current runtime environment not support Canvas");const{quality:r,mime:o="image/jpeg",maxSize:i,minFileSizeKB:s=50}=h(n)?n:{};let a,c=r;if(r)c=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));c=e<s?1:e<1024?.85:e<5120?.8:.75}return u(i)&&(a=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:a,mime:o,quality:c})))):t instanceof File?new Promise((e=>{const n=[...t.name.split(".").slice(0,-1),{"image/webp":"webp","image/jpeg":"jpg","image/png":"png"}[o]].join("."),r=+parseInt((t.size/1024).toFixed(2));if(r<s)e({file:t});else{const i=new FileReader;i.onload=({target:{result:i}})=>{const s=new Image;s.onload=()=>{const l=document.createElement("canvas"),d=l.getContext("2d"),f=s.width,p=s.height,{width:h,height:g}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(u(t)){const{width:e,height:s}=le({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:a}=le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<5120){const e=1400,t=1400,{width:s,height:a}=le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<10240){const e=1600,t=1600,{width:s,height:a}=le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:a}=le({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}return{width:o,height:i}}({sizeKB:r,maxSize:a,originWidth:f,originHeight:p});l.width=h,l.height=g,d.clearRect(0,0,h,g),d.drawImage(s,0,0,h,g);const m=l.toDataURL(o,c),y=atob(m.split(",")[1]);let b=y.length;const w=new Uint8Array(new ArrayBuffer(b));for(;b--;)w[b]=y.charCodeAt(b);const x=new File([w],n,{type:o});e({file:x,bufferArray:w,origin:t,beforeSrc:i,afterSrc:m,beforeKB:r,afterKB:Number((x.size/1024).toFixed(2))})},s.src=i},i.readAsDataURL(t)}})):Promise.resolve(null)},e.cookieDel=e=>S(e,"",-1),e.cookieGet=function(e){const{cookie:t}=document;if(!t)return"";const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t],[o,i=""]=r.split("=");if(o===e)return decodeURIComponent(i)}return""},e.cookieSet=S,e.copyText=function(e,t){const{successCallback:n,failCallback:r}=p(t)?{}:t;navigator.clipboard?navigator.clipboard.writeText(e).then((()=>{m(n)&&n()})).catch((n=>{x(e,t)})):x(e,t)},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:i}=p(n)?{successCode:200,successCallback:void 0,failCallback:void 0}:n,s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(){if(s.status===r)ae(s.response,t,o);else if(m(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(c(t)&&t.includes("application/json")){const t=new FileReader;t.onload=()=>{i({status:e,response:t.result})},t.readAsText(s.response)}else i(s)}},s.onerror=e=>{m(i)&&i({status:0,code:"ERROR_CONNECTION_REFUSED"})},s.send()},e.dateParse=F,e.dateToEnd=function(e){const t=C(e);return t.setDate(t.getDate()+1),F(t.getTime()-1)},e.dateToStart=C,e.debounce=(e,t)=>{let n,r=!1;const o=function(...o){r||(clearTimeout(n),n=setTimeout((()=>{e.call(this,...o)}),t))};return o.cancel=()=>{clearTimeout(n),r=!0},o},e.decodeFromBase64=function(e){const t=p(ue("atob"))?De(e):ue("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return p(ue("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(ue("TextDecoder"))("utf-8").decode(r)},e.divide=(e,t)=>{let n=0,r=0,o=0,i=0;return void 0!==e.toString().split(".")[1]&&(n=e.toString().split(".")[1].length),void 0!==t.toString().split(".")[1]&&(r=t.toString().split(".")[1].length),o=Number(e.toString().replace(".","")),i=Number(t.toString().replace(".","")),o/i*Math.pow(10,r-n)},e.downloadBlob=ae,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){ae(new Blob([JSON.stringify(e,null,4)]),n)}else{if(!r||!r.length)throw new Error("未传入表头数据");if(!Array.isArray(e))throw new Error("data error! expected array!");const o=r.join(",")+"\n";let i="";e.forEach((e=>{i+=Object.values(e).join(",\t")+",\n"}));se("data:"+{csv:"text/csv",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}[t]+";charset=utf-8,\ufeff"+encodeURIComponent(o+i),n)}},e.downloadHref=se,e.downloadURL=function(e,t){window.open(t?ie(e,t):e)},e.encodeToBase64=function(e){const t=p(ue("TextEncoder"))?function(e){const t=encodeURIComponent(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(e):(new(ue("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return p(ue("btoa"))?Oe(n):ue("btoa")(n)},e.escapeRegExp=Ve,e.executeInScope=function(e,t={}){const n=Object.keys(t),r=n.map((e=>t[e]));try{return new Function(...n,`return (() => { ${e} })()`)(...r)}catch(e){throw new Error(`代码执行失败: ${e.message}`)}},e.fallbackCopyText=x,e.flatTree=function e(n,r=Ce){const{childField:o,keyField:s,pidField:a}=r;let c=[];return t(n,(t=>{const n={...t,[o]:[]};if(i(n,o)&&delete n[o],c.push(n),t[o]){const n=t[o].map((e=>({...e,[a]:t[s]||e.pid})));c=c.concat(e(n,r))}})),c},e.forEachDeep=function(e,t,n="children",r=!1){let o=!1;const i=(s,a,c=0)=>{if(r)for(let r=s.length-1;r>=0&&!o;r--){const l=t(s[r],r,s,e,a,c);if(!1===l){o=!0;break}!0!==l&&s[r]&&Array.isArray(s[r][n])&&i(s[r][n],s[r],c+1)}else for(let r=0,l=s.length;r<l&&!o;r++){const l=t(s[r],r,s,e,a,c);if(!1===l){o=!0;break}!0!==l&&s[r]&&Array.isArray(s[r][n])&&i(s[r][n],s[r],c+1)}};i(e,null),e=null},e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=F(e);let r,o=t;const i={"Y+":`${n.getFullYear()}`,"y+":`${n.getFullYear()}`,"M+":`${n.getMonth()+1}`,"D+":`${n.getDate()}`,"d+":`${n.getDate()}`,"H+":`${n.getHours()}`,"m+":`${n.getMinutes()}`,"s+":`${n.getSeconds()}`,"S+":`${n.getMilliseconds()}`,"w+":["周日","周一","周二","周三","周四","周五","周六"][n.getDay()]};for(const e in i)r=new RegExp("("+e+")").exec(o),r&&(o=o.replace(r[1],1===r[1].length?i[e]:i[e].padStart(r[1].length,"0")));return o},e.formatMoney=we,e.formatNumber=we,e.formatTree=function(e,n=Ce){const{keyField:r,childField:o,pidField:i}=n,s=[],a={};return t(e,(e=>{a[e[r]]=e})),t(e,(e=>{const t=a[e[i]];t?(t[o]||(t[o]=[])).push(e):s.push(e)})),e=null,s},e.fuzzySearchTree=function e(n,r,o=je){if(!i(r,"filter")&&(!i(r,"keyword")||w(r.keyword)))return n;const s=[];return t(n,(t=>{const n=t[o.childField]&&t[o.childField].length>0?e(t[o.childField]||[],r,o):[];((i(r,"filter")?r.filter(t):o.ignoreCase?t[o.nameField].toLowerCase().includes(r.keyword.toLowerCase()):t[o.nameField].includes(r.keyword))||n.length>0)&&(t[o.childField]?n.length>0?s.push({...t,[o.childField]:n}):o.removeEmptyChild?(t[o.childField]&&delete t[o.childField],s.push({...t})):s.push({...t,[o.childField]:[]}):(t[o.childField]&&delete t[o.childField],s.push({...t})))})),s},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:a="middle",font:l="20px PingFangSC-Medium,PingFang SC",fillStyle:u="rgba(189, 177, 167, .3)",rotate:d=-20,zIndex:f=2147483647,watermarkId:h="__wm"}=p(n)?{}:n,g=c(r)?document.querySelector(r):r;if(!g)throw new Error(`${r} is not valid Html Element or element selector`);const m=document.createElement("canvas");m.setAttribute("width",o),m.setAttribute("height",i);const y=m.getContext("2d");y.textAlign=s,y.textBaseline=a,y.font=l,y.fillStyle=u,y.rotate(Math.PI/180*d),y.fillText(t,parseFloat(o)/4,parseFloat(i)/2);const b=m.toDataURL(),w=document.querySelector(`#${h}`),x=w||document.createElement("div"),S=`opacity: 1 !important; display: block !important; visibility: visible !important; position:absolute; left:0; top:0; width:100%; height:100%; z-index:${f}; pointer-events:none; background-repeat:repeat; background-image:url('${b}')`;x.setAttribute("style",S),x.setAttribute("id",h),x.classList.add("nav-height"),w||(g.style.position="relative",g.appendChild(x));const A=window.MutationObserver||window.WebKitMutationObserver;if(A){let r=new A((function(){const o=document.querySelector(`#${h}`);if(o){const{opacity:i,zIndex:s,display:a,visibility:c}=(e=>{const t=getComputedStyle(e);return{opacity:t.getPropertyValue("opacity"),zIndex:t.getPropertyValue("z-index"),display:t.getPropertyValue("display"),visibility:t.getPropertyValue("visibility")}})(o);(o&&o.getAttribute("style")!==S||!o||"1"!==i||"2147483647"!==s||"block"!==a||"visible"!==c)&&(r.disconnect(),r=null,g.removeChild(o),e(t,n))}else r.disconnect(),r=null,e(t,n)}));r.observe(g,{attributes:!0,subtree:!0,childList:!0})}},e.getComputedCssVal=function(e,t,n=!0){const r=getComputedStyle(e).getPropertyValue(t)??"";return n?Number(r.replace(/([0-9]*)(.*)/g,"$1")):r},e.getGlobal=ue,e.getStrWidthPx=J,e.getStyle=function(e,t){return getComputedStyle(e).getPropertyValue(t)},e.hasClass=function(e,t){if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},e.humanFileSize=function(e,t={decimals:0,si:!1,separator:" "}){const{decimals:n=0,si:r=!1,separator:o=" ",baseUnit:i,maxUnit:s}=t;let a=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!p(i)){const e=a.findIndex((e=>e===i));-1!==e&&(a=a.slice(e))}if(!p(s)){const e=a.findIndex((e=>e===s));-1!==e&&a.splice(e+1)}return be(e,a,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=g,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=l,e.isDate=b,e.isDigit=e=>_e.test(e),e.isEmail=e=>Me.test(e),e.isEmpty=w,e.isEqual=function(e,t){return Ke(e,t)},e.isError=e=>"Error"===a(e),e.isFloat=qe,e.isFunction=m,e.isIdNo=e=>{if(!Ne.test(e))return!1;const t=Number(e.slice(6,10)),n=Number(e.slice(10,12)),r=Number(e.slice(12,14)),o=new Date(t,n-1,r);if(!(o.getFullYear()===t&&o.getMonth()+1===n&&o.getDate()===r))return!1;const i=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let s=0;for(let t=0;t<17;t++)s+=Number(e.slice(t,t+1))*i[t];return["1","0","X","9","8","7","6","5","4","3","2"][s%11]===e.slice(-1)},e.isInteger=ze,e.isIpV4=e=>ke.test(e),e.isIpV6=e=>Ue.test(e),e.isJsonString=function(e){try{const t=JSON.parse(e);return"object"==typeof t&&null!==t&&t}catch(e){return!1}},e.isNaN=y,e.isNull=f,e.isNullOrUnDef=p,e.isNullish=p,e.isNumber=u,e.isNumerical=e=>ze(e)||qe(e),e.isObject=h,e.isPhone=e=>Le.test(e),e.isPlainObject=B,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===a(e),e.isString=c,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=d,e.isUrl=(e,t=!1)=>(t?Pe:Be).test(e),e.isValidDate=A,e.mapDeep=function(e,t,n="children",r=!1){let o=!1;const i=[],s=(i,a,c,l=0)=>{if(r)for(let r=i.length-1;r>=0&&!o;r--){const u=t(i[r],r,i,e,a,l);if(!1===u){o=!0;break}!0!==u&&(c.push(U(u,[n])),i[r]&&Array.isArray(i[r][n])?(c[c.length-1][n]=[],s(i[r][n],i[r],c[c.length-1][n],l+1)):delete u[n])}else for(let r=0;r<i.length&&!o;r++){const u=t(i[r],r,i,e,a,l);if(!1===u){o=!0;break}!0!==u&&(c.push(U(u,[n])),i[r]&&Array.isArray(i[r][n])?(c[c.length-1][n]=[],s(i[r][n],i[r],c[c.length-1][n],l+1)):delete u[n])}};return s(e,null,i),e=null,i},e.multiply=$e,e.numberAbbr=be,e.numberToHex=ye,e.objectAssign=z,e.objectEach=k,e.objectEachAsync=async function(e,t){for(const n in e)if(i(e,n)&&!1===await t(e[n],n))break},e.objectFill=function(e,t,n){const r=n||((e,t,n)=>void 0===e[n]);return k(t,((n,o)=>{r(e,t,o)&&(e[o]=n)})),e},e.objectGet=function(e,t,n=!1){const r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".");let o=e,s=0;for(let e=r.length;s<e-1;++s){const e=r[s];if(u(Number(e))&&Array.isArray(o))o=o[e];else{if(!h(o)||!i(o,e)){if(o=void 0,n)throw new Error("[Object] objectGet path 路径不正确");break}o=o[e]}}return{p:o,k:o?r[s]:void 0,v:o?o[r[s]]:void 0}},e.objectHas=i,e.objectMap=function(e,t){const n={};for(const r in e)i(e,r)&&(n[r]=t(e[r],r));return e=null,n},e.objectMerge=z,e.objectOmit=U,e.objectPick=function(e,t){const n={};return k(e,((e,r)=>{t.includes(r)&&(n[r]=e)})),e=null,n},e.once=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.call(this,...r)),t}},e.parseQueryParams=function(e=location.search){const t={};return Array.from(e.matchAll(/[&?]?([^=&]+)=?([^=&]*)/g)).forEach(((e,n)=>{t[e[1]]?"string"==typeof t[e[1]]?t[e[1]]=[t[e[1]],e[2]]:t[e[1]].push(e[2]):t[e[1]]=e[2]})),t},e.parseVarFromString=function(e,t="{",n="}"){return Array.from(e.matchAll(Ye(t,n))).map((e=>p(e)?void 0:e[1]))},e.pathJoin=Q,e.pathNormalize=Z,e.qsParse=ee,e.qsStringify=ne,e.randomNumber=de,e.randomString=(e,t)=>{let n=0,r=fe;c(t)?(n=e,r=t):u(e)?n=e:c(e)&&(r=e);let o=Math.max(n,1),i="";const s=r.length-1;if(s<2)throw new Error("字符串池长度不能少于 2");for(;o--;){i+=r[de(0,s)]}return i},e.randomUuid=function(){if("undefined"==typeof URL||!URL.createObjectURL||"undefined"==typeof Blob){const e="0123456789abcdef",t="xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx";let n="";for(let r=0;r<t.length;r++){const o=de(0,15);n+="-"==t[r]||"4"==t[r]?t[r]:e[o]}return n}return/[^/]+$/.exec(URL.createObjectURL(new Blob).slice())[0]},e.removeClass=function(e,t){K(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Ye(n,r)),(function(e,n){return i(t,n)?t[n]:e}))},e.searchTreeById=function(e,t,n){const{children:r="children",id:o="id"}=n||{},i=(e,t,n)=>e.reduce(((e,s)=>{const a=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...a&&a.length?i(a,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let a=[t],c=[s];for(;n&&n.parentId;)a=[n.parentId,...a],c=[n.parent,...c],n=e.find((e=>e[o]===n.parentId));return[a,c]})(i(e))},e.setGlobal=function(e,t){if("undefined"!=typeof globalThis)globalThis[e]=t;else if("undefined"!=typeof window)window[e]=t;else if("undefined"!=typeof global)global[e]=t;else{if("undefined"==typeof self)throw new SyntaxError("当前环境下无法设置全局属性");self[e]=t}},e.setStyle=X,e.smoothScroll=function(e){return new Promise((n=>{const r={el:document,to:0,duration:567,easing:"ease"},{el:o,to:i,duration:s,easing:a}=z(r,e),c=document.documentElement,l=document.body,u=o===window||o===document||o===c||o===l?[c,l]:[o];let d;const f=(()=>{let e=0;return t(u,(t=>{if("scrollTop"in t)return e=t.scrollTop,!1})),e})(),p=i-f,h=function(e){let t;if(g(e))t=N(...e);else{const n=P[e];if(!n)throw new Error(`${e} 缓冲函数未定义`);t=N(...n)}return e=>t(Math.max(0,Math.min(e,1)))}(a),m=()=>{const e=performance.now(),t=(d?e-d:0)/s,r=h(t);var o;d||(d=e),o=f+p*r,u.forEach((e=>{"scrollTop"in e&&(e.scrollTop=o)})),t>=1?n():requestAnimationFrame(m)};m()}))},e.stringAssign=(e,t)=>e.replace(Y,((e,n)=>((e,t)=>{try{return new Function(`with(arguments[0]){if(arguments[0].${e} === undefined)throw "";return String(arguments[0].${e})}`)(t)}catch(t){throw new SyntaxError(`无法执行表达式:${e}`)}})(n,t))),e.stringCamelCase=function(e,t){let n=e;return t&&(n=e.replace(/^./,(e=>e.toUpperCase()))),n.replace(/[\s_-](.)/g,((e,t)=>t.toUpperCase()))},e.stringEscapeHtml=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};return e.replace(/[&<>"]/g,(e=>t[e]))},e.stringFill=(e,t=" ")=>new Array(e).fill(t).join(""),e.stringFormat=function(e,...t){let n=0;return[e.replace(V,(e=>{const r=t[n++];switch(e){case"%%":return n--,"%";default:case"%s":return String(r);case"%d":return String(Number(r));case"%o":return JSON.stringify(r)}})),...t.splice(n).map(String)].join(" ")},e.stringKebabCase=W,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>Te(e,-t),e.supportCanvas=ce,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const a=Date.now(),c=()=>{i=a,e.call(this,...s)};if(0===i)return n?c():void(i=a);i+t-a>0?(clearTimeout(r),r=setTimeout((()=>c()),t)):c()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=Fe,e.typeIs=a,e.uniqueNumber=Ae,e.uniqueString=(e,t)=>{let n=0,r=pe;c(t)?(n=e,r=t):u(e)?n=e:c(e)&&(r=e);let o=ye(Ae(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=Ee(r);return o},e.uniqueSymbol=Ge,e.urlDelParams=(e,t)=>{const n=re(e);return t.forEach((e=>delete n.searchParams[e])),oe(n)},e.urlParse=re,e.urlSetParams=ie,e.urlStringify=oe,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=De,e.weBtoa=Oe}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sculp-js",
3
- "version": "1.11.0",
3
+ "version": "1.11.1-alpha.1",
4
4
  "packageManager": "npm@8.19.2",
5
5
  "description": "js utils library, includes function library、class library",
6
6
  "scripts": {