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