@tricoteuses/tisseuse 0.14.5 → 0.14.6
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/{html-CsSi8pXx.js → html-CW0PiEAm.js} +168 -114
- package/dist/index.js +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
|
@@ -13112,7 +13112,7 @@ async function* H_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13112
13112
|
for (let n of c === void 0 ? zm(t) : Vm(t, c)) o && console.log(`In "${t.input.slice(n.position.start, n.position.stop)}": \nReference "${t.text(n.position)}": ${JSON.stringify(n, null, 2)}`), e.push(n);
|
|
13113
13113
|
return e;
|
|
13114
13114
|
}, { inputSize: t.input.length }), h = performance.now();
|
|
13115
|
-
for (let e of m) for (let n of
|
|
13115
|
+
for (let e of m) for (let n of nv(t, e)) {
|
|
13116
13116
|
let r = n.type === "parent-enfant" ? n.parent : n;
|
|
13117
13117
|
switch (r.type) {
|
|
13118
13118
|
case "alinéa":
|
|
@@ -13157,7 +13157,7 @@ async function* H_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13157
13157
|
phase: "collectDefinitionsAndTextState"
|
|
13158
13158
|
});
|
|
13159
13159
|
let g = /* @__PURE__ */ new Set();
|
|
13160
|
-
for (let e of m) for (let t of
|
|
13160
|
+
for (let e of m) for (let t of tv(e, { citations: !0 })) g.add(t);
|
|
13161
13161
|
let _ = W_(t, m);
|
|
13162
13162
|
await u.time("preloadActiveArticlesByTextIds", () => l.preloadActiveArticlesByTextIds({
|
|
13163
13163
|
date: n,
|
|
@@ -13177,7 +13177,7 @@ async function* H_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13177
13177
|
nums: v
|
|
13178
13178
|
}), { count: v.size }), p = s === void 0 ? {} : s;
|
|
13179
13179
|
let y = 0, ee = performance.now();
|
|
13180
|
-
for (let e of m) for await (let r of
|
|
13180
|
+
for (let e of m) for await (let r of sv({
|
|
13181
13181
|
articleDefinitionByNumByTextId: d,
|
|
13182
13182
|
legiResolver: l,
|
|
13183
13183
|
context: t,
|
|
@@ -13267,7 +13267,7 @@ function U_({ context: e, logPartialReferences: t, reference: n, state: r, text:
|
|
|
13267
13267
|
}
|
|
13268
13268
|
function W_(e, t) {
|
|
13269
13269
|
let n = /* @__PURE__ */ new Set();
|
|
13270
|
-
for (let r of t) for (let t of
|
|
13270
|
+
for (let r of t) for (let t of nv(e, r, { citations: !0 })) {
|
|
13271
13271
|
let e = t.type === "parent-enfant" ? t.parent : t;
|
|
13272
13272
|
e.type === "texte" && e.cid !== void 0 ? n.add(e.cid) : e.type === "article" && e.implicitText?.cid !== void 0 && n.add(e.implicitText.cid);
|
|
13273
13273
|
}
|
|
@@ -13287,7 +13287,7 @@ async function G_({ context: e, date: t, legiResolver: n, logPartialReferences:
|
|
|
13287
13287
|
return o;
|
|
13288
13288
|
}
|
|
13289
13289
|
async function K_({ articleNums: e, context: t, date: n, legiResolver: r, logPartialReferences: i, reference: a, state: o }) {
|
|
13290
|
-
for (let s of
|
|
13290
|
+
for (let s of nv(t, a)) await q_({
|
|
13291
13291
|
articleNums: e,
|
|
13292
13292
|
atomicOrParentChildReference: s,
|
|
13293
13293
|
context: t,
|
|
@@ -13324,7 +13324,7 @@ async function q_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13324
13324
|
case "phrase": break;
|
|
13325
13325
|
case "article":
|
|
13326
13326
|
if (c.definition && s.textId !== void 0) break;
|
|
13327
|
-
await
|
|
13327
|
+
await $_({
|
|
13328
13328
|
article: c,
|
|
13329
13329
|
date: r,
|
|
13330
13330
|
legiResolver: i,
|
|
@@ -13372,10 +13372,62 @@ async function q_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13372
13372
|
default: break;
|
|
13373
13373
|
}
|
|
13374
13374
|
}
|
|
13375
|
-
|
|
13376
|
-
|
|
13375
|
+
var J_ = new Set([
|
|
13376
|
+
"LEGITEXT000006069568",
|
|
13377
|
+
"LEGITEXT000006069569",
|
|
13378
|
+
"LEGITEXT000006069574",
|
|
13379
|
+
"LEGITEXT000006069576",
|
|
13380
|
+
"LEGITEXT000006069577",
|
|
13381
|
+
"LEGITEXT000006069583"
|
|
13382
|
+
]);
|
|
13383
|
+
function Y_(e, t, n) {
|
|
13384
|
+
let r = n.replace(/\s+/gu, " ").trim();
|
|
13385
|
+
r !== "" && r !== t && e.add(r);
|
|
13386
|
+
}
|
|
13387
|
+
function X_(e, t) {
|
|
13388
|
+
let n = new Set([e]), r = new Set([e]);
|
|
13389
|
+
for (let i = 0; i < 3; i++) {
|
|
13390
|
+
let i = /* @__PURE__ */ new Set();
|
|
13391
|
+
for (let a of r) {
|
|
13392
|
+
let r = /* @__PURE__ */ new Set();
|
|
13393
|
+
Y_(r, e, a.replace(/\s*-\s*/gu, "-")), Y_(r, e, a.replace(/^(R\*)\s*(\d)/u, "$1 $2")), t === "LEGITEXT000006069583" && (Y_(r, e, a.replace(/^(R)(\d)/u, "$1*$2")), Y_(r, e, a.replace(/^(R)(\d)/u, "$1* $2"))), Y_(r, e, a.replace(/^R\*/u, "*R")), Y_(r, e, a.replace(/^R\*/u, "R"));
|
|
13394
|
+
for (let t of a.matchAll(/-(?=\p{L})/gu)) Y_(r, e, `${a.slice(0, t.index)} ${a.slice(t.index + 1)}`);
|
|
13395
|
+
Y_(r, e, a.replace(/-O(?=\p{L}|\s|$)/gu, "-0")), Y_(r, e, a.replace(/-0(?=\p{L})/gu, "-0 "));
|
|
13396
|
+
let o = a.match(/^((?:L\s*O|[LRDA])\*?\s*)(\d{4,})$/u);
|
|
13397
|
+
if (o !== null) {
|
|
13398
|
+
let [, t, n] = o;
|
|
13399
|
+
for (let i = 2; i < n.length; i++) Y_(r, e, `${t}${n.slice(0, i)}-${n.slice(i)}`);
|
|
13400
|
+
}
|
|
13401
|
+
/^(?:L\s*O|[LRDA])\*?/u.test(a) && Y_(r, e, a.replace(/\s+(\d+)$/u, "-$1")), t === "LEGITEXT000006069576" && /^0\d+$/u.test(a) && Y_(r, e, String(Number(a))), Y_(r, e, a.replace(/(\d)\s+0(?=\s*-?\s*\p{L})/gu, "$1-0")), Y_(r, e, a.replace(/(\p{L})\s+(\d{2})-([\p{L}])$/u, "$1-$2 $3"));
|
|
13402
|
+
for (let e of r) n.has(e) || (n.add(e), i.add(e));
|
|
13403
|
+
}
|
|
13404
|
+
r = i;
|
|
13405
|
+
}
|
|
13406
|
+
return n.delete(e), [...n];
|
|
13407
|
+
}
|
|
13408
|
+
function Z_(e, t) {
|
|
13409
|
+
if (!J_.has(t)) return [];
|
|
13410
|
+
let n = [], r = e;
|
|
13411
|
+
for (let e = 0; e < 4; e++) {
|
|
13412
|
+
let e = r.replace(/(?:\s*-\s*|\s+)(?:[IVX]+|[1-9]\d*)(?:\s+(?:bis|ter|quater|quinquies|sexies))?$/iu, "").trim();
|
|
13413
|
+
if (e === "" || e === r) break;
|
|
13414
|
+
n.push(e), r = e;
|
|
13415
|
+
}
|
|
13416
|
+
return n;
|
|
13377
13417
|
}
|
|
13378
|
-
async function
|
|
13418
|
+
async function Q_({ alternatives: e, date: t, legiResolver: n, textId: r }) {
|
|
13419
|
+
let i = [];
|
|
13420
|
+
for (let a of e) {
|
|
13421
|
+
let e = (await n.getActiveArticlesByTextAndNum({
|
|
13422
|
+
date: t,
|
|
13423
|
+
num: a,
|
|
13424
|
+
textId: r
|
|
13425
|
+
})).filter(({ dateDebut: e, dateFin: n }) => e <= t && n > t);
|
|
13426
|
+
e.length > 0 && i.push(e);
|
|
13427
|
+
}
|
|
13428
|
+
return i.length === 1 ? i[0] : [];
|
|
13429
|
+
}
|
|
13430
|
+
async function $_({ article: e, date: t, legiResolver: n, state: r }) {
|
|
13379
13431
|
if (e.present || e.num === void 0) return !1;
|
|
13380
13432
|
let i = e.implicitText?.cid ?? r.textId;
|
|
13381
13433
|
return !(i !== void 0 && (await n.getActiveArticlesByTextAndNum({
|
|
@@ -13388,22 +13440,24 @@ async function Y_({ article: e, date: t, legiResolver: n, state: r }) {
|
|
|
13388
13440
|
textId: r.defaultTextId
|
|
13389
13441
|
})).length > 0);
|
|
13390
13442
|
}
|
|
13391
|
-
async function*
|
|
13443
|
+
async function* ev({ ancestors: e, article: t, legiResolver: n, context: r, date: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13392
13444
|
if (t.present) return;
|
|
13393
13445
|
let l = [], u = t.implicitText?.cid ?? c.textId;
|
|
13394
13446
|
if (u !== void 0 && (l = await n.getActiveArticlesByTextAndNum({
|
|
13395
13447
|
date: i,
|
|
13396
13448
|
num: t.num,
|
|
13397
13449
|
textId: u
|
|
13398
|
-
})), l.length === 0
|
|
13399
|
-
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
|
|
13450
|
+
})), l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await Q_({
|
|
13451
|
+
alternatives: X_(t.num, u),
|
|
13452
|
+
date: i,
|
|
13453
|
+
legiResolver: n,
|
|
13454
|
+
textId: u
|
|
13455
|
+
})), l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await Q_({
|
|
13456
|
+
alternatives: Z_(t.num, u),
|
|
13457
|
+
date: i,
|
|
13458
|
+
legiResolver: n,
|
|
13459
|
+
textId: u
|
|
13460
|
+
})), l.length === 0 && c.defaultTextId !== void 0 && c.defaultTextId !== u && (l = await n.getActiveArticlesByTextAndNum({
|
|
13407
13461
|
date: i,
|
|
13408
13462
|
num: t.num,
|
|
13409
13463
|
textId: c.defaultTextId
|
|
@@ -13432,91 +13486,91 @@ async function* X_({ ancestors: e, article: t, legiResolver: n, context: r, date
|
|
|
13432
13486
|
type: "external_article"
|
|
13433
13487
|
}).filter(([, e]) => e !== void 0));
|
|
13434
13488
|
}
|
|
13435
|
-
function*
|
|
13489
|
+
function* tv(e, { citations: t = !1 } = {}) {
|
|
13436
13490
|
switch (e.type) {
|
|
13437
13491
|
case "article":
|
|
13438
13492
|
e.num !== void 0 && (yield e.num);
|
|
13439
13493
|
break;
|
|
13440
13494
|
case "bounded-interval":
|
|
13441
|
-
yield*
|
|
13495
|
+
yield* tv(e.first, { citations: t }), yield* tv(e.last, { citations: t });
|
|
13442
13496
|
break;
|
|
13443
13497
|
case "counted-interval":
|
|
13444
|
-
yield*
|
|
13498
|
+
yield* tv(e.first, { citations: t });
|
|
13445
13499
|
break;
|
|
13446
13500
|
case "enumeration":
|
|
13447
13501
|
case "exclusion":
|
|
13448
|
-
yield*
|
|
13502
|
+
yield* tv(e.left, { citations: t }), yield* tv(e.right, { citations: t });
|
|
13449
13503
|
break;
|
|
13450
13504
|
case "parent-enfant":
|
|
13451
|
-
yield*
|
|
13505
|
+
yield* tv(e.parent, { citations: t }), yield* tv(e.child, { citations: t });
|
|
13452
13506
|
break;
|
|
13453
13507
|
case "reference_et_action":
|
|
13454
|
-
if (yield*
|
|
13508
|
+
if (yield* tv(e.reference, { citations: t }), t) {
|
|
13455
13509
|
let { originalCitations: n } = e.action;
|
|
13456
13510
|
if (n !== void 0) {
|
|
13457
|
-
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield*
|
|
13511
|
+
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield* tv(n, { citations: t });
|
|
13458
13512
|
}
|
|
13459
13513
|
}
|
|
13460
13514
|
break;
|
|
13461
13515
|
}
|
|
13462
13516
|
}
|
|
13463
|
-
function*
|
|
13517
|
+
function* nv(e, t, { citations: n = !1 } = {}) {
|
|
13464
13518
|
switch (t.type) {
|
|
13465
13519
|
case "bounded-interval":
|
|
13466
|
-
yield*
|
|
13520
|
+
yield* nv(e, t.first, { citations: n }), yield* nv(e, t.last, { citations: n });
|
|
13467
13521
|
break;
|
|
13468
13522
|
case "counted-interval":
|
|
13469
|
-
yield*
|
|
13523
|
+
yield* nv(e, t.first, { citations: n });
|
|
13470
13524
|
break;
|
|
13471
13525
|
case "enumeration":
|
|
13472
13526
|
case "exclusion":
|
|
13473
|
-
yield*
|
|
13527
|
+
yield* nv(e, t.left, { citations: n }), yield* nv(e, t.right, { citations: n });
|
|
13474
13528
|
break;
|
|
13475
13529
|
case "reference_et_action":
|
|
13476
|
-
if (yield*
|
|
13530
|
+
if (yield* nv(e, t.reference, { citations: n }), n) {
|
|
13477
13531
|
let { originalCitations: r } = t.action;
|
|
13478
13532
|
if (r !== void 0) {
|
|
13479
|
-
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield*
|
|
13533
|
+
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield* nv(e, r, { citations: n });
|
|
13480
13534
|
}
|
|
13481
13535
|
}
|
|
13482
13536
|
break;
|
|
13483
13537
|
default: yield t;
|
|
13484
13538
|
}
|
|
13485
13539
|
}
|
|
13486
|
-
function*
|
|
13540
|
+
function* rv(e, t) {
|
|
13487
13541
|
if (t.type === "texte") console.error(`iterDeepestDivisionsOrArticles must not be called with a text:\n${JSON.stringify(t, null, 2)}`);
|
|
13488
13542
|
else if (dt(t) || t.type === "article") yield t;
|
|
13489
13543
|
else if (!(ft(t) || t.type === "incomplete-header")) switch (t.type) {
|
|
13490
13544
|
case "bounded-interval":
|
|
13491
|
-
yield*
|
|
13545
|
+
yield* rv(e, t.first), yield* rv(e, t.last);
|
|
13492
13546
|
break;
|
|
13493
13547
|
case "counted-interval":
|
|
13494
|
-
yield*
|
|
13548
|
+
yield* rv(e, t.first);
|
|
13495
13549
|
break;
|
|
13496
13550
|
case "enumeration":
|
|
13497
13551
|
case "exclusion":
|
|
13498
|
-
yield*
|
|
13552
|
+
yield* rv(e, t.left), yield* rv(e, t.right);
|
|
13499
13553
|
break;
|
|
13500
13554
|
case "parent-enfant": {
|
|
13501
|
-
let n = [
|
|
13502
|
-
n.length === 0 ? yield*
|
|
13555
|
+
let n = [...rv(e, t.child)];
|
|
13556
|
+
n.length === 0 ? yield* rv(e, t.parent) : yield* n;
|
|
13503
13557
|
break;
|
|
13504
13558
|
}
|
|
13505
13559
|
case "reference_et_action": {
|
|
13506
|
-
yield*
|
|
13560
|
+
yield* rv(e, t.reference);
|
|
13507
13561
|
let { originalCitations: n } = t.action;
|
|
13508
13562
|
if (n !== void 0) {
|
|
13509
|
-
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield*
|
|
13563
|
+
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield* rv(e, n);
|
|
13510
13564
|
}
|
|
13511
13565
|
break;
|
|
13512
13566
|
}
|
|
13513
13567
|
default: c("iterDeepestDivisionsOrArticles reference.type", t);
|
|
13514
13568
|
}
|
|
13515
13569
|
}
|
|
13516
|
-
function
|
|
13570
|
+
function iv(e) {
|
|
13517
13571
|
return e?.split(":")[0].trim().toLowerCase().split(/\s+/).map((e) => e.trim()).filter((e) => e !== "").join(" ");
|
|
13518
13572
|
}
|
|
13519
|
-
async function*
|
|
13573
|
+
async function* av({ ancestors: e, legiResolver: t, context: n, date: r, division: i, divisionChildReference: a, logIgnoredReferencesTypes: o, logPartialReferences: s, originalPositionsFromTransformedIterator: c, parentSectionChildren: l, reference: u, state: d }) {
|
|
13520
13574
|
if (i.present) return;
|
|
13521
13575
|
let f;
|
|
13522
13576
|
if (l === void 0 && d.textId !== void 0 && (l = await t.getDirectSectionChildren({
|
|
@@ -13524,20 +13578,20 @@ async function* tv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13524
13578
|
parentPath: d.textId
|
|
13525
13579
|
})), l !== void 0) {
|
|
13526
13580
|
for (let e of l) {
|
|
13527
|
-
let t =
|
|
13581
|
+
let t = iv(e.title);
|
|
13528
13582
|
if (t !== void 0) {
|
|
13529
13583
|
let n = !1;
|
|
13530
|
-
if (i.index !== void 0 && (n =
|
|
13584
|
+
if (i.index !== void 0 && (n = ov(i.type, i.index).some((e) => e === t)), !n && i.num !== void 0 && (n = `${i.type} ${i.num.toLowerCase()}` === t), n) {
|
|
13531
13585
|
f = e;
|
|
13532
13586
|
break;
|
|
13533
13587
|
}
|
|
13534
13588
|
}
|
|
13535
13589
|
}
|
|
13536
13590
|
if (f === void 0 && (f = l.find((e) => {
|
|
13537
|
-
let t =
|
|
13591
|
+
let t = iv(e.title)?.split(/\s+/);
|
|
13538
13592
|
return t !== void 0 && t.length === 2 && ot.includes(t[0]) && t[1] === "législative";
|
|
13539
13593
|
}), f !== void 0)) {
|
|
13540
|
-
let e =
|
|
13594
|
+
let e = iv(f.title).split(/\s+/), t = {
|
|
13541
13595
|
start: i.position.stop,
|
|
13542
13596
|
stop: i.position.stop
|
|
13543
13597
|
}, n = c === void 0 ? void 0 : v(c, t), r = Object.fromEntries(Object.entries({
|
|
@@ -13555,8 +13609,8 @@ async function* tv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13555
13609
|
}).filter(([, e]) => e !== void 0)), i = r;
|
|
13556
13610
|
}
|
|
13557
13611
|
}
|
|
13558
|
-
let p = a === void 0 ? [] : [
|
|
13559
|
-
if (a !== void 0) for (let l of
|
|
13612
|
+
let p = a === void 0 ? [] : [...rv(n, a.child)], m = 0;
|
|
13613
|
+
if (a !== void 0) for (let l of nv(n, a.child)) {
|
|
13560
13614
|
let h = l.type === "parent-enfant" ? l.parent : l, g = l.type === "parent-enfant" ? l : void 0;
|
|
13561
13615
|
switch (h.type) {
|
|
13562
13616
|
case "alinéa":
|
|
@@ -13564,7 +13618,7 @@ async function* tv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13564
13618
|
case "item":
|
|
13565
13619
|
case "phrase": break;
|
|
13566
13620
|
case "article":
|
|
13567
|
-
yield*
|
|
13621
|
+
yield* ev({
|
|
13568
13622
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13569
13623
|
article: h,
|
|
13570
13624
|
legiResolver: t,
|
|
@@ -13590,7 +13644,7 @@ async function* tv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13590
13644
|
f !== void 0 && (a = await t.getDirectSectionChildren({
|
|
13591
13645
|
date: r,
|
|
13592
13646
|
parentPath: f.path
|
|
13593
|
-
})), yield*
|
|
13647
|
+
})), yield* av({
|
|
13594
13648
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13595
13649
|
legiResolver: t,
|
|
13596
13650
|
context: n,
|
|
@@ -13628,7 +13682,7 @@ async function* tv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13628
13682
|
}).filter(([, e]) => e !== void 0));
|
|
13629
13683
|
}
|
|
13630
13684
|
}
|
|
13631
|
-
function*
|
|
13685
|
+
function* ov(e, t) {
|
|
13632
13686
|
let n = Math.floor(t), r = Math.floor((t - n) * 1e3);
|
|
13633
13687
|
if (r === 0) {
|
|
13634
13688
|
for (let t of re(n)) yield `${t.toLowerCase()} ${e}`;
|
|
@@ -13638,9 +13692,9 @@ function* nv(e, t) {
|
|
|
13638
13692
|
for (let r of f(n)) yield `${e} ${t} ${r.toLowerCase()}`;
|
|
13639
13693
|
}
|
|
13640
13694
|
}
|
|
13641
|
-
async function*
|
|
13695
|
+
async function* sv({ articleDefinitionByNumByTextId: e, legiResolver: t, context: n, date: r, logIgnoredReferencesTypes: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13642
13696
|
let l = e ?? {}, u = c === void 0 ? {} : c;
|
|
13643
|
-
for (let e of
|
|
13697
|
+
for (let e of nv(n, s)) {
|
|
13644
13698
|
let c = e.type === "parent-enfant" ? e.parent : e, d = e.type === "parent-enfant" ? e : void 0;
|
|
13645
13699
|
switch (c.type) {
|
|
13646
13700
|
case "alinéa":
|
|
@@ -13651,7 +13705,7 @@ async function* rv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13651
13705
|
if (c.definition && u.textId !== void 0) {
|
|
13652
13706
|
let e = l[u.textId]?.[c.num];
|
|
13653
13707
|
e !== void 0 && (e.originalTransformation === void 0 && o !== void 0 && (e.originalTransformation = v(o, e.position)), yield e);
|
|
13654
|
-
} else yield*
|
|
13708
|
+
} else yield* ev({
|
|
13655
13709
|
article: c,
|
|
13656
13710
|
legiResolver: t,
|
|
13657
13711
|
context: n,
|
|
@@ -13672,7 +13726,7 @@ async function* rv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13672
13726
|
case "sous-sous-paragraphe":
|
|
13673
13727
|
case "sous-titre":
|
|
13674
13728
|
case "titre":
|
|
13675
|
-
c.definition && u.textId !== void 0 || (yield*
|
|
13729
|
+
c.definition && u.textId !== void 0 || (yield* av({
|
|
13676
13730
|
legiResolver: t,
|
|
13677
13731
|
context: n,
|
|
13678
13732
|
date: r,
|
|
@@ -13693,8 +13747,8 @@ async function* rv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13693
13747
|
state: u,
|
|
13694
13748
|
text: c
|
|
13695
13749
|
});
|
|
13696
|
-
let e = d === void 0 ? [] : [
|
|
13697
|
-
if (d !== void 0) for (let f of
|
|
13750
|
+
let e = d === void 0 ? [] : [...rv(n, d.child)], l = 0;
|
|
13751
|
+
if (d !== void 0) for (let f of nv(n, d.child)) {
|
|
13698
13752
|
let p = f.type === "parent-enfant" ? f.parent : f, m = f.type === "parent-enfant" ? f : void 0;
|
|
13699
13753
|
switch (p.type) {
|
|
13700
13754
|
case "alinéa":
|
|
@@ -13702,7 +13756,7 @@ async function* rv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13702
13756
|
case "item":
|
|
13703
13757
|
case "phrase": break;
|
|
13704
13758
|
case "article":
|
|
13705
|
-
yield*
|
|
13759
|
+
yield* ev({
|
|
13706
13760
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13707
13761
|
article: p,
|
|
13708
13762
|
legiResolver: t,
|
|
@@ -13728,7 +13782,7 @@ async function* rv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13728
13782
|
u.textId !== void 0 && (d = await t.getDirectSectionChildren({
|
|
13729
13783
|
date: r,
|
|
13730
13784
|
parentPath: u.textId
|
|
13731
|
-
})), yield*
|
|
13785
|
+
})), yield* av({
|
|
13732
13786
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13733
13787
|
legiResolver: t,
|
|
13734
13788
|
context: n,
|
|
@@ -13779,7 +13833,7 @@ async function* rv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13779
13833
|
if (e !== void 0) {
|
|
13780
13834
|
for (let s of e) if (s.references !== void 0) {
|
|
13781
13835
|
let e = structuredClone(u);
|
|
13782
|
-
for (let c of s.references) yield*
|
|
13836
|
+
for (let c of s.references) yield* sv({
|
|
13783
13837
|
articleDefinitionByNumByTextId: l,
|
|
13784
13838
|
legiResolver: t,
|
|
13785
13839
|
context: n,
|
|
@@ -13796,13 +13850,13 @@ async function* rv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13796
13850
|
}
|
|
13797
13851
|
//#endregion
|
|
13798
13852
|
//#region src/lib/extractors/table_of_contents.ts
|
|
13799
|
-
function
|
|
13853
|
+
function cv(e) {
|
|
13800
13854
|
let t = e;
|
|
13801
13855
|
return t.items ?? [...t.articles ?? [], ...t.divisions ?? []];
|
|
13802
13856
|
}
|
|
13803
|
-
function*
|
|
13857
|
+
function* lv({ context: e, tableOfContents: t, transformation: n }) {
|
|
13804
13858
|
let r = 0, i = _e(n);
|
|
13805
|
-
for (let n of
|
|
13859
|
+
for (let n of dv(t)) {
|
|
13806
13860
|
let t = n.line.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = RegExp(`^${t}$`, "m");
|
|
13807
13861
|
a.lastIndex = r;
|
|
13808
13862
|
let o = a.exec(e.input);
|
|
@@ -13814,7 +13868,7 @@ function* av({ context: e, tableOfContents: t, transformation: n }) {
|
|
|
13814
13868
|
l.originalTransformation = c, l.position = s, yield l, r = s.stop;
|
|
13815
13869
|
}
|
|
13816
13870
|
}
|
|
13817
|
-
function
|
|
13871
|
+
function uv(e) {
|
|
13818
13872
|
let t = new n(e), r = { items: [] }, i = [];
|
|
13819
13873
|
for (let e of Tn(t)) if (dt(e)) {
|
|
13820
13874
|
let n = i.findIndex(({ type: t }) => t === e.type);
|
|
@@ -13832,14 +13886,14 @@ function ov(e) {
|
|
|
13832
13886
|
else throw Error(`Unexpected type "${e.type}" in definition:\n${JSON.stringify(e, null, 2)}`);
|
|
13833
13887
|
return r;
|
|
13834
13888
|
}
|
|
13835
|
-
function*
|
|
13889
|
+
function* dv(e) {
|
|
13836
13890
|
e.type !== void 0 && (yield e);
|
|
13837
|
-
for (let t of
|
|
13891
|
+
for (let t of cv(e)) t.type === "article" ? yield t : yield* dv(t);
|
|
13838
13892
|
}
|
|
13839
13893
|
//#endregion
|
|
13840
13894
|
//#region src/lib/links.ts
|
|
13841
|
-
var
|
|
13842
|
-
function
|
|
13895
|
+
var fv = ["Exploratrice", "Forgejo"];
|
|
13896
|
+
function pv(e, t, n) {
|
|
13843
13897
|
let r = n.match(Ke);
|
|
13844
13898
|
if (r === null) throw Error(`Unknown ID format: ${n}`);
|
|
13845
13899
|
switch (e) {
|
|
@@ -13860,19 +13914,19 @@ function lv(e, t, n) {
|
|
|
13860
13914
|
}
|
|
13861
13915
|
//#endregion
|
|
13862
13916
|
//#region src/lib/linkers/html.ts
|
|
13863
|
-
function
|
|
13917
|
+
function mv(e, t) {
|
|
13864
13918
|
if (e !== void 0) return e;
|
|
13865
13919
|
if (t !== void 0) return new V_(t);
|
|
13866
13920
|
throw Error("A Canutes database or legal resolver is required");
|
|
13867
13921
|
}
|
|
13868
|
-
function
|
|
13922
|
+
function hv(e, t) {
|
|
13869
13923
|
return t.type === "reference_et_action" ? JSON.stringify({
|
|
13870
13924
|
...e,
|
|
13871
13925
|
action: t.action
|
|
13872
13926
|
}) : JSON.stringify(e);
|
|
13873
13927
|
}
|
|
13874
|
-
async function
|
|
13875
|
-
let h = new xe("addLinksToHtml"), g =
|
|
13928
|
+
async function gv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl: o, linkType: s, logIgnoredReferencesTypes: l, logPartialReferences: u, logReferences: d, onLink: f, previousContext: p, state: m }) {
|
|
13929
|
+
let h = new xe("addLinksToHtml"), g = mv(t, e);
|
|
13876
13930
|
await h.time("preloadTextTitlesInfos", () => g.preloadTextTitlesInfos());
|
|
13877
13931
|
let _ = h.timeSync("simplifyHtml", () => a({ removeAWithHref: !0 })(i), {
|
|
13878
13932
|
inputSize: i.length,
|
|
@@ -13894,7 +13948,7 @@ async function fv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13894
13948
|
case "article_definition": {
|
|
13895
13949
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
13896
13950
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
13897
|
-
|
|
13951
|
+
vv({
|
|
13898
13952
|
inputHtml: i,
|
|
13899
13953
|
originalTransformation: n,
|
|
13900
13954
|
output: { replacements: y },
|
|
@@ -13907,12 +13961,12 @@ async function fv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13907
13961
|
let { articleId: t, originalTransformation: n } = e;
|
|
13908
13962
|
if (t !== void 0) {
|
|
13909
13963
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
13910
|
-
|
|
13964
|
+
vv({
|
|
13911
13965
|
inputHtml: i,
|
|
13912
13966
|
originalTransformation: n,
|
|
13913
13967
|
output: { replacements: y },
|
|
13914
13968
|
replacementCounter: ee,
|
|
13915
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_article_externe" href="${
|
|
13969
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_article_externe" href="${pv(s, o, t)}">${e}</a>`
|
|
13916
13970
|
});
|
|
13917
13971
|
}
|
|
13918
13972
|
break;
|
|
@@ -13921,12 +13975,12 @@ async function fv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13921
13975
|
let { originalTransformation: t, sectionTaId: n } = e;
|
|
13922
13976
|
if (n !== void 0) {
|
|
13923
13977
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
13924
|
-
|
|
13978
|
+
vv({
|
|
13925
13979
|
inputHtml: i,
|
|
13926
13980
|
originalTransformation: t,
|
|
13927
13981
|
output: { replacements: y },
|
|
13928
13982
|
replacementCounter: ee,
|
|
13929
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${
|
|
13983
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${pv(s, o, n)}">${e}</a>`
|
|
13930
13984
|
});
|
|
13931
13985
|
}
|
|
13932
13986
|
break;
|
|
@@ -13938,12 +13992,12 @@ async function fv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13938
13992
|
continue;
|
|
13939
13993
|
}
|
|
13940
13994
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
13941
|
-
|
|
13995
|
+
vv({
|
|
13942
13996
|
inputHtml: i,
|
|
13943
13997
|
originalTransformation: t,
|
|
13944
13998
|
output: { replacements: y },
|
|
13945
13999
|
replacementCounter: ee,
|
|
13946
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${
|
|
14000
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${pv(s, o, n.cid)}">${e}</a>`
|
|
13947
14001
|
});
|
|
13948
14002
|
break;
|
|
13949
14003
|
}
|
|
@@ -13951,7 +14005,7 @@ async function fv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13951
14005
|
let { url: t, originalTransformation: n } = e;
|
|
13952
14006
|
if (t === void 0) continue;
|
|
13953
14007
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(e, null, 2)}`);
|
|
13954
|
-
|
|
14008
|
+
vv({
|
|
13955
14009
|
inputHtml: i,
|
|
13956
14010
|
originalTransformation: n,
|
|
13957
14011
|
output: { replacements: y },
|
|
@@ -13963,7 +14017,7 @@ async function fv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13963
14017
|
case "internal_article": {
|
|
13964
14018
|
let { definition: t, originalTransformation: n } = e;
|
|
13965
14019
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
13966
|
-
|
|
14020
|
+
vv({
|
|
13967
14021
|
inputHtml: i,
|
|
13968
14022
|
originalTransformation: n,
|
|
13969
14023
|
output: { replacements: y },
|
|
@@ -13975,7 +14029,7 @@ async function fv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13975
14029
|
default: c("Link", e);
|
|
13976
14030
|
}
|
|
13977
14031
|
}, { count: te + 1 });
|
|
13978
|
-
let ne = h.timeSync("applyHtmlReplacements", () =>
|
|
14032
|
+
let ne = h.timeSync("applyHtmlReplacements", () => _v(i, y), {
|
|
13979
14033
|
count: y.length,
|
|
13980
14034
|
inputSize: i.length
|
|
13981
14035
|
});
|
|
@@ -13987,13 +14041,13 @@ async function fv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
13987
14041
|
output: y.length === 0 ? null : ne
|
|
13988
14042
|
};
|
|
13989
14043
|
}
|
|
13990
|
-
function
|
|
14044
|
+
function _v(e, t) {
|
|
13991
14045
|
if (t.length === 0) return e;
|
|
13992
14046
|
let n = [], r = 0;
|
|
13993
14047
|
for (let i of t.toSorted((e, t) => e.start - t.start || e.stop - t.stop || e.order - t.order)) i.start < r || (n.push(e.slice(r, i.start)), n.push(i.replacement), r = i.stop);
|
|
13994
14048
|
return n.push(e.slice(r)), n.join("");
|
|
13995
14049
|
}
|
|
13996
|
-
function
|
|
14050
|
+
function vv({ inputHtml: e, originalTransformation: t, output: n, replacementCounter: r, tagHtmlFromOriginal: i }) {
|
|
13997
14051
|
let a = d(t, i(s(e, t, 0) ?? ""));
|
|
13998
14052
|
n.replacements.push({
|
|
13999
14053
|
order: r.value++,
|
|
@@ -14002,11 +14056,11 @@ function mv({ inputHtml: e, originalTransformation: t, output: n, replacementCou
|
|
|
14002
14056
|
stop: t.position.stop
|
|
14003
14057
|
});
|
|
14004
14058
|
}
|
|
14005
|
-
function
|
|
14059
|
+
function yv({ attributes: e, inputHtml: t, originalTransformation: n, outputByType: r, replacementCounter: i }) {
|
|
14006
14060
|
let a = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
14007
14061
|
for (let e of ["links", "links_or_references"]) {
|
|
14008
14062
|
let o = r[e];
|
|
14009
|
-
o !== void 0 &&
|
|
14063
|
+
o !== void 0 && vv({
|
|
14010
14064
|
inputHtml: t,
|
|
14011
14065
|
originalTransformation: n,
|
|
14012
14066
|
output: o,
|
|
@@ -14015,11 +14069,11 @@ function hv({ attributes: e, inputHtml: t, originalTransformation: n, outputByTy
|
|
|
14015
14069
|
});
|
|
14016
14070
|
}
|
|
14017
14071
|
}
|
|
14018
|
-
function
|
|
14072
|
+
function bv({ id: e, outputByType: t }) {
|
|
14019
14073
|
return t.references !== void 0 || e === void 0 && t.links_or_references !== void 0;
|
|
14020
14074
|
}
|
|
14021
|
-
async function
|
|
14022
|
-
let h =
|
|
14075
|
+
async function xv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, htmlTransformation: a, inputHtml: o, linkBaseUrl: s, linkType: l, logIgnoredReferencesTypes: u, logPartialReferences: d, logReferences: f, outputTypes: p, referredLegifranceTextsInfos: m }) {
|
|
14076
|
+
let h = mv(t, e);
|
|
14023
14077
|
await h.preloadTextTitlesInfos();
|
|
14024
14078
|
let g = new n(a.output), _ = {}, v = {};
|
|
14025
14079
|
for (let e of p) v[e] = {
|
|
@@ -14041,7 +14095,7 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14041
14095
|
case "article_definition": {
|
|
14042
14096
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
14043
14097
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
14044
|
-
for (let e of Object.values(v))
|
|
14098
|
+
for (let e of Object.values(v)) vv({
|
|
14045
14099
|
inputHtml: o,
|
|
14046
14100
|
originalTransformation: n,
|
|
14047
14101
|
output: e,
|
|
@@ -14053,10 +14107,10 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14053
14107
|
case "external_article": {
|
|
14054
14108
|
let { article: t, articleId: n, originalTransformation: r } = e;
|
|
14055
14109
|
if (r === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
14056
|
-
if (n !== void 0 && (
|
|
14110
|
+
if (n !== void 0 && (yv({
|
|
14057
14111
|
attributes: {
|
|
14058
14112
|
class: "lien_article_externe",
|
|
14059
|
-
href:
|
|
14113
|
+
href: pv(l, s, n)
|
|
14060
14114
|
},
|
|
14061
14115
|
inputHtml: o,
|
|
14062
14116
|
originalTransformation: r,
|
|
@@ -14066,14 +14120,14 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14066
14120
|
let e = await h.getTextIdFromSegmentId(n);
|
|
14067
14121
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
14068
14122
|
}
|
|
14069
|
-
|
|
14123
|
+
bv({
|
|
14070
14124
|
id: n,
|
|
14071
14125
|
outputByType: v
|
|
14072
|
-
}) &&
|
|
14126
|
+
}) && Sv({
|
|
14073
14127
|
attributes: {
|
|
14074
14128
|
class: "reference_article",
|
|
14075
14129
|
style: "background-color: #eae462",
|
|
14076
|
-
title:
|
|
14130
|
+
title: hv(t, e.reference)
|
|
14077
14131
|
},
|
|
14078
14132
|
id: n,
|
|
14079
14133
|
inputHtml: o,
|
|
@@ -14086,10 +14140,10 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14086
14140
|
case "external_division": {
|
|
14087
14141
|
let { division: t, originalTransformation: n, sectionTaId: r } = e;
|
|
14088
14142
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
14089
|
-
if (r !== void 0 && (
|
|
14143
|
+
if (r !== void 0 && (yv({
|
|
14090
14144
|
attributes: {
|
|
14091
14145
|
class: "lien_division_externe",
|
|
14092
|
-
href:
|
|
14146
|
+
href: pv(l, s, r)
|
|
14093
14147
|
},
|
|
14094
14148
|
inputHtml: o,
|
|
14095
14149
|
originalTransformation: n,
|
|
@@ -14099,14 +14153,14 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14099
14153
|
let e = await h.getTextIdFromSegmentId(r);
|
|
14100
14154
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
14101
14155
|
}
|
|
14102
|
-
|
|
14156
|
+
bv({
|
|
14103
14157
|
id: r,
|
|
14104
14158
|
outputByType: v
|
|
14105
|
-
}) &&
|
|
14159
|
+
}) && Sv({
|
|
14106
14160
|
attributes: {
|
|
14107
14161
|
class: "reference_division",
|
|
14108
14162
|
style: "background-color: #eae462",
|
|
14109
|
-
title:
|
|
14163
|
+
title: hv(t, e.reference)
|
|
14110
14164
|
},
|
|
14111
14165
|
id: r,
|
|
14112
14166
|
inputHtml: o,
|
|
@@ -14119,7 +14173,7 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14119
14173
|
case "european_text": {
|
|
14120
14174
|
let { url: t, originalTransformation: n, text: r, titleId: i } = e;
|
|
14121
14175
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14122
|
-
|
|
14176
|
+
yv({
|
|
14123
14177
|
attributes: {
|
|
14124
14178
|
class: "lien_texte_european",
|
|
14125
14179
|
href: t,
|
|
@@ -14129,14 +14183,14 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14129
14183
|
originalTransformation: n,
|
|
14130
14184
|
outputByType: v,
|
|
14131
14185
|
replacementCounter: y
|
|
14132
|
-
}),
|
|
14186
|
+
}), bv({
|
|
14133
14187
|
id: i,
|
|
14134
14188
|
outputByType: v
|
|
14135
|
-
}) &&
|
|
14189
|
+
}) && Sv({
|
|
14136
14190
|
attributes: {
|
|
14137
14191
|
class: "reference_texte",
|
|
14138
14192
|
style: "background-color: #eae462",
|
|
14139
|
-
title:
|
|
14193
|
+
title: hv(r, e.reference)
|
|
14140
14194
|
},
|
|
14141
14195
|
id: i,
|
|
14142
14196
|
inputHtml: o,
|
|
@@ -14149,23 +14203,23 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14149
14203
|
case "external_text": {
|
|
14150
14204
|
let { originalTransformation: t, text: n } = e;
|
|
14151
14205
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14152
|
-
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (
|
|
14206
|
+
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (yv({
|
|
14153
14207
|
attributes: {
|
|
14154
14208
|
class: "lien_texte_externe",
|
|
14155
|
-
href:
|
|
14209
|
+
href: pv(l, s, n.cid)
|
|
14156
14210
|
},
|
|
14157
14211
|
inputHtml: o,
|
|
14158
14212
|
originalTransformation: t,
|
|
14159
14213
|
outputByType: v,
|
|
14160
14214
|
replacementCounter: y
|
|
14161
|
-
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)),
|
|
14215
|
+
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)), bv({
|
|
14162
14216
|
id: n.cid,
|
|
14163
14217
|
outputByType: v
|
|
14164
|
-
}) &&
|
|
14218
|
+
}) && Sv({
|
|
14165
14219
|
attributes: {
|
|
14166
14220
|
class: "reference_texte",
|
|
14167
14221
|
style: "background-color: #eae462",
|
|
14168
|
-
title:
|
|
14222
|
+
title: hv(n, e.reference)
|
|
14169
14223
|
},
|
|
14170
14224
|
id: n.cid,
|
|
14171
14225
|
inputHtml: o,
|
|
@@ -14178,7 +14232,7 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14178
14232
|
case "internal_article": {
|
|
14179
14233
|
let { definition: t, originalTransformation: n } = e;
|
|
14180
14234
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
14181
|
-
for (let e of Object.values(v))
|
|
14235
|
+
for (let e of Object.values(v)) vv({
|
|
14182
14236
|
inputHtml: o,
|
|
14183
14237
|
originalTransformation: n,
|
|
14184
14238
|
output: e,
|
|
@@ -14189,18 +14243,18 @@ async function _v({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14189
14243
|
}
|
|
14190
14244
|
default: c("Link", e);
|
|
14191
14245
|
}
|
|
14192
|
-
for (let e of Object.values(v)) e.html =
|
|
14246
|
+
for (let e of Object.values(v)) e.html = _v(o, e.replacements);
|
|
14193
14247
|
return {
|
|
14194
14248
|
outputByType: v,
|
|
14195
14249
|
referredLegifranceTextCountByCid: _
|
|
14196
14250
|
};
|
|
14197
14251
|
}
|
|
14198
|
-
function
|
|
14252
|
+
function Sv({ attributes: e, id: t, inputHtml: n, originalTransformation: r, outputByType: i, replacementCounter: a }) {
|
|
14199
14253
|
let o = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
14200
14254
|
for (let e of ["links_or_references", "references"]) {
|
|
14201
14255
|
if (e === "links_or_references" && t !== void 0) continue;
|
|
14202
14256
|
let s = i[e];
|
|
14203
|
-
s !== void 0 &&
|
|
14257
|
+
s !== void 0 && vv({
|
|
14204
14258
|
inputHtml: n,
|
|
14205
14259
|
originalTransformation: r,
|
|
14206
14260
|
output: s,
|
|
@@ -14210,4 +14264,4 @@ function vv({ attributes: e, id: t, inputHtml: n, originalTransformation: r, out
|
|
|
14210
14264
|
}
|
|
14211
14265
|
}
|
|
14212
14266
|
//#endregion
|
|
14213
|
-
export { Wp as $, Vm as A, O as At, hm as B, ft as Bt, Xm as C, Rt as Ct, Wm as D, ht as Dt, Gm as E, mt as Et, Im as F, rt as Ft, Kp as G, mm as H, lt as Ht, Om as I, it as It, Gp as J, qp as K, Em as L, at as Lt, Um as M, tt as Mt, Lm as N, nt as Nt, Rm as O, _t as Ot, Fm as P, ot as Pt, bp as Q, wm as R, ut as Rt, Mh as S, Dt as St, qm as T, Ot as Tt, cm as U, ct as Ut, gm as V, st as Vt, $ as W, Rp as X, jp as Y, yp as Z, Qh as _, qt as _t,
|
|
14267
|
+
export { Wp as $, Vm as A, O as At, hm as B, ft as Bt, Xm as C, Rt as Ct, Wm as D, ht as Dt, Gm as E, mt as Et, Im as F, rt as Ft, Kp as G, mm as H, lt as Ht, Om as I, it as It, Gp as J, qp as K, Em as L, at as Lt, Um as M, tt as Mt, Lm as N, nt as Nt, Rm as O, _t as Ot, Fm as P, ot as Pt, bp as Q, wm as R, ut as Rt, Mh as S, Dt as St, qm as T, Ot as Tt, cm as U, ct as Ut, gm as V, st as Vt, $ as W, Rp as X, jp as Y, yp as Z, Qh as _, qt as _t, lv as a, wn as at, Kh as b, Bt as bt, dv as c, fn as ct, V_ as d, rn as dt, dp as et, D_ as f, an as ft, O_ as g, Xt as gt, F_ as h, Qt as ht, pv as i, xn as it, Hm as j, xt as jt, zm as k, D as kt, H_ as l, un as lt, k_ as m, sn as mt, gv as n, _n as nt, uv as o, pn as ot, I_ as p, nn as pt, Zp as q, fv as r, vn as rt, cv as s, gn as st, xv as t, Tn as tt, sv as u, tn as ut, qh as v, Jt as vt, Km as w, zt as wt, Nh as x, Vt as xt, Jh as y, Yt as yt, _m as z, dt as zt };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as e, A as t, At as n, B as r, Bt as i, Dt as a, Et as o, F as s, Ft as c, G as l, H as u, Ht as d, I as f, It as p, K as m, L as ee, Lt as te, M as ne, Mt as re, N as ie, Nt as ae, O as oe, Ot as se, P as ce, Pt as le, Q as ue, R as de, Rt as fe, St as pe, Tt as me, U as he, Ut as ge, V as _e, Vt as ve, W as ye, X as be, Y as xe, Z as Se, _t as Ce, a as we, at as Te, b as Ee, bt as De, c as Oe, ct as ke, d as Ae, dt as je, f as Me, ft as Ne, g as Pe, gt as h, h as Fe, ht as g, i as _, it as Ie, j as Le, jt as Re, k as ze, kt as Be, l as v, lt as Ve, m as He, mt as Ue, n as We, nt as Ge, o as Ke, ot as qe, p as Je, pt as Ye, q as Xe, r as Ze, rt as Qe, s as $e, st as et, t as tt, tt as nt, u as rt, ut as it, vt as at, wt as ot, xt as st, yt as ct, z as lt, zt as ut } from "./html-
|
|
1
|
+
import { $ as e, A as t, At as n, B as r, Bt as i, Dt as a, Et as o, F as s, Ft as c, G as l, H as u, Ht as d, I as f, It as p, K as m, L as ee, Lt as te, M as ne, Mt as re, N as ie, Nt as ae, O as oe, Ot as se, P as ce, Pt as le, Q as ue, R as de, Rt as fe, St as pe, Tt as me, U as he, Ut as ge, V as _e, Vt as ve, W as ye, X as be, Y as xe, Z as Se, _t as Ce, a as we, at as Te, b as Ee, bt as De, c as Oe, ct as ke, d as Ae, dt as je, f as Me, ft as Ne, g as Pe, gt as h, h as Fe, ht as g, i as _, it as Ie, j as Le, jt as Re, k as ze, kt as Be, l as v, lt as Ve, m as He, mt as Ue, n as We, nt as Ge, o as Ke, ot as qe, p as Je, pt as Ye, q as Xe, r as Ze, rt as Qe, s as $e, st as et, t as tt, tt as nt, u as rt, ut as it, vt as at, wt as ot, xt as st, yt as ct, z as lt, zt as ut } from "./html-CW0PiEAm.js";
|
|
2
2
|
import { $ as dt, A as ft, At as pt, B as mt, C as ht, Ct as y, D as b, E as gt, Et as x, F as S, Ft as C, G as _t, H as vt, I as w, J as yt, K as bt, M as xt, Mt as St, N as Ct, Nt as wt, O as Tt, P as Et, Pt as Dt, Q as T, S as Ot, St as kt, T as At, Tt as E, W as jt, X as Mt, Y as Nt, Z as Pt, _ as D, a as Ft, b as It, bt as Lt, c as Rt, ct as zt, d as Bt, dt as Vt, f as Ht, ft as Ut, g as Wt, gt as O, h as Gt, i as Kt, it as qt, j as Jt, jt as k, k as Yt, kt as A, l as Xt, lt as Zt, m as Qt, o as $t, ot as en, p as tn, q as nn, r as rn, s as an, t as on, tt as sn, u as cn, ut as ln, v as j, vt as un, w as dn, wt as M, x as fn, y as pn, yt as mn, z as hn } from "./resolver-CLdkzY2R.js";
|
|
3
3
|
//#region ../../node_modules/@tricoteuses/legifrance/dist/legal/index.js
|
|
4
4
|
function gn(e, t) {
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as e, C as t, Ct as n, D as r, E as i, J as a, P as o, Q as s, S as c, T as l, W as u, _ as d, _t as f, a as p, bt as m, c as h, d as g, et as _, jt as ee, m as v, n as y, o as b, pt as x, q as te, t as ne, v as S, vt as re, w as ie, x as ae, y as oe, yt as C } from "./html-
|
|
1
|
+
import { At as e, C as t, Ct as n, D as r, E as i, J as a, P as o, Q as s, S as c, T as l, W as u, _ as d, _t as f, a as p, bt as m, c as h, d as g, et as _, jt as ee, m as v, n as y, o as b, pt as x, q as te, t as ne, v as S, vt as re, w as ie, x as ae, y as oe, yt as C } from "./html-CW0PiEAm.js";
|
|
2
2
|
import { Ct as w, D as se, E as ce, N as le, Q as ue, Tt as T, gt as E, i as de, j as fe, jt as D, kt as O, n as pe, ot as me, pt as he, r as ge, t as _e, wt as k } from "./resolver-CLdkzY2R.js";
|
|
3
3
|
import * as ve from "node:crypto";
|
|
4
4
|
import { createHash as A } from "node:crypto";
|