@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.
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // ../../node_modules/@domql/utils/dist/cjs/key.js
33
+ // ../../../domql/packages/utils/dist/cjs/key.js
34
34
  var require_key = __commonJS({
35
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
35
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
36
36
  "use strict";
37
37
  var __defProp2 = Object.defineProperty;
38
38
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -69,9 +69,9 @@ var require_key = __commonJS({
69
69
  }
70
70
  });
71
71
 
72
- // ../../node_modules/@domql/utils/dist/cjs/env.js
72
+ // ../../../domql/packages/utils/dist/cjs/env.js
73
73
  var require_env = __commonJS({
74
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
74
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
75
75
  "use strict";
76
76
  var __defProp2 = Object.defineProperty;
77
77
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -107,9 +107,9 @@ var require_env = __commonJS({
107
107
  }
108
108
  });
109
109
 
110
- // ../../node_modules/@domql/utils/dist/cjs/globals.js
110
+ // ../../../domql/packages/utils/dist/cjs/globals.js
111
111
  var require_globals = __commonJS({
112
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
112
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
113
113
  "use strict";
114
114
  var __defProp2 = Object.defineProperty;
115
115
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -133,19 +133,19 @@ var require_globals = __commonJS({
133
133
  document: () => document3,
134
134
  global: () => global,
135
135
  self: () => self,
136
- window: () => window2
136
+ window: () => window3
137
137
  });
138
138
  module2.exports = __toCommonJS2(globals_exports);
139
139
  var global = globalThis;
140
140
  var self = globalThis;
141
- var window2 = globalThis;
142
- var document3 = window2.document;
141
+ var window3 = globalThis;
142
+ var document3 = window3.document;
143
143
  }
144
144
  });
145
145
 
146
- // ../../node_modules/@domql/utils/dist/cjs/node.js
146
+ // ../../../domql/packages/utils/dist/cjs/node.js
147
147
  var require_node = __commonJS({
148
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
148
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
149
149
  "use strict";
150
150
  var __defProp2 = Object.defineProperty;
151
151
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -180,9 +180,9 @@ var require_node = __commonJS({
180
180
  }
181
181
  });
182
182
 
183
- // ../../node_modules/@domql/utils/dist/cjs/types.js
183
+ // ../../../domql/packages/utils/dist/cjs/types.js
184
184
  var require_types = __commonJS({
185
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
185
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
186
186
  "use strict";
187
187
  var __defProp2 = Object.defineProperty;
188
188
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -270,9 +270,9 @@ var require_types = __commonJS({
270
270
  }
271
271
  });
272
272
 
273
- // ../../node_modules/@domql/utils/dist/cjs/array.js
273
+ // ../../../domql/packages/utils/dist/cjs/array.js
274
274
  var require_array = __commonJS({
275
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
275
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
276
276
  "use strict";
277
277
  var __defProp2 = Object.defineProperty;
278
278
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -295,6 +295,7 @@ var require_array = __commonJS({
295
295
  __export2(array_exports, {
296
296
  addItemAfterEveryElement: () => addItemAfterEveryElement,
297
297
  arrayContainsOtherArray: () => arrayContainsOtherArray,
298
+ arraysEqual: () => arraysEqual,
298
299
  createNestedObject: () => createNestedObject,
299
300
  cutArrayAfterValue: () => cutArrayAfterValue,
300
301
  cutArrayBeforeValue: () => cutArrayBeforeValue,
@@ -341,10 +342,10 @@ var require_array = __commonJS({
341
342
  return [].concat(...arrays);
342
343
  };
343
344
  var mergeArray = (arr, excludeFrom = []) => {
344
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
345
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
345
346
  };
346
347
  var mergeAndCloneIfArray = (obj) => {
347
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
348
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
348
349
  };
349
350
  var cutArrayBeforeValue = (arr, value) => {
350
351
  const index = arr.indexOf(value);
@@ -411,12 +412,23 @@ var require_array = __commonJS({
411
412
  }
412
413
  return newArray;
413
414
  };
415
+ var arraysEqual = (arr1, arr2) => {
416
+ if (arr1.length !== arr2.length) {
417
+ return false;
418
+ }
419
+ for (let i = 0; i < arr1.length; i++) {
420
+ if (arr1[i] !== arr2[i]) {
421
+ return false;
422
+ }
423
+ }
424
+ return true;
425
+ };
414
426
  }
415
427
  });
416
428
 
417
- // ../../node_modules/@domql/utils/dist/cjs/string.js
429
+ // ../../../domql/packages/utils/dist/cjs/string.js
418
430
  var require_string = __commonJS({
419
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
431
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
420
432
  "use strict";
421
433
  var __defProp2 = Object.defineProperty;
422
434
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -437,8 +449,14 @@ var require_string = __commonJS({
437
449
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
438
450
  var string_exports = {};
439
451
  __export2(string_exports, {
452
+ customDecodeURIComponent: () => customDecodeURIComponent,
453
+ customEncodeURIComponent: () => customEncodeURIComponent,
454
+ decodeNewlines: () => decodeNewlines,
455
+ encodeNewlines: () => encodeNewlines,
456
+ findKeyPosition: () => findKeyPosition,
440
457
  lowercaseFirstLetter: () => lowercaseFirstLetter,
441
458
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
459
+ replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
442
460
  stringIncludesAny: () => stringIncludesAny,
443
461
  trimStringFromSymbols: () => trimStringFromSymbols
444
462
  });
@@ -484,12 +502,83 @@ var require_string = __commonJS({
484
502
  var lowercaseFirstLetter = (inputString) => {
485
503
  return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
486
504
  };
505
+ var findKeyPosition = (str, key) => {
506
+ const lines = str.split("\n");
507
+ let startLineNumber = -1;
508
+ let endLineNumber = -1;
509
+ let startColumn = -1;
510
+ let endColumn = -1;
511
+ const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
512
+ let braceCount = 0;
513
+ let foundKey = false;
514
+ for (let i = 0; i < lines.length; i++) {
515
+ if (keyPattern.test(lines[i]) && !foundKey) {
516
+ foundKey = true;
517
+ startLineNumber = i + 1;
518
+ startColumn = lines[i].indexOf(key) + 1;
519
+ if (lines[i].includes("{}")) {
520
+ endLineNumber = startLineNumber;
521
+ endColumn = lines[i].indexOf("{}") + 3;
522
+ break;
523
+ }
524
+ const line = lines[i].slice(startColumn + key.length);
525
+ if (line.includes("{") || line.includes("[")) {
526
+ braceCount = 1;
527
+ } else {
528
+ endLineNumber = i + 1;
529
+ endColumn = lines[i].length + 1;
530
+ break;
531
+ }
532
+ } else if (foundKey) {
533
+ braceCount += (lines[i].match(/{/g) || []).length;
534
+ braceCount += (lines[i].match(/\[/g) || []).length;
535
+ braceCount -= (lines[i].match(/}/g) || []).length;
536
+ braceCount -= (lines[i].match(/]/g) || []).length;
537
+ if (braceCount === 0) {
538
+ endLineNumber = i + 1;
539
+ endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
540
+ break;
541
+ }
542
+ }
543
+ }
544
+ return {
545
+ startColumn,
546
+ endColumn,
547
+ startLineNumber,
548
+ endLineNumber
549
+ };
550
+ };
551
+ var replaceOctalEscapeSequences = (str) => {
552
+ const octalRegex = /\\([0-7]{1,3})/g;
553
+ return str.replace(octalRegex, (match, p1) => {
554
+ const octalValue = parseInt(p1, 8);
555
+ const char = String.fromCharCode(octalValue);
556
+ return char;
557
+ });
558
+ };
559
+ var encodeNewlines = (str) => {
560
+ return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
561
+ };
562
+ var decodeNewlines = (encodedStr) => {
563
+ return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
564
+ };
565
+ var customEncodeURIComponent = (str) => {
566
+ return str.split("").map((char) => {
567
+ if (/[^a-zA-Z0-9\s]/.test(char)) {
568
+ return "%" + char.charCodeAt(0).toString(16).toUpperCase();
569
+ }
570
+ return char;
571
+ }).join("");
572
+ };
573
+ var customDecodeURIComponent = (encodedStr) => {
574
+ return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
575
+ };
487
576
  }
488
577
  });
489
578
 
490
- // ../../node_modules/@domql/utils/dist/cjs/object.js
579
+ // ../../../domql/packages/utils/dist/cjs/object.js
491
580
  var require_object = __commonJS({
492
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
581
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
493
582
  "use strict";
494
583
  var __defProp2 = Object.defineProperty;
495
584
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -510,7 +599,9 @@ var require_object = __commonJS({
510
599
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
511
600
  var object_exports = {};
512
601
  __export2(object_exports, {
602
+ checkIfKeyIsComponent: () => checkIfKeyIsComponent,
513
603
  clone: () => clone,
604
+ createObjectWithoutPrototype: () => createObjectWithoutPrototype,
514
605
  deepClone: () => deepClone2,
515
606
  deepCloneExclude: () => deepCloneExclude,
516
607
  deepCloneWithExtend: () => deepCloneWithExtend,
@@ -525,6 +616,8 @@ var require_object = __commonJS({
525
616
  diffObjects: () => diffObjects,
526
617
  exec: () => exec,
527
618
  flattenRecursive: () => flattenRecursive,
619
+ getChildrenComponentsByKey: () => getChildrenComponentsByKey,
620
+ getExtendsInElement: () => getExtendsInElement,
528
621
  hasOwnProperty: () => hasOwnProperty,
529
622
  isEmpty: () => isEmpty,
530
623
  isEmptyObject: () => isEmptyObject,
@@ -647,7 +740,7 @@ var require_object = __commonJS({
647
740
  return o;
648
741
  };
649
742
  var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
650
- const o = (0, import_types.isArray)(obj) ? [] : {};
743
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
651
744
  for (const prop in obj) {
652
745
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
653
746
  continue;
@@ -901,7 +994,7 @@ var require_object = __commonJS({
901
994
  };
902
995
  var overwriteDeep = (obj, params, excludeFrom = []) => {
903
996
  for (const e in params) {
904
- if (e === "__proto__")
997
+ if (e === "__ref")
905
998
  continue;
906
999
  if (excludeFrom.includes(e) || e.startsWith("__"))
907
1000
  continue;
@@ -994,12 +1087,72 @@ var require_object = __commonJS({
994
1087
  }
995
1088
  return obj;
996
1089
  };
1090
+ var createObjectWithoutPrototype = (obj) => {
1091
+ if (obj === null || typeof obj !== "object") {
1092
+ return obj;
1093
+ }
1094
+ const newObj = /* @__PURE__ */ Object.create(null);
1095
+ for (const key in obj) {
1096
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
1097
+ newObj[key] = createObjectWithoutPrototype(obj[key]);
1098
+ }
1099
+ }
1100
+ return newObj;
1101
+ };
1102
+ var checkIfKeyIsComponent = (key) => {
1103
+ const isFirstKeyString = (0, import_types.isString)(key);
1104
+ if (!isFirstKeyString)
1105
+ return;
1106
+ const firstCharKey = key.slice(0, 1);
1107
+ return /^[A-Z]*$/.test(firstCharKey);
1108
+ };
1109
+ var getChildrenComponentsByKey = (key, el) => {
1110
+ if (key === el.key || el.__ref.__componentKey === key) {
1111
+ return el;
1112
+ }
1113
+ if (el.extend) {
1114
+ const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
1115
+ const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
1116
+ if (foundString || foundInArray)
1117
+ return el;
1118
+ }
1119
+ if (el.parent && el.parent.childExtend) {
1120
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
1121
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
1122
+ if (foundString || foundInArray)
1123
+ return el;
1124
+ }
1125
+ };
1126
+ var getExtendsInElement = (obj) => {
1127
+ let result = [];
1128
+ function traverse(o) {
1129
+ for (const key in o) {
1130
+ if (Object.hasOwnProperty.call(o, key)) {
1131
+ if (checkIfKeyIsComponent(key)) {
1132
+ result.push(key);
1133
+ }
1134
+ if (key === "extend") {
1135
+ if (typeof o[key] === "string") {
1136
+ result.push(o[key]);
1137
+ } else if (Array.isArray(o[key])) {
1138
+ result = result.concat(o[key]);
1139
+ }
1140
+ }
1141
+ if (typeof o[key] === "object" && o[key] !== null) {
1142
+ traverse(o[key]);
1143
+ }
1144
+ }
1145
+ }
1146
+ }
1147
+ traverse(obj);
1148
+ return result;
1149
+ };
997
1150
  }
998
1151
  });
999
1152
 
1000
- // ../../node_modules/@domql/utils/dist/cjs/function.js
1153
+ // ../../../domql/packages/utils/dist/cjs/function.js
1001
1154
  var require_function = __commonJS({
1002
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
1155
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
1003
1156
  "use strict";
1004
1157
  var __defProp2 = Object.defineProperty;
1005
1158
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1072,9 +1225,9 @@ var require_function = __commonJS({
1072
1225
  }
1073
1226
  });
1074
1227
 
1075
- // ../../node_modules/@domql/utils/dist/cjs/log.js
1228
+ // ../../../domql/packages/utils/dist/cjs/log.js
1076
1229
  var require_log = __commonJS({
1077
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
1230
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
1078
1231
  "use strict";
1079
1232
  var __defProp2 = Object.defineProperty;
1080
1233
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1113,9 +1266,9 @@ var require_log = __commonJS({
1113
1266
  }
1114
1267
  });
1115
1268
 
1116
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1269
+ // ../../../domql/packages/utils/dist/cjs/cookie.js
1117
1270
  var require_cookie = __commonJS({
1118
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1271
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
1119
1272
  "use strict";
1120
1273
  var __defProp2 = Object.defineProperty;
1121
1274
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1170,9 +1323,9 @@ var require_cookie = __commonJS({
1170
1323
  }
1171
1324
  });
1172
1325
 
1173
- // ../../node_modules/@domql/utils/dist/cjs/tags.js
1326
+ // ../../../domql/packages/utils/dist/cjs/tags.js
1174
1327
  var require_tags = __commonJS({
1175
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
1328
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1176
1329
  "use strict";
1177
1330
  var __defProp2 = Object.defineProperty;
1178
1331
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1338,9 +1491,9 @@ var require_tags = __commonJS({
1338
1491
  }
1339
1492
  });
1340
1493
 
1341
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1494
+ // ../../../domql/packages/utils/dist/cjs/index.js
1342
1495
  var require_cjs = __commonJS({
1343
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1496
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1344
1497
  "use strict";
1345
1498
  var __defProp2 = Object.defineProperty;
1346
1499
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1373,9 +1526,9 @@ var require_cjs = __commonJS({
1373
1526
  }
1374
1527
  });
1375
1528
 
1376
- // ../../node_modules/@symbo.ls/utils/dist/cjs/index.js
1529
+ // ../utils/dist/cjs/index.js
1377
1530
  var require_cjs2 = __commonJS({
1378
- "../../node_modules/@symbo.ls/utils/dist/cjs/index.js"(exports, module2) {
1531
+ "../utils/dist/cjs/index.js"(exports, module2) {
1379
1532
  "use strict";
1380
1533
  var __create2 = Object.create;
1381
1534
  var __defProp2 = Object.defineProperty;
@@ -1408,7 +1561,7 @@ var require_cjs2 = __commonJS({
1408
1561
  ));
1409
1562
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1410
1563
  var require_key2 = __commonJS2({
1411
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
1564
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports2, module22) {
1412
1565
  "use strict";
1413
1566
  var __defProp22 = Object.defineProperty;
1414
1567
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1445,7 +1598,7 @@ var require_cjs2 = __commonJS({
1445
1598
  }
1446
1599
  });
1447
1600
  var require_env2 = __commonJS2({
1448
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
1601
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports2, module22) {
1449
1602
  "use strict";
1450
1603
  var __defProp22 = Object.defineProperty;
1451
1604
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1481,7 +1634,7 @@ var require_cjs2 = __commonJS({
1481
1634
  }
1482
1635
  });
1483
1636
  var require_globals2 = __commonJS2({
1484
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
1637
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports2, module22) {
1485
1638
  "use strict";
1486
1639
  var __defProp22 = Object.defineProperty;
1487
1640
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1505,17 +1658,17 @@ var require_cjs2 = __commonJS({
1505
1658
  document: () => document22,
1506
1659
  global: () => global,
1507
1660
  self: () => self,
1508
- window: () => window2
1661
+ window: () => window22
1509
1662
  });
1510
1663
  module22.exports = __toCommonJS22(globals_exports);
1511
1664
  var global = globalThis;
1512
1665
  var self = globalThis;
1513
- var window2 = globalThis;
1514
- var document22 = window2.document;
1666
+ var window22 = globalThis;
1667
+ var document22 = window22.document;
1515
1668
  }
1516
1669
  });
1517
1670
  var require_node2 = __commonJS2({
1518
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
1671
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports2, module22) {
1519
1672
  "use strict";
1520
1673
  var __defProp22 = Object.defineProperty;
1521
1674
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1550,7 +1703,7 @@ var require_cjs2 = __commonJS({
1550
1703
  }
1551
1704
  });
1552
1705
  var require_types2 = __commonJS2({
1553
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
1706
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports2, module22) {
1554
1707
  "use strict";
1555
1708
  var __defProp22 = Object.defineProperty;
1556
1709
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1638,7 +1791,7 @@ var require_cjs2 = __commonJS({
1638
1791
  }
1639
1792
  });
1640
1793
  var require_array2 = __commonJS2({
1641
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
1794
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports2, module22) {
1642
1795
  "use strict";
1643
1796
  var __defProp22 = Object.defineProperty;
1644
1797
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1661,6 +1814,7 @@ var require_cjs2 = __commonJS({
1661
1814
  __export22(array_exports, {
1662
1815
  addItemAfterEveryElement: () => addItemAfterEveryElement,
1663
1816
  arrayContainsOtherArray: () => arrayContainsOtherArray,
1817
+ arraysEqual: () => arraysEqual,
1664
1818
  createNestedObject: () => createNestedObject,
1665
1819
  cutArrayAfterValue: () => cutArrayAfterValue,
1666
1820
  cutArrayBeforeValue: () => cutArrayBeforeValue,
@@ -1777,10 +1931,21 @@ var require_cjs2 = __commonJS({
1777
1931
  }
1778
1932
  return newArray;
1779
1933
  };
1934
+ var arraysEqual = (arr1, arr2) => {
1935
+ if (arr1.length !== arr2.length) {
1936
+ return false;
1937
+ }
1938
+ for (let i = 0; i < arr1.length; i++) {
1939
+ if (arr1[i] !== arr2[i]) {
1940
+ return false;
1941
+ }
1942
+ }
1943
+ return true;
1944
+ };
1780
1945
  }
1781
1946
  });
1782
1947
  var require_string2 = __commonJS2({
1783
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
1948
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports2, module22) {
1784
1949
  "use strict";
1785
1950
  var __defProp22 = Object.defineProperty;
1786
1951
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1801,8 +1966,12 @@ var require_cjs2 = __commonJS({
1801
1966
  var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1802
1967
  var string_exports = {};
1803
1968
  __export22(string_exports, {
1969
+ customDecodeURIComponent: () => customDecodeURIComponent,
1970
+ customEncodeURIComponent: () => customEncodeURIComponent,
1971
+ findKeyPosition: () => findKeyPosition,
1804
1972
  lowercaseFirstLetter: () => lowercaseFirstLetter,
1805
1973
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
1974
+ replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
1806
1975
  stringIncludesAny: () => stringIncludesAny,
1807
1976
  trimStringFromSymbols: () => trimStringFromSymbols
1808
1977
  });
@@ -1848,10 +2017,75 @@ var require_cjs2 = __commonJS({
1848
2017
  var lowercaseFirstLetter = (inputString) => {
1849
2018
  return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
1850
2019
  };
2020
+ var findKeyPosition = (str, key) => {
2021
+ const lines = str.split("\n");
2022
+ let startLineNumber = -1;
2023
+ let endLineNumber = -1;
2024
+ let startColumn = -1;
2025
+ let endColumn = -1;
2026
+ const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2027
+ let braceCount = 0;
2028
+ let foundKey = false;
2029
+ for (let i = 0; i < lines.length; i++) {
2030
+ if (keyPattern.test(lines[i]) && !foundKey) {
2031
+ foundKey = true;
2032
+ startLineNumber = i + 1;
2033
+ startColumn = lines[i].indexOf(key) + 1;
2034
+ if (lines[i].includes("{}")) {
2035
+ endLineNumber = startLineNumber;
2036
+ endColumn = lines[i].indexOf("{}") + 3;
2037
+ break;
2038
+ }
2039
+ const line = lines[i].slice(startColumn + key.length);
2040
+ if (line.includes("{") || line.includes("[")) {
2041
+ braceCount = 1;
2042
+ } else {
2043
+ endLineNumber = i + 1;
2044
+ endColumn = lines[i].length + 1;
2045
+ break;
2046
+ }
2047
+ } else if (foundKey) {
2048
+ braceCount += (lines[i].match(/{/g) || []).length;
2049
+ braceCount += (lines[i].match(/\[/g) || []).length;
2050
+ braceCount -= (lines[i].match(/}/g) || []).length;
2051
+ braceCount -= (lines[i].match(/]/g) || []).length;
2052
+ if (braceCount === 0) {
2053
+ endLineNumber = i + 1;
2054
+ endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2055
+ break;
2056
+ }
2057
+ }
2058
+ }
2059
+ return {
2060
+ startColumn,
2061
+ endColumn,
2062
+ startLineNumber,
2063
+ endLineNumber
2064
+ };
2065
+ };
2066
+ var replaceOctalEscapeSequences = (str) => {
2067
+ const octalRegex = /\\([0-7]{1,3})/g;
2068
+ return str.replace(octalRegex, (match, p1) => {
2069
+ const octalValue = parseInt(p1, 8);
2070
+ const char = String.fromCharCode(octalValue);
2071
+ return char;
2072
+ });
2073
+ };
2074
+ var customEncodeURIComponent = (str) => {
2075
+ return str.split("").map((char) => {
2076
+ if (/[^a-zA-Z0-9\s]/.test(char)) {
2077
+ return "%" + char.charCodeAt(0).toString(16).toUpperCase();
2078
+ }
2079
+ return char;
2080
+ }).join("");
2081
+ };
2082
+ var customDecodeURIComponent = (encodedStr) => {
2083
+ return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
2084
+ };
1851
2085
  }
1852
2086
  });
1853
2087
  var require_object2 = __commonJS2({
1854
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
2088
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports2, module22) {
1855
2089
  "use strict";
1856
2090
  var __defProp22 = Object.defineProperty;
1857
2091
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -1872,7 +2106,9 @@ var require_cjs2 = __commonJS({
1872
2106
  var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1873
2107
  var object_exports = {};
1874
2108
  __export22(object_exports, {
2109
+ checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1875
2110
  clone: () => clone,
2111
+ createObjectWithoutPrototype: () => createObjectWithoutPrototype,
1876
2112
  deepClone: () => deepClone2,
1877
2113
  deepCloneExclude: () => deepCloneExclude,
1878
2114
  deepCloneWithExtend: () => deepCloneWithExtend,
@@ -1887,6 +2123,8 @@ var require_cjs2 = __commonJS({
1887
2123
  diffObjects: () => diffObjects,
1888
2124
  exec: () => exec,
1889
2125
  flattenRecursive: () => flattenRecursive,
2126
+ getChildrenComponentsByKey: () => getChildrenComponentsByKey,
2127
+ getExtendsInElement: () => getExtendsInElement,
1890
2128
  hasOwnProperty: () => hasOwnProperty,
1891
2129
  isEmpty: () => isEmpty,
1892
2130
  isEmptyObject: () => isEmptyObject,
@@ -2009,7 +2247,7 @@ var require_cjs2 = __commonJS({
2009
2247
  return o;
2010
2248
  };
2011
2249
  var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
2012
- const o = (0, import_types.isArray)(obj) ? [] : {};
2250
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
2013
2251
  for (const prop in obj) {
2014
2252
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
2015
2253
  continue;
@@ -2356,10 +2594,70 @@ var require_cjs2 = __commonJS({
2356
2594
  }
2357
2595
  return obj;
2358
2596
  };
2597
+ var createObjectWithoutPrototype = (obj) => {
2598
+ if (obj === null || typeof obj !== "object") {
2599
+ return obj;
2600
+ }
2601
+ const newObj = /* @__PURE__ */ Object.create(null);
2602
+ for (const key in obj) {
2603
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
2604
+ newObj[key] = createObjectWithoutPrototype(obj[key]);
2605
+ }
2606
+ }
2607
+ return newObj;
2608
+ };
2609
+ var checkIfKeyIsComponent = (key) => {
2610
+ const isFirstKeyString = (0, import_types.isString)(key);
2611
+ if (!isFirstKeyString)
2612
+ return;
2613
+ const firstCharKey = key.slice(0, 1);
2614
+ return /^[A-Z]*$/.test(firstCharKey);
2615
+ };
2616
+ var getChildrenComponentsByKey = (key, el) => {
2617
+ if (key === el.key || el.__ref.__componentKey === key) {
2618
+ return el;
2619
+ }
2620
+ if (el.extend) {
2621
+ const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
2622
+ const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
2623
+ if (foundString || foundInArray)
2624
+ return el;
2625
+ }
2626
+ if (el.parent && el.parent.childExtend) {
2627
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
2628
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
2629
+ if (foundString || foundInArray)
2630
+ return el;
2631
+ }
2632
+ };
2633
+ var getExtendsInElement = (obj) => {
2634
+ let result = [];
2635
+ function traverse(o) {
2636
+ for (const key in o) {
2637
+ if (Object.hasOwnProperty.call(o, key)) {
2638
+ if (checkIfKeyIsComponent(key)) {
2639
+ result.push(key);
2640
+ }
2641
+ if (key === "extend") {
2642
+ if (typeof o[key] === "string") {
2643
+ result.push(o[key]);
2644
+ } else if (Array.isArray(o[key])) {
2645
+ result = result.concat(o[key]);
2646
+ }
2647
+ }
2648
+ if (typeof o[key] === "object" && o[key] !== null) {
2649
+ traverse(o[key]);
2650
+ }
2651
+ }
2652
+ }
2653
+ }
2654
+ traverse(obj);
2655
+ return result;
2656
+ };
2359
2657
  }
2360
2658
  });
2361
2659
  var require_function2 = __commonJS2({
2362
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
2660
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports2, module22) {
2363
2661
  "use strict";
2364
2662
  var __defProp22 = Object.defineProperty;
2365
2663
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2432,7 +2730,7 @@ var require_cjs2 = __commonJS({
2432
2730
  }
2433
2731
  });
2434
2732
  var require_log2 = __commonJS2({
2435
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
2733
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports2, module22) {
2436
2734
  "use strict";
2437
2735
  var __defProp22 = Object.defineProperty;
2438
2736
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2471,7 +2769,7 @@ var require_cjs2 = __commonJS({
2471
2769
  }
2472
2770
  });
2473
2771
  var require_cookie2 = __commonJS2({
2474
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
2772
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports2, module22) {
2475
2773
  "use strict";
2476
2774
  var __defProp22 = Object.defineProperty;
2477
2775
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2526,7 +2824,7 @@ var require_cjs2 = __commonJS({
2526
2824
  }
2527
2825
  });
2528
2826
  var require_tags2 = __commonJS2({
2529
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
2827
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports2, module22) {
2530
2828
  "use strict";
2531
2829
  var __defProp22 = Object.defineProperty;
2532
2830
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2692,7 +2990,7 @@ var require_cjs2 = __commonJS({
2692
2990
  }
2693
2991
  });
2694
2992
  var require_cjs4 = __commonJS2({
2695
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
2993
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports2, module22) {
2696
2994
  "use strict";
2697
2995
  var __defProp22 = Object.defineProperty;
2698
2996
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
@@ -2732,8 +3030,11 @@ var require_cjs2 = __commonJS({
2732
3030
  findClosestNumber: () => findClosestNumber,
2733
3031
  findClosestNumberInFactory: () => findClosestNumberInFactory,
2734
3032
  formatDate: () => formatDate,
3033
+ isPhoto: () => isPhoto,
3034
+ loadCssFile: () => loadCssFile,
2735
3035
  loadJavascript: () => loadJavascript,
2736
3036
  loadJavascriptFile: () => loadJavascriptFile,
3037
+ loadJavascriptFileSync: () => loadJavascriptFileSync,
2737
3038
  removeChars: () => removeChars,
2738
3039
  toCamelCase: () => toCamelCase,
2739
3040
  toDashCase: () => toDashCase2,
@@ -2743,13 +3044,15 @@ var require_cjs2 = __commonJS({
2743
3044
  });
2744
3045
  module2.exports = __toCommonJS2(src_exports);
2745
3046
  var import_utils22 = __toESM2(require_cjs4(), 1);
2746
- var toggleFullscreen = (el) => {
3047
+ var toggleFullscreen = async (el) => {
2747
3048
  if (!document.fullscreenElement) {
2748
- el.node.requestFullscreen().catch((err) => {
3049
+ try {
3050
+ await (el.node || document).requestFullscreen();
3051
+ } catch (err) {
2749
3052
  console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
2750
- });
3053
+ }
2751
3054
  } else {
2752
- document.exitFullscreen();
3055
+ await document.exitFullscreen();
2753
3056
  }
2754
3057
  };
2755
3058
  var import_utils10 = __toESM2(require_cjs4(), 1);
@@ -2780,7 +3083,7 @@ var require_cjs2 = __commonJS({
2780
3083
  }
2781
3084
  return fib[n];
2782
3085
  };
2783
- var loadJavascriptFile = (FILE_URL, async = true, doc = document, type = "text/javascript") => {
3086
+ var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
2784
3087
  return new Promise((resolve, reject) => {
2785
3088
  try {
2786
3089
  const scriptEle = doc.createElement("script");
@@ -2793,10 +3096,10 @@ var require_cjs2 = __commonJS({
2793
3096
  });
2794
3097
  });
2795
3098
  scriptEle.addEventListener("error", (ev) => {
2796
- reject({
3099
+ reject(new Error({
2797
3100
  status: false,
2798
3101
  message: `Failed to load the script ${FILE_URL}`
2799
- });
3102
+ }));
2800
3103
  });
2801
3104
  doc.body.appendChild(scriptEle);
2802
3105
  } catch (error) {
@@ -2804,17 +3107,51 @@ var require_cjs2 = __commonJS({
2804
3107
  }
2805
3108
  });
2806
3109
  };
2807
- var loadJavascript = (body, async = true, doc = document, type = "text/javascript") => {
3110
+ var loadJavascriptFileSync = (FILE_URL, doc = document, fallback, type = "text/javascript") => {
3111
+ const xhr = new window.XMLHttpRequest();
3112
+ xhr.open("GET", FILE_URL, false);
3113
+ xhr.send();
3114
+ if (xhr.status === 200) {
3115
+ const scriptEle = doc.createElement("script");
3116
+ scriptEle.type = type;
3117
+ scriptEle.text = xhr.responseText;
3118
+ doc.body.appendChild(scriptEle);
3119
+ if (typeof fallback === "function")
3120
+ fallback();
3121
+ } else {
3122
+ throw new Error(`Failed to load the script ${FILE_URL}`);
3123
+ }
3124
+ };
3125
+ var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3126
+ return new Promise((resolve, reject) => {
3127
+ try {
3128
+ const linkElem = doc.createElement("link");
3129
+ linkElem.rel = "stylesheet";
3130
+ linkElem.href = FILE_URL;
3131
+ linkElem.addEventListener("load", (ev) => {
3132
+ resolve({
3133
+ status: true
3134
+ });
3135
+ });
3136
+ doc.head.appendChild(linkElem);
3137
+ } catch (error) {
3138
+ reject(error);
3139
+ }
3140
+ });
3141
+ };
3142
+ var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
2808
3143
  try {
2809
3144
  const scriptEle = doc.createElement("script");
2810
3145
  scriptEle.type = type;
2811
3146
  scriptEle.async = async;
3147
+ scriptEle.id = id;
2812
3148
  scriptEle.innerHTML = body;
2813
3149
  doc.body.appendChild(scriptEle);
2814
3150
  } catch (error) {
2815
3151
  console.warn(error);
2816
3152
  }
2817
3153
  };
3154
+ var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
2818
3155
  var copyStringToClipboard = (str) => {
2819
3156
  const el = document.createElement("textarea");
2820
3157
  el.value = str;
@@ -2885,13 +3222,13 @@ var require_cjs3 = __commonJS({
2885
3222
  document: () => document3,
2886
3223
  global: () => global,
2887
3224
  self: () => self,
2888
- window: () => window2
3225
+ window: () => window3
2889
3226
  });
2890
3227
  module2.exports = __toCommonJS2(globals_exports);
2891
3228
  var global = globalThis;
2892
3229
  var self = globalThis;
2893
- var window2 = globalThis;
2894
- var document3 = window2.document;
3230
+ var window3 = globalThis;
3231
+ var document3 = window3.document;
2895
3232
  }
2896
3233
  });
2897
3234