@brightsideoy/kama 0.1.0-alpha.52 → 0.1.0-alpha.53
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/defaults/definitions/blocks/header_image.yaml +1 -1
- package/defaults/definitions/blocks/image_card.yaml +10 -6
- package/defaults/definitions/blocks/single_image.yaml +28 -0
- package/defaults/definitions/nodes/article.yaml +2 -1
- package/defaults/definitions/nodes/event.yaml +9 -3
- package/defaults/definitions/nodes/page.yaml +1 -0
- package/defaults/definitions/nodes/product.yaml +8 -2
- package/definitions/_page.yaml +1 -1
- package/dist/assets/index-C_0enbRK.js +1359 -0
- package/dist/assets/index-u2bmkT1_.css +1 -0
- package/dist/index.html +2 -2
- package/dist/index.js +440 -279
- package/package.json +2 -1
- package/dist/assets/index-BpDJdGFw.css +0 -1
- package/dist/assets/index-CN0RaCrK.js +0 -1313
package/dist/index.js
CHANGED
|
@@ -1142,11 +1142,11 @@ function et({ indent: e, options: { commentString: t } }, n, r, i) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
//#endregion
|
|
1144
1144
|
//#region node_modules/yaml/browser/dist/nodes/YAMLMap.js
|
|
1145
|
-
function
|
|
1145
|
+
function B(e, t) {
|
|
1146
1146
|
let n = S(t) ? t.value : t;
|
|
1147
1147
|
for (let r of e) if (x(r) && (r.key === t || r.key === n || S(r.key) && r.key.value === n)) return r;
|
|
1148
1148
|
}
|
|
1149
|
-
var
|
|
1149
|
+
var V = class extends ye {
|
|
1150
1150
|
static get tagName() {
|
|
1151
1151
|
return "tag:yaml.org,2002:map";
|
|
1152
1152
|
}
|
|
@@ -1166,7 +1166,7 @@ var B = class extends ye {
|
|
|
1166
1166
|
add(e, t) {
|
|
1167
1167
|
let n;
|
|
1168
1168
|
n = x(e) ? e : !e || typeof e != "object" || !("key" in e) ? new z(e, e?.value) : new z(e.key, e.value);
|
|
1169
|
-
let r =
|
|
1169
|
+
let r = B(this.items, n.key), i = this.schema?.sortMapEntries;
|
|
1170
1170
|
if (r) {
|
|
1171
1171
|
if (!t) throw Error(`Key ${n.key} already set`);
|
|
1172
1172
|
S(r.value) && pe(n.value) ? r.value.value = n.value : r.value = n.value;
|
|
@@ -1176,15 +1176,15 @@ var B = class extends ye {
|
|
|
1176
1176
|
} else this.items.push(n);
|
|
1177
1177
|
}
|
|
1178
1178
|
delete(e) {
|
|
1179
|
-
let t =
|
|
1179
|
+
let t = B(this.items, e);
|
|
1180
1180
|
return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
|
|
1181
1181
|
}
|
|
1182
1182
|
get(e, t) {
|
|
1183
|
-
let n =
|
|
1183
|
+
let n = B(this.items, e)?.value;
|
|
1184
1184
|
return (!t && S(n) ? n.value : n) ?? void 0;
|
|
1185
1185
|
}
|
|
1186
1186
|
has(e) {
|
|
1187
|
-
return !!
|
|
1187
|
+
return !!B(this.items, e);
|
|
1188
1188
|
}
|
|
1189
1189
|
set(e, t) {
|
|
1190
1190
|
this.add(new z(e, t), !0);
|
|
@@ -1209,16 +1209,16 @@ var B = class extends ye {
|
|
|
1209
1209
|
onComment: t
|
|
1210
1210
|
});
|
|
1211
1211
|
}
|
|
1212
|
-
},
|
|
1212
|
+
}, tt = {
|
|
1213
1213
|
collection: "map",
|
|
1214
1214
|
default: !0,
|
|
1215
|
-
nodeClass:
|
|
1215
|
+
nodeClass: V,
|
|
1216
1216
|
tag: "tag:yaml.org,2002:map",
|
|
1217
1217
|
resolve(e, t) {
|
|
1218
1218
|
return b(e) || t("Expected a mapping for this tag"), e;
|
|
1219
1219
|
},
|
|
1220
|
-
createNode: (e, t, n) =>
|
|
1221
|
-
},
|
|
1220
|
+
createNode: (e, t, n) => V.from(e, t, n)
|
|
1221
|
+
}, H = class extends ye {
|
|
1222
1222
|
static get tagName() {
|
|
1223
1223
|
return "tag:yaml.org,2002:seq";
|
|
1224
1224
|
}
|
|
@@ -1229,21 +1229,21 @@ var B = class extends ye {
|
|
|
1229
1229
|
this.items.push(e);
|
|
1230
1230
|
}
|
|
1231
1231
|
delete(e) {
|
|
1232
|
-
let t =
|
|
1232
|
+
let t = nt(e);
|
|
1233
1233
|
return typeof t == "number" && this.items.splice(t, 1).length > 0;
|
|
1234
1234
|
}
|
|
1235
1235
|
get(e, t) {
|
|
1236
|
-
let n =
|
|
1236
|
+
let n = nt(e);
|
|
1237
1237
|
if (typeof n != "number") return;
|
|
1238
1238
|
let r = this.items[n];
|
|
1239
1239
|
return !t && S(r) ? r.value : r;
|
|
1240
1240
|
}
|
|
1241
1241
|
has(e) {
|
|
1242
|
-
let t =
|
|
1242
|
+
let t = nt(e);
|
|
1243
1243
|
return typeof t == "number" && t < this.items.length;
|
|
1244
1244
|
}
|
|
1245
1245
|
set(e, t) {
|
|
1246
|
-
let n =
|
|
1246
|
+
let n = nt(e);
|
|
1247
1247
|
if (typeof n != "number") throw Error(`Expected a valid index, not ${e}.`);
|
|
1248
1248
|
let r = this.items[n];
|
|
1249
1249
|
S(r) && pe(t) ? r.value = t : this.items[n] = t;
|
|
@@ -1282,22 +1282,22 @@ var B = class extends ye {
|
|
|
1282
1282
|
return i;
|
|
1283
1283
|
}
|
|
1284
1284
|
};
|
|
1285
|
-
function
|
|
1285
|
+
function nt(e) {
|
|
1286
1286
|
let t = S(e) ? e.value : e;
|
|
1287
1287
|
return t && typeof t == "string" && (t = Number(t)), typeof t == "number" && Number.isInteger(t) && t >= 0 ? t : null;
|
|
1288
1288
|
}
|
|
1289
1289
|
//#endregion
|
|
1290
1290
|
//#region node_modules/yaml/browser/dist/schema/common/seq.js
|
|
1291
|
-
var
|
|
1291
|
+
var rt = {
|
|
1292
1292
|
collection: "seq",
|
|
1293
1293
|
default: !0,
|
|
1294
|
-
nodeClass:
|
|
1294
|
+
nodeClass: H,
|
|
1295
1295
|
tag: "tag:yaml.org,2002:seq",
|
|
1296
1296
|
resolve(e, t) {
|
|
1297
1297
|
return C(e) || t("Expected a sequence for this tag"), e;
|
|
1298
1298
|
},
|
|
1299
|
-
createNode: (e, t, n) =>
|
|
1300
|
-
},
|
|
1299
|
+
createNode: (e, t, n) => H.from(e, t, n)
|
|
1300
|
+
}, it = {
|
|
1301
1301
|
identify: (e) => typeof e == "string",
|
|
1302
1302
|
default: !0,
|
|
1303
1303
|
tag: "tag:yaml.org,2002:str",
|
|
@@ -1305,27 +1305,27 @@ var it = {
|
|
|
1305
1305
|
stringify(e, t, n, r) {
|
|
1306
1306
|
return t = Object.assign({ actualString: !0 }, t), Ie(e, t, n, r);
|
|
1307
1307
|
}
|
|
1308
|
-
},
|
|
1308
|
+
}, at = {
|
|
1309
1309
|
identify: (e) => e == null,
|
|
1310
1310
|
createNode: () => new I(null),
|
|
1311
1311
|
default: !0,
|
|
1312
1312
|
tag: "tag:yaml.org,2002:null",
|
|
1313
1313
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1314
1314
|
resolve: () => new I(null),
|
|
1315
|
-
stringify: ({ source: e }, t) => typeof e == "string" &&
|
|
1316
|
-
},
|
|
1315
|
+
stringify: ({ source: e }, t) => typeof e == "string" && at.test.test(e) ? e : t.options.nullStr
|
|
1316
|
+
}, ot = {
|
|
1317
1317
|
identify: (e) => typeof e == "boolean",
|
|
1318
1318
|
default: !0,
|
|
1319
1319
|
tag: "tag:yaml.org,2002:bool",
|
|
1320
1320
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1321
1321
|
resolve: (e) => new I(e[0] === "t" || e[0] === "T"),
|
|
1322
1322
|
stringify({ source: e, value: t }, n) {
|
|
1323
|
-
return e &&
|
|
1323
|
+
return e && ot.test.test(e) && t === (e[0] === "t" || e[0] === "T") ? e : t ? n.options.trueStr : n.options.falseStr;
|
|
1324
1324
|
}
|
|
1325
1325
|
};
|
|
1326
1326
|
//#endregion
|
|
1327
1327
|
//#region node_modules/yaml/browser/dist/stringify/stringifyNumber.js
|
|
1328
|
-
function
|
|
1328
|
+
function U({ format: e, minFractionDigits: t, tag: n, value: r }) {
|
|
1329
1329
|
if (typeof r == "bigint") return String(r);
|
|
1330
1330
|
let i = typeof r == "number" ? r : Number(r);
|
|
1331
1331
|
if (!isFinite(i)) return isNaN(i) ? ".nan" : i < 0 ? "-.inf" : ".inf";
|
|
@@ -1340,14 +1340,14 @@ function H({ format: e, minFractionDigits: t, tag: n, value: r }) {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
//#endregion
|
|
1342
1342
|
//#region node_modules/yaml/browser/dist/schema/core/float.js
|
|
1343
|
-
var
|
|
1343
|
+
var st = {
|
|
1344
1344
|
identify: (e) => typeof e == "number",
|
|
1345
1345
|
default: !0,
|
|
1346
1346
|
tag: "tag:yaml.org,2002:float",
|
|
1347
1347
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1348
1348
|
resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
|
|
1349
|
-
stringify:
|
|
1350
|
-
},
|
|
1349
|
+
stringify: U
|
|
1350
|
+
}, ct = {
|
|
1351
1351
|
identify: (e) => typeof e == "number",
|
|
1352
1352
|
default: !0,
|
|
1353
1353
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1356,9 +1356,9 @@ var ct = {
|
|
|
1356
1356
|
resolve: (e) => parseFloat(e),
|
|
1357
1357
|
stringify(e) {
|
|
1358
1358
|
let t = Number(e.value);
|
|
1359
|
-
return isFinite(t) ? t.toExponential() :
|
|
1359
|
+
return isFinite(t) ? t.toExponential() : U(e);
|
|
1360
1360
|
}
|
|
1361
|
-
},
|
|
1361
|
+
}, lt = {
|
|
1362
1362
|
identify: (e) => typeof e == "number",
|
|
1363
1363
|
default: !0,
|
|
1364
1364
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1367,60 +1367,60 @@ var ct = {
|
|
|
1367
1367
|
let t = new I(parseFloat(e)), n = e.indexOf(".");
|
|
1368
1368
|
return n !== -1 && e[e.length - 1] === "0" && (t.minFractionDigits = e.length - n - 1), t;
|
|
1369
1369
|
},
|
|
1370
|
-
stringify:
|
|
1371
|
-
},
|
|
1372
|
-
function
|
|
1370
|
+
stringify: U
|
|
1371
|
+
}, ut = (e) => typeof e == "bigint" || Number.isInteger(e), dt = (e, t, n, { intAsBigInt: r }) => r ? BigInt(e) : parseInt(e.substring(t), n);
|
|
1372
|
+
function ft(e, t, n) {
|
|
1373
1373
|
let { value: r } = e;
|
|
1374
|
-
return
|
|
1374
|
+
return ut(r) && r >= 0 ? n + r.toString(t) : U(e);
|
|
1375
1375
|
}
|
|
1376
|
-
var
|
|
1377
|
-
identify: (e) =>
|
|
1376
|
+
var pt = {
|
|
1377
|
+
identify: (e) => ut(e) && e >= 0,
|
|
1378
1378
|
default: !0,
|
|
1379
1379
|
tag: "tag:yaml.org,2002:int",
|
|
1380
1380
|
format: "OCT",
|
|
1381
1381
|
test: /^0o[0-7]+$/,
|
|
1382
|
-
resolve: (e, t, n) =>
|
|
1383
|
-
stringify: (e) =>
|
|
1384
|
-
},
|
|
1385
|
-
identify:
|
|
1382
|
+
resolve: (e, t, n) => dt(e, 2, 8, n),
|
|
1383
|
+
stringify: (e) => ft(e, 8, "0o")
|
|
1384
|
+
}, mt = {
|
|
1385
|
+
identify: ut,
|
|
1386
1386
|
default: !0,
|
|
1387
1387
|
tag: "tag:yaml.org,2002:int",
|
|
1388
1388
|
test: /^[-+]?[0-9]+$/,
|
|
1389
|
-
resolve: (e, t, n) =>
|
|
1390
|
-
stringify:
|
|
1391
|
-
},
|
|
1392
|
-
identify: (e) =>
|
|
1389
|
+
resolve: (e, t, n) => dt(e, 0, 10, n),
|
|
1390
|
+
stringify: U
|
|
1391
|
+
}, ht = {
|
|
1392
|
+
identify: (e) => ut(e) && e >= 0,
|
|
1393
1393
|
default: !0,
|
|
1394
1394
|
tag: "tag:yaml.org,2002:int",
|
|
1395
1395
|
format: "HEX",
|
|
1396
1396
|
test: /^0x[0-9a-fA-F]+$/,
|
|
1397
|
-
resolve: (e, t, n) =>
|
|
1398
|
-
stringify: (e) =>
|
|
1399
|
-
},
|
|
1400
|
-
|
|
1397
|
+
resolve: (e, t, n) => dt(e, 2, 16, n),
|
|
1398
|
+
stringify: (e) => ft(e, 16, "0x")
|
|
1399
|
+
}, gt = [
|
|
1400
|
+
tt,
|
|
1401
|
+
rt,
|
|
1401
1402
|
it,
|
|
1402
1403
|
at,
|
|
1403
1404
|
ot,
|
|
1404
|
-
|
|
1405
|
+
pt,
|
|
1405
1406
|
mt,
|
|
1406
1407
|
ht,
|
|
1407
|
-
|
|
1408
|
+
st,
|
|
1408
1409
|
ct,
|
|
1409
|
-
lt
|
|
1410
|
-
ut
|
|
1410
|
+
lt
|
|
1411
1411
|
];
|
|
1412
1412
|
//#endregion
|
|
1413
1413
|
//#region node_modules/yaml/browser/dist/schema/json/schema.js
|
|
1414
|
-
function
|
|
1414
|
+
function _t(e) {
|
|
1415
1415
|
return typeof e == "bigint" || Number.isInteger(e);
|
|
1416
1416
|
}
|
|
1417
|
-
var
|
|
1417
|
+
var vt = ({ value: e }) => JSON.stringify(e), yt = [
|
|
1418
1418
|
{
|
|
1419
1419
|
identify: (e) => typeof e == "string",
|
|
1420
1420
|
default: !0,
|
|
1421
1421
|
tag: "tag:yaml.org,2002:str",
|
|
1422
1422
|
resolve: (e) => e,
|
|
1423
|
-
stringify:
|
|
1423
|
+
stringify: vt
|
|
1424
1424
|
},
|
|
1425
1425
|
{
|
|
1426
1426
|
identify: (e) => e == null,
|
|
@@ -1429,7 +1429,7 @@ var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
|
1429
1429
|
tag: "tag:yaml.org,2002:null",
|
|
1430
1430
|
test: /^null$/,
|
|
1431
1431
|
resolve: () => null,
|
|
1432
|
-
stringify:
|
|
1432
|
+
stringify: vt
|
|
1433
1433
|
},
|
|
1434
1434
|
{
|
|
1435
1435
|
identify: (e) => typeof e == "boolean",
|
|
@@ -1437,15 +1437,15 @@ var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
|
1437
1437
|
tag: "tag:yaml.org,2002:bool",
|
|
1438
1438
|
test: /^true$|^false$/,
|
|
1439
1439
|
resolve: (e) => e === "true",
|
|
1440
|
-
stringify:
|
|
1440
|
+
stringify: vt
|
|
1441
1441
|
},
|
|
1442
1442
|
{
|
|
1443
|
-
identify:
|
|
1443
|
+
identify: _t,
|
|
1444
1444
|
default: !0,
|
|
1445
1445
|
tag: "tag:yaml.org,2002:int",
|
|
1446
1446
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
1447
1447
|
resolve: (e, t, { intAsBigInt: n }) => n ? BigInt(e) : parseInt(e, 10),
|
|
1448
|
-
stringify: ({ value: e }) =>
|
|
1448
|
+
stringify: ({ value: e }) => _t(e) ? e.toString() : JSON.stringify(e)
|
|
1449
1449
|
},
|
|
1450
1450
|
{
|
|
1451
1451
|
identify: (e) => typeof e == "number",
|
|
@@ -1453,16 +1453,16 @@ var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
|
1453
1453
|
tag: "tag:yaml.org,2002:float",
|
|
1454
1454
|
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
|
1455
1455
|
resolve: (e) => parseFloat(e),
|
|
1456
|
-
stringify:
|
|
1456
|
+
stringify: vt
|
|
1457
1457
|
}
|
|
1458
|
-
],
|
|
1458
|
+
], bt = [tt, rt].concat(yt, {
|
|
1459
1459
|
default: !0,
|
|
1460
1460
|
tag: "",
|
|
1461
1461
|
test: /^/,
|
|
1462
1462
|
resolve(e, t) {
|
|
1463
1463
|
return t(`Unresolved plain scalar ${JSON.stringify(e)}`), e;
|
|
1464
1464
|
}
|
|
1465
|
-
}),
|
|
1465
|
+
}), xt = {
|
|
1466
1466
|
identify: (e) => e instanceof Uint8Array,
|
|
1467
1467
|
default: !1,
|
|
1468
1468
|
tag: "tag:yaml.org,2002:binary",
|
|
@@ -1496,7 +1496,7 @@ var yt = ({ value: e }) => JSON.stringify(e), bt = [
|
|
|
1496
1496
|
};
|
|
1497
1497
|
//#endregion
|
|
1498
1498
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
|
|
1499
|
-
function
|
|
1499
|
+
function St(e, t) {
|
|
1500
1500
|
if (C(e)) for (let n = 0; n < e.items.length; ++n) {
|
|
1501
1501
|
let r = e.items[n];
|
|
1502
1502
|
if (!x(r)) {
|
|
@@ -1515,8 +1515,8 @@ function Ct(e, t) {
|
|
|
1515
1515
|
else t("Expected a sequence for this tag");
|
|
1516
1516
|
return e;
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1519
|
-
let { replacer: r } = n, i = new
|
|
1518
|
+
function Ct(e, t, n) {
|
|
1519
|
+
let { replacer: r } = n, i = new H(e);
|
|
1520
1520
|
i.tag = "tag:yaml.org,2002:pairs";
|
|
1521
1521
|
let a = 0;
|
|
1522
1522
|
if (t && Symbol.iterator in Object(t)) for (let e of t) {
|
|
@@ -1534,15 +1534,15 @@ function wt(e, t, n) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
return i;
|
|
1536
1536
|
}
|
|
1537
|
-
var
|
|
1537
|
+
var wt = {
|
|
1538
1538
|
collection: "seq",
|
|
1539
1539
|
default: !1,
|
|
1540
1540
|
tag: "tag:yaml.org,2002:pairs",
|
|
1541
|
-
resolve:
|
|
1542
|
-
createNode:
|
|
1543
|
-
},
|
|
1541
|
+
resolve: St,
|
|
1542
|
+
createNode: Ct
|
|
1543
|
+
}, Tt = class e extends H {
|
|
1544
1544
|
constructor() {
|
|
1545
|
-
super(), this.add =
|
|
1545
|
+
super(), this.add = V.prototype.add.bind(this), this.delete = V.prototype.delete.bind(this), this.get = V.prototype.get.bind(this), this.has = V.prototype.has.bind(this), this.set = V.prototype.set.bind(this), this.tag = e.tag;
|
|
1546
1546
|
}
|
|
1547
1547
|
toJSON(e, t) {
|
|
1548
1548
|
if (!t) return super.toJSON(e);
|
|
@@ -1556,51 +1556,51 @@ var Tt = {
|
|
|
1556
1556
|
return n;
|
|
1557
1557
|
}
|
|
1558
1558
|
static from(e, t, n) {
|
|
1559
|
-
let r =
|
|
1559
|
+
let r = Ct(e, t, n), i = new this();
|
|
1560
1560
|
return i.items = r.items, i;
|
|
1561
1561
|
}
|
|
1562
1562
|
};
|
|
1563
|
-
|
|
1564
|
-
var
|
|
1563
|
+
Tt.tag = "tag:yaml.org,2002:omap";
|
|
1564
|
+
var Et = {
|
|
1565
1565
|
collection: "seq",
|
|
1566
1566
|
identify: (e) => e instanceof Map,
|
|
1567
|
-
nodeClass:
|
|
1567
|
+
nodeClass: Tt,
|
|
1568
1568
|
default: !1,
|
|
1569
1569
|
tag: "tag:yaml.org,2002:omap",
|
|
1570
1570
|
resolve(e, t) {
|
|
1571
|
-
let n =
|
|
1571
|
+
let n = St(e, t), r = [];
|
|
1572
1572
|
for (let { key: e } of n.items) S(e) && (r.includes(e.value) ? t(`Ordered maps must not include duplicate keys: ${e.value}`) : r.push(e.value));
|
|
1573
|
-
return Object.assign(new
|
|
1573
|
+
return Object.assign(new Tt(), n);
|
|
1574
1574
|
},
|
|
1575
|
-
createNode: (e, t, n) =>
|
|
1575
|
+
createNode: (e, t, n) => Tt.from(e, t, n)
|
|
1576
1576
|
};
|
|
1577
1577
|
//#endregion
|
|
1578
1578
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js
|
|
1579
|
-
function
|
|
1580
|
-
return t && (e ?
|
|
1579
|
+
function Dt({ value: e, source: t }, n) {
|
|
1580
|
+
return t && (e ? Ot : kt).test.test(t) ? t : e ? n.options.trueStr : n.options.falseStr;
|
|
1581
1581
|
}
|
|
1582
|
-
var
|
|
1582
|
+
var Ot = {
|
|
1583
1583
|
identify: (e) => e === !0,
|
|
1584
1584
|
default: !0,
|
|
1585
1585
|
tag: "tag:yaml.org,2002:bool",
|
|
1586
1586
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
1587
1587
|
resolve: () => new I(!0),
|
|
1588
|
-
stringify:
|
|
1589
|
-
},
|
|
1588
|
+
stringify: Dt
|
|
1589
|
+
}, kt = {
|
|
1590
1590
|
identify: (e) => e === !1,
|
|
1591
1591
|
default: !0,
|
|
1592
1592
|
tag: "tag:yaml.org,2002:bool",
|
|
1593
1593
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
|
|
1594
1594
|
resolve: () => new I(!1),
|
|
1595
|
-
stringify:
|
|
1596
|
-
},
|
|
1595
|
+
stringify: Dt
|
|
1596
|
+
}, At = {
|
|
1597
1597
|
identify: (e) => typeof e == "number",
|
|
1598
1598
|
default: !0,
|
|
1599
1599
|
tag: "tag:yaml.org,2002:float",
|
|
1600
1600
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
1601
1601
|
resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
|
|
1602
|
-
stringify:
|
|
1603
|
-
},
|
|
1602
|
+
stringify: U
|
|
1603
|
+
}, jt = {
|
|
1604
1604
|
identify: (e) => typeof e == "number",
|
|
1605
1605
|
default: !0,
|
|
1606
1606
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1609,9 +1609,9 @@ var kt = {
|
|
|
1609
1609
|
resolve: (e) => parseFloat(e.replace(/_/g, "")),
|
|
1610
1610
|
stringify(e) {
|
|
1611
1611
|
let t = Number(e.value);
|
|
1612
|
-
return isFinite(t) ? t.toExponential() :
|
|
1612
|
+
return isFinite(t) ? t.toExponential() : U(e);
|
|
1613
1613
|
}
|
|
1614
|
-
},
|
|
1614
|
+
}, Mt = {
|
|
1615
1615
|
identify: (e) => typeof e == "number",
|
|
1616
1616
|
default: !0,
|
|
1617
1617
|
tag: "tag:yaml.org,2002:float",
|
|
@@ -1624,9 +1624,9 @@ var kt = {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
return t;
|
|
1626
1626
|
},
|
|
1627
|
-
stringify:
|
|
1628
|
-
},
|
|
1629
|
-
function
|
|
1627
|
+
stringify: U
|
|
1628
|
+
}, Nt = (e) => typeof e == "bigint" || Number.isInteger(e);
|
|
1629
|
+
function Pt(e, t, n, { intAsBigInt: r }) {
|
|
1630
1630
|
let i = e[0];
|
|
1631
1631
|
if ((i === "-" || i === "+") && (t += 1), e = e.substring(t).replace(/_/g, ""), r) {
|
|
1632
1632
|
switch (n) {
|
|
@@ -1644,60 +1644,60 @@ function Ft(e, t, n, { intAsBigInt: r }) {
|
|
|
1644
1644
|
let a = parseInt(e, n);
|
|
1645
1645
|
return i === "-" ? -1 * a : a;
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1647
|
+
function Ft(e, t, n) {
|
|
1648
1648
|
let { value: r } = e;
|
|
1649
|
-
if (
|
|
1649
|
+
if (Nt(r)) {
|
|
1650
1650
|
let e = r.toString(t);
|
|
1651
1651
|
return r < 0 ? "-" + n + e.substr(1) : n + e;
|
|
1652
1652
|
}
|
|
1653
|
-
return
|
|
1653
|
+
return U(e);
|
|
1654
1654
|
}
|
|
1655
|
-
var
|
|
1656
|
-
identify:
|
|
1655
|
+
var It = {
|
|
1656
|
+
identify: Nt,
|
|
1657
1657
|
default: !0,
|
|
1658
1658
|
tag: "tag:yaml.org,2002:int",
|
|
1659
1659
|
format: "BIN",
|
|
1660
1660
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1661
|
-
resolve: (e, t, n) =>
|
|
1662
|
-
stringify: (e) =>
|
|
1663
|
-
},
|
|
1664
|
-
identify:
|
|
1661
|
+
resolve: (e, t, n) => Pt(e, 2, 2, n),
|
|
1662
|
+
stringify: (e) => Ft(e, 2, "0b")
|
|
1663
|
+
}, Lt = {
|
|
1664
|
+
identify: Nt,
|
|
1665
1665
|
default: !0,
|
|
1666
1666
|
tag: "tag:yaml.org,2002:int",
|
|
1667
1667
|
format: "OCT",
|
|
1668
1668
|
test: /^[-+]?0[0-7_]+$/,
|
|
1669
|
-
resolve: (e, t, n) =>
|
|
1670
|
-
stringify: (e) =>
|
|
1671
|
-
},
|
|
1672
|
-
identify:
|
|
1669
|
+
resolve: (e, t, n) => Pt(e, 1, 8, n),
|
|
1670
|
+
stringify: (e) => Ft(e, 8, "0")
|
|
1671
|
+
}, Rt = {
|
|
1672
|
+
identify: Nt,
|
|
1673
1673
|
default: !0,
|
|
1674
1674
|
tag: "tag:yaml.org,2002:int",
|
|
1675
1675
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
1676
|
-
resolve: (e, t, n) =>
|
|
1677
|
-
stringify:
|
|
1678
|
-
},
|
|
1679
|
-
identify:
|
|
1676
|
+
resolve: (e, t, n) => Pt(e, 0, 10, n),
|
|
1677
|
+
stringify: U
|
|
1678
|
+
}, zt = {
|
|
1679
|
+
identify: Nt,
|
|
1680
1680
|
default: !0,
|
|
1681
1681
|
tag: "tag:yaml.org,2002:int",
|
|
1682
1682
|
format: "HEX",
|
|
1683
1683
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
1684
|
-
resolve: (e, t, n) =>
|
|
1685
|
-
stringify: (e) =>
|
|
1686
|
-
},
|
|
1684
|
+
resolve: (e, t, n) => Pt(e, 2, 16, n),
|
|
1685
|
+
stringify: (e) => Ft(e, 16, "0x")
|
|
1686
|
+
}, Bt = class e extends V {
|
|
1687
1687
|
constructor(t) {
|
|
1688
1688
|
super(t), this.tag = e.tag;
|
|
1689
1689
|
}
|
|
1690
1690
|
add(e) {
|
|
1691
1691
|
let t;
|
|
1692
|
-
t = x(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new z(e.key, null) : new z(e, null),
|
|
1692
|
+
t = x(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new z(e.key, null) : new z(e, null), B(this.items, t.key) || this.items.push(t);
|
|
1693
1693
|
}
|
|
1694
1694
|
get(e, t) {
|
|
1695
|
-
let n =
|
|
1695
|
+
let n = B(this.items, e);
|
|
1696
1696
|
return !t && x(n) ? S(n.key) ? n.key.value : n.key : n;
|
|
1697
1697
|
}
|
|
1698
1698
|
set(e, t) {
|
|
1699
1699
|
if (typeof t != "boolean") throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
|
|
1700
|
-
let n =
|
|
1700
|
+
let n = B(this.items, e);
|
|
1701
1701
|
n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new z(e));
|
|
1702
1702
|
}
|
|
1703
1703
|
toJSON(e, t) {
|
|
@@ -1714,17 +1714,17 @@ var Lt = {
|
|
|
1714
1714
|
return i;
|
|
1715
1715
|
}
|
|
1716
1716
|
};
|
|
1717
|
-
|
|
1718
|
-
var
|
|
1717
|
+
Bt.tag = "tag:yaml.org,2002:set";
|
|
1718
|
+
var Vt = {
|
|
1719
1719
|
collection: "map",
|
|
1720
1720
|
identify: (e) => e instanceof Set,
|
|
1721
|
-
nodeClass:
|
|
1721
|
+
nodeClass: Bt,
|
|
1722
1722
|
default: !1,
|
|
1723
1723
|
tag: "tag:yaml.org,2002:set",
|
|
1724
|
-
createNode: (e, t, n) =>
|
|
1724
|
+
createNode: (e, t, n) => Bt.from(e, t, n),
|
|
1725
1725
|
resolve(e, t) {
|
|
1726
1726
|
if (b(e)) {
|
|
1727
|
-
if (e.hasAllNullValues(!0)) return Object.assign(new
|
|
1727
|
+
if (e.hasAllNullValues(!0)) return Object.assign(new Bt(), e);
|
|
1728
1728
|
t("Set items must all have null values");
|
|
1729
1729
|
} else t("Expected a mapping for this tag");
|
|
1730
1730
|
return e;
|
|
@@ -1732,127 +1732,127 @@ var Ht = {
|
|
|
1732
1732
|
};
|
|
1733
1733
|
//#endregion
|
|
1734
1734
|
//#region node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
|
|
1735
|
-
function
|
|
1735
|
+
function Ht(e, t) {
|
|
1736
1736
|
let n = e[0], r = n === "-" || n === "+" ? e.substring(1) : e, i = (e) => t ? BigInt(e) : Number(e), a = r.replace(/_/g, "").split(":").reduce((e, t) => e * i(60) + i(t), i(0));
|
|
1737
1737
|
return n === "-" ? i(-1) * a : a;
|
|
1738
1738
|
}
|
|
1739
|
-
function
|
|
1739
|
+
function Ut(e) {
|
|
1740
1740
|
let { value: t } = e, n = (e) => e;
|
|
1741
1741
|
if (typeof t == "bigint") n = (e) => BigInt(e);
|
|
1742
|
-
else if (isNaN(t) || !isFinite(t)) return
|
|
1742
|
+
else if (isNaN(t) || !isFinite(t)) return U(e);
|
|
1743
1743
|
let r = "";
|
|
1744
1744
|
t < 0 && (r = "-", t *= n(-1));
|
|
1745
1745
|
let i = n(60), a = [t % i];
|
|
1746
1746
|
return t < 60 ? a.unshift(0) : (t = (t - a[0]) / i, a.unshift(t % i), t >= 60 && (t = (t - a[0]) / i, a.unshift(t))), r + a.map((e) => String(e).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
|
|
1747
1747
|
}
|
|
1748
|
-
var
|
|
1748
|
+
var Wt = {
|
|
1749
1749
|
identify: (e) => typeof e == "bigint" || Number.isInteger(e),
|
|
1750
1750
|
default: !0,
|
|
1751
1751
|
tag: "tag:yaml.org,2002:int",
|
|
1752
1752
|
format: "TIME",
|
|
1753
1753
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
1754
|
-
resolve: (e, t, { intAsBigInt: n }) =>
|
|
1755
|
-
stringify:
|
|
1756
|
-
},
|
|
1754
|
+
resolve: (e, t, { intAsBigInt: n }) => Ht(e, n),
|
|
1755
|
+
stringify: Ut
|
|
1756
|
+
}, Gt = {
|
|
1757
1757
|
identify: (e) => typeof e == "number",
|
|
1758
1758
|
default: !0,
|
|
1759
1759
|
tag: "tag:yaml.org,2002:float",
|
|
1760
1760
|
format: "TIME",
|
|
1761
1761
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
1762
|
-
resolve: (e) =>
|
|
1763
|
-
stringify:
|
|
1764
|
-
},
|
|
1762
|
+
resolve: (e) => Ht(e, !1),
|
|
1763
|
+
stringify: Ut
|
|
1764
|
+
}, Kt = {
|
|
1765
1765
|
identify: (e) => e instanceof Date,
|
|
1766
1766
|
default: !0,
|
|
1767
1767
|
tag: "tag:yaml.org,2002:timestamp",
|
|
1768
1768
|
test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
|
|
1769
1769
|
resolve(e) {
|
|
1770
|
-
let t = e.match(
|
|
1770
|
+
let t = e.match(Kt.test);
|
|
1771
1771
|
if (!t) throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
1772
1772
|
let [, n, r, i, a, o, s] = t.map(Number), c = t[7] ? Number((t[7] + "00").substr(1, 3)) : 0, l = Date.UTC(n, r - 1, i, a || 0, o || 0, s || 0, c), u = t[8];
|
|
1773
1773
|
if (u && u !== "Z") {
|
|
1774
|
-
let e =
|
|
1774
|
+
let e = Ht(u, !1);
|
|
1775
1775
|
Math.abs(e) < 30 && (e *= 60), l -= 6e4 * e;
|
|
1776
1776
|
}
|
|
1777
1777
|
return new Date(l);
|
|
1778
1778
|
},
|
|
1779
1779
|
stringify: ({ value: e }) => e?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
|
|
1780
|
-
},
|
|
1781
|
-
|
|
1780
|
+
}, qt = [
|
|
1781
|
+
tt,
|
|
1782
|
+
rt,
|
|
1782
1783
|
it,
|
|
1783
1784
|
at,
|
|
1784
|
-
|
|
1785
|
+
Ot,
|
|
1785
1786
|
kt,
|
|
1786
|
-
|
|
1787
|
+
It,
|
|
1787
1788
|
Lt,
|
|
1788
1789
|
Rt,
|
|
1789
1790
|
zt,
|
|
1790
|
-
|
|
1791
|
+
At,
|
|
1791
1792
|
jt,
|
|
1792
1793
|
Mt,
|
|
1793
|
-
|
|
1794
|
-
St,
|
|
1794
|
+
xt,
|
|
1795
1795
|
R,
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1796
|
+
Et,
|
|
1797
|
+
wt,
|
|
1798
|
+
Vt,
|
|
1799
|
+
Wt,
|
|
1799
1800
|
Gt,
|
|
1800
|
-
Kt
|
|
1801
|
-
|
|
1802
|
-
],
|
|
1803
|
-
["core", _t],
|
|
1801
|
+
Kt
|
|
1802
|
+
], Jt = /* @__PURE__ */ new Map([
|
|
1803
|
+
["core", gt],
|
|
1804
1804
|
["failsafe", [
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1805
|
+
tt,
|
|
1806
|
+
rt,
|
|
1807
|
+
it
|
|
1808
1808
|
]],
|
|
1809
|
-
["json",
|
|
1810
|
-
["yaml11",
|
|
1811
|
-
["yaml-1.1",
|
|
1812
|
-
]),
|
|
1813
|
-
binary:
|
|
1814
|
-
bool:
|
|
1815
|
-
float:
|
|
1816
|
-
floatExp:
|
|
1817
|
-
floatNaN:
|
|
1818
|
-
floatTime:
|
|
1819
|
-
int:
|
|
1820
|
-
intHex:
|
|
1821
|
-
intOct:
|
|
1822
|
-
intTime:
|
|
1823
|
-
map:
|
|
1809
|
+
["json", bt],
|
|
1810
|
+
["yaml11", qt],
|
|
1811
|
+
["yaml-1.1", qt]
|
|
1812
|
+
]), Yt = {
|
|
1813
|
+
binary: xt,
|
|
1814
|
+
bool: ot,
|
|
1815
|
+
float: lt,
|
|
1816
|
+
floatExp: ct,
|
|
1817
|
+
floatNaN: st,
|
|
1818
|
+
floatTime: Gt,
|
|
1819
|
+
int: mt,
|
|
1820
|
+
intHex: ht,
|
|
1821
|
+
intOct: pt,
|
|
1822
|
+
intTime: Wt,
|
|
1823
|
+
map: tt,
|
|
1824
1824
|
merge: R,
|
|
1825
|
-
null:
|
|
1826
|
-
omap:
|
|
1827
|
-
pairs:
|
|
1828
|
-
seq:
|
|
1829
|
-
set:
|
|
1830
|
-
timestamp:
|
|
1831
|
-
},
|
|
1832
|
-
"tag:yaml.org,2002:binary":
|
|
1825
|
+
null: at,
|
|
1826
|
+
omap: Et,
|
|
1827
|
+
pairs: wt,
|
|
1828
|
+
seq: rt,
|
|
1829
|
+
set: Vt,
|
|
1830
|
+
timestamp: Kt
|
|
1831
|
+
}, Xt = {
|
|
1832
|
+
"tag:yaml.org,2002:binary": xt,
|
|
1833
1833
|
"tag:yaml.org,2002:merge": R,
|
|
1834
|
-
"tag:yaml.org,2002:omap":
|
|
1835
|
-
"tag:yaml.org,2002:pairs":
|
|
1836
|
-
"tag:yaml.org,2002:set":
|
|
1837
|
-
"tag:yaml.org,2002:timestamp":
|
|
1834
|
+
"tag:yaml.org,2002:omap": Et,
|
|
1835
|
+
"tag:yaml.org,2002:pairs": wt,
|
|
1836
|
+
"tag:yaml.org,2002:set": Vt,
|
|
1837
|
+
"tag:yaml.org,2002:timestamp": Kt
|
|
1838
1838
|
};
|
|
1839
|
-
function
|
|
1840
|
-
let r =
|
|
1839
|
+
function Zt(e, t, n) {
|
|
1840
|
+
let r = Jt.get(t);
|
|
1841
1841
|
if (r && !e) return n && !r.includes(R) ? r.concat(R) : r.slice();
|
|
1842
1842
|
let i = r;
|
|
1843
1843
|
if (!i) {
|
|
1844
1844
|
if (Array.isArray(e)) i = [];
|
|
1845
1845
|
else {
|
|
1846
|
-
let e = Array.from(
|
|
1846
|
+
let e = Array.from(Jt.keys()).filter((e) => e !== "yaml11").map((e) => JSON.stringify(e)).join(", ");
|
|
1847
1847
|
throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`);
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
1850
|
if (Array.isArray(e)) for (let t of e) i = i.concat(t);
|
|
1851
1851
|
else typeof e == "function" && (i = e(i.slice()));
|
|
1852
1852
|
return n && (i = i.concat(R)), i.reduce((e, t) => {
|
|
1853
|
-
let n = typeof t == "string" ?
|
|
1853
|
+
let n = typeof t == "string" ? Yt[t] : t;
|
|
1854
1854
|
if (!n) {
|
|
1855
|
-
let e = JSON.stringify(t), n = Object.keys(
|
|
1855
|
+
let e = JSON.stringify(t), n = Object.keys(Yt).map((e) => JSON.stringify(e)).join(", ");
|
|
1856
1856
|
throw Error(`Unknown custom tag ${e}; use one of ${n}`);
|
|
1857
1857
|
}
|
|
1858
1858
|
return e.includes(n) || e.push(n), e;
|
|
@@ -1860,9 +1860,9 @@ function Qt(e, t, n) {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
//#endregion
|
|
1862
1862
|
//#region node_modules/yaml/browser/dist/schema/Schema.js
|
|
1863
|
-
var
|
|
1863
|
+
var Qt = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), $t = class e {
|
|
1864
1864
|
constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: r, schema: i, sortMapEntries: a, toStringDefaults: o }) {
|
|
1865
|
-
this.compat = Array.isArray(e) ?
|
|
1865
|
+
this.compat = Array.isArray(e) ? Zt(e, "compat") : e ? Zt(null, e) : null, this.name = typeof i == "string" && i || "core", this.knownTags = r ? Xt : {}, this.tags = Zt(t, this.name, n), this.toStringOptions = o ?? null, Object.defineProperty(this, p, { value: tt }), Object.defineProperty(this, h, { value: it }), Object.defineProperty(this, g, { value: rt }), this.sortMapEntries = typeof a == "function" ? a : a === !0 ? Qt : null;
|
|
1866
1866
|
}
|
|
1867
1867
|
clone() {
|
|
1868
1868
|
let t = Object.create(e.prototype, Object.getOwnPropertyDescriptors(this));
|
|
@@ -1871,7 +1871,7 @@ var $t = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), en = class e {
|
|
|
1871
1871
|
};
|
|
1872
1872
|
//#endregion
|
|
1873
1873
|
//#region node_modules/yaml/browser/dist/stringify/stringifyDocument.js
|
|
1874
|
-
function
|
|
1874
|
+
function en(e, t) {
|
|
1875
1875
|
let n = [], r = t.directives === !0;
|
|
1876
1876
|
if (t.directives !== !1 && e.directives) {
|
|
1877
1877
|
let t = e.directives.toString(e);
|
|
@@ -1909,7 +1909,7 @@ function tn(e, t) {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
//#endregion
|
|
1911
1911
|
//#region node_modules/yaml/browser/dist/doc/Document.js
|
|
1912
|
-
var
|
|
1912
|
+
var tn = class e {
|
|
1913
1913
|
constructor(e, t, n) {
|
|
1914
1914
|
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, _, { value: f });
|
|
1915
1915
|
let r = null;
|
|
@@ -1933,10 +1933,10 @@ var nn = class e {
|
|
|
1933
1933
|
return t.commentBefore = this.commentBefore, t.comment = this.comment, t.errors = this.errors.slice(), t.warnings = this.warnings.slice(), t.options = Object.assign({}, this.options), this.directives && (t.directives = this.directives.clone()), t.schema = this.schema.clone(), t.contents = T(this.contents) ? this.contents.clone(t.schema) : this.contents, this.range && (t.range = this.range.slice()), t;
|
|
1934
1934
|
}
|
|
1935
1935
|
add(e) {
|
|
1936
|
-
|
|
1936
|
+
nn(this.contents) && this.contents.add(e);
|
|
1937
1937
|
}
|
|
1938
1938
|
addIn(e, t) {
|
|
1939
|
-
|
|
1939
|
+
nn(this.contents) && this.contents.addIn(e, t);
|
|
1940
1940
|
}
|
|
1941
1941
|
createAlias(e, t) {
|
|
1942
1942
|
if (!e.anchor) {
|
|
@@ -1967,10 +1967,10 @@ var nn = class e {
|
|
|
1967
1967
|
return new z(this.createNode(e, null, n), this.createNode(t, null, n));
|
|
1968
1968
|
}
|
|
1969
1969
|
delete(e) {
|
|
1970
|
-
return
|
|
1970
|
+
return nn(this.contents) ? this.contents.delete(e) : !1;
|
|
1971
1971
|
}
|
|
1972
1972
|
deleteIn(e) {
|
|
1973
|
-
return ve(e) ? this.contents != null && (this.contents = null, !0) :
|
|
1973
|
+
return ve(e) ? this.contents != null && (this.contents = null, !0) : nn(this.contents) ? this.contents.deleteIn(e) : !1;
|
|
1974
1974
|
}
|
|
1975
1975
|
get(e, t) {
|
|
1976
1976
|
return w(this.contents) ? this.contents.get(e, t) : void 0;
|
|
@@ -1985,10 +1985,10 @@ var nn = class e {
|
|
|
1985
1985
|
return ve(e) ? this.contents !== void 0 : w(this.contents) ? this.contents.hasIn(e) : !1;
|
|
1986
1986
|
}
|
|
1987
1987
|
set(e, t) {
|
|
1988
|
-
this.contents == null ? this.contents = _e(this.schema, [e], t) :
|
|
1988
|
+
this.contents == null ? this.contents = _e(this.schema, [e], t) : nn(this.contents) && this.contents.set(e, t);
|
|
1989
1989
|
}
|
|
1990
1990
|
setIn(e, t) {
|
|
1991
|
-
ve(e) ? this.contents = t : this.contents == null ? this.contents = _e(this.schema, Array.from(e), t) :
|
|
1991
|
+
ve(e) ? this.contents = t : this.contents == null ? this.contents = _e(this.schema, Array.from(e), t) : nn(this.contents) && this.contents.setIn(e, t);
|
|
1992
1992
|
}
|
|
1993
1993
|
setSchema(e, t = {}) {
|
|
1994
1994
|
typeof e == "number" && (e = String(e));
|
|
@@ -2016,7 +2016,7 @@ var nn = class e {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
}
|
|
2018
2018
|
if (t.schema instanceof Object) this.schema = t.schema;
|
|
2019
|
-
else if (n) this.schema = new
|
|
2019
|
+
else if (n) this.schema = new $t(Object.assign(n, t));
|
|
2020
2020
|
else throw Error("With a null YAML version, the { schema: Schema } option is required");
|
|
2021
2021
|
}
|
|
2022
2022
|
toJS({ json: e, jsonArg: t, mapAsMap: n, maxAliasCount: r, onAnchor: i, reviver: a } = {}) {
|
|
@@ -2045,24 +2045,24 @@ var nn = class e {
|
|
|
2045
2045
|
let t = JSON.stringify(e.indent);
|
|
2046
2046
|
throw Error(`"indent" option must be a positive integer, not ${t}`);
|
|
2047
2047
|
}
|
|
2048
|
-
return
|
|
2048
|
+
return en(this, e);
|
|
2049
2049
|
}
|
|
2050
2050
|
};
|
|
2051
|
-
function
|
|
2051
|
+
function nn(e) {
|
|
2052
2052
|
if (w(e)) return !0;
|
|
2053
2053
|
throw Error("Expected a YAML collection as document contents");
|
|
2054
2054
|
}
|
|
2055
2055
|
//#endregion
|
|
2056
2056
|
//#region node_modules/yaml/browser/dist/errors.js
|
|
2057
|
-
var
|
|
2057
|
+
var rn = class extends Error {
|
|
2058
2058
|
constructor(e, t, n, r) {
|
|
2059
2059
|
super(), this.name = e, this.code = n, this.message = r, this.pos = t;
|
|
2060
2060
|
}
|
|
2061
|
-
},
|
|
2061
|
+
}, an = class extends rn {
|
|
2062
2062
|
constructor(e, t, n) {
|
|
2063
2063
|
super("YAMLParseError", e, t, n);
|
|
2064
2064
|
}
|
|
2065
|
-
}, on = class extends
|
|
2065
|
+
}, on = class extends rn {
|
|
2066
2066
|
constructor(e, t, n) {
|
|
2067
2067
|
super("YAMLWarning", e, t, n);
|
|
2068
2068
|
}
|
|
@@ -2179,7 +2179,7 @@ function dn(e, t, n) {
|
|
|
2179
2179
|
//#region node_modules/yaml/browser/dist/compose/resolve-block-map.js
|
|
2180
2180
|
var fn = "All mapping items must start at the same column";
|
|
2181
2181
|
function pn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2182
|
-
let o = new ((a?.nodeClass) ??
|
|
2182
|
+
let o = new ((a?.nodeClass) ?? V)(n.schema);
|
|
2183
2183
|
n.atRoot &&= !1;
|
|
2184
2184
|
let s = r.offset, c = null;
|
|
2185
2185
|
for (let a of r.items) {
|
|
@@ -2230,7 +2230,7 @@ function pn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2230
2230
|
//#endregion
|
|
2231
2231
|
//#region node_modules/yaml/browser/dist/compose/resolve-block-seq.js
|
|
2232
2232
|
function mn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2233
|
-
let o = new ((a?.nodeClass) ??
|
|
2233
|
+
let o = new ((a?.nodeClass) ?? H)(n.schema);
|
|
2234
2234
|
n.atRoot &&= !1, n.atKey &&= !1;
|
|
2235
2235
|
let s = r.offset, c = null;
|
|
2236
2236
|
for (let { start: a, value: l } of r.items) {
|
|
@@ -2293,7 +2293,7 @@ function hn(e, t, n, r) {
|
|
|
2293
2293
|
//#region node_modules/yaml/browser/dist/compose/resolve-flow-collection.js
|
|
2294
2294
|
var gn = "Block collections are not allowed within flow collections", _n = (e) => e && (e.type === "block-map" || e.type === "block-seq");
|
|
2295
2295
|
function vn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
2296
|
-
let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new ((a?.nodeClass) ?? (o ?
|
|
2296
|
+
let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new ((a?.nodeClass) ?? (o ? V : H))(n.schema);
|
|
2297
2297
|
c.flow = !0;
|
|
2298
2298
|
let l = n.atRoot;
|
|
2299
2299
|
l && (n.atRoot = !1), n.atKey &&= !1;
|
|
@@ -2366,7 +2366,7 @@ function vn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
|
|
|
2366
2366
|
let e = c;
|
|
2367
2367
|
dn(n, e.items, g) && i(a, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(y);
|
|
2368
2368
|
} else {
|
|
2369
|
-
let e = new
|
|
2369
|
+
let e = new V(n.schema);
|
|
2370
2370
|
e.flow = !0, e.items.push(y);
|
|
2371
2371
|
let t = (v ?? g).range;
|
|
2372
2372
|
e.range = [
|
|
@@ -2411,7 +2411,7 @@ function bn(e, t, n, r, i) {
|
|
|
2411
2411
|
n && (!t || t.offset < n.offset) && i(n, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
2412
2412
|
}
|
|
2413
2413
|
let s = n.type === "block-map" ? "map" : n.type === "block-seq" ? "seq" : n.start.source === "{" ? "map" : "seq";
|
|
2414
|
-
if (!a || !o || o === "!" || o ===
|
|
2414
|
+
if (!a || !o || o === "!" || o === V.tagName && s === "map" || o === H.tagName && s === "seq") return yn(e, t, n, i, o);
|
|
2415
2415
|
let c = t.schema.tags.find((e) => e.tag === o && e.collection === s);
|
|
2416
2416
|
if (!c) {
|
|
2417
2417
|
let r = t.schema.knownTags[o];
|
|
@@ -2799,7 +2799,7 @@ function zn({ options: e }, { offset: t, source: n, end: r }, i) {
|
|
|
2799
2799
|
//#endregion
|
|
2800
2800
|
//#region node_modules/yaml/browser/dist/compose/compose-doc.js
|
|
2801
2801
|
function Bn(e, t, { offset: n, start: r, value: i, end: a }, o) {
|
|
2802
|
-
let s = new
|
|
2802
|
+
let s = new tn(void 0, Object.assign({ _directives: t }, e)), c = {
|
|
2803
2803
|
atKey: !1,
|
|
2804
2804
|
atRoot: !0,
|
|
2805
2805
|
directives: s.directives,
|
|
@@ -2852,7 +2852,7 @@ var Un = class {
|
|
|
2852
2852
|
constructor(e = {}) {
|
|
2853
2853
|
this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (e, t, n, r) => {
|
|
2854
2854
|
let i = Vn(e);
|
|
2855
|
-
r ? this.warnings.push(new on(i, t, n)) : this.errors.push(new
|
|
2855
|
+
r ? this.warnings.push(new on(i, t, n)) : this.errors.push(new an(i, t, n));
|
|
2856
2856
|
}, this.directives = new oe({ version: e.version || "1.2" }), this.options = e;
|
|
2857
2857
|
}
|
|
2858
2858
|
decorate(e, t) {
|
|
@@ -2909,13 +2909,13 @@ var Un = class {
|
|
|
2909
2909
|
this.prelude.push(e.source);
|
|
2910
2910
|
break;
|
|
2911
2911
|
case "error": {
|
|
2912
|
-
let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new
|
|
2912
|
+
let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new an(Vn(e), "UNEXPECTED_TOKEN", t);
|
|
2913
2913
|
this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
|
|
2914
2914
|
break;
|
|
2915
2915
|
}
|
|
2916
2916
|
case "doc-end": {
|
|
2917
2917
|
if (!this.doc) {
|
|
2918
|
-
this.errors.push(new
|
|
2918
|
+
this.errors.push(new an(Vn(e), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document"));
|
|
2919
2919
|
break;
|
|
2920
2920
|
}
|
|
2921
2921
|
this.doc.directives.docEnd = !0;
|
|
@@ -2927,13 +2927,13 @@ var Un = class {
|
|
|
2927
2927
|
this.doc.range[2] = t.offset;
|
|
2928
2928
|
break;
|
|
2929
2929
|
}
|
|
2930
|
-
default: this.errors.push(new
|
|
2930
|
+
default: this.errors.push(new an(Vn(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
2933
|
*end(e = !1, t = -1) {
|
|
2934
2934
|
if (this.doc) this.decorate(this.doc, !0), yield this.doc, this.doc = null;
|
|
2935
2935
|
else if (e) {
|
|
2936
|
-
let e = new
|
|
2936
|
+
let e = new tn(void 0, Object.assign({ _directives: this.directives }, this.options));
|
|
2937
2937
|
this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), e.range = [
|
|
2938
2938
|
0,
|
|
2939
2939
|
t,
|
|
@@ -2949,7 +2949,7 @@ function Wn(e, t = !0, n) {
|
|
|
2949
2949
|
let r = (e, t, r) => {
|
|
2950
2950
|
let i = typeof e == "number" ? e : Array.isArray(e) ? e[0] : e.offset;
|
|
2951
2951
|
if (n) n(i, t, r);
|
|
2952
|
-
else throw new
|
|
2952
|
+
else throw new an([i, i + 1], t, r);
|
|
2953
2953
|
};
|
|
2954
2954
|
switch (e.type) {
|
|
2955
2955
|
case "scalar":
|
|
@@ -4336,7 +4336,7 @@ function Tr(e, t = {}) {
|
|
|
4336
4336
|
let { lineCounter: n, prettyErrors: r } = Cr(t), i = new Sr(n?.addNewLine), a = new Un(t), o = null;
|
|
4337
4337
|
for (let t of a.compose(i.parse(e), !0, e.length)) if (!o) o = t;
|
|
4338
4338
|
else if (o.options.logLevel !== "silent") {
|
|
4339
|
-
o.errors.push(new
|
|
4339
|
+
o.errors.push(new an(t.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
4340
4340
|
break;
|
|
4341
4341
|
}
|
|
4342
4342
|
return r && n && (o.errors.forEach(sn(e, n)), o.warnings.forEach(sn(e, n))), o;
|
|
@@ -4362,7 +4362,7 @@ function Dr(e, t, n) {
|
|
|
4362
4362
|
let { keepUndefined: e } = n ?? t ?? {};
|
|
4363
4363
|
if (!e) return;
|
|
4364
4364
|
}
|
|
4365
|
-
return y(e) && !r ? e.toString(n) : new
|
|
4365
|
+
return y(e) && !r ? e.toString(n) : new tn(e, r, n).toString(n);
|
|
4366
4366
|
}
|
|
4367
4367
|
//#endregion
|
|
4368
4368
|
//#region node_modules/yaml/browser/index.js
|
|
@@ -4370,17 +4370,17 @@ var Or = /* @__PURE__ */ a({
|
|
|
4370
4370
|
Alias: () => de,
|
|
4371
4371
|
CST: () => ir,
|
|
4372
4372
|
Composer: () => Un,
|
|
4373
|
-
Document: () =>
|
|
4373
|
+
Document: () => tn,
|
|
4374
4374
|
Lexer: () => mr,
|
|
4375
4375
|
LineCounter: () => hr,
|
|
4376
4376
|
Pair: () => z,
|
|
4377
4377
|
Parser: () => Sr,
|
|
4378
4378
|
Scalar: () => I,
|
|
4379
|
-
Schema: () =>
|
|
4380
|
-
YAMLError: () =>
|
|
4381
|
-
YAMLMap: () =>
|
|
4382
|
-
YAMLParseError: () =>
|
|
4383
|
-
YAMLSeq: () =>
|
|
4379
|
+
Schema: () => $t,
|
|
4380
|
+
YAMLError: () => rn,
|
|
4381
|
+
YAMLMap: () => V,
|
|
4382
|
+
YAMLParseError: () => an,
|
|
4383
|
+
YAMLSeq: () => H,
|
|
4384
4384
|
YAMLWarning: () => on,
|
|
4385
4385
|
isAlias: () => v,
|
|
4386
4386
|
isCollection: () => w,
|
|
@@ -4435,14 +4435,15 @@ var Or = /* @__PURE__ */ a({
|
|
|
4435
4435
|
hasCanvas: !0,
|
|
4436
4436
|
directLinking: !0,
|
|
4437
4437
|
regions: { content: { label: "Content" } },
|
|
4438
|
-
|
|
4438
|
+
allowedBlocks: [
|
|
4439
4439
|
"header",
|
|
4440
4440
|
"hero",
|
|
4441
4441
|
"text",
|
|
4442
4442
|
"image_card",
|
|
4443
4443
|
"header_image",
|
|
4444
4444
|
"two-column",
|
|
4445
|
-
"three-column"
|
|
4445
|
+
"three-column",
|
|
4446
|
+
"single_image"
|
|
4446
4447
|
],
|
|
4447
4448
|
tabs: { settings: {
|
|
4448
4449
|
label: "Article",
|
|
@@ -4478,7 +4479,16 @@ var Or = /* @__PURE__ */ a({
|
|
|
4478
4479
|
hasCanvas: !0,
|
|
4479
4480
|
directLinking: !0,
|
|
4480
4481
|
regions: { main: { label: "Content" } },
|
|
4481
|
-
|
|
4482
|
+
allowedBlocks: [
|
|
4483
|
+
"header",
|
|
4484
|
+
"hero",
|
|
4485
|
+
"text",
|
|
4486
|
+
"image_card",
|
|
4487
|
+
"header_image",
|
|
4488
|
+
"two-column",
|
|
4489
|
+
"three-column",
|
|
4490
|
+
"single_image"
|
|
4491
|
+
],
|
|
4482
4492
|
tabs: { settings: {
|
|
4483
4493
|
label: "Event",
|
|
4484
4494
|
fields: [
|
|
@@ -4559,7 +4569,8 @@ var Or = /* @__PURE__ */ a({
|
|
|
4559
4569
|
"image_card",
|
|
4560
4570
|
"header_image",
|
|
4561
4571
|
"two-column",
|
|
4562
|
-
"three-column"
|
|
4572
|
+
"three-column",
|
|
4573
|
+
"single_image"
|
|
4563
4574
|
],
|
|
4564
4575
|
tabs: { settings: {
|
|
4565
4576
|
label: "Page",
|
|
@@ -4660,7 +4671,16 @@ var Or = /* @__PURE__ */ a({
|
|
|
4660
4671
|
main: { label: "Product Content" },
|
|
4661
4672
|
sidebar: { label: "Sidebar" }
|
|
4662
4673
|
},
|
|
4663
|
-
|
|
4674
|
+
allowedBlocks: [
|
|
4675
|
+
"header",
|
|
4676
|
+
"hero",
|
|
4677
|
+
"text",
|
|
4678
|
+
"image_card",
|
|
4679
|
+
"header_image",
|
|
4680
|
+
"two-column",
|
|
4681
|
+
"three-column",
|
|
4682
|
+
"single_image"
|
|
4683
|
+
],
|
|
4664
4684
|
tabs: {
|
|
4665
4685
|
settings: {
|
|
4666
4686
|
label: "Product",
|
|
@@ -4864,7 +4884,7 @@ var Or = /* @__PURE__ */ a({
|
|
|
4864
4884
|
header_image: {
|
|
4865
4885
|
id: "header_image",
|
|
4866
4886
|
label: "Header Image",
|
|
4867
|
-
group: "
|
|
4887
|
+
group: "Media",
|
|
4868
4888
|
description: "Image for page header.",
|
|
4869
4889
|
fields: [
|
|
4870
4890
|
{ image: {
|
|
@@ -4951,12 +4971,17 @@ var Or = /* @__PURE__ */ a({
|
|
|
4951
4971
|
public: !0,
|
|
4952
4972
|
default: "Card text content..."
|
|
4953
4973
|
} },
|
|
4954
|
-
{
|
|
4955
|
-
label: "Link
|
|
4956
|
-
type: "
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4974
|
+
{ link: {
|
|
4975
|
+
label: "Link",
|
|
4976
|
+
type: "link",
|
|
4977
|
+
allowedLinkTypes: [
|
|
4978
|
+
"tree",
|
|
4979
|
+
"node",
|
|
4980
|
+
"url",
|
|
4981
|
+
"file",
|
|
4982
|
+
"email",
|
|
4983
|
+
"telephone"
|
|
4984
|
+
]
|
|
4960
4985
|
} },
|
|
4961
4986
|
{ linkText: {
|
|
4962
4987
|
label: "Button Text",
|
|
@@ -4969,6 +4994,36 @@ var Or = /* @__PURE__ */ a({
|
|
|
4969
4994
|
{ hidden: { default: !1 } }
|
|
4970
4995
|
]
|
|
4971
4996
|
},
|
|
4997
|
+
single_image: {
|
|
4998
|
+
id: "single_image",
|
|
4999
|
+
label: "Single Image",
|
|
5000
|
+
group: "Media",
|
|
5001
|
+
description: "Just a single image block.",
|
|
5002
|
+
fields: [
|
|
5003
|
+
{ image: {
|
|
5004
|
+
label: "Image",
|
|
5005
|
+
type: "asset",
|
|
5006
|
+
required: !0,
|
|
5007
|
+
multiple: !1,
|
|
5008
|
+
maxSizeMB: 15,
|
|
5009
|
+
allowedTypes: ["image/*"],
|
|
5010
|
+
public: !0
|
|
5011
|
+
} },
|
|
5012
|
+
{ link: {
|
|
5013
|
+
label: "Link",
|
|
5014
|
+
type: "link",
|
|
5015
|
+
position: "sidebar",
|
|
5016
|
+
allowedLinkTypes: [
|
|
5017
|
+
"tree",
|
|
5018
|
+
"node",
|
|
5019
|
+
"url",
|
|
5020
|
+
"file"
|
|
5021
|
+
]
|
|
5022
|
+
} },
|
|
5023
|
+
{ fieldSet: "access" },
|
|
5024
|
+
{ hidden: { default: !1 } }
|
|
5025
|
+
]
|
|
5026
|
+
},
|
|
4972
5027
|
text: {
|
|
4973
5028
|
id: "text",
|
|
4974
5029
|
label: "Text",
|
|
@@ -5007,7 +5062,7 @@ var Or = /* @__PURE__ */ a({
|
|
|
5007
5062
|
header_image: {
|
|
5008
5063
|
id: "header_image",
|
|
5009
5064
|
label: "Header Image",
|
|
5010
|
-
group: "
|
|
5065
|
+
group: "Media",
|
|
5011
5066
|
description: "Image for page header.",
|
|
5012
5067
|
fields: [
|
|
5013
5068
|
{ image: {
|
|
@@ -5094,12 +5149,17 @@ var Or = /* @__PURE__ */ a({
|
|
|
5094
5149
|
public: !0,
|
|
5095
5150
|
default: "Card text content..."
|
|
5096
5151
|
} },
|
|
5097
|
-
{
|
|
5098
|
-
label: "Link
|
|
5099
|
-
type: "
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5152
|
+
{ link: {
|
|
5153
|
+
label: "Link",
|
|
5154
|
+
type: "link",
|
|
5155
|
+
allowedLinkTypes: [
|
|
5156
|
+
"tree",
|
|
5157
|
+
"node",
|
|
5158
|
+
"url",
|
|
5159
|
+
"file",
|
|
5160
|
+
"email",
|
|
5161
|
+
"telephone"
|
|
5162
|
+
]
|
|
5103
5163
|
} },
|
|
5104
5164
|
{ linkText: {
|
|
5105
5165
|
label: "Button Text",
|
|
@@ -5112,6 +5172,36 @@ var Or = /* @__PURE__ */ a({
|
|
|
5112
5172
|
{ hidden: { default: !1 } }
|
|
5113
5173
|
]
|
|
5114
5174
|
},
|
|
5175
|
+
single_image: {
|
|
5176
|
+
id: "single_image",
|
|
5177
|
+
label: "Single Image",
|
|
5178
|
+
group: "Media",
|
|
5179
|
+
description: "Just a single image block.",
|
|
5180
|
+
fields: [
|
|
5181
|
+
{ image: {
|
|
5182
|
+
label: "Image",
|
|
5183
|
+
type: "asset",
|
|
5184
|
+
required: !0,
|
|
5185
|
+
multiple: !1,
|
|
5186
|
+
maxSizeMB: 15,
|
|
5187
|
+
allowedTypes: ["image/*"],
|
|
5188
|
+
public: !0
|
|
5189
|
+
} },
|
|
5190
|
+
{ link: {
|
|
5191
|
+
label: "Link",
|
|
5192
|
+
type: "link",
|
|
5193
|
+
position: "sidebar",
|
|
5194
|
+
allowedLinkTypes: [
|
|
5195
|
+
"tree",
|
|
5196
|
+
"node",
|
|
5197
|
+
"url",
|
|
5198
|
+
"file"
|
|
5199
|
+
]
|
|
5200
|
+
} },
|
|
5201
|
+
{ fieldSet: "access" },
|
|
5202
|
+
{ hidden: { default: !1 } }
|
|
5203
|
+
]
|
|
5204
|
+
},
|
|
5115
5205
|
text: {
|
|
5116
5206
|
id: "text",
|
|
5117
5207
|
label: "Text",
|
|
@@ -6786,6 +6876,7 @@ function ri(e) {
|
|
|
6786
6876
|
parentAssetId: s.parentAssetId || null,
|
|
6787
6877
|
cropCoordinates: s.cropCoordinates || null,
|
|
6788
6878
|
variants: s.variants || void 0,
|
|
6879
|
+
metadataOverrides: s.metadataOverrides || void 0,
|
|
6789
6880
|
filename: s.filename || void 0,
|
|
6790
6881
|
mimeType: s.mimeType || void 0
|
|
6791
6882
|
} : l) : a[o] = Array.isArray(s) || s && typeof s == "object" ? r(s, c) : s;
|
|
@@ -6838,13 +6929,15 @@ async function oi(e, t) {
|
|
|
6838
6929
|
a.storageKeyPrivate,
|
|
6839
6930
|
a.parentAssetId,
|
|
6840
6931
|
a.cropCoordinatesJson,
|
|
6932
|
+
a.dataJson,
|
|
6841
6933
|
p.cdnUrl AS parentCdnUrl,
|
|
6842
|
-
p.storageKeyPrivate AS parentStorageKeyPrivate
|
|
6934
|
+
p.storageKeyPrivate AS parentStorageKeyPrivate,
|
|
6935
|
+
p.dataJson AS parentDataJson
|
|
6843
6936
|
FROM assets a
|
|
6844
6937
|
LEFT JOIN assets p ON a.parentAssetId = p.id
|
|
6845
6938
|
WHERE a.id IN (${i})
|
|
6846
6939
|
`).all(...Array.from(n)), o = Array.isArray(a) ? a : a?.results || [], s = await e.prepare(`
|
|
6847
|
-
SELECT id, cdnUrl, storageKeyPrivate, filename, parentAssetId, cropCoordinatesJson
|
|
6940
|
+
SELECT id, cdnUrl, storageKeyPrivate, filename, parentAssetId, cropCoordinatesJson, dataJson
|
|
6848
6941
|
FROM assets
|
|
6849
6942
|
WHERE isSystemVariant = 1
|
|
6850
6943
|
AND (parentAssetId IN (${i}) OR ${Array.from(n).map(() => "filename LIKE ?").join(" OR ")})
|
|
@@ -6871,7 +6964,16 @@ async function oi(e, t) {
|
|
|
6871
6964
|
if (e.cropCoordinatesJson) try {
|
|
6872
6965
|
r = typeof e.cropCoordinatesJson == "string" ? JSON.parse(e.cropCoordinatesJson) : e.cropCoordinatesJson;
|
|
6873
6966
|
} catch {}
|
|
6874
|
-
let i = l.get(e.id);
|
|
6967
|
+
let i = l.get(e.id), a = {};
|
|
6968
|
+
try {
|
|
6969
|
+
a = JSON.parse(e.dataJson || "{}");
|
|
6970
|
+
} catch {}
|
|
6971
|
+
if (e.parentAssetId && e.parentDataJson) try {
|
|
6972
|
+
a = {
|
|
6973
|
+
...JSON.parse(e.parentDataJson),
|
|
6974
|
+
...a
|
|
6975
|
+
};
|
|
6976
|
+
} catch {}
|
|
6875
6977
|
u.set(e.id, {
|
|
6876
6978
|
id: e.id,
|
|
6877
6979
|
url: t,
|
|
@@ -6880,7 +6982,10 @@ async function oi(e, t) {
|
|
|
6880
6982
|
cropCoordinates: r,
|
|
6881
6983
|
variants: i && Object.keys(i).length > 0 ? i : void 0,
|
|
6882
6984
|
filename: e.filename,
|
|
6883
|
-
mimeType: e.mimeType
|
|
6985
|
+
mimeType: e.mimeType,
|
|
6986
|
+
title: a.title || "",
|
|
6987
|
+
alt: a.alt || "",
|
|
6988
|
+
description: a.description || ""
|
|
6884
6989
|
});
|
|
6885
6990
|
}
|
|
6886
6991
|
let d = (e) => {
|
|
@@ -6891,7 +6996,7 @@ async function oi(e, t) {
|
|
|
6891
6996
|
id: t,
|
|
6892
6997
|
url: "",
|
|
6893
6998
|
originalUrl: ""
|
|
6894
|
-
}, r = typeof e == "object" && e.variants ? e.variants : void 0, i = typeof e == "object" && e.cropCoordinates ? e.cropCoordinates : void 0;
|
|
6999
|
+
}, r = typeof e == "object" && e.variants ? e.variants : void 0, i = typeof e == "object" && e.cropCoordinates ? e.cropCoordinates : void 0, a = typeof e == "object" && e.metadataOverrides ? e.metadataOverrides : void 0;
|
|
6895
7000
|
return {
|
|
6896
7001
|
...n,
|
|
6897
7002
|
id: t,
|
|
@@ -6899,7 +7004,8 @@ async function oi(e, t) {
|
|
|
6899
7004
|
url: typeof e == "object" && e.url && !e.url.startsWith("blob:") ? e.url : n.url,
|
|
6900
7005
|
originalUrl: typeof e == "object" && e.originalUrl && !e.originalUrl.startsWith("blob:") ? e.originalUrl : n.originalUrl,
|
|
6901
7006
|
cropCoordinates: i || n.cropCoordinates || null,
|
|
6902
|
-
variants: r || n.variants || void 0
|
|
7007
|
+
variants: r || n.variants || void 0,
|
|
7008
|
+
metadataOverrides: a
|
|
6903
7009
|
};
|
|
6904
7010
|
}
|
|
6905
7011
|
if (Array.isArray(e)) return e.map(d);
|
|
@@ -8342,10 +8448,14 @@ Z.get("/", async (e) => {
|
|
|
8342
8448
|
let C = b.map((t) => {
|
|
8343
8449
|
let n = {
|
|
8344
8450
|
title: "",
|
|
8345
|
-
alt: ""
|
|
8451
|
+
alt: "",
|
|
8452
|
+
description: ""
|
|
8346
8453
|
};
|
|
8347
8454
|
try {
|
|
8348
|
-
n =
|
|
8455
|
+
n = {
|
|
8456
|
+
...n,
|
|
8457
|
+
...JSON.parse(t.dataJson || "{}")
|
|
8458
|
+
};
|
|
8349
8459
|
} catch {}
|
|
8350
8460
|
let r = Mi(t.cdnUrl, t.storageKeyPrivate, e.env?.CDN_DOMAIN);
|
|
8351
8461
|
return {
|
|
@@ -8355,6 +8465,7 @@ Z.get("/", async (e) => {
|
|
|
8355
8465
|
sizeBytes: t.sizeBytes || 0,
|
|
8356
8466
|
title: n.title || "",
|
|
8357
8467
|
alt: n.alt || "",
|
|
8468
|
+
description: n.description || "",
|
|
8358
8469
|
createdAt: t.createdAt,
|
|
8359
8470
|
updatedAt: t.updatedAt,
|
|
8360
8471
|
deletedAt: t.deletedAt || null,
|
|
@@ -8437,10 +8548,14 @@ Z.get("/", async (e) => {
|
|
|
8437
8548
|
`%${n}%`
|
|
8438
8549
|
]), c = {
|
|
8439
8550
|
title: "",
|
|
8440
|
-
alt: ""
|
|
8551
|
+
alt: "",
|
|
8552
|
+
description: ""
|
|
8441
8553
|
};
|
|
8442
8554
|
try {
|
|
8443
|
-
c =
|
|
8555
|
+
c = {
|
|
8556
|
+
...c,
|
|
8557
|
+
...JSON.parse(i.dataJson || "{}")
|
|
8558
|
+
};
|
|
8444
8559
|
} catch {}
|
|
8445
8560
|
let l = Mi(i.cdnUrl, i.storageKeyPrivate, e.env?.CDN_DOMAIN);
|
|
8446
8561
|
return e.json({
|
|
@@ -8452,6 +8567,7 @@ Z.get("/", async (e) => {
|
|
|
8452
8567
|
updatedAt: i.updatedAt,
|
|
8453
8568
|
title: c.title || "",
|
|
8454
8569
|
alt: c.alt || "",
|
|
8570
|
+
description: c.description || "",
|
|
8455
8571
|
url: l,
|
|
8456
8572
|
originalUrl: l,
|
|
8457
8573
|
connectedNodes: o,
|
|
@@ -8484,7 +8600,7 @@ Z.get("/", async (e) => {
|
|
|
8484
8600
|
try {
|
|
8485
8601
|
o = JSON.parse(a.dataJson || "{}");
|
|
8486
8602
|
} catch {}
|
|
8487
|
-
return r.title !== void 0 && (o.title = r.title), r.alt !== void 0 && (o.alt = r.alt), await ji(t, "UPDATE assets SET filename = ?, dataJson = ?, updatedAt = CURRENT_TIMESTAMP WHERE id = ?", [
|
|
8603
|
+
return r.title !== void 0 && (o.title = r.title), r.alt !== void 0 && (o.alt = r.alt), r.description !== void 0 && (o.description = r.description), await ji(t, "UPDATE assets SET filename = ?, dataJson = ?, updatedAt = CURRENT_TIMESTAMP WHERE id = ?", [
|
|
8488
8604
|
r.filename === void 0 ? a.filename : r.filename,
|
|
8489
8605
|
JSON.stringify(o),
|
|
8490
8606
|
n
|
|
@@ -8670,7 +8786,7 @@ async function Li(e, t, n, r, i = !1) {
|
|
|
8670
8786
|
let s = o.hidden === !0 || o.hidden === 1 || o.hidden === "1" || o.hidden === "true", l = Pi(o.startShowingAt, o.stopShowingAt);
|
|
8671
8787
|
if (!i && (s || !l)) continue;
|
|
8672
8788
|
let u = t.elementType || t.componentId || "text-block", d = r.blocks?.[u]?.fields || r.elements?.[u]?.fields || r.components?.[u]?.fields || {}, f = String(o.blockId || o._instanceId || o.id || t.blockId || t.id), p = Ri(o, d);
|
|
8673
|
-
p = await oi(e, p), p = await Fi(e, p), p.blockId = f;
|
|
8789
|
+
p = await oi(e, p), p = await Fi(e, p), p = zi(p), p.blockId = f;
|
|
8674
8790
|
let m = t.region || n;
|
|
8675
8791
|
c[m] || (c[m] = []), c[m].push({
|
|
8676
8792
|
instanceId: t.id,
|
|
@@ -8692,13 +8808,36 @@ async function Li(e, t, n, r, i = !1) {
|
|
|
8692
8808
|
function Ri(e, t = {}) {
|
|
8693
8809
|
let n = {};
|
|
8694
8810
|
for (let [r, i] of Object.entries(e)) {
|
|
8695
|
-
if (r === "disabledRegions" || r === "hidden" || r === "is_hidden" || r === "isHidden" || r === "status" || r === "startShowingAt" || r === "stopShowingAt" || r === "slug" || r === "title" || r === "id" || r.startsWith("_")) continue;
|
|
8811
|
+
if (r.endsWith("_meta") || r === "disabledRegions" || r === "hidden" || r === "is_hidden" || r === "isHidden" || r === "status" || r === "startShowingAt" || r === "stopShowingAt" || r === "slug" || r === "title" || r === "id" || r.startsWith("_")) continue;
|
|
8696
8812
|
let e = t[r];
|
|
8697
8813
|
e ? e.public !== !1 && (n[r] = i) : n[r] = i;
|
|
8698
8814
|
}
|
|
8699
8815
|
return n;
|
|
8700
8816
|
}
|
|
8701
|
-
|
|
8817
|
+
function zi(e) {
|
|
8818
|
+
if (Array.isArray(e)) return e.map(zi);
|
|
8819
|
+
if (!e || typeof e != "object") return e;
|
|
8820
|
+
if (typeof e.id == "string" && e.id.startsWith("ast_") && typeof e.url == "string") {
|
|
8821
|
+
let t = e.metadataOverrides || {}, n = e.variants && typeof e.variants == "object" ? e.variants : {}, r = Object.entries(n).find(([, t]) => t?.id === e.id)?.[0], i = r ? {
|
|
8822
|
+
...t,
|
|
8823
|
+
...t.crops?.[r] || {}
|
|
8824
|
+
} : t, a = Object.fromEntries(Object.entries(n).filter(([, t]) => t?.id !== e.id).map(([t, n]) => [t, zi({
|
|
8825
|
+
...n,
|
|
8826
|
+
title: n?.title ?? e.title ?? "",
|
|
8827
|
+
alt: n?.alt ?? e.alt ?? "",
|
|
8828
|
+
description: n?.description ?? e.description ?? ""
|
|
8829
|
+
})])), { metadataOverrides: o, ...s } = e;
|
|
8830
|
+
return {
|
|
8831
|
+
...s,
|
|
8832
|
+
title: i.title ?? e.title ?? "",
|
|
8833
|
+
alt: i.alt ?? e.alt ?? "",
|
|
8834
|
+
description: i.description ?? e.description ?? "",
|
|
8835
|
+
...Object.keys(a).length > 0 ? { variants: a } : {}
|
|
8836
|
+
};
|
|
8837
|
+
}
|
|
8838
|
+
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, zi(t)]));
|
|
8839
|
+
}
|
|
8840
|
+
async function Bi(e, t) {
|
|
8702
8841
|
if (typeof t == "string") {
|
|
8703
8842
|
if (!t.includes("#node:") && !t.includes("data-node-id") && !t.includes("#asset:") && !t.includes("data-asset-id")) return t;
|
|
8704
8843
|
let n = /* @__PURE__ */ new Set();
|
|
@@ -8715,7 +8854,7 @@ async function zi(e, t) {
|
|
|
8715
8854
|
let t = n[1], r = t.match(/data-node-id=["']([^"']+)["']/i), i = t.match(/data-tree-id=["']([^"']+)["']/i);
|
|
8716
8855
|
if (!r || !i) continue;
|
|
8717
8856
|
let a = await e.prepare("SELECT id as treeNodeId FROM tree_nodes WHERE contentId = ? AND treeId = ? LIMIT 1").get(r[1], i[1]);
|
|
8718
|
-
a?.treeNodeId && u.set(`${r[1]}:${i[1]}`, await
|
|
8857
|
+
a?.treeNodeId && u.set(`${r[1]}:${i[1]}`, await Ui(e, String(a.treeNodeId), i[1]));
|
|
8719
8858
|
}
|
|
8720
8859
|
return t.replace(d, (e, t) => {
|
|
8721
8860
|
let n = t.match(/data-node-id=["']([^"']+)["']/i), r = t.match(/data-asset-id=["']([^"']+)["']/i), i = t.match(/href=["']([^"']+)["']/i);
|
|
@@ -8730,14 +8869,36 @@ async function zi(e, t) {
|
|
|
8730
8869
|
return i ? `<a${t.replace(/href=["'][^"']*["']/i, `href="${g || "/"}"`)}>` : e;
|
|
8731
8870
|
});
|
|
8732
8871
|
}
|
|
8733
|
-
if (Array.isArray(t)) return Promise.all(t.map((t) =>
|
|
8872
|
+
if (Array.isArray(t)) return Promise.all(t.map((t) => Bi(e, t)));
|
|
8734
8873
|
if (t && typeof t == "object") {
|
|
8735
|
-
|
|
8874
|
+
if (typeof t.href == "string" && (t.href.startsWith("#node:") || t.href.startsWith("#asset:"))) return {
|
|
8875
|
+
...t,
|
|
8876
|
+
href: await Vi(e, t)
|
|
8877
|
+
};
|
|
8878
|
+
let n = await Promise.all(Object.entries(t).map(async ([t, n]) => [t, await Bi(e, n)]));
|
|
8736
8879
|
return Object.fromEntries(n);
|
|
8737
8880
|
}
|
|
8738
8881
|
return t;
|
|
8739
8882
|
}
|
|
8740
|
-
function
|
|
8883
|
+
async function Vi(e, t) {
|
|
8884
|
+
let n = t.href.match(/^#node:(.+)$/), r = t.href.match(/^#asset:(.+)$/);
|
|
8885
|
+
if (r) {
|
|
8886
|
+
let t = await e.prepare("SELECT cdnUrl, storageKeyPrivate FROM assets WHERE id = ?").get(r[1]);
|
|
8887
|
+
return t?.cdnUrl || (t?.storageKeyPrivate ? `/media/${t.storageKeyPrivate}` : "#");
|
|
8888
|
+
}
|
|
8889
|
+
if (!n) return t.href;
|
|
8890
|
+
let i = n[1];
|
|
8891
|
+
if (t.treeId) {
|
|
8892
|
+
let n = await e.prepare("SELECT id as treeNodeId FROM tree_nodes WHERE contentId = ? AND treeId = ? LIMIT 1").get(i, t.treeId);
|
|
8893
|
+
if (n?.treeNodeId) {
|
|
8894
|
+
let r = await Ui(e, String(n.treeNodeId), String(t.treeId));
|
|
8895
|
+
if (r) return r;
|
|
8896
|
+
}
|
|
8897
|
+
}
|
|
8898
|
+
let a = await e.prepare("SELECT slug FROM content_nodes WHERE id = ?").get(i);
|
|
8899
|
+
return a?.slug ? `/${String(a.slug).replace(/^\/+|\/+$/g, "")}` : "#";
|
|
8900
|
+
}
|
|
8901
|
+
function Hi(e) {
|
|
8741
8902
|
let t = e.socialImage;
|
|
8742
8903
|
if (!t || typeof t != "object") return null;
|
|
8743
8904
|
let n = (e, t) => {
|
|
@@ -8768,7 +8929,7 @@ function Bi(e) {
|
|
|
8768
8929
|
])
|
|
8769
8930
|
};
|
|
8770
8931
|
}
|
|
8771
|
-
async function
|
|
8932
|
+
async function Ui(e, t, n) {
|
|
8772
8933
|
if (!t) return "";
|
|
8773
8934
|
let r = await e.prepare("\n WITH RECURSIVE ancestor_path(id, parentId, slug, level) AS (\n SELECT t.id, t.parentId, c.slug, 0\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE t.id = ? AND t.treeId = ?\n UNION ALL\n SELECT t.id, t.parentId, c.slug, ap.level + 1\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n INNER JOIN ancestor_path ap ON t.id = ap.parentId\n WHERE t.treeId = ?\n )\n SELECT slug FROM ancestor_path ORDER BY level DESC\n ").all(t, n, n), i = Array.isArray(r) ? r : r?.results || [], a = [];
|
|
8774
8935
|
for (let e of i) {
|
|
@@ -8777,7 +8938,7 @@ async function Vi(e, t, n) {
|
|
|
8777
8938
|
}
|
|
8778
8939
|
return "/" + a.join("/");
|
|
8779
8940
|
}
|
|
8780
|
-
async function
|
|
8941
|
+
async function Wi(e, t, n, r, i) {
|
|
8781
8942
|
let a = {}, o = null;
|
|
8782
8943
|
if (t) {
|
|
8783
8944
|
let n = await e.prepare("\n WITH RECURSIVE ancestor_path(id, contentId, title, slug, parentId, level) AS (\n SELECT t.id, t.contentId, c.title, c.slug, t.parentId, 0\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE t.id = ? OR c.id = ?\n UNION ALL\n SELECT t.id, t.contentId, c.title, c.slug, t.parentId, ap.level + 1\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n INNER JOIN ancestor_path ap ON t.id = ap.parentId\n )\n SELECT c.dataJson, c.draftDataJson \n FROM ancestor_path ap\n INNER JOIN content_nodes c ON ap.contentId = c.id\n ORDER BY ap.level ASC\n ").all(t, t), i = Array.isArray(n) ? n : n?.results || [], s = /* @__PURE__ */ new Set([
|
|
@@ -8837,7 +8998,7 @@ Ni.get("/*", async (e) => {
|
|
|
8837
8998
|
WHERE cn.slug = ? ${l === null ? "" : "AND nc.channelId = ?"}
|
|
8838
8999
|
`, o = l === null ? [n] : [n, l], s = await t.prepare(a).all(...o), c = Array.isArray(s) ? s : s?.results || [];
|
|
8839
9000
|
if (c.length > 0) for (let e of c) {
|
|
8840
|
-
let n = (await
|
|
9001
|
+
let n = (await Ui(t, e.treeNodeId, e.treeId)).replace(/^\/+|\/+$/g, ""), r = i.replace(/^\/+|\/+$/g, "");
|
|
8841
9002
|
if (n === r || r === "home" && (n === "" || n === "home")) {
|
|
8842
9003
|
h = e, g = e;
|
|
8843
9004
|
break;
|
|
@@ -8855,7 +9016,7 @@ Ni.get("/*", async (e) => {
|
|
|
8855
9016
|
LIMIT 1
|
|
8856
9017
|
`).get(...e);
|
|
8857
9018
|
}
|
|
8858
|
-
let v = g?.treeId || _ || "main-nav", y = g?.parentId || null, b = g?.treeNodeId ? await
|
|
9019
|
+
let v = g?.treeId || _ || "main-nav", y = g?.parentId || null, b = g?.treeNodeId ? await Ui(t, g.treeNodeId, v) : `/${(h.slug || "").replace(/^\/+|\/+$/g, "")}`, x = {
|
|
8859
9020
|
id: h.id,
|
|
8860
9021
|
title: h.title,
|
|
8861
9022
|
slug: h.slug,
|
|
@@ -8873,11 +9034,11 @@ Ni.get("/*", async (e) => {
|
|
|
8873
9034
|
k = typeof A == "string" ? JSON.parse(A) : A;
|
|
8874
9035
|
} catch {}
|
|
8875
9036
|
k.disabledRegions && (T = k.disabledRegions), O = k.hidden === !0 || k.hidden === 1 || k.hidden === "1" || k.hidden === "true", E = k.startShowingAt || null, D = k.stopShowingAt || null;
|
|
8876
|
-
let j = k.layoutId, ee = j && j !== "inherit", { resolvedLayoutId: te, inheritedFields: ne } = await
|
|
9037
|
+
let j = k.layoutId, ee = j && j !== "inherit", { resolvedLayoutId: te, inheritedFields: ne } = await Wi(t, y, v, o, w), re = ee ? j : te || C.defaultLayout || null;
|
|
8877
9038
|
for (let [e, t] of Object.entries(ne)) (k[e] === void 0 || k[e] === null || k[e] === "" || k[e] === "inherit") && t !== void 0 && (k[e] = t);
|
|
8878
9039
|
let M = await oi(t, Ri(k, w));
|
|
8879
|
-
M = await Fi(t, M), M = await
|
|
8880
|
-
let ie =
|
|
9040
|
+
M = await Fi(t, M), M = zi(M), M = await Bi(t, M);
|
|
9041
|
+
let ie = Hi(M);
|
|
8881
9042
|
delete M.socialImage, delete M.fbImage, delete M.xImage, delete M.whatsappImage, ie && (M.socialImages = ie), x.slug = h.slug, x.title = h.title, Object.assign(x, M), x.layoutId = re;
|
|
8882
9043
|
let ae = !!h.isHidden || O, oe = !Pi(E, D);
|
|
8883
9044
|
if (!o && (ae || oe)) return e.json({ error: "Node is hidden or outside its scheduled publishing window" }, 404);
|
|
@@ -8915,7 +9076,7 @@ Ni.get("/*", async (e) => {
|
|
|
8915
9076
|
let i = r.hidden === !0 || r.hidden === 1 || r.hidden === "1" || r.hidden === "true", a = Pi(r.startShowingAt, r.stopShowingAt);
|
|
8916
9077
|
if (!o && (i || !a)) continue;
|
|
8917
9078
|
let s = e.elementType || e.componentId || "text-block", c = p.blocks?.[s]?.fields || p.elements?.[s]?.fields || p.components?.[s]?.fields || {}, l = String(r.blockId || r._instanceId || r.id || e.blockId || e.id), u = Ri(r, c);
|
|
8918
|
-
u = await oi(t, u), u = await
|
|
9079
|
+
u = await oi(t, u), u = zi(u), u = await Bi(t, u), u.blockId = l, P[n].push({
|
|
8919
9080
|
instanceId: e.id,
|
|
8920
9081
|
blockId: l,
|
|
8921
9082
|
componentId: s,
|
|
@@ -8967,8 +9128,8 @@ Ni.get("/*", async (e) => {
|
|
|
8967
9128
|
});
|
|
8968
9129
|
//#endregion
|
|
8969
9130
|
//#region server/routes/public/tree.ts
|
|
8970
|
-
var
|
|
8971
|
-
function
|
|
9131
|
+
var Gi = new e();
|
|
9132
|
+
function Ki(e, t) {
|
|
8972
9133
|
let n = /* @__PURE__ */ new Date();
|
|
8973
9134
|
if (e && String(e).trim() !== "") {
|
|
8974
9135
|
let t = new Date(e);
|
|
@@ -8980,7 +9141,7 @@ function Wi(e, t) {
|
|
|
8980
9141
|
}
|
|
8981
9142
|
return !0;
|
|
8982
9143
|
}
|
|
8983
|
-
|
|
9144
|
+
Gi.get("/:treeParam", async (e) => {
|
|
8984
9145
|
try {
|
|
8985
9146
|
let t = e.get("db"), n = e.req.param("treeParam"), r = e.req.query("channelId") || e.req.query("channel") || "default", i = e.req.query("preview") === "true";
|
|
8986
9147
|
if (r && r !== "default" && r !== "all") {
|
|
@@ -9019,7 +9180,7 @@ Ui.get("/:treeParam", async (e) => {
|
|
|
9019
9180
|
if (r) try {
|
|
9020
9181
|
n = typeof r == "string" ? JSON.parse(r) : r, delete n._isTreeDraft, delete n._draftParentId, delete n.isNew, delete n.hidden, delete n.is_hidden, delete n.isHidden, delete n.status;
|
|
9021
9182
|
} catch {}
|
|
9022
|
-
let a = !i && (e.status === "draft" || e.status === "new"), o = !!e.isHidden || a || n.hidden === !0 || n.hidden === 1 || n.hidden === "1" || n.hidden === "true", s =
|
|
9183
|
+
let a = !i && (e.status === "draft" || e.status === "new"), o = !!e.isHidden || a || n.hidden === !0 || n.hidden === 1 || n.hidden === "1" || n.hidden === "true", s = Ki(n.startShowingAt, n.stopShowingAt), c = (e.slug || "").replace(/^\/+|\/+$/g, ""), l = c === "home" || c === "homee" ? "/" : `${t}/${c}`.replace(/\/+/g, "/"), u = {
|
|
9023
9184
|
id: e.id,
|
|
9024
9185
|
treeNodeId: e.treeNodeId,
|
|
9025
9186
|
parentId: e.parentId || null,
|
|
@@ -9054,8 +9215,8 @@ Ui.get("/:treeParam", async (e) => {
|
|
|
9054
9215
|
});
|
|
9055
9216
|
//#endregion
|
|
9056
9217
|
//#region server/routes/public/assets.ts
|
|
9057
|
-
var
|
|
9058
|
-
function
|
|
9218
|
+
var qi = new e();
|
|
9219
|
+
function Ji(e, t) {
|
|
9059
9220
|
if (t === "webp") return "image/webp";
|
|
9060
9221
|
if (t === "avif") return "image/avif";
|
|
9061
9222
|
if (t === "jpeg" || t === "jpg") return "image/jpeg";
|
|
@@ -9063,7 +9224,7 @@ function Ki(e, t) {
|
|
|
9063
9224
|
let n = e.toLowerCase();
|
|
9064
9225
|
return n.endsWith(".jpg") || n.endsWith(".jpeg") ? "image/jpeg" : n.endsWith(".png") ? "image/png" : n.endsWith(".webp") ? "image/webp" : n.endsWith(".gif") ? "image/gif" : n.endsWith(".svg") ? "image/svg+xml" : n.endsWith(".pdf") ? "application/pdf" : n.endsWith(".mp4") ? "video/mp4" : n.endsWith(".webm") ? "video/webm" : "application/octet-stream";
|
|
9065
9226
|
}
|
|
9066
|
-
|
|
9227
|
+
qi.get("/*", async (e) => {
|
|
9067
9228
|
let t = e.req.path.replace(/^\/media\//, "").replace(/^\//, "");
|
|
9068
9229
|
if (!t) return e.text("Asset key missing", 400);
|
|
9069
9230
|
let n = e.env?.MEDIA_BUCKET, { w: r, h: i, q: a, f: o } = e.req.query(), s = !!(r || i || a || o), c = e.req.header("Via")?.includes("image-resizing") || e.req.header("User-Agent")?.includes("Cloudflare-ImgRen");
|
|
@@ -9109,7 +9270,7 @@ Gi.get("/*", async (e) => {
|
|
|
9109
9270
|
if (!s) {
|
|
9110
9271
|
let n = u(g);
|
|
9111
9272
|
return e.body(n, 200, {
|
|
9112
|
-
"Content-Type":
|
|
9273
|
+
"Content-Type": Ji(t),
|
|
9113
9274
|
"Cache-Control": "public, max-age=86400"
|
|
9114
9275
|
});
|
|
9115
9276
|
}
|
|
@@ -9117,7 +9278,7 @@ Gi.get("/*", async (e) => {
|
|
|
9117
9278
|
if (l(b)) {
|
|
9118
9279
|
let n = u(b);
|
|
9119
9280
|
return e.body(n, 200, {
|
|
9120
|
-
"Content-Type":
|
|
9281
|
+
"Content-Type": Ji(t, v),
|
|
9121
9282
|
"Cache-Control": "public, max-age=31536000, immutable",
|
|
9122
9283
|
"X-Local-Cache": "HIT"
|
|
9123
9284
|
});
|
|
@@ -9130,14 +9291,14 @@ Gi.get("/*", async (e) => {
|
|
|
9130
9291
|
typeof n == "number" && (a.width = n), typeof c == "number" && (a.height = c), (a.width || a.height) && (a.fit = "cover", i = i.resize(a)), v === "webp" ? i = i.webp({ quality: typeof _ == "number" ? _ : 80 }) : v === "avif" ? i = i.avif({ quality: typeof _ == "number" ? _ : 70 }) : v === "jpeg" || v === "jpg" ? i = i.jpeg({ quality: typeof _ == "number" ? _ : 80 }) : v === "png" && (i = i.png({ quality: typeof _ == "number" ? _ : 80 }));
|
|
9131
9292
|
let o = await i.toBuffer();
|
|
9132
9293
|
return d(m(b), { recursive: !0 }), f(b, o), e.body(o, 200, {
|
|
9133
|
-
"Content-Type":
|
|
9294
|
+
"Content-Type": Ji(t, v),
|
|
9134
9295
|
"Cache-Control": "public, max-age=31536000, immutable",
|
|
9135
9296
|
"X-Local-Cache": "MISS"
|
|
9136
9297
|
});
|
|
9137
9298
|
} catch {
|
|
9138
9299
|
let n = u(g);
|
|
9139
9300
|
return e.body(n, 200, {
|
|
9140
|
-
"Content-Type":
|
|
9301
|
+
"Content-Type": Ji(t),
|
|
9141
9302
|
"Cache-Control": "public, max-age=86400"
|
|
9142
9303
|
});
|
|
9143
9304
|
}
|
|
@@ -9148,8 +9309,8 @@ Gi.get("/*", async (e) => {
|
|
|
9148
9309
|
});
|
|
9149
9310
|
//#endregion
|
|
9150
9311
|
//#region server/routes/public/paths.ts
|
|
9151
|
-
var
|
|
9152
|
-
function
|
|
9312
|
+
var Yi = new e();
|
|
9313
|
+
function Xi(e, t) {
|
|
9153
9314
|
let n = /* @__PURE__ */ new Date();
|
|
9154
9315
|
if (e && String(e).trim() !== "") {
|
|
9155
9316
|
let t = new Date(e);
|
|
@@ -9161,7 +9322,7 @@ function Ji(e, t) {
|
|
|
9161
9322
|
}
|
|
9162
9323
|
return !0;
|
|
9163
9324
|
}
|
|
9164
|
-
|
|
9325
|
+
Yi.get("/", async (e) => {
|
|
9165
9326
|
try {
|
|
9166
9327
|
let t = await e.get("db").prepare("\n SELECT \n t.id as treeNodeId,\n t.parentId,\n c.slug,\n c.contentType as nodeType,\n c.status,\n c.dataJson\n FROM tree_nodes t\n INNER JOIN content_nodes c ON t.contentId = c.id\n WHERE (c.deletedAt IS NULL OR c.deletedAt = '')\n ").all(), n = Array.isArray(t) ? t : t?.results || [], r = [];
|
|
9167
9328
|
function i(e = null, t = "") {
|
|
@@ -9174,7 +9335,7 @@ qi.get("/", async (e) => {
|
|
|
9174
9335
|
if (e.dataJson) try {
|
|
9175
9336
|
n = typeof e.dataJson == "string" ? JSON.parse(e.dataJson) : e.dataJson;
|
|
9176
9337
|
} catch {}
|
|
9177
|
-
let a = e.status === "published" || e.status === "active", o =
|
|
9338
|
+
let a = e.status === "published" || e.status === "active", o = Xi(n.startShowingAt, n.stopShowingAt);
|
|
9178
9339
|
if (!a || !o) continue;
|
|
9179
9340
|
let s = (e.slug || "").replace(/^\/+|\/+$/g, ""), c = s === "home" || s === "homee" ? "/" : `${t}/${s}`.replace(/\/+/g, "/");
|
|
9180
9341
|
e.nodeType !== "external-link" && r.push(c);
|
|
@@ -9191,7 +9352,7 @@ qi.get("/", async (e) => {
|
|
|
9191
9352
|
});
|
|
9192
9353
|
//#endregion
|
|
9193
9354
|
//#region server/index.ts
|
|
9194
|
-
var $ = new e(),
|
|
9355
|
+
var $ = new e(), Zi = !1;
|
|
9195
9356
|
$.use("*", o()), $.use("/media/*", o({
|
|
9196
9357
|
origin: "*",
|
|
9197
9358
|
allowMethods: [
|
|
@@ -9212,13 +9373,13 @@ $.use("*", o()), $.use("/media/*", o({
|
|
|
9212
9373
|
let n = new URL(e.req.url), r = (e.req.header("host") || n.hostname).split(":")[0];
|
|
9213
9374
|
e.set("currentDomain", r);
|
|
9214
9375
|
let i = u(e);
|
|
9215
|
-
if (e.set("db", i), !
|
|
9216
|
-
await Nr(i),
|
|
9376
|
+
if (e.set("db", i), !Zi) try {
|
|
9377
|
+
await Nr(i), Zi = !0;
|
|
9217
9378
|
} catch (e) {
|
|
9218
9379
|
console.error("❌ [CMS Server] Failed to initialize system tables on cold start:", e);
|
|
9219
9380
|
}
|
|
9220
9381
|
await t();
|
|
9221
|
-
}), $.route("/media",
|
|
9382
|
+
}), $.route("/media", qi), $.use("/media/*", Ir()), $.route("/api/cms/nodes", X), $.route("/api/cms/nodes.json", X), $.route("/api/cms/formcsv", X), $.route("/api/cms/formcsv.json", X), $.route("/api/cms/stats", Ai), $.route("/api/cms/stats.json", Ai), $.route("/api/cms", yi), $.route("/api/cms/channels", Ci), $.route("/api/cms/channels.json", Ci), $.route("/api/cms/schemas", wi), $.route("/api/cms/schemas.json", wi), $.route("/api/cms", Di), $.route("/api/admin/assets", Z), $.route("/api/v1/node", Ni), $.route("/api/v1/page", Ni), $.route("/api/v1/tree", Gi), $.route("/api/v1/all-paths", Yi), $.get("*", async (e) => {
|
|
9222
9383
|
if (e.env?.ASSETS) {
|
|
9223
9384
|
let t = await e.env.ASSETS.fetch(e.req.raw);
|
|
9224
9385
|
if (t.status === 404) {
|