@symbo.ls/scratch 2.11.360 → 2.11.365
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.
- package/dist/cjs/index.js +1533 -111
- package/dist/cjs/set.js +1514 -89
- package/dist/cjs/system/color.js +1471 -34
- package/dist/cjs/system/document.js +1461 -24
- package/dist/cjs/system/font.js +1469 -43
- package/dist/cjs/system/index.js +1520 -100
- package/dist/cjs/system/reset.js +1470 -33
- package/dist/cjs/system/shadow.js +1476 -53
- package/dist/cjs/system/spacing.js +1474 -51
- package/dist/cjs/system/svg.js +1463 -26
- package/dist/cjs/system/theme.js +1478 -41
- package/dist/cjs/system/timing.js +1469 -39
- package/dist/cjs/system/typography.js +1464 -32
- package/dist/cjs/transforms/index.js +1490 -70
- package/dist/cjs/utils/index.js +1466 -32
- package/dist/cjs/utils/sequence.js +1461 -27
- package/dist/cjs/utils/var.js +1459 -22
- package/package.json +3 -3
|
@@ -205,32 +205,32 @@ var require_types = __commonJS({
|
|
|
205
205
|
__export2(types_exports, {
|
|
206
206
|
TYPES: () => TYPES,
|
|
207
207
|
is: () => is,
|
|
208
|
-
isArray: () =>
|
|
208
|
+
isArray: () => isArray2,
|
|
209
209
|
isBoolean: () => isBoolean,
|
|
210
210
|
isDate: () => isDate,
|
|
211
211
|
isDefined: () => isDefined2,
|
|
212
212
|
isFunction: () => isFunction,
|
|
213
213
|
isNot: () => isNot,
|
|
214
214
|
isNull: () => isNull,
|
|
215
|
-
isNumber: () =>
|
|
216
|
-
isObject: () =>
|
|
215
|
+
isNumber: () => isNumber2,
|
|
216
|
+
isObject: () => isObject2,
|
|
217
217
|
isObjectLike: () => isObjectLike2,
|
|
218
|
-
isString: () =>
|
|
218
|
+
isString: () => isString4,
|
|
219
219
|
isUndefined: () => isUndefined
|
|
220
220
|
});
|
|
221
221
|
module2.exports = __toCommonJS2(types_exports);
|
|
222
222
|
var import_node = require_node();
|
|
223
|
-
var
|
|
223
|
+
var isObject2 = (arg) => {
|
|
224
224
|
if (arg === null)
|
|
225
225
|
return false;
|
|
226
226
|
return typeof arg === "object" && arg.constructor === Object;
|
|
227
227
|
};
|
|
228
|
-
var
|
|
229
|
-
var
|
|
228
|
+
var isString4 = (arg) => typeof arg === "string";
|
|
229
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
230
230
|
var isFunction = (arg) => typeof arg === "function";
|
|
231
231
|
var isBoolean = (arg) => arg === true || arg === false;
|
|
232
232
|
var isNull = (arg) => arg === null;
|
|
233
|
-
var
|
|
233
|
+
var isArray2 = (arg) => Array.isArray(arg);
|
|
234
234
|
var isDate = (d) => d instanceof Date;
|
|
235
235
|
var isObjectLike2 = (arg) => {
|
|
236
236
|
if (arg === null)
|
|
@@ -238,18 +238,18 @@ var require_types = __commonJS({
|
|
|
238
238
|
return typeof arg === "object";
|
|
239
239
|
};
|
|
240
240
|
var isDefined2 = (arg) => {
|
|
241
|
-
return
|
|
241
|
+
return isObject2(arg) || isObjectLike2(arg) || isString4(arg) || isNumber2(arg) || isFunction(arg) || isArray2(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
242
242
|
};
|
|
243
243
|
var isUndefined = (arg) => {
|
|
244
244
|
return arg === void 0;
|
|
245
245
|
};
|
|
246
246
|
var TYPES = {
|
|
247
247
|
boolean: isBoolean,
|
|
248
|
-
array:
|
|
249
|
-
object:
|
|
250
|
-
string:
|
|
248
|
+
array: isArray2,
|
|
249
|
+
object: isObject2,
|
|
250
|
+
string: isString4,
|
|
251
251
|
date: isDate,
|
|
252
|
-
number:
|
|
252
|
+
number: isNumber2,
|
|
253
253
|
null: isNull,
|
|
254
254
|
function: isFunction,
|
|
255
255
|
objectLike: isObjectLike2,
|
|
@@ -1379,6 +1379,1448 @@ var require_cjs2 = __commonJS({
|
|
|
1379
1379
|
}
|
|
1380
1380
|
});
|
|
1381
1381
|
|
|
1382
|
+
// ../utils/dist/cjs/index.js
|
|
1383
|
+
var require_cjs3 = __commonJS({
|
|
1384
|
+
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
1385
|
+
"use strict";
|
|
1386
|
+
var __create2 = Object.create;
|
|
1387
|
+
var __defProp2 = Object.defineProperty;
|
|
1388
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1389
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1390
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1391
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1392
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
1393
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1394
|
+
};
|
|
1395
|
+
var __export2 = (target, all) => {
|
|
1396
|
+
for (var name in all)
|
|
1397
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1398
|
+
};
|
|
1399
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1400
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1401
|
+
for (let key of __getOwnPropNames2(from))
|
|
1402
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1403
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1404
|
+
}
|
|
1405
|
+
return to;
|
|
1406
|
+
};
|
|
1407
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1408
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
1409
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
1410
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1411
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1412
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1413
|
+
mod
|
|
1414
|
+
));
|
|
1415
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1416
|
+
var require_key2 = __commonJS2({
|
|
1417
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
|
|
1418
|
+
"use strict";
|
|
1419
|
+
var __defProp22 = Object.defineProperty;
|
|
1420
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1421
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1422
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1423
|
+
var __export22 = (target, all) => {
|
|
1424
|
+
for (var name in all)
|
|
1425
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1426
|
+
};
|
|
1427
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1428
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1429
|
+
for (let key of __getOwnPropNames22(from))
|
|
1430
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1431
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1432
|
+
}
|
|
1433
|
+
return to;
|
|
1434
|
+
};
|
|
1435
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1436
|
+
var key_exports = {};
|
|
1437
|
+
__export22(key_exports, {
|
|
1438
|
+
createSnapshotId: () => createSnapshotId,
|
|
1439
|
+
generateKey: () => generateKey
|
|
1440
|
+
});
|
|
1441
|
+
module22.exports = __toCommonJS22(key_exports);
|
|
1442
|
+
var generateKey = /* @__PURE__ */ function() {
|
|
1443
|
+
let index = 0;
|
|
1444
|
+
function newId() {
|
|
1445
|
+
index++;
|
|
1446
|
+
return index;
|
|
1447
|
+
}
|
|
1448
|
+
return newId;
|
|
1449
|
+
}();
|
|
1450
|
+
var createSnapshotId = generateKey;
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
var require_env2 = __commonJS2({
|
|
1454
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
|
|
1455
|
+
"use strict";
|
|
1456
|
+
var __defProp22 = Object.defineProperty;
|
|
1457
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1458
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1459
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1460
|
+
var __export22 = (target, all) => {
|
|
1461
|
+
for (var name in all)
|
|
1462
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1463
|
+
};
|
|
1464
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1465
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1466
|
+
for (let key of __getOwnPropNames22(from))
|
|
1467
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1468
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1469
|
+
}
|
|
1470
|
+
return to;
|
|
1471
|
+
};
|
|
1472
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1473
|
+
var env_exports = {};
|
|
1474
|
+
__export22(env_exports, {
|
|
1475
|
+
NODE_ENV: () => NODE_ENV,
|
|
1476
|
+
getNev: () => getNev,
|
|
1477
|
+
isDevelopment: () => isDevelopment,
|
|
1478
|
+
isProduction: () => isProduction,
|
|
1479
|
+
isTest: () => isTest
|
|
1480
|
+
});
|
|
1481
|
+
module22.exports = __toCommonJS22(env_exports);
|
|
1482
|
+
var NODE_ENV = "development";
|
|
1483
|
+
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
1484
|
+
var isTest = (env = NODE_ENV) => env === "test";
|
|
1485
|
+
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
1486
|
+
var getNev = (key, env = NODE_ENV) => env[key];
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
var require_globals2 = __commonJS2({
|
|
1490
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
|
|
1491
|
+
"use strict";
|
|
1492
|
+
var __defProp22 = Object.defineProperty;
|
|
1493
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1494
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1495
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1496
|
+
var __export22 = (target, all) => {
|
|
1497
|
+
for (var name in all)
|
|
1498
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1499
|
+
};
|
|
1500
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1501
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1502
|
+
for (let key of __getOwnPropNames22(from))
|
|
1503
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1504
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1505
|
+
}
|
|
1506
|
+
return to;
|
|
1507
|
+
};
|
|
1508
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1509
|
+
var globals_exports = {};
|
|
1510
|
+
__export22(globals_exports, {
|
|
1511
|
+
document: () => document22,
|
|
1512
|
+
global: () => global,
|
|
1513
|
+
self: () => self,
|
|
1514
|
+
window: () => window2
|
|
1515
|
+
});
|
|
1516
|
+
module22.exports = __toCommonJS22(globals_exports);
|
|
1517
|
+
var global = globalThis;
|
|
1518
|
+
var self = globalThis;
|
|
1519
|
+
var window2 = globalThis;
|
|
1520
|
+
var document22 = window2.document;
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
var require_node2 = __commonJS2({
|
|
1524
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
|
|
1525
|
+
"use strict";
|
|
1526
|
+
var __defProp22 = Object.defineProperty;
|
|
1527
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1528
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1529
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1530
|
+
var __export22 = (target, all) => {
|
|
1531
|
+
for (var name in all)
|
|
1532
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1533
|
+
};
|
|
1534
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1535
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1536
|
+
for (let key of __getOwnPropNames22(from))
|
|
1537
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1538
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1539
|
+
}
|
|
1540
|
+
return to;
|
|
1541
|
+
};
|
|
1542
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1543
|
+
var node_exports = {};
|
|
1544
|
+
__export22(node_exports, {
|
|
1545
|
+
isHtmlElement: () => isHtmlElement,
|
|
1546
|
+
isNode: () => isNode
|
|
1547
|
+
});
|
|
1548
|
+
module22.exports = __toCommonJS22(node_exports);
|
|
1549
|
+
var import_globals2 = require_globals2();
|
|
1550
|
+
var isNode = (obj) => {
|
|
1551
|
+
return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
1552
|
+
};
|
|
1553
|
+
var isHtmlElement = (obj) => {
|
|
1554
|
+
return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
});
|
|
1558
|
+
var require_types2 = __commonJS2({
|
|
1559
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
|
|
1560
|
+
"use strict";
|
|
1561
|
+
var __defProp22 = Object.defineProperty;
|
|
1562
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1563
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1564
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1565
|
+
var __export22 = (target, all) => {
|
|
1566
|
+
for (var name in all)
|
|
1567
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1568
|
+
};
|
|
1569
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1570
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1571
|
+
for (let key of __getOwnPropNames22(from))
|
|
1572
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1573
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1574
|
+
}
|
|
1575
|
+
return to;
|
|
1576
|
+
};
|
|
1577
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1578
|
+
var types_exports = {};
|
|
1579
|
+
__export22(types_exports, {
|
|
1580
|
+
TYPES: () => TYPES,
|
|
1581
|
+
is: () => is,
|
|
1582
|
+
isArray: () => isArray3,
|
|
1583
|
+
isBoolean: () => isBoolean,
|
|
1584
|
+
isDate: () => isDate,
|
|
1585
|
+
isDefined: () => isDefined2,
|
|
1586
|
+
isFunction: () => isFunction,
|
|
1587
|
+
isNot: () => isNot,
|
|
1588
|
+
isNull: () => isNull,
|
|
1589
|
+
isNumber: () => isNumber2,
|
|
1590
|
+
isObject: () => isObject3,
|
|
1591
|
+
isObjectLike: () => isObjectLike2,
|
|
1592
|
+
isString: () => isString22,
|
|
1593
|
+
isUndefined: () => isUndefined
|
|
1594
|
+
});
|
|
1595
|
+
module22.exports = __toCommonJS22(types_exports);
|
|
1596
|
+
var import_node = require_node2();
|
|
1597
|
+
var isObject3 = (arg) => {
|
|
1598
|
+
if (arg === null)
|
|
1599
|
+
return false;
|
|
1600
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
1601
|
+
};
|
|
1602
|
+
var isString22 = (arg) => typeof arg === "string";
|
|
1603
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
1604
|
+
var isFunction = (arg) => typeof arg === "function";
|
|
1605
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
1606
|
+
var isNull = (arg) => arg === null;
|
|
1607
|
+
var isArray3 = (arg) => Array.isArray(arg);
|
|
1608
|
+
var isDate = (d) => d instanceof Date;
|
|
1609
|
+
var isObjectLike2 = (arg) => {
|
|
1610
|
+
if (arg === null)
|
|
1611
|
+
return false;
|
|
1612
|
+
return typeof arg === "object";
|
|
1613
|
+
};
|
|
1614
|
+
var isDefined2 = (arg) => {
|
|
1615
|
+
return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
1616
|
+
};
|
|
1617
|
+
var isUndefined = (arg) => {
|
|
1618
|
+
return arg === void 0;
|
|
1619
|
+
};
|
|
1620
|
+
var TYPES = {
|
|
1621
|
+
boolean: isBoolean,
|
|
1622
|
+
array: isArray3,
|
|
1623
|
+
object: isObject3,
|
|
1624
|
+
string: isString22,
|
|
1625
|
+
date: isDate,
|
|
1626
|
+
number: isNumber2,
|
|
1627
|
+
null: isNull,
|
|
1628
|
+
function: isFunction,
|
|
1629
|
+
objectLike: isObjectLike2,
|
|
1630
|
+
node: import_node.isNode,
|
|
1631
|
+
htmlElement: import_node.isHtmlElement,
|
|
1632
|
+
defined: isDefined2
|
|
1633
|
+
};
|
|
1634
|
+
var is = (arg) => {
|
|
1635
|
+
return (...args) => {
|
|
1636
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
var isNot = (arg) => {
|
|
1640
|
+
return (...args) => {
|
|
1641
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
1642
|
+
};
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
var require_array2 = __commonJS2({
|
|
1647
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
|
|
1648
|
+
"use strict";
|
|
1649
|
+
var __defProp22 = Object.defineProperty;
|
|
1650
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1651
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1652
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1653
|
+
var __export22 = (target, all) => {
|
|
1654
|
+
for (var name in all)
|
|
1655
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1656
|
+
};
|
|
1657
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1658
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1659
|
+
for (let key of __getOwnPropNames22(from))
|
|
1660
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1661
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1662
|
+
}
|
|
1663
|
+
return to;
|
|
1664
|
+
};
|
|
1665
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1666
|
+
var array_exports = {};
|
|
1667
|
+
__export22(array_exports, {
|
|
1668
|
+
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
1669
|
+
createNestedObject: () => createNestedObject,
|
|
1670
|
+
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
1671
|
+
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
1672
|
+
joinArrays: () => joinArrays,
|
|
1673
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
1674
|
+
mergeArray: () => mergeArray,
|
|
1675
|
+
removeFromArray: () => removeFromArray,
|
|
1676
|
+
removeValueFromArray: () => removeValueFromArray,
|
|
1677
|
+
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
1678
|
+
swapItemsInArray: () => swapItemsInArray
|
|
1679
|
+
});
|
|
1680
|
+
module22.exports = __toCommonJS22(array_exports);
|
|
1681
|
+
var import_object = require_object2();
|
|
1682
|
+
var import_types = require_types2();
|
|
1683
|
+
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
1684
|
+
return arr2.every((val) => arr1.includes(val));
|
|
1685
|
+
};
|
|
1686
|
+
var removeFromArray = (arr, index) => {
|
|
1687
|
+
if ((0, import_types.isString)(index))
|
|
1688
|
+
index = parseInt(index);
|
|
1689
|
+
if ((0, import_types.isNumber)(index)) {
|
|
1690
|
+
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
1691
|
+
throw new Error("Invalid index");
|
|
1692
|
+
}
|
|
1693
|
+
arr.splice(index, 1);
|
|
1694
|
+
} else if ((0, import_types.isArray)(index)) {
|
|
1695
|
+
index.forEach((idx) => removeFromArray(arr, idx));
|
|
1696
|
+
} else {
|
|
1697
|
+
throw new Error("Invalid index");
|
|
1698
|
+
}
|
|
1699
|
+
return arr;
|
|
1700
|
+
};
|
|
1701
|
+
var swapItemsInArray = (arr, i, j) => {
|
|
1702
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
1703
|
+
};
|
|
1704
|
+
var joinArrays = (...arrays) => {
|
|
1705
|
+
return [].concat(...arrays);
|
|
1706
|
+
};
|
|
1707
|
+
var mergeArray = (arr, excludeFrom = []) => {
|
|
1708
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
1709
|
+
};
|
|
1710
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
1711
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
1712
|
+
};
|
|
1713
|
+
var cutArrayBeforeValue = (arr, value) => {
|
|
1714
|
+
const index = arr.indexOf(value);
|
|
1715
|
+
if (index !== -1) {
|
|
1716
|
+
return arr.slice(0, index);
|
|
1717
|
+
}
|
|
1718
|
+
return arr;
|
|
1719
|
+
};
|
|
1720
|
+
var cutArrayAfterValue = (arr, value) => {
|
|
1721
|
+
if (!(0, import_types.isArray)(arr))
|
|
1722
|
+
return;
|
|
1723
|
+
const index = arr.indexOf(value);
|
|
1724
|
+
if (index !== -1) {
|
|
1725
|
+
return arr.slice(index + 1);
|
|
1726
|
+
}
|
|
1727
|
+
return arr;
|
|
1728
|
+
};
|
|
1729
|
+
var createNestedObject = (arr, lastValue) => {
|
|
1730
|
+
const nestedObject = {};
|
|
1731
|
+
if (arr.length === 0) {
|
|
1732
|
+
return lastValue;
|
|
1733
|
+
}
|
|
1734
|
+
arr.reduce((obj, value, index) => {
|
|
1735
|
+
if (!obj[value]) {
|
|
1736
|
+
obj[value] = {};
|
|
1737
|
+
}
|
|
1738
|
+
if (index === arr.length - 1 && lastValue) {
|
|
1739
|
+
obj[value] = lastValue;
|
|
1740
|
+
}
|
|
1741
|
+
return obj[value];
|
|
1742
|
+
}, nestedObject);
|
|
1743
|
+
return nestedObject;
|
|
1744
|
+
};
|
|
1745
|
+
var removeValueFromArray = (arr, value) => {
|
|
1746
|
+
const index = arr.indexOf(value);
|
|
1747
|
+
if (index > -1) {
|
|
1748
|
+
const newArray = [...arr];
|
|
1749
|
+
newArray.splice(index, 1);
|
|
1750
|
+
return newArray;
|
|
1751
|
+
}
|
|
1752
|
+
return arr.slice();
|
|
1753
|
+
};
|
|
1754
|
+
var removeValueFromArrayAll = (arr, value) => {
|
|
1755
|
+
return arr.filter((item) => item !== value);
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
});
|
|
1759
|
+
var require_string2 = __commonJS2({
|
|
1760
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
|
|
1761
|
+
"use strict";
|
|
1762
|
+
var __defProp22 = Object.defineProperty;
|
|
1763
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1764
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1765
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1766
|
+
var __export22 = (target, all) => {
|
|
1767
|
+
for (var name in all)
|
|
1768
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1769
|
+
};
|
|
1770
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1771
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1772
|
+
for (let key of __getOwnPropNames22(from))
|
|
1773
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1774
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1775
|
+
}
|
|
1776
|
+
return to;
|
|
1777
|
+
};
|
|
1778
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1779
|
+
var string_exports = {};
|
|
1780
|
+
__export22(string_exports, {
|
|
1781
|
+
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
1782
|
+
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
1783
|
+
stringIncludesAny: () => stringIncludesAny,
|
|
1784
|
+
trimStringFromSymbols: () => trimStringFromSymbols
|
|
1785
|
+
});
|
|
1786
|
+
module22.exports = __toCommonJS22(string_exports);
|
|
1787
|
+
var stringIncludesAny = (str, characters) => {
|
|
1788
|
+
for (const char of characters) {
|
|
1789
|
+
if (str.includes(char)) {
|
|
1790
|
+
return true;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
return false;
|
|
1794
|
+
};
|
|
1795
|
+
var trimStringFromSymbols = (str, characters) => {
|
|
1796
|
+
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
1797
|
+
return str.replace(pattern, "");
|
|
1798
|
+
};
|
|
1799
|
+
var brackRegex = {
|
|
1800
|
+
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
1801
|
+
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
1802
|
+
};
|
|
1803
|
+
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
1804
|
+
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
1805
|
+
return str;
|
|
1806
|
+
const reg = brackRegex[options.bracketsLength || 2];
|
|
1807
|
+
return str.replace(reg, (_, parentPath, variable) => {
|
|
1808
|
+
if (parentPath) {
|
|
1809
|
+
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
1810
|
+
let parentState = state;
|
|
1811
|
+
for (let i = 0; i < parentLevels; i++) {
|
|
1812
|
+
parentState = parentState.parent;
|
|
1813
|
+
if (!parentState) {
|
|
1814
|
+
return "";
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
const value = parentState[variable.trim()];
|
|
1818
|
+
return value !== void 0 ? `${value}` : "";
|
|
1819
|
+
} else {
|
|
1820
|
+
const value = state[variable.trim()];
|
|
1821
|
+
return value !== void 0 ? `${value}` : "";
|
|
1822
|
+
}
|
|
1823
|
+
});
|
|
1824
|
+
};
|
|
1825
|
+
var lowercaseFirstLetter = (inputString) => {
|
|
1826
|
+
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
1827
|
+
};
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1830
|
+
var require_object2 = __commonJS2({
|
|
1831
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
|
|
1832
|
+
"use strict";
|
|
1833
|
+
var __defProp22 = Object.defineProperty;
|
|
1834
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1835
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1836
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1837
|
+
var __export22 = (target, all) => {
|
|
1838
|
+
for (var name in all)
|
|
1839
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1840
|
+
};
|
|
1841
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1842
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1843
|
+
for (let key of __getOwnPropNames22(from))
|
|
1844
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1845
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1846
|
+
}
|
|
1847
|
+
return to;
|
|
1848
|
+
};
|
|
1849
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1850
|
+
var object_exports = {};
|
|
1851
|
+
__export22(object_exports, {
|
|
1852
|
+
clone: () => clone,
|
|
1853
|
+
deepClone: () => deepClone2,
|
|
1854
|
+
deepCloneExclude: () => deepCloneExclude,
|
|
1855
|
+
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
1856
|
+
deepContains: () => deepContains,
|
|
1857
|
+
deepDestringify: () => deepDestringify,
|
|
1858
|
+
deepDiff: () => deepDiff,
|
|
1859
|
+
deepMerge: () => deepMerge2,
|
|
1860
|
+
deepStringify: () => deepStringify,
|
|
1861
|
+
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
1862
|
+
diff: () => diff,
|
|
1863
|
+
diffArrays: () => diffArrays,
|
|
1864
|
+
diffObjects: () => diffObjects,
|
|
1865
|
+
exec: () => exec,
|
|
1866
|
+
flattenRecursive: () => flattenRecursive,
|
|
1867
|
+
hasOwnProperty: () => hasOwnProperty,
|
|
1868
|
+
isEmpty: () => isEmpty,
|
|
1869
|
+
isEmptyObject: () => isEmptyObject,
|
|
1870
|
+
isEqualDeep: () => isEqualDeep,
|
|
1871
|
+
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
1872
|
+
map: () => map,
|
|
1873
|
+
merge: () => merge2,
|
|
1874
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
1875
|
+
mergeIfExisted: () => mergeIfExisted,
|
|
1876
|
+
objectToString: () => objectToString,
|
|
1877
|
+
overwrite: () => overwrite,
|
|
1878
|
+
overwriteDeep: () => overwriteDeep,
|
|
1879
|
+
overwriteShallow: () => overwriteShallow,
|
|
1880
|
+
removeFromObject: () => removeFromObject,
|
|
1881
|
+
stringToObject: () => stringToObject
|
|
1882
|
+
});
|
|
1883
|
+
module22.exports = __toCommonJS22(object_exports);
|
|
1884
|
+
var import_globals2 = require_globals2();
|
|
1885
|
+
var import_types = require_types2();
|
|
1886
|
+
var import_array = require_array2();
|
|
1887
|
+
var import_string = require_string2();
|
|
1888
|
+
var exec = (param, element, state, context) => {
|
|
1889
|
+
if ((0, import_types.isFunction)(param)) {
|
|
1890
|
+
return param(
|
|
1891
|
+
element,
|
|
1892
|
+
state || element.state,
|
|
1893
|
+
context || element.context
|
|
1894
|
+
);
|
|
1895
|
+
}
|
|
1896
|
+
return param;
|
|
1897
|
+
};
|
|
1898
|
+
var map = (obj, extention, element) => {
|
|
1899
|
+
for (const e in extention) {
|
|
1900
|
+
obj[e] = exec(extention[e], element);
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
var merge2 = (element, obj, excludeFrom = []) => {
|
|
1904
|
+
for (const e in obj) {
|
|
1905
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
1906
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1907
|
+
continue;
|
|
1908
|
+
const elementProp = element[e];
|
|
1909
|
+
const objProp = obj[e];
|
|
1910
|
+
if (elementProp === void 0) {
|
|
1911
|
+
element[e] = objProp;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
return element;
|
|
1915
|
+
};
|
|
1916
|
+
var deepMerge2 = (element, extend, excludeFrom = []) => {
|
|
1917
|
+
for (const e in extend) {
|
|
1918
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
1919
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1920
|
+
continue;
|
|
1921
|
+
const elementProp = element[e];
|
|
1922
|
+
const extendProp = extend[e];
|
|
1923
|
+
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
1924
|
+
deepMerge2(elementProp, extendProp, excludeFrom);
|
|
1925
|
+
} else if (elementProp === void 0) {
|
|
1926
|
+
element[e] = extendProp;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
return element;
|
|
1930
|
+
};
|
|
1931
|
+
var clone = (obj, excludeFrom = []) => {
|
|
1932
|
+
const o = {};
|
|
1933
|
+
for (const prop in obj) {
|
|
1934
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1935
|
+
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
1936
|
+
continue;
|
|
1937
|
+
o[prop] = obj[prop];
|
|
1938
|
+
}
|
|
1939
|
+
return o;
|
|
1940
|
+
};
|
|
1941
|
+
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
1942
|
+
if ((0, import_types.isArray)(obj)) {
|
|
1943
|
+
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
1944
|
+
}
|
|
1945
|
+
const o = {};
|
|
1946
|
+
for (const k in obj) {
|
|
1947
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
1948
|
+
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
1949
|
+
continue;
|
|
1950
|
+
let v = obj[k];
|
|
1951
|
+
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
1952
|
+
v = mergeArrayExclude(v, excludeFrom);
|
|
1953
|
+
}
|
|
1954
|
+
if ((0, import_types.isArray)(v)) {
|
|
1955
|
+
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
1956
|
+
} else if ((0, import_types.isObject)(v)) {
|
|
1957
|
+
o[k] = deepCloneExclude(v, excludeFrom);
|
|
1958
|
+
} else
|
|
1959
|
+
o[k] = v;
|
|
1960
|
+
}
|
|
1961
|
+
return o;
|
|
1962
|
+
};
|
|
1963
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
1964
|
+
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
1965
|
+
};
|
|
1966
|
+
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
1967
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
1968
|
+
for (const prop in obj) {
|
|
1969
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1970
|
+
continue;
|
|
1971
|
+
if (prop === "__proto__")
|
|
1972
|
+
continue;
|
|
1973
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
1974
|
+
continue;
|
|
1975
|
+
let objProp = obj[prop];
|
|
1976
|
+
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
1977
|
+
continue;
|
|
1978
|
+
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
1979
|
+
objProp = (0, import_array.mergeArray)(objProp);
|
|
1980
|
+
}
|
|
1981
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
1982
|
+
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
1983
|
+
} else
|
|
1984
|
+
o[prop] = objProp;
|
|
1985
|
+
}
|
|
1986
|
+
return o;
|
|
1987
|
+
};
|
|
1988
|
+
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
1989
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
1990
|
+
for (const prop in obj) {
|
|
1991
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1992
|
+
continue;
|
|
1993
|
+
const objProp = obj[prop];
|
|
1994
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
1995
|
+
continue;
|
|
1996
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
1997
|
+
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
1998
|
+
} else
|
|
1999
|
+
o[prop] = objProp;
|
|
2000
|
+
}
|
|
2001
|
+
return o;
|
|
2002
|
+
};
|
|
2003
|
+
var deepStringify = (obj, stringified = {}) => {
|
|
2004
|
+
for (const prop in obj) {
|
|
2005
|
+
const objProp = obj[prop];
|
|
2006
|
+
if ((0, import_types.isFunction)(objProp)) {
|
|
2007
|
+
stringified[prop] = objProp.toString();
|
|
2008
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2009
|
+
stringified[prop] = {};
|
|
2010
|
+
deepStringify(objProp, stringified[prop]);
|
|
2011
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2012
|
+
stringified[prop] = [];
|
|
2013
|
+
objProp.forEach((v, i) => {
|
|
2014
|
+
if ((0, import_types.isObject)(v)) {
|
|
2015
|
+
stringified[prop][i] = {};
|
|
2016
|
+
deepStringify(v, stringified[prop][i]);
|
|
2017
|
+
} else if ((0, import_types.isFunction)(v)) {
|
|
2018
|
+
stringified[prop][i] = v.toString();
|
|
2019
|
+
} else {
|
|
2020
|
+
stringified[prop][i] = v;
|
|
2021
|
+
}
|
|
2022
|
+
});
|
|
2023
|
+
} else {
|
|
2024
|
+
stringified[prop] = objProp;
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
return stringified;
|
|
2028
|
+
};
|
|
2029
|
+
var objectToString = (obj, indent = 0) => {
|
|
2030
|
+
const spaces = " ".repeat(indent);
|
|
2031
|
+
let str = "{\n";
|
|
2032
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
2033
|
+
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2034
|
+
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2035
|
+
str += `${spaces} ${stringedKey}: `;
|
|
2036
|
+
if ((0, import_types.isArray)(value)) {
|
|
2037
|
+
str += "[\n";
|
|
2038
|
+
for (const element of value) {
|
|
2039
|
+
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2040
|
+
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2041
|
+
`;
|
|
2042
|
+
} else if ((0, import_types.isString)(element)) {
|
|
2043
|
+
str += `${spaces} '${element}',
|
|
2044
|
+
`;
|
|
2045
|
+
} else {
|
|
2046
|
+
str += `${spaces} ${element},
|
|
2047
|
+
`;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
str += `${spaces} ]`;
|
|
2051
|
+
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2052
|
+
str += objectToString(value, indent + 1);
|
|
2053
|
+
} else if ((0, import_types.isString)(value)) {
|
|
2054
|
+
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2055
|
+
} else {
|
|
2056
|
+
str += value;
|
|
2057
|
+
}
|
|
2058
|
+
str += ",\n";
|
|
2059
|
+
}
|
|
2060
|
+
str += `${spaces}}`;
|
|
2061
|
+
return str;
|
|
2062
|
+
};
|
|
2063
|
+
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2064
|
+
for (const prop in obj) {
|
|
2065
|
+
const objProp = obj[prop];
|
|
2066
|
+
if ((0, import_types.isFunction)(objProp))
|
|
2067
|
+
continue;
|
|
2068
|
+
else if ((0, import_types.isObject)(objProp)) {
|
|
2069
|
+
detached[prop] = {};
|
|
2070
|
+
deepStringify(objProp, detached[prop]);
|
|
2071
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2072
|
+
detached[prop] = [];
|
|
2073
|
+
objProp.forEach((v, i) => {
|
|
2074
|
+
if ((0, import_types.isFunction)(v))
|
|
2075
|
+
return;
|
|
2076
|
+
if ((0, import_types.isObject)(v)) {
|
|
2077
|
+
detached[prop][i] = {};
|
|
2078
|
+
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2079
|
+
} else {
|
|
2080
|
+
detached[prop][i] = v;
|
|
2081
|
+
}
|
|
2082
|
+
});
|
|
2083
|
+
} else {
|
|
2084
|
+
detached[prop] = objProp;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
return detached;
|
|
2088
|
+
};
|
|
2089
|
+
var deepDestringify = (obj, destringified = {}) => {
|
|
2090
|
+
for (const prop in obj) {
|
|
2091
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2092
|
+
if (!hasOwnProperty2)
|
|
2093
|
+
continue;
|
|
2094
|
+
const objProp = obj[prop];
|
|
2095
|
+
if ((0, import_types.isString)(objProp)) {
|
|
2096
|
+
if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
|
|
2097
|
+
try {
|
|
2098
|
+
const evalProp = import_globals2.window.eval(`(${objProp})`);
|
|
2099
|
+
destringified[prop] = evalProp;
|
|
2100
|
+
} catch (e) {
|
|
2101
|
+
if (e)
|
|
2102
|
+
destringified[prop] = objProp;
|
|
2103
|
+
}
|
|
2104
|
+
} else {
|
|
2105
|
+
destringified[prop] = objProp;
|
|
2106
|
+
}
|
|
2107
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2108
|
+
destringified[prop] = [];
|
|
2109
|
+
objProp.forEach((arrProp) => {
|
|
2110
|
+
if ((0, import_types.isString)(arrProp)) {
|
|
2111
|
+
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2112
|
+
try {
|
|
2113
|
+
const evalProp = import_globals2.window.eval(`(${arrProp})`);
|
|
2114
|
+
destringified[prop].push(evalProp);
|
|
2115
|
+
} catch (e) {
|
|
2116
|
+
if (e)
|
|
2117
|
+
destringified[prop].push(arrProp);
|
|
2118
|
+
}
|
|
2119
|
+
} else {
|
|
2120
|
+
destringified[prop].push(arrProp);
|
|
2121
|
+
}
|
|
2122
|
+
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2123
|
+
destringified[prop].push(deepDestringify(arrProp));
|
|
2124
|
+
} else {
|
|
2125
|
+
destringified[prop].push(arrProp);
|
|
2126
|
+
}
|
|
2127
|
+
});
|
|
2128
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2129
|
+
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2130
|
+
} else {
|
|
2131
|
+
destringified[prop] = objProp;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
return destringified;
|
|
2135
|
+
};
|
|
2136
|
+
var stringToObject = (str, verbose) => {
|
|
2137
|
+
try {
|
|
2138
|
+
return import_globals2.window.eval("(" + str + ")");
|
|
2139
|
+
} catch (e) {
|
|
2140
|
+
if (verbose)
|
|
2141
|
+
console.warn(e);
|
|
2142
|
+
}
|
|
2143
|
+
};
|
|
2144
|
+
var diffObjects = (original, objToDiff, cache) => {
|
|
2145
|
+
for (const e in objToDiff) {
|
|
2146
|
+
if (e === "ref")
|
|
2147
|
+
continue;
|
|
2148
|
+
const originalProp = original[e];
|
|
2149
|
+
const objToDiffProp = objToDiff[e];
|
|
2150
|
+
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2151
|
+
cache[e] = {};
|
|
2152
|
+
diff(originalProp, objToDiffProp, cache[e]);
|
|
2153
|
+
} else if (objToDiffProp !== void 0) {
|
|
2154
|
+
cache[e] = objToDiffProp;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
return cache;
|
|
2158
|
+
};
|
|
2159
|
+
var diffArrays = (original, objToDiff, cache) => {
|
|
2160
|
+
if (original.length !== objToDiff.length) {
|
|
2161
|
+
cache = objToDiff;
|
|
2162
|
+
} else {
|
|
2163
|
+
const diffArr = [];
|
|
2164
|
+
for (let i = 0; i < original.length; i++) {
|
|
2165
|
+
const diffObj = diff(original[i], objToDiff[i]);
|
|
2166
|
+
if (Object.keys(diffObj).length > 0) {
|
|
2167
|
+
diffArr.push(diffObj);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
if (diffArr.length > 0) {
|
|
2171
|
+
cache = diffArr;
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
return cache;
|
|
2175
|
+
};
|
|
2176
|
+
var diff = (original, objToDiff, cache = {}) => {
|
|
2177
|
+
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2178
|
+
cache = [];
|
|
2179
|
+
diffArrays(original, objToDiff, cache);
|
|
2180
|
+
} else {
|
|
2181
|
+
diffObjects(original, objToDiff, cache);
|
|
2182
|
+
}
|
|
2183
|
+
return cache;
|
|
2184
|
+
};
|
|
2185
|
+
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2186
|
+
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2187
|
+
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2188
|
+
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2189
|
+
var deepDiff = (lhs, rhs) => {
|
|
2190
|
+
if (lhs === rhs)
|
|
2191
|
+
return {};
|
|
2192
|
+
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2193
|
+
return rhs;
|
|
2194
|
+
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2195
|
+
if (!hasOwnProperty(rhs, key)) {
|
|
2196
|
+
acc[key] = void 0;
|
|
2197
|
+
}
|
|
2198
|
+
return acc;
|
|
2199
|
+
}, makeObjectWithoutPrototype());
|
|
2200
|
+
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2201
|
+
if (lhs.valueOf() === rhs.valueOf())
|
|
2202
|
+
return {};
|
|
2203
|
+
return rhs;
|
|
2204
|
+
}
|
|
2205
|
+
return Object.keys(rhs).reduce((acc, key) => {
|
|
2206
|
+
if (!hasOwnProperty(lhs, key)) {
|
|
2207
|
+
acc[key] = rhs[key];
|
|
2208
|
+
return acc;
|
|
2209
|
+
}
|
|
2210
|
+
const difference = diff(lhs[key], rhs[key]);
|
|
2211
|
+
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2212
|
+
return acc;
|
|
2213
|
+
}
|
|
2214
|
+
acc[key] = difference;
|
|
2215
|
+
return acc;
|
|
2216
|
+
}, deletedValues);
|
|
2217
|
+
};
|
|
2218
|
+
var overwrite = (element, params, excludeFrom = []) => {
|
|
2219
|
+
const { ref } = element;
|
|
2220
|
+
const changes = {};
|
|
2221
|
+
for (const e in params) {
|
|
2222
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2223
|
+
continue;
|
|
2224
|
+
const elementProp = element[e];
|
|
2225
|
+
const paramsProp = params[e];
|
|
2226
|
+
if (paramsProp) {
|
|
2227
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
2228
|
+
ref[e] = paramsProp;
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
return changes;
|
|
2232
|
+
};
|
|
2233
|
+
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2234
|
+
for (const e in params) {
|
|
2235
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2236
|
+
continue;
|
|
2237
|
+
obj[e] = params[e];
|
|
2238
|
+
}
|
|
2239
|
+
return obj;
|
|
2240
|
+
};
|
|
2241
|
+
var overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
2242
|
+
for (const e in params) {
|
|
2243
|
+
if (e === "__proto__")
|
|
2244
|
+
continue;
|
|
2245
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2246
|
+
continue;
|
|
2247
|
+
const objProp = obj[e];
|
|
2248
|
+
const paramsProp = params[e];
|
|
2249
|
+
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2250
|
+
overwriteDeep(objProp, paramsProp);
|
|
2251
|
+
} else if (paramsProp !== void 0) {
|
|
2252
|
+
obj[e] = paramsProp;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
return obj;
|
|
2256
|
+
};
|
|
2257
|
+
var mergeIfExisted = (a, b) => {
|
|
2258
|
+
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2259
|
+
return deepMerge2(a, b);
|
|
2260
|
+
return a || b;
|
|
2261
|
+
};
|
|
2262
|
+
var flattenRecursive = (param, prop, stack = []) => {
|
|
2263
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2264
|
+
stack.push(objectized);
|
|
2265
|
+
const extendOfExtend = objectized[prop];
|
|
2266
|
+
if (extendOfExtend)
|
|
2267
|
+
flattenRecursive(extendOfExtend, prop, stack);
|
|
2268
|
+
delete objectized[prop];
|
|
2269
|
+
return stack;
|
|
2270
|
+
};
|
|
2271
|
+
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2272
|
+
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2273
|
+
return param === element;
|
|
2274
|
+
}
|
|
2275
|
+
if (visited.has(param) || visited.has(element)) {
|
|
2276
|
+
return true;
|
|
2277
|
+
}
|
|
2278
|
+
visited.add(param);
|
|
2279
|
+
visited.add(element);
|
|
2280
|
+
const keysParam = Object.keys(param);
|
|
2281
|
+
const keysElement = Object.keys(element);
|
|
2282
|
+
if (keysParam.length !== keysElement.length) {
|
|
2283
|
+
return false;
|
|
2284
|
+
}
|
|
2285
|
+
for (const key of keysParam) {
|
|
2286
|
+
if (!keysElement.includes(key)) {
|
|
2287
|
+
return false;
|
|
2288
|
+
}
|
|
2289
|
+
const paramProp = param[key];
|
|
2290
|
+
const elementProp = element[key];
|
|
2291
|
+
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2292
|
+
return false;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
return true;
|
|
2296
|
+
};
|
|
2297
|
+
var deepContains = (obj1, obj2) => {
|
|
2298
|
+
if (typeof obj1 !== typeof obj2) {
|
|
2299
|
+
return false;
|
|
2300
|
+
}
|
|
2301
|
+
if ((0, import_types.isObjectLike)(obj1)) {
|
|
2302
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
2303
|
+
if (obj1.length !== obj2.length) {
|
|
2304
|
+
return false;
|
|
2305
|
+
}
|
|
2306
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
2307
|
+
if (!deepContains(obj1[i], obj2[i])) {
|
|
2308
|
+
return false;
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
2312
|
+
for (const key in obj1) {
|
|
2313
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2314
|
+
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2315
|
+
return false;
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
} else {
|
|
2320
|
+
return obj2 === obj1;
|
|
2321
|
+
}
|
|
2322
|
+
return true;
|
|
2323
|
+
};
|
|
2324
|
+
var removeFromObject = (obj, props) => {
|
|
2325
|
+
if (props === void 0 || props === null)
|
|
2326
|
+
return obj;
|
|
2327
|
+
if ((0, import_types.is)(props)("string", "number")) {
|
|
2328
|
+
delete obj[props];
|
|
2329
|
+
} else if ((0, import_types.isArray)(props)) {
|
|
2330
|
+
props.forEach((prop) => delete obj[prop]);
|
|
2331
|
+
} else {
|
|
2332
|
+
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
2333
|
+
}
|
|
2334
|
+
return obj;
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
});
|
|
2338
|
+
var require_function2 = __commonJS2({
|
|
2339
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
|
|
2340
|
+
"use strict";
|
|
2341
|
+
var __defProp22 = Object.defineProperty;
|
|
2342
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2343
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2344
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2345
|
+
var __export22 = (target, all) => {
|
|
2346
|
+
for (var name in all)
|
|
2347
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2348
|
+
};
|
|
2349
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2350
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2351
|
+
for (let key of __getOwnPropNames22(from))
|
|
2352
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2353
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2354
|
+
}
|
|
2355
|
+
return to;
|
|
2356
|
+
};
|
|
2357
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2358
|
+
var function_exports = {};
|
|
2359
|
+
__export22(function_exports, {
|
|
2360
|
+
debounce: () => debounce,
|
|
2361
|
+
debounceOnContext: () => debounceOnContext,
|
|
2362
|
+
isStringFunction: () => isStringFunction,
|
|
2363
|
+
memoize: () => memoize
|
|
2364
|
+
});
|
|
2365
|
+
module22.exports = __toCommonJS22(function_exports);
|
|
2366
|
+
function debounce(func, wait, immediate) {
|
|
2367
|
+
let timeout;
|
|
2368
|
+
return function() {
|
|
2369
|
+
const context = this;
|
|
2370
|
+
const args = arguments;
|
|
2371
|
+
const later = function() {
|
|
2372
|
+
timeout = null;
|
|
2373
|
+
if (!immediate)
|
|
2374
|
+
func.apply(context, args);
|
|
2375
|
+
};
|
|
2376
|
+
const callNow = immediate && !timeout;
|
|
2377
|
+
clearTimeout(timeout);
|
|
2378
|
+
timeout = setTimeout(later, wait);
|
|
2379
|
+
if (callNow)
|
|
2380
|
+
func.apply(context, args);
|
|
2381
|
+
};
|
|
2382
|
+
}
|
|
2383
|
+
var debounceOnContext = (element, func, timeout = 300) => {
|
|
2384
|
+
let timer;
|
|
2385
|
+
return (...args) => {
|
|
2386
|
+
clearTimeout(timer);
|
|
2387
|
+
timer = setTimeout(() => {
|
|
2388
|
+
func.apply(element, args);
|
|
2389
|
+
}, timeout);
|
|
2390
|
+
};
|
|
2391
|
+
};
|
|
2392
|
+
var memoize = (fn) => {
|
|
2393
|
+
const cache = {};
|
|
2394
|
+
return (...args) => {
|
|
2395
|
+
const n = args[0];
|
|
2396
|
+
if (n in cache) {
|
|
2397
|
+
return cache[n];
|
|
2398
|
+
} else {
|
|
2399
|
+
const result = fn(n);
|
|
2400
|
+
cache[n] = result;
|
|
2401
|
+
return result;
|
|
2402
|
+
}
|
|
2403
|
+
};
|
|
2404
|
+
};
|
|
2405
|
+
var isStringFunction = (inputString) => {
|
|
2406
|
+
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
2407
|
+
return functionRegex.test(inputString);
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
});
|
|
2411
|
+
var require_log2 = __commonJS2({
|
|
2412
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
|
|
2413
|
+
"use strict";
|
|
2414
|
+
var __defProp22 = Object.defineProperty;
|
|
2415
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2416
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2417
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2418
|
+
var __export22 = (target, all) => {
|
|
2419
|
+
for (var name in all)
|
|
2420
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2421
|
+
};
|
|
2422
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2423
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2424
|
+
for (let key of __getOwnPropNames22(from))
|
|
2425
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2426
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2427
|
+
}
|
|
2428
|
+
return to;
|
|
2429
|
+
};
|
|
2430
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2431
|
+
var log_exports = {};
|
|
2432
|
+
__export22(log_exports, {
|
|
2433
|
+
logGroupIf: () => logGroupIf,
|
|
2434
|
+
logIf: () => logIf
|
|
2435
|
+
});
|
|
2436
|
+
module22.exports = __toCommonJS22(log_exports);
|
|
2437
|
+
var logIf = (bool, ...arg) => {
|
|
2438
|
+
if (bool)
|
|
2439
|
+
arg.map((v) => console.log(v));
|
|
2440
|
+
};
|
|
2441
|
+
var logGroupIf = (bool, key, ...arg) => {
|
|
2442
|
+
if (bool) {
|
|
2443
|
+
console.group(key);
|
|
2444
|
+
arg.map((v) => console.log(v));
|
|
2445
|
+
console.groupEnd(key);
|
|
2446
|
+
}
|
|
2447
|
+
};
|
|
2448
|
+
}
|
|
2449
|
+
});
|
|
2450
|
+
var require_cookie2 = __commonJS2({
|
|
2451
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
|
|
2452
|
+
"use strict";
|
|
2453
|
+
var __defProp22 = Object.defineProperty;
|
|
2454
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2455
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2456
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2457
|
+
var __export22 = (target, all) => {
|
|
2458
|
+
for (var name in all)
|
|
2459
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2460
|
+
};
|
|
2461
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2462
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2463
|
+
for (let key of __getOwnPropNames22(from))
|
|
2464
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2465
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2466
|
+
}
|
|
2467
|
+
return to;
|
|
2468
|
+
};
|
|
2469
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2470
|
+
var cookie_exports = {};
|
|
2471
|
+
__export22(cookie_exports, {
|
|
2472
|
+
getCookie: () => getCookie,
|
|
2473
|
+
isMobile: () => isMobile,
|
|
2474
|
+
setCookie: () => setCookie
|
|
2475
|
+
});
|
|
2476
|
+
module22.exports = __toCommonJS22(cookie_exports);
|
|
2477
|
+
var import_types = require_types2();
|
|
2478
|
+
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
2479
|
+
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
2480
|
+
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2481
|
+
return;
|
|
2482
|
+
const d = /* @__PURE__ */ new Date();
|
|
2483
|
+
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
2484
|
+
const expires = `expires=${d.toUTCString()}`;
|
|
2485
|
+
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2486
|
+
};
|
|
2487
|
+
var getCookie = (cname) => {
|
|
2488
|
+
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2489
|
+
return;
|
|
2490
|
+
const name = `${cname}=`;
|
|
2491
|
+
const decodedCookie = decodeURIComponent(document.cookie);
|
|
2492
|
+
const ca = decodedCookie.split(";");
|
|
2493
|
+
for (let i = 0; i < ca.length; i++) {
|
|
2494
|
+
let c = ca[i];
|
|
2495
|
+
while (c.charAt(0) === " ")
|
|
2496
|
+
c = c.substring(1);
|
|
2497
|
+
if (c.indexOf(name) === 0)
|
|
2498
|
+
return c.substring(name.length, c.length);
|
|
2499
|
+
}
|
|
2500
|
+
return "";
|
|
2501
|
+
};
|
|
2502
|
+
}
|
|
2503
|
+
});
|
|
2504
|
+
var require_tags2 = __commonJS2({
|
|
2505
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
|
|
2506
|
+
"use strict";
|
|
2507
|
+
var __defProp22 = Object.defineProperty;
|
|
2508
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2509
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2510
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2511
|
+
var __export22 = (target, all) => {
|
|
2512
|
+
for (var name in all)
|
|
2513
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2514
|
+
};
|
|
2515
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2516
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2517
|
+
for (let key of __getOwnPropNames22(from))
|
|
2518
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2519
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2520
|
+
}
|
|
2521
|
+
return to;
|
|
2522
|
+
};
|
|
2523
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2524
|
+
var tags_exports = {};
|
|
2525
|
+
__export22(tags_exports, {
|
|
2526
|
+
HTML_TAGS: () => HTML_TAGS,
|
|
2527
|
+
isValidHtmlTag: () => isValidHtmlTag
|
|
2528
|
+
});
|
|
2529
|
+
module22.exports = __toCommonJS22(tags_exports);
|
|
2530
|
+
var HTML_TAGS = {
|
|
2531
|
+
root: [
|
|
2532
|
+
"body",
|
|
2533
|
+
"html"
|
|
2534
|
+
],
|
|
2535
|
+
head: [
|
|
2536
|
+
"title",
|
|
2537
|
+
"base",
|
|
2538
|
+
"meta",
|
|
2539
|
+
"style"
|
|
2540
|
+
],
|
|
2541
|
+
body: [
|
|
2542
|
+
"string",
|
|
2543
|
+
"fragment",
|
|
2544
|
+
"a",
|
|
2545
|
+
"abbr",
|
|
2546
|
+
"acronym",
|
|
2547
|
+
"address",
|
|
2548
|
+
"applet",
|
|
2549
|
+
"area",
|
|
2550
|
+
"article",
|
|
2551
|
+
"aside",
|
|
2552
|
+
"audio",
|
|
2553
|
+
"b",
|
|
2554
|
+
"basefont",
|
|
2555
|
+
"bdi",
|
|
2556
|
+
"bdo",
|
|
2557
|
+
"big",
|
|
2558
|
+
"blockquote",
|
|
2559
|
+
"br",
|
|
2560
|
+
"button",
|
|
2561
|
+
"canvas",
|
|
2562
|
+
"caption",
|
|
2563
|
+
"center",
|
|
2564
|
+
"cite",
|
|
2565
|
+
"code",
|
|
2566
|
+
"search",
|
|
2567
|
+
"col",
|
|
2568
|
+
"colgroup",
|
|
2569
|
+
"data",
|
|
2570
|
+
"datalist",
|
|
2571
|
+
"dd",
|
|
2572
|
+
"del",
|
|
2573
|
+
"details",
|
|
2574
|
+
"dfn",
|
|
2575
|
+
"dialog",
|
|
2576
|
+
"dir",
|
|
2577
|
+
"div",
|
|
2578
|
+
"dl",
|
|
2579
|
+
"dt",
|
|
2580
|
+
"em",
|
|
2581
|
+
"embed",
|
|
2582
|
+
"fieldset",
|
|
2583
|
+
"figcaption",
|
|
2584
|
+
"figure",
|
|
2585
|
+
"font",
|
|
2586
|
+
"footer",
|
|
2587
|
+
"form",
|
|
2588
|
+
"frame",
|
|
2589
|
+
"frameset",
|
|
2590
|
+
"h1",
|
|
2591
|
+
"h2",
|
|
2592
|
+
"h3",
|
|
2593
|
+
"h4",
|
|
2594
|
+
"h5",
|
|
2595
|
+
"h6",
|
|
2596
|
+
"head",
|
|
2597
|
+
"header",
|
|
2598
|
+
"hr",
|
|
2599
|
+
"i",
|
|
2600
|
+
"iframe",
|
|
2601
|
+
"img",
|
|
2602
|
+
"input",
|
|
2603
|
+
"ins",
|
|
2604
|
+
"kbd",
|
|
2605
|
+
"label",
|
|
2606
|
+
"legend",
|
|
2607
|
+
"li",
|
|
2608
|
+
"link",
|
|
2609
|
+
"main",
|
|
2610
|
+
"map",
|
|
2611
|
+
"mark",
|
|
2612
|
+
"meter",
|
|
2613
|
+
"nav",
|
|
2614
|
+
"noframes",
|
|
2615
|
+
"noscript",
|
|
2616
|
+
"object",
|
|
2617
|
+
"ol",
|
|
2618
|
+
"optgroup",
|
|
2619
|
+
"option",
|
|
2620
|
+
"output",
|
|
2621
|
+
"p",
|
|
2622
|
+
"param",
|
|
2623
|
+
"picture",
|
|
2624
|
+
"pre",
|
|
2625
|
+
"progress",
|
|
2626
|
+
"hgroup",
|
|
2627
|
+
"q",
|
|
2628
|
+
"rp",
|
|
2629
|
+
"rt",
|
|
2630
|
+
"ruby",
|
|
2631
|
+
"s",
|
|
2632
|
+
"samp",
|
|
2633
|
+
"script",
|
|
2634
|
+
"section",
|
|
2635
|
+
"select",
|
|
2636
|
+
"small",
|
|
2637
|
+
"source",
|
|
2638
|
+
"span",
|
|
2639
|
+
"strike",
|
|
2640
|
+
"strong",
|
|
2641
|
+
"sub",
|
|
2642
|
+
"summary",
|
|
2643
|
+
"sup",
|
|
2644
|
+
"table",
|
|
2645
|
+
"tbody",
|
|
2646
|
+
"td",
|
|
2647
|
+
"template",
|
|
2648
|
+
"hgroup",
|
|
2649
|
+
"textarea",
|
|
2650
|
+
"tfoot",
|
|
2651
|
+
"th",
|
|
2652
|
+
"thead",
|
|
2653
|
+
"time",
|
|
2654
|
+
"tr",
|
|
2655
|
+
"track",
|
|
2656
|
+
"tt",
|
|
2657
|
+
"u",
|
|
2658
|
+
"ul",
|
|
2659
|
+
"var",
|
|
2660
|
+
"video",
|
|
2661
|
+
"wbr",
|
|
2662
|
+
// SVG
|
|
2663
|
+
"svg",
|
|
2664
|
+
"path"
|
|
2665
|
+
]
|
|
2666
|
+
};
|
|
2667
|
+
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
2668
|
+
}
|
|
2669
|
+
});
|
|
2670
|
+
var require_cjs4 = __commonJS2({
|
|
2671
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
|
|
2672
|
+
"use strict";
|
|
2673
|
+
var __defProp22 = Object.defineProperty;
|
|
2674
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2675
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2676
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2677
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2678
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2679
|
+
for (let key of __getOwnPropNames22(from))
|
|
2680
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2681
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2682
|
+
}
|
|
2683
|
+
return to;
|
|
2684
|
+
};
|
|
2685
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
2686
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2687
|
+
var utils_exports = {};
|
|
2688
|
+
module22.exports = __toCommonJS22(utils_exports);
|
|
2689
|
+
__reExport(utils_exports, require_key2(), module22.exports);
|
|
2690
|
+
__reExport(utils_exports, require_env2(), module22.exports);
|
|
2691
|
+
__reExport(utils_exports, require_types2(), module22.exports);
|
|
2692
|
+
__reExport(utils_exports, require_object2(), module22.exports);
|
|
2693
|
+
__reExport(utils_exports, require_function2(), module22.exports);
|
|
2694
|
+
__reExport(utils_exports, require_array2(), module22.exports);
|
|
2695
|
+
__reExport(utils_exports, require_node2(), module22.exports);
|
|
2696
|
+
__reExport(utils_exports, require_log2(), module22.exports);
|
|
2697
|
+
__reExport(utils_exports, require_string2(), module22.exports);
|
|
2698
|
+
__reExport(utils_exports, require_globals2(), module22.exports);
|
|
2699
|
+
__reExport(utils_exports, require_cookie2(), module22.exports);
|
|
2700
|
+
__reExport(utils_exports, require_tags2(), module22.exports);
|
|
2701
|
+
}
|
|
2702
|
+
});
|
|
2703
|
+
var src_exports = {};
|
|
2704
|
+
__export2(src_exports, {
|
|
2705
|
+
arrayzeValue: () => arrayzeValue,
|
|
2706
|
+
copyStringToClipboard: () => copyStringToClipboard,
|
|
2707
|
+
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
2708
|
+
findClosestNumber: () => findClosestNumber,
|
|
2709
|
+
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
2710
|
+
formatDate: () => formatDate,
|
|
2711
|
+
loadJavascriptFile: () => loadJavascriptFile,
|
|
2712
|
+
removeChars: () => removeChars,
|
|
2713
|
+
toCamelCase: () => toCamelCase,
|
|
2714
|
+
toDashCase: () => toDashCase2,
|
|
2715
|
+
toDescriptionCase: () => toDescriptionCase,
|
|
2716
|
+
toTitleCase: () => toTitleCase,
|
|
2717
|
+
toggleFullscreen: () => toggleFullscreen
|
|
2718
|
+
});
|
|
2719
|
+
module2.exports = __toCommonJS2(src_exports);
|
|
2720
|
+
var import_utils22 = __toESM2(require_cjs4(), 1);
|
|
2721
|
+
var toggleFullscreen = (el) => {
|
|
2722
|
+
if (!document.fullscreenElement) {
|
|
2723
|
+
el.node.requestFullscreen().catch((err) => {
|
|
2724
|
+
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
2725
|
+
});
|
|
2726
|
+
} else {
|
|
2727
|
+
document.exitFullscreen();
|
|
2728
|
+
}
|
|
2729
|
+
};
|
|
2730
|
+
var import_utils9 = __toESM2(require_cjs4(), 1);
|
|
2731
|
+
var findClosestNumber = (number, arr) => {
|
|
2732
|
+
return ((0, import_utils9.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
2733
|
+
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
2734
|
+
});
|
|
2735
|
+
};
|
|
2736
|
+
var findClosestNumberInFactory = (val, factory) => {
|
|
2737
|
+
val = parseFloat(val);
|
|
2738
|
+
if ((0, import_utils9.isObject)(factory))
|
|
2739
|
+
factory = Object.values(factory);
|
|
2740
|
+
return findClosestNumber(val, factory);
|
|
2741
|
+
};
|
|
2742
|
+
var formatDate = (timestamp) => {
|
|
2743
|
+
if (!timestamp)
|
|
2744
|
+
return "";
|
|
2745
|
+
const d = new Date(timestamp);
|
|
2746
|
+
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
2747
|
+
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
2748
|
+
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
2749
|
+
return `${da} ${mo}, ${ye}`;
|
|
2750
|
+
};
|
|
2751
|
+
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
2752
|
+
const fib = [0, 1];
|
|
2753
|
+
for (let i = 2; i <= n; i++) {
|
|
2754
|
+
fib[i] = fib[i - 1] + fib[i - 2];
|
|
2755
|
+
}
|
|
2756
|
+
return fib[n];
|
|
2757
|
+
};
|
|
2758
|
+
var loadJavascriptFile = (FILE_URL, async = true, doc = document, type = "text/javascript") => {
|
|
2759
|
+
return new Promise((resolve, reject) => {
|
|
2760
|
+
try {
|
|
2761
|
+
const scriptEle = doc.createElement("script");
|
|
2762
|
+
scriptEle.type = type;
|
|
2763
|
+
scriptEle.async = async;
|
|
2764
|
+
scriptEle.src = FILE_URL;
|
|
2765
|
+
scriptEle.addEventListener("load", (ev) => {
|
|
2766
|
+
resolve({
|
|
2767
|
+
status: true
|
|
2768
|
+
});
|
|
2769
|
+
});
|
|
2770
|
+
scriptEle.addEventListener("error", (ev) => {
|
|
2771
|
+
reject({
|
|
2772
|
+
status: false,
|
|
2773
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
2774
|
+
});
|
|
2775
|
+
});
|
|
2776
|
+
doc.body.appendChild(scriptEle);
|
|
2777
|
+
} catch (error) {
|
|
2778
|
+
reject(error);
|
|
2779
|
+
}
|
|
2780
|
+
});
|
|
2781
|
+
};
|
|
2782
|
+
var copyStringToClipboard = (str) => {
|
|
2783
|
+
const el = document.createElement("textarea");
|
|
2784
|
+
el.value = str;
|
|
2785
|
+
el.setAttribute("readonly", "");
|
|
2786
|
+
el.style = { position: "absolute", left: "-9999px" };
|
|
2787
|
+
document.body.appendChild(el);
|
|
2788
|
+
el.select();
|
|
2789
|
+
document.execCommand("copy");
|
|
2790
|
+
document.body.removeChild(el);
|
|
2791
|
+
};
|
|
2792
|
+
var removeChars = (str) => {
|
|
2793
|
+
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
2794
|
+
};
|
|
2795
|
+
var toCamelCase = (str) => {
|
|
2796
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
2797
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
2798
|
+
}).replaceAll(/\s+/g, "");
|
|
2799
|
+
};
|
|
2800
|
+
var toTitleCase = (str) => str && str.replace(
|
|
2801
|
+
/\w\S*/g,
|
|
2802
|
+
(txt) => {
|
|
2803
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
2804
|
+
}
|
|
2805
|
+
);
|
|
2806
|
+
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2807
|
+
var toDescriptionCase = (str = "") => {
|
|
2808
|
+
const result = str.replace(/([A-Z])/g, " $1");
|
|
2809
|
+
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
2810
|
+
};
|
|
2811
|
+
var arrayzeValue = (val) => {
|
|
2812
|
+
if ((0, import_utils22.isArray)(val))
|
|
2813
|
+
return val;
|
|
2814
|
+
if ((0, import_utils22.isString)(val))
|
|
2815
|
+
return val.split(" ");
|
|
2816
|
+
if ((0, import_utils22.isObject)(val))
|
|
2817
|
+
return Object.values(val);
|
|
2818
|
+
if ((0, import_utils22.isNumber)(val))
|
|
2819
|
+
return [val];
|
|
2820
|
+
};
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2823
|
+
|
|
1382
2824
|
// src/system/typography.js
|
|
1383
2825
|
var typography_exports = {};
|
|
1384
2826
|
__export(typography_exports, {
|
|
@@ -1388,7 +2830,7 @@ __export(typography_exports, {
|
|
|
1388
2830
|
runThroughMedia: () => runThroughMedia
|
|
1389
2831
|
});
|
|
1390
2832
|
module.exports = __toCommonJS(typography_exports);
|
|
1391
|
-
var
|
|
2833
|
+
var import_utils7 = __toESM(require_cjs(), 1);
|
|
1392
2834
|
|
|
1393
2835
|
// src/factory.js
|
|
1394
2836
|
var import_utils = __toESM(require_cjs(), 1);
|
|
@@ -1615,18 +3057,8 @@ var import_globals = __toESM(require_cjs2(), 1);
|
|
|
1615
3057
|
var import_utils2 = __toESM(require_cjs(), 1);
|
|
1616
3058
|
|
|
1617
3059
|
// src/utils/sequence.js
|
|
1618
|
-
var
|
|
1619
|
-
|
|
1620
|
-
// ../utils/src/index.js
|
|
1621
|
-
var import_utils4 = __toESM(require_cjs());
|
|
1622
|
-
|
|
1623
|
-
// ../utils/src/scaling.js
|
|
1624
|
-
var import_utils3 = __toESM(require_cjs());
|
|
1625
|
-
|
|
1626
|
-
// ../utils/src/index.js
|
|
1627
|
-
var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
1628
|
-
|
|
1629
|
-
// src/utils/sequence.js
|
|
3060
|
+
var import_utils3 = __toESM(require_cjs(), 1);
|
|
3061
|
+
var import_utils4 = __toESM(require_cjs3(), 1);
|
|
1630
3062
|
var numToLetterMap = {
|
|
1631
3063
|
"-6": "U",
|
|
1632
3064
|
"-5": "V",
|
|
@@ -1768,9 +3200,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
1768
3200
|
unit = UNIT2.default,
|
|
1769
3201
|
useVariable
|
|
1770
3202
|
} = sequenceProps;
|
|
1771
|
-
if ((0,
|
|
3203
|
+
if ((0, import_utils3.isString)(value) && value.slice(0, 2) === "--")
|
|
1772
3204
|
return `var(${value})`;
|
|
1773
|
-
const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
|
|
3205
|
+
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
1774
3206
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
1775
3207
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
1776
3208
|
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
@@ -1833,7 +3265,7 @@ var findHeadings = (propertyNames) => {
|
|
|
1833
3265
|
};
|
|
1834
3266
|
|
|
1835
3267
|
// src/utils/var.js
|
|
1836
|
-
var
|
|
3268
|
+
var import_utils5 = __toESM(require_cjs(), 1);
|
|
1837
3269
|
var applySequenceGlobalVars = (vars, obj, options) => {
|
|
1838
3270
|
const CONFIG2 = getActiveConfig();
|
|
1839
3271
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
@@ -1904,7 +3336,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1904
3336
|
};
|
|
1905
3337
|
|
|
1906
3338
|
// src/utils/sprite.js
|
|
1907
|
-
var
|
|
3339
|
+
var import_utils6 = __toESM(require_cjs(), 1);
|
|
1908
3340
|
|
|
1909
3341
|
// src/system/typography.js
|
|
1910
3342
|
var runThroughMedia = (FACTORY2) => {
|
|
@@ -1926,7 +3358,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
1926
3358
|
h1Matches,
|
|
1927
3359
|
unit
|
|
1928
3360
|
} = FACTORY2;
|
|
1929
|
-
(0,
|
|
3361
|
+
(0, import_utils7.merge)(mediaValue, {
|
|
1930
3362
|
type,
|
|
1931
3363
|
base,
|
|
1932
3364
|
ratio,
|
|
@@ -1943,7 +3375,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
1943
3375
|
applyMediaSequenceVars(FACTORY2, prop);
|
|
1944
3376
|
continue;
|
|
1945
3377
|
}
|
|
1946
|
-
(0,
|
|
3378
|
+
(0, import_utils7.merge)(mediaValue, {
|
|
1947
3379
|
sequence: {},
|
|
1948
3380
|
scales: {},
|
|
1949
3381
|
templates: {},
|