sculp-js 1.17.0 → 1.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/cjs/array.js +69 -1
  2. package/dist/cjs/async.js +1 -1
  3. package/dist/cjs/base64.js +1 -1
  4. package/dist/cjs/clipboard.js +1 -1
  5. package/dist/cjs/cloneDeep.js +1 -1
  6. package/dist/cjs/cookie.js +1 -1
  7. package/dist/cjs/date.js +1 -1
  8. package/dist/cjs/dom.js +1 -1
  9. package/dist/cjs/download.js +1 -1
  10. package/dist/cjs/file.js +1 -1
  11. package/dist/cjs/func.js +1 -1
  12. package/dist/cjs/index.js +2 -1
  13. package/dist/cjs/isEqual.js +1 -1
  14. package/dist/cjs/math.js +1 -1
  15. package/dist/cjs/number.js +1 -1
  16. package/dist/cjs/object.js +1 -1
  17. package/dist/cjs/path.js +1 -1
  18. package/dist/cjs/qs.js +1 -1
  19. package/dist/cjs/random.js +1 -1
  20. package/dist/cjs/string.js +1 -1
  21. package/dist/cjs/tooltip.js +1 -1
  22. package/dist/cjs/tree.js +1 -1
  23. package/dist/cjs/type.js +1 -1
  24. package/dist/cjs/unique.js +1 -1
  25. package/dist/cjs/url.js +1 -1
  26. package/dist/cjs/validator.js +1 -1
  27. package/dist/cjs/variable.js +1 -1
  28. package/dist/cjs/watermark.js +1 -1
  29. package/dist/esm/array.js +69 -2
  30. package/dist/esm/async.js +1 -1
  31. package/dist/esm/base64.js +1 -1
  32. package/dist/esm/clipboard.js +1 -1
  33. package/dist/esm/cloneDeep.js +1 -1
  34. package/dist/esm/cookie.js +1 -1
  35. package/dist/esm/date.js +1 -1
  36. package/dist/esm/dom.js +1 -1
  37. package/dist/esm/download.js +1 -1
  38. package/dist/esm/file.js +1 -1
  39. package/dist/esm/func.js +1 -1
  40. package/dist/esm/index.js +2 -2
  41. package/dist/esm/isEqual.js +1 -1
  42. package/dist/esm/math.js +1 -1
  43. package/dist/esm/number.js +1 -1
  44. package/dist/esm/object.js +1 -1
  45. package/dist/esm/path.js +1 -1
  46. package/dist/esm/qs.js +1 -1
  47. package/dist/esm/random.js +1 -1
  48. package/dist/esm/string.js +1 -1
  49. package/dist/esm/tooltip.js +1 -1
  50. package/dist/esm/tree.js +1 -1
  51. package/dist/esm/type.js +1 -1
  52. package/dist/esm/unique.js +1 -1
  53. package/dist/esm/url.js +1 -1
  54. package/dist/esm/validator.js +1 -1
  55. package/dist/esm/variable.js +1 -1
  56. package/dist/esm/watermark.js +1 -1
  57. package/dist/types/array.d.ts +51 -0
  58. package/dist/umd/index.min.js +2 -2
  59. package/package.json +1 -1
package/dist/cjs/array.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -97,8 +97,76 @@ function arrayRemove(array, expect) {
97
97
  });
98
98
  return array;
99
99
  }
100
+ /**
101
+ * Compare source array and target array, return diff result (added / removed).
102
+ *
103
+ * - If `getKey` is not provided:
104
+ * - Primitive values (string | number | symbol) will be used as keys directly.
105
+ * - If `getKey` is provided:
106
+ * - It will be used to extract unique keys from items.
107
+ *
108
+ * @template T
109
+ * @param source - Source array (original data)
110
+ * @param target - Target array (new data)
111
+ * @param getKey - Optional function to get unique key
112
+ *
113
+ * @returns DiffResult<T>
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * diffArray([1, 2, 3], [2, 3, 4])
118
+ * // => { added: [4], removed: [1] }
119
+ * ```
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * diffArray(['a', 'b'], ['b', 'c'])
124
+ * // => { added: ['c'], removed: ['a'] }
125
+ * ```
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * diffArray(
130
+ * [{ id: 1 }, { id: 2 }],
131
+ * [{ id: 2 }, { id: 3 }],
132
+ * item => item.id
133
+ * )
134
+ * // => { added: [{ id: 3 }], removed: [{ id: 1 }] }
135
+ * ```
136
+ */
137
+ function diffArray(source, target, getKey) {
138
+ const resolveKey = item => {
139
+ if (getKey) return getKey(item);
140
+ if (typeof item === 'string' || typeof item === 'number' || typeof item === 'symbol') {
141
+ return item;
142
+ }
143
+ throw new Error('diffArray: getKey is required when item is not a primitive value');
144
+ };
145
+ const sourceMap = new Map();
146
+ const targetMap = new Map();
147
+ for (const item of source) {
148
+ sourceMap.set(resolveKey(item), item);
149
+ }
150
+ for (const item of target) {
151
+ targetMap.set(resolveKey(item), item);
152
+ }
153
+ const added = [];
154
+ const del = [];
155
+ for (const [key, item] of targetMap) {
156
+ if (!sourceMap.has(key)) {
157
+ added.push(item);
158
+ }
159
+ }
160
+ for (const [key, item] of sourceMap) {
161
+ if (!targetMap.has(key)) {
162
+ del.push(item);
163
+ }
164
+ }
165
+ return { added, removed: del };
166
+ }
100
167
 
101
168
  exports.arrayEach = arrayEach;
102
169
  exports.arrayEachAsync = arrayEachAsync;
103
170
  exports.arrayInsertBefore = arrayInsertBefore;
104
171
  exports.arrayRemove = arrayRemove;
172
+ exports.diffArray = diffArray;
package/dist/cjs/async.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/date.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/file.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/func.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -38,6 +38,7 @@ exports.arrayEach = array.arrayEach;
38
38
  exports.arrayEachAsync = array.arrayEachAsync;
39
39
  exports.arrayInsertBefore = array.arrayInsertBefore;
40
40
  exports.arrayRemove = array.arrayRemove;
41
+ exports.diffArray = array.diffArray;
41
42
  exports.copyText = clipboard.copyText;
42
43
  exports.fallbackCopyText = clipboard.fallbackCopyText;
43
44
  exports.cookieDel = cookie.cookieDel;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/path.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/qs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/tree.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/type.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/url.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/array.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -95,5 +95,72 @@ function arrayRemove(array, expect) {
95
95
  });
96
96
  return array;
97
97
  }
98
+ /**
99
+ * Compare source array and target array, return diff result (added / removed).
100
+ *
101
+ * - If `getKey` is not provided:
102
+ * - Primitive values (string | number | symbol) will be used as keys directly.
103
+ * - If `getKey` is provided:
104
+ * - It will be used to extract unique keys from items.
105
+ *
106
+ * @template T
107
+ * @param source - Source array (original data)
108
+ * @param target - Target array (new data)
109
+ * @param getKey - Optional function to get unique key
110
+ *
111
+ * @returns DiffResult<T>
112
+ *
113
+ * @example
114
+ * ```ts
115
+ * diffArray([1, 2, 3], [2, 3, 4])
116
+ * // => { added: [4], removed: [1] }
117
+ * ```
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * diffArray(['a', 'b'], ['b', 'c'])
122
+ * // => { added: ['c'], removed: ['a'] }
123
+ * ```
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * diffArray(
128
+ * [{ id: 1 }, { id: 2 }],
129
+ * [{ id: 2 }, { id: 3 }],
130
+ * item => item.id
131
+ * )
132
+ * // => { added: [{ id: 3 }], removed: [{ id: 1 }] }
133
+ * ```
134
+ */
135
+ function diffArray(source, target, getKey) {
136
+ const resolveKey = item => {
137
+ if (getKey) return getKey(item);
138
+ if (typeof item === 'string' || typeof item === 'number' || typeof item === 'symbol') {
139
+ return item;
140
+ }
141
+ throw new Error('diffArray: getKey is required when item is not a primitive value');
142
+ };
143
+ const sourceMap = new Map();
144
+ const targetMap = new Map();
145
+ for (const item of source) {
146
+ sourceMap.set(resolveKey(item), item);
147
+ }
148
+ for (const item of target) {
149
+ targetMap.set(resolveKey(item), item);
150
+ }
151
+ const added = [];
152
+ const del = [];
153
+ for (const [key, item] of targetMap) {
154
+ if (!sourceMap.has(key)) {
155
+ added.push(item);
156
+ }
157
+ }
158
+ for (const [key, item] of sourceMap) {
159
+ if (!targetMap.has(key)) {
160
+ del.push(item);
161
+ }
162
+ }
163
+ return { added, removed: del };
164
+ }
98
165
 
99
- export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayRemove };
166
+ export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayRemove, diffArray };
package/dist/esm/async.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/date.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/file.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/func.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
7
- export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayRemove } from './array.js';
7
+ export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayRemove, diffArray } from './array.js';
8
8
  export { copyText, fallbackCopyText } from './clipboard.js';
9
9
  export { cookieDel, cookieGet, cookieSet } from './cookie.js';
10
10
  export {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/path.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/qs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/tree.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/type.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/url.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
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.17.0
2
+ * sculp-js v1.17.2
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -47,3 +47,54 @@ export declare function arrayInsertBefore(array: AnyArray, start: number, to: nu
47
47
  * @returns {V[]}
48
48
  */
49
49
  export declare function arrayRemove<V>(array: V[], expect: (val: V, idx: number) => boolean): V[];
50
+ /**
51
+ * Diff result type
52
+ */
53
+ export interface DiffResult<T> {
54
+ /** Items that exist in target but not in source */
55
+ added: T[];
56
+ /** Items that exist in source but not in target */
57
+ removed: T[];
58
+ }
59
+ /**
60
+ * Get unique key function
61
+ */
62
+ export type GetKey<T> = (item: T) => string | number | symbol;
63
+ /**
64
+ * Compare source array and target array, return diff result (added / removed).
65
+ *
66
+ * - If `getKey` is not provided:
67
+ * - Primitive values (string | number | symbol) will be used as keys directly.
68
+ * - If `getKey` is provided:
69
+ * - It will be used to extract unique keys from items.
70
+ *
71
+ * @template T
72
+ * @param source - Source array (original data)
73
+ * @param target - Target array (new data)
74
+ * @param getKey - Optional function to get unique key
75
+ *
76
+ * @returns DiffResult<T>
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * diffArray([1, 2, 3], [2, 3, 4])
81
+ * // => { added: [4], removed: [1] }
82
+ * ```
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * diffArray(['a', 'b'], ['b', 'c'])
87
+ * // => { added: ['c'], removed: ['a'] }
88
+ * ```
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * diffArray(
93
+ * [{ id: 1 }, { id: 2 }],
94
+ * [{ id: 2 }, { id: 3 }],
95
+ * item => item.id
96
+ * )
97
+ * // => { added: [{ id: 3 }], removed: [{ id: 1 }] }
98
+ * ```
99
+ */
100
+ export declare function diffArray<T>(source: readonly T[], target: readonly T[], getKey?: GetKey<T>): DiffResult<T>;
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * sculp-js v1.17.0
2
+ * sculp-js v1.17.2
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}=Object.prototype;function o(e,t){return r.call(e,t)}function i(e){return!!p(e)||(!!l(e)||!!h(e)&&o(e,"length"))}function s(e){return n.call(e).slice(8,-1)}const l=e=>"string"==typeof e,a=e=>"boolean"==typeof e,c=e=>"number"==typeof e&&!Number.isNaN(e),u=e=>void 0===e,d=e=>null===e;function f(e){return u(e)||d(e)}const h=e=>"Object"===s(e),p=e=>Array.isArray(e),g=e=>"function"==typeof e,m=e=>Number.isNaN(e),y=e=>"Date"===s(e);function b(e){return!u(NodeList)&&NodeList.prototype.isPrototypeOf(e)}const w=e=>{if(!h(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function x(e,t){for(const n in e)if(o(e,n)&&!1===t(e[n],n))break;e=null}function S(e,t){const n={};return x(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const A=(e,t,n)=>{if(u(n))return t;if(s(t)!==s(n))return p(n)?A(e,[],n):h(n)?A(e,{},n):n;if(w(n)){const r=e.get(n);return r||(e.set(n,t),x(n,((n,r)=>{t[r]=A(e,t[r],n)})),t)}if(p(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=A(e,t[r],n)})),t)}return n};function E(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=A(n,e,o)}return n.clear(),e}function v(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const F="0123456789",C="abcdefghijklmnopqrstuvwxyz",T="ABCDEFGHIJKLMNOPQRSTUVWXYZ",R=/%[%sdo]/g;const $=/\${(.*?)}/g;const N=(e,t)=>{e.split(/\s+/g).forEach(t)};const j=(e,t,n)=>{h(t)?x(t,((t,n)=>{j(e,n,t)})):e.style.setProperty(v(t),n)};function D(e,t=14,n=!0){let r=0;if(console.assert(l(e),`${e} 不是有效的字符串`),l(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}function k(e){let t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){const n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}function L(e,t){const{successCallback:n,failCallback:r,container:o=document.body}=f(t)?{}:t;let i=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);o.appendChild(i),k(i);try{document.execCommand("copy")&&g(n)&&n()}catch(e){g(r)&&r(e)}finally{o.removeChild(i),i=null,window.getSelection()?.removeAllRanges()}}function O(e,t,n){const r=[],o="expires";if(r.push([e,encodeURIComponent(t)]),c(n)){const e=new Date;e.setTime(e.getTime()+n),r.push([o,e.toUTCString()])}else y(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const I=e=>y(e)&&!m(e.getTime()),M=e=>{if(!l(e))return;const t=e.replace(/-/g,"/");return new Date(t)},P=e=>{if(!l(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(!I(o))return;const[,i,s,a]=n,c=parseInt(s,10),u=parseInt(a,10),d=(e,t)=>"+"===i?e-t:e+t;return o.setHours(d(o.getHours(),c)),o.setMinutes(d(o.getMinutes(),u)),o};function B(e){const t=new Date(e);if(I(t))return t;const n=M(e);if(I(n))return n;const r=P(e);if(I(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function U(e){const t=B(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}const H=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("/")},z=(e,...t)=>H([e,...t].join("/"));function W(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())u(n[e])?n[e]=r:p(n[e])||(n[e]=t.getAll(e));return n}const _=e=>l(e)?e:c(e)?String(e):a(e)?e?"true":"false":y(e)?e.toISOString():null;function q(e,t=_){const n=new URLSearchParams;return x(e,((e,r)=>{if(p(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 G=(e,t=!0)=>{let n=null;g(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:l,hostname:a,hash:c,search:u,pathname:d}=n,f=z("/",d),h=o&&i?`${o}:${i}`:"",p=u.replace(/^\?/,"");return n=null,{protocol:r,auth:h,username:o,password:i,host:s,port:l,hostname:a,hash:c,search:u,searchParams:W(p),query:p,pathname:f,path:`${f}${u}`,href:e}},Y=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,l=n?`${n}@`:"",a=q(i),c=a?`?${a}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${l}${r}${o}${c}${u}`},V=(e,t)=>{const n=G(e);return Object.assign(n.searchParams,t),Y(n)};function X(e,t,n){let 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),r=null,g(n)&&n()}))}function K(e,t,n){const r=URL.createObjectURL(e);X(r,t),setTimeout((()=>{URL.revokeObjectURL(r),g(n)&&n()}))}function J(){return!!document.createElement("canvas").getContext}function Z({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 Q(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 ee=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),te=`${F}${T}${C}`;const ne=`${F}${T}${C}`,re="undefined"!=typeof BigInt,oe=()=>Q("JSBI"),ie=e=>re?BigInt(e):oe().BigInt(e);function se(e,t=ne){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!re)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=ie(e);const r=[],{length:o}=t,i=ie(o),s=()=>{const e=Number(((e,t)=>re?e%t:oe().remainder(e,t))(n,i));n=((e,t)=>re?e/t:oe().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const le=(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 l=Number(e),a=0;for(;l>=r&&a<s-1;)l/=r,a++;const c=l.toFixed(o),u=t[a];return String(c)+i+u};function ae(e,t){if(f(t))return parseInt(String(e)).toLocaleString();let n=0;return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let ce=0,ue=0;const de=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==ue&&(ue=t,ce=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${ee(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(ce,5);return ce++,`${n}${r}${i}`},fe=e=>e[ee(0,e.length-1)];function he(e,t,n){let r=250,o=13;const i=e.children[0];D(t,12)<230?(i.style.maxWidth=D(t,12)+20+50+"px",r=n.clientX+(D(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 pe={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=l(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)he(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&&(he(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=l(e)?document.querySelector(e):e;let n=document.querySelector("#customTitle1494304949567");t&&n&&(t.removeChild(n),n=null)}},ge={keyField:"key",childField:"children",pidField:"pid"},me={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};function ye(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const{childField:r="children",reverse:o=!1,breadthFirst:i=!1,isDomNode:s=!1}=h(n)?n:{};let l=!1;const a=[],c=(n,o,u=0)=>{for(let d=n.length-1;d>=0&&!l;d--){const f=n[d];if(i)a.push({item:f,index:d,array:n,tree:e,parent:o,level:u});else{const i=t(f,d,n,e,o,u);if(!1===i){l=!0;break}if(!0===i)continue;f&&(s?b(f[r]):Array.isArray(f[r]))&&c(f[r],f,u+1)}}if(i)for(;a.length>0&&!l;){const e=a.shift(),{item:n,index:o,array:i,tree:u,parent:d,level:f}=e,h=t(n,o,i,u,d,f);if(!1===h){l=!0;break}!0!==h&&(n&&(s?b(n[r]):Array.isArray(n[r]))&&c(n[r],n,f+1))}},u=(n,o,c=0)=>{for(let d=0,f=n.length;d<f&&!l;d++){const f=n[d];if(i)a.push({item:f,index:d,array:n,tree:e,parent:o,level:c});else{const i=t(f,d,n,e,o,c);if(!1===i){l=!0;break}if(!0===i)continue;f&&(s?b(f[r]):Array.isArray(f[r]))&&u(f[r],f,c+1)}}if(i)for(;a.length>0&&!l;){const e=a.shift();if(!e)break;const{item:n,index:o,array:i,tree:c,parent:d,level:f}=e,h=t(n,o,i,c,d,f);if(!1===h){l=!0;break}!0!==h&&(n&&(s?b(n[r]):Array.isArray(n[r]))&&u(n[r],n,f+1))}};o?c(e,null,0):u(e,null,0),e=null}const be=(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)},we=(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),(be(e,o)+be(t,o))/o};const xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Se=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Ae(e){let t,n,r,o,i="",s=0;const l=(e=String(e)).length,a=l%3;for(;s<l;){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+=xe.charAt(t>>18&63)+xe.charAt(t>>12&63)+xe.charAt(t>>6&63)+xe.charAt(63&t)}return a?i.slice(0,a-3)+"===".substring(a):i}function Ee(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Se.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=xe.indexOf(e.charAt(i++))<<18|xe.indexOf(e.charAt(i++))<<12|(n=xe.indexOf(e.charAt(i++)))<<6|(r=xe.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 ve=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Fe=/^(?:(?:\+|00)86)?1\d{10}$/,Ce=/^(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]$/,Te=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Re=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,$e=/^(?:(?:\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])$/,Ne=/^(([\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,je=/^(-?[1-9]\d*|0)$/,De=e=>je.test(e),ke=/^-?([1-9]\d*|0)\.\d*[1-9]$/,Le=e=>ke.test(e),Oe=/^\d+$/;function Ie(e){return[...new Set(e.trim().split(""))].join("")}function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t){return new RegExp(`${Me(e.trim())}\\s*([^${Me(Ie(e))}${Me(Ie(t))}\\s]*)\\s*${t.trim()}`,"g")}const Be={MAP:"[object Map]",SET:"[object Set]",DATE:"[object Date]",REGEXP:"[object RegExp]",SYMBOL:"[object Symbol]",ARRAY_BUFFER:"[object ArrayBuffer]",DATA_VIEW:"[object DataView]",ARGUMENTS:"[object Arguments]"},{toString:Ue,hasOwnProperty:He}=Object.prototype,ze=e=>Ue.call(e);function We(e,t,n=void 0){if(e===t)return!0;if(e!=e&&t!=t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e.constructor!==t.constructor)return!1;if(n||(n=new WeakMap),n.has(e))return n.get(e)===t;n.set(e,t);const r=ze(e);if(r!==ze(t))return!1;let o=!1;switch(r){case Be.DATE:o=+e==+t;break;case Be.REGEXP:o=""+e==""+t;break;case Be.SYMBOL:o=Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t);break;case Be.ARRAY_BUFFER:o=_e(e,t);break;case Be.DATA_VIEW:s=t,o=(i=e).byteLength===s.byteLength&&i.byteOffset===s.byteOffset&&_e(i.buffer,s.buffer);break;case Be.MAP:o=function(e,t,n){if(e.size!==t.size)return!1;for(const[r,o]of e){const e=t.get(r);if(void 0===e&&!t.has(r))return!1;if(!We(o,e,n))return!1}return!0}(e,t,n);break;case Be.SET:o=function(e,t,n){if(e.size!==t.size)return!1;for(const r of e){if(t.has(r))continue;let e=!1;for(const o of t)if(We(r,o,n)){e=!0;break}if(!e)return!1}return!0}(e,t,n);break;case Be.ARGUMENTS:default:o=Array.isArray(e)||ArrayBuffer.isView(e)?function(e,t,n){const r=e.length;if(r!==t.length)return!1;let o=r;for(;o--;)if(!We(e[o],t[o],n))return!1;return!0}(e,t,n):function(e,t,n){const r=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(r.length!==o.length)return!1;for(let o=0;o<r.length;o++){const i=r[o];if(!He.call(t,i)||!We(e[i],t[i],n))return!1}return!0}(e,t,n)}var i,s;return o}function _e(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new Uint8Array(e),r=new Uint8Array(t);let o=e.byteLength;for(;o--;)if(n[o]!==r[o])return!1;return!0}e.EMAIL_REGEX=ve,e.HEX_POOL=ne,e.HTTP_URL_REGEX=Re,e.IPV4_REGEX=$e,e.IPV6_REGEX=Ne,e.PHONE_REGEX=Fe,e.STRING_ARABIC_NUMERALS=F,e.STRING_LOWERCASE_ALPHA=C,e.STRING_POOL=te,e.STRING_UPPERCASE_ALPHA=T,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Te,e.add=we,e.addClass=function(e,t){N(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=i,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),l=[];let a,c=0,u=0;const d=()=>{if(a)return o(a);const n=i.next();if(n.done)return void(c===e.length&&r(l));const s=u++;t(n.value,s,e).then((e=>{c++,l[s]=e,d()})).catch((e=>{a=e,d()}))};for(let e=0;e<s;e++)d()}))},e.b64decode=function(e){const t=f(Q("atob"))?Ee(e):Q("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return f(Q("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(Q("TextDecoder"))("utf-8").decode(r)},e.b64encode=function(e){const t=f(Q("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(Q("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return f(Q("btoa"))?Ae(n):Q("btoa")(n)},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,l=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),a=new Date(l);return a.getFullYear()+i+String(a.getMonth()+1).padStart(2,"0")+i+String(a.getDate()).padStart(2,"0")+" "+String(a.getHours()).padStart(2,"0")+s+String(a.getMinutes()).padStart(2,"0")+s+String(a.getSeconds()).padStart(2,"0")},e.chooseLocalFile=function(e,t){let 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),n=null}))}},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(!J())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 l,a=r;if(r)a=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));a=e<s?1:e<1024?.85:e<5120?.8:.75}return c(i)&&(l=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:l,mime:o,quality:a})))):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 u=document.createElement("canvas"),d=u.getContext("2d"),f=s.width,h=s.height,{width:p,height:g}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(c(t)){const{width:e,height:s}=Z({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(e<5120){const e=1400,t=1400,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(e<10240){const e=1600,t=1600,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}return{width:o,height:i}}({sizeKB:r,maxSize:l,originWidth:f,originHeight:h});u.width=p,u.height=g,d.clearRect(0,0,p,g),d.drawImage(s,0,0,p,g);const m=u.toDataURL(o,a),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=>O(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=O,e.copyText=function(e,t){const{successCallback:n,failCallback:r}=f(t)?{}:t;navigator.clipboard?navigator.clipboard.writeText(e).then((()=>{g(n)&&n()})).catch((n=>{L(e,t)})):L(e,t)},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:i}=f(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)K(s.response,t,o);else if(g(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(l(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=>{g(i)&&i({status:0,code:"ERROR_CONNECTION_REFUSED"})},s.send()},e.dateParse=B,e.dateToEnd=function(e){const t=U(e);return t.setDate(t.getDate()+1),B(t.getTime()-1)},e.dateToStart=U,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.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=K,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){K(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"}));X("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=X,e.downloadURL=function(e,t){window.open(t?V(e,t):e)},e.escapeRegExp=Me,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=L,e.filterDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const r=[];return ye(e,((...e)=>{t(...e)&&r.push(e[0])}),n),r},e.findDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){let r=null;return ye(e,((...e)=>{if(t(...e))return r=e[0],!1}),n),r},e.flatTree=function e(t,n=ge){const{keyField:r="key",childField:i="children",pidField:s="pid"}=h(n)?n:{};let l=[];for(let a=0,c=t.length;a<c;a++){const c=t[a],u={...c,[i]:[]};if(o(u,i)&&delete u[i],l.push(u),c[i]){const t=c[i].map((e=>({...e,[s]:c[r]||e.pid})));l=l.concat(e(t,n))}}return l},e.forEachDeep=ye,e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=B(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=ae,e.formatNumber=ae,e.formatTree=function(e,t=ge){const{keyField:n="key",childField:r="children",pidField:o="pid"}=h(t)?t:{},i=[],s={};for(let t=0,r=e.length;t<r;t++){const r=e[t];s[r[n]]=r}for(let t=0,n=e.length;t<n;t++){const n=e[t],l=s[n[o]];l?(l[r]||(l[r]=[])).push(n):i.push(n)}return e=null,i},e.fuzzySearchTree=function e(t,n,r=me){if(!o(n,"filter")&&!n.keyword)return t;const i=[];for(let s=0,l=t.length;s<l;s++){const l=t[s],a=l[r.childField]&&l[r.childField].length>0?e(l[r.childField]||[],n,r):[];if((o(n,"filter")?n.filter(l):r.ignoreCase?l[r.nameField].toLowerCase().includes(n.keyword.toLowerCase()):l[r.nameField].includes(n.keyword))||a.length>0)if(l[r.childField])if(a.length>0)i.push({...l,[r.childField]:a});else if(r.removeEmptyChild){const{[r.childField]:e,...t}=l;i.push(t)}else i.push({...l,[r.childField]:[]});else{const{[r.childField]:e,...t}=l;i.push(t)}}return i},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:a="middle",font:c="20px PingFangSC-Medium,PingFang SC",fillStyle:u="rgba(189, 177, 167, .3)",rotate:d=-20,zIndex:h=2147483647,watermarkId:p="__wm"}=f(n)?{}:n,g=l(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=c,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(`#${p}`),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:${h}; pointer-events:none; background-repeat:repeat; background-image:url('${b}')`;x.setAttribute("style",S),x.setAttribute("id",p),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(){let o=document.querySelector(`#${p}`);if(o){const{opacity:i,zIndex:s,display:l,visibility:a}=(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"!==l||"visible"!==a)&&(r.disconnect(),r=null,g.removeChild(o),o=null,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=Q,e.getStrWidthPx=D,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 l=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!f(i)){const e=l.findIndex((e=>e===i));-1!==e&&(l=l.slice(e))}if(!f(s)){const e=l.findIndex((e=>e===s));-1!==e&&l.splice(e+1)}return le(e,l,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=p,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=a,e.isDate=y,e.isDigit=e=>Oe.test(e),e.isEmail=e=>ve.test(e),e.isEmpty=function(e){if(f(e)||Number.isNaN(e))return!0;const t=s(e);return i(e)||"Arguments"===t?!e.length:"Set"===t||"Map"===t?!e.size:!Object.keys(e).length},e.isEqual=function(e,t){return We(e,t)},e.isError=e=>"Error"===s(e),e.isFloat=Le,e.isFunction=g,e.isIdNo=e=>{if(!Ce.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=De,e.isIpV4=e=>$e.test(e),e.isIpV6=e=>Ne.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=m,e.isNodeList=b,e.isNull=d,e.isNullOrUnDef=f,e.isNullish=f,e.isNumber=c,e.isNumerical=e=>De(e)||Le(e),e.isObject=h,e.isPhone=e=>Fe.test(e),e.isPlainObject=w,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===s(e),e.isString=l,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=u,e.isUrl=(e,t=!1)=>(t?Te:Re).test(e),e.isValidDate=I,e.mapDeep=function(e,t,n={childField:"children",reverse:!1}){const{childField:r="children",reverse:o=!1}=h(n)?n:{};let i=!1;const s=[],l=(n,s,a,c=0)=>{if(o)for(let o=n.length-1;o>=0&&!i;o--){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(a.push(S(d,[r])),u&&Array.isArray(u[r])?(a[a.length-1][r]=[],l(u[r],u,a[a.length-1][r],c+1)):delete d[r])}else for(let o=0;o<n.length&&!i;o++){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(a.push(S(d,[r])),u&&Array.isArray(u[r])?(a[a.length-1][r]=[],l(u[r],u,a[a.length-1][r],c+1)):delete d[r])}};return l(e,null,s),e=null,s},e.multiply=be,e.numberAbbr=le,e.numberToHex=se,e.objectAssign=E,e.objectEach=x,e.objectEachAsync=async function(e,t){for(const n in e)if(o(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 x(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 i=e,s=0;for(let e=r.length;s<e-1;++s){const e=r[s];if(c(Number(e))&&Array.isArray(i))i=i[e];else{if(!h(i)||!o(i,e)){if(i=void 0,n)throw new Error("[Object] objectGet path 路径不正确");break}i=i[e]}}return{p:i,k:i?r[s]:void 0,v:i?i[r[s]]:void 0}},e.objectHas=o,e.objectMap=function(e,t){const n={};for(const r in e)o(e,r)&&(n[r]=t(e[r],r));return e=null,n},e.objectMerge=E,e.objectOmit=S,e.objectPick=function(e,t){const n={};return x(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(Pe(t,n))).map((e=>f(e)?void 0:e[1]))},e.pathJoin=z,e.pathNormalize=H,e.qsParse=W,e.qsStringify=q,e.randomNumber=ee,e.randomString=(e,t)=>{let n=0,r=te;l(t)?(n=e,r=t):c(e)?n=e:l(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[ee(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=ee(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){N(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Pe(n,r)),(function(e,n){return o(t,n)?t[n]:e}))},e.safeAwait=function(e,t){return e.then((e=>[null,e])).catch((e=>{if(t){return[Object.assign({},e,t),void 0]}return[e,void 0]}))},e.searchTreeById=function(e,t,n={childField:"children",keyField:"id"}){const{childField:r="children",keyField:o="id"}=h(n)?n:{},i=(e,t,n)=>e.reduce(((e,s)=>{const l=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...l&&l.length?i(l,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let l=[t],a=[s];for(;n&&n.parentId;)l=[n.parentId,...l],a=[n.parent,...a],n=e.find((e=>e[o]===n.parentId));return[l,a]})(i(e))},e.select=k,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=j,e.stringAssign=(e,t)=>e.replace($,((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(R,(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=v,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>we(e,-t),e.supportCanvas=J,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const l=Date.now(),a=()=>{i=l,e.call(this,...s)};if(0===i)return n?a():void(i=l);i+t-l>0?(clearTimeout(r),r=setTimeout((()=>a()),t)):a()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=pe,e.typeIs=s,e.uniqueNumber=de,e.uniqueString=(e,t)=>{let n=0,r=ne;l(t)?(n=e,r=t):c(e)?n=e:l(e)&&(r=e);let o=se(de(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=fe(r);return o},e.uniqueSymbol=Ie,e.urlDelParams=(e,t)=>{const n=G(e);return t.forEach((e=>delete n.searchParams[e])),Y(n)},e.urlParse=G,e.urlSetParams=V,e.urlStringify=Y,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=Ee,e.weBtoa=Ae}));
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}=Object.prototype;function o(e,t){return r.call(e,t)}function i(e){return!!p(e)||(!!l(e)||!!h(e)&&o(e,"length"))}function s(e){return n.call(e).slice(8,-1)}const l=e=>"string"==typeof e,a=e=>"boolean"==typeof e,c=e=>"number"==typeof e&&!Number.isNaN(e),u=e=>void 0===e,d=e=>null===e;function f(e){return u(e)||d(e)}const h=e=>"Object"===s(e),p=e=>Array.isArray(e),g=e=>"function"==typeof e,m=e=>Number.isNaN(e),y=e=>"Date"===s(e);function b(e){return!u(NodeList)&&NodeList.prototype.isPrototypeOf(e)}const w=e=>{if(!h(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function x(e,t){for(const n in e)if(o(e,n)&&!1===t(e[n],n))break;e=null}function S(e,t){const n={};return x(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const A=(e,t,n)=>{if(u(n))return t;if(s(t)!==s(n))return p(n)?A(e,[],n):h(n)?A(e,{},n):n;if(w(n)){const r=e.get(n);return r||(e.set(n,t),x(n,((n,r)=>{t[r]=A(e,t[r],n)})),t)}if(p(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=A(e,t[r],n)})),t)}return n};function E(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=A(n,e,o)}return n.clear(),e}function v(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const F="0123456789",C="abcdefghijklmnopqrstuvwxyz",T="ABCDEFGHIJKLMNOPQRSTUVWXYZ",R=/%[%sdo]/g;const $=/\${(.*?)}/g;const N=(e,t)=>{e.split(/\s+/g).forEach(t)};const j=(e,t,n)=>{h(t)?x(t,((t,n)=>{j(e,n,t)})):e.style.setProperty(v(t),n)};function D(e,t=14,n=!0){let r=0;if(console.assert(l(e),`${e} 不是有效的字符串`),l(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}function k(e){let t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){const n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}function L(e,t){const{successCallback:n,failCallback:r,container:o=document.body}=f(t)?{}:t;let i=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);o.appendChild(i),k(i);try{document.execCommand("copy")&&g(n)&&n()}catch(e){g(r)&&r(e)}finally{o.removeChild(i),i=null,window.getSelection()?.removeAllRanges()}}function M(e,t,n){const r=[],o="expires";if(r.push([e,encodeURIComponent(t)]),c(n)){const e=new Date;e.setTime(e.getTime()+n),r.push([o,e.toUTCString()])}else y(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const O=e=>y(e)&&!m(e.getTime()),I=e=>{if(!l(e))return;const t=e.replace(/-/g,"/");return new Date(t)},P=e=>{if(!l(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(!O(o))return;const[,i,s,a]=n,c=parseInt(s,10),u=parseInt(a,10),d=(e,t)=>"+"===i?e-t:e+t;return o.setHours(d(o.getHours(),c)),o.setMinutes(d(o.getMinutes(),u)),o};function B(e){const t=new Date(e);if(O(t))return t;const n=I(e);if(O(n))return n;const r=P(e);if(O(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function U(e){const t=B(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}const H=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("/")},z=(e,...t)=>H([e,...t].join("/"));function W(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())u(n[e])?n[e]=r:p(n[e])||(n[e]=t.getAll(e));return n}const _=e=>l(e)?e:c(e)?String(e):a(e)?e?"true":"false":y(e)?e.toISOString():null;function q(e,t=_){const n=new URLSearchParams;return x(e,((e,r)=>{if(p(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 G=(e,t=!0)=>{let n=null;g(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:l,hostname:a,hash:c,search:u,pathname:d}=n,f=z("/",d),h=o&&i?`${o}:${i}`:"",p=u.replace(/^\?/,"");return n=null,{protocol:r,auth:h,username:o,password:i,host:s,port:l,hostname:a,hash:c,search:u,searchParams:W(p),query:p,pathname:f,path:`${f}${u}`,href:e}},Y=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,l=n?`${n}@`:"",a=q(i),c=a?`?${a}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${l}${r}${o}${c}${u}`},V=(e,t)=>{const n=G(e);return Object.assign(n.searchParams,t),Y(n)};function X(e,t,n){let 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),r=null,g(n)&&n()}))}function K(e,t,n){const r=URL.createObjectURL(e);X(r,t),setTimeout((()=>{URL.revokeObjectURL(r),g(n)&&n()}))}function J(){return!!document.createElement("canvas").getContext}function Z({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 Q(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 ee=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),te=`${F}${T}${C}`;const ne=`${F}${T}${C}`,re="undefined"!=typeof BigInt,oe=()=>Q("JSBI"),ie=e=>re?BigInt(e):oe().BigInt(e);function se(e,t=ne){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!re)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=ie(e);const r=[],{length:o}=t,i=ie(o),s=()=>{const e=Number(((e,t)=>re?e%t:oe().remainder(e,t))(n,i));n=((e,t)=>re?e/t:oe().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const le=(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 l=Number(e),a=0;for(;l>=r&&a<s-1;)l/=r,a++;const c=l.toFixed(o),u=t[a];return String(c)+i+u};function ae(e,t){if(f(t))return parseInt(String(e)).toLocaleString();let n=0;return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let ce=0,ue=0;const de=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==ue&&(ue=t,ce=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${ee(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(ce,5);return ce++,`${n}${r}${i}`},fe=e=>e[ee(0,e.length-1)];function he(e,t,n){let r=250,o=13;const i=e.children[0];D(t,12)<230?(i.style.maxWidth=D(t,12)+20+50+"px",r=n.clientX+(D(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 pe={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=l(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)he(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&&(he(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=l(e)?document.querySelector(e):e;let n=document.querySelector("#customTitle1494304949567");t&&n&&(t.removeChild(n),n=null)}},ge={keyField:"key",childField:"children",pidField:"pid"},me={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};function ye(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const{childField:r="children",reverse:o=!1,breadthFirst:i=!1,isDomNode:s=!1}=h(n)?n:{};let l=!1;const a=[],c=(n,o,u=0)=>{for(let d=n.length-1;d>=0&&!l;d--){const f=n[d];if(i)a.push({item:f,index:d,array:n,tree:e,parent:o,level:u});else{const i=t(f,d,n,e,o,u);if(!1===i){l=!0;break}if(!0===i)continue;f&&(s?b(f[r]):Array.isArray(f[r]))&&c(f[r],f,u+1)}}if(i)for(;a.length>0&&!l;){const e=a.shift(),{item:n,index:o,array:i,tree:u,parent:d,level:f}=e,h=t(n,o,i,u,d,f);if(!1===h){l=!0;break}!0!==h&&(n&&(s?b(n[r]):Array.isArray(n[r]))&&c(n[r],n,f+1))}},u=(n,o,c=0)=>{for(let d=0,f=n.length;d<f&&!l;d++){const f=n[d];if(i)a.push({item:f,index:d,array:n,tree:e,parent:o,level:c});else{const i=t(f,d,n,e,o,c);if(!1===i){l=!0;break}if(!0===i)continue;f&&(s?b(f[r]):Array.isArray(f[r]))&&u(f[r],f,c+1)}}if(i)for(;a.length>0&&!l;){const e=a.shift();if(!e)break;const{item:n,index:o,array:i,tree:c,parent:d,level:f}=e,h=t(n,o,i,c,d,f);if(!1===h){l=!0;break}!0!==h&&(n&&(s?b(n[r]):Array.isArray(n[r]))&&u(n[r],n,f+1))}};o?c(e,null,0):u(e,null,0),e=null}const be=(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)},we=(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),(be(e,o)+be(t,o))/o};const xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Se=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Ae(e){let t,n,r,o,i="",s=0;const l=(e=String(e)).length,a=l%3;for(;s<l;){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+=xe.charAt(t>>18&63)+xe.charAt(t>>12&63)+xe.charAt(t>>6&63)+xe.charAt(63&t)}return a?i.slice(0,a-3)+"===".substring(a):i}function Ee(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Se.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=xe.indexOf(e.charAt(i++))<<18|xe.indexOf(e.charAt(i++))<<12|(n=xe.indexOf(e.charAt(i++)))<<6|(r=xe.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 ve=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Fe=/^(?:(?:\+|00)86)?1\d{10}$/,Ce=/^(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]$/,Te=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Re=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,$e=/^(?:(?:\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])$/,Ne=/^(([\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,je=/^(-?[1-9]\d*|0)$/,De=e=>je.test(e),ke=/^-?([1-9]\d*|0)\.\d*[1-9]$/,Le=e=>ke.test(e),Me=/^\d+$/;function Oe(e){return[...new Set(e.trim().split(""))].join("")}function Ie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t){return new RegExp(`${Ie(e.trim())}\\s*([^${Ie(Oe(e))}${Ie(Oe(t))}\\s]*)\\s*${t.trim()}`,"g")}const Be={MAP:"[object Map]",SET:"[object Set]",DATE:"[object Date]",REGEXP:"[object RegExp]",SYMBOL:"[object Symbol]",ARRAY_BUFFER:"[object ArrayBuffer]",DATA_VIEW:"[object DataView]",ARGUMENTS:"[object Arguments]"},{toString:Ue,hasOwnProperty:He}=Object.prototype,ze=e=>Ue.call(e);function We(e,t,n=void 0){if(e===t)return!0;if(e!=e&&t!=t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e.constructor!==t.constructor)return!1;if(n||(n=new WeakMap),n.has(e))return n.get(e)===t;n.set(e,t);const r=ze(e);if(r!==ze(t))return!1;let o=!1;switch(r){case Be.DATE:o=+e==+t;break;case Be.REGEXP:o=""+e==""+t;break;case Be.SYMBOL:o=Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t);break;case Be.ARRAY_BUFFER:o=_e(e,t);break;case Be.DATA_VIEW:s=t,o=(i=e).byteLength===s.byteLength&&i.byteOffset===s.byteOffset&&_e(i.buffer,s.buffer);break;case Be.MAP:o=function(e,t,n){if(e.size!==t.size)return!1;for(const[r,o]of e){const e=t.get(r);if(void 0===e&&!t.has(r))return!1;if(!We(o,e,n))return!1}return!0}(e,t,n);break;case Be.SET:o=function(e,t,n){if(e.size!==t.size)return!1;for(const r of e){if(t.has(r))continue;let e=!1;for(const o of t)if(We(r,o,n)){e=!0;break}if(!e)return!1}return!0}(e,t,n);break;case Be.ARGUMENTS:default:o=Array.isArray(e)||ArrayBuffer.isView(e)?function(e,t,n){const r=e.length;if(r!==t.length)return!1;let o=r;for(;o--;)if(!We(e[o],t[o],n))return!1;return!0}(e,t,n):function(e,t,n){const r=Reflect.ownKeys(e),o=Reflect.ownKeys(t);if(r.length!==o.length)return!1;for(let o=0;o<r.length;o++){const i=r[o];if(!He.call(t,i)||!We(e[i],t[i],n))return!1}return!0}(e,t,n)}var i,s;return o}function _e(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new Uint8Array(e),r=new Uint8Array(t);let o=e.byteLength;for(;o--;)if(n[o]!==r[o])return!1;return!0}e.EMAIL_REGEX=ve,e.HEX_POOL=ne,e.HTTP_URL_REGEX=Re,e.IPV4_REGEX=$e,e.IPV6_REGEX=Ne,e.PHONE_REGEX=Fe,e.STRING_ARABIC_NUMERALS=F,e.STRING_LOWERCASE_ALPHA=C,e.STRING_POOL=te,e.STRING_UPPERCASE_ALPHA=T,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Te,e.add=we,e.addClass=function(e,t){N(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=i,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),l=[];let a,c=0,u=0;const d=()=>{if(a)return o(a);const n=i.next();if(n.done)return void(c===e.length&&r(l));const s=u++;t(n.value,s,e).then((e=>{c++,l[s]=e,d()})).catch((e=>{a=e,d()}))};for(let e=0;e<s;e++)d()}))},e.b64decode=function(e){const t=f(Q("atob"))?Ee(e):Q("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return f(Q("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(Q("TextDecoder"))("utf-8").decode(r)},e.b64encode=function(e){const t=f(Q("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(Q("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return f(Q("btoa"))?Ae(n):Q("btoa")(n)},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,l=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),a=new Date(l);return a.getFullYear()+i+String(a.getMonth()+1).padStart(2,"0")+i+String(a.getDate()).padStart(2,"0")+" "+String(a.getHours()).padStart(2,"0")+s+String(a.getMinutes()).padStart(2,"0")+s+String(a.getSeconds()).padStart(2,"0")},e.chooseLocalFile=function(e,t){let 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),n=null}))}},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(!J())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 l,a=r;if(r)a=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));a=e<s?1:e<1024?.85:e<5120?.8:.75}return c(i)&&(l=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:l,mime:o,quality:a})))):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 u=document.createElement("canvas"),d=u.getContext("2d"),f=s.width,h=s.height,{width:p,height:g}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(c(t)){const{width:e,height:s}=Z({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(e<5120){const e=1400,t=1400,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(e<10240){const e=1600,t=1600,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:l}=Z({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=l}return{width:o,height:i}}({sizeKB:r,maxSize:l,originWidth:f,originHeight:h});u.width=p,u.height=g,d.clearRect(0,0,p,g),d.drawImage(s,0,0,p,g);const m=u.toDataURL(o,a),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=>M(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=M,e.copyText=function(e,t){const{successCallback:n,failCallback:r}=f(t)?{}:t;navigator.clipboard?navigator.clipboard.writeText(e).then((()=>{g(n)&&n()})).catch((n=>{L(e,t)})):L(e,t)},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:i}=f(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)K(s.response,t,o);else if(g(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(l(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=>{g(i)&&i({status:0,code:"ERROR_CONNECTION_REFUSED"})},s.send()},e.dateParse=B,e.dateToEnd=function(e){const t=U(e);return t.setDate(t.getDate()+1),B(t.getTime()-1)},e.dateToStart=U,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.diffArray=function(e,t,n){const r=e=>{if(n)return n(e);if("string"==typeof e||"number"==typeof e||"symbol"==typeof e)return e;throw new Error("diffArray: getKey is required when item is not a primitive value")},o=new Map,i=new Map;for(const t of e)o.set(r(t),t);for(const e of t)i.set(r(e),e);const s=[],l=[];for(const[e,t]of i)o.has(e)||s.push(t);for(const[e,t]of o)i.has(e)||l.push(t);return{added:s,removed:l}},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=K,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){K(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"}));X("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=X,e.downloadURL=function(e,t){window.open(t?V(e,t):e)},e.escapeRegExp=Ie,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=L,e.filterDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const r=[];return ye(e,((...e)=>{t(...e)&&r.push(e[0])}),n),r},e.findDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){let r=null;return ye(e,((...e)=>{if(t(...e))return r=e[0],!1}),n),r},e.flatTree=function e(t,n=ge){const{keyField:r="key",childField:i="children",pidField:s="pid"}=h(n)?n:{};let l=[];for(let a=0,c=t.length;a<c;a++){const c=t[a],u={...c,[i]:[]};if(o(u,i)&&delete u[i],l.push(u),c[i]){const t=c[i].map((e=>({...e,[s]:c[r]||e.pid})));l=l.concat(e(t,n))}}return l},e.forEachDeep=ye,e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=B(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=ae,e.formatNumber=ae,e.formatTree=function(e,t=ge){const{keyField:n="key",childField:r="children",pidField:o="pid"}=h(t)?t:{},i=[],s={};for(let t=0,r=e.length;t<r;t++){const r=e[t];s[r[n]]=r}for(let t=0,n=e.length;t<n;t++){const n=e[t],l=s[n[o]];l?(l[r]||(l[r]=[])).push(n):i.push(n)}return e=null,i},e.fuzzySearchTree=function e(t,n,r=me){if(!o(n,"filter")&&!n.keyword)return t;const i=[];for(let s=0,l=t.length;s<l;s++){const l=t[s],a=l[r.childField]&&l[r.childField].length>0?e(l[r.childField]||[],n,r):[];if((o(n,"filter")?n.filter(l):r.ignoreCase?l[r.nameField].toLowerCase().includes(n.keyword.toLowerCase()):l[r.nameField].includes(n.keyword))||a.length>0)if(l[r.childField])if(a.length>0)i.push({...l,[r.childField]:a});else if(r.removeEmptyChild){const{[r.childField]:e,...t}=l;i.push(t)}else i.push({...l,[r.childField]:[]});else{const{[r.childField]:e,...t}=l;i.push(t)}}return i},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:a="middle",font:c="20px PingFangSC-Medium,PingFang SC",fillStyle:u="rgba(189, 177, 167, .3)",rotate:d=-20,zIndex:h=2147483647,watermarkId:p="__wm"}=f(n)?{}:n,g=l(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=c,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(`#${p}`),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:${h}; pointer-events:none; background-repeat:repeat; background-image:url('${b}')`;x.setAttribute("style",S),x.setAttribute("id",p),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(){let o=document.querySelector(`#${p}`);if(o){const{opacity:i,zIndex:s,display:l,visibility:a}=(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"!==l||"visible"!==a)&&(r.disconnect(),r=null,g.removeChild(o),o=null,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=Q,e.getStrWidthPx=D,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 l=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!f(i)){const e=l.findIndex((e=>e===i));-1!==e&&(l=l.slice(e))}if(!f(s)){const e=l.findIndex((e=>e===s));-1!==e&&l.splice(e+1)}return le(e,l,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=p,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=a,e.isDate=y,e.isDigit=e=>Me.test(e),e.isEmail=e=>ve.test(e),e.isEmpty=function(e){if(f(e)||Number.isNaN(e))return!0;const t=s(e);return i(e)||"Arguments"===t?!e.length:"Set"===t||"Map"===t?!e.size:!Object.keys(e).length},e.isEqual=function(e,t){return We(e,t)},e.isError=e=>"Error"===s(e),e.isFloat=Le,e.isFunction=g,e.isIdNo=e=>{if(!Ce.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=De,e.isIpV4=e=>$e.test(e),e.isIpV6=e=>Ne.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=m,e.isNodeList=b,e.isNull=d,e.isNullOrUnDef=f,e.isNullish=f,e.isNumber=c,e.isNumerical=e=>De(e)||Le(e),e.isObject=h,e.isPhone=e=>Fe.test(e),e.isPlainObject=w,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===s(e),e.isString=l,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=u,e.isUrl=(e,t=!1)=>(t?Te:Re).test(e),e.isValidDate=O,e.mapDeep=function(e,t,n={childField:"children",reverse:!1}){const{childField:r="children",reverse:o=!1}=h(n)?n:{};let i=!1;const s=[],l=(n,s,a,c=0)=>{if(o)for(let o=n.length-1;o>=0&&!i;o--){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(a.push(S(d,[r])),u&&Array.isArray(u[r])?(a[a.length-1][r]=[],l(u[r],u,a[a.length-1][r],c+1)):delete d[r])}else for(let o=0;o<n.length&&!i;o++){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(a.push(S(d,[r])),u&&Array.isArray(u[r])?(a[a.length-1][r]=[],l(u[r],u,a[a.length-1][r],c+1)):delete d[r])}};return l(e,null,s),e=null,s},e.multiply=be,e.numberAbbr=le,e.numberToHex=se,e.objectAssign=E,e.objectEach=x,e.objectEachAsync=async function(e,t){for(const n in e)if(o(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 x(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 i=e,s=0;for(let e=r.length;s<e-1;++s){const e=r[s];if(c(Number(e))&&Array.isArray(i))i=i[e];else{if(!h(i)||!o(i,e)){if(i=void 0,n)throw new Error("[Object] objectGet path 路径不正确");break}i=i[e]}}return{p:i,k:i?r[s]:void 0,v:i?i[r[s]]:void 0}},e.objectHas=o,e.objectMap=function(e,t){const n={};for(const r in e)o(e,r)&&(n[r]=t(e[r],r));return e=null,n},e.objectMerge=E,e.objectOmit=S,e.objectPick=function(e,t){const n={};return x(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(Pe(t,n))).map((e=>f(e)?void 0:e[1]))},e.pathJoin=z,e.pathNormalize=H,e.qsParse=W,e.qsStringify=q,e.randomNumber=ee,e.randomString=(e,t)=>{let n=0,r=te;l(t)?(n=e,r=t):c(e)?n=e:l(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[ee(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=ee(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){N(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Pe(n,r)),(function(e,n){return o(t,n)?t[n]:e}))},e.safeAwait=function(e,t){return e.then((e=>[null,e])).catch((e=>{if(t){return[Object.assign({},e,t),void 0]}return[e,void 0]}))},e.searchTreeById=function(e,t,n={childField:"children",keyField:"id"}){const{childField:r="children",keyField:o="id"}=h(n)?n:{},i=(e,t,n)=>e.reduce(((e,s)=>{const l=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...l&&l.length?i(l,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let l=[t],a=[s];for(;n&&n.parentId;)l=[n.parentId,...l],a=[n.parent,...a],n=e.find((e=>e[o]===n.parentId));return[l,a]})(i(e))},e.select=k,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=j,e.stringAssign=(e,t)=>e.replace($,((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(R,(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=v,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>we(e,-t),e.supportCanvas=J,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const l=Date.now(),a=()=>{i=l,e.call(this,...s)};if(0===i)return n?a():void(i=l);i+t-l>0?(clearTimeout(r),r=setTimeout((()=>a()),t)):a()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=pe,e.typeIs=s,e.uniqueNumber=de,e.uniqueString=(e,t)=>{let n=0,r=ne;l(t)?(n=e,r=t):c(e)?n=e:l(e)&&(r=e);let o=se(de(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=fe(r);return o},e.uniqueSymbol=Oe,e.urlDelParams=(e,t)=>{const n=G(e);return t.forEach((e=>delete n.searchParams[e])),Y(n)},e.urlParse=G,e.urlSetParams=V,e.urlStringify=Y,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=Ee,e.weBtoa=Ae}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sculp-js",
3
- "version": "1.17.0",
3
+ "version": "1.17.2",
4
4
  "description": "Utils function library for modern javascript",
5
5
  "scripts": {
6
6
  "prepare": "husky install",