@symbo.ls/scratch 2.11.125 → 2.11.131

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