@symbo.ls/scratch 2.11.410 → 2.11.429
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factory.js +18 -4
- package/dist/cjs/index.js +2297 -2248
- package/dist/cjs/set.js +2234 -2187
- package/dist/cjs/system/color.js +2145 -2101
- package/dist/cjs/system/document.js +2072 -2028
- package/dist/cjs/system/font.js +1846 -1801
- package/dist/cjs/system/index.js +2277 -2230
- package/dist/cjs/system/reset.js +2057 -2013
- package/dist/cjs/system/shadow.js +2154 -2109
- package/dist/cjs/system/spacing.js +1907 -1862
- package/dist/cjs/system/svg.js +1837 -1793
- package/dist/cjs/system/theme.js +2153 -2109
- package/dist/cjs/system/timing.js +1908 -1861
- package/dist/cjs/system/typography.js +2065 -2021
- package/dist/cjs/transforms/index.js +2176 -2129
- package/dist/cjs/utils/color.js +18 -4
- package/dist/cjs/utils/index.js +2082 -2036
- package/dist/cjs/utils/sequence.js +1820 -1774
- package/dist/cjs/utils/sprite.js +18 -4
- package/dist/cjs/utils/var.js +2033 -1989
- package/package.json +2 -2
- package/src/utils/sequence.js +2 -1
package/dist/cjs/utils/index.js
CHANGED
|
@@ -34,35 +34,35 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
var require_cjs = __commonJS({
|
|
35
35
|
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
37
|
+
var __defProp2 = Object.defineProperty;
|
|
38
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
41
|
+
var __export2 = (target, all) => {
|
|
42
42
|
for (var name in all)
|
|
43
|
-
|
|
43
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
44
44
|
};
|
|
45
|
-
var
|
|
45
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
46
46
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
-
for (let key of
|
|
48
|
-
if (!
|
|
49
|
-
|
|
47
|
+
for (let key of __getOwnPropNames2(from))
|
|
48
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
49
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
50
|
}
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
|
-
var
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
54
54
|
var globals_exports = {};
|
|
55
|
-
|
|
55
|
+
__export2(globals_exports, {
|
|
56
56
|
document: () => document3,
|
|
57
57
|
global: () => global,
|
|
58
58
|
self: () => self,
|
|
59
|
-
window: () =>
|
|
59
|
+
window: () => window3
|
|
60
60
|
});
|
|
61
|
-
module2.exports =
|
|
61
|
+
module2.exports = __toCommonJS2(globals_exports);
|
|
62
62
|
var global = globalThis;
|
|
63
63
|
var self = globalThis;
|
|
64
|
-
var
|
|
65
|
-
var document3 =
|
|
64
|
+
var window3 = globalThis;
|
|
65
|
+
var document3 = window3.document;
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
@@ -70,29 +70,29 @@ var require_cjs = __commonJS({
|
|
|
70
70
|
var require_key = __commonJS({
|
|
71
71
|
"../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
|
|
72
72
|
"use strict";
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
var
|
|
73
|
+
var __defProp2 = Object.defineProperty;
|
|
74
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
75
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
76
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
77
|
+
var __export2 = (target, all) => {
|
|
78
78
|
for (var name in all)
|
|
79
|
-
|
|
79
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
80
80
|
};
|
|
81
|
-
var
|
|
81
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
82
82
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
83
|
-
for (let key of
|
|
84
|
-
if (!
|
|
85
|
-
|
|
83
|
+
for (let key of __getOwnPropNames2(from))
|
|
84
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
85
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
86
86
|
}
|
|
87
87
|
return to;
|
|
88
88
|
};
|
|
89
|
-
var
|
|
89
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
90
90
|
var key_exports = {};
|
|
91
|
-
|
|
91
|
+
__export2(key_exports, {
|
|
92
92
|
createSnapshotId: () => createSnapshotId,
|
|
93
93
|
generateKey: () => generateKey
|
|
94
94
|
});
|
|
95
|
-
module2.exports =
|
|
95
|
+
module2.exports = __toCommonJS2(key_exports);
|
|
96
96
|
var generateKey = /* @__PURE__ */ function() {
|
|
97
97
|
let index = 0;
|
|
98
98
|
function newId() {
|
|
@@ -109,32 +109,32 @@ var require_key = __commonJS({
|
|
|
109
109
|
var require_env = __commonJS({
|
|
110
110
|
"../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
|
|
111
111
|
"use strict";
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
112
|
+
var __defProp2 = Object.defineProperty;
|
|
113
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
114
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
115
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
116
|
+
var __export2 = (target, all) => {
|
|
117
117
|
for (var name in all)
|
|
118
|
-
|
|
118
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
119
119
|
};
|
|
120
|
-
var
|
|
120
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
121
121
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
122
|
-
for (let key of
|
|
123
|
-
if (!
|
|
124
|
-
|
|
122
|
+
for (let key of __getOwnPropNames2(from))
|
|
123
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
124
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
125
125
|
}
|
|
126
126
|
return to;
|
|
127
127
|
};
|
|
128
|
-
var
|
|
128
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
129
129
|
var env_exports = {};
|
|
130
|
-
|
|
130
|
+
__export2(env_exports, {
|
|
131
131
|
NODE_ENV: () => NODE_ENV,
|
|
132
132
|
getNev: () => getNev,
|
|
133
133
|
isDevelopment: () => isDevelopment,
|
|
134
134
|
isProduction: () => isProduction,
|
|
135
135
|
isTest: () => isTest
|
|
136
136
|
});
|
|
137
|
-
module2.exports =
|
|
137
|
+
module2.exports = __toCommonJS2(env_exports);
|
|
138
138
|
var NODE_ENV = "development";
|
|
139
139
|
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
140
140
|
var isTest = (env = NODE_ENV) => env === "test";
|
|
@@ -147,35 +147,35 @@ var require_env = __commonJS({
|
|
|
147
147
|
var require_globals = __commonJS({
|
|
148
148
|
"../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
|
-
var
|
|
151
|
-
var
|
|
152
|
-
var
|
|
153
|
-
var
|
|
154
|
-
var
|
|
150
|
+
var __defProp2 = Object.defineProperty;
|
|
151
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
152
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
153
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
154
|
+
var __export2 = (target, all) => {
|
|
155
155
|
for (var name in all)
|
|
156
|
-
|
|
156
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
157
157
|
};
|
|
158
|
-
var
|
|
158
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
159
159
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
160
|
-
for (let key of
|
|
161
|
-
if (!
|
|
162
|
-
|
|
160
|
+
for (let key of __getOwnPropNames2(from))
|
|
161
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
162
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
163
163
|
}
|
|
164
164
|
return to;
|
|
165
165
|
};
|
|
166
|
-
var
|
|
166
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
167
167
|
var globals_exports = {};
|
|
168
|
-
|
|
168
|
+
__export2(globals_exports, {
|
|
169
169
|
document: () => document3,
|
|
170
170
|
global: () => global,
|
|
171
171
|
self: () => self,
|
|
172
|
-
window: () =>
|
|
172
|
+
window: () => window3
|
|
173
173
|
});
|
|
174
|
-
module2.exports =
|
|
174
|
+
module2.exports = __toCommonJS2(globals_exports);
|
|
175
175
|
var global = globalThis;
|
|
176
176
|
var self = globalThis;
|
|
177
|
-
var
|
|
178
|
-
var document3 =
|
|
177
|
+
var window3 = globalThis;
|
|
178
|
+
var document3 = window3.document;
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
|
|
@@ -183,29 +183,29 @@ var require_globals = __commonJS({
|
|
|
183
183
|
var require_node = __commonJS({
|
|
184
184
|
"../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
|
|
185
185
|
"use strict";
|
|
186
|
-
var
|
|
187
|
-
var
|
|
188
|
-
var
|
|
189
|
-
var
|
|
190
|
-
var
|
|
186
|
+
var __defProp2 = Object.defineProperty;
|
|
187
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
188
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
189
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
190
|
+
var __export2 = (target, all) => {
|
|
191
191
|
for (var name in all)
|
|
192
|
-
|
|
192
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
193
193
|
};
|
|
194
|
-
var
|
|
194
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
195
195
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
196
|
-
for (let key of
|
|
197
|
-
if (!
|
|
198
|
-
|
|
196
|
+
for (let key of __getOwnPropNames2(from))
|
|
197
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
198
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
199
199
|
}
|
|
200
200
|
return to;
|
|
201
201
|
};
|
|
202
|
-
var
|
|
202
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
203
203
|
var node_exports = {};
|
|
204
|
-
|
|
204
|
+
__export2(node_exports, {
|
|
205
205
|
isHtmlElement: () => isHtmlElement,
|
|
206
206
|
isNode: () => isNode
|
|
207
207
|
});
|
|
208
|
-
module2.exports =
|
|
208
|
+
module2.exports = __toCommonJS2(node_exports);
|
|
209
209
|
var import_globals2 = require_globals();
|
|
210
210
|
var isNode = (obj) => {
|
|
211
211
|
return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
@@ -220,25 +220,25 @@ var require_node = __commonJS({
|
|
|
220
220
|
var require_types = __commonJS({
|
|
221
221
|
"../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
|
|
222
222
|
"use strict";
|
|
223
|
-
var
|
|
224
|
-
var
|
|
225
|
-
var
|
|
226
|
-
var
|
|
227
|
-
var
|
|
223
|
+
var __defProp2 = Object.defineProperty;
|
|
224
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
225
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
226
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
227
|
+
var __export2 = (target, all) => {
|
|
228
228
|
for (var name in all)
|
|
229
|
-
|
|
229
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
230
230
|
};
|
|
231
|
-
var
|
|
231
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
232
232
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
233
|
-
for (let key of
|
|
234
|
-
if (!
|
|
235
|
-
|
|
233
|
+
for (let key of __getOwnPropNames2(from))
|
|
234
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
235
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
236
236
|
}
|
|
237
237
|
return to;
|
|
238
238
|
};
|
|
239
|
-
var
|
|
239
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
240
240
|
var types_exports = {};
|
|
241
|
-
|
|
241
|
+
__export2(types_exports, {
|
|
242
242
|
TYPES: () => TYPES,
|
|
243
243
|
is: () => is,
|
|
244
244
|
isArray: () => isArray2,
|
|
@@ -254,7 +254,7 @@ var require_types = __commonJS({
|
|
|
254
254
|
isString: () => isString4,
|
|
255
255
|
isUndefined: () => isUndefined
|
|
256
256
|
});
|
|
257
|
-
module2.exports =
|
|
257
|
+
module2.exports = __toCommonJS2(types_exports);
|
|
258
258
|
var import_node = require_node();
|
|
259
259
|
var isObject2 = (arg) => {
|
|
260
260
|
if (arg === null)
|
|
@@ -310,25 +310,25 @@ var require_types = __commonJS({
|
|
|
310
310
|
var require_array = __commonJS({
|
|
311
311
|
"../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
|
|
312
312
|
"use strict";
|
|
313
|
-
var
|
|
314
|
-
var
|
|
315
|
-
var
|
|
316
|
-
var
|
|
317
|
-
var
|
|
313
|
+
var __defProp2 = Object.defineProperty;
|
|
314
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
315
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
316
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
317
|
+
var __export2 = (target, all) => {
|
|
318
318
|
for (var name in all)
|
|
319
|
-
|
|
319
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
320
320
|
};
|
|
321
|
-
var
|
|
321
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
322
322
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
323
|
-
for (let key of
|
|
324
|
-
if (!
|
|
325
|
-
|
|
323
|
+
for (let key of __getOwnPropNames2(from))
|
|
324
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
325
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
326
326
|
}
|
|
327
327
|
return to;
|
|
328
328
|
};
|
|
329
|
-
var
|
|
329
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
330
330
|
var array_exports = {};
|
|
331
|
-
|
|
331
|
+
__export2(array_exports, {
|
|
332
332
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
333
333
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
334
334
|
arraysEqual: () => arraysEqual,
|
|
@@ -345,7 +345,7 @@ var require_array = __commonJS({
|
|
|
345
345
|
reorderArrayByValues: () => reorderArrayByValues,
|
|
346
346
|
swapItemsInArray: () => swapItemsInArray
|
|
347
347
|
});
|
|
348
|
-
module2.exports =
|
|
348
|
+
module2.exports = __toCommonJS2(array_exports);
|
|
349
349
|
var import_object = require_object();
|
|
350
350
|
var import_types = require_types();
|
|
351
351
|
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
@@ -378,10 +378,10 @@ var require_array = __commonJS({
|
|
|
378
378
|
return [].concat(...arrays);
|
|
379
379
|
};
|
|
380
380
|
var mergeArray = (arr, excludeFrom = []) => {
|
|
381
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
381
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
|
|
382
382
|
};
|
|
383
383
|
var mergeAndCloneIfArray = (obj) => {
|
|
384
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
384
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
|
|
385
385
|
};
|
|
386
386
|
var cutArrayBeforeValue = (arr, value) => {
|
|
387
387
|
const index = arr.indexOf(value);
|
|
@@ -466,27 +466,29 @@ var require_array = __commonJS({
|
|
|
466
466
|
var require_string = __commonJS({
|
|
467
467
|
"../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
|
|
468
468
|
"use strict";
|
|
469
|
-
var
|
|
470
|
-
var
|
|
471
|
-
var
|
|
472
|
-
var
|
|
473
|
-
var
|
|
469
|
+
var __defProp2 = Object.defineProperty;
|
|
470
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
471
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
472
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
473
|
+
var __export2 = (target, all) => {
|
|
474
474
|
for (var name in all)
|
|
475
|
-
|
|
475
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
476
476
|
};
|
|
477
|
-
var
|
|
477
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
478
478
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
479
|
-
for (let key of
|
|
480
|
-
if (!
|
|
481
|
-
|
|
479
|
+
for (let key of __getOwnPropNames2(from))
|
|
480
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
481
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
482
482
|
}
|
|
483
483
|
return to;
|
|
484
484
|
};
|
|
485
|
-
var
|
|
485
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
486
486
|
var string_exports = {};
|
|
487
|
-
|
|
487
|
+
__export2(string_exports, {
|
|
488
488
|
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
489
489
|
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
490
|
+
decodeNewlines: () => decodeNewlines,
|
|
491
|
+
encodeNewlines: () => encodeNewlines,
|
|
490
492
|
findKeyPosition: () => findKeyPosition,
|
|
491
493
|
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
492
494
|
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
@@ -494,7 +496,7 @@ var require_string = __commonJS({
|
|
|
494
496
|
stringIncludesAny: () => stringIncludesAny,
|
|
495
497
|
trimStringFromSymbols: () => trimStringFromSymbols
|
|
496
498
|
});
|
|
497
|
-
module2.exports =
|
|
499
|
+
module2.exports = __toCommonJS2(string_exports);
|
|
498
500
|
var stringIncludesAny = (str, characters) => {
|
|
499
501
|
for (const char of characters) {
|
|
500
502
|
if (str.includes(char)) {
|
|
@@ -590,6 +592,12 @@ var require_string = __commonJS({
|
|
|
590
592
|
return char;
|
|
591
593
|
});
|
|
592
594
|
};
|
|
595
|
+
var encodeNewlines = (str) => {
|
|
596
|
+
return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
|
|
597
|
+
};
|
|
598
|
+
var decodeNewlines = (encodedStr) => {
|
|
599
|
+
return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
|
|
600
|
+
};
|
|
593
601
|
var customEncodeURIComponent = (str) => {
|
|
594
602
|
return str.split("").map((char) => {
|
|
595
603
|
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
@@ -608,25 +616,25 @@ var require_string = __commonJS({
|
|
|
608
616
|
var require_object = __commonJS({
|
|
609
617
|
"../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
|
|
610
618
|
"use strict";
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var
|
|
614
|
-
var
|
|
615
|
-
var
|
|
619
|
+
var __defProp2 = Object.defineProperty;
|
|
620
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
621
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
622
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
623
|
+
var __export2 = (target, all) => {
|
|
616
624
|
for (var name in all)
|
|
617
|
-
|
|
625
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
618
626
|
};
|
|
619
|
-
var
|
|
627
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
620
628
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
621
|
-
for (let key of
|
|
622
|
-
if (!
|
|
623
|
-
|
|
629
|
+
for (let key of __getOwnPropNames2(from))
|
|
630
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
631
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
624
632
|
}
|
|
625
633
|
return to;
|
|
626
634
|
};
|
|
627
|
-
var
|
|
635
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
628
636
|
var object_exports = {};
|
|
629
|
-
|
|
637
|
+
__export2(object_exports, {
|
|
630
638
|
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
631
639
|
clone: () => clone,
|
|
632
640
|
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
@@ -662,7 +670,7 @@ var require_object = __commonJS({
|
|
|
662
670
|
removeFromObject: () => removeFromObject,
|
|
663
671
|
stringToObject: () => stringToObject
|
|
664
672
|
});
|
|
665
|
-
module2.exports =
|
|
673
|
+
module2.exports = __toCommonJS2(object_exports);
|
|
666
674
|
var import_globals2 = require_globals();
|
|
667
675
|
var import_types = require_types();
|
|
668
676
|
var import_array = require_array();
|
|
@@ -768,7 +776,7 @@ var require_object = __commonJS({
|
|
|
768
776
|
return o;
|
|
769
777
|
};
|
|
770
778
|
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
771
|
-
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
779
|
+
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
772
780
|
for (const prop in obj) {
|
|
773
781
|
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
774
782
|
continue;
|
|
@@ -1022,7 +1030,7 @@ var require_object = __commonJS({
|
|
|
1022
1030
|
};
|
|
1023
1031
|
var overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
1024
1032
|
for (const e in params) {
|
|
1025
|
-
if (e === "
|
|
1033
|
+
if (e === "__ref")
|
|
1026
1034
|
continue;
|
|
1027
1035
|
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
1028
1036
|
continue;
|
|
@@ -1144,6 +1152,12 @@ var require_object = __commonJS({
|
|
|
1144
1152
|
if (foundString || foundInArray)
|
|
1145
1153
|
return el;
|
|
1146
1154
|
}
|
|
1155
|
+
if (el.parent && el.parent.childExtend) {
|
|
1156
|
+
const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
|
|
1157
|
+
const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
|
|
1158
|
+
if (foundString || foundInArray)
|
|
1159
|
+
return el;
|
|
1160
|
+
}
|
|
1147
1161
|
};
|
|
1148
1162
|
var getExtendsInElement = (obj) => {
|
|
1149
1163
|
let result = [];
|
|
@@ -1176,31 +1190,31 @@ var require_object = __commonJS({
|
|
|
1176
1190
|
var require_function = __commonJS({
|
|
1177
1191
|
"../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
|
|
1178
1192
|
"use strict";
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1181
|
-
var
|
|
1182
|
-
var
|
|
1183
|
-
var
|
|
1193
|
+
var __defProp2 = Object.defineProperty;
|
|
1194
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1195
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1196
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1197
|
+
var __export2 = (target, all) => {
|
|
1184
1198
|
for (var name in all)
|
|
1185
|
-
|
|
1199
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1186
1200
|
};
|
|
1187
|
-
var
|
|
1201
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1188
1202
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1189
|
-
for (let key of
|
|
1190
|
-
if (!
|
|
1191
|
-
|
|
1203
|
+
for (let key of __getOwnPropNames2(from))
|
|
1204
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1205
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1192
1206
|
}
|
|
1193
1207
|
return to;
|
|
1194
1208
|
};
|
|
1195
|
-
var
|
|
1209
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1196
1210
|
var function_exports = {};
|
|
1197
|
-
|
|
1211
|
+
__export2(function_exports, {
|
|
1198
1212
|
debounce: () => debounce,
|
|
1199
1213
|
debounceOnContext: () => debounceOnContext,
|
|
1200
1214
|
isStringFunction: () => isStringFunction,
|
|
1201
1215
|
memoize: () => memoize
|
|
1202
1216
|
});
|
|
1203
|
-
module2.exports =
|
|
1217
|
+
module2.exports = __toCommonJS2(function_exports);
|
|
1204
1218
|
function debounce(func, wait, immediate) {
|
|
1205
1219
|
let timeout;
|
|
1206
1220
|
return function() {
|
|
@@ -1251,29 +1265,29 @@ var require_function = __commonJS({
|
|
|
1251
1265
|
var require_log = __commonJS({
|
|
1252
1266
|
"../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
|
|
1253
1267
|
"use strict";
|
|
1254
|
-
var
|
|
1255
|
-
var
|
|
1256
|
-
var
|
|
1257
|
-
var
|
|
1258
|
-
var
|
|
1268
|
+
var __defProp2 = Object.defineProperty;
|
|
1269
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1270
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1271
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1272
|
+
var __export2 = (target, all) => {
|
|
1259
1273
|
for (var name in all)
|
|
1260
|
-
|
|
1274
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1261
1275
|
};
|
|
1262
|
-
var
|
|
1276
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1263
1277
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1264
|
-
for (let key of
|
|
1265
|
-
if (!
|
|
1266
|
-
|
|
1278
|
+
for (let key of __getOwnPropNames2(from))
|
|
1279
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1280
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1267
1281
|
}
|
|
1268
1282
|
return to;
|
|
1269
1283
|
};
|
|
1270
|
-
var
|
|
1284
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1271
1285
|
var log_exports = {};
|
|
1272
|
-
|
|
1286
|
+
__export2(log_exports, {
|
|
1273
1287
|
logGroupIf: () => logGroupIf,
|
|
1274
1288
|
logIf: () => logIf
|
|
1275
1289
|
});
|
|
1276
|
-
module2.exports =
|
|
1290
|
+
module2.exports = __toCommonJS2(log_exports);
|
|
1277
1291
|
var logIf = (bool, ...arg) => {
|
|
1278
1292
|
if (bool)
|
|
1279
1293
|
arg.map((v) => console.log(v));
|
|
@@ -1292,46 +1306,46 @@ var require_log = __commonJS({
|
|
|
1292
1306
|
var require_cookie = __commonJS({
|
|
1293
1307
|
"../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1294
1308
|
"use strict";
|
|
1295
|
-
var
|
|
1296
|
-
var
|
|
1297
|
-
var
|
|
1298
|
-
var
|
|
1299
|
-
var
|
|
1309
|
+
var __defProp2 = Object.defineProperty;
|
|
1310
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1311
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1312
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1313
|
+
var __export2 = (target, all) => {
|
|
1300
1314
|
for (var name in all)
|
|
1301
|
-
|
|
1315
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1302
1316
|
};
|
|
1303
|
-
var
|
|
1317
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1304
1318
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1305
|
-
for (let key of
|
|
1306
|
-
if (!
|
|
1307
|
-
|
|
1319
|
+
for (let key of __getOwnPropNames2(from))
|
|
1320
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1321
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1308
1322
|
}
|
|
1309
1323
|
return to;
|
|
1310
1324
|
};
|
|
1311
|
-
var
|
|
1325
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1312
1326
|
var cookie_exports = {};
|
|
1313
|
-
|
|
1327
|
+
__export2(cookie_exports, {
|
|
1314
1328
|
getCookie: () => getCookie,
|
|
1315
1329
|
isMobile: () => isMobile,
|
|
1316
1330
|
setCookie: () => setCookie
|
|
1317
1331
|
});
|
|
1318
|
-
module2.exports =
|
|
1332
|
+
module2.exports = __toCommonJS2(cookie_exports);
|
|
1319
1333
|
var import_types = require_types();
|
|
1320
|
-
var
|
|
1334
|
+
var import_utils7 = require_cjs2();
|
|
1321
1335
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
1322
1336
|
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
1323
|
-
if ((0, import_types.isUndefined)(
|
|
1337
|
+
if ((0, import_types.isUndefined)(import_utils7.document) || (0, import_types.isUndefined)(import_utils7.document.cookie))
|
|
1324
1338
|
return;
|
|
1325
1339
|
const d = /* @__PURE__ */ new Date();
|
|
1326
1340
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
1327
1341
|
const expires = `expires=${d.toUTCString()}`;
|
|
1328
|
-
|
|
1342
|
+
import_utils7.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1329
1343
|
};
|
|
1330
1344
|
var getCookie = (cname) => {
|
|
1331
|
-
if ((0, import_types.isUndefined)(
|
|
1345
|
+
if ((0, import_types.isUndefined)(import_utils7.document) || (0, import_types.isUndefined)(import_utils7.document.cookie))
|
|
1332
1346
|
return;
|
|
1333
1347
|
const name = `${cname}=`;
|
|
1334
|
-
const decodedCookie = decodeURIComponent(
|
|
1348
|
+
const decodedCookie = decodeURIComponent(import_utils7.document.cookie);
|
|
1335
1349
|
const ca = decodedCookie.split(";");
|
|
1336
1350
|
for (let i = 0; i < ca.length; i++) {
|
|
1337
1351
|
let c = ca[i];
|
|
@@ -1349,29 +1363,29 @@ var require_cookie = __commonJS({
|
|
|
1349
1363
|
var require_tags = __commonJS({
|
|
1350
1364
|
"../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1351
1365
|
"use strict";
|
|
1352
|
-
var
|
|
1353
|
-
var
|
|
1354
|
-
var
|
|
1355
|
-
var
|
|
1356
|
-
var
|
|
1366
|
+
var __defProp2 = Object.defineProperty;
|
|
1367
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1368
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1369
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1370
|
+
var __export2 = (target, all) => {
|
|
1357
1371
|
for (var name in all)
|
|
1358
|
-
|
|
1372
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1359
1373
|
};
|
|
1360
|
-
var
|
|
1374
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1361
1375
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1362
|
-
for (let key of
|
|
1363
|
-
if (!
|
|
1364
|
-
|
|
1376
|
+
for (let key of __getOwnPropNames2(from))
|
|
1377
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1378
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1365
1379
|
}
|
|
1366
1380
|
return to;
|
|
1367
1381
|
};
|
|
1368
|
-
var
|
|
1382
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1369
1383
|
var tags_exports = {};
|
|
1370
|
-
|
|
1384
|
+
__export2(tags_exports, {
|
|
1371
1385
|
HTML_TAGS: () => HTML_TAGS,
|
|
1372
1386
|
isValidHtmlTag: () => isValidHtmlTag
|
|
1373
1387
|
});
|
|
1374
|
-
module2.exports =
|
|
1388
|
+
module2.exports = __toCommonJS2(tags_exports);
|
|
1375
1389
|
var HTML_TAGS = {
|
|
1376
1390
|
root: [
|
|
1377
1391
|
"body",
|
|
@@ -1517,22 +1531,22 @@ var require_tags = __commonJS({
|
|
|
1517
1531
|
var require_cjs2 = __commonJS({
|
|
1518
1532
|
"../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
|
|
1519
1533
|
"use strict";
|
|
1520
|
-
var
|
|
1521
|
-
var
|
|
1522
|
-
var
|
|
1523
|
-
var
|
|
1524
|
-
var
|
|
1534
|
+
var __defProp2 = Object.defineProperty;
|
|
1535
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1536
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1537
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1538
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1525
1539
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1526
|
-
for (let key of
|
|
1527
|
-
if (!
|
|
1528
|
-
|
|
1540
|
+
for (let key of __getOwnPropNames2(from))
|
|
1541
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1542
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1529
1543
|
}
|
|
1530
1544
|
return to;
|
|
1531
1545
|
};
|
|
1532
|
-
var __reExport = (target, mod, secondTarget) => (
|
|
1533
|
-
var
|
|
1546
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
|
|
1547
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1534
1548
|
var utils_exports2 = {};
|
|
1535
|
-
module2.exports =
|
|
1549
|
+
module2.exports = __toCommonJS2(utils_exports2);
|
|
1536
1550
|
__reExport(utils_exports2, require_key(), module2.exports);
|
|
1537
1551
|
__reExport(utils_exports2, require_env(), module2.exports);
|
|
1538
1552
|
__reExport(utils_exports2, require_types(), module2.exports);
|
|
@@ -1548,1912 +1562,1942 @@ var require_cjs2 = __commonJS({
|
|
|
1548
1562
|
}
|
|
1549
1563
|
});
|
|
1550
1564
|
|
|
1551
|
-
//
|
|
1552
|
-
var
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
getSequenceValue: () => getSequenceValue,
|
|
1574
|
-
getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
|
|
1575
|
-
getSubratio: () => getSubratio,
|
|
1576
|
-
getSubratioDifference: () => getSubratioDifference,
|
|
1577
|
-
hexToRgb: () => hexToRgb,
|
|
1578
|
-
hexToRgbArray: () => hexToRgbArray,
|
|
1579
|
-
hexToRgba: () => hexToRgba,
|
|
1580
|
-
hslToRgb: () => hslToRgb,
|
|
1581
|
-
isScalingUnit: () => isScalingUnit,
|
|
1582
|
-
mixTwoColors: () => mixTwoColors,
|
|
1583
|
-
mixTwoRgb: () => mixTwoRgb,
|
|
1584
|
-
mixTwoRgba: () => mixTwoRgba,
|
|
1585
|
-
numToLetterMap: () => numToLetterMap,
|
|
1586
|
-
opacify: () => opacify,
|
|
1587
|
-
returnSubThemeOrDefault: () => returnSubThemeOrDefault,
|
|
1588
|
-
rgbArrayToHex: () => rgbArrayToHex,
|
|
1589
|
-
rgbToHSL: () => rgbToHSL,
|
|
1590
|
-
rgbToHex: () => rgbToHex,
|
|
1591
|
-
setCustomFont: () => setCustomFont,
|
|
1592
|
-
setCustomFontMedia: () => setCustomFontMedia,
|
|
1593
|
-
setInCustomFontMedia: () => setInCustomFontMedia,
|
|
1594
|
-
setScalingVar: () => setScalingVar,
|
|
1595
|
-
setSubScalingVar: () => setSubScalingVar,
|
|
1596
|
-
setVariables: () => setVariables
|
|
1597
|
-
});
|
|
1598
|
-
module.exports = __toCommonJS(utils_exports);
|
|
1599
|
-
|
|
1600
|
-
// src/utils/unit.js
|
|
1601
|
-
var isScalingUnit = (unit) => {
|
|
1602
|
-
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
1603
|
-
};
|
|
1604
|
-
|
|
1605
|
-
// src/utils/color.js
|
|
1606
|
-
var import_globals = __toESM(require_cjs(), 1);
|
|
1607
|
-
var import_utils = __toESM(require_cjs2(), 1);
|
|
1608
|
-
var ENV = "development";
|
|
1609
|
-
var colorStringToRgbaArray = (color) => {
|
|
1610
|
-
if (color === "")
|
|
1611
|
-
return [0, 0, 0, 0];
|
|
1612
|
-
if (color.toLowerCase() === "transparent")
|
|
1613
|
-
return [0, 0, 0, 0];
|
|
1614
|
-
if (color[0] === "#") {
|
|
1615
|
-
if (color.length < 7) {
|
|
1616
|
-
color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
|
|
1617
|
-
}
|
|
1618
|
-
return [
|
|
1619
|
-
parseInt(color.substr(1, 2), 16),
|
|
1620
|
-
parseInt(color.substr(3, 2), 16),
|
|
1621
|
-
parseInt(color.substr(5, 2), 16),
|
|
1622
|
-
color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
|
|
1623
|
-
];
|
|
1624
|
-
}
|
|
1625
|
-
if (color.indexOf("rgb") === -1) {
|
|
1626
|
-
if (import_globals.document && import_globals.window) {
|
|
1627
|
-
const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
|
|
1628
|
-
const flag = "rgb(1, 2, 3)";
|
|
1629
|
-
elem.style.color = flag;
|
|
1630
|
-
if (elem.style.color !== flag) {
|
|
1631
|
-
import_globals.document.body.removeChild(elem);
|
|
1632
|
-
return;
|
|
1565
|
+
// ../utils/dist/cjs/index.js
|
|
1566
|
+
var require_cjs3 = __commonJS({
|
|
1567
|
+
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
1568
|
+
"use strict";
|
|
1569
|
+
var __create2 = Object.create;
|
|
1570
|
+
var __defProp2 = Object.defineProperty;
|
|
1571
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1572
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1573
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1574
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1575
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
1576
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1577
|
+
};
|
|
1578
|
+
var __export2 = (target, all) => {
|
|
1579
|
+
for (var name in all)
|
|
1580
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1581
|
+
};
|
|
1582
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1583
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1584
|
+
for (let key of __getOwnPropNames2(from))
|
|
1585
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1586
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1633
1587
|
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1588
|
+
return to;
|
|
1589
|
+
};
|
|
1590
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1591
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
1592
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
1593
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1594
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1595
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1596
|
+
mod
|
|
1597
|
+
));
|
|
1598
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1599
|
+
var require_key2 = __commonJS2({
|
|
1600
|
+
"../../../domql/packages/utils/dist/cjs/key.js"(exports2, module22) {
|
|
1601
|
+
"use strict";
|
|
1602
|
+
var __defProp22 = Object.defineProperty;
|
|
1603
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1604
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1605
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1606
|
+
var __export22 = (target, all) => {
|
|
1607
|
+
for (var name in all)
|
|
1608
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1609
|
+
};
|
|
1610
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1611
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1612
|
+
for (let key of __getOwnPropNames22(from))
|
|
1613
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1614
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1615
|
+
}
|
|
1616
|
+
return to;
|
|
1617
|
+
};
|
|
1618
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1619
|
+
var key_exports = {};
|
|
1620
|
+
__export22(key_exports, {
|
|
1621
|
+
createSnapshotId: () => createSnapshotId,
|
|
1622
|
+
generateKey: () => generateKey
|
|
1623
|
+
});
|
|
1624
|
+
module22.exports = __toCommonJS22(key_exports);
|
|
1625
|
+
var generateKey = /* @__PURE__ */ function() {
|
|
1626
|
+
let index = 0;
|
|
1627
|
+
function newId() {
|
|
1628
|
+
index++;
|
|
1629
|
+
return index;
|
|
1630
|
+
}
|
|
1631
|
+
return newId;
|
|
1632
|
+
}();
|
|
1633
|
+
var createSnapshotId = generateKey;
|
|
1638
1634
|
}
|
|
1639
|
-
color = import_globals.window.getComputedStyle(elem).color;
|
|
1640
|
-
import_globals.document.body.removeChild(elem);
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
if (color.indexOf("rgb") === 0) {
|
|
1644
|
-
if (color.indexOf("rgba") === -1)
|
|
1645
|
-
color = `${color}, 1`;
|
|
1646
|
-
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
1647
|
-
}
|
|
1648
|
-
return [0, 0, 0, 0];
|
|
1649
|
-
};
|
|
1650
|
-
var mixTwoColors = (colorA, colorB, range = 0.5) => {
|
|
1651
|
-
colorA = colorStringToRgbaArray(colorA);
|
|
1652
|
-
colorB = colorStringToRgbaArray(colorB);
|
|
1653
|
-
return mixTwoRgba(colorA, colorB, range);
|
|
1654
|
-
};
|
|
1655
|
-
var hexToRgb = (hex, alpha = 1) => {
|
|
1656
|
-
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
1657
|
-
return `rgb(${r},${g},${b})`;
|
|
1658
|
-
};
|
|
1659
|
-
var hexToRgbArray = (hex, alpha = 1) => {
|
|
1660
|
-
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
1661
|
-
return [r, g, b];
|
|
1662
|
-
};
|
|
1663
|
-
var rgbToHex = (r, g, b) => {
|
|
1664
|
-
return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1);
|
|
1665
|
-
};
|
|
1666
|
-
var rgbArrayToHex = ([r, g, b]) => {
|
|
1667
|
-
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
1668
|
-
};
|
|
1669
|
-
var hexToRgba = (hex, alpha = 1) => {
|
|
1670
|
-
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
1671
|
-
return `rgba(${r},${g},${b},${alpha})`;
|
|
1672
|
-
};
|
|
1673
|
-
var mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
1674
|
-
const arr = [];
|
|
1675
|
-
for (let i = 0; i < 3; i++) {
|
|
1676
|
-
arr[i] = ~~(colorA[i] + (colorB[i] - colorA[i]) * range);
|
|
1677
|
-
}
|
|
1678
|
-
return `rgb(${arr})`;
|
|
1679
|
-
};
|
|
1680
|
-
var changeLightness = (delta, hsl) => {
|
|
1681
|
-
const [hue, saturation, lightness] = hsl;
|
|
1682
|
-
const newLightness = Math.max(
|
|
1683
|
-
0,
|
|
1684
|
-
Math.min(100, lightness + parseFloat(delta))
|
|
1685
|
-
);
|
|
1686
|
-
return [hue, saturation, newLightness];
|
|
1687
|
-
};
|
|
1688
|
-
var rgbToHSL = (r, g, b) => {
|
|
1689
|
-
const a = Math.max(r, g, b);
|
|
1690
|
-
const n = a - Math.min(r, g, b);
|
|
1691
|
-
const f = 1 - Math.abs(a + a - n - 1);
|
|
1692
|
-
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
1693
|
-
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
1694
|
-
};
|
|
1695
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
1696
|
-
Math.min(k - 3, 9 - k, 1),
|
|
1697
|
-
-1
|
|
1698
|
-
)) => [f(0), f(8), f(4)];
|
|
1699
|
-
var getColorShade = (col, amt) => {
|
|
1700
|
-
const num = parseInt(col, 16);
|
|
1701
|
-
let r = (num >> 16) + amt;
|
|
1702
|
-
if (r > 255)
|
|
1703
|
-
r = 255;
|
|
1704
|
-
else if (r < 0)
|
|
1705
|
-
r = 0;
|
|
1706
|
-
let b = (num >> 8 & 255) + amt;
|
|
1707
|
-
if (b > 255)
|
|
1708
|
-
b = 255;
|
|
1709
|
-
else if (b < 0)
|
|
1710
|
-
b = 0;
|
|
1711
|
-
let g = (num & 255) + amt;
|
|
1712
|
-
if (g > 255)
|
|
1713
|
-
g = 255;
|
|
1714
|
-
else if (g < 0)
|
|
1715
|
-
g = 0;
|
|
1716
|
-
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
1717
|
-
};
|
|
1718
|
-
var mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
1719
|
-
const arr = [];
|
|
1720
|
-
for (let i = 0; i < 4; i++) {
|
|
1721
|
-
const round = i === 3 ? (x) => x : Math.round;
|
|
1722
|
-
arr[i] = round(
|
|
1723
|
-
colorA[i] + (colorB[i] - colorA[i]) * range
|
|
1724
|
-
);
|
|
1725
|
-
}
|
|
1726
|
-
return `rgba(${arr})`;
|
|
1727
|
-
};
|
|
1728
|
-
var opacify = (color, opacity) => {
|
|
1729
|
-
const arr = colorStringToRgbaArray(color);
|
|
1730
|
-
if (!arr) {
|
|
1731
|
-
if (ENV === "test" || ENV === "development")
|
|
1732
|
-
console.warn(color + " color is not rgba");
|
|
1733
|
-
return;
|
|
1734
|
-
}
|
|
1735
|
-
arr[3] = opacity;
|
|
1736
|
-
return `rgba(${arr})`;
|
|
1737
|
-
};
|
|
1738
|
-
var getRgbTone = (rgb, tone) => {
|
|
1739
|
-
if ((0, import_utils.isString)(rgb) && rgb.includes("rgb"))
|
|
1740
|
-
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
1741
|
-
if ((0, import_utils.isString)(rgb))
|
|
1742
|
-
rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
1743
|
-
if ((0, import_utils.isNumber)(tone))
|
|
1744
|
-
tone += "";
|
|
1745
|
-
const toHex = rgbArrayToHex(rgb);
|
|
1746
|
-
const abs = tone.slice(0, 1);
|
|
1747
|
-
if (abs === "-" || abs === "+") {
|
|
1748
|
-
const colorShade = getColorShade(toHex, parseFloat(tone));
|
|
1749
|
-
return hexToRgbArray(colorShade).join(", ");
|
|
1750
|
-
} else {
|
|
1751
|
-
const [r, g, b] = rgb;
|
|
1752
|
-
const hsl = rgbToHSL(r, g, b);
|
|
1753
|
-
const [h, s, l] = hsl;
|
|
1754
|
-
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
|
|
1755
|
-
return newRgb;
|
|
1756
|
-
}
|
|
1757
|
-
};
|
|
1758
|
-
|
|
1759
|
-
// src/utils/theme.js
|
|
1760
|
-
var returnSubThemeOrDefault = (orig, theme) => {
|
|
1761
|
-
if (!orig)
|
|
1762
|
-
return;
|
|
1763
|
-
if (orig.themes && orig.themes[theme])
|
|
1764
|
-
return orig.themes[theme];
|
|
1765
|
-
if (orig[theme])
|
|
1766
|
-
return [orig, orig[theme]];
|
|
1767
|
-
return orig;
|
|
1768
|
-
};
|
|
1769
|
-
|
|
1770
|
-
// src/utils/font.js
|
|
1771
|
-
var getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
1772
|
-
if (LIBRARY[key])
|
|
1773
|
-
return LIBRARY[key].value;
|
|
1774
|
-
if (LIBRARY.default)
|
|
1775
|
-
return LIBRARY[LIBRARY.default].value;
|
|
1776
|
-
const hasValue = Object.keys(LIBRARY)[0];
|
|
1777
|
-
return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
|
|
1778
|
-
};
|
|
1779
|
-
var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
|
|
1780
|
-
var setInCustomFontMedia = (str) => `@font-face { ${str} }`;
|
|
1781
|
-
var setCustomFont = (name, url, weight) => `
|
|
1782
|
-
font-family: '${name}';
|
|
1783
|
-
font-style: normal;
|
|
1784
|
-
${weight && `font-weight: ${weight};`}
|
|
1785
|
-
src: url('${url}') format('${getFontFormat(url)}');`;
|
|
1786
|
-
var setCustomFontMedia = (name, url, weight) => `@font-face {
|
|
1787
|
-
${setCustomFont(name, url, weight)}
|
|
1788
|
-
}`;
|
|
1789
|
-
var getFontFaceEach = (name, weights) => {
|
|
1790
|
-
const keys = Object.keys(weights);
|
|
1791
|
-
return keys.map((key) => {
|
|
1792
|
-
const { url, fontWeight } = weights[key];
|
|
1793
|
-
return setCustomFont(name, url, fontWeight);
|
|
1794
|
-
});
|
|
1795
|
-
};
|
|
1796
|
-
var getFontFace = (LIBRARY) => {
|
|
1797
|
-
const keys = Object.keys(LIBRARY);
|
|
1798
|
-
return keys.map((key) => getFontFaceEach(key, LIBRARY[key].value));
|
|
1799
|
-
};
|
|
1800
|
-
var getFontFaceEachString = (name, weights) => {
|
|
1801
|
-
const isArr = weights[0];
|
|
1802
|
-
if (isArr)
|
|
1803
|
-
return getFontFaceEach(name, weights).map(setInCustomFontMedia);
|
|
1804
|
-
return setCustomFontMedia(name, weights.url);
|
|
1805
|
-
};
|
|
1806
|
-
var getFontFaceString = (LIBRARY) => {
|
|
1807
|
-
const keys = Object.keys(LIBRARY);
|
|
1808
|
-
return keys.map((key) => getFontFaceEachString(key, LIBRARY[key].value));
|
|
1809
|
-
};
|
|
1810
|
-
|
|
1811
|
-
// src/utils/sequence.js
|
|
1812
|
-
var import_utils5 = __toESM(require_cjs2(), 1);
|
|
1813
|
-
|
|
1814
|
-
// ../utils/dist/cjs/index.js
|
|
1815
|
-
var __create2 = Object.create;
|
|
1816
|
-
var __defProp2 = Object.defineProperty;
|
|
1817
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1818
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1819
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1820
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1821
|
-
var __commonJS2 = (cb, mod) => function __require() {
|
|
1822
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1823
|
-
};
|
|
1824
|
-
var __export2 = (target, all) => {
|
|
1825
|
-
for (var name in all)
|
|
1826
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1827
|
-
};
|
|
1828
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1829
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1830
|
-
for (let key of __getOwnPropNames2(from))
|
|
1831
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1832
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1833
|
-
}
|
|
1834
|
-
return to;
|
|
1835
|
-
};
|
|
1836
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1837
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1838
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1839
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1840
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1841
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1842
|
-
mod
|
|
1843
|
-
));
|
|
1844
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1845
|
-
var require_key2 = __commonJS2({
|
|
1846
|
-
"../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
|
|
1847
|
-
"use strict";
|
|
1848
|
-
var __defProp22 = Object.defineProperty;
|
|
1849
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1850
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1851
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1852
|
-
var __export22 = (target, all) => {
|
|
1853
|
-
for (var name in all)
|
|
1854
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1855
|
-
};
|
|
1856
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1857
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1858
|
-
for (let key of __getOwnPropNames22(from))
|
|
1859
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1860
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1861
|
-
}
|
|
1862
|
-
return to;
|
|
1863
|
-
};
|
|
1864
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1865
|
-
var key_exports = {};
|
|
1866
|
-
__export22(key_exports, {
|
|
1867
|
-
createSnapshotId: () => createSnapshotId,
|
|
1868
|
-
generateKey: () => generateKey
|
|
1869
|
-
});
|
|
1870
|
-
module2.exports = __toCommonJS22(key_exports);
|
|
1871
|
-
var generateKey = /* @__PURE__ */ function() {
|
|
1872
|
-
let index = 0;
|
|
1873
|
-
function newId() {
|
|
1874
|
-
index++;
|
|
1875
|
-
return index;
|
|
1876
|
-
}
|
|
1877
|
-
return newId;
|
|
1878
|
-
}();
|
|
1879
|
-
var createSnapshotId = generateKey;
|
|
1880
|
-
}
|
|
1881
|
-
});
|
|
1882
|
-
var require_env2 = __commonJS2({
|
|
1883
|
-
"../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
|
|
1884
|
-
"use strict";
|
|
1885
|
-
var __defProp22 = Object.defineProperty;
|
|
1886
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1887
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1888
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1889
|
-
var __export22 = (target, all) => {
|
|
1890
|
-
for (var name in all)
|
|
1891
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1892
|
-
};
|
|
1893
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1894
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1895
|
-
for (let key of __getOwnPropNames22(from))
|
|
1896
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1897
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1898
|
-
}
|
|
1899
|
-
return to;
|
|
1900
|
-
};
|
|
1901
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1902
|
-
var env_exports = {};
|
|
1903
|
-
__export22(env_exports, {
|
|
1904
|
-
NODE_ENV: () => NODE_ENV,
|
|
1905
|
-
getNev: () => getNev,
|
|
1906
|
-
isDevelopment: () => isDevelopment,
|
|
1907
|
-
isProduction: () => isProduction,
|
|
1908
|
-
isTest: () => isTest
|
|
1909
1635
|
});
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
var
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1636
|
+
var require_env2 = __commonJS2({
|
|
1637
|
+
"../../../domql/packages/utils/dist/cjs/env.js"(exports2, module22) {
|
|
1638
|
+
"use strict";
|
|
1639
|
+
var __defProp22 = Object.defineProperty;
|
|
1640
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1641
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1642
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1643
|
+
var __export22 = (target, all) => {
|
|
1644
|
+
for (var name in all)
|
|
1645
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1646
|
+
};
|
|
1647
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1648
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1649
|
+
for (let key of __getOwnPropNames22(from))
|
|
1650
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1651
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1652
|
+
}
|
|
1653
|
+
return to;
|
|
1654
|
+
};
|
|
1655
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1656
|
+
var env_exports = {};
|
|
1657
|
+
__export22(env_exports, {
|
|
1658
|
+
NODE_ENV: () => NODE_ENV,
|
|
1659
|
+
getNev: () => getNev,
|
|
1660
|
+
isDevelopment: () => isDevelopment,
|
|
1661
|
+
isProduction: () => isProduction,
|
|
1662
|
+
isTest: () => isTest
|
|
1663
|
+
});
|
|
1664
|
+
module22.exports = __toCommonJS22(env_exports);
|
|
1665
|
+
var NODE_ENV = "development";
|
|
1666
|
+
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
1667
|
+
var isTest = (env = NODE_ENV) => env === "test";
|
|
1668
|
+
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
1669
|
+
var getNev = (key, env = NODE_ENV) => env[key];
|
|
1934
1670
|
}
|
|
1935
|
-
return to;
|
|
1936
|
-
};
|
|
1937
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1938
|
-
var globals_exports = {};
|
|
1939
|
-
__export22(globals_exports, {
|
|
1940
|
-
document: () => document22,
|
|
1941
|
-
global: () => global,
|
|
1942
|
-
self: () => self,
|
|
1943
|
-
window: () => window2
|
|
1944
1671
|
});
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
var
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1672
|
+
var require_globals2 = __commonJS2({
|
|
1673
|
+
"../../../domql/packages/utils/dist/cjs/globals.js"(exports2, module22) {
|
|
1674
|
+
"use strict";
|
|
1675
|
+
var __defProp22 = Object.defineProperty;
|
|
1676
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1677
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1678
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1679
|
+
var __export22 = (target, all) => {
|
|
1680
|
+
for (var name in all)
|
|
1681
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1682
|
+
};
|
|
1683
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1684
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1685
|
+
for (let key of __getOwnPropNames22(from))
|
|
1686
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1687
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1688
|
+
}
|
|
1689
|
+
return to;
|
|
1690
|
+
};
|
|
1691
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1692
|
+
var globals_exports = {};
|
|
1693
|
+
__export22(globals_exports, {
|
|
1694
|
+
document: () => document22,
|
|
1695
|
+
global: () => global,
|
|
1696
|
+
self: () => self,
|
|
1697
|
+
window: () => window22
|
|
1698
|
+
});
|
|
1699
|
+
module22.exports = __toCommonJS22(globals_exports);
|
|
1700
|
+
var global = globalThis;
|
|
1701
|
+
var self = globalThis;
|
|
1702
|
+
var window22 = globalThis;
|
|
1703
|
+
var document22 = window22.document;
|
|
1968
1704
|
}
|
|
1969
|
-
return to;
|
|
1970
|
-
};
|
|
1971
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1972
|
-
var node_exports = {};
|
|
1973
|
-
__export22(node_exports, {
|
|
1974
|
-
isHtmlElement: () => isHtmlElement,
|
|
1975
|
-
isNode: () => isNode
|
|
1976
1705
|
});
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
});
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
__defProp22(
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
1706
|
+
var require_node2 = __commonJS2({
|
|
1707
|
+
"../../../domql/packages/utils/dist/cjs/node.js"(exports2, module22) {
|
|
1708
|
+
"use strict";
|
|
1709
|
+
var __defProp22 = Object.defineProperty;
|
|
1710
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1711
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1712
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1713
|
+
var __export22 = (target, all) => {
|
|
1714
|
+
for (var name in all)
|
|
1715
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1716
|
+
};
|
|
1717
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1718
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1719
|
+
for (let key of __getOwnPropNames22(from))
|
|
1720
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1721
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1722
|
+
}
|
|
1723
|
+
return to;
|
|
1724
|
+
};
|
|
1725
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1726
|
+
var node_exports = {};
|
|
1727
|
+
__export22(node_exports, {
|
|
1728
|
+
isHtmlElement: () => isHtmlElement,
|
|
1729
|
+
isNode: () => isNode
|
|
1730
|
+
});
|
|
1731
|
+
module22.exports = __toCommonJS22(node_exports);
|
|
1732
|
+
var import_globals2 = require_globals2();
|
|
1733
|
+
var isNode = (obj) => {
|
|
1734
|
+
return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
1735
|
+
};
|
|
1736
|
+
var isHtmlElement = (obj) => {
|
|
1737
|
+
return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
1738
|
+
};
|
|
2003
1739
|
}
|
|
2004
|
-
return to;
|
|
2005
|
-
};
|
|
2006
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2007
|
-
var types_exports = {};
|
|
2008
|
-
__export22(types_exports, {
|
|
2009
|
-
TYPES: () => TYPES,
|
|
2010
|
-
is: () => is,
|
|
2011
|
-
isArray: () => isArray3,
|
|
2012
|
-
isBoolean: () => isBoolean,
|
|
2013
|
-
isDate: () => isDate,
|
|
2014
|
-
isDefined: () => isDefined2,
|
|
2015
|
-
isFunction: () => isFunction,
|
|
2016
|
-
isNot: () => isNot,
|
|
2017
|
-
isNull: () => isNull,
|
|
2018
|
-
isNumber: () => isNumber2,
|
|
2019
|
-
isObject: () => isObject3,
|
|
2020
|
-
isObjectLike: () => isObjectLike2,
|
|
2021
|
-
isString: () => isString22,
|
|
2022
|
-
isUndefined: () => isUndefined
|
|
2023
1740
|
});
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
var
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
1741
|
+
var require_types2 = __commonJS2({
|
|
1742
|
+
"../../../domql/packages/utils/dist/cjs/types.js"(exports2, module22) {
|
|
1743
|
+
"use strict";
|
|
1744
|
+
var __defProp22 = Object.defineProperty;
|
|
1745
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1746
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1747
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1748
|
+
var __export22 = (target, all) => {
|
|
1749
|
+
for (var name in all)
|
|
1750
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1751
|
+
};
|
|
1752
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1753
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1754
|
+
for (let key of __getOwnPropNames22(from))
|
|
1755
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1756
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1757
|
+
}
|
|
1758
|
+
return to;
|
|
1759
|
+
};
|
|
1760
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1761
|
+
var types_exports = {};
|
|
1762
|
+
__export22(types_exports, {
|
|
1763
|
+
TYPES: () => TYPES,
|
|
1764
|
+
is: () => is,
|
|
1765
|
+
isArray: () => isArray3,
|
|
1766
|
+
isBoolean: () => isBoolean,
|
|
1767
|
+
isDate: () => isDate,
|
|
1768
|
+
isDefined: () => isDefined2,
|
|
1769
|
+
isFunction: () => isFunction,
|
|
1770
|
+
isNot: () => isNot,
|
|
1771
|
+
isNull: () => isNull,
|
|
1772
|
+
isNumber: () => isNumber2,
|
|
1773
|
+
isObject: () => isObject3,
|
|
1774
|
+
isObjectLike: () => isObjectLike2,
|
|
1775
|
+
isString: () => isString22,
|
|
1776
|
+
isUndefined: () => isUndefined
|
|
1777
|
+
});
|
|
1778
|
+
module22.exports = __toCommonJS22(types_exports);
|
|
1779
|
+
var import_node = require_node2();
|
|
1780
|
+
var isObject3 = (arg) => {
|
|
1781
|
+
if (arg === null)
|
|
1782
|
+
return false;
|
|
1783
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
1784
|
+
};
|
|
1785
|
+
var isString22 = (arg) => typeof arg === "string";
|
|
1786
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
1787
|
+
var isFunction = (arg) => typeof arg === "function";
|
|
1788
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
1789
|
+
var isNull = (arg) => arg === null;
|
|
1790
|
+
var isArray3 = (arg) => Array.isArray(arg);
|
|
1791
|
+
var isDate = (d) => d instanceof Date;
|
|
1792
|
+
var isObjectLike2 = (arg) => {
|
|
1793
|
+
if (arg === null)
|
|
1794
|
+
return false;
|
|
1795
|
+
return typeof arg === "object";
|
|
1796
|
+
};
|
|
1797
|
+
var isDefined2 = (arg) => {
|
|
1798
|
+
return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
1799
|
+
};
|
|
1800
|
+
var isUndefined = (arg) => {
|
|
1801
|
+
return arg === void 0;
|
|
1802
|
+
};
|
|
1803
|
+
var TYPES = {
|
|
1804
|
+
boolean: isBoolean,
|
|
1805
|
+
array: isArray3,
|
|
1806
|
+
object: isObject3,
|
|
1807
|
+
string: isString22,
|
|
1808
|
+
date: isDate,
|
|
1809
|
+
number: isNumber2,
|
|
1810
|
+
null: isNull,
|
|
1811
|
+
function: isFunction,
|
|
1812
|
+
objectLike: isObjectLike2,
|
|
1813
|
+
node: import_node.isNode,
|
|
1814
|
+
htmlElement: import_node.isHtmlElement,
|
|
1815
|
+
defined: isDefined2
|
|
1816
|
+
};
|
|
1817
|
+
var is = (arg) => {
|
|
1818
|
+
return (...args) => {
|
|
1819
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
1820
|
+
};
|
|
1821
|
+
};
|
|
1822
|
+
var isNot = (arg) => {
|
|
1823
|
+
return (...args) => {
|
|
1824
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
1825
|
+
};
|
|
1826
|
+
};
|
|
2091
1827
|
}
|
|
2092
|
-
return to;
|
|
2093
|
-
};
|
|
2094
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2095
|
-
var array_exports = {};
|
|
2096
|
-
__export22(array_exports, {
|
|
2097
|
-
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2098
|
-
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2099
|
-
arraysEqual: () => arraysEqual,
|
|
2100
|
-
createNestedObject: () => createNestedObject,
|
|
2101
|
-
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2102
|
-
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2103
|
-
getFrequencyInArray: () => getFrequencyInArray,
|
|
2104
|
-
joinArrays: () => joinArrays,
|
|
2105
|
-
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
2106
|
-
mergeArray: () => mergeArray,
|
|
2107
|
-
removeFromArray: () => removeFromArray,
|
|
2108
|
-
removeValueFromArray: () => removeValueFromArray,
|
|
2109
|
-
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
2110
|
-
reorderArrayByValues: () => reorderArrayByValues,
|
|
2111
|
-
swapItemsInArray: () => swapItemsInArray
|
|
2112
1828
|
});
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
throw new Error("Invalid index");
|
|
2130
|
-
}
|
|
2131
|
-
arr.splice(index, 1);
|
|
2132
|
-
} else if ((0, import_types.isArray)(index)) {
|
|
2133
|
-
index.forEach((idx) => removeFromArray(arr, idx));
|
|
2134
|
-
} else {
|
|
2135
|
-
throw new Error("Invalid index");
|
|
2136
|
-
}
|
|
2137
|
-
return arr;
|
|
2138
|
-
};
|
|
2139
|
-
var swapItemsInArray = (arr, i, j) => {
|
|
2140
|
-
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
2141
|
-
};
|
|
2142
|
-
var joinArrays = (...arrays) => {
|
|
2143
|
-
return [].concat(...arrays);
|
|
2144
|
-
};
|
|
2145
|
-
var mergeArray = (arr, excludeFrom = []) => {
|
|
2146
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
2147
|
-
};
|
|
2148
|
-
var mergeAndCloneIfArray = (obj) => {
|
|
2149
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2150
|
-
};
|
|
2151
|
-
var cutArrayBeforeValue = (arr, value) => {
|
|
2152
|
-
const index = arr.indexOf(value);
|
|
2153
|
-
if (index !== -1) {
|
|
2154
|
-
return arr.slice(0, index);
|
|
2155
|
-
}
|
|
2156
|
-
return arr;
|
|
2157
|
-
};
|
|
2158
|
-
var cutArrayAfterValue = (arr, value) => {
|
|
2159
|
-
if (!(0, import_types.isArray)(arr))
|
|
2160
|
-
return;
|
|
2161
|
-
const index = arr.indexOf(value);
|
|
2162
|
-
if (index !== -1) {
|
|
2163
|
-
return arr.slice(index + 1);
|
|
2164
|
-
}
|
|
2165
|
-
return arr;
|
|
2166
|
-
};
|
|
2167
|
-
var createNestedObject = (arr, lastValue) => {
|
|
2168
|
-
const nestedObject = {};
|
|
2169
|
-
if (arr.length === 0) {
|
|
2170
|
-
return lastValue;
|
|
2171
|
-
}
|
|
2172
|
-
arr.reduce((obj, value, index) => {
|
|
2173
|
-
if (!obj[value]) {
|
|
2174
|
-
obj[value] = {};
|
|
2175
|
-
}
|
|
2176
|
-
if (index === arr.length - 1 && lastValue) {
|
|
2177
|
-
obj[value] = lastValue;
|
|
2178
|
-
}
|
|
2179
|
-
return obj[value];
|
|
2180
|
-
}, nestedObject);
|
|
2181
|
-
return nestedObject;
|
|
2182
|
-
};
|
|
2183
|
-
var removeValueFromArray = (arr, value) => {
|
|
2184
|
-
const index = arr.indexOf(value);
|
|
2185
|
-
if (index > -1) {
|
|
2186
|
-
const newArray = [...arr];
|
|
2187
|
-
newArray.splice(index, 1);
|
|
2188
|
-
return newArray;
|
|
2189
|
-
}
|
|
2190
|
-
return arr;
|
|
2191
|
-
};
|
|
2192
|
-
var removeValueFromArrayAll = (arr, value) => {
|
|
2193
|
-
return arr.filter((item) => item !== value);
|
|
2194
|
-
};
|
|
2195
|
-
var addItemAfterEveryElement = (array, item) => {
|
|
2196
|
-
const result = [];
|
|
2197
|
-
for (let i = 0; i < array.length; i++) {
|
|
2198
|
-
result.push(array[i]);
|
|
2199
|
-
if (i < array.length - 1) {
|
|
2200
|
-
result.push(item);
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
return result;
|
|
2204
|
-
};
|
|
2205
|
-
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
2206
|
-
const newArray = [...array];
|
|
2207
|
-
const indexToMove = newArray.indexOf(valueToMove);
|
|
2208
|
-
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
2209
|
-
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
2210
|
-
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
2211
|
-
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
2212
|
-
newArray.splice(insertIndex, 0, removedItem);
|
|
2213
|
-
}
|
|
2214
|
-
return newArray;
|
|
2215
|
-
};
|
|
2216
|
-
var arraysEqual = (arr1, arr2) => {
|
|
2217
|
-
if (arr1.length !== arr2.length) {
|
|
2218
|
-
return false;
|
|
2219
|
-
}
|
|
2220
|
-
for (let i = 0; i < arr1.length; i++) {
|
|
2221
|
-
if (arr1[i] !== arr2[i]) {
|
|
2222
|
-
return false;
|
|
2223
|
-
}
|
|
2224
|
-
}
|
|
2225
|
-
return true;
|
|
2226
|
-
};
|
|
2227
|
-
}
|
|
2228
|
-
});
|
|
2229
|
-
var require_string2 = __commonJS2({
|
|
2230
|
-
"../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
|
|
2231
|
-
"use strict";
|
|
2232
|
-
var __defProp22 = Object.defineProperty;
|
|
2233
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2234
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2235
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2236
|
-
var __export22 = (target, all) => {
|
|
2237
|
-
for (var name in all)
|
|
2238
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2239
|
-
};
|
|
2240
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2241
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2242
|
-
for (let key of __getOwnPropNames22(from))
|
|
2243
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2244
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2245
|
-
}
|
|
2246
|
-
return to;
|
|
2247
|
-
};
|
|
2248
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2249
|
-
var string_exports = {};
|
|
2250
|
-
__export22(string_exports, {
|
|
2251
|
-
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
2252
|
-
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
2253
|
-
findKeyPosition: () => findKeyPosition,
|
|
2254
|
-
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
2255
|
-
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
2256
|
-
replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
|
|
2257
|
-
stringIncludesAny: () => stringIncludesAny,
|
|
2258
|
-
trimStringFromSymbols: () => trimStringFromSymbols
|
|
2259
|
-
});
|
|
2260
|
-
module2.exports = __toCommonJS22(string_exports);
|
|
2261
|
-
var stringIncludesAny = (str, characters) => {
|
|
2262
|
-
for (const char of characters) {
|
|
2263
|
-
if (str.includes(char)) {
|
|
2264
|
-
return true;
|
|
2265
|
-
}
|
|
2266
|
-
}
|
|
2267
|
-
return false;
|
|
2268
|
-
};
|
|
2269
|
-
var trimStringFromSymbols = (str, characters) => {
|
|
2270
|
-
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
2271
|
-
return str.replace(pattern, "");
|
|
2272
|
-
};
|
|
2273
|
-
var brackRegex = {
|
|
2274
|
-
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2275
|
-
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2276
|
-
};
|
|
2277
|
-
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
2278
|
-
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2279
|
-
return str;
|
|
2280
|
-
const reg = brackRegex[options.bracketsLength || 2];
|
|
2281
|
-
return str.replace(reg, (_, parentPath, variable) => {
|
|
2282
|
-
if (parentPath) {
|
|
2283
|
-
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2284
|
-
let parentState = state;
|
|
2285
|
-
for (let i = 0; i < parentLevels; i++) {
|
|
2286
|
-
parentState = parentState.parent;
|
|
2287
|
-
if (!parentState) {
|
|
2288
|
-
return "";
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
const value = parentState[variable.trim()];
|
|
2292
|
-
return value !== void 0 ? `${value}` : "";
|
|
2293
|
-
} else {
|
|
2294
|
-
const value = state[variable.trim()];
|
|
2295
|
-
return value !== void 0 ? `${value}` : "";
|
|
2296
|
-
}
|
|
2297
|
-
});
|
|
2298
|
-
};
|
|
2299
|
-
var lowercaseFirstLetter = (inputString) => {
|
|
2300
|
-
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2301
|
-
};
|
|
2302
|
-
var findKeyPosition = (str, key) => {
|
|
2303
|
-
const lines = str.split("\n");
|
|
2304
|
-
let startLineNumber = -1;
|
|
2305
|
-
let endLineNumber = -1;
|
|
2306
|
-
let startColumn = -1;
|
|
2307
|
-
let endColumn = -1;
|
|
2308
|
-
const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
|
|
2309
|
-
let braceCount = 0;
|
|
2310
|
-
let foundKey = false;
|
|
2311
|
-
for (let i = 0; i < lines.length; i++) {
|
|
2312
|
-
if (keyPattern.test(lines[i]) && !foundKey) {
|
|
2313
|
-
foundKey = true;
|
|
2314
|
-
startLineNumber = i + 1;
|
|
2315
|
-
startColumn = lines[i].indexOf(key) + 1;
|
|
2316
|
-
if (lines[i].includes("{}")) {
|
|
2317
|
-
endLineNumber = startLineNumber;
|
|
2318
|
-
endColumn = lines[i].indexOf("{}") + 3;
|
|
2319
|
-
break;
|
|
1829
|
+
var require_array2 = __commonJS2({
|
|
1830
|
+
"../../../domql/packages/utils/dist/cjs/array.js"(exports2, module22) {
|
|
1831
|
+
"use strict";
|
|
1832
|
+
var __defProp22 = Object.defineProperty;
|
|
1833
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1834
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1835
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1836
|
+
var __export22 = (target, all) => {
|
|
1837
|
+
for (var name in all)
|
|
1838
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1839
|
+
};
|
|
1840
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1841
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1842
|
+
for (let key of __getOwnPropNames22(from))
|
|
1843
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1844
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2320
1845
|
}
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
1846
|
+
return to;
|
|
1847
|
+
};
|
|
1848
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1849
|
+
var array_exports = {};
|
|
1850
|
+
__export22(array_exports, {
|
|
1851
|
+
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
1852
|
+
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
1853
|
+
arraysEqual: () => arraysEqual,
|
|
1854
|
+
createNestedObject: () => createNestedObject,
|
|
1855
|
+
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
1856
|
+
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
1857
|
+
getFrequencyInArray: () => getFrequencyInArray,
|
|
1858
|
+
joinArrays: () => joinArrays,
|
|
1859
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
1860
|
+
mergeArray: () => mergeArray,
|
|
1861
|
+
removeFromArray: () => removeFromArray,
|
|
1862
|
+
removeValueFromArray: () => removeValueFromArray,
|
|
1863
|
+
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
1864
|
+
reorderArrayByValues: () => reorderArrayByValues,
|
|
1865
|
+
swapItemsInArray: () => swapItemsInArray
|
|
1866
|
+
});
|
|
1867
|
+
module22.exports = __toCommonJS22(array_exports);
|
|
1868
|
+
var import_object = require_object2();
|
|
1869
|
+
var import_types = require_types2();
|
|
1870
|
+
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
1871
|
+
return arr2.every((val) => arr1.includes(val));
|
|
1872
|
+
};
|
|
1873
|
+
var getFrequencyInArray = (arr, value) => {
|
|
1874
|
+
return arr.reduce((count, currentValue) => {
|
|
1875
|
+
return currentValue === value ? count + 1 : count;
|
|
1876
|
+
}, 0);
|
|
1877
|
+
};
|
|
1878
|
+
var removeFromArray = (arr, index) => {
|
|
1879
|
+
if ((0, import_types.isString)(index))
|
|
1880
|
+
index = parseInt(index);
|
|
1881
|
+
if ((0, import_types.isNumber)(index)) {
|
|
1882
|
+
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
1883
|
+
throw new Error("Invalid index");
|
|
1884
|
+
}
|
|
1885
|
+
arr.splice(index, 1);
|
|
1886
|
+
} else if ((0, import_types.isArray)(index)) {
|
|
1887
|
+
index.forEach((idx) => removeFromArray(arr, idx));
|
|
2324
1888
|
} else {
|
|
2325
|
-
|
|
2326
|
-
endColumn = lines[i].length + 1;
|
|
2327
|
-
break;
|
|
1889
|
+
throw new Error("Invalid index");
|
|
2328
1890
|
}
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
1891
|
+
return arr;
|
|
1892
|
+
};
|
|
1893
|
+
var swapItemsInArray = (arr, i, j) => {
|
|
1894
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
1895
|
+
};
|
|
1896
|
+
var joinArrays = (...arrays) => {
|
|
1897
|
+
return [].concat(...arrays);
|
|
1898
|
+
};
|
|
1899
|
+
var mergeArray = (arr, excludeFrom = []) => {
|
|
1900
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
1901
|
+
};
|
|
1902
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
1903
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
1904
|
+
};
|
|
1905
|
+
var cutArrayBeforeValue = (arr, value) => {
|
|
1906
|
+
const index = arr.indexOf(value);
|
|
1907
|
+
if (index !== -1) {
|
|
1908
|
+
return arr.slice(0, index);
|
|
2338
1909
|
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
};
|
|
2348
|
-
var replaceOctalEscapeSequences = (str) => {
|
|
2349
|
-
const octalRegex = /\\([0-7]{1,3})/g;
|
|
2350
|
-
return str.replace(octalRegex, (match, p1) => {
|
|
2351
|
-
const octalValue = parseInt(p1, 8);
|
|
2352
|
-
const char = String.fromCharCode(octalValue);
|
|
2353
|
-
return char;
|
|
2354
|
-
});
|
|
2355
|
-
};
|
|
2356
|
-
var customEncodeURIComponent = (str) => {
|
|
2357
|
-
return str.split("").map((char) => {
|
|
2358
|
-
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
2359
|
-
return "%" + char.charCodeAt(0).toString(16).toUpperCase();
|
|
2360
|
-
}
|
|
2361
|
-
return char;
|
|
2362
|
-
}).join("");
|
|
2363
|
-
};
|
|
2364
|
-
var customDecodeURIComponent = (encodedStr) => {
|
|
2365
|
-
return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
|
|
2366
|
-
};
|
|
2367
|
-
}
|
|
2368
|
-
});
|
|
2369
|
-
var require_object2 = __commonJS2({
|
|
2370
|
-
"../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
|
|
2371
|
-
"use strict";
|
|
2372
|
-
var __defProp22 = Object.defineProperty;
|
|
2373
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2374
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2375
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2376
|
-
var __export22 = (target, all) => {
|
|
2377
|
-
for (var name in all)
|
|
2378
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2379
|
-
};
|
|
2380
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2381
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2382
|
-
for (let key of __getOwnPropNames22(from))
|
|
2383
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2384
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2385
|
-
}
|
|
2386
|
-
return to;
|
|
2387
|
-
};
|
|
2388
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2389
|
-
var object_exports = {};
|
|
2390
|
-
__export22(object_exports, {
|
|
2391
|
-
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
2392
|
-
clone: () => clone,
|
|
2393
|
-
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2394
|
-
deepClone: () => deepClone2,
|
|
2395
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
2396
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2397
|
-
deepContains: () => deepContains,
|
|
2398
|
-
deepDestringify: () => deepDestringify,
|
|
2399
|
-
deepDiff: () => deepDiff,
|
|
2400
|
-
deepMerge: () => deepMerge2,
|
|
2401
|
-
deepStringify: () => deepStringify,
|
|
2402
|
-
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
2403
|
-
diff: () => diff,
|
|
2404
|
-
diffArrays: () => diffArrays,
|
|
2405
|
-
diffObjects: () => diffObjects,
|
|
2406
|
-
exec: () => exec,
|
|
2407
|
-
flattenRecursive: () => flattenRecursive,
|
|
2408
|
-
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
2409
|
-
getExtendsInElement: () => getExtendsInElement,
|
|
2410
|
-
hasOwnProperty: () => hasOwnProperty,
|
|
2411
|
-
isEmpty: () => isEmpty,
|
|
2412
|
-
isEmptyObject: () => isEmptyObject,
|
|
2413
|
-
isEqualDeep: () => isEqualDeep,
|
|
2414
|
-
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
2415
|
-
map: () => map,
|
|
2416
|
-
merge: () => merge,
|
|
2417
|
-
mergeArrayExclude: () => mergeArrayExclude,
|
|
2418
|
-
mergeIfExisted: () => mergeIfExisted,
|
|
2419
|
-
objectToString: () => objectToString,
|
|
2420
|
-
overwrite: () => overwrite,
|
|
2421
|
-
overwriteDeep: () => overwriteDeep,
|
|
2422
|
-
overwriteShallow: () => overwriteShallow,
|
|
2423
|
-
removeFromObject: () => removeFromObject,
|
|
2424
|
-
stringToObject: () => stringToObject
|
|
2425
|
-
});
|
|
2426
|
-
module2.exports = __toCommonJS22(object_exports);
|
|
2427
|
-
var import_globals2 = require_globals2();
|
|
2428
|
-
var import_types = require_types2();
|
|
2429
|
-
var import_array = require_array2();
|
|
2430
|
-
var import_string = require_string2();
|
|
2431
|
-
var exec = (param, element, state, context) => {
|
|
2432
|
-
if ((0, import_types.isFunction)(param)) {
|
|
2433
|
-
return param(
|
|
2434
|
-
element,
|
|
2435
|
-
state || element.state,
|
|
2436
|
-
context || element.context
|
|
2437
|
-
);
|
|
2438
|
-
}
|
|
2439
|
-
return param;
|
|
2440
|
-
};
|
|
2441
|
-
var map = (obj, extention, element) => {
|
|
2442
|
-
for (const e in extention) {
|
|
2443
|
-
obj[e] = exec(extention[e], element);
|
|
2444
|
-
}
|
|
2445
|
-
};
|
|
2446
|
-
var merge = (element, obj, excludeFrom = []) => {
|
|
2447
|
-
for (const e in obj) {
|
|
2448
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
2449
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2450
|
-
continue;
|
|
2451
|
-
const elementProp = element[e];
|
|
2452
|
-
const objProp = obj[e];
|
|
2453
|
-
if (elementProp === void 0) {
|
|
2454
|
-
element[e] = objProp;
|
|
2455
|
-
}
|
|
2456
|
-
}
|
|
2457
|
-
return element;
|
|
2458
|
-
};
|
|
2459
|
-
var deepMerge2 = (element, extend, excludeFrom = []) => {
|
|
2460
|
-
for (const e in extend) {
|
|
2461
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
2462
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2463
|
-
continue;
|
|
2464
|
-
const elementProp = element[e];
|
|
2465
|
-
const extendProp = extend[e];
|
|
2466
|
-
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
2467
|
-
deepMerge2(elementProp, extendProp, excludeFrom);
|
|
2468
|
-
} else if (elementProp === void 0) {
|
|
2469
|
-
element[e] = extendProp;
|
|
2470
|
-
}
|
|
2471
|
-
}
|
|
2472
|
-
return element;
|
|
2473
|
-
};
|
|
2474
|
-
var clone = (obj, excludeFrom = []) => {
|
|
2475
|
-
const o = {};
|
|
2476
|
-
for (const prop in obj) {
|
|
2477
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2478
|
-
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2479
|
-
continue;
|
|
2480
|
-
o[prop] = obj[prop];
|
|
2481
|
-
}
|
|
2482
|
-
return o;
|
|
2483
|
-
};
|
|
2484
|
-
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
2485
|
-
if ((0, import_types.isArray)(obj)) {
|
|
2486
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2487
|
-
}
|
|
2488
|
-
const o = {};
|
|
2489
|
-
for (const k in obj) {
|
|
2490
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2491
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2492
|
-
continue;
|
|
2493
|
-
let v = obj[k];
|
|
2494
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2495
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
2496
|
-
}
|
|
2497
|
-
if ((0, import_types.isArray)(v)) {
|
|
2498
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2499
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
2500
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2501
|
-
} else
|
|
2502
|
-
o[k] = v;
|
|
2503
|
-
}
|
|
2504
|
-
return o;
|
|
2505
|
-
};
|
|
2506
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
2507
|
-
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
2508
|
-
};
|
|
2509
|
-
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
2510
|
-
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2511
|
-
for (const prop in obj) {
|
|
2512
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2513
|
-
continue;
|
|
2514
|
-
if (prop === "__proto__")
|
|
2515
|
-
continue;
|
|
2516
|
-
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2517
|
-
continue;
|
|
2518
|
-
let objProp = obj[prop];
|
|
2519
|
-
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
2520
|
-
continue;
|
|
2521
|
-
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
2522
|
-
objProp = (0, import_array.mergeArray)(objProp);
|
|
2523
|
-
}
|
|
2524
|
-
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2525
|
-
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
2526
|
-
} else
|
|
2527
|
-
o[prop] = objProp;
|
|
2528
|
-
}
|
|
2529
|
-
return o;
|
|
2530
|
-
};
|
|
2531
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
2532
|
-
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2533
|
-
for (const prop in obj) {
|
|
2534
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2535
|
-
continue;
|
|
2536
|
-
const objProp = obj[prop];
|
|
2537
|
-
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
2538
|
-
continue;
|
|
2539
|
-
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2540
|
-
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
2541
|
-
} else
|
|
2542
|
-
o[prop] = objProp;
|
|
2543
|
-
}
|
|
2544
|
-
return o;
|
|
2545
|
-
};
|
|
2546
|
-
var deepStringify = (obj, stringified = {}) => {
|
|
2547
|
-
for (const prop in obj) {
|
|
2548
|
-
const objProp = obj[prop];
|
|
2549
|
-
if ((0, import_types.isFunction)(objProp)) {
|
|
2550
|
-
stringified[prop] = objProp.toString();
|
|
2551
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
2552
|
-
stringified[prop] = {};
|
|
2553
|
-
deepStringify(objProp, stringified[prop]);
|
|
2554
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2555
|
-
stringified[prop] = [];
|
|
2556
|
-
objProp.forEach((v, i) => {
|
|
2557
|
-
if ((0, import_types.isObject)(v)) {
|
|
2558
|
-
stringified[prop][i] = {};
|
|
2559
|
-
deepStringify(v, stringified[prop][i]);
|
|
2560
|
-
} else if ((0, import_types.isFunction)(v)) {
|
|
2561
|
-
stringified[prop][i] = v.toString();
|
|
2562
|
-
} else {
|
|
2563
|
-
stringified[prop][i] = v;
|
|
2564
|
-
}
|
|
2565
|
-
});
|
|
2566
|
-
} else {
|
|
2567
|
-
stringified[prop] = objProp;
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
return stringified;
|
|
2571
|
-
};
|
|
2572
|
-
var objectToString = (obj = {}, indent = 0) => {
|
|
2573
|
-
const spaces = " ".repeat(indent);
|
|
2574
|
-
let str = "{\n";
|
|
2575
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
2576
|
-
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2577
|
-
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2578
|
-
str += `${spaces} ${stringedKey}: `;
|
|
2579
|
-
if ((0, import_types.isArray)(value)) {
|
|
2580
|
-
str += "[\n";
|
|
2581
|
-
for (const element of value) {
|
|
2582
|
-
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2583
|
-
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2584
|
-
`;
|
|
2585
|
-
} else if ((0, import_types.isString)(element)) {
|
|
2586
|
-
str += `${spaces} '${element}',
|
|
2587
|
-
`;
|
|
2588
|
-
} else {
|
|
2589
|
-
str += `${spaces} ${element},
|
|
2590
|
-
`;
|
|
2591
|
-
}
|
|
1910
|
+
return arr;
|
|
1911
|
+
};
|
|
1912
|
+
var cutArrayAfterValue = (arr, value) => {
|
|
1913
|
+
if (!(0, import_types.isArray)(arr))
|
|
1914
|
+
return;
|
|
1915
|
+
const index = arr.indexOf(value);
|
|
1916
|
+
if (index !== -1) {
|
|
1917
|
+
return arr.slice(index + 1);
|
|
2592
1918
|
}
|
|
2593
|
-
|
|
2594
|
-
}
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
str += `${spaces}}`;
|
|
2604
|
-
return str;
|
|
2605
|
-
};
|
|
2606
|
-
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2607
|
-
for (const prop in obj) {
|
|
2608
|
-
const objProp = obj[prop];
|
|
2609
|
-
if ((0, import_types.isFunction)(objProp))
|
|
2610
|
-
continue;
|
|
2611
|
-
else if ((0, import_types.isObject)(objProp)) {
|
|
2612
|
-
detached[prop] = {};
|
|
2613
|
-
deepStringify(objProp, detached[prop]);
|
|
2614
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2615
|
-
detached[prop] = [];
|
|
2616
|
-
objProp.forEach((v, i) => {
|
|
2617
|
-
if ((0, import_types.isFunction)(v))
|
|
2618
|
-
return;
|
|
2619
|
-
if ((0, import_types.isObject)(v)) {
|
|
2620
|
-
detached[prop][i] = {};
|
|
2621
|
-
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2622
|
-
} else {
|
|
2623
|
-
detached[prop][i] = v;
|
|
1919
|
+
return arr;
|
|
1920
|
+
};
|
|
1921
|
+
var createNestedObject = (arr, lastValue) => {
|
|
1922
|
+
const nestedObject = {};
|
|
1923
|
+
if (arr.length === 0) {
|
|
1924
|
+
return lastValue;
|
|
1925
|
+
}
|
|
1926
|
+
arr.reduce((obj, value, index) => {
|
|
1927
|
+
if (!obj[value]) {
|
|
1928
|
+
obj[value] = {};
|
|
2624
1929
|
}
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
1930
|
+
if (index === arr.length - 1 && lastValue) {
|
|
1931
|
+
obj[value] = lastValue;
|
|
1932
|
+
}
|
|
1933
|
+
return obj[value];
|
|
1934
|
+
}, nestedObject);
|
|
1935
|
+
return nestedObject;
|
|
1936
|
+
};
|
|
1937
|
+
var removeValueFromArray = (arr, value) => {
|
|
1938
|
+
const index = arr.indexOf(value);
|
|
1939
|
+
if (index > -1) {
|
|
1940
|
+
const newArray = [...arr];
|
|
1941
|
+
newArray.splice(index, 1);
|
|
1942
|
+
return newArray;
|
|
1943
|
+
}
|
|
1944
|
+
return arr;
|
|
1945
|
+
};
|
|
1946
|
+
var removeValueFromArrayAll = (arr, value) => {
|
|
1947
|
+
return arr.filter((item) => item !== value);
|
|
1948
|
+
};
|
|
1949
|
+
var addItemAfterEveryElement = (array, item) => {
|
|
1950
|
+
const result = [];
|
|
1951
|
+
for (let i = 0; i < array.length; i++) {
|
|
1952
|
+
result.push(array[i]);
|
|
1953
|
+
if (i < array.length - 1) {
|
|
1954
|
+
result.push(item);
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
return result;
|
|
1958
|
+
};
|
|
1959
|
+
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
1960
|
+
const newArray = [...array];
|
|
1961
|
+
const indexToMove = newArray.indexOf(valueToMove);
|
|
1962
|
+
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
1963
|
+
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
1964
|
+
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
1965
|
+
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
1966
|
+
newArray.splice(insertIndex, 0, removedItem);
|
|
1967
|
+
}
|
|
1968
|
+
return newArray;
|
|
1969
|
+
};
|
|
1970
|
+
var arraysEqual = (arr1, arr2) => {
|
|
1971
|
+
if (arr1.length !== arr2.length) {
|
|
1972
|
+
return false;
|
|
1973
|
+
}
|
|
1974
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
1975
|
+
if (arr1[i] !== arr2[i]) {
|
|
1976
|
+
return false;
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
return true;
|
|
1980
|
+
};
|
|
2629
1981
|
}
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
1982
|
+
});
|
|
1983
|
+
var require_string2 = __commonJS2({
|
|
1984
|
+
"../../../domql/packages/utils/dist/cjs/string.js"(exports2, module22) {
|
|
1985
|
+
"use strict";
|
|
1986
|
+
var __defProp22 = Object.defineProperty;
|
|
1987
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1988
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1989
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1990
|
+
var __export22 = (target, all) => {
|
|
1991
|
+
for (var name in all)
|
|
1992
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1993
|
+
};
|
|
1994
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1995
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1996
|
+
for (let key of __getOwnPropNames22(from))
|
|
1997
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1998
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1999
|
+
}
|
|
2000
|
+
return to;
|
|
2001
|
+
};
|
|
2002
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2003
|
+
var string_exports = {};
|
|
2004
|
+
__export22(string_exports, {
|
|
2005
|
+
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
2006
|
+
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
2007
|
+
findKeyPosition: () => findKeyPosition,
|
|
2008
|
+
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
2009
|
+
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
2010
|
+
replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
|
|
2011
|
+
stringIncludesAny: () => stringIncludesAny,
|
|
2012
|
+
trimStringFromSymbols: () => trimStringFromSymbols
|
|
2013
|
+
});
|
|
2014
|
+
module22.exports = __toCommonJS22(string_exports);
|
|
2015
|
+
var stringIncludesAny = (str, characters) => {
|
|
2016
|
+
for (const char of characters) {
|
|
2017
|
+
if (str.includes(char)) {
|
|
2018
|
+
return true;
|
|
2646
2019
|
}
|
|
2647
|
-
} else {
|
|
2648
|
-
destringified[prop] = objProp;
|
|
2649
2020
|
}
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2021
|
+
return false;
|
|
2022
|
+
};
|
|
2023
|
+
var trimStringFromSymbols = (str, characters) => {
|
|
2024
|
+
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
2025
|
+
return str.replace(pattern, "");
|
|
2026
|
+
};
|
|
2027
|
+
var brackRegex = {
|
|
2028
|
+
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2029
|
+
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2030
|
+
};
|
|
2031
|
+
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
2032
|
+
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2033
|
+
return str;
|
|
2034
|
+
const reg = brackRegex[options.bracketsLength || 2];
|
|
2035
|
+
return str.replace(reg, (_, parentPath, variable) => {
|
|
2036
|
+
if (parentPath) {
|
|
2037
|
+
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2038
|
+
let parentState = state;
|
|
2039
|
+
for (let i = 0; i < parentLevels; i++) {
|
|
2040
|
+
parentState = parentState.parent;
|
|
2041
|
+
if (!parentState) {
|
|
2042
|
+
return "";
|
|
2661
2043
|
}
|
|
2662
|
-
} else {
|
|
2663
|
-
destringified[prop].push(arrProp);
|
|
2664
2044
|
}
|
|
2665
|
-
|
|
2666
|
-
|
|
2045
|
+
const value = parentState[variable.trim()];
|
|
2046
|
+
return value !== void 0 ? `${value}` : "";
|
|
2667
2047
|
} else {
|
|
2668
|
-
|
|
2048
|
+
const value = state[variable.trim()];
|
|
2049
|
+
return value !== void 0 ? `${value}` : "";
|
|
2669
2050
|
}
|
|
2670
2051
|
});
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2052
|
+
};
|
|
2053
|
+
var lowercaseFirstLetter = (inputString) => {
|
|
2054
|
+
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2055
|
+
};
|
|
2056
|
+
var findKeyPosition = (str, key) => {
|
|
2057
|
+
const lines = str.split("\n");
|
|
2058
|
+
let startLineNumber = -1;
|
|
2059
|
+
let endLineNumber = -1;
|
|
2060
|
+
let startColumn = -1;
|
|
2061
|
+
let endColumn = -1;
|
|
2062
|
+
const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
|
|
2063
|
+
let braceCount = 0;
|
|
2064
|
+
let foundKey = false;
|
|
2065
|
+
for (let i = 0; i < lines.length; i++) {
|
|
2066
|
+
if (keyPattern.test(lines[i]) && !foundKey) {
|
|
2067
|
+
foundKey = true;
|
|
2068
|
+
startLineNumber = i + 1;
|
|
2069
|
+
startColumn = lines[i].indexOf(key) + 1;
|
|
2070
|
+
if (lines[i].includes("{}")) {
|
|
2071
|
+
endLineNumber = startLineNumber;
|
|
2072
|
+
endColumn = lines[i].indexOf("{}") + 3;
|
|
2073
|
+
break;
|
|
2074
|
+
}
|
|
2075
|
+
const line = lines[i].slice(startColumn + key.length);
|
|
2076
|
+
if (line.includes("{") || line.includes("[")) {
|
|
2077
|
+
braceCount = 1;
|
|
2078
|
+
} else {
|
|
2079
|
+
endLineNumber = i + 1;
|
|
2080
|
+
endColumn = lines[i].length + 1;
|
|
2081
|
+
break;
|
|
2082
|
+
}
|
|
2083
|
+
} else if (foundKey) {
|
|
2084
|
+
braceCount += (lines[i].match(/{/g) || []).length;
|
|
2085
|
+
braceCount += (lines[i].match(/\[/g) || []).length;
|
|
2086
|
+
braceCount -= (lines[i].match(/}/g) || []).length;
|
|
2087
|
+
braceCount -= (lines[i].match(/]/g) || []).length;
|
|
2088
|
+
if (braceCount === 0) {
|
|
2089
|
+
endLineNumber = i + 1;
|
|
2090
|
+
endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
|
|
2091
|
+
break;
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2711
2094
|
}
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
if (!hasOwnProperty(rhs, key)) {
|
|
2739
|
-
acc[key] = void 0;
|
|
2740
|
-
}
|
|
2741
|
-
return acc;
|
|
2742
|
-
}, makeObjectWithoutPrototype());
|
|
2743
|
-
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2744
|
-
if (lhs.valueOf() === rhs.valueOf())
|
|
2745
|
-
return {};
|
|
2746
|
-
return rhs;
|
|
2747
|
-
}
|
|
2748
|
-
return Object.keys(rhs).reduce((acc, key) => {
|
|
2749
|
-
if (!hasOwnProperty(lhs, key)) {
|
|
2750
|
-
acc[key] = rhs[key];
|
|
2751
|
-
return acc;
|
|
2752
|
-
}
|
|
2753
|
-
const difference = diff(lhs[key], rhs[key]);
|
|
2754
|
-
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2755
|
-
return acc;
|
|
2756
|
-
}
|
|
2757
|
-
acc[key] = difference;
|
|
2758
|
-
return acc;
|
|
2759
|
-
}, deletedValues);
|
|
2760
|
-
};
|
|
2761
|
-
var overwrite = (element, params, excludeFrom = []) => {
|
|
2762
|
-
const { ref } = element;
|
|
2763
|
-
const changes = {};
|
|
2764
|
-
for (const e in params) {
|
|
2765
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2766
|
-
continue;
|
|
2767
|
-
const elementProp = element[e];
|
|
2768
|
-
const paramsProp = params[e];
|
|
2769
|
-
if (paramsProp) {
|
|
2770
|
-
ref.__cache[e] = changes[e] = elementProp;
|
|
2771
|
-
ref[e] = paramsProp;
|
|
2772
|
-
}
|
|
2773
|
-
}
|
|
2774
|
-
return changes;
|
|
2775
|
-
};
|
|
2776
|
-
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2777
|
-
for (const e in params) {
|
|
2778
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2779
|
-
continue;
|
|
2780
|
-
obj[e] = params[e];
|
|
2781
|
-
}
|
|
2782
|
-
return obj;
|
|
2783
|
-
};
|
|
2784
|
-
var overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
2785
|
-
for (const e in params) {
|
|
2786
|
-
if (e === "__proto__")
|
|
2787
|
-
continue;
|
|
2788
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2789
|
-
continue;
|
|
2790
|
-
const objProp = obj[e];
|
|
2791
|
-
const paramsProp = params[e];
|
|
2792
|
-
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2793
|
-
overwriteDeep(objProp, paramsProp);
|
|
2794
|
-
} else if (paramsProp !== void 0) {
|
|
2795
|
-
obj[e] = paramsProp;
|
|
2796
|
-
}
|
|
2797
|
-
}
|
|
2798
|
-
return obj;
|
|
2799
|
-
};
|
|
2800
|
-
var mergeIfExisted = (a, b) => {
|
|
2801
|
-
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2802
|
-
return deepMerge2(a, b);
|
|
2803
|
-
return a || b;
|
|
2804
|
-
};
|
|
2805
|
-
var flattenRecursive = (param, prop, stack = []) => {
|
|
2806
|
-
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2807
|
-
stack.push(objectized);
|
|
2808
|
-
const extendOfExtend = objectized[prop];
|
|
2809
|
-
if (extendOfExtend)
|
|
2810
|
-
flattenRecursive(extendOfExtend, prop, stack);
|
|
2811
|
-
delete objectized[prop];
|
|
2812
|
-
return stack;
|
|
2813
|
-
};
|
|
2814
|
-
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2815
|
-
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2816
|
-
return param === element;
|
|
2817
|
-
}
|
|
2818
|
-
if (visited.has(param) || visited.has(element)) {
|
|
2819
|
-
return true;
|
|
2820
|
-
}
|
|
2821
|
-
visited.add(param);
|
|
2822
|
-
visited.add(element);
|
|
2823
|
-
const keysParam = Object.keys(param);
|
|
2824
|
-
const keysElement = Object.keys(element);
|
|
2825
|
-
if (keysParam.length !== keysElement.length) {
|
|
2826
|
-
return false;
|
|
2827
|
-
}
|
|
2828
|
-
for (const key of keysParam) {
|
|
2829
|
-
if (!keysElement.includes(key)) {
|
|
2830
|
-
return false;
|
|
2831
|
-
}
|
|
2832
|
-
const paramProp = param[key];
|
|
2833
|
-
const elementProp = element[key];
|
|
2834
|
-
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2835
|
-
return false;
|
|
2836
|
-
}
|
|
2837
|
-
}
|
|
2838
|
-
return true;
|
|
2839
|
-
};
|
|
2840
|
-
var deepContains = (obj1, obj2) => {
|
|
2841
|
-
if (typeof obj1 !== typeof obj2) {
|
|
2842
|
-
return false;
|
|
2095
|
+
return {
|
|
2096
|
+
startColumn,
|
|
2097
|
+
endColumn,
|
|
2098
|
+
startLineNumber,
|
|
2099
|
+
endLineNumber
|
|
2100
|
+
};
|
|
2101
|
+
};
|
|
2102
|
+
var replaceOctalEscapeSequences = (str) => {
|
|
2103
|
+
const octalRegex = /\\([0-7]{1,3})/g;
|
|
2104
|
+
return str.replace(octalRegex, (match, p1) => {
|
|
2105
|
+
const octalValue = parseInt(p1, 8);
|
|
2106
|
+
const char = String.fromCharCode(octalValue);
|
|
2107
|
+
return char;
|
|
2108
|
+
});
|
|
2109
|
+
};
|
|
2110
|
+
var customEncodeURIComponent = (str) => {
|
|
2111
|
+
return str.split("").map((char) => {
|
|
2112
|
+
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
2113
|
+
return "%" + char.charCodeAt(0).toString(16).toUpperCase();
|
|
2114
|
+
}
|
|
2115
|
+
return char;
|
|
2116
|
+
}).join("");
|
|
2117
|
+
};
|
|
2118
|
+
var customDecodeURIComponent = (encodedStr) => {
|
|
2119
|
+
return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
|
|
2120
|
+
};
|
|
2843
2121
|
}
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2122
|
+
});
|
|
2123
|
+
var require_object2 = __commonJS2({
|
|
2124
|
+
"../../../domql/packages/utils/dist/cjs/object.js"(exports2, module22) {
|
|
2125
|
+
"use strict";
|
|
2126
|
+
var __defProp22 = Object.defineProperty;
|
|
2127
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2128
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2129
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2130
|
+
var __export22 = (target, all) => {
|
|
2131
|
+
for (var name in all)
|
|
2132
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2133
|
+
};
|
|
2134
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2135
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2136
|
+
for (let key of __getOwnPropNames22(from))
|
|
2137
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2138
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2139
|
+
}
|
|
2140
|
+
return to;
|
|
2141
|
+
};
|
|
2142
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2143
|
+
var object_exports = {};
|
|
2144
|
+
__export22(object_exports, {
|
|
2145
|
+
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
2146
|
+
clone: () => clone,
|
|
2147
|
+
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2148
|
+
deepClone: () => deepClone2,
|
|
2149
|
+
deepCloneExclude: () => deepCloneExclude,
|
|
2150
|
+
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2151
|
+
deepContains: () => deepContains,
|
|
2152
|
+
deepDestringify: () => deepDestringify,
|
|
2153
|
+
deepDiff: () => deepDiff,
|
|
2154
|
+
deepMerge: () => deepMerge2,
|
|
2155
|
+
deepStringify: () => deepStringify,
|
|
2156
|
+
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
2157
|
+
diff: () => diff,
|
|
2158
|
+
diffArrays: () => diffArrays,
|
|
2159
|
+
diffObjects: () => diffObjects,
|
|
2160
|
+
exec: () => exec,
|
|
2161
|
+
flattenRecursive: () => flattenRecursive,
|
|
2162
|
+
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
2163
|
+
getExtendsInElement: () => getExtendsInElement,
|
|
2164
|
+
hasOwnProperty: () => hasOwnProperty,
|
|
2165
|
+
isEmpty: () => isEmpty,
|
|
2166
|
+
isEmptyObject: () => isEmptyObject,
|
|
2167
|
+
isEqualDeep: () => isEqualDeep,
|
|
2168
|
+
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
2169
|
+
map: () => map,
|
|
2170
|
+
merge: () => merge,
|
|
2171
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
2172
|
+
mergeIfExisted: () => mergeIfExisted,
|
|
2173
|
+
objectToString: () => objectToString,
|
|
2174
|
+
overwrite: () => overwrite,
|
|
2175
|
+
overwriteDeep: () => overwriteDeep,
|
|
2176
|
+
overwriteShallow: () => overwriteShallow,
|
|
2177
|
+
removeFromObject: () => removeFromObject,
|
|
2178
|
+
stringToObject: () => stringToObject
|
|
2179
|
+
});
|
|
2180
|
+
module22.exports = __toCommonJS22(object_exports);
|
|
2181
|
+
var import_globals2 = require_globals2();
|
|
2182
|
+
var import_types = require_types2();
|
|
2183
|
+
var import_array = require_array2();
|
|
2184
|
+
var import_string = require_string2();
|
|
2185
|
+
var exec = (param, element, state, context) => {
|
|
2186
|
+
if ((0, import_types.isFunction)(param)) {
|
|
2187
|
+
return param(
|
|
2188
|
+
element,
|
|
2189
|
+
state || element.state,
|
|
2190
|
+
context || element.context
|
|
2191
|
+
);
|
|
2192
|
+
}
|
|
2193
|
+
return param;
|
|
2194
|
+
};
|
|
2195
|
+
var map = (obj, extention, element) => {
|
|
2196
|
+
for (const e in extention) {
|
|
2197
|
+
obj[e] = exec(extention[e], element);
|
|
2198
|
+
}
|
|
2199
|
+
};
|
|
2200
|
+
var merge = (element, obj, excludeFrom = []) => {
|
|
2201
|
+
for (const e in obj) {
|
|
2202
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
2203
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2204
|
+
continue;
|
|
2205
|
+
const elementProp = element[e];
|
|
2206
|
+
const objProp = obj[e];
|
|
2207
|
+
if (elementProp === void 0) {
|
|
2208
|
+
element[e] = objProp;
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
return element;
|
|
2212
|
+
};
|
|
2213
|
+
var deepMerge2 = (element, extend, excludeFrom = []) => {
|
|
2214
|
+
for (const e in extend) {
|
|
2215
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
2216
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2217
|
+
continue;
|
|
2218
|
+
const elementProp = element[e];
|
|
2219
|
+
const extendProp = extend[e];
|
|
2220
|
+
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
2221
|
+
deepMerge2(elementProp, extendProp, excludeFrom);
|
|
2222
|
+
} else if (elementProp === void 0) {
|
|
2223
|
+
element[e] = extendProp;
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
return element;
|
|
2227
|
+
};
|
|
2228
|
+
var clone = (obj, excludeFrom = []) => {
|
|
2229
|
+
const o = {};
|
|
2230
|
+
for (const prop in obj) {
|
|
2231
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2232
|
+
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2233
|
+
continue;
|
|
2234
|
+
o[prop] = obj[prop];
|
|
2235
|
+
}
|
|
2236
|
+
return o;
|
|
2237
|
+
};
|
|
2238
|
+
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
2239
|
+
if ((0, import_types.isArray)(obj)) {
|
|
2240
|
+
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2241
|
+
}
|
|
2242
|
+
const o = {};
|
|
2243
|
+
for (const k in obj) {
|
|
2244
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2245
|
+
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2246
|
+
continue;
|
|
2247
|
+
let v = obj[k];
|
|
2248
|
+
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2249
|
+
v = mergeArrayExclude(v, excludeFrom);
|
|
2250
|
+
}
|
|
2251
|
+
if ((0, import_types.isArray)(v)) {
|
|
2252
|
+
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2253
|
+
} else if ((0, import_types.isObject)(v)) {
|
|
2254
|
+
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2255
|
+
} else
|
|
2256
|
+
o[k] = v;
|
|
2257
|
+
}
|
|
2258
|
+
return o;
|
|
2259
|
+
};
|
|
2260
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
2261
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
2262
|
+
};
|
|
2263
|
+
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
2264
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2265
|
+
for (const prop in obj) {
|
|
2266
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2267
|
+
continue;
|
|
2268
|
+
if (prop === "__proto__")
|
|
2269
|
+
continue;
|
|
2270
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2271
|
+
continue;
|
|
2272
|
+
let objProp = obj[prop];
|
|
2273
|
+
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
2274
|
+
continue;
|
|
2275
|
+
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
2276
|
+
objProp = (0, import_array.mergeArray)(objProp);
|
|
2277
|
+
}
|
|
2278
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2279
|
+
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
2280
|
+
} else
|
|
2281
|
+
o[prop] = objProp;
|
|
2282
|
+
}
|
|
2283
|
+
return o;
|
|
2284
|
+
};
|
|
2285
|
+
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
2286
|
+
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
2287
|
+
for (const prop in obj) {
|
|
2288
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2289
|
+
continue;
|
|
2290
|
+
const objProp = obj[prop];
|
|
2291
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
2292
|
+
continue;
|
|
2293
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2294
|
+
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
2295
|
+
} else
|
|
2296
|
+
o[prop] = objProp;
|
|
2297
|
+
}
|
|
2298
|
+
return o;
|
|
2299
|
+
};
|
|
2300
|
+
var deepStringify = (obj, stringified = {}) => {
|
|
2301
|
+
for (const prop in obj) {
|
|
2302
|
+
const objProp = obj[prop];
|
|
2303
|
+
if ((0, import_types.isFunction)(objProp)) {
|
|
2304
|
+
stringified[prop] = objProp.toString();
|
|
2305
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2306
|
+
stringified[prop] = {};
|
|
2307
|
+
deepStringify(objProp, stringified[prop]);
|
|
2308
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2309
|
+
stringified[prop] = [];
|
|
2310
|
+
objProp.forEach((v, i) => {
|
|
2311
|
+
if ((0, import_types.isObject)(v)) {
|
|
2312
|
+
stringified[prop][i] = {};
|
|
2313
|
+
deepStringify(v, stringified[prop][i]);
|
|
2314
|
+
} else if ((0, import_types.isFunction)(v)) {
|
|
2315
|
+
stringified[prop][i] = v.toString();
|
|
2316
|
+
} else {
|
|
2317
|
+
stringified[prop][i] = v;
|
|
2318
|
+
}
|
|
2319
|
+
});
|
|
2320
|
+
} else {
|
|
2321
|
+
stringified[prop] = objProp;
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
return stringified;
|
|
2325
|
+
};
|
|
2326
|
+
var objectToString = (obj = {}, indent = 0) => {
|
|
2327
|
+
const spaces = " ".repeat(indent);
|
|
2328
|
+
let str = "{\n";
|
|
2329
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
2330
|
+
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2331
|
+
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2332
|
+
str += `${spaces} ${stringedKey}: `;
|
|
2333
|
+
if ((0, import_types.isArray)(value)) {
|
|
2334
|
+
str += "[\n";
|
|
2335
|
+
for (const element of value) {
|
|
2336
|
+
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2337
|
+
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2338
|
+
`;
|
|
2339
|
+
} else if ((0, import_types.isString)(element)) {
|
|
2340
|
+
str += `${spaces} '${element}',
|
|
2341
|
+
`;
|
|
2342
|
+
} else {
|
|
2343
|
+
str += `${spaces} ${element},
|
|
2344
|
+
`;
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
str += `${spaces} ]`;
|
|
2348
|
+
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2349
|
+
str += objectToString(value, indent + 1);
|
|
2350
|
+
} else if ((0, import_types.isString)(value)) {
|
|
2351
|
+
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2352
|
+
} else {
|
|
2353
|
+
str += value;
|
|
2354
|
+
}
|
|
2355
|
+
str += ",\n";
|
|
2356
|
+
}
|
|
2357
|
+
str += `${spaces}}`;
|
|
2358
|
+
return str;
|
|
2359
|
+
};
|
|
2360
|
+
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2361
|
+
for (const prop in obj) {
|
|
2362
|
+
const objProp = obj[prop];
|
|
2363
|
+
if ((0, import_types.isFunction)(objProp))
|
|
2364
|
+
continue;
|
|
2365
|
+
else if ((0, import_types.isObject)(objProp)) {
|
|
2366
|
+
detached[prop] = {};
|
|
2367
|
+
deepStringify(objProp, detached[prop]);
|
|
2368
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2369
|
+
detached[prop] = [];
|
|
2370
|
+
objProp.forEach((v, i) => {
|
|
2371
|
+
if ((0, import_types.isFunction)(v))
|
|
2372
|
+
return;
|
|
2373
|
+
if ((0, import_types.isObject)(v)) {
|
|
2374
|
+
detached[prop][i] = {};
|
|
2375
|
+
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2376
|
+
} else {
|
|
2377
|
+
detached[prop][i] = v;
|
|
2378
|
+
}
|
|
2379
|
+
});
|
|
2380
|
+
} else {
|
|
2381
|
+
detached[prop] = objProp;
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
return detached;
|
|
2385
|
+
};
|
|
2386
|
+
var deepDestringify = (obj, destringified = {}) => {
|
|
2387
|
+
for (const prop in obj) {
|
|
2388
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2389
|
+
if (!hasOwnProperty2)
|
|
2390
|
+
continue;
|
|
2391
|
+
const objProp = obj[prop];
|
|
2392
|
+
if ((0, import_types.isString)(objProp)) {
|
|
2393
|
+
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2394
|
+
try {
|
|
2395
|
+
const evalProp = import_globals2.window.eval(`(${objProp})`);
|
|
2396
|
+
destringified[prop] = evalProp;
|
|
2397
|
+
} catch (e) {
|
|
2398
|
+
if (e)
|
|
2399
|
+
destringified[prop] = objProp;
|
|
2400
|
+
}
|
|
2401
|
+
} else {
|
|
2402
|
+
destringified[prop] = objProp;
|
|
2403
|
+
}
|
|
2404
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2405
|
+
destringified[prop] = [];
|
|
2406
|
+
objProp.forEach((arrProp) => {
|
|
2407
|
+
if ((0, import_types.isString)(arrProp)) {
|
|
2408
|
+
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2409
|
+
try {
|
|
2410
|
+
const evalProp = import_globals2.window.eval(`(${arrProp})`);
|
|
2411
|
+
destringified[prop].push(evalProp);
|
|
2412
|
+
} catch (e) {
|
|
2413
|
+
if (e)
|
|
2414
|
+
destringified[prop].push(arrProp);
|
|
2415
|
+
}
|
|
2416
|
+
} else {
|
|
2417
|
+
destringified[prop].push(arrProp);
|
|
2418
|
+
}
|
|
2419
|
+
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2420
|
+
destringified[prop].push(deepDestringify(arrProp));
|
|
2421
|
+
} else {
|
|
2422
|
+
destringified[prop].push(arrProp);
|
|
2423
|
+
}
|
|
2424
|
+
});
|
|
2425
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2426
|
+
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2427
|
+
} else {
|
|
2428
|
+
destringified[prop] = objProp;
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
return destringified;
|
|
2432
|
+
};
|
|
2433
|
+
var stringToObject = (str, opts = { verbose: true }) => {
|
|
2434
|
+
try {
|
|
2435
|
+
return import_globals2.window.eval("(" + str + ")");
|
|
2436
|
+
} catch (e) {
|
|
2437
|
+
if (opts.verbose)
|
|
2438
|
+
console.warn(e);
|
|
2439
|
+
}
|
|
2440
|
+
};
|
|
2441
|
+
var diffObjects = (original, objToDiff, cache) => {
|
|
2442
|
+
for (const e in objToDiff) {
|
|
2443
|
+
if (e === "ref")
|
|
2444
|
+
continue;
|
|
2445
|
+
const originalProp = original[e];
|
|
2446
|
+
const objToDiffProp = objToDiff[e];
|
|
2447
|
+
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2448
|
+
cache[e] = {};
|
|
2449
|
+
diff(originalProp, objToDiffProp, cache[e]);
|
|
2450
|
+
} else if (objToDiffProp !== void 0) {
|
|
2451
|
+
cache[e] = objToDiffProp;
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
return cache;
|
|
2455
|
+
};
|
|
2456
|
+
var diffArrays = (original, objToDiff, cache) => {
|
|
2457
|
+
if (original.length !== objToDiff.length) {
|
|
2458
|
+
cache = objToDiff;
|
|
2459
|
+
} else {
|
|
2460
|
+
const diffArr = [];
|
|
2461
|
+
for (let i = 0; i < original.length; i++) {
|
|
2462
|
+
const diffObj = diff(original[i], objToDiff[i]);
|
|
2463
|
+
if (Object.keys(diffObj).length > 0) {
|
|
2464
|
+
diffArr.push(diffObj);
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
if (diffArr.length > 0) {
|
|
2468
|
+
cache = diffArr;
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
return cache;
|
|
2472
|
+
};
|
|
2473
|
+
var diff = (original, objToDiff, cache = {}) => {
|
|
2474
|
+
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2475
|
+
cache = [];
|
|
2476
|
+
diffArrays(original, objToDiff, cache);
|
|
2477
|
+
} else {
|
|
2478
|
+
diffObjects(original, objToDiff, cache);
|
|
2479
|
+
}
|
|
2480
|
+
return cache;
|
|
2481
|
+
};
|
|
2482
|
+
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2483
|
+
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2484
|
+
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2485
|
+
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2486
|
+
var deepDiff = (lhs, rhs) => {
|
|
2487
|
+
if (lhs === rhs)
|
|
2488
|
+
return {};
|
|
2489
|
+
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2490
|
+
return rhs;
|
|
2491
|
+
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2492
|
+
if (!hasOwnProperty(rhs, key)) {
|
|
2493
|
+
acc[key] = void 0;
|
|
2494
|
+
}
|
|
2495
|
+
return acc;
|
|
2496
|
+
}, makeObjectWithoutPrototype());
|
|
2497
|
+
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2498
|
+
if (lhs.valueOf() === rhs.valueOf())
|
|
2499
|
+
return {};
|
|
2500
|
+
return rhs;
|
|
2501
|
+
}
|
|
2502
|
+
return Object.keys(rhs).reduce((acc, key) => {
|
|
2503
|
+
if (!hasOwnProperty(lhs, key)) {
|
|
2504
|
+
acc[key] = rhs[key];
|
|
2505
|
+
return acc;
|
|
2506
|
+
}
|
|
2507
|
+
const difference = diff(lhs[key], rhs[key]);
|
|
2508
|
+
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2509
|
+
return acc;
|
|
2510
|
+
}
|
|
2511
|
+
acc[key] = difference;
|
|
2512
|
+
return acc;
|
|
2513
|
+
}, deletedValues);
|
|
2514
|
+
};
|
|
2515
|
+
var overwrite = (element, params, excludeFrom = []) => {
|
|
2516
|
+
const { ref } = element;
|
|
2517
|
+
const changes = {};
|
|
2518
|
+
for (const e in params) {
|
|
2519
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2520
|
+
continue;
|
|
2521
|
+
const elementProp = element[e];
|
|
2522
|
+
const paramsProp = params[e];
|
|
2523
|
+
if (paramsProp) {
|
|
2524
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
2525
|
+
ref[e] = paramsProp;
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
return changes;
|
|
2529
|
+
};
|
|
2530
|
+
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2531
|
+
for (const e in params) {
|
|
2532
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2533
|
+
continue;
|
|
2534
|
+
obj[e] = params[e];
|
|
2535
|
+
}
|
|
2536
|
+
return obj;
|
|
2537
|
+
};
|
|
2538
|
+
var overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
2539
|
+
for (const e in params) {
|
|
2540
|
+
if (e === "__proto__")
|
|
2541
|
+
continue;
|
|
2542
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2543
|
+
continue;
|
|
2544
|
+
const objProp = obj[e];
|
|
2545
|
+
const paramsProp = params[e];
|
|
2546
|
+
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2547
|
+
overwriteDeep(objProp, paramsProp);
|
|
2548
|
+
} else if (paramsProp !== void 0) {
|
|
2549
|
+
obj[e] = paramsProp;
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
return obj;
|
|
2553
|
+
};
|
|
2554
|
+
var mergeIfExisted = (a, b) => {
|
|
2555
|
+
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2556
|
+
return deepMerge2(a, b);
|
|
2557
|
+
return a || b;
|
|
2558
|
+
};
|
|
2559
|
+
var flattenRecursive = (param, prop, stack = []) => {
|
|
2560
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2561
|
+
stack.push(objectized);
|
|
2562
|
+
const extendOfExtend = objectized[prop];
|
|
2563
|
+
if (extendOfExtend)
|
|
2564
|
+
flattenRecursive(extendOfExtend, prop, stack);
|
|
2565
|
+
delete objectized[prop];
|
|
2566
|
+
return stack;
|
|
2567
|
+
};
|
|
2568
|
+
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2569
|
+
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2570
|
+
return param === element;
|
|
2571
|
+
}
|
|
2572
|
+
if (visited.has(param) || visited.has(element)) {
|
|
2573
|
+
return true;
|
|
2574
|
+
}
|
|
2575
|
+
visited.add(param);
|
|
2576
|
+
visited.add(element);
|
|
2577
|
+
const keysParam = Object.keys(param);
|
|
2578
|
+
const keysElement = Object.keys(element);
|
|
2579
|
+
if (keysParam.length !== keysElement.length) {
|
|
2847
2580
|
return false;
|
|
2848
2581
|
}
|
|
2849
|
-
for (
|
|
2850
|
-
if (!
|
|
2582
|
+
for (const key of keysParam) {
|
|
2583
|
+
if (!keysElement.includes(key)) {
|
|
2851
2584
|
return false;
|
|
2852
2585
|
}
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2857
|
-
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2586
|
+
const paramProp = param[key];
|
|
2587
|
+
const elementProp = element[key];
|
|
2588
|
+
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2858
2589
|
return false;
|
|
2859
2590
|
}
|
|
2860
2591
|
}
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
const newObj = /* @__PURE__ */ Object.create(null);
|
|
2884
|
-
for (const key in obj) {
|
|
2885
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2886
|
-
newObj[key] = createObjectWithoutPrototype(obj[key]);
|
|
2887
|
-
}
|
|
2888
|
-
}
|
|
2889
|
-
return newObj;
|
|
2890
|
-
};
|
|
2891
|
-
var checkIfKeyIsComponent = (key) => {
|
|
2892
|
-
const isFirstKeyString = (0, import_types.isString)(key);
|
|
2893
|
-
if (!isFirstKeyString)
|
|
2894
|
-
return;
|
|
2895
|
-
const firstCharKey = key.slice(0, 1);
|
|
2896
|
-
return /^[A-Z]*$/.test(firstCharKey);
|
|
2897
|
-
};
|
|
2898
|
-
var getChildrenComponentsByKey = (key, el) => {
|
|
2899
|
-
if (key === el.key || el.__ref.__componentKey === key) {
|
|
2900
|
-
return el;
|
|
2901
|
-
}
|
|
2902
|
-
if (el.extend) {
|
|
2903
|
-
const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
|
|
2904
|
-
const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
|
|
2905
|
-
if (foundString || foundInArray)
|
|
2906
|
-
return el;
|
|
2907
|
-
}
|
|
2908
|
-
};
|
|
2909
|
-
var getExtendsInElement = (obj) => {
|
|
2910
|
-
let result = [];
|
|
2911
|
-
function traverse(o) {
|
|
2912
|
-
for (const key in o) {
|
|
2913
|
-
if (Object.hasOwnProperty.call(o, key)) {
|
|
2914
|
-
if (checkIfKeyIsComponent(key)) {
|
|
2915
|
-
result.push(key);
|
|
2916
|
-
}
|
|
2917
|
-
if (key === "extend") {
|
|
2918
|
-
if (typeof o[key] === "string") {
|
|
2919
|
-
result.push(o[key]);
|
|
2920
|
-
} else if (Array.isArray(o[key])) {
|
|
2921
|
-
result = result.concat(o[key]);
|
|
2592
|
+
return true;
|
|
2593
|
+
};
|
|
2594
|
+
var deepContains = (obj1, obj2) => {
|
|
2595
|
+
if (typeof obj1 !== typeof obj2) {
|
|
2596
|
+
return false;
|
|
2597
|
+
}
|
|
2598
|
+
if ((0, import_types.isObjectLike)(obj1)) {
|
|
2599
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
2600
|
+
if (obj1.length !== obj2.length) {
|
|
2601
|
+
return false;
|
|
2602
|
+
}
|
|
2603
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
2604
|
+
if (!deepContains(obj1[i], obj2[i])) {
|
|
2605
|
+
return false;
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
2609
|
+
for (const key in obj1) {
|
|
2610
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2611
|
+
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2612
|
+
return false;
|
|
2613
|
+
}
|
|
2922
2614
|
}
|
|
2923
2615
|
}
|
|
2924
|
-
|
|
2925
|
-
|
|
2616
|
+
} else {
|
|
2617
|
+
return obj2 === obj1;
|
|
2618
|
+
}
|
|
2619
|
+
return true;
|
|
2620
|
+
};
|
|
2621
|
+
var removeFromObject = (obj, props) => {
|
|
2622
|
+
if (props === void 0 || props === null)
|
|
2623
|
+
return obj;
|
|
2624
|
+
if ((0, import_types.is)(props)("string", "number")) {
|
|
2625
|
+
delete obj[props];
|
|
2626
|
+
} else if ((0, import_types.isArray)(props)) {
|
|
2627
|
+
props.forEach((prop) => delete obj[prop]);
|
|
2628
|
+
} else {
|
|
2629
|
+
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
2630
|
+
}
|
|
2631
|
+
return obj;
|
|
2632
|
+
};
|
|
2633
|
+
var createObjectWithoutPrototype = (obj) => {
|
|
2634
|
+
if (obj === null || typeof obj !== "object") {
|
|
2635
|
+
return obj;
|
|
2636
|
+
}
|
|
2637
|
+
const newObj = /* @__PURE__ */ Object.create(null);
|
|
2638
|
+
for (const key in obj) {
|
|
2639
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2640
|
+
newObj[key] = createObjectWithoutPrototype(obj[key]);
|
|
2926
2641
|
}
|
|
2927
2642
|
}
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2643
|
+
return newObj;
|
|
2644
|
+
};
|
|
2645
|
+
var checkIfKeyIsComponent = (key) => {
|
|
2646
|
+
const isFirstKeyString = (0, import_types.isString)(key);
|
|
2647
|
+
if (!isFirstKeyString)
|
|
2648
|
+
return;
|
|
2649
|
+
const firstCharKey = key.slice(0, 1);
|
|
2650
|
+
return /^[A-Z]*$/.test(firstCharKey);
|
|
2651
|
+
};
|
|
2652
|
+
var getChildrenComponentsByKey = (key, el) => {
|
|
2653
|
+
if (key === el.key || el.__ref.__componentKey === key) {
|
|
2654
|
+
return el;
|
|
2655
|
+
}
|
|
2656
|
+
if (el.extend) {
|
|
2657
|
+
const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
|
|
2658
|
+
const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
|
|
2659
|
+
if (foundString || foundInArray)
|
|
2660
|
+
return el;
|
|
2661
|
+
}
|
|
2662
|
+
if (el.parent && el.parent.childExtend) {
|
|
2663
|
+
const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
|
|
2664
|
+
const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
|
|
2665
|
+
if (foundString || foundInArray)
|
|
2666
|
+
return el;
|
|
2667
|
+
}
|
|
2668
|
+
};
|
|
2669
|
+
var getExtendsInElement = (obj) => {
|
|
2670
|
+
let result = [];
|
|
2671
|
+
function traverse(o) {
|
|
2672
|
+
for (const key in o) {
|
|
2673
|
+
if (Object.hasOwnProperty.call(o, key)) {
|
|
2674
|
+
if (checkIfKeyIsComponent(key)) {
|
|
2675
|
+
result.push(key);
|
|
2676
|
+
}
|
|
2677
|
+
if (key === "extend") {
|
|
2678
|
+
if (typeof o[key] === "string") {
|
|
2679
|
+
result.push(o[key]);
|
|
2680
|
+
} else if (Array.isArray(o[key])) {
|
|
2681
|
+
result = result.concat(o[key]);
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
if (typeof o[key] === "object" && o[key] !== null) {
|
|
2685
|
+
traverse(o[key]);
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
traverse(obj);
|
|
2691
|
+
return result;
|
|
2692
|
+
};
|
|
2951
2693
|
}
|
|
2952
|
-
return to;
|
|
2953
|
-
};
|
|
2954
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2955
|
-
var function_exports = {};
|
|
2956
|
-
__export22(function_exports, {
|
|
2957
|
-
debounce: () => debounce,
|
|
2958
|
-
debounceOnContext: () => debounceOnContext,
|
|
2959
|
-
isStringFunction: () => isStringFunction,
|
|
2960
|
-
memoize: () => memoize
|
|
2961
2694
|
});
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2695
|
+
var require_function2 = __commonJS2({
|
|
2696
|
+
"../../../domql/packages/utils/dist/cjs/function.js"(exports2, module22) {
|
|
2697
|
+
"use strict";
|
|
2698
|
+
var __defProp22 = Object.defineProperty;
|
|
2699
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2700
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2701
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2702
|
+
var __export22 = (target, all) => {
|
|
2703
|
+
for (var name in all)
|
|
2704
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2705
|
+
};
|
|
2706
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2707
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2708
|
+
for (let key of __getOwnPropNames22(from))
|
|
2709
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2710
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2711
|
+
}
|
|
2712
|
+
return to;
|
|
2713
|
+
};
|
|
2714
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2715
|
+
var function_exports = {};
|
|
2716
|
+
__export22(function_exports, {
|
|
2717
|
+
debounce: () => debounce,
|
|
2718
|
+
debounceOnContext: () => debounceOnContext,
|
|
2719
|
+
isStringFunction: () => isStringFunction,
|
|
2720
|
+
memoize: () => memoize
|
|
2721
|
+
});
|
|
2722
|
+
module22.exports = __toCommonJS22(function_exports);
|
|
2723
|
+
function debounce(func, wait, immediate) {
|
|
2724
|
+
let timeout;
|
|
2725
|
+
return function() {
|
|
2726
|
+
const context = this;
|
|
2727
|
+
const args = arguments;
|
|
2728
|
+
const later = function() {
|
|
2729
|
+
timeout = null;
|
|
2730
|
+
if (!immediate)
|
|
2731
|
+
func.apply(context, args);
|
|
2732
|
+
};
|
|
2733
|
+
const callNow = immediate && !timeout;
|
|
2734
|
+
clearTimeout(timeout);
|
|
2735
|
+
timeout = setTimeout(later, wait);
|
|
2736
|
+
if (callNow)
|
|
2737
|
+
func.apply(context, args);
|
|
2738
|
+
};
|
|
2739
|
+
}
|
|
2740
|
+
var debounceOnContext = (element, func, timeout = 300) => {
|
|
2741
|
+
let timer;
|
|
2742
|
+
return (...args) => {
|
|
2743
|
+
clearTimeout(timer);
|
|
2744
|
+
timer = setTimeout(() => {
|
|
2745
|
+
func.apply(element, args);
|
|
2746
|
+
}, timeout);
|
|
2747
|
+
};
|
|
2748
|
+
};
|
|
2749
|
+
var memoize = (fn) => {
|
|
2750
|
+
const cache = {};
|
|
2751
|
+
return (...args) => {
|
|
2752
|
+
const n = args[0];
|
|
2753
|
+
if (n in cache) {
|
|
2754
|
+
return cache[n];
|
|
2755
|
+
} else {
|
|
2756
|
+
const result = fn(n);
|
|
2757
|
+
cache[n] = result;
|
|
2758
|
+
return result;
|
|
2759
|
+
}
|
|
2760
|
+
};
|
|
2761
|
+
};
|
|
2762
|
+
var isStringFunction = (inputString) => {
|
|
2763
|
+
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
2764
|
+
return functionRegex.test(inputString);
|
|
2972
2765
|
};
|
|
2973
|
-
const callNow = immediate && !timeout;
|
|
2974
|
-
clearTimeout(timeout);
|
|
2975
|
-
timeout = setTimeout(later, wait);
|
|
2976
|
-
if (callNow)
|
|
2977
|
-
func.apply(context, args);
|
|
2978
|
-
};
|
|
2979
|
-
}
|
|
2980
|
-
var debounceOnContext = (element, func, timeout = 300) => {
|
|
2981
|
-
let timer;
|
|
2982
|
-
return (...args) => {
|
|
2983
|
-
clearTimeout(timer);
|
|
2984
|
-
timer = setTimeout(() => {
|
|
2985
|
-
func.apply(element, args);
|
|
2986
|
-
}, timeout);
|
|
2987
|
-
};
|
|
2988
|
-
};
|
|
2989
|
-
var memoize = (fn) => {
|
|
2990
|
-
const cache = {};
|
|
2991
|
-
return (...args) => {
|
|
2992
|
-
const n = args[0];
|
|
2993
|
-
if (n in cache) {
|
|
2994
|
-
return cache[n];
|
|
2995
|
-
} else {
|
|
2996
|
-
const result = fn(n);
|
|
2997
|
-
cache[n] = result;
|
|
2998
|
-
return result;
|
|
2999
|
-
}
|
|
3000
|
-
};
|
|
3001
|
-
};
|
|
3002
|
-
var isStringFunction = (inputString) => {
|
|
3003
|
-
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
3004
|
-
return functionRegex.test(inputString);
|
|
3005
|
-
};
|
|
3006
|
-
}
|
|
3007
|
-
});
|
|
3008
|
-
var require_log2 = __commonJS2({
|
|
3009
|
-
"../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
|
|
3010
|
-
"use strict";
|
|
3011
|
-
var __defProp22 = Object.defineProperty;
|
|
3012
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3013
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3014
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3015
|
-
var __export22 = (target, all) => {
|
|
3016
|
-
for (var name in all)
|
|
3017
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3018
|
-
};
|
|
3019
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
3020
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
3021
|
-
for (let key of __getOwnPropNames22(from))
|
|
3022
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3023
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3024
2766
|
}
|
|
3025
|
-
return to;
|
|
3026
|
-
};
|
|
3027
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3028
|
-
var log_exports = {};
|
|
3029
|
-
__export22(log_exports, {
|
|
3030
|
-
logGroupIf: () => logGroupIf,
|
|
3031
|
-
logIf: () => logIf
|
|
3032
2767
|
});
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
2768
|
+
var require_log2 = __commonJS2({
|
|
2769
|
+
"../../../domql/packages/utils/dist/cjs/log.js"(exports2, module22) {
|
|
2770
|
+
"use strict";
|
|
2771
|
+
var __defProp22 = Object.defineProperty;
|
|
2772
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2773
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2774
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2775
|
+
var __export22 = (target, all) => {
|
|
2776
|
+
for (var name in all)
|
|
2777
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2778
|
+
};
|
|
2779
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2780
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2781
|
+
for (let key of __getOwnPropNames22(from))
|
|
2782
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2783
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2784
|
+
}
|
|
2785
|
+
return to;
|
|
2786
|
+
};
|
|
2787
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2788
|
+
var log_exports = {};
|
|
2789
|
+
__export22(log_exports, {
|
|
2790
|
+
logGroupIf: () => logGroupIf,
|
|
2791
|
+
logIf: () => logIf
|
|
2792
|
+
});
|
|
2793
|
+
module22.exports = __toCommonJS22(log_exports);
|
|
2794
|
+
var logIf = (bool, ...arg) => {
|
|
2795
|
+
if (bool)
|
|
2796
|
+
arg.map((v) => console.log(v));
|
|
2797
|
+
};
|
|
2798
|
+
var logGroupIf = (bool, key, ...arg) => {
|
|
2799
|
+
if (bool) {
|
|
2800
|
+
console.group(key);
|
|
2801
|
+
arg.map((v) => console.log(v));
|
|
2802
|
+
console.groupEnd(key);
|
|
2803
|
+
}
|
|
2804
|
+
};
|
|
3043
2805
|
}
|
|
3044
|
-
};
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
2806
|
+
});
|
|
2807
|
+
var require_cookie2 = __commonJS2({
|
|
2808
|
+
"../../../domql/packages/utils/dist/cjs/cookie.js"(exports2, module22) {
|
|
2809
|
+
"use strict";
|
|
2810
|
+
var __defProp22 = Object.defineProperty;
|
|
2811
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2812
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2813
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2814
|
+
var __export22 = (target, all) => {
|
|
2815
|
+
for (var name in all)
|
|
2816
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2817
|
+
};
|
|
2818
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2819
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2820
|
+
for (let key of __getOwnPropNames22(from))
|
|
2821
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2822
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2823
|
+
}
|
|
2824
|
+
return to;
|
|
2825
|
+
};
|
|
2826
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2827
|
+
var cookie_exports = {};
|
|
2828
|
+
__export22(cookie_exports, {
|
|
2829
|
+
getCookie: () => getCookie,
|
|
2830
|
+
isMobile: () => isMobile,
|
|
2831
|
+
setCookie: () => setCookie
|
|
2832
|
+
});
|
|
2833
|
+
module22.exports = __toCommonJS22(cookie_exports);
|
|
2834
|
+
var import_types = require_types2();
|
|
2835
|
+
var import_utils32 = require_cjs4();
|
|
2836
|
+
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
2837
|
+
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
2838
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2839
|
+
return;
|
|
2840
|
+
const d = /* @__PURE__ */ new Date();
|
|
2841
|
+
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
2842
|
+
const expires = `expires=${d.toUTCString()}`;
|
|
2843
|
+
import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2844
|
+
};
|
|
2845
|
+
var getCookie = (cname) => {
|
|
2846
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2847
|
+
return;
|
|
2848
|
+
const name = `${cname}=`;
|
|
2849
|
+
const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
|
|
2850
|
+
const ca = decodedCookie.split(";");
|
|
2851
|
+
for (let i = 0; i < ca.length; i++) {
|
|
2852
|
+
let c = ca[i];
|
|
2853
|
+
while (c.charAt(0) === " ")
|
|
2854
|
+
c = c.substring(1);
|
|
2855
|
+
if (c.indexOf(name) === 0)
|
|
2856
|
+
return c.substring(name.length, c.length);
|
|
2857
|
+
}
|
|
2858
|
+
return "";
|
|
2859
|
+
};
|
|
3063
2860
|
}
|
|
3064
|
-
return to;
|
|
3065
|
-
};
|
|
3066
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3067
|
-
var cookie_exports = {};
|
|
3068
|
-
__export22(cookie_exports, {
|
|
3069
|
-
getCookie: () => getCookie,
|
|
3070
|
-
isMobile: () => isMobile,
|
|
3071
|
-
setCookie: () => setCookie
|
|
3072
2861
|
});
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
2862
|
+
var require_tags2 = __commonJS2({
|
|
2863
|
+
"../../../domql/packages/utils/dist/cjs/tags.js"(exports2, module22) {
|
|
2864
|
+
"use strict";
|
|
2865
|
+
var __defProp22 = Object.defineProperty;
|
|
2866
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2867
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2868
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2869
|
+
var __export22 = (target, all) => {
|
|
2870
|
+
for (var name in all)
|
|
2871
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2872
|
+
};
|
|
2873
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2874
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2875
|
+
for (let key of __getOwnPropNames22(from))
|
|
2876
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2877
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2878
|
+
}
|
|
2879
|
+
return to;
|
|
2880
|
+
};
|
|
2881
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2882
|
+
var tags_exports = {};
|
|
2883
|
+
__export22(tags_exports, {
|
|
2884
|
+
HTML_TAGS: () => HTML_TAGS,
|
|
2885
|
+
isValidHtmlTag: () => isValidHtmlTag
|
|
2886
|
+
});
|
|
2887
|
+
module22.exports = __toCommonJS22(tags_exports);
|
|
2888
|
+
var HTML_TAGS = {
|
|
2889
|
+
root: [
|
|
2890
|
+
"body",
|
|
2891
|
+
"html"
|
|
2892
|
+
],
|
|
2893
|
+
head: [
|
|
2894
|
+
"title",
|
|
2895
|
+
"base",
|
|
2896
|
+
"meta",
|
|
2897
|
+
"style"
|
|
2898
|
+
],
|
|
2899
|
+
body: [
|
|
2900
|
+
"string",
|
|
2901
|
+
"fragment",
|
|
2902
|
+
"a",
|
|
2903
|
+
"abbr",
|
|
2904
|
+
"acronym",
|
|
2905
|
+
"address",
|
|
2906
|
+
"applet",
|
|
2907
|
+
"area",
|
|
2908
|
+
"article",
|
|
2909
|
+
"aside",
|
|
2910
|
+
"audio",
|
|
2911
|
+
"b",
|
|
2912
|
+
"basefont",
|
|
2913
|
+
"bdi",
|
|
2914
|
+
"bdo",
|
|
2915
|
+
"big",
|
|
2916
|
+
"blockquote",
|
|
2917
|
+
"br",
|
|
2918
|
+
"button",
|
|
2919
|
+
"canvas",
|
|
2920
|
+
"caption",
|
|
2921
|
+
"center",
|
|
2922
|
+
"cite",
|
|
2923
|
+
"code",
|
|
2924
|
+
"search",
|
|
2925
|
+
"col",
|
|
2926
|
+
"colgroup",
|
|
2927
|
+
"data",
|
|
2928
|
+
"datalist",
|
|
2929
|
+
"dd",
|
|
2930
|
+
"del",
|
|
2931
|
+
"details",
|
|
2932
|
+
"dfn",
|
|
2933
|
+
"dialog",
|
|
2934
|
+
"dir",
|
|
2935
|
+
"div",
|
|
2936
|
+
"dl",
|
|
2937
|
+
"dt",
|
|
2938
|
+
"em",
|
|
2939
|
+
"embed",
|
|
2940
|
+
"fieldset",
|
|
2941
|
+
"figcaption",
|
|
2942
|
+
"figure",
|
|
2943
|
+
"font",
|
|
2944
|
+
"footer",
|
|
2945
|
+
"form",
|
|
2946
|
+
"frame",
|
|
2947
|
+
"frameset",
|
|
2948
|
+
"h1",
|
|
2949
|
+
"h2",
|
|
2950
|
+
"h3",
|
|
2951
|
+
"h4",
|
|
2952
|
+
"h5",
|
|
2953
|
+
"h6",
|
|
2954
|
+
"head",
|
|
2955
|
+
"header",
|
|
2956
|
+
"hr",
|
|
2957
|
+
"i",
|
|
2958
|
+
"iframe",
|
|
2959
|
+
"img",
|
|
2960
|
+
"input",
|
|
2961
|
+
"ins",
|
|
2962
|
+
"kbd",
|
|
2963
|
+
"label",
|
|
2964
|
+
"legend",
|
|
2965
|
+
"li",
|
|
2966
|
+
"link",
|
|
2967
|
+
"main",
|
|
2968
|
+
"map",
|
|
2969
|
+
"mark",
|
|
2970
|
+
"meter",
|
|
2971
|
+
"nav",
|
|
2972
|
+
"noframes",
|
|
2973
|
+
"noscript",
|
|
2974
|
+
"object",
|
|
2975
|
+
"ol",
|
|
2976
|
+
"optgroup",
|
|
2977
|
+
"option",
|
|
2978
|
+
"output",
|
|
2979
|
+
"p",
|
|
2980
|
+
"param",
|
|
2981
|
+
"picture",
|
|
2982
|
+
"pre",
|
|
2983
|
+
"progress",
|
|
2984
|
+
"hgroup",
|
|
2985
|
+
"q",
|
|
2986
|
+
"rp",
|
|
2987
|
+
"rt",
|
|
2988
|
+
"ruby",
|
|
2989
|
+
"s",
|
|
2990
|
+
"samp",
|
|
2991
|
+
"script",
|
|
2992
|
+
"section",
|
|
2993
|
+
"select",
|
|
2994
|
+
"small",
|
|
2995
|
+
"source",
|
|
2996
|
+
"span",
|
|
2997
|
+
"strike",
|
|
2998
|
+
"strong",
|
|
2999
|
+
"sub",
|
|
3000
|
+
"summary",
|
|
3001
|
+
"sup",
|
|
3002
|
+
"table",
|
|
3003
|
+
"tbody",
|
|
3004
|
+
"td",
|
|
3005
|
+
"template",
|
|
3006
|
+
"hgroup",
|
|
3007
|
+
"textarea",
|
|
3008
|
+
"tfoot",
|
|
3009
|
+
"th",
|
|
3010
|
+
"thead",
|
|
3011
|
+
"time",
|
|
3012
|
+
"tr",
|
|
3013
|
+
"track",
|
|
3014
|
+
"tt",
|
|
3015
|
+
"u",
|
|
3016
|
+
"ul",
|
|
3017
|
+
"var",
|
|
3018
|
+
"video",
|
|
3019
|
+
"wbr",
|
|
3020
|
+
// SVG
|
|
3021
|
+
"svg",
|
|
3022
|
+
"path"
|
|
3023
|
+
]
|
|
3024
|
+
};
|
|
3025
|
+
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
3026
|
+
}
|
|
3027
|
+
});
|
|
3028
|
+
var require_cjs4 = __commonJS2({
|
|
3029
|
+
"../../../domql/packages/utils/dist/cjs/index.js"(exports2, module22) {
|
|
3030
|
+
"use strict";
|
|
3031
|
+
var __defProp22 = Object.defineProperty;
|
|
3032
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3033
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3034
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3035
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3036
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3037
|
+
for (let key of __getOwnPropNames22(from))
|
|
3038
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3039
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3040
|
+
}
|
|
3041
|
+
return to;
|
|
3042
|
+
};
|
|
3043
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
3044
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3045
|
+
var utils_exports2 = {};
|
|
3046
|
+
module22.exports = __toCommonJS22(utils_exports2);
|
|
3047
|
+
__reExport(utils_exports2, require_key2(), module22.exports);
|
|
3048
|
+
__reExport(utils_exports2, require_env2(), module22.exports);
|
|
3049
|
+
__reExport(utils_exports2, require_types2(), module22.exports);
|
|
3050
|
+
__reExport(utils_exports2, require_object2(), module22.exports);
|
|
3051
|
+
__reExport(utils_exports2, require_function2(), module22.exports);
|
|
3052
|
+
__reExport(utils_exports2, require_array2(), module22.exports);
|
|
3053
|
+
__reExport(utils_exports2, require_node2(), module22.exports);
|
|
3054
|
+
__reExport(utils_exports2, require_log2(), module22.exports);
|
|
3055
|
+
__reExport(utils_exports2, require_string2(), module22.exports);
|
|
3056
|
+
__reExport(utils_exports2, require_globals2(), module22.exports);
|
|
3057
|
+
__reExport(utils_exports2, require_cookie2(), module22.exports);
|
|
3058
|
+
__reExport(utils_exports2, require_tags2(), module22.exports);
|
|
3059
|
+
}
|
|
3060
|
+
});
|
|
3061
|
+
var src_exports = {};
|
|
3062
|
+
__export2(src_exports, {
|
|
3063
|
+
arrayzeValue: () => arrayzeValue,
|
|
3064
|
+
copyStringToClipboard: () => copyStringToClipboard,
|
|
3065
|
+
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
3066
|
+
findClosestNumber: () => findClosestNumber,
|
|
3067
|
+
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
3068
|
+
formatDate: () => formatDate,
|
|
3069
|
+
isPhoto: () => isPhoto,
|
|
3070
|
+
loadCssFile: () => loadCssFile,
|
|
3071
|
+
loadJavascript: () => loadJavascript,
|
|
3072
|
+
loadJavascriptFile: () => loadJavascriptFile,
|
|
3073
|
+
loadJavascriptFileSync: () => loadJavascriptFileSync,
|
|
3074
|
+
removeChars: () => removeChars,
|
|
3075
|
+
toCamelCase: () => toCamelCase,
|
|
3076
|
+
toDashCase: () => toDashCase2,
|
|
3077
|
+
toDescriptionCase: () => toDescriptionCase,
|
|
3078
|
+
toTitleCase: () => toTitleCase,
|
|
3079
|
+
toggleFullscreen: () => toggleFullscreen
|
|
3080
|
+
});
|
|
3081
|
+
module2.exports = __toCommonJS2(src_exports);
|
|
3082
|
+
var import_utils22 = __toESM2(require_cjs4(), 1);
|
|
3083
|
+
var toggleFullscreen = async (el) => {
|
|
3084
|
+
if (!document.fullscreenElement) {
|
|
3085
|
+
try {
|
|
3086
|
+
await (el.node || document).requestFullscreen();
|
|
3087
|
+
} catch (err) {
|
|
3088
|
+
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
3089
|
+
}
|
|
3090
|
+
} else {
|
|
3091
|
+
await document.exitFullscreen();
|
|
3097
3092
|
}
|
|
3098
|
-
return "";
|
|
3099
3093
|
};
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
var __defProp22 = Object.defineProperty;
|
|
3106
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3107
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3108
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3109
|
-
var __export22 = (target, all) => {
|
|
3110
|
-
for (var name in all)
|
|
3111
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3094
|
+
var import_utils7 = __toESM2(require_cjs4(), 1);
|
|
3095
|
+
var findClosestNumber = (number, arr) => {
|
|
3096
|
+
return ((0, import_utils7.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
3097
|
+
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
3098
|
+
});
|
|
3112
3099
|
};
|
|
3113
|
-
var
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3100
|
+
var findClosestNumberInFactory = (val, factory) => {
|
|
3101
|
+
val = parseFloat(val);
|
|
3102
|
+
if ((0, import_utils7.isObject)(factory))
|
|
3103
|
+
factory = Object.values(factory);
|
|
3104
|
+
return findClosestNumber(val, factory);
|
|
3105
|
+
};
|
|
3106
|
+
var formatDate = (timestamp) => {
|
|
3107
|
+
if (!timestamp)
|
|
3108
|
+
return "";
|
|
3109
|
+
const d = new Date(timestamp);
|
|
3110
|
+
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
3111
|
+
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
3112
|
+
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
3113
|
+
return `${da} ${mo}, ${ye}`;
|
|
3114
|
+
};
|
|
3115
|
+
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
3116
|
+
const fib = [0, 1];
|
|
3117
|
+
for (let i = 2; i <= n; i++) {
|
|
3118
|
+
fib[i] = fib[i - 1] + fib[i - 2];
|
|
3119
|
+
}
|
|
3120
|
+
return fib[n];
|
|
3121
|
+
};
|
|
3122
|
+
var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
|
|
3123
|
+
return new Promise((resolve, reject) => {
|
|
3124
|
+
try {
|
|
3125
|
+
const scriptEle = doc.createElement("script");
|
|
3126
|
+
scriptEle.type = type;
|
|
3127
|
+
scriptEle.async = async;
|
|
3128
|
+
scriptEle.src = FILE_URL;
|
|
3129
|
+
scriptEle.addEventListener("load", (ev) => {
|
|
3130
|
+
resolve({
|
|
3131
|
+
status: true
|
|
3132
|
+
});
|
|
3133
|
+
});
|
|
3134
|
+
scriptEle.addEventListener("error", (ev) => {
|
|
3135
|
+
reject(new Error({
|
|
3136
|
+
status: false,
|
|
3137
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
3138
|
+
}));
|
|
3139
|
+
});
|
|
3140
|
+
doc.body.appendChild(scriptEle);
|
|
3141
|
+
} catch (error) {
|
|
3142
|
+
reject(error);
|
|
3143
|
+
}
|
|
3144
|
+
});
|
|
3120
3145
|
};
|
|
3121
|
-
var
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
"
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
"
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
"
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
"link",
|
|
3207
|
-
"main",
|
|
3208
|
-
"map",
|
|
3209
|
-
"mark",
|
|
3210
|
-
"meter",
|
|
3211
|
-
"nav",
|
|
3212
|
-
"noframes",
|
|
3213
|
-
"noscript",
|
|
3214
|
-
"object",
|
|
3215
|
-
"ol",
|
|
3216
|
-
"optgroup",
|
|
3217
|
-
"option",
|
|
3218
|
-
"output",
|
|
3219
|
-
"p",
|
|
3220
|
-
"param",
|
|
3221
|
-
"picture",
|
|
3222
|
-
"pre",
|
|
3223
|
-
"progress",
|
|
3224
|
-
"hgroup",
|
|
3225
|
-
"q",
|
|
3226
|
-
"rp",
|
|
3227
|
-
"rt",
|
|
3228
|
-
"ruby",
|
|
3229
|
-
"s",
|
|
3230
|
-
"samp",
|
|
3231
|
-
"script",
|
|
3232
|
-
"section",
|
|
3233
|
-
"select",
|
|
3234
|
-
"small",
|
|
3235
|
-
"source",
|
|
3236
|
-
"span",
|
|
3237
|
-
"strike",
|
|
3238
|
-
"strong",
|
|
3239
|
-
"sub",
|
|
3240
|
-
"summary",
|
|
3241
|
-
"sup",
|
|
3242
|
-
"table",
|
|
3243
|
-
"tbody",
|
|
3244
|
-
"td",
|
|
3245
|
-
"template",
|
|
3246
|
-
"hgroup",
|
|
3247
|
-
"textarea",
|
|
3248
|
-
"tfoot",
|
|
3249
|
-
"th",
|
|
3250
|
-
"thead",
|
|
3251
|
-
"time",
|
|
3252
|
-
"tr",
|
|
3253
|
-
"track",
|
|
3254
|
-
"tt",
|
|
3255
|
-
"u",
|
|
3256
|
-
"ul",
|
|
3257
|
-
"var",
|
|
3258
|
-
"video",
|
|
3259
|
-
"wbr",
|
|
3260
|
-
// SVG
|
|
3261
|
-
"svg",
|
|
3262
|
-
"path"
|
|
3263
|
-
]
|
|
3146
|
+
var loadJavascriptFileSync = (FILE_URL, doc = document, fallback, type = "text/javascript") => {
|
|
3147
|
+
const xhr = new window.XMLHttpRequest();
|
|
3148
|
+
xhr.open("GET", FILE_URL, false);
|
|
3149
|
+
xhr.send();
|
|
3150
|
+
if (xhr.status === 200) {
|
|
3151
|
+
const scriptEle = doc.createElement("script");
|
|
3152
|
+
scriptEle.type = type;
|
|
3153
|
+
scriptEle.text = xhr.responseText;
|
|
3154
|
+
doc.body.appendChild(scriptEle);
|
|
3155
|
+
if (typeof fallback === "function")
|
|
3156
|
+
fallback();
|
|
3157
|
+
} else {
|
|
3158
|
+
throw new Error(`Failed to load the script ${FILE_URL}`);
|
|
3159
|
+
}
|
|
3160
|
+
};
|
|
3161
|
+
var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
|
|
3162
|
+
return new Promise((resolve, reject) => {
|
|
3163
|
+
try {
|
|
3164
|
+
const linkElem = doc.createElement("link");
|
|
3165
|
+
linkElem.rel = "stylesheet";
|
|
3166
|
+
linkElem.href = FILE_URL;
|
|
3167
|
+
linkElem.addEventListener("load", (ev) => {
|
|
3168
|
+
resolve({
|
|
3169
|
+
status: true
|
|
3170
|
+
});
|
|
3171
|
+
});
|
|
3172
|
+
doc.head.appendChild(linkElem);
|
|
3173
|
+
} catch (error) {
|
|
3174
|
+
reject(error);
|
|
3175
|
+
}
|
|
3176
|
+
});
|
|
3177
|
+
};
|
|
3178
|
+
var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
|
|
3179
|
+
try {
|
|
3180
|
+
const scriptEle = doc.createElement("script");
|
|
3181
|
+
scriptEle.type = type;
|
|
3182
|
+
scriptEle.async = async;
|
|
3183
|
+
scriptEle.id = id;
|
|
3184
|
+
scriptEle.innerHTML = body;
|
|
3185
|
+
doc.body.appendChild(scriptEle);
|
|
3186
|
+
} catch (error) {
|
|
3187
|
+
console.warn(error);
|
|
3188
|
+
}
|
|
3189
|
+
};
|
|
3190
|
+
var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
|
|
3191
|
+
var copyStringToClipboard = (str) => {
|
|
3192
|
+
const el = document.createElement("textarea");
|
|
3193
|
+
el.value = str;
|
|
3194
|
+
el.setAttribute("readonly", "");
|
|
3195
|
+
el.style = { position: "absolute", left: "-9999px" };
|
|
3196
|
+
document.body.appendChild(el);
|
|
3197
|
+
el.select();
|
|
3198
|
+
document.execCommand("copy");
|
|
3199
|
+
document.body.removeChild(el);
|
|
3200
|
+
};
|
|
3201
|
+
var removeChars = (str) => {
|
|
3202
|
+
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
3203
|
+
};
|
|
3204
|
+
var toCamelCase = (str) => {
|
|
3205
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
3206
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
3207
|
+
}).replaceAll(/\s+/g, "");
|
|
3208
|
+
};
|
|
3209
|
+
var toTitleCase = (str) => str && str.replace(
|
|
3210
|
+
/\w\S*/g,
|
|
3211
|
+
(txt) => {
|
|
3212
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
3213
|
+
}
|
|
3214
|
+
);
|
|
3215
|
+
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
3216
|
+
var toDescriptionCase = (str = "") => {
|
|
3217
|
+
if (typeof str !== "string")
|
|
3218
|
+
return;
|
|
3219
|
+
const result = str.replace(/([A-Z])/g, " $1");
|
|
3220
|
+
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
3221
|
+
};
|
|
3222
|
+
var arrayzeValue = (val) => {
|
|
3223
|
+
if ((0, import_utils22.isArray)(val))
|
|
3224
|
+
return val;
|
|
3225
|
+
if ((0, import_utils22.isString)(val))
|
|
3226
|
+
return val.split(" ");
|
|
3227
|
+
if ((0, import_utils22.isObject)(val))
|
|
3228
|
+
return Object.values(val);
|
|
3229
|
+
if ((0, import_utils22.isNumber)(val))
|
|
3230
|
+
return [val];
|
|
3264
3231
|
};
|
|
3265
|
-
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
3266
3232
|
}
|
|
3267
3233
|
});
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3234
|
+
|
|
3235
|
+
// src/utils/index.js
|
|
3236
|
+
var utils_exports = {};
|
|
3237
|
+
__export(utils_exports, {
|
|
3238
|
+
applyMediaSequenceVars: () => applyMediaSequenceVars,
|
|
3239
|
+
applySequenceGlobalVars: () => applySequenceGlobalVars,
|
|
3240
|
+
applySequenceVars: () => applySequenceVars,
|
|
3241
|
+
changeLightness: () => changeLightness,
|
|
3242
|
+
colorStringToRgbaArray: () => colorStringToRgbaArray,
|
|
3243
|
+
convertSvgToSymbol: () => convertSvgToSymbol,
|
|
3244
|
+
findHeadingLetter: () => findHeadingLetter,
|
|
3245
|
+
findHeadings: () => findHeadings,
|
|
3246
|
+
generateSequence: () => generateSequence,
|
|
3247
|
+
generateSprite: () => generateSprite,
|
|
3248
|
+
generateSubSequence: () => generateSubSequence,
|
|
3249
|
+
getColorShade: () => getColorShade,
|
|
3250
|
+
getDefaultOrFirstKey: () => getDefaultOrFirstKey,
|
|
3251
|
+
getFontFace: () => getFontFace,
|
|
3252
|
+
getFontFaceEach: () => getFontFaceEach,
|
|
3253
|
+
getFontFaceEachString: () => getFontFaceEachString,
|
|
3254
|
+
getFontFaceString: () => getFontFaceString,
|
|
3255
|
+
getFontFormat: () => getFontFormat,
|
|
3256
|
+
getRgbTone: () => getRgbTone,
|
|
3257
|
+
getSequenceValue: () => getSequenceValue,
|
|
3258
|
+
getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
|
|
3259
|
+
getSubratio: () => getSubratio,
|
|
3260
|
+
getSubratioDifference: () => getSubratioDifference,
|
|
3261
|
+
hexToRgb: () => hexToRgb,
|
|
3262
|
+
hexToRgbArray: () => hexToRgbArray,
|
|
3263
|
+
hexToRgba: () => hexToRgba,
|
|
3264
|
+
hslToRgb: () => hslToRgb,
|
|
3265
|
+
isScalingUnit: () => isScalingUnit,
|
|
3266
|
+
mixTwoColors: () => mixTwoColors,
|
|
3267
|
+
mixTwoRgb: () => mixTwoRgb,
|
|
3268
|
+
mixTwoRgba: () => mixTwoRgba,
|
|
3269
|
+
numToLetterMap: () => numToLetterMap,
|
|
3270
|
+
opacify: () => opacify,
|
|
3271
|
+
returnSubThemeOrDefault: () => returnSubThemeOrDefault,
|
|
3272
|
+
rgbArrayToHex: () => rgbArrayToHex,
|
|
3273
|
+
rgbToHSL: () => rgbToHSL,
|
|
3274
|
+
rgbToHex: () => rgbToHex,
|
|
3275
|
+
setCustomFont: () => setCustomFont,
|
|
3276
|
+
setCustomFontMedia: () => setCustomFontMedia,
|
|
3277
|
+
setInCustomFontMedia: () => setInCustomFontMedia,
|
|
3278
|
+
setScalingVar: () => setScalingVar,
|
|
3279
|
+
setSubScalingVar: () => setSubScalingVar,
|
|
3280
|
+
setVariables: () => setVariables
|
|
3281
|
+
});
|
|
3282
|
+
module.exports = __toCommonJS(utils_exports);
|
|
3283
|
+
|
|
3284
|
+
// src/utils/unit.js
|
|
3285
|
+
var isScalingUnit = (unit) => {
|
|
3286
|
+
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
3287
|
+
};
|
|
3288
|
+
|
|
3289
|
+
// src/utils/color.js
|
|
3290
|
+
var import_globals = __toESM(require_cjs(), 1);
|
|
3291
|
+
var import_utils = __toESM(require_cjs2(), 1);
|
|
3292
|
+
var ENV = "development";
|
|
3293
|
+
var colorStringToRgbaArray = (color) => {
|
|
3294
|
+
if (color === "")
|
|
3295
|
+
return [0, 0, 0, 0];
|
|
3296
|
+
if (color.toLowerCase() === "transparent")
|
|
3297
|
+
return [0, 0, 0, 0];
|
|
3298
|
+
if (color[0] === "#") {
|
|
3299
|
+
if (color.length < 7) {
|
|
3300
|
+
color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
|
|
3301
|
+
}
|
|
3302
|
+
return [
|
|
3303
|
+
parseInt(color.substr(1, 2), 16),
|
|
3304
|
+
parseInt(color.substr(3, 2), 16),
|
|
3305
|
+
parseInt(color.substr(5, 2), 16),
|
|
3306
|
+
color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
|
|
3307
|
+
];
|
|
3308
|
+
}
|
|
3309
|
+
if (color.indexOf("rgb") === -1) {
|
|
3310
|
+
if (import_globals.document && import_globals.window) {
|
|
3311
|
+
const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
|
|
3312
|
+
const flag = "rgb(1, 2, 3)";
|
|
3313
|
+
elem.style.color = flag;
|
|
3314
|
+
if (elem.style.color !== flag) {
|
|
3315
|
+
import_globals.document.body.removeChild(elem);
|
|
3316
|
+
return;
|
|
3280
3317
|
}
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
__reExport(utils_exports2, require_types2(), module2.exports);
|
|
3290
|
-
__reExport(utils_exports2, require_object2(), module2.exports);
|
|
3291
|
-
__reExport(utils_exports2, require_function2(), module2.exports);
|
|
3292
|
-
__reExport(utils_exports2, require_array2(), module2.exports);
|
|
3293
|
-
__reExport(utils_exports2, require_node2(), module2.exports);
|
|
3294
|
-
__reExport(utils_exports2, require_log2(), module2.exports);
|
|
3295
|
-
__reExport(utils_exports2, require_string2(), module2.exports);
|
|
3296
|
-
__reExport(utils_exports2, require_globals2(), module2.exports);
|
|
3297
|
-
__reExport(utils_exports2, require_cookie2(), module2.exports);
|
|
3298
|
-
__reExport(utils_exports2, require_tags2(), module2.exports);
|
|
3318
|
+
elem.style.color = color;
|
|
3319
|
+
if (elem.style.color === flag || elem.style.color === "") {
|
|
3320
|
+
import_globals.document.body.removeChild(elem);
|
|
3321
|
+
return [0, 0, 0, 0];
|
|
3322
|
+
}
|
|
3323
|
+
color = import_globals.window.getComputedStyle(elem).color;
|
|
3324
|
+
import_globals.document.body.removeChild(elem);
|
|
3325
|
+
}
|
|
3299
3326
|
}
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
copyStringToClipboard: () => copyStringToClipboard,
|
|
3305
|
-
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
3306
|
-
findClosestNumber: () => findClosestNumber,
|
|
3307
|
-
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
3308
|
-
formatDate: () => formatDate,
|
|
3309
|
-
isPhoto: () => isPhoto,
|
|
3310
|
-
loadCssFile: () => loadCssFile,
|
|
3311
|
-
loadJavascript: () => loadJavascript,
|
|
3312
|
-
loadJavascriptFile: () => loadJavascriptFile,
|
|
3313
|
-
removeChars: () => removeChars,
|
|
3314
|
-
toCamelCase: () => toCamelCase,
|
|
3315
|
-
toDashCase: () => toDashCase,
|
|
3316
|
-
toDescriptionCase: () => toDescriptionCase,
|
|
3317
|
-
toTitleCase: () => toTitleCase,
|
|
3318
|
-
toggleFullscreen: () => toggleFullscreen
|
|
3319
|
-
});
|
|
3320
|
-
module.exports = __toCommonJS2(src_exports);
|
|
3321
|
-
var import_utils2 = __toESM2(require_cjs3(), 1);
|
|
3322
|
-
var toggleFullscreen = (el) => {
|
|
3323
|
-
if (!document.fullscreenElement) {
|
|
3324
|
-
el.node.requestFullscreen().catch((err) => {
|
|
3325
|
-
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
3326
|
-
});
|
|
3327
|
-
} else {
|
|
3328
|
-
document.exitFullscreen();
|
|
3327
|
+
if (color.indexOf("rgb") === 0) {
|
|
3328
|
+
if (color.indexOf("rgba") === -1)
|
|
3329
|
+
color = `${color}, 1`;
|
|
3330
|
+
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
3329
3331
|
}
|
|
3332
|
+
return [0, 0, 0, 0];
|
|
3330
3333
|
};
|
|
3331
|
-
var
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
});
|
|
3334
|
+
var mixTwoColors = (colorA, colorB, range = 0.5) => {
|
|
3335
|
+
colorA = colorStringToRgbaArray(colorA);
|
|
3336
|
+
colorB = colorStringToRgbaArray(colorB);
|
|
3337
|
+
return mixTwoRgba(colorA, colorB, range);
|
|
3336
3338
|
};
|
|
3337
|
-
var
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
factory = Object.values(factory);
|
|
3341
|
-
return findClosestNumber(val, factory);
|
|
3339
|
+
var hexToRgb = (hex, alpha = 1) => {
|
|
3340
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
3341
|
+
return `rgb(${r},${g},${b})`;
|
|
3342
3342
|
};
|
|
3343
|
-
var
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
const d = new Date(timestamp);
|
|
3347
|
-
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
3348
|
-
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
3349
|
-
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
3350
|
-
return `${da} ${mo}, ${ye}`;
|
|
3343
|
+
var hexToRgbArray = (hex, alpha = 1) => {
|
|
3344
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
3345
|
+
return [r, g, b];
|
|
3351
3346
|
};
|
|
3352
|
-
var
|
|
3353
|
-
|
|
3354
|
-
for (let i = 2; i <= n; i++) {
|
|
3355
|
-
fib[i] = fib[i - 1] + fib[i - 2];
|
|
3356
|
-
}
|
|
3357
|
-
return fib[n];
|
|
3347
|
+
var rgbToHex = (r, g, b) => {
|
|
3348
|
+
return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1);
|
|
3358
3349
|
};
|
|
3359
|
-
var
|
|
3360
|
-
return
|
|
3361
|
-
try {
|
|
3362
|
-
const scriptEle = doc.createElement("script");
|
|
3363
|
-
scriptEle.type = type;
|
|
3364
|
-
scriptEle.async = async;
|
|
3365
|
-
scriptEle.src = FILE_URL;
|
|
3366
|
-
scriptEle.addEventListener("load", (ev) => {
|
|
3367
|
-
resolve({
|
|
3368
|
-
status: true
|
|
3369
|
-
});
|
|
3370
|
-
});
|
|
3371
|
-
scriptEle.addEventListener("error", (ev) => {
|
|
3372
|
-
reject({
|
|
3373
|
-
status: false,
|
|
3374
|
-
message: `Failed to load the script ${FILE_URL}`
|
|
3375
|
-
});
|
|
3376
|
-
});
|
|
3377
|
-
doc.body.appendChild(scriptEle);
|
|
3378
|
-
} catch (error) {
|
|
3379
|
-
reject(error);
|
|
3380
|
-
}
|
|
3381
|
-
});
|
|
3350
|
+
var rgbArrayToHex = ([r, g, b]) => {
|
|
3351
|
+
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
3382
3352
|
};
|
|
3383
|
-
var
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
const linkElem = doc.createElement("link");
|
|
3387
|
-
linkElem.rel = "stylesheet";
|
|
3388
|
-
linkElem.href = FILE_URL;
|
|
3389
|
-
linkElem.addEventListener("load", (ev) => {
|
|
3390
|
-
resolve({
|
|
3391
|
-
status: true
|
|
3392
|
-
});
|
|
3393
|
-
});
|
|
3394
|
-
doc.head.appendChild(linkElem);
|
|
3395
|
-
} catch (error) {
|
|
3396
|
-
reject(error);
|
|
3397
|
-
}
|
|
3398
|
-
});
|
|
3353
|
+
var hexToRgba = (hex, alpha = 1) => {
|
|
3354
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
3355
|
+
return `rgba(${r},${g},${b},${alpha})`;
|
|
3399
3356
|
};
|
|
3400
|
-
var
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
scriptEle.async = async;
|
|
3405
|
-
scriptEle.id = id;
|
|
3406
|
-
scriptEle.innerHTML = body;
|
|
3407
|
-
doc.body.appendChild(scriptEle);
|
|
3408
|
-
} catch (error) {
|
|
3409
|
-
console.warn(error);
|
|
3357
|
+
var mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
3358
|
+
const arr = [];
|
|
3359
|
+
for (let i = 0; i < 3; i++) {
|
|
3360
|
+
arr[i] = ~~(colorA[i] + (colorB[i] - colorA[i]) * range);
|
|
3410
3361
|
}
|
|
3362
|
+
return `rgb(${arr})`;
|
|
3363
|
+
};
|
|
3364
|
+
var changeLightness = (delta, hsl) => {
|
|
3365
|
+
const [hue, saturation, lightness] = hsl;
|
|
3366
|
+
const newLightness = Math.max(
|
|
3367
|
+
0,
|
|
3368
|
+
Math.min(100, lightness + parseFloat(delta))
|
|
3369
|
+
);
|
|
3370
|
+
return [hue, saturation, newLightness];
|
|
3371
|
+
};
|
|
3372
|
+
var rgbToHSL = (r, g, b) => {
|
|
3373
|
+
const a = Math.max(r, g, b);
|
|
3374
|
+
const n = a - Math.min(r, g, b);
|
|
3375
|
+
const f = 1 - Math.abs(a + a - n - 1);
|
|
3376
|
+
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
3377
|
+
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
3411
3378
|
};
|
|
3412
|
-
var
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3379
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
3380
|
+
Math.min(k - 3, 9 - k, 1),
|
|
3381
|
+
-1
|
|
3382
|
+
)) => [f(0), f(8), f(4)];
|
|
3383
|
+
var getColorShade = (col, amt) => {
|
|
3384
|
+
const num = parseInt(col, 16);
|
|
3385
|
+
let r = (num >> 16) + amt;
|
|
3386
|
+
if (r > 255)
|
|
3387
|
+
r = 255;
|
|
3388
|
+
else if (r < 0)
|
|
3389
|
+
r = 0;
|
|
3390
|
+
let b = (num >> 8 & 255) + amt;
|
|
3391
|
+
if (b > 255)
|
|
3392
|
+
b = 255;
|
|
3393
|
+
else if (b < 0)
|
|
3394
|
+
b = 0;
|
|
3395
|
+
let g = (num & 255) + amt;
|
|
3396
|
+
if (g > 255)
|
|
3397
|
+
g = 255;
|
|
3398
|
+
else if (g < 0)
|
|
3399
|
+
g = 0;
|
|
3400
|
+
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
3422
3401
|
};
|
|
3423
|
-
var
|
|
3424
|
-
|
|
3402
|
+
var mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
3403
|
+
const arr = [];
|
|
3404
|
+
for (let i = 0; i < 4; i++) {
|
|
3405
|
+
const round = i === 3 ? (x) => x : Math.round;
|
|
3406
|
+
arr[i] = round(
|
|
3407
|
+
colorA[i] + (colorB[i] - colorA[i]) * range
|
|
3408
|
+
);
|
|
3409
|
+
}
|
|
3410
|
+
return `rgba(${arr})`;
|
|
3425
3411
|
};
|
|
3426
|
-
var
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3412
|
+
var opacify = (color, opacity) => {
|
|
3413
|
+
const arr = colorStringToRgbaArray(color);
|
|
3414
|
+
if (!arr) {
|
|
3415
|
+
if (ENV === "test" || ENV === "development")
|
|
3416
|
+
console.warn(color + " color is not rgba");
|
|
3417
|
+
return;
|
|
3418
|
+
}
|
|
3419
|
+
arr[3] = opacity;
|
|
3420
|
+
return `rgba(${arr})`;
|
|
3430
3421
|
};
|
|
3431
|
-
var
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3422
|
+
var getRgbTone = (rgb, tone) => {
|
|
3423
|
+
if ((0, import_utils.isString)(rgb) && rgb.includes("rgb"))
|
|
3424
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
3425
|
+
if ((0, import_utils.isString)(rgb))
|
|
3426
|
+
rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
3427
|
+
if ((0, import_utils.isNumber)(tone))
|
|
3428
|
+
tone += "";
|
|
3429
|
+
const toHex = rgbArrayToHex(rgb);
|
|
3430
|
+
const abs = tone.slice(0, 1);
|
|
3431
|
+
if (abs === "-" || abs === "+") {
|
|
3432
|
+
const colorShade = getColorShade(toHex, parseFloat(tone));
|
|
3433
|
+
return hexToRgbArray(colorShade).join(", ");
|
|
3434
|
+
} else {
|
|
3435
|
+
const [r, g, b] = rgb;
|
|
3436
|
+
const hsl = rgbToHSL(r, g, b);
|
|
3437
|
+
const [h, s, l] = hsl;
|
|
3438
|
+
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
|
|
3439
|
+
return newRgb;
|
|
3435
3440
|
}
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3441
|
+
};
|
|
3442
|
+
|
|
3443
|
+
// src/utils/theme.js
|
|
3444
|
+
var returnSubThemeOrDefault = (orig, theme) => {
|
|
3445
|
+
if (!orig)
|
|
3440
3446
|
return;
|
|
3441
|
-
|
|
3442
|
-
|
|
3447
|
+
if (orig.themes && orig.themes[theme])
|
|
3448
|
+
return orig.themes[theme];
|
|
3449
|
+
if (orig[theme])
|
|
3450
|
+
return [orig, orig[theme]];
|
|
3451
|
+
return orig;
|
|
3452
|
+
};
|
|
3453
|
+
|
|
3454
|
+
// src/utils/font.js
|
|
3455
|
+
var getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
3456
|
+
if (LIBRARY[key])
|
|
3457
|
+
return LIBRARY[key].value;
|
|
3458
|
+
if (LIBRARY.default)
|
|
3459
|
+
return LIBRARY[LIBRARY.default].value;
|
|
3460
|
+
const hasValue = Object.keys(LIBRARY)[0];
|
|
3461
|
+
return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
|
|
3462
|
+
};
|
|
3463
|
+
var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
|
|
3464
|
+
var setInCustomFontMedia = (str) => `@font-face { ${str} }`;
|
|
3465
|
+
var setCustomFont = (name, url, weight) => `
|
|
3466
|
+
font-family: '${name}';
|
|
3467
|
+
font-style: normal;
|
|
3468
|
+
${weight && `font-weight: ${weight};`}
|
|
3469
|
+
src: url('${url}') format('${getFontFormat(url)}');`;
|
|
3470
|
+
var setCustomFontMedia = (name, url, weight) => `@font-face {
|
|
3471
|
+
${setCustomFont(name, url, weight)}
|
|
3472
|
+
}`;
|
|
3473
|
+
var getFontFaceEach = (name, weights) => {
|
|
3474
|
+
const keys = Object.keys(weights);
|
|
3475
|
+
return keys.map((key) => {
|
|
3476
|
+
const { url, fontWeight } = weights[key];
|
|
3477
|
+
return setCustomFont(name, url, fontWeight);
|
|
3478
|
+
});
|
|
3479
|
+
};
|
|
3480
|
+
var getFontFace = (LIBRARY) => {
|
|
3481
|
+
const keys = Object.keys(LIBRARY);
|
|
3482
|
+
return keys.map((key) => getFontFaceEach(key, LIBRARY[key].value));
|
|
3483
|
+
};
|
|
3484
|
+
var getFontFaceEachString = (name, weights) => {
|
|
3485
|
+
const isArr = weights[0];
|
|
3486
|
+
if (isArr)
|
|
3487
|
+
return getFontFaceEach(name, weights).map(setInCustomFontMedia);
|
|
3488
|
+
return setCustomFontMedia(name, weights.url);
|
|
3443
3489
|
};
|
|
3444
|
-
var
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
if ((0, import_utils2.isString)(val))
|
|
3448
|
-
return val.split(" ");
|
|
3449
|
-
if ((0, import_utils2.isObject)(val))
|
|
3450
|
-
return Object.values(val);
|
|
3451
|
-
if ((0, import_utils2.isNumber)(val))
|
|
3452
|
-
return [val];
|
|
3490
|
+
var getFontFaceString = (LIBRARY) => {
|
|
3491
|
+
const keys = Object.keys(LIBRARY);
|
|
3492
|
+
return keys.map((key) => getFontFaceEachString(key, LIBRARY[key].value));
|
|
3453
3493
|
};
|
|
3454
3494
|
|
|
3495
|
+
// src/utils/sequence.js
|
|
3496
|
+
var import_utils3 = __toESM(require_cjs2(), 1);
|
|
3497
|
+
var import_utils4 = __toESM(require_cjs3(), 1);
|
|
3498
|
+
|
|
3455
3499
|
// src/factory.js
|
|
3456
|
-
var
|
|
3500
|
+
var import_utils2 = __toESM(require_cjs2(), 1);
|
|
3457
3501
|
|
|
3458
3502
|
// src/defaultConfig/index.js
|
|
3459
3503
|
var defaultConfig_exports = {};
|
|
@@ -3660,7 +3704,7 @@ var CONFIG = {
|
|
|
3660
3704
|
CSS_VARS,
|
|
3661
3705
|
...defaultConfig_exports
|
|
3662
3706
|
};
|
|
3663
|
-
var cachedConfig = (0,
|
|
3707
|
+
var cachedConfig = (0, import_utils2.deepClone)(CONFIG);
|
|
3664
3708
|
var FACTORY = {
|
|
3665
3709
|
active: "0",
|
|
3666
3710
|
0: CONFIG
|
|
@@ -3811,9 +3855,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
3811
3855
|
unit = UNIT2.default,
|
|
3812
3856
|
useVariable
|
|
3813
3857
|
} = sequenceProps;
|
|
3814
|
-
if ((0,
|
|
3858
|
+
if ((0, import_utils3.isString)(value) && value.slice(0, 2) === "--")
|
|
3815
3859
|
return `var(${value})`;
|
|
3816
|
-
const prefix = `--${(
|
|
3860
|
+
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
3817
3861
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
3818
3862
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
3819
3863
|
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
@@ -3859,7 +3903,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
3859
3903
|
};
|
|
3860
3904
|
var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
|
|
3861
3905
|
if (typeof value !== "string") {
|
|
3862
|
-
|
|
3906
|
+
const CONFIG2 = getActiveConfig();
|
|
3907
|
+
if (CONFIG2.verbose)
|
|
3908
|
+
console.warn(propertyName, value, "is not a string");
|
|
3863
3909
|
return { [propertyName]: value };
|
|
3864
3910
|
}
|
|
3865
3911
|
if (value === "-" || value === "")
|
|
@@ -3876,11 +3922,11 @@ var findHeadings = (propertyNames) => {
|
|
|
3876
3922
|
};
|
|
3877
3923
|
|
|
3878
3924
|
// src/utils/var.js
|
|
3879
|
-
var
|
|
3925
|
+
var import_utils5 = __toESM(require_cjs2(), 1);
|
|
3880
3926
|
var setVariables = (result, key) => {
|
|
3881
3927
|
const CONFIG2 = getActiveConfig();
|
|
3882
3928
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
3883
|
-
if ((0,
|
|
3929
|
+
if ((0, import_utils5.isObjectLike)(result.value)) {
|
|
3884
3930
|
} else {
|
|
3885
3931
|
CSS_VARS2[result.var] = result.value;
|
|
3886
3932
|
}
|
|
@@ -3955,7 +4001,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
3955
4001
|
};
|
|
3956
4002
|
|
|
3957
4003
|
// src/utils/sprite.js
|
|
3958
|
-
var
|
|
4004
|
+
var import_utils6 = __toESM(require_cjs2(), 1);
|
|
3959
4005
|
var generateSprite = (icons) => {
|
|
3960
4006
|
const CONFIG2 = getActiveConfig();
|
|
3961
4007
|
let sprite = "";
|
|
@@ -3969,7 +4015,7 @@ var generateSprite = (icons) => {
|
|
|
3969
4015
|
return sprite;
|
|
3970
4016
|
};
|
|
3971
4017
|
var parseRootAttributes = (htmlString) => {
|
|
3972
|
-
if (!(0,
|
|
4018
|
+
if (!(0, import_utils6.isString)(htmlString)) {
|
|
3973
4019
|
return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
|
|
3974
4020
|
}
|
|
3975
4021
|
const match = htmlString.match(/<svg\s+(.*?)>/);
|
|
@@ -3989,7 +4035,7 @@ var replaceIdsAndUrls = (code, key) => {
|
|
|
3989
4035
|
const urlRegex = /url\(#([^)]*)\)/g;
|
|
3990
4036
|
const matches = code.match(/id="([^"]*)"/g);
|
|
3991
4037
|
let replacedCode = code;
|
|
3992
|
-
if ((0,
|
|
4038
|
+
if ((0, import_utils6.isArray)(matches)) {
|
|
3993
4039
|
matches.forEach(() => {
|
|
3994
4040
|
const randomKey = Math.floor(Math.random() * 1e5);
|
|
3995
4041
|
replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
|