@symbo.ls/scratch 2.11.410 → 2.11.429

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,29 +34,29 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
34
  var require_key = __commonJS({
35
35
  "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
36
36
  "use strict";
37
- var __defProp3 = Object.defineProperty;
38
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
39
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
40
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
41
- var __export3 = (target, all) => {
37
+ var __defProp2 = Object.defineProperty;
38
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
41
+ var __export2 = (target, all) => {
42
42
  for (var name in all)
43
- __defProp3(target, name, { get: all[name], enumerable: true });
43
+ __defProp2(target, name, { get: all[name], enumerable: true });
44
44
  };
45
- var __copyProps3 = (to, from, except, desc) => {
45
+ var __copyProps2 = (to, from, except, desc) => {
46
46
  if (from && typeof from === "object" || typeof from === "function") {
47
- for (let key of __getOwnPropNames3(from))
48
- if (!__hasOwnProp3.call(to, key) && key !== except)
49
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
47
+ for (let key of __getOwnPropNames2(from))
48
+ if (!__hasOwnProp2.call(to, key) && key !== except)
49
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
50
50
  }
51
51
  return to;
52
52
  };
53
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
53
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
54
54
  var key_exports = {};
55
- __export3(key_exports, {
55
+ __export2(key_exports, {
56
56
  createSnapshotId: () => createSnapshotId,
57
57
  generateKey: () => generateKey
58
58
  });
59
- module2.exports = __toCommonJS3(key_exports);
59
+ module2.exports = __toCommonJS2(key_exports);
60
60
  var generateKey = /* @__PURE__ */ function() {
61
61
  let index = 0;
62
62
  function newId() {
@@ -73,32 +73,32 @@ var require_key = __commonJS({
73
73
  var require_env = __commonJS({
74
74
  "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
75
75
  "use strict";
76
- var __defProp3 = Object.defineProperty;
77
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
78
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
79
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
80
- var __export3 = (target, all) => {
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
81
  for (var name in all)
82
- __defProp3(target, name, { get: all[name], enumerable: true });
82
+ __defProp2(target, name, { get: all[name], enumerable: true });
83
83
  };
84
- var __copyProps3 = (to, from, except, desc) => {
84
+ var __copyProps2 = (to, from, except, desc) => {
85
85
  if (from && typeof from === "object" || typeof from === "function") {
86
- for (let key of __getOwnPropNames3(from))
87
- if (!__hasOwnProp3.call(to, key) && key !== except)
88
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
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
89
  }
90
90
  return to;
91
91
  };
92
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
92
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
93
93
  var env_exports = {};
94
- __export3(env_exports, {
94
+ __export2(env_exports, {
95
95
  NODE_ENV: () => NODE_ENV,
96
96
  getNev: () => getNev,
97
97
  isDevelopment: () => isDevelopment,
98
98
  isProduction: () => isProduction,
99
99
  isTest: () => isTest
100
100
  });
101
- module2.exports = __toCommonJS3(env_exports);
101
+ module2.exports = __toCommonJS2(env_exports);
102
102
  var NODE_ENV = "development";
103
103
  var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
104
104
  var isTest = (env = NODE_ENV) => env === "test";
@@ -111,35 +111,35 @@ var require_env = __commonJS({
111
111
  var require_globals = __commonJS({
112
112
  "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
113
113
  "use strict";
114
- var __defProp3 = Object.defineProperty;
115
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
116
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
117
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
118
- var __export3 = (target, all) => {
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
119
  for (var name in all)
120
- __defProp3(target, name, { get: all[name], enumerable: true });
120
+ __defProp2(target, name, { get: all[name], enumerable: true });
121
121
  };
122
- var __copyProps3 = (to, from, except, desc) => {
122
+ var __copyProps2 = (to, from, except, desc) => {
123
123
  if (from && typeof from === "object" || typeof from === "function") {
124
- for (let key of __getOwnPropNames3(from))
125
- if (!__hasOwnProp3.call(to, key) && key !== except)
126
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
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
127
  }
128
128
  return to;
129
129
  };
130
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
130
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
131
131
  var globals_exports = {};
132
- __export3(globals_exports, {
132
+ __export2(globals_exports, {
133
133
  document: () => document3,
134
134
  global: () => global,
135
135
  self: () => self,
136
- window: () => window2
136
+ window: () => window3
137
137
  });
138
- module2.exports = __toCommonJS3(globals_exports);
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
 
@@ -147,29 +147,29 @@ var require_globals = __commonJS({
147
147
  var require_node = __commonJS({
148
148
  "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
149
149
  "use strict";
150
- var __defProp3 = Object.defineProperty;
151
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
152
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
153
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
154
- var __export3 = (target, all) => {
150
+ var __defProp2 = Object.defineProperty;
151
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
152
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
153
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
154
+ var __export2 = (target, all) => {
155
155
  for (var name in all)
156
- __defProp3(target, name, { get: all[name], enumerable: true });
156
+ __defProp2(target, name, { get: all[name], enumerable: true });
157
157
  };
158
- var __copyProps3 = (to, from, except, desc) => {
158
+ var __copyProps2 = (to, from, except, desc) => {
159
159
  if (from && typeof from === "object" || typeof from === "function") {
160
- for (let key of __getOwnPropNames3(from))
161
- if (!__hasOwnProp3.call(to, key) && key !== except)
162
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
160
+ for (let key of __getOwnPropNames2(from))
161
+ if (!__hasOwnProp2.call(to, key) && key !== except)
162
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
163
163
  }
164
164
  return to;
165
165
  };
166
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
166
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
167
167
  var node_exports = {};
168
- __export3(node_exports, {
168
+ __export2(node_exports, {
169
169
  isHtmlElement: () => isHtmlElement,
170
170
  isNode: () => isNode
171
171
  });
172
- module2.exports = __toCommonJS3(node_exports);
172
+ module2.exports = __toCommonJS2(node_exports);
173
173
  var import_globals2 = require_globals();
174
174
  var isNode = (obj) => {
175
175
  return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
@@ -184,25 +184,25 @@ var require_node = __commonJS({
184
184
  var require_types = __commonJS({
185
185
  "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
186
186
  "use strict";
187
- var __defProp3 = Object.defineProperty;
188
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
189
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
190
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
191
- var __export3 = (target, all) => {
187
+ var __defProp2 = Object.defineProperty;
188
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
189
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
190
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
191
+ var __export2 = (target, all) => {
192
192
  for (var name in all)
193
- __defProp3(target, name, { get: all[name], enumerable: true });
193
+ __defProp2(target, name, { get: all[name], enumerable: true });
194
194
  };
195
- var __copyProps3 = (to, from, except, desc) => {
195
+ var __copyProps2 = (to, from, except, desc) => {
196
196
  if (from && typeof from === "object" || typeof from === "function") {
197
- for (let key of __getOwnPropNames3(from))
198
- if (!__hasOwnProp3.call(to, key) && key !== except)
199
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
197
+ for (let key of __getOwnPropNames2(from))
198
+ if (!__hasOwnProp2.call(to, key) && key !== except)
199
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
200
200
  }
201
201
  return to;
202
202
  };
203
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
203
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
204
204
  var types_exports = {};
205
- __export3(types_exports, {
205
+ __export2(types_exports, {
206
206
  TYPES: () => TYPES,
207
207
  is: () => is,
208
208
  isArray: () => isArray2,
@@ -218,7 +218,7 @@ var require_types = __commonJS({
218
218
  isString: () => isString4,
219
219
  isUndefined: () => isUndefined
220
220
  });
221
- module2.exports = __toCommonJS3(types_exports);
221
+ module2.exports = __toCommonJS2(types_exports);
222
222
  var import_node = require_node();
223
223
  var isObject2 = (arg) => {
224
224
  if (arg === null)
@@ -274,25 +274,25 @@ var require_types = __commonJS({
274
274
  var require_array = __commonJS({
275
275
  "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
276
276
  "use strict";
277
- var __defProp3 = Object.defineProperty;
278
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
279
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
280
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
281
- var __export3 = (target, all) => {
277
+ var __defProp2 = Object.defineProperty;
278
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
279
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
280
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
281
+ var __export2 = (target, all) => {
282
282
  for (var name in all)
283
- __defProp3(target, name, { get: all[name], enumerable: true });
283
+ __defProp2(target, name, { get: all[name], enumerable: true });
284
284
  };
285
- var __copyProps3 = (to, from, except, desc) => {
285
+ var __copyProps2 = (to, from, except, desc) => {
286
286
  if (from && typeof from === "object" || typeof from === "function") {
287
- for (let key of __getOwnPropNames3(from))
288
- if (!__hasOwnProp3.call(to, key) && key !== except)
289
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
287
+ for (let key of __getOwnPropNames2(from))
288
+ if (!__hasOwnProp2.call(to, key) && key !== except)
289
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
290
290
  }
291
291
  return to;
292
292
  };
293
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
293
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
294
294
  var array_exports = {};
295
- __export3(array_exports, {
295
+ __export2(array_exports, {
296
296
  addItemAfterEveryElement: () => addItemAfterEveryElement,
297
297
  arrayContainsOtherArray: () => arrayContainsOtherArray,
298
298
  arraysEqual: () => arraysEqual,
@@ -309,7 +309,7 @@ var require_array = __commonJS({
309
309
  reorderArrayByValues: () => reorderArrayByValues,
310
310
  swapItemsInArray: () => swapItemsInArray
311
311
  });
312
- module2.exports = __toCommonJS3(array_exports);
312
+ module2.exports = __toCommonJS2(array_exports);
313
313
  var import_object = require_object();
314
314
  var import_types = require_types();
315
315
  var arrayContainsOtherArray = (arr1, arr2) => {
@@ -342,10 +342,10 @@ var require_array = __commonJS({
342
342
  return [].concat(...arrays);
343
343
  };
344
344
  var mergeArray = (arr, excludeFrom = []) => {
345
- 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), {});
346
346
  };
347
347
  var mergeAndCloneIfArray = (obj) => {
348
- 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);
349
349
  };
350
350
  var cutArrayBeforeValue = (arr, value) => {
351
351
  const index = arr.indexOf(value);
@@ -430,27 +430,29 @@ var require_array = __commonJS({
430
430
  var require_string = __commonJS({
431
431
  "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
432
432
  "use strict";
433
- var __defProp3 = Object.defineProperty;
434
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
435
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
436
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
437
- var __export3 = (target, all) => {
433
+ var __defProp2 = Object.defineProperty;
434
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
435
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
436
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
437
+ var __export2 = (target, all) => {
438
438
  for (var name in all)
439
- __defProp3(target, name, { get: all[name], enumerable: true });
439
+ __defProp2(target, name, { get: all[name], enumerable: true });
440
440
  };
441
- var __copyProps3 = (to, from, except, desc) => {
441
+ var __copyProps2 = (to, from, except, desc) => {
442
442
  if (from && typeof from === "object" || typeof from === "function") {
443
- for (let key of __getOwnPropNames3(from))
444
- if (!__hasOwnProp3.call(to, key) && key !== except)
445
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
443
+ for (let key of __getOwnPropNames2(from))
444
+ if (!__hasOwnProp2.call(to, key) && key !== except)
445
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
446
446
  }
447
447
  return to;
448
448
  };
449
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
449
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
450
450
  var string_exports = {};
451
- __export3(string_exports, {
451
+ __export2(string_exports, {
452
452
  customDecodeURIComponent: () => customDecodeURIComponent,
453
453
  customEncodeURIComponent: () => customEncodeURIComponent,
454
+ decodeNewlines: () => decodeNewlines,
455
+ encodeNewlines: () => encodeNewlines,
454
456
  findKeyPosition: () => findKeyPosition,
455
457
  lowercaseFirstLetter: () => lowercaseFirstLetter,
456
458
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
@@ -458,7 +460,7 @@ var require_string = __commonJS({
458
460
  stringIncludesAny: () => stringIncludesAny,
459
461
  trimStringFromSymbols: () => trimStringFromSymbols
460
462
  });
461
- module2.exports = __toCommonJS3(string_exports);
463
+ module2.exports = __toCommonJS2(string_exports);
462
464
  var stringIncludesAny = (str, characters) => {
463
465
  for (const char of characters) {
464
466
  if (str.includes(char)) {
@@ -554,6 +556,12 @@ var require_string = __commonJS({
554
556
  return char;
555
557
  });
556
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
+ };
557
565
  var customEncodeURIComponent = (str) => {
558
566
  return str.split("").map((char) => {
559
567
  if (/[^a-zA-Z0-9\s]/.test(char)) {
@@ -572,25 +580,25 @@ var require_string = __commonJS({
572
580
  var require_object = __commonJS({
573
581
  "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
574
582
  "use strict";
575
- var __defProp3 = Object.defineProperty;
576
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
577
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
578
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
579
- var __export3 = (target, all) => {
583
+ var __defProp2 = Object.defineProperty;
584
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
585
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
586
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
587
+ var __export2 = (target, all) => {
580
588
  for (var name in all)
581
- __defProp3(target, name, { get: all[name], enumerable: true });
589
+ __defProp2(target, name, { get: all[name], enumerable: true });
582
590
  };
583
- var __copyProps3 = (to, from, except, desc) => {
591
+ var __copyProps2 = (to, from, except, desc) => {
584
592
  if (from && typeof from === "object" || typeof from === "function") {
585
- for (let key of __getOwnPropNames3(from))
586
- if (!__hasOwnProp3.call(to, key) && key !== except)
587
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
593
+ for (let key of __getOwnPropNames2(from))
594
+ if (!__hasOwnProp2.call(to, key) && key !== except)
595
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
588
596
  }
589
597
  return to;
590
598
  };
591
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
599
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
592
600
  var object_exports = {};
593
- __export3(object_exports, {
601
+ __export2(object_exports, {
594
602
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
595
603
  clone: () => clone,
596
604
  createObjectWithoutPrototype: () => createObjectWithoutPrototype,
@@ -626,7 +634,7 @@ var require_object = __commonJS({
626
634
  removeFromObject: () => removeFromObject,
627
635
  stringToObject: () => stringToObject
628
636
  });
629
- module2.exports = __toCommonJS3(object_exports);
637
+ module2.exports = __toCommonJS2(object_exports);
630
638
  var import_globals2 = require_globals();
631
639
  var import_types = require_types();
632
640
  var import_array = require_array();
@@ -732,7 +740,7 @@ var require_object = __commonJS({
732
740
  return o;
733
741
  };
734
742
  var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
735
- 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) ? [] : {};
736
744
  for (const prop in obj) {
737
745
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
738
746
  continue;
@@ -986,7 +994,7 @@ var require_object = __commonJS({
986
994
  };
987
995
  var overwriteDeep = (obj, params, excludeFrom = []) => {
988
996
  for (const e in params) {
989
- if (e === "__proto__")
997
+ if (e === "__ref")
990
998
  continue;
991
999
  if (excludeFrom.includes(e) || e.startsWith("__"))
992
1000
  continue;
@@ -1108,6 +1116,12 @@ var require_object = __commonJS({
1108
1116
  if (foundString || foundInArray)
1109
1117
  return el;
1110
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
+ }
1111
1125
  };
1112
1126
  var getExtendsInElement = (obj) => {
1113
1127
  let result = [];
@@ -1140,31 +1154,31 @@ var require_object = __commonJS({
1140
1154
  var require_function = __commonJS({
1141
1155
  "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
1142
1156
  "use strict";
1143
- var __defProp3 = Object.defineProperty;
1144
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1145
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1146
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1147
- var __export3 = (target, all) => {
1157
+ var __defProp2 = Object.defineProperty;
1158
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1159
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1160
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1161
+ var __export2 = (target, all) => {
1148
1162
  for (var name in all)
1149
- __defProp3(target, name, { get: all[name], enumerable: true });
1163
+ __defProp2(target, name, { get: all[name], enumerable: true });
1150
1164
  };
1151
- var __copyProps3 = (to, from, except, desc) => {
1165
+ var __copyProps2 = (to, from, except, desc) => {
1152
1166
  if (from && typeof from === "object" || typeof from === "function") {
1153
- for (let key of __getOwnPropNames3(from))
1154
- if (!__hasOwnProp3.call(to, key) && key !== except)
1155
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1167
+ for (let key of __getOwnPropNames2(from))
1168
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1169
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1156
1170
  }
1157
1171
  return to;
1158
1172
  };
1159
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1173
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1160
1174
  var function_exports = {};
1161
- __export3(function_exports, {
1175
+ __export2(function_exports, {
1162
1176
  debounce: () => debounce,
1163
1177
  debounceOnContext: () => debounceOnContext,
1164
1178
  isStringFunction: () => isStringFunction,
1165
1179
  memoize: () => memoize
1166
1180
  });
1167
- module2.exports = __toCommonJS3(function_exports);
1181
+ module2.exports = __toCommonJS2(function_exports);
1168
1182
  function debounce(func, wait, immediate) {
1169
1183
  let timeout;
1170
1184
  return function() {
@@ -1215,29 +1229,29 @@ var require_function = __commonJS({
1215
1229
  var require_log = __commonJS({
1216
1230
  "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
1217
1231
  "use strict";
1218
- var __defProp3 = Object.defineProperty;
1219
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1220
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1221
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1222
- var __export3 = (target, all) => {
1232
+ var __defProp2 = Object.defineProperty;
1233
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1234
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1235
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1236
+ var __export2 = (target, all) => {
1223
1237
  for (var name in all)
1224
- __defProp3(target, name, { get: all[name], enumerable: true });
1238
+ __defProp2(target, name, { get: all[name], enumerable: true });
1225
1239
  };
1226
- var __copyProps3 = (to, from, except, desc) => {
1240
+ var __copyProps2 = (to, from, except, desc) => {
1227
1241
  if (from && typeof from === "object" || typeof from === "function") {
1228
- for (let key of __getOwnPropNames3(from))
1229
- if (!__hasOwnProp3.call(to, key) && key !== except)
1230
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1242
+ for (let key of __getOwnPropNames2(from))
1243
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1244
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1231
1245
  }
1232
1246
  return to;
1233
1247
  };
1234
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1248
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1235
1249
  var log_exports = {};
1236
- __export3(log_exports, {
1250
+ __export2(log_exports, {
1237
1251
  logGroupIf: () => logGroupIf,
1238
1252
  logIf: () => logIf
1239
1253
  });
1240
- module2.exports = __toCommonJS3(log_exports);
1254
+ module2.exports = __toCommonJS2(log_exports);
1241
1255
  var logIf = (bool, ...arg) => {
1242
1256
  if (bool)
1243
1257
  arg.map((v) => console.log(v));
@@ -1256,46 +1270,46 @@ var require_log = __commonJS({
1256
1270
  var require_cookie = __commonJS({
1257
1271
  "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
1258
1272
  "use strict";
1259
- var __defProp3 = Object.defineProperty;
1260
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1261
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1262
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1263
- var __export3 = (target, all) => {
1273
+ var __defProp2 = Object.defineProperty;
1274
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1275
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1276
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1277
+ var __export2 = (target, all) => {
1264
1278
  for (var name in all)
1265
- __defProp3(target, name, { get: all[name], enumerable: true });
1279
+ __defProp2(target, name, { get: all[name], enumerable: true });
1266
1280
  };
1267
- var __copyProps3 = (to, from, except, desc) => {
1281
+ var __copyProps2 = (to, from, except, desc) => {
1268
1282
  if (from && typeof from === "object" || typeof from === "function") {
1269
- for (let key of __getOwnPropNames3(from))
1270
- if (!__hasOwnProp3.call(to, key) && key !== except)
1271
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1283
+ for (let key of __getOwnPropNames2(from))
1284
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1285
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1272
1286
  }
1273
1287
  return to;
1274
1288
  };
1275
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1289
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1276
1290
  var cookie_exports = {};
1277
- __export3(cookie_exports, {
1291
+ __export2(cookie_exports, {
1278
1292
  getCookie: () => getCookie,
1279
1293
  isMobile: () => isMobile,
1280
1294
  setCookie: () => setCookie
1281
1295
  });
1282
- module2.exports = __toCommonJS3(cookie_exports);
1296
+ module2.exports = __toCommonJS2(cookie_exports);
1283
1297
  var import_types = require_types();
1284
- var import_utils10 = require_cjs();
1298
+ var import_utils9 = require_cjs();
1285
1299
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
1286
1300
  var setCookie = (cname, cvalue, exdays = 365) => {
1287
- if ((0, import_types.isUndefined)(import_utils10.document) || (0, import_types.isUndefined)(import_utils10.document.cookie))
1301
+ if ((0, import_types.isUndefined)(import_utils9.document) || (0, import_types.isUndefined)(import_utils9.document.cookie))
1288
1302
  return;
1289
1303
  const d = /* @__PURE__ */ new Date();
1290
1304
  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
1291
1305
  const expires = `expires=${d.toUTCString()}`;
1292
- import_utils10.document.cookie = `${cname}=${cvalue};${expires};path=/`;
1306
+ import_utils9.document.cookie = `${cname}=${cvalue};${expires};path=/`;
1293
1307
  };
1294
1308
  var getCookie = (cname) => {
1295
- if ((0, import_types.isUndefined)(import_utils10.document) || (0, import_types.isUndefined)(import_utils10.document.cookie))
1309
+ if ((0, import_types.isUndefined)(import_utils9.document) || (0, import_types.isUndefined)(import_utils9.document.cookie))
1296
1310
  return;
1297
1311
  const name = `${cname}=`;
1298
- const decodedCookie = decodeURIComponent(import_utils10.document.cookie);
1312
+ const decodedCookie = decodeURIComponent(import_utils9.document.cookie);
1299
1313
  const ca = decodedCookie.split(";");
1300
1314
  for (let i = 0; i < ca.length; i++) {
1301
1315
  let c = ca[i];
@@ -1313,29 +1327,29 @@ var require_cookie = __commonJS({
1313
1327
  var require_tags = __commonJS({
1314
1328
  "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1315
1329
  "use strict";
1316
- var __defProp3 = Object.defineProperty;
1317
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1318
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1319
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1320
- var __export3 = (target, all) => {
1330
+ var __defProp2 = Object.defineProperty;
1331
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1332
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1333
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1334
+ var __export2 = (target, all) => {
1321
1335
  for (var name in all)
1322
- __defProp3(target, name, { get: all[name], enumerable: true });
1336
+ __defProp2(target, name, { get: all[name], enumerable: true });
1323
1337
  };
1324
- var __copyProps3 = (to, from, except, desc) => {
1338
+ var __copyProps2 = (to, from, except, desc) => {
1325
1339
  if (from && typeof from === "object" || typeof from === "function") {
1326
- for (let key of __getOwnPropNames3(from))
1327
- if (!__hasOwnProp3.call(to, key) && key !== except)
1328
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1340
+ for (let key of __getOwnPropNames2(from))
1341
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1342
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1329
1343
  }
1330
1344
  return to;
1331
1345
  };
1332
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1346
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1333
1347
  var tags_exports = {};
1334
- __export3(tags_exports, {
1348
+ __export2(tags_exports, {
1335
1349
  HTML_TAGS: () => HTML_TAGS,
1336
1350
  isValidHtmlTag: () => isValidHtmlTag
1337
1351
  });
1338
- module2.exports = __toCommonJS3(tags_exports);
1352
+ module2.exports = __toCommonJS2(tags_exports);
1339
1353
  var HTML_TAGS = {
1340
1354
  root: [
1341
1355
  "body",
@@ -1481,22 +1495,22 @@ var require_tags = __commonJS({
1481
1495
  var require_cjs = __commonJS({
1482
1496
  "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1483
1497
  "use strict";
1484
- var __defProp3 = Object.defineProperty;
1485
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1486
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1487
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1488
- var __copyProps3 = (to, from, except, desc) => {
1498
+ var __defProp2 = Object.defineProperty;
1499
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1500
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1501
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1502
+ var __copyProps2 = (to, from, except, desc) => {
1489
1503
  if (from && typeof from === "object" || typeof from === "function") {
1490
- for (let key of __getOwnPropNames3(from))
1491
- if (!__hasOwnProp3.call(to, key) && key !== except)
1492
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1504
+ for (let key of __getOwnPropNames2(from))
1505
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1506
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1493
1507
  }
1494
1508
  return to;
1495
1509
  };
1496
- var __reExport = (target, mod, secondTarget) => (__copyProps3(target, mod, "default"), secondTarget && __copyProps3(secondTarget, mod, "default"));
1497
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1510
+ var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
1511
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1498
1512
  var utils_exports = {};
1499
- module2.exports = __toCommonJS3(utils_exports);
1513
+ module2.exports = __toCommonJS2(utils_exports);
1500
1514
  __reExport(utils_exports, require_key(), module2.exports);
1501
1515
  __reExport(utils_exports, require_env(), module2.exports);
1502
1516
  __reExport(utils_exports, require_types(), module2.exports);
@@ -1516,1932 +1530,1962 @@ var require_cjs = __commonJS({
1516
1530
  var require_cjs2 = __commonJS({
1517
1531
  "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
1518
1532
  "use strict";
1519
- var __defProp3 = Object.defineProperty;
1520
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1521
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1522
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1523
- var __export3 = (target, all) => {
1533
+ var __defProp2 = Object.defineProperty;
1534
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1535
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1536
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1537
+ var __export2 = (target, all) => {
1524
1538
  for (var name in all)
1525
- __defProp3(target, name, { get: all[name], enumerable: true });
1539
+ __defProp2(target, name, { get: all[name], enumerable: true });
1526
1540
  };
1527
- var __copyProps3 = (to, from, except, desc) => {
1541
+ var __copyProps2 = (to, from, except, desc) => {
1528
1542
  if (from && typeof from === "object" || typeof from === "function") {
1529
- for (let key of __getOwnPropNames3(from))
1530
- if (!__hasOwnProp3.call(to, key) && key !== except)
1531
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1543
+ for (let key of __getOwnPropNames2(from))
1544
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1545
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1532
1546
  }
1533
1547
  return to;
1534
1548
  };
1535
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1549
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1536
1550
  var globals_exports = {};
1537
- __export3(globals_exports, {
1551
+ __export2(globals_exports, {
1538
1552
  document: () => document3,
1539
1553
  global: () => global,
1540
1554
  self: () => self,
1541
- window: () => window2
1555
+ window: () => window3
1542
1556
  });
1543
- module2.exports = __toCommonJS3(globals_exports);
1557
+ module2.exports = __toCommonJS2(globals_exports);
1544
1558
  var global = globalThis;
1545
1559
  var self = globalThis;
1546
- var window2 = globalThis;
1547
- var document3 = window2.document;
1560
+ var window3 = globalThis;
1561
+ var document3 = window3.document;
1548
1562
  }
1549
1563
  });
1550
1564
 
1551
- // src/system/document.js
1552
- var document_exports = {};
1553
- __export(document_exports, {
1554
- applyDocument: () => applyDocument
1555
- });
1556
- module.exports = __toCommonJS(document_exports);
1557
- var import_utils8 = __toESM(require_cjs(), 1);
1558
-
1559
- // src/factory.js
1560
- var import_utils = __toESM(require_cjs(), 1);
1561
-
1562
- // src/defaultConfig/index.js
1563
- var defaultConfig_exports = {};
1564
- __export(defaultConfig_exports, {
1565
- ANIMATION: () => ANIMATION,
1566
- BREAKPOINTS: () => BREAKPOINTS,
1567
- CASES: () => CASES,
1568
- COLOR: () => COLOR,
1569
- DEVICES: () => DEVICES,
1570
- DOCUMENT: () => DOCUMENT,
1571
- FONT: () => FONT,
1572
- FONT_FACE: () => FONT_FACE,
1573
- FONT_FAMILY: () => FONT_FAMILY,
1574
- FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
1575
- GRADIENT: () => GRADIENT,
1576
- GRID: () => GRID,
1577
- ICONS: () => ICONS,
1578
- MEDIA: () => MEDIA,
1579
- RESET: () => RESET,
1580
- SEMANTIC_ICONS: () => SEMANTIC_ICONS,
1581
- SEQUENCE: () => SEQUENCE,
1582
- SHADOW: () => SHADOW,
1583
- SPACING: () => SPACING,
1584
- SVG: () => SVG,
1585
- SVG_DATA: () => SVG_DATA,
1586
- TEMPLATES: () => TEMPLATES,
1587
- THEME: () => THEME,
1588
- TIMING: () => TIMING,
1589
- TYPOGRAPHY: () => TYPOGRAPHY,
1590
- UNIT: () => UNIT
1591
- });
1592
-
1593
- // src/defaultConfig/sequence.js
1594
- var SEQUENCE = {
1595
- "minor-second": 1.067,
1596
- "major-second": 1.125,
1597
- "minor-third": 1.2,
1598
- "major-third": 1.25,
1599
- "perfect-fourth": 1.333,
1600
- "augmented-fourth": 1.414,
1601
- "perfect-fifth": 1.5,
1602
- "minor-sixth": 1.6,
1603
- phi: 1.618,
1604
- // golden-ratio
1605
- "major-sixth": 1.667,
1606
- "square-root-3": 1.732,
1607
- // theodorus
1608
- "minor-seventh": 1.778,
1609
- "major-seventh": 1.875,
1610
- octave: 2,
1611
- "square-root-5": 2.23,
1612
- // pythagoras
1613
- "major-tenth": 2.5,
1614
- "major-eleventh": 2.667,
1615
- "major-twelfth": 3,
1616
- pi: 3.14,
1617
- // archimedes
1618
- "double-octave": 4
1619
- };
1620
-
1621
- // src/defaultConfig/unit.js
1622
- var UNIT = {
1623
- default: "em"
1624
- };
1625
-
1626
- // src/defaultConfig/typography.js
1627
- var defaultProps = {
1628
- browserDefault: 16,
1629
- base: 16,
1630
- type: "font-size",
1631
- ratio: SEQUENCE["minor-third"],
1632
- range: [-3, 12],
1633
- h1Matches: 6,
1634
- lineHeight: 1.5,
1635
- subSequence: true,
1636
- mediaRegenerate: false,
1637
- unit: "em",
1638
- templates: {},
1639
- sequence: {},
1640
- scales: {},
1641
- vars: {}
1642
- };
1643
- var TYPOGRAPHY = defaultProps;
1644
-
1645
- // src/defaultConfig/font.js
1646
- var FONT = {};
1647
-
1648
- // src/defaultConfig/font-family.js
1649
- var FONT_FAMILY = {};
1650
- var FONT_FAMILY_TYPES = {
1651
- "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
1652
- serif: "Times New Roman, Georgia, serif, --system-default",
1653
- monospace: "Courier New, monospace, --system-default"
1654
- };
1655
- var FONT_FACE = {};
1656
-
1657
- // src/defaultConfig/media.js
1658
- var MEDIA = {
1659
- tv: "(min-width: 2780px)",
1660
- light: "(prefers-color-scheme: light)",
1661
- dark: "(prefers-color-scheme: dark)",
1662
- print: "print"
1663
- };
1664
-
1665
- // src/defaultConfig/spacing.js
1666
- var defaultProps2 = {
1667
- base: TYPOGRAPHY.base,
1668
- type: "spacing",
1669
- ratio: SEQUENCE.phi,
1670
- range: [-5, 15],
1671
- subSequence: true,
1672
- mediaRegenerate: false,
1673
- unit: "em",
1674
- sequence: {},
1675
- scales: {},
1676
- vars: {}
1677
- };
1678
- var SPACING = defaultProps2;
1679
-
1680
- // src/defaultConfig/color.js
1681
- var COLOR = {};
1682
- var GRADIENT = {};
1683
-
1684
- // src/defaultConfig/theme.js
1685
- var THEME = {};
1686
-
1687
- // src/defaultConfig/shadow.js
1688
- var SHADOW = {};
1689
-
1690
- // src/defaultConfig/icons.js
1691
- var ICONS = {};
1692
- var SEMANTIC_ICONS = {};
1693
-
1694
- // src/defaultConfig/timing.js
1695
- var defaultProps3 = {
1696
- default: 150,
1697
- base: 150,
1698
- type: "timing",
1699
- ratio: SEQUENCE["perfect-fourth"],
1700
- range: [-3, 12],
1701
- mediaRegenerate: false,
1702
- unit: "ms",
1703
- sequence: {},
1704
- scales: {},
1705
- vars: {}
1706
- };
1707
- var TIMING = defaultProps3;
1708
-
1709
- // src/defaultConfig/document.js
1710
- var DOCUMENT = {};
1711
-
1712
- // src/defaultConfig/responsive.js
1713
- var BREAKPOINTS = {
1714
- screenL: 1920,
1715
- screenM: 1680,
1716
- screenS: 1440,
1717
- tabletL: 1366,
1718
- tabletM: 1280,
1719
- tabletS: 1024,
1720
- mobileL: 768,
1721
- mobileM: 560,
1722
- mobileS: 480,
1723
- mobileXS: 375
1724
- };
1725
- var DEVICES = {
1726
- screenL: [1920, 1024],
1727
- screenM: [1680, 1024],
1728
- screenS: [1440, 978],
1729
- tabletL: [1366, 926],
1730
- tabletM: [1280, 768],
1731
- tabletS: [1024, 768],
1732
- mobileL: [768, 375],
1733
- mobileM: [560, 768],
1734
- mobileS: [480, 768],
1735
- mobileXS: [375, 768]
1736
- };
1737
-
1738
- // src/defaultConfig/cases.js
1739
- var CASES = {};
1740
-
1741
- // src/defaultConfig/animation.js
1742
- var ANIMATION = {};
1743
-
1744
- // src/defaultConfig/svg.js
1745
- var SVG = {};
1746
- var SVG_DATA = {};
1747
-
1748
- // src/defaultConfig/templates.js
1749
- var TEMPLATES = {};
1750
-
1751
- // src/defaultConfig/grid.js
1752
- var defaultProps4 = {};
1753
- var GRID = defaultProps4;
1754
-
1755
- // src/defaultConfig/index.js
1756
- var RESET = {};
1757
-
1758
- // src/factory.js
1759
- var CSS_VARS = {};
1760
- var CONFIG = {
1761
- verbose: false,
1762
- useVariable: true,
1763
- useReset: true,
1764
- CSS_VARS,
1765
- ...defaultConfig_exports
1766
- };
1767
- var cachedConfig = (0, import_utils.deepClone)(CONFIG);
1768
- var FACTORY = {
1769
- active: "0",
1770
- 0: CONFIG
1771
- };
1772
- var getActiveConfig = (def) => {
1773
- return FACTORY[def || FACTORY.active] || CONFIG;
1774
- };
1775
-
1776
- // src/utils/color.js
1777
- var import_globals = __toESM(require_cjs2(), 1);
1778
- var import_utils2 = __toESM(require_cjs(), 1);
1779
-
1780
- // src/utils/font.js
1781
- var getDefaultOrFirstKey = (LIBRARY, key) => {
1782
- if (LIBRARY[key])
1783
- return LIBRARY[key].value;
1784
- if (LIBRARY.default)
1785
- return LIBRARY[LIBRARY.default].value;
1786
- const hasValue = Object.keys(LIBRARY)[0];
1787
- return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
1788
- };
1789
-
1790
- // src/utils/sequence.js
1791
- var import_utils4 = __toESM(require_cjs(), 1);
1792
-
1793
1565
  // ../utils/dist/cjs/index.js
1794
- var __create2 = Object.create;
1795
- var __defProp2 = Object.defineProperty;
1796
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1797
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1798
- var __getProtoOf2 = Object.getPrototypeOf;
1799
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1800
- var __commonJS2 = (cb, mod) => function __require() {
1801
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1802
- };
1803
- var __export2 = (target, all) => {
1804
- for (var name in all)
1805
- __defProp2(target, name, { get: all[name], enumerable: true });
1806
- };
1807
- var __copyProps2 = (to, from, except, desc) => {
1808
- if (from && typeof from === "object" || typeof from === "function") {
1809
- for (let key of __getOwnPropNames2(from))
1810
- if (!__hasOwnProp2.call(to, key) && key !== except)
1811
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1812
- }
1813
- return to;
1814
- };
1815
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1816
- // If the importer is in node compatibility mode or this is not an ESM
1817
- // file that has been converted to a CommonJS file using a Babel-
1818
- // compatible transform (i.e. "__esModule" has not been set), then set
1819
- // "default" to the CommonJS "module.exports" for node compatibility.
1820
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
1821
- mod
1822
- ));
1823
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1824
- var require_key2 = __commonJS2({
1825
- "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
1566
+ var require_cjs3 = __commonJS({
1567
+ "../utils/dist/cjs/index.js"(exports, module2) {
1826
1568
  "use strict";
1827
- var __defProp22 = Object.defineProperty;
1828
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1829
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1830
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1831
- var __export22 = (target, all) => {
1569
+ var __create2 = Object.create;
1570
+ var __defProp2 = Object.defineProperty;
1571
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1572
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1573
+ var __getProtoOf2 = Object.getPrototypeOf;
1574
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1575
+ var __commonJS2 = (cb, mod) => function __require() {
1576
+ return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1577
+ };
1578
+ var __export2 = (target, all) => {
1832
1579
  for (var name in all)
1833
- __defProp22(target, name, { get: all[name], enumerable: true });
1580
+ __defProp2(target, name, { get: all[name], enumerable: true });
1834
1581
  };
1835
- var __copyProps22 = (to, from, except, desc) => {
1582
+ var __copyProps2 = (to, from, except, desc) => {
1836
1583
  if (from && typeof from === "object" || typeof from === "function") {
1837
- for (let key of __getOwnPropNames22(from))
1838
- if (!__hasOwnProp22.call(to, key) && key !== except)
1839
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1584
+ for (let key of __getOwnPropNames2(from))
1585
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1586
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1840
1587
  }
1841
1588
  return to;
1842
1589
  };
1843
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1844
- var key_exports = {};
1845
- __export22(key_exports, {
1846
- createSnapshotId: () => createSnapshotId,
1847
- generateKey: () => generateKey
1590
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1591
+ // If the importer is in node compatibility mode or this is not an ESM
1592
+ // file that has been converted to a CommonJS file using a Babel-
1593
+ // compatible transform (i.e. "__esModule" has not been set), then set
1594
+ // "default" to the CommonJS "module.exports" for node compatibility.
1595
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
1596
+ mod
1597
+ ));
1598
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1599
+ var require_key2 = __commonJS2({
1600
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports2, module22) {
1601
+ "use strict";
1602
+ var __defProp22 = Object.defineProperty;
1603
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1604
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1605
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1606
+ var __export22 = (target, all) => {
1607
+ for (var name in all)
1608
+ __defProp22(target, name, { get: all[name], enumerable: true });
1609
+ };
1610
+ var __copyProps22 = (to, from, except, desc) => {
1611
+ if (from && typeof from === "object" || typeof from === "function") {
1612
+ for (let key of __getOwnPropNames22(from))
1613
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1614
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1615
+ }
1616
+ return to;
1617
+ };
1618
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1619
+ var key_exports = {};
1620
+ __export22(key_exports, {
1621
+ createSnapshotId: () => createSnapshotId,
1622
+ generateKey: () => generateKey
1623
+ });
1624
+ module22.exports = __toCommonJS22(key_exports);
1625
+ var generateKey = /* @__PURE__ */ function() {
1626
+ let index = 0;
1627
+ function newId() {
1628
+ index++;
1629
+ return index;
1630
+ }
1631
+ return newId;
1632
+ }();
1633
+ var createSnapshotId = generateKey;
1634
+ }
1848
1635
  });
1849
- module2.exports = __toCommonJS22(key_exports);
1850
- var generateKey = /* @__PURE__ */ function() {
1851
- let index = 0;
1852
- function newId() {
1853
- index++;
1854
- return index;
1636
+ var require_env2 = __commonJS2({
1637
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports2, module22) {
1638
+ "use strict";
1639
+ var __defProp22 = Object.defineProperty;
1640
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1641
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1642
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1643
+ var __export22 = (target, all) => {
1644
+ for (var name in all)
1645
+ __defProp22(target, name, { get: all[name], enumerable: true });
1646
+ };
1647
+ var __copyProps22 = (to, from, except, desc) => {
1648
+ if (from && typeof from === "object" || typeof from === "function") {
1649
+ for (let key of __getOwnPropNames22(from))
1650
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1651
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1652
+ }
1653
+ return to;
1654
+ };
1655
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1656
+ var env_exports = {};
1657
+ __export22(env_exports, {
1658
+ NODE_ENV: () => NODE_ENV,
1659
+ getNev: () => getNev,
1660
+ isDevelopment: () => isDevelopment,
1661
+ isProduction: () => isProduction,
1662
+ isTest: () => isTest
1663
+ });
1664
+ module22.exports = __toCommonJS22(env_exports);
1665
+ var NODE_ENV = "development";
1666
+ var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
1667
+ var isTest = (env = NODE_ENV) => env === "test";
1668
+ var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
1669
+ var getNev = (key, env = NODE_ENV) => env[key];
1855
1670
  }
1856
- return newId;
1857
- }();
1858
- var createSnapshotId = generateKey;
1859
- }
1860
- });
1861
- var require_env2 = __commonJS2({
1862
- "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
1863
- "use strict";
1864
- var __defProp22 = Object.defineProperty;
1865
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1866
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1867
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1868
- var __export22 = (target, all) => {
1869
- for (var name in all)
1870
- __defProp22(target, name, { get: all[name], enumerable: true });
1871
- };
1872
- var __copyProps22 = (to, from, except, desc) => {
1873
- if (from && typeof from === "object" || typeof from === "function") {
1874
- for (let key of __getOwnPropNames22(from))
1875
- if (!__hasOwnProp22.call(to, key) && key !== except)
1876
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1671
+ });
1672
+ var require_globals2 = __commonJS2({
1673
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports2, module22) {
1674
+ "use strict";
1675
+ var __defProp22 = Object.defineProperty;
1676
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1677
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1678
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1679
+ var __export22 = (target, all) => {
1680
+ for (var name in all)
1681
+ __defProp22(target, name, { get: all[name], enumerable: true });
1682
+ };
1683
+ var __copyProps22 = (to, from, except, desc) => {
1684
+ if (from && typeof from === "object" || typeof from === "function") {
1685
+ for (let key of __getOwnPropNames22(from))
1686
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1687
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1688
+ }
1689
+ return to;
1690
+ };
1691
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1692
+ var globals_exports = {};
1693
+ __export22(globals_exports, {
1694
+ document: () => document22,
1695
+ global: () => global,
1696
+ self: () => self,
1697
+ window: () => window22
1698
+ });
1699
+ module22.exports = __toCommonJS22(globals_exports);
1700
+ var global = globalThis;
1701
+ var self = globalThis;
1702
+ var window22 = globalThis;
1703
+ var document22 = window22.document;
1877
1704
  }
1878
- return to;
1879
- };
1880
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1881
- var env_exports = {};
1882
- __export22(env_exports, {
1883
- NODE_ENV: () => NODE_ENV,
1884
- getNev: () => getNev,
1885
- isDevelopment: () => isDevelopment,
1886
- isProduction: () => isProduction,
1887
- isTest: () => isTest
1888
1705
  });
1889
- module2.exports = __toCommonJS22(env_exports);
1890
- var NODE_ENV = "development";
1891
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
1892
- var isTest = (env = NODE_ENV) => env === "test";
1893
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
1894
- var getNev = (key, env = NODE_ENV) => env[key];
1895
- }
1896
- });
1897
- var require_globals2 = __commonJS2({
1898
- "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
1899
- "use strict";
1900
- var __defProp22 = Object.defineProperty;
1901
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1902
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1903
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1904
- var __export22 = (target, all) => {
1905
- for (var name in all)
1906
- __defProp22(target, name, { get: all[name], enumerable: true });
1907
- };
1908
- var __copyProps22 = (to, from, except, desc) => {
1909
- if (from && typeof from === "object" || typeof from === "function") {
1910
- for (let key of __getOwnPropNames22(from))
1911
- if (!__hasOwnProp22.call(to, key) && key !== except)
1912
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1706
+ var require_node2 = __commonJS2({
1707
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports2, module22) {
1708
+ "use strict";
1709
+ var __defProp22 = Object.defineProperty;
1710
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1711
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1712
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1713
+ var __export22 = (target, all) => {
1714
+ for (var name in all)
1715
+ __defProp22(target, name, { get: all[name], enumerable: true });
1716
+ };
1717
+ var __copyProps22 = (to, from, except, desc) => {
1718
+ if (from && typeof from === "object" || typeof from === "function") {
1719
+ for (let key of __getOwnPropNames22(from))
1720
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1721
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1722
+ }
1723
+ return to;
1724
+ };
1725
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1726
+ var node_exports = {};
1727
+ __export22(node_exports, {
1728
+ isHtmlElement: () => isHtmlElement,
1729
+ isNode: () => isNode
1730
+ });
1731
+ module22.exports = __toCommonJS22(node_exports);
1732
+ var import_globals2 = require_globals2();
1733
+ var isNode = (obj) => {
1734
+ return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
1735
+ };
1736
+ var isHtmlElement = (obj) => {
1737
+ return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
1738
+ };
1913
1739
  }
1914
- return to;
1915
- };
1916
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1917
- var globals_exports = {};
1918
- __export22(globals_exports, {
1919
- document: () => document22,
1920
- global: () => global,
1921
- self: () => self,
1922
- window: () => window2
1923
1740
  });
1924
- module2.exports = __toCommonJS22(globals_exports);
1925
- var global = globalThis;
1926
- var self = globalThis;
1927
- var window2 = globalThis;
1928
- var document22 = window2.document;
1929
- }
1930
- });
1931
- var require_node2 = __commonJS2({
1932
- "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
1933
- "use strict";
1934
- var __defProp22 = Object.defineProperty;
1935
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1936
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1937
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1938
- var __export22 = (target, all) => {
1939
- for (var name in all)
1940
- __defProp22(target, name, { get: all[name], enumerable: true });
1941
- };
1942
- var __copyProps22 = (to, from, except, desc) => {
1943
- if (from && typeof from === "object" || typeof from === "function") {
1944
- for (let key of __getOwnPropNames22(from))
1945
- if (!__hasOwnProp22.call(to, key) && key !== except)
1946
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1741
+ var require_types2 = __commonJS2({
1742
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports2, module22) {
1743
+ "use strict";
1744
+ var __defProp22 = Object.defineProperty;
1745
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1746
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1747
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1748
+ var __export22 = (target, all) => {
1749
+ for (var name in all)
1750
+ __defProp22(target, name, { get: all[name], enumerable: true });
1751
+ };
1752
+ var __copyProps22 = (to, from, except, desc) => {
1753
+ if (from && typeof from === "object" || typeof from === "function") {
1754
+ for (let key of __getOwnPropNames22(from))
1755
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1756
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1757
+ }
1758
+ return to;
1759
+ };
1760
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1761
+ var types_exports = {};
1762
+ __export22(types_exports, {
1763
+ TYPES: () => TYPES,
1764
+ is: () => is,
1765
+ isArray: () => isArray3,
1766
+ isBoolean: () => isBoolean,
1767
+ isDate: () => isDate,
1768
+ isDefined: () => isDefined2,
1769
+ isFunction: () => isFunction,
1770
+ isNot: () => isNot,
1771
+ isNull: () => isNull,
1772
+ isNumber: () => isNumber2,
1773
+ isObject: () => isObject3,
1774
+ isObjectLike: () => isObjectLike2,
1775
+ isString: () => isString22,
1776
+ isUndefined: () => isUndefined
1777
+ });
1778
+ module22.exports = __toCommonJS22(types_exports);
1779
+ var import_node = require_node2();
1780
+ var isObject3 = (arg) => {
1781
+ if (arg === null)
1782
+ return false;
1783
+ return typeof arg === "object" && arg.constructor === Object;
1784
+ };
1785
+ var isString22 = (arg) => typeof arg === "string";
1786
+ var isNumber2 = (arg) => typeof arg === "number";
1787
+ var isFunction = (arg) => typeof arg === "function";
1788
+ var isBoolean = (arg) => arg === true || arg === false;
1789
+ var isNull = (arg) => arg === null;
1790
+ var isArray3 = (arg) => Array.isArray(arg);
1791
+ var isDate = (d) => d instanceof Date;
1792
+ var isObjectLike2 = (arg) => {
1793
+ if (arg === null)
1794
+ return false;
1795
+ return typeof arg === "object";
1796
+ };
1797
+ var isDefined2 = (arg) => {
1798
+ return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
1799
+ };
1800
+ var isUndefined = (arg) => {
1801
+ return arg === void 0;
1802
+ };
1803
+ var TYPES = {
1804
+ boolean: isBoolean,
1805
+ array: isArray3,
1806
+ object: isObject3,
1807
+ string: isString22,
1808
+ date: isDate,
1809
+ number: isNumber2,
1810
+ null: isNull,
1811
+ function: isFunction,
1812
+ objectLike: isObjectLike2,
1813
+ node: import_node.isNode,
1814
+ htmlElement: import_node.isHtmlElement,
1815
+ defined: isDefined2
1816
+ };
1817
+ var is = (arg) => {
1818
+ return (...args) => {
1819
+ return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
1820
+ };
1821
+ };
1822
+ var isNot = (arg) => {
1823
+ return (...args) => {
1824
+ return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
1825
+ };
1826
+ };
1947
1827
  }
1948
- return to;
1949
- };
1950
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1951
- var node_exports = {};
1952
- __export22(node_exports, {
1953
- isHtmlElement: () => isHtmlElement,
1954
- isNode: () => isNode
1955
1828
  });
1956
- module2.exports = __toCommonJS22(node_exports);
1957
- var import_globals2 = require_globals2();
1958
- var isNode = (obj) => {
1959
- return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
1960
- };
1961
- var isHtmlElement = (obj) => {
1962
- return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
1963
- };
1964
- }
1965
- });
1966
- var require_types2 = __commonJS2({
1967
- "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
1968
- "use strict";
1969
- var __defProp22 = Object.defineProperty;
1970
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1971
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1972
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1973
- var __export22 = (target, all) => {
1974
- for (var name in all)
1975
- __defProp22(target, name, { get: all[name], enumerable: true });
1976
- };
1977
- var __copyProps22 = (to, from, except, desc) => {
1978
- if (from && typeof from === "object" || typeof from === "function") {
1979
- for (let key of __getOwnPropNames22(from))
1980
- if (!__hasOwnProp22.call(to, key) && key !== except)
1981
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1829
+ var require_array2 = __commonJS2({
1830
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports2, module22) {
1831
+ "use strict";
1832
+ var __defProp22 = Object.defineProperty;
1833
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1834
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1835
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1836
+ var __export22 = (target, all) => {
1837
+ for (var name in all)
1838
+ __defProp22(target, name, { get: all[name], enumerable: true });
1839
+ };
1840
+ var __copyProps22 = (to, from, except, desc) => {
1841
+ if (from && typeof from === "object" || typeof from === "function") {
1842
+ for (let key of __getOwnPropNames22(from))
1843
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1844
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1845
+ }
1846
+ return to;
1847
+ };
1848
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1849
+ var array_exports = {};
1850
+ __export22(array_exports, {
1851
+ addItemAfterEveryElement: () => addItemAfterEveryElement,
1852
+ arrayContainsOtherArray: () => arrayContainsOtherArray,
1853
+ arraysEqual: () => arraysEqual,
1854
+ createNestedObject: () => createNestedObject,
1855
+ cutArrayAfterValue: () => cutArrayAfterValue,
1856
+ cutArrayBeforeValue: () => cutArrayBeforeValue,
1857
+ getFrequencyInArray: () => getFrequencyInArray,
1858
+ joinArrays: () => joinArrays,
1859
+ mergeAndCloneIfArray: () => mergeAndCloneIfArray,
1860
+ mergeArray: () => mergeArray,
1861
+ removeFromArray: () => removeFromArray,
1862
+ removeValueFromArray: () => removeValueFromArray,
1863
+ removeValueFromArrayAll: () => removeValueFromArrayAll,
1864
+ reorderArrayByValues: () => reorderArrayByValues,
1865
+ swapItemsInArray: () => swapItemsInArray
1866
+ });
1867
+ module22.exports = __toCommonJS22(array_exports);
1868
+ var import_object = require_object2();
1869
+ var import_types = require_types2();
1870
+ var arrayContainsOtherArray = (arr1, arr2) => {
1871
+ return arr2.every((val) => arr1.includes(val));
1872
+ };
1873
+ var getFrequencyInArray = (arr, value) => {
1874
+ return arr.reduce((count, currentValue) => {
1875
+ return currentValue === value ? count + 1 : count;
1876
+ }, 0);
1877
+ };
1878
+ var removeFromArray = (arr, index) => {
1879
+ if ((0, import_types.isString)(index))
1880
+ index = parseInt(index);
1881
+ if ((0, import_types.isNumber)(index)) {
1882
+ if (index < 0 || index >= arr.length || isNaN(index)) {
1883
+ throw new Error("Invalid index");
1884
+ }
1885
+ arr.splice(index, 1);
1886
+ } else if ((0, import_types.isArray)(index)) {
1887
+ index.forEach((idx) => removeFromArray(arr, idx));
1888
+ } else {
1889
+ throw new Error("Invalid index");
1890
+ }
1891
+ return arr;
1892
+ };
1893
+ var swapItemsInArray = (arr, i, j) => {
1894
+ [arr[i], arr[j]] = [arr[j], arr[i]];
1895
+ };
1896
+ var joinArrays = (...arrays) => {
1897
+ return [].concat(...arrays);
1898
+ };
1899
+ var mergeArray = (arr, excludeFrom = []) => {
1900
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
1901
+ };
1902
+ var mergeAndCloneIfArray = (obj) => {
1903
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
1904
+ };
1905
+ var cutArrayBeforeValue = (arr, value) => {
1906
+ const index = arr.indexOf(value);
1907
+ if (index !== -1) {
1908
+ return arr.slice(0, index);
1909
+ }
1910
+ return arr;
1911
+ };
1912
+ var cutArrayAfterValue = (arr, value) => {
1913
+ if (!(0, import_types.isArray)(arr))
1914
+ return;
1915
+ const index = arr.indexOf(value);
1916
+ if (index !== -1) {
1917
+ return arr.slice(index + 1);
1918
+ }
1919
+ return arr;
1920
+ };
1921
+ var createNestedObject = (arr, lastValue) => {
1922
+ const nestedObject = {};
1923
+ if (arr.length === 0) {
1924
+ return lastValue;
1925
+ }
1926
+ arr.reduce((obj, value, index) => {
1927
+ if (!obj[value]) {
1928
+ obj[value] = {};
1929
+ }
1930
+ if (index === arr.length - 1 && lastValue) {
1931
+ obj[value] = lastValue;
1932
+ }
1933
+ return obj[value];
1934
+ }, nestedObject);
1935
+ return nestedObject;
1936
+ };
1937
+ var removeValueFromArray = (arr, value) => {
1938
+ const index = arr.indexOf(value);
1939
+ if (index > -1) {
1940
+ const newArray = [...arr];
1941
+ newArray.splice(index, 1);
1942
+ return newArray;
1943
+ }
1944
+ return arr;
1945
+ };
1946
+ var removeValueFromArrayAll = (arr, value) => {
1947
+ return arr.filter((item) => item !== value);
1948
+ };
1949
+ var addItemAfterEveryElement = (array, item) => {
1950
+ const result = [];
1951
+ for (let i = 0; i < array.length; i++) {
1952
+ result.push(array[i]);
1953
+ if (i < array.length - 1) {
1954
+ result.push(item);
1955
+ }
1956
+ }
1957
+ return result;
1958
+ };
1959
+ var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
1960
+ const newArray = [...array];
1961
+ const indexToMove = newArray.indexOf(valueToMove);
1962
+ const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
1963
+ if (indexToMove !== -1 && indexToInsertBefore !== -1) {
1964
+ const removedItem = newArray.splice(indexToMove, 1)[0];
1965
+ const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
1966
+ newArray.splice(insertIndex, 0, removedItem);
1967
+ }
1968
+ return newArray;
1969
+ };
1970
+ var arraysEqual = (arr1, arr2) => {
1971
+ if (arr1.length !== arr2.length) {
1972
+ return false;
1973
+ }
1974
+ for (let i = 0; i < arr1.length; i++) {
1975
+ if (arr1[i] !== arr2[i]) {
1976
+ return false;
1977
+ }
1978
+ }
1979
+ return true;
1980
+ };
1982
1981
  }
1983
- return to;
1984
- };
1985
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1986
- var types_exports = {};
1987
- __export22(types_exports, {
1988
- TYPES: () => TYPES,
1989
- is: () => is,
1990
- isArray: () => isArray3,
1991
- isBoolean: () => isBoolean,
1992
- isDate: () => isDate,
1993
- isDefined: () => isDefined2,
1994
- isFunction: () => isFunction,
1995
- isNot: () => isNot,
1996
- isNull: () => isNull,
1997
- isNumber: () => isNumber2,
1998
- isObject: () => isObject3,
1999
- isObjectLike: () => isObjectLike2,
2000
- isString: () => isString22,
2001
- isUndefined: () => isUndefined
2002
1982
  });
2003
- module2.exports = __toCommonJS22(types_exports);
2004
- var import_node = require_node2();
2005
- var isObject3 = (arg) => {
2006
- if (arg === null)
2007
- return false;
2008
- return typeof arg === "object" && arg.constructor === Object;
2009
- };
2010
- var isString22 = (arg) => typeof arg === "string";
2011
- var isNumber2 = (arg) => typeof arg === "number";
2012
- var isFunction = (arg) => typeof arg === "function";
2013
- var isBoolean = (arg) => arg === true || arg === false;
2014
- var isNull = (arg) => arg === null;
2015
- var isArray3 = (arg) => Array.isArray(arg);
2016
- var isDate = (d) => d instanceof Date;
2017
- var isObjectLike2 = (arg) => {
2018
- if (arg === null)
2019
- return false;
2020
- return typeof arg === "object";
2021
- };
2022
- var isDefined2 = (arg) => {
2023
- return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
2024
- };
2025
- var isUndefined = (arg) => {
2026
- return arg === void 0;
2027
- };
2028
- var TYPES = {
2029
- boolean: isBoolean,
2030
- array: isArray3,
2031
- object: isObject3,
2032
- string: isString22,
2033
- date: isDate,
2034
- number: isNumber2,
2035
- null: isNull,
2036
- function: isFunction,
2037
- objectLike: isObjectLike2,
2038
- node: import_node.isNode,
2039
- htmlElement: import_node.isHtmlElement,
2040
- defined: isDefined2
2041
- };
2042
- var is = (arg) => {
2043
- return (...args) => {
2044
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
2045
- };
2046
- };
2047
- var isNot = (arg) => {
2048
- return (...args) => {
2049
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
2050
- };
2051
- };
2052
- }
2053
- });
2054
- var require_array2 = __commonJS2({
2055
- "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
2056
- "use strict";
2057
- var __defProp22 = Object.defineProperty;
2058
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2059
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2060
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2061
- var __export22 = (target, all) => {
2062
- for (var name in all)
2063
- __defProp22(target, name, { get: all[name], enumerable: true });
2064
- };
2065
- var __copyProps22 = (to, from, except, desc) => {
2066
- if (from && typeof from === "object" || typeof from === "function") {
2067
- for (let key of __getOwnPropNames22(from))
2068
- if (!__hasOwnProp22.call(to, key) && key !== except)
2069
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1983
+ var require_string2 = __commonJS2({
1984
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports2, module22) {
1985
+ "use strict";
1986
+ var __defProp22 = Object.defineProperty;
1987
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1988
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1989
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1990
+ var __export22 = (target, all) => {
1991
+ for (var name in all)
1992
+ __defProp22(target, name, { get: all[name], enumerable: true });
1993
+ };
1994
+ var __copyProps22 = (to, from, except, desc) => {
1995
+ if (from && typeof from === "object" || typeof from === "function") {
1996
+ for (let key of __getOwnPropNames22(from))
1997
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1998
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1999
+ }
2000
+ return to;
2001
+ };
2002
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2003
+ var string_exports = {};
2004
+ __export22(string_exports, {
2005
+ customDecodeURIComponent: () => customDecodeURIComponent,
2006
+ customEncodeURIComponent: () => customEncodeURIComponent,
2007
+ findKeyPosition: () => findKeyPosition,
2008
+ lowercaseFirstLetter: () => lowercaseFirstLetter,
2009
+ replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
2010
+ replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
2011
+ stringIncludesAny: () => stringIncludesAny,
2012
+ trimStringFromSymbols: () => trimStringFromSymbols
2013
+ });
2014
+ module22.exports = __toCommonJS22(string_exports);
2015
+ var stringIncludesAny = (str, characters) => {
2016
+ for (const char of characters) {
2017
+ if (str.includes(char)) {
2018
+ return true;
2019
+ }
2020
+ }
2021
+ return false;
2022
+ };
2023
+ var trimStringFromSymbols = (str, characters) => {
2024
+ const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
2025
+ return str.replace(pattern, "");
2026
+ };
2027
+ var brackRegex = {
2028
+ 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
2029
+ 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
2030
+ };
2031
+ var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
2032
+ if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
2033
+ return str;
2034
+ const reg = brackRegex[options.bracketsLength || 2];
2035
+ return str.replace(reg, (_, parentPath, variable) => {
2036
+ if (parentPath) {
2037
+ const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
2038
+ let parentState = state;
2039
+ for (let i = 0; i < parentLevels; i++) {
2040
+ parentState = parentState.parent;
2041
+ if (!parentState) {
2042
+ return "";
2043
+ }
2044
+ }
2045
+ const value = parentState[variable.trim()];
2046
+ return value !== void 0 ? `${value}` : "";
2047
+ } else {
2048
+ const value = state[variable.trim()];
2049
+ return value !== void 0 ? `${value}` : "";
2050
+ }
2051
+ });
2052
+ };
2053
+ var lowercaseFirstLetter = (inputString) => {
2054
+ return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
2055
+ };
2056
+ var findKeyPosition = (str, key) => {
2057
+ const lines = str.split("\n");
2058
+ let startLineNumber = -1;
2059
+ let endLineNumber = -1;
2060
+ let startColumn = -1;
2061
+ let endColumn = -1;
2062
+ const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2063
+ let braceCount = 0;
2064
+ let foundKey = false;
2065
+ for (let i = 0; i < lines.length; i++) {
2066
+ if (keyPattern.test(lines[i]) && !foundKey) {
2067
+ foundKey = true;
2068
+ startLineNumber = i + 1;
2069
+ startColumn = lines[i].indexOf(key) + 1;
2070
+ if (lines[i].includes("{}")) {
2071
+ endLineNumber = startLineNumber;
2072
+ endColumn = lines[i].indexOf("{}") + 3;
2073
+ break;
2074
+ }
2075
+ const line = lines[i].slice(startColumn + key.length);
2076
+ if (line.includes("{") || line.includes("[")) {
2077
+ braceCount = 1;
2078
+ } else {
2079
+ endLineNumber = i + 1;
2080
+ endColumn = lines[i].length + 1;
2081
+ break;
2082
+ }
2083
+ } else if (foundKey) {
2084
+ braceCount += (lines[i].match(/{/g) || []).length;
2085
+ braceCount += (lines[i].match(/\[/g) || []).length;
2086
+ braceCount -= (lines[i].match(/}/g) || []).length;
2087
+ braceCount -= (lines[i].match(/]/g) || []).length;
2088
+ if (braceCount === 0) {
2089
+ endLineNumber = i + 1;
2090
+ endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2091
+ break;
2092
+ }
2093
+ }
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
+ };
2070
2121
  }
2071
- return to;
2072
- };
2073
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2074
- var array_exports = {};
2075
- __export22(array_exports, {
2076
- addItemAfterEveryElement: () => addItemAfterEveryElement,
2077
- arrayContainsOtherArray: () => arrayContainsOtherArray,
2078
- arraysEqual: () => arraysEqual,
2079
- createNestedObject: () => createNestedObject,
2080
- cutArrayAfterValue: () => cutArrayAfterValue,
2081
- cutArrayBeforeValue: () => cutArrayBeforeValue,
2082
- getFrequencyInArray: () => getFrequencyInArray,
2083
- joinArrays: () => joinArrays,
2084
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
2085
- mergeArray: () => mergeArray,
2086
- removeFromArray: () => removeFromArray,
2087
- removeValueFromArray: () => removeValueFromArray,
2088
- removeValueFromArrayAll: () => removeValueFromArrayAll,
2089
- reorderArrayByValues: () => reorderArrayByValues,
2090
- swapItemsInArray: () => swapItemsInArray
2091
2122
  });
2092
- module2.exports = __toCommonJS22(array_exports);
2093
- var import_object = require_object2();
2094
- var import_types = require_types2();
2095
- var arrayContainsOtherArray = (arr1, arr2) => {
2096
- return arr2.every((val) => arr1.includes(val));
2097
- };
2098
- var getFrequencyInArray = (arr, value) => {
2099
- return arr.reduce((count, currentValue) => {
2100
- return currentValue === value ? count + 1 : count;
2101
- }, 0);
2102
- };
2103
- var removeFromArray = (arr, index) => {
2104
- if ((0, import_types.isString)(index))
2105
- index = parseInt(index);
2106
- if ((0, import_types.isNumber)(index)) {
2107
- if (index < 0 || index >= arr.length || isNaN(index)) {
2108
- throw new Error("Invalid index");
2123
+ var require_object2 = __commonJS2({
2124
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports2, module22) {
2125
+ "use strict";
2126
+ var __defProp22 = Object.defineProperty;
2127
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2128
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2129
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2130
+ var __export22 = (target, all) => {
2131
+ for (var name in all)
2132
+ __defProp22(target, name, { get: all[name], enumerable: true });
2133
+ };
2134
+ var __copyProps22 = (to, from, except, desc) => {
2135
+ if (from && typeof from === "object" || typeof from === "function") {
2136
+ for (let key of __getOwnPropNames22(from))
2137
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2138
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2139
+ }
2140
+ return to;
2141
+ };
2142
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2143
+ var object_exports = {};
2144
+ __export22(object_exports, {
2145
+ checkIfKeyIsComponent: () => checkIfKeyIsComponent,
2146
+ clone: () => clone,
2147
+ createObjectWithoutPrototype: () => createObjectWithoutPrototype,
2148
+ deepClone: () => deepClone2,
2149
+ deepCloneExclude: () => deepCloneExclude,
2150
+ deepCloneWithExtend: () => deepCloneWithExtend,
2151
+ deepContains: () => deepContains,
2152
+ deepDestringify: () => deepDestringify,
2153
+ deepDiff: () => deepDiff,
2154
+ deepMerge: () => deepMerge2,
2155
+ deepStringify: () => deepStringify,
2156
+ detachFunctionsFromObject: () => detachFunctionsFromObject,
2157
+ diff: () => diff,
2158
+ diffArrays: () => diffArrays,
2159
+ diffObjects: () => diffObjects,
2160
+ exec: () => exec,
2161
+ flattenRecursive: () => flattenRecursive,
2162
+ getChildrenComponentsByKey: () => getChildrenComponentsByKey,
2163
+ getExtendsInElement: () => getExtendsInElement,
2164
+ hasOwnProperty: () => hasOwnProperty,
2165
+ isEmpty: () => isEmpty,
2166
+ isEmptyObject: () => isEmptyObject,
2167
+ isEqualDeep: () => isEqualDeep,
2168
+ makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
2169
+ map: () => map,
2170
+ merge: () => merge2,
2171
+ mergeArrayExclude: () => mergeArrayExclude,
2172
+ mergeIfExisted: () => mergeIfExisted,
2173
+ objectToString: () => objectToString,
2174
+ overwrite: () => overwrite,
2175
+ overwriteDeep: () => overwriteDeep,
2176
+ overwriteShallow: () => overwriteShallow,
2177
+ removeFromObject: () => removeFromObject,
2178
+ stringToObject: () => stringToObject
2179
+ });
2180
+ module22.exports = __toCommonJS22(object_exports);
2181
+ var import_globals2 = require_globals2();
2182
+ var import_types = require_types2();
2183
+ var import_array = require_array2();
2184
+ var import_string = require_string2();
2185
+ var exec = (param, element, state, context) => {
2186
+ if ((0, import_types.isFunction)(param)) {
2187
+ return param(
2188
+ element,
2189
+ state || element.state,
2190
+ context || element.context
2191
+ );
2192
+ }
2193
+ return param;
2194
+ };
2195
+ var map = (obj, extention, element) => {
2196
+ for (const e in extention) {
2197
+ obj[e] = exec(extention[e], element);
2198
+ }
2199
+ };
2200
+ var merge2 = (element, obj, excludeFrom = []) => {
2201
+ for (const e in obj) {
2202
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
2203
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2204
+ continue;
2205
+ const elementProp = element[e];
2206
+ const objProp = obj[e];
2207
+ if (elementProp === void 0) {
2208
+ element[e] = objProp;
2209
+ }
2210
+ }
2211
+ return element;
2212
+ };
2213
+ var deepMerge2 = (element, extend, excludeFrom = []) => {
2214
+ for (const e in extend) {
2215
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
2216
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2217
+ continue;
2218
+ const elementProp = element[e];
2219
+ const extendProp = extend[e];
2220
+ if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
2221
+ deepMerge2(elementProp, extendProp, excludeFrom);
2222
+ } else if (elementProp === void 0) {
2223
+ element[e] = extendProp;
2224
+ }
2225
+ }
2226
+ return element;
2227
+ };
2228
+ var clone = (obj, excludeFrom = []) => {
2229
+ const o = {};
2230
+ for (const prop in obj) {
2231
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2232
+ if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
2233
+ continue;
2234
+ o[prop] = obj[prop];
2235
+ }
2236
+ return o;
2237
+ };
2238
+ var deepCloneExclude = (obj, excludeFrom = []) => {
2239
+ if ((0, import_types.isArray)(obj)) {
2240
+ return obj.map((x) => deepCloneExclude(x, excludeFrom));
2241
+ }
2242
+ const o = {};
2243
+ for (const k in obj) {
2244
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
2245
+ if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
2246
+ continue;
2247
+ let v = obj[k];
2248
+ if (k === "extend" && (0, import_types.isArray)(v)) {
2249
+ v = mergeArrayExclude(v, excludeFrom);
2250
+ }
2251
+ if ((0, import_types.isArray)(v)) {
2252
+ o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
2253
+ } else if ((0, import_types.isObject)(v)) {
2254
+ o[k] = deepCloneExclude(v, excludeFrom);
2255
+ } else
2256
+ o[k] = v;
2257
+ }
2258
+ return o;
2259
+ };
2260
+ var mergeArrayExclude = (arr, excl = []) => {
2261
+ return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
2262
+ };
2263
+ var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
2264
+ const o = (0, import_types.isArray)(obj) ? [] : {};
2265
+ for (const prop in obj) {
2266
+ if (!Object.prototype.hasOwnProperty.call(obj, prop))
2267
+ continue;
2268
+ if (prop === "__proto__")
2269
+ continue;
2270
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
2271
+ continue;
2272
+ let objProp = obj[prop];
2273
+ if (cleanUndefined && (0, import_types.isUndefined)(objProp))
2274
+ continue;
2275
+ if (prop === "extend" && (0, import_types.isArray)(objProp)) {
2276
+ objProp = (0, import_array.mergeArray)(objProp);
2277
+ }
2278
+ if ((0, import_types.isObjectLike)(objProp)) {
2279
+ o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
2280
+ } else
2281
+ o[prop] = objProp;
2282
+ }
2283
+ return o;
2284
+ };
2285
+ var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
2286
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
2287
+ for (const prop in obj) {
2288
+ if (!Object.prototype.hasOwnProperty.call(obj, prop))
2289
+ continue;
2290
+ const objProp = obj[prop];
2291
+ if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
2292
+ continue;
2293
+ if ((0, import_types.isObjectLike)(objProp)) {
2294
+ o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
2295
+ } else
2296
+ o[prop] = objProp;
2297
+ }
2298
+ return o;
2299
+ };
2300
+ var deepStringify = (obj, stringified = {}) => {
2301
+ for (const prop in obj) {
2302
+ const objProp = obj[prop];
2303
+ if ((0, import_types.isFunction)(objProp)) {
2304
+ stringified[prop] = objProp.toString();
2305
+ } else if ((0, import_types.isObject)(objProp)) {
2306
+ stringified[prop] = {};
2307
+ deepStringify(objProp, stringified[prop]);
2308
+ } else if ((0, import_types.isArray)(objProp)) {
2309
+ stringified[prop] = [];
2310
+ objProp.forEach((v, i) => {
2311
+ if ((0, import_types.isObject)(v)) {
2312
+ stringified[prop][i] = {};
2313
+ deepStringify(v, stringified[prop][i]);
2314
+ } else if ((0, import_types.isFunction)(v)) {
2315
+ stringified[prop][i] = v.toString();
2316
+ } else {
2317
+ stringified[prop][i] = v;
2318
+ }
2319
+ });
2320
+ } else {
2321
+ stringified[prop] = objProp;
2322
+ }
2323
+ }
2324
+ return stringified;
2325
+ };
2326
+ var objectToString = (obj = {}, indent = 0) => {
2327
+ const spaces = " ".repeat(indent);
2328
+ let str = "{\n";
2329
+ for (const [key, value] of Object.entries(obj)) {
2330
+ const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
2331
+ const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
2332
+ str += `${spaces} ${stringedKey}: `;
2333
+ if ((0, import_types.isArray)(value)) {
2334
+ str += "[\n";
2335
+ for (const element of value) {
2336
+ if ((0, import_types.isObject)(element) && element !== null) {
2337
+ str += `${spaces} ${objectToString(element, indent + 2)},
2338
+ `;
2339
+ } else if ((0, import_types.isString)(element)) {
2340
+ str += `${spaces} '${element}',
2341
+ `;
2342
+ } else {
2343
+ str += `${spaces} ${element},
2344
+ `;
2345
+ }
2346
+ }
2347
+ str += `${spaces} ]`;
2348
+ } else if ((0, import_types.isObjectLike)(value)) {
2349
+ str += objectToString(value, indent + 1);
2350
+ } else if ((0, import_types.isString)(value)) {
2351
+ str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
2352
+ } else {
2353
+ str += value;
2354
+ }
2355
+ str += ",\n";
2356
+ }
2357
+ str += `${spaces}}`;
2358
+ return str;
2359
+ };
2360
+ var detachFunctionsFromObject = (obj, detached = {}) => {
2361
+ for (const prop in obj) {
2362
+ const objProp = obj[prop];
2363
+ if ((0, import_types.isFunction)(objProp))
2364
+ continue;
2365
+ else if ((0, import_types.isObject)(objProp)) {
2366
+ detached[prop] = {};
2367
+ deepStringify(objProp, detached[prop]);
2368
+ } else if ((0, import_types.isArray)(objProp)) {
2369
+ detached[prop] = [];
2370
+ objProp.forEach((v, i) => {
2371
+ if ((0, import_types.isFunction)(v))
2372
+ return;
2373
+ if ((0, import_types.isObject)(v)) {
2374
+ detached[prop][i] = {};
2375
+ detachFunctionsFromObject(v, detached[prop][i]);
2376
+ } else {
2377
+ detached[prop][i] = v;
2378
+ }
2379
+ });
2380
+ } else {
2381
+ detached[prop] = objProp;
2382
+ }
2383
+ }
2384
+ return detached;
2385
+ };
2386
+ var deepDestringify = (obj, destringified = {}) => {
2387
+ for (const prop in obj) {
2388
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2389
+ if (!hasOwnProperty2)
2390
+ continue;
2391
+ const objProp = obj[prop];
2392
+ if ((0, import_types.isString)(objProp)) {
2393
+ if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2394
+ try {
2395
+ const evalProp = import_globals2.window.eval(`(${objProp})`);
2396
+ destringified[prop] = evalProp;
2397
+ } catch (e) {
2398
+ if (e)
2399
+ destringified[prop] = objProp;
2400
+ }
2401
+ } else {
2402
+ destringified[prop] = objProp;
2403
+ }
2404
+ } else if ((0, import_types.isArray)(objProp)) {
2405
+ destringified[prop] = [];
2406
+ objProp.forEach((arrProp) => {
2407
+ if ((0, import_types.isString)(arrProp)) {
2408
+ if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
2409
+ try {
2410
+ const evalProp = import_globals2.window.eval(`(${arrProp})`);
2411
+ destringified[prop].push(evalProp);
2412
+ } catch (e) {
2413
+ if (e)
2414
+ destringified[prop].push(arrProp);
2415
+ }
2416
+ } else {
2417
+ destringified[prop].push(arrProp);
2418
+ }
2419
+ } else if ((0, import_types.isObject)(arrProp)) {
2420
+ destringified[prop].push(deepDestringify(arrProp));
2421
+ } else {
2422
+ destringified[prop].push(arrProp);
2423
+ }
2424
+ });
2425
+ } else if ((0, import_types.isObject)(objProp)) {
2426
+ destringified[prop] = deepDestringify(objProp, destringified[prop]);
2427
+ } else {
2428
+ destringified[prop] = objProp;
2429
+ }
2430
+ }
2431
+ return destringified;
2432
+ };
2433
+ var stringToObject = (str, opts = { verbose: true }) => {
2434
+ try {
2435
+ return import_globals2.window.eval("(" + str + ")");
2436
+ } catch (e) {
2437
+ if (opts.verbose)
2438
+ console.warn(e);
2439
+ }
2440
+ };
2441
+ var diffObjects = (original, objToDiff, cache) => {
2442
+ for (const e in objToDiff) {
2443
+ if (e === "ref")
2444
+ continue;
2445
+ const originalProp = original[e];
2446
+ const objToDiffProp = objToDiff[e];
2447
+ if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
2448
+ cache[e] = {};
2449
+ diff(originalProp, objToDiffProp, cache[e]);
2450
+ } else if (objToDiffProp !== void 0) {
2451
+ cache[e] = objToDiffProp;
2452
+ }
2453
+ }
2454
+ return cache;
2455
+ };
2456
+ var diffArrays = (original, objToDiff, cache) => {
2457
+ if (original.length !== objToDiff.length) {
2458
+ cache = objToDiff;
2459
+ } else {
2460
+ const diffArr = [];
2461
+ for (let i = 0; i < original.length; i++) {
2462
+ const diffObj = diff(original[i], objToDiff[i]);
2463
+ if (Object.keys(diffObj).length > 0) {
2464
+ diffArr.push(diffObj);
2465
+ }
2466
+ }
2467
+ if (diffArr.length > 0) {
2468
+ cache = diffArr;
2469
+ }
2470
+ }
2471
+ return cache;
2472
+ };
2473
+ var diff = (original, objToDiff, cache = {}) => {
2474
+ if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
2475
+ cache = [];
2476
+ diffArrays(original, objToDiff, cache);
2477
+ } else {
2478
+ diffObjects(original, objToDiff, cache);
2479
+ }
2480
+ return cache;
2481
+ };
2482
+ var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
2483
+ var isEmpty = (o) => Object.keys(o).length === 0;
2484
+ var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
2485
+ var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
2486
+ var deepDiff = (lhs, rhs) => {
2487
+ if (lhs === rhs)
2488
+ return {};
2489
+ if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
2490
+ return rhs;
2491
+ const deletedValues = Object.keys(lhs).reduce((acc, key) => {
2492
+ if (!hasOwnProperty(rhs, key)) {
2493
+ acc[key] = void 0;
2494
+ }
2495
+ return acc;
2496
+ }, makeObjectWithoutPrototype());
2497
+ if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
2498
+ if (lhs.valueOf() === rhs.valueOf())
2499
+ return {};
2500
+ return rhs;
2501
+ }
2502
+ return Object.keys(rhs).reduce((acc, key) => {
2503
+ if (!hasOwnProperty(lhs, key)) {
2504
+ acc[key] = rhs[key];
2505
+ return acc;
2506
+ }
2507
+ const difference = diff(lhs[key], rhs[key]);
2508
+ if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
2509
+ return acc;
2510
+ }
2511
+ acc[key] = difference;
2512
+ return acc;
2513
+ }, deletedValues);
2514
+ };
2515
+ var overwrite = (element, params, excludeFrom = []) => {
2516
+ const { ref } = element;
2517
+ const changes = {};
2518
+ for (const e in params) {
2519
+ if (excludeFrom.includes(e) || e.startsWith("__"))
2520
+ continue;
2521
+ const elementProp = element[e];
2522
+ const paramsProp = params[e];
2523
+ if (paramsProp) {
2524
+ ref.__cache[e] = changes[e] = elementProp;
2525
+ ref[e] = paramsProp;
2526
+ }
2527
+ }
2528
+ return changes;
2529
+ };
2530
+ var overwriteShallow = (obj, params, excludeFrom = []) => {
2531
+ for (const e in params) {
2532
+ if (excludeFrom.includes(e) || e.startsWith("__"))
2533
+ continue;
2534
+ obj[e] = params[e];
2535
+ }
2536
+ return obj;
2537
+ };
2538
+ var overwriteDeep = (obj, params, excludeFrom = []) => {
2539
+ for (const e in params) {
2540
+ if (e === "__proto__")
2541
+ continue;
2542
+ if (excludeFrom.includes(e) || e.startsWith("__"))
2543
+ continue;
2544
+ const objProp = obj[e];
2545
+ const paramsProp = params[e];
2546
+ if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
2547
+ overwriteDeep(objProp, paramsProp);
2548
+ } else if (paramsProp !== void 0) {
2549
+ obj[e] = paramsProp;
2550
+ }
2551
+ }
2552
+ return obj;
2553
+ };
2554
+ var mergeIfExisted = (a, b) => {
2555
+ if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
2556
+ return deepMerge2(a, b);
2557
+ return a || b;
2558
+ };
2559
+ var flattenRecursive = (param, prop, stack = []) => {
2560
+ const objectized = (0, import_array.mergeAndCloneIfArray)(param);
2561
+ stack.push(objectized);
2562
+ const extendOfExtend = objectized[prop];
2563
+ if (extendOfExtend)
2564
+ flattenRecursive(extendOfExtend, prop, stack);
2565
+ delete objectized[prop];
2566
+ return stack;
2567
+ };
2568
+ var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
2569
+ if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
2570
+ return param === element;
2571
+ }
2572
+ if (visited.has(param) || visited.has(element)) {
2573
+ return true;
2574
+ }
2575
+ visited.add(param);
2576
+ visited.add(element);
2577
+ const keysParam = Object.keys(param);
2578
+ const keysElement = Object.keys(element);
2579
+ if (keysParam.length !== keysElement.length) {
2580
+ return false;
2581
+ }
2582
+ for (const key of keysParam) {
2583
+ if (!keysElement.includes(key)) {
2584
+ return false;
2585
+ }
2586
+ const paramProp = param[key];
2587
+ const elementProp = element[key];
2588
+ if (!isEqualDeep(paramProp, elementProp, visited)) {
2589
+ return false;
2590
+ }
2591
+ }
2592
+ return true;
2593
+ };
2594
+ var deepContains = (obj1, obj2) => {
2595
+ if (typeof obj1 !== typeof obj2) {
2596
+ return false;
2597
+ }
2598
+ if ((0, import_types.isObjectLike)(obj1)) {
2599
+ if (Array.isArray(obj1) && Array.isArray(obj2)) {
2600
+ if (obj1.length !== obj2.length) {
2601
+ return false;
2602
+ }
2603
+ for (let i = 0; i < obj1.length; i++) {
2604
+ if (!deepContains(obj1[i], obj2[i])) {
2605
+ return false;
2606
+ }
2607
+ }
2608
+ } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
2609
+ for (const key in obj1) {
2610
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
2611
+ if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
2612
+ return false;
2613
+ }
2614
+ }
2615
+ }
2616
+ } else {
2617
+ return obj2 === obj1;
2618
+ }
2619
+ return true;
2620
+ };
2621
+ var removeFromObject = (obj, props) => {
2622
+ if (props === void 0 || props === null)
2623
+ return obj;
2624
+ if ((0, import_types.is)(props)("string", "number")) {
2625
+ delete obj[props];
2626
+ } else if ((0, import_types.isArray)(props)) {
2627
+ props.forEach((prop) => delete obj[prop]);
2628
+ } else {
2629
+ throw new Error("Invalid input: props must be a string or an array of strings");
2630
+ }
2631
+ return obj;
2632
+ };
2633
+ var createObjectWithoutPrototype = (obj) => {
2634
+ if (obj === null || typeof obj !== "object") {
2635
+ return obj;
2636
+ }
2637
+ const newObj = /* @__PURE__ */ Object.create(null);
2638
+ for (const key in obj) {
2639
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
2640
+ newObj[key] = createObjectWithoutPrototype(obj[key]);
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
+ };
2693
+ }
2694
+ });
2695
+ var require_function2 = __commonJS2({
2696
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports2, module22) {
2697
+ "use strict";
2698
+ var __defProp22 = Object.defineProperty;
2699
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2700
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2701
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2702
+ var __export22 = (target, all) => {
2703
+ for (var name in all)
2704
+ __defProp22(target, name, { get: all[name], enumerable: true });
2705
+ };
2706
+ var __copyProps22 = (to, from, except, desc) => {
2707
+ if (from && typeof from === "object" || typeof from === "function") {
2708
+ for (let key of __getOwnPropNames22(from))
2709
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2710
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2711
+ }
2712
+ return to;
2713
+ };
2714
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2715
+ var function_exports = {};
2716
+ __export22(function_exports, {
2717
+ debounce: () => debounce,
2718
+ debounceOnContext: () => debounceOnContext,
2719
+ isStringFunction: () => isStringFunction,
2720
+ memoize: () => memoize
2721
+ });
2722
+ module22.exports = __toCommonJS22(function_exports);
2723
+ function debounce(func, wait, immediate) {
2724
+ let timeout;
2725
+ return function() {
2726
+ const context = this;
2727
+ const args = arguments;
2728
+ const later = function() {
2729
+ timeout = null;
2730
+ if (!immediate)
2731
+ func.apply(context, args);
2732
+ };
2733
+ const callNow = immediate && !timeout;
2734
+ clearTimeout(timeout);
2735
+ timeout = setTimeout(later, wait);
2736
+ if (callNow)
2737
+ func.apply(context, args);
2738
+ };
2109
2739
  }
2110
- arr.splice(index, 1);
2111
- } else if ((0, import_types.isArray)(index)) {
2112
- index.forEach((idx) => removeFromArray(arr, idx));
2113
- } else {
2114
- throw new Error("Invalid index");
2740
+ var debounceOnContext = (element, func, timeout = 300) => {
2741
+ let timer;
2742
+ return (...args) => {
2743
+ clearTimeout(timer);
2744
+ timer = setTimeout(() => {
2745
+ func.apply(element, args);
2746
+ }, timeout);
2747
+ };
2748
+ };
2749
+ var memoize = (fn) => {
2750
+ const cache = {};
2751
+ return (...args) => {
2752
+ const n = args[0];
2753
+ if (n in cache) {
2754
+ return cache[n];
2755
+ } else {
2756
+ const result = fn(n);
2757
+ cache[n] = result;
2758
+ return result;
2759
+ }
2760
+ };
2761
+ };
2762
+ var isStringFunction = (inputString) => {
2763
+ const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
2764
+ return functionRegex.test(inputString);
2765
+ };
2115
2766
  }
2116
- return arr;
2117
- };
2118
- var swapItemsInArray = (arr, i, j) => {
2119
- [arr[i], arr[j]] = [arr[j], arr[i]];
2120
- };
2121
- var joinArrays = (...arrays) => {
2122
- return [].concat(...arrays);
2123
- };
2124
- var mergeArray = (arr, excludeFrom = []) => {
2125
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
2126
- };
2127
- var mergeAndCloneIfArray = (obj) => {
2128
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
2129
- };
2130
- var cutArrayBeforeValue = (arr, value) => {
2131
- const index = arr.indexOf(value);
2132
- if (index !== -1) {
2133
- return arr.slice(0, index);
2767
+ });
2768
+ var require_log2 = __commonJS2({
2769
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports2, module22) {
2770
+ "use strict";
2771
+ var __defProp22 = Object.defineProperty;
2772
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2773
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2774
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2775
+ var __export22 = (target, all) => {
2776
+ for (var name in all)
2777
+ __defProp22(target, name, { get: all[name], enumerable: true });
2778
+ };
2779
+ var __copyProps22 = (to, from, except, desc) => {
2780
+ if (from && typeof from === "object" || typeof from === "function") {
2781
+ for (let key of __getOwnPropNames22(from))
2782
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2783
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2784
+ }
2785
+ return to;
2786
+ };
2787
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2788
+ var log_exports = {};
2789
+ __export22(log_exports, {
2790
+ logGroupIf: () => logGroupIf,
2791
+ logIf: () => logIf
2792
+ });
2793
+ module22.exports = __toCommonJS22(log_exports);
2794
+ var logIf = (bool, ...arg) => {
2795
+ if (bool)
2796
+ arg.map((v) => console.log(v));
2797
+ };
2798
+ var logGroupIf = (bool, key, ...arg) => {
2799
+ if (bool) {
2800
+ console.group(key);
2801
+ arg.map((v) => console.log(v));
2802
+ console.groupEnd(key);
2803
+ }
2804
+ };
2134
2805
  }
2135
- return arr;
2136
- };
2137
- var cutArrayAfterValue = (arr, value) => {
2138
- if (!(0, import_types.isArray)(arr))
2139
- return;
2140
- const index = arr.indexOf(value);
2141
- if (index !== -1) {
2142
- return arr.slice(index + 1);
2806
+ });
2807
+ var require_cookie2 = __commonJS2({
2808
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports2, module22) {
2809
+ "use strict";
2810
+ var __defProp22 = Object.defineProperty;
2811
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2812
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2813
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2814
+ var __export22 = (target, all) => {
2815
+ for (var name in all)
2816
+ __defProp22(target, name, { get: all[name], enumerable: true });
2817
+ };
2818
+ var __copyProps22 = (to, from, except, desc) => {
2819
+ if (from && typeof from === "object" || typeof from === "function") {
2820
+ for (let key of __getOwnPropNames22(from))
2821
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2822
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2823
+ }
2824
+ return to;
2825
+ };
2826
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2827
+ var cookie_exports = {};
2828
+ __export22(cookie_exports, {
2829
+ getCookie: () => getCookie,
2830
+ isMobile: () => isMobile,
2831
+ setCookie: () => setCookie
2832
+ });
2833
+ module22.exports = __toCommonJS22(cookie_exports);
2834
+ var import_types = require_types2();
2835
+ var import_utils32 = require_cjs4();
2836
+ var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
2837
+ var setCookie = (cname, cvalue, exdays = 365) => {
2838
+ if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
2839
+ return;
2840
+ const d = /* @__PURE__ */ new Date();
2841
+ d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
2842
+ const expires = `expires=${d.toUTCString()}`;
2843
+ import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
2844
+ };
2845
+ var getCookie = (cname) => {
2846
+ if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
2847
+ return;
2848
+ const name = `${cname}=`;
2849
+ const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
2850
+ const ca = decodedCookie.split(";");
2851
+ for (let i = 0; i < ca.length; i++) {
2852
+ let c = ca[i];
2853
+ while (c.charAt(0) === " ")
2854
+ c = c.substring(1);
2855
+ if (c.indexOf(name) === 0)
2856
+ return c.substring(name.length, c.length);
2857
+ }
2858
+ return "";
2859
+ };
2143
2860
  }
2144
- return arr;
2145
- };
2146
- var createNestedObject = (arr, lastValue) => {
2147
- const nestedObject = {};
2148
- if (arr.length === 0) {
2149
- return lastValue;
2861
+ });
2862
+ var require_tags2 = __commonJS2({
2863
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports2, module22) {
2864
+ "use strict";
2865
+ var __defProp22 = Object.defineProperty;
2866
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2867
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2868
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2869
+ var __export22 = (target, all) => {
2870
+ for (var name in all)
2871
+ __defProp22(target, name, { get: all[name], enumerable: true });
2872
+ };
2873
+ var __copyProps22 = (to, from, except, desc) => {
2874
+ if (from && typeof from === "object" || typeof from === "function") {
2875
+ for (let key of __getOwnPropNames22(from))
2876
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2877
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2878
+ }
2879
+ return to;
2880
+ };
2881
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2882
+ var tags_exports = {};
2883
+ __export22(tags_exports, {
2884
+ HTML_TAGS: () => HTML_TAGS,
2885
+ isValidHtmlTag: () => isValidHtmlTag
2886
+ });
2887
+ module22.exports = __toCommonJS22(tags_exports);
2888
+ var HTML_TAGS = {
2889
+ root: [
2890
+ "body",
2891
+ "html"
2892
+ ],
2893
+ head: [
2894
+ "title",
2895
+ "base",
2896
+ "meta",
2897
+ "style"
2898
+ ],
2899
+ body: [
2900
+ "string",
2901
+ "fragment",
2902
+ "a",
2903
+ "abbr",
2904
+ "acronym",
2905
+ "address",
2906
+ "applet",
2907
+ "area",
2908
+ "article",
2909
+ "aside",
2910
+ "audio",
2911
+ "b",
2912
+ "basefont",
2913
+ "bdi",
2914
+ "bdo",
2915
+ "big",
2916
+ "blockquote",
2917
+ "br",
2918
+ "button",
2919
+ "canvas",
2920
+ "caption",
2921
+ "center",
2922
+ "cite",
2923
+ "code",
2924
+ "search",
2925
+ "col",
2926
+ "colgroup",
2927
+ "data",
2928
+ "datalist",
2929
+ "dd",
2930
+ "del",
2931
+ "details",
2932
+ "dfn",
2933
+ "dialog",
2934
+ "dir",
2935
+ "div",
2936
+ "dl",
2937
+ "dt",
2938
+ "em",
2939
+ "embed",
2940
+ "fieldset",
2941
+ "figcaption",
2942
+ "figure",
2943
+ "font",
2944
+ "footer",
2945
+ "form",
2946
+ "frame",
2947
+ "frameset",
2948
+ "h1",
2949
+ "h2",
2950
+ "h3",
2951
+ "h4",
2952
+ "h5",
2953
+ "h6",
2954
+ "head",
2955
+ "header",
2956
+ "hr",
2957
+ "i",
2958
+ "iframe",
2959
+ "img",
2960
+ "input",
2961
+ "ins",
2962
+ "kbd",
2963
+ "label",
2964
+ "legend",
2965
+ "li",
2966
+ "link",
2967
+ "main",
2968
+ "map",
2969
+ "mark",
2970
+ "meter",
2971
+ "nav",
2972
+ "noframes",
2973
+ "noscript",
2974
+ "object",
2975
+ "ol",
2976
+ "optgroup",
2977
+ "option",
2978
+ "output",
2979
+ "p",
2980
+ "param",
2981
+ "picture",
2982
+ "pre",
2983
+ "progress",
2984
+ "hgroup",
2985
+ "q",
2986
+ "rp",
2987
+ "rt",
2988
+ "ruby",
2989
+ "s",
2990
+ "samp",
2991
+ "script",
2992
+ "section",
2993
+ "select",
2994
+ "small",
2995
+ "source",
2996
+ "span",
2997
+ "strike",
2998
+ "strong",
2999
+ "sub",
3000
+ "summary",
3001
+ "sup",
3002
+ "table",
3003
+ "tbody",
3004
+ "td",
3005
+ "template",
3006
+ "hgroup",
3007
+ "textarea",
3008
+ "tfoot",
3009
+ "th",
3010
+ "thead",
3011
+ "time",
3012
+ "tr",
3013
+ "track",
3014
+ "tt",
3015
+ "u",
3016
+ "ul",
3017
+ "var",
3018
+ "video",
3019
+ "wbr",
3020
+ // SVG
3021
+ "svg",
3022
+ "path"
3023
+ ]
3024
+ };
3025
+ var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
2150
3026
  }
2151
- arr.reduce((obj, value, index) => {
2152
- if (!obj[value]) {
2153
- obj[value] = {};
2154
- }
2155
- if (index === arr.length - 1 && lastValue) {
2156
- obj[value] = lastValue;
3027
+ });
3028
+ var require_cjs4 = __commonJS2({
3029
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports2, module22) {
3030
+ "use strict";
3031
+ var __defProp22 = Object.defineProperty;
3032
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3033
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
3034
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3035
+ var __copyProps22 = (to, from, except, desc) => {
3036
+ if (from && typeof from === "object" || typeof from === "function") {
3037
+ for (let key of __getOwnPropNames22(from))
3038
+ if (!__hasOwnProp22.call(to, key) && key !== except)
3039
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3040
+ }
3041
+ return to;
3042
+ };
3043
+ var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
3044
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3045
+ var utils_exports = {};
3046
+ module22.exports = __toCommonJS22(utils_exports);
3047
+ __reExport(utils_exports, require_key2(), module22.exports);
3048
+ __reExport(utils_exports, require_env2(), module22.exports);
3049
+ __reExport(utils_exports, require_types2(), module22.exports);
3050
+ __reExport(utils_exports, require_object2(), module22.exports);
3051
+ __reExport(utils_exports, require_function2(), module22.exports);
3052
+ __reExport(utils_exports, require_array2(), module22.exports);
3053
+ __reExport(utils_exports, require_node2(), module22.exports);
3054
+ __reExport(utils_exports, require_log2(), module22.exports);
3055
+ __reExport(utils_exports, require_string2(), module22.exports);
3056
+ __reExport(utils_exports, require_globals2(), module22.exports);
3057
+ __reExport(utils_exports, require_cookie2(), module22.exports);
3058
+ __reExport(utils_exports, require_tags2(), module22.exports);
3059
+ }
3060
+ });
3061
+ var src_exports = {};
3062
+ __export2(src_exports, {
3063
+ arrayzeValue: () => arrayzeValue,
3064
+ copyStringToClipboard: () => copyStringToClipboard,
3065
+ fibonacciNumberByIndex: () => fibonacciNumberByIndex,
3066
+ findClosestNumber: () => findClosestNumber,
3067
+ findClosestNumberInFactory: () => findClosestNumberInFactory,
3068
+ formatDate: () => formatDate,
3069
+ isPhoto: () => isPhoto,
3070
+ loadCssFile: () => loadCssFile,
3071
+ loadJavascript: () => loadJavascript,
3072
+ loadJavascriptFile: () => loadJavascriptFile,
3073
+ loadJavascriptFileSync: () => loadJavascriptFileSync,
3074
+ removeChars: () => removeChars,
3075
+ toCamelCase: () => toCamelCase,
3076
+ toDashCase: () => toDashCase2,
3077
+ toDescriptionCase: () => toDescriptionCase,
3078
+ toTitleCase: () => toTitleCase,
3079
+ toggleFullscreen: () => toggleFullscreen
3080
+ });
3081
+ module2.exports = __toCommonJS2(src_exports);
3082
+ var import_utils22 = __toESM2(require_cjs4(), 1);
3083
+ var toggleFullscreen = async (el) => {
3084
+ if (!document.fullscreenElement) {
3085
+ try {
3086
+ await (el.node || document).requestFullscreen();
3087
+ } catch (err) {
3088
+ console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
2157
3089
  }
2158
- return obj[value];
2159
- }, nestedObject);
2160
- return nestedObject;
2161
- };
2162
- var removeValueFromArray = (arr, value) => {
2163
- const index = arr.indexOf(value);
2164
- if (index > -1) {
2165
- const newArray = [...arr];
2166
- newArray.splice(index, 1);
2167
- return newArray;
3090
+ } else {
3091
+ await document.exitFullscreen();
2168
3092
  }
2169
- return arr;
2170
3093
  };
2171
- var removeValueFromArrayAll = (arr, value) => {
2172
- return arr.filter((item) => item !== value);
3094
+ var import_utils9 = __toESM2(require_cjs4(), 1);
3095
+ var findClosestNumber = (number, arr) => {
3096
+ return ((0, import_utils9.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
3097
+ return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
3098
+ });
2173
3099
  };
2174
- var addItemAfterEveryElement = (array, item) => {
2175
- const result = [];
2176
- for (let i = 0; i < array.length; i++) {
2177
- result.push(array[i]);
2178
- if (i < array.length - 1) {
2179
- result.push(item);
3100
+ var findClosestNumberInFactory = (val, factory) => {
3101
+ val = parseFloat(val);
3102
+ if ((0, import_utils9.isObject)(factory))
3103
+ factory = Object.values(factory);
3104
+ return findClosestNumber(val, factory);
3105
+ };
3106
+ var formatDate = (timestamp) => {
3107
+ if (!timestamp)
3108
+ return "";
3109
+ const d = new Date(timestamp);
3110
+ const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
3111
+ const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
3112
+ const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
3113
+ return `${da} ${mo}, ${ye}`;
3114
+ };
3115
+ var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
3116
+ const fib = [0, 1];
3117
+ for (let i = 2; i <= n; i++) {
3118
+ fib[i] = fib[i - 1] + fib[i - 2];
3119
+ }
3120
+ return fib[n];
3121
+ };
3122
+ var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3123
+ return new Promise((resolve, reject) => {
3124
+ try {
3125
+ const scriptEle = doc.createElement("script");
3126
+ scriptEle.type = type;
3127
+ scriptEle.async = async;
3128
+ scriptEle.src = FILE_URL;
3129
+ scriptEle.addEventListener("load", (ev) => {
3130
+ resolve({
3131
+ status: true
3132
+ });
3133
+ });
3134
+ scriptEle.addEventListener("error", (ev) => {
3135
+ reject(new Error({
3136
+ status: false,
3137
+ message: `Failed to load the script ${FILE_URL}`
3138
+ }));
3139
+ });
3140
+ doc.body.appendChild(scriptEle);
3141
+ } catch (error) {
3142
+ reject(error);
2180
3143
  }
2181
- }
2182
- return result;
3144
+ });
2183
3145
  };
2184
- var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
2185
- const newArray = [...array];
2186
- const indexToMove = newArray.indexOf(valueToMove);
2187
- const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
2188
- if (indexToMove !== -1 && indexToInsertBefore !== -1) {
2189
- const removedItem = newArray.splice(indexToMove, 1)[0];
2190
- const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
2191
- newArray.splice(insertIndex, 0, removedItem);
2192
- }
2193
- return newArray;
2194
- };
2195
- var arraysEqual = (arr1, arr2) => {
2196
- if (arr1.length !== arr2.length) {
2197
- return false;
2198
- }
2199
- for (let i = 0; i < arr1.length; i++) {
2200
- if (arr1[i] !== arr2[i]) {
2201
- return false;
2202
- }
2203
- }
2204
- return true;
2205
- };
2206
- }
2207
- });
2208
- var require_string2 = __commonJS2({
2209
- "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
2210
- "use strict";
2211
- var __defProp22 = Object.defineProperty;
2212
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2213
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2214
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2215
- var __export22 = (target, all) => {
2216
- for (var name in all)
2217
- __defProp22(target, name, { get: all[name], enumerable: true });
2218
- };
2219
- var __copyProps22 = (to, from, except, desc) => {
2220
- if (from && typeof from === "object" || typeof from === "function") {
2221
- for (let key of __getOwnPropNames22(from))
2222
- if (!__hasOwnProp22.call(to, key) && key !== except)
2223
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2224
- }
2225
- return to;
2226
- };
2227
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2228
- var string_exports = {};
2229
- __export22(string_exports, {
2230
- customDecodeURIComponent: () => customDecodeURIComponent,
2231
- customEncodeURIComponent: () => customEncodeURIComponent,
2232
- findKeyPosition: () => findKeyPosition,
2233
- lowercaseFirstLetter: () => lowercaseFirstLetter,
2234
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
2235
- replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
2236
- stringIncludesAny: () => stringIncludesAny,
2237
- trimStringFromSymbols: () => trimStringFromSymbols
2238
- });
2239
- module2.exports = __toCommonJS22(string_exports);
2240
- var stringIncludesAny = (str, characters) => {
2241
- for (const char of characters) {
2242
- if (str.includes(char)) {
2243
- return true;
2244
- }
2245
- }
2246
- return false;
2247
- };
2248
- var trimStringFromSymbols = (str, characters) => {
2249
- const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
2250
- return str.replace(pattern, "");
2251
- };
2252
- var brackRegex = {
2253
- 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
2254
- 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
2255
- };
2256
- var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
2257
- if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
2258
- return str;
2259
- const reg = brackRegex[options.bracketsLength || 2];
2260
- return str.replace(reg, (_, parentPath, variable) => {
2261
- if (parentPath) {
2262
- const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
2263
- let parentState = state;
2264
- for (let i = 0; i < parentLevels; i++) {
2265
- parentState = parentState.parent;
2266
- if (!parentState) {
2267
- return "";
2268
- }
2269
- }
2270
- const value = parentState[variable.trim()];
2271
- return value !== void 0 ? `${value}` : "";
2272
- } else {
2273
- const value = state[variable.trim()];
2274
- return value !== void 0 ? `${value}` : "";
2275
- }
2276
- });
2277
- };
2278
- var lowercaseFirstLetter = (inputString) => {
2279
- return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
2280
- };
2281
- var findKeyPosition = (str, key) => {
2282
- const lines = str.split("\n");
2283
- let startLineNumber = -1;
2284
- let endLineNumber = -1;
2285
- let startColumn = -1;
2286
- let endColumn = -1;
2287
- const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2288
- let braceCount = 0;
2289
- let foundKey = false;
2290
- for (let i = 0; i < lines.length; i++) {
2291
- if (keyPattern.test(lines[i]) && !foundKey) {
2292
- foundKey = true;
2293
- startLineNumber = i + 1;
2294
- startColumn = lines[i].indexOf(key) + 1;
2295
- if (lines[i].includes("{}")) {
2296
- endLineNumber = startLineNumber;
2297
- endColumn = lines[i].indexOf("{}") + 3;
2298
- break;
2299
- }
2300
- const line = lines[i].slice(startColumn + key.length);
2301
- if (line.includes("{") || line.includes("[")) {
2302
- braceCount = 1;
2303
- } else {
2304
- endLineNumber = i + 1;
2305
- endColumn = lines[i].length + 1;
2306
- break;
2307
- }
2308
- } else if (foundKey) {
2309
- braceCount += (lines[i].match(/{/g) || []).length;
2310
- braceCount += (lines[i].match(/\[/g) || []).length;
2311
- braceCount -= (lines[i].match(/}/g) || []).length;
2312
- braceCount -= (lines[i].match(/]/g) || []).length;
2313
- if (braceCount === 0) {
2314
- endLineNumber = i + 1;
2315
- endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2316
- break;
2317
- }
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);
2318
3175
  }
2319
- }
2320
- return {
2321
- startColumn,
2322
- endColumn,
2323
- startLineNumber,
2324
- endLineNumber
2325
- };
2326
- };
2327
- var replaceOctalEscapeSequences = (str) => {
2328
- const octalRegex = /\\([0-7]{1,3})/g;
2329
- return str.replace(octalRegex, (match, p1) => {
2330
- const octalValue = parseInt(p1, 8);
2331
- const char = String.fromCharCode(octalValue);
2332
- return char;
2333
3176
  });
2334
3177
  };
2335
- var customEncodeURIComponent = (str) => {
2336
- return str.split("").map((char) => {
2337
- if (/[^a-zA-Z0-9\s]/.test(char)) {
2338
- return "%" + char.charCodeAt(0).toString(16).toUpperCase();
2339
- }
2340
- return char;
2341
- }).join("");
2342
- };
2343
- var customDecodeURIComponent = (encodedStr) => {
2344
- return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
2345
- };
2346
- }
2347
- });
2348
- var require_object2 = __commonJS2({
2349
- "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
2350
- "use strict";
2351
- var __defProp22 = Object.defineProperty;
2352
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2353
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2354
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2355
- var __export22 = (target, all) => {
2356
- for (var name in all)
2357
- __defProp22(target, name, { get: all[name], enumerable: true });
2358
- };
2359
- var __copyProps22 = (to, from, except, desc) => {
2360
- if (from && typeof from === "object" || typeof from === "function") {
2361
- for (let key of __getOwnPropNames22(from))
2362
- if (!__hasOwnProp22.call(to, key) && key !== except)
2363
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2364
- }
2365
- return to;
2366
- };
2367
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2368
- var object_exports = {};
2369
- __export22(object_exports, {
2370
- checkIfKeyIsComponent: () => checkIfKeyIsComponent,
2371
- clone: () => clone,
2372
- createObjectWithoutPrototype: () => createObjectWithoutPrototype,
2373
- deepClone: () => deepClone2,
2374
- deepCloneExclude: () => deepCloneExclude,
2375
- deepCloneWithExtend: () => deepCloneWithExtend,
2376
- deepContains: () => deepContains,
2377
- deepDestringify: () => deepDestringify,
2378
- deepDiff: () => deepDiff,
2379
- deepMerge: () => deepMerge2,
2380
- deepStringify: () => deepStringify,
2381
- detachFunctionsFromObject: () => detachFunctionsFromObject,
2382
- diff: () => diff,
2383
- diffArrays: () => diffArrays,
2384
- diffObjects: () => diffObjects,
2385
- exec: () => exec,
2386
- flattenRecursive: () => flattenRecursive,
2387
- getChildrenComponentsByKey: () => getChildrenComponentsByKey,
2388
- getExtendsInElement: () => getExtendsInElement,
2389
- hasOwnProperty: () => hasOwnProperty,
2390
- isEmpty: () => isEmpty,
2391
- isEmptyObject: () => isEmptyObject,
2392
- isEqualDeep: () => isEqualDeep,
2393
- makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
2394
- map: () => map,
2395
- merge: () => merge2,
2396
- mergeArrayExclude: () => mergeArrayExclude,
2397
- mergeIfExisted: () => mergeIfExisted,
2398
- objectToString: () => objectToString,
2399
- overwrite: () => overwrite,
2400
- overwriteDeep: () => overwriteDeep,
2401
- overwriteShallow: () => overwriteShallow,
2402
- removeFromObject: () => removeFromObject,
2403
- stringToObject: () => stringToObject
2404
- });
2405
- module2.exports = __toCommonJS22(object_exports);
2406
- var import_globals2 = require_globals2();
2407
- var import_types = require_types2();
2408
- var import_array = require_array2();
2409
- var import_string = require_string2();
2410
- var exec = (param, element, state, context) => {
2411
- if ((0, import_types.isFunction)(param)) {
2412
- return param(
2413
- element,
2414
- state || element.state,
2415
- context || element.context
2416
- );
2417
- }
2418
- return param;
2419
- };
2420
- var map = (obj, extention, element) => {
2421
- for (const e in extention) {
2422
- obj[e] = exec(extention[e], element);
2423
- }
2424
- };
2425
- var merge2 = (element, obj, excludeFrom = []) => {
2426
- for (const e in obj) {
2427
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
2428
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2429
- continue;
2430
- const elementProp = element[e];
2431
- const objProp = obj[e];
2432
- if (elementProp === void 0) {
2433
- element[e] = objProp;
2434
- }
2435
- }
2436
- return element;
2437
- };
2438
- var deepMerge2 = (element, extend, excludeFrom = []) => {
2439
- for (const e in extend) {
2440
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
2441
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2442
- continue;
2443
- const elementProp = element[e];
2444
- const extendProp = extend[e];
2445
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
2446
- deepMerge2(elementProp, extendProp, excludeFrom);
2447
- } else if (elementProp === void 0) {
2448
- element[e] = extendProp;
2449
- }
2450
- }
2451
- return element;
2452
- };
2453
- var clone = (obj, excludeFrom = []) => {
2454
- const o = {};
2455
- for (const prop in obj) {
2456
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2457
- if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
2458
- continue;
2459
- o[prop] = obj[prop];
2460
- }
2461
- return o;
2462
- };
2463
- var deepCloneExclude = (obj, excludeFrom = []) => {
2464
- if ((0, import_types.isArray)(obj)) {
2465
- return obj.map((x) => deepCloneExclude(x, excludeFrom));
2466
- }
2467
- const o = {};
2468
- for (const k in obj) {
2469
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
2470
- if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
2471
- continue;
2472
- let v = obj[k];
2473
- if (k === "extend" && (0, import_types.isArray)(v)) {
2474
- v = mergeArrayExclude(v, excludeFrom);
2475
- }
2476
- if ((0, import_types.isArray)(v)) {
2477
- o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
2478
- } else if ((0, import_types.isObject)(v)) {
2479
- o[k] = deepCloneExclude(v, excludeFrom);
2480
- } else
2481
- o[k] = v;
2482
- }
2483
- return o;
2484
- };
2485
- var mergeArrayExclude = (arr, excl = []) => {
2486
- return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
2487
- };
2488
- var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
2489
- const o = (0, import_types.isArray)(obj) ? [] : {};
2490
- for (const prop in obj) {
2491
- if (!Object.prototype.hasOwnProperty.call(obj, prop))
2492
- continue;
2493
- if (prop === "__proto__")
2494
- continue;
2495
- if (excludeFrom.includes(prop) || prop.startsWith("__"))
2496
- continue;
2497
- let objProp = obj[prop];
2498
- if (cleanUndefined && (0, import_types.isUndefined)(objProp))
2499
- continue;
2500
- if (prop === "extend" && (0, import_types.isArray)(objProp)) {
2501
- objProp = (0, import_array.mergeArray)(objProp);
2502
- }
2503
- if ((0, import_types.isObjectLike)(objProp)) {
2504
- o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
2505
- } else
2506
- o[prop] = objProp;
2507
- }
2508
- return o;
2509
- };
2510
- var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
2511
- const o = (0, import_types.isArray)(obj) ? [] : {};
2512
- for (const prop in obj) {
2513
- if (!Object.prototype.hasOwnProperty.call(obj, prop))
2514
- continue;
2515
- const objProp = obj[prop];
2516
- if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
2517
- continue;
2518
- if ((0, import_types.isObjectLike)(objProp)) {
2519
- o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
2520
- } else
2521
- o[prop] = objProp;
2522
- }
2523
- return o;
2524
- };
2525
- var deepStringify = (obj, stringified = {}) => {
2526
- for (const prop in obj) {
2527
- const objProp = obj[prop];
2528
- if ((0, import_types.isFunction)(objProp)) {
2529
- stringified[prop] = objProp.toString();
2530
- } else if ((0, import_types.isObject)(objProp)) {
2531
- stringified[prop] = {};
2532
- deepStringify(objProp, stringified[prop]);
2533
- } else if ((0, import_types.isArray)(objProp)) {
2534
- stringified[prop] = [];
2535
- objProp.forEach((v, i) => {
2536
- if ((0, import_types.isObject)(v)) {
2537
- stringified[prop][i] = {};
2538
- deepStringify(v, stringified[prop][i]);
2539
- } else if ((0, import_types.isFunction)(v)) {
2540
- stringified[prop][i] = v.toString();
2541
- } else {
2542
- stringified[prop][i] = v;
2543
- }
2544
- });
2545
- } else {
2546
- stringified[prop] = objProp;
2547
- }
2548
- }
2549
- return stringified;
2550
- };
2551
- var objectToString = (obj = {}, indent = 0) => {
2552
- const spaces = " ".repeat(indent);
2553
- let str = "{\n";
2554
- for (const [key, value] of Object.entries(obj)) {
2555
- const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
2556
- const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
2557
- str += `${spaces} ${stringedKey}: `;
2558
- if ((0, import_types.isArray)(value)) {
2559
- str += "[\n";
2560
- for (const element of value) {
2561
- if ((0, import_types.isObject)(element) && element !== null) {
2562
- str += `${spaces} ${objectToString(element, indent + 2)},
2563
- `;
2564
- } else if ((0, import_types.isString)(element)) {
2565
- str += `${spaces} '${element}',
2566
- `;
2567
- } else {
2568
- str += `${spaces} ${element},
2569
- `;
2570
- }
2571
- }
2572
- str += `${spaces} ]`;
2573
- } else if ((0, import_types.isObjectLike)(value)) {
2574
- str += objectToString(value, indent + 1);
2575
- } else if ((0, import_types.isString)(value)) {
2576
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
2577
- } else {
2578
- str += value;
2579
- }
2580
- str += ",\n";
2581
- }
2582
- str += `${spaces}}`;
2583
- return str;
2584
- };
2585
- var detachFunctionsFromObject = (obj, detached = {}) => {
2586
- for (const prop in obj) {
2587
- const objProp = obj[prop];
2588
- if ((0, import_types.isFunction)(objProp))
2589
- continue;
2590
- else if ((0, import_types.isObject)(objProp)) {
2591
- detached[prop] = {};
2592
- deepStringify(objProp, detached[prop]);
2593
- } else if ((0, import_types.isArray)(objProp)) {
2594
- detached[prop] = [];
2595
- objProp.forEach((v, i) => {
2596
- if ((0, import_types.isFunction)(v))
2597
- return;
2598
- if ((0, import_types.isObject)(v)) {
2599
- detached[prop][i] = {};
2600
- detachFunctionsFromObject(v, detached[prop][i]);
2601
- } else {
2602
- detached[prop][i] = v;
2603
- }
2604
- });
2605
- } else {
2606
- detached[prop] = objProp;
2607
- }
2608
- }
2609
- return detached;
2610
- };
2611
- var deepDestringify = (obj, destringified = {}) => {
2612
- for (const prop in obj) {
2613
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2614
- if (!hasOwnProperty2)
2615
- continue;
2616
- const objProp = obj[prop];
2617
- if ((0, import_types.isString)(objProp)) {
2618
- if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2619
- try {
2620
- const evalProp = import_globals2.window.eval(`(${objProp})`);
2621
- destringified[prop] = evalProp;
2622
- } catch (e) {
2623
- if (e)
2624
- destringified[prop] = objProp;
2625
- }
2626
- } else {
2627
- destringified[prop] = objProp;
2628
- }
2629
- } else if ((0, import_types.isArray)(objProp)) {
2630
- destringified[prop] = [];
2631
- objProp.forEach((arrProp) => {
2632
- if ((0, import_types.isString)(arrProp)) {
2633
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
2634
- try {
2635
- const evalProp = import_globals2.window.eval(`(${arrProp})`);
2636
- destringified[prop].push(evalProp);
2637
- } catch (e) {
2638
- if (e)
2639
- destringified[prop].push(arrProp);
2640
- }
2641
- } else {
2642
- destringified[prop].push(arrProp);
2643
- }
2644
- } else if ((0, import_types.isObject)(arrProp)) {
2645
- destringified[prop].push(deepDestringify(arrProp));
2646
- } else {
2647
- destringified[prop].push(arrProp);
2648
- }
2649
- });
2650
- } else if ((0, import_types.isObject)(objProp)) {
2651
- destringified[prop] = deepDestringify(objProp, destringified[prop]);
2652
- } else {
2653
- destringified[prop] = objProp;
2654
- }
2655
- }
2656
- return destringified;
2657
- };
2658
- var stringToObject = (str, opts = { verbose: true }) => {
2659
- try {
2660
- return import_globals2.window.eval("(" + str + ")");
2661
- } catch (e) {
2662
- if (opts.verbose)
2663
- console.warn(e);
2664
- }
2665
- };
2666
- var diffObjects = (original, objToDiff, cache) => {
2667
- for (const e in objToDiff) {
2668
- if (e === "ref")
2669
- continue;
2670
- const originalProp = original[e];
2671
- const objToDiffProp = objToDiff[e];
2672
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
2673
- cache[e] = {};
2674
- diff(originalProp, objToDiffProp, cache[e]);
2675
- } else if (objToDiffProp !== void 0) {
2676
- cache[e] = objToDiffProp;
2677
- }
2678
- }
2679
- return cache;
2680
- };
2681
- var diffArrays = (original, objToDiff, cache) => {
2682
- if (original.length !== objToDiff.length) {
2683
- cache = objToDiff;
2684
- } else {
2685
- const diffArr = [];
2686
- for (let i = 0; i < original.length; i++) {
2687
- const diffObj = diff(original[i], objToDiff[i]);
2688
- if (Object.keys(diffObj).length > 0) {
2689
- diffArr.push(diffObj);
2690
- }
2691
- }
2692
- if (diffArr.length > 0) {
2693
- cache = diffArr;
2694
- }
2695
- }
2696
- return cache;
2697
- };
2698
- var diff = (original, objToDiff, cache = {}) => {
2699
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
2700
- cache = [];
2701
- diffArrays(original, objToDiff, cache);
2702
- } else {
2703
- diffObjects(original, objToDiff, cache);
2704
- }
2705
- return cache;
2706
- };
2707
- var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
2708
- var isEmpty = (o) => Object.keys(o).length === 0;
2709
- var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
2710
- var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
2711
- var deepDiff = (lhs, rhs) => {
2712
- if (lhs === rhs)
2713
- return {};
2714
- if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
2715
- return rhs;
2716
- const deletedValues = Object.keys(lhs).reduce((acc, key) => {
2717
- if (!hasOwnProperty(rhs, key)) {
2718
- acc[key] = void 0;
2719
- }
2720
- return acc;
2721
- }, makeObjectWithoutPrototype());
2722
- if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
2723
- if (lhs.valueOf() === rhs.valueOf())
2724
- return {};
2725
- return rhs;
2726
- }
2727
- return Object.keys(rhs).reduce((acc, key) => {
2728
- if (!hasOwnProperty(lhs, key)) {
2729
- acc[key] = rhs[key];
2730
- return acc;
2731
- }
2732
- const difference = diff(lhs[key], rhs[key]);
2733
- if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
2734
- return acc;
2735
- }
2736
- acc[key] = difference;
2737
- return acc;
2738
- }, deletedValues);
2739
- };
2740
- var overwrite = (element, params, excludeFrom = []) => {
2741
- const { ref } = element;
2742
- const changes = {};
2743
- for (const e in params) {
2744
- if (excludeFrom.includes(e) || e.startsWith("__"))
2745
- continue;
2746
- const elementProp = element[e];
2747
- const paramsProp = params[e];
2748
- if (paramsProp) {
2749
- ref.__cache[e] = changes[e] = elementProp;
2750
- ref[e] = paramsProp;
2751
- }
2752
- }
2753
- return changes;
2754
- };
2755
- var overwriteShallow = (obj, params, excludeFrom = []) => {
2756
- for (const e in params) {
2757
- if (excludeFrom.includes(e) || e.startsWith("__"))
2758
- continue;
2759
- obj[e] = params[e];
2760
- }
2761
- return obj;
2762
- };
2763
- var overwriteDeep = (obj, params, excludeFrom = []) => {
2764
- for (const e in params) {
2765
- if (e === "__proto__")
2766
- continue;
2767
- if (excludeFrom.includes(e) || e.startsWith("__"))
2768
- continue;
2769
- const objProp = obj[e];
2770
- const paramsProp = params[e];
2771
- if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
2772
- overwriteDeep(objProp, paramsProp);
2773
- } else if (paramsProp !== void 0) {
2774
- obj[e] = paramsProp;
2775
- }
2776
- }
2777
- return obj;
2778
- };
2779
- var mergeIfExisted = (a, b) => {
2780
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
2781
- return deepMerge2(a, b);
2782
- return a || b;
2783
- };
2784
- var flattenRecursive = (param, prop, stack = []) => {
2785
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
2786
- stack.push(objectized);
2787
- const extendOfExtend = objectized[prop];
2788
- if (extendOfExtend)
2789
- flattenRecursive(extendOfExtend, prop, stack);
2790
- delete objectized[prop];
2791
- return stack;
2792
- };
2793
- var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
2794
- if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
2795
- return param === element;
2796
- }
2797
- if (visited.has(param) || visited.has(element)) {
2798
- return true;
2799
- }
2800
- visited.add(param);
2801
- visited.add(element);
2802
- const keysParam = Object.keys(param);
2803
- const keysElement = Object.keys(element);
2804
- if (keysParam.length !== keysElement.length) {
2805
- return false;
2806
- }
2807
- for (const key of keysParam) {
2808
- if (!keysElement.includes(key)) {
2809
- return false;
2810
- }
2811
- const paramProp = param[key];
2812
- const elementProp = element[key];
2813
- if (!isEqualDeep(paramProp, elementProp, visited)) {
2814
- return false;
2815
- }
2816
- }
2817
- return true;
2818
- };
2819
- var deepContains = (obj1, obj2) => {
2820
- if (typeof obj1 !== typeof obj2) {
2821
- return false;
2822
- }
2823
- if ((0, import_types.isObjectLike)(obj1)) {
2824
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
2825
- if (obj1.length !== obj2.length) {
2826
- return false;
2827
- }
2828
- for (let i = 0; i < obj1.length; i++) {
2829
- if (!deepContains(obj1[i], obj2[i])) {
2830
- return false;
2831
- }
2832
- }
2833
- } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
2834
- for (const key in obj1) {
2835
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
2836
- if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
2837
- return false;
2838
- }
2839
- }
2840
- }
2841
- } else {
2842
- return obj2 === obj1;
2843
- }
2844
- return true;
2845
- };
2846
- var removeFromObject = (obj, props) => {
2847
- if (props === void 0 || props === null)
2848
- return obj;
2849
- if ((0, import_types.is)(props)("string", "number")) {
2850
- delete obj[props];
2851
- } else if ((0, import_types.isArray)(props)) {
2852
- props.forEach((prop) => delete obj[prop]);
2853
- } else {
2854
- throw new Error("Invalid input: props must be a string or an array of strings");
2855
- }
2856
- return obj;
2857
- };
2858
- var createObjectWithoutPrototype = (obj) => {
2859
- if (obj === null || typeof obj !== "object") {
2860
- return obj;
2861
- }
2862
- const newObj = /* @__PURE__ */ Object.create(null);
2863
- for (const key in obj) {
2864
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
2865
- newObj[key] = createObjectWithoutPrototype(obj[key]);
2866
- }
2867
- }
2868
- return newObj;
2869
- };
2870
- var checkIfKeyIsComponent = (key) => {
2871
- const isFirstKeyString = (0, import_types.isString)(key);
2872
- if (!isFirstKeyString)
2873
- return;
2874
- const firstCharKey = key.slice(0, 1);
2875
- return /^[A-Z]*$/.test(firstCharKey);
2876
- };
2877
- var getChildrenComponentsByKey = (key, el) => {
2878
- if (key === el.key || el.__ref.__componentKey === key) {
2879
- return el;
2880
- }
2881
- if (el.extend) {
2882
- const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
2883
- const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
2884
- if (foundString || foundInArray)
2885
- return el;
2886
- }
2887
- };
2888
- var getExtendsInElement = (obj) => {
2889
- let result = [];
2890
- function traverse(o) {
2891
- for (const key in o) {
2892
- if (Object.hasOwnProperty.call(o, key)) {
2893
- if (checkIfKeyIsComponent(key)) {
2894
- result.push(key);
2895
- }
2896
- if (key === "extend") {
2897
- if (typeof o[key] === "string") {
2898
- result.push(o[key]);
2899
- } else if (Array.isArray(o[key])) {
2900
- result = result.concat(o[key]);
2901
- }
2902
- }
2903
- if (typeof o[key] === "object" && o[key] !== null) {
2904
- traverse(o[key]);
2905
- }
2906
- }
2907
- }
2908
- }
2909
- traverse(obj);
2910
- return result;
2911
- };
2912
- }
2913
- });
2914
- var require_function2 = __commonJS2({
2915
- "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
2916
- "use strict";
2917
- var __defProp22 = Object.defineProperty;
2918
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2919
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2920
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2921
- var __export22 = (target, all) => {
2922
- for (var name in all)
2923
- __defProp22(target, name, { get: all[name], enumerable: true });
2924
- };
2925
- var __copyProps22 = (to, from, except, desc) => {
2926
- if (from && typeof from === "object" || typeof from === "function") {
2927
- for (let key of __getOwnPropNames22(from))
2928
- if (!__hasOwnProp22.call(to, key) && key !== except)
2929
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2930
- }
2931
- return to;
2932
- };
2933
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2934
- var function_exports = {};
2935
- __export22(function_exports, {
2936
- debounce: () => debounce,
2937
- debounceOnContext: () => debounceOnContext,
2938
- isStringFunction: () => isStringFunction,
2939
- memoize: () => memoize
2940
- });
2941
- module2.exports = __toCommonJS22(function_exports);
2942
- function debounce(func, wait, immediate) {
2943
- let timeout;
2944
- return function() {
2945
- const context = this;
2946
- const args = arguments;
2947
- const later = function() {
2948
- timeout = null;
2949
- if (!immediate)
2950
- func.apply(context, args);
2951
- };
2952
- const callNow = immediate && !timeout;
2953
- clearTimeout(timeout);
2954
- timeout = setTimeout(later, wait);
2955
- if (callNow)
2956
- func.apply(context, args);
2957
- };
2958
- }
2959
- var debounceOnContext = (element, func, timeout = 300) => {
2960
- let timer;
2961
- return (...args) => {
2962
- clearTimeout(timer);
2963
- timer = setTimeout(() => {
2964
- func.apply(element, args);
2965
- }, timeout);
2966
- };
2967
- };
2968
- var memoize = (fn) => {
2969
- const cache = {};
2970
- return (...args) => {
2971
- const n = args[0];
2972
- if (n in cache) {
2973
- return cache[n];
2974
- } else {
2975
- const result = fn(n);
2976
- cache[n] = result;
2977
- return result;
2978
- }
2979
- };
2980
- };
2981
- var isStringFunction = (inputString) => {
2982
- const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
2983
- return functionRegex.test(inputString);
2984
- };
2985
- }
2986
- });
2987
- var require_log2 = __commonJS2({
2988
- "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
2989
- "use strict";
2990
- var __defProp22 = Object.defineProperty;
2991
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2992
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2993
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2994
- var __export22 = (target, all) => {
2995
- for (var name in all)
2996
- __defProp22(target, name, { get: all[name], enumerable: true });
2997
- };
2998
- var __copyProps22 = (to, from, except, desc) => {
2999
- if (from && typeof from === "object" || typeof from === "function") {
3000
- for (let key of __getOwnPropNames22(from))
3001
- if (!__hasOwnProp22.call(to, key) && key !== except)
3002
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3003
- }
3004
- return to;
3005
- };
3006
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3007
- var log_exports = {};
3008
- __export22(log_exports, {
3009
- logGroupIf: () => logGroupIf,
3010
- logIf: () => logIf
3011
- });
3012
- module2.exports = __toCommonJS22(log_exports);
3013
- var logIf = (bool, ...arg) => {
3014
- if (bool)
3015
- arg.map((v) => console.log(v));
3016
- };
3017
- var logGroupIf = (bool, key, ...arg) => {
3018
- if (bool) {
3019
- console.group(key);
3020
- arg.map((v) => console.log(v));
3021
- console.groupEnd(key);
3022
- }
3023
- };
3024
- }
3025
- });
3026
- var require_cookie2 = __commonJS2({
3027
- "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
3028
- "use strict";
3029
- var __defProp22 = Object.defineProperty;
3030
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3031
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3032
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3033
- var __export22 = (target, all) => {
3034
- for (var name in all)
3035
- __defProp22(target, name, { get: all[name], enumerable: true });
3036
- };
3037
- var __copyProps22 = (to, from, except, desc) => {
3038
- if (from && typeof from === "object" || typeof from === "function") {
3039
- for (let key of __getOwnPropNames22(from))
3040
- if (!__hasOwnProp22.call(to, key) && key !== except)
3041
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3042
- }
3043
- return to;
3044
- };
3045
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3046
- var cookie_exports = {};
3047
- __export22(cookie_exports, {
3048
- getCookie: () => getCookie,
3049
- isMobile: () => isMobile,
3050
- setCookie: () => setCookie
3051
- });
3052
- module2.exports = __toCommonJS22(cookie_exports);
3053
- var import_types = require_types2();
3054
- var import_utils32 = require_cjs3();
3055
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
3056
- var setCookie = (cname, cvalue, exdays = 365) => {
3057
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3058
- return;
3059
- const d = /* @__PURE__ */ new Date();
3060
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
3061
- const expires = `expires=${d.toUTCString()}`;
3062
- import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
3063
- };
3064
- var getCookie = (cname) => {
3065
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3066
- return;
3067
- const name = `${cname}=`;
3068
- const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
3069
- const ca = decodedCookie.split(";");
3070
- for (let i = 0; i < ca.length; i++) {
3071
- let c = ca[i];
3072
- while (c.charAt(0) === " ")
3073
- c = c.substring(1);
3074
- if (c.indexOf(name) === 0)
3075
- return c.substring(name.length, c.length);
3076
- }
3077
- return "";
3078
- };
3079
- }
3080
- });
3081
- var require_tags2 = __commonJS2({
3082
- "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
3083
- "use strict";
3084
- var __defProp22 = Object.defineProperty;
3085
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3086
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3087
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3088
- var __export22 = (target, all) => {
3089
- for (var name in all)
3090
- __defProp22(target, name, { get: all[name], enumerable: true });
3091
- };
3092
- var __copyProps22 = (to, from, except, desc) => {
3093
- if (from && typeof from === "object" || typeof from === "function") {
3094
- for (let key of __getOwnPropNames22(from))
3095
- if (!__hasOwnProp22.call(to, key) && key !== except)
3096
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3097
- }
3098
- return to;
3099
- };
3100
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3101
- var tags_exports = {};
3102
- __export22(tags_exports, {
3103
- HTML_TAGS: () => HTML_TAGS,
3104
- isValidHtmlTag: () => isValidHtmlTag
3105
- });
3106
- module2.exports = __toCommonJS22(tags_exports);
3107
- var HTML_TAGS = {
3108
- root: [
3109
- "body",
3110
- "html"
3111
- ],
3112
- head: [
3113
- "title",
3114
- "base",
3115
- "meta",
3116
- "style"
3117
- ],
3118
- body: [
3119
- "string",
3120
- "fragment",
3121
- "a",
3122
- "abbr",
3123
- "acronym",
3124
- "address",
3125
- "applet",
3126
- "area",
3127
- "article",
3128
- "aside",
3129
- "audio",
3130
- "b",
3131
- "basefont",
3132
- "bdi",
3133
- "bdo",
3134
- "big",
3135
- "blockquote",
3136
- "br",
3137
- "button",
3138
- "canvas",
3139
- "caption",
3140
- "center",
3141
- "cite",
3142
- "code",
3143
- "search",
3144
- "col",
3145
- "colgroup",
3146
- "data",
3147
- "datalist",
3148
- "dd",
3149
- "del",
3150
- "details",
3151
- "dfn",
3152
- "dialog",
3153
- "dir",
3154
- "div",
3155
- "dl",
3156
- "dt",
3157
- "em",
3158
- "embed",
3159
- "fieldset",
3160
- "figcaption",
3161
- "figure",
3162
- "font",
3163
- "footer",
3164
- "form",
3165
- "frame",
3166
- "frameset",
3167
- "h1",
3168
- "h2",
3169
- "h3",
3170
- "h4",
3171
- "h5",
3172
- "h6",
3173
- "head",
3174
- "header",
3175
- "hr",
3176
- "i",
3177
- "iframe",
3178
- "img",
3179
- "input",
3180
- "ins",
3181
- "kbd",
3182
- "label",
3183
- "legend",
3184
- "li",
3185
- "link",
3186
- "main",
3187
- "map",
3188
- "mark",
3189
- "meter",
3190
- "nav",
3191
- "noframes",
3192
- "noscript",
3193
- "object",
3194
- "ol",
3195
- "optgroup",
3196
- "option",
3197
- "output",
3198
- "p",
3199
- "param",
3200
- "picture",
3201
- "pre",
3202
- "progress",
3203
- "hgroup",
3204
- "q",
3205
- "rp",
3206
- "rt",
3207
- "ruby",
3208
- "s",
3209
- "samp",
3210
- "script",
3211
- "section",
3212
- "select",
3213
- "small",
3214
- "source",
3215
- "span",
3216
- "strike",
3217
- "strong",
3218
- "sub",
3219
- "summary",
3220
- "sup",
3221
- "table",
3222
- "tbody",
3223
- "td",
3224
- "template",
3225
- "hgroup",
3226
- "textarea",
3227
- "tfoot",
3228
- "th",
3229
- "thead",
3230
- "time",
3231
- "tr",
3232
- "track",
3233
- "tt",
3234
- "u",
3235
- "ul",
3236
- "var",
3237
- "video",
3238
- "wbr",
3239
- // SVG
3240
- "svg",
3241
- "path"
3242
- ]
3178
+ var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
3179
+ try {
3180
+ const scriptEle = doc.createElement("script");
3181
+ scriptEle.type = type;
3182
+ scriptEle.async = async;
3183
+ scriptEle.id = id;
3184
+ scriptEle.innerHTML = body;
3185
+ doc.body.appendChild(scriptEle);
3186
+ } catch (error) {
3187
+ console.warn(error);
3188
+ }
3189
+ };
3190
+ var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
3191
+ var copyStringToClipboard = (str) => {
3192
+ const el = document.createElement("textarea");
3193
+ el.value = str;
3194
+ el.setAttribute("readonly", "");
3195
+ el.style = { position: "absolute", left: "-9999px" };
3196
+ document.body.appendChild(el);
3197
+ el.select();
3198
+ document.execCommand("copy");
3199
+ document.body.removeChild(el);
3200
+ };
3201
+ var removeChars = (str) => {
3202
+ return str.replace(/[^a-zA-Z0-9_]/g, "");
3203
+ };
3204
+ var toCamelCase = (str) => {
3205
+ return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
3206
+ return index === 0 ? word.toLowerCase() : word.toUpperCase();
3207
+ }).replaceAll(/\s+/g, "");
3208
+ };
3209
+ var toTitleCase = (str) => str && str.replace(
3210
+ /\w\S*/g,
3211
+ (txt) => {
3212
+ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
3213
+ }
3214
+ );
3215
+ var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
3216
+ var toDescriptionCase = (str = "") => {
3217
+ if (typeof str !== "string")
3218
+ return;
3219
+ const result = str.replace(/([A-Z])/g, " $1");
3220
+ return result.charAt(0).toUpperCase() + result.slice(1);
3221
+ };
3222
+ var arrayzeValue = (val) => {
3223
+ if ((0, import_utils22.isArray)(val))
3224
+ return val;
3225
+ if ((0, import_utils22.isString)(val))
3226
+ return val.split(" ");
3227
+ if ((0, import_utils22.isObject)(val))
3228
+ return Object.values(val);
3229
+ if ((0, import_utils22.isNumber)(val))
3230
+ return [val];
3243
3231
  };
3244
- var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
3245
3232
  }
3246
3233
  });
3247
- var require_cjs3 = __commonJS2({
3248
- "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
3249
- "use strict";
3250
- var __defProp22 = Object.defineProperty;
3251
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3252
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3253
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3254
- var __copyProps22 = (to, from, except, desc) => {
3255
- if (from && typeof from === "object" || typeof from === "function") {
3256
- for (let key of __getOwnPropNames22(from))
3257
- if (!__hasOwnProp22.call(to, key) && key !== except)
3258
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3259
- }
3260
- return to;
3261
- };
3262
- var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
3263
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3264
- var utils_exports = {};
3265
- module2.exports = __toCommonJS22(utils_exports);
3266
- __reExport(utils_exports, require_key2(), module2.exports);
3267
- __reExport(utils_exports, require_env2(), module2.exports);
3268
- __reExport(utils_exports, require_types2(), module2.exports);
3269
- __reExport(utils_exports, require_object2(), module2.exports);
3270
- __reExport(utils_exports, require_function2(), module2.exports);
3271
- __reExport(utils_exports, require_array2(), module2.exports);
3272
- __reExport(utils_exports, require_node2(), module2.exports);
3273
- __reExport(utils_exports, require_log2(), module2.exports);
3274
- __reExport(utils_exports, require_string2(), module2.exports);
3275
- __reExport(utils_exports, require_globals2(), module2.exports);
3276
- __reExport(utils_exports, require_cookie2(), module2.exports);
3277
- __reExport(utils_exports, require_tags2(), module2.exports);
3278
- }
3234
+
3235
+ // src/system/document.js
3236
+ var document_exports = {};
3237
+ __export(document_exports, {
3238
+ applyDocument: () => applyDocument
3279
3239
  });
3280
- var src_exports = {};
3281
- __export2(src_exports, {
3282
- arrayzeValue: () => arrayzeValue,
3283
- copyStringToClipboard: () => copyStringToClipboard,
3284
- fibonacciNumberByIndex: () => fibonacciNumberByIndex,
3285
- findClosestNumber: () => findClosestNumber,
3286
- findClosestNumberInFactory: () => findClosestNumberInFactory,
3287
- formatDate: () => formatDate,
3288
- isPhoto: () => isPhoto,
3289
- loadCssFile: () => loadCssFile,
3290
- loadJavascript: () => loadJavascript,
3291
- loadJavascriptFile: () => loadJavascriptFile,
3292
- removeChars: () => removeChars,
3293
- toCamelCase: () => toCamelCase,
3294
- toDashCase: () => toDashCase,
3295
- toDescriptionCase: () => toDescriptionCase,
3296
- toTitleCase: () => toTitleCase,
3297
- toggleFullscreen: () => toggleFullscreen
3240
+ module.exports = __toCommonJS(document_exports);
3241
+ var import_utils7 = __toESM(require_cjs(), 1);
3242
+
3243
+ // src/factory.js
3244
+ var import_utils = __toESM(require_cjs(), 1);
3245
+
3246
+ // src/defaultConfig/index.js
3247
+ var defaultConfig_exports = {};
3248
+ __export(defaultConfig_exports, {
3249
+ ANIMATION: () => ANIMATION,
3250
+ BREAKPOINTS: () => BREAKPOINTS,
3251
+ CASES: () => CASES,
3252
+ COLOR: () => COLOR,
3253
+ DEVICES: () => DEVICES,
3254
+ DOCUMENT: () => DOCUMENT,
3255
+ FONT: () => FONT,
3256
+ FONT_FACE: () => FONT_FACE,
3257
+ FONT_FAMILY: () => FONT_FAMILY,
3258
+ FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
3259
+ GRADIENT: () => GRADIENT,
3260
+ GRID: () => GRID,
3261
+ ICONS: () => ICONS,
3262
+ MEDIA: () => MEDIA,
3263
+ RESET: () => RESET,
3264
+ SEMANTIC_ICONS: () => SEMANTIC_ICONS,
3265
+ SEQUENCE: () => SEQUENCE,
3266
+ SHADOW: () => SHADOW,
3267
+ SPACING: () => SPACING,
3268
+ SVG: () => SVG,
3269
+ SVG_DATA: () => SVG_DATA,
3270
+ TEMPLATES: () => TEMPLATES,
3271
+ THEME: () => THEME,
3272
+ TIMING: () => TIMING,
3273
+ TYPOGRAPHY: () => TYPOGRAPHY,
3274
+ UNIT: () => UNIT
3298
3275
  });
3299
- module.exports = __toCommonJS2(src_exports);
3300
- var import_utils22 = __toESM2(require_cjs3(), 1);
3301
- var toggleFullscreen = (el) => {
3302
- if (!document.fullscreenElement) {
3303
- el.node.requestFullscreen().catch((err) => {
3304
- console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
3305
- });
3306
- } else {
3307
- document.exitFullscreen();
3308
- }
3276
+
3277
+ // src/defaultConfig/sequence.js
3278
+ var SEQUENCE = {
3279
+ "minor-second": 1.067,
3280
+ "major-second": 1.125,
3281
+ "minor-third": 1.2,
3282
+ "major-third": 1.25,
3283
+ "perfect-fourth": 1.333,
3284
+ "augmented-fourth": 1.414,
3285
+ "perfect-fifth": 1.5,
3286
+ "minor-sixth": 1.6,
3287
+ phi: 1.618,
3288
+ // golden-ratio
3289
+ "major-sixth": 1.667,
3290
+ "square-root-3": 1.732,
3291
+ // theodorus
3292
+ "minor-seventh": 1.778,
3293
+ "major-seventh": 1.875,
3294
+ octave: 2,
3295
+ "square-root-5": 2.23,
3296
+ // pythagoras
3297
+ "major-tenth": 2.5,
3298
+ "major-eleventh": 2.667,
3299
+ "major-twelfth": 3,
3300
+ pi: 3.14,
3301
+ // archimedes
3302
+ "double-octave": 4
3309
3303
  };
3310
- var import_utils3 = __toESM2(require_cjs3(), 1);
3311
- var findClosestNumber = (number, arr) => {
3312
- return ((0, import_utils3.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
3313
- return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
3314
- });
3304
+
3305
+ // src/defaultConfig/unit.js
3306
+ var UNIT = {
3307
+ default: "em"
3315
3308
  };
3316
- var findClosestNumberInFactory = (val, factory) => {
3317
- val = parseFloat(val);
3318
- if ((0, import_utils3.isObject)(factory))
3319
- factory = Object.values(factory);
3320
- return findClosestNumber(val, factory);
3309
+
3310
+ // src/defaultConfig/typography.js
3311
+ var defaultProps = {
3312
+ browserDefault: 16,
3313
+ base: 16,
3314
+ type: "font-size",
3315
+ ratio: SEQUENCE["minor-third"],
3316
+ range: [-3, 12],
3317
+ h1Matches: 6,
3318
+ lineHeight: 1.5,
3319
+ subSequence: true,
3320
+ mediaRegenerate: false,
3321
+ unit: "em",
3322
+ templates: {},
3323
+ sequence: {},
3324
+ scales: {},
3325
+ vars: {}
3321
3326
  };
3322
- var formatDate = (timestamp) => {
3323
- if (!timestamp)
3324
- return "";
3325
- const d = new Date(timestamp);
3326
- const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
3327
- const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
3328
- const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
3329
- return `${da} ${mo}, ${ye}`;
3327
+ var TYPOGRAPHY = defaultProps;
3328
+
3329
+ // src/defaultConfig/font.js
3330
+ var FONT = {};
3331
+
3332
+ // src/defaultConfig/font-family.js
3333
+ var FONT_FAMILY = {};
3334
+ var FONT_FAMILY_TYPES = {
3335
+ "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
3336
+ serif: "Times New Roman, Georgia, serif, --system-default",
3337
+ monospace: "Courier New, monospace, --system-default"
3330
3338
  };
3331
- var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
3332
- const fib = [0, 1];
3333
- for (let i = 2; i <= n; i++) {
3334
- fib[i] = fib[i - 1] + fib[i - 2];
3335
- }
3336
- return fib[n];
3339
+ var FONT_FACE = {};
3340
+
3341
+ // src/defaultConfig/media.js
3342
+ var MEDIA = {
3343
+ tv: "(min-width: 2780px)",
3344
+ light: "(prefers-color-scheme: light)",
3345
+ dark: "(prefers-color-scheme: dark)",
3346
+ print: "print"
3337
3347
  };
3338
- var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3339
- return new Promise((resolve, reject) => {
3340
- try {
3341
- const scriptEle = doc.createElement("script");
3342
- scriptEle.type = type;
3343
- scriptEle.async = async;
3344
- scriptEle.src = FILE_URL;
3345
- scriptEle.addEventListener("load", (ev) => {
3346
- resolve({
3347
- status: true
3348
- });
3349
- });
3350
- scriptEle.addEventListener("error", (ev) => {
3351
- reject({
3352
- status: false,
3353
- message: `Failed to load the script ${FILE_URL}`
3354
- });
3355
- });
3356
- doc.body.appendChild(scriptEle);
3357
- } catch (error) {
3358
- reject(error);
3359
- }
3360
- });
3348
+
3349
+ // src/defaultConfig/spacing.js
3350
+ var defaultProps2 = {
3351
+ base: TYPOGRAPHY.base,
3352
+ type: "spacing",
3353
+ ratio: SEQUENCE.phi,
3354
+ range: [-5, 15],
3355
+ subSequence: true,
3356
+ mediaRegenerate: false,
3357
+ unit: "em",
3358
+ sequence: {},
3359
+ scales: {},
3360
+ vars: {}
3361
3361
  };
3362
- var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3363
- return new Promise((resolve, reject) => {
3364
- try {
3365
- const linkElem = doc.createElement("link");
3366
- linkElem.rel = "stylesheet";
3367
- linkElem.href = FILE_URL;
3368
- linkElem.addEventListener("load", (ev) => {
3369
- resolve({
3370
- status: true
3371
- });
3372
- });
3373
- doc.head.appendChild(linkElem);
3374
- } catch (error) {
3375
- reject(error);
3376
- }
3377
- });
3362
+ var SPACING = defaultProps2;
3363
+
3364
+ // src/defaultConfig/color.js
3365
+ var COLOR = {};
3366
+ var GRADIENT = {};
3367
+
3368
+ // src/defaultConfig/theme.js
3369
+ var THEME = {};
3370
+
3371
+ // src/defaultConfig/shadow.js
3372
+ var SHADOW = {};
3373
+
3374
+ // src/defaultConfig/icons.js
3375
+ var ICONS = {};
3376
+ var SEMANTIC_ICONS = {};
3377
+
3378
+ // src/defaultConfig/timing.js
3379
+ var defaultProps3 = {
3380
+ default: 150,
3381
+ base: 150,
3382
+ type: "timing",
3383
+ ratio: SEQUENCE["perfect-fourth"],
3384
+ range: [-3, 12],
3385
+ mediaRegenerate: false,
3386
+ unit: "ms",
3387
+ sequence: {},
3388
+ scales: {},
3389
+ vars: {}
3378
3390
  };
3379
- var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
3380
- try {
3381
- const scriptEle = doc.createElement("script");
3382
- scriptEle.type = type;
3383
- scriptEle.async = async;
3384
- scriptEle.id = id;
3385
- scriptEle.innerHTML = body;
3386
- doc.body.appendChild(scriptEle);
3387
- } catch (error) {
3388
- console.warn(error);
3389
- }
3391
+ var TIMING = defaultProps3;
3392
+
3393
+ // src/defaultConfig/document.js
3394
+ var DOCUMENT = {};
3395
+
3396
+ // src/defaultConfig/responsive.js
3397
+ var BREAKPOINTS = {
3398
+ screenL: 1920,
3399
+ screenM: 1680,
3400
+ screenS: 1440,
3401
+ tabletL: 1366,
3402
+ tabletM: 1280,
3403
+ tabletS: 1024,
3404
+ mobileL: 768,
3405
+ mobileM: 560,
3406
+ mobileS: 480,
3407
+ mobileXS: 375
3390
3408
  };
3391
- var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
3392
- var copyStringToClipboard = (str) => {
3393
- const el = document.createElement("textarea");
3394
- el.value = str;
3395
- el.setAttribute("readonly", "");
3396
- el.style = { position: "absolute", left: "-9999px" };
3397
- document.body.appendChild(el);
3398
- el.select();
3399
- document.execCommand("copy");
3400
- document.body.removeChild(el);
3409
+ var DEVICES = {
3410
+ screenL: [1920, 1024],
3411
+ screenM: [1680, 1024],
3412
+ screenS: [1440, 978],
3413
+ tabletL: [1366, 926],
3414
+ tabletM: [1280, 768],
3415
+ tabletS: [1024, 768],
3416
+ mobileL: [768, 375],
3417
+ mobileM: [560, 768],
3418
+ mobileS: [480, 768],
3419
+ mobileXS: [375, 768]
3401
3420
  };
3402
- var removeChars = (str) => {
3403
- return str.replace(/[^a-zA-Z0-9_]/g, "");
3421
+
3422
+ // src/defaultConfig/cases.js
3423
+ var CASES = {};
3424
+
3425
+ // src/defaultConfig/animation.js
3426
+ var ANIMATION = {};
3427
+
3428
+ // src/defaultConfig/svg.js
3429
+ var SVG = {};
3430
+ var SVG_DATA = {};
3431
+
3432
+ // src/defaultConfig/templates.js
3433
+ var TEMPLATES = {};
3434
+
3435
+ // src/defaultConfig/grid.js
3436
+ var defaultProps4 = {};
3437
+ var GRID = defaultProps4;
3438
+
3439
+ // src/defaultConfig/index.js
3440
+ var RESET = {};
3441
+
3442
+ // src/factory.js
3443
+ var CSS_VARS = {};
3444
+ var CONFIG = {
3445
+ verbose: false,
3446
+ useVariable: true,
3447
+ useReset: true,
3448
+ CSS_VARS,
3449
+ ...defaultConfig_exports
3404
3450
  };
3405
- var toCamelCase = (str) => {
3406
- return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
3407
- return index === 0 ? word.toLowerCase() : word.toUpperCase();
3408
- }).replaceAll(/\s+/g, "");
3451
+ var cachedConfig = (0, import_utils.deepClone)(CONFIG);
3452
+ var FACTORY = {
3453
+ active: "0",
3454
+ 0: CONFIG
3409
3455
  };
3410
- var toTitleCase = (str) => str && str.replace(
3411
- /\w\S*/g,
3412
- (txt) => {
3413
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
3414
- }
3415
- );
3416
- var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
3417
- var toDescriptionCase = (str = "") => {
3418
- if (typeof str !== "string")
3419
- return;
3420
- const result = str.replace(/([A-Z])/g, " $1");
3421
- return result.charAt(0).toUpperCase() + result.slice(1);
3456
+ var getActiveConfig = (def) => {
3457
+ return FACTORY[def || FACTORY.active] || CONFIG;
3422
3458
  };
3423
- var arrayzeValue = (val) => {
3424
- if ((0, import_utils22.isArray)(val))
3425
- return val;
3426
- if ((0, import_utils22.isString)(val))
3427
- return val.split(" ");
3428
- if ((0, import_utils22.isObject)(val))
3429
- return Object.values(val);
3430
- if ((0, import_utils22.isNumber)(val))
3431
- return [val];
3459
+
3460
+ // src/utils/color.js
3461
+ var import_globals = __toESM(require_cjs2(), 1);
3462
+ var import_utils2 = __toESM(require_cjs(), 1);
3463
+
3464
+ // src/utils/font.js
3465
+ var getDefaultOrFirstKey = (LIBRARY, key) => {
3466
+ if (LIBRARY[key])
3467
+ return LIBRARY[key].value;
3468
+ if (LIBRARY.default)
3469
+ return LIBRARY[LIBRARY.default].value;
3470
+ const hasValue = Object.keys(LIBRARY)[0];
3471
+ return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
3432
3472
  };
3433
3473
 
3474
+ // src/utils/sequence.js
3475
+ var import_utils3 = __toESM(require_cjs(), 1);
3476
+ var import_utils4 = __toESM(require_cjs3(), 1);
3477
+
3434
3478
  // src/utils/var.js
3435
- var import_utils6 = __toESM(require_cjs(), 1);
3479
+ var import_utils5 = __toESM(require_cjs(), 1);
3436
3480
 
3437
3481
  // src/utils/sprite.js
3438
- var import_utils7 = __toESM(require_cjs(), 1);
3482
+ var import_utils6 = __toESM(require_cjs(), 1);
3439
3483
 
3440
3484
  // src/system/document.js
3441
3485
  var applyDocument = () => {
3442
3486
  const CONFIG2 = getActiveConfig();
3443
3487
  const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
3444
- return (0, import_utils8.merge)(DOCUMENT2, {
3488
+ return (0, import_utils7.merge)(DOCUMENT2, {
3445
3489
  theme: THEME2.document,
3446
3490
  fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
3447
3491
  fontSize: TYPOGRAPHY2.base,