@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: () => isArray3,
@@ -218,7 +218,7 @@ var require_types = __commonJS({
218
218
  isString: () => isString5,
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 isObject3 = (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,2022 +1530,2052 @@ 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/color.js
1552
- var color_exports = {};
1553
- __export(color_exports, {
1554
- getColor: () => getColor,
1555
- getMediaColor: () => getMediaColor,
1556
- setColor: () => setColor,
1557
- setGradient: () => setGradient
1558
- });
1559
- module.exports = __toCommonJS(color_exports);
1560
- var import_utils8 = __toESM(require_cjs(), 1);
1561
-
1562
- // src/factory.js
1563
- var import_utils = __toESM(require_cjs(), 1);
1564
-
1565
- // src/defaultConfig/index.js
1566
- var defaultConfig_exports = {};
1567
- __export(defaultConfig_exports, {
1568
- ANIMATION: () => ANIMATION,
1569
- BREAKPOINTS: () => BREAKPOINTS,
1570
- CASES: () => CASES,
1571
- COLOR: () => COLOR,
1572
- DEVICES: () => DEVICES,
1573
- DOCUMENT: () => DOCUMENT,
1574
- FONT: () => FONT,
1575
- FONT_FACE: () => FONT_FACE,
1576
- FONT_FAMILY: () => FONT_FAMILY,
1577
- FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
1578
- GRADIENT: () => GRADIENT,
1579
- GRID: () => GRID,
1580
- ICONS: () => ICONS,
1581
- MEDIA: () => MEDIA,
1582
- RESET: () => RESET,
1583
- SEMANTIC_ICONS: () => SEMANTIC_ICONS,
1584
- SEQUENCE: () => SEQUENCE,
1585
- SHADOW: () => SHADOW,
1586
- SPACING: () => SPACING,
1587
- SVG: () => SVG,
1588
- SVG_DATA: () => SVG_DATA,
1589
- TEMPLATES: () => TEMPLATES,
1590
- THEME: () => THEME,
1591
- TIMING: () => TIMING,
1592
- TYPOGRAPHY: () => TYPOGRAPHY,
1593
- UNIT: () => UNIT
1594
- });
1595
-
1596
- // src/defaultConfig/sequence.js
1597
- var SEQUENCE = {
1598
- "minor-second": 1.067,
1599
- "major-second": 1.125,
1600
- "minor-third": 1.2,
1601
- "major-third": 1.25,
1602
- "perfect-fourth": 1.333,
1603
- "augmented-fourth": 1.414,
1604
- "perfect-fifth": 1.5,
1605
- "minor-sixth": 1.6,
1606
- phi: 1.618,
1607
- // golden-ratio
1608
- "major-sixth": 1.667,
1609
- "square-root-3": 1.732,
1610
- // theodorus
1611
- "minor-seventh": 1.778,
1612
- "major-seventh": 1.875,
1613
- octave: 2,
1614
- "square-root-5": 2.23,
1615
- // pythagoras
1616
- "major-tenth": 2.5,
1617
- "major-eleventh": 2.667,
1618
- "major-twelfth": 3,
1619
- pi: 3.14,
1620
- // archimedes
1621
- "double-octave": 4
1622
- };
1623
-
1624
- // src/defaultConfig/unit.js
1625
- var UNIT = {
1626
- default: "em"
1627
- };
1628
-
1629
- // src/defaultConfig/typography.js
1630
- var defaultProps = {
1631
- browserDefault: 16,
1632
- base: 16,
1633
- type: "font-size",
1634
- ratio: SEQUENCE["minor-third"],
1635
- range: [-3, 12],
1636
- h1Matches: 6,
1637
- lineHeight: 1.5,
1638
- subSequence: true,
1639
- mediaRegenerate: false,
1640
- unit: "em",
1641
- templates: {},
1642
- sequence: {},
1643
- scales: {},
1644
- vars: {}
1645
- };
1646
- var TYPOGRAPHY = defaultProps;
1647
-
1648
- // src/defaultConfig/font.js
1649
- var FONT = {};
1650
-
1651
- // src/defaultConfig/font-family.js
1652
- var FONT_FAMILY = {};
1653
- var FONT_FAMILY_TYPES = {
1654
- "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
1655
- serif: "Times New Roman, Georgia, serif, --system-default",
1656
- monospace: "Courier New, monospace, --system-default"
1657
- };
1658
- var FONT_FACE = {};
1659
-
1660
- // src/defaultConfig/media.js
1661
- var MEDIA = {
1662
- tv: "(min-width: 2780px)",
1663
- light: "(prefers-color-scheme: light)",
1664
- dark: "(prefers-color-scheme: dark)",
1665
- print: "print"
1666
- };
1667
-
1668
- // src/defaultConfig/spacing.js
1669
- var defaultProps2 = {
1670
- base: TYPOGRAPHY.base,
1671
- type: "spacing",
1672
- ratio: SEQUENCE.phi,
1673
- range: [-5, 15],
1674
- subSequence: true,
1675
- mediaRegenerate: false,
1676
- unit: "em",
1677
- sequence: {},
1678
- scales: {},
1679
- vars: {}
1680
- };
1681
- var SPACING = defaultProps2;
1682
-
1683
- // src/defaultConfig/color.js
1684
- var COLOR = {};
1685
- var GRADIENT = {};
1686
-
1687
- // src/defaultConfig/theme.js
1688
- var THEME = {};
1689
-
1690
- // src/defaultConfig/shadow.js
1691
- var SHADOW = {};
1692
-
1693
- // src/defaultConfig/icons.js
1694
- var ICONS = {};
1695
- var SEMANTIC_ICONS = {};
1696
-
1697
- // src/defaultConfig/timing.js
1698
- var defaultProps3 = {
1699
- default: 150,
1700
- base: 150,
1701
- type: "timing",
1702
- ratio: SEQUENCE["perfect-fourth"],
1703
- range: [-3, 12],
1704
- mediaRegenerate: false,
1705
- unit: "ms",
1706
- sequence: {},
1707
- scales: {},
1708
- vars: {}
1709
- };
1710
- var TIMING = defaultProps3;
1711
-
1712
- // src/defaultConfig/document.js
1713
- var DOCUMENT = {};
1714
-
1715
- // src/defaultConfig/responsive.js
1716
- var BREAKPOINTS = {
1717
- screenL: 1920,
1718
- screenM: 1680,
1719
- screenS: 1440,
1720
- tabletL: 1366,
1721
- tabletM: 1280,
1722
- tabletS: 1024,
1723
- mobileL: 768,
1724
- mobileM: 560,
1725
- mobileS: 480,
1726
- mobileXS: 375
1727
- };
1728
- var DEVICES = {
1729
- screenL: [1920, 1024],
1730
- screenM: [1680, 1024],
1731
- screenS: [1440, 978],
1732
- tabletL: [1366, 926],
1733
- tabletM: [1280, 768],
1734
- tabletS: [1024, 768],
1735
- mobileL: [768, 375],
1736
- mobileM: [560, 768],
1737
- mobileS: [480, 768],
1738
- mobileXS: [375, 768]
1739
- };
1740
-
1741
- // src/defaultConfig/cases.js
1742
- var CASES = {};
1743
-
1744
- // src/defaultConfig/animation.js
1745
- var ANIMATION = {};
1746
-
1747
- // src/defaultConfig/svg.js
1748
- var SVG = {};
1749
- var SVG_DATA = {};
1750
-
1751
- // src/defaultConfig/templates.js
1752
- var TEMPLATES = {};
1753
-
1754
- // src/defaultConfig/grid.js
1755
- var defaultProps4 = {};
1756
- var GRID = defaultProps4;
1757
-
1758
- // src/defaultConfig/index.js
1759
- var RESET = {};
1760
-
1761
- // src/factory.js
1762
- var CSS_VARS = {};
1763
- var CONFIG = {
1764
- verbose: false,
1765
- useVariable: true,
1766
- useReset: true,
1767
- CSS_VARS,
1768
- ...defaultConfig_exports
1769
- };
1770
- var cachedConfig = (0, import_utils.deepClone)(CONFIG);
1771
- var FACTORY = {
1772
- active: "0",
1773
- 0: CONFIG
1774
- };
1775
- var getActiveConfig = (def) => {
1776
- return FACTORY[def || FACTORY.active] || CONFIG;
1777
- };
1778
-
1779
- // src/utils/color.js
1780
- var import_globals = __toESM(require_cjs2(), 1);
1781
- var import_utils2 = __toESM(require_cjs(), 1);
1782
- var colorStringToRgbaArray = (color) => {
1783
- if (color === "")
1784
- return [0, 0, 0, 0];
1785
- if (color.toLowerCase() === "transparent")
1786
- return [0, 0, 0, 0];
1787
- if (color[0] === "#") {
1788
- if (color.length < 7) {
1789
- color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
1790
- }
1791
- return [
1792
- parseInt(color.substr(1, 2), 16),
1793
- parseInt(color.substr(3, 2), 16),
1794
- parseInt(color.substr(5, 2), 16),
1795
- color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
1796
- ];
1797
- }
1798
- if (color.indexOf("rgb") === -1) {
1799
- if (import_globals.document && import_globals.window) {
1800
- const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
1801
- const flag = "rgb(1, 2, 3)";
1802
- elem.style.color = flag;
1803
- if (elem.style.color !== flag) {
1804
- import_globals.document.body.removeChild(elem);
1805
- return;
1806
- }
1807
- elem.style.color = color;
1808
- if (elem.style.color === flag || elem.style.color === "") {
1809
- import_globals.document.body.removeChild(elem);
1810
- return [0, 0, 0, 0];
1811
- }
1812
- color = import_globals.window.getComputedStyle(elem).color;
1813
- import_globals.document.body.removeChild(elem);
1814
- }
1815
- }
1816
- if (color.indexOf("rgb") === 0) {
1817
- if (color.indexOf("rgba") === -1)
1818
- color = `${color}, 1`;
1819
- return color.match(/[\.\d]+/g).map((a) => +a);
1820
- }
1821
- return [0, 0, 0, 0];
1822
- };
1823
- var hexToRgbArray = (hex, alpha = 1) => {
1824
- const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
1825
- return [r, g, b];
1826
- };
1827
- var rgbArrayToHex = ([r, g, b]) => {
1828
- return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
1829
- };
1830
- var rgbToHSL = (r, g, b) => {
1831
- const a = Math.max(r, g, b);
1832
- const n = a - Math.min(r, g, b);
1833
- const f = 1 - Math.abs(a + a - n - 1);
1834
- const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
1835
- return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
1836
- };
1837
- var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
1838
- Math.min(k - 3, 9 - k, 1),
1839
- -1
1840
- )) => [f(0), f(8), f(4)];
1841
- var getColorShade = (col, amt) => {
1842
- const num = parseInt(col, 16);
1843
- let r = (num >> 16) + amt;
1844
- if (r > 255)
1845
- r = 255;
1846
- else if (r < 0)
1847
- r = 0;
1848
- let b = (num >> 8 & 255) + amt;
1849
- if (b > 255)
1850
- b = 255;
1851
- else if (b < 0)
1852
- b = 0;
1853
- let g = (num & 255) + amt;
1854
- if (g > 255)
1855
- g = 255;
1856
- else if (g < 0)
1857
- g = 0;
1858
- return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
1859
- };
1860
- var getRgbTone = (rgb, tone) => {
1861
- if ((0, import_utils2.isString)(rgb) && rgb.includes("rgb"))
1862
- rgb = colorStringToRgbaArray(rgb).join(", ");
1863
- if ((0, import_utils2.isString)(rgb))
1864
- rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
1865
- if ((0, import_utils2.isNumber)(tone))
1866
- tone += "";
1867
- const toHex = rgbArrayToHex(rgb);
1868
- const abs = tone.slice(0, 1);
1869
- if (abs === "-" || abs === "+") {
1870
- const colorShade = getColorShade(toHex, parseFloat(tone));
1871
- return hexToRgbArray(colorShade).join(", ");
1872
- } else {
1873
- const [r, g, b] = rgb;
1874
- const hsl = rgbToHSL(r, g, b);
1875
- const [h, s, l] = hsl;
1876
- const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1877
- return newRgb;
1878
- }
1879
- };
1880
-
1881
- // src/utils/sequence.js
1882
- var import_utils4 = __toESM(require_cjs(), 1);
1883
-
1884
1565
  // ../utils/dist/cjs/index.js
1885
- var __create2 = Object.create;
1886
- var __defProp2 = Object.defineProperty;
1887
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1888
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1889
- var __getProtoOf2 = Object.getPrototypeOf;
1890
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1891
- var __commonJS2 = (cb, mod) => function __require() {
1892
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1893
- };
1894
- var __export2 = (target, all) => {
1895
- for (var name in all)
1896
- __defProp2(target, name, { get: all[name], enumerable: true });
1897
- };
1898
- var __copyProps2 = (to, from, except, desc) => {
1899
- if (from && typeof from === "object" || typeof from === "function") {
1900
- for (let key of __getOwnPropNames2(from))
1901
- if (!__hasOwnProp2.call(to, key) && key !== except)
1902
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1903
- }
1904
- return to;
1905
- };
1906
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1907
- // If the importer is in node compatibility mode or this is not an ESM
1908
- // file that has been converted to a CommonJS file using a Babel-
1909
- // compatible transform (i.e. "__esModule" has not been set), then set
1910
- // "default" to the CommonJS "module.exports" for node compatibility.
1911
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
1912
- mod
1913
- ));
1914
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1915
- var require_key2 = __commonJS2({
1916
- "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
1566
+ var require_cjs3 = __commonJS({
1567
+ "../utils/dist/cjs/index.js"(exports, module2) {
1917
1568
  "use strict";
1918
- var __defProp22 = Object.defineProperty;
1919
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1920
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1921
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1922
- 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) => {
1923
1579
  for (var name in all)
1924
- __defProp22(target, name, { get: all[name], enumerable: true });
1580
+ __defProp2(target, name, { get: all[name], enumerable: true });
1925
1581
  };
1926
- var __copyProps22 = (to, from, except, desc) => {
1582
+ var __copyProps2 = (to, from, except, desc) => {
1927
1583
  if (from && typeof from === "object" || typeof from === "function") {
1928
- for (let key of __getOwnPropNames22(from))
1929
- if (!__hasOwnProp22.call(to, key) && key !== except)
1930
- __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 });
1931
1587
  }
1932
1588
  return to;
1933
1589
  };
1934
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1935
- var key_exports = {};
1936
- __export22(key_exports, {
1937
- createSnapshotId: () => createSnapshotId,
1938
- 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
+ }
1939
1635
  });
1940
- module2.exports = __toCommonJS22(key_exports);
1941
- var generateKey = /* @__PURE__ */ function() {
1942
- let index = 0;
1943
- function newId() {
1944
- index++;
1945
- 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];
1946
1670
  }
1947
- return newId;
1948
- }();
1949
- var createSnapshotId = generateKey;
1950
- }
1951
- });
1952
- var require_env2 = __commonJS2({
1953
- "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
1954
- "use strict";
1955
- var __defProp22 = Object.defineProperty;
1956
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1957
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1958
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1959
- var __export22 = (target, all) => {
1960
- for (var name in all)
1961
- __defProp22(target, name, { get: all[name], enumerable: true });
1962
- };
1963
- var __copyProps22 = (to, from, except, desc) => {
1964
- if (from && typeof from === "object" || typeof from === "function") {
1965
- for (let key of __getOwnPropNames22(from))
1966
- if (!__hasOwnProp22.call(to, key) && key !== except)
1967
- __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;
1968
1704
  }
1969
- return to;
1970
- };
1971
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1972
- var env_exports = {};
1973
- __export22(env_exports, {
1974
- NODE_ENV: () => NODE_ENV,
1975
- getNev: () => getNev,
1976
- isDevelopment: () => isDevelopment,
1977
- isProduction: () => isProduction,
1978
- isTest: () => isTest
1979
1705
  });
1980
- module2.exports = __toCommonJS22(env_exports);
1981
- var NODE_ENV = "development";
1982
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
1983
- var isTest = (env = NODE_ENV) => env === "test";
1984
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
1985
- var getNev = (key, env = NODE_ENV) => env[key];
1986
- }
1987
- });
1988
- var require_globals2 = __commonJS2({
1989
- "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
1990
- "use strict";
1991
- var __defProp22 = Object.defineProperty;
1992
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1993
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1994
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1995
- var __export22 = (target, all) => {
1996
- for (var name in all)
1997
- __defProp22(target, name, { get: all[name], enumerable: true });
1998
- };
1999
- var __copyProps22 = (to, from, except, desc) => {
2000
- if (from && typeof from === "object" || typeof from === "function") {
2001
- for (let key of __getOwnPropNames22(from))
2002
- if (!__hasOwnProp22.call(to, key) && key !== except)
2003
- __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
+ };
2004
1739
  }
2005
- return to;
2006
- };
2007
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2008
- var globals_exports = {};
2009
- __export22(globals_exports, {
2010
- document: () => document22,
2011
- global: () => global,
2012
- self: () => self,
2013
- window: () => window2
2014
1740
  });
2015
- module2.exports = __toCommonJS22(globals_exports);
2016
- var global = globalThis;
2017
- var self = globalThis;
2018
- var window2 = globalThis;
2019
- var document22 = window2.document;
2020
- }
2021
- });
2022
- var require_node2 = __commonJS2({
2023
- "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
2024
- "use strict";
2025
- var __defProp22 = Object.defineProperty;
2026
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2027
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2028
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2029
- var __export22 = (target, all) => {
2030
- for (var name in all)
2031
- __defProp22(target, name, { get: all[name], enumerable: true });
2032
- };
2033
- var __copyProps22 = (to, from, except, desc) => {
2034
- if (from && typeof from === "object" || typeof from === "function") {
2035
- for (let key of __getOwnPropNames22(from))
2036
- if (!__hasOwnProp22.call(to, key) && key !== except)
2037
- __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
+ };
2038
1827
  }
2039
- return to;
2040
- };
2041
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2042
- var node_exports = {};
2043
- __export22(node_exports, {
2044
- isHtmlElement: () => isHtmlElement,
2045
- isNode: () => isNode
2046
1828
  });
2047
- module2.exports = __toCommonJS22(node_exports);
2048
- var import_globals2 = require_globals2();
2049
- var isNode = (obj) => {
2050
- return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
2051
- };
2052
- var isHtmlElement = (obj) => {
2053
- return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
2054
- };
2055
- }
2056
- });
2057
- var require_types2 = __commonJS2({
2058
- "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
2059
- "use strict";
2060
- var __defProp22 = Object.defineProperty;
2061
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2062
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2063
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2064
- var __export22 = (target, all) => {
2065
- for (var name in all)
2066
- __defProp22(target, name, { get: all[name], enumerable: true });
2067
- };
2068
- var __copyProps22 = (to, from, except, desc) => {
2069
- if (from && typeof from === "object" || typeof from === "function") {
2070
- for (let key of __getOwnPropNames22(from))
2071
- if (!__hasOwnProp22.call(to, key) && key !== except)
2072
- __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
+ };
2073
1981
  }
2074
- return to;
2075
- };
2076
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2077
- var types_exports = {};
2078
- __export22(types_exports, {
2079
- TYPES: () => TYPES,
2080
- is: () => is,
2081
- isArray: () => isArray3,
2082
- isBoolean: () => isBoolean,
2083
- isDate: () => isDate,
2084
- isDefined: () => isDefined2,
2085
- isFunction: () => isFunction,
2086
- isNot: () => isNot,
2087
- isNull: () => isNull,
2088
- isNumber: () => isNumber2,
2089
- isObject: () => isObject3,
2090
- isObjectLike: () => isObjectLike2,
2091
- isString: () => isString22,
2092
- isUndefined: () => isUndefined
2093
1982
  });
2094
- module2.exports = __toCommonJS22(types_exports);
2095
- var import_node = require_node2();
2096
- var isObject3 = (arg) => {
2097
- if (arg === null)
2098
- return false;
2099
- return typeof arg === "object" && arg.constructor === Object;
2100
- };
2101
- var isString22 = (arg) => typeof arg === "string";
2102
- var isNumber2 = (arg) => typeof arg === "number";
2103
- var isFunction = (arg) => typeof arg === "function";
2104
- var isBoolean = (arg) => arg === true || arg === false;
2105
- var isNull = (arg) => arg === null;
2106
- var isArray3 = (arg) => Array.isArray(arg);
2107
- var isDate = (d) => d instanceof Date;
2108
- var isObjectLike2 = (arg) => {
2109
- if (arg === null)
2110
- return false;
2111
- return typeof arg === "object";
2112
- };
2113
- var isDefined2 = (arg) => {
2114
- return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
2115
- };
2116
- var isUndefined = (arg) => {
2117
- return arg === void 0;
2118
- };
2119
- var TYPES = {
2120
- boolean: isBoolean,
2121
- array: isArray3,
2122
- object: isObject3,
2123
- string: isString22,
2124
- date: isDate,
2125
- number: isNumber2,
2126
- null: isNull,
2127
- function: isFunction,
2128
- objectLike: isObjectLike2,
2129
- node: import_node.isNode,
2130
- htmlElement: import_node.isHtmlElement,
2131
- defined: isDefined2
2132
- };
2133
- var is = (arg) => {
2134
- return (...args) => {
2135
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
2136
- };
2137
- };
2138
- var isNot = (arg) => {
2139
- return (...args) => {
2140
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
2141
- };
2142
- };
2143
- }
2144
- });
2145
- var require_array2 = __commonJS2({
2146
- "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
2147
- "use strict";
2148
- var __defProp22 = Object.defineProperty;
2149
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2150
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2151
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2152
- var __export22 = (target, all) => {
2153
- for (var name in all)
2154
- __defProp22(target, name, { get: all[name], enumerable: true });
2155
- };
2156
- var __copyProps22 = (to, from, except, desc) => {
2157
- if (from && typeof from === "object" || typeof from === "function") {
2158
- for (let key of __getOwnPropNames22(from))
2159
- if (!__hasOwnProp22.call(to, key) && key !== except)
2160
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2161
- }
2162
- return to;
2163
- };
2164
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2165
- var array_exports = {};
2166
- __export22(array_exports, {
2167
- addItemAfterEveryElement: () => addItemAfterEveryElement,
2168
- arrayContainsOtherArray: () => arrayContainsOtherArray,
2169
- arraysEqual: () => arraysEqual,
2170
- createNestedObject: () => createNestedObject,
2171
- cutArrayAfterValue: () => cutArrayAfterValue,
2172
- cutArrayBeforeValue: () => cutArrayBeforeValue,
2173
- getFrequencyInArray: () => getFrequencyInArray,
2174
- joinArrays: () => joinArrays,
2175
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
2176
- mergeArray: () => mergeArray,
2177
- removeFromArray: () => removeFromArray,
2178
- removeValueFromArray: () => removeValueFromArray,
2179
- removeValueFromArrayAll: () => removeValueFromArrayAll,
2180
- reorderArrayByValues: () => reorderArrayByValues,
2181
- swapItemsInArray: () => swapItemsInArray
2182
- });
2183
- module2.exports = __toCommonJS22(array_exports);
2184
- var import_object = require_object2();
2185
- var import_types = require_types2();
2186
- var arrayContainsOtherArray = (arr1, arr2) => {
2187
- return arr2.every((val) => arr1.includes(val));
2188
- };
2189
- var getFrequencyInArray = (arr, value) => {
2190
- return arr.reduce((count, currentValue) => {
2191
- return currentValue === value ? count + 1 : count;
2192
- }, 0);
2193
- };
2194
- var removeFromArray = (arr, index) => {
2195
- if ((0, import_types.isString)(index))
2196
- index = parseInt(index);
2197
- if ((0, import_types.isNumber)(index)) {
2198
- if (index < 0 || index >= arr.length || isNaN(index)) {
2199
- throw new Error("Invalid index");
2200
- }
2201
- arr.splice(index, 1);
2202
- } else if ((0, import_types.isArray)(index)) {
2203
- index.forEach((idx) => removeFromArray(arr, idx));
2204
- } else {
2205
- throw new Error("Invalid index");
2206
- }
2207
- return arr;
2208
- };
2209
- var swapItemsInArray = (arr, i, j) => {
2210
- [arr[i], arr[j]] = [arr[j], arr[i]];
2211
- };
2212
- var joinArrays = (...arrays) => {
2213
- return [].concat(...arrays);
2214
- };
2215
- var mergeArray = (arr, excludeFrom = []) => {
2216
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
2217
- };
2218
- var mergeAndCloneIfArray = (obj) => {
2219
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
2220
- };
2221
- var cutArrayBeforeValue = (arr, value) => {
2222
- const index = arr.indexOf(value);
2223
- if (index !== -1) {
2224
- return arr.slice(0, index);
2225
- }
2226
- return arr;
2227
- };
2228
- var cutArrayAfterValue = (arr, value) => {
2229
- if (!(0, import_types.isArray)(arr))
2230
- return;
2231
- const index = arr.indexOf(value);
2232
- if (index !== -1) {
2233
- return arr.slice(index + 1);
2234
- }
2235
- return arr;
2236
- };
2237
- var createNestedObject = (arr, lastValue) => {
2238
- const nestedObject = {};
2239
- if (arr.length === 0) {
2240
- return lastValue;
2241
- }
2242
- arr.reduce((obj, value, index) => {
2243
- if (!obj[value]) {
2244
- obj[value] = {};
2245
- }
2246
- if (index === arr.length - 1 && lastValue) {
2247
- obj[value] = lastValue;
2248
- }
2249
- return obj[value];
2250
- }, nestedObject);
2251
- return nestedObject;
2252
- };
2253
- var removeValueFromArray = (arr, value) => {
2254
- const index = arr.indexOf(value);
2255
- if (index > -1) {
2256
- const newArray = [...arr];
2257
- newArray.splice(index, 1);
2258
- return newArray;
2259
- }
2260
- return arr;
2261
- };
2262
- var removeValueFromArrayAll = (arr, value) => {
2263
- return arr.filter((item) => item !== value);
2264
- };
2265
- var addItemAfterEveryElement = (array, item) => {
2266
- const result = [];
2267
- for (let i = 0; i < array.length; i++) {
2268
- result.push(array[i]);
2269
- if (i < array.length - 1) {
2270
- result.push(item);
2271
- }
2272
- }
2273
- return result;
2274
- };
2275
- var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
2276
- const newArray = [...array];
2277
- const indexToMove = newArray.indexOf(valueToMove);
2278
- const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
2279
- if (indexToMove !== -1 && indexToInsertBefore !== -1) {
2280
- const removedItem = newArray.splice(indexToMove, 1)[0];
2281
- const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
2282
- newArray.splice(insertIndex, 0, removedItem);
2283
- }
2284
- return newArray;
2285
- };
2286
- var arraysEqual = (arr1, arr2) => {
2287
- if (arr1.length !== arr2.length) {
2288
- return false;
2289
- }
2290
- for (let i = 0; i < arr1.length; i++) {
2291
- if (arr1[i] !== arr2[i]) {
2292
- return false;
2293
- }
2294
- }
2295
- return true;
2296
- };
2297
- }
2298
- });
2299
- var require_string2 = __commonJS2({
2300
- "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
2301
- "use strict";
2302
- var __defProp22 = Object.defineProperty;
2303
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2304
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2305
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2306
- var __export22 = (target, all) => {
2307
- for (var name in all)
2308
- __defProp22(target, name, { get: all[name], enumerable: true });
2309
- };
2310
- var __copyProps22 = (to, from, except, desc) => {
2311
- if (from && typeof from === "object" || typeof from === "function") {
2312
- for (let key of __getOwnPropNames22(from))
2313
- if (!__hasOwnProp22.call(to, key) && key !== except)
2314
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2315
- }
2316
- return to;
2317
- };
2318
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2319
- var string_exports = {};
2320
- __export22(string_exports, {
2321
- customDecodeURIComponent: () => customDecodeURIComponent,
2322
- customEncodeURIComponent: () => customEncodeURIComponent,
2323
- findKeyPosition: () => findKeyPosition,
2324
- lowercaseFirstLetter: () => lowercaseFirstLetter,
2325
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
2326
- replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
2327
- stringIncludesAny: () => stringIncludesAny,
2328
- trimStringFromSymbols: () => trimStringFromSymbols
2329
- });
2330
- module2.exports = __toCommonJS22(string_exports);
2331
- var stringIncludesAny = (str, characters) => {
2332
- for (const char of characters) {
2333
- if (str.includes(char)) {
2334
- return true;
2335
- }
2336
- }
2337
- return false;
2338
- };
2339
- var trimStringFromSymbols = (str, characters) => {
2340
- const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
2341
- return str.replace(pattern, "");
2342
- };
2343
- var brackRegex = {
2344
- 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
2345
- 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
2346
- };
2347
- var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
2348
- if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
2349
- return str;
2350
- const reg = brackRegex[options.bracketsLength || 2];
2351
- return str.replace(reg, (_, parentPath, variable) => {
2352
- if (parentPath) {
2353
- const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
2354
- let parentState = state;
2355
- for (let i = 0; i < parentLevels; i++) {
2356
- parentState = parentState.parent;
2357
- if (!parentState) {
2358
- return "";
2359
- }
2360
- }
2361
- const value = parentState[variable.trim()];
2362
- return value !== void 0 ? `${value}` : "";
2363
- } else {
2364
- const value = state[variable.trim()];
2365
- return value !== void 0 ? `${value}` : "";
2366
- }
2367
- });
2368
- };
2369
- var lowercaseFirstLetter = (inputString) => {
2370
- return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
2371
- };
2372
- var findKeyPosition = (str, key) => {
2373
- const lines = str.split("\n");
2374
- let startLineNumber = -1;
2375
- let endLineNumber = -1;
2376
- let startColumn = -1;
2377
- let endColumn = -1;
2378
- const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2379
- let braceCount = 0;
2380
- let foundKey = false;
2381
- for (let i = 0; i < lines.length; i++) {
2382
- if (keyPattern.test(lines[i]) && !foundKey) {
2383
- foundKey = true;
2384
- startLineNumber = i + 1;
2385
- startColumn = lines[i].indexOf(key) + 1;
2386
- if (lines[i].includes("{}")) {
2387
- endLineNumber = startLineNumber;
2388
- endColumn = lines[i].indexOf("{}") + 3;
2389
- break;
2390
- }
2391
- const line = lines[i].slice(startColumn + key.length);
2392
- if (line.includes("{") || line.includes("[")) {
2393
- braceCount = 1;
2394
- } else {
2395
- endLineNumber = i + 1;
2396
- endColumn = lines[i].length + 1;
2397
- break;
2398
- }
2399
- } else if (foundKey) {
2400
- braceCount += (lines[i].match(/{/g) || []).length;
2401
- braceCount += (lines[i].match(/\[/g) || []).length;
2402
- braceCount -= (lines[i].match(/}/g) || []).length;
2403
- braceCount -= (lines[i].match(/]/g) || []).length;
2404
- if (braceCount === 0) {
2405
- endLineNumber = i + 1;
2406
- endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2407
- break;
2408
- }
2409
- }
2410
- }
2411
- return {
2412
- startColumn,
2413
- endColumn,
2414
- startLineNumber,
2415
- endLineNumber
2416
- };
2417
- };
2418
- var replaceOctalEscapeSequences = (str) => {
2419
- const octalRegex = /\\([0-7]{1,3})/g;
2420
- return str.replace(octalRegex, (match, p1) => {
2421
- const octalValue = parseInt(p1, 8);
2422
- const char = String.fromCharCode(octalValue);
2423
- return char;
2424
- });
2425
- };
2426
- var customEncodeURIComponent = (str) => {
2427
- return str.split("").map((char) => {
2428
- if (/[^a-zA-Z0-9\s]/.test(char)) {
2429
- return "%" + char.charCodeAt(0).toString(16).toUpperCase();
2430
- }
2431
- return char;
2432
- }).join("");
2433
- };
2434
- var customDecodeURIComponent = (encodedStr) => {
2435
- return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
2436
- };
2437
- }
2438
- });
2439
- var require_object2 = __commonJS2({
2440
- "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
2441
- "use strict";
2442
- var __defProp22 = Object.defineProperty;
2443
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2444
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2445
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2446
- var __export22 = (target, all) => {
2447
- for (var name in all)
2448
- __defProp22(target, name, { get: all[name], enumerable: true });
2449
- };
2450
- var __copyProps22 = (to, from, except, desc) => {
2451
- if (from && typeof from === "object" || typeof from === "function") {
2452
- for (let key of __getOwnPropNames22(from))
2453
- if (!__hasOwnProp22.call(to, key) && key !== except)
2454
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2455
- }
2456
- return to;
2457
- };
2458
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2459
- var object_exports = {};
2460
- __export22(object_exports, {
2461
- checkIfKeyIsComponent: () => checkIfKeyIsComponent,
2462
- clone: () => clone,
2463
- createObjectWithoutPrototype: () => createObjectWithoutPrototype,
2464
- deepClone: () => deepClone2,
2465
- deepCloneExclude: () => deepCloneExclude,
2466
- deepCloneWithExtend: () => deepCloneWithExtend,
2467
- deepContains: () => deepContains,
2468
- deepDestringify: () => deepDestringify,
2469
- deepDiff: () => deepDiff,
2470
- deepMerge: () => deepMerge2,
2471
- deepStringify: () => deepStringify,
2472
- detachFunctionsFromObject: () => detachFunctionsFromObject,
2473
- diff: () => diff,
2474
- diffArrays: () => diffArrays,
2475
- diffObjects: () => diffObjects,
2476
- exec: () => exec,
2477
- flattenRecursive: () => flattenRecursive,
2478
- getChildrenComponentsByKey: () => getChildrenComponentsByKey,
2479
- getExtendsInElement: () => getExtendsInElement,
2480
- hasOwnProperty: () => hasOwnProperty,
2481
- isEmpty: () => isEmpty,
2482
- isEmptyObject: () => isEmptyObject,
2483
- isEqualDeep: () => isEqualDeep,
2484
- makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
2485
- map: () => map,
2486
- merge: () => merge,
2487
- mergeArrayExclude: () => mergeArrayExclude,
2488
- mergeIfExisted: () => mergeIfExisted,
2489
- objectToString: () => objectToString,
2490
- overwrite: () => overwrite,
2491
- overwriteDeep: () => overwriteDeep,
2492
- overwriteShallow: () => overwriteShallow,
2493
- removeFromObject: () => removeFromObject,
2494
- stringToObject: () => stringToObject
2495
- });
2496
- module2.exports = __toCommonJS22(object_exports);
2497
- var import_globals2 = require_globals2();
2498
- var import_types = require_types2();
2499
- var import_array = require_array2();
2500
- var import_string = require_string2();
2501
- var exec = (param, element, state, context) => {
2502
- if ((0, import_types.isFunction)(param)) {
2503
- return param(
2504
- element,
2505
- state || element.state,
2506
- context || element.context
2507
- );
2508
- }
2509
- return param;
2510
- };
2511
- var map = (obj, extention, element) => {
2512
- for (const e in extention) {
2513
- obj[e] = exec(extention[e], element);
2514
- }
2515
- };
2516
- var merge = (element, obj, excludeFrom = []) => {
2517
- for (const e in obj) {
2518
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
2519
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2520
- continue;
2521
- const elementProp = element[e];
2522
- const objProp = obj[e];
2523
- if (elementProp === void 0) {
2524
- element[e] = objProp;
2525
- }
2526
- }
2527
- return element;
2528
- };
2529
- var deepMerge2 = (element, extend, excludeFrom = []) => {
2530
- for (const e in extend) {
2531
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
2532
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2533
- continue;
2534
- const elementProp = element[e];
2535
- const extendProp = extend[e];
2536
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
2537
- deepMerge2(elementProp, extendProp, excludeFrom);
2538
- } else if (elementProp === void 0) {
2539
- element[e] = extendProp;
2540
- }
2541
- }
2542
- return element;
2543
- };
2544
- var clone = (obj, excludeFrom = []) => {
2545
- const o = {};
2546
- for (const prop in obj) {
2547
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2548
- if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
2549
- continue;
2550
- o[prop] = obj[prop];
2551
- }
2552
- return o;
2553
- };
2554
- var deepCloneExclude = (obj, excludeFrom = []) => {
2555
- if ((0, import_types.isArray)(obj)) {
2556
- return obj.map((x) => deepCloneExclude(x, excludeFrom));
2557
- }
2558
- const o = {};
2559
- for (const k in obj) {
2560
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
2561
- if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
2562
- continue;
2563
- let v = obj[k];
2564
- if (k === "extend" && (0, import_types.isArray)(v)) {
2565
- v = mergeArrayExclude(v, excludeFrom);
2566
- }
2567
- if ((0, import_types.isArray)(v)) {
2568
- o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
2569
- } else if ((0, import_types.isObject)(v)) {
2570
- o[k] = deepCloneExclude(v, excludeFrom);
2571
- } else
2572
- o[k] = v;
2573
- }
2574
- return o;
2575
- };
2576
- var mergeArrayExclude = (arr, excl = []) => {
2577
- return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
2578
- };
2579
- var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
2580
- const o = (0, import_types.isArray)(obj) ? [] : {};
2581
- for (const prop in obj) {
2582
- if (!Object.prototype.hasOwnProperty.call(obj, prop))
2583
- continue;
2584
- if (prop === "__proto__")
2585
- continue;
2586
- if (excludeFrom.includes(prop) || prop.startsWith("__"))
2587
- continue;
2588
- let objProp = obj[prop];
2589
- if (cleanUndefined && (0, import_types.isUndefined)(objProp))
2590
- continue;
2591
- if (prop === "extend" && (0, import_types.isArray)(objProp)) {
2592
- objProp = (0, import_array.mergeArray)(objProp);
2593
- }
2594
- if ((0, import_types.isObjectLike)(objProp)) {
2595
- o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
2596
- } else
2597
- o[prop] = objProp;
2598
- }
2599
- return o;
2600
- };
2601
- var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
2602
- const o = (0, import_types.isArray)(obj) ? [] : {};
2603
- for (const prop in obj) {
2604
- if (!Object.prototype.hasOwnProperty.call(obj, prop))
2605
- continue;
2606
- const objProp = obj[prop];
2607
- if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
2608
- continue;
2609
- if ((0, import_types.isObjectLike)(objProp)) {
2610
- o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
2611
- } else
2612
- o[prop] = objProp;
2613
- }
2614
- return o;
2615
- };
2616
- var deepStringify = (obj, stringified = {}) => {
2617
- for (const prop in obj) {
2618
- const objProp = obj[prop];
2619
- if ((0, import_types.isFunction)(objProp)) {
2620
- stringified[prop] = objProp.toString();
2621
- } else if ((0, import_types.isObject)(objProp)) {
2622
- stringified[prop] = {};
2623
- deepStringify(objProp, stringified[prop]);
2624
- } else if ((0, import_types.isArray)(objProp)) {
2625
- stringified[prop] = [];
2626
- objProp.forEach((v, i) => {
2627
- if ((0, import_types.isObject)(v)) {
2628
- stringified[prop][i] = {};
2629
- deepStringify(v, stringified[prop][i]);
2630
- } else if ((0, import_types.isFunction)(v)) {
2631
- stringified[prop][i] = v.toString();
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}` : "";
2632
2047
  } else {
2633
- stringified[prop][i] = v;
2048
+ const value = state[variable.trim()];
2049
+ return value !== void 0 ? `${value}` : "";
2634
2050
  }
2635
2051
  });
2636
- } else {
2637
- stringified[prop] = objProp;
2638
- }
2639
- }
2640
- return stringified;
2641
- };
2642
- var objectToString = (obj = {}, indent = 0) => {
2643
- const spaces = " ".repeat(indent);
2644
- let str = "{\n";
2645
- for (const [key, value] of Object.entries(obj)) {
2646
- const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
2647
- const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
2648
- str += `${spaces} ${stringedKey}: `;
2649
- if ((0, import_types.isArray)(value)) {
2650
- str += "[\n";
2651
- for (const element of value) {
2652
- if ((0, import_types.isObject)(element) && element !== null) {
2653
- str += `${spaces} ${objectToString(element, indent + 2)},
2654
- `;
2655
- } else if ((0, import_types.isString)(element)) {
2656
- str += `${spaces} '${element}',
2657
- `;
2658
- } else {
2659
- str += `${spaces} ${element},
2660
- `;
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
+ }
2661
2093
  }
2662
2094
  }
2663
- str += `${spaces} ]`;
2664
- } else if ((0, import_types.isObjectLike)(value)) {
2665
- str += objectToString(value, indent + 1);
2666
- } else if ((0, import_types.isString)(value)) {
2667
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
2668
- } else {
2669
- str += value;
2670
- }
2671
- str += ",\n";
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
+ };
2672
2121
  }
2673
- str += `${spaces}}`;
2674
- return str;
2675
- };
2676
- var detachFunctionsFromObject = (obj, detached = {}) => {
2677
- for (const prop in obj) {
2678
- const objProp = obj[prop];
2679
- if ((0, import_types.isFunction)(objProp))
2680
- continue;
2681
- else if ((0, import_types.isObject)(objProp)) {
2682
- detached[prop] = {};
2683
- deepStringify(objProp, detached[prop]);
2684
- } else if ((0, import_types.isArray)(objProp)) {
2685
- detached[prop] = [];
2686
- objProp.forEach((v, i) => {
2687
- if ((0, import_types.isFunction)(v))
2688
- return;
2689
- if ((0, import_types.isObject)(v)) {
2690
- detached[prop][i] = {};
2691
- detachFunctionsFromObject(v, detached[prop][i]);
2122
+ });
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: () => merge,
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 merge = (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
+ });
2692
2320
  } else {
2693
- detached[prop][i] = v;
2321
+ stringified[prop] = objProp;
2694
2322
  }
2695
- });
2696
- } else {
2697
- detached[prop] = objProp;
2698
- }
2699
- }
2700
- return detached;
2701
- };
2702
- var deepDestringify = (obj, destringified = {}) => {
2703
- for (const prop in obj) {
2704
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2705
- if (!hasOwnProperty2)
2706
- continue;
2707
- const objProp = obj[prop];
2708
- if ((0, import_types.isString)(objProp)) {
2709
- if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2710
- try {
2711
- const evalProp = import_globals2.window.eval(`(${objProp})`);
2712
- destringified[prop] = evalProp;
2713
- } catch (e) {
2714
- if (e)
2715
- destringified[prop] = objProp;
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;
2716
2354
  }
2717
- } else {
2718
- destringified[prop] = objProp;
2355
+ str += ",\n";
2719
2356
  }
2720
- } else if ((0, import_types.isArray)(objProp)) {
2721
- destringified[prop] = [];
2722
- objProp.forEach((arrProp) => {
2723
- if ((0, import_types.isString)(arrProp)) {
2724
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
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("[")) {
2725
2394
  try {
2726
- const evalProp = import_globals2.window.eval(`(${arrProp})`);
2727
- destringified[prop].push(evalProp);
2395
+ const evalProp = import_globals2.window.eval(`(${objProp})`);
2396
+ destringified[prop] = evalProp;
2728
2397
  } catch (e) {
2729
2398
  if (e)
2730
- destringified[prop].push(arrProp);
2399
+ destringified[prop] = objProp;
2731
2400
  }
2732
2401
  } else {
2733
- destringified[prop].push(arrProp);
2402
+ destringified[prop] = objProp;
2734
2403
  }
2735
- } else if ((0, import_types.isObject)(arrProp)) {
2736
- destringified[prop].push(deepDestringify(arrProp));
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]);
2737
2427
  } else {
2738
- destringified[prop].push(arrProp);
2428
+ destringified[prop] = objProp;
2739
2429
  }
2740
- });
2741
- } else if ((0, import_types.isObject)(objProp)) {
2742
- destringified[prop] = deepDestringify(objProp, destringified[prop]);
2743
- } else {
2744
- destringified[prop] = objProp;
2745
- }
2746
- }
2747
- return destringified;
2748
- };
2749
- var stringToObject = (str, opts = { verbose: true }) => {
2750
- try {
2751
- return import_globals2.window.eval("(" + str + ")");
2752
- } catch (e) {
2753
- if (opts.verbose)
2754
- console.warn(e);
2755
- }
2756
- };
2757
- var diffObjects = (original, objToDiff, cache) => {
2758
- for (const e in objToDiff) {
2759
- if (e === "ref")
2760
- continue;
2761
- const originalProp = original[e];
2762
- const objToDiffProp = objToDiff[e];
2763
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
2764
- cache[e] = {};
2765
- diff(originalProp, objToDiffProp, cache[e]);
2766
- } else if (objToDiffProp !== void 0) {
2767
- cache[e] = objToDiffProp;
2768
- }
2769
- }
2770
- return cache;
2771
- };
2772
- var diffArrays = (original, objToDiff, cache) => {
2773
- if (original.length !== objToDiff.length) {
2774
- cache = objToDiff;
2775
- } else {
2776
- const diffArr = [];
2777
- for (let i = 0; i < original.length; i++) {
2778
- const diffObj = diff(original[i], objToDiff[i]);
2779
- if (Object.keys(diffObj).length > 0) {
2780
- diffArr.push(diffObj);
2781
2430
  }
2782
- }
2783
- if (diffArr.length > 0) {
2784
- cache = diffArr;
2785
- }
2786
- }
2787
- return cache;
2788
- };
2789
- var diff = (original, objToDiff, cache = {}) => {
2790
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
2791
- cache = [];
2792
- diffArrays(original, objToDiff, cache);
2793
- } else {
2794
- diffObjects(original, objToDiff, cache);
2795
- }
2796
- return cache;
2797
- };
2798
- var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
2799
- var isEmpty = (o) => Object.keys(o).length === 0;
2800
- var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
2801
- var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
2802
- var deepDiff = (lhs, rhs) => {
2803
- if (lhs === rhs)
2804
- return {};
2805
- if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
2806
- return rhs;
2807
- const deletedValues = Object.keys(lhs).reduce((acc, key) => {
2808
- if (!hasOwnProperty(rhs, key)) {
2809
- acc[key] = void 0;
2810
- }
2811
- return acc;
2812
- }, makeObjectWithoutPrototype());
2813
- if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
2814
- if (lhs.valueOf() === rhs.valueOf())
2815
- return {};
2816
- return rhs;
2817
- }
2818
- return Object.keys(rhs).reduce((acc, key) => {
2819
- if (!hasOwnProperty(lhs, key)) {
2820
- acc[key] = rhs[key];
2821
- return acc;
2822
- }
2823
- const difference = diff(lhs[key], rhs[key]);
2824
- if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
2825
- return acc;
2826
- }
2827
- acc[key] = difference;
2828
- return acc;
2829
- }, deletedValues);
2830
- };
2831
- var overwrite = (element, params, excludeFrom = []) => {
2832
- const { ref } = element;
2833
- const changes = {};
2834
- for (const e in params) {
2835
- if (excludeFrom.includes(e) || e.startsWith("__"))
2836
- continue;
2837
- const elementProp = element[e];
2838
- const paramsProp = params[e];
2839
- if (paramsProp) {
2840
- ref.__cache[e] = changes[e] = elementProp;
2841
- ref[e] = paramsProp;
2842
- }
2843
- }
2844
- return changes;
2845
- };
2846
- var overwriteShallow = (obj, params, excludeFrom = []) => {
2847
- for (const e in params) {
2848
- if (excludeFrom.includes(e) || e.startsWith("__"))
2849
- continue;
2850
- obj[e] = params[e];
2851
- }
2852
- return obj;
2853
- };
2854
- var overwriteDeep = (obj, params, excludeFrom = []) => {
2855
- for (const e in params) {
2856
- if (e === "__proto__")
2857
- continue;
2858
- if (excludeFrom.includes(e) || e.startsWith("__"))
2859
- continue;
2860
- const objProp = obj[e];
2861
- const paramsProp = params[e];
2862
- if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
2863
- overwriteDeep(objProp, paramsProp);
2864
- } else if (paramsProp !== void 0) {
2865
- obj[e] = paramsProp;
2866
- }
2867
- }
2868
- return obj;
2869
- };
2870
- var mergeIfExisted = (a, b) => {
2871
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
2872
- return deepMerge2(a, b);
2873
- return a || b;
2874
- };
2875
- var flattenRecursive = (param, prop, stack = []) => {
2876
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
2877
- stack.push(objectized);
2878
- const extendOfExtend = objectized[prop];
2879
- if (extendOfExtend)
2880
- flattenRecursive(extendOfExtend, prop, stack);
2881
- delete objectized[prop];
2882
- return stack;
2883
- };
2884
- var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
2885
- if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
2886
- return param === element;
2887
- }
2888
- if (visited.has(param) || visited.has(element)) {
2889
- return true;
2890
- }
2891
- visited.add(param);
2892
- visited.add(element);
2893
- const keysParam = Object.keys(param);
2894
- const keysElement = Object.keys(element);
2895
- if (keysParam.length !== keysElement.length) {
2896
- return false;
2897
- }
2898
- for (const key of keysParam) {
2899
- if (!keysElement.includes(key)) {
2900
- return false;
2901
- }
2902
- const paramProp = param[key];
2903
- const elementProp = element[key];
2904
- if (!isEqualDeep(paramProp, elementProp, visited)) {
2905
- return false;
2906
- }
2907
- }
2908
- return true;
2909
- };
2910
- var deepContains = (obj1, obj2) => {
2911
- if (typeof obj1 !== typeof obj2) {
2912
- return false;
2913
- }
2914
- if ((0, import_types.isObjectLike)(obj1)) {
2915
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
2916
- if (obj1.length !== obj2.length) {
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) {
2917
2580
  return false;
2918
2581
  }
2919
- for (let i = 0; i < obj1.length; i++) {
2920
- if (!deepContains(obj1[i], obj2[i])) {
2582
+ for (const key of keysParam) {
2583
+ if (!keysElement.includes(key)) {
2921
2584
  return false;
2922
2585
  }
2923
- }
2924
- } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
2925
- for (const key in obj1) {
2926
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
2927
- if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
2586
+ const paramProp = param[key];
2587
+ const elementProp = element[key];
2588
+ if (!isEqualDeep(paramProp, elementProp, visited)) {
2928
2589
  return false;
2929
2590
  }
2930
2591
  }
2931
- }
2932
- } else {
2933
- return obj2 === obj1;
2934
- }
2935
- return true;
2936
- };
2937
- var removeFromObject = (obj, props) => {
2938
- if (props === void 0 || props === null)
2939
- return obj;
2940
- if ((0, import_types.is)(props)("string", "number")) {
2941
- delete obj[props];
2942
- } else if ((0, import_types.isArray)(props)) {
2943
- props.forEach((prop) => delete obj[prop]);
2944
- } else {
2945
- throw new Error("Invalid input: props must be a string or an array of strings");
2946
- }
2947
- return obj;
2948
- };
2949
- var createObjectWithoutPrototype = (obj) => {
2950
- if (obj === null || typeof obj !== "object") {
2951
- return obj;
2952
- }
2953
- const newObj = /* @__PURE__ */ Object.create(null);
2954
- for (const key in obj) {
2955
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
2956
- newObj[key] = createObjectWithoutPrototype(obj[key]);
2957
- }
2958
- }
2959
- return newObj;
2960
- };
2961
- var checkIfKeyIsComponent = (key) => {
2962
- const isFirstKeyString = (0, import_types.isString)(key);
2963
- if (!isFirstKeyString)
2964
- return;
2965
- const firstCharKey = key.slice(0, 1);
2966
- return /^[A-Z]*$/.test(firstCharKey);
2967
- };
2968
- var getChildrenComponentsByKey = (key, el) => {
2969
- if (key === el.key || el.__ref.__componentKey === key) {
2970
- return el;
2971
- }
2972
- if (el.extend) {
2973
- const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
2974
- const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
2975
- if (foundString || foundInArray)
2976
- return el;
2977
- }
2978
- };
2979
- var getExtendsInElement = (obj) => {
2980
- let result = [];
2981
- function traverse(o) {
2982
- for (const key in o) {
2983
- if (Object.hasOwnProperty.call(o, key)) {
2984
- if (checkIfKeyIsComponent(key)) {
2985
- result.push(key);
2986
- }
2987
- if (key === "extend") {
2988
- if (typeof o[key] === "string") {
2989
- result.push(o[key]);
2990
- } else if (Array.isArray(o[key])) {
2991
- result = result.concat(o[key]);
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
+ }
2992
2614
  }
2993
2615
  }
2994
- if (typeof o[key] === "object" && o[key] !== null) {
2995
- traverse(o[key]);
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]);
2996
2641
  }
2997
2642
  }
2998
- }
2999
- }
3000
- traverse(obj);
3001
- return result;
3002
- };
3003
- }
3004
- });
3005
- var require_function2 = __commonJS2({
3006
- "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
3007
- "use strict";
3008
- var __defProp22 = Object.defineProperty;
3009
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3010
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3011
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3012
- var __export22 = (target, all) => {
3013
- for (var name in all)
3014
- __defProp22(target, name, { get: all[name], enumerable: true });
3015
- };
3016
- var __copyProps22 = (to, from, except, desc) => {
3017
- if (from && typeof from === "object" || typeof from === "function") {
3018
- for (let key of __getOwnPropNames22(from))
3019
- if (!__hasOwnProp22.call(to, key) && key !== except)
3020
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
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
+ };
3021
2693
  }
3022
- return to;
3023
- };
3024
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3025
- var function_exports = {};
3026
- __export22(function_exports, {
3027
- debounce: () => debounce,
3028
- debounceOnContext: () => debounceOnContext,
3029
- isStringFunction: () => isStringFunction,
3030
- memoize: () => memoize
3031
2694
  });
3032
- module2.exports = __toCommonJS22(function_exports);
3033
- function debounce(func, wait, immediate) {
3034
- let timeout;
3035
- return function() {
3036
- const context = this;
3037
- const args = arguments;
3038
- const later = function() {
3039
- timeout = null;
3040
- if (!immediate)
3041
- func.apply(context, args);
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 });
3042
2705
  };
3043
- const callNow = immediate && !timeout;
3044
- clearTimeout(timeout);
3045
- timeout = setTimeout(later, wait);
3046
- if (callNow)
3047
- func.apply(context, args);
3048
- };
3049
- }
3050
- var debounceOnContext = (element, func, timeout = 300) => {
3051
- let timer;
3052
- return (...args) => {
3053
- clearTimeout(timer);
3054
- timer = setTimeout(() => {
3055
- func.apply(element, args);
3056
- }, timeout);
3057
- };
3058
- };
3059
- var memoize = (fn) => {
3060
- const cache = {};
3061
- return (...args) => {
3062
- const n = args[0];
3063
- if (n in cache) {
3064
- return cache[n];
3065
- } else {
3066
- const result = fn(n);
3067
- cache[n] = result;
3068
- return result;
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
+ };
3069
2739
  }
3070
- };
3071
- };
3072
- var isStringFunction = (inputString) => {
3073
- const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
3074
- return functionRegex.test(inputString);
3075
- };
3076
- }
3077
- });
3078
- var require_log2 = __commonJS2({
3079
- "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
3080
- "use strict";
3081
- var __defProp22 = Object.defineProperty;
3082
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3083
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3084
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3085
- var __export22 = (target, all) => {
3086
- for (var name in all)
3087
- __defProp22(target, name, { get: all[name], enumerable: true });
3088
- };
3089
- var __copyProps22 = (to, from, except, desc) => {
3090
- if (from && typeof from === "object" || typeof from === "function") {
3091
- for (let key of __getOwnPropNames22(from))
3092
- if (!__hasOwnProp22.call(to, key) && key !== except)
3093
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
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
+ };
3094
2766
  }
3095
- return to;
3096
- };
3097
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3098
- var log_exports = {};
3099
- __export22(log_exports, {
3100
- logGroupIf: () => logGroupIf,
3101
- logIf: () => logIf
3102
2767
  });
3103
- module2.exports = __toCommonJS22(log_exports);
3104
- var logIf = (bool, ...arg) => {
3105
- if (bool)
3106
- arg.map((v) => console.log(v));
3107
- };
3108
- var logGroupIf = (bool, key, ...arg) => {
3109
- if (bool) {
3110
- console.group(key);
3111
- arg.map((v) => console.log(v));
3112
- console.groupEnd(key);
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
+ };
3113
2805
  }
3114
- };
3115
- }
3116
- });
3117
- var require_cookie2 = __commonJS2({
3118
- "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
3119
- "use strict";
3120
- var __defProp22 = Object.defineProperty;
3121
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3122
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3123
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3124
- var __export22 = (target, all) => {
3125
- for (var name in all)
3126
- __defProp22(target, name, { get: all[name], enumerable: true });
3127
- };
3128
- var __copyProps22 = (to, from, except, desc) => {
3129
- if (from && typeof from === "object" || typeof from === "function") {
3130
- for (let key of __getOwnPropNames22(from))
3131
- if (!__hasOwnProp22.call(to, key) && key !== except)
3132
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
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
+ };
3133
2860
  }
3134
- return to;
3135
- };
3136
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3137
- var cookie_exports = {};
3138
- __export22(cookie_exports, {
3139
- getCookie: () => getCookie,
3140
- isMobile: () => isMobile,
3141
- setCookie: () => setCookie
3142
2861
  });
3143
- module2.exports = __toCommonJS22(cookie_exports);
3144
- var import_types = require_types2();
3145
- var import_utils32 = require_cjs3();
3146
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
3147
- var setCookie = (cname, cvalue, exdays = 365) => {
3148
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3149
- return;
3150
- const d = /* @__PURE__ */ new Date();
3151
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
3152
- const expires = `expires=${d.toUTCString()}`;
3153
- import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
3154
- };
3155
- var getCookie = (cname) => {
3156
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3157
- return;
3158
- const name = `${cname}=`;
3159
- const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
3160
- const ca = decodedCookie.split(";");
3161
- for (let i = 0; i < ca.length; i++) {
3162
- let c = ca[i];
3163
- while (c.charAt(0) === " ")
3164
- c = c.substring(1);
3165
- if (c.indexOf(name) === 0)
3166
- return c.substring(name.length, c.length);
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);
3026
+ }
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})`);
3089
+ }
3090
+ } else {
3091
+ await document.exitFullscreen();
3167
3092
  }
3168
- return "";
3169
3093
  };
3170
- }
3171
- });
3172
- var require_tags2 = __commonJS2({
3173
- "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
3174
- "use strict";
3175
- var __defProp22 = Object.defineProperty;
3176
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3177
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3178
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3179
- var __export22 = (target, all) => {
3180
- for (var name in all)
3181
- __defProp22(target, name, { get: all[name], enumerable: true });
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
+ });
3182
3099
  };
3183
- var __copyProps22 = (to, from, except, desc) => {
3184
- if (from && typeof from === "object" || typeof from === "function") {
3185
- for (let key of __getOwnPropNames22(from))
3186
- if (!__hasOwnProp22.call(to, key) && key !== except)
3187
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3188
- }
3189
- return to;
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);
3143
+ }
3144
+ });
3190
3145
  };
3191
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3192
- var tags_exports = {};
3193
- __export22(tags_exports, {
3194
- HTML_TAGS: () => HTML_TAGS,
3195
- isValidHtmlTag: () => isValidHtmlTag
3196
- });
3197
- module2.exports = __toCommonJS22(tags_exports);
3198
- var HTML_TAGS = {
3199
- root: [
3200
- "body",
3201
- "html"
3202
- ],
3203
- head: [
3204
- "title",
3205
- "base",
3206
- "meta",
3207
- "style"
3208
- ],
3209
- body: [
3210
- "string",
3211
- "fragment",
3212
- "a",
3213
- "abbr",
3214
- "acronym",
3215
- "address",
3216
- "applet",
3217
- "area",
3218
- "article",
3219
- "aside",
3220
- "audio",
3221
- "b",
3222
- "basefont",
3223
- "bdi",
3224
- "bdo",
3225
- "big",
3226
- "blockquote",
3227
- "br",
3228
- "button",
3229
- "canvas",
3230
- "caption",
3231
- "center",
3232
- "cite",
3233
- "code",
3234
- "search",
3235
- "col",
3236
- "colgroup",
3237
- "data",
3238
- "datalist",
3239
- "dd",
3240
- "del",
3241
- "details",
3242
- "dfn",
3243
- "dialog",
3244
- "dir",
3245
- "div",
3246
- "dl",
3247
- "dt",
3248
- "em",
3249
- "embed",
3250
- "fieldset",
3251
- "figcaption",
3252
- "figure",
3253
- "font",
3254
- "footer",
3255
- "form",
3256
- "frame",
3257
- "frameset",
3258
- "h1",
3259
- "h2",
3260
- "h3",
3261
- "h4",
3262
- "h5",
3263
- "h6",
3264
- "head",
3265
- "header",
3266
- "hr",
3267
- "i",
3268
- "iframe",
3269
- "img",
3270
- "input",
3271
- "ins",
3272
- "kbd",
3273
- "label",
3274
- "legend",
3275
- "li",
3276
- "link",
3277
- "main",
3278
- "map",
3279
- "mark",
3280
- "meter",
3281
- "nav",
3282
- "noframes",
3283
- "noscript",
3284
- "object",
3285
- "ol",
3286
- "optgroup",
3287
- "option",
3288
- "output",
3289
- "p",
3290
- "param",
3291
- "picture",
3292
- "pre",
3293
- "progress",
3294
- "hgroup",
3295
- "q",
3296
- "rp",
3297
- "rt",
3298
- "ruby",
3299
- "s",
3300
- "samp",
3301
- "script",
3302
- "section",
3303
- "select",
3304
- "small",
3305
- "source",
3306
- "span",
3307
- "strike",
3308
- "strong",
3309
- "sub",
3310
- "summary",
3311
- "sup",
3312
- "table",
3313
- "tbody",
3314
- "td",
3315
- "template",
3316
- "hgroup",
3317
- "textarea",
3318
- "tfoot",
3319
- "th",
3320
- "thead",
3321
- "time",
3322
- "tr",
3323
- "track",
3324
- "tt",
3325
- "u",
3326
- "ul",
3327
- "var",
3328
- "video",
3329
- "wbr",
3330
- // SVG
3331
- "svg",
3332
- "path"
3333
- ]
3146
+ var loadJavascriptFileSync = (FILE_URL, doc = document, fallback, type = "text/javascript") => {
3147
+ const xhr = new window.XMLHttpRequest();
3148
+ xhr.open("GET", FILE_URL, false);
3149
+ xhr.send();
3150
+ if (xhr.status === 200) {
3151
+ const scriptEle = doc.createElement("script");
3152
+ scriptEle.type = type;
3153
+ scriptEle.text = xhr.responseText;
3154
+ doc.body.appendChild(scriptEle);
3155
+ if (typeof fallback === "function")
3156
+ fallback();
3157
+ } else {
3158
+ throw new Error(`Failed to load the script ${FILE_URL}`);
3159
+ }
3160
+ };
3161
+ var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3162
+ return new Promise((resolve, reject) => {
3163
+ try {
3164
+ const linkElem = doc.createElement("link");
3165
+ linkElem.rel = "stylesheet";
3166
+ linkElem.href = FILE_URL;
3167
+ linkElem.addEventListener("load", (ev) => {
3168
+ resolve({
3169
+ status: true
3170
+ });
3171
+ });
3172
+ doc.head.appendChild(linkElem);
3173
+ } catch (error) {
3174
+ reject(error);
3175
+ }
3176
+ });
3334
3177
  };
3335
- var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
3336
- }
3337
- });
3338
- var require_cjs3 = __commonJS2({
3339
- "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
3340
- "use strict";
3341
- var __defProp22 = Object.defineProperty;
3342
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3343
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3344
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3345
- var __copyProps22 = (to, from, except, desc) => {
3346
- if (from && typeof from === "object" || typeof from === "function") {
3347
- for (let key of __getOwnPropNames22(from))
3348
- if (!__hasOwnProp22.call(to, key) && key !== except)
3349
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3350
- }
3351
- return to;
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];
3352
3231
  };
3353
- var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
3354
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3355
- var utils_exports = {};
3356
- module2.exports = __toCommonJS22(utils_exports);
3357
- __reExport(utils_exports, require_key2(), module2.exports);
3358
- __reExport(utils_exports, require_env2(), module2.exports);
3359
- __reExport(utils_exports, require_types2(), module2.exports);
3360
- __reExport(utils_exports, require_object2(), module2.exports);
3361
- __reExport(utils_exports, require_function2(), module2.exports);
3362
- __reExport(utils_exports, require_array2(), module2.exports);
3363
- __reExport(utils_exports, require_node2(), module2.exports);
3364
- __reExport(utils_exports, require_log2(), module2.exports);
3365
- __reExport(utils_exports, require_string2(), module2.exports);
3366
- __reExport(utils_exports, require_globals2(), module2.exports);
3367
- __reExport(utils_exports, require_cookie2(), module2.exports);
3368
- __reExport(utils_exports, require_tags2(), module2.exports);
3369
3232
  }
3370
3233
  });
3371
- var src_exports = {};
3372
- __export2(src_exports, {
3373
- arrayzeValue: () => arrayzeValue,
3374
- copyStringToClipboard: () => copyStringToClipboard,
3375
- fibonacciNumberByIndex: () => fibonacciNumberByIndex,
3376
- findClosestNumber: () => findClosestNumber,
3377
- findClosestNumberInFactory: () => findClosestNumberInFactory,
3378
- formatDate: () => formatDate,
3379
- isPhoto: () => isPhoto,
3380
- loadCssFile: () => loadCssFile,
3381
- loadJavascript: () => loadJavascript,
3382
- loadJavascriptFile: () => loadJavascriptFile,
3383
- removeChars: () => removeChars,
3384
- toCamelCase: () => toCamelCase,
3385
- toDashCase: () => toDashCase,
3386
- toDescriptionCase: () => toDescriptionCase,
3387
- toTitleCase: () => toTitleCase,
3388
- toggleFullscreen: () => toggleFullscreen
3234
+
3235
+ // src/system/color.js
3236
+ var color_exports = {};
3237
+ __export(color_exports, {
3238
+ getColor: () => getColor,
3239
+ getMediaColor: () => getMediaColor,
3240
+ setColor: () => setColor,
3241
+ setGradient: () => setGradient
3389
3242
  });
3390
- module.exports = __toCommonJS2(src_exports);
3391
- var import_utils22 = __toESM2(require_cjs3(), 1);
3392
- var toggleFullscreen = (el) => {
3393
- if (!document.fullscreenElement) {
3394
- el.node.requestFullscreen().catch((err) => {
3395
- console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
3396
- });
3397
- } else {
3398
- document.exitFullscreen();
3399
- }
3243
+ module.exports = __toCommonJS(color_exports);
3244
+ var import_utils7 = __toESM(require_cjs(), 1);
3245
+
3246
+ // src/factory.js
3247
+ var import_utils = __toESM(require_cjs(), 1);
3248
+
3249
+ // src/defaultConfig/index.js
3250
+ var defaultConfig_exports = {};
3251
+ __export(defaultConfig_exports, {
3252
+ ANIMATION: () => ANIMATION,
3253
+ BREAKPOINTS: () => BREAKPOINTS,
3254
+ CASES: () => CASES,
3255
+ COLOR: () => COLOR,
3256
+ DEVICES: () => DEVICES,
3257
+ DOCUMENT: () => DOCUMENT,
3258
+ FONT: () => FONT,
3259
+ FONT_FACE: () => FONT_FACE,
3260
+ FONT_FAMILY: () => FONT_FAMILY,
3261
+ FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
3262
+ GRADIENT: () => GRADIENT,
3263
+ GRID: () => GRID,
3264
+ ICONS: () => ICONS,
3265
+ MEDIA: () => MEDIA,
3266
+ RESET: () => RESET,
3267
+ SEMANTIC_ICONS: () => SEMANTIC_ICONS,
3268
+ SEQUENCE: () => SEQUENCE,
3269
+ SHADOW: () => SHADOW,
3270
+ SPACING: () => SPACING,
3271
+ SVG: () => SVG,
3272
+ SVG_DATA: () => SVG_DATA,
3273
+ TEMPLATES: () => TEMPLATES,
3274
+ THEME: () => THEME,
3275
+ TIMING: () => TIMING,
3276
+ TYPOGRAPHY: () => TYPOGRAPHY,
3277
+ UNIT: () => UNIT
3278
+ });
3279
+
3280
+ // src/defaultConfig/sequence.js
3281
+ var SEQUENCE = {
3282
+ "minor-second": 1.067,
3283
+ "major-second": 1.125,
3284
+ "minor-third": 1.2,
3285
+ "major-third": 1.25,
3286
+ "perfect-fourth": 1.333,
3287
+ "augmented-fourth": 1.414,
3288
+ "perfect-fifth": 1.5,
3289
+ "minor-sixth": 1.6,
3290
+ phi: 1.618,
3291
+ // golden-ratio
3292
+ "major-sixth": 1.667,
3293
+ "square-root-3": 1.732,
3294
+ // theodorus
3295
+ "minor-seventh": 1.778,
3296
+ "major-seventh": 1.875,
3297
+ octave: 2,
3298
+ "square-root-5": 2.23,
3299
+ // pythagoras
3300
+ "major-tenth": 2.5,
3301
+ "major-eleventh": 2.667,
3302
+ "major-twelfth": 3,
3303
+ pi: 3.14,
3304
+ // archimedes
3305
+ "double-octave": 4
3306
+ };
3307
+
3308
+ // src/defaultConfig/unit.js
3309
+ var UNIT = {
3310
+ default: "em"
3400
3311
  };
3401
- var import_utils3 = __toESM2(require_cjs3(), 1);
3402
- var findClosestNumber = (number, arr) => {
3403
- return ((0, import_utils3.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
3404
- return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
3405
- });
3312
+
3313
+ // src/defaultConfig/typography.js
3314
+ var defaultProps = {
3315
+ browserDefault: 16,
3316
+ base: 16,
3317
+ type: "font-size",
3318
+ ratio: SEQUENCE["minor-third"],
3319
+ range: [-3, 12],
3320
+ h1Matches: 6,
3321
+ lineHeight: 1.5,
3322
+ subSequence: true,
3323
+ mediaRegenerate: false,
3324
+ unit: "em",
3325
+ templates: {},
3326
+ sequence: {},
3327
+ scales: {},
3328
+ vars: {}
3406
3329
  };
3407
- var findClosestNumberInFactory = (val, factory) => {
3408
- val = parseFloat(val);
3409
- if ((0, import_utils3.isObject)(factory))
3410
- factory = Object.values(factory);
3411
- return findClosestNumber(val, factory);
3330
+ var TYPOGRAPHY = defaultProps;
3331
+
3332
+ // src/defaultConfig/font.js
3333
+ var FONT = {};
3334
+
3335
+ // src/defaultConfig/font-family.js
3336
+ var FONT_FAMILY = {};
3337
+ var FONT_FAMILY_TYPES = {
3338
+ "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
3339
+ serif: "Times New Roman, Georgia, serif, --system-default",
3340
+ monospace: "Courier New, monospace, --system-default"
3412
3341
  };
3413
- var formatDate = (timestamp) => {
3414
- if (!timestamp)
3415
- return "";
3416
- const d = new Date(timestamp);
3417
- const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
3418
- const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
3419
- const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
3420
- return `${da} ${mo}, ${ye}`;
3342
+ var FONT_FACE = {};
3343
+
3344
+ // src/defaultConfig/media.js
3345
+ var MEDIA = {
3346
+ tv: "(min-width: 2780px)",
3347
+ light: "(prefers-color-scheme: light)",
3348
+ dark: "(prefers-color-scheme: dark)",
3349
+ print: "print"
3421
3350
  };
3422
- var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
3423
- const fib = [0, 1];
3424
- for (let i = 2; i <= n; i++) {
3425
- fib[i] = fib[i - 1] + fib[i - 2];
3426
- }
3427
- return fib[n];
3351
+
3352
+ // src/defaultConfig/spacing.js
3353
+ var defaultProps2 = {
3354
+ base: TYPOGRAPHY.base,
3355
+ type: "spacing",
3356
+ ratio: SEQUENCE.phi,
3357
+ range: [-5, 15],
3358
+ subSequence: true,
3359
+ mediaRegenerate: false,
3360
+ unit: "em",
3361
+ sequence: {},
3362
+ scales: {},
3363
+ vars: {}
3428
3364
  };
3429
- var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3430
- return new Promise((resolve, reject) => {
3431
- try {
3432
- const scriptEle = doc.createElement("script");
3433
- scriptEle.type = type;
3434
- scriptEle.async = async;
3435
- scriptEle.src = FILE_URL;
3436
- scriptEle.addEventListener("load", (ev) => {
3437
- resolve({
3438
- status: true
3439
- });
3440
- });
3441
- scriptEle.addEventListener("error", (ev) => {
3442
- reject({
3443
- status: false,
3444
- message: `Failed to load the script ${FILE_URL}`
3445
- });
3446
- });
3447
- doc.body.appendChild(scriptEle);
3448
- } catch (error) {
3449
- reject(error);
3450
- }
3451
- });
3365
+ var SPACING = defaultProps2;
3366
+
3367
+ // src/defaultConfig/color.js
3368
+ var COLOR = {};
3369
+ var GRADIENT = {};
3370
+
3371
+ // src/defaultConfig/theme.js
3372
+ var THEME = {};
3373
+
3374
+ // src/defaultConfig/shadow.js
3375
+ var SHADOW = {};
3376
+
3377
+ // src/defaultConfig/icons.js
3378
+ var ICONS = {};
3379
+ var SEMANTIC_ICONS = {};
3380
+
3381
+ // src/defaultConfig/timing.js
3382
+ var defaultProps3 = {
3383
+ default: 150,
3384
+ base: 150,
3385
+ type: "timing",
3386
+ ratio: SEQUENCE["perfect-fourth"],
3387
+ range: [-3, 12],
3388
+ mediaRegenerate: false,
3389
+ unit: "ms",
3390
+ sequence: {},
3391
+ scales: {},
3392
+ vars: {}
3452
3393
  };
3453
- var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3454
- return new Promise((resolve, reject) => {
3455
- try {
3456
- const linkElem = doc.createElement("link");
3457
- linkElem.rel = "stylesheet";
3458
- linkElem.href = FILE_URL;
3459
- linkElem.addEventListener("load", (ev) => {
3460
- resolve({
3461
- status: true
3462
- });
3463
- });
3464
- doc.head.appendChild(linkElem);
3465
- } catch (error) {
3466
- reject(error);
3467
- }
3468
- });
3394
+ var TIMING = defaultProps3;
3395
+
3396
+ // src/defaultConfig/document.js
3397
+ var DOCUMENT = {};
3398
+
3399
+ // src/defaultConfig/responsive.js
3400
+ var BREAKPOINTS = {
3401
+ screenL: 1920,
3402
+ screenM: 1680,
3403
+ screenS: 1440,
3404
+ tabletL: 1366,
3405
+ tabletM: 1280,
3406
+ tabletS: 1024,
3407
+ mobileL: 768,
3408
+ mobileM: 560,
3409
+ mobileS: 480,
3410
+ mobileXS: 375
3469
3411
  };
3470
- var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
3471
- try {
3472
- const scriptEle = doc.createElement("script");
3473
- scriptEle.type = type;
3474
- scriptEle.async = async;
3475
- scriptEle.id = id;
3476
- scriptEle.innerHTML = body;
3477
- doc.body.appendChild(scriptEle);
3478
- } catch (error) {
3479
- console.warn(error);
3480
- }
3412
+ var DEVICES = {
3413
+ screenL: [1920, 1024],
3414
+ screenM: [1680, 1024],
3415
+ screenS: [1440, 978],
3416
+ tabletL: [1366, 926],
3417
+ tabletM: [1280, 768],
3418
+ tabletS: [1024, 768],
3419
+ mobileL: [768, 375],
3420
+ mobileM: [560, 768],
3421
+ mobileS: [480, 768],
3422
+ mobileXS: [375, 768]
3481
3423
  };
3482
- var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
3483
- var copyStringToClipboard = (str) => {
3484
- const el = document.createElement("textarea");
3485
- el.value = str;
3486
- el.setAttribute("readonly", "");
3487
- el.style = { position: "absolute", left: "-9999px" };
3488
- document.body.appendChild(el);
3489
- el.select();
3490
- document.execCommand("copy");
3491
- document.body.removeChild(el);
3424
+
3425
+ // src/defaultConfig/cases.js
3426
+ var CASES = {};
3427
+
3428
+ // src/defaultConfig/animation.js
3429
+ var ANIMATION = {};
3430
+
3431
+ // src/defaultConfig/svg.js
3432
+ var SVG = {};
3433
+ var SVG_DATA = {};
3434
+
3435
+ // src/defaultConfig/templates.js
3436
+ var TEMPLATES = {};
3437
+
3438
+ // src/defaultConfig/grid.js
3439
+ var defaultProps4 = {};
3440
+ var GRID = defaultProps4;
3441
+
3442
+ // src/defaultConfig/index.js
3443
+ var RESET = {};
3444
+
3445
+ // src/factory.js
3446
+ var CSS_VARS = {};
3447
+ var CONFIG = {
3448
+ verbose: false,
3449
+ useVariable: true,
3450
+ useReset: true,
3451
+ CSS_VARS,
3452
+ ...defaultConfig_exports
3492
3453
  };
3493
- var removeChars = (str) => {
3494
- return str.replace(/[^a-zA-Z0-9_]/g, "");
3454
+ var cachedConfig = (0, import_utils.deepClone)(CONFIG);
3455
+ var FACTORY = {
3456
+ active: "0",
3457
+ 0: CONFIG
3495
3458
  };
3496
- var toCamelCase = (str) => {
3497
- return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
3498
- return index === 0 ? word.toLowerCase() : word.toUpperCase();
3499
- }).replaceAll(/\s+/g, "");
3459
+ var getActiveConfig = (def) => {
3460
+ return FACTORY[def || FACTORY.active] || CONFIG;
3500
3461
  };
3501
- var toTitleCase = (str) => str && str.replace(
3502
- /\w\S*/g,
3503
- (txt) => {
3504
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
3462
+
3463
+ // src/utils/color.js
3464
+ var import_globals = __toESM(require_cjs2(), 1);
3465
+ var import_utils2 = __toESM(require_cjs(), 1);
3466
+ var colorStringToRgbaArray = (color) => {
3467
+ if (color === "")
3468
+ return [0, 0, 0, 0];
3469
+ if (color.toLowerCase() === "transparent")
3470
+ return [0, 0, 0, 0];
3471
+ if (color[0] === "#") {
3472
+ if (color.length < 7) {
3473
+ color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
3474
+ }
3475
+ return [
3476
+ parseInt(color.substr(1, 2), 16),
3477
+ parseInt(color.substr(3, 2), 16),
3478
+ parseInt(color.substr(5, 2), 16),
3479
+ color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
3480
+ ];
3505
3481
  }
3506
- );
3507
- var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
3508
- var toDescriptionCase = (str = "") => {
3509
- if (typeof str !== "string")
3510
- return;
3511
- const result = str.replace(/([A-Z])/g, " $1");
3512
- return result.charAt(0).toUpperCase() + result.slice(1);
3482
+ if (color.indexOf("rgb") === -1) {
3483
+ if (import_globals.document && import_globals.window) {
3484
+ const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
3485
+ const flag = "rgb(1, 2, 3)";
3486
+ elem.style.color = flag;
3487
+ if (elem.style.color !== flag) {
3488
+ import_globals.document.body.removeChild(elem);
3489
+ return;
3490
+ }
3491
+ elem.style.color = color;
3492
+ if (elem.style.color === flag || elem.style.color === "") {
3493
+ import_globals.document.body.removeChild(elem);
3494
+ return [0, 0, 0, 0];
3495
+ }
3496
+ color = import_globals.window.getComputedStyle(elem).color;
3497
+ import_globals.document.body.removeChild(elem);
3498
+ }
3499
+ }
3500
+ if (color.indexOf("rgb") === 0) {
3501
+ if (color.indexOf("rgba") === -1)
3502
+ color = `${color}, 1`;
3503
+ return color.match(/[\.\d]+/g).map((a) => +a);
3504
+ }
3505
+ return [0, 0, 0, 0];
3506
+ };
3507
+ var hexToRgbArray = (hex, alpha = 1) => {
3508
+ const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
3509
+ return [r, g, b];
3510
+ };
3511
+ var rgbArrayToHex = ([r, g, b]) => {
3512
+ return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
3513
+ };
3514
+ var rgbToHSL = (r, g, b) => {
3515
+ const a = Math.max(r, g, b);
3516
+ const n = a - Math.min(r, g, b);
3517
+ const f = 1 - Math.abs(a + a - n - 1);
3518
+ const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
3519
+ return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
3520
+ };
3521
+ var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
3522
+ Math.min(k - 3, 9 - k, 1),
3523
+ -1
3524
+ )) => [f(0), f(8), f(4)];
3525
+ var getColorShade = (col, amt) => {
3526
+ const num = parseInt(col, 16);
3527
+ let r = (num >> 16) + amt;
3528
+ if (r > 255)
3529
+ r = 255;
3530
+ else if (r < 0)
3531
+ r = 0;
3532
+ let b = (num >> 8 & 255) + amt;
3533
+ if (b > 255)
3534
+ b = 255;
3535
+ else if (b < 0)
3536
+ b = 0;
3537
+ let g = (num & 255) + amt;
3538
+ if (g > 255)
3539
+ g = 255;
3540
+ else if (g < 0)
3541
+ g = 0;
3542
+ return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
3513
3543
  };
3514
- var arrayzeValue = (val) => {
3515
- if ((0, import_utils22.isArray)(val))
3516
- return val;
3517
- if ((0, import_utils22.isString)(val))
3518
- return val.split(" ");
3519
- if ((0, import_utils22.isObject)(val))
3520
- return Object.values(val);
3521
- if ((0, import_utils22.isNumber)(val))
3522
- return [val];
3544
+ var getRgbTone = (rgb, tone) => {
3545
+ if ((0, import_utils2.isString)(rgb) && rgb.includes("rgb"))
3546
+ rgb = colorStringToRgbaArray(rgb).join(", ");
3547
+ if ((0, import_utils2.isString)(rgb))
3548
+ rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
3549
+ if ((0, import_utils2.isNumber)(tone))
3550
+ tone += "";
3551
+ const toHex = rgbArrayToHex(rgb);
3552
+ const abs = tone.slice(0, 1);
3553
+ if (abs === "-" || abs === "+") {
3554
+ const colorShade = getColorShade(toHex, parseFloat(tone));
3555
+ return hexToRgbArray(colorShade).join(", ");
3556
+ } else {
3557
+ const [r, g, b] = rgb;
3558
+ const hsl = rgbToHSL(r, g, b);
3559
+ const [h, s, l] = hsl;
3560
+ const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
3561
+ return newRgb;
3562
+ }
3523
3563
  };
3524
3564
 
3565
+ // src/utils/sequence.js
3566
+ var import_utils3 = __toESM(require_cjs(), 1);
3567
+ var import_utils4 = __toESM(require_cjs3(), 1);
3568
+
3525
3569
  // src/utils/var.js
3526
- var import_utils6 = __toESM(require_cjs(), 1);
3570
+ var import_utils5 = __toESM(require_cjs(), 1);
3527
3571
 
3528
3572
  // src/utils/sprite.js
3529
- var import_utils7 = __toESM(require_cjs(), 1);
3573
+ var import_utils6 = __toESM(require_cjs(), 1);
3530
3574
 
3531
3575
  // src/system/color.js
3532
3576
  var getColor = (value, key, config) => {
3533
3577
  const CONFIG2 = config || getActiveConfig();
3534
- if (!(0, import_utils8.isString)(value)) {
3578
+ if (!(0, import_utils7.isString)(value)) {
3535
3579
  if (CONFIG2.verbose)
3536
3580
  console.warn(value, "- type for color is not valid");
3537
3581
  return;
@@ -3540,7 +3584,7 @@ var getColor = (value, key, config) => {
3540
3584
  return `var(${value})`;
3541
3585
  if (key && value[key])
3542
3586
  value = value[key];
3543
- const [name, alpha, tone] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
3587
+ const [name, alpha, tone] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
3544
3588
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
3545
3589
  let val = COLOR2[name] || GRADIENT2[name];
3546
3590
  if (!val) {
@@ -3572,17 +3616,17 @@ var getMediaColor = (value, globalTheme, config) => {
3572
3616
  const CONFIG2 = config || getActiveConfig();
3573
3617
  if (!globalTheme)
3574
3618
  globalTheme = CONFIG2.globalTheme;
3575
- if (!(0, import_utils8.isString)(value)) {
3619
+ if (!(0, import_utils7.isString)(value)) {
3576
3620
  if (CONFIG2.verbose)
3577
3621
  console.warn(value, "- type for color is not valid");
3578
3622
  return;
3579
3623
  }
3580
3624
  if (value.slice(0, 2) === "--")
3581
3625
  return `var(${value})`;
3582
- const [name] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
3626
+ const [name] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
3583
3627
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
3584
3628
  const val = COLOR2[name] || GRADIENT2[name];
3585
- const isObj = (0, import_utils8.isObject)(val);
3629
+ const isObj = (0, import_utils7.isObject)(val);
3586
3630
  if (isObj && val.value)
3587
3631
  return getColor(value, `@${globalTheme}`, config);
3588
3632
  else if (isObj) {
@@ -3605,7 +3649,7 @@ var getMediaColor = (value, globalTheme, config) => {
3605
3649
  };
3606
3650
  var setColor = (val, key, suffix) => {
3607
3651
  const CONFIG2 = getActiveConfig();
3608
- if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--") {
3652
+ if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--") {
3609
3653
  val = getColor(val.slice(2));
3610
3654
  if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
3611
3655
  if (CONFIG2.verbose)
@@ -3613,13 +3657,13 @@ var setColor = (val, key, suffix) => {
3613
3657
  val = val.split(" ")[0];
3614
3658
  }
3615
3659
  }
3616
- if ((0, import_utils8.isArray)(val)) {
3660
+ if ((0, import_utils7.isArray)(val)) {
3617
3661
  return {
3618
3662
  "@light": setColor(val[0], key, "light"),
3619
3663
  "@dark": setColor(val[1], key, "dark")
3620
3664
  };
3621
3665
  }
3622
- if ((0, import_utils8.isObject)(val)) {
3666
+ if ((0, import_utils7.isObject)(val)) {
3623
3667
  const obj = {};
3624
3668
  for (const variant in val) {
3625
3669
  obj[variant] = setColor(
@@ -3648,15 +3692,15 @@ var setColor = (val, key, suffix) => {
3648
3692
  };
3649
3693
  var setGradient = (val, key, suffix) => {
3650
3694
  const CONFIG2 = getActiveConfig();
3651
- if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--")
3695
+ if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--")
3652
3696
  val = getColor(val.slice(2));
3653
- if ((0, import_utils8.isArray)(val)) {
3697
+ if ((0, import_utils7.isArray)(val)) {
3654
3698
  return {
3655
3699
  "@light": setGradient(val[0], key, "light"),
3656
3700
  "@dark": setGradient(val[0], key, "dark")
3657
3701
  };
3658
3702
  }
3659
- if ((0, import_utils8.isObject)(val)) {
3703
+ if ((0, import_utils7.isObject)(val)) {
3660
3704
  const obj = {};
3661
3705
  for (const variant in val)
3662
3706
  obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);