@symbo.ls/scratch 2.11.131 → 2.11.132

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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/defaultConfig/animation.js +26 -0
  3. package/dist/cjs/defaultConfig/cases.js +26 -0
  4. package/dist/cjs/defaultConfig/color.js +28 -0
  5. package/dist/cjs/defaultConfig/document.js +26 -0
  6. package/dist/cjs/defaultConfig/font-family.js +34 -0
  7. package/dist/cjs/defaultConfig/font.js +26 -0
  8. package/dist/cjs/defaultConfig/icons.js +26 -0
  9. package/dist/cjs/defaultConfig/index.js +221 -0
  10. package/dist/cjs/defaultConfig/media.js +51 -0
  11. package/dist/cjs/defaultConfig/responsive.js +50 -0
  12. package/dist/cjs/defaultConfig/sequence.js +51 -0
  13. package/dist/cjs/defaultConfig/spacing.js +85 -0
  14. package/dist/cjs/defaultConfig/svg.js +28 -0
  15. package/dist/cjs/defaultConfig/templates.js +26 -0
  16. package/dist/cjs/defaultConfig/theme.js +26 -0
  17. package/dist/cjs/defaultConfig/timing.js +67 -0
  18. package/dist/cjs/defaultConfig/typography.js +71 -0
  19. package/dist/cjs/defaultConfig/unit.js +28 -0
  20. package/dist/cjs/factory.js +1442 -0
  21. package/dist/cjs/index.js +3059 -0
  22. package/dist/cjs/package.json +4 -0
  23. package/dist/cjs/set.js +2428 -0
  24. package/dist/cjs/system/color.js +1711 -0
  25. package/dist/cjs/system/document.js +1504 -0
  26. package/dist/cjs/system/font.js +1544 -0
  27. package/dist/cjs/system/index.js +2616 -0
  28. package/dist/cjs/system/reset.js +1613 -0
  29. package/dist/cjs/system/spacing.js +1788 -0
  30. package/dist/cjs/system/svg.js +1615 -0
  31. package/dist/cjs/system/theme.js +1799 -0
  32. package/dist/cjs/system/timing.js +1701 -0
  33. package/dist/cjs/system/typography.js +1754 -0
  34. package/dist/cjs/tests/index.js +30 -0
  35. package/dist/cjs/transforms/index.js +1977 -0
  36. package/dist/cjs/utils/color.js +1399 -0
  37. package/dist/cjs/utils/font.js +72 -0
  38. package/dist/cjs/utils/index.js +1977 -0
  39. package/dist/cjs/utils/sequence.js +1611 -0
  40. package/dist/cjs/utils/sprite.js +1486 -0
  41. package/dist/cjs/utils/theme.js +34 -0
  42. package/dist/cjs/utils/var.js +1467 -0
  43. package/package.json +2 -2
@@ -0,0 +1,1711 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+
33
+ // ../../node_modules/@domql/utils/dist/cjs/key.js
34
+ var require_key = __commonJS({
35
+ "../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
36
+ "use strict";
37
+ var __defProp2 = Object.defineProperty;
38
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
41
+ var __export2 = (target, all) => {
42
+ for (var name in all)
43
+ __defProp2(target, name, { get: all[name], enumerable: true });
44
+ };
45
+ var __copyProps2 = (to, from, except, desc) => {
46
+ if (from && typeof from === "object" || typeof from === "function") {
47
+ for (let key of __getOwnPropNames2(from))
48
+ if (!__hasOwnProp2.call(to, key) && key !== except)
49
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
50
+ }
51
+ return to;
52
+ };
53
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
54
+ var key_exports = {};
55
+ __export2(key_exports, {
56
+ createKey: () => createKey,
57
+ createSnapshotId: () => createSnapshotId
58
+ });
59
+ module2.exports = __toCommonJS2(key_exports);
60
+ var createKey = function() {
61
+ let index = 0;
62
+ function newId() {
63
+ index++;
64
+ return index;
65
+ }
66
+ return newId;
67
+ }();
68
+ var createSnapshotId = createKey;
69
+ }
70
+ });
71
+
72
+ // ../../node_modules/@domql/utils/dist/cjs/env.js
73
+ var require_env = __commonJS({
74
+ "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
75
+ "use strict";
76
+ var __defProp2 = Object.defineProperty;
77
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
78
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
79
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
80
+ var __export2 = (target, all) => {
81
+ for (var name in all)
82
+ __defProp2(target, name, { get: all[name], enumerable: true });
83
+ };
84
+ var __copyProps2 = (to, from, except, desc) => {
85
+ if (from && typeof from === "object" || typeof from === "function") {
86
+ for (let key of __getOwnPropNames2(from))
87
+ if (!__hasOwnProp2.call(to, key) && key !== except)
88
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
89
+ }
90
+ return to;
91
+ };
92
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
93
+ var env_exports = {};
94
+ __export2(env_exports, {
95
+ NODE_ENV: () => NODE_ENV,
96
+ getNev: () => getNev,
97
+ isDevelopment: () => isDevelopment,
98
+ isProduction: () => isProduction,
99
+ isTest: () => isTest
100
+ });
101
+ module2.exports = __toCommonJS2(env_exports);
102
+ var NODE_ENV = "development";
103
+ var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
104
+ var isTest = (env = NODE_ENV) => env === "test";
105
+ var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
106
+ var getNev = (key, env = NODE_ENV) => env[key];
107
+ }
108
+ });
109
+
110
+ // ../../node_modules/@domql/utils/dist/cjs/globals.js
111
+ var require_globals = __commonJS({
112
+ "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
113
+ "use strict";
114
+ var __defProp2 = Object.defineProperty;
115
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
116
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
117
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
118
+ var __export2 = (target, all) => {
119
+ for (var name in all)
120
+ __defProp2(target, name, { get: all[name], enumerable: true });
121
+ };
122
+ var __copyProps2 = (to, from, except, desc) => {
123
+ if (from && typeof from === "object" || typeof from === "function") {
124
+ for (let key of __getOwnPropNames2(from))
125
+ if (!__hasOwnProp2.call(to, key) && key !== except)
126
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
127
+ }
128
+ return to;
129
+ };
130
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
131
+ var globals_exports = {};
132
+ __export2(globals_exports, {
133
+ document: () => document3,
134
+ global: () => global,
135
+ self: () => self,
136
+ window: () => window2
137
+ });
138
+ module2.exports = __toCommonJS2(globals_exports);
139
+ var global = globalThis;
140
+ var self = globalThis;
141
+ var window2 = globalThis;
142
+ var document3 = window2.document;
143
+ }
144
+ });
145
+
146
+ // ../../node_modules/@domql/utils/dist/cjs/node.js
147
+ var require_node = __commonJS({
148
+ "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
149
+ "use strict";
150
+ var __defProp2 = Object.defineProperty;
151
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
152
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
153
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
154
+ var __export2 = (target, all) => {
155
+ for (var name in all)
156
+ __defProp2(target, name, { get: all[name], enumerable: true });
157
+ };
158
+ var __copyProps2 = (to, from, except, desc) => {
159
+ if (from && typeof from === "object" || typeof from === "function") {
160
+ for (let key of __getOwnPropNames2(from))
161
+ if (!__hasOwnProp2.call(to, key) && key !== except)
162
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
163
+ }
164
+ return to;
165
+ };
166
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
167
+ var node_exports = {};
168
+ __export2(node_exports, {
169
+ isHtmlElement: () => isHtmlElement,
170
+ isNode: () => isNode
171
+ });
172
+ module2.exports = __toCommonJS2(node_exports);
173
+ var import_globals2 = require_globals();
174
+ var isNode = (obj) => {
175
+ return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
176
+ };
177
+ var isHtmlElement = (obj) => {
178
+ return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
179
+ };
180
+ }
181
+ });
182
+
183
+ // ../../node_modules/@domql/utils/dist/cjs/types.js
184
+ var require_types = __commonJS({
185
+ "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
186
+ "use strict";
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
+ for (var name in all)
193
+ __defProp2(target, name, { get: all[name], enumerable: true });
194
+ };
195
+ var __copyProps2 = (to, from, except, desc) => {
196
+ if (from && typeof from === "object" || typeof from === "function") {
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
+ }
201
+ return to;
202
+ };
203
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
204
+ var types_exports = {};
205
+ __export2(types_exports, {
206
+ TYPES: () => TYPES,
207
+ is: () => is,
208
+ isArray: () => isArray5,
209
+ isBoolean: () => isBoolean,
210
+ isDefined: () => isDefined2,
211
+ isFunction: () => isFunction,
212
+ isNot: () => isNot,
213
+ isNull: () => isNull,
214
+ isNumber: () => isNumber2,
215
+ isObject: () => isObject5,
216
+ isObjectLike: () => isObjectLike2,
217
+ isString: () => isString6,
218
+ isUndefined: () => isUndefined
219
+ });
220
+ module2.exports = __toCommonJS2(types_exports);
221
+ var import_node = require_node();
222
+ var isObject5 = (arg) => {
223
+ if (arg === null)
224
+ return false;
225
+ return typeof arg === "object" && arg.constructor === Object;
226
+ };
227
+ var isString6 = (arg) => typeof arg === "string";
228
+ var isNumber2 = (arg) => typeof arg === "number";
229
+ var isFunction = (arg) => typeof arg === "function";
230
+ var isBoolean = (arg) => arg === true || arg === false;
231
+ var isNull = (arg) => arg === null;
232
+ var isArray5 = (arg) => Array.isArray(arg);
233
+ var isObjectLike2 = (arg) => {
234
+ if (arg === null)
235
+ return false;
236
+ return typeof arg === "object";
237
+ };
238
+ var isDefined2 = (arg) => {
239
+ return isObject5(arg) || isObjectLike2(arg) || isString6(arg) || isNumber2(arg) || isFunction(arg) || isArray5(arg) || isObjectLike2(arg) || isBoolean(arg) || isNull(arg);
240
+ };
241
+ var isUndefined = (arg) => {
242
+ return arg === void 0;
243
+ };
244
+ var TYPES = {
245
+ boolean: isBoolean,
246
+ array: isArray5,
247
+ object: isObject5,
248
+ string: isString6,
249
+ number: isNumber2,
250
+ null: isNull,
251
+ function: isFunction,
252
+ objectLike: isObjectLike2,
253
+ node: import_node.isNode,
254
+ htmlElement: import_node.isHtmlElement,
255
+ defined: isDefined2
256
+ };
257
+ var is = (arg) => {
258
+ return (...args) => {
259
+ return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
260
+ };
261
+ };
262
+ var isNot = (arg) => {
263
+ return (...args) => {
264
+ return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
265
+ };
266
+ };
267
+ }
268
+ });
269
+
270
+ // ../../node_modules/@domql/utils/dist/cjs/array.js
271
+ var require_array = __commonJS({
272
+ "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
273
+ "use strict";
274
+ var __defProp2 = Object.defineProperty;
275
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
276
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
277
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
278
+ var __export2 = (target, all) => {
279
+ for (var name in all)
280
+ __defProp2(target, name, { get: all[name], enumerable: true });
281
+ };
282
+ var __copyProps2 = (to, from, except, desc) => {
283
+ if (from && typeof from === "object" || typeof from === "function") {
284
+ for (let key of __getOwnPropNames2(from))
285
+ if (!__hasOwnProp2.call(to, key) && key !== except)
286
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
287
+ }
288
+ return to;
289
+ };
290
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
291
+ var array_exports = {};
292
+ __export2(array_exports, {
293
+ arrayContainsOtherArray: () => arrayContainsOtherArray,
294
+ createNestedObject: () => createNestedObject,
295
+ cutArrayAfterValue: () => cutArrayAfterValue,
296
+ cutArrayBeforeValue: () => cutArrayBeforeValue,
297
+ joinArrays: () => joinArrays,
298
+ mergeAndCloneIfArray: () => mergeAndCloneIfArray,
299
+ mergeArray: () => mergeArray,
300
+ removeFromArray: () => removeFromArray,
301
+ swapItemsInArray: () => swapItemsInArray
302
+ });
303
+ module2.exports = __toCommonJS2(array_exports);
304
+ var import_object = require_object();
305
+ var import_types = require_types();
306
+ var arrayContainsOtherArray = (arr1, arr2) => {
307
+ return arr2.every((val) => arr1.includes(val));
308
+ };
309
+ var removeFromArray = (arr, index) => {
310
+ if ((0, import_types.isString)(index))
311
+ index = parseInt(index);
312
+ if ((0, import_types.isNumber)(index)) {
313
+ if (index < 0 || index >= arr.length || isNaN(index)) {
314
+ throw new Error("Invalid index");
315
+ }
316
+ arr.splice(index, 1);
317
+ } else if ((0, import_types.isArray)(index)) {
318
+ index.forEach((idx) => removeFromArray(arr, idx));
319
+ } else {
320
+ throw new Error("Invalid index");
321
+ }
322
+ return arr;
323
+ };
324
+ var swapItemsInArray = (arr, i, j) => {
325
+ [arr[i], arr[j]] = [arr[j], arr[i]];
326
+ };
327
+ var joinArrays = (...arrays) => {
328
+ return [].concat(...arrays);
329
+ };
330
+ var mergeArray = (arr, excludeFrom = []) => {
331
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
332
+ };
333
+ var mergeAndCloneIfArray = (obj) => {
334
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
335
+ };
336
+ var cutArrayBeforeValue = (arr, value) => {
337
+ const index = arr.indexOf(value);
338
+ if (index !== -1) {
339
+ return arr.slice(0, index);
340
+ }
341
+ return arr;
342
+ };
343
+ var cutArrayAfterValue = (arr, value) => {
344
+ const index = arr.indexOf(value);
345
+ if (index !== -1) {
346
+ return arr.slice(index + 1);
347
+ }
348
+ return arr;
349
+ };
350
+ var createNestedObject = (arr, lastValue) => {
351
+ const nestedObject = {};
352
+ if (arr.length === 0) {
353
+ return lastValue;
354
+ }
355
+ arr.reduce((obj, value, index) => {
356
+ if (!obj[value]) {
357
+ obj[value] = {};
358
+ }
359
+ if (index === arr.length - 1 && lastValue) {
360
+ obj[value] = lastValue;
361
+ }
362
+ return obj[value];
363
+ }, nestedObject);
364
+ return nestedObject;
365
+ };
366
+ }
367
+ });
368
+
369
+ // ../../node_modules/@domql/utils/dist/cjs/string.js
370
+ var require_string = __commonJS({
371
+ "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
372
+ "use strict";
373
+ var __defProp2 = Object.defineProperty;
374
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
375
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
376
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
377
+ var __export2 = (target, all) => {
378
+ for (var name in all)
379
+ __defProp2(target, name, { get: all[name], enumerable: true });
380
+ };
381
+ var __copyProps2 = (to, from, except, desc) => {
382
+ if (from && typeof from === "object" || typeof from === "function") {
383
+ for (let key of __getOwnPropNames2(from))
384
+ if (!__hasOwnProp2.call(to, key) && key !== except)
385
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
386
+ }
387
+ return to;
388
+ };
389
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
390
+ var string_exports = {};
391
+ __export2(string_exports, {
392
+ replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
393
+ stringIncludesAny: () => stringIncludesAny
394
+ });
395
+ module2.exports = __toCommonJS2(string_exports);
396
+ var stringIncludesAny = (str, characters) => {
397
+ for (const char of characters) {
398
+ if (str.includes(char)) {
399
+ return true;
400
+ }
401
+ }
402
+ return false;
403
+ };
404
+ var brackRegex = /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g;
405
+ var replaceLiteralsWithObjectFields = (str, state) => {
406
+ if (!str.includes("{{"))
407
+ return str;
408
+ return str.replace(brackRegex, (_, parentPath, variable) => {
409
+ if (parentPath) {
410
+ const parentLevels = parentPath.match(/\.\.\//g).length;
411
+ let parentState = state;
412
+ for (let i = 0; i < parentLevels; i++) {
413
+ parentState = parentState.parent;
414
+ if (!parentState) {
415
+ return "";
416
+ }
417
+ }
418
+ const value = parentState[variable.trim()];
419
+ return value !== void 0 ? `${value}` : "";
420
+ } else {
421
+ const value = state[variable.trim()];
422
+ return value !== void 0 ? `${value}` : "";
423
+ }
424
+ });
425
+ };
426
+ }
427
+ });
428
+
429
+ // ../../node_modules/@domql/utils/dist/cjs/object.js
430
+ var require_object = __commonJS({
431
+ "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
432
+ "use strict";
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
+ for (var name in all)
439
+ __defProp2(target, name, { get: all[name], enumerable: true });
440
+ };
441
+ var __copyProps2 = (to, from, except, desc) => {
442
+ if (from && typeof from === "object" || typeof from === "function") {
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
+ }
447
+ return to;
448
+ };
449
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
450
+ var object_exports = {};
451
+ __export2(object_exports, {
452
+ clone: () => clone,
453
+ deepClone: () => deepClone2,
454
+ deepCloneExclude: () => deepCloneExclude,
455
+ deepDestringify: () => deepDestringify,
456
+ deepMerge: () => deepMerge2,
457
+ deepStringify: () => deepStringify,
458
+ detachFunctionsFromObject: () => detachFunctionsFromObject,
459
+ diff: () => diff,
460
+ diffArrays: () => diffArrays,
461
+ diffObjects: () => diffObjects,
462
+ exec: () => exec,
463
+ flattenRecursive: () => flattenRecursive,
464
+ isEqualDeep: () => isEqualDeep,
465
+ map: () => map,
466
+ merge: () => merge,
467
+ mergeArrayExclude: () => mergeArrayExclude,
468
+ mergeIfExisted: () => mergeIfExisted,
469
+ objectToString: () => objectToString,
470
+ overwrite: () => overwrite,
471
+ overwriteDeep: () => overwriteDeep,
472
+ overwriteShallow: () => overwriteShallow,
473
+ removeFromObject: () => removeFromObject,
474
+ stringToObject: () => stringToObject
475
+ });
476
+ module2.exports = __toCommonJS2(object_exports);
477
+ var import_globals2 = require_globals();
478
+ var import_types = require_types();
479
+ var import_array = require_array();
480
+ var import_string = require_string();
481
+ var exec = (param, element, state, context) => {
482
+ if ((0, import_types.isFunction)(param)) {
483
+ return param(
484
+ element,
485
+ state || element.state,
486
+ context || element.context
487
+ );
488
+ }
489
+ return param;
490
+ };
491
+ var map = (obj, extention, element) => {
492
+ for (const e in extention) {
493
+ obj[e] = exec(extention[e], element);
494
+ }
495
+ };
496
+ var merge = (element, obj, excludeFrom = []) => {
497
+ for (const e in obj) {
498
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
499
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
500
+ continue;
501
+ const elementProp = element[e];
502
+ const objProp = obj[e];
503
+ if (elementProp === void 0) {
504
+ element[e] = objProp;
505
+ }
506
+ }
507
+ return element;
508
+ };
509
+ var deepMerge2 = (element, extend, excludeFrom = []) => {
510
+ for (const e in extend) {
511
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
512
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
513
+ continue;
514
+ const elementProp = element[e];
515
+ const extendProp = extend[e];
516
+ if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
517
+ deepMerge2(elementProp, extendProp);
518
+ } else if (elementProp === void 0) {
519
+ element[e] = extendProp;
520
+ }
521
+ }
522
+ return element;
523
+ };
524
+ var clone = (obj, excludeFrom = []) => {
525
+ const o = {};
526
+ for (const prop in obj) {
527
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
528
+ if (!hasOwnProperty || excludeFrom.includes(prop) || prop.startsWith("__"))
529
+ continue;
530
+ o[prop] = obj[prop];
531
+ }
532
+ return o;
533
+ };
534
+ var deepCloneExclude = (obj, excludeFrom = []) => {
535
+ if ((0, import_types.isArray)(obj)) {
536
+ return obj.map((x) => deepCloneExclude(x, excludeFrom));
537
+ }
538
+ const o = {};
539
+ for (const k in obj) {
540
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, k);
541
+ if (!hasOwnProperty || excludeFrom.includes(k) || k.startsWith("__"))
542
+ continue;
543
+ let v = obj[k];
544
+ if (k === "extend" && (0, import_types.isArray)(v)) {
545
+ v = mergeArrayExclude(v, excludeFrom);
546
+ }
547
+ if ((0, import_types.isArray)(v)) {
548
+ o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
549
+ } else if ((0, import_types.isObject)(v)) {
550
+ o[k] = deepCloneExclude(v, excludeFrom);
551
+ } else
552
+ o[k] = v;
553
+ }
554
+ return o;
555
+ };
556
+ var mergeArrayExclude = (arr, excl = []) => {
557
+ return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
558
+ };
559
+ var deepClone2 = (obj, excludeFrom = []) => {
560
+ const o = (0, import_types.isArray)(obj) ? [] : {};
561
+ for (const prop in obj) {
562
+ if (prop === "__proto__")
563
+ continue;
564
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
565
+ continue;
566
+ let objProp = obj[prop];
567
+ if (prop === "extend" && (0, import_types.isArray)(objProp)) {
568
+ objProp = (0, import_array.mergeArray)(objProp);
569
+ }
570
+ if ((0, import_types.isObjectLike)(objProp)) {
571
+ o[prop] = deepClone2(objProp, excludeFrom);
572
+ } else
573
+ o[prop] = objProp;
574
+ }
575
+ return o;
576
+ };
577
+ var deepStringify = (obj, stringified = {}) => {
578
+ for (const prop in obj) {
579
+ const objProp = obj[prop];
580
+ if ((0, import_types.isFunction)(objProp)) {
581
+ stringified[prop] = objProp.toString();
582
+ } else if ((0, import_types.isObject)(objProp)) {
583
+ stringified[prop] = {};
584
+ deepStringify(objProp, stringified[prop]);
585
+ } else if ((0, import_types.isArray)(objProp)) {
586
+ stringified[prop] = [];
587
+ objProp.forEach((v, i) => {
588
+ if ((0, import_types.isObject)(v)) {
589
+ stringified[prop][i] = {};
590
+ deepStringify(v, stringified[prop][i]);
591
+ } else if ((0, import_types.isFunction)(v)) {
592
+ stringified[prop][i] = v.toString();
593
+ } else {
594
+ stringified[prop][i] = v;
595
+ }
596
+ });
597
+ } else {
598
+ stringified[prop] = objProp;
599
+ }
600
+ }
601
+ return stringified;
602
+ };
603
+ var objectToString = (obj, indent = 0) => {
604
+ const spaces = " ".repeat(indent);
605
+ let str = "{\n";
606
+ for (const [key, value] of Object.entries(obj)) {
607
+ const keyAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "!"]);
608
+ const stringedKey = keyAllowdChars ? `'${key}'` : key;
609
+ str += `${spaces} ${stringedKey}: `;
610
+ if ((0, import_types.isArray)(value)) {
611
+ str += "[\n";
612
+ for (const element of value) {
613
+ if ((0, import_types.isObject)(element) && element !== null) {
614
+ str += `${spaces} ${objectToString(element, indent + 2)},
615
+ `;
616
+ } else if ((0, import_types.isString)(element)) {
617
+ str += `${spaces} '${element}',
618
+ `;
619
+ } else {
620
+ str += `${spaces} ${element},
621
+ `;
622
+ }
623
+ }
624
+ str += `${spaces} ]`;
625
+ } else if ((0, import_types.isObject)(value)) {
626
+ str += objectToString(value, indent + 1);
627
+ } else if ((0, import_types.isString)(value)) {
628
+ str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
629
+ } else {
630
+ str += value;
631
+ }
632
+ str += ",\n";
633
+ }
634
+ str += `${spaces}}`;
635
+ return str;
636
+ };
637
+ var detachFunctionsFromObject = (obj, detached = {}) => {
638
+ for (const prop in obj) {
639
+ const objProp = obj[prop];
640
+ if ((0, import_types.isFunction)(objProp))
641
+ continue;
642
+ else if ((0, import_types.isObject)(objProp)) {
643
+ detached[prop] = {};
644
+ deepStringify(objProp, detached[prop]);
645
+ } else if ((0, import_types.isArray)(objProp)) {
646
+ detached[prop] = [];
647
+ objProp.forEach((v, i) => {
648
+ if ((0, import_types.isFunction)(v))
649
+ return;
650
+ if ((0, import_types.isObject)(v)) {
651
+ detached[prop][i] = {};
652
+ detachFunctionsFromObject(v, detached[prop][i]);
653
+ } else {
654
+ detached[prop][i] = v;
655
+ }
656
+ });
657
+ } else {
658
+ detached[prop] = objProp;
659
+ }
660
+ }
661
+ return detached;
662
+ };
663
+ var deepDestringify = (obj, stringified = {}) => {
664
+ for (const prop in obj) {
665
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
666
+ if (!hasOwnProperty)
667
+ continue;
668
+ const objProp = obj[prop];
669
+ if ((0, import_types.isString)(objProp)) {
670
+ if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
671
+ try {
672
+ const evalProp = import_globals2.window.eval(`(${objProp})`);
673
+ stringified[prop] = evalProp;
674
+ } catch (e) {
675
+ if (e)
676
+ stringified[prop] = objProp;
677
+ }
678
+ } else {
679
+ stringified[prop] = objProp;
680
+ }
681
+ } else if ((0, import_types.isArray)(objProp)) {
682
+ stringified[prop] = [];
683
+ objProp.forEach((arrProp) => {
684
+ if ((0, import_types.isString)(arrProp)) {
685
+ if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
686
+ try {
687
+ const evalProp = import_globals2.window.eval(`(${arrProp})`);
688
+ stringified[prop].push(evalProp);
689
+ } catch (e) {
690
+ if (e)
691
+ stringified[prop].push(arrProp);
692
+ }
693
+ } else {
694
+ stringified[prop].push(arrProp);
695
+ }
696
+ } else if ((0, import_types.isObject)(arrProp)) {
697
+ stringified[prop].push(deepDestringify(arrProp));
698
+ } else {
699
+ stringified[prop].push(arrProp);
700
+ }
701
+ });
702
+ } else if ((0, import_types.isObject)(objProp)) {
703
+ stringified[prop] = deepDestringify(objProp, stringified[prop]);
704
+ } else {
705
+ stringified[prop] = objProp;
706
+ }
707
+ }
708
+ return stringified;
709
+ };
710
+ var stringToObject = (str) => {
711
+ let obj;
712
+ try {
713
+ obj = import_globals2.window.eval("(" + str + ")");
714
+ } catch (e) {
715
+ console.warn(e);
716
+ }
717
+ if (obj)
718
+ return obj;
719
+ };
720
+ var diffObjects = (original, objToDiff, cache) => {
721
+ for (const e in objToDiff) {
722
+ if (e === "ref")
723
+ continue;
724
+ const originalProp = original[e];
725
+ const objToDiffProp = objToDiff[e];
726
+ if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
727
+ cache[e] = {};
728
+ diff(originalProp, objToDiffProp, cache[e]);
729
+ } else if (objToDiffProp !== void 0) {
730
+ cache[e] = objToDiffProp;
731
+ }
732
+ }
733
+ return cache;
734
+ };
735
+ var diffArrays = (original, objToDiff, cache) => {
736
+ if (original.length !== objToDiff.length) {
737
+ cache = objToDiff;
738
+ } else {
739
+ const diffArr = [];
740
+ for (let i = 0; i < original.length; i++) {
741
+ const diffObj = diff(original[i], objToDiff[i]);
742
+ if (Object.keys(diffObj).length > 0) {
743
+ diffArr.push(diffObj);
744
+ }
745
+ }
746
+ if (diffArr.length > 0) {
747
+ cache = diffArr;
748
+ }
749
+ }
750
+ return cache;
751
+ };
752
+ var diff = (original, objToDiff, cache = {}) => {
753
+ if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
754
+ cache = [];
755
+ diffArrays(original, objToDiff, cache);
756
+ } else {
757
+ diffObjects(original, objToDiff, cache);
758
+ }
759
+ return cache;
760
+ };
761
+ var overwrite = (element, params, excludeFrom = []) => {
762
+ const { ref } = element;
763
+ const changes = {};
764
+ for (const e in params) {
765
+ if (excludeFrom.includes(e) || e.startsWith("__"))
766
+ continue;
767
+ const elementProp = element[e];
768
+ const paramsProp = params[e];
769
+ if (paramsProp) {
770
+ ref.__cache[e] = changes[e] = elementProp;
771
+ ref[e] = paramsProp;
772
+ }
773
+ }
774
+ return changes;
775
+ };
776
+ var overwriteShallow = (obj, params, excludeFrom = []) => {
777
+ for (const e in params) {
778
+ if (excludeFrom.includes(e) || e.startsWith("__"))
779
+ continue;
780
+ obj[e] = params[e];
781
+ }
782
+ return obj;
783
+ };
784
+ var overwriteDeep = (obj, params, excludeFrom = []) => {
785
+ for (const e in params) {
786
+ if (e === "__proto__")
787
+ continue;
788
+ if (excludeFrom.includes(e) || e.startsWith("__"))
789
+ continue;
790
+ const objProp = obj[e];
791
+ const paramsProp = params[e];
792
+ if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
793
+ overwriteDeep(objProp, paramsProp);
794
+ } else if (paramsProp !== void 0) {
795
+ obj[e] = paramsProp;
796
+ }
797
+ }
798
+ return obj;
799
+ };
800
+ var mergeIfExisted = (a, b) => {
801
+ if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
802
+ return deepMerge2(a, b);
803
+ return a || b;
804
+ };
805
+ var flattenRecursive = (param, prop, stack = []) => {
806
+ const objectized = (0, import_array.mergeAndCloneIfArray)(param);
807
+ stack.push(objectized);
808
+ const extendOfExtend = objectized[prop];
809
+ if (extendOfExtend)
810
+ flattenRecursive(extendOfExtend, prop, stack);
811
+ delete objectized[prop];
812
+ return stack;
813
+ };
814
+ var isEqualDeep = (param, element) => {
815
+ if (param === element)
816
+ return true;
817
+ if (!param || !element)
818
+ return false;
819
+ for (const prop in param) {
820
+ const paramProp = param[prop];
821
+ const elementProp = element[prop];
822
+ if ((0, import_types.isObjectLike)(paramProp)) {
823
+ const isEqual = isEqualDeep(paramProp, elementProp);
824
+ if (!isEqual)
825
+ return false;
826
+ } else {
827
+ const isEqual = paramProp === elementProp;
828
+ if (!isEqual)
829
+ return false;
830
+ }
831
+ }
832
+ return true;
833
+ };
834
+ var removeFromObject = (obj, props) => {
835
+ if (props === void 0 || props === null)
836
+ return obj;
837
+ if ((0, import_types.is)(props)("string", "number")) {
838
+ delete obj[props];
839
+ } else if ((0, import_types.isArray)(props)) {
840
+ props.forEach((prop) => delete obj[prop]);
841
+ } else {
842
+ throw new Error("Invalid input: props must be a string or an array of strings");
843
+ }
844
+ return obj;
845
+ };
846
+ }
847
+ });
848
+
849
+ // ../../node_modules/@domql/utils/dist/cjs/function.js
850
+ var require_function = __commonJS({
851
+ "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
852
+ "use strict";
853
+ var __defProp2 = Object.defineProperty;
854
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
855
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
856
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
857
+ var __export2 = (target, all) => {
858
+ for (var name in all)
859
+ __defProp2(target, name, { get: all[name], enumerable: true });
860
+ };
861
+ var __copyProps2 = (to, from, except, desc) => {
862
+ if (from && typeof from === "object" || typeof from === "function") {
863
+ for (let key of __getOwnPropNames2(from))
864
+ if (!__hasOwnProp2.call(to, key) && key !== except)
865
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
866
+ }
867
+ return to;
868
+ };
869
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
870
+ var function_exports = {};
871
+ __export2(function_exports, {
872
+ debounce: () => debounce,
873
+ memoize: () => memoize
874
+ });
875
+ module2.exports = __toCommonJS2(function_exports);
876
+ var debounce = (element, func, timeout = 300) => {
877
+ let timer;
878
+ return (...args) => {
879
+ clearTimeout(timer);
880
+ timer = setTimeout(() => {
881
+ func.apply(element, args);
882
+ }, timeout);
883
+ };
884
+ };
885
+ var memoize = (fn) => {
886
+ const cache = {};
887
+ return (...args) => {
888
+ const n = args[0];
889
+ if (n in cache) {
890
+ return cache[n];
891
+ } else {
892
+ const result = fn(n);
893
+ cache[n] = result;
894
+ return result;
895
+ }
896
+ };
897
+ };
898
+ }
899
+ });
900
+
901
+ // ../../node_modules/@domql/utils/dist/cjs/log.js
902
+ var require_log = __commonJS({
903
+ "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
904
+ "use strict";
905
+ var __defProp2 = Object.defineProperty;
906
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
907
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
908
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
909
+ var __export2 = (target, all) => {
910
+ for (var name in all)
911
+ __defProp2(target, name, { get: all[name], enumerable: true });
912
+ };
913
+ var __copyProps2 = (to, from, except, desc) => {
914
+ if (from && typeof from === "object" || typeof from === "function") {
915
+ for (let key of __getOwnPropNames2(from))
916
+ if (!__hasOwnProp2.call(to, key) && key !== except)
917
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
918
+ }
919
+ return to;
920
+ };
921
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
922
+ var log_exports = {};
923
+ __export2(log_exports, {
924
+ logGroupIf: () => logGroupIf,
925
+ logIf: () => logIf
926
+ });
927
+ module2.exports = __toCommonJS2(log_exports);
928
+ var logIf = (bool, ...arg) => {
929
+ if (bool)
930
+ arg.map((v) => console.log(v));
931
+ };
932
+ var logGroupIf = (bool, key, ...arg) => {
933
+ if (bool) {
934
+ console.group(key);
935
+ arg.map((v) => console.log(v));
936
+ console.groupEnd(key);
937
+ }
938
+ };
939
+ }
940
+ });
941
+
942
+ // ../../node_modules/@domql/utils/dist/cjs/cookie.js
943
+ var require_cookie = __commonJS({
944
+ "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
945
+ "use strict";
946
+ var __defProp2 = Object.defineProperty;
947
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
948
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
949
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
950
+ var __export2 = (target, all) => {
951
+ for (var name in all)
952
+ __defProp2(target, name, { get: all[name], enumerable: true });
953
+ };
954
+ var __copyProps2 = (to, from, except, desc) => {
955
+ if (from && typeof from === "object" || typeof from === "function") {
956
+ for (let key of __getOwnPropNames2(from))
957
+ if (!__hasOwnProp2.call(to, key) && key !== except)
958
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
959
+ }
960
+ return to;
961
+ };
962
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
963
+ var cookie_exports = {};
964
+ __export2(cookie_exports, {
965
+ getCookie: () => getCookie,
966
+ isMobile: () => isMobile,
967
+ setCookie: () => setCookie
968
+ });
969
+ module2.exports = __toCommonJS2(cookie_exports);
970
+ var import_types = require_types();
971
+ var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
972
+ var setCookie = (cname, cvalue, exdays = 365) => {
973
+ if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
974
+ return;
975
+ const d = /* @__PURE__ */ new Date();
976
+ d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
977
+ const expires = `expires=${d.toUTCString()}`;
978
+ document.cookie = `${cname}=${cvalue};${expires};path=/`;
979
+ };
980
+ var getCookie = (cname) => {
981
+ if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
982
+ return;
983
+ const name = `${cname}=`;
984
+ const decodedCookie = decodeURIComponent(document.cookie);
985
+ const ca = decodedCookie.split(";");
986
+ for (let i = 0; i < ca.length; i++) {
987
+ let c = ca[i];
988
+ while (c.charAt(0) === " ")
989
+ c = c.substring(1);
990
+ if (c.indexOf(name) === 0)
991
+ return c.substring(name.length, c.length);
992
+ }
993
+ return "";
994
+ };
995
+ }
996
+ });
997
+
998
+ // ../../node_modules/@domql/utils/dist/cjs/tags.js
999
+ var require_tags = __commonJS({
1000
+ "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
1001
+ "use strict";
1002
+ var __defProp2 = Object.defineProperty;
1003
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1004
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1005
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1006
+ var __export2 = (target, all) => {
1007
+ for (var name in all)
1008
+ __defProp2(target, name, { get: all[name], enumerable: true });
1009
+ };
1010
+ var __copyProps2 = (to, from, except, desc) => {
1011
+ if (from && typeof from === "object" || typeof from === "function") {
1012
+ for (let key of __getOwnPropNames2(from))
1013
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1014
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1015
+ }
1016
+ return to;
1017
+ };
1018
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1019
+ var tags_exports = {};
1020
+ __export2(tags_exports, {
1021
+ HTML_TAGS: () => HTML_TAGS,
1022
+ isValidHtmlTag: () => isValidHtmlTag
1023
+ });
1024
+ module2.exports = __toCommonJS2(tags_exports);
1025
+ var HTML_TAGS = {
1026
+ root: [
1027
+ "body",
1028
+ "html"
1029
+ ],
1030
+ head: [
1031
+ "title",
1032
+ "base",
1033
+ "meta",
1034
+ "style"
1035
+ ],
1036
+ body: [
1037
+ "string",
1038
+ "fragment",
1039
+ "a",
1040
+ "abbr",
1041
+ "acronym",
1042
+ "address",
1043
+ "applet",
1044
+ "area",
1045
+ "article",
1046
+ "aside",
1047
+ "audio",
1048
+ "b",
1049
+ "basefont",
1050
+ "bdi",
1051
+ "bdo",
1052
+ "big",
1053
+ "blockquote",
1054
+ "br",
1055
+ "button",
1056
+ "canvas",
1057
+ "caption",
1058
+ "center",
1059
+ "cite",
1060
+ "code",
1061
+ "col",
1062
+ "colgroup",
1063
+ "data",
1064
+ "datalist",
1065
+ "dd",
1066
+ "del",
1067
+ "details",
1068
+ "dfn",
1069
+ "dialog",
1070
+ "dir",
1071
+ "div",
1072
+ "dl",
1073
+ "dt",
1074
+ "em",
1075
+ "embed",
1076
+ "fieldset",
1077
+ "figcaption",
1078
+ "figure",
1079
+ "font",
1080
+ "footer",
1081
+ "form",
1082
+ "frame",
1083
+ "frameset",
1084
+ "h1",
1085
+ "h2",
1086
+ "h3",
1087
+ "h4",
1088
+ "h5",
1089
+ "h6",
1090
+ "head",
1091
+ "header",
1092
+ "hr",
1093
+ "i",
1094
+ "iframe",
1095
+ "img",
1096
+ "input",
1097
+ "ins",
1098
+ "kbd",
1099
+ "label",
1100
+ "legend",
1101
+ "li",
1102
+ "link",
1103
+ "main",
1104
+ "map",
1105
+ "mark",
1106
+ "meter",
1107
+ "nav",
1108
+ "noframes",
1109
+ "noscript",
1110
+ "object",
1111
+ "ol",
1112
+ "optgroup",
1113
+ "option",
1114
+ "output",
1115
+ "p",
1116
+ "param",
1117
+ "picture",
1118
+ "pre",
1119
+ "progress",
1120
+ "q",
1121
+ "rp",
1122
+ "rt",
1123
+ "ruby",
1124
+ "s",
1125
+ "samp",
1126
+ "script",
1127
+ "section",
1128
+ "select",
1129
+ "small",
1130
+ "source",
1131
+ "span",
1132
+ "strike",
1133
+ "strong",
1134
+ "sub",
1135
+ "summary",
1136
+ "sup",
1137
+ "table",
1138
+ "tbody",
1139
+ "td",
1140
+ "template",
1141
+ "textarea",
1142
+ "tfoot",
1143
+ "th",
1144
+ "thead",
1145
+ "time",
1146
+ "tr",
1147
+ "track",
1148
+ "tt",
1149
+ "u",
1150
+ "ul",
1151
+ "var",
1152
+ "video",
1153
+ "wbr",
1154
+ // SVG
1155
+ "svg",
1156
+ "path"
1157
+ ]
1158
+ };
1159
+ var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
1160
+ }
1161
+ });
1162
+
1163
+ // ../../node_modules/@domql/utils/dist/cjs/index.js
1164
+ var require_cjs = __commonJS({
1165
+ "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1166
+ "use strict";
1167
+ var __defProp2 = Object.defineProperty;
1168
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1169
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1170
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1171
+ var __copyProps2 = (to, from, except, desc) => {
1172
+ if (from && typeof from === "object" || typeof from === "function") {
1173
+ for (let key of __getOwnPropNames2(from))
1174
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1175
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1176
+ }
1177
+ return to;
1178
+ };
1179
+ var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
1180
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1181
+ var utils_exports = {};
1182
+ module2.exports = __toCommonJS2(utils_exports);
1183
+ __reExport(utils_exports, require_key(), module2.exports);
1184
+ __reExport(utils_exports, require_env(), module2.exports);
1185
+ __reExport(utils_exports, require_types(), module2.exports);
1186
+ __reExport(utils_exports, require_object(), module2.exports);
1187
+ __reExport(utils_exports, require_function(), module2.exports);
1188
+ __reExport(utils_exports, require_array(), module2.exports);
1189
+ __reExport(utils_exports, require_node(), module2.exports);
1190
+ __reExport(utils_exports, require_log(), module2.exports);
1191
+ __reExport(utils_exports, require_string(), module2.exports);
1192
+ __reExport(utils_exports, require_globals(), module2.exports);
1193
+ __reExport(utils_exports, require_cookie(), module2.exports);
1194
+ __reExport(utils_exports, require_tags(), module2.exports);
1195
+ }
1196
+ });
1197
+
1198
+ // ../../node_modules/@domql/globals/dist/cjs/index.js
1199
+ var require_cjs2 = __commonJS({
1200
+ "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
1201
+ "use strict";
1202
+ var __defProp2 = Object.defineProperty;
1203
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1204
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1205
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1206
+ var __export2 = (target, all) => {
1207
+ for (var name in all)
1208
+ __defProp2(target, name, { get: all[name], enumerable: true });
1209
+ };
1210
+ var __copyProps2 = (to, from, except, desc) => {
1211
+ if (from && typeof from === "object" || typeof from === "function") {
1212
+ for (let key of __getOwnPropNames2(from))
1213
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1214
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1215
+ }
1216
+ return to;
1217
+ };
1218
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1219
+ var globals_exports = {};
1220
+ __export2(globals_exports, {
1221
+ document: () => document3,
1222
+ global: () => global,
1223
+ self: () => self,
1224
+ window: () => window2
1225
+ });
1226
+ module2.exports = __toCommonJS2(globals_exports);
1227
+ var global = globalThis;
1228
+ var self = globalThis;
1229
+ var window2 = globalThis;
1230
+ var document3 = window2.document;
1231
+ }
1232
+ });
1233
+
1234
+ // src/system/color.js
1235
+ var color_exports = {};
1236
+ __export(color_exports, {
1237
+ getColor: () => getColor,
1238
+ getMediaColor: () => getMediaColor,
1239
+ setColor: () => setColor,
1240
+ setGradient: () => setGradient
1241
+ });
1242
+ module.exports = __toCommonJS(color_exports);
1243
+
1244
+ // src/factory.js
1245
+ var import_utils = __toESM(require_cjs(), 1);
1246
+
1247
+ // src/defaultConfig/index.js
1248
+ var defaultConfig_exports = {};
1249
+ __export(defaultConfig_exports, {
1250
+ ANIMATION: () => ANIMATION,
1251
+ BREAKPOINTS: () => BREAKPOINTS,
1252
+ CASES: () => CASES,
1253
+ COLOR: () => COLOR,
1254
+ DEVICES: () => DEVICES,
1255
+ DOCUMENT: () => DOCUMENT,
1256
+ FONT: () => FONT,
1257
+ FONT_FACE: () => FONT_FACE,
1258
+ FONT_FAMILY: () => FONT_FAMILY,
1259
+ FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
1260
+ GRADIENT: () => GRADIENT,
1261
+ ICONS: () => ICONS,
1262
+ MEDIA: () => MEDIA,
1263
+ RESET: () => RESET,
1264
+ SEQUENCE: () => SEQUENCE,
1265
+ SPACING: () => SPACING,
1266
+ SVG: () => SVG,
1267
+ SVG_DATA: () => SVG_DATA,
1268
+ TEMPLATES: () => TEMPLATES,
1269
+ THEME: () => THEME,
1270
+ TIMING: () => TIMING,
1271
+ TYPOGRAPHY: () => TYPOGRAPHY,
1272
+ UNIT: () => UNIT
1273
+ });
1274
+
1275
+ // src/defaultConfig/sequence.js
1276
+ var SEQUENCE = {
1277
+ "minor-second": 1.067,
1278
+ "major-second": 1.125,
1279
+ "minor-third": 1.2,
1280
+ "major-third": 1.25,
1281
+ "perfect-fourth": 1.333,
1282
+ "augmented-fourth": 1.414,
1283
+ "perfect-fifth": 1.5,
1284
+ "minor-sixth": 1.6,
1285
+ phi: 1.618,
1286
+ // golden-ratio
1287
+ "major-sixth": 1.667,
1288
+ "square-root-3": 1.732,
1289
+ // theodorus
1290
+ "minor-seventh": 1.778,
1291
+ "major-seventh": 1.875,
1292
+ octave: 2,
1293
+ "square-root-5": 2.23,
1294
+ // pythagoras
1295
+ "major-tenth": 2.5,
1296
+ "major-eleventh": 2.667,
1297
+ "major-twelfth": 3,
1298
+ pi: 3.14,
1299
+ // archimedes
1300
+ "double-octave": 4
1301
+ };
1302
+
1303
+ // src/defaultConfig/unit.js
1304
+ var UNIT = {
1305
+ default: "em"
1306
+ };
1307
+
1308
+ // src/defaultConfig/typography.js
1309
+ var defaultProps = {
1310
+ browserDefault: 16,
1311
+ base: 16,
1312
+ type: "font-size",
1313
+ ratio: SEQUENCE["minor-third"],
1314
+ range: [-3, 12],
1315
+ h1Matches: 6,
1316
+ lineHeight: 1.5,
1317
+ subSequence: true,
1318
+ unit: "em",
1319
+ templates: {},
1320
+ sequence: {},
1321
+ scales: {},
1322
+ vars: {}
1323
+ };
1324
+ var TYPOGRAPHY = defaultProps;
1325
+
1326
+ // src/defaultConfig/font.js
1327
+ var FONT = {};
1328
+
1329
+ // src/defaultConfig/font-family.js
1330
+ var FONT_FAMILY = {};
1331
+ var FONT_FAMILY_TYPES = {
1332
+ "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
1333
+ serif: "Times New Roman, Georgia, serif, --system-default",
1334
+ monospace: "Courier New, monospace, --system-default"
1335
+ };
1336
+ var FONT_FACE = {};
1337
+
1338
+ // src/defaultConfig/media.js
1339
+ var MEDIA = {
1340
+ tv: "(min-width: 2780px)",
1341
+ screenL: "(max-width: 1920px)",
1342
+ "screenL<": "(min-width: 1920px)",
1343
+ screenM: "(max-width: 1680px)",
1344
+ "screenM<": "(min-width: 1680px)",
1345
+ screenS: "(max-width: 1440px)",
1346
+ "screenS<": "(min-width: 1440px)",
1347
+ tabletL: "(max-width: 1366px)",
1348
+ "tabletL<": "(min-width: 1366px)",
1349
+ tabletM: "(max-width: 1280px)",
1350
+ "tabletM<": "(min-width: 1280px)",
1351
+ tabletS: "(max-width: 1024px)",
1352
+ "tabletS<": "(min-width: 1024px)",
1353
+ mobileL: "(max-width: 768px)",
1354
+ "mobileL<": "(min-width: 768px)",
1355
+ mobileM: "(max-width: 560px)",
1356
+ "mobileM<": "(min-width: 560px)",
1357
+ mobileS: "(max-width: 480px)",
1358
+ "mobileS<": "(min-width: 480px)",
1359
+ mobileXS: "(max-width: 375px)",
1360
+ "mobileXS<": "(min-width: 375px)",
1361
+ light: "(prefers-color-scheme: light)",
1362
+ dark: "(prefers-color-scheme: dark)",
1363
+ print: "print"
1364
+ };
1365
+
1366
+ // src/defaultConfig/spacing.js
1367
+ var defaultProps2 = {
1368
+ base: TYPOGRAPHY.base,
1369
+ type: "spacing",
1370
+ ratio: SEQUENCE.phi,
1371
+ range: [-5, 15],
1372
+ subSequence: true,
1373
+ unit: "em",
1374
+ sequence: {},
1375
+ scales: {},
1376
+ vars: {}
1377
+ };
1378
+ var SPACING = defaultProps2;
1379
+
1380
+ // src/defaultConfig/color.js
1381
+ var COLOR = {};
1382
+ var GRADIENT = {};
1383
+
1384
+ // src/defaultConfig/theme.js
1385
+ var THEME = {};
1386
+
1387
+ // src/defaultConfig/icons.js
1388
+ var ICONS = {};
1389
+
1390
+ // src/defaultConfig/timing.js
1391
+ var defaultProps3 = {
1392
+ default: 150,
1393
+ base: 150,
1394
+ type: "timing",
1395
+ ratio: SEQUENCE["perfect-fourth"],
1396
+ range: [-3, 12],
1397
+ unit: "ms",
1398
+ sequence: {},
1399
+ scales: {},
1400
+ vars: {}
1401
+ };
1402
+ var TIMING = defaultProps3;
1403
+
1404
+ // src/defaultConfig/document.js
1405
+ var DOCUMENT = {};
1406
+
1407
+ // src/defaultConfig/responsive.js
1408
+ var BREAKPOINTS = {
1409
+ screenL: 1920,
1410
+ screenM: 1680,
1411
+ screenS: 1440,
1412
+ tabletL: 1366,
1413
+ tabletM: 1280,
1414
+ tabletS: 1024,
1415
+ mobileL: 768,
1416
+ mobileM: 560,
1417
+ mobileS: 480,
1418
+ mobileXS: 375
1419
+ };
1420
+ var DEVICES = {
1421
+ screenL: [1920, 1024],
1422
+ screenM: [1680, 1024],
1423
+ screenS: [1440, 978],
1424
+ tabletL: [1366, 926],
1425
+ tabletM: [1280, 768],
1426
+ tabletS: [1024, 768],
1427
+ mobileL: [768, 375],
1428
+ mobileM: [560, 768],
1429
+ mobileS: [480, 768],
1430
+ mobileXS: [375, 768]
1431
+ };
1432
+
1433
+ // src/defaultConfig/cases.js
1434
+ var CASES = {};
1435
+
1436
+ // src/defaultConfig/animation.js
1437
+ var ANIMATION = {};
1438
+
1439
+ // src/defaultConfig/svg.js
1440
+ var SVG = {};
1441
+ var SVG_DATA = {};
1442
+
1443
+ // src/defaultConfig/templates.js
1444
+ var TEMPLATES = {};
1445
+
1446
+ // src/defaultConfig/index.js
1447
+ var RESET = {};
1448
+
1449
+ // src/factory.js
1450
+ var CSS_VARS = {};
1451
+ var CONFIG = {
1452
+ verbose: false,
1453
+ useVariable: true,
1454
+ useReset: true,
1455
+ CSS_VARS,
1456
+ ...defaultConfig_exports
1457
+ };
1458
+ var cachedConfig = (0, import_utils.deepClone)(CONFIG);
1459
+ var FACTORY = {
1460
+ active: "0",
1461
+ 0: CONFIG
1462
+ };
1463
+ var getActiveConfig = (def) => {
1464
+ return FACTORY[def || FACTORY.active];
1465
+ };
1466
+
1467
+ // src/system/color.js
1468
+ var import_utils9 = __toESM(require_cjs(), 1);
1469
+
1470
+ // src/utils/color.js
1471
+ var import_globals = __toESM(require_cjs2(), 1);
1472
+ var import_utils2 = __toESM(require_cjs(), 1);
1473
+ var colorStringToRgbaArray = (color) => {
1474
+ if (color === "")
1475
+ return;
1476
+ if (color.toLowerCase() === "transparent")
1477
+ return [0, 0, 0, 0];
1478
+ if (color[0] === "#") {
1479
+ if (color.length < 7) {
1480
+ color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
1481
+ }
1482
+ return [
1483
+ parseInt(color.substr(1, 2), 16),
1484
+ parseInt(color.substr(3, 2), 16),
1485
+ parseInt(color.substr(5, 2), 16),
1486
+ color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
1487
+ ];
1488
+ }
1489
+ if (color.indexOf("rgb") === -1) {
1490
+ if (import_globals.document && import_globals.window) {
1491
+ const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
1492
+ const flag = "rgb(1, 2, 3)";
1493
+ elem.style.color = flag;
1494
+ if (elem.style.color !== flag)
1495
+ return;
1496
+ elem.style.color = color;
1497
+ if (elem.style.color === flag || elem.style.color === "")
1498
+ return;
1499
+ color = import_globals.window.getComputedStyle(elem).color;
1500
+ import_globals.document.body.removeChild(elem);
1501
+ }
1502
+ }
1503
+ if (color.indexOf("rgb") === 0) {
1504
+ if (color.indexOf("rgba") === -1)
1505
+ color = `${color}, 1`;
1506
+ return color.match(/[\.\d]+/g).map((a) => +a);
1507
+ }
1508
+ return [];
1509
+ };
1510
+ var hexToRgbArray = (hex, alpha = 1) => {
1511
+ const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
1512
+ return [r, g, b];
1513
+ };
1514
+ var rgbArrayToHex = ([r, g, b]) => {
1515
+ return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
1516
+ };
1517
+ var rgbToHSL = (r, g, b) => {
1518
+ const a = Math.max(r, g, b);
1519
+ const n = a - Math.min(r, g, b);
1520
+ const f = 1 - Math.abs(a + a - n - 1);
1521
+ const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
1522
+ return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
1523
+ };
1524
+ var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
1525
+ Math.min(k - 3, 9 - k, 1),
1526
+ -1
1527
+ )) => [f(0), f(8), f(4)];
1528
+ var getColorShade = (col, amt) => {
1529
+ const num = parseInt(col, 16);
1530
+ let r = (num >> 16) + amt;
1531
+ if (r > 255)
1532
+ r = 255;
1533
+ else if (r < 0)
1534
+ r = 0;
1535
+ let b = (num >> 8 & 255) + amt;
1536
+ if (b > 255)
1537
+ b = 255;
1538
+ else if (b < 0)
1539
+ b = 0;
1540
+ let g = (num & 255) + amt;
1541
+ if (g > 255)
1542
+ g = 255;
1543
+ else if (g < 0)
1544
+ g = 0;
1545
+ return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
1546
+ };
1547
+ var getRgbTone = (rgb, tone) => {
1548
+ if ((0, import_utils2.isString)(rgb))
1549
+ rgb = rgb.split(", ").map((v) => parseFloat(v));
1550
+ if ((0, import_utils2.isNumber)(tone))
1551
+ tone += "";
1552
+ const toHex = rgbArrayToHex(rgb);
1553
+ const abs = tone.slice(0, 1);
1554
+ if (abs === "-" || abs === "+") {
1555
+ const colorShade = getColorShade(toHex, parseFloat(tone));
1556
+ return hexToRgbArray(colorShade).join(", ");
1557
+ } else {
1558
+ const [r, g, b] = rgb;
1559
+ const hsl = rgbToHSL(r, g, b);
1560
+ const [h, s, l] = hsl;
1561
+ const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1562
+ return newRgb;
1563
+ }
1564
+ };
1565
+
1566
+ // src/utils/sequence.js
1567
+ var import_utils5 = __toESM(require_cjs(), 1);
1568
+
1569
+ // ../utils/src/index.js
1570
+ var import_utils4 = __toESM(require_cjs());
1571
+
1572
+ // ../utils/src/scaling.js
1573
+ var import_utils3 = __toESM(require_cjs());
1574
+
1575
+ // src/utils/var.js
1576
+ var import_utils7 = __toESM(require_cjs(), 1);
1577
+
1578
+ // src/utils/sprite.js
1579
+ var import_utils8 = __toESM(require_cjs(), 1);
1580
+
1581
+ // src/system/color.js
1582
+ var getColor = (value, key, config) => {
1583
+ const CONFIG2 = config || getActiveConfig();
1584
+ if (!(0, import_utils9.isString)(value)) {
1585
+ if (CONFIG2.verbose)
1586
+ console.warn(value, "- type for color is not valid");
1587
+ return;
1588
+ }
1589
+ if (value.slice(0, 2) === "--")
1590
+ return `var(${value})`;
1591
+ if (key && value[key])
1592
+ value = value[key];
1593
+ const [name, alpha, tone] = (0, import_utils9.isArray)(value) ? value : value.split(" ");
1594
+ const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1595
+ let val = COLOR2[name] || GRADIENT2[name];
1596
+ if (!val) {
1597
+ if (CONFIG2.verbose)
1598
+ console.warn("Can't find color ", name);
1599
+ return value;
1600
+ }
1601
+ if (key) {
1602
+ if (val[key])
1603
+ val = val[key];
1604
+ else if (CONFIG2.verbose)
1605
+ console.warn(value, " - does not have ", key);
1606
+ }
1607
+ let rgb = val.rgb;
1608
+ if (!rgb) {
1609
+ return CONFIG2.useVariable ? `var(${val.var})` : val.value;
1610
+ }
1611
+ if (tone && !val[tone]) {
1612
+ rgb = getRgbTone(rgb, tone);
1613
+ val[tone] = { rgb, var: `${val.var}-${tone}` };
1614
+ }
1615
+ if (val[tone])
1616
+ rgb = val[tone].rgb;
1617
+ if (alpha)
1618
+ return `rgba(${rgb}, ${alpha})`;
1619
+ return CONFIG2.useVariable ? `var(${val.var})` : `rgb(${rgb})`;
1620
+ };
1621
+ var getMediaColor = (value, globalTheme, config) => {
1622
+ const CONFIG2 = config || getActiveConfig();
1623
+ if (!globalTheme)
1624
+ globalTheme = CONFIG2.globalTheme;
1625
+ if (!(0, import_utils9.isString)(value)) {
1626
+ if (CONFIG2.verbose)
1627
+ console.warn(value, "- type for color is not valid");
1628
+ return;
1629
+ }
1630
+ if (value.slice(0, 2) === "--")
1631
+ return `var(${value})`;
1632
+ const [name] = (0, import_utils9.isArray)(value) ? value : value.split(" ");
1633
+ const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1634
+ const val = COLOR2[name] || GRADIENT2[name];
1635
+ const isObj = (0, import_utils9.isObject)(val);
1636
+ if (isObj && val.value)
1637
+ return getColor(value, `@${globalTheme}`, config);
1638
+ else if (isObj) {
1639
+ if (globalTheme)
1640
+ return getColor(value, `@${globalTheme}`, config);
1641
+ else {
1642
+ const obj = {};
1643
+ for (const mediaName in val) {
1644
+ const query = CONFIG2.MEDIA[mediaName.slice(1)];
1645
+ const media = `@media screen and ${query}`;
1646
+ obj[media] = getColor(value, mediaName, config);
1647
+ }
1648
+ return obj;
1649
+ }
1650
+ } else {
1651
+ if (CONFIG2.verbose)
1652
+ console.warn("Can't find color", value);
1653
+ return value;
1654
+ }
1655
+ };
1656
+ var setColor = (val, key, suffix) => {
1657
+ const CONFIG2 = getActiveConfig();
1658
+ if ((0, import_utils9.isString)(val) && val.slice(0, 2) === "--")
1659
+ val = getColor(val.slice(2));
1660
+ if ((0, import_utils9.isArray)(val)) {
1661
+ return {
1662
+ "@light": setColor(val[0], key, "light"),
1663
+ "@dark": setColor(val[1], key, "dark")
1664
+ };
1665
+ }
1666
+ if ((0, import_utils9.isObject)(val)) {
1667
+ const obj = {};
1668
+ for (const variant in val)
1669
+ obj[variant] = setColor(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
1670
+ return obj;
1671
+ }
1672
+ const CSSVar = `--color-${key}` + (suffix ? `-${suffix}` : "");
1673
+ const [r, g, b, a = 1] = colorStringToRgbaArray(val.value || val);
1674
+ const alpha = parseFloat(a.toFixed(2));
1675
+ const rgb = `${r}, ${g}, ${b}`;
1676
+ const value = `rgba(${rgb}, ${alpha})`;
1677
+ if (CONFIG2.useVariable) {
1678
+ CONFIG2.CSS_VARS[CSSVar] = value;
1679
+ }
1680
+ return {
1681
+ var: CSSVar,
1682
+ rgb,
1683
+ alpha,
1684
+ value
1685
+ };
1686
+ };
1687
+ var setGradient = (val, key, suffix) => {
1688
+ const CONFIG2 = getActiveConfig();
1689
+ if ((0, import_utils9.isString)(val) && val.slice(0, 2) === "--")
1690
+ val = getColor(val.slice(2));
1691
+ if ((0, import_utils9.isArray)(val)) {
1692
+ return {
1693
+ "@light": setGradient(val[0], key, "light"),
1694
+ "@dark": setGradient(val[0], key, "dark")
1695
+ };
1696
+ }
1697
+ if ((0, import_utils9.isObject)(val)) {
1698
+ const obj = {};
1699
+ for (const variant in val)
1700
+ obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
1701
+ return obj;
1702
+ }
1703
+ const CSSVar = `--gradient-${key}` + (suffix ? `-${suffix}` : "");
1704
+ if (CONFIG2.useVariable) {
1705
+ CONFIG2.CSS_VARS[CSSVar] = val.value || val;
1706
+ }
1707
+ return {
1708
+ var: CSSVar,
1709
+ value: val.value || val
1710
+ };
1711
+ };