@symbo.ls/scratch 2.11.398 → 2.11.429

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,19 +56,19 @@ var require_cjs = __commonJS({
56
56
  document: () => document4,
57
57
  global: () => global,
58
58
  self: () => self,
59
- window: () => window2
59
+ window: () => window3
60
60
  });
61
61
  module2.exports = __toCommonJS2(globals_exports);
62
62
  var global = globalThis;
63
63
  var self = globalThis;
64
- var window2 = globalThis;
65
- var document4 = window2.document;
64
+ var window3 = globalThis;
65
+ var document4 = window3.document;
66
66
  }
67
67
  });
68
68
 
69
- // ../../node_modules/@domql/utils/dist/cjs/key.js
69
+ // ../../../domql/packages/utils/dist/cjs/key.js
70
70
  var require_key = __commonJS({
71
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
71
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
72
72
  "use strict";
73
73
  var __defProp2 = Object.defineProperty;
74
74
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -105,9 +105,9 @@ var require_key = __commonJS({
105
105
  }
106
106
  });
107
107
 
108
- // ../../node_modules/@domql/utils/dist/cjs/env.js
108
+ // ../../../domql/packages/utils/dist/cjs/env.js
109
109
  var require_env = __commonJS({
110
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
110
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
111
111
  "use strict";
112
112
  var __defProp2 = Object.defineProperty;
113
113
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -143,9 +143,9 @@ var require_env = __commonJS({
143
143
  }
144
144
  });
145
145
 
146
- // ../../node_modules/@domql/utils/dist/cjs/globals.js
146
+ // ../../../domql/packages/utils/dist/cjs/globals.js
147
147
  var require_globals = __commonJS({
148
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
148
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
149
149
  "use strict";
150
150
  var __defProp2 = Object.defineProperty;
151
151
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -169,19 +169,19 @@ var require_globals = __commonJS({
169
169
  document: () => document4,
170
170
  global: () => global,
171
171
  self: () => self,
172
- window: () => window2
172
+ window: () => window3
173
173
  });
174
174
  module2.exports = __toCommonJS2(globals_exports);
175
175
  var global = globalThis;
176
176
  var self = globalThis;
177
- var window2 = globalThis;
178
- var document4 = window2.document;
177
+ var window3 = globalThis;
178
+ var document4 = window3.document;
179
179
  }
180
180
  });
181
181
 
182
- // ../../node_modules/@domql/utils/dist/cjs/node.js
182
+ // ../../../domql/packages/utils/dist/cjs/node.js
183
183
  var require_node = __commonJS({
184
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
184
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
185
185
  "use strict";
186
186
  var __defProp2 = Object.defineProperty;
187
187
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -216,9 +216,9 @@ var require_node = __commonJS({
216
216
  }
217
217
  });
218
218
 
219
- // ../../node_modules/@domql/utils/dist/cjs/types.js
219
+ // ../../../domql/packages/utils/dist/cjs/types.js
220
220
  var require_types = __commonJS({
221
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
221
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
222
222
  "use strict";
223
223
  var __defProp2 = Object.defineProperty;
224
224
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -306,9 +306,9 @@ var require_types = __commonJS({
306
306
  }
307
307
  });
308
308
 
309
- // ../../node_modules/@domql/utils/dist/cjs/array.js
309
+ // ../../../domql/packages/utils/dist/cjs/array.js
310
310
  var require_array = __commonJS({
311
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
311
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
312
312
  "use strict";
313
313
  var __defProp2 = Object.defineProperty;
314
314
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -331,6 +331,7 @@ var require_array = __commonJS({
331
331
  __export2(array_exports, {
332
332
  addItemAfterEveryElement: () => addItemAfterEveryElement,
333
333
  arrayContainsOtherArray: () => arrayContainsOtherArray,
334
+ arraysEqual: () => arraysEqual,
334
335
  createNestedObject: () => createNestedObject,
335
336
  cutArrayAfterValue: () => cutArrayAfterValue,
336
337
  cutArrayBeforeValue: () => cutArrayBeforeValue,
@@ -377,10 +378,10 @@ var require_array = __commonJS({
377
378
  return [].concat(...arrays);
378
379
  };
379
380
  var mergeArray = (arr, excludeFrom = []) => {
380
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
381
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
381
382
  };
382
383
  var mergeAndCloneIfArray = (obj) => {
383
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
384
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
384
385
  };
385
386
  var cutArrayBeforeValue = (arr, value) => {
386
387
  const index = arr.indexOf(value);
@@ -447,12 +448,23 @@ var require_array = __commonJS({
447
448
  }
448
449
  return newArray;
449
450
  };
451
+ var arraysEqual = (arr1, arr2) => {
452
+ if (arr1.length !== arr2.length) {
453
+ return false;
454
+ }
455
+ for (let i = 0; i < arr1.length; i++) {
456
+ if (arr1[i] !== arr2[i]) {
457
+ return false;
458
+ }
459
+ }
460
+ return true;
461
+ };
450
462
  }
451
463
  });
452
464
 
453
- // ../../node_modules/@domql/utils/dist/cjs/string.js
465
+ // ../../../domql/packages/utils/dist/cjs/string.js
454
466
  var require_string = __commonJS({
455
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
467
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
456
468
  "use strict";
457
469
  var __defProp2 = Object.defineProperty;
458
470
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -473,8 +485,14 @@ var require_string = __commonJS({
473
485
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
474
486
  var string_exports = {};
475
487
  __export2(string_exports, {
488
+ customDecodeURIComponent: () => customDecodeURIComponent,
489
+ customEncodeURIComponent: () => customEncodeURIComponent,
490
+ decodeNewlines: () => decodeNewlines,
491
+ encodeNewlines: () => encodeNewlines,
492
+ findKeyPosition: () => findKeyPosition,
476
493
  lowercaseFirstLetter: () => lowercaseFirstLetter,
477
494
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
495
+ replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
478
496
  stringIncludesAny: () => stringIncludesAny,
479
497
  trimStringFromSymbols: () => trimStringFromSymbols
480
498
  });
@@ -520,12 +538,83 @@ var require_string = __commonJS({
520
538
  var lowercaseFirstLetter = (inputString) => {
521
539
  return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
522
540
  };
541
+ var findKeyPosition = (str, key) => {
542
+ const lines = str.split("\n");
543
+ let startLineNumber = -1;
544
+ let endLineNumber = -1;
545
+ let startColumn = -1;
546
+ let endColumn = -1;
547
+ const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
548
+ let braceCount = 0;
549
+ let foundKey = false;
550
+ for (let i = 0; i < lines.length; i++) {
551
+ if (keyPattern.test(lines[i]) && !foundKey) {
552
+ foundKey = true;
553
+ startLineNumber = i + 1;
554
+ startColumn = lines[i].indexOf(key) + 1;
555
+ if (lines[i].includes("{}")) {
556
+ endLineNumber = startLineNumber;
557
+ endColumn = lines[i].indexOf("{}") + 3;
558
+ break;
559
+ }
560
+ const line = lines[i].slice(startColumn + key.length);
561
+ if (line.includes("{") || line.includes("[")) {
562
+ braceCount = 1;
563
+ } else {
564
+ endLineNumber = i + 1;
565
+ endColumn = lines[i].length + 1;
566
+ break;
567
+ }
568
+ } else if (foundKey) {
569
+ braceCount += (lines[i].match(/{/g) || []).length;
570
+ braceCount += (lines[i].match(/\[/g) || []).length;
571
+ braceCount -= (lines[i].match(/}/g) || []).length;
572
+ braceCount -= (lines[i].match(/]/g) || []).length;
573
+ if (braceCount === 0) {
574
+ endLineNumber = i + 1;
575
+ endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
576
+ break;
577
+ }
578
+ }
579
+ }
580
+ return {
581
+ startColumn,
582
+ endColumn,
583
+ startLineNumber,
584
+ endLineNumber
585
+ };
586
+ };
587
+ var replaceOctalEscapeSequences = (str) => {
588
+ const octalRegex = /\\([0-7]{1,3})/g;
589
+ return str.replace(octalRegex, (match, p1) => {
590
+ const octalValue = parseInt(p1, 8);
591
+ const char = String.fromCharCode(octalValue);
592
+ return char;
593
+ });
594
+ };
595
+ var encodeNewlines = (str) => {
596
+ return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
597
+ };
598
+ var decodeNewlines = (encodedStr) => {
599
+ return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
600
+ };
601
+ var customEncodeURIComponent = (str) => {
602
+ return str.split("").map((char) => {
603
+ if (/[^a-zA-Z0-9\s]/.test(char)) {
604
+ return "%" + char.charCodeAt(0).toString(16).toUpperCase();
605
+ }
606
+ return char;
607
+ }).join("");
608
+ };
609
+ var customDecodeURIComponent = (encodedStr) => {
610
+ return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
611
+ };
523
612
  }
524
613
  });
525
614
 
526
- // ../../node_modules/@domql/utils/dist/cjs/object.js
615
+ // ../../../domql/packages/utils/dist/cjs/object.js
527
616
  var require_object = __commonJS({
528
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
617
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
529
618
  "use strict";
530
619
  var __defProp2 = Object.defineProperty;
531
620
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -546,7 +635,9 @@ var require_object = __commonJS({
546
635
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
547
636
  var object_exports = {};
548
637
  __export2(object_exports, {
638
+ checkIfKeyIsComponent: () => checkIfKeyIsComponent,
549
639
  clone: () => clone,
640
+ createObjectWithoutPrototype: () => createObjectWithoutPrototype,
550
641
  deepClone: () => deepClone2,
551
642
  deepCloneExclude: () => deepCloneExclude,
552
643
  deepCloneWithExtend: () => deepCloneWithExtend,
@@ -561,6 +652,8 @@ var require_object = __commonJS({
561
652
  diffObjects: () => diffObjects,
562
653
  exec: () => exec,
563
654
  flattenRecursive: () => flattenRecursive,
655
+ getChildrenComponentsByKey: () => getChildrenComponentsByKey,
656
+ getExtendsInElement: () => getExtendsInElement,
564
657
  hasOwnProperty: () => hasOwnProperty,
565
658
  isEmpty: () => isEmpty,
566
659
  isEmptyObject: () => isEmptyObject,
@@ -683,7 +776,7 @@ var require_object = __commonJS({
683
776
  return o;
684
777
  };
685
778
  var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
686
- const o = (0, import_types.isArray)(obj) ? [] : {};
779
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
687
780
  for (const prop in obj) {
688
781
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
689
782
  continue;
@@ -937,7 +1030,7 @@ var require_object = __commonJS({
937
1030
  };
938
1031
  var overwriteDeep = (obj, params, excludeFrom = []) => {
939
1032
  for (const e in params) {
940
- if (e === "__proto__")
1033
+ if (e === "__ref")
941
1034
  continue;
942
1035
  if (excludeFrom.includes(e) || e.startsWith("__"))
943
1036
  continue;
@@ -1030,12 +1123,72 @@ var require_object = __commonJS({
1030
1123
  }
1031
1124
  return obj;
1032
1125
  };
1126
+ var createObjectWithoutPrototype = (obj) => {
1127
+ if (obj === null || typeof obj !== "object") {
1128
+ return obj;
1129
+ }
1130
+ const newObj = /* @__PURE__ */ Object.create(null);
1131
+ for (const key in obj) {
1132
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
1133
+ newObj[key] = createObjectWithoutPrototype(obj[key]);
1134
+ }
1135
+ }
1136
+ return newObj;
1137
+ };
1138
+ var checkIfKeyIsComponent = (key) => {
1139
+ const isFirstKeyString = (0, import_types.isString)(key);
1140
+ if (!isFirstKeyString)
1141
+ return;
1142
+ const firstCharKey = key.slice(0, 1);
1143
+ return /^[A-Z]*$/.test(firstCharKey);
1144
+ };
1145
+ var getChildrenComponentsByKey = (key, el) => {
1146
+ if (key === el.key || el.__ref.__componentKey === key) {
1147
+ return el;
1148
+ }
1149
+ if (el.extend) {
1150
+ const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
1151
+ const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
1152
+ if (foundString || foundInArray)
1153
+ return el;
1154
+ }
1155
+ if (el.parent && el.parent.childExtend) {
1156
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
1157
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
1158
+ if (foundString || foundInArray)
1159
+ return el;
1160
+ }
1161
+ };
1162
+ var getExtendsInElement = (obj) => {
1163
+ let result = [];
1164
+ function traverse(o) {
1165
+ for (const key in o) {
1166
+ if (Object.hasOwnProperty.call(o, key)) {
1167
+ if (checkIfKeyIsComponent(key)) {
1168
+ result.push(key);
1169
+ }
1170
+ if (key === "extend") {
1171
+ if (typeof o[key] === "string") {
1172
+ result.push(o[key]);
1173
+ } else if (Array.isArray(o[key])) {
1174
+ result = result.concat(o[key]);
1175
+ }
1176
+ }
1177
+ if (typeof o[key] === "object" && o[key] !== null) {
1178
+ traverse(o[key]);
1179
+ }
1180
+ }
1181
+ }
1182
+ }
1183
+ traverse(obj);
1184
+ return result;
1185
+ };
1033
1186
  }
1034
1187
  });
1035
1188
 
1036
- // ../../node_modules/@domql/utils/dist/cjs/function.js
1189
+ // ../../../domql/packages/utils/dist/cjs/function.js
1037
1190
  var require_function = __commonJS({
1038
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
1191
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
1039
1192
  "use strict";
1040
1193
  var __defProp2 = Object.defineProperty;
1041
1194
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1108,9 +1261,9 @@ var require_function = __commonJS({
1108
1261
  }
1109
1262
  });
1110
1263
 
1111
- // ../../node_modules/@domql/utils/dist/cjs/log.js
1264
+ // ../../../domql/packages/utils/dist/cjs/log.js
1112
1265
  var require_log = __commonJS({
1113
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
1266
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
1114
1267
  "use strict";
1115
1268
  var __defProp2 = Object.defineProperty;
1116
1269
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1149,9 +1302,9 @@ var require_log = __commonJS({
1149
1302
  }
1150
1303
  });
1151
1304
 
1152
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1305
+ // ../../../domql/packages/utils/dist/cjs/cookie.js
1153
1306
  var require_cookie = __commonJS({
1154
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1307
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
1155
1308
  "use strict";
1156
1309
  var __defProp2 = Object.defineProperty;
1157
1310
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1206,9 +1359,9 @@ var require_cookie = __commonJS({
1206
1359
  }
1207
1360
  });
1208
1361
 
1209
- // ../../node_modules/@domql/utils/dist/cjs/tags.js
1362
+ // ../../../domql/packages/utils/dist/cjs/tags.js
1210
1363
  var require_tags = __commonJS({
1211
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
1364
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1212
1365
  "use strict";
1213
1366
  var __defProp2 = Object.defineProperty;
1214
1367
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1374,9 +1527,9 @@ var require_tags = __commonJS({
1374
1527
  }
1375
1528
  });
1376
1529
 
1377
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1530
+ // ../../../domql/packages/utils/dist/cjs/index.js
1378
1531
  var require_cjs2 = __commonJS({
1379
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1532
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1380
1533
  "use strict";
1381
1534
  var __defProp2 = Object.defineProperty;
1382
1535
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1409,9 +1562,9 @@ var require_cjs2 = __commonJS({
1409
1562
  }
1410
1563
  });
1411
1564
 
1412
- // ../../node_modules/@symbo.ls/utils/dist/cjs/index.js
1565
+ // ../utils/dist/cjs/index.js
1413
1566
  var require_cjs3 = __commonJS({
1414
- "../../node_modules/@symbo.ls/utils/dist/cjs/index.js"(exports, module2) {
1567
+ "../utils/dist/cjs/index.js"(exports, module2) {
1415
1568
  "use strict";
1416
1569
  var __create2 = Object.create;
1417
1570
  var __defProp2 = Object.defineProperty;
@@ -1444,7 +1597,7 @@ var require_cjs3 = __commonJS({
1444
1597
  ));
1445
1598
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1446
1599
  var require_key2 = __commonJS2({
1447
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
1600
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports2, module22) {
1448
1601
  "use strict";
1449
1602
  var __defProp22 = Object.defineProperty;
1450
1603
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1481,7 +1634,7 @@ var require_cjs3 = __commonJS({
1481
1634
  }
1482
1635
  });
1483
1636
  var require_env2 = __commonJS2({
1484
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
1637
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports2, module22) {
1485
1638
  "use strict";
1486
1639
  var __defProp22 = Object.defineProperty;
1487
1640
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1517,7 +1670,7 @@ var require_cjs3 = __commonJS({
1517
1670
  }
1518
1671
  });
1519
1672
  var require_globals2 = __commonJS2({
1520
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
1673
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports2, module22) {
1521
1674
  "use strict";
1522
1675
  var __defProp22 = Object.defineProperty;
1523
1676
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1541,17 +1694,17 @@ var require_cjs3 = __commonJS({
1541
1694
  document: () => document22,
1542
1695
  global: () => global,
1543
1696
  self: () => self,
1544
- window: () => window2
1697
+ window: () => window22
1545
1698
  });
1546
1699
  module22.exports = __toCommonJS22(globals_exports);
1547
1700
  var global = globalThis;
1548
1701
  var self = globalThis;
1549
- var window2 = globalThis;
1550
- var document22 = window2.document;
1702
+ var window22 = globalThis;
1703
+ var document22 = window22.document;
1551
1704
  }
1552
1705
  });
1553
1706
  var require_node2 = __commonJS2({
1554
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
1707
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports2, module22) {
1555
1708
  "use strict";
1556
1709
  var __defProp22 = Object.defineProperty;
1557
1710
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1586,7 +1739,7 @@ var require_cjs3 = __commonJS({
1586
1739
  }
1587
1740
  });
1588
1741
  var require_types2 = __commonJS2({
1589
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
1742
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports2, module22) {
1590
1743
  "use strict";
1591
1744
  var __defProp22 = Object.defineProperty;
1592
1745
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1674,7 +1827,7 @@ var require_cjs3 = __commonJS({
1674
1827
  }
1675
1828
  });
1676
1829
  var require_array2 = __commonJS2({
1677
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
1830
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports2, module22) {
1678
1831
  "use strict";
1679
1832
  var __defProp22 = Object.defineProperty;
1680
1833
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1697,6 +1850,7 @@ var require_cjs3 = __commonJS({
1697
1850
  __export22(array_exports, {
1698
1851
  addItemAfterEveryElement: () => addItemAfterEveryElement,
1699
1852
  arrayContainsOtherArray: () => arrayContainsOtherArray,
1853
+ arraysEqual: () => arraysEqual,
1700
1854
  createNestedObject: () => createNestedObject,
1701
1855
  cutArrayAfterValue: () => cutArrayAfterValue,
1702
1856
  cutArrayBeforeValue: () => cutArrayBeforeValue,
@@ -1813,10 +1967,21 @@ var require_cjs3 = __commonJS({
1813
1967
  }
1814
1968
  return newArray;
1815
1969
  };
1970
+ var arraysEqual = (arr1, arr2) => {
1971
+ if (arr1.length !== arr2.length) {
1972
+ return false;
1973
+ }
1974
+ for (let i = 0; i < arr1.length; i++) {
1975
+ if (arr1[i] !== arr2[i]) {
1976
+ return false;
1977
+ }
1978
+ }
1979
+ return true;
1980
+ };
1816
1981
  }
1817
1982
  });
1818
1983
  var require_string2 = __commonJS2({
1819
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
1984
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports2, module22) {
1820
1985
  "use strict";
1821
1986
  var __defProp22 = Object.defineProperty;
1822
1987
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1837,8 +2002,12 @@ var require_cjs3 = __commonJS({
1837
2002
  var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1838
2003
  var string_exports = {};
1839
2004
  __export22(string_exports, {
2005
+ customDecodeURIComponent: () => customDecodeURIComponent,
2006
+ customEncodeURIComponent: () => customEncodeURIComponent,
2007
+ findKeyPosition: () => findKeyPosition,
1840
2008
  lowercaseFirstLetter: () => lowercaseFirstLetter,
1841
2009
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
2010
+ replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
1842
2011
  stringIncludesAny: () => stringIncludesAny,
1843
2012
  trimStringFromSymbols: () => trimStringFromSymbols
1844
2013
  });
@@ -1884,10 +2053,75 @@ var require_cjs3 = __commonJS({
1884
2053
  var lowercaseFirstLetter = (inputString) => {
1885
2054
  return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
1886
2055
  };
2056
+ var findKeyPosition = (str, key) => {
2057
+ const lines = str.split("\n");
2058
+ let startLineNumber = -1;
2059
+ let endLineNumber = -1;
2060
+ let startColumn = -1;
2061
+ let endColumn = -1;
2062
+ const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2063
+ let braceCount = 0;
2064
+ let foundKey = false;
2065
+ for (let i = 0; i < lines.length; i++) {
2066
+ if (keyPattern.test(lines[i]) && !foundKey) {
2067
+ foundKey = true;
2068
+ startLineNumber = i + 1;
2069
+ startColumn = lines[i].indexOf(key) + 1;
2070
+ if (lines[i].includes("{}")) {
2071
+ endLineNumber = startLineNumber;
2072
+ endColumn = lines[i].indexOf("{}") + 3;
2073
+ break;
2074
+ }
2075
+ const line = lines[i].slice(startColumn + key.length);
2076
+ if (line.includes("{") || line.includes("[")) {
2077
+ braceCount = 1;
2078
+ } else {
2079
+ endLineNumber = i + 1;
2080
+ endColumn = lines[i].length + 1;
2081
+ break;
2082
+ }
2083
+ } else if (foundKey) {
2084
+ braceCount += (lines[i].match(/{/g) || []).length;
2085
+ braceCount += (lines[i].match(/\[/g) || []).length;
2086
+ braceCount -= (lines[i].match(/}/g) || []).length;
2087
+ braceCount -= (lines[i].match(/]/g) || []).length;
2088
+ if (braceCount === 0) {
2089
+ endLineNumber = i + 1;
2090
+ endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2091
+ break;
2092
+ }
2093
+ }
2094
+ }
2095
+ return {
2096
+ startColumn,
2097
+ endColumn,
2098
+ startLineNumber,
2099
+ endLineNumber
2100
+ };
2101
+ };
2102
+ var replaceOctalEscapeSequences = (str) => {
2103
+ const octalRegex = /\\([0-7]{1,3})/g;
2104
+ return str.replace(octalRegex, (match, p1) => {
2105
+ const octalValue = parseInt(p1, 8);
2106
+ const char = String.fromCharCode(octalValue);
2107
+ return char;
2108
+ });
2109
+ };
2110
+ var customEncodeURIComponent = (str) => {
2111
+ return str.split("").map((char) => {
2112
+ if (/[^a-zA-Z0-9\s]/.test(char)) {
2113
+ return "%" + char.charCodeAt(0).toString(16).toUpperCase();
2114
+ }
2115
+ return char;
2116
+ }).join("");
2117
+ };
2118
+ var customDecodeURIComponent = (encodedStr) => {
2119
+ return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
2120
+ };
1887
2121
  }
1888
2122
  });
1889
2123
  var require_object2 = __commonJS2({
1890
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
2124
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports2, module22) {
1891
2125
  "use strict";
1892
2126
  var __defProp22 = Object.defineProperty;
1893
2127
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1908,7 +2142,9 @@ var require_cjs3 = __commonJS({
1908
2142
  var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1909
2143
  var object_exports = {};
1910
2144
  __export22(object_exports, {
2145
+ checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1911
2146
  clone: () => clone,
2147
+ createObjectWithoutPrototype: () => createObjectWithoutPrototype,
1912
2148
  deepClone: () => deepClone2,
1913
2149
  deepCloneExclude: () => deepCloneExclude,
1914
2150
  deepCloneWithExtend: () => deepCloneWithExtend,
@@ -1923,6 +2159,8 @@ var require_cjs3 = __commonJS({
1923
2159
  diffObjects: () => diffObjects,
1924
2160
  exec: () => exec,
1925
2161
  flattenRecursive: () => flattenRecursive,
2162
+ getChildrenComponentsByKey: () => getChildrenComponentsByKey,
2163
+ getExtendsInElement: () => getExtendsInElement,
1926
2164
  hasOwnProperty: () => hasOwnProperty,
1927
2165
  isEmpty: () => isEmpty,
1928
2166
  isEmptyObject: () => isEmptyObject,
@@ -2045,7 +2283,7 @@ var require_cjs3 = __commonJS({
2045
2283
  return o;
2046
2284
  };
2047
2285
  var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
2048
- const o = (0, import_types.isArray)(obj) ? [] : {};
2286
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
2049
2287
  for (const prop in obj) {
2050
2288
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
2051
2289
  continue;
@@ -2392,10 +2630,70 @@ var require_cjs3 = __commonJS({
2392
2630
  }
2393
2631
  return obj;
2394
2632
  };
2633
+ var createObjectWithoutPrototype = (obj) => {
2634
+ if (obj === null || typeof obj !== "object") {
2635
+ return obj;
2636
+ }
2637
+ const newObj = /* @__PURE__ */ Object.create(null);
2638
+ for (const key in obj) {
2639
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
2640
+ newObj[key] = createObjectWithoutPrototype(obj[key]);
2641
+ }
2642
+ }
2643
+ return newObj;
2644
+ };
2645
+ var checkIfKeyIsComponent = (key) => {
2646
+ const isFirstKeyString = (0, import_types.isString)(key);
2647
+ if (!isFirstKeyString)
2648
+ return;
2649
+ const firstCharKey = key.slice(0, 1);
2650
+ return /^[A-Z]*$/.test(firstCharKey);
2651
+ };
2652
+ var getChildrenComponentsByKey = (key, el) => {
2653
+ if (key === el.key || el.__ref.__componentKey === key) {
2654
+ return el;
2655
+ }
2656
+ if (el.extend) {
2657
+ const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
2658
+ const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
2659
+ if (foundString || foundInArray)
2660
+ return el;
2661
+ }
2662
+ if (el.parent && el.parent.childExtend) {
2663
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
2664
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
2665
+ if (foundString || foundInArray)
2666
+ return el;
2667
+ }
2668
+ };
2669
+ var getExtendsInElement = (obj) => {
2670
+ let result = [];
2671
+ function traverse(o) {
2672
+ for (const key in o) {
2673
+ if (Object.hasOwnProperty.call(o, key)) {
2674
+ if (checkIfKeyIsComponent(key)) {
2675
+ result.push(key);
2676
+ }
2677
+ if (key === "extend") {
2678
+ if (typeof o[key] === "string") {
2679
+ result.push(o[key]);
2680
+ } else if (Array.isArray(o[key])) {
2681
+ result = result.concat(o[key]);
2682
+ }
2683
+ }
2684
+ if (typeof o[key] === "object" && o[key] !== null) {
2685
+ traverse(o[key]);
2686
+ }
2687
+ }
2688
+ }
2689
+ }
2690
+ traverse(obj);
2691
+ return result;
2692
+ };
2395
2693
  }
2396
2694
  });
2397
2695
  var require_function2 = __commonJS2({
2398
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
2696
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports2, module22) {
2399
2697
  "use strict";
2400
2698
  var __defProp22 = Object.defineProperty;
2401
2699
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2468,7 +2766,7 @@ var require_cjs3 = __commonJS({
2468
2766
  }
2469
2767
  });
2470
2768
  var require_log2 = __commonJS2({
2471
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
2769
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports2, module22) {
2472
2770
  "use strict";
2473
2771
  var __defProp22 = Object.defineProperty;
2474
2772
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2507,7 +2805,7 @@ var require_cjs3 = __commonJS({
2507
2805
  }
2508
2806
  });
2509
2807
  var require_cookie2 = __commonJS2({
2510
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
2808
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports2, module22) {
2511
2809
  "use strict";
2512
2810
  var __defProp22 = Object.defineProperty;
2513
2811
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2562,7 +2860,7 @@ var require_cjs3 = __commonJS({
2562
2860
  }
2563
2861
  });
2564
2862
  var require_tags2 = __commonJS2({
2565
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
2863
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports2, module22) {
2566
2864
  "use strict";
2567
2865
  var __defProp22 = Object.defineProperty;
2568
2866
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2728,7 +3026,7 @@ var require_cjs3 = __commonJS({
2728
3026
  }
2729
3027
  });
2730
3028
  var require_cjs4 = __commonJS2({
2731
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
3029
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports2, module22) {
2732
3030
  "use strict";
2733
3031
  var __defProp22 = Object.defineProperty;
2734
3032
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2768,8 +3066,11 @@ var require_cjs3 = __commonJS({
2768
3066
  findClosestNumber: () => findClosestNumber,
2769
3067
  findClosestNumberInFactory: () => findClosestNumberInFactory,
2770
3068
  formatDate: () => formatDate,
3069
+ isPhoto: () => isPhoto,
3070
+ loadCssFile: () => loadCssFile,
2771
3071
  loadJavascript: () => loadJavascript,
2772
3072
  loadJavascriptFile: () => loadJavascriptFile,
3073
+ loadJavascriptFileSync: () => loadJavascriptFileSync,
2773
3074
  removeChars: () => removeChars,
2774
3075
  toCamelCase: () => toCamelCase,
2775
3076
  toDashCase: () => toDashCase2,
@@ -2779,13 +3080,15 @@ var require_cjs3 = __commonJS({
2779
3080
  });
2780
3081
  module2.exports = __toCommonJS2(src_exports);
2781
3082
  var import_utils22 = __toESM2(require_cjs4(), 1);
2782
- var toggleFullscreen = (el) => {
3083
+ var toggleFullscreen = async (el) => {
2783
3084
  if (!document.fullscreenElement) {
2784
- el.node.requestFullscreen().catch((err) => {
3085
+ try {
3086
+ await (el.node || document).requestFullscreen();
3087
+ } catch (err) {
2785
3088
  console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
2786
- });
3089
+ }
2787
3090
  } else {
2788
- document.exitFullscreen();
3091
+ await document.exitFullscreen();
2789
3092
  }
2790
3093
  };
2791
3094
  var import_utils8 = __toESM2(require_cjs4(), 1);
@@ -2816,7 +3119,7 @@ var require_cjs3 = __commonJS({
2816
3119
  }
2817
3120
  return fib[n];
2818
3121
  };
2819
- var loadJavascriptFile = (FILE_URL, async = true, doc = document, type = "text/javascript") => {
3122
+ var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
2820
3123
  return new Promise((resolve, reject) => {
2821
3124
  try {
2822
3125
  const scriptEle = doc.createElement("script");
@@ -2829,10 +3132,10 @@ var require_cjs3 = __commonJS({
2829
3132
  });
2830
3133
  });
2831
3134
  scriptEle.addEventListener("error", (ev) => {
2832
- reject({
3135
+ reject(new Error({
2833
3136
  status: false,
2834
3137
  message: `Failed to load the script ${FILE_URL}`
2835
- });
3138
+ }));
2836
3139
  });
2837
3140
  doc.body.appendChild(scriptEle);
2838
3141
  } catch (error) {
@@ -2840,17 +3143,51 @@ var require_cjs3 = __commonJS({
2840
3143
  }
2841
3144
  });
2842
3145
  };
2843
- var loadJavascript = (body, async = true, doc = document, type = "text/javascript") => {
3146
+ var loadJavascriptFileSync = (FILE_URL, doc = document, fallback, type = "text/javascript") => {
3147
+ const xhr = new window.XMLHttpRequest();
3148
+ xhr.open("GET", FILE_URL, false);
3149
+ xhr.send();
3150
+ if (xhr.status === 200) {
3151
+ const scriptEle = doc.createElement("script");
3152
+ scriptEle.type = type;
3153
+ scriptEle.text = xhr.responseText;
3154
+ doc.body.appendChild(scriptEle);
3155
+ if (typeof fallback === "function")
3156
+ fallback();
3157
+ } else {
3158
+ throw new Error(`Failed to load the script ${FILE_URL}`);
3159
+ }
3160
+ };
3161
+ var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3162
+ return new Promise((resolve, reject) => {
3163
+ try {
3164
+ const linkElem = doc.createElement("link");
3165
+ linkElem.rel = "stylesheet";
3166
+ linkElem.href = FILE_URL;
3167
+ linkElem.addEventListener("load", (ev) => {
3168
+ resolve({
3169
+ status: true
3170
+ });
3171
+ });
3172
+ doc.head.appendChild(linkElem);
3173
+ } catch (error) {
3174
+ reject(error);
3175
+ }
3176
+ });
3177
+ };
3178
+ var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
2844
3179
  try {
2845
3180
  const scriptEle = doc.createElement("script");
2846
3181
  scriptEle.type = type;
2847
3182
  scriptEle.async = async;
3183
+ scriptEle.id = id;
2848
3184
  scriptEle.innerHTML = body;
2849
3185
  doc.body.appendChild(scriptEle);
2850
3186
  } catch (error) {
2851
3187
  console.warn(error);
2852
3188
  }
2853
3189
  };
3190
+ var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
2854
3191
  var copyStringToClipboard = (str) => {
2855
3192
  const el = document.createElement("textarea");
2856
3193
  el.value = str;