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