@symbo.ls/scratch 2.11.504 → 2.11.512
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 +125 -1914
- package/dist/cjs/index.js +276 -3911
- package/dist/cjs/set.js +251 -3894
- package/dist/cjs/system/color.js +177 -3853
- package/dist/cjs/system/document.js +164 -3834
- package/dist/cjs/system/font.js +160 -3836
- package/dist/cjs/system/index.js +258 -3900
- package/dist/cjs/system/reset.js +198 -3845
- package/dist/cjs/system/shadow.js +178 -3858
- package/dist/cjs/system/spacing.js +334 -4001
- package/dist/cjs/system/svg.js +158 -3837
- package/dist/cjs/system/theme.js +182 -3861
- package/dist/cjs/system/timing.js +317 -3996
- package/dist/cjs/system/typography.js +167 -3834
- package/dist/cjs/transforms/index.js +200 -3879
- package/dist/cjs/utils/color.js +27 -1915
- package/dist/cjs/utils/index.js +167 -3841
- package/dist/cjs/utils/sequence.js +142 -3814
- package/dist/cjs/utils/sprite.js +109 -1912
- package/dist/cjs/utils/var.js +139 -3815
- package/package.json +3 -3
package/dist/cjs/utils/var.js
CHANGED
|
@@ -30,3812 +30,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// ../../node_modules/@domql/utils/dist/cjs/key.js
|
|
34
|
-
var require_key = __commonJS({
|
|
35
|
-
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
|
|
36
|
-
"use strict";
|
|
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
|
-
for (var name in all)
|
|
43
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
44
|
-
};
|
|
45
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
46
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
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
|
-
}
|
|
51
|
-
return to;
|
|
52
|
-
};
|
|
53
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
54
|
-
var key_exports = {};
|
|
55
|
-
__export2(key_exports, {
|
|
56
|
-
createSnapshotId: () => createSnapshotId,
|
|
57
|
-
generateKey: () => generateKey
|
|
58
|
-
});
|
|
59
|
-
module2.exports = __toCommonJS2(key_exports);
|
|
60
|
-
var generateKey = /* @__PURE__ */ function() {
|
|
61
|
-
let index = 0;
|
|
62
|
-
function newId() {
|
|
63
|
-
index++;
|
|
64
|
-
return index;
|
|
65
|
-
}
|
|
66
|
-
return newId;
|
|
67
|
-
}();
|
|
68
|
-
var createSnapshotId = generateKey;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
// ../../node_modules/@domql/utils/dist/cjs/env.js
|
|
73
|
-
var require_env = __commonJS({
|
|
74
|
-
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
|
|
75
|
-
"use strict";
|
|
76
|
-
var __defProp2 = Object.defineProperty;
|
|
77
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
78
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
79
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
80
|
-
var __export2 = (target, all) => {
|
|
81
|
-
for (var name in all)
|
|
82
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
83
|
-
};
|
|
84
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
85
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
86
|
-
for (let key of __getOwnPropNames2(from))
|
|
87
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
88
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
89
|
-
}
|
|
90
|
-
return to;
|
|
91
|
-
};
|
|
92
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
93
|
-
var env_exports = {};
|
|
94
|
-
__export2(env_exports, {
|
|
95
|
-
NODE_ENV: () => NODE_ENV,
|
|
96
|
-
getNev: () => getNev,
|
|
97
|
-
isDevelopment: () => isDevelopment,
|
|
98
|
-
isProduction: () => isProduction,
|
|
99
|
-
isTest: () => isTest
|
|
100
|
-
});
|
|
101
|
-
module2.exports = __toCommonJS2(env_exports);
|
|
102
|
-
var NODE_ENV = "development";
|
|
103
|
-
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
104
|
-
var isTest = (env = NODE_ENV) => env === "test";
|
|
105
|
-
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
106
|
-
var getNev = (key, env = NODE_ENV) => env[key];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// ../../node_modules/@domql/utils/dist/cjs/globals.js
|
|
111
|
-
var require_globals = __commonJS({
|
|
112
|
-
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
|
|
113
|
-
"use strict";
|
|
114
|
-
var __defProp2 = Object.defineProperty;
|
|
115
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
116
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
117
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
118
|
-
var __export2 = (target, all) => {
|
|
119
|
-
for (var name in all)
|
|
120
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
121
|
-
};
|
|
122
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
123
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
124
|
-
for (let key of __getOwnPropNames2(from))
|
|
125
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
126
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
127
|
-
}
|
|
128
|
-
return to;
|
|
129
|
-
};
|
|
130
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
131
|
-
var globals_exports = {};
|
|
132
|
-
__export2(globals_exports, {
|
|
133
|
-
document: () => document2,
|
|
134
|
-
global: () => global,
|
|
135
|
-
self: () => self,
|
|
136
|
-
window: () => window2
|
|
137
|
-
});
|
|
138
|
-
module2.exports = __toCommonJS2(globals_exports);
|
|
139
|
-
var global = globalThis;
|
|
140
|
-
var self = globalThis;
|
|
141
|
-
var window2 = globalThis;
|
|
142
|
-
var document2 = window2.document;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// ../../node_modules/@domql/utils/dist/cjs/node.js
|
|
147
|
-
var require_node = __commonJS({
|
|
148
|
-
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
|
|
149
|
-
"use strict";
|
|
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
|
-
for (var name in all)
|
|
156
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
157
|
-
};
|
|
158
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
159
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
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
|
-
}
|
|
164
|
-
return to;
|
|
165
|
-
};
|
|
166
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
167
|
-
var node_exports = {};
|
|
168
|
-
__export2(node_exports, {
|
|
169
|
-
isDOMNode: () => isDOMNode,
|
|
170
|
-
isHtmlElement: () => isHtmlElement,
|
|
171
|
-
isNode: () => isNode
|
|
172
|
-
});
|
|
173
|
-
module2.exports = __toCommonJS2(node_exports);
|
|
174
|
-
var import_globals = require_globals();
|
|
175
|
-
var isNode = (obj) => {
|
|
176
|
-
return (typeof Node === "object" ? obj instanceof import_globals.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
177
|
-
};
|
|
178
|
-
var isHtmlElement = (obj) => {
|
|
179
|
-
return (typeof HTMLElement === "object" ? obj instanceof import_globals.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
180
|
-
};
|
|
181
|
-
var isDOMNode = (obj) => {
|
|
182
|
-
return typeof import_globals.window !== "undefined" && (obj instanceof import_globals.window.Node || obj instanceof import_globals.window.Window || obj === import_globals.window || obj === document);
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
// ../../node_modules/@domql/utils/dist/cjs/types.js
|
|
188
|
-
var require_types = __commonJS({
|
|
189
|
-
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
|
|
190
|
-
"use strict";
|
|
191
|
-
var __defProp2 = Object.defineProperty;
|
|
192
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
193
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
194
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
195
|
-
var __export2 = (target, all) => {
|
|
196
|
-
for (var name in all)
|
|
197
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
198
|
-
};
|
|
199
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
200
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
201
|
-
for (let key of __getOwnPropNames2(from))
|
|
202
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
203
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
204
|
-
}
|
|
205
|
-
return to;
|
|
206
|
-
};
|
|
207
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
208
|
-
var types_exports = {};
|
|
209
|
-
__export2(types_exports, {
|
|
210
|
-
TYPES: () => TYPES,
|
|
211
|
-
is: () => is,
|
|
212
|
-
isArray: () => isArray,
|
|
213
|
-
isBoolean: () => isBoolean,
|
|
214
|
-
isDate: () => isDate,
|
|
215
|
-
isDefined: () => isDefined2,
|
|
216
|
-
isFunction: () => isFunction,
|
|
217
|
-
isNot: () => isNot,
|
|
218
|
-
isNull: () => isNull,
|
|
219
|
-
isNumber: () => isNumber,
|
|
220
|
-
isObject: () => isObject2,
|
|
221
|
-
isObjectLike: () => isObjectLike2,
|
|
222
|
-
isString: () => isString2,
|
|
223
|
-
isUndefined: () => isUndefined
|
|
224
|
-
});
|
|
225
|
-
module2.exports = __toCommonJS2(types_exports);
|
|
226
|
-
var import_node = require_node();
|
|
227
|
-
var isObject2 = (arg) => {
|
|
228
|
-
if (arg === null)
|
|
229
|
-
return false;
|
|
230
|
-
return typeof arg === "object" && arg.constructor === Object;
|
|
231
|
-
};
|
|
232
|
-
var isString2 = (arg) => typeof arg === "string";
|
|
233
|
-
var isNumber = (arg) => typeof arg === "number";
|
|
234
|
-
var isFunction = (arg) => typeof arg === "function";
|
|
235
|
-
var isBoolean = (arg) => arg === true || arg === false;
|
|
236
|
-
var isNull = (arg) => arg === null;
|
|
237
|
-
var isArray = (arg) => Array.isArray(arg);
|
|
238
|
-
var isDate = (d) => d instanceof Date;
|
|
239
|
-
var isObjectLike2 = (arg) => {
|
|
240
|
-
if (arg === null)
|
|
241
|
-
return false;
|
|
242
|
-
return typeof arg === "object";
|
|
243
|
-
};
|
|
244
|
-
var isDefined2 = (arg) => {
|
|
245
|
-
return isObject2(arg) || isObjectLike2(arg) || isString2(arg) || isNumber(arg) || isFunction(arg) || isArray(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
246
|
-
};
|
|
247
|
-
var isUndefined = (arg) => {
|
|
248
|
-
return arg === void 0;
|
|
249
|
-
};
|
|
250
|
-
var TYPES = {
|
|
251
|
-
boolean: isBoolean,
|
|
252
|
-
array: isArray,
|
|
253
|
-
object: isObject2,
|
|
254
|
-
string: isString2,
|
|
255
|
-
date: isDate,
|
|
256
|
-
number: isNumber,
|
|
257
|
-
null: isNull,
|
|
258
|
-
function: isFunction,
|
|
259
|
-
objectLike: isObjectLike2,
|
|
260
|
-
node: import_node.isNode,
|
|
261
|
-
htmlElement: import_node.isHtmlElement,
|
|
262
|
-
defined: isDefined2
|
|
263
|
-
};
|
|
264
|
-
var is = (arg) => {
|
|
265
|
-
return (...args) => {
|
|
266
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
267
|
-
};
|
|
268
|
-
};
|
|
269
|
-
var isNot = (arg) => {
|
|
270
|
-
return (...args) => {
|
|
271
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
// ../../node_modules/@domql/utils/dist/cjs/array.js
|
|
278
|
-
var require_array = __commonJS({
|
|
279
|
-
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
|
|
280
|
-
"use strict";
|
|
281
|
-
var __defProp2 = Object.defineProperty;
|
|
282
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
283
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
284
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
285
|
-
var __export2 = (target, all) => {
|
|
286
|
-
for (var name in all)
|
|
287
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
288
|
-
};
|
|
289
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
290
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
291
|
-
for (let key of __getOwnPropNames2(from))
|
|
292
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
293
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
294
|
-
}
|
|
295
|
-
return to;
|
|
296
|
-
};
|
|
297
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
298
|
-
var array_exports = {};
|
|
299
|
-
__export2(array_exports, {
|
|
300
|
-
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
301
|
-
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
302
|
-
arraysEqual: () => arraysEqual,
|
|
303
|
-
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
304
|
-
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
305
|
-
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
306
|
-
filterArrays: () => filterArrays,
|
|
307
|
-
filterArraysFast: () => filterArraysFast,
|
|
308
|
-
getFrequencyInArray: () => getFrequencyInArray,
|
|
309
|
-
joinArrays: () => joinArrays,
|
|
310
|
-
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
311
|
-
mergeArray: () => mergeArray,
|
|
312
|
-
removeFromArray: () => removeFromArray,
|
|
313
|
-
removeValueFromArray: () => removeValueFromArray,
|
|
314
|
-
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
315
|
-
reorderArrayByValues: () => reorderArrayByValues,
|
|
316
|
-
swapItemsInArray: () => swapItemsInArray
|
|
317
|
-
});
|
|
318
|
-
module2.exports = __toCommonJS2(array_exports);
|
|
319
|
-
var import_object = require_object();
|
|
320
|
-
var import_types = require_types();
|
|
321
|
-
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
322
|
-
return arr2.every((val) => arr1.includes(val));
|
|
323
|
-
};
|
|
324
|
-
var getFrequencyInArray = (arr, value) => {
|
|
325
|
-
return arr.reduce((count, currentValue) => {
|
|
326
|
-
return currentValue === value ? count + 1 : count;
|
|
327
|
-
}, 0);
|
|
328
|
-
};
|
|
329
|
-
var removeFromArray = (arr, index) => {
|
|
330
|
-
if ((0, import_types.isString)(index))
|
|
331
|
-
index = parseInt(index);
|
|
332
|
-
if ((0, import_types.isNumber)(index)) {
|
|
333
|
-
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
334
|
-
throw new Error("Invalid index");
|
|
335
|
-
}
|
|
336
|
-
arr.splice(index, 1);
|
|
337
|
-
} else if ((0, import_types.isArray)(index)) {
|
|
338
|
-
index.forEach((idx) => removeFromArray(arr, idx));
|
|
339
|
-
} else {
|
|
340
|
-
throw new Error("Invalid index");
|
|
341
|
-
}
|
|
342
|
-
return arr;
|
|
343
|
-
};
|
|
344
|
-
var swapItemsInArray = (arr, i, j) => {
|
|
345
|
-
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
346
|
-
};
|
|
347
|
-
var joinArrays = (...arrays) => {
|
|
348
|
-
return [].concat(...arrays);
|
|
349
|
-
};
|
|
350
|
-
var mergeArray = (arr, exclude = []) => {
|
|
351
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
352
|
-
};
|
|
353
|
-
var mergeAndCloneIfArray = (obj) => {
|
|
354
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
355
|
-
};
|
|
356
|
-
var cutArrayBeforeValue = (arr, value) => {
|
|
357
|
-
const index = arr.indexOf(value);
|
|
358
|
-
if (index !== -1) {
|
|
359
|
-
return arr.slice(0, index);
|
|
360
|
-
}
|
|
361
|
-
return arr;
|
|
362
|
-
};
|
|
363
|
-
var cutArrayAfterValue = (arr, value) => {
|
|
364
|
-
if (!(0, import_types.isArray)(arr))
|
|
365
|
-
return;
|
|
366
|
-
const index = arr.indexOf(value);
|
|
367
|
-
if (index !== -1) {
|
|
368
|
-
return arr.slice(index + 1);
|
|
369
|
-
}
|
|
370
|
-
return arr;
|
|
371
|
-
};
|
|
372
|
-
var removeValueFromArray = (arr, value) => {
|
|
373
|
-
const index = arr.indexOf(value);
|
|
374
|
-
if (index > -1) {
|
|
375
|
-
const newArray = [...arr];
|
|
376
|
-
newArray.splice(index, 1);
|
|
377
|
-
return newArray;
|
|
378
|
-
}
|
|
379
|
-
return arr;
|
|
380
|
-
};
|
|
381
|
-
var removeValueFromArrayAll = (arr, value) => {
|
|
382
|
-
return arr.filter((item) => item !== value);
|
|
383
|
-
};
|
|
384
|
-
var addItemAfterEveryElement = (array, item) => {
|
|
385
|
-
const result = [];
|
|
386
|
-
for (let i = 0; i < array.length; i++) {
|
|
387
|
-
result.push(array[i]);
|
|
388
|
-
if (i < array.length - 1) {
|
|
389
|
-
result.push(item);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return result;
|
|
393
|
-
};
|
|
394
|
-
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
395
|
-
const newArray = [...array];
|
|
396
|
-
const indexToMove = newArray.indexOf(valueToMove);
|
|
397
|
-
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
398
|
-
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
399
|
-
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
400
|
-
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
401
|
-
newArray.splice(insertIndex, 0, removedItem);
|
|
402
|
-
}
|
|
403
|
-
return newArray;
|
|
404
|
-
};
|
|
405
|
-
var arraysEqual = (arr1, arr2) => {
|
|
406
|
-
if (arr1.length !== arr2.length) {
|
|
407
|
-
return false;
|
|
408
|
-
}
|
|
409
|
-
for (let i = 0; i < arr1.length; i++) {
|
|
410
|
-
if (arr1[i] !== arr2[i]) {
|
|
411
|
-
return false;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
return true;
|
|
415
|
-
};
|
|
416
|
-
var filterArrays = (sourceArr, excludeArr) => {
|
|
417
|
-
return sourceArr.filter((item) => !excludeArr.includes(item));
|
|
418
|
-
};
|
|
419
|
-
var filterArraysFast = (sourceArr, excludeArr) => {
|
|
420
|
-
const excludeSet = new Set(excludeArr);
|
|
421
|
-
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
422
|
-
};
|
|
423
|
-
var checkIfStringIsInArray = (string, arr) => {
|
|
424
|
-
if (!string)
|
|
425
|
-
return;
|
|
426
|
-
return arr.filter((v) => string.includes(v)).length;
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
// ../../node_modules/@domql/utils/dist/cjs/string.js
|
|
432
|
-
var require_string = __commonJS({
|
|
433
|
-
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
|
|
434
|
-
"use strict";
|
|
435
|
-
var __defProp2 = Object.defineProperty;
|
|
436
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
437
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
438
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
439
|
-
var __export2 = (target, all) => {
|
|
440
|
-
for (var name in all)
|
|
441
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
442
|
-
};
|
|
443
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
444
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
445
|
-
for (let key of __getOwnPropNames2(from))
|
|
446
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
447
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
448
|
-
}
|
|
449
|
-
return to;
|
|
450
|
-
};
|
|
451
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
452
|
-
var string_exports = {};
|
|
453
|
-
__export2(string_exports, {
|
|
454
|
-
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
455
|
-
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
456
|
-
decodeNewlines: () => decodeNewlines,
|
|
457
|
-
encodeNewlines: () => encodeNewlines,
|
|
458
|
-
findKeyPosition: () => findKeyPosition,
|
|
459
|
-
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
460
|
-
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
461
|
-
replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
|
|
462
|
-
stringIncludesAny: () => stringIncludesAny,
|
|
463
|
-
trimStringFromSymbols: () => trimStringFromSymbols
|
|
464
|
-
});
|
|
465
|
-
module2.exports = __toCommonJS2(string_exports);
|
|
466
|
-
var stringIncludesAny = (str, characters) => {
|
|
467
|
-
for (const char of characters) {
|
|
468
|
-
if (str.includes(char)) {
|
|
469
|
-
return true;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
return false;
|
|
473
|
-
};
|
|
474
|
-
var trimStringFromSymbols = (str, characters) => {
|
|
475
|
-
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
476
|
-
return str.replace(pattern, "");
|
|
477
|
-
};
|
|
478
|
-
var brackRegex = {
|
|
479
|
-
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
480
|
-
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
481
|
-
};
|
|
482
|
-
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
483
|
-
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
484
|
-
return str;
|
|
485
|
-
const reg = brackRegex[options.bracketsLength || 2];
|
|
486
|
-
const obj = forcedState || this.state || {};
|
|
487
|
-
return str.replace(reg, (_, parentPath, variable) => {
|
|
488
|
-
if (parentPath) {
|
|
489
|
-
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
490
|
-
let parentState = obj;
|
|
491
|
-
for (let i = 0; i < parentLevels; i++) {
|
|
492
|
-
parentState = parentState.parent;
|
|
493
|
-
if (!parentState) {
|
|
494
|
-
return "";
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
const value = parentState[variable.trim()];
|
|
498
|
-
return value !== void 0 ? `${value}` : "";
|
|
499
|
-
} else {
|
|
500
|
-
const value = obj[variable.trim()];
|
|
501
|
-
return value !== void 0 ? `${value}` : "";
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
var lowercaseFirstLetter = (inputString) => {
|
|
506
|
-
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
507
|
-
};
|
|
508
|
-
var findKeyPosition = (str, key) => {
|
|
509
|
-
const lines = str.split("\n");
|
|
510
|
-
let startLineNumber = -1;
|
|
511
|
-
let endLineNumber = -1;
|
|
512
|
-
let startColumn = -1;
|
|
513
|
-
let endColumn = -1;
|
|
514
|
-
const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
|
|
515
|
-
let braceCount = 0;
|
|
516
|
-
let foundKey = false;
|
|
517
|
-
for (let i = 0; i < lines.length; i++) {
|
|
518
|
-
if (keyPattern.test(lines[i]) && !foundKey) {
|
|
519
|
-
foundKey = true;
|
|
520
|
-
startLineNumber = i + 1;
|
|
521
|
-
startColumn = lines[i].indexOf(key) + 1;
|
|
522
|
-
if (lines[i].includes("{}")) {
|
|
523
|
-
endLineNumber = startLineNumber;
|
|
524
|
-
endColumn = lines[i].indexOf("{}") + 3;
|
|
525
|
-
break;
|
|
526
|
-
}
|
|
527
|
-
const line = lines[i].slice(startColumn + key.length);
|
|
528
|
-
if (line.includes("{") || line.includes("[")) {
|
|
529
|
-
braceCount = 1;
|
|
530
|
-
} else {
|
|
531
|
-
endLineNumber = i + 1;
|
|
532
|
-
endColumn = lines[i].length + 1;
|
|
533
|
-
break;
|
|
534
|
-
}
|
|
535
|
-
} else if (foundKey) {
|
|
536
|
-
braceCount += (lines[i].match(/{/g) || []).length;
|
|
537
|
-
braceCount += (lines[i].match(/\[/g) || []).length;
|
|
538
|
-
braceCount -= (lines[i].match(/}/g) || []).length;
|
|
539
|
-
braceCount -= (lines[i].match(/]/g) || []).length;
|
|
540
|
-
if (braceCount === 0) {
|
|
541
|
-
endLineNumber = i + 1;
|
|
542
|
-
endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
|
|
543
|
-
break;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
return {
|
|
548
|
-
startColumn,
|
|
549
|
-
endColumn,
|
|
550
|
-
startLineNumber,
|
|
551
|
-
endLineNumber
|
|
552
|
-
};
|
|
553
|
-
};
|
|
554
|
-
var replaceOctalEscapeSequences = (str) => {
|
|
555
|
-
const octalRegex = /\\([0-7]{1,3})/g;
|
|
556
|
-
return str.replace(octalRegex, (match, p1) => {
|
|
557
|
-
const octalValue = parseInt(p1, 8);
|
|
558
|
-
const char = String.fromCharCode(octalValue);
|
|
559
|
-
return char;
|
|
560
|
-
});
|
|
561
|
-
};
|
|
562
|
-
var encodeNewlines = (str) => {
|
|
563
|
-
return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
|
|
564
|
-
};
|
|
565
|
-
var decodeNewlines = (encodedStr) => {
|
|
566
|
-
return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
|
|
567
|
-
};
|
|
568
|
-
var customEncodeURIComponent = (str) => {
|
|
569
|
-
return str.split("").map((char) => {
|
|
570
|
-
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
571
|
-
return "%" + char.charCodeAt(0).toString(16).toUpperCase();
|
|
572
|
-
}
|
|
573
|
-
return char;
|
|
574
|
-
}).join("");
|
|
575
|
-
};
|
|
576
|
-
var customDecodeURIComponent = (encodedStr) => {
|
|
577
|
-
return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
|
|
578
|
-
};
|
|
579
|
-
}
|
|
580
|
-
});
|
|
581
|
-
|
|
582
|
-
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
583
|
-
var require_object = __commonJS({
|
|
584
|
-
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
585
|
-
"use strict";
|
|
586
|
-
var __defProp2 = Object.defineProperty;
|
|
587
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
588
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
589
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
590
|
-
var __export2 = (target, all) => {
|
|
591
|
-
for (var name in all)
|
|
592
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
593
|
-
};
|
|
594
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
595
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
596
|
-
for (let key of __getOwnPropNames2(from))
|
|
597
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
598
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
599
|
-
}
|
|
600
|
-
return to;
|
|
601
|
-
};
|
|
602
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
603
|
-
var object_exports = {};
|
|
604
|
-
__export2(object_exports, {
|
|
605
|
-
clone: () => clone,
|
|
606
|
-
createNestedObject: () => createNestedObject,
|
|
607
|
-
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
608
|
-
deepClone: () => deepClone2,
|
|
609
|
-
deepContains: () => deepContains,
|
|
610
|
-
deepDestringify: () => deepDestringify,
|
|
611
|
-
deepDiff: () => deepDiff,
|
|
612
|
-
deepMerge: () => deepMerge2,
|
|
613
|
-
deepStringify: () => deepStringify,
|
|
614
|
-
deepStringifyWithMaxDepth: () => deepStringifyWithMaxDepth,
|
|
615
|
-
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
616
|
-
detectInfiniteLoop: () => detectInfiniteLoop,
|
|
617
|
-
diff: () => diff,
|
|
618
|
-
diffArrays: () => diffArrays,
|
|
619
|
-
diffObjects: () => diffObjects,
|
|
620
|
-
excludeKeysFromObject: () => excludeKeysFromObject,
|
|
621
|
-
exec: () => exec,
|
|
622
|
-
flattenRecursive: () => flattenRecursive,
|
|
623
|
-
hasOwnProperty: () => hasOwnProperty,
|
|
624
|
-
isCyclic: () => isCyclic,
|
|
625
|
-
isEmpty: () => isEmpty,
|
|
626
|
-
isEmptyObject: () => isEmptyObject,
|
|
627
|
-
isEqualDeep: () => isEqualDeep,
|
|
628
|
-
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
629
|
-
map: () => map,
|
|
630
|
-
merge: () => merge,
|
|
631
|
-
mergeArrayExclude: () => mergeArrayExclude,
|
|
632
|
-
mergeIfExisted: () => mergeIfExisted,
|
|
633
|
-
objectToString: () => objectToString,
|
|
634
|
-
overwrite: () => overwrite,
|
|
635
|
-
overwriteDeep: () => overwriteDeep,
|
|
636
|
-
overwriteShallow: () => overwriteShallow,
|
|
637
|
-
removeFromObject: () => removeFromObject,
|
|
638
|
-
removeNestedKeyByPath: () => removeNestedKeyByPath,
|
|
639
|
-
stringToObject: () => stringToObject
|
|
640
|
-
});
|
|
641
|
-
module2.exports = __toCommonJS2(object_exports);
|
|
642
|
-
var import_globals = require_globals();
|
|
643
|
-
var import_types = require_types();
|
|
644
|
-
var import_array = require_array();
|
|
645
|
-
var import_string = require_string();
|
|
646
|
-
var import_node = require_node();
|
|
647
|
-
var ENV = "development";
|
|
648
|
-
var exec = (param, element, state, context) => {
|
|
649
|
-
if ((0, import_types.isFunction)(param)) {
|
|
650
|
-
return param.call(
|
|
651
|
-
element,
|
|
652
|
-
element,
|
|
653
|
-
state || element.state,
|
|
654
|
-
context || element.context
|
|
655
|
-
);
|
|
656
|
-
}
|
|
657
|
-
return param;
|
|
658
|
-
};
|
|
659
|
-
var map = (obj, extention, element) => {
|
|
660
|
-
for (const e in extention) {
|
|
661
|
-
obj[e] = exec(extention[e], element);
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
var merge = (element, obj, excludeFrom = []) => {
|
|
665
|
-
for (const e in obj) {
|
|
666
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
667
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
668
|
-
continue;
|
|
669
|
-
const elementProp = element[e];
|
|
670
|
-
const objProp = obj[e];
|
|
671
|
-
if (elementProp === void 0) {
|
|
672
|
-
element[e] = objProp;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
return element;
|
|
676
|
-
};
|
|
677
|
-
var deepMerge2 = (element, extend, excludeFrom = []) => {
|
|
678
|
-
for (const e in extend) {
|
|
679
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
680
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
681
|
-
continue;
|
|
682
|
-
const elementProp = element[e];
|
|
683
|
-
const extendProp = extend[e];
|
|
684
|
-
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
685
|
-
deepMerge2(elementProp, extendProp, excludeFrom);
|
|
686
|
-
} else if (elementProp === void 0) {
|
|
687
|
-
element[e] = extendProp;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
return element;
|
|
691
|
-
};
|
|
692
|
-
var clone = (obj, excludeFrom = []) => {
|
|
693
|
-
const o = {};
|
|
694
|
-
for (const prop in obj) {
|
|
695
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
696
|
-
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
697
|
-
continue;
|
|
698
|
-
o[prop] = obj[prop];
|
|
699
|
-
}
|
|
700
|
-
return o;
|
|
701
|
-
};
|
|
702
|
-
var mergeArrayExclude = (arr, exclude = []) => {
|
|
703
|
-
return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
|
|
704
|
-
};
|
|
705
|
-
var deepClone2 = (obj, options = {}) => {
|
|
706
|
-
const {
|
|
707
|
-
exclude = [],
|
|
708
|
-
cleanUndefined = false,
|
|
709
|
-
cleanNull = false,
|
|
710
|
-
window: targetWindow,
|
|
711
|
-
visited = /* @__PURE__ */ new WeakMap(),
|
|
712
|
-
handleExtend = false
|
|
713
|
-
} = options;
|
|
714
|
-
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
715
|
-
return obj;
|
|
716
|
-
}
|
|
717
|
-
if (visited.has(obj)) {
|
|
718
|
-
return visited.get(obj);
|
|
719
|
-
}
|
|
720
|
-
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
721
|
-
visited.set(obj, clone2);
|
|
722
|
-
for (const key in obj) {
|
|
723
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
724
|
-
continue;
|
|
725
|
-
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
726
|
-
continue;
|
|
727
|
-
const value = obj[key];
|
|
728
|
-
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
729
|
-
continue;
|
|
730
|
-
if ((0, import_node.isDOMNode)(value)) {
|
|
731
|
-
clone2[key] = value;
|
|
732
|
-
continue;
|
|
733
|
-
}
|
|
734
|
-
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
735
|
-
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
736
|
-
continue;
|
|
737
|
-
}
|
|
738
|
-
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
739
|
-
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
740
|
-
continue;
|
|
741
|
-
}
|
|
742
|
-
if ((0, import_types.isObjectLike)(value)) {
|
|
743
|
-
clone2[key] = deepClone2(value, {
|
|
744
|
-
...options,
|
|
745
|
-
visited
|
|
746
|
-
});
|
|
747
|
-
} else {
|
|
748
|
-
clone2[key] = value;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
return clone2;
|
|
752
|
-
};
|
|
753
|
-
var deepStringify = (obj, stringified = {}) => {
|
|
754
|
-
var _a, _b;
|
|
755
|
-
if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
|
|
756
|
-
(obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
|
|
757
|
-
obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
|
|
758
|
-
}
|
|
759
|
-
for (const prop in obj) {
|
|
760
|
-
const objProp = obj[prop];
|
|
761
|
-
if ((0, import_types.isFunction)(objProp)) {
|
|
762
|
-
stringified[prop] = objProp.toString();
|
|
763
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
764
|
-
stringified[prop] = {};
|
|
765
|
-
deepStringify(objProp, stringified[prop]);
|
|
766
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
767
|
-
stringified[prop] = [];
|
|
768
|
-
objProp.forEach((v, i) => {
|
|
769
|
-
if ((0, import_types.isObject)(v)) {
|
|
770
|
-
stringified[prop][i] = {};
|
|
771
|
-
deepStringify(v, stringified[prop][i]);
|
|
772
|
-
} else if ((0, import_types.isFunction)(v)) {
|
|
773
|
-
stringified[prop][i] = v.toString();
|
|
774
|
-
} else {
|
|
775
|
-
stringified[prop][i] = v;
|
|
776
|
-
}
|
|
777
|
-
});
|
|
778
|
-
} else {
|
|
779
|
-
stringified[prop] = objProp;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return stringified;
|
|
783
|
-
};
|
|
784
|
-
var MAX_DEPTH = 100;
|
|
785
|
-
var deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path = "") => {
|
|
786
|
-
if (depth > MAX_DEPTH) {
|
|
787
|
-
console.warn(`Maximum depth exceeded at path: ${path}. Possible circular reference.`);
|
|
788
|
-
return "[MAX_DEPTH_EXCEEDED]";
|
|
789
|
-
}
|
|
790
|
-
for (const prop in obj) {
|
|
791
|
-
const currentPath = path ? `${path}.${prop}` : prop;
|
|
792
|
-
const objProp = obj[prop];
|
|
793
|
-
if ((0, import_types.isFunction)(objProp)) {
|
|
794
|
-
stringified[prop] = objProp.toString();
|
|
795
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
796
|
-
stringified[prop] = {};
|
|
797
|
-
deepStringifyWithMaxDepth(objProp, stringified[prop], depth + 1, currentPath);
|
|
798
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
799
|
-
stringified[prop] = [];
|
|
800
|
-
objProp.forEach((v, i) => {
|
|
801
|
-
const itemPath = `${currentPath}[${i}]`;
|
|
802
|
-
if ((0, import_types.isObject)(v)) {
|
|
803
|
-
stringified[prop][i] = {};
|
|
804
|
-
deepStringifyWithMaxDepth(v, stringified[prop][i], depth + 1, itemPath);
|
|
805
|
-
} else if ((0, import_types.isFunction)(v)) {
|
|
806
|
-
stringified[prop][i] = v.toString();
|
|
807
|
-
} else {
|
|
808
|
-
stringified[prop][i] = v;
|
|
809
|
-
}
|
|
810
|
-
});
|
|
811
|
-
} else {
|
|
812
|
-
stringified[prop] = objProp;
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
return stringified;
|
|
816
|
-
};
|
|
817
|
-
var objectToString = (obj = {}, indent = 0) => {
|
|
818
|
-
if (obj === null || typeof obj !== "object") {
|
|
819
|
-
return String(obj);
|
|
820
|
-
}
|
|
821
|
-
if (Object.keys(obj).length === 0) {
|
|
822
|
-
return "{}";
|
|
823
|
-
}
|
|
824
|
-
const spaces = " ".repeat(indent);
|
|
825
|
-
let str = "{\n";
|
|
826
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
827
|
-
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
828
|
-
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
829
|
-
str += `${spaces} ${stringedKey}: `;
|
|
830
|
-
if ((0, import_types.isArray)(value)) {
|
|
831
|
-
str += "[\n";
|
|
832
|
-
for (const element of value) {
|
|
833
|
-
if ((0, import_types.isObjectLike)(element) && element !== null) {
|
|
834
|
-
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
835
|
-
`;
|
|
836
|
-
} else if ((0, import_types.isString)(element)) {
|
|
837
|
-
str += `${spaces} '${element}',
|
|
838
|
-
`;
|
|
839
|
-
} else {
|
|
840
|
-
str += `${spaces} ${element},
|
|
841
|
-
`;
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
str += `${spaces} ]`;
|
|
845
|
-
} else if ((0, import_types.isObjectLike)(value)) {
|
|
846
|
-
str += objectToString(value, indent + 1);
|
|
847
|
-
} else if ((0, import_types.isString)(value)) {
|
|
848
|
-
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
849
|
-
} else {
|
|
850
|
-
str += value;
|
|
851
|
-
}
|
|
852
|
-
str += ",\n";
|
|
853
|
-
}
|
|
854
|
-
str += `${spaces}}`;
|
|
855
|
-
return str;
|
|
856
|
-
};
|
|
857
|
-
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
858
|
-
for (const prop in obj) {
|
|
859
|
-
const objProp = obj[prop];
|
|
860
|
-
if ((0, import_types.isFunction)(objProp))
|
|
861
|
-
continue;
|
|
862
|
-
else if ((0, import_types.isObject)(objProp)) {
|
|
863
|
-
detached[prop] = {};
|
|
864
|
-
deepStringify(objProp, detached[prop]);
|
|
865
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
866
|
-
detached[prop] = [];
|
|
867
|
-
objProp.forEach((v, i) => {
|
|
868
|
-
if ((0, import_types.isFunction)(v))
|
|
869
|
-
return;
|
|
870
|
-
if ((0, import_types.isObject)(v)) {
|
|
871
|
-
detached[prop][i] = {};
|
|
872
|
-
detachFunctionsFromObject(v, detached[prop][i]);
|
|
873
|
-
} else {
|
|
874
|
-
detached[prop][i] = v;
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
} else {
|
|
878
|
-
detached[prop] = objProp;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
return detached;
|
|
882
|
-
};
|
|
883
|
-
var deepDestringify = (obj, destringified = {}) => {
|
|
884
|
-
for (const prop in obj) {
|
|
885
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
886
|
-
if (!hasOwnProperty2)
|
|
887
|
-
continue;
|
|
888
|
-
const objProp = obj[prop];
|
|
889
|
-
if ((0, import_types.isString)(objProp)) {
|
|
890
|
-
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
891
|
-
try {
|
|
892
|
-
const evalProp = import_globals.window.eval(`(${objProp})`);
|
|
893
|
-
destringified[prop] = evalProp;
|
|
894
|
-
} catch (e) {
|
|
895
|
-
if (e)
|
|
896
|
-
destringified[prop] = objProp;
|
|
897
|
-
}
|
|
898
|
-
} else {
|
|
899
|
-
destringified[prop] = objProp;
|
|
900
|
-
}
|
|
901
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
902
|
-
destringified[prop] = [];
|
|
903
|
-
objProp.forEach((arrProp) => {
|
|
904
|
-
if ((0, import_types.isString)(arrProp)) {
|
|
905
|
-
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
906
|
-
try {
|
|
907
|
-
const evalProp = import_globals.window.eval(`(${arrProp})`);
|
|
908
|
-
destringified[prop].push(evalProp);
|
|
909
|
-
} catch (e) {
|
|
910
|
-
if (e)
|
|
911
|
-
destringified[prop].push(arrProp);
|
|
912
|
-
}
|
|
913
|
-
} else {
|
|
914
|
-
destringified[prop].push(arrProp);
|
|
915
|
-
}
|
|
916
|
-
} else if ((0, import_types.isObject)(arrProp)) {
|
|
917
|
-
destringified[prop].push(deepDestringify(arrProp));
|
|
918
|
-
} else {
|
|
919
|
-
destringified[prop].push(arrProp);
|
|
920
|
-
}
|
|
921
|
-
});
|
|
922
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
923
|
-
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
924
|
-
} else {
|
|
925
|
-
destringified[prop] = objProp;
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
return destringified;
|
|
929
|
-
};
|
|
930
|
-
var stringToObject = (str, opts = { verbose: true }) => {
|
|
931
|
-
try {
|
|
932
|
-
return str ? import_globals.window.eval("(" + str + ")") : {};
|
|
933
|
-
} catch (e) {
|
|
934
|
-
if (opts.verbose)
|
|
935
|
-
console.warn(e);
|
|
936
|
-
}
|
|
937
|
-
};
|
|
938
|
-
var diffObjects = (original, objToDiff, cache) => {
|
|
939
|
-
for (const e in objToDiff) {
|
|
940
|
-
if (e === "ref")
|
|
941
|
-
continue;
|
|
942
|
-
const originalProp = original[e];
|
|
943
|
-
const objToDiffProp = objToDiff[e];
|
|
944
|
-
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
945
|
-
cache[e] = {};
|
|
946
|
-
diff(originalProp, objToDiffProp, cache[e]);
|
|
947
|
-
} else if (objToDiffProp !== void 0) {
|
|
948
|
-
cache[e] = objToDiffProp;
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
return cache;
|
|
952
|
-
};
|
|
953
|
-
var diffArrays = (original, objToDiff, cache) => {
|
|
954
|
-
if (original.length !== objToDiff.length) {
|
|
955
|
-
cache = objToDiff;
|
|
956
|
-
} else {
|
|
957
|
-
const diffArr = [];
|
|
958
|
-
for (let i = 0; i < original.length; i++) {
|
|
959
|
-
const diffObj = diff(original[i], objToDiff[i]);
|
|
960
|
-
if (Object.keys(diffObj).length > 0) {
|
|
961
|
-
diffArr.push(diffObj);
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
if (diffArr.length > 0) {
|
|
965
|
-
cache = diffArr;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
return cache;
|
|
969
|
-
};
|
|
970
|
-
var diff = (original, objToDiff, cache = {}) => {
|
|
971
|
-
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
972
|
-
cache = [];
|
|
973
|
-
diffArrays(original, objToDiff, cache);
|
|
974
|
-
} else {
|
|
975
|
-
diffObjects(original, objToDiff, cache);
|
|
976
|
-
}
|
|
977
|
-
return cache;
|
|
978
|
-
};
|
|
979
|
-
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
980
|
-
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
981
|
-
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
982
|
-
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
983
|
-
var deepDiff = (lhs, rhs) => {
|
|
984
|
-
if (lhs === rhs)
|
|
985
|
-
return {};
|
|
986
|
-
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
987
|
-
return rhs;
|
|
988
|
-
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
989
|
-
if (!hasOwnProperty(rhs, key)) {
|
|
990
|
-
acc[key] = void 0;
|
|
991
|
-
}
|
|
992
|
-
return acc;
|
|
993
|
-
}, makeObjectWithoutPrototype());
|
|
994
|
-
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
995
|
-
if (lhs.valueOf() === rhs.valueOf())
|
|
996
|
-
return {};
|
|
997
|
-
return rhs;
|
|
998
|
-
}
|
|
999
|
-
return Object.keys(rhs).reduce((acc, key) => {
|
|
1000
|
-
if (!hasOwnProperty(lhs, key)) {
|
|
1001
|
-
acc[key] = rhs[key];
|
|
1002
|
-
return acc;
|
|
1003
|
-
}
|
|
1004
|
-
const difference = diff(lhs[key], rhs[key]);
|
|
1005
|
-
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
1006
|
-
return acc;
|
|
1007
|
-
}
|
|
1008
|
-
acc[key] = difference;
|
|
1009
|
-
return acc;
|
|
1010
|
-
}, deletedValues);
|
|
1011
|
-
};
|
|
1012
|
-
var overwrite = (element, params, opts = {}) => {
|
|
1013
|
-
const { __ref: ref } = element;
|
|
1014
|
-
const excl = opts.exclude || [];
|
|
1015
|
-
const allowUnderscore = opts.preventUnderscore;
|
|
1016
|
-
const preventCaching = opts.preventCaching;
|
|
1017
|
-
for (const e in params) {
|
|
1018
|
-
if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
|
|
1019
|
-
continue;
|
|
1020
|
-
const elementProp = element[e];
|
|
1021
|
-
const paramsProp = params[e];
|
|
1022
|
-
if (paramsProp !== void 0) {
|
|
1023
|
-
element[e] = paramsProp;
|
|
1024
|
-
if (ref && !preventCaching) {
|
|
1025
|
-
ref.__cache[e] = elementProp;
|
|
1026
|
-
}
|
|
1027
|
-
if ((0, import_types.isObject)(opts.diff)) {
|
|
1028
|
-
diff[e] = elementProp;
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
return element;
|
|
1033
|
-
};
|
|
1034
|
-
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
1035
|
-
for (const e in params) {
|
|
1036
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
1037
|
-
continue;
|
|
1038
|
-
obj[e] = params[e];
|
|
1039
|
-
}
|
|
1040
|
-
return obj;
|
|
1041
|
-
};
|
|
1042
|
-
var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
1043
|
-
const excl = opts.exclude || [];
|
|
1044
|
-
const forcedExclude = opts.preventForce ? [] : ["node", "window"];
|
|
1045
|
-
if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
|
|
1046
|
-
return params;
|
|
1047
|
-
}
|
|
1048
|
-
if (visited.has(obj))
|
|
1049
|
-
return visited.get(obj);
|
|
1050
|
-
visited.set(obj, obj);
|
|
1051
|
-
for (const e in params) {
|
|
1052
|
-
if (!Object.hasOwnProperty.call(params, e))
|
|
1053
|
-
continue;
|
|
1054
|
-
if (excl.includes(e) || forcedExclude && e.startsWith("__"))
|
|
1055
|
-
continue;
|
|
1056
|
-
const objProp = obj[e];
|
|
1057
|
-
const paramsProp = params[e];
|
|
1058
|
-
if ((0, import_node.isDOMNode)(paramsProp)) {
|
|
1059
|
-
obj[e] = paramsProp;
|
|
1060
|
-
} else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
1061
|
-
obj[e] = overwriteDeep(objProp, paramsProp, opts, visited);
|
|
1062
|
-
} else if (paramsProp !== void 0) {
|
|
1063
|
-
obj[e] = paramsProp;
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
return obj;
|
|
1067
|
-
};
|
|
1068
|
-
var mergeIfExisted = (a, b) => {
|
|
1069
|
-
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
1070
|
-
return deepMerge2(a, b);
|
|
1071
|
-
return a || b;
|
|
1072
|
-
};
|
|
1073
|
-
var flattenRecursive = (param, prop, stack = []) => {
|
|
1074
|
-
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
1075
|
-
stack.push(objectized);
|
|
1076
|
-
const extendOfExtend = objectized[prop];
|
|
1077
|
-
if (extendOfExtend)
|
|
1078
|
-
flattenRecursive(extendOfExtend, prop, stack);
|
|
1079
|
-
delete objectized[prop];
|
|
1080
|
-
return stack;
|
|
1081
|
-
};
|
|
1082
|
-
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
1083
|
-
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
1084
|
-
return param === element;
|
|
1085
|
-
}
|
|
1086
|
-
if (visited.has(param) || visited.has(element)) {
|
|
1087
|
-
return true;
|
|
1088
|
-
}
|
|
1089
|
-
visited.add(param);
|
|
1090
|
-
visited.add(element);
|
|
1091
|
-
const keysParam = Object.keys(param);
|
|
1092
|
-
const keysElement = Object.keys(element);
|
|
1093
|
-
if (keysParam.length !== keysElement.length) {
|
|
1094
|
-
return false;
|
|
1095
|
-
}
|
|
1096
|
-
for (const key of keysParam) {
|
|
1097
|
-
if (!keysElement.includes(key)) {
|
|
1098
|
-
return false;
|
|
1099
|
-
}
|
|
1100
|
-
const paramProp = param[key];
|
|
1101
|
-
const elementProp = element[key];
|
|
1102
|
-
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
1103
|
-
return false;
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
return true;
|
|
1107
|
-
};
|
|
1108
|
-
var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
|
|
1109
|
-
if (obj1 === obj2)
|
|
1110
|
-
return true;
|
|
1111
|
-
if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
|
|
1112
|
-
return false;
|
|
1113
|
-
if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
|
|
1114
|
-
return obj1 === obj2;
|
|
1115
|
-
const stack = [[obj1, obj2]];
|
|
1116
|
-
const visited = /* @__PURE__ */ new WeakSet();
|
|
1117
|
-
while (stack.length > 0) {
|
|
1118
|
-
const [current1, current2] = stack.pop();
|
|
1119
|
-
if (visited.has(current1))
|
|
1120
|
-
continue;
|
|
1121
|
-
visited.add(current1);
|
|
1122
|
-
const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
|
|
1123
|
-
const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
|
|
1124
|
-
if (keys1.length !== keys2.length)
|
|
1125
|
-
return false;
|
|
1126
|
-
for (const key of keys1) {
|
|
1127
|
-
if (!Object.prototype.hasOwnProperty.call(current2, key))
|
|
1128
|
-
return false;
|
|
1129
|
-
const value1 = current1[key];
|
|
1130
|
-
const value2 = current2[key];
|
|
1131
|
-
if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
|
|
1132
|
-
if (value1 !== value2)
|
|
1133
|
-
return false;
|
|
1134
|
-
} else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
|
|
1135
|
-
if (value1 !== value2) {
|
|
1136
|
-
stack.push([value1, value2]);
|
|
1137
|
-
}
|
|
1138
|
-
} else if (value1 !== value2) {
|
|
1139
|
-
return false;
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
return true;
|
|
1144
|
-
};
|
|
1145
|
-
var removeFromObject = (obj, props) => {
|
|
1146
|
-
if (props === void 0 || props === null)
|
|
1147
|
-
return obj;
|
|
1148
|
-
if ((0, import_types.is)(props)("string", "number")) {
|
|
1149
|
-
delete obj[props];
|
|
1150
|
-
} else if ((0, import_types.isArray)(props)) {
|
|
1151
|
-
props.forEach((prop) => delete obj[prop]);
|
|
1152
|
-
} else {
|
|
1153
|
-
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
1154
|
-
}
|
|
1155
|
-
return obj;
|
|
1156
|
-
};
|
|
1157
|
-
var createObjectWithoutPrototype = (obj) => {
|
|
1158
|
-
if (obj === null || typeof obj !== "object") {
|
|
1159
|
-
return obj;
|
|
1160
|
-
}
|
|
1161
|
-
const newObj = /* @__PURE__ */ Object.create(null);
|
|
1162
|
-
for (const key in obj) {
|
|
1163
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1164
|
-
newObj[key] = createObjectWithoutPrototype(obj[key]);
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
return newObj;
|
|
1168
|
-
};
|
|
1169
|
-
var createNestedObject = (arr, lastValue) => {
|
|
1170
|
-
const nestedObject = {};
|
|
1171
|
-
if (arr.length === 0) {
|
|
1172
|
-
return lastValue;
|
|
1173
|
-
}
|
|
1174
|
-
arr.reduce((obj, value, index) => {
|
|
1175
|
-
if (!obj[value]) {
|
|
1176
|
-
obj[value] = {};
|
|
1177
|
-
}
|
|
1178
|
-
if (index === arr.length - 1 && lastValue) {
|
|
1179
|
-
obj[value] = lastValue;
|
|
1180
|
-
}
|
|
1181
|
-
return obj[value];
|
|
1182
|
-
}, nestedObject);
|
|
1183
|
-
return nestedObject;
|
|
1184
|
-
};
|
|
1185
|
-
var removeNestedKeyByPath = (obj, path) => {
|
|
1186
|
-
if (!Array.isArray(path)) {
|
|
1187
|
-
throw new Error("Path must be an array.");
|
|
1188
|
-
}
|
|
1189
|
-
let current = obj;
|
|
1190
|
-
for (let i = 0; i < path.length - 1; i++) {
|
|
1191
|
-
if (current[path[i]] === void 0) {
|
|
1192
|
-
return;
|
|
1193
|
-
}
|
|
1194
|
-
current = current[path[i]];
|
|
1195
|
-
}
|
|
1196
|
-
const lastKey = path[path.length - 1];
|
|
1197
|
-
if (current && Object.hasOwnProperty.call(current, lastKey)) {
|
|
1198
|
-
delete current[lastKey];
|
|
1199
|
-
}
|
|
1200
|
-
};
|
|
1201
|
-
var detectInfiniteLoop = (arr) => {
|
|
1202
|
-
const maxRepeats = 10;
|
|
1203
|
-
let pattern = [];
|
|
1204
|
-
let repeatCount = 0;
|
|
1205
|
-
for (let i = 0; i < arr.length; i++) {
|
|
1206
|
-
if (pattern.length < 2) {
|
|
1207
|
-
pattern.push(arr[i]);
|
|
1208
|
-
} else {
|
|
1209
|
-
if (arr[i] === pattern[i % 2]) {
|
|
1210
|
-
repeatCount++;
|
|
1211
|
-
} else {
|
|
1212
|
-
pattern = [arr[i - 1], arr[i]];
|
|
1213
|
-
repeatCount = 1;
|
|
1214
|
-
}
|
|
1215
|
-
if (repeatCount >= maxRepeats * 2) {
|
|
1216
|
-
if (ENV === "test" || ENV === "development") {
|
|
1217
|
-
console.warn("Warning: Potential infinite loop detected due to repeated sequence:", pattern);
|
|
1218
|
-
}
|
|
1219
|
-
return true;
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
};
|
|
1224
|
-
var isCyclic = (obj) => {
|
|
1225
|
-
const seenObjects = [];
|
|
1226
|
-
function detect(obj2) {
|
|
1227
|
-
if (obj2 && typeof obj2 === "object") {
|
|
1228
|
-
if (seenObjects.indexOf(obj2) !== -1) {
|
|
1229
|
-
return true;
|
|
1230
|
-
}
|
|
1231
|
-
seenObjects.push(obj2);
|
|
1232
|
-
for (const key in obj2) {
|
|
1233
|
-
if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
|
|
1234
|
-
console.log(obj2, "cycle at " + key);
|
|
1235
|
-
return true;
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
return false;
|
|
1240
|
-
}
|
|
1241
|
-
return detect(obj);
|
|
1242
|
-
};
|
|
1243
|
-
var excludeKeysFromObject = (obj, excludedKeys) => {
|
|
1244
|
-
const result = { ...obj };
|
|
1245
|
-
excludedKeys.forEach((key) => delete result[key]);
|
|
1246
|
-
return result;
|
|
1247
|
-
};
|
|
1248
|
-
}
|
|
1249
|
-
});
|
|
1250
|
-
|
|
1251
|
-
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
1252
|
-
var require_function = __commonJS({
|
|
1253
|
-
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
1254
|
-
"use strict";
|
|
1255
|
-
var __defProp2 = Object.defineProperty;
|
|
1256
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1257
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1258
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1259
|
-
var __export2 = (target, all) => {
|
|
1260
|
-
for (var name in all)
|
|
1261
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1262
|
-
};
|
|
1263
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1264
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1265
|
-
for (let key of __getOwnPropNames2(from))
|
|
1266
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1267
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1268
|
-
}
|
|
1269
|
-
return to;
|
|
1270
|
-
};
|
|
1271
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1272
|
-
var function_exports = {};
|
|
1273
|
-
__export2(function_exports, {
|
|
1274
|
-
cloneFunction: () => cloneFunction,
|
|
1275
|
-
debounce: () => debounce,
|
|
1276
|
-
debounceOnContext: () => debounceOnContext,
|
|
1277
|
-
isStringFunction: () => isStringFunction,
|
|
1278
|
-
memoize: () => memoize
|
|
1279
|
-
});
|
|
1280
|
-
module2.exports = __toCommonJS2(function_exports);
|
|
1281
|
-
function debounce(func, wait, immediate) {
|
|
1282
|
-
let timeout;
|
|
1283
|
-
return function() {
|
|
1284
|
-
const context = this;
|
|
1285
|
-
const args = arguments;
|
|
1286
|
-
const later = function() {
|
|
1287
|
-
timeout = null;
|
|
1288
|
-
if (!immediate)
|
|
1289
|
-
func.apply(context, args);
|
|
1290
|
-
};
|
|
1291
|
-
const callNow = immediate && !timeout;
|
|
1292
|
-
clearTimeout(timeout);
|
|
1293
|
-
timeout = setTimeout(later, wait);
|
|
1294
|
-
if (callNow)
|
|
1295
|
-
func.apply(context, args);
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
var debounceOnContext = (element, func, timeout = 300) => {
|
|
1299
|
-
let timer;
|
|
1300
|
-
return (...args) => {
|
|
1301
|
-
clearTimeout(timer);
|
|
1302
|
-
timer = setTimeout(() => {
|
|
1303
|
-
func.apply(element, args);
|
|
1304
|
-
}, timeout);
|
|
1305
|
-
};
|
|
1306
|
-
};
|
|
1307
|
-
var memoize = (fn) => {
|
|
1308
|
-
const cache = {};
|
|
1309
|
-
return (...args) => {
|
|
1310
|
-
const n = args[0];
|
|
1311
|
-
if (n in cache) {
|
|
1312
|
-
return cache[n];
|
|
1313
|
-
} else {
|
|
1314
|
-
const result = fn(n);
|
|
1315
|
-
cache[n] = result;
|
|
1316
|
-
return result;
|
|
1317
|
-
}
|
|
1318
|
-
};
|
|
1319
|
-
};
|
|
1320
|
-
var isStringFunction = (inputString) => {
|
|
1321
|
-
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
1322
|
-
return functionRegex.test(inputString);
|
|
1323
|
-
};
|
|
1324
|
-
function cloneFunction(fn, win = window) {
|
|
1325
|
-
const temp = function() {
|
|
1326
|
-
return fn.apply(win, arguments);
|
|
1327
|
-
};
|
|
1328
|
-
for (const key in fn) {
|
|
1329
|
-
if (Object.hasOwnProperty.call(fn, key)) {
|
|
1330
|
-
temp[key] = fn[key];
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
return temp;
|
|
1334
|
-
}
|
|
1335
|
-
}
|
|
1336
|
-
});
|
|
1337
|
-
|
|
1338
|
-
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
1339
|
-
var require_log = __commonJS({
|
|
1340
|
-
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
1341
|
-
"use strict";
|
|
1342
|
-
var __defProp2 = Object.defineProperty;
|
|
1343
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1344
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1345
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1346
|
-
var __export2 = (target, all) => {
|
|
1347
|
-
for (var name in all)
|
|
1348
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1349
|
-
};
|
|
1350
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1351
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1352
|
-
for (let key of __getOwnPropNames2(from))
|
|
1353
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1354
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1355
|
-
}
|
|
1356
|
-
return to;
|
|
1357
|
-
};
|
|
1358
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1359
|
-
var log_exports = {};
|
|
1360
|
-
__export2(log_exports, {
|
|
1361
|
-
logGroupIf: () => logGroupIf,
|
|
1362
|
-
logIf: () => logIf
|
|
1363
|
-
});
|
|
1364
|
-
module2.exports = __toCommonJS2(log_exports);
|
|
1365
|
-
var logIf = (bool, ...arg) => {
|
|
1366
|
-
if (bool)
|
|
1367
|
-
arg.map((v) => console.log(v));
|
|
1368
|
-
};
|
|
1369
|
-
var logGroupIf = (bool, key, ...arg) => {
|
|
1370
|
-
if (bool) {
|
|
1371
|
-
console.group(key);
|
|
1372
|
-
arg.map((v) => console.log(v));
|
|
1373
|
-
console.groupEnd(key);
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
}
|
|
1377
|
-
});
|
|
1378
|
-
|
|
1379
|
-
// ../../node_modules/@domql/utils/dist/cjs/cookie.js
|
|
1380
|
-
var require_cookie = __commonJS({
|
|
1381
|
-
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1382
|
-
"use strict";
|
|
1383
|
-
var __defProp2 = Object.defineProperty;
|
|
1384
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1385
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1386
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1387
|
-
var __export2 = (target, all) => {
|
|
1388
|
-
for (var name in all)
|
|
1389
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1390
|
-
};
|
|
1391
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1392
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1393
|
-
for (let key of __getOwnPropNames2(from))
|
|
1394
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1395
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1396
|
-
}
|
|
1397
|
-
return to;
|
|
1398
|
-
};
|
|
1399
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1400
|
-
var cookie_exports = {};
|
|
1401
|
-
__export2(cookie_exports, {
|
|
1402
|
-
getCookie: () => getCookie,
|
|
1403
|
-
getLocalStorage: () => getLocalStorage,
|
|
1404
|
-
isMobile: () => isMobile,
|
|
1405
|
-
removeCookie: () => removeCookie,
|
|
1406
|
-
setCookie: () => setCookie,
|
|
1407
|
-
setLocalStorage: () => setLocalStorage
|
|
1408
|
-
});
|
|
1409
|
-
module2.exports = __toCommonJS2(cookie_exports);
|
|
1410
|
-
var import_types = require_types();
|
|
1411
|
-
var import_utils5 = require_cjs();
|
|
1412
|
-
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
1413
|
-
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
1414
|
-
if ((0, import_types.isUndefined)(import_utils5.document) || (0, import_types.isUndefined)(import_utils5.document.cookie))
|
|
1415
|
-
return;
|
|
1416
|
-
const d = /* @__PURE__ */ new Date();
|
|
1417
|
-
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
1418
|
-
const expires = `expires=${d.toUTCString()}`;
|
|
1419
|
-
import_utils5.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1420
|
-
};
|
|
1421
|
-
var getCookie = (cname) => {
|
|
1422
|
-
if ((0, import_types.isUndefined)(import_utils5.document) || (0, import_types.isUndefined)(import_utils5.document.cookie))
|
|
1423
|
-
return;
|
|
1424
|
-
const name = `${cname}=`;
|
|
1425
|
-
const decodedCookie = decodeURIComponent(import_utils5.document.cookie);
|
|
1426
|
-
const ca = decodedCookie.split(";");
|
|
1427
|
-
for (let i = 0; i < ca.length; i++) {
|
|
1428
|
-
let c = ca[i];
|
|
1429
|
-
while (c.charAt(0) === " ")
|
|
1430
|
-
c = c.substring(1);
|
|
1431
|
-
if (c.indexOf(name) === 0)
|
|
1432
|
-
return c.substring(name.length, c.length);
|
|
1433
|
-
}
|
|
1434
|
-
return "";
|
|
1435
|
-
};
|
|
1436
|
-
var removeCookie = (cname) => {
|
|
1437
|
-
if ((0, import_types.isUndefined)(import_utils5.document) || (0, import_types.isUndefined)(import_utils5.document.cookie))
|
|
1438
|
-
return;
|
|
1439
|
-
import_utils5.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
1440
|
-
};
|
|
1441
|
-
function getLocalStorage(key) {
|
|
1442
|
-
let savedJSON;
|
|
1443
|
-
if (window.localStorage) {
|
|
1444
|
-
try {
|
|
1445
|
-
savedJSON = JSON.parse(window.localStorage.getItem(key));
|
|
1446
|
-
} catch (e) {
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
if (typeof savedJSON !== "undefined") {
|
|
1450
|
-
return savedJSON;
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
1453
|
-
function setLocalStorage(key, data) {
|
|
1454
|
-
if (data && window.localStorage) {
|
|
1455
|
-
if (typeof data === "object") {
|
|
1456
|
-
window.localStorage.setItem(key, JSON.stringify(data));
|
|
1457
|
-
} else {
|
|
1458
|
-
window.localStorage.setItem(key, data);
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
});
|
|
1464
|
-
|
|
1465
|
-
// ../../node_modules/@domql/utils/dist/cjs/tags.js
|
|
1466
|
-
var require_tags = __commonJS({
|
|
1467
|
-
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1468
|
-
"use strict";
|
|
1469
|
-
var __defProp2 = Object.defineProperty;
|
|
1470
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1471
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1472
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1473
|
-
var __export2 = (target, all) => {
|
|
1474
|
-
for (var name in all)
|
|
1475
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1476
|
-
};
|
|
1477
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1478
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1479
|
-
for (let key of __getOwnPropNames2(from))
|
|
1480
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1481
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1482
|
-
}
|
|
1483
|
-
return to;
|
|
1484
|
-
};
|
|
1485
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1486
|
-
var tags_exports = {};
|
|
1487
|
-
__export2(tags_exports, {
|
|
1488
|
-
HTML_TAGS: () => HTML_TAGS,
|
|
1489
|
-
isValidHtmlTag: () => isValidHtmlTag
|
|
1490
|
-
});
|
|
1491
|
-
module2.exports = __toCommonJS2(tags_exports);
|
|
1492
|
-
var HTML_TAGS = {
|
|
1493
|
-
root: [
|
|
1494
|
-
"body",
|
|
1495
|
-
"html"
|
|
1496
|
-
],
|
|
1497
|
-
head: [
|
|
1498
|
-
"title",
|
|
1499
|
-
"base",
|
|
1500
|
-
"meta",
|
|
1501
|
-
"style",
|
|
1502
|
-
"noscript",
|
|
1503
|
-
"script"
|
|
1504
|
-
],
|
|
1505
|
-
body: [
|
|
1506
|
-
"string",
|
|
1507
|
-
"style",
|
|
1508
|
-
"fragment",
|
|
1509
|
-
"a",
|
|
1510
|
-
"abbr",
|
|
1511
|
-
"acronym",
|
|
1512
|
-
"address",
|
|
1513
|
-
"applet",
|
|
1514
|
-
"area",
|
|
1515
|
-
"article",
|
|
1516
|
-
"aside",
|
|
1517
|
-
"audio",
|
|
1518
|
-
"b",
|
|
1519
|
-
"basefont",
|
|
1520
|
-
"bdi",
|
|
1521
|
-
"bdo",
|
|
1522
|
-
"big",
|
|
1523
|
-
"blockquote",
|
|
1524
|
-
"br",
|
|
1525
|
-
"button",
|
|
1526
|
-
"canvas",
|
|
1527
|
-
"caption",
|
|
1528
|
-
"center",
|
|
1529
|
-
"cite",
|
|
1530
|
-
"code",
|
|
1531
|
-
"search",
|
|
1532
|
-
"col",
|
|
1533
|
-
"colgroup",
|
|
1534
|
-
"data",
|
|
1535
|
-
"datalist",
|
|
1536
|
-
"dd",
|
|
1537
|
-
"del",
|
|
1538
|
-
"details",
|
|
1539
|
-
"dfn",
|
|
1540
|
-
"dialog",
|
|
1541
|
-
"dir",
|
|
1542
|
-
"div",
|
|
1543
|
-
"dl",
|
|
1544
|
-
"dt",
|
|
1545
|
-
"em",
|
|
1546
|
-
"embed",
|
|
1547
|
-
"fieldset",
|
|
1548
|
-
"figcaption",
|
|
1549
|
-
"figure",
|
|
1550
|
-
"font",
|
|
1551
|
-
"footer",
|
|
1552
|
-
"form",
|
|
1553
|
-
"frame",
|
|
1554
|
-
"frameset",
|
|
1555
|
-
"h1",
|
|
1556
|
-
"h2",
|
|
1557
|
-
"h3",
|
|
1558
|
-
"h4",
|
|
1559
|
-
"h5",
|
|
1560
|
-
"h6",
|
|
1561
|
-
"head",
|
|
1562
|
-
"header",
|
|
1563
|
-
"hr",
|
|
1564
|
-
"i",
|
|
1565
|
-
"iframe",
|
|
1566
|
-
"img",
|
|
1567
|
-
"input",
|
|
1568
|
-
"ins",
|
|
1569
|
-
"kbd",
|
|
1570
|
-
"label",
|
|
1571
|
-
"legend",
|
|
1572
|
-
"li",
|
|
1573
|
-
"link",
|
|
1574
|
-
"main",
|
|
1575
|
-
"map",
|
|
1576
|
-
"mark",
|
|
1577
|
-
"meter",
|
|
1578
|
-
"nav",
|
|
1579
|
-
"noframes",
|
|
1580
|
-
"noscript",
|
|
1581
|
-
"object",
|
|
1582
|
-
"ol",
|
|
1583
|
-
"optgroup",
|
|
1584
|
-
"option",
|
|
1585
|
-
"output",
|
|
1586
|
-
"p",
|
|
1587
|
-
"param",
|
|
1588
|
-
"picture",
|
|
1589
|
-
"pre",
|
|
1590
|
-
"progress",
|
|
1591
|
-
"hgroup",
|
|
1592
|
-
"q",
|
|
1593
|
-
"rp",
|
|
1594
|
-
"rt",
|
|
1595
|
-
"ruby",
|
|
1596
|
-
"s",
|
|
1597
|
-
"samp",
|
|
1598
|
-
"script",
|
|
1599
|
-
"section",
|
|
1600
|
-
"select",
|
|
1601
|
-
"small",
|
|
1602
|
-
"source",
|
|
1603
|
-
"span",
|
|
1604
|
-
"strike",
|
|
1605
|
-
"strong",
|
|
1606
|
-
"sub",
|
|
1607
|
-
"summary",
|
|
1608
|
-
"sup",
|
|
1609
|
-
"table",
|
|
1610
|
-
"tbody",
|
|
1611
|
-
"td",
|
|
1612
|
-
"template",
|
|
1613
|
-
"hgroup",
|
|
1614
|
-
"textarea",
|
|
1615
|
-
"tfoot",
|
|
1616
|
-
"th",
|
|
1617
|
-
"thead",
|
|
1618
|
-
"time",
|
|
1619
|
-
"tr",
|
|
1620
|
-
"track",
|
|
1621
|
-
"tt",
|
|
1622
|
-
"u",
|
|
1623
|
-
"ul",
|
|
1624
|
-
"var",
|
|
1625
|
-
"video",
|
|
1626
|
-
"wbr",
|
|
1627
|
-
// SVG
|
|
1628
|
-
"svg",
|
|
1629
|
-
"path"
|
|
1630
|
-
]
|
|
1631
|
-
};
|
|
1632
|
-
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
1633
|
-
}
|
|
1634
|
-
});
|
|
1635
|
-
|
|
1636
|
-
// ../../node_modules/@domql/utils/dist/cjs/component.js
|
|
1637
|
-
var require_component = __commonJS({
|
|
1638
|
-
"../../node_modules/@domql/utils/dist/cjs/component.js"(exports, module2) {
|
|
1639
|
-
"use strict";
|
|
1640
|
-
var __defProp2 = Object.defineProperty;
|
|
1641
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1642
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1643
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1644
|
-
var __export2 = (target, all) => {
|
|
1645
|
-
for (var name in all)
|
|
1646
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1647
|
-
};
|
|
1648
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1649
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1650
|
-
for (let key of __getOwnPropNames2(from))
|
|
1651
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1652
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1653
|
-
}
|
|
1654
|
-
return to;
|
|
1655
|
-
};
|
|
1656
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1657
|
-
var component_exports = {};
|
|
1658
|
-
__export2(component_exports, {
|
|
1659
|
-
addAdditionalExtend: () => addAdditionalExtend,
|
|
1660
|
-
addChildrenIfNotInOriginal: () => addChildrenIfNotInOriginal,
|
|
1661
|
-
applyComponentFromContext: () => applyComponentFromContext,
|
|
1662
|
-
applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
|
|
1663
|
-
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
1664
|
-
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
1665
|
-
checkIfSugar: () => checkIfSugar,
|
|
1666
|
-
extendizeByKey: () => extendizeByKey,
|
|
1667
|
-
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
1668
|
-
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
1669
|
-
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
1670
|
-
getExtendsInElement: () => getExtendsInElement,
|
|
1671
|
-
hasVariantProp: () => hasVariantProp,
|
|
1672
|
-
isVariant: () => isVariant,
|
|
1673
|
-
setContentKey: () => setContentKey
|
|
1674
|
-
});
|
|
1675
|
-
module2.exports = __toCommonJS2(component_exports);
|
|
1676
|
-
var import__ = require_cjs();
|
|
1677
|
-
var ENV = "development";
|
|
1678
|
-
var checkIfKeyIsComponent = (key) => {
|
|
1679
|
-
const isFirstKeyString = (0, import__.isString)(key);
|
|
1680
|
-
if (!isFirstKeyString)
|
|
1681
|
-
return;
|
|
1682
|
-
const firstCharKey = key.slice(0, 1);
|
|
1683
|
-
return /^[A-Z]*$/.test(firstCharKey);
|
|
1684
|
-
};
|
|
1685
|
-
var checkIfKeyIsProperty = (key) => {
|
|
1686
|
-
const isFirstKeyString = (0, import__.isString)(key);
|
|
1687
|
-
if (!isFirstKeyString)
|
|
1688
|
-
return;
|
|
1689
|
-
const firstCharKey = key.slice(0, 1);
|
|
1690
|
-
return /^[a-z]*$/.test(firstCharKey);
|
|
1691
|
-
};
|
|
1692
|
-
var addAdditionalExtend = (newExtend, element) => {
|
|
1693
|
-
if (!newExtend)
|
|
1694
|
-
return element;
|
|
1695
|
-
const { extend: elementExtend } = element;
|
|
1696
|
-
const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
|
|
1697
|
-
const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
|
|
1698
|
-
const extend = (0, import__.joinArrays)(receivedArray, originalArray);
|
|
1699
|
-
return { ...element, extend };
|
|
1700
|
-
};
|
|
1701
|
-
var checkIfSugar = (element, parent, key) => {
|
|
1702
|
-
var _a;
|
|
1703
|
-
const {
|
|
1704
|
-
extend,
|
|
1705
|
-
props,
|
|
1706
|
-
childExtend,
|
|
1707
|
-
extends: extendProps,
|
|
1708
|
-
childExtends,
|
|
1709
|
-
childProps,
|
|
1710
|
-
children,
|
|
1711
|
-
on,
|
|
1712
|
-
$collection,
|
|
1713
|
-
$stateCollection,
|
|
1714
|
-
$propsCollection
|
|
1715
|
-
} = element;
|
|
1716
|
-
const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
|
|
1717
|
-
if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
|
|
1718
|
-
const logErr = (_a = parent || element) == null ? void 0 : _a.error;
|
|
1719
|
-
if (logErr)
|
|
1720
|
-
logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
|
|
1721
|
-
}
|
|
1722
|
-
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
1723
|
-
};
|
|
1724
|
-
var extractComponentKeyFromKey = (key) => {
|
|
1725
|
-
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
1726
|
-
};
|
|
1727
|
-
var extendizeByKey = (element, parent, key) => {
|
|
1728
|
-
const { context } = parent;
|
|
1729
|
-
const { tag, extend, childExtends } = element;
|
|
1730
|
-
const isSugar = checkIfSugar(element, parent, key);
|
|
1731
|
-
const extendFromKey = extractComponentKeyFromKey(key);
|
|
1732
|
-
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
1733
|
-
if (element === isExtendKeyComponent)
|
|
1734
|
-
return element;
|
|
1735
|
-
else if (isSugar) {
|
|
1736
|
-
const newElem = addAdditionalExtend(element.extends, {
|
|
1737
|
-
extend: extendFromKey,
|
|
1738
|
-
tag,
|
|
1739
|
-
props: { ...element }
|
|
1740
|
-
});
|
|
1741
|
-
if (newElem.props.data) {
|
|
1742
|
-
newElem.data = newElem.props.data;
|
|
1743
|
-
delete newElem.props.data;
|
|
1744
|
-
}
|
|
1745
|
-
if (newElem.props.state) {
|
|
1746
|
-
newElem.state = newElem.props.state;
|
|
1747
|
-
delete newElem.props.state;
|
|
1748
|
-
}
|
|
1749
|
-
if (newElem.props.attr) {
|
|
1750
|
-
newElem.attr = newElem.props.attr;
|
|
1751
|
-
delete newElem.props.attr;
|
|
1752
|
-
}
|
|
1753
|
-
if (newElem.props.if) {
|
|
1754
|
-
newElem.if = newElem.props.if;
|
|
1755
|
-
delete newElem.props.if;
|
|
1756
|
-
}
|
|
1757
|
-
if (childExtends)
|
|
1758
|
-
newElem.childExtend = childExtends;
|
|
1759
|
-
return newElem;
|
|
1760
|
-
} else if (!extend || extend === true) {
|
|
1761
|
-
return {
|
|
1762
|
-
...element,
|
|
1763
|
-
tag,
|
|
1764
|
-
extend: extendFromKey
|
|
1765
|
-
};
|
|
1766
|
-
} else if (extend) {
|
|
1767
|
-
return addAdditionalExtend(extendFromKey, element);
|
|
1768
|
-
} else if ((0, import__.isFunction)(element)) {
|
|
1769
|
-
return {
|
|
1770
|
-
extend: extendFromKey,
|
|
1771
|
-
tag,
|
|
1772
|
-
props: { ...(0, import__.exec)(element, parent) }
|
|
1773
|
-
};
|
|
1774
|
-
}
|
|
1775
|
-
};
|
|
1776
|
-
function getCapitalCaseKeys(obj) {
|
|
1777
|
-
return Object.keys(obj).filter((key) => /^[A-Z]/.test(key));
|
|
1778
|
-
}
|
|
1779
|
-
var addChildrenIfNotInOriginal = (element, parent, key) => {
|
|
1780
|
-
const childElems = getCapitalCaseKeys(element.props);
|
|
1781
|
-
if (!childElems.length)
|
|
1782
|
-
return element;
|
|
1783
|
-
for (const i in childElems) {
|
|
1784
|
-
const childKey = childElems[i];
|
|
1785
|
-
const childElem = element[childKey];
|
|
1786
|
-
const newChild = element.props[childKey];
|
|
1787
|
-
const assignChild = (val) => {
|
|
1788
|
-
element[childKey] = val;
|
|
1789
|
-
delete element.props[childKey];
|
|
1790
|
-
};
|
|
1791
|
-
if (newChild == null ? void 0 : newChild.ignoreExtend)
|
|
1792
|
-
continue;
|
|
1793
|
-
if (newChild === null)
|
|
1794
|
-
assignChild(null);
|
|
1795
|
-
else if (!childElem)
|
|
1796
|
-
assignChild((0, import__.deepClone)(newChild));
|
|
1797
|
-
else {
|
|
1798
|
-
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
1799
|
-
if (isSugarChildElem)
|
|
1800
|
-
continue;
|
|
1801
|
-
assignChild({
|
|
1802
|
-
extend: element[childKey],
|
|
1803
|
-
props: newChild
|
|
1804
|
-
});
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
};
|
|
1808
|
-
var applyKeyComponentAsExtend = (element, parent, key) => {
|
|
1809
|
-
return extendizeByKey(element, parent, key) || element;
|
|
1810
|
-
};
|
|
1811
|
-
var applyComponentFromContext = (element, parent, options) => {
|
|
1812
|
-
const { context } = element;
|
|
1813
|
-
if (!context || !context.components)
|
|
1814
|
-
return;
|
|
1815
|
-
const { components } = context;
|
|
1816
|
-
const { extend } = element;
|
|
1817
|
-
const execExtend = (0, import__.exec)(extend, element);
|
|
1818
|
-
if ((0, import__.isString)(execExtend)) {
|
|
1819
|
-
const componentExists = components[execExtend] || components["smbls." + execExtend];
|
|
1820
|
-
if (componentExists)
|
|
1821
|
-
element.extend = componentExists;
|
|
1822
|
-
else {
|
|
1823
|
-
if ((ENV === "test" || ENV === "development") && options.verbose) {
|
|
1824
|
-
console.warn(execExtend, "is not in library", components, element);
|
|
1825
|
-
console.warn("replacing with ", {});
|
|
1826
|
-
}
|
|
1827
|
-
element.extend = {};
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
};
|
|
1831
|
-
var isVariant = (param) => {
|
|
1832
|
-
if (!(0, import__.isString)(param))
|
|
1833
|
-
return;
|
|
1834
|
-
const firstCharKey = param.slice(0, 1);
|
|
1835
|
-
return firstCharKey === ".";
|
|
1836
|
-
};
|
|
1837
|
-
var hasVariantProp = (element) => {
|
|
1838
|
-
const { props } = element;
|
|
1839
|
-
if ((0, import__.isObject)(props) && (0, import__.isString)(props.variant))
|
|
1840
|
-
return true;
|
|
1841
|
-
};
|
|
1842
|
-
var getChildrenComponentsByKey = (key, el) => {
|
|
1843
|
-
if (key === el.key || el.__ref.__componentKey === key) {
|
|
1844
|
-
return el;
|
|
1845
|
-
}
|
|
1846
|
-
if (el.extend) {
|
|
1847
|
-
const foundString = (0, import__.isString)(el.extend) && el.extend === key;
|
|
1848
|
-
const foundInArray = (0, import__.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
|
|
1849
|
-
if (foundString || foundInArray)
|
|
1850
|
-
return el;
|
|
1851
|
-
}
|
|
1852
|
-
if (el.parent && el.parent.childExtend) {
|
|
1853
|
-
const foundString = (0, import__.isString)(el.parent.childExtend) && el.parent.childExtend === key;
|
|
1854
|
-
const foundInArray = (0, import__.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
|
|
1855
|
-
if (foundString || foundInArray)
|
|
1856
|
-
return el;
|
|
1857
|
-
}
|
|
1858
|
-
};
|
|
1859
|
-
var getExtendsInElement = (obj) => {
|
|
1860
|
-
let result = [];
|
|
1861
|
-
function traverse(o) {
|
|
1862
|
-
for (const key in o) {
|
|
1863
|
-
if (Object.hasOwnProperty.call(o, key)) {
|
|
1864
|
-
if (checkIfKeyIsComponent(key)) {
|
|
1865
|
-
result.push(key);
|
|
1866
|
-
}
|
|
1867
|
-
if (key === "extend" || key === "extends") {
|
|
1868
|
-
if (typeof o[key] === "string") {
|
|
1869
|
-
result.push(o[key]);
|
|
1870
|
-
} else if (Array.isArray(o[key])) {
|
|
1871
|
-
result = result.concat(o[key]);
|
|
1872
|
-
}
|
|
1873
|
-
}
|
|
1874
|
-
if (typeof o[key] === "object" && o[key] !== null) {
|
|
1875
|
-
traverse(o[key]);
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
}
|
|
1879
|
-
}
|
|
1880
|
-
traverse(obj);
|
|
1881
|
-
return result;
|
|
1882
|
-
};
|
|
1883
|
-
var setContentKey = (el, opts = {}) => {
|
|
1884
|
-
const { __ref: ref } = el;
|
|
1885
|
-
const contentElementKey = opts.contentElementKey;
|
|
1886
|
-
if (contentElementKey !== "content" && contentElementKey !== ref.contentElementKey || !ref.contentElementKey) {
|
|
1887
|
-
ref.contentElementKey = contentElementKey || "content";
|
|
1888
|
-
} else
|
|
1889
|
-
ref.contentElementKey = "content";
|
|
1890
|
-
if (contentElementKey !== "content")
|
|
1891
|
-
opts.contentElementKey = "content";
|
|
1892
|
-
return ref.contentElementKey;
|
|
1893
|
-
};
|
|
1894
|
-
}
|
|
1895
|
-
});
|
|
1896
|
-
|
|
1897
|
-
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1898
|
-
var require_cjs = __commonJS({
|
|
1899
|
-
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1900
|
-
"use strict";
|
|
1901
|
-
var __defProp2 = Object.defineProperty;
|
|
1902
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1903
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1904
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1905
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1906
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1907
|
-
for (let key of __getOwnPropNames2(from))
|
|
1908
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1909
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1910
|
-
}
|
|
1911
|
-
return to;
|
|
1912
|
-
};
|
|
1913
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
|
|
1914
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1915
|
-
var utils_exports = {};
|
|
1916
|
-
module2.exports = __toCommonJS2(utils_exports);
|
|
1917
|
-
__reExport(utils_exports, require_key(), module2.exports);
|
|
1918
|
-
__reExport(utils_exports, require_env(), module2.exports);
|
|
1919
|
-
__reExport(utils_exports, require_types(), module2.exports);
|
|
1920
|
-
__reExport(utils_exports, require_object(), module2.exports);
|
|
1921
|
-
__reExport(utils_exports, require_function(), module2.exports);
|
|
1922
|
-
__reExport(utils_exports, require_array(), module2.exports);
|
|
1923
|
-
__reExport(utils_exports, require_node(), module2.exports);
|
|
1924
|
-
__reExport(utils_exports, require_log(), module2.exports);
|
|
1925
|
-
__reExport(utils_exports, require_string(), module2.exports);
|
|
1926
|
-
__reExport(utils_exports, require_globals(), module2.exports);
|
|
1927
|
-
__reExport(utils_exports, require_cookie(), module2.exports);
|
|
1928
|
-
__reExport(utils_exports, require_tags(), module2.exports);
|
|
1929
|
-
__reExport(utils_exports, require_component(), module2.exports);
|
|
1930
|
-
}
|
|
1931
|
-
});
|
|
1932
|
-
|
|
1933
33
|
// ../utils/dist/cjs/index.js
|
|
1934
|
-
var
|
|
34
|
+
var require_cjs = __commonJS({
|
|
1935
35
|
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
1936
36
|
"use strict";
|
|
1937
|
-
var
|
|
1938
|
-
var __defProp2 = Object.defineProperty;
|
|
37
|
+
var __defProp3 = Object.defineProperty;
|
|
1939
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1940
39
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1941
|
-
var
|
|
1942
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1943
|
-
var __commonJS2 = (cb, mod) => function __require() {
|
|
1944
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1945
|
-
};
|
|
40
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1946
41
|
var __export2 = (target, all) => {
|
|
1947
42
|
for (var name in all)
|
|
1948
|
-
|
|
43
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1949
44
|
};
|
|
1950
45
|
var __copyProps2 = (to, from, except, desc) => {
|
|
1951
46
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1952
47
|
for (let key of __getOwnPropNames2(from))
|
|
1953
|
-
if (!
|
|
1954
|
-
|
|
48
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
49
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1955
50
|
}
|
|
1956
51
|
return to;
|
|
1957
52
|
};
|
|
1958
|
-
var
|
|
1959
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1960
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1961
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1962
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1963
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1964
|
-
mod
|
|
1965
|
-
));
|
|
1966
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1967
|
-
var require_key2 = __commonJS2({
|
|
1968
|
-
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
|
|
1969
|
-
"use strict";
|
|
1970
|
-
var __defProp22 = Object.defineProperty;
|
|
1971
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1972
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1973
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1974
|
-
var __export22 = (target, all) => {
|
|
1975
|
-
for (var name in all)
|
|
1976
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1977
|
-
};
|
|
1978
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1979
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1980
|
-
for (let key of __getOwnPropNames22(from))
|
|
1981
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1982
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1983
|
-
}
|
|
1984
|
-
return to;
|
|
1985
|
-
};
|
|
1986
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1987
|
-
var key_exports = {};
|
|
1988
|
-
__export22(key_exports, {
|
|
1989
|
-
createSnapshotId: () => createSnapshotId,
|
|
1990
|
-
generateKey: () => generateKey
|
|
1991
|
-
});
|
|
1992
|
-
module22.exports = __toCommonJS22(key_exports);
|
|
1993
|
-
var generateKey = /* @__PURE__ */ function() {
|
|
1994
|
-
let index = 0;
|
|
1995
|
-
function newId() {
|
|
1996
|
-
index++;
|
|
1997
|
-
return index;
|
|
1998
|
-
}
|
|
1999
|
-
return newId;
|
|
2000
|
-
}();
|
|
2001
|
-
var createSnapshotId = generateKey;
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
2004
|
-
var require_env2 = __commonJS2({
|
|
2005
|
-
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
|
|
2006
|
-
"use strict";
|
|
2007
|
-
var __defProp22 = Object.defineProperty;
|
|
2008
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2009
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2010
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2011
|
-
var __export22 = (target, all) => {
|
|
2012
|
-
for (var name in all)
|
|
2013
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2014
|
-
};
|
|
2015
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2016
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2017
|
-
for (let key of __getOwnPropNames22(from))
|
|
2018
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2019
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2020
|
-
}
|
|
2021
|
-
return to;
|
|
2022
|
-
};
|
|
2023
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2024
|
-
var env_exports = {};
|
|
2025
|
-
__export22(env_exports, {
|
|
2026
|
-
NODE_ENV: () => NODE_ENV,
|
|
2027
|
-
getNev: () => getNev,
|
|
2028
|
-
isDevelopment: () => isDevelopment,
|
|
2029
|
-
isProduction: () => isProduction,
|
|
2030
|
-
isTest: () => isTest
|
|
2031
|
-
});
|
|
2032
|
-
module22.exports = __toCommonJS22(env_exports);
|
|
2033
|
-
var NODE_ENV = "development";
|
|
2034
|
-
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
2035
|
-
var isTest = (env = NODE_ENV) => env === "test";
|
|
2036
|
-
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
2037
|
-
var getNev = (key, env = NODE_ENV) => env[key];
|
|
2038
|
-
}
|
|
2039
|
-
});
|
|
2040
|
-
var require_globals2 = __commonJS2({
|
|
2041
|
-
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
|
|
2042
|
-
"use strict";
|
|
2043
|
-
var __defProp22 = Object.defineProperty;
|
|
2044
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2045
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2046
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2047
|
-
var __export22 = (target, all) => {
|
|
2048
|
-
for (var name in all)
|
|
2049
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2050
|
-
};
|
|
2051
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2052
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2053
|
-
for (let key of __getOwnPropNames22(from))
|
|
2054
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2055
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2056
|
-
}
|
|
2057
|
-
return to;
|
|
2058
|
-
};
|
|
2059
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2060
|
-
var globals_exports = {};
|
|
2061
|
-
__export22(globals_exports, {
|
|
2062
|
-
document: () => document2,
|
|
2063
|
-
global: () => global,
|
|
2064
|
-
self: () => self,
|
|
2065
|
-
window: () => window2
|
|
2066
|
-
});
|
|
2067
|
-
module22.exports = __toCommonJS22(globals_exports);
|
|
2068
|
-
var global = globalThis;
|
|
2069
|
-
var self = globalThis;
|
|
2070
|
-
var window2 = globalThis;
|
|
2071
|
-
var document2 = window2.document;
|
|
2072
|
-
}
|
|
2073
|
-
});
|
|
2074
|
-
var require_node2 = __commonJS2({
|
|
2075
|
-
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
|
|
2076
|
-
"use strict";
|
|
2077
|
-
var __defProp22 = Object.defineProperty;
|
|
2078
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2079
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2080
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2081
|
-
var __export22 = (target, all) => {
|
|
2082
|
-
for (var name in all)
|
|
2083
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2084
|
-
};
|
|
2085
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2086
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2087
|
-
for (let key of __getOwnPropNames22(from))
|
|
2088
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2089
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2090
|
-
}
|
|
2091
|
-
return to;
|
|
2092
|
-
};
|
|
2093
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2094
|
-
var node_exports = {};
|
|
2095
|
-
__export22(node_exports, {
|
|
2096
|
-
isDOMNode: () => isDOMNode,
|
|
2097
|
-
isHtmlElement: () => isHtmlElement,
|
|
2098
|
-
isNode: () => isNode
|
|
2099
|
-
});
|
|
2100
|
-
module22.exports = __toCommonJS22(node_exports);
|
|
2101
|
-
var import_globals = require_globals2();
|
|
2102
|
-
var isNode = (obj) => {
|
|
2103
|
-
return (typeof Node === "object" ? obj instanceof import_globals.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
2104
|
-
};
|
|
2105
|
-
var isHtmlElement = (obj) => {
|
|
2106
|
-
return (typeof HTMLElement === "object" ? obj instanceof import_globals.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
2107
|
-
};
|
|
2108
|
-
var isDOMNode = (obj) => {
|
|
2109
|
-
return typeof import_globals.window !== "undefined" && (obj instanceof import_globals.window.Node || obj instanceof import_globals.window.Window || obj === import_globals.window || obj === document);
|
|
2110
|
-
};
|
|
2111
|
-
}
|
|
2112
|
-
});
|
|
2113
|
-
var require_types2 = __commonJS2({
|
|
2114
|
-
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
|
|
2115
|
-
"use strict";
|
|
2116
|
-
var __defProp22 = Object.defineProperty;
|
|
2117
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2118
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2119
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2120
|
-
var __export22 = (target, all) => {
|
|
2121
|
-
for (var name in all)
|
|
2122
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2123
|
-
};
|
|
2124
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2125
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2126
|
-
for (let key of __getOwnPropNames22(from))
|
|
2127
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2128
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2129
|
-
}
|
|
2130
|
-
return to;
|
|
2131
|
-
};
|
|
2132
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2133
|
-
var types_exports = {};
|
|
2134
|
-
__export22(types_exports, {
|
|
2135
|
-
TYPES: () => TYPES,
|
|
2136
|
-
is: () => is,
|
|
2137
|
-
isArray: () => isArray3,
|
|
2138
|
-
isBoolean: () => isBoolean,
|
|
2139
|
-
isDate: () => isDate,
|
|
2140
|
-
isDefined: () => isDefined2,
|
|
2141
|
-
isFunction: () => isFunction,
|
|
2142
|
-
isNot: () => isNot,
|
|
2143
|
-
isNull: () => isNull,
|
|
2144
|
-
isNumber: () => isNumber2,
|
|
2145
|
-
isObject: () => isObject3,
|
|
2146
|
-
isObjectLike: () => isObjectLike2,
|
|
2147
|
-
isString: () => isString2,
|
|
2148
|
-
isUndefined: () => isUndefined
|
|
2149
|
-
});
|
|
2150
|
-
module22.exports = __toCommonJS22(types_exports);
|
|
2151
|
-
var import_node = require_node2();
|
|
2152
|
-
var isObject3 = (arg) => {
|
|
2153
|
-
if (arg === null)
|
|
2154
|
-
return false;
|
|
2155
|
-
return typeof arg === "object" && arg.constructor === Object;
|
|
2156
|
-
};
|
|
2157
|
-
var isString2 = (arg) => typeof arg === "string";
|
|
2158
|
-
var isNumber2 = (arg) => typeof arg === "number";
|
|
2159
|
-
var isFunction = (arg) => typeof arg === "function";
|
|
2160
|
-
var isBoolean = (arg) => arg === true || arg === false;
|
|
2161
|
-
var isNull = (arg) => arg === null;
|
|
2162
|
-
var isArray3 = (arg) => Array.isArray(arg);
|
|
2163
|
-
var isDate = (d) => d instanceof Date;
|
|
2164
|
-
var isObjectLike2 = (arg) => {
|
|
2165
|
-
if (arg === null)
|
|
2166
|
-
return false;
|
|
2167
|
-
return typeof arg === "object";
|
|
2168
|
-
};
|
|
2169
|
-
var isDefined2 = (arg) => {
|
|
2170
|
-
return isObject3(arg) || isObjectLike2(arg) || isString2(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
2171
|
-
};
|
|
2172
|
-
var isUndefined = (arg) => {
|
|
2173
|
-
return arg === void 0;
|
|
2174
|
-
};
|
|
2175
|
-
var TYPES = {
|
|
2176
|
-
boolean: isBoolean,
|
|
2177
|
-
array: isArray3,
|
|
2178
|
-
object: isObject3,
|
|
2179
|
-
string: isString2,
|
|
2180
|
-
date: isDate,
|
|
2181
|
-
number: isNumber2,
|
|
2182
|
-
null: isNull,
|
|
2183
|
-
function: isFunction,
|
|
2184
|
-
objectLike: isObjectLike2,
|
|
2185
|
-
node: import_node.isNode,
|
|
2186
|
-
htmlElement: import_node.isHtmlElement,
|
|
2187
|
-
defined: isDefined2
|
|
2188
|
-
};
|
|
2189
|
-
var is = (arg) => {
|
|
2190
|
-
return (...args) => {
|
|
2191
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
2192
|
-
};
|
|
2193
|
-
};
|
|
2194
|
-
var isNot = (arg) => {
|
|
2195
|
-
return (...args) => {
|
|
2196
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
2197
|
-
};
|
|
2198
|
-
};
|
|
2199
|
-
}
|
|
2200
|
-
});
|
|
2201
|
-
var require_array2 = __commonJS2({
|
|
2202
|
-
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
|
|
2203
|
-
"use strict";
|
|
2204
|
-
var __defProp22 = Object.defineProperty;
|
|
2205
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2206
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2207
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2208
|
-
var __export22 = (target, all) => {
|
|
2209
|
-
for (var name in all)
|
|
2210
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2211
|
-
};
|
|
2212
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2213
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2214
|
-
for (let key of __getOwnPropNames22(from))
|
|
2215
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2216
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2217
|
-
}
|
|
2218
|
-
return to;
|
|
2219
|
-
};
|
|
2220
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2221
|
-
var array_exports = {};
|
|
2222
|
-
__export22(array_exports, {
|
|
2223
|
-
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2224
|
-
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2225
|
-
arraysEqual: () => arraysEqual,
|
|
2226
|
-
checkIfStringIsInArray: () => checkIfStringIsInArray,
|
|
2227
|
-
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2228
|
-
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2229
|
-
filterArrays: () => filterArrays,
|
|
2230
|
-
filterArraysFast: () => filterArraysFast,
|
|
2231
|
-
getFrequencyInArray: () => getFrequencyInArray,
|
|
2232
|
-
joinArrays: () => joinArrays,
|
|
2233
|
-
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
2234
|
-
mergeArray: () => mergeArray,
|
|
2235
|
-
removeFromArray: () => removeFromArray,
|
|
2236
|
-
removeValueFromArray: () => removeValueFromArray,
|
|
2237
|
-
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
2238
|
-
reorderArrayByValues: () => reorderArrayByValues,
|
|
2239
|
-
swapItemsInArray: () => swapItemsInArray
|
|
2240
|
-
});
|
|
2241
|
-
module22.exports = __toCommonJS22(array_exports);
|
|
2242
|
-
var import_object = require_object2();
|
|
2243
|
-
var import_types = require_types2();
|
|
2244
|
-
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
2245
|
-
return arr2.every((val) => arr1.includes(val));
|
|
2246
|
-
};
|
|
2247
|
-
var getFrequencyInArray = (arr, value) => {
|
|
2248
|
-
return arr.reduce((count, currentValue) => {
|
|
2249
|
-
return currentValue === value ? count + 1 : count;
|
|
2250
|
-
}, 0);
|
|
2251
|
-
};
|
|
2252
|
-
var removeFromArray = (arr, index) => {
|
|
2253
|
-
if ((0, import_types.isString)(index))
|
|
2254
|
-
index = parseInt(index);
|
|
2255
|
-
if ((0, import_types.isNumber)(index)) {
|
|
2256
|
-
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
2257
|
-
throw new Error("Invalid index");
|
|
2258
|
-
}
|
|
2259
|
-
arr.splice(index, 1);
|
|
2260
|
-
} else if ((0, import_types.isArray)(index)) {
|
|
2261
|
-
index.forEach((idx) => removeFromArray(arr, idx));
|
|
2262
|
-
} else {
|
|
2263
|
-
throw new Error("Invalid index");
|
|
2264
|
-
}
|
|
2265
|
-
return arr;
|
|
2266
|
-
};
|
|
2267
|
-
var swapItemsInArray = (arr, i, j) => {
|
|
2268
|
-
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
2269
|
-
};
|
|
2270
|
-
var joinArrays = (...arrays) => {
|
|
2271
|
-
return [].concat(...arrays);
|
|
2272
|
-
};
|
|
2273
|
-
var mergeArray = (arr, exclude = []) => {
|
|
2274
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
|
|
2275
|
-
};
|
|
2276
|
-
var mergeAndCloneIfArray = (obj) => {
|
|
2277
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2278
|
-
};
|
|
2279
|
-
var cutArrayBeforeValue = (arr, value) => {
|
|
2280
|
-
const index = arr.indexOf(value);
|
|
2281
|
-
if (index !== -1) {
|
|
2282
|
-
return arr.slice(0, index);
|
|
2283
|
-
}
|
|
2284
|
-
return arr;
|
|
2285
|
-
};
|
|
2286
|
-
var cutArrayAfterValue = (arr, value) => {
|
|
2287
|
-
if (!(0, import_types.isArray)(arr))
|
|
2288
|
-
return;
|
|
2289
|
-
const index = arr.indexOf(value);
|
|
2290
|
-
if (index !== -1) {
|
|
2291
|
-
return arr.slice(index + 1);
|
|
2292
|
-
}
|
|
2293
|
-
return arr;
|
|
2294
|
-
};
|
|
2295
|
-
var removeValueFromArray = (arr, value) => {
|
|
2296
|
-
const index = arr.indexOf(value);
|
|
2297
|
-
if (index > -1) {
|
|
2298
|
-
const newArray = [...arr];
|
|
2299
|
-
newArray.splice(index, 1);
|
|
2300
|
-
return newArray;
|
|
2301
|
-
}
|
|
2302
|
-
return arr;
|
|
2303
|
-
};
|
|
2304
|
-
var removeValueFromArrayAll = (arr, value) => {
|
|
2305
|
-
return arr.filter((item) => item !== value);
|
|
2306
|
-
};
|
|
2307
|
-
var addItemAfterEveryElement = (array, item) => {
|
|
2308
|
-
const result = [];
|
|
2309
|
-
for (let i = 0; i < array.length; i++) {
|
|
2310
|
-
result.push(array[i]);
|
|
2311
|
-
if (i < array.length - 1) {
|
|
2312
|
-
result.push(item);
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
return result;
|
|
2316
|
-
};
|
|
2317
|
-
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
2318
|
-
const newArray = [...array];
|
|
2319
|
-
const indexToMove = newArray.indexOf(valueToMove);
|
|
2320
|
-
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
2321
|
-
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
2322
|
-
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
2323
|
-
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
2324
|
-
newArray.splice(insertIndex, 0, removedItem);
|
|
2325
|
-
}
|
|
2326
|
-
return newArray;
|
|
2327
|
-
};
|
|
2328
|
-
var arraysEqual = (arr1, arr2) => {
|
|
2329
|
-
if (arr1.length !== arr2.length) {
|
|
2330
|
-
return false;
|
|
2331
|
-
}
|
|
2332
|
-
for (let i = 0; i < arr1.length; i++) {
|
|
2333
|
-
if (arr1[i] !== arr2[i]) {
|
|
2334
|
-
return false;
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
return true;
|
|
2338
|
-
};
|
|
2339
|
-
var filterArrays = (sourceArr, excludeArr) => {
|
|
2340
|
-
return sourceArr.filter((item) => !excludeArr.includes(item));
|
|
2341
|
-
};
|
|
2342
|
-
var filterArraysFast = (sourceArr, excludeArr) => {
|
|
2343
|
-
const excludeSet = new Set(excludeArr);
|
|
2344
|
-
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
2345
|
-
};
|
|
2346
|
-
var checkIfStringIsInArray = (string, arr) => {
|
|
2347
|
-
if (!string)
|
|
2348
|
-
return;
|
|
2349
|
-
return arr.filter((v) => string.includes(v)).length;
|
|
2350
|
-
};
|
|
2351
|
-
}
|
|
2352
|
-
});
|
|
2353
|
-
var require_string2 = __commonJS2({
|
|
2354
|
-
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
|
|
2355
|
-
"use strict";
|
|
2356
|
-
var __defProp22 = Object.defineProperty;
|
|
2357
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2358
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2359
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2360
|
-
var __export22 = (target, all) => {
|
|
2361
|
-
for (var name in all)
|
|
2362
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2363
|
-
};
|
|
2364
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2365
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2366
|
-
for (let key of __getOwnPropNames22(from))
|
|
2367
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2368
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2369
|
-
}
|
|
2370
|
-
return to;
|
|
2371
|
-
};
|
|
2372
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2373
|
-
var string_exports = {};
|
|
2374
|
-
__export22(string_exports, {
|
|
2375
|
-
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
2376
|
-
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
2377
|
-
decodeNewlines: () => decodeNewlines,
|
|
2378
|
-
encodeNewlines: () => encodeNewlines,
|
|
2379
|
-
findKeyPosition: () => findKeyPosition,
|
|
2380
|
-
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
2381
|
-
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
2382
|
-
replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
|
|
2383
|
-
stringIncludesAny: () => stringIncludesAny,
|
|
2384
|
-
trimStringFromSymbols: () => trimStringFromSymbols
|
|
2385
|
-
});
|
|
2386
|
-
module22.exports = __toCommonJS22(string_exports);
|
|
2387
|
-
var stringIncludesAny = (str, characters) => {
|
|
2388
|
-
for (const char of characters) {
|
|
2389
|
-
if (str.includes(char)) {
|
|
2390
|
-
return true;
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
return false;
|
|
2394
|
-
};
|
|
2395
|
-
var trimStringFromSymbols = (str, characters) => {
|
|
2396
|
-
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
2397
|
-
return str.replace(pattern, "");
|
|
2398
|
-
};
|
|
2399
|
-
var brackRegex = {
|
|
2400
|
-
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2401
|
-
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2402
|
-
};
|
|
2403
|
-
function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
|
|
2404
|
-
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2405
|
-
return str;
|
|
2406
|
-
const reg = brackRegex[options.bracketsLength || 2];
|
|
2407
|
-
const obj = forcedState || this.state || {};
|
|
2408
|
-
return str.replace(reg, (_, parentPath, variable) => {
|
|
2409
|
-
if (parentPath) {
|
|
2410
|
-
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2411
|
-
let parentState = obj;
|
|
2412
|
-
for (let i = 0; i < parentLevels; i++) {
|
|
2413
|
-
parentState = parentState.parent;
|
|
2414
|
-
if (!parentState) {
|
|
2415
|
-
return "";
|
|
2416
|
-
}
|
|
2417
|
-
}
|
|
2418
|
-
const value = parentState[variable.trim()];
|
|
2419
|
-
return value !== void 0 ? `${value}` : "";
|
|
2420
|
-
} else {
|
|
2421
|
-
const value = obj[variable.trim()];
|
|
2422
|
-
return value !== void 0 ? `${value}` : "";
|
|
2423
|
-
}
|
|
2424
|
-
});
|
|
2425
|
-
}
|
|
2426
|
-
var lowercaseFirstLetter = (inputString) => {
|
|
2427
|
-
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2428
|
-
};
|
|
2429
|
-
var findKeyPosition = (str, key) => {
|
|
2430
|
-
const lines = str.split("\n");
|
|
2431
|
-
let startLineNumber = -1;
|
|
2432
|
-
let endLineNumber = -1;
|
|
2433
|
-
let startColumn = -1;
|
|
2434
|
-
let endColumn = -1;
|
|
2435
|
-
const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
|
|
2436
|
-
let braceCount = 0;
|
|
2437
|
-
let foundKey = false;
|
|
2438
|
-
for (let i = 0; i < lines.length; i++) {
|
|
2439
|
-
if (keyPattern.test(lines[i]) && !foundKey) {
|
|
2440
|
-
foundKey = true;
|
|
2441
|
-
startLineNumber = i + 1;
|
|
2442
|
-
startColumn = lines[i].indexOf(key) + 1;
|
|
2443
|
-
if (lines[i].includes("{}")) {
|
|
2444
|
-
endLineNumber = startLineNumber;
|
|
2445
|
-
endColumn = lines[i].indexOf("{}") + 3;
|
|
2446
|
-
break;
|
|
2447
|
-
}
|
|
2448
|
-
const line = lines[i].slice(startColumn + key.length);
|
|
2449
|
-
if (line.includes("{") || line.includes("[")) {
|
|
2450
|
-
braceCount = 1;
|
|
2451
|
-
} else {
|
|
2452
|
-
endLineNumber = i + 1;
|
|
2453
|
-
endColumn = lines[i].length + 1;
|
|
2454
|
-
break;
|
|
2455
|
-
}
|
|
2456
|
-
} else if (foundKey) {
|
|
2457
|
-
braceCount += (lines[i].match(/{/g) || []).length;
|
|
2458
|
-
braceCount += (lines[i].match(/\[/g) || []).length;
|
|
2459
|
-
braceCount -= (lines[i].match(/}/g) || []).length;
|
|
2460
|
-
braceCount -= (lines[i].match(/]/g) || []).length;
|
|
2461
|
-
if (braceCount === 0) {
|
|
2462
|
-
endLineNumber = i + 1;
|
|
2463
|
-
endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
|
|
2464
|
-
break;
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
return {
|
|
2469
|
-
startColumn,
|
|
2470
|
-
endColumn,
|
|
2471
|
-
startLineNumber,
|
|
2472
|
-
endLineNumber
|
|
2473
|
-
};
|
|
2474
|
-
};
|
|
2475
|
-
var replaceOctalEscapeSequences = (str) => {
|
|
2476
|
-
const octalRegex = /\\([0-7]{1,3})/g;
|
|
2477
|
-
return str.replace(octalRegex, (match, p1) => {
|
|
2478
|
-
const octalValue = parseInt(p1, 8);
|
|
2479
|
-
const char = String.fromCharCode(octalValue);
|
|
2480
|
-
return char;
|
|
2481
|
-
});
|
|
2482
|
-
};
|
|
2483
|
-
var encodeNewlines = (str) => {
|
|
2484
|
-
return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
|
|
2485
|
-
};
|
|
2486
|
-
var decodeNewlines = (encodedStr) => {
|
|
2487
|
-
return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
|
|
2488
|
-
};
|
|
2489
|
-
var customEncodeURIComponent = (str) => {
|
|
2490
|
-
return str.split("").map((char) => {
|
|
2491
|
-
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
2492
|
-
return "%" + char.charCodeAt(0).toString(16).toUpperCase();
|
|
2493
|
-
}
|
|
2494
|
-
return char;
|
|
2495
|
-
}).join("");
|
|
2496
|
-
};
|
|
2497
|
-
var customDecodeURIComponent = (encodedStr) => {
|
|
2498
|
-
return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
|
|
2499
|
-
};
|
|
2500
|
-
}
|
|
2501
|
-
});
|
|
2502
|
-
var require_object2 = __commonJS2({
|
|
2503
|
-
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
|
|
2504
|
-
"use strict";
|
|
2505
|
-
var __defProp22 = Object.defineProperty;
|
|
2506
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2507
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2508
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2509
|
-
var __export22 = (target, all) => {
|
|
2510
|
-
for (var name in all)
|
|
2511
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2512
|
-
};
|
|
2513
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2514
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2515
|
-
for (let key of __getOwnPropNames22(from))
|
|
2516
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2517
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2518
|
-
}
|
|
2519
|
-
return to;
|
|
2520
|
-
};
|
|
2521
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2522
|
-
var object_exports = {};
|
|
2523
|
-
__export22(object_exports, {
|
|
2524
|
-
clone: () => clone,
|
|
2525
|
-
createNestedObject: () => createNestedObject,
|
|
2526
|
-
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2527
|
-
deepClone: () => deepClone2,
|
|
2528
|
-
deepContains: () => deepContains,
|
|
2529
|
-
deepDestringify: () => deepDestringify,
|
|
2530
|
-
deepDiff: () => deepDiff,
|
|
2531
|
-
deepMerge: () => deepMerge2,
|
|
2532
|
-
deepStringify: () => deepStringify,
|
|
2533
|
-
deepStringifyWithMaxDepth: () => deepStringifyWithMaxDepth,
|
|
2534
|
-
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
2535
|
-
detectInfiniteLoop: () => detectInfiniteLoop,
|
|
2536
|
-
diff: () => diff,
|
|
2537
|
-
diffArrays: () => diffArrays,
|
|
2538
|
-
diffObjects: () => diffObjects,
|
|
2539
|
-
excludeKeysFromObject: () => excludeKeysFromObject,
|
|
2540
|
-
exec: () => exec,
|
|
2541
|
-
flattenRecursive: () => flattenRecursive,
|
|
2542
|
-
hasOwnProperty: () => hasOwnProperty,
|
|
2543
|
-
isCyclic: () => isCyclic,
|
|
2544
|
-
isEmpty: () => isEmpty,
|
|
2545
|
-
isEmptyObject: () => isEmptyObject,
|
|
2546
|
-
isEqualDeep: () => isEqualDeep,
|
|
2547
|
-
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
2548
|
-
map: () => map,
|
|
2549
|
-
merge: () => merge,
|
|
2550
|
-
mergeArrayExclude: () => mergeArrayExclude,
|
|
2551
|
-
mergeIfExisted: () => mergeIfExisted,
|
|
2552
|
-
objectToString: () => objectToString,
|
|
2553
|
-
overwrite: () => overwrite,
|
|
2554
|
-
overwriteDeep: () => overwriteDeep,
|
|
2555
|
-
overwriteShallow: () => overwriteShallow,
|
|
2556
|
-
removeFromObject: () => removeFromObject,
|
|
2557
|
-
removeNestedKeyByPath: () => removeNestedKeyByPath,
|
|
2558
|
-
stringToObject: () => stringToObject
|
|
2559
|
-
});
|
|
2560
|
-
module22.exports = __toCommonJS22(object_exports);
|
|
2561
|
-
var import_globals = require_globals2();
|
|
2562
|
-
var import_types = require_types2();
|
|
2563
|
-
var import_array = require_array2();
|
|
2564
|
-
var import_string = require_string2();
|
|
2565
|
-
var import_node = require_node2();
|
|
2566
|
-
var ENV = "development";
|
|
2567
|
-
var exec = (param, element, state, context) => {
|
|
2568
|
-
if ((0, import_types.isFunction)(param)) {
|
|
2569
|
-
return param.call(
|
|
2570
|
-
element,
|
|
2571
|
-
element,
|
|
2572
|
-
state || element.state,
|
|
2573
|
-
context || element.context
|
|
2574
|
-
);
|
|
2575
|
-
}
|
|
2576
|
-
return param;
|
|
2577
|
-
};
|
|
2578
|
-
var map = (obj, extention, element) => {
|
|
2579
|
-
for (const e in extention) {
|
|
2580
|
-
obj[e] = exec(extention[e], element);
|
|
2581
|
-
}
|
|
2582
|
-
};
|
|
2583
|
-
var merge = (element, obj, excludeFrom = []) => {
|
|
2584
|
-
for (const e in obj) {
|
|
2585
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
2586
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2587
|
-
continue;
|
|
2588
|
-
const elementProp = element[e];
|
|
2589
|
-
const objProp = obj[e];
|
|
2590
|
-
if (elementProp === void 0) {
|
|
2591
|
-
element[e] = objProp;
|
|
2592
|
-
}
|
|
2593
|
-
}
|
|
2594
|
-
return element;
|
|
2595
|
-
};
|
|
2596
|
-
var deepMerge2 = (element, extend, excludeFrom = []) => {
|
|
2597
|
-
for (const e in extend) {
|
|
2598
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
2599
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2600
|
-
continue;
|
|
2601
|
-
const elementProp = element[e];
|
|
2602
|
-
const extendProp = extend[e];
|
|
2603
|
-
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
2604
|
-
deepMerge2(elementProp, extendProp, excludeFrom);
|
|
2605
|
-
} else if (elementProp === void 0) {
|
|
2606
|
-
element[e] = extendProp;
|
|
2607
|
-
}
|
|
2608
|
-
}
|
|
2609
|
-
return element;
|
|
2610
|
-
};
|
|
2611
|
-
var clone = (obj, excludeFrom = []) => {
|
|
2612
|
-
const o = {};
|
|
2613
|
-
for (const prop in obj) {
|
|
2614
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2615
|
-
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2616
|
-
continue;
|
|
2617
|
-
o[prop] = obj[prop];
|
|
2618
|
-
}
|
|
2619
|
-
return o;
|
|
2620
|
-
};
|
|
2621
|
-
var mergeArrayExclude = (arr, exclude = []) => {
|
|
2622
|
-
return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
|
|
2623
|
-
};
|
|
2624
|
-
var deepClone2 = (obj, options = {}) => {
|
|
2625
|
-
const {
|
|
2626
|
-
exclude = [],
|
|
2627
|
-
cleanUndefined = false,
|
|
2628
|
-
cleanNull = false,
|
|
2629
|
-
window: targetWindow,
|
|
2630
|
-
visited = /* @__PURE__ */ new WeakMap(),
|
|
2631
|
-
handleExtend = false
|
|
2632
|
-
} = options;
|
|
2633
|
-
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
|
|
2634
|
-
return obj;
|
|
2635
|
-
}
|
|
2636
|
-
if (visited.has(obj)) {
|
|
2637
|
-
return visited.get(obj);
|
|
2638
|
-
}
|
|
2639
|
-
const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
|
|
2640
|
-
visited.set(obj, clone2);
|
|
2641
|
-
for (const key in obj) {
|
|
2642
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
2643
|
-
continue;
|
|
2644
|
-
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
2645
|
-
continue;
|
|
2646
|
-
const value = obj[key];
|
|
2647
|
-
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
2648
|
-
continue;
|
|
2649
|
-
if ((0, import_node.isDOMNode)(value)) {
|
|
2650
|
-
clone2[key] = value;
|
|
2651
|
-
continue;
|
|
2652
|
-
}
|
|
2653
|
-
if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
|
|
2654
|
-
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
2655
|
-
continue;
|
|
2656
|
-
}
|
|
2657
|
-
if ((0, import_types.isFunction)(value) && targetWindow) {
|
|
2658
|
-
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
2659
|
-
continue;
|
|
2660
|
-
}
|
|
2661
|
-
if ((0, import_types.isObjectLike)(value)) {
|
|
2662
|
-
clone2[key] = deepClone2(value, {
|
|
2663
|
-
...options,
|
|
2664
|
-
visited
|
|
2665
|
-
});
|
|
2666
|
-
} else {
|
|
2667
|
-
clone2[key] = value;
|
|
2668
|
-
}
|
|
2669
|
-
}
|
|
2670
|
-
return clone2;
|
|
2671
|
-
};
|
|
2672
|
-
var deepStringify = (obj, stringified = {}) => {
|
|
2673
|
-
var _a, _b;
|
|
2674
|
-
if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
|
|
2675
|
-
(obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
|
|
2676
|
-
obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
|
|
2677
|
-
}
|
|
2678
|
-
for (const prop in obj) {
|
|
2679
|
-
const objProp = obj[prop];
|
|
2680
|
-
if ((0, import_types.isFunction)(objProp)) {
|
|
2681
|
-
stringified[prop] = objProp.toString();
|
|
2682
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
2683
|
-
stringified[prop] = {};
|
|
2684
|
-
deepStringify(objProp, stringified[prop]);
|
|
2685
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2686
|
-
stringified[prop] = [];
|
|
2687
|
-
objProp.forEach((v, i) => {
|
|
2688
|
-
if ((0, import_types.isObject)(v)) {
|
|
2689
|
-
stringified[prop][i] = {};
|
|
2690
|
-
deepStringify(v, stringified[prop][i]);
|
|
2691
|
-
} else if ((0, import_types.isFunction)(v)) {
|
|
2692
|
-
stringified[prop][i] = v.toString();
|
|
2693
|
-
} else {
|
|
2694
|
-
stringified[prop][i] = v;
|
|
2695
|
-
}
|
|
2696
|
-
});
|
|
2697
|
-
} else {
|
|
2698
|
-
stringified[prop] = objProp;
|
|
2699
|
-
}
|
|
2700
|
-
}
|
|
2701
|
-
return stringified;
|
|
2702
|
-
};
|
|
2703
|
-
var MAX_DEPTH = 100;
|
|
2704
|
-
var deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path = "") => {
|
|
2705
|
-
if (depth > MAX_DEPTH) {
|
|
2706
|
-
console.warn(`Maximum depth exceeded at path: ${path}. Possible circular reference.`);
|
|
2707
|
-
return "[MAX_DEPTH_EXCEEDED]";
|
|
2708
|
-
}
|
|
2709
|
-
for (const prop in obj) {
|
|
2710
|
-
const currentPath = path ? `${path}.${prop}` : prop;
|
|
2711
|
-
const objProp = obj[prop];
|
|
2712
|
-
if ((0, import_types.isFunction)(objProp)) {
|
|
2713
|
-
stringified[prop] = objProp.toString();
|
|
2714
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
2715
|
-
stringified[prop] = {};
|
|
2716
|
-
deepStringifyWithMaxDepth(objProp, stringified[prop], depth + 1, currentPath);
|
|
2717
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2718
|
-
stringified[prop] = [];
|
|
2719
|
-
objProp.forEach((v, i) => {
|
|
2720
|
-
const itemPath = `${currentPath}[${i}]`;
|
|
2721
|
-
if ((0, import_types.isObject)(v)) {
|
|
2722
|
-
stringified[prop][i] = {};
|
|
2723
|
-
deepStringifyWithMaxDepth(v, stringified[prop][i], depth + 1, itemPath);
|
|
2724
|
-
} else if ((0, import_types.isFunction)(v)) {
|
|
2725
|
-
stringified[prop][i] = v.toString();
|
|
2726
|
-
} else {
|
|
2727
|
-
stringified[prop][i] = v;
|
|
2728
|
-
}
|
|
2729
|
-
});
|
|
2730
|
-
} else {
|
|
2731
|
-
stringified[prop] = objProp;
|
|
2732
|
-
}
|
|
2733
|
-
}
|
|
2734
|
-
return stringified;
|
|
2735
|
-
};
|
|
2736
|
-
var objectToString = (obj = {}, indent = 0) => {
|
|
2737
|
-
if (obj === null || typeof obj !== "object") {
|
|
2738
|
-
return String(obj);
|
|
2739
|
-
}
|
|
2740
|
-
if (Object.keys(obj).length === 0) {
|
|
2741
|
-
return "{}";
|
|
2742
|
-
}
|
|
2743
|
-
const spaces = " ".repeat(indent);
|
|
2744
|
-
let str = "{\n";
|
|
2745
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
2746
|
-
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2747
|
-
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2748
|
-
str += `${spaces} ${stringedKey}: `;
|
|
2749
|
-
if ((0, import_types.isArray)(value)) {
|
|
2750
|
-
str += "[\n";
|
|
2751
|
-
for (const element of value) {
|
|
2752
|
-
if ((0, import_types.isObjectLike)(element) && element !== null) {
|
|
2753
|
-
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2754
|
-
`;
|
|
2755
|
-
} else if ((0, import_types.isString)(element)) {
|
|
2756
|
-
str += `${spaces} '${element}',
|
|
2757
|
-
`;
|
|
2758
|
-
} else {
|
|
2759
|
-
str += `${spaces} ${element},
|
|
2760
|
-
`;
|
|
2761
|
-
}
|
|
2762
|
-
}
|
|
2763
|
-
str += `${spaces} ]`;
|
|
2764
|
-
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2765
|
-
str += objectToString(value, indent + 1);
|
|
2766
|
-
} else if ((0, import_types.isString)(value)) {
|
|
2767
|
-
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2768
|
-
} else {
|
|
2769
|
-
str += value;
|
|
2770
|
-
}
|
|
2771
|
-
str += ",\n";
|
|
2772
|
-
}
|
|
2773
|
-
str += `${spaces}}`;
|
|
2774
|
-
return str;
|
|
2775
|
-
};
|
|
2776
|
-
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2777
|
-
for (const prop in obj) {
|
|
2778
|
-
const objProp = obj[prop];
|
|
2779
|
-
if ((0, import_types.isFunction)(objProp))
|
|
2780
|
-
continue;
|
|
2781
|
-
else if ((0, import_types.isObject)(objProp)) {
|
|
2782
|
-
detached[prop] = {};
|
|
2783
|
-
deepStringify(objProp, detached[prop]);
|
|
2784
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2785
|
-
detached[prop] = [];
|
|
2786
|
-
objProp.forEach((v, i) => {
|
|
2787
|
-
if ((0, import_types.isFunction)(v))
|
|
2788
|
-
return;
|
|
2789
|
-
if ((0, import_types.isObject)(v)) {
|
|
2790
|
-
detached[prop][i] = {};
|
|
2791
|
-
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2792
|
-
} else {
|
|
2793
|
-
detached[prop][i] = v;
|
|
2794
|
-
}
|
|
2795
|
-
});
|
|
2796
|
-
} else {
|
|
2797
|
-
detached[prop] = objProp;
|
|
2798
|
-
}
|
|
2799
|
-
}
|
|
2800
|
-
return detached;
|
|
2801
|
-
};
|
|
2802
|
-
var deepDestringify = (obj, destringified = {}) => {
|
|
2803
|
-
for (const prop in obj) {
|
|
2804
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2805
|
-
if (!hasOwnProperty2)
|
|
2806
|
-
continue;
|
|
2807
|
-
const objProp = obj[prop];
|
|
2808
|
-
if ((0, import_types.isString)(objProp)) {
|
|
2809
|
-
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2810
|
-
try {
|
|
2811
|
-
const evalProp = import_globals.window.eval(`(${objProp})`);
|
|
2812
|
-
destringified[prop] = evalProp;
|
|
2813
|
-
} catch (e) {
|
|
2814
|
-
if (e)
|
|
2815
|
-
destringified[prop] = objProp;
|
|
2816
|
-
}
|
|
2817
|
-
} else {
|
|
2818
|
-
destringified[prop] = objProp;
|
|
2819
|
-
}
|
|
2820
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2821
|
-
destringified[prop] = [];
|
|
2822
|
-
objProp.forEach((arrProp) => {
|
|
2823
|
-
if ((0, import_types.isString)(arrProp)) {
|
|
2824
|
-
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2825
|
-
try {
|
|
2826
|
-
const evalProp = import_globals.window.eval(`(${arrProp})`);
|
|
2827
|
-
destringified[prop].push(evalProp);
|
|
2828
|
-
} catch (e) {
|
|
2829
|
-
if (e)
|
|
2830
|
-
destringified[prop].push(arrProp);
|
|
2831
|
-
}
|
|
2832
|
-
} else {
|
|
2833
|
-
destringified[prop].push(arrProp);
|
|
2834
|
-
}
|
|
2835
|
-
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2836
|
-
destringified[prop].push(deepDestringify(arrProp));
|
|
2837
|
-
} else {
|
|
2838
|
-
destringified[prop].push(arrProp);
|
|
2839
|
-
}
|
|
2840
|
-
});
|
|
2841
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
2842
|
-
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2843
|
-
} else {
|
|
2844
|
-
destringified[prop] = objProp;
|
|
2845
|
-
}
|
|
2846
|
-
}
|
|
2847
|
-
return destringified;
|
|
2848
|
-
};
|
|
2849
|
-
var stringToObject = (str, opts = { verbose: true }) => {
|
|
2850
|
-
try {
|
|
2851
|
-
return str ? import_globals.window.eval("(" + str + ")") : {};
|
|
2852
|
-
} catch (e) {
|
|
2853
|
-
if (opts.verbose)
|
|
2854
|
-
console.warn(e);
|
|
2855
|
-
}
|
|
2856
|
-
};
|
|
2857
|
-
var diffObjects = (original, objToDiff, cache) => {
|
|
2858
|
-
for (const e in objToDiff) {
|
|
2859
|
-
if (e === "ref")
|
|
2860
|
-
continue;
|
|
2861
|
-
const originalProp = original[e];
|
|
2862
|
-
const objToDiffProp = objToDiff[e];
|
|
2863
|
-
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2864
|
-
cache[e] = {};
|
|
2865
|
-
diff(originalProp, objToDiffProp, cache[e]);
|
|
2866
|
-
} else if (objToDiffProp !== void 0) {
|
|
2867
|
-
cache[e] = objToDiffProp;
|
|
2868
|
-
}
|
|
2869
|
-
}
|
|
2870
|
-
return cache;
|
|
2871
|
-
};
|
|
2872
|
-
var diffArrays = (original, objToDiff, cache) => {
|
|
2873
|
-
if (original.length !== objToDiff.length) {
|
|
2874
|
-
cache = objToDiff;
|
|
2875
|
-
} else {
|
|
2876
|
-
const diffArr = [];
|
|
2877
|
-
for (let i = 0; i < original.length; i++) {
|
|
2878
|
-
const diffObj = diff(original[i], objToDiff[i]);
|
|
2879
|
-
if (Object.keys(diffObj).length > 0) {
|
|
2880
|
-
diffArr.push(diffObj);
|
|
2881
|
-
}
|
|
2882
|
-
}
|
|
2883
|
-
if (diffArr.length > 0) {
|
|
2884
|
-
cache = diffArr;
|
|
2885
|
-
}
|
|
2886
|
-
}
|
|
2887
|
-
return cache;
|
|
2888
|
-
};
|
|
2889
|
-
var diff = (original, objToDiff, cache = {}) => {
|
|
2890
|
-
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2891
|
-
cache = [];
|
|
2892
|
-
diffArrays(original, objToDiff, cache);
|
|
2893
|
-
} else {
|
|
2894
|
-
diffObjects(original, objToDiff, cache);
|
|
2895
|
-
}
|
|
2896
|
-
return cache;
|
|
2897
|
-
};
|
|
2898
|
-
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2899
|
-
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2900
|
-
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2901
|
-
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2902
|
-
var deepDiff = (lhs, rhs) => {
|
|
2903
|
-
if (lhs === rhs)
|
|
2904
|
-
return {};
|
|
2905
|
-
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2906
|
-
return rhs;
|
|
2907
|
-
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2908
|
-
if (!hasOwnProperty(rhs, key)) {
|
|
2909
|
-
acc[key] = void 0;
|
|
2910
|
-
}
|
|
2911
|
-
return acc;
|
|
2912
|
-
}, makeObjectWithoutPrototype());
|
|
2913
|
-
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2914
|
-
if (lhs.valueOf() === rhs.valueOf())
|
|
2915
|
-
return {};
|
|
2916
|
-
return rhs;
|
|
2917
|
-
}
|
|
2918
|
-
return Object.keys(rhs).reduce((acc, key) => {
|
|
2919
|
-
if (!hasOwnProperty(lhs, key)) {
|
|
2920
|
-
acc[key] = rhs[key];
|
|
2921
|
-
return acc;
|
|
2922
|
-
}
|
|
2923
|
-
const difference = diff(lhs[key], rhs[key]);
|
|
2924
|
-
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2925
|
-
return acc;
|
|
2926
|
-
}
|
|
2927
|
-
acc[key] = difference;
|
|
2928
|
-
return acc;
|
|
2929
|
-
}, deletedValues);
|
|
2930
|
-
};
|
|
2931
|
-
var overwrite = (element, params, opts = {}) => {
|
|
2932
|
-
const { __ref: ref } = element;
|
|
2933
|
-
const excl = opts.exclude || [];
|
|
2934
|
-
const allowUnderscore = opts.preventUnderscore;
|
|
2935
|
-
const preventCaching = opts.preventCaching;
|
|
2936
|
-
for (const e in params) {
|
|
2937
|
-
if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
|
|
2938
|
-
continue;
|
|
2939
|
-
const elementProp = element[e];
|
|
2940
|
-
const paramsProp = params[e];
|
|
2941
|
-
if (paramsProp !== void 0) {
|
|
2942
|
-
element[e] = paramsProp;
|
|
2943
|
-
if (ref && !preventCaching) {
|
|
2944
|
-
ref.__cache[e] = elementProp;
|
|
2945
|
-
}
|
|
2946
|
-
if ((0, import_types.isObject)(opts.diff)) {
|
|
2947
|
-
diff[e] = elementProp;
|
|
2948
|
-
}
|
|
2949
|
-
}
|
|
2950
|
-
}
|
|
2951
|
-
return element;
|
|
2952
|
-
};
|
|
2953
|
-
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2954
|
-
for (const e in params) {
|
|
2955
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2956
|
-
continue;
|
|
2957
|
-
obj[e] = params[e];
|
|
2958
|
-
}
|
|
2959
|
-
return obj;
|
|
2960
|
-
};
|
|
2961
|
-
var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
2962
|
-
const excl = opts.exclude || [];
|
|
2963
|
-
const forcedExclude = opts.preventForce ? [] : ["node", "window"];
|
|
2964
|
-
if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
|
|
2965
|
-
return params;
|
|
2966
|
-
}
|
|
2967
|
-
if (visited.has(obj))
|
|
2968
|
-
return visited.get(obj);
|
|
2969
|
-
visited.set(obj, obj);
|
|
2970
|
-
for (const e in params) {
|
|
2971
|
-
if (!Object.hasOwnProperty.call(params, e))
|
|
2972
|
-
continue;
|
|
2973
|
-
if (excl.includes(e) || forcedExclude && e.startsWith("__"))
|
|
2974
|
-
continue;
|
|
2975
|
-
const objProp = obj[e];
|
|
2976
|
-
const paramsProp = params[e];
|
|
2977
|
-
if ((0, import_node.isDOMNode)(paramsProp)) {
|
|
2978
|
-
obj[e] = paramsProp;
|
|
2979
|
-
} else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2980
|
-
obj[e] = overwriteDeep(objProp, paramsProp, opts, visited);
|
|
2981
|
-
} else if (paramsProp !== void 0) {
|
|
2982
|
-
obj[e] = paramsProp;
|
|
2983
|
-
}
|
|
2984
|
-
}
|
|
2985
|
-
return obj;
|
|
2986
|
-
};
|
|
2987
|
-
var mergeIfExisted = (a, b) => {
|
|
2988
|
-
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2989
|
-
return deepMerge2(a, b);
|
|
2990
|
-
return a || b;
|
|
2991
|
-
};
|
|
2992
|
-
var flattenRecursive = (param, prop, stack = []) => {
|
|
2993
|
-
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2994
|
-
stack.push(objectized);
|
|
2995
|
-
const extendOfExtend = objectized[prop];
|
|
2996
|
-
if (extendOfExtend)
|
|
2997
|
-
flattenRecursive(extendOfExtend, prop, stack);
|
|
2998
|
-
delete objectized[prop];
|
|
2999
|
-
return stack;
|
|
3000
|
-
};
|
|
3001
|
-
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
3002
|
-
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
3003
|
-
return param === element;
|
|
3004
|
-
}
|
|
3005
|
-
if (visited.has(param) || visited.has(element)) {
|
|
3006
|
-
return true;
|
|
3007
|
-
}
|
|
3008
|
-
visited.add(param);
|
|
3009
|
-
visited.add(element);
|
|
3010
|
-
const keysParam = Object.keys(param);
|
|
3011
|
-
const keysElement = Object.keys(element);
|
|
3012
|
-
if (keysParam.length !== keysElement.length) {
|
|
3013
|
-
return false;
|
|
3014
|
-
}
|
|
3015
|
-
for (const key of keysParam) {
|
|
3016
|
-
if (!keysElement.includes(key)) {
|
|
3017
|
-
return false;
|
|
3018
|
-
}
|
|
3019
|
-
const paramProp = param[key];
|
|
3020
|
-
const elementProp = element[key];
|
|
3021
|
-
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
3022
|
-
return false;
|
|
3023
|
-
}
|
|
3024
|
-
}
|
|
3025
|
-
return true;
|
|
3026
|
-
};
|
|
3027
|
-
var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
|
|
3028
|
-
if (obj1 === obj2)
|
|
3029
|
-
return true;
|
|
3030
|
-
if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
|
|
3031
|
-
return false;
|
|
3032
|
-
if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
|
|
3033
|
-
return obj1 === obj2;
|
|
3034
|
-
const stack = [[obj1, obj2]];
|
|
3035
|
-
const visited = /* @__PURE__ */ new WeakSet();
|
|
3036
|
-
while (stack.length > 0) {
|
|
3037
|
-
const [current1, current2] = stack.pop();
|
|
3038
|
-
if (visited.has(current1))
|
|
3039
|
-
continue;
|
|
3040
|
-
visited.add(current1);
|
|
3041
|
-
const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
|
|
3042
|
-
const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
|
|
3043
|
-
if (keys1.length !== keys2.length)
|
|
3044
|
-
return false;
|
|
3045
|
-
for (const key of keys1) {
|
|
3046
|
-
if (!Object.prototype.hasOwnProperty.call(current2, key))
|
|
3047
|
-
return false;
|
|
3048
|
-
const value1 = current1[key];
|
|
3049
|
-
const value2 = current2[key];
|
|
3050
|
-
if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
|
|
3051
|
-
if (value1 !== value2)
|
|
3052
|
-
return false;
|
|
3053
|
-
} else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
|
|
3054
|
-
if (value1 !== value2) {
|
|
3055
|
-
stack.push([value1, value2]);
|
|
3056
|
-
}
|
|
3057
|
-
} else if (value1 !== value2) {
|
|
3058
|
-
return false;
|
|
3059
|
-
}
|
|
3060
|
-
}
|
|
3061
|
-
}
|
|
3062
|
-
return true;
|
|
3063
|
-
};
|
|
3064
|
-
var removeFromObject = (obj, props) => {
|
|
3065
|
-
if (props === void 0 || props === null)
|
|
3066
|
-
return obj;
|
|
3067
|
-
if ((0, import_types.is)(props)("string", "number")) {
|
|
3068
|
-
delete obj[props];
|
|
3069
|
-
} else if ((0, import_types.isArray)(props)) {
|
|
3070
|
-
props.forEach((prop) => delete obj[prop]);
|
|
3071
|
-
} else {
|
|
3072
|
-
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
3073
|
-
}
|
|
3074
|
-
return obj;
|
|
3075
|
-
};
|
|
3076
|
-
var createObjectWithoutPrototype = (obj) => {
|
|
3077
|
-
if (obj === null || typeof obj !== "object") {
|
|
3078
|
-
return obj;
|
|
3079
|
-
}
|
|
3080
|
-
const newObj = /* @__PURE__ */ Object.create(null);
|
|
3081
|
-
for (const key in obj) {
|
|
3082
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
3083
|
-
newObj[key] = createObjectWithoutPrototype(obj[key]);
|
|
3084
|
-
}
|
|
3085
|
-
}
|
|
3086
|
-
return newObj;
|
|
3087
|
-
};
|
|
3088
|
-
var createNestedObject = (arr, lastValue) => {
|
|
3089
|
-
const nestedObject = {};
|
|
3090
|
-
if (arr.length === 0) {
|
|
3091
|
-
return lastValue;
|
|
3092
|
-
}
|
|
3093
|
-
arr.reduce((obj, value, index) => {
|
|
3094
|
-
if (!obj[value]) {
|
|
3095
|
-
obj[value] = {};
|
|
3096
|
-
}
|
|
3097
|
-
if (index === arr.length - 1 && lastValue) {
|
|
3098
|
-
obj[value] = lastValue;
|
|
3099
|
-
}
|
|
3100
|
-
return obj[value];
|
|
3101
|
-
}, nestedObject);
|
|
3102
|
-
return nestedObject;
|
|
3103
|
-
};
|
|
3104
|
-
var removeNestedKeyByPath = (obj, path) => {
|
|
3105
|
-
if (!Array.isArray(path)) {
|
|
3106
|
-
throw new Error("Path must be an array.");
|
|
3107
|
-
}
|
|
3108
|
-
let current = obj;
|
|
3109
|
-
for (let i = 0; i < path.length - 1; i++) {
|
|
3110
|
-
if (current[path[i]] === void 0) {
|
|
3111
|
-
return;
|
|
3112
|
-
}
|
|
3113
|
-
current = current[path[i]];
|
|
3114
|
-
}
|
|
3115
|
-
const lastKey = path[path.length - 1];
|
|
3116
|
-
if (current && Object.hasOwnProperty.call(current, lastKey)) {
|
|
3117
|
-
delete current[lastKey];
|
|
3118
|
-
}
|
|
3119
|
-
};
|
|
3120
|
-
var detectInfiniteLoop = (arr) => {
|
|
3121
|
-
const maxRepeats = 10;
|
|
3122
|
-
let pattern = [];
|
|
3123
|
-
let repeatCount = 0;
|
|
3124
|
-
for (let i = 0; i < arr.length; i++) {
|
|
3125
|
-
if (pattern.length < 2) {
|
|
3126
|
-
pattern.push(arr[i]);
|
|
3127
|
-
} else {
|
|
3128
|
-
if (arr[i] === pattern[i % 2]) {
|
|
3129
|
-
repeatCount++;
|
|
3130
|
-
} else {
|
|
3131
|
-
pattern = [arr[i - 1], arr[i]];
|
|
3132
|
-
repeatCount = 1;
|
|
3133
|
-
}
|
|
3134
|
-
if (repeatCount >= maxRepeats * 2) {
|
|
3135
|
-
if (ENV === "test" || ENV === "development") {
|
|
3136
|
-
console.warn("Warning: Potential infinite loop detected due to repeated sequence:", pattern);
|
|
3137
|
-
}
|
|
3138
|
-
return true;
|
|
3139
|
-
}
|
|
3140
|
-
}
|
|
3141
|
-
}
|
|
3142
|
-
};
|
|
3143
|
-
var isCyclic = (obj) => {
|
|
3144
|
-
const seenObjects = [];
|
|
3145
|
-
function detect(obj2) {
|
|
3146
|
-
if (obj2 && typeof obj2 === "object") {
|
|
3147
|
-
if (seenObjects.indexOf(obj2) !== -1) {
|
|
3148
|
-
return true;
|
|
3149
|
-
}
|
|
3150
|
-
seenObjects.push(obj2);
|
|
3151
|
-
for (const key in obj2) {
|
|
3152
|
-
if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
|
|
3153
|
-
console.log(obj2, "cycle at " + key);
|
|
3154
|
-
return true;
|
|
3155
|
-
}
|
|
3156
|
-
}
|
|
3157
|
-
}
|
|
3158
|
-
return false;
|
|
3159
|
-
}
|
|
3160
|
-
return detect(obj);
|
|
3161
|
-
};
|
|
3162
|
-
var excludeKeysFromObject = (obj, excludedKeys) => {
|
|
3163
|
-
const result = { ...obj };
|
|
3164
|
-
excludedKeys.forEach((key) => delete result[key]);
|
|
3165
|
-
return result;
|
|
3166
|
-
};
|
|
3167
|
-
}
|
|
3168
|
-
});
|
|
3169
|
-
var require_function2 = __commonJS2({
|
|
3170
|
-
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
|
|
3171
|
-
"use strict";
|
|
3172
|
-
var __defProp22 = Object.defineProperty;
|
|
3173
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3174
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3175
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3176
|
-
var __export22 = (target, all) => {
|
|
3177
|
-
for (var name in all)
|
|
3178
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3179
|
-
};
|
|
3180
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
3181
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
3182
|
-
for (let key of __getOwnPropNames22(from))
|
|
3183
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3184
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3185
|
-
}
|
|
3186
|
-
return to;
|
|
3187
|
-
};
|
|
3188
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3189
|
-
var function_exports = {};
|
|
3190
|
-
__export22(function_exports, {
|
|
3191
|
-
cloneFunction: () => cloneFunction,
|
|
3192
|
-
debounce: () => debounce,
|
|
3193
|
-
debounceOnContext: () => debounceOnContext,
|
|
3194
|
-
isStringFunction: () => isStringFunction,
|
|
3195
|
-
memoize: () => memoize
|
|
3196
|
-
});
|
|
3197
|
-
module22.exports = __toCommonJS22(function_exports);
|
|
3198
|
-
function debounce(func, wait, immediate) {
|
|
3199
|
-
let timeout;
|
|
3200
|
-
return function() {
|
|
3201
|
-
const context = this;
|
|
3202
|
-
const args = arguments;
|
|
3203
|
-
const later = function() {
|
|
3204
|
-
timeout = null;
|
|
3205
|
-
if (!immediate)
|
|
3206
|
-
func.apply(context, args);
|
|
3207
|
-
};
|
|
3208
|
-
const callNow = immediate && !timeout;
|
|
3209
|
-
clearTimeout(timeout);
|
|
3210
|
-
timeout = setTimeout(later, wait);
|
|
3211
|
-
if (callNow)
|
|
3212
|
-
func.apply(context, args);
|
|
3213
|
-
};
|
|
3214
|
-
}
|
|
3215
|
-
var debounceOnContext = (element, func, timeout = 300) => {
|
|
3216
|
-
let timer;
|
|
3217
|
-
return (...args) => {
|
|
3218
|
-
clearTimeout(timer);
|
|
3219
|
-
timer = setTimeout(() => {
|
|
3220
|
-
func.apply(element, args);
|
|
3221
|
-
}, timeout);
|
|
3222
|
-
};
|
|
3223
|
-
};
|
|
3224
|
-
var memoize = (fn) => {
|
|
3225
|
-
const cache = {};
|
|
3226
|
-
return (...args) => {
|
|
3227
|
-
const n = args[0];
|
|
3228
|
-
if (n in cache) {
|
|
3229
|
-
return cache[n];
|
|
3230
|
-
} else {
|
|
3231
|
-
const result = fn(n);
|
|
3232
|
-
cache[n] = result;
|
|
3233
|
-
return result;
|
|
3234
|
-
}
|
|
3235
|
-
};
|
|
3236
|
-
};
|
|
3237
|
-
var isStringFunction = (inputString) => {
|
|
3238
|
-
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
3239
|
-
return functionRegex.test(inputString);
|
|
3240
|
-
};
|
|
3241
|
-
function cloneFunction(fn, win = window) {
|
|
3242
|
-
const temp = function() {
|
|
3243
|
-
return fn.apply(win, arguments);
|
|
3244
|
-
};
|
|
3245
|
-
for (const key in fn) {
|
|
3246
|
-
if (Object.hasOwnProperty.call(fn, key)) {
|
|
3247
|
-
temp[key] = fn[key];
|
|
3248
|
-
}
|
|
3249
|
-
}
|
|
3250
|
-
return temp;
|
|
3251
|
-
}
|
|
3252
|
-
}
|
|
3253
|
-
});
|
|
3254
|
-
var require_log2 = __commonJS2({
|
|
3255
|
-
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
|
|
3256
|
-
"use strict";
|
|
3257
|
-
var __defProp22 = Object.defineProperty;
|
|
3258
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3259
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3260
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3261
|
-
var __export22 = (target, all) => {
|
|
3262
|
-
for (var name in all)
|
|
3263
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3264
|
-
};
|
|
3265
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
3266
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
3267
|
-
for (let key of __getOwnPropNames22(from))
|
|
3268
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3269
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3270
|
-
}
|
|
3271
|
-
return to;
|
|
3272
|
-
};
|
|
3273
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3274
|
-
var log_exports = {};
|
|
3275
|
-
__export22(log_exports, {
|
|
3276
|
-
logGroupIf: () => logGroupIf,
|
|
3277
|
-
logIf: () => logIf
|
|
3278
|
-
});
|
|
3279
|
-
module22.exports = __toCommonJS22(log_exports);
|
|
3280
|
-
var logIf = (bool, ...arg) => {
|
|
3281
|
-
if (bool)
|
|
3282
|
-
arg.map((v) => console.log(v));
|
|
3283
|
-
};
|
|
3284
|
-
var logGroupIf = (bool, key, ...arg) => {
|
|
3285
|
-
if (bool) {
|
|
3286
|
-
console.group(key);
|
|
3287
|
-
arg.map((v) => console.log(v));
|
|
3288
|
-
console.groupEnd(key);
|
|
3289
|
-
}
|
|
3290
|
-
};
|
|
3291
|
-
}
|
|
3292
|
-
});
|
|
3293
|
-
var require_cookie2 = __commonJS2({
|
|
3294
|
-
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
|
|
3295
|
-
"use strict";
|
|
3296
|
-
var __defProp22 = Object.defineProperty;
|
|
3297
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3298
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3299
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3300
|
-
var __export22 = (target, all) => {
|
|
3301
|
-
for (var name in all)
|
|
3302
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3303
|
-
};
|
|
3304
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
3305
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
3306
|
-
for (let key of __getOwnPropNames22(from))
|
|
3307
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3308
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3309
|
-
}
|
|
3310
|
-
return to;
|
|
3311
|
-
};
|
|
3312
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3313
|
-
var cookie_exports = {};
|
|
3314
|
-
__export22(cookie_exports, {
|
|
3315
|
-
getCookie: () => getCookie,
|
|
3316
|
-
getLocalStorage: () => getLocalStorage,
|
|
3317
|
-
isMobile: () => isMobile,
|
|
3318
|
-
removeCookie: () => removeCookie,
|
|
3319
|
-
setCookie: () => setCookie,
|
|
3320
|
-
setLocalStorage: () => setLocalStorage
|
|
3321
|
-
});
|
|
3322
|
-
module22.exports = __toCommonJS22(cookie_exports);
|
|
3323
|
-
var import_types = require_types2();
|
|
3324
|
-
var import_utils32 = require_cjs3();
|
|
3325
|
-
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
3326
|
-
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
3327
|
-
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
3328
|
-
return;
|
|
3329
|
-
const d = /* @__PURE__ */ new Date();
|
|
3330
|
-
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
3331
|
-
const expires = `expires=${d.toUTCString()}`;
|
|
3332
|
-
import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
3333
|
-
};
|
|
3334
|
-
var getCookie = (cname) => {
|
|
3335
|
-
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
3336
|
-
return;
|
|
3337
|
-
const name = `${cname}=`;
|
|
3338
|
-
const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
|
|
3339
|
-
const ca = decodedCookie.split(";");
|
|
3340
|
-
for (let i = 0; i < ca.length; i++) {
|
|
3341
|
-
let c = ca[i];
|
|
3342
|
-
while (c.charAt(0) === " ")
|
|
3343
|
-
c = c.substring(1);
|
|
3344
|
-
if (c.indexOf(name) === 0)
|
|
3345
|
-
return c.substring(name.length, c.length);
|
|
3346
|
-
}
|
|
3347
|
-
return "";
|
|
3348
|
-
};
|
|
3349
|
-
var removeCookie = (cname) => {
|
|
3350
|
-
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
3351
|
-
return;
|
|
3352
|
-
import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
3353
|
-
};
|
|
3354
|
-
function getLocalStorage(key) {
|
|
3355
|
-
let savedJSON;
|
|
3356
|
-
if (window.localStorage) {
|
|
3357
|
-
try {
|
|
3358
|
-
savedJSON = JSON.parse(window.localStorage.getItem(key));
|
|
3359
|
-
} catch (e) {
|
|
3360
|
-
}
|
|
3361
|
-
}
|
|
3362
|
-
if (typeof savedJSON !== "undefined") {
|
|
3363
|
-
return savedJSON;
|
|
3364
|
-
}
|
|
3365
|
-
}
|
|
3366
|
-
function setLocalStorage(key, data) {
|
|
3367
|
-
if (data && window.localStorage) {
|
|
3368
|
-
if (typeof data === "object") {
|
|
3369
|
-
window.localStorage.setItem(key, JSON.stringify(data));
|
|
3370
|
-
} else {
|
|
3371
|
-
window.localStorage.setItem(key, data);
|
|
3372
|
-
}
|
|
3373
|
-
}
|
|
3374
|
-
}
|
|
3375
|
-
}
|
|
3376
|
-
});
|
|
3377
|
-
var require_tags2 = __commonJS2({
|
|
3378
|
-
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
|
|
3379
|
-
"use strict";
|
|
3380
|
-
var __defProp22 = Object.defineProperty;
|
|
3381
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3382
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3383
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3384
|
-
var __export22 = (target, all) => {
|
|
3385
|
-
for (var name in all)
|
|
3386
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3387
|
-
};
|
|
3388
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
3389
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
3390
|
-
for (let key of __getOwnPropNames22(from))
|
|
3391
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3392
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3393
|
-
}
|
|
3394
|
-
return to;
|
|
3395
|
-
};
|
|
3396
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3397
|
-
var tags_exports = {};
|
|
3398
|
-
__export22(tags_exports, {
|
|
3399
|
-
HTML_TAGS: () => HTML_TAGS,
|
|
3400
|
-
isValidHtmlTag: () => isValidHtmlTag
|
|
3401
|
-
});
|
|
3402
|
-
module22.exports = __toCommonJS22(tags_exports);
|
|
3403
|
-
var HTML_TAGS = {
|
|
3404
|
-
root: [
|
|
3405
|
-
"body",
|
|
3406
|
-
"html"
|
|
3407
|
-
],
|
|
3408
|
-
head: [
|
|
3409
|
-
"title",
|
|
3410
|
-
"base",
|
|
3411
|
-
"meta",
|
|
3412
|
-
"style",
|
|
3413
|
-
"noscript",
|
|
3414
|
-
"script"
|
|
3415
|
-
],
|
|
3416
|
-
body: [
|
|
3417
|
-
"string",
|
|
3418
|
-
"style",
|
|
3419
|
-
"fragment",
|
|
3420
|
-
"a",
|
|
3421
|
-
"abbr",
|
|
3422
|
-
"acronym",
|
|
3423
|
-
"address",
|
|
3424
|
-
"applet",
|
|
3425
|
-
"area",
|
|
3426
|
-
"article",
|
|
3427
|
-
"aside",
|
|
3428
|
-
"audio",
|
|
3429
|
-
"b",
|
|
3430
|
-
"basefont",
|
|
3431
|
-
"bdi",
|
|
3432
|
-
"bdo",
|
|
3433
|
-
"big",
|
|
3434
|
-
"blockquote",
|
|
3435
|
-
"br",
|
|
3436
|
-
"button",
|
|
3437
|
-
"canvas",
|
|
3438
|
-
"caption",
|
|
3439
|
-
"center",
|
|
3440
|
-
"cite",
|
|
3441
|
-
"code",
|
|
3442
|
-
"search",
|
|
3443
|
-
"col",
|
|
3444
|
-
"colgroup",
|
|
3445
|
-
"data",
|
|
3446
|
-
"datalist",
|
|
3447
|
-
"dd",
|
|
3448
|
-
"del",
|
|
3449
|
-
"details",
|
|
3450
|
-
"dfn",
|
|
3451
|
-
"dialog",
|
|
3452
|
-
"dir",
|
|
3453
|
-
"div",
|
|
3454
|
-
"dl",
|
|
3455
|
-
"dt",
|
|
3456
|
-
"em",
|
|
3457
|
-
"embed",
|
|
3458
|
-
"fieldset",
|
|
3459
|
-
"figcaption",
|
|
3460
|
-
"figure",
|
|
3461
|
-
"font",
|
|
3462
|
-
"footer",
|
|
3463
|
-
"form",
|
|
3464
|
-
"frame",
|
|
3465
|
-
"frameset",
|
|
3466
|
-
"h1",
|
|
3467
|
-
"h2",
|
|
3468
|
-
"h3",
|
|
3469
|
-
"h4",
|
|
3470
|
-
"h5",
|
|
3471
|
-
"h6",
|
|
3472
|
-
"head",
|
|
3473
|
-
"header",
|
|
3474
|
-
"hr",
|
|
3475
|
-
"i",
|
|
3476
|
-
"iframe",
|
|
3477
|
-
"img",
|
|
3478
|
-
"input",
|
|
3479
|
-
"ins",
|
|
3480
|
-
"kbd",
|
|
3481
|
-
"label",
|
|
3482
|
-
"legend",
|
|
3483
|
-
"li",
|
|
3484
|
-
"link",
|
|
3485
|
-
"main",
|
|
3486
|
-
"map",
|
|
3487
|
-
"mark",
|
|
3488
|
-
"meter",
|
|
3489
|
-
"nav",
|
|
3490
|
-
"noframes",
|
|
3491
|
-
"noscript",
|
|
3492
|
-
"object",
|
|
3493
|
-
"ol",
|
|
3494
|
-
"optgroup",
|
|
3495
|
-
"option",
|
|
3496
|
-
"output",
|
|
3497
|
-
"p",
|
|
3498
|
-
"param",
|
|
3499
|
-
"picture",
|
|
3500
|
-
"pre",
|
|
3501
|
-
"progress",
|
|
3502
|
-
"hgroup",
|
|
3503
|
-
"q",
|
|
3504
|
-
"rp",
|
|
3505
|
-
"rt",
|
|
3506
|
-
"ruby",
|
|
3507
|
-
"s",
|
|
3508
|
-
"samp",
|
|
3509
|
-
"script",
|
|
3510
|
-
"section",
|
|
3511
|
-
"select",
|
|
3512
|
-
"small",
|
|
3513
|
-
"source",
|
|
3514
|
-
"span",
|
|
3515
|
-
"strike",
|
|
3516
|
-
"strong",
|
|
3517
|
-
"sub",
|
|
3518
|
-
"summary",
|
|
3519
|
-
"sup",
|
|
3520
|
-
"table",
|
|
3521
|
-
"tbody",
|
|
3522
|
-
"td",
|
|
3523
|
-
"template",
|
|
3524
|
-
"hgroup",
|
|
3525
|
-
"textarea",
|
|
3526
|
-
"tfoot",
|
|
3527
|
-
"th",
|
|
3528
|
-
"thead",
|
|
3529
|
-
"time",
|
|
3530
|
-
"tr",
|
|
3531
|
-
"track",
|
|
3532
|
-
"tt",
|
|
3533
|
-
"u",
|
|
3534
|
-
"ul",
|
|
3535
|
-
"var",
|
|
3536
|
-
"video",
|
|
3537
|
-
"wbr",
|
|
3538
|
-
// SVG
|
|
3539
|
-
"svg",
|
|
3540
|
-
"path"
|
|
3541
|
-
]
|
|
3542
|
-
};
|
|
3543
|
-
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
3544
|
-
}
|
|
3545
|
-
});
|
|
3546
|
-
var require_component2 = __commonJS2({
|
|
3547
|
-
"../../node_modules/@domql/utils/dist/cjs/component.js"(exports2, module22) {
|
|
3548
|
-
"use strict";
|
|
3549
|
-
var __defProp22 = Object.defineProperty;
|
|
3550
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3551
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3552
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3553
|
-
var __export22 = (target, all) => {
|
|
3554
|
-
for (var name in all)
|
|
3555
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3556
|
-
};
|
|
3557
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
3558
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
3559
|
-
for (let key of __getOwnPropNames22(from))
|
|
3560
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3561
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3562
|
-
}
|
|
3563
|
-
return to;
|
|
3564
|
-
};
|
|
3565
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3566
|
-
var component_exports = {};
|
|
3567
|
-
__export22(component_exports, {
|
|
3568
|
-
addAdditionalExtend: () => addAdditionalExtend,
|
|
3569
|
-
addChildrenIfNotInOriginal: () => addChildrenIfNotInOriginal,
|
|
3570
|
-
applyComponentFromContext: () => applyComponentFromContext,
|
|
3571
|
-
applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
|
|
3572
|
-
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
3573
|
-
checkIfKeyIsProperty: () => checkIfKeyIsProperty,
|
|
3574
|
-
checkIfSugar: () => checkIfSugar,
|
|
3575
|
-
extendizeByKey: () => extendizeByKey,
|
|
3576
|
-
extractComponentKeyFromKey: () => extractComponentKeyFromKey,
|
|
3577
|
-
getCapitalCaseKeys: () => getCapitalCaseKeys,
|
|
3578
|
-
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
3579
|
-
getExtendsInElement: () => getExtendsInElement,
|
|
3580
|
-
hasVariantProp: () => hasVariantProp,
|
|
3581
|
-
isVariant: () => isVariant,
|
|
3582
|
-
setContentKey: () => setContentKey
|
|
3583
|
-
});
|
|
3584
|
-
module22.exports = __toCommonJS22(component_exports);
|
|
3585
|
-
var import__ = require_cjs3();
|
|
3586
|
-
var ENV = "development";
|
|
3587
|
-
var checkIfKeyIsComponent = (key) => {
|
|
3588
|
-
const isFirstKeyString = (0, import__.isString)(key);
|
|
3589
|
-
if (!isFirstKeyString)
|
|
3590
|
-
return;
|
|
3591
|
-
const firstCharKey = key.slice(0, 1);
|
|
3592
|
-
return /^[A-Z]*$/.test(firstCharKey);
|
|
3593
|
-
};
|
|
3594
|
-
var checkIfKeyIsProperty = (key) => {
|
|
3595
|
-
const isFirstKeyString = (0, import__.isString)(key);
|
|
3596
|
-
if (!isFirstKeyString)
|
|
3597
|
-
return;
|
|
3598
|
-
const firstCharKey = key.slice(0, 1);
|
|
3599
|
-
return /^[a-z]*$/.test(firstCharKey);
|
|
3600
|
-
};
|
|
3601
|
-
var addAdditionalExtend = (newExtend, element) => {
|
|
3602
|
-
if (!newExtend)
|
|
3603
|
-
return element;
|
|
3604
|
-
const { extend: elementExtend } = element;
|
|
3605
|
-
const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
|
|
3606
|
-
const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
|
|
3607
|
-
const extend = (0, import__.joinArrays)(receivedArray, originalArray);
|
|
3608
|
-
return { ...element, extend };
|
|
3609
|
-
};
|
|
3610
|
-
var checkIfSugar = (element, parent, key) => {
|
|
3611
|
-
var _a;
|
|
3612
|
-
const {
|
|
3613
|
-
extend,
|
|
3614
|
-
props,
|
|
3615
|
-
childExtend,
|
|
3616
|
-
extends: extendProps,
|
|
3617
|
-
childExtends,
|
|
3618
|
-
childProps,
|
|
3619
|
-
children,
|
|
3620
|
-
on,
|
|
3621
|
-
$collection,
|
|
3622
|
-
$stateCollection,
|
|
3623
|
-
$propsCollection
|
|
3624
|
-
} = element;
|
|
3625
|
-
const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
|
|
3626
|
-
if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
|
|
3627
|
-
const logErr = (_a = parent || element) == null ? void 0 : _a.error;
|
|
3628
|
-
if (logErr)
|
|
3629
|
-
logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
|
|
3630
|
-
}
|
|
3631
|
-
return !hasComponentAttrs || childProps || extendProps || children || childExtends;
|
|
3632
|
-
};
|
|
3633
|
-
var extractComponentKeyFromKey = (key) => {
|
|
3634
|
-
return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
3635
|
-
};
|
|
3636
|
-
var extendizeByKey = (element, parent, key) => {
|
|
3637
|
-
const { context } = parent;
|
|
3638
|
-
const { tag, extend, childExtends } = element;
|
|
3639
|
-
const isSugar = checkIfSugar(element, parent, key);
|
|
3640
|
-
const extendFromKey = extractComponentKeyFromKey(key);
|
|
3641
|
-
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
3642
|
-
if (element === isExtendKeyComponent)
|
|
3643
|
-
return element;
|
|
3644
|
-
else if (isSugar) {
|
|
3645
|
-
const newElem = addAdditionalExtend(element.extends, {
|
|
3646
|
-
extend: extendFromKey,
|
|
3647
|
-
tag,
|
|
3648
|
-
props: { ...element }
|
|
3649
|
-
});
|
|
3650
|
-
if (newElem.props.data) {
|
|
3651
|
-
newElem.data = newElem.props.data;
|
|
3652
|
-
delete newElem.props.data;
|
|
3653
|
-
}
|
|
3654
|
-
if (newElem.props.state) {
|
|
3655
|
-
newElem.state = newElem.props.state;
|
|
3656
|
-
delete newElem.props.state;
|
|
3657
|
-
}
|
|
3658
|
-
if (newElem.props.attr) {
|
|
3659
|
-
newElem.attr = newElem.props.attr;
|
|
3660
|
-
delete newElem.props.attr;
|
|
3661
|
-
}
|
|
3662
|
-
if (newElem.props.if) {
|
|
3663
|
-
newElem.if = newElem.props.if;
|
|
3664
|
-
delete newElem.props.if;
|
|
3665
|
-
}
|
|
3666
|
-
if (childExtends)
|
|
3667
|
-
newElem.childExtend = childExtends;
|
|
3668
|
-
return newElem;
|
|
3669
|
-
} else if (!extend || extend === true) {
|
|
3670
|
-
return {
|
|
3671
|
-
...element,
|
|
3672
|
-
tag,
|
|
3673
|
-
extend: extendFromKey
|
|
3674
|
-
};
|
|
3675
|
-
} else if (extend) {
|
|
3676
|
-
return addAdditionalExtend(extendFromKey, element);
|
|
3677
|
-
} else if ((0, import__.isFunction)(element)) {
|
|
3678
|
-
return {
|
|
3679
|
-
extend: extendFromKey,
|
|
3680
|
-
tag,
|
|
3681
|
-
props: { ...(0, import__.exec)(element, parent) }
|
|
3682
|
-
};
|
|
3683
|
-
}
|
|
3684
|
-
};
|
|
3685
|
-
function getCapitalCaseKeys(obj) {
|
|
3686
|
-
return Object.keys(obj).filter((key) => /^[A-Z]/.test(key));
|
|
3687
|
-
}
|
|
3688
|
-
var addChildrenIfNotInOriginal = (element, parent, key) => {
|
|
3689
|
-
const childElems = getCapitalCaseKeys(element.props);
|
|
3690
|
-
if (!childElems.length)
|
|
3691
|
-
return element;
|
|
3692
|
-
for (const i in childElems) {
|
|
3693
|
-
const childKey = childElems[i];
|
|
3694
|
-
const childElem = element[childKey];
|
|
3695
|
-
const newChild = element.props[childKey];
|
|
3696
|
-
const assignChild = (val) => {
|
|
3697
|
-
element[childKey] = val;
|
|
3698
|
-
delete element.props[childKey];
|
|
3699
|
-
};
|
|
3700
|
-
if (newChild == null ? void 0 : newChild.ignoreExtend)
|
|
3701
|
-
continue;
|
|
3702
|
-
if (newChild === null)
|
|
3703
|
-
assignChild(null);
|
|
3704
|
-
else if (!childElem)
|
|
3705
|
-
assignChild((0, import__.deepClone)(newChild));
|
|
3706
|
-
else {
|
|
3707
|
-
const isSugarChildElem = checkIfSugar(childElem, parent, key);
|
|
3708
|
-
if (isSugarChildElem)
|
|
3709
|
-
continue;
|
|
3710
|
-
assignChild({
|
|
3711
|
-
extend: element[childKey],
|
|
3712
|
-
props: newChild
|
|
3713
|
-
});
|
|
3714
|
-
}
|
|
3715
|
-
}
|
|
3716
|
-
};
|
|
3717
|
-
var applyKeyComponentAsExtend = (element, parent, key) => {
|
|
3718
|
-
return extendizeByKey(element, parent, key) || element;
|
|
3719
|
-
};
|
|
3720
|
-
var applyComponentFromContext = (element, parent, options) => {
|
|
3721
|
-
const { context } = element;
|
|
3722
|
-
if (!context || !context.components)
|
|
3723
|
-
return;
|
|
3724
|
-
const { components } = context;
|
|
3725
|
-
const { extend } = element;
|
|
3726
|
-
const execExtend = (0, import__.exec)(extend, element);
|
|
3727
|
-
if ((0, import__.isString)(execExtend)) {
|
|
3728
|
-
const componentExists = components[execExtend] || components["smbls." + execExtend];
|
|
3729
|
-
if (componentExists)
|
|
3730
|
-
element.extend = componentExists;
|
|
3731
|
-
else {
|
|
3732
|
-
if ((ENV === "test" || ENV === "development") && options.verbose) {
|
|
3733
|
-
console.warn(execExtend, "is not in library", components, element);
|
|
3734
|
-
console.warn("replacing with ", {});
|
|
3735
|
-
}
|
|
3736
|
-
element.extend = {};
|
|
3737
|
-
}
|
|
3738
|
-
}
|
|
3739
|
-
};
|
|
3740
|
-
var isVariant = (param) => {
|
|
3741
|
-
if (!(0, import__.isString)(param))
|
|
3742
|
-
return;
|
|
3743
|
-
const firstCharKey = param.slice(0, 1);
|
|
3744
|
-
return firstCharKey === ".";
|
|
3745
|
-
};
|
|
3746
|
-
var hasVariantProp = (element) => {
|
|
3747
|
-
const { props } = element;
|
|
3748
|
-
if ((0, import__.isObject)(props) && (0, import__.isString)(props.variant))
|
|
3749
|
-
return true;
|
|
3750
|
-
};
|
|
3751
|
-
var getChildrenComponentsByKey = (key, el) => {
|
|
3752
|
-
if (key === el.key || el.__ref.__componentKey === key) {
|
|
3753
|
-
return el;
|
|
3754
|
-
}
|
|
3755
|
-
if (el.extend) {
|
|
3756
|
-
const foundString = (0, import__.isString)(el.extend) && el.extend === key;
|
|
3757
|
-
const foundInArray = (0, import__.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
|
|
3758
|
-
if (foundString || foundInArray)
|
|
3759
|
-
return el;
|
|
3760
|
-
}
|
|
3761
|
-
if (el.parent && el.parent.childExtend) {
|
|
3762
|
-
const foundString = (0, import__.isString)(el.parent.childExtend) && el.parent.childExtend === key;
|
|
3763
|
-
const foundInArray = (0, import__.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
|
|
3764
|
-
if (foundString || foundInArray)
|
|
3765
|
-
return el;
|
|
3766
|
-
}
|
|
3767
|
-
};
|
|
3768
|
-
var getExtendsInElement = (obj) => {
|
|
3769
|
-
let result = [];
|
|
3770
|
-
function traverse(o) {
|
|
3771
|
-
for (const key in o) {
|
|
3772
|
-
if (Object.hasOwnProperty.call(o, key)) {
|
|
3773
|
-
if (checkIfKeyIsComponent(key)) {
|
|
3774
|
-
result.push(key);
|
|
3775
|
-
}
|
|
3776
|
-
if (key === "extend" || key === "extends") {
|
|
3777
|
-
if (typeof o[key] === "string") {
|
|
3778
|
-
result.push(o[key]);
|
|
3779
|
-
} else if (Array.isArray(o[key])) {
|
|
3780
|
-
result = result.concat(o[key]);
|
|
3781
|
-
}
|
|
3782
|
-
}
|
|
3783
|
-
if (typeof o[key] === "object" && o[key] !== null) {
|
|
3784
|
-
traverse(o[key]);
|
|
3785
|
-
}
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
}
|
|
3789
|
-
traverse(obj);
|
|
3790
|
-
return result;
|
|
3791
|
-
};
|
|
3792
|
-
var setContentKey = (el, opts = {}) => {
|
|
3793
|
-
const { __ref: ref } = el;
|
|
3794
|
-
const contentElementKey = opts.contentElementKey;
|
|
3795
|
-
if (contentElementKey !== "content" && contentElementKey !== ref.contentElementKey || !ref.contentElementKey) {
|
|
3796
|
-
ref.contentElementKey = contentElementKey || "content";
|
|
3797
|
-
} else
|
|
3798
|
-
ref.contentElementKey = "content";
|
|
3799
|
-
if (contentElementKey !== "content")
|
|
3800
|
-
opts.contentElementKey = "content";
|
|
3801
|
-
return ref.contentElementKey;
|
|
3802
|
-
};
|
|
3803
|
-
}
|
|
3804
|
-
});
|
|
3805
|
-
var require_cjs3 = __commonJS2({
|
|
3806
|
-
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
|
|
3807
|
-
"use strict";
|
|
3808
|
-
var __defProp22 = Object.defineProperty;
|
|
3809
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3810
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3811
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3812
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
3813
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
3814
|
-
for (let key of __getOwnPropNames22(from))
|
|
3815
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3816
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3817
|
-
}
|
|
3818
|
-
return to;
|
|
3819
|
-
};
|
|
3820
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
3821
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3822
|
-
var utils_exports = {};
|
|
3823
|
-
module22.exports = __toCommonJS22(utils_exports);
|
|
3824
|
-
__reExport(utils_exports, require_key2(), module22.exports);
|
|
3825
|
-
__reExport(utils_exports, require_env2(), module22.exports);
|
|
3826
|
-
__reExport(utils_exports, require_types2(), module22.exports);
|
|
3827
|
-
__reExport(utils_exports, require_object2(), module22.exports);
|
|
3828
|
-
__reExport(utils_exports, require_function2(), module22.exports);
|
|
3829
|
-
__reExport(utils_exports, require_array2(), module22.exports);
|
|
3830
|
-
__reExport(utils_exports, require_node2(), module22.exports);
|
|
3831
|
-
__reExport(utils_exports, require_log2(), module22.exports);
|
|
3832
|
-
__reExport(utils_exports, require_string2(), module22.exports);
|
|
3833
|
-
__reExport(utils_exports, require_globals2(), module22.exports);
|
|
3834
|
-
__reExport(utils_exports, require_cookie2(), module22.exports);
|
|
3835
|
-
__reExport(utils_exports, require_tags2(), module22.exports);
|
|
3836
|
-
__reExport(utils_exports, require_component2(), module22.exports);
|
|
3837
|
-
}
|
|
3838
|
-
});
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
3839
54
|
var src_exports = {};
|
|
3840
55
|
__export2(src_exports, {
|
|
3841
56
|
arrayzeValue: () => arrayzeValue,
|
|
@@ -3851,7 +66,6 @@ var require_cjs2 = __commonJS({
|
|
|
3851
66
|
loadJavascriptFile: () => loadJavascriptFile,
|
|
3852
67
|
loadJavascriptFileEmbedSync: () => loadJavascriptFileEmbedSync,
|
|
3853
68
|
loadJavascriptFileSync: () => loadJavascriptFileSync,
|
|
3854
|
-
registerFrameListener: () => registerFrameListener,
|
|
3855
69
|
removeChars: () => removeChars,
|
|
3856
70
|
toCamelCase: () => toCamelCase,
|
|
3857
71
|
toDashCase: () => toDashCase2,
|
|
@@ -3860,7 +74,17 @@ var require_cjs2 = __commonJS({
|
|
|
3860
74
|
toggleFullscreen: () => toggleFullscreen
|
|
3861
75
|
});
|
|
3862
76
|
module2.exports = __toCommonJS2(src_exports);
|
|
3863
|
-
var
|
|
77
|
+
var window22 = globalThis;
|
|
78
|
+
var document22 = window22.document;
|
|
79
|
+
var isObject2 = (arg) => {
|
|
80
|
+
if (arg === null)
|
|
81
|
+
return false;
|
|
82
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
83
|
+
};
|
|
84
|
+
var isString2 = (arg) => typeof arg === "string";
|
|
85
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
86
|
+
var isArray2 = (arg) => Array.isArray(arg);
|
|
87
|
+
var isMobile2 = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
3864
88
|
async function toggleFullscreen(opts) {
|
|
3865
89
|
if (!document.fullscreenElement) {
|
|
3866
90
|
try {
|
|
@@ -3872,15 +96,14 @@ var require_cjs2 = __commonJS({
|
|
|
3872
96
|
await document.exitFullscreen();
|
|
3873
97
|
}
|
|
3874
98
|
}
|
|
3875
|
-
var import_utils5 = __toESM2(require_cjs3(), 1);
|
|
3876
99
|
var findClosestNumber = (number, arr) => {
|
|
3877
|
-
return ((
|
|
100
|
+
return (isArray2(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
3878
101
|
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
3879
102
|
});
|
|
3880
103
|
};
|
|
3881
104
|
var findClosestNumberInFactory = (val, factory) => {
|
|
3882
105
|
val = parseFloat(val);
|
|
3883
|
-
if ((
|
|
106
|
+
if (isObject2(factory))
|
|
3884
107
|
factory = Object.values(factory);
|
|
3885
108
|
return findClosestNumber(val, factory);
|
|
3886
109
|
};
|
|
@@ -3989,13 +212,6 @@ var require_cjs2 = __commonJS({
|
|
|
3989
212
|
}
|
|
3990
213
|
};
|
|
3991
214
|
var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
|
|
3992
|
-
var registerFrameListener = (el) => {
|
|
3993
|
-
const { __ref: ref } = el;
|
|
3994
|
-
const { frameListeners } = ref.root.data;
|
|
3995
|
-
if (frameListeners && !frameListeners.has(el)) {
|
|
3996
|
-
frameListeners.add(el);
|
|
3997
|
-
}
|
|
3998
|
-
};
|
|
3999
215
|
var copyStringToClipboard = async (str) => {
|
|
4000
216
|
try {
|
|
4001
217
|
await navigator.clipboard.writeText(str);
|
|
@@ -4035,13 +251,13 @@ var require_cjs2 = __commonJS({
|
|
|
4035
251
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
4036
252
|
};
|
|
4037
253
|
var arrayzeValue = (val) => {
|
|
4038
|
-
if ((
|
|
254
|
+
if (isArray2(val))
|
|
4039
255
|
return val;
|
|
4040
|
-
if ((
|
|
256
|
+
if (isString2(val))
|
|
4041
257
|
return val.split(" ");
|
|
4042
|
-
if ((
|
|
258
|
+
if (isObject2(val))
|
|
4043
259
|
return Object.values(val);
|
|
4044
|
-
if ((
|
|
260
|
+
if (isNumber2(val))
|
|
4045
261
|
return [val];
|
|
4046
262
|
};
|
|
4047
263
|
}
|
|
@@ -4056,10 +272,119 @@ __export(var_exports, {
|
|
|
4056
272
|
setVariables: () => setVariables
|
|
4057
273
|
});
|
|
4058
274
|
module.exports = __toCommonJS(var_exports);
|
|
4059
|
-
var import_utils4 = __toESM(require_cjs(), 1);
|
|
4060
275
|
|
|
4061
|
-
//
|
|
4062
|
-
var
|
|
276
|
+
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
277
|
+
var window2 = globalThis;
|
|
278
|
+
var document2 = window2.document;
|
|
279
|
+
|
|
280
|
+
// ../../../domql/packages/utils/dist/esm/node.js
|
|
281
|
+
var isDOMNode = (obj) => {
|
|
282
|
+
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
// ../../../domql/packages/utils/dist/esm/types.js
|
|
286
|
+
var isFunction = (arg) => typeof arg === "function";
|
|
287
|
+
var isNull = (arg) => arg === null;
|
|
288
|
+
var isArray = (arg) => Array.isArray(arg);
|
|
289
|
+
var isObjectLike = (arg) => {
|
|
290
|
+
if (arg === null)
|
|
291
|
+
return false;
|
|
292
|
+
return typeof arg === "object";
|
|
293
|
+
};
|
|
294
|
+
var isUndefined = (arg) => {
|
|
295
|
+
return arg === void 0;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
// ../../../domql/packages/utils/dist/esm/array.js
|
|
299
|
+
var mergeArray = (arr, exclude = []) => {
|
|
300
|
+
return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
// ../../../domql/packages/utils/dist/esm/object.js
|
|
304
|
+
var __defProp2 = Object.defineProperty;
|
|
305
|
+
var __defProps = Object.defineProperties;
|
|
306
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
307
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
308
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
309
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
310
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
311
|
+
var __spreadValues = (a, b) => {
|
|
312
|
+
for (var prop in b || (b = {}))
|
|
313
|
+
if (__hasOwnProp2.call(b, prop))
|
|
314
|
+
__defNormalProp(a, prop, b[prop]);
|
|
315
|
+
if (__getOwnPropSymbols)
|
|
316
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
317
|
+
if (__propIsEnum.call(b, prop))
|
|
318
|
+
__defNormalProp(a, prop, b[prop]);
|
|
319
|
+
}
|
|
320
|
+
return a;
|
|
321
|
+
};
|
|
322
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
323
|
+
var deepMerge = (element, extend, excludeFrom = []) => {
|
|
324
|
+
for (const e in extend) {
|
|
325
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
326
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
327
|
+
continue;
|
|
328
|
+
const elementProp = element[e];
|
|
329
|
+
const extendProp = extend[e];
|
|
330
|
+
if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
|
|
331
|
+
deepMerge(elementProp, extendProp, excludeFrom);
|
|
332
|
+
} else if (elementProp === void 0) {
|
|
333
|
+
element[e] = extendProp;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return element;
|
|
337
|
+
};
|
|
338
|
+
var deepClone = (obj, options = {}) => {
|
|
339
|
+
const {
|
|
340
|
+
exclude = [],
|
|
341
|
+
cleanUndefined = false,
|
|
342
|
+
cleanNull = false,
|
|
343
|
+
window: targetWindow,
|
|
344
|
+
visited = /* @__PURE__ */ new WeakMap(),
|
|
345
|
+
handleExtend = false
|
|
346
|
+
} = options;
|
|
347
|
+
if (!isObjectLike(obj) || isDOMNode(obj)) {
|
|
348
|
+
return obj;
|
|
349
|
+
}
|
|
350
|
+
if (visited.has(obj)) {
|
|
351
|
+
return visited.get(obj);
|
|
352
|
+
}
|
|
353
|
+
const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
|
|
354
|
+
visited.set(obj, clone2);
|
|
355
|
+
for (const key in obj) {
|
|
356
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
357
|
+
continue;
|
|
358
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
359
|
+
continue;
|
|
360
|
+
const value = obj[key];
|
|
361
|
+
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
|
|
362
|
+
continue;
|
|
363
|
+
if (isDOMNode(value)) {
|
|
364
|
+
clone2[key] = value;
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (handleExtend && key === "extend" && isArray(value)) {
|
|
368
|
+
clone2[key] = mergeArray(value, exclude);
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
if (isFunction(value) && targetWindow) {
|
|
372
|
+
clone2[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
if (isObjectLike(value)) {
|
|
376
|
+
clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
|
|
377
|
+
visited
|
|
378
|
+
}));
|
|
379
|
+
} else {
|
|
380
|
+
clone2[key] = value;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return clone2;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
// ../../../domql/packages/utils/dist/esm/cookie.js
|
|
387
|
+
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
4063
388
|
|
|
4064
389
|
// src/defaultConfig/index.js
|
|
4065
390
|
var defaultConfig_exports = {};
|
|
@@ -4273,7 +598,7 @@ var CONFIG = {
|
|
|
4273
598
|
CSS_VARS,
|
|
4274
599
|
...void 0 || defaultConfig_exports
|
|
4275
600
|
};
|
|
4276
|
-
var cachedConfig =
|
|
601
|
+
var cachedConfig = deepClone(CONFIG);
|
|
4277
602
|
var FACTORY = {
|
|
4278
603
|
active: "0",
|
|
4279
604
|
0: CONFIG
|
|
@@ -4283,8 +608,7 @@ var getActiveConfig = (def) => {
|
|
|
4283
608
|
};
|
|
4284
609
|
|
|
4285
610
|
// src/utils/sequence.js
|
|
4286
|
-
var
|
|
4287
|
-
var import_utils3 = __toESM(require_cjs2(), 1);
|
|
611
|
+
var import_utils3 = __toESM(require_cjs(), 1);
|
|
4288
612
|
|
|
4289
613
|
// src/utils/unit.js
|
|
4290
614
|
var isScalingUnit = (unit) => {
|
|
@@ -4308,7 +632,7 @@ var getSubratio = (base, ratio) => {
|
|
|
4308
632
|
var setVariables = (result, key) => {
|
|
4309
633
|
const CONFIG2 = getActiveConfig();
|
|
4310
634
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
4311
|
-
if (
|
|
635
|
+
if (isObjectLike(result.value)) {
|
|
4312
636
|
} else {
|
|
4313
637
|
CSS_VARS2[result.var] = result.value;
|
|
4314
638
|
}
|