@tricoteuses/tisseuse 0.14.8 → 0.14.9
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/README.md +7 -2
- package/dist/{html-Cse0qjys.js → html-B2BbrPpc.js} +262 -193
- package/dist/index.js +51 -51
- package/dist/{resolver-CLdkzY2R.js → resolver-D5TCkLkD.js} +3 -0
- package/dist/server-f-legi.js +1 -1
- package/dist/server.js +179 -179
- package/dist/src/lib/extractors/links.d.ts +7 -0
- package/dist/src/lib/index.d.ts +1 -1
- package/dist/src/lib/legi/canutes_resolver.d.ts +25 -1
- package/dist/src/lib/legi/canutes_resolver.test.d.ts +1 -0
- package/dist/src/lib/legi/resolver.d.ts +16 -0
- package/dist/src/lib/links.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as e, B as t, Ct as n, D as r, Dt as i, E as a, Et as o, F as s, Ft as c, G as l, H as u, I as d, It as f, J as p, K as m, L as h, Lt as g, Mt as _, N as v, Nt as y, Ot as ee, Q as te, R as ne, Rt as re, St as b, Tt as x, U as ie, V as ae, W as oe, X as se, Y as ce, Z as le, _t as ue, at as de, ct as fe, et as pe, ft as me, g as he, gt as S, ht as ge, j as _e, jt as C, k as ve, kt as w, lt as ye, mt as be, n as xe, nt as Se, ot as Ce, pt as we, q as Te, r as Ee, rt as De, st as Oe, t as ke, tt as Ae, ut as je, vt as Me, wt as T, xt as Ne, yt as Pe, zt as Fe } from "./resolver-
|
|
1
|
+
import { At as e, B as t, Ct as n, D as r, Dt as i, E as a, Et as o, F as s, Ft as c, G as l, H as u, I as d, It as f, J as p, K as m, L as h, Lt as g, Mt as _, N as v, Nt as y, Ot as ee, Q as te, R as ne, Rt as re, St as b, Tt as x, U as ie, V as ae, W as oe, X as se, Y as ce, Z as le, _t as ue, at as de, ct as fe, et as pe, ft as me, g as he, gt as S, ht as ge, j as _e, jt as C, k as ve, kt as w, lt as ye, mt as be, n as xe, nt as Se, ot as Ce, pt as we, q as Te, r as Ee, rt as De, st as Oe, t as ke, tt as Ae, ut as je, vt as Me, wt as T, xt as Ne, yt as Pe, zt as Fe } from "./resolver-D5TCkLkD.js";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var Ie = Object.create, Le = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, ze = Object.getOwnPropertyNames, Be = Object.getPrototypeOf, Ve = Object.prototype.hasOwnProperty, He = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Ue = (e, t) => {
|
|
4
4
|
let n = {};
|
|
@@ -12964,6 +12964,25 @@ function B_(e) {
|
|
|
12964
12964
|
};
|
|
12965
12965
|
}
|
|
12966
12966
|
function V_(e) {
|
|
12967
|
+
if (e.length === 0) return;
|
|
12968
|
+
let t = /* @__PURE__ */ new Map();
|
|
12969
|
+
for (let n of e) {
|
|
12970
|
+
let e = n.versions?.VERSION, r = Array.isArray(e) ? e : e == null ? [] : [e], i = new Set([n.id]);
|
|
12971
|
+
for (let e of r) {
|
|
12972
|
+
let t = e?.LIEN_ART?.["@id"];
|
|
12973
|
+
typeof t == "string" && i.add(t);
|
|
12974
|
+
}
|
|
12975
|
+
let a = [...i].sort().join("\0"), o = n.dateDebut ?? "0001-01-01", s = t.get(a);
|
|
12976
|
+
(s === void 0 || o > s.dateDebut) && t.set(a, {
|
|
12977
|
+
dateDebut: o,
|
|
12978
|
+
id: n.id
|
|
12979
|
+
});
|
|
12980
|
+
}
|
|
12981
|
+
if (t.size !== 1) return;
|
|
12982
|
+
let [{ id: n }] = [...t.values()];
|
|
12983
|
+
return { articleId: n };
|
|
12984
|
+
}
|
|
12985
|
+
function H_(e) {
|
|
12967
12986
|
let t = e["@id"];
|
|
12968
12987
|
return t === void 0 ? null : {
|
|
12969
12988
|
dateDebut: e["@debut"] ?? null,
|
|
@@ -12973,11 +12992,12 @@ function V_(e) {
|
|
|
12973
12992
|
title: e["#text"] ?? null
|
|
12974
12993
|
};
|
|
12975
12994
|
}
|
|
12976
|
-
function
|
|
12995
|
+
function U_(e, t) {
|
|
12977
12996
|
return (e.dateDebut === null || e.dateDebut <= t) && (e.dateFin === null || e.dateFin >= t);
|
|
12978
12997
|
}
|
|
12979
|
-
var
|
|
12998
|
+
var W_ = class extends ke {
|
|
12980
12999
|
canutesDb;
|
|
13000
|
+
articleHistoryInfoByTextAndNum = /* @__PURE__ */ new Map();
|
|
12981
13001
|
articleRowsByNumByTextAndDate = /* @__PURE__ */ new Map();
|
|
12982
13002
|
directSectionChildrenByParentAndDate = /* @__PURE__ */ new Map();
|
|
12983
13003
|
globalArticleRowsByNumAndDate = /* @__PURE__ */ new Map();
|
|
@@ -13003,6 +13023,20 @@ var U_ = class extends ke {
|
|
|
13003
13023
|
AND num = ${t}
|
|
13004
13024
|
`).map(B_), this.articleRowsByNumByTextAndDate.set(r, i)), i;
|
|
13005
13025
|
}
|
|
13026
|
+
async getArticleHistoryInfo({ num: e, textId: t }) {
|
|
13027
|
+
if (e === void 0) return;
|
|
13028
|
+
let n = `${t}\0${e}`, r = this.articleHistoryInfoByTextAndNum.get(n);
|
|
13029
|
+
return r === void 0 && (r = V_(await this.canutesDb`
|
|
13030
|
+
SELECT
|
|
13031
|
+
id,
|
|
13032
|
+
data -> 'META' -> 'META_SPEC' -> 'META_ARTICLE' ->> 'DATE_DEBUT' AS "dateDebut",
|
|
13033
|
+
data -> 'VERSIONS' AS versions
|
|
13034
|
+
FROM legifrance.article
|
|
13035
|
+
WHERE
|
|
13036
|
+
data -> 'CONTEXTE' -> 'TEXTE' ->> '@cid' = ${t}
|
|
13037
|
+
AND num = ${e}
|
|
13038
|
+
`), this.articleHistoryInfoByTextAndNum.set(n, r)), r;
|
|
13039
|
+
}
|
|
13006
13040
|
async getDirectSectionChildren({ date: e, parentPath: t }) {
|
|
13007
13041
|
let n = `${t}\0${e}`, r = this.directSectionChildrenByParentAndDate.get(n);
|
|
13008
13042
|
if (r === void 0) {
|
|
@@ -13015,7 +13049,7 @@ var U_ = class extends ke {
|
|
|
13015
13049
|
SELECT data
|
|
13016
13050
|
FROM legifrance.textelr
|
|
13017
13051
|
WHERE id = ${t}
|
|
13018
|
-
`)[0]?.data.STRUCT?.LIEN_SECTION_TA?.map(
|
|
13052
|
+
`)[0]?.data.STRUCT?.LIEN_SECTION_TA?.map(H_).filter((e) => e !== null).filter((t) => U_(t, e)) ?? [] : i.map(H_).filter((e) => e !== null).filter((t) => U_(t, e)), this.directSectionChildrenByParentAndDate.set(n, r);
|
|
13019
13053
|
}
|
|
13020
13054
|
return r;
|
|
13021
13055
|
}
|
|
@@ -13129,15 +13163,15 @@ var U_ = class extends ke {
|
|
|
13129
13163
|
};
|
|
13130
13164
|
//#endregion
|
|
13131
13165
|
//#region src/lib/extractors/links.ts
|
|
13132
|
-
async function*
|
|
13133
|
-
let l = r ?? (e === void 0 ? void 0 : new
|
|
13166
|
+
async function* G_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgnoredReferencesTypes: i, logPartialReferences: a, logReferences: o, state: s, transformation: c }) {
|
|
13167
|
+
let l = r ?? (e === void 0 ? void 0 : new W_(e));
|
|
13134
13168
|
if (l === void 0) throw Error("A Canutes database or legal resolver is required");
|
|
13135
13169
|
let u = new xe("extractTextLinks"), d = {}, f = c === void 0 ? void 0 : _e(c), p = s === void 0 ? {} : structuredClone(s), m = u.timeSync("extractReferences", () => {
|
|
13136
13170
|
let e = [];
|
|
13137
13171
|
for (let n of c === void 0 ? Vm(t) : Um(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);
|
|
13138
13172
|
return e;
|
|
13139
13173
|
}, { inputSize: t.input.length }), h = performance.now();
|
|
13140
|
-
for (let e of m) for (let n of
|
|
13174
|
+
for (let e of m) for (let n of uv(t, e)) {
|
|
13141
13175
|
let r = n.type === "parent-enfant" ? n.parent : n;
|
|
13142
13176
|
switch (r.type) {
|
|
13143
13177
|
case "alinéa":
|
|
@@ -13166,7 +13200,7 @@ async function* W_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13166
13200
|
r.definition && p.textId === void 0 && a && console.log(`In "${t.input.slice(e.position.start, e.position.stop)}": Missing state.textId for division definition`);
|
|
13167
13201
|
break;
|
|
13168
13202
|
case "texte":
|
|
13169
|
-
|
|
13203
|
+
K_({
|
|
13170
13204
|
context: t,
|
|
13171
13205
|
logPartialReferences: a,
|
|
13172
13206
|
reference: e,
|
|
@@ -13182,14 +13216,14 @@ async function* W_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13182
13216
|
phase: "collectDefinitionsAndTextState"
|
|
13183
13217
|
});
|
|
13184
13218
|
let g = /* @__PURE__ */ new Set();
|
|
13185
|
-
for (let e of m) for (let t of
|
|
13186
|
-
let _ =
|
|
13219
|
+
for (let e of m) for (let t of lv(e, { citations: !0 })) g.add(t);
|
|
13220
|
+
let _ = q_(t, m);
|
|
13187
13221
|
await u.time("preloadActiveArticlesByTextIds", () => l.preloadActiveArticlesByTextIds({
|
|
13188
13222
|
date: n,
|
|
13189
13223
|
nums: g,
|
|
13190
13224
|
textIds: _
|
|
13191
13225
|
}), { count: _.size });
|
|
13192
|
-
let v = await u.time("collectUniqueFallbackArticleNums", () =>
|
|
13226
|
+
let v = await u.time("collectUniqueFallbackArticleNums", () => J_({
|
|
13193
13227
|
context: t,
|
|
13194
13228
|
date: n,
|
|
13195
13229
|
legiResolver: l,
|
|
@@ -13202,7 +13236,7 @@ async function* W_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13202
13236
|
nums: v
|
|
13203
13237
|
}), { count: v.size }), p = s === void 0 ? {} : s;
|
|
13204
13238
|
let y = 0, ee = performance.now();
|
|
13205
|
-
for (let e of m) for await (let r of
|
|
13239
|
+
for (let e of m) for await (let r of hv({
|
|
13206
13240
|
articleDefinitionByNumByTextId: d,
|
|
13207
13241
|
legiResolver: l,
|
|
13208
13242
|
context: t,
|
|
@@ -13219,7 +13253,7 @@ async function* W_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13219
13253
|
phase: "iterReferenceLinks"
|
|
13220
13254
|
}), u.log({ referenceCount: m.length });
|
|
13221
13255
|
}
|
|
13222
|
-
function
|
|
13256
|
+
function K_({ context: e, logPartialReferences: t, reference: n, state: r, text: i }) {
|
|
13223
13257
|
switch (i.nature) {
|
|
13224
13258
|
case "ARRETE":
|
|
13225
13259
|
case "CIRCULAIRE":
|
|
@@ -13290,17 +13324,17 @@ function G_({ context: e, logPartialReferences: t, reference: n, state: r, text:
|
|
|
13290
13324
|
default: i.nature === void 0 ? delete r.textId : c("nature", i.nature);
|
|
13291
13325
|
}
|
|
13292
13326
|
}
|
|
13293
|
-
function
|
|
13327
|
+
function q_(e, t) {
|
|
13294
13328
|
let n = /* @__PURE__ */ new Set();
|
|
13295
|
-
for (let r of t) for (let t of
|
|
13329
|
+
for (let r of t) for (let t of uv(e, r, { citations: !0 })) {
|
|
13296
13330
|
let e = t.type === "parent-enfant" ? t.parent : t;
|
|
13297
13331
|
e.type === "texte" && e.cid !== void 0 ? n.add(e.cid) : e.type === "article" && e.implicitText?.cid !== void 0 && n.add(e.implicitText.cid);
|
|
13298
13332
|
}
|
|
13299
13333
|
return n;
|
|
13300
13334
|
}
|
|
13301
|
-
async function
|
|
13335
|
+
async function J_({ context: e, date: t, legiResolver: n, logPartialReferences: r, references: i, state: a }) {
|
|
13302
13336
|
let o = /* @__PURE__ */ new Set();
|
|
13303
|
-
for (let s of i) await
|
|
13337
|
+
for (let s of i) await Y_({
|
|
13304
13338
|
articleNums: o,
|
|
13305
13339
|
context: e,
|
|
13306
13340
|
date: t,
|
|
@@ -13311,8 +13345,8 @@ async function q_({ context: e, date: t, legiResolver: n, logPartialReferences:
|
|
|
13311
13345
|
});
|
|
13312
13346
|
return o;
|
|
13313
13347
|
}
|
|
13314
|
-
async function
|
|
13315
|
-
for (let s of
|
|
13348
|
+
async function Y_({ articleNums: e, context: t, date: n, legiResolver: r, logPartialReferences: i, reference: a, state: o }) {
|
|
13349
|
+
for (let s of uv(t, a)) await X_({
|
|
13316
13350
|
articleNums: e,
|
|
13317
13351
|
atomicOrParentChildReference: s,
|
|
13318
13352
|
context: t,
|
|
@@ -13327,7 +13361,7 @@ async function J_({ articleNums: e, context: t, date: n, legiResolver: r, logPar
|
|
|
13327
13361
|
if (s !== void 0) {
|
|
13328
13362
|
for (let a of s) if (a.references !== void 0) {
|
|
13329
13363
|
let s = structuredClone(o);
|
|
13330
|
-
for (let o of a.references) await
|
|
13364
|
+
for (let o of a.references) await Y_({
|
|
13331
13365
|
articleNums: e,
|
|
13332
13366
|
context: t,
|
|
13333
13367
|
date: n,
|
|
@@ -13340,7 +13374,7 @@ async function J_({ articleNums: e, context: t, date: n, legiResolver: r, logPar
|
|
|
13340
13374
|
}
|
|
13341
13375
|
}
|
|
13342
13376
|
}
|
|
13343
|
-
async function
|
|
13377
|
+
async function X_({ articleNums: e, atomicOrParentChildReference: t, context: n, date: r, legiResolver: i, logPartialReferences: a, reference: o, state: s }) {
|
|
13344
13378
|
let c = t.type === "parent-enfant" ? t.parent : t, l = t.type === "parent-enfant" ? t : void 0;
|
|
13345
13379
|
switch (c.type) {
|
|
13346
13380
|
case "alinéa":
|
|
@@ -13349,7 +13383,7 @@ async function Y_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13349
13383
|
case "phrase": break;
|
|
13350
13384
|
case "article":
|
|
13351
13385
|
if (c.definition && s.textId !== void 0) break;
|
|
13352
|
-
await
|
|
13386
|
+
await sv({
|
|
13353
13387
|
article: c,
|
|
13354
13388
|
date: r,
|
|
13355
13389
|
legiResolver: i,
|
|
@@ -13367,7 +13401,7 @@ async function Y_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13367
13401
|
case "sous-titre":
|
|
13368
13402
|
case "titre":
|
|
13369
13403
|
if (c.definition && s.textId !== void 0) break;
|
|
13370
|
-
l !== void 0 && await
|
|
13404
|
+
l !== void 0 && await Y_({
|
|
13371
13405
|
articleNums: e,
|
|
13372
13406
|
context: n,
|
|
13373
13407
|
date: r,
|
|
@@ -13378,13 +13412,13 @@ async function Y_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13378
13412
|
});
|
|
13379
13413
|
break;
|
|
13380
13414
|
case "texte":
|
|
13381
|
-
|
|
13415
|
+
K_({
|
|
13382
13416
|
context: n,
|
|
13383
13417
|
logPartialReferences: a,
|
|
13384
13418
|
reference: o,
|
|
13385
13419
|
state: s,
|
|
13386
13420
|
text: c
|
|
13387
|
-
}), l !== void 0 && await
|
|
13421
|
+
}), l !== void 0 && await Y_({
|
|
13388
13422
|
articleNums: e,
|
|
13389
13423
|
context: n,
|
|
13390
13424
|
date: r,
|
|
@@ -13397,14 +13431,14 @@ async function Y_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13397
13431
|
default: break;
|
|
13398
13432
|
}
|
|
13399
13433
|
}
|
|
13400
|
-
var
|
|
13434
|
+
var Z_ = new Set([
|
|
13401
13435
|
"LEGITEXT000005634379",
|
|
13402
13436
|
"LEGITEXT000006069583",
|
|
13403
13437
|
"LEGITEXT000006070933",
|
|
13404
13438
|
"LEGITEXT000006072026",
|
|
13405
13439
|
"LEGITEXT000006073984",
|
|
13406
13440
|
"LEGITEXT000006074096"
|
|
13407
|
-
]),
|
|
13441
|
+
]), Q_ = new Set([
|
|
13408
13442
|
"LEGITEXT000006069568",
|
|
13409
13443
|
"LEGITEXT000006069569",
|
|
13410
13444
|
"LEGITEXT000006069574",
|
|
@@ -13412,41 +13446,41 @@ var X_ = new Set([
|
|
|
13412
13446
|
"LEGITEXT000006069577",
|
|
13413
13447
|
"LEGITEXT000006069583"
|
|
13414
13448
|
]);
|
|
13415
|
-
function
|
|
13449
|
+
function $_(e, t, n) {
|
|
13416
13450
|
let r = n.replace(/\s+/gu, " ").trim();
|
|
13417
13451
|
r !== "" && r !== t && e.add(r);
|
|
13418
13452
|
}
|
|
13419
|
-
function
|
|
13453
|
+
function ev(e, t) {
|
|
13420
13454
|
let n = new Set([e]), r = new Set([e]);
|
|
13421
13455
|
for (let i = 0; i < 3; i++) {
|
|
13422
13456
|
let i = /* @__PURE__ */ new Set();
|
|
13423
13457
|
for (let a of r) {
|
|
13424
13458
|
let r = /* @__PURE__ */ new Set();
|
|
13425
|
-
|
|
13426
|
-
for (let t of a.matchAll(/-(?=\p{L})/gu))
|
|
13427
|
-
|
|
13459
|
+
$_(r, e, a.replace(/\s*-\s*/gu, "-")), $_(r, e, a.replace(/^(R\*)\s*(\d)/u, "$1 $2")), t === "LEGITEXT000006069583" && ($_(r, e, a.replace(/^(R)(\d)/u, "$1*$2")), $_(r, e, a.replace(/^(R)(\d)/u, "$1* $2"))), $_(r, e, a.replace(/^R\*/u, "*R")), $_(r, e, a.replace(/^R\*/u, "R"));
|
|
13460
|
+
for (let t of a.matchAll(/-(?=\p{L})/gu)) $_(r, e, `${a.slice(0, t.index)} ${a.slice(t.index + 1)}`);
|
|
13461
|
+
$_(r, e, a.replace(/-O(?=\p{L}|\s|$)/gu, "-0")), $_(r, e, a.replace(/-0(?=\p{L})/gu, "-0 "));
|
|
13428
13462
|
let o = a.match(/^((?:L\s*O|[LRDA])\*?\s*)(\d{4,})$/u);
|
|
13429
13463
|
if (o !== null) {
|
|
13430
13464
|
let [, t, n] = o;
|
|
13431
|
-
for (let i = 2; i < n.length; i++)
|
|
13465
|
+
for (let i = 2; i < n.length; i++) $_(r, e, `${t}${n.slice(0, i)}-${n.slice(i)}`);
|
|
13432
13466
|
}
|
|
13433
|
-
if (/^(?:L\s*O|[LRDA])\*?/u.test(a) &&
|
|
13467
|
+
if (/^(?:L\s*O|[LRDA])\*?/u.test(a) && $_(r, e, a.replace(/\s+(\d+)$/u, "-$1")), t === "LEGITEXT000006069576" && /^0\d+$/u.test(a) && $_(r, e, String(Number(a))), Z_.has(t) && /^\d/u.test(a)) for (let t of [
|
|
13434
13468
|
"L",
|
|
13435
13469
|
"R",
|
|
13436
13470
|
"D",
|
|
13437
13471
|
"A",
|
|
13438
13472
|
"R*",
|
|
13439
13473
|
"*R"
|
|
13440
|
-
])
|
|
13441
|
-
|
|
13474
|
+
]) $_(r, e, `${t}${a}`);
|
|
13475
|
+
$_(r, e, a.replace(/(\d)\s+0(?=\s*-?\s*\p{L})/gu, "$1-0")), $_(r, e, a.replace(/(\p{L})\s+(\d{2})-([\p{L}])$/u, "$1-$2 $3"));
|
|
13442
13476
|
for (let e of r) n.has(e) || (n.add(e), i.add(e));
|
|
13443
13477
|
}
|
|
13444
13478
|
r = i;
|
|
13445
13479
|
}
|
|
13446
13480
|
return n.delete(e), [...n];
|
|
13447
13481
|
}
|
|
13448
|
-
function
|
|
13449
|
-
if (!
|
|
13482
|
+
function tv(e, t) {
|
|
13483
|
+
if (!Q_.has(t)) return [];
|
|
13450
13484
|
let n = [], r = e;
|
|
13451
13485
|
for (let e = 0; e < 4; e++) {
|
|
13452
13486
|
let e = r.replace(/(?:\s*-\s*|\s+)(?:[IVX]+|[1-9]\d*)(?:\s+(?:bis|ter|quater|quinquies|sexies))?$/iu, "").trim();
|
|
@@ -13455,10 +13489,10 @@ function ev(e, t) {
|
|
|
13455
13489
|
}
|
|
13456
13490
|
return n;
|
|
13457
13491
|
}
|
|
13458
|
-
function
|
|
13492
|
+
function nv(e, t) {
|
|
13459
13493
|
return `${e}\0${t}`;
|
|
13460
13494
|
}
|
|
13461
|
-
var
|
|
13495
|
+
var rv = new Map([
|
|
13462
13496
|
...[
|
|
13463
13497
|
"1594 F quinquies A",
|
|
13464
13498
|
"1594 F quinquies-D",
|
|
@@ -13466,7 +13500,7 @@ var nv = new Map([
|
|
|
13466
13500
|
"1594 F quinquies E II",
|
|
13467
13501
|
"1594 F quinquies- E-I",
|
|
13468
13502
|
"1594 F quinquies K"
|
|
13469
|
-
].map((e) => [
|
|
13503
|
+
].map((e) => [nv("LEGITEXT000006069577", e), {
|
|
13470
13504
|
num: "1594 F quinquies",
|
|
13471
13505
|
textId: "LEGITEXT000006069577"
|
|
13472
13506
|
}]),
|
|
@@ -13475,7 +13509,7 @@ var nv = new Map([
|
|
|
13475
13509
|
"1594-0 G-A",
|
|
13476
13510
|
"1594-0 G-A-II",
|
|
13477
13511
|
"1594-0 G-A-VI"
|
|
13478
|
-
].map((e) => [
|
|
13512
|
+
].map((e) => [nv("LEGITEXT000006069577", e), {
|
|
13479
13513
|
num: "1594-0 G",
|
|
13480
13514
|
textId: "LEGITEXT000006069577"
|
|
13481
13515
|
}]),
|
|
@@ -13487,23 +13521,23 @@ var nv = new Map([
|
|
|
13487
13521
|
["38 B", "LEGITEXT000006069574"],
|
|
13488
13522
|
["49 octies D", "LEGITEXT000006069574"],
|
|
13489
13523
|
["199-0", "LEGITEXT000006069576"]
|
|
13490
|
-
].map(([e, t]) => [
|
|
13524
|
+
].map(([e, t]) => [nv("LEGITEXT000006069577", e), {
|
|
13491
13525
|
num: e,
|
|
13492
13526
|
textId: t
|
|
13493
13527
|
}]),
|
|
13494
|
-
[
|
|
13528
|
+
[nv("LEGITEXT000006069577", "L173"), {
|
|
13495
13529
|
num: "173",
|
|
13496
13530
|
textId: "LEGITEXT000006069577"
|
|
13497
13531
|
}],
|
|
13498
|
-
[
|
|
13532
|
+
[nv("LEGITEXT000006069583", "L38 B"), {
|
|
13499
13533
|
num: "L38",
|
|
13500
13534
|
textId: "LEGITEXT000006069583"
|
|
13501
13535
|
}],
|
|
13502
|
-
...["L311-13 C", "L311-13 D"].map((e) => [
|
|
13536
|
+
...["L311-13 C", "L311-13 D"].map((e) => [nv("LEGITEXT000006070158", e), {
|
|
13503
13537
|
num: "L311-13",
|
|
13504
13538
|
textId: "LEGITEXT000006070158"
|
|
13505
13539
|
}]),
|
|
13506
|
-
[
|
|
13540
|
+
[nv("LEGITEXT000006071154", "226-14"), {
|
|
13507
13541
|
num: "226-14",
|
|
13508
13542
|
textId: "LEGITEXT000006070719"
|
|
13509
13543
|
}],
|
|
@@ -13511,23 +13545,23 @@ var nv = new Map([
|
|
|
13511
13545
|
"1300-1",
|
|
13512
13546
|
"1300-2",
|
|
13513
13547
|
"1300-4"
|
|
13514
|
-
].map((e) => [
|
|
13548
|
+
].map((e) => [nv("LEGITEXT000006070721", e), {
|
|
13515
13549
|
num: e,
|
|
13516
13550
|
textId: "LEGITEXT000006070716"
|
|
13517
13551
|
}])
|
|
13518
|
-
]),
|
|
13519
|
-
[
|
|
13520
|
-
[
|
|
13521
|
-
[
|
|
13522
|
-
[
|
|
13552
|
+
]), iv = new Map([
|
|
13553
|
+
[nv("LEGITEXT000006069574", "382-0 C bis"), "LEGIARTI000036256024"],
|
|
13554
|
+
[nv("LEGITEXT000006069577", "1586 quinquies"), "LEGIARTI000023380915"],
|
|
13555
|
+
[nv("LEGITEXT000006069577", "1681 sexies"), "LEGIARTI000037986425"],
|
|
13556
|
+
[nv("LEGITEXT000006069577", "286"), "LEGIARTI000033815246"]
|
|
13523
13557
|
]);
|
|
13524
|
-
function
|
|
13525
|
-
let t = new Set(e.flatMap(({ num: e, textId: t }) => e === null || t === null ? [] : [
|
|
13558
|
+
function av(e) {
|
|
13559
|
+
let t = new Set(e.flatMap(({ num: e, textId: t }) => e === null || t === null ? [] : [nv(t, e)]));
|
|
13526
13560
|
if (t.size !== 1) return;
|
|
13527
|
-
let n =
|
|
13561
|
+
let n = iv.get([...t][0]);
|
|
13528
13562
|
return e.find(({ id: e }) => e === n);
|
|
13529
13563
|
}
|
|
13530
|
-
async function
|
|
13564
|
+
async function ov({ alternatives: e, date: t, legiResolver: n }) {
|
|
13531
13565
|
let r = [];
|
|
13532
13566
|
for (let { num: i, textId: a } of e) {
|
|
13533
13567
|
let e = (await n.getActiveArticlesByTextAndNum({
|
|
@@ -13539,7 +13573,7 @@ async function av({ alternatives: e, date: t, legiResolver: n }) {
|
|
|
13539
13573
|
}
|
|
13540
13574
|
return r.length === 1 ? r[0] : [];
|
|
13541
13575
|
}
|
|
13542
|
-
async function
|
|
13576
|
+
async function sv({ article: e, date: t, legiResolver: n, state: r }) {
|
|
13543
13577
|
if (e.present || e.num === void 0) return !1;
|
|
13544
13578
|
let i = e.implicitText?.cid ?? r.textId;
|
|
13545
13579
|
return !(i !== void 0 && (await n.getActiveArticlesByTextAndNum({
|
|
@@ -13552,30 +13586,32 @@ async function ov({ article: e, date: t, legiResolver: n, state: r }) {
|
|
|
13552
13586
|
textId: r.defaultTextId
|
|
13553
13587
|
})).length > 0);
|
|
13554
13588
|
}
|
|
13555
|
-
async function*
|
|
13589
|
+
async function* cv({ ancestors: e, article: t, legiResolver: n, context: r, date: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13556
13590
|
if (t.present) return;
|
|
13557
13591
|
let l = [], u = t.implicitText?.cid ?? c.textId;
|
|
13558
|
-
|
|
13592
|
+
u === "LEGITEXT000006070716" && t.num !== void 0 && /^[LR]\d/u.test(t.num) && (u = "LEGITEXT000025024948");
|
|
13593
|
+
let d = [];
|
|
13594
|
+
if (u !== void 0 && (l = await n.getActiveArticlesByTextAndNum({
|
|
13559
13595
|
date: i,
|
|
13560
13596
|
num: t.num,
|
|
13561
13597
|
textId: u
|
|
13562
|
-
})), l.length === 0 && t.num !== void 0 && u !== void 0) {
|
|
13563
|
-
let e =
|
|
13564
|
-
e !== void 0 && (l = await
|
|
13598
|
+
}), l.length > 0 && (d = l)), l.length === 0 && t.num !== void 0 && u !== void 0) {
|
|
13599
|
+
let e = rv.get(nv(u, t.num));
|
|
13600
|
+
e !== void 0 && (l = await ov({
|
|
13565
13601
|
alternatives: [e],
|
|
13566
13602
|
date: i,
|
|
13567
13603
|
legiResolver: n
|
|
13568
13604
|
}));
|
|
13569
13605
|
}
|
|
13570
|
-
if (l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await
|
|
13571
|
-
alternatives:
|
|
13606
|
+
if (l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await ov({
|
|
13607
|
+
alternatives: ev(t.num, u).map((e) => ({
|
|
13572
13608
|
num: e,
|
|
13573
13609
|
textId: u
|
|
13574
13610
|
})),
|
|
13575
13611
|
date: i,
|
|
13576
13612
|
legiResolver: n
|
|
13577
|
-
})), l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await
|
|
13578
|
-
alternatives:
|
|
13613
|
+
})), l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await ov({
|
|
13614
|
+
alternatives: tv(t.num, u).map((e) => ({
|
|
13579
13615
|
num: e,
|
|
13580
13616
|
textId: u
|
|
13581
13617
|
})),
|
|
@@ -13595,111 +13631,119 @@ async function* sv({ ancestors: e, article: t, legiResolver: n, context: r, date
|
|
|
13595
13631
|
if (e.length === 1) c.articleId = e[0].id;
|
|
13596
13632
|
else {
|
|
13597
13633
|
e.length !== 0 && (l = e);
|
|
13598
|
-
let n =
|
|
13634
|
+
let n = av(l);
|
|
13599
13635
|
n === void 0 ? (e = l.filter(({ id: e }) => !c.textId?.startsWith("JORF") || e.startsWith("JORF")), e.length === 1 ? c.articleId = e[0].id : (e.length !== 0 && (l = e), a && console.warn(`In "${r.input.slice(t.position.start, t.position.stop)}": Unable to filter article ${t.num ?? null} of text ${c.textId ?? null} among IDs ${JSON.stringify(l.map(({ id: e }) => e), null, 2)} for reference ${JSON.stringify(t, null, 2)}`), delete c.articleId)) : c.articleId = n.id;
|
|
13600
13636
|
}
|
|
13601
13637
|
}
|
|
13602
|
-
let
|
|
13638
|
+
let f = e === void 0 ? t.position : t.position.start < e[0].position.start ? {
|
|
13603
13639
|
start: t.position.start,
|
|
13604
13640
|
stop: e[0].position.stop
|
|
13605
13641
|
} : {
|
|
13606
13642
|
start: e[0].position.start,
|
|
13607
13643
|
stop: t.position.stop
|
|
13608
|
-
};
|
|
13644
|
+
}, p;
|
|
13645
|
+
if (c.articleId === void 0 && t.num !== void 0 && d.length > 0 && !d.some(({ dateDebut: e, dateFin: t }) => e <= i && t > i)) {
|
|
13646
|
+
let e = await n.getArticleHistoryInfo({
|
|
13647
|
+
num: t.num,
|
|
13648
|
+
textId: u
|
|
13649
|
+
});
|
|
13650
|
+
e !== void 0 && (p = e.articleId);
|
|
13651
|
+
}
|
|
13609
13652
|
yield Object.fromEntries(Object.entries({
|
|
13610
13653
|
article: t,
|
|
13611
13654
|
articleId: c.articleId,
|
|
13612
|
-
|
|
13613
|
-
|
|
13655
|
+
historyArticleId: p,
|
|
13656
|
+
originalTransformation: o === void 0 ? void 0 : v(o, f),
|
|
13657
|
+
position: f,
|
|
13614
13658
|
reference: s,
|
|
13615
13659
|
type: "external_article"
|
|
13616
13660
|
}).filter(([, e]) => e !== void 0));
|
|
13617
13661
|
}
|
|
13618
|
-
function*
|
|
13662
|
+
function* lv(e, { citations: t = !1 } = {}) {
|
|
13619
13663
|
switch (e.type) {
|
|
13620
13664
|
case "article":
|
|
13621
13665
|
e.num !== void 0 && (yield e.num);
|
|
13622
13666
|
break;
|
|
13623
13667
|
case "bounded-interval":
|
|
13624
|
-
yield*
|
|
13668
|
+
yield* lv(e.first, { citations: t }), yield* lv(e.last, { citations: t });
|
|
13625
13669
|
break;
|
|
13626
13670
|
case "counted-interval":
|
|
13627
|
-
yield*
|
|
13671
|
+
yield* lv(e.first, { citations: t });
|
|
13628
13672
|
break;
|
|
13629
13673
|
case "enumeration":
|
|
13630
13674
|
case "exclusion":
|
|
13631
|
-
yield*
|
|
13675
|
+
yield* lv(e.left, { citations: t }), yield* lv(e.right, { citations: t });
|
|
13632
13676
|
break;
|
|
13633
13677
|
case "parent-enfant":
|
|
13634
|
-
yield*
|
|
13678
|
+
yield* lv(e.parent, { citations: t }), yield* lv(e.child, { citations: t });
|
|
13635
13679
|
break;
|
|
13636
13680
|
case "reference_et_action":
|
|
13637
|
-
if (yield*
|
|
13681
|
+
if (yield* lv(e.reference, { citations: t }), t) {
|
|
13638
13682
|
let { originalCitations: n } = e.action;
|
|
13639
13683
|
if (n !== void 0) {
|
|
13640
|
-
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield*
|
|
13684
|
+
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield* lv(n, { citations: t });
|
|
13641
13685
|
}
|
|
13642
13686
|
}
|
|
13643
13687
|
break;
|
|
13644
13688
|
}
|
|
13645
13689
|
}
|
|
13646
|
-
function*
|
|
13690
|
+
function* uv(e, t, { citations: n = !1 } = {}) {
|
|
13647
13691
|
switch (t.type) {
|
|
13648
13692
|
case "bounded-interval":
|
|
13649
|
-
yield*
|
|
13693
|
+
yield* uv(e, t.first, { citations: n }), yield* uv(e, t.last, { citations: n });
|
|
13650
13694
|
break;
|
|
13651
13695
|
case "counted-interval":
|
|
13652
|
-
yield*
|
|
13696
|
+
yield* uv(e, t.first, { citations: n });
|
|
13653
13697
|
break;
|
|
13654
13698
|
case "enumeration":
|
|
13655
13699
|
case "exclusion":
|
|
13656
|
-
yield*
|
|
13700
|
+
yield* uv(e, t.left, { citations: n }), yield* uv(e, t.right, { citations: n });
|
|
13657
13701
|
break;
|
|
13658
13702
|
case "reference_et_action":
|
|
13659
|
-
if (yield*
|
|
13703
|
+
if (yield* uv(e, t.reference, { citations: n }), n) {
|
|
13660
13704
|
let { originalCitations: r } = t.action;
|
|
13661
13705
|
if (r !== void 0) {
|
|
13662
|
-
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield*
|
|
13706
|
+
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield* uv(e, r, { citations: n });
|
|
13663
13707
|
}
|
|
13664
13708
|
}
|
|
13665
13709
|
break;
|
|
13666
13710
|
default: yield t;
|
|
13667
13711
|
}
|
|
13668
13712
|
}
|
|
13669
|
-
function*
|
|
13713
|
+
function* dv(e, t) {
|
|
13670
13714
|
if (t.type === "texte") console.error(`iterDeepestDivisionsOrArticles must not be called with a text:\n${JSON.stringify(t, null, 2)}`);
|
|
13671
13715
|
else if (dt(t) || t.type === "article") yield t;
|
|
13672
13716
|
else if (!(ft(t) || t.type === "incomplete-header")) switch (t.type) {
|
|
13673
13717
|
case "bounded-interval":
|
|
13674
|
-
yield*
|
|
13718
|
+
yield* dv(e, t.first), yield* dv(e, t.last);
|
|
13675
13719
|
break;
|
|
13676
13720
|
case "counted-interval":
|
|
13677
|
-
yield*
|
|
13721
|
+
yield* dv(e, t.first);
|
|
13678
13722
|
break;
|
|
13679
13723
|
case "enumeration":
|
|
13680
13724
|
case "exclusion":
|
|
13681
|
-
yield*
|
|
13725
|
+
yield* dv(e, t.left), yield* dv(e, t.right);
|
|
13682
13726
|
break;
|
|
13683
13727
|
case "parent-enfant": {
|
|
13684
|
-
let n = [...
|
|
13685
|
-
n.length === 0 ? yield*
|
|
13728
|
+
let n = [...dv(e, t.child)];
|
|
13729
|
+
n.length === 0 ? yield* dv(e, t.parent) : yield* n;
|
|
13686
13730
|
break;
|
|
13687
13731
|
}
|
|
13688
13732
|
case "reference_et_action": {
|
|
13689
|
-
yield*
|
|
13733
|
+
yield* dv(e, t.reference);
|
|
13690
13734
|
let { originalCitations: n } = t.action;
|
|
13691
13735
|
if (n !== void 0) {
|
|
13692
|
-
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield*
|
|
13736
|
+
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield* dv(e, n);
|
|
13693
13737
|
}
|
|
13694
13738
|
break;
|
|
13695
13739
|
}
|
|
13696
13740
|
default: c("iterDeepestDivisionsOrArticles reference.type", t);
|
|
13697
13741
|
}
|
|
13698
13742
|
}
|
|
13699
|
-
function
|
|
13743
|
+
function fv(e) {
|
|
13700
13744
|
return e?.split(":")[0].trim().toLowerCase().split(/\s+/).map((e) => e.trim()).filter((e) => e !== "").join(" ");
|
|
13701
13745
|
}
|
|
13702
|
-
async function*
|
|
13746
|
+
async function* pv({ ancestors: e, legiResolver: t, context: n, date: r, division: i, divisionChildReference: a, logIgnoredReferencesTypes: o, logPartialReferences: s, originalPositionsFromTransformedIterator: c, parentSectionChildren: l, reference: u, state: d }) {
|
|
13703
13747
|
if (i.present) return;
|
|
13704
13748
|
let f;
|
|
13705
13749
|
if (l === void 0 && d.textId !== void 0 && (l = await t.getDirectSectionChildren({
|
|
@@ -13707,20 +13751,20 @@ async function* fv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13707
13751
|
parentPath: d.textId
|
|
13708
13752
|
})), l !== void 0) {
|
|
13709
13753
|
for (let e of l) {
|
|
13710
|
-
let t =
|
|
13754
|
+
let t = fv(e.title);
|
|
13711
13755
|
if (t !== void 0) {
|
|
13712
13756
|
let n = !1;
|
|
13713
|
-
if (i.index !== void 0 && (n =
|
|
13757
|
+
if (i.index !== void 0 && (n = mv(i.type, i.index).some((e) => e === t)), !n && i.num !== void 0 && (n = `${i.type} ${i.num.toLowerCase()}` === t), n) {
|
|
13714
13758
|
f = e;
|
|
13715
13759
|
break;
|
|
13716
13760
|
}
|
|
13717
13761
|
}
|
|
13718
13762
|
}
|
|
13719
13763
|
if (f === void 0 && (f = l.find((e) => {
|
|
13720
|
-
let t =
|
|
13764
|
+
let t = fv(e.title)?.split(/\s+/);
|
|
13721
13765
|
return t !== void 0 && t.length === 2 && ot.includes(t[0]) && t[1] === "législative";
|
|
13722
13766
|
}), f !== void 0)) {
|
|
13723
|
-
let e =
|
|
13767
|
+
let e = fv(f.title).split(/\s+/), t = {
|
|
13724
13768
|
start: i.position.stop,
|
|
13725
13769
|
stop: i.position.stop
|
|
13726
13770
|
}, n = c === void 0 ? void 0 : v(c, t), r = Object.fromEntries(Object.entries({
|
|
@@ -13738,8 +13782,8 @@ async function* fv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13738
13782
|
}).filter(([, e]) => e !== void 0)), i = r;
|
|
13739
13783
|
}
|
|
13740
13784
|
}
|
|
13741
|
-
let p = a === void 0 ? [] : [...
|
|
13742
|
-
if (a !== void 0) for (let l of
|
|
13785
|
+
let p = a === void 0 ? [] : [...dv(n, a.child)], m = 0;
|
|
13786
|
+
if (a !== void 0) for (let l of uv(n, a.child)) {
|
|
13743
13787
|
let h = l.type === "parent-enfant" ? l.parent : l, g = l.type === "parent-enfant" ? l : void 0;
|
|
13744
13788
|
switch (h.type) {
|
|
13745
13789
|
case "alinéa":
|
|
@@ -13747,7 +13791,7 @@ async function* fv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13747
13791
|
case "item":
|
|
13748
13792
|
case "phrase": break;
|
|
13749
13793
|
case "article":
|
|
13750
|
-
yield*
|
|
13794
|
+
yield* cv({
|
|
13751
13795
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13752
13796
|
article: h,
|
|
13753
13797
|
legiResolver: t,
|
|
@@ -13773,7 +13817,7 @@ async function* fv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13773
13817
|
f !== void 0 && (a = await t.getDirectSectionChildren({
|
|
13774
13818
|
date: r,
|
|
13775
13819
|
parentPath: f.path
|
|
13776
|
-
})), yield*
|
|
13820
|
+
})), yield* pv({
|
|
13777
13821
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13778
13822
|
legiResolver: t,
|
|
13779
13823
|
context: n,
|
|
@@ -13811,7 +13855,7 @@ async function* fv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13811
13855
|
}).filter(([, e]) => e !== void 0));
|
|
13812
13856
|
}
|
|
13813
13857
|
}
|
|
13814
|
-
function*
|
|
13858
|
+
function* mv(e, t) {
|
|
13815
13859
|
let n = Math.floor(t), r = Math.floor((t - n) * 1e3);
|
|
13816
13860
|
if (r === 0) {
|
|
13817
13861
|
for (let t of re(n)) yield `${t.toLowerCase()} ${e}`;
|
|
@@ -13821,9 +13865,9 @@ function* pv(e, t) {
|
|
|
13821
13865
|
for (let r of f(n)) yield `${e} ${t} ${r.toLowerCase()}`;
|
|
13822
13866
|
}
|
|
13823
13867
|
}
|
|
13824
|
-
async function*
|
|
13868
|
+
async function* hv({ articleDefinitionByNumByTextId: e, legiResolver: t, context: n, date: r, logIgnoredReferencesTypes: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13825
13869
|
let l = e ?? {}, u = c === void 0 ? {} : c;
|
|
13826
|
-
for (let e of
|
|
13870
|
+
for (let e of uv(n, s)) {
|
|
13827
13871
|
let c = e.type === "parent-enfant" ? e.parent : e, d = e.type === "parent-enfant" ? e : void 0;
|
|
13828
13872
|
switch (c.type) {
|
|
13829
13873
|
case "alinéa":
|
|
@@ -13834,7 +13878,7 @@ async function* mv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13834
13878
|
if (c.definition && u.textId !== void 0) {
|
|
13835
13879
|
let e = l[u.textId]?.[c.num];
|
|
13836
13880
|
e !== void 0 && (e.originalTransformation === void 0 && o !== void 0 && (e.originalTransformation = v(o, e.position)), yield e);
|
|
13837
|
-
} else yield*
|
|
13881
|
+
} else yield* cv({
|
|
13838
13882
|
article: c,
|
|
13839
13883
|
legiResolver: t,
|
|
13840
13884
|
context: n,
|
|
@@ -13855,7 +13899,7 @@ async function* mv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13855
13899
|
case "sous-sous-paragraphe":
|
|
13856
13900
|
case "sous-titre":
|
|
13857
13901
|
case "titre":
|
|
13858
|
-
c.definition && u.textId !== void 0 || (yield*
|
|
13902
|
+
c.definition && u.textId !== void 0 || (yield* pv({
|
|
13859
13903
|
legiResolver: t,
|
|
13860
13904
|
context: n,
|
|
13861
13905
|
date: r,
|
|
@@ -13869,15 +13913,15 @@ async function* mv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13869
13913
|
}));
|
|
13870
13914
|
break;
|
|
13871
13915
|
case "texte": {
|
|
13872
|
-
|
|
13916
|
+
K_({
|
|
13873
13917
|
context: n,
|
|
13874
13918
|
logPartialReferences: a,
|
|
13875
13919
|
reference: s,
|
|
13876
13920
|
state: u,
|
|
13877
13921
|
text: c
|
|
13878
13922
|
});
|
|
13879
|
-
let e = d === void 0 ? [] : [...
|
|
13880
|
-
if (d !== void 0) for (let f of
|
|
13923
|
+
let e = d === void 0 ? [] : [...dv(n, d.child)], l = 0;
|
|
13924
|
+
if (d !== void 0) for (let f of uv(n, d.child)) {
|
|
13881
13925
|
let p = f.type === "parent-enfant" ? f.parent : f, m = f.type === "parent-enfant" ? f : void 0;
|
|
13882
13926
|
switch (p.type) {
|
|
13883
13927
|
case "alinéa":
|
|
@@ -13885,7 +13929,7 @@ async function* mv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13885
13929
|
case "item":
|
|
13886
13930
|
case "phrase": break;
|
|
13887
13931
|
case "article":
|
|
13888
|
-
yield*
|
|
13932
|
+
yield* cv({
|
|
13889
13933
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13890
13934
|
article: p,
|
|
13891
13935
|
legiResolver: t,
|
|
@@ -13911,7 +13955,7 @@ async function* mv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13911
13955
|
u.textId !== void 0 && (d = await t.getDirectSectionChildren({
|
|
13912
13956
|
date: r,
|
|
13913
13957
|
parentPath: u.textId
|
|
13914
|
-
})), yield*
|
|
13958
|
+
})), yield* pv({
|
|
13915
13959
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13916
13960
|
legiResolver: t,
|
|
13917
13961
|
context: n,
|
|
@@ -13962,7 +14006,7 @@ async function* mv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13962
14006
|
if (e !== void 0) {
|
|
13963
14007
|
for (let s of e) if (s.references !== void 0) {
|
|
13964
14008
|
let e = structuredClone(u);
|
|
13965
|
-
for (let c of s.references) yield*
|
|
14009
|
+
for (let c of s.references) yield* hv({
|
|
13966
14010
|
articleDefinitionByNumByTextId: l,
|
|
13967
14011
|
legiResolver: t,
|
|
13968
14012
|
context: n,
|
|
@@ -13979,13 +14023,13 @@ async function* mv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13979
14023
|
}
|
|
13980
14024
|
//#endregion
|
|
13981
14025
|
//#region src/lib/extractors/table_of_contents.ts
|
|
13982
|
-
function
|
|
14026
|
+
function gv(e) {
|
|
13983
14027
|
let t = e;
|
|
13984
14028
|
return t.items ?? [...t.articles ?? [], ...t.divisions ?? []];
|
|
13985
14029
|
}
|
|
13986
|
-
function*
|
|
14030
|
+
function* _v({ context: e, tableOfContents: t, transformation: n }) {
|
|
13987
14031
|
let r = 0, i = _e(n);
|
|
13988
|
-
for (let n of
|
|
14032
|
+
for (let n of yv(t)) {
|
|
13989
14033
|
let t = n.line.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = RegExp(`^${t}$`, "m");
|
|
13990
14034
|
a.lastIndex = r;
|
|
13991
14035
|
let o = a.exec(e.input);
|
|
@@ -13997,7 +14041,7 @@ function* gv({ context: e, tableOfContents: t, transformation: n }) {
|
|
|
13997
14041
|
l.originalTransformation = c, l.position = s, yield l, r = s.stop;
|
|
13998
14042
|
}
|
|
13999
14043
|
}
|
|
14000
|
-
function
|
|
14044
|
+
function vv(e) {
|
|
14001
14045
|
let t = new n(e), r = { items: [] }, i = [];
|
|
14002
14046
|
for (let e of Tn(t)) if (dt(e)) {
|
|
14003
14047
|
let n = i.findIndex(({ type: t }) => t === e.type);
|
|
@@ -14015,14 +14059,22 @@ function _v(e) {
|
|
|
14015
14059
|
else throw Error(`Unexpected type "${e.type}" in definition:\n${JSON.stringify(e, null, 2)}`);
|
|
14016
14060
|
return r;
|
|
14017
14061
|
}
|
|
14018
|
-
function*
|
|
14062
|
+
function* yv(e) {
|
|
14019
14063
|
e.type !== void 0 && (yield e);
|
|
14020
|
-
for (let t of
|
|
14064
|
+
for (let t of gv(e)) t.type === "article" ? yield t : yield* yv(t);
|
|
14021
14065
|
}
|
|
14022
14066
|
//#endregion
|
|
14023
14067
|
//#region src/lib/links.ts
|
|
14024
|
-
var
|
|
14025
|
-
function
|
|
14068
|
+
var bv = ["Exploratrice", "Forgejo"];
|
|
14069
|
+
function xv(e, t, n) {
|
|
14070
|
+
if (n.match(Ke) === null) throw Error(`Unknown ID format: ${n}`);
|
|
14071
|
+
switch (e) {
|
|
14072
|
+
case "Exploratrice": return new URL(`legifrance/articles/${n}/versions`, t).toString();
|
|
14073
|
+
case "Forgejo": return;
|
|
14074
|
+
default: c("urlFromArticleVersionsId linkType", e);
|
|
14075
|
+
}
|
|
14076
|
+
}
|
|
14077
|
+
function Sv(e, t, n) {
|
|
14026
14078
|
let r = n.match(Ke);
|
|
14027
14079
|
if (r === null) throw Error(`Unknown ID format: ${n}`);
|
|
14028
14080
|
switch (e) {
|
|
@@ -14043,19 +14095,19 @@ function bv(e, t, n) {
|
|
|
14043
14095
|
}
|
|
14044
14096
|
//#endregion
|
|
14045
14097
|
//#region src/lib/linkers/html.ts
|
|
14046
|
-
function
|
|
14098
|
+
function Cv(e, t) {
|
|
14047
14099
|
if (e !== void 0) return e;
|
|
14048
|
-
if (t !== void 0) return new
|
|
14100
|
+
if (t !== void 0) return new W_(t);
|
|
14049
14101
|
throw Error("A Canutes database or legal resolver is required");
|
|
14050
14102
|
}
|
|
14051
|
-
function
|
|
14103
|
+
function wv(e, t) {
|
|
14052
14104
|
return t.type === "reference_et_action" ? JSON.stringify({
|
|
14053
14105
|
...e,
|
|
14054
14106
|
action: t.action
|
|
14055
14107
|
}) : JSON.stringify(e);
|
|
14056
14108
|
}
|
|
14057
|
-
async function
|
|
14058
|
-
let h = new xe("addLinksToHtml"), g =
|
|
14109
|
+
async function Tv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl: o, linkType: s, logIgnoredReferencesTypes: l, logPartialReferences: u, logReferences: d, onLink: f, previousContext: p, state: m }) {
|
|
14110
|
+
let h = new xe("addLinksToHtml"), g = Cv(t, e);
|
|
14059
14111
|
await h.time("preloadTextTitlesInfos", () => g.preloadTextTitlesInfos());
|
|
14060
14112
|
let _ = h.timeSync("simplifyHtml", () => a({ removeAWithHref: !0 })(i), {
|
|
14061
14113
|
inputSize: i.length,
|
|
@@ -14064,7 +14116,7 @@ async function Cv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14064
14116
|
v.currentArticle = p?.currentArticle, v.currentText = p?.currentText;
|
|
14065
14117
|
let y = [], ee = { value: 0 }, te = -1;
|
|
14066
14118
|
await h.time("extractTextLinks", async () => {
|
|
14067
|
-
for await (let e of
|
|
14119
|
+
for await (let e of G_({
|
|
14068
14120
|
legiResolver: g,
|
|
14069
14121
|
context: v,
|
|
14070
14122
|
date: r,
|
|
@@ -14077,7 +14129,7 @@ async function Cv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14077
14129
|
case "article_definition": {
|
|
14078
14130
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
14079
14131
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
14080
|
-
|
|
14132
|
+
Dv({
|
|
14081
14133
|
inputHtml: i,
|
|
14082
14134
|
originalTransformation: n,
|
|
14083
14135
|
output: { replacements: y },
|
|
@@ -14087,29 +14139,31 @@ async function Cv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14087
14139
|
break;
|
|
14088
14140
|
}
|
|
14089
14141
|
case "external_article": {
|
|
14090
|
-
let { articleId: t,
|
|
14091
|
-
if (t
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
}
|
|
14100
|
-
|
|
14142
|
+
let { articleId: t, historyArticleId: n, originalTransformation: r } = e;
|
|
14143
|
+
if (t === void 0 && n === void 0) break;
|
|
14144
|
+
if (r === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
14145
|
+
let a = t === void 0 ? xv(s, o, n) : Sv(s, o, t);
|
|
14146
|
+
if (a === void 0) break;
|
|
14147
|
+
let c = t === void 0 ? `class="lien_article_historique" href="${a}" title="Versions de l'article"` : `class="lien_article_externe" href="${a}"`;
|
|
14148
|
+
Dv({
|
|
14149
|
+
inputHtml: i,
|
|
14150
|
+
originalTransformation: r,
|
|
14151
|
+
output: { replacements: y },
|
|
14152
|
+
replacementCounter: ee,
|
|
14153
|
+
tagHtmlFromOriginal: (e) => `<a ${c}>${e}</a>`
|
|
14154
|
+
});
|
|
14101
14155
|
break;
|
|
14102
14156
|
}
|
|
14103
14157
|
case "external_division": {
|
|
14104
14158
|
let { originalTransformation: t, sectionTaId: n } = e;
|
|
14105
14159
|
if (n !== void 0) {
|
|
14106
14160
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
14107
|
-
|
|
14161
|
+
Dv({
|
|
14108
14162
|
inputHtml: i,
|
|
14109
14163
|
originalTransformation: t,
|
|
14110
14164
|
output: { replacements: y },
|
|
14111
14165
|
replacementCounter: ee,
|
|
14112
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${
|
|
14166
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${Sv(s, o, n)}">${e}</a>`
|
|
14113
14167
|
});
|
|
14114
14168
|
}
|
|
14115
14169
|
break;
|
|
@@ -14121,12 +14175,12 @@ async function Cv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14121
14175
|
continue;
|
|
14122
14176
|
}
|
|
14123
14177
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14124
|
-
|
|
14178
|
+
Dv({
|
|
14125
14179
|
inputHtml: i,
|
|
14126
14180
|
originalTransformation: t,
|
|
14127
14181
|
output: { replacements: y },
|
|
14128
14182
|
replacementCounter: ee,
|
|
14129
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${
|
|
14183
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${Sv(s, o, n.cid)}">${e}</a>`
|
|
14130
14184
|
});
|
|
14131
14185
|
break;
|
|
14132
14186
|
}
|
|
@@ -14134,7 +14188,7 @@ async function Cv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14134
14188
|
let { url: t, originalTransformation: n } = e;
|
|
14135
14189
|
if (t === void 0) continue;
|
|
14136
14190
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(e, null, 2)}`);
|
|
14137
|
-
|
|
14191
|
+
Dv({
|
|
14138
14192
|
inputHtml: i,
|
|
14139
14193
|
originalTransformation: n,
|
|
14140
14194
|
output: { replacements: y },
|
|
@@ -14146,7 +14200,7 @@ async function Cv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14146
14200
|
case "internal_article": {
|
|
14147
14201
|
let { definition: t, originalTransformation: n } = e;
|
|
14148
14202
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
14149
|
-
|
|
14203
|
+
Dv({
|
|
14150
14204
|
inputHtml: i,
|
|
14151
14205
|
originalTransformation: n,
|
|
14152
14206
|
output: { replacements: y },
|
|
@@ -14158,7 +14212,7 @@ async function Cv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14158
14212
|
default: c("Link", e);
|
|
14159
14213
|
}
|
|
14160
14214
|
}, { count: te + 1 });
|
|
14161
|
-
let ne = h.timeSync("applyHtmlReplacements", () =>
|
|
14215
|
+
let ne = h.timeSync("applyHtmlReplacements", () => Ev(i, y), {
|
|
14162
14216
|
count: y.length,
|
|
14163
14217
|
inputSize: i.length
|
|
14164
14218
|
});
|
|
@@ -14170,13 +14224,13 @@ async function Cv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14170
14224
|
output: y.length === 0 ? null : ne
|
|
14171
14225
|
};
|
|
14172
14226
|
}
|
|
14173
|
-
function
|
|
14227
|
+
function Ev(e, t) {
|
|
14174
14228
|
if (t.length === 0) return e;
|
|
14175
14229
|
let n = [], r = 0;
|
|
14176
14230
|
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);
|
|
14177
14231
|
return n.push(e.slice(r)), n.join("");
|
|
14178
14232
|
}
|
|
14179
|
-
function
|
|
14233
|
+
function Dv({ inputHtml: e, originalTransformation: t, output: n, replacementCounter: r, tagHtmlFromOriginal: i }) {
|
|
14180
14234
|
let a = d(t, i(s(e, t, 0) ?? ""));
|
|
14181
14235
|
n.replacements.push({
|
|
14182
14236
|
order: r.value++,
|
|
@@ -14185,11 +14239,11 @@ function Tv({ inputHtml: e, originalTransformation: t, output: n, replacementCou
|
|
|
14185
14239
|
stop: t.position.stop
|
|
14186
14240
|
});
|
|
14187
14241
|
}
|
|
14188
|
-
function
|
|
14242
|
+
function Ov({ attributes: e, inputHtml: t, originalTransformation: n, outputByType: r, replacementCounter: i }) {
|
|
14189
14243
|
let a = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
14190
14244
|
for (let e of ["links", "links_or_references"]) {
|
|
14191
14245
|
let o = r[e];
|
|
14192
|
-
o !== void 0 &&
|
|
14246
|
+
o !== void 0 && Dv({
|
|
14193
14247
|
inputHtml: t,
|
|
14194
14248
|
originalTransformation: n,
|
|
14195
14249
|
output: o,
|
|
@@ -14198,11 +14252,11 @@ function Ev({ attributes: e, inputHtml: t, originalTransformation: n, outputByTy
|
|
|
14198
14252
|
});
|
|
14199
14253
|
}
|
|
14200
14254
|
}
|
|
14201
|
-
function
|
|
14255
|
+
function kv({ id: e, outputByType: t }) {
|
|
14202
14256
|
return t.references !== void 0 || e === void 0 && t.links_or_references !== void 0;
|
|
14203
14257
|
}
|
|
14204
|
-
async function
|
|
14205
|
-
let h =
|
|
14258
|
+
async function Av({ 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 }) {
|
|
14259
|
+
let h = Cv(t, e);
|
|
14206
14260
|
await h.preloadTextTitlesInfos();
|
|
14207
14261
|
let g = new n(a.output), _ = {}, v = {};
|
|
14208
14262
|
for (let e of p) v[e] = {
|
|
@@ -14211,7 +14265,7 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14211
14265
|
replacements: []
|
|
14212
14266
|
};
|
|
14213
14267
|
let y = { value: 0 };
|
|
14214
|
-
for await (let e of
|
|
14268
|
+
for await (let e of G_({
|
|
14215
14269
|
legiResolver: h,
|
|
14216
14270
|
context: g,
|
|
14217
14271
|
date: r,
|
|
@@ -14224,7 +14278,7 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14224
14278
|
case "article_definition": {
|
|
14225
14279
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
14226
14280
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
14227
|
-
for (let e of Object.values(v))
|
|
14281
|
+
for (let e of Object.values(v)) Dv({
|
|
14228
14282
|
inputHtml: o,
|
|
14229
14283
|
originalTransformation: n,
|
|
14230
14284
|
output: e,
|
|
@@ -14234,33 +14288,48 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14234
14288
|
break;
|
|
14235
14289
|
}
|
|
14236
14290
|
case "external_article": {
|
|
14237
|
-
let { article: t, articleId: n,
|
|
14238
|
-
if (
|
|
14239
|
-
if (n !== void 0
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
|
|
14244
|
-
|
|
14245
|
-
|
|
14246
|
-
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14291
|
+
let { article: t, articleId: n, historyArticleId: r, originalTransformation: i } = e;
|
|
14292
|
+
if (i === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
14293
|
+
if (n !== void 0) {
|
|
14294
|
+
if (Ov({
|
|
14295
|
+
attributes: {
|
|
14296
|
+
class: "lien_article_externe",
|
|
14297
|
+
href: Sv(l, s, n)
|
|
14298
|
+
},
|
|
14299
|
+
inputHtml: o,
|
|
14300
|
+
originalTransformation: i,
|
|
14301
|
+
outputByType: v,
|
|
14302
|
+
replacementCounter: y
|
|
14303
|
+
}), m) {
|
|
14304
|
+
let e = await h.getTextIdFromSegmentId(n);
|
|
14305
|
+
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
14306
|
+
}
|
|
14307
|
+
} else if (r !== void 0) {
|
|
14308
|
+
let e = xv(l, s, r);
|
|
14309
|
+
e !== void 0 && Ov({
|
|
14310
|
+
attributes: {
|
|
14311
|
+
class: "lien_article_historique",
|
|
14312
|
+
href: e,
|
|
14313
|
+
title: "Versions de l'article"
|
|
14314
|
+
},
|
|
14315
|
+
inputHtml: o,
|
|
14316
|
+
originalTransformation: i,
|
|
14317
|
+
outputByType: v,
|
|
14318
|
+
replacementCounter: y
|
|
14319
|
+
});
|
|
14251
14320
|
}
|
|
14252
|
-
|
|
14321
|
+
kv({
|
|
14253
14322
|
id: n,
|
|
14254
14323
|
outputByType: v
|
|
14255
|
-
}) &&
|
|
14324
|
+
}) && jv({
|
|
14256
14325
|
attributes: {
|
|
14257
14326
|
class: "reference_article",
|
|
14258
14327
|
style: "background-color: #eae462",
|
|
14259
|
-
title:
|
|
14328
|
+
title: wv(t, e.reference)
|
|
14260
14329
|
},
|
|
14261
14330
|
id: n,
|
|
14262
14331
|
inputHtml: o,
|
|
14263
|
-
originalTransformation:
|
|
14332
|
+
originalTransformation: i,
|
|
14264
14333
|
outputByType: v,
|
|
14265
14334
|
replacementCounter: y
|
|
14266
14335
|
});
|
|
@@ -14269,10 +14338,10 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14269
14338
|
case "external_division": {
|
|
14270
14339
|
let { division: t, originalTransformation: n, sectionTaId: r } = e;
|
|
14271
14340
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
14272
|
-
if (r !== void 0 && (
|
|
14341
|
+
if (r !== void 0 && (Ov({
|
|
14273
14342
|
attributes: {
|
|
14274
14343
|
class: "lien_division_externe",
|
|
14275
|
-
href:
|
|
14344
|
+
href: Sv(l, s, r)
|
|
14276
14345
|
},
|
|
14277
14346
|
inputHtml: o,
|
|
14278
14347
|
originalTransformation: n,
|
|
@@ -14282,14 +14351,14 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14282
14351
|
let e = await h.getTextIdFromSegmentId(r);
|
|
14283
14352
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
14284
14353
|
}
|
|
14285
|
-
|
|
14354
|
+
kv({
|
|
14286
14355
|
id: r,
|
|
14287
14356
|
outputByType: v
|
|
14288
|
-
}) &&
|
|
14357
|
+
}) && jv({
|
|
14289
14358
|
attributes: {
|
|
14290
14359
|
class: "reference_division",
|
|
14291
14360
|
style: "background-color: #eae462",
|
|
14292
|
-
title:
|
|
14361
|
+
title: wv(t, e.reference)
|
|
14293
14362
|
},
|
|
14294
14363
|
id: r,
|
|
14295
14364
|
inputHtml: o,
|
|
@@ -14302,7 +14371,7 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14302
14371
|
case "european_text": {
|
|
14303
14372
|
let { url: t, originalTransformation: n, text: r, titleId: i } = e;
|
|
14304
14373
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14305
|
-
|
|
14374
|
+
Ov({
|
|
14306
14375
|
attributes: {
|
|
14307
14376
|
class: "lien_texte_european",
|
|
14308
14377
|
href: t,
|
|
@@ -14312,14 +14381,14 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14312
14381
|
originalTransformation: n,
|
|
14313
14382
|
outputByType: v,
|
|
14314
14383
|
replacementCounter: y
|
|
14315
|
-
}),
|
|
14384
|
+
}), kv({
|
|
14316
14385
|
id: i,
|
|
14317
14386
|
outputByType: v
|
|
14318
|
-
}) &&
|
|
14387
|
+
}) && jv({
|
|
14319
14388
|
attributes: {
|
|
14320
14389
|
class: "reference_texte",
|
|
14321
14390
|
style: "background-color: #eae462",
|
|
14322
|
-
title:
|
|
14391
|
+
title: wv(r, e.reference)
|
|
14323
14392
|
},
|
|
14324
14393
|
id: i,
|
|
14325
14394
|
inputHtml: o,
|
|
@@ -14332,23 +14401,23 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14332
14401
|
case "external_text": {
|
|
14333
14402
|
let { originalTransformation: t, text: n } = e;
|
|
14334
14403
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14335
|
-
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (
|
|
14404
|
+
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (Ov({
|
|
14336
14405
|
attributes: {
|
|
14337
14406
|
class: "lien_texte_externe",
|
|
14338
|
-
href:
|
|
14407
|
+
href: Sv(l, s, n.cid)
|
|
14339
14408
|
},
|
|
14340
14409
|
inputHtml: o,
|
|
14341
14410
|
originalTransformation: t,
|
|
14342
14411
|
outputByType: v,
|
|
14343
14412
|
replacementCounter: y
|
|
14344
|
-
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)),
|
|
14413
|
+
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)), kv({
|
|
14345
14414
|
id: n.cid,
|
|
14346
14415
|
outputByType: v
|
|
14347
|
-
}) &&
|
|
14416
|
+
}) && jv({
|
|
14348
14417
|
attributes: {
|
|
14349
14418
|
class: "reference_texte",
|
|
14350
14419
|
style: "background-color: #eae462",
|
|
14351
|
-
title:
|
|
14420
|
+
title: wv(n, e.reference)
|
|
14352
14421
|
},
|
|
14353
14422
|
id: n.cid,
|
|
14354
14423
|
inputHtml: o,
|
|
@@ -14361,7 +14430,7 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14361
14430
|
case "internal_article": {
|
|
14362
14431
|
let { definition: t, originalTransformation: n } = e;
|
|
14363
14432
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
14364
|
-
for (let e of Object.values(v))
|
|
14433
|
+
for (let e of Object.values(v)) Dv({
|
|
14365
14434
|
inputHtml: o,
|
|
14366
14435
|
originalTransformation: n,
|
|
14367
14436
|
output: e,
|
|
@@ -14372,18 +14441,18 @@ async function Ov({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14372
14441
|
}
|
|
14373
14442
|
default: c("Link", e);
|
|
14374
14443
|
}
|
|
14375
|
-
for (let e of Object.values(v)) e.html =
|
|
14444
|
+
for (let e of Object.values(v)) e.html = Ev(o, e.replacements);
|
|
14376
14445
|
return {
|
|
14377
14446
|
outputByType: v,
|
|
14378
14447
|
referredLegifranceTextCountByCid: _
|
|
14379
14448
|
};
|
|
14380
14449
|
}
|
|
14381
|
-
function
|
|
14450
|
+
function jv({ attributes: e, id: t, inputHtml: n, originalTransformation: r, outputByType: i, replacementCounter: a }) {
|
|
14382
14451
|
let o = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
14383
14452
|
for (let e of ["links_or_references", "references"]) {
|
|
14384
14453
|
if (e === "links_or_references" && t !== void 0) continue;
|
|
14385
14454
|
let s = i[e];
|
|
14386
|
-
s !== void 0 &&
|
|
14455
|
+
s !== void 0 && Dv({
|
|
14387
14456
|
inputHtml: n,
|
|
14388
14457
|
originalTransformation: r,
|
|
14389
14458
|
output: s,
|
|
@@ -14393,4 +14462,4 @@ function kv({ attributes: e, id: t, inputHtml: n, originalTransformation: r, out
|
|
|
14393
14462
|
}
|
|
14394
14463
|
}
|
|
14395
14464
|
//#endregion
|
|
14396
|
-
export {
|
|
14465
|
+
export { bp as $, Vm as A, D as At, ym as B, dt as Bt, Ph as C, Dt as Ct, qm as D, mt as Dt, Ym as E, Ot as Et, Lm as F, ot as Ft, $ as G, vm as H, st as Ht, Rm as I, rt as It, Zp as J, Kp as K, Am as L, it as Lt, Wm as M, xt as Mt, Gm as N, tt as Nt, Km as O, ht as Ot, zm as P, nt as Pt, yp as Q, Om as R, at as Rt, Fh as S, Vt as St, Jm as T, zt as Tt, gm as U, lt as Ut, _m as V, ft as Vt, lm as W, ct as Wt, jp as X, Gp as Y, Rp as Z, A_ as _, Xt as _t, Sv as a, xn as at, Xh as b, Yt as bt, gv as c, gn as ct, hv as d, tn as dt, Wp as et, W_ as f, rn as ft, L_ as g, Qt as gt, j_ as h, sn as ht, xv as i, vn as it, Um as j, O as jt, Bm as k, _t as kt, yv as l, fn as lt, R_ as m, nn as mt, Tv as n, Tn as nt, _v as o, wn as ot, k_ as p, an as pt, qp as q, bv as r, _n as rt, vv as s, pn as st, Av as t, dp as tt, G_ as u, un as ut, eg as v, qt as vt, Qm as w, Rt as wt, Jh as x, Bt as xt, Yh as y, Jt as yt, Em as z, ut as zt };
|