@tricoteuses/tisseuse 0.14.11 → 0.14.12
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 +3 -1
- package/dist/{html-zrF2u7Vr.js → html-Bos7PYtS.js} +656 -598
- package/dist/index.js +1 -1
- package/dist/server.js +1 -1
- package/dist/src/lib/text_parsers/legal_text_aliases.d.ts +8 -0
- package/dist/src/scripts/add_links_to_senat_comptes_rendus.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10589,15 +10589,26 @@ var Qp = [
|
|
|
10589
10589
|
nature: "CODE",
|
|
10590
10590
|
title: "Code des postes et des communications électroniques"
|
|
10591
10591
|
}
|
|
10592
|
-
}
|
|
10592
|
+
}, nm = Qp.map(({ cid: e, title: t }) => ({
|
|
10593
|
+
cid: e,
|
|
10594
|
+
normalizedTitle: t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/gu, "").replace(/\s+/gu, " ").trim()
|
|
10595
|
+
}));
|
|
10596
|
+
function rm(e) {
|
|
10597
|
+
let t = e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/gu, "").replace(/\s+/gu, " ").trim(), n = $p.find(({ regExp: e }) => e.test(t));
|
|
10598
|
+
if (n !== void 0) return n.alias.cid;
|
|
10599
|
+
let r = t.match(/^(?:le\s+|la\s+|du\s+|de\s+la\s+|de\s+l')?(code\b.+)$/);
|
|
10600
|
+
if (r === null || r[1] === void 0) return;
|
|
10601
|
+
let i = r[1], a = nm.filter(({ normalizedTitle: e }) => e.startsWith(i));
|
|
10602
|
+
return a.length === 1 ? a[0].cid : void 0;
|
|
10603
|
+
}
|
|
10593
10604
|
new Set([...Qp.map(({ cid: e }) => e), ...Object.values(tm).map(({ cid: e }) => e)]);
|
|
10594
|
-
var
|
|
10605
|
+
var im = [{
|
|
10595
10606
|
info: tm.execution,
|
|
10596
10607
|
regExp: /code\s+des?\s+proc[eé]dures?\s+(?:civiles?\s+)?d['’]\s*ex(?:c)?[eé]cution/giu
|
|
10597
10608
|
}, {
|
|
10598
10609
|
info: tm.postes,
|
|
10599
10610
|
regExp: /code\s+des\s+postes\s+et\s+(?:des?\s+)?communications?\s+[eé]lectroniques?/giu
|
|
10600
|
-
}],
|
|
10611
|
+
}], am = `(?:${[...Qp.map(({ pattern: e }) => `(?:${e})`), em].join("|")})`, om = {
|
|
10601
10612
|
I: {
|
|
10602
10613
|
cid: "LEGITEXT000006069568",
|
|
10603
10614
|
nature: "CODE",
|
|
@@ -10619,9 +10630,9 @@ var nm = [{
|
|
|
10619
10630
|
title: "Code général des impôts, annexe IV"
|
|
10620
10631
|
}
|
|
10621
10632
|
};
|
|
10622
|
-
function
|
|
10633
|
+
function sm(e, t) {
|
|
10623
10634
|
let n = [];
|
|
10624
|
-
for (let { info: r, regExp: i } of
|
|
10635
|
+
for (let { info: r, regExp: i } of im) {
|
|
10625
10636
|
i.lastIndex = 0;
|
|
10626
10637
|
for (let a of e.matchAll(i)) a.index <= t.start && n.push({
|
|
10627
10638
|
index: a.index,
|
|
@@ -10630,8 +10641,8 @@ function am(e, t) {
|
|
|
10630
10641
|
}
|
|
10631
10642
|
return n.sort((e, t) => t.index - e.index), n[0]?.info;
|
|
10632
10643
|
}
|
|
10633
|
-
function
|
|
10634
|
-
if (/^cpce$/iv.test(e)) return t === void 0 ? void 0 :
|
|
10644
|
+
function cm(e, t) {
|
|
10645
|
+
if (/^cpce$/iv.test(e)) return t === void 0 ? void 0 : sm(t.input, t.position);
|
|
10635
10646
|
let n = $p.find(({ regExp: t }) => t.test(e))?.alias;
|
|
10636
10647
|
if (n === void 0) return;
|
|
10637
10648
|
let { cid: r, nature: i, title: a } = n;
|
|
@@ -10641,15 +10652,15 @@ function om(e, t) {
|
|
|
10641
10652
|
title: a
|
|
10642
10653
|
};
|
|
10643
10654
|
}
|
|
10644
|
-
function
|
|
10655
|
+
function lm(e, t) {
|
|
10645
10656
|
return e.cid === "LEGITEXT000006070716" && t !== void 0 && /^[LR]\d/u.test(t) ? {
|
|
10646
10657
|
...tm.execution,
|
|
10647
10658
|
position: e.position,
|
|
10648
10659
|
type: "texte"
|
|
10649
10660
|
} : e;
|
|
10650
10661
|
}
|
|
10651
|
-
function
|
|
10652
|
-
let r =
|
|
10662
|
+
function um(e, t, n) {
|
|
10663
|
+
let r = cm(e, n === void 0 ? void 0 : {
|
|
10653
10664
|
input: n,
|
|
10654
10665
|
position: t
|
|
10655
10666
|
});
|
|
@@ -10659,39 +10670,39 @@ function cm(e, t, n) {
|
|
|
10659
10670
|
type: "texte"
|
|
10660
10671
|
};
|
|
10661
10672
|
}
|
|
10662
|
-
var
|
|
10673
|
+
var dm = T(...Qp.map(({ pattern: e }) => C(`${e}(?=$|\\P{Alphabetic})`, {
|
|
10663
10674
|
flags: "iv",
|
|
10664
|
-
value: (e, t) =>
|
|
10675
|
+
value: (e, t) => um(e[0], t.position(), t.input)
|
|
10665
10676
|
})), C(`${em}(?=$|\\P{Alphabetic})`, {
|
|
10666
10677
|
flags: "iv",
|
|
10667
|
-
value: (e, t) =>
|
|
10678
|
+
value: (e, t) => um(e[0], t.position(), t.input)
|
|
10668
10679
|
}));
|
|
10669
10680
|
//#endregion
|
|
10670
10681
|
//#region src/lib/text_parsers/doctrinal_references.ts
|
|
10671
|
-
function
|
|
10682
|
+
function fm(e, t) {
|
|
10672
10683
|
let n = e.indices?.groups?.[t];
|
|
10673
10684
|
return n === void 0 ? void 0 : {
|
|
10674
10685
|
start: n[0],
|
|
10675
10686
|
stop: n[1]
|
|
10676
10687
|
};
|
|
10677
10688
|
}
|
|
10678
|
-
function
|
|
10689
|
+
function pm(e) {
|
|
10679
10690
|
let t = e.match(/^(?<article>.*\d(?:[\p{L}\d-]*))\s+(?<subdivision>[IVXLCDM]+(?:\s+(?:bis|ter|quater))?|\d+\s*(?:°|º|er|e|ème))$/iu)?.groups?.article?.trim() ?? e;
|
|
10680
10691
|
return {
|
|
10681
10692
|
num: Jt(t),
|
|
10682
10693
|
parsedArticleText: t
|
|
10683
10694
|
};
|
|
10684
10695
|
}
|
|
10685
|
-
function
|
|
10696
|
+
function mm(e, t) {
|
|
10686
10697
|
let n = e.groups?.article?.trim(), r = e.groups?.text;
|
|
10687
10698
|
if (n === void 0 || r === void 0) return;
|
|
10688
|
-
let i =
|
|
10699
|
+
let i = fm(e, "articleKeyword");
|
|
10689
10700
|
if (i === void 0 && !/^(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d/iu.test(n)) return;
|
|
10690
|
-
let { num: a, parsedArticleText: o } =
|
|
10701
|
+
let { num: a, parsedArticleText: o } = pm(n), s = fm(e, "article"), c = fm(e, "text");
|
|
10691
10702
|
if (a === void 0 || s === void 0 || c === void 0) return;
|
|
10692
|
-
let l =
|
|
10703
|
+
let l = um(r, c, t.input);
|
|
10693
10704
|
if (l === void 0) return;
|
|
10694
|
-
let u =
|
|
10705
|
+
let u = lm(l, a), d = {
|
|
10695
10706
|
num: a,
|
|
10696
10707
|
position: {
|
|
10697
10708
|
start: i?.start ?? s.start,
|
|
@@ -10709,17 +10720,17 @@ function fm(e, t) {
|
|
|
10709
10720
|
type: "parent-enfant"
|
|
10710
10721
|
};
|
|
10711
10722
|
}
|
|
10712
|
-
var
|
|
10723
|
+
var hm = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
10713
10724
|
flags: "i",
|
|
10714
10725
|
value: (e, t) => {
|
|
10715
|
-
let n =
|
|
10726
|
+
let n = om[e[1].toUpperCase()];
|
|
10716
10727
|
return n === void 0 ? void 0 : {
|
|
10717
10728
|
...n,
|
|
10718
10729
|
position: t.position(),
|
|
10719
10730
|
type: "texte"
|
|
10720
10731
|
};
|
|
10721
10732
|
}
|
|
10722
|
-
}),
|
|
10733
|
+
}), gm = o(Qt, { value: (e, t) => {
|
|
10723
10734
|
let n = t.position(), r = t.text(n), i = r.match(/^(?<article>.*\d(?:[\p{L}\d-]*))\s+\d+\s*(?:°|º|er|e|ème)$/iu)?.groups?.article?.trim() ?? r;
|
|
10724
10735
|
return {
|
|
10725
10736
|
num: Jt(i),
|
|
@@ -10729,25 +10740,25 @@ var pm = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
|
10729
10740
|
},
|
|
10730
10741
|
type: "article"
|
|
10731
10742
|
};
|
|
10732
|
-
} }),
|
|
10743
|
+
} }), _m = x([C(String.raw`\s*,\s*art(?:icle)?\.?\s+`, { flags: "i" }), gm], { value: (e) => e[1] }), vm = x([
|
|
10733
10744
|
w(C(String.raw`(?:le|la|les)\s+`, { flags: "i" }), { default: "" }),
|
|
10734
|
-
T(
|
|
10735
|
-
|
|
10745
|
+
T(hm, dm),
|
|
10746
|
+
_m
|
|
10736
10747
|
], { value: (e, t) => {
|
|
10737
10748
|
let n = e[2];
|
|
10738
10749
|
return {
|
|
10739
10750
|
child: n,
|
|
10740
|
-
parent:
|
|
10751
|
+
parent: lm(e[1], n.num),
|
|
10741
10752
|
position: t.position(),
|
|
10742
10753
|
type: "parent-enfant"
|
|
10743
10754
|
};
|
|
10744
|
-
} }),
|
|
10755
|
+
} }), ym = C(String.raw`(?:(?<articleKeyword>articles?)\s+)?(?<article>\S[^\n,;:\(\)]*?)\s+(?:(?:du|de\s+la|de\s+l['’])\s+)?(?<text>${am})(?=$|\P{Alphabetic})`, {
|
|
10745
10756
|
flags: "div",
|
|
10746
|
-
value: (e, t) =>
|
|
10747
|
-
}),
|
|
10757
|
+
value: (e, t) => mm(e, t)
|
|
10758
|
+
}), bm = C(String.raw`(?<article1>(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d[^\n,;:\(\)]*?)\s+(?<coordinator>et|ou)\s+(?<article2>(?:(?:L\.?\s*O|[LRDA])\*?\.?\s*)\d[^\n,;:\(\)]*?)\s+(?:(?:du|de\s+la|de\s+l['’])\s+)?(?<text>${am})(?=$|\P{Alphabetic})`, {
|
|
10748
10759
|
flags: "div",
|
|
10749
10760
|
value: (e, t) => {
|
|
10750
|
-
let n =
|
|
10761
|
+
let n = fm(e, "article1"), r = fm(e, "article2"), i = fm(e, "text"), a = e.groups?.article1, o = e.groups?.article2, s = e.groups?.coordinator, c = a === void 0 ? void 0 : Jt(a.trim()), l = o === void 0 ? void 0 : Jt(o.trim()), u = e.groups?.text === void 0 || i === void 0 ? void 0 : um(e.groups.text, i, t.input);
|
|
10751
10762
|
if (!(n === void 0 || r === void 0 || c === void 0 || l === void 0 || s !== "et" && s !== "ou" || u === void 0)) return {
|
|
10752
10763
|
child: {
|
|
10753
10764
|
coordinator: s,
|
|
@@ -10767,7 +10778,7 @@ var pm = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
|
10767
10778
|
},
|
|
10768
10779
|
type: "enumeration"
|
|
10769
10780
|
},
|
|
10770
|
-
parent:
|
|
10781
|
+
parent: lm(lm(u, c), l),
|
|
10771
10782
|
position: {
|
|
10772
10783
|
start: n.start,
|
|
10773
10784
|
stop: u.position.stop
|
|
@@ -10775,7 +10786,7 @@ var pm = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
|
10775
10786
|
type: "parent-enfant"
|
|
10776
10787
|
};
|
|
10777
10788
|
}
|
|
10778
|
-
}),
|
|
10789
|
+
}), xm = T(vm, bm, ym), Sm = (e) => {
|
|
10779
10790
|
let t = e.offset, n = /,\s*(?:par\s+)?/guy;
|
|
10780
10791
|
if (n.lastIndex = t, !n.exec(e.input)) return;
|
|
10781
10792
|
e.offset = n.lastIndex;
|
|
@@ -10791,7 +10802,7 @@ var pm = C(String.raw`cgi\s*,\s*ann(?:exe)?\.?\s*(IV|III|II|I)`, {
|
|
|
10791
10802
|
}
|
|
10792
10803
|
return e.offset = i.lastIndex, e.length = 0, e.usedInputs = e.input.slice(t, e.offset), r;
|
|
10793
10804
|
};
|
|
10794
|
-
function
|
|
10805
|
+
function Cm(e) {
|
|
10795
10806
|
for (let t = 0; t < e.length; t += 1) {
|
|
10796
10807
|
let r = t === 0 ? void 0 : e[t - 1];
|
|
10797
10808
|
if (r && /[\p{L}\p{N}_]/u.test(r)) continue;
|
|
@@ -10800,7 +10811,7 @@ function xm(e) {
|
|
|
10800
10811
|
}
|
|
10801
10812
|
return null;
|
|
10802
10813
|
}
|
|
10803
|
-
function
|
|
10814
|
+
function wm(e, t) {
|
|
10804
10815
|
let r = e.slice(0, Math.max(0, t)), i = /(?:^|[^\p{L}\p{N}_])les\s+/giu, a = null;
|
|
10805
10816
|
for (; i.exec(r) !== null;) {
|
|
10806
10817
|
let e = new n(r, i.lastIndex), t = Ae(e);
|
|
@@ -10808,7 +10819,7 @@ function Sm(e, t) {
|
|
|
10808
10819
|
}
|
|
10809
10820
|
return a;
|
|
10810
10821
|
}
|
|
10811
|
-
function
|
|
10822
|
+
function Tm(e) {
|
|
10812
10823
|
let t = [], r = /(?:,\s*)?par\s+/giu, i = 0, a;
|
|
10813
10824
|
for (; (a = r.exec(e)) !== null;) {
|
|
10814
10825
|
let o = new n(e, r.lastIndex);
|
|
@@ -10820,17 +10831,17 @@ function Cm(e) {
|
|
|
10820
10831
|
}
|
|
10821
10832
|
//#endregion
|
|
10822
10833
|
//#region src/lib/text_parsers/actions.ts
|
|
10823
|
-
var
|
|
10834
|
+
var Em = (e) => x([
|
|
10824
10835
|
C(e, { flags: "i" }),
|
|
10825
|
-
|
|
10836
|
+
Sm,
|
|
10826
10837
|
C(e === "est" ? "remplacée?" : "remplacée?s", { flags: "i" })
|
|
10827
|
-
], { value: "remplacer" }),
|
|
10838
|
+
], { value: "remplacer" }), Dm = T(ee(C("(modalités|conditions) d'application (de )?", { flags: "i" }), {
|
|
10828
10839
|
lookbackLength: 35,
|
|
10829
10840
|
value: { action: "précision" }
|
|
10830
10841
|
}), ee(C("en application (de )?", { flags: "i" }), {
|
|
10831
10842
|
lookbackLength: 35,
|
|
10832
10843
|
value: { action: "application" }
|
|
10833
|
-
})),
|
|
10844
|
+
})), Om = i("après|avant|ajoutée?s?|insérée?s?|complétée?s?|rédigée?s?|suit|modifiée?s?|rétablie?s?|remplacée?s?|supprimée?s?|abrogée?s?|devient", T(x([
|
|
10834
10845
|
b,
|
|
10835
10846
|
C("est complété par les mots ?", { flags: "i" }),
|
|
10836
10847
|
C(" ?:"),
|
|
@@ -10898,7 +10909,7 @@ var wm = (e) => x([
|
|
|
10898
10909
|
}), C("est rétablie? (ainsi qu'il|comme) suit", {
|
|
10899
10910
|
flags: "i",
|
|
10900
10911
|
value: "rétablir"
|
|
10901
|
-
}),
|
|
10912
|
+
}), Em("est"), C("est remplacée?", {
|
|
10902
10913
|
flags: "i",
|
|
10903
10914
|
value: "remplacer"
|
|
10904
10915
|
}), C("sont ainsi modifiée?s", {
|
|
@@ -10913,7 +10924,7 @@ var wm = (e) => x([
|
|
|
10913
10924
|
}), C("sont rétablie?s (ainsi qu'il|comme) suit", {
|
|
10914
10925
|
flags: "i",
|
|
10915
10926
|
value: "rétablir"
|
|
10916
|
-
}),
|
|
10927
|
+
}), Em("sont"), C("sont remplacée?s", {
|
|
10917
10928
|
flags: "i",
|
|
10918
10929
|
value: "remplacer"
|
|
10919
10930
|
}), C("sont renum[eé]rotée?s", {
|
|
@@ -10933,7 +10944,7 @@ var wm = (e) => x([
|
|
|
10933
10944
|
}), C("est remplacée?", {
|
|
10934
10945
|
flags: "i",
|
|
10935
10946
|
value: "remplacer"
|
|
10936
|
-
}),
|
|
10947
|
+
}), Em("est"), Em("sont"), C("sont remplacée?s", {
|
|
10937
10948
|
flags: "i",
|
|
10938
10949
|
value: "remplacer"
|
|
10939
10950
|
}), C("est modifiée?", {
|
|
@@ -11093,23 +11104,23 @@ var wm = (e) => x([
|
|
|
11093
11104
|
}), C("est supprimée?", {
|
|
11094
11105
|
flags: "i",
|
|
11095
11106
|
value: "supprimer"
|
|
11096
|
-
}))], { value: (e) => ({ action: e[1] }) }))),
|
|
11107
|
+
}))], { value: (e) => ({ action: e[1] }) }))), km = T(un, wn), Am = T(fn, xn, dm, he), jm = x([km, _(x([le, Am], { value: (e) => e[1] }))], { value: (e, t) => _t(e[0], e[1], t.position()) }), Mm = x([Am, _(x([le, Am], { value: (e) => e[1] }))], { value: (e, t) => _t(e[0], e[1], t.position()) }), Nm = x([se, jm], { value: (e) => e[1] }), Pm = T(x([le, Mm], { value: (e) => e[1] }), Nm), Fm = T(x([Ht, w(Pm, { default: null })], { value: (e) => {
|
|
11097
11108
|
let t = e[0], n = e[1];
|
|
11098
11109
|
return n === null ? t : mt(n, t);
|
|
11099
|
-
} }),
|
|
11110
|
+
} }), jm), Im = T(x([Ut, w(Pm, { default: null })], { value: (e) => {
|
|
11100
11111
|
let t = e[0], n = e[1];
|
|
11101
11112
|
return n === null ? t : mt(n, t);
|
|
11102
|
-
} }),
|
|
11103
|
-
w(
|
|
11113
|
+
} }), Mm), Lm = x([
|
|
11114
|
+
w(Dm, { default: null }),
|
|
11104
11115
|
x([
|
|
11105
11116
|
p,
|
|
11106
|
-
|
|
11117
|
+
Fm,
|
|
11107
11118
|
w([w(C(" modifiée?s", { flags: "i" }), { default: "" }), C(" susvisée?s", { flags: "i" })], { default: "" })
|
|
11108
11119
|
], { value: (e, t) => ({
|
|
11109
11120
|
...e[1],
|
|
11110
11121
|
position: t.position()
|
|
11111
11122
|
}) }),
|
|
11112
|
-
w(
|
|
11123
|
+
w(Om, { default: null })
|
|
11113
11124
|
], { value: (e, t) => {
|
|
11114
11125
|
let n = e[2] ?? e[0];
|
|
11115
11126
|
return n === null ? e[1] : {
|
|
@@ -11118,18 +11129,18 @@ var wm = (e) => x([
|
|
|
11118
11129
|
reference: e[1],
|
|
11119
11130
|
type: "reference_et_action"
|
|
11120
11131
|
};
|
|
11121
|
-
} }),
|
|
11122
|
-
w(
|
|
11132
|
+
} }), Rm = T(x([
|
|
11133
|
+
w(Dm, { default: null }),
|
|
11123
11134
|
x([
|
|
11124
11135
|
ce,
|
|
11125
|
-
|
|
11136
|
+
Im,
|
|
11126
11137
|
w([w(C(" modifiée?", { flags: "i" }), { default: "" }), C(" susvisée?", { flags: "i" })], { default: "" }),
|
|
11127
11138
|
w(C(String.raw`, ?qui devient [^,]+ ","`, { flags: "i" }), { default: "" })
|
|
11128
11139
|
], { value: (e, t) => ({
|
|
11129
11140
|
...e[1],
|
|
11130
11141
|
position: t.position()
|
|
11131
11142
|
}) }),
|
|
11132
|
-
w(
|
|
11143
|
+
w(Om, { default: null })
|
|
11133
11144
|
], { value: (e, t) => {
|
|
11134
11145
|
let n = e[2] ?? e[0];
|
|
11135
11146
|
return n === null ? e[1] : {
|
|
@@ -11138,23 +11149,23 @@ var wm = (e) => x([
|
|
|
11138
11149
|
reference: e[1],
|
|
11139
11150
|
type: "reference_et_action"
|
|
11140
11151
|
};
|
|
11141
|
-
} }),
|
|
11152
|
+
} }), Lm), zm = i("article|loi|décret|code|alinéa|phrase|chapitre|titre|livre|partie|section|paragraphe|ordonnance|constitution|directive|règlement|\\d|[ivxlc]+|[a-zA-Z]", x([Rm, _([T(Ct, St), Rm])], { value: (e, t) => ht(e[0], e[1], t.position()) })), Bm = o(Im, { value: (e, t) => ({
|
|
11142
11153
|
...e,
|
|
11143
11154
|
position: t.position()
|
|
11144
|
-
}) }),
|
|
11155
|
+
}) }), Vm = T(_(Bm, {
|
|
11145
11156
|
min: 2,
|
|
11146
11157
|
separator: Ne,
|
|
11147
11158
|
value: (e) => [e[0], ...e.slice(1).map(([, e]) => e)]
|
|
11148
|
-
}), _(
|
|
11159
|
+
}), _(Bm, {
|
|
11149
11160
|
min: 2,
|
|
11150
11161
|
separator: C(String.raw`\n`),
|
|
11151
11162
|
value: (e) => [e[0], ...e.slice(1).map(([, e]) => e)]
|
|
11152
|
-
}), o(
|
|
11163
|
+
}), o(Bm, { value: (e) => [e] }));
|
|
11153
11164
|
//#endregion
|
|
11154
11165
|
//#region src/lib/extractors/references.ts
|
|
11155
|
-
function*
|
|
11166
|
+
function* Hm(e, t) {
|
|
11156
11167
|
let r = Xp(e, t), i = new n(r.output), a = _e(r);
|
|
11157
|
-
for (let e of
|
|
11168
|
+
for (let e of Wm(i)) {
|
|
11158
11169
|
e = structuredClone(e), t.references === void 0 && (t.references = []), t.references.push(e);
|
|
11159
11170
|
for (let t of xt(e)) {
|
|
11160
11171
|
let e = t.position;
|
|
@@ -11163,132 +11174,132 @@ function* Bm(e, t) {
|
|
|
11163
11174
|
yield e;
|
|
11164
11175
|
}
|
|
11165
11176
|
}
|
|
11166
|
-
function*
|
|
11167
|
-
yield*
|
|
11177
|
+
function* Um(e, t = {}) {
|
|
11178
|
+
yield* Wm(e, t);
|
|
11168
11179
|
}
|
|
11169
|
-
function*
|
|
11170
|
-
let n = i(String.raw`arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+`, T($, tn, _n,
|
|
11180
|
+
function* Wm(e, t = {}) {
|
|
11181
|
+
let n = i(String.raw`arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+`, T($, tn, _n, xm, zm), 80, String.raw`(?<=^|\P{Alphabetic})(?:arrêtés?|circulaires?|code|constitution|décrets?(?:-loi)?|loi|ordonnance|art\.|articles?|chapitre|livre|paragraphe|partie|section|sous-paragraphe|sous-section|sous-sous-paragraphe|sous-titre|titre|alinéas?|phrases?|règlements?|directives?|décisions?|«|[IVXLCDM]+|[A-Z]|\d+)(?=$|\P{Alphabetic})`);
|
|
11171
11182
|
for (let r of n.extract(e, {
|
|
11172
11183
|
overlapWindow: 80,
|
|
11173
11184
|
overlapWindowForCandidate: t.overlapWindowForCandidate
|
|
11174
|
-
})) if (r !== void 0) if (r.type === "citation") yield*
|
|
11185
|
+
})) if (r !== void 0) if (r.type === "citation") yield* Hm(e, r);
|
|
11175
11186
|
else {
|
|
11176
11187
|
if (r.type === "reference_et_action" || r.type === "alinéa" || r.type === "article" || r.type === "chapitre" || r.type === "item" || r.type === "livre" || r.type === "paragraphe" || r.type === "partie" || r.type === "phrase" || r.type === "section" || r.type === "sous-paragraphe" || r.type === "sous-section" || r.type === "sous-sous-paragraphe" || r.type === "sous-titre" || r.type === "titre" || r.type === "texte" || r.type === "bounded-interval" || r.type === "counted-interval" || r.type === "enumeration" || r.type === "exclusion" || r.type === "parent-enfant" || r.type === "incomplete-header") {
|
|
11177
11188
|
for (let t of xt(r)) if (t.type === "reference_et_action") {
|
|
11178
11189
|
let { originalCitations: n } = t.action;
|
|
11179
|
-
if (n !== void 0) for (let t of n) for (let n of
|
|
11190
|
+
if (n !== void 0) for (let t of n) for (let n of Hm(e, t));
|
|
11180
11191
|
}
|
|
11181
11192
|
}
|
|
11182
11193
|
yield r;
|
|
11183
11194
|
}
|
|
11184
11195
|
}
|
|
11185
|
-
function*
|
|
11196
|
+
function* Gm(e, t) {
|
|
11186
11197
|
let n = _e(t);
|
|
11187
|
-
for (let t of
|
|
11198
|
+
for (let t of Um(e)) {
|
|
11188
11199
|
for (let e of xt(t, { citations: !0 })) e.position !== void 0 && (e.originalTransformation = v(n, e.position));
|
|
11189
11200
|
yield t;
|
|
11190
11201
|
}
|
|
11191
11202
|
}
|
|
11192
|
-
var
|
|
11203
|
+
var Km = (e) => [...Um(e)], qm = (e, t) => [...Gm(e, t)], Jm = "(?:avant|apr[eè]s)", Ym = T(C("avant(?![-A-Za-zÀ-ÖØ-öø-ÿ0-9_])", {
|
|
11193
11204
|
flags: "i",
|
|
11194
11205
|
value: "before"
|
|
11195
11206
|
}), C("apr[eè]s(?![-A-Za-zÀ-ÖØ-öø-ÿ0-9_])", {
|
|
11196
11207
|
flags: "i",
|
|
11197
11208
|
value: "after"
|
|
11198
|
-
})),
|
|
11209
|
+
})), Xm = T(C("(?:au|a[uù])\\s+d[eé]but\\b", {
|
|
11199
11210
|
flags: "i",
|
|
11200
11211
|
value: "start"
|
|
11201
11212
|
}), C("(?:a|à)\\s+la\\s+fin\\b", {
|
|
11202
11213
|
flags: "i",
|
|
11203
11214
|
value: "end"
|
|
11204
11215
|
}));
|
|
11205
|
-
function
|
|
11216
|
+
function Zm(e) {
|
|
11206
11217
|
return e === "before" ? "insert_before" : "insert_after";
|
|
11207
11218
|
}
|
|
11208
|
-
function
|
|
11209
|
-
let t =
|
|
11219
|
+
function Qm(e) {
|
|
11220
|
+
let t = $m(e), n = /(?:^|[^\p{L}\p{N}_-])(avant|apres)(?![\p{L}\p{N}_-])/u.exec(t);
|
|
11210
11221
|
return n ? n[1] === "avant" ? "before" : "after" : null;
|
|
11211
11222
|
}
|
|
11212
|
-
function
|
|
11223
|
+
function $m(e) {
|
|
11213
11224
|
return e.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
11214
11225
|
}
|
|
11215
11226
|
//#endregion
|
|
11216
11227
|
//#region src/lib/text_parsers/action_words.ts
|
|
11217
|
-
var
|
|
11218
|
-
function
|
|
11228
|
+
var eh = /\b(ins[èe]re|ins[ée]r[ée]|ajout|remplac|supprim|abrog|compl[èeé]t|r[ée]dig|r[ée]tabl|modifi(?:e|é|ée|és|ées|er|ant|ent))/iu;
|
|
11229
|
+
function th(e) {
|
|
11219
11230
|
return e.toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "");
|
|
11220
11231
|
}
|
|
11221
|
-
function
|
|
11232
|
+
function nh(e, t = e) {
|
|
11222
11233
|
return /\bredige\b|\bredigee\b|\bredigees\b|\brediges\b|\bainsi\b/.test(e) || /\bdispositions suivantes\b/.test(t);
|
|
11223
11234
|
}
|
|
11224
|
-
function
|
|
11225
|
-
return
|
|
11235
|
+
function rh(e) {
|
|
11236
|
+
return Qm(e) === "after";
|
|
11226
11237
|
}
|
|
11227
|
-
function
|
|
11228
|
-
return
|
|
11238
|
+
function ih(e) {
|
|
11239
|
+
return Qm(e) === "before";
|
|
11229
11240
|
}
|
|
11230
|
-
function
|
|
11241
|
+
function ah(e) {
|
|
11231
11242
|
return /\bretabl/.test(e);
|
|
11232
11243
|
}
|
|
11233
|
-
function
|
|
11244
|
+
function oh(e) {
|
|
11234
11245
|
return /\binsere(?:e|es|s)?\b|\bajoute\b|\bajoutee\b|\bajoutes\b|\bajoutees\b|\bcomplete(?:e|es|s)?\b/.test(e);
|
|
11235
11246
|
}
|
|
11236
|
-
function
|
|
11247
|
+
function sh(e) {
|
|
11237
11248
|
return /\bremplace\b|\bremplacee\b|\bremplaces\b|\bremplacees\b/.test(e);
|
|
11238
11249
|
}
|
|
11239
|
-
function
|
|
11250
|
+
function ch(e) {
|
|
11240
11251
|
return /\bsupprime\b|\bsupprimee\b|\bsupprimes\b|\bsupprimees\b|\babroge\b|\babrogee\b|\babroges\b|\babrogees\b/.test(e);
|
|
11241
11252
|
}
|
|
11242
|
-
function
|
|
11253
|
+
function lh(e) {
|
|
11243
11254
|
return /\b(remplace|modifie|redige|rediges|redigee|redigees)\b/.test(e);
|
|
11244
11255
|
}
|
|
11245
11256
|
//#endregion
|
|
11246
11257
|
//#region src/lib/extractors/portion_references.ts
|
|
11247
|
-
function
|
|
11258
|
+
function uh(e, t) {
|
|
11248
11259
|
e && (e.start += t, e.stop += t);
|
|
11249
11260
|
}
|
|
11250
|
-
function
|
|
11261
|
+
function dh(e, t) {
|
|
11251
11262
|
if (e.type === "parent-enfant") {
|
|
11252
|
-
|
|
11263
|
+
dh(e.parent, t), dh(e.child, t), uh(e.position, t);
|
|
11253
11264
|
return;
|
|
11254
11265
|
}
|
|
11255
11266
|
if (e.type === "bounded-interval") {
|
|
11256
|
-
|
|
11267
|
+
dh(e.first, t), dh(e.last, t), uh(e.position, t);
|
|
11257
11268
|
return;
|
|
11258
11269
|
}
|
|
11259
11270
|
if (e.type === "counted-interval") {
|
|
11260
|
-
|
|
11271
|
+
dh(e.first, t), uh(e.position, t);
|
|
11261
11272
|
return;
|
|
11262
11273
|
}
|
|
11263
11274
|
if (e.type === "enumeration" || e.type === "exclusion") {
|
|
11264
|
-
|
|
11275
|
+
dh(e.left, t), dh(e.right, t), uh(e.position, t);
|
|
11265
11276
|
return;
|
|
11266
11277
|
}
|
|
11267
11278
|
if (e.type === "reference_et_action") {
|
|
11268
|
-
|
|
11279
|
+
dh(e.reference, t), uh(e.position, t);
|
|
11269
11280
|
return;
|
|
11270
11281
|
}
|
|
11271
|
-
|
|
11282
|
+
uh(e.position, t);
|
|
11272
11283
|
}
|
|
11273
|
-
function
|
|
11284
|
+
function fh(e) {
|
|
11274
11285
|
return e.replace(/\b(de\s+l['’]?|de\s+la|de\s+le|du|des)\s*$/i, "");
|
|
11275
11286
|
}
|
|
11276
|
-
function
|
|
11287
|
+
function ph(e) {
|
|
11277
11288
|
let t = /^(?:(?:[aà]\s+)?l['’]|(?:[aà]\s+)?la\b|(?:[aà]\s+)?le\b|les\b|des\b|aux\b|du\b)\s*/iu.exec(e)?.[0].length ?? 0, n = e.slice(t > 0 ? t : 0).trim();
|
|
11278
11289
|
return n ? {
|
|
11279
11290
|
text: n,
|
|
11280
11291
|
offset: t
|
|
11281
11292
|
} : null;
|
|
11282
11293
|
}
|
|
11283
|
-
function
|
|
11294
|
+
function mh(e) {
|
|
11284
11295
|
return [...e.matchAll(/(?:^|\P{L})(\p{L})/gu)].map((e) => (e.index ?? 0) + e[0].length - (e[1]?.length ?? 0));
|
|
11285
11296
|
}
|
|
11286
|
-
function
|
|
11297
|
+
function hh(e) {
|
|
11287
11298
|
let t = new n(e), r = Rt(t);
|
|
11288
11299
|
return !r || t.remaining().trim().length !== 0 ? null : r;
|
|
11289
11300
|
}
|
|
11290
|
-
function
|
|
11291
|
-
for (let t of
|
|
11301
|
+
function gh(e) {
|
|
11302
|
+
for (let t of mh(e)) {
|
|
11292
11303
|
let r = new n(e, t), i = Et(r);
|
|
11293
11304
|
if (!(i === void 0 || r.remaining().trim() !== "")) return {
|
|
11294
11305
|
nature: i,
|
|
@@ -11297,17 +11308,17 @@ function mh(e) {
|
|
|
11297
11308
|
}
|
|
11298
11309
|
return null;
|
|
11299
11310
|
}
|
|
11300
|
-
function
|
|
11311
|
+
function _h(e, t) {
|
|
11301
11312
|
let n = e.trim().replace(/[;:,]\s*$/u, "").replace(/\b(?:est|sont)\s*$/iu, "").trim();
|
|
11302
11313
|
if (!n) return null;
|
|
11303
|
-
for (let e of
|
|
11304
|
-
let r = n.slice(e).trim(), i =
|
|
11314
|
+
for (let e of mh(n)) {
|
|
11315
|
+
let r = n.slice(e).trim(), i = gh(r);
|
|
11305
11316
|
if (!i) continue;
|
|
11306
|
-
let a =
|
|
11317
|
+
let a = Tm(r.slice(0, i.start)).trim();
|
|
11307
11318
|
if (!a) continue;
|
|
11308
11319
|
let o = /\s*(,|\bet\b|\bou\b|(?<!\p{L})[aà](?!\p{L}))\s*/giu, s = [], c = 0, l;
|
|
11309
11320
|
for (; (l = o.exec(a)) !== null;) {
|
|
11310
|
-
let e =
|
|
11321
|
+
let e = th(l[1] ?? "");
|
|
11311
11322
|
if (a.slice(c, l.index).trim() === "") {
|
|
11312
11323
|
e !== "a" && e !== "à" && (c = o.lastIndex);
|
|
11313
11324
|
continue;
|
|
@@ -11324,17 +11335,17 @@ function hh(e, t) {
|
|
|
11324
11335
|
}), s.length < 2) continue;
|
|
11325
11336
|
let u = s.some((e) => e.separator === "à"), d = [], f = [], p = !0, m = i.nature, h;
|
|
11326
11337
|
for (let [n, r] of s.entries()) {
|
|
11327
|
-
let i =
|
|
11338
|
+
let i = ph(r.text);
|
|
11328
11339
|
if (!i) {
|
|
11329
11340
|
d.length = 0;
|
|
11330
11341
|
break;
|
|
11331
11342
|
}
|
|
11332
|
-
let a =
|
|
11343
|
+
let a = hh(`${i.text} ${m}`);
|
|
11333
11344
|
if (!a) {
|
|
11334
11345
|
d.length = 0;
|
|
11335
11346
|
break;
|
|
11336
11347
|
}
|
|
11337
|
-
|
|
11348
|
+
dh(a, t + e + r.start + i.offset), d.push(a), a.type !== m || a.index === void 0 || a.index < 1 ? p = !1 : (h !== void 0 && !u && a.index !== h + 1 && (p = !1), h = a.index), n < s.length - 1 && (f.push(r.separator ?? "et"), (r.separator ?? "et") === "ou" && (p = !1));
|
|
11338
11349
|
}
|
|
11339
11350
|
let [g, ..._] = d;
|
|
11340
11351
|
if (!g || _.length === 0) continue;
|
|
@@ -11351,16 +11362,16 @@ function hh(e, t) {
|
|
|
11351
11362
|
}
|
|
11352
11363
|
return null;
|
|
11353
11364
|
}
|
|
11354
|
-
function
|
|
11365
|
+
function vh(e, t) {
|
|
11355
11366
|
let r = e.trim().replace(/[;:,]\s*$/u, "").replace(/\b(?:est|sont)\s*$/iu, "").trim();
|
|
11356
11367
|
if (!r) return null;
|
|
11357
|
-
for (let e of
|
|
11368
|
+
for (let e of mh(r)) {
|
|
11358
11369
|
let i = r.slice(e);
|
|
11359
11370
|
if (!i) continue;
|
|
11360
11371
|
let a = new n(i), o = Rt(a);
|
|
11361
11372
|
if (!o || a.offset === 0 || !se(a)) continue;
|
|
11362
|
-
let s = a.offset, c =
|
|
11363
|
-
if (c) return
|
|
11373
|
+
let s = a.offset, c = _h(i.slice(s), t + e + s);
|
|
11374
|
+
if (c) return dh(o, t + e), {
|
|
11364
11375
|
...mt(c, o),
|
|
11365
11376
|
position: {
|
|
11366
11377
|
start: o.position.start,
|
|
@@ -11370,57 +11381,57 @@ function gh(e, t) {
|
|
|
11370
11381
|
}
|
|
11371
11382
|
return null;
|
|
11372
11383
|
}
|
|
11373
|
-
function
|
|
11374
|
-
let r =
|
|
11384
|
+
function yh(e, t) {
|
|
11385
|
+
let r = fh(e);
|
|
11375
11386
|
if (!r) return null;
|
|
11376
|
-
let i =
|
|
11387
|
+
let i = vh(r, t);
|
|
11377
11388
|
if (i) return i;
|
|
11378
|
-
let a =
|
|
11389
|
+
let a = _h(r, t);
|
|
11379
11390
|
if (a) return a;
|
|
11380
|
-
for (let e of
|
|
11391
|
+
for (let e of mh(r)) {
|
|
11381
11392
|
let i = r.slice(e);
|
|
11382
11393
|
if (!i) continue;
|
|
11383
11394
|
let a = new n(i), o = Rt(a);
|
|
11384
|
-
if (!(!o || a.offset === 0) && i.slice(a.offset).trim().length === 0) return
|
|
11395
|
+
if (!(!o || a.offset === 0) && i.slice(a.offset).trim().length === 0) return dh(o, t + e), o;
|
|
11385
11396
|
}
|
|
11386
11397
|
return null;
|
|
11387
11398
|
}
|
|
11388
|
-
function
|
|
11399
|
+
function bh(e) {
|
|
11389
11400
|
return Math.max(0, ...Rp(e).map((e) => e.kind === "single" ? e.steps.length : Math.max(e.first.length, e.last.length)));
|
|
11390
11401
|
}
|
|
11391
|
-
function
|
|
11402
|
+
function xh(e) {
|
|
11392
11403
|
return Rp(e).length;
|
|
11393
11404
|
}
|
|
11394
|
-
function
|
|
11405
|
+
function Sh(e, t) {
|
|
11395
11406
|
if (!e) return t;
|
|
11396
11407
|
if (!t) return e;
|
|
11397
|
-
let n =
|
|
11398
|
-
return n === r ?
|
|
11408
|
+
let n = bh(e), r = bh(t);
|
|
11409
|
+
return n === r ? xh(e) >= xh(t) ? e : t : n > r ? e : t;
|
|
11399
11410
|
}
|
|
11400
|
-
function
|
|
11411
|
+
function Ch(e) {
|
|
11401
11412
|
return e.map((e) => ({
|
|
11402
11413
|
reference: e,
|
|
11403
|
-
specificity:
|
|
11414
|
+
specificity: bh(e)
|
|
11404
11415
|
})).filter((e) => e.specificity > 0).sort((e, t) => t.specificity - e.specificity)[0]?.reference ?? null;
|
|
11405
11416
|
}
|
|
11406
|
-
function
|
|
11417
|
+
function wh(e, { actionIndex: t = e.length } = {}) {
|
|
11407
11418
|
let r = /\barticle\b/i.exec(e);
|
|
11408
11419
|
if (!r || r.index === void 0) return null;
|
|
11409
11420
|
let i = r.index, a = new n(e.slice(i)), o = fn(a);
|
|
11410
11421
|
if (!o) return null;
|
|
11411
|
-
|
|
11412
|
-
let s = e.slice(0, i), c = i + a.offset, l = e.slice(c, t), u =
|
|
11422
|
+
dh(o, i);
|
|
11423
|
+
let s = e.slice(0, i), c = i + a.offset, l = e.slice(c, t), u = Sh(Ch(Th(s)), yh(s, 0)) ?? Ch(Th(l)) ?? yh(l, c);
|
|
11413
11424
|
return u ? mt(o, u) : null;
|
|
11414
11425
|
}
|
|
11415
|
-
function
|
|
11416
|
-
return
|
|
11426
|
+
function Th(e) {
|
|
11427
|
+
return Km(new n(e));
|
|
11417
11428
|
}
|
|
11418
11429
|
//#endregion
|
|
11419
11430
|
//#region src/lib/extractors/quoted_text.ts
|
|
11420
|
-
function
|
|
11431
|
+
function Eh(e) {
|
|
11421
11432
|
return e.split(/\n+/).map((e) => e.replace(/^\s*[«“"]\s*/u, "").trim()).filter((e) => e.length > 0).join("\n").replace(/[»”"]\s*$/u, "").trim();
|
|
11422
11433
|
}
|
|
11423
|
-
function
|
|
11434
|
+
function Dh(e) {
|
|
11424
11435
|
let t = [], r = 0;
|
|
11425
11436
|
for (; r < e.length;) {
|
|
11426
11437
|
let i = e.indexOf("«", r);
|
|
@@ -11432,7 +11443,7 @@ function Th(e) {
|
|
|
11432
11443
|
r = i + 1;
|
|
11433
11444
|
continue;
|
|
11434
11445
|
}
|
|
11435
|
-
let s =
|
|
11446
|
+
let s = Eh(Zp(e, o)), c = o.position ?? {
|
|
11436
11447
|
start: i,
|
|
11437
11448
|
stop: i + 1
|
|
11438
11449
|
};
|
|
@@ -11446,7 +11457,7 @@ function Th(e) {
|
|
|
11446
11457
|
}
|
|
11447
11458
|
return t;
|
|
11448
11459
|
}
|
|
11449
|
-
function
|
|
11460
|
+
function Oh(e, t) {
|
|
11450
11461
|
if (t.length === 0) return e;
|
|
11451
11462
|
let n = 0, r = [];
|
|
11452
11463
|
for (let { start: i, end: a } of t) {
|
|
@@ -11455,7 +11466,7 @@ function Eh(e, t) {
|
|
|
11455
11466
|
}
|
|
11456
11467
|
return n < e.length && r.push(e.slice(n)), r.join("");
|
|
11457
11468
|
}
|
|
11458
|
-
function
|
|
11469
|
+
function kh(e) {
|
|
11459
11470
|
let t = [], n = 0;
|
|
11460
11471
|
for (; n < e.length;) {
|
|
11461
11472
|
let r = e.indexOf("«", n);
|
|
@@ -11475,13 +11486,13 @@ function Dh(e) {
|
|
|
11475
11486
|
}
|
|
11476
11487
|
return t;
|
|
11477
11488
|
}
|
|
11478
|
-
function
|
|
11489
|
+
function Ah(e, t) {
|
|
11479
11490
|
return e ? t.some((t) => e.start >= t.start && e.stop <= t.end) : !1;
|
|
11480
11491
|
}
|
|
11481
|
-
function
|
|
11482
|
-
return
|
|
11492
|
+
function jh(e, t) {
|
|
11493
|
+
return Ah(e, t);
|
|
11483
11494
|
}
|
|
11484
|
-
function
|
|
11495
|
+
function Mh(e) {
|
|
11485
11496
|
if (!e.includes("«")) return e;
|
|
11486
11497
|
let t = e.split(""), n = !1;
|
|
11487
11498
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -11500,10 +11511,10 @@ function Ah(e) {
|
|
|
11500
11511
|
}
|
|
11501
11512
|
//#endregion
|
|
11502
11513
|
//#region src/lib/text_parsers/action_citation_patterns.ts
|
|
11503
|
-
function
|
|
11514
|
+
function Nh(e) {
|
|
11504
11515
|
return `(?:${e.join("|")})`;
|
|
11505
11516
|
}
|
|
11506
|
-
var
|
|
11517
|
+
var Ph = [
|
|
11507
11518
|
"(?:à\\s+|de\\s+)?l[’']année",
|
|
11508
11519
|
"(?:à\\s+|de\\s+)?la date",
|
|
11509
11520
|
"(?:à\\s+|de\\s+)?la mention",
|
|
@@ -11521,7 +11532,7 @@ var Mh = [
|
|
|
11521
11532
|
"(?:aux|des|les)\\s+nombres",
|
|
11522
11533
|
"(?:aux|des|les)\\s+références",
|
|
11523
11534
|
"le tableau intitulé"
|
|
11524
|
-
],
|
|
11535
|
+
], Fh = [
|
|
11525
11536
|
"l[’']année",
|
|
11526
11537
|
"la date",
|
|
11527
11538
|
"la mention",
|
|
@@ -11539,10 +11550,10 @@ var Mh = [
|
|
|
11539
11550
|
"les mots",
|
|
11540
11551
|
"les nombres",
|
|
11541
11552
|
"les références"
|
|
11542
|
-
],
|
|
11553
|
+
], Ih = Nh(Ph), Lh = Nh(Fh);
|
|
11543
11554
|
//#endregion
|
|
11544
11555
|
//#region src/lib/text_parsers/action_directives.ts
|
|
11545
|
-
function
|
|
11556
|
+
function Rh(e) {
|
|
11546
11557
|
return e.type === "reference_et_action" ? {
|
|
11547
11558
|
action: e.action,
|
|
11548
11559
|
reference: e.reference
|
|
@@ -11551,7 +11562,7 @@ function Ih(e) {
|
|
|
11551
11562
|
reference: e
|
|
11552
11563
|
};
|
|
11553
11564
|
}
|
|
11554
|
-
function
|
|
11565
|
+
function zh(e) {
|
|
11555
11566
|
let t = e.indices?.[0]?.[0] ?? e.index, n = /« ?(.*?) ?»/dg, r = [], i;
|
|
11556
11567
|
for (; (i = n.exec(e[0])) !== null;) {
|
|
11557
11568
|
let e = i.indices?.[1], n = i.indices?.[0];
|
|
@@ -11567,21 +11578,21 @@ function Lh(e) {
|
|
|
11567
11578
|
}
|
|
11568
11579
|
return r;
|
|
11569
11580
|
}
|
|
11570
|
-
var
|
|
11571
|
-
C(`${
|
|
11581
|
+
var Bh = x([
|
|
11582
|
+
C(`${Ih}s?`, { flags: "i" }),
|
|
11572
11583
|
C(" ?: ?"),
|
|
11573
11584
|
$
|
|
11574
|
-
], { value: (e) => e[2] }),
|
|
11575
|
-
C(`${
|
|
11585
|
+
], { value: (e) => e[2] }), Vh = x([
|
|
11586
|
+
C(`${Lh}s?(?: suivant(?:e)?s?)?`, { flags: "i" }),
|
|
11576
11587
|
C(" ?: ?"),
|
|
11577
11588
|
$
|
|
11578
|
-
], { value: (e) => e[2] }),
|
|
11589
|
+
], { value: (e) => e[2] }), Hh = x([
|
|
11579
11590
|
b,
|
|
11580
|
-
|
|
11591
|
+
Bh,
|
|
11581
11592
|
S,
|
|
11582
11593
|
T(C("est remplacée? par", { flags: "i" }), C("sont remplacée?s par", { flags: "i" })),
|
|
11583
11594
|
S,
|
|
11584
|
-
|
|
11595
|
+
Vh
|
|
11585
11596
|
], { value: (e) => ({
|
|
11586
11597
|
action: {
|
|
11587
11598
|
action: "remplacer",
|
|
@@ -11592,9 +11603,9 @@ var Rh = x([
|
|
|
11592
11603
|
replacementCitation: e[5],
|
|
11593
11604
|
targetCitation: e[1]
|
|
11594
11605
|
}
|
|
11595
|
-
}) }),
|
|
11606
|
+
}) }), Uh = T(C(`(?:, ?| )(?:${Ih}s? ?: ?« ?[^»]+ ?»(?: ?(?:,|et) ?)*)+(?:est|sont) (?:supprimée?s?|abrogée?s?)`, {
|
|
11596
11607
|
flags: "di",
|
|
11597
|
-
value: (e) =>
|
|
11608
|
+
value: (e) => zh(e).map((e) => ({
|
|
11598
11609
|
action: {
|
|
11599
11610
|
action: "supprimer",
|
|
11600
11611
|
actionInContent: !0
|
|
@@ -11606,8 +11617,8 @@ var Rh = x([
|
|
|
11606
11617
|
}))
|
|
11607
11618
|
}), x([
|
|
11608
11619
|
b,
|
|
11609
|
-
|
|
11610
|
-
_([C("(?:, ?| et )"),
|
|
11620
|
+
Bh,
|
|
11621
|
+
_([C("(?:, ?| et )"), Bh], { value: (e) => e.map((e) => e[1]) }),
|
|
11611
11622
|
S,
|
|
11612
11623
|
T(C("est supprimée?", { flags: "i" }), C("sont supprimée?s", { flags: "i" }), C("est abrogée?", { flags: "i" }), C("sont abrogée?s", { flags: "i" }))
|
|
11613
11624
|
], { value: (e) => [e[1], ...e[2] ?? []].map((e) => ({
|
|
@@ -11619,9 +11630,9 @@ var Rh = x([
|
|
|
11619
11630
|
kind: "delete",
|
|
11620
11631
|
targetCitation: e
|
|
11621
11632
|
}
|
|
11622
|
-
})) })),
|
|
11633
|
+
})) })), Wh = T(x([
|
|
11623
11634
|
b,
|
|
11624
|
-
|
|
11635
|
+
Ym,
|
|
11625
11636
|
S,
|
|
11626
11637
|
C("(?:la référence|la mention|le mot|les mots|le signe)", { flags: "i" }),
|
|
11627
11638
|
C(" ?: ?"),
|
|
@@ -11637,10 +11648,10 @@ var Rh = x([
|
|
|
11637
11648
|
},
|
|
11638
11649
|
operation: {
|
|
11639
11650
|
insertCitation: e[9],
|
|
11640
|
-
kind:
|
|
11651
|
+
kind: Zm(e[1]),
|
|
11641
11652
|
targetCitation: e[5]
|
|
11642
11653
|
}
|
|
11643
|
-
}) }),
|
|
11654
|
+
}) }), Hh, Uh, x([
|
|
11644
11655
|
b,
|
|
11645
11656
|
T(C("est ainsi rédigée?", { flags: "i" }), C("sont ainsi rédigée?s", { flags: "i" }), C("est rédigée? (?:ainsi qu'il|comme) suit", { flags: "i" }), C("sont rédigée?s (?:ainsi qu'il|comme) suit", { flags: "i" })),
|
|
11646
11657
|
C(" ?: ?"),
|
|
@@ -11655,27 +11666,27 @@ var Rh = x([
|
|
|
11655
11666
|
replacementCitation: e[3],
|
|
11656
11667
|
replacementKind: "text"
|
|
11657
11668
|
}
|
|
11658
|
-
}) })),
|
|
11669
|
+
}) })), Gh = T(Wh, x([C(" et"), Wh], { value: (e) => e[1] })), Kh = w(T(x([
|
|
11659
11670
|
S,
|
|
11660
11671
|
C("par", { flags: "i" }),
|
|
11661
11672
|
S,
|
|
11662
|
-
|
|
11673
|
+
Vh
|
|
11663
11674
|
], { value: (e) => ({
|
|
11664
11675
|
citation: e[3],
|
|
11665
11676
|
kind: "replace"
|
|
11666
|
-
}) }), x([S,
|
|
11677
|
+
}) }), x([S, Vh], { value: (e) => ({
|
|
11667
11678
|
citation: e[1],
|
|
11668
11679
|
kind: "insert"
|
|
11669
11680
|
}) })), { default: null });
|
|
11670
|
-
function
|
|
11681
|
+
function qh(e) {
|
|
11671
11682
|
return typeof e == "object" && !!e && "action" in e && "operation" in e;
|
|
11672
11683
|
}
|
|
11673
|
-
function
|
|
11684
|
+
function Jh(e) {
|
|
11674
11685
|
let t = [];
|
|
11675
|
-
for (let n of e)
|
|
11686
|
+
for (let n of e) qh(n) ? t.push(n) : Array.isArray(n) && t.push(...Jh(n));
|
|
11676
11687
|
return t;
|
|
11677
11688
|
}
|
|
11678
|
-
function
|
|
11689
|
+
function Yh(e, t) {
|
|
11679
11690
|
if (!e) return [];
|
|
11680
11691
|
let n = e.originalCitations ?? [];
|
|
11681
11692
|
if (e.action === "remplacer") {
|
|
@@ -11723,12 +11734,12 @@ function qh(e, t) {
|
|
|
11723
11734
|
}
|
|
11724
11735
|
return [];
|
|
11725
11736
|
}
|
|
11726
|
-
var
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
_(
|
|
11737
|
+
var Xh = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e?s?|ajout[eé]e?s?|rédigée?s?", x([
|
|
11738
|
+
zm,
|
|
11739
|
+
Kh,
|
|
11740
|
+
_(Gh, { value: (e) => Jh(e) })
|
|
11730
11741
|
], { value: (e, t) => {
|
|
11731
|
-
let { action: n, reference: r } =
|
|
11742
|
+
let { action: n, reference: r } = Rh(e[0]), i = [...Yh(n, e[1]), ...e[2] ?? []], a = n ?? i[0]?.action;
|
|
11732
11743
|
if (!(!a || i.length === 0)) return {
|
|
11733
11744
|
action: a,
|
|
11734
11745
|
operations: i.map(({ operation: e }) => e),
|
|
@@ -11736,7 +11747,7 @@ var Jh = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e
|
|
|
11736
11747
|
reference: r,
|
|
11737
11748
|
type: "action_directive"
|
|
11738
11749
|
};
|
|
11739
|
-
} }), 200),
|
|
11750
|
+
} }), 200), Zh = x([
|
|
11740
11751
|
C("la\\s+fin\\s+de\\s+", { flags: "i" }),
|
|
11741
11752
|
w(C("(?:la\\s+|l['’]\\s*)", { flags: "i" }), { default: "" }),
|
|
11742
11753
|
T(C("phrase", {
|
|
@@ -11753,14 +11764,14 @@ var Jh = i("après|avant|remplacée?s?|supprimée?s?|abrogée?s?|ins[eé]r[eé]e
|
|
|
11753
11764
|
type: "tail_after_target",
|
|
11754
11765
|
unit: e[2]
|
|
11755
11766
|
}) });
|
|
11756
|
-
function
|
|
11767
|
+
function Qh(e) {
|
|
11757
11768
|
if (e.type === "phrase") return "phrase";
|
|
11758
11769
|
if (e.type === "alinéa") return "alinéa";
|
|
11759
11770
|
if (e.type === "article") return "article";
|
|
11760
|
-
if (e.type === "parent-enfant") return
|
|
11771
|
+
if (e.type === "parent-enfant") return Qh(e.child);
|
|
11761
11772
|
}
|
|
11762
|
-
function
|
|
11763
|
-
let t =
|
|
11773
|
+
function $h(e) {
|
|
11774
|
+
let t = th(e);
|
|
11764
11775
|
if (!/\bla\s+fin\s+d/iu.test(t)) return null;
|
|
11765
11776
|
let n = /\bla\s+fin\s+(?:de\s+la|d['’]?une|du|de\s+l['’]?|des)\s*[^,;.]*\bphrase\b/u.test(t) ? "phrase" : /\bla\s+fin\s+(?:de\s+la|d['’]?un|du|de\s+l['’]?|des)\s*[^,;.]*\balinea\b/u.test(t) ? "alinéa" : /\bla\s+fin\s+(?:de\s+l['’]?|d['’]?)article\b/u.test(t) ? "article" : void 0;
|
|
11766
11777
|
return {
|
|
@@ -11770,10 +11781,10 @@ function Zh(e) {
|
|
|
11770
11781
|
}
|
|
11771
11782
|
//#endregion
|
|
11772
11783
|
//#region src/lib/text_parsers/action_occurrences.ts
|
|
11773
|
-
function
|
|
11784
|
+
function eg(e) {
|
|
11774
11785
|
return e.replace(/\s+/gu, " ").trim().normalize("NFD").replace(/[\u0300-\u036f]/gu, "").replace(/[’‘]/gu, "'").toLowerCase();
|
|
11775
11786
|
}
|
|
11776
|
-
function
|
|
11787
|
+
function tg(e, t) {
|
|
11777
11788
|
let n = e.slice(0, Math.max(0, t)), r = RegExp(`\\b(${we})\\s+occurrence\\b`, "giu"), i = null, a;
|
|
11778
11789
|
for (; (a = r.exec(n)) !== null;) {
|
|
11779
11790
|
let e = be(a[1] ?? "");
|
|
@@ -11781,37 +11792,37 @@ function $h(e, t) {
|
|
|
11781
11792
|
}
|
|
11782
11793
|
return i;
|
|
11783
11794
|
}
|
|
11784
|
-
function
|
|
11785
|
-
let t =
|
|
11786
|
-
return /\b(?:derniere\s+occurrence|a\s+la\s+fin)\b/u.test(t) ? "last" :
|
|
11795
|
+
function ng(e) {
|
|
11796
|
+
let t = eg(e);
|
|
11797
|
+
return /\b(?:derniere\s+occurrence|a\s+la\s+fin)\b/u.test(t) ? "last" : tg(e, e.length) ?? void 0;
|
|
11787
11798
|
}
|
|
11788
11799
|
//#endregion
|
|
11789
11800
|
//#region src/lib/extractors/action_directives.ts
|
|
11790
|
-
var
|
|
11791
|
-
function
|
|
11801
|
+
var rg = "(?:(?:alinea|alineas|section|sous-section|paragraphe|sous-paragraphe|sous-sous-paragraphe|chapitre|titre|livre|partie)|(?:[ivxlcdm]+|[a-z]|\\d+\\s*°?)(?:\\s+(?:bis|ter|quater|quinquies|sexies|septies|octies|nonies|decies|undecies|duodecies))?)", ig = "(?:un|une|l['’]?|le|la)";
|
|
11802
|
+
function ag(e) {
|
|
11792
11803
|
return /\b(?:les?|la|l['’]?)\s+(?:mots?|references?|mentions?|signes?|nombres?|montants?|taux|pourcentages?|dates?|annees?)\b/u.test(e);
|
|
11793
11804
|
}
|
|
11794
|
-
function
|
|
11805
|
+
function og(e) {
|
|
11795
11806
|
return /\b(?:une|la|les?)\s+phrases?\b/u.test(e);
|
|
11796
11807
|
}
|
|
11797
|
-
function
|
|
11798
|
-
return new RegExp(String.raw`\b(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b[\s\S]{0,90}\b${
|
|
11808
|
+
function sg(e) {
|
|
11809
|
+
return new RegExp(String.raw`\b(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b[\s\S]{0,90}\b${ig}\s+${rg}\b`, "u").test(e) ? !0 : new RegExp(String.raw`\b${ig}\s+${rg}\b[\s\S]{0,90}\b(?:est|sont)\s+(?:ainsi\s+)?(?:insere(?:e|es|s)?|ajoute(?:e|es|s)?|complete(?:e|es|s)?|retabli(?:e|es|s)?)\b`, "u").test(e);
|
|
11799
11810
|
}
|
|
11800
|
-
function
|
|
11801
|
-
if (!
|
|
11811
|
+
function cg({ hasRedactionIntro: e, insertText: t, normalized: n }) {
|
|
11812
|
+
if (!ag(n) && !og(n) && (sg(n) && /\balinea\b/u.test(n) || e && yp(t))) return "block";
|
|
11802
11813
|
}
|
|
11803
|
-
function
|
|
11804
|
-
if (!
|
|
11814
|
+
function lg({ hasRedactionIntro: e, normalized: t, replacementText: n }) {
|
|
11815
|
+
if (!og(t) && (e && /\balineas?\b/u.test(t) || e && yp(n))) return "block";
|
|
11805
11816
|
}
|
|
11806
|
-
function
|
|
11817
|
+
function ug(e) {
|
|
11807
11818
|
let t = bp(e);
|
|
11808
11819
|
return t ? t.restText : e;
|
|
11809
11820
|
}
|
|
11810
|
-
function
|
|
11811
|
-
let t =
|
|
11821
|
+
function dg(e) {
|
|
11822
|
+
let t = ug(e);
|
|
11812
11823
|
return t === e ? e.replace(gp, "") : t;
|
|
11813
11824
|
}
|
|
11814
|
-
function
|
|
11825
|
+
function fg(e) {
|
|
11815
11826
|
let t = e.split("\n"), n = [], r = 0;
|
|
11816
11827
|
for (let e of t) {
|
|
11817
11828
|
let t = r, i = t + e.length;
|
|
@@ -11823,10 +11834,10 @@ function ug(e) {
|
|
|
11823
11834
|
}
|
|
11824
11835
|
return n;
|
|
11825
11836
|
}
|
|
11826
|
-
function
|
|
11837
|
+
function pg(e) {
|
|
11827
11838
|
return bp(e) !== void 0 || gp.test(e);
|
|
11828
11839
|
}
|
|
11829
|
-
function
|
|
11840
|
+
function mg(e) {
|
|
11830
11841
|
if (gp.test(e)) return {
|
|
11831
11842
|
marker: "-",
|
|
11832
11843
|
level: 5
|
|
@@ -11834,87 +11845,87 @@ function fg(e) {
|
|
|
11834
11845
|
let t = bp(e);
|
|
11835
11846
|
return t ? {
|
|
11836
11847
|
marker: t.token,
|
|
11837
|
-
level:
|
|
11848
|
+
level: hg(t.token)
|
|
11838
11849
|
} : null;
|
|
11839
11850
|
}
|
|
11840
|
-
function
|
|
11851
|
+
function hg(e) {
|
|
11841
11852
|
let t = e.trim().split(/\s+/u)[0]?.replace(/[^\p{L}\p{N}]+/gu, "") ?? "";
|
|
11842
11853
|
return /^\d+$/u.test(t) ? 2 : /^[ivxlcdm]+$/u.test(t) && (t.length > 1 || /^[ivx]$/u.test(t)) ? 4 : /^[a-z]$/u.test(t) ? 3 : vp(t) || /^[A-Z]$/u.test(t) ? 1 : 2;
|
|
11843
11854
|
}
|
|
11844
|
-
function
|
|
11855
|
+
function gg(e) {
|
|
11845
11856
|
let t = [], n = e;
|
|
11846
11857
|
for (;;) {
|
|
11847
|
-
let e =
|
|
11858
|
+
let e = mg(n);
|
|
11848
11859
|
if (!e) return t;
|
|
11849
11860
|
t.push(e.marker);
|
|
11850
|
-
let r =
|
|
11861
|
+
let r = dg(n);
|
|
11851
11862
|
if (r === n) return t;
|
|
11852
11863
|
n = r.trimStart();
|
|
11853
11864
|
}
|
|
11854
11865
|
}
|
|
11855
|
-
function
|
|
11856
|
-
let t =
|
|
11866
|
+
function _g(e) {
|
|
11867
|
+
let t = th(Oh(e, Dh(e)));
|
|
11857
11868
|
return /(?:^|[;:.]\s*)(?:(?:il\s+)?est|sont)\s+(?:inseree?s?|ajoutee?s?)\s+(?:la\s+reference|la\s+mention|les\s+mots|le\s+mot|le\s+signe|les\s+references)?\s*:/.exec(t)?.index ?? null;
|
|
11858
11869
|
}
|
|
11859
|
-
function
|
|
11860
|
-
let t =
|
|
11870
|
+
function vg(e) {
|
|
11871
|
+
let t = _g(e);
|
|
11861
11872
|
if (t !== null) return t;
|
|
11862
11873
|
for (let t = 0; t < e.length; t += 1) {
|
|
11863
11874
|
let r = new n(e.slice(t));
|
|
11864
|
-
if (
|
|
11875
|
+
if (Om(r) && r.offset > 0) return t;
|
|
11865
11876
|
}
|
|
11866
11877
|
return null;
|
|
11867
11878
|
}
|
|
11868
|
-
function
|
|
11879
|
+
function yg(e) {
|
|
11869
11880
|
return e.type === "reference_et_action" ? e.reference : e;
|
|
11870
11881
|
}
|
|
11871
|
-
function
|
|
11872
|
-
return
|
|
11882
|
+
function bg(e) {
|
|
11883
|
+
return Km(new n(e)).map(yg).find((e) => bt(e) === "article") || (k_(e)?.reference ?? null);
|
|
11873
11884
|
}
|
|
11874
|
-
function
|
|
11875
|
-
let t =
|
|
11885
|
+
function xg(e) {
|
|
11886
|
+
let t = vg(e) ?? e.length, r = kh(e), i = Km(new n(e)), a = i.flatMap((e) => Array.from(O(yg(e)))).filter((e) => e.type === "article" && e.position).map((e) => ({
|
|
11876
11887
|
start: e.position.start,
|
|
11877
11888
|
end: e.position.stop
|
|
11878
|
-
})), o = i.map(
|
|
11879
|
-
return u ?
|
|
11889
|
+
})), o = i.map(yg).filter((e) => !jh(e.position, r) && !Ah(e.position, a) && bt(e) !== "article" && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0)), s = e.slice(0, t).trimEnd(), c = yh(p_(s), 0) ?? yh(s, 0) ?? yh(s.replace(/\b(?:est|sont)\s*$/iu, "").trimEnd(), 0), l = c && !Ah(c.position, a) ? c : null, u = o[0];
|
|
11890
|
+
return u ? Sh(u, l) : l;
|
|
11880
11891
|
}
|
|
11881
|
-
function
|
|
11882
|
-
let t =
|
|
11892
|
+
function Sg(e) {
|
|
11893
|
+
let t = vg(e) ?? e.length, r = kh(e), i = Km(new n(e)).map(yg).filter((e) => !jh(e.position, r) && (e.position?.start ?? 0) < t).sort((e, t) => (e.position?.start ?? 0) - (t.position?.start ?? 0));
|
|
11883
11894
|
return i.length === 0 ? null : i.find((e) => bt(e) !== "article") ?? null ?? i[0] ?? null;
|
|
11884
11895
|
}
|
|
11885
|
-
function
|
|
11886
|
-
let t = [e,
|
|
11896
|
+
function Cg(e) {
|
|
11897
|
+
let t = [e, ug(e)].map((e) => e.trim()).filter((e, t, n) => e && n.indexOf(e) === t);
|
|
11887
11898
|
for (let e of t) {
|
|
11888
|
-
let t =
|
|
11899
|
+
let t = vg(e) ?? e.length, n = yh(e, 0) ?? wh(e, { actionIndex: t }) ?? Sg(e) ?? bg(e);
|
|
11889
11900
|
if (n) return n;
|
|
11890
11901
|
}
|
|
11891
11902
|
return null;
|
|
11892
11903
|
}
|
|
11893
|
-
function
|
|
11904
|
+
function wg(e) {
|
|
11894
11905
|
return e?.toLowerCase().replace(/[.)]/g, "").trim();
|
|
11895
11906
|
}
|
|
11896
|
-
function
|
|
11897
|
-
return !(e.type !== t.type || e.index !== void 0 && t.index !== void 0 && e.index !== t.index || e.num !== void 0 && t.num !== void 0 &&
|
|
11907
|
+
function Tg(e, t) {
|
|
11908
|
+
return !(e.type !== t.type || e.index !== void 0 && t.index !== void 0 && e.index !== t.index || e.num !== void 0 && t.num !== void 0 && wg(e.num) !== wg(t.num));
|
|
11898
11909
|
}
|
|
11899
|
-
function
|
|
11910
|
+
function Eg(e) {
|
|
11900
11911
|
let t = null;
|
|
11901
11912
|
for (let n of O(e)) t = n;
|
|
11902
11913
|
return t;
|
|
11903
11914
|
}
|
|
11904
|
-
function
|
|
11905
|
-
return t && e.type === "parent-enfant" &&
|
|
11915
|
+
function Dg(e, t) {
|
|
11916
|
+
return t && e.type === "parent-enfant" && Tg(e.parent, t) ? e.child : e;
|
|
11906
11917
|
}
|
|
11907
|
-
function
|
|
11918
|
+
function Og(e, t) {
|
|
11908
11919
|
let n = null;
|
|
11909
11920
|
for (let r of O(e)) r.type === t && r.relative === void 0 && (r.index === void 0 && r.num === void 0 || (n = r));
|
|
11910
11921
|
return n;
|
|
11911
11922
|
}
|
|
11912
|
-
function
|
|
11923
|
+
function kg(e, t) {
|
|
11913
11924
|
if (!t) return e;
|
|
11914
11925
|
let n = structuredClone(e), r = (e) => {
|
|
11915
11926
|
if (e.type !== "parent-enfant" && e.type !== "bounded-interval" && e.type !== "counted-interval" && e.type !== "enumeration" && e.type !== "exclusion" && e.type !== "reference_et_action") {
|
|
11916
11927
|
if (e.relative === 0) {
|
|
11917
|
-
let n =
|
|
11928
|
+
let n = Og(t, e.type);
|
|
11918
11929
|
n && (e.index = n.index, e.num = n.num, delete e.relative);
|
|
11919
11930
|
}
|
|
11920
11931
|
return;
|
|
@@ -11940,7 +11951,7 @@ function Dg(e, t) {
|
|
|
11940
11951
|
};
|
|
11941
11952
|
return r(n), n;
|
|
11942
11953
|
}
|
|
11943
|
-
function
|
|
11954
|
+
function Ag(e) {
|
|
11944
11955
|
let t = (e) => {
|
|
11945
11956
|
if (e.type !== "parent-enfant" && e.type !== "bounded-interval" && e.type !== "counted-interval" && e.type !== "enumeration" && e.type !== "exclusion" && e.type !== "reference_et_action") return e.relative !== void 0;
|
|
11946
11957
|
switch (e.type) {
|
|
@@ -11954,14 +11965,14 @@ function Og(e) {
|
|
|
11954
11965
|
};
|
|
11955
11966
|
return t(e);
|
|
11956
11967
|
}
|
|
11957
|
-
function
|
|
11968
|
+
function jg(e) {
|
|
11958
11969
|
let t = [], n = [];
|
|
11959
11970
|
for (let r of e) {
|
|
11960
|
-
if (!
|
|
11971
|
+
if (!pg(r.text)) {
|
|
11961
11972
|
n[n.length - 1]?.body.push(r);
|
|
11962
11973
|
continue;
|
|
11963
11974
|
}
|
|
11964
|
-
let e =
|
|
11975
|
+
let e = mg(r.text), i = e?.level ?? 0, a = {
|
|
11965
11976
|
body: [],
|
|
11966
11977
|
children: [],
|
|
11967
11978
|
level: i,
|
|
@@ -11973,13 +11984,13 @@ function kg(e) {
|
|
|
11973
11984
|
}
|
|
11974
11985
|
return t;
|
|
11975
11986
|
}
|
|
11976
|
-
function
|
|
11987
|
+
function Mg(e, t) {
|
|
11977
11988
|
if (!e) return t;
|
|
11978
11989
|
if (!t) return e;
|
|
11979
|
-
let n =
|
|
11990
|
+
let n = Dg(t, Eg(e));
|
|
11980
11991
|
return n.type === "article" || bt(n), mt(e, n);
|
|
11981
11992
|
}
|
|
11982
|
-
function
|
|
11993
|
+
function Ng(e, t) {
|
|
11983
11994
|
return {
|
|
11984
11995
|
...mt(e, t),
|
|
11985
11996
|
position: {
|
|
@@ -11988,16 +11999,16 @@ function jg(e, t) {
|
|
|
11988
11999
|
}
|
|
11989
12000
|
};
|
|
11990
12001
|
}
|
|
11991
|
-
function
|
|
11992
|
-
return [
|
|
12002
|
+
function Pg(e) {
|
|
12003
|
+
return [dg(e.line.text), ...e.body.map((e) => e.text)].join("\n").trim();
|
|
11993
12004
|
}
|
|
11994
|
-
function
|
|
12005
|
+
function Fg(e) {
|
|
11995
12006
|
return e.body[e.body.length - 1]?.end ?? e.line.end;
|
|
11996
12007
|
}
|
|
11997
|
-
function
|
|
12008
|
+
function Ig(e) {
|
|
11998
12009
|
return (e ?? "").replace(/°/gu, "").replace(/\s+/gu, " ").trim();
|
|
11999
12010
|
}
|
|
12000
|
-
function
|
|
12011
|
+
function Lg(e, t) {
|
|
12001
12012
|
let r = new n(e, t), i = te(r);
|
|
12002
12013
|
return typeof i == "string" && r.offset > t ? {
|
|
12003
12014
|
date: i,
|
|
@@ -12005,14 +12016,14 @@ function Fg(e, t) {
|
|
|
12005
12016
|
stop: r.offset
|
|
12006
12017
|
} : null;
|
|
12007
12018
|
}
|
|
12008
|
-
function
|
|
12009
|
-
let t =
|
|
12019
|
+
function Rg(e) {
|
|
12020
|
+
let t = kh(e), n = [];
|
|
12010
12021
|
for (let r = 0; r < e.length; r += 1) {
|
|
12011
12022
|
let i = e[r];
|
|
12012
12023
|
if (i === void 0 || !/\d/u.test(i)) continue;
|
|
12013
|
-
let a =
|
|
12024
|
+
let a = Lg(e, r);
|
|
12014
12025
|
if (a) {
|
|
12015
|
-
if (
|
|
12026
|
+
if (Ah(a, t)) {
|
|
12016
12027
|
r = Math.max(r, a.stop - 1);
|
|
12017
12028
|
continue;
|
|
12018
12029
|
}
|
|
@@ -12021,25 +12032,25 @@ function Ig(e) {
|
|
|
12021
12032
|
}
|
|
12022
12033
|
return n;
|
|
12023
12034
|
}
|
|
12024
|
-
function
|
|
12025
|
-
return
|
|
12035
|
+
function zg(e) {
|
|
12036
|
+
return th(e).replace(/\s+/gu, " ");
|
|
12026
12037
|
}
|
|
12027
|
-
function
|
|
12028
|
-
let t =
|
|
12038
|
+
function Bg(e) {
|
|
12039
|
+
let t = zg(e), n = /\b(?:entr(?:e|ent|era|eront)\s+en\s+vigueur|s['’]?\s*appli(?:que|quent)|est\s+applicable|sont\s+applicables?|applicables?)\b/giu, r = null, i;
|
|
12029
12040
|
for (; (i = n.exec(t)) !== null;) r = i;
|
|
12030
12041
|
return r;
|
|
12031
12042
|
}
|
|
12032
|
-
function
|
|
12033
|
-
let n =
|
|
12034
|
-
return !!(/\bau\s*$/u.test(n) && r.startsWith(",") || /\ba compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || /\babroge(?:e|es|s)?\s+a compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) ||
|
|
12043
|
+
function Vg(e, t) {
|
|
12044
|
+
let n = zg(e.slice(0, t.start)), r = zg(e.slice(t.stop));
|
|
12045
|
+
return !!(/\bau\s*$/u.test(n) && r.startsWith(",") || /\ba compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || /\babroge(?:e|es|s)?\s+a compter\s+(?:du|de la|de l['’]?|des)?\s*$/u.test(n) || Bg(e.slice(0, t.start)));
|
|
12035
12046
|
}
|
|
12036
|
-
function
|
|
12037
|
-
return
|
|
12047
|
+
function Hg(e) {
|
|
12048
|
+
return Rg(e).find((t) => Vg(e, t))?.date;
|
|
12038
12049
|
}
|
|
12039
|
-
function
|
|
12040
|
-
return e.map((e) =>
|
|
12050
|
+
function Ug(e) {
|
|
12051
|
+
return e.map((e) => Ig(e.num)).filter((e) => e.length > 0);
|
|
12041
12052
|
}
|
|
12042
|
-
function
|
|
12053
|
+
function Wg(e, t) {
|
|
12043
12054
|
let n = e.at(-1), r = t.at(-1);
|
|
12044
12055
|
if (!n || !r) return [e, t];
|
|
12045
12056
|
let i = e.slice(0, -1), a = t.slice(0, -1);
|
|
@@ -12050,51 +12061,51 @@ function Hg(e, t) {
|
|
|
12050
12061
|
for (let e = o; e <= s; e += 1) c.push([...i, String(e)]);
|
|
12051
12062
|
return c;
|
|
12052
12063
|
}
|
|
12053
|
-
function
|
|
12064
|
+
function Gg(e) {
|
|
12054
12065
|
if (e.kind === "single") {
|
|
12055
|
-
let t =
|
|
12066
|
+
let t = Ug(e.steps);
|
|
12056
12067
|
return t.length > 0 ? [t] : [];
|
|
12057
12068
|
}
|
|
12058
|
-
let t =
|
|
12059
|
-
return t.length === 0 && n.length === 0 ? [] :
|
|
12069
|
+
let t = Ug(e.first), n = Ug(e.last);
|
|
12070
|
+
return t.length === 0 && n.length === 0 ? [] : Wg(t, n);
|
|
12060
12071
|
}
|
|
12061
|
-
function
|
|
12062
|
-
let t =
|
|
12063
|
-
for (let e of t.map(
|
|
12072
|
+
function Kg(e) {
|
|
12073
|
+
let t = Km(new n(e)), r = [];
|
|
12074
|
+
for (let e of t.map(yg)) {
|
|
12064
12075
|
if (e.type === "article" && e.present) {
|
|
12065
12076
|
r.push([]);
|
|
12066
12077
|
continue;
|
|
12067
12078
|
}
|
|
12068
|
-
for (let t of Rp(e)) r.push(...
|
|
12079
|
+
for (let t of Rp(e)) r.push(...Gg(t));
|
|
12069
12080
|
}
|
|
12070
12081
|
return r.filter((e, t, n) => n.findIndex((t) => t.join("\0") === e.join("\0")) === t);
|
|
12071
12082
|
}
|
|
12072
|
-
function
|
|
12083
|
+
function qg(e) {
|
|
12073
12084
|
let t = [], n = e.split(/(?<=[.;])\s+/u).map((e) => e.trim()).filter(Boolean);
|
|
12074
|
-
for (let e of n) for (let n of
|
|
12075
|
-
if (!
|
|
12076
|
-
let r =
|
|
12085
|
+
for (let e of n) for (let n of Rg(e)) {
|
|
12086
|
+
if (!Vg(e, n)) continue;
|
|
12087
|
+
let r = Bg(e.slice(0, n.start));
|
|
12077
12088
|
if (!r) continue;
|
|
12078
|
-
let i =
|
|
12089
|
+
let i = Kg(e.slice(0, r.index).trim());
|
|
12079
12090
|
if (i.length === 0) continue;
|
|
12080
12091
|
t.push({
|
|
12081
12092
|
date: n.date,
|
|
12082
12093
|
paths: i
|
|
12083
12094
|
});
|
|
12084
|
-
let a =
|
|
12095
|
+
let a = Jg(e.slice(n.stop), i);
|
|
12085
12096
|
t.push(...a);
|
|
12086
12097
|
}
|
|
12087
12098
|
return t;
|
|
12088
12099
|
}
|
|
12089
|
-
function
|
|
12100
|
+
function Jg(e, t) {
|
|
12090
12101
|
let n = /(?:^|[^\p{L}\p{N}_])(?:a|à)\s+l['’]exception\s+(.+?)(?:\bqui\b|\bentr(?:e|ent|era|eront)\s+en\s+vigueur\b)/iu.exec(e);
|
|
12091
12102
|
if (!n) return [];
|
|
12092
12103
|
let r = n.index + n[0].length, i = n[1]?.trim();
|
|
12093
12104
|
if (!i) return [];
|
|
12094
|
-
let a =
|
|
12105
|
+
let a = Kg(i);
|
|
12095
12106
|
if (a.length === 0) return [];
|
|
12096
12107
|
let o = [];
|
|
12097
|
-
for (let n of
|
|
12108
|
+
for (let n of Rg(e.slice(r))) {
|
|
12098
12109
|
let e = n.date;
|
|
12099
12110
|
o.push({
|
|
12100
12111
|
date: e,
|
|
@@ -12105,44 +12116,44 @@ function Kg(e, t) {
|
|
|
12105
12116
|
}
|
|
12106
12117
|
return o;
|
|
12107
12118
|
}
|
|
12108
|
-
function
|
|
12119
|
+
function Yg(e, t, n) {
|
|
12109
12120
|
return [
|
|
12110
12121
|
...e,
|
|
12111
|
-
|
|
12112
|
-
...
|
|
12122
|
+
Ig(t.marker),
|
|
12123
|
+
...gg(n).map(Ig)
|
|
12113
12124
|
].filter((e) => e.length > 0);
|
|
12114
12125
|
}
|
|
12115
|
-
function
|
|
12126
|
+
function Xg(e) {
|
|
12116
12127
|
let t = [];
|
|
12117
|
-
for (let n of e) t.push(...
|
|
12128
|
+
for (let n of e) t.push(...qg(Pg(n))), t.push(...Xg(n.children));
|
|
12118
12129
|
return t;
|
|
12119
12130
|
}
|
|
12120
|
-
function
|
|
12131
|
+
function Zg(e, t) {
|
|
12121
12132
|
return t.length > e.length ? !1 : t.every((t, n) => e[n] === t);
|
|
12122
12133
|
}
|
|
12123
|
-
function
|
|
12134
|
+
function Qg(e, t) {
|
|
12124
12135
|
if (t.length > e.length) return !1;
|
|
12125
12136
|
let n = e.length - t.length;
|
|
12126
12137
|
return t.every((t, r) => e[n + r] === t);
|
|
12127
12138
|
}
|
|
12128
|
-
function
|
|
12129
|
-
return n ? n.some((n) =>
|
|
12139
|
+
function $g(e, t, n) {
|
|
12140
|
+
return n ? n.some((n) => $g(e, n) ? $g(e, Zg(e, n) ? [...n, ...t] : t) : !1) : t.length === 0 ? !0 : Zg(e, t) || Qg(e, t);
|
|
12130
12141
|
}
|
|
12131
|
-
function
|
|
12142
|
+
function e_(e, t, n) {
|
|
12132
12143
|
if (e.length === 0 || n.length === 0) return;
|
|
12133
12144
|
let r = new Map(t.map((e) => [e.directive, e.sourcePath]));
|
|
12134
12145
|
for (let t of e) {
|
|
12135
12146
|
if (t.applicabilityDate) continue;
|
|
12136
12147
|
let e = r.get(t) ?? [], i, a = -1;
|
|
12137
12148
|
for (let t of n) for (let n of t.paths) {
|
|
12138
|
-
if (
|
|
12149
|
+
if (!$g(e, n, t.parentPaths)) continue;
|
|
12139
12150
|
let r = n.length + Math.max(0, ...t.parentPaths?.map((e) => e.length) ?? [0]);
|
|
12140
12151
|
r > a && (i = t.date, a = r);
|
|
12141
12152
|
}
|
|
12142
12153
|
i && (t.applicabilityDate = i);
|
|
12143
12154
|
}
|
|
12144
12155
|
}
|
|
12145
|
-
function
|
|
12156
|
+
function t_(e, t) {
|
|
12146
12157
|
if (!e) return t;
|
|
12147
12158
|
if (!t) return e;
|
|
12148
12159
|
let n = t.rowIndex ?? e.rowIndex, r = t.columnIndex ?? e.columnIndex;
|
|
@@ -12152,39 +12163,39 @@ function $g(e, t) {
|
|
|
12152
12163
|
...r ? { columnIndex: r } : {}
|
|
12153
12164
|
};
|
|
12154
12165
|
}
|
|
12155
|
-
function
|
|
12166
|
+
function n_(e) {
|
|
12156
12167
|
return e !== void 0 && (e.rowIndex !== void 0 || e.columnIndex !== void 0);
|
|
12157
12168
|
}
|
|
12158
|
-
function
|
|
12169
|
+
function r_(e, t, n, r, i = [], a = []) {
|
|
12159
12170
|
let o = [], s = t;
|
|
12160
12171
|
for (let c of e) {
|
|
12161
|
-
let e =
|
|
12172
|
+
let e = dg(c.line.text), l = Yg(i, c, e), u = Pg(c);
|
|
12162
12173
|
if (!u) continue;
|
|
12163
|
-
let d =
|
|
12164
|
-
if (
|
|
12174
|
+
let d = t_(r, f_(u, r !== void 0)), f = Cg(e), p = Mg(t, f);
|
|
12175
|
+
if (vg(u) === null) {
|
|
12165
12176
|
if (c.children.length > 0) {
|
|
12166
|
-
let e = p ?? t, r =
|
|
12177
|
+
let e = p ?? t, r = r_(c.children, e, n, d, l, a);
|
|
12167
12178
|
r.length > 0 && (o.push(...r), s = r[r.length - 1]?.reference ?? s);
|
|
12168
12179
|
continue;
|
|
12169
12180
|
}
|
|
12170
12181
|
s = p ?? s;
|
|
12171
12182
|
continue;
|
|
12172
12183
|
}
|
|
12173
|
-
let m =
|
|
12184
|
+
let m = bg(u), h = Mg(t, xg(u) ?? m ?? f) ?? m ?? p;
|
|
12174
12185
|
if (!h) {
|
|
12175
12186
|
if (c.children.length > 0) {
|
|
12176
|
-
let e =
|
|
12187
|
+
let e = r_(c.children, p ?? t, n, d, l, a);
|
|
12177
12188
|
o.push(...e);
|
|
12178
12189
|
}
|
|
12179
12190
|
continue;
|
|
12180
12191
|
}
|
|
12181
|
-
h =
|
|
12182
|
-
let g =
|
|
12192
|
+
h = kg(h, Ag(h) ? s ?? t : t);
|
|
12193
|
+
let g = O_({
|
|
12183
12194
|
action: { action: "modifier" },
|
|
12184
12195
|
reference: h,
|
|
12185
12196
|
sourcePosition: {
|
|
12186
12197
|
start: c.line.start,
|
|
12187
|
-
stop:
|
|
12198
|
+
stop: Fg(c)
|
|
12188
12199
|
},
|
|
12189
12200
|
sourceText: u,
|
|
12190
12201
|
fullText: n,
|
|
@@ -12192,7 +12203,7 @@ function t_(e, t, n, r, i = [], a = []) {
|
|
|
12192
12203
|
});
|
|
12193
12204
|
if (!g) {
|
|
12194
12205
|
if (s = h, c.children.length > 0) {
|
|
12195
|
-
let e =
|
|
12206
|
+
let e = r_(c.children, p ?? h, n, d, l, a);
|
|
12196
12207
|
o.push(...e), s = e[e.length - 1]?.reference ?? s;
|
|
12197
12208
|
}
|
|
12198
12209
|
continue;
|
|
@@ -12208,19 +12219,19 @@ function t_(e, t, n, r, i = [], a = []) {
|
|
|
12208
12219
|
sourcePath: l
|
|
12209
12220
|
});
|
|
12210
12221
|
if (s = h, c.children.length > 0) {
|
|
12211
|
-
let e =
|
|
12222
|
+
let e = r_(c.children, p ?? h, n, d, l, a);
|
|
12212
12223
|
e.length > 0 && (o.push(...e), s = e[e.length - 1]?.reference ?? s);
|
|
12213
12224
|
}
|
|
12214
12225
|
}
|
|
12215
|
-
return
|
|
12226
|
+
return D_(o);
|
|
12216
12227
|
}
|
|
12217
|
-
function
|
|
12218
|
-
let t =
|
|
12228
|
+
function i_(e) {
|
|
12229
|
+
let t = fg(e), n = t.findIndex((e) => pg(e.text));
|
|
12219
12230
|
if (n === -1) return null;
|
|
12220
|
-
let r = t.slice(0, n).reverse().map((e) =>
|
|
12221
|
-
return
|
|
12231
|
+
let r = t.slice(0, n).reverse().map((e) => Cg(e.text)).find((e) => e !== null) ?? null, i = jg(t.slice(n)), a = [], o = r_(i, r, e, void 0, [], a);
|
|
12232
|
+
return e_(o, a, Xg(i)), o.length > 0 ? o : null;
|
|
12222
12233
|
}
|
|
12223
|
-
function
|
|
12234
|
+
function a_(e, t) {
|
|
12224
12235
|
let n = e.indexOf("«");
|
|
12225
12236
|
if (n === -1) return;
|
|
12226
12237
|
let r = e.indexOf("»", n + 1);
|
|
@@ -12235,40 +12246,40 @@ function r_(e, t) {
|
|
|
12235
12246
|
}
|
|
12236
12247
|
};
|
|
12237
12248
|
}
|
|
12238
|
-
function
|
|
12239
|
-
let t =
|
|
12249
|
+
function o_(e) {
|
|
12250
|
+
let t = th(e);
|
|
12240
12251
|
return /\btableau\b/.test(t) && /\b(?:tableau|celui)\s+(?:suivant|ainsi\s+redigee?|ainsi\s+rediges|ainsi\s+redigees)\b/.test(t);
|
|
12241
12252
|
}
|
|
12242
|
-
function
|
|
12243
|
-
for (let t of
|
|
12244
|
-
if (!
|
|
12253
|
+
function s_(e) {
|
|
12254
|
+
for (let t of fg(e)) {
|
|
12255
|
+
if (!o_(t.text)) continue;
|
|
12245
12256
|
let e = t.text.indexOf(":");
|
|
12246
12257
|
return e === -1 ? t.end : t.start + e + 1;
|
|
12247
12258
|
}
|
|
12248
12259
|
return null;
|
|
12249
12260
|
}
|
|
12250
|
-
function
|
|
12251
|
-
let n =
|
|
12252
|
-
return n === null ?
|
|
12261
|
+
function c_(e, t) {
|
|
12262
|
+
let n = s_(e);
|
|
12263
|
+
return n === null ? a_(e, t) : a_(e.slice(n), t + n);
|
|
12253
12264
|
}
|
|
12254
|
-
function
|
|
12255
|
-
return
|
|
12265
|
+
function l_(e, t) {
|
|
12266
|
+
return tg(e, t);
|
|
12256
12267
|
}
|
|
12257
|
-
function
|
|
12258
|
-
let n =
|
|
12268
|
+
function u_(e, t) {
|
|
12269
|
+
let n = wm(e, t);
|
|
12259
12270
|
return n && n > 1 ? n : void 0;
|
|
12260
12271
|
}
|
|
12261
|
-
function
|
|
12272
|
+
function d_(e, t) {
|
|
12262
12273
|
if (!Array.isArray(e) || e.length < 2 || t.length < e.length) return e;
|
|
12263
12274
|
let n = e[0];
|
|
12264
12275
|
return e.some((e) => JSON.stringify(e) !== JSON.stringify(n)) ? e : n;
|
|
12265
12276
|
}
|
|
12266
|
-
function
|
|
12267
|
-
let n =
|
|
12277
|
+
function f_(e, t = !1) {
|
|
12278
|
+
let n = Oh(e, Dh(e)), r = th(n), i = /\btableau\b/.test(r);
|
|
12268
12279
|
if (!i && !t) return;
|
|
12269
12280
|
let a = (e) => {
|
|
12270
12281
|
if (!e) return;
|
|
12271
|
-
let t = e.replace(/^(?:a|à)\s+la\s+/iu, "").trim(), n =
|
|
12282
|
+
let t = e.replace(/^(?:a|à)\s+la\s+/iu, "").trim(), n = th(t);
|
|
12272
12283
|
if (/^derni(?:er|ere)s?\b/u.test(n)) return -1;
|
|
12273
12284
|
let r = be(t);
|
|
12274
12285
|
return r && r > 0 ? r : void 0;
|
|
@@ -12289,30 +12300,30 @@ function u_(e, t = !1) {
|
|
|
12289
12300
|
let l = /\bla\s+(.+?)\s+ligne\b/iu.exec(n), u = /\bla\s+(.+?)\s+colonne\b/iu.exec(n);
|
|
12290
12301
|
return o(a(l?.[1]), a(u?.[1])) || (i ? { type: "table" } : void 0);
|
|
12291
12302
|
}
|
|
12292
|
-
function
|
|
12303
|
+
function p_(e) {
|
|
12293
12304
|
return e.replace(/(?:[,;:]\s*)?(?:(?:le|la|les|l['’])\s+)?(?:année|date|dispositions?|mention|montant|mot|mots|nombre|nombres|pourcentage|référence|références|signe|taux|texte|phrase|phrases|tableau)(?:\s+[^,;:]*)?\s*:?\s*$/iu, "").trimEnd();
|
|
12294
12305
|
}
|
|
12295
|
-
function
|
|
12306
|
+
function m_(e) {
|
|
12296
12307
|
return e.replace(/(?:[,;:]\s*)?(?:(?:le|la|les|l['’])\s+)?(?:année|date|dispositions?|mention|montant|mot|mots|nombre|nombres|pourcentage|référence|références|signe|taux|texte|tableau)(?:\s+[^,;:]*)?\s*:?\s*$/iu, "").trimEnd();
|
|
12297
12308
|
}
|
|
12298
|
-
var
|
|
12299
|
-
|
|
12300
|
-
|
|
12301
|
-
|
|
12309
|
+
var h_ = [
|
|
12310
|
+
g_("(?:la\\s+date\\s+d(?:u|e|[’']))"),
|
|
12311
|
+
g_("(?:le\\s+montant\\s+d(?:e|[’']))"),
|
|
12312
|
+
g_("(?:la\\s+référence\\s+à)")
|
|
12302
12313
|
];
|
|
12303
|
-
function
|
|
12314
|
+
function g_(e) {
|
|
12304
12315
|
return new RegExp(String.raw`(?:^|[,;:]\s*)${e}\s+(?<target>.+?)\s+(?:est|sont)\s+remplac[eé]e?s?\s+par\s+${e}\s+(?<replacement>.+?)(?=\s*(?:[.;]|$))`, "iu");
|
|
12305
12316
|
}
|
|
12306
|
-
function
|
|
12317
|
+
function __(e) {
|
|
12307
12318
|
return e.replace(/\s+/gu, " ").replace(/\s+([,;])/gu, "$1").trim();
|
|
12308
12319
|
}
|
|
12309
|
-
function
|
|
12320
|
+
function v_(e) {
|
|
12310
12321
|
if (e.includes("«") || e.includes("»")) return null;
|
|
12311
|
-
for (let t of
|
|
12322
|
+
for (let t of h_) {
|
|
12312
12323
|
let n = t.exec(e), r = n?.groups?.target, i = n?.groups?.replacement;
|
|
12313
12324
|
if (!(!r || !i)) return {
|
|
12314
|
-
targetText:
|
|
12315
|
-
replacementText:
|
|
12325
|
+
targetText: __(r),
|
|
12326
|
+
replacementText: __(i),
|
|
12316
12327
|
operandRange: {
|
|
12317
12328
|
start: n.index,
|
|
12318
12329
|
end: n.index + n[0].length
|
|
@@ -12321,22 +12332,22 @@ function g_(e) {
|
|
|
12321
12332
|
}
|
|
12322
12333
|
return null;
|
|
12323
12334
|
}
|
|
12324
|
-
function
|
|
12325
|
-
let t =
|
|
12335
|
+
function y_(e) {
|
|
12336
|
+
let t = v_(e);
|
|
12326
12337
|
return t ? [t.operandRange] : [];
|
|
12327
12338
|
}
|
|
12328
|
-
function
|
|
12329
|
-
return
|
|
12339
|
+
function b_(e, t) {
|
|
12340
|
+
return Ah(e.position, t) ? !0 : Array.from(O(yg(e))).some((e) => Ah(e.position, t));
|
|
12330
12341
|
}
|
|
12331
|
-
function
|
|
12332
|
-
let o =
|
|
12342
|
+
function x_(e, t, n, r, i, a) {
|
|
12343
|
+
let o = th(e), s = th(Oh(e, i)), c = nh(s, o), l = rh(s), u = ih(s), d = n.action === "rétablir" || ah(s), f = oh(s) || d, p = sh(s), m = ch(s), h = o_(e), g = u ? "insert_before" : "insert_after", _ = l ? $h(s) : null, v = p ? _ : null, y = m ? _ : null, ee = () => {
|
|
12333
12344
|
let n = i[0]?.start;
|
|
12334
|
-
return (n === void 0 ? void 0 :
|
|
12345
|
+
return (n === void 0 ? void 0 : u_(t, n)) ?? Cm(e) ?? void 0;
|
|
12335
12346
|
}, te = () => {
|
|
12336
12347
|
let e = i[0]?.start;
|
|
12337
|
-
return (e === void 0 ? void 0 :
|
|
12348
|
+
return (e === void 0 ? void 0 : l_(t, e)) ?? void 0;
|
|
12338
12349
|
}, ne = ({ kind: e, targetText: t, insertText: n, expectsFollowingTable: r }) => {
|
|
12339
|
-
let i =
|
|
12350
|
+
let i = cg({
|
|
12340
12351
|
hasRedactionIntro: c,
|
|
12341
12352
|
insertText: n,
|
|
12342
12353
|
normalized: o
|
|
@@ -12443,7 +12454,7 @@ function y_(e, t, n, r, i, a) {
|
|
|
12443
12454
|
replacement: { type: "following_table" }
|
|
12444
12455
|
};
|
|
12445
12456
|
if (p && !f && !m && a.length === 0) {
|
|
12446
|
-
let t =
|
|
12457
|
+
let t = v_(e);
|
|
12447
12458
|
if (t) return {
|
|
12448
12459
|
kind: "replace",
|
|
12449
12460
|
targetText: t.targetText,
|
|
@@ -12469,7 +12480,7 @@ function y_(e, t, n, r, i, a) {
|
|
|
12469
12480
|
targetScope: _
|
|
12470
12481
|
};
|
|
12471
12482
|
if (!f && a.length === 1 && c) {
|
|
12472
|
-
let e =
|
|
12483
|
+
let e = lg({
|
|
12473
12484
|
hasRedactionIntro: c,
|
|
12474
12485
|
normalized: o,
|
|
12475
12486
|
replacementText: a[0]
|
|
@@ -12525,11 +12536,11 @@ function y_(e, t, n, r, i, a) {
|
|
|
12525
12536
|
expectsFollowingTable: h
|
|
12526
12537
|
}) : null;
|
|
12527
12538
|
}
|
|
12528
|
-
function
|
|
12529
|
-
let t =
|
|
12539
|
+
function S_(e) {
|
|
12540
|
+
let t = th(e);
|
|
12530
12541
|
return /\bapres\b/.test(t) && /\bla\s+fin\s+(?:(?:de\s+l['’]?)|d['’]?|de|du|des)?\s*$/u.test(t);
|
|
12531
12542
|
}
|
|
12532
|
-
function
|
|
12543
|
+
function C_(e) {
|
|
12533
12544
|
switch (e.kind) {
|
|
12534
12545
|
case "insert_after":
|
|
12535
12546
|
case "insert_before": return {
|
|
@@ -12573,7 +12584,7 @@ function x_(e) {
|
|
|
12573
12584
|
case "delete_article": return { kind: "delete_article" };
|
|
12574
12585
|
}
|
|
12575
12586
|
}
|
|
12576
|
-
function
|
|
12587
|
+
function w_(e) {
|
|
12577
12588
|
let t = (t) => {
|
|
12578
12589
|
let n = e[t];
|
|
12579
12590
|
return typeof n == "string" ? n : "";
|
|
@@ -12590,7 +12601,7 @@ function S_(e) {
|
|
|
12590
12601
|
o
|
|
12591
12602
|
].join("|");
|
|
12592
12603
|
}
|
|
12593
|
-
function
|
|
12604
|
+
function T_(e, t, n) {
|
|
12594
12605
|
return t.targetType === n.targetType && JSON.stringify(t.reference) === JSON.stringify(n.reference) && JSON.stringify(t.portionSelectors) === JSON.stringify(n.portionSelectors) ? e : {
|
|
12595
12606
|
...e,
|
|
12596
12607
|
targetType: t.targetType,
|
|
@@ -12598,10 +12609,10 @@ function C_(e, t, n) {
|
|
|
12598
12609
|
portionSelectors: t.portionSelectors
|
|
12599
12610
|
};
|
|
12600
12611
|
}
|
|
12601
|
-
function
|
|
12602
|
-
return (e.kind === "compound" ? e.operations : [
|
|
12612
|
+
function E_(e, t) {
|
|
12613
|
+
return (e.kind === "compound" ? e.operations : [C_(e)]).map((n) => T_(n, e, t));
|
|
12603
12614
|
}
|
|
12604
|
-
function
|
|
12615
|
+
function D_(e) {
|
|
12605
12616
|
let t = [];
|
|
12606
12617
|
for (let n = 0; n < e.length; n += 1) {
|
|
12607
12618
|
let r = e[n];
|
|
@@ -12616,14 +12627,14 @@ function T_(e) {
|
|
|
12616
12627
|
continue;
|
|
12617
12628
|
}
|
|
12618
12629
|
let o = i[0], s = [];
|
|
12619
|
-
for (let [e, t] of i.entries()) for (let [n, r] of
|
|
12630
|
+
for (let [e, t] of i.entries()) for (let [n, r] of E_(t, o).entries()) s.push({
|
|
12620
12631
|
directiveIndex: e,
|
|
12621
12632
|
operationIndex: n,
|
|
12622
12633
|
operation: r
|
|
12623
12634
|
});
|
|
12624
12635
|
let c = /* @__PURE__ */ new Set(), l = [];
|
|
12625
12636
|
for (let e = s.length - 1; e >= 0; --e) {
|
|
12626
|
-
let t = s[e], n =
|
|
12637
|
+
let t = s[e], n = w_(t.operation);
|
|
12627
12638
|
c.has(n) || (c.add(n), l.push(t));
|
|
12628
12639
|
}
|
|
12629
12640
|
l.sort((e, t) => e.directiveIndex - t.directiveIndex || e.operationIndex - t.operationIndex), t.push({
|
|
@@ -12642,14 +12653,14 @@ function T_(e) {
|
|
|
12642
12653
|
}
|
|
12643
12654
|
return t;
|
|
12644
12655
|
}
|
|
12645
|
-
function
|
|
12646
|
-
let o = e.target ?? bt(t), s = Rp(t), c = i && n.start < i.length ? i.slice(n.start) : r, l = i && n.start < i.length ? n.start : 0, u = i === r && n.start < r.length && !
|
|
12656
|
+
function O_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullText: i, tableTarget: a }) {
|
|
12657
|
+
let o = e.target ?? bt(t), s = Rp(t), c = i && n.start < i.length ? i.slice(n.start) : r, l = i && n.start < i.length ? n.start : 0, u = i === r && n.start < r.length && !S_(r.slice(0, n.start)) ? r.slice(n.start) : r, d = Dh(u), f = x_(r, u, e, o, d, d.map((e) => e.text));
|
|
12647
12658
|
if (!f) return null;
|
|
12648
|
-
let p =
|
|
12659
|
+
let p = d_(f, s), m = Hg(r), h = {
|
|
12649
12660
|
...m ? { applicabilityDate: m } : {},
|
|
12650
12661
|
sourcePosition: n,
|
|
12651
12662
|
sourceText: r
|
|
12652
|
-
}, g =
|
|
12663
|
+
}, g = c_(c, l), _ = (e) => {
|
|
12653
12664
|
switch (e.kind) {
|
|
12654
12665
|
case "insert_after":
|
|
12655
12666
|
case "insert_before": return {
|
|
@@ -12711,7 +12722,7 @@ function E_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12711
12722
|
insertText: e.insertText,
|
|
12712
12723
|
...e.insertLayout ? { insertLayout: e.insertLayout } : {},
|
|
12713
12724
|
...e.expectsFollowingTable && g ? { citation: g } : {},
|
|
12714
|
-
...
|
|
12725
|
+
...n_(a) ? { tableTarget: a } : {},
|
|
12715
12726
|
...h
|
|
12716
12727
|
};
|
|
12717
12728
|
case "replace": return {
|
|
@@ -12728,7 +12739,7 @@ function E_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12728
12739
|
...e.occurrenceIndex === void 0 ? {} : { occurrenceIndex: e.occurrenceIndex },
|
|
12729
12740
|
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12730
12741
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12731
|
-
...
|
|
12742
|
+
...n_(a) ? { tableTarget: a } : {},
|
|
12732
12743
|
...h
|
|
12733
12744
|
};
|
|
12734
12745
|
case "replace_portion": return e.replacement.type === "following_table" && !g ? null : {
|
|
@@ -12740,11 +12751,11 @@ function E_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12740
12751
|
replacement: e.replacement,
|
|
12741
12752
|
...e.replacementLayout ? { replacementLayout: e.replacementLayout } : {},
|
|
12742
12753
|
...e.replacement.type === "following_table" && g ? { citation: g } : {},
|
|
12743
|
-
...
|
|
12754
|
+
...n_(a) ? { tableTarget: a } : {},
|
|
12744
12755
|
...h
|
|
12745
12756
|
};
|
|
12746
12757
|
case "delete": {
|
|
12747
|
-
let n = d.map((e) =>
|
|
12758
|
+
let n = d.map((e) => l_(u, e.start)), r = /* @__PURE__ */ new Map();
|
|
12748
12759
|
for (let [e, t] of d.entries()) r.has(t.text) || r.set(t.text, n[e] ?? null);
|
|
12749
12760
|
let i = [e.targetText, ...e.extraTargetTexts ?? []].filter((e) => e && e.trim().length > 0).filter((e, t, n) => n.indexOf(e) === t);
|
|
12750
12761
|
return i.length > 1 ? v(i.map((t) => ({
|
|
@@ -12753,7 +12764,7 @@ function E_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12753
12764
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12754
12765
|
occurrenceIndex: r.get(t) ?? void 0,
|
|
12755
12766
|
...t === e.targetText && e.targetOccurrenceCount !== void 0 ? { targetOccurrenceCount: e.targetOccurrenceCount } : {},
|
|
12756
|
-
...
|
|
12767
|
+
...n_(a) ? { tableTarget: a } : {}
|
|
12757
12768
|
}))) : {
|
|
12758
12769
|
kind: "delete",
|
|
12759
12770
|
targetType: o,
|
|
@@ -12763,7 +12774,7 @@ function E_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12763
12774
|
...e.targetScope ? { targetScope: e.targetScope } : {},
|
|
12764
12775
|
occurrenceIndex: r.get(e.targetText) ?? void 0,
|
|
12765
12776
|
...e.targetOccurrenceCount === void 0 ? {} : { targetOccurrenceCount: e.targetOccurrenceCount },
|
|
12766
|
-
...
|
|
12777
|
+
...n_(a) ? { tableTarget: a } : {},
|
|
12767
12778
|
...h
|
|
12768
12779
|
};
|
|
12769
12780
|
}
|
|
@@ -12772,7 +12783,7 @@ function E_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12772
12783
|
targetType: o,
|
|
12773
12784
|
reference: t,
|
|
12774
12785
|
portionSelectors: s,
|
|
12775
|
-
...
|
|
12786
|
+
...n_(a) ? { tableTarget: a } : {},
|
|
12776
12787
|
...h
|
|
12777
12788
|
};
|
|
12778
12789
|
case "delete_article": return o === "article" ? {
|
|
@@ -12796,7 +12807,7 @@ function E_({ action: e, reference: t, sourcePosition: n, sourceText: r, fullTex
|
|
|
12796
12807
|
}
|
|
12797
12808
|
return y(p);
|
|
12798
12809
|
}
|
|
12799
|
-
function
|
|
12810
|
+
function k_(e) {
|
|
12800
12811
|
let t = /\barticle\s+([0-9]+(?:-[0-9]+)?(?:\s*[A-Z])?(?:\s+[a-z]+)?)\b/i.exec(e);
|
|
12801
12812
|
if (!t || t.index === void 0) return null;
|
|
12802
12813
|
let n = t.index, r = t.index + t[0].length;
|
|
@@ -12815,57 +12826,57 @@ function D_(e) {
|
|
|
12815
12826
|
}
|
|
12816
12827
|
};
|
|
12817
12828
|
}
|
|
12818
|
-
function
|
|
12829
|
+
function A_(e, t) {
|
|
12819
12830
|
let i = r(e).output;
|
|
12820
12831
|
if (t.allowListExtraction) {
|
|
12821
|
-
let e =
|
|
12832
|
+
let e = i_(i);
|
|
12822
12833
|
if (e) return e;
|
|
12823
12834
|
}
|
|
12824
|
-
let a =
|
|
12825
|
-
if (l.length > 0 && (c = c.filter((e) => !
|
|
12826
|
-
let e =
|
|
12835
|
+
let a = kh(i), o = y_(i), s = Mh(i), c = Km(new n(i)), l = [...a, ...o];
|
|
12836
|
+
if (l.length > 0 && (c = c.filter((e) => !b_(e, l))), c.length === 0 && (c = Km(new n(s.split(",")[0] ?? s))), c.length === 0) {
|
|
12837
|
+
let e = k_(s);
|
|
12827
12838
|
e && (c = [{
|
|
12828
12839
|
...e.reference,
|
|
12829
12840
|
position: e.position
|
|
12830
12841
|
}]);
|
|
12831
12842
|
}
|
|
12832
|
-
let u =
|
|
12843
|
+
let u = vg(s);
|
|
12833
12844
|
if (c.length === 1 && c[0]?.type === "article") {
|
|
12834
|
-
let e =
|
|
12845
|
+
let e = wh(s, { actionIndex: u ?? s.length });
|
|
12835
12846
|
e && (c = [e]);
|
|
12836
12847
|
}
|
|
12837
12848
|
if (u !== null) {
|
|
12838
|
-
let e = c.some((e) => bt(
|
|
12849
|
+
let e = c.some((e) => bt(yg(e)) === "article"), t = c.some((e) => [...O(yg(e))].some((e) => e.type === "article")), n = s.slice(0, u), r = yh(p_(n), 0) ?? yh(n, 0), i = c.map(yg).sort((e, t) => bh(t) - bh(e) || xh(t) - xh(e))[0], a = Sh(i ?? null, r);
|
|
12839
12850
|
if (!e && a && a === r && (c = [r]), !t) {
|
|
12840
12851
|
let e = i, t = n.indexOf(":");
|
|
12841
12852
|
if (t !== -1) {
|
|
12842
|
-
let r = t + 1, i =
|
|
12843
|
-
e && i &&
|
|
12853
|
+
let r = t + 1, i = yh(m_(n.slice(r)), r), a = i ? Rp(i) : [];
|
|
12854
|
+
e && i && bh(e) > 0 && (a.length > 1 || a.some((e) => e.kind === "range")) && (c = [Ng(e, i)]);
|
|
12844
12855
|
}
|
|
12845
12856
|
}
|
|
12846
12857
|
if (t) {
|
|
12847
|
-
let e = c.map(
|
|
12848
|
-
t !== -1 && e && i &&
|
|
12858
|
+
let e = c.map(yg).filter((e) => [...O(e)].some((e) => e.type === "article")).sort((e, t) => bh(t) - bh(e) || xh(t) - xh(e))[0], t = n.indexOf(":"), r = t === -1 ? 0 : t + 1, i = yh(m_(n.slice(r)), r), a = i ? Rp(i) : [];
|
|
12859
|
+
t !== -1 && e && i && bh(e) > 0 && (a.length > 1 || a.some((e) => e.kind === "range")) && c.push(Ng(e, i));
|
|
12849
12860
|
}
|
|
12850
12861
|
}
|
|
12851
12862
|
let d = [];
|
|
12852
12863
|
for (let e of c) {
|
|
12853
12864
|
if (e.type === "reference_et_action") {
|
|
12854
|
-
let t = e.position?.start ?? 0, n = i.lastIndexOf("\n", Math.max(0, t - 1)) + 1, r =
|
|
12865
|
+
let t = e.position?.start ?? 0, n = i.lastIndexOf("\n", Math.max(0, t - 1)) + 1, r = S_(i.slice(n, t)) ? n : t, a = {
|
|
12855
12866
|
start: r,
|
|
12856
12867
|
stop: i.length
|
|
12857
|
-
}, o = i.slice(r), s =
|
|
12868
|
+
}, o = i.slice(r), s = O_({
|
|
12858
12869
|
action: e.action,
|
|
12859
12870
|
reference: e.reference,
|
|
12860
12871
|
sourcePosition: a,
|
|
12861
12872
|
sourceText: o,
|
|
12862
12873
|
fullText: i,
|
|
12863
|
-
tableTarget:
|
|
12874
|
+
tableTarget: f_(o) ?? f_(i)
|
|
12864
12875
|
});
|
|
12865
12876
|
s && (Array.isArray(s) ? d.push(...s) : d.push(s));
|
|
12866
12877
|
continue;
|
|
12867
12878
|
}
|
|
12868
|
-
let t =
|
|
12879
|
+
let t = O_({
|
|
12869
12880
|
action: { action: "modifier" },
|
|
12870
12881
|
reference: e,
|
|
12871
12882
|
sourcePosition: e.position ?? {
|
|
@@ -12874,87 +12885,87 @@ function O_(e, t) {
|
|
|
12874
12885
|
},
|
|
12875
12886
|
sourceText: i,
|
|
12876
12887
|
fullText: i,
|
|
12877
|
-
tableTarget:
|
|
12888
|
+
tableTarget: f_(i)
|
|
12878
12889
|
});
|
|
12879
12890
|
t && (Array.isArray(t) ? d.push(...t) : d.push(t));
|
|
12880
12891
|
}
|
|
12881
12892
|
if (d.length === 0) {
|
|
12882
|
-
let e =
|
|
12893
|
+
let e = k_(s);
|
|
12883
12894
|
if (e) {
|
|
12884
|
-
let t =
|
|
12895
|
+
let t = O_({
|
|
12885
12896
|
action: { action: "modifier" },
|
|
12886
12897
|
reference: e.reference,
|
|
12887
12898
|
sourcePosition: e.position,
|
|
12888
12899
|
sourceText: i,
|
|
12889
12900
|
fullText: i,
|
|
12890
|
-
tableTarget:
|
|
12901
|
+
tableTarget: f_(i)
|
|
12891
12902
|
});
|
|
12892
12903
|
t && (Array.isArray(t) ? d.push(...t) : d.push(t));
|
|
12893
12904
|
}
|
|
12894
12905
|
}
|
|
12895
|
-
return
|
|
12906
|
+
return D_(d);
|
|
12896
12907
|
}
|
|
12897
|
-
function
|
|
12908
|
+
function j_(e) {
|
|
12898
12909
|
let t = new n(r(e).output);
|
|
12899
|
-
return [...
|
|
12910
|
+
return [...Xh.extract(t, { overlapWindow: 100 })];
|
|
12900
12911
|
}
|
|
12901
|
-
function A_(e) {
|
|
12902
|
-
return O_(e, { allowListExtraction: !0 });
|
|
12903
|
-
}
|
|
12904
|
-
var j_ = A_;
|
|
12905
12912
|
function M_(e) {
|
|
12906
|
-
|
|
12907
|
-
|
|
12913
|
+
return A_(e, { allowListExtraction: !0 });
|
|
12914
|
+
}
|
|
12915
|
+
var N_ = M_;
|
|
12916
|
+
function P_(e) {
|
|
12917
|
+
let t = th(e);
|
|
12918
|
+
return t.includes("«") || t.includes("»") || !e.trim().endsWith(":") ? !1 : lh(t);
|
|
12908
12919
|
}
|
|
12909
|
-
function
|
|
12920
|
+
function F_(e) {
|
|
12910
12921
|
return e.trimStart().startsWith("«");
|
|
12911
12922
|
}
|
|
12912
|
-
function
|
|
12923
|
+
function I_(e) {
|
|
12913
12924
|
return /»[.;]?\s*$/u.test(e);
|
|
12914
12925
|
}
|
|
12915
|
-
function
|
|
12926
|
+
function L_(e, t) {
|
|
12916
12927
|
for (let n = t; n < e.length; n += 1) {
|
|
12917
|
-
let t =
|
|
12928
|
+
let t = ug(e[n]).trim();
|
|
12918
12929
|
if (t.length > 0) return t;
|
|
12919
12930
|
}
|
|
12920
12931
|
}
|
|
12921
|
-
function
|
|
12932
|
+
function R_(e, t) {
|
|
12922
12933
|
let n = [], r = !1, i = t + 1;
|
|
12923
12934
|
for (; i < e.length;) {
|
|
12924
|
-
let t = e[i], a =
|
|
12935
|
+
let t = e[i], a = ug(t);
|
|
12925
12936
|
if (!r && a.includes("«") && (r = !0), r) {
|
|
12926
12937
|
n.push(a);
|
|
12927
|
-
let t =
|
|
12928
|
-
if (
|
|
12938
|
+
let t = L_(e, i + 1);
|
|
12939
|
+
if (I_(a) && (t === void 0 || !F_(t))) break;
|
|
12929
12940
|
} else if (a.trim().length > 0) break;
|
|
12930
12941
|
i += 1;
|
|
12931
12942
|
}
|
|
12932
12943
|
return !r || n.length === 0 ? null : {
|
|
12933
|
-
combinedText: [
|
|
12944
|
+
combinedText: [ug(e[t]), ...n].join("\n"),
|
|
12934
12945
|
endIndex: i
|
|
12935
12946
|
};
|
|
12936
12947
|
}
|
|
12937
|
-
function
|
|
12948
|
+
function z_(e) {
|
|
12938
12949
|
let t = a()(e).output.split("\n").map((e) => e.trim()).filter((e) => e.length > 0), n = [];
|
|
12939
12950
|
for (let e = 0; e < t.length; e += 1) {
|
|
12940
12951
|
let r = t[e];
|
|
12941
|
-
if (
|
|
12942
|
-
let r =
|
|
12952
|
+
if (P_(r)) {
|
|
12953
|
+
let r = R_(t, e);
|
|
12943
12954
|
if (r) {
|
|
12944
|
-
let t =
|
|
12955
|
+
let t = M_(r.combinedText);
|
|
12945
12956
|
if (t.length > 0) {
|
|
12946
12957
|
n.push(...t), e = r.endIndex;
|
|
12947
12958
|
continue;
|
|
12948
12959
|
}
|
|
12949
12960
|
}
|
|
12950
12961
|
}
|
|
12951
|
-
let i =
|
|
12962
|
+
let i = A_(r, { allowListExtraction: !1 });
|
|
12952
12963
|
i.length > 0 && n.push(...i);
|
|
12953
12964
|
}
|
|
12954
12965
|
return n;
|
|
12955
12966
|
}
|
|
12956
|
-
var
|
|
12957
|
-
function
|
|
12967
|
+
var B_ = z_, V_;
|
|
12968
|
+
function H_(e) {
|
|
12958
12969
|
return {
|
|
12959
12970
|
dateDebut: e.dateDebut ?? "0001-01-01",
|
|
12960
12971
|
dateFin: e.dateFin ?? "2999-01-01",
|
|
@@ -12963,7 +12974,7 @@ function B_(e) {
|
|
|
12963
12974
|
textId: e.textId
|
|
12964
12975
|
};
|
|
12965
12976
|
}
|
|
12966
|
-
function
|
|
12977
|
+
function U_(e) {
|
|
12967
12978
|
if (e.length === 0) return;
|
|
12968
12979
|
let t = /* @__PURE__ */ new Map();
|
|
12969
12980
|
for (let n of e) {
|
|
@@ -12982,7 +12993,7 @@ function V_(e) {
|
|
|
12982
12993
|
let [{ id: n }] = [...t.values()];
|
|
12983
12994
|
return { articleId: n };
|
|
12984
12995
|
}
|
|
12985
|
-
function
|
|
12996
|
+
function W_(e) {
|
|
12986
12997
|
let t = e["@id"];
|
|
12987
12998
|
return t === void 0 ? null : {
|
|
12988
12999
|
dateDebut: e["@debut"] ?? null,
|
|
@@ -12992,10 +13003,10 @@ function H_(e) {
|
|
|
12992
13003
|
title: e["#text"] ?? null
|
|
12993
13004
|
};
|
|
12994
13005
|
}
|
|
12995
|
-
function
|
|
13006
|
+
function G_(e, t) {
|
|
12996
13007
|
return (e.dateDebut === null || e.dateDebut <= t) && (e.dateFin === null || e.dateFin >= t);
|
|
12997
13008
|
}
|
|
12998
|
-
var
|
|
13009
|
+
var K_ = class extends ke {
|
|
12999
13010
|
canutesDb;
|
|
13000
13011
|
articleHistoryInfoByTextAndNum = /* @__PURE__ */ new Map();
|
|
13001
13012
|
articleRowsByNumByTextAndDate = /* @__PURE__ */ new Map();
|
|
@@ -13021,12 +13032,12 @@ var W_ = class extends ke {
|
|
|
13021
13032
|
WHERE
|
|
13022
13033
|
data -> 'CONTEXTE' -> 'TEXTE' ->> '@cid' = ${n}
|
|
13023
13034
|
AND num = ${t}
|
|
13024
|
-
`).map(
|
|
13035
|
+
`).map(H_), this.articleRowsByNumByTextAndDate.set(r, i)), i;
|
|
13025
13036
|
}
|
|
13026
13037
|
async getArticleHistoryInfo({ num: e, textId: t }) {
|
|
13027
13038
|
if (e === void 0) return;
|
|
13028
13039
|
let n = `${t}\0${e}`, r = this.articleHistoryInfoByTextAndNum.get(n);
|
|
13029
|
-
return r === void 0 && (r =
|
|
13040
|
+
return r === void 0 && (r = U_(await this.canutesDb`
|
|
13030
13041
|
SELECT
|
|
13031
13042
|
id,
|
|
13032
13043
|
data -> 'META' -> 'META_SPEC' -> 'META_ARTICLE' ->> 'DATE_DEBUT' AS "dateDebut",
|
|
@@ -13049,7 +13060,7 @@ var W_ = class extends ke {
|
|
|
13049
13060
|
SELECT data
|
|
13050
13061
|
FROM legifrance.textelr
|
|
13051
13062
|
WHERE id = ${t}
|
|
13052
|
-
`)[0]?.data.STRUCT?.LIEN_SECTION_TA?.map(
|
|
13063
|
+
`)[0]?.data.STRUCT?.LIEN_SECTION_TA?.map(W_).filter((e) => e !== null).filter((t) => G_(t, e)) ?? [] : i.map(W_).filter((e) => e !== null).filter((t) => G_(t, e)), this.directSectionChildrenByParentAndDate.set(n, r);
|
|
13053
13064
|
}
|
|
13054
13065
|
return r;
|
|
13055
13066
|
}
|
|
@@ -13092,7 +13103,7 @@ var W_ = class extends ke {
|
|
|
13092
13103
|
FROM legifrance.article
|
|
13093
13104
|
WHERE num = ${t}
|
|
13094
13105
|
LIMIT 100
|
|
13095
|
-
`).map(
|
|
13106
|
+
`).map(H_), this.globalArticleRowsByNumAndDate.set(n, r)), r;
|
|
13096
13107
|
}
|
|
13097
13108
|
async preloadTextTitlesInfos(e = {}) {
|
|
13098
13109
|
let t = (t, n = {}) => {
|
|
@@ -13107,7 +13118,7 @@ var W_ = class extends ke {
|
|
|
13107
13118
|
return;
|
|
13108
13119
|
}
|
|
13109
13120
|
let n = new xe("canutes.preloadTextTitlesInfos");
|
|
13110
|
-
|
|
13121
|
+
V_ === void 0 ? (t("queryTextTitlesInfos:start"), V_ = (async () => {
|
|
13111
13122
|
let e = await n.time("queryTextTitlesInfos", () => this.canutesDb`
|
|
13112
13123
|
SELECT
|
|
13113
13124
|
data -> 'META' -> 'META_SPEC' -> 'META_TEXTE_CHRONICLE' ->> 'CID' AS cid,
|
|
@@ -13137,8 +13148,8 @@ var W_ = class extends ke {
|
|
|
13137
13148
|
`);
|
|
13138
13149
|
t("queryTextTitlesInfos:done", { count: e.length }), t("buildTextTitlesInfos:start", { count: e.length }), await Ee(e, { onProgress: ({ count: e, phase: n }) => t(`buildTextTitlesInfos:${n}`, { count: e }) }), t("buildTextTitlesInfos:done", { count: e.length }), t("setTextTitlesInfos:done");
|
|
13139
13150
|
})().catch((e) => {
|
|
13140
|
-
throw
|
|
13141
|
-
})) : t("waiting-for-shared-preload"), await
|
|
13151
|
+
throw V_ = void 0, e;
|
|
13152
|
+
})) : t("waiting-for-shared-preload"), await V_, n.log(), this.textTitlesInfosLoaded = !0;
|
|
13142
13153
|
}
|
|
13143
13154
|
async preloadUniqueActiveArticlesByNums({ date: e, nums: t }) {
|
|
13144
13155
|
let n = [...new Set([...t].filter(Boolean))].filter((t) => !this.globalArticleRowsByNumAndDate.has(`${t}\0${e}`));
|
|
@@ -13152,7 +13163,7 @@ var W_ = class extends ke {
|
|
|
13152
13163
|
data -> 'META' -> 'META_SPEC' -> 'META_ARTICLE' ->> 'DATE_FIN' AS "dateFin"
|
|
13153
13164
|
FROM legifrance.article
|
|
13154
13165
|
WHERE num IN ${this.canutesDb(n)}
|
|
13155
|
-
`).map(
|
|
13166
|
+
`).map(H_), i = /* @__PURE__ */ new Map();
|
|
13156
13167
|
for (let e of r) {
|
|
13157
13168
|
if (e.num === null) continue;
|
|
13158
13169
|
let t = i.get(e.num);
|
|
@@ -13163,15 +13174,15 @@ var W_ = class extends ke {
|
|
|
13163
13174
|
};
|
|
13164
13175
|
//#endregion
|
|
13165
13176
|
//#region src/lib/extractors/links.ts
|
|
13166
|
-
async function*
|
|
13167
|
-
let l = r ?? (e === void 0 ? void 0 : new
|
|
13177
|
+
async function* q_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgnoredReferencesTypes: i, logPartialReferences: a, logReferences: o, state: s, transformation: c }) {
|
|
13178
|
+
let l = r ?? (e === void 0 ? void 0 : new K_(e));
|
|
13168
13179
|
if (l === void 0) throw Error("A Canutes database or legal resolver is required");
|
|
13169
13180
|
let u = new xe("extractTextLinks"), d = {}, f = c === void 0 ? void 0 : _e(c), p = s === void 0 ? {} : structuredClone(s), m = u.timeSync("extractReferences", () => {
|
|
13170
13181
|
let e = [];
|
|
13171
|
-
for (let n of c === void 0 ?
|
|
13182
|
+
for (let n of c === void 0 ? Um(t) : Gm(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);
|
|
13172
13183
|
return e;
|
|
13173
13184
|
}, { inputSize: t.input.length }), h = performance.now();
|
|
13174
|
-
for (let e of m) for (let n of
|
|
13185
|
+
for (let e of m) for (let n of mv(t, e)) {
|
|
13175
13186
|
let r = n.type === "parent-enfant" ? n.parent : n;
|
|
13176
13187
|
switch (r.type) {
|
|
13177
13188
|
case "alinéa":
|
|
@@ -13200,7 +13211,7 @@ async function* G_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13200
13211
|
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`);
|
|
13201
13212
|
break;
|
|
13202
13213
|
case "texte":
|
|
13203
|
-
|
|
13214
|
+
J_({
|
|
13204
13215
|
context: t,
|
|
13205
13216
|
logPartialReferences: a,
|
|
13206
13217
|
reference: e,
|
|
@@ -13216,14 +13227,14 @@ async function* G_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13216
13227
|
phase: "collectDefinitionsAndTextState"
|
|
13217
13228
|
});
|
|
13218
13229
|
let g = /* @__PURE__ */ new Set();
|
|
13219
|
-
for (let e of m) for (let t of
|
|
13220
|
-
let _ =
|
|
13230
|
+
for (let e of m) for (let t of pv(e, { citations: !0 })) g.add(t);
|
|
13231
|
+
let _ = Y_(t, m);
|
|
13221
13232
|
await u.time("preloadActiveArticlesByTextIds", () => l.preloadActiveArticlesByTextIds({
|
|
13222
13233
|
date: n,
|
|
13223
13234
|
nums: g,
|
|
13224
13235
|
textIds: _
|
|
13225
13236
|
}), { count: _.size });
|
|
13226
|
-
let v = await u.time("collectUniqueFallbackArticleNums", () =>
|
|
13237
|
+
let v = await u.time("collectUniqueFallbackArticleNums", () => X_({
|
|
13227
13238
|
context: t,
|
|
13228
13239
|
date: n,
|
|
13229
13240
|
legiResolver: l,
|
|
@@ -13236,7 +13247,7 @@ async function* G_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13236
13247
|
nums: v
|
|
13237
13248
|
}), { count: v.size }), p = s === void 0 ? {} : s;
|
|
13238
13249
|
let y = 0, ee = performance.now();
|
|
13239
|
-
for (let e of m) for await (let r of
|
|
13250
|
+
for (let e of m) for await (let r of yv({
|
|
13240
13251
|
articleDefinitionByNumByTextId: d,
|
|
13241
13252
|
legiResolver: l,
|
|
13242
13253
|
context: t,
|
|
@@ -13253,7 +13264,7 @@ async function* G_({ canutesDb: e, context: t, date: n, legiResolver: r, logIgno
|
|
|
13253
13264
|
phase: "iterReferenceLinks"
|
|
13254
13265
|
}), u.log({ referenceCount: m.length });
|
|
13255
13266
|
}
|
|
13256
|
-
function
|
|
13267
|
+
function J_({ context: e, logPartialReferences: t, reference: n, state: r, text: i }) {
|
|
13257
13268
|
switch (i.nature) {
|
|
13258
13269
|
case "ARRETE":
|
|
13259
13270
|
case "CIRCULAIRE":
|
|
@@ -13324,17 +13335,17 @@ function K_({ context: e, logPartialReferences: t, reference: n, state: r, text:
|
|
|
13324
13335
|
default: i.nature === void 0 ? delete r.textId : c("nature", i.nature);
|
|
13325
13336
|
}
|
|
13326
13337
|
}
|
|
13327
|
-
function
|
|
13338
|
+
function Y_(e, t) {
|
|
13328
13339
|
let n = /* @__PURE__ */ new Set();
|
|
13329
|
-
for (let r of t) for (let t of
|
|
13340
|
+
for (let r of t) for (let t of mv(e, r, { citations: !0 })) {
|
|
13330
13341
|
let e = t.type === "parent-enfant" ? t.parent : t;
|
|
13331
13342
|
e.type === "texte" && e.cid !== void 0 ? n.add(e.cid) : e.type === "article" && e.implicitText?.cid !== void 0 && n.add(e.implicitText.cid);
|
|
13332
13343
|
}
|
|
13333
13344
|
return n;
|
|
13334
13345
|
}
|
|
13335
|
-
async function
|
|
13346
|
+
async function X_({ context: e, date: t, legiResolver: n, logPartialReferences: r, references: i, state: a }) {
|
|
13336
13347
|
let o = /* @__PURE__ */ new Set();
|
|
13337
|
-
for (let s of i) await
|
|
13348
|
+
for (let s of i) await Z_({
|
|
13338
13349
|
articleNums: o,
|
|
13339
13350
|
context: e,
|
|
13340
13351
|
date: t,
|
|
@@ -13345,8 +13356,8 @@ async function J_({ context: e, date: t, legiResolver: n, logPartialReferences:
|
|
|
13345
13356
|
});
|
|
13346
13357
|
return o;
|
|
13347
13358
|
}
|
|
13348
|
-
async function
|
|
13349
|
-
for (let s of
|
|
13359
|
+
async function Z_({ articleNums: e, context: t, date: n, legiResolver: r, logPartialReferences: i, reference: a, state: o }) {
|
|
13360
|
+
for (let s of mv(t, a)) await Q_({
|
|
13350
13361
|
articleNums: e,
|
|
13351
13362
|
atomicOrParentChildReference: s,
|
|
13352
13363
|
context: t,
|
|
@@ -13361,7 +13372,7 @@ async function Y_({ articleNums: e, context: t, date: n, legiResolver: r, logPar
|
|
|
13361
13372
|
if (s !== void 0) {
|
|
13362
13373
|
for (let a of s) if (a.references !== void 0) {
|
|
13363
13374
|
let s = structuredClone(o);
|
|
13364
|
-
for (let o of a.references) await
|
|
13375
|
+
for (let o of a.references) await Z_({
|
|
13365
13376
|
articleNums: e,
|
|
13366
13377
|
context: t,
|
|
13367
13378
|
date: n,
|
|
@@ -13374,7 +13385,7 @@ async function Y_({ articleNums: e, context: t, date: n, legiResolver: r, logPar
|
|
|
13374
13385
|
}
|
|
13375
13386
|
}
|
|
13376
13387
|
}
|
|
13377
|
-
async function
|
|
13388
|
+
async function Q_({ articleNums: e, atomicOrParentChildReference: t, context: n, date: r, legiResolver: i, logPartialReferences: a, reference: o, state: s }) {
|
|
13378
13389
|
let c = t.type === "parent-enfant" ? t.parent : t, l = t.type === "parent-enfant" ? t : void 0;
|
|
13379
13390
|
switch (c.type) {
|
|
13380
13391
|
case "alinéa":
|
|
@@ -13383,7 +13394,7 @@ async function X_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13383
13394
|
case "phrase": break;
|
|
13384
13395
|
case "article":
|
|
13385
13396
|
if (c.definition && s.textId !== void 0) break;
|
|
13386
|
-
await
|
|
13397
|
+
await dv({
|
|
13387
13398
|
article: c,
|
|
13388
13399
|
date: r,
|
|
13389
13400
|
legiResolver: i,
|
|
@@ -13401,7 +13412,7 @@ async function X_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13401
13412
|
case "sous-titre":
|
|
13402
13413
|
case "titre":
|
|
13403
13414
|
if (c.definition && s.textId !== void 0) break;
|
|
13404
|
-
l !== void 0 && await
|
|
13415
|
+
l !== void 0 && await Z_({
|
|
13405
13416
|
articleNums: e,
|
|
13406
13417
|
context: n,
|
|
13407
13418
|
date: r,
|
|
@@ -13412,13 +13423,13 @@ async function X_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13412
13423
|
});
|
|
13413
13424
|
break;
|
|
13414
13425
|
case "texte":
|
|
13415
|
-
|
|
13426
|
+
J_({
|
|
13416
13427
|
context: n,
|
|
13417
13428
|
logPartialReferences: a,
|
|
13418
13429
|
reference: o,
|
|
13419
13430
|
state: s,
|
|
13420
13431
|
text: c
|
|
13421
|
-
}), l !== void 0 && await
|
|
13432
|
+
}), l !== void 0 && await Z_({
|
|
13422
13433
|
articleNums: e,
|
|
13423
13434
|
context: n,
|
|
13424
13435
|
date: r,
|
|
@@ -13431,14 +13442,14 @@ async function X_({ articleNums: e, atomicOrParentChildReference: t, context: n,
|
|
|
13431
13442
|
default: break;
|
|
13432
13443
|
}
|
|
13433
13444
|
}
|
|
13434
|
-
var
|
|
13445
|
+
var $_ = new Set([
|
|
13435
13446
|
"LEGITEXT000005634379",
|
|
13436
13447
|
"LEGITEXT000006069583",
|
|
13437
13448
|
"LEGITEXT000006070933",
|
|
13438
13449
|
"LEGITEXT000006072026",
|
|
13439
13450
|
"LEGITEXT000006073984",
|
|
13440
13451
|
"LEGITEXT000006074096"
|
|
13441
|
-
]),
|
|
13452
|
+
]), ev = new Set([
|
|
13442
13453
|
"LEGITEXT000006069568",
|
|
13443
13454
|
"LEGITEXT000006069569",
|
|
13444
13455
|
"LEGITEXT000006069574",
|
|
@@ -13446,41 +13457,41 @@ var Z_ = new Set([
|
|
|
13446
13457
|
"LEGITEXT000006069577",
|
|
13447
13458
|
"LEGITEXT000006069583"
|
|
13448
13459
|
]);
|
|
13449
|
-
function
|
|
13460
|
+
function tv(e, t, n) {
|
|
13450
13461
|
let r = n.replace(/\s+/gu, " ").trim();
|
|
13451
13462
|
r !== "" && r !== t && e.add(r);
|
|
13452
13463
|
}
|
|
13453
|
-
function
|
|
13464
|
+
function nv(e, t) {
|
|
13454
13465
|
let n = new Set([e]), r = new Set([e]);
|
|
13455
13466
|
for (let i = 0; i < 3; i++) {
|
|
13456
13467
|
let i = /* @__PURE__ */ new Set();
|
|
13457
13468
|
for (let a of r) {
|
|
13458
13469
|
let r = /* @__PURE__ */ new Set();
|
|
13459
|
-
|
|
13460
|
-
for (let t of a.matchAll(/-(?=\p{L})/gu))
|
|
13461
|
-
|
|
13470
|
+
tv(r, e, a.replace(/\s*-\s*/gu, "-")), tv(r, e, a.replace(/^(R\*)\s*(\d)/u, "$1 $2")), t === "LEGITEXT000006069583" && (tv(r, e, a.replace(/^(R)(\d)/u, "$1*$2")), tv(r, e, a.replace(/^(R)(\d)/u, "$1* $2"))), tv(r, e, a.replace(/^R\*/u, "*R")), tv(r, e, a.replace(/^R\*/u, "R"));
|
|
13471
|
+
for (let t of a.matchAll(/-(?=\p{L})/gu)) tv(r, e, `${a.slice(0, t.index)} ${a.slice(t.index + 1)}`);
|
|
13472
|
+
tv(r, e, a.replace(/-O(?=\p{L}|\s|$)/gu, "-0")), tv(r, e, a.replace(/-0(?=\p{L})/gu, "-0 "));
|
|
13462
13473
|
let o = a.match(/^((?:L\s*O|[LRDA])\*?\s*)(\d{4,})$/u);
|
|
13463
13474
|
if (o !== null) {
|
|
13464
13475
|
let [, t, n] = o;
|
|
13465
|
-
for (let i = 2; i < n.length; i++)
|
|
13476
|
+
for (let i = 2; i < n.length; i++) tv(r, e, `${t}${n.slice(0, i)}-${n.slice(i)}`);
|
|
13466
13477
|
}
|
|
13467
|
-
if (/^(?:L\s*O|[LRDA])\*?/u.test(a) &&
|
|
13478
|
+
if (/^(?:L\s*O|[LRDA])\*?/u.test(a) && tv(r, e, a.replace(/\s+(\d+)$/u, "-$1")), t === "LEGITEXT000006069576" && /^0\d+$/u.test(a) && tv(r, e, String(Number(a))), $_.has(t) && /^\d/u.test(a)) for (let t of [
|
|
13468
13479
|
"L",
|
|
13469
13480
|
"R",
|
|
13470
13481
|
"D",
|
|
13471
13482
|
"A",
|
|
13472
13483
|
"R*",
|
|
13473
13484
|
"*R"
|
|
13474
|
-
])
|
|
13475
|
-
|
|
13485
|
+
]) tv(r, e, `${t}${a}`);
|
|
13486
|
+
tv(r, e, a.replace(/(\d)\s+0(?=\s*-?\s*\p{L})/gu, "$1-0")), tv(r, e, a.replace(/(\p{L})\s+(\d{2})-([\p{L}])$/u, "$1-$2 $3"));
|
|
13476
13487
|
for (let e of r) n.has(e) || (n.add(e), i.add(e));
|
|
13477
13488
|
}
|
|
13478
13489
|
r = i;
|
|
13479
13490
|
}
|
|
13480
13491
|
return n.delete(e), [...n];
|
|
13481
13492
|
}
|
|
13482
|
-
function
|
|
13483
|
-
if (!
|
|
13493
|
+
function rv(e, t) {
|
|
13494
|
+
if (!ev.has(t)) return [];
|
|
13484
13495
|
let n = [], r = e;
|
|
13485
13496
|
for (let e = 0; e < 4; e++) {
|
|
13486
13497
|
let e = r.replace(/(?:\s*-\s*|\s+)(?:[IVX]+|[1-9]\d*)(?:\s+(?:bis|ter|quater|quinquies|sexies))?$/iu, "").trim();
|
|
@@ -13489,10 +13500,10 @@ function tv(e, t) {
|
|
|
13489
13500
|
}
|
|
13490
13501
|
return n;
|
|
13491
13502
|
}
|
|
13492
|
-
function
|
|
13503
|
+
function iv(e, t) {
|
|
13493
13504
|
return `${e}\0${t}`;
|
|
13494
13505
|
}
|
|
13495
|
-
var
|
|
13506
|
+
var av = new Map([
|
|
13496
13507
|
...[
|
|
13497
13508
|
"1594 F quinquies A",
|
|
13498
13509
|
"1594 F quinquies-D",
|
|
@@ -13500,7 +13511,7 @@ var rv = new Map([
|
|
|
13500
13511
|
"1594 F quinquies E II",
|
|
13501
13512
|
"1594 F quinquies- E-I",
|
|
13502
13513
|
"1594 F quinquies K"
|
|
13503
|
-
].map((e) => [
|
|
13514
|
+
].map((e) => [iv("LEGITEXT000006069577", e), {
|
|
13504
13515
|
num: "1594 F quinquies",
|
|
13505
13516
|
textId: "LEGITEXT000006069577"
|
|
13506
13517
|
}]),
|
|
@@ -13509,7 +13520,7 @@ var rv = new Map([
|
|
|
13509
13520
|
"1594-0 G-A",
|
|
13510
13521
|
"1594-0 G-A-II",
|
|
13511
13522
|
"1594-0 G-A-VI"
|
|
13512
|
-
].map((e) => [
|
|
13523
|
+
].map((e) => [iv("LEGITEXT000006069577", e), {
|
|
13513
13524
|
num: "1594-0 G",
|
|
13514
13525
|
textId: "LEGITEXT000006069577"
|
|
13515
13526
|
}]),
|
|
@@ -13521,23 +13532,23 @@ var rv = new Map([
|
|
|
13521
13532
|
["38 B", "LEGITEXT000006069574"],
|
|
13522
13533
|
["49 octies D", "LEGITEXT000006069574"],
|
|
13523
13534
|
["199-0", "LEGITEXT000006069576"]
|
|
13524
|
-
].map(([e, t]) => [
|
|
13535
|
+
].map(([e, t]) => [iv("LEGITEXT000006069577", e), {
|
|
13525
13536
|
num: e,
|
|
13526
13537
|
textId: t
|
|
13527
13538
|
}]),
|
|
13528
|
-
[
|
|
13539
|
+
[iv("LEGITEXT000006069577", "L173"), {
|
|
13529
13540
|
num: "173",
|
|
13530
13541
|
textId: "LEGITEXT000006069577"
|
|
13531
13542
|
}],
|
|
13532
|
-
[
|
|
13543
|
+
[iv("LEGITEXT000006069583", "L38 B"), {
|
|
13533
13544
|
num: "L38",
|
|
13534
13545
|
textId: "LEGITEXT000006069583"
|
|
13535
13546
|
}],
|
|
13536
|
-
...["L311-13 C", "L311-13 D"].map((e) => [
|
|
13547
|
+
...["L311-13 C", "L311-13 D"].map((e) => [iv("LEGITEXT000006070158", e), {
|
|
13537
13548
|
num: "L311-13",
|
|
13538
13549
|
textId: "LEGITEXT000006070158"
|
|
13539
13550
|
}]),
|
|
13540
|
-
[
|
|
13551
|
+
[iv("LEGITEXT000006071154", "226-14"), {
|
|
13541
13552
|
num: "226-14",
|
|
13542
13553
|
textId: "LEGITEXT000006070719"
|
|
13543
13554
|
}],
|
|
@@ -13545,28 +13556,62 @@ var rv = new Map([
|
|
|
13545
13556
|
"1300-1",
|
|
13546
13557
|
"1300-2",
|
|
13547
13558
|
"1300-4"
|
|
13548
|
-
].map((e) => [
|
|
13559
|
+
].map((e) => [iv("LEGITEXT000006070721", e), {
|
|
13549
13560
|
num: e,
|
|
13550
13561
|
textId: "LEGITEXT000006070716"
|
|
13551
13562
|
}])
|
|
13552
|
-
]),
|
|
13553
|
-
[
|
|
13554
|
-
[
|
|
13555
|
-
[
|
|
13556
|
-
[
|
|
13563
|
+
]), ov = new Map([
|
|
13564
|
+
[iv("LEGITEXT000006069574", "382-0 C bis"), "LEGIARTI000036256024"],
|
|
13565
|
+
[iv("LEGITEXT000006069577", "1586 quinquies"), "LEGIARTI000023380915"],
|
|
13566
|
+
[iv("LEGITEXT000006069577", "1681 sexies"), "LEGIARTI000037986425"],
|
|
13567
|
+
[iv("LEGITEXT000006069577", "286"), "LEGIARTI000033815246"]
|
|
13557
13568
|
]);
|
|
13558
|
-
function
|
|
13559
|
-
let
|
|
13569
|
+
function sv(e, t) {
|
|
13570
|
+
let n = /* @__PURE__ */ new Map(), r = (t, r) => {
|
|
13571
|
+
let i = r.replace(/[.·]/gu, "-").replace(/\s*-\s*/gu, "-").replace(/\s+/gu, "-").replace(/-{2,}/gu, "-").replace(/^-|-$/gu, "").replace(/-(?=\s)/gu, "").replace(/\s+/gu, " ").trim();
|
|
13572
|
+
i === "" || i === e || !/^(?:[LRDA]\s*)?\d+(?:-\d+)*(?:\s+(?:bis|ter|quater|quinquies|sexies|septies))?$/iu.test(i) || n.set(`${t}\0${i}`, {
|
|
13573
|
+
textId: t,
|
|
13574
|
+
num: i
|
|
13575
|
+
});
|
|
13576
|
+
}, i = /^(.*\d)\s*[,,;]?\s*(css|cgi|cibs|lpf|cch|cja|casf|cgct|coj|cpi|csp|ceseda|cmf|comofi|cpce)$/iu.exec(e);
|
|
13577
|
+
if (i !== null) {
|
|
13578
|
+
let e = rm(i[2]);
|
|
13579
|
+
e !== void 0 && r(e, i[1]);
|
|
13580
|
+
}
|
|
13581
|
+
let a = /^(.*\d)[\s,;]+(?:du\s+|de\s+la\s+|de\s+l')?(code\b[\w'\s]*)$/iu.exec(e);
|
|
13582
|
+
if (a !== null) {
|
|
13583
|
+
let e = rm(a[2]);
|
|
13584
|
+
e !== void 0 && r(e, a[1]);
|
|
13585
|
+
}
|
|
13586
|
+
t !== void 0 && r(t, e);
|
|
13587
|
+
let o = [];
|
|
13588
|
+
for (let { textId: e, num: t } of n.values()) if (/^[LRDA]/iu.test(t)) o.push({
|
|
13589
|
+
textId: e,
|
|
13590
|
+
num: t
|
|
13591
|
+
});
|
|
13592
|
+
else for (let n of [
|
|
13593
|
+
"L",
|
|
13594
|
+
"R",
|
|
13595
|
+
"D",
|
|
13596
|
+
"A"
|
|
13597
|
+
]) o.push({
|
|
13598
|
+
textId: e,
|
|
13599
|
+
num: `${n}${t}`
|
|
13600
|
+
});
|
|
13601
|
+
return o;
|
|
13602
|
+
}
|
|
13603
|
+
function cv(e) {
|
|
13604
|
+
let t = new Set(e.flatMap(({ num: e, textId: t }) => e === null || t === null ? [] : [iv(t, e)]));
|
|
13560
13605
|
if (t.size !== 1) return;
|
|
13561
|
-
let n =
|
|
13606
|
+
let n = ov.get([...t][0]);
|
|
13562
13607
|
if (n !== void 0) return e.find(({ id: e }) => e === n);
|
|
13563
13608
|
}
|
|
13564
|
-
function
|
|
13609
|
+
function lv(e) {
|
|
13565
13610
|
if (e.length < 2) return;
|
|
13566
13611
|
let [t, ...n] = [...e].sort((e, t) => t.dateDebut.localeCompare(e.dateDebut));
|
|
13567
13612
|
if (!n.some(({ dateDebut: e }) => e >= t.dateDebut)) return t;
|
|
13568
13613
|
}
|
|
13569
|
-
async function
|
|
13614
|
+
async function uv({ alternatives: e, date: t, legiResolver: n }) {
|
|
13570
13615
|
let r = [];
|
|
13571
13616
|
for (let { num: i, textId: a } of e) {
|
|
13572
13617
|
let e = (await n.getActiveArticlesByTextAndNum({
|
|
@@ -13578,7 +13623,7 @@ async function sv({ alternatives: e, date: t, legiResolver: n }) {
|
|
|
13578
13623
|
}
|
|
13579
13624
|
return r.length === 1 ? r[0] : [];
|
|
13580
13625
|
}
|
|
13581
|
-
async function
|
|
13626
|
+
async function dv({ article: e, date: t, legiResolver: n, state: r }) {
|
|
13582
13627
|
if (e.present || e.num === void 0) return !1;
|
|
13583
13628
|
let i = e.implicitText?.cid ?? r.textId;
|
|
13584
13629
|
return !(i !== void 0 && (await n.getActiveArticlesByTextAndNum({
|
|
@@ -13591,7 +13636,7 @@ async function cv({ article: e, date: t, legiResolver: n, state: r }) {
|
|
|
13591
13636
|
textId: r.defaultTextId
|
|
13592
13637
|
})).length > 0);
|
|
13593
13638
|
}
|
|
13594
|
-
async function*
|
|
13639
|
+
async function* fv({ ancestors: e, article: t, legiResolver: n, context: r, date: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13595
13640
|
if (t.present) return;
|
|
13596
13641
|
let l = [], u = t.implicitText?.cid ?? c.textId;
|
|
13597
13642
|
u === "LEGITEXT000006070716" && t.num !== void 0 && /^[LR]\d/u.test(t.num) && (u = "LEGITEXT000025024948");
|
|
@@ -13601,28 +13646,34 @@ async function* lv({ ancestors: e, article: t, legiResolver: n, context: r, date
|
|
|
13601
13646
|
num: t.num,
|
|
13602
13647
|
textId: u
|
|
13603
13648
|
}), l.length > 0 && (d = l)), l.length === 0 && t.num !== void 0 && u !== void 0) {
|
|
13604
|
-
let e =
|
|
13605
|
-
e !== void 0 && (l = await
|
|
13649
|
+
let e = av.get(iv(u, t.num));
|
|
13650
|
+
e !== void 0 && (l = await uv({
|
|
13606
13651
|
alternatives: [e],
|
|
13607
13652
|
date: i,
|
|
13608
13653
|
legiResolver: n
|
|
13609
13654
|
}));
|
|
13610
13655
|
}
|
|
13611
|
-
|
|
13612
|
-
alternatives:
|
|
13656
|
+
l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await uv({
|
|
13657
|
+
alternatives: nv(t.num, u).map((e) => ({
|
|
13613
13658
|
num: e,
|
|
13614
13659
|
textId: u
|
|
13615
13660
|
})),
|
|
13616
13661
|
date: i,
|
|
13617
13662
|
legiResolver: n
|
|
13618
|
-
})), l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await
|
|
13619
|
-
alternatives:
|
|
13663
|
+
})), l.length === 0 && t.num !== void 0 && u !== void 0 && (l = await uv({
|
|
13664
|
+
alternatives: rv(t.num, u).map((e) => ({
|
|
13620
13665
|
num: e,
|
|
13621
13666
|
textId: u
|
|
13622
13667
|
})),
|
|
13623
13668
|
date: i,
|
|
13624
13669
|
legiResolver: n
|
|
13625
|
-
}))
|
|
13670
|
+
}));
|
|
13671
|
+
let f = [];
|
|
13672
|
+
if (l.length === 0 && t.num !== void 0 && (f = sv(t.num, u), f.length > 0 && (l = await uv({
|
|
13673
|
+
alternatives: f,
|
|
13674
|
+
date: i,
|
|
13675
|
+
legiResolver: n
|
|
13676
|
+
}))), l.length === 0 && c.defaultTextId !== void 0 && c.defaultTextId !== u && (l = await n.getActiveArticlesByTextAndNum({
|
|
13626
13677
|
date: i,
|
|
13627
13678
|
num: t.num,
|
|
13628
13679
|
textId: c.defaultTextId
|
|
@@ -13636,30 +13687,37 @@ async function* lv({ ancestors: e, article: t, legiResolver: n, context: r, date
|
|
|
13636
13687
|
if (e.length === 1) c.articleId = e[0].id;
|
|
13637
13688
|
else {
|
|
13638
13689
|
e.length !== 0 && (l = e);
|
|
13639
|
-
let n =
|
|
13690
|
+
let n = cv(l);
|
|
13640
13691
|
if (n !== void 0) c.articleId = n.id;
|
|
13641
13692
|
else {
|
|
13642
|
-
let n =
|
|
13693
|
+
let n = lv(l.filter(({ dateDebut: e, dateFin: t }) => e <= i && t > i));
|
|
13643
13694
|
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;
|
|
13644
13695
|
}
|
|
13645
13696
|
}
|
|
13646
13697
|
}
|
|
13647
|
-
let
|
|
13698
|
+
let p = e === void 0 ? t.position : t.position.start < e[0].position.start ? {
|
|
13648
13699
|
start: t.position.start,
|
|
13649
13700
|
stop: e[0].position.stop
|
|
13650
13701
|
} : {
|
|
13651
13702
|
start: e[0].position.start,
|
|
13652
13703
|
stop: t.position.stop
|
|
13653
|
-
},
|
|
13704
|
+
}, m;
|
|
13705
|
+
if (c.articleId === void 0 && t.num !== void 0 && f.length === 1) {
|
|
13706
|
+
let e = await n.getArticleHistoryInfo({
|
|
13707
|
+
num: f[0].num,
|
|
13708
|
+
textId: f[0].textId
|
|
13709
|
+
});
|
|
13710
|
+
e !== void 0 && (m = e.articleId);
|
|
13711
|
+
}
|
|
13654
13712
|
if (c.articleId === void 0 && t.num !== void 0) {
|
|
13655
13713
|
if (d.length > 0 && !d.some(({ dateDebut: e, dateFin: t }) => e <= i && t > i)) {
|
|
13656
13714
|
let e = await n.getArticleHistoryInfo({
|
|
13657
13715
|
num: t.num,
|
|
13658
13716
|
textId: u
|
|
13659
13717
|
});
|
|
13660
|
-
e !== void 0 && (
|
|
13661
|
-
} else if (d.length === 0 && u !== void 0) {
|
|
13662
|
-
let e = [], r = new Set([...
|
|
13718
|
+
e !== void 0 && (m = e.articleId);
|
|
13719
|
+
} else if (d.length === 0 && u !== void 0 && f.length !== 1) {
|
|
13720
|
+
let e = [], r = new Set([...rv(t.num, u), ...nv(t.num, u)]);
|
|
13663
13721
|
for (let t of r) {
|
|
13664
13722
|
let r = await n.getActiveArticlesByTextAndNum({
|
|
13665
13723
|
date: i,
|
|
@@ -13679,105 +13737,105 @@ async function* lv({ ancestors: e, article: t, legiResolver: n, context: r, date
|
|
|
13679
13737
|
num: e[0],
|
|
13680
13738
|
textId: u
|
|
13681
13739
|
});
|
|
13682
|
-
t !== void 0 && (
|
|
13740
|
+
t !== void 0 && (m = t.articleId);
|
|
13683
13741
|
}
|
|
13684
13742
|
}
|
|
13685
13743
|
}
|
|
13686
13744
|
yield Object.fromEntries(Object.entries({
|
|
13687
13745
|
article: t,
|
|
13688
13746
|
articleId: c.articleId,
|
|
13689
|
-
historyArticleId:
|
|
13690
|
-
originalTransformation: o === void 0 ? void 0 : v(o,
|
|
13691
|
-
position:
|
|
13747
|
+
historyArticleId: m,
|
|
13748
|
+
originalTransformation: o === void 0 ? void 0 : v(o, p),
|
|
13749
|
+
position: p,
|
|
13692
13750
|
reference: s,
|
|
13693
13751
|
type: "external_article"
|
|
13694
13752
|
}).filter(([, e]) => e !== void 0));
|
|
13695
13753
|
}
|
|
13696
|
-
function*
|
|
13754
|
+
function* pv(e, { citations: t = !1 } = {}) {
|
|
13697
13755
|
switch (e.type) {
|
|
13698
13756
|
case "article":
|
|
13699
13757
|
e.num !== void 0 && (yield e.num);
|
|
13700
13758
|
break;
|
|
13701
13759
|
case "bounded-interval":
|
|
13702
|
-
yield*
|
|
13760
|
+
yield* pv(e.first, { citations: t }), yield* pv(e.last, { citations: t });
|
|
13703
13761
|
break;
|
|
13704
13762
|
case "counted-interval":
|
|
13705
|
-
yield*
|
|
13763
|
+
yield* pv(e.first, { citations: t });
|
|
13706
13764
|
break;
|
|
13707
13765
|
case "enumeration":
|
|
13708
13766
|
case "exclusion":
|
|
13709
|
-
yield*
|
|
13767
|
+
yield* pv(e.left, { citations: t }), yield* pv(e.right, { citations: t });
|
|
13710
13768
|
break;
|
|
13711
13769
|
case "parent-enfant":
|
|
13712
|
-
yield*
|
|
13770
|
+
yield* pv(e.parent, { citations: t }), yield* pv(e.child, { citations: t });
|
|
13713
13771
|
break;
|
|
13714
13772
|
case "reference_et_action":
|
|
13715
|
-
if (yield*
|
|
13773
|
+
if (yield* pv(e.reference, { citations: t }), t) {
|
|
13716
13774
|
let { originalCitations: n } = e.action;
|
|
13717
13775
|
if (n !== void 0) {
|
|
13718
|
-
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield*
|
|
13776
|
+
for (let e of n) if (e.references !== void 0) for (let n of e.references) yield* pv(n, { citations: t });
|
|
13719
13777
|
}
|
|
13720
13778
|
}
|
|
13721
13779
|
break;
|
|
13722
13780
|
}
|
|
13723
13781
|
}
|
|
13724
|
-
function*
|
|
13782
|
+
function* mv(e, t, { citations: n = !1 } = {}) {
|
|
13725
13783
|
switch (t.type) {
|
|
13726
13784
|
case "bounded-interval":
|
|
13727
|
-
yield*
|
|
13785
|
+
yield* mv(e, t.first, { citations: n }), yield* mv(e, t.last, { citations: n });
|
|
13728
13786
|
break;
|
|
13729
13787
|
case "counted-interval":
|
|
13730
|
-
yield*
|
|
13788
|
+
yield* mv(e, t.first, { citations: n });
|
|
13731
13789
|
break;
|
|
13732
13790
|
case "enumeration":
|
|
13733
13791
|
case "exclusion":
|
|
13734
|
-
yield*
|
|
13792
|
+
yield* mv(e, t.left, { citations: n }), yield* mv(e, t.right, { citations: n });
|
|
13735
13793
|
break;
|
|
13736
13794
|
case "reference_et_action":
|
|
13737
|
-
if (yield*
|
|
13795
|
+
if (yield* mv(e, t.reference, { citations: n }), n) {
|
|
13738
13796
|
let { originalCitations: r } = t.action;
|
|
13739
13797
|
if (r !== void 0) {
|
|
13740
|
-
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield*
|
|
13798
|
+
for (let t of r) if (t.references !== void 0) for (let r of t.references) yield* mv(e, r, { citations: n });
|
|
13741
13799
|
}
|
|
13742
13800
|
}
|
|
13743
13801
|
break;
|
|
13744
13802
|
default: yield t;
|
|
13745
13803
|
}
|
|
13746
13804
|
}
|
|
13747
|
-
function*
|
|
13805
|
+
function* hv(e, t) {
|
|
13748
13806
|
if (t.type === "texte") console.error(`iterDeepestDivisionsOrArticles must not be called with a text:\n${JSON.stringify(t, null, 2)}`);
|
|
13749
13807
|
else if (dt(t) || t.type === "article") yield t;
|
|
13750
13808
|
else if (!(ft(t) || t.type === "incomplete-header")) switch (t.type) {
|
|
13751
13809
|
case "bounded-interval":
|
|
13752
|
-
yield*
|
|
13810
|
+
yield* hv(e, t.first), yield* hv(e, t.last);
|
|
13753
13811
|
break;
|
|
13754
13812
|
case "counted-interval":
|
|
13755
|
-
yield*
|
|
13813
|
+
yield* hv(e, t.first);
|
|
13756
13814
|
break;
|
|
13757
13815
|
case "enumeration":
|
|
13758
13816
|
case "exclusion":
|
|
13759
|
-
yield*
|
|
13817
|
+
yield* hv(e, t.left), yield* hv(e, t.right);
|
|
13760
13818
|
break;
|
|
13761
13819
|
case "parent-enfant": {
|
|
13762
|
-
let n = [...
|
|
13763
|
-
n.length === 0 ? yield*
|
|
13820
|
+
let n = [...hv(e, t.child)];
|
|
13821
|
+
n.length === 0 ? yield* hv(e, t.parent) : yield* n;
|
|
13764
13822
|
break;
|
|
13765
13823
|
}
|
|
13766
13824
|
case "reference_et_action": {
|
|
13767
|
-
yield*
|
|
13825
|
+
yield* hv(e, t.reference);
|
|
13768
13826
|
let { originalCitations: n } = t.action;
|
|
13769
13827
|
if (n !== void 0) {
|
|
13770
|
-
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield*
|
|
13828
|
+
for (let t of n) if (t.references !== void 0) for (let n of t.references) yield* hv(e, n);
|
|
13771
13829
|
}
|
|
13772
13830
|
break;
|
|
13773
13831
|
}
|
|
13774
13832
|
default: c("iterDeepestDivisionsOrArticles reference.type", t);
|
|
13775
13833
|
}
|
|
13776
13834
|
}
|
|
13777
|
-
function
|
|
13835
|
+
function gv(e) {
|
|
13778
13836
|
return e?.split(":")[0].trim().toLowerCase().split(/\s+/).map((e) => e.trim()).filter((e) => e !== "").join(" ");
|
|
13779
13837
|
}
|
|
13780
|
-
async function*
|
|
13838
|
+
async function* _v({ ancestors: e, legiResolver: t, context: n, date: r, division: i, divisionChildReference: a, logIgnoredReferencesTypes: o, logPartialReferences: s, originalPositionsFromTransformedIterator: c, parentSectionChildren: l, reference: u, state: d }) {
|
|
13781
13839
|
if (i.present) return;
|
|
13782
13840
|
let f;
|
|
13783
13841
|
if (l === void 0 && d.textId !== void 0 && (l = await t.getDirectSectionChildren({
|
|
@@ -13785,20 +13843,20 @@ async function* mv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13785
13843
|
parentPath: d.textId
|
|
13786
13844
|
})), l !== void 0) {
|
|
13787
13845
|
for (let e of l) {
|
|
13788
|
-
let t =
|
|
13846
|
+
let t = gv(e.title);
|
|
13789
13847
|
if (t !== void 0) {
|
|
13790
13848
|
let n = !1;
|
|
13791
|
-
if (i.index !== void 0 && (n =
|
|
13849
|
+
if (i.index !== void 0 && (n = vv(i.type, i.index).some((e) => e === t)), !n && i.num !== void 0 && (n = `${i.type} ${i.num.toLowerCase()}` === t), n) {
|
|
13792
13850
|
f = e;
|
|
13793
13851
|
break;
|
|
13794
13852
|
}
|
|
13795
13853
|
}
|
|
13796
13854
|
}
|
|
13797
13855
|
if (f === void 0 && (f = l.find((e) => {
|
|
13798
|
-
let t =
|
|
13856
|
+
let t = gv(e.title)?.split(/\s+/);
|
|
13799
13857
|
return t !== void 0 && t.length === 2 && ot.includes(t[0]) && t[1] === "législative";
|
|
13800
13858
|
}), f !== void 0)) {
|
|
13801
|
-
let e =
|
|
13859
|
+
let e = gv(f.title).split(/\s+/), t = {
|
|
13802
13860
|
start: i.position.stop,
|
|
13803
13861
|
stop: i.position.stop
|
|
13804
13862
|
}, n = c === void 0 ? void 0 : v(c, t), r = Object.fromEntries(Object.entries({
|
|
@@ -13816,8 +13874,8 @@ async function* mv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13816
13874
|
}).filter(([, e]) => e !== void 0)), i = r;
|
|
13817
13875
|
}
|
|
13818
13876
|
}
|
|
13819
|
-
let p = a === void 0 ? [] : [...
|
|
13820
|
-
if (a !== void 0) for (let l of
|
|
13877
|
+
let p = a === void 0 ? [] : [...hv(n, a.child)], m = 0;
|
|
13878
|
+
if (a !== void 0) for (let l of mv(n, a.child)) {
|
|
13821
13879
|
let h = l.type === "parent-enfant" ? l.parent : l, g = l.type === "parent-enfant" ? l : void 0;
|
|
13822
13880
|
switch (h.type) {
|
|
13823
13881
|
case "alinéa":
|
|
@@ -13825,7 +13883,7 @@ async function* mv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13825
13883
|
case "item":
|
|
13826
13884
|
case "phrase": break;
|
|
13827
13885
|
case "article":
|
|
13828
|
-
yield*
|
|
13886
|
+
yield* fv({
|
|
13829
13887
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13830
13888
|
article: h,
|
|
13831
13889
|
legiResolver: t,
|
|
@@ -13851,7 +13909,7 @@ async function* mv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13851
13909
|
f !== void 0 && (a = await t.getDirectSectionChildren({
|
|
13852
13910
|
date: r,
|
|
13853
13911
|
parentPath: f.path
|
|
13854
|
-
})), yield*
|
|
13912
|
+
})), yield* _v({
|
|
13855
13913
|
ancestors: p.length === 1 ? [...e ?? [], i] : void 0,
|
|
13856
13914
|
legiResolver: t,
|
|
13857
13915
|
context: n,
|
|
@@ -13889,7 +13947,7 @@ async function* mv({ ancestors: e, legiResolver: t, context: n, date: r, divisio
|
|
|
13889
13947
|
}).filter(([, e]) => e !== void 0));
|
|
13890
13948
|
}
|
|
13891
13949
|
}
|
|
13892
|
-
function*
|
|
13950
|
+
function* vv(e, t) {
|
|
13893
13951
|
let n = Math.floor(t), r = Math.floor((t - n) * 1e3);
|
|
13894
13952
|
if (r === 0) {
|
|
13895
13953
|
for (let t of re(n)) yield `${t.toLowerCase()} ${e}`;
|
|
@@ -13899,9 +13957,9 @@ function* hv(e, t) {
|
|
|
13899
13957
|
for (let r of f(n)) yield `${e} ${t} ${r.toLowerCase()}`;
|
|
13900
13958
|
}
|
|
13901
13959
|
}
|
|
13902
|
-
async function*
|
|
13960
|
+
async function* yv({ articleDefinitionByNumByTextId: e, legiResolver: t, context: n, date: r, logIgnoredReferencesTypes: i, logPartialReferences: a, originalPositionsFromTransformedIterator: o, reference: s, state: c }) {
|
|
13903
13961
|
let l = e ?? {}, u = c === void 0 ? {} : c;
|
|
13904
|
-
for (let e of
|
|
13962
|
+
for (let e of mv(n, s)) {
|
|
13905
13963
|
let c = e.type === "parent-enfant" ? e.parent : e, d = e.type === "parent-enfant" ? e : void 0;
|
|
13906
13964
|
switch (c.type) {
|
|
13907
13965
|
case "alinéa":
|
|
@@ -13912,7 +13970,7 @@ async function* gv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13912
13970
|
if (c.definition && u.textId !== void 0) {
|
|
13913
13971
|
let e = l[u.textId]?.[c.num];
|
|
13914
13972
|
e !== void 0 && (e.originalTransformation === void 0 && o !== void 0 && (e.originalTransformation = v(o, e.position)), yield e);
|
|
13915
|
-
} else yield*
|
|
13973
|
+
} else yield* fv({
|
|
13916
13974
|
article: c,
|
|
13917
13975
|
legiResolver: t,
|
|
13918
13976
|
context: n,
|
|
@@ -13933,7 +13991,7 @@ async function* gv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13933
13991
|
case "sous-sous-paragraphe":
|
|
13934
13992
|
case "sous-titre":
|
|
13935
13993
|
case "titre":
|
|
13936
|
-
c.definition && u.textId !== void 0 || (yield*
|
|
13994
|
+
c.definition && u.textId !== void 0 || (yield* _v({
|
|
13937
13995
|
legiResolver: t,
|
|
13938
13996
|
context: n,
|
|
13939
13997
|
date: r,
|
|
@@ -13947,15 +14005,15 @@ async function* gv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13947
14005
|
}));
|
|
13948
14006
|
break;
|
|
13949
14007
|
case "texte": {
|
|
13950
|
-
|
|
14008
|
+
J_({
|
|
13951
14009
|
context: n,
|
|
13952
14010
|
logPartialReferences: a,
|
|
13953
14011
|
reference: s,
|
|
13954
14012
|
state: u,
|
|
13955
14013
|
text: c
|
|
13956
14014
|
});
|
|
13957
|
-
let e = d === void 0 ? [] : [...
|
|
13958
|
-
if (d !== void 0) for (let f of
|
|
14015
|
+
let e = d === void 0 ? [] : [...hv(n, d.child)], l = 0;
|
|
14016
|
+
if (d !== void 0) for (let f of mv(n, d.child)) {
|
|
13959
14017
|
let p = f.type === "parent-enfant" ? f.parent : f, m = f.type === "parent-enfant" ? f : void 0;
|
|
13960
14018
|
switch (p.type) {
|
|
13961
14019
|
case "alinéa":
|
|
@@ -13963,7 +14021,7 @@ async function* gv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13963
14021
|
case "item":
|
|
13964
14022
|
case "phrase": break;
|
|
13965
14023
|
case "article":
|
|
13966
|
-
yield*
|
|
14024
|
+
yield* fv({
|
|
13967
14025
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13968
14026
|
article: p,
|
|
13969
14027
|
legiResolver: t,
|
|
@@ -13989,7 +14047,7 @@ async function* gv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
13989
14047
|
u.textId !== void 0 && (d = await t.getDirectSectionChildren({
|
|
13990
14048
|
date: r,
|
|
13991
14049
|
parentPath: u.textId
|
|
13992
|
-
})), yield*
|
|
14050
|
+
})), yield* _v({
|
|
13993
14051
|
ancestors: e.length === 1 ? [c] : void 0,
|
|
13994
14052
|
legiResolver: t,
|
|
13995
14053
|
context: n,
|
|
@@ -14040,7 +14098,7 @@ async function* gv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
14040
14098
|
if (e !== void 0) {
|
|
14041
14099
|
for (let s of e) if (s.references !== void 0) {
|
|
14042
14100
|
let e = structuredClone(u);
|
|
14043
|
-
for (let c of s.references) yield*
|
|
14101
|
+
for (let c of s.references) yield* yv({
|
|
14044
14102
|
articleDefinitionByNumByTextId: l,
|
|
14045
14103
|
legiResolver: t,
|
|
14046
14104
|
context: n,
|
|
@@ -14057,13 +14115,13 @@ async function* gv({ articleDefinitionByNumByTextId: e, legiResolver: t, context
|
|
|
14057
14115
|
}
|
|
14058
14116
|
//#endregion
|
|
14059
14117
|
//#region src/lib/extractors/table_of_contents.ts
|
|
14060
|
-
function
|
|
14118
|
+
function bv(e) {
|
|
14061
14119
|
let t = e;
|
|
14062
14120
|
return t.items ?? [...t.articles ?? [], ...t.divisions ?? []];
|
|
14063
14121
|
}
|
|
14064
|
-
function*
|
|
14122
|
+
function* xv({ context: e, tableOfContents: t, transformation: n }) {
|
|
14065
14123
|
let r = 0, i = _e(n);
|
|
14066
|
-
for (let n of
|
|
14124
|
+
for (let n of Cv(t)) {
|
|
14067
14125
|
let t = n.line.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = RegExp(`^${t}$`, "m");
|
|
14068
14126
|
a.lastIndex = r;
|
|
14069
14127
|
let o = a.exec(e.input);
|
|
@@ -14075,7 +14133,7 @@ function* vv({ context: e, tableOfContents: t, transformation: n }) {
|
|
|
14075
14133
|
l.originalTransformation = c, l.position = s, yield l, r = s.stop;
|
|
14076
14134
|
}
|
|
14077
14135
|
}
|
|
14078
|
-
function
|
|
14136
|
+
function Sv(e) {
|
|
14079
14137
|
let t = new n(e), r = { items: [] }, i = [];
|
|
14080
14138
|
for (let e of Tn(t)) if (dt(e)) {
|
|
14081
14139
|
let n = i.findIndex(({ type: t }) => t === e.type);
|
|
@@ -14093,14 +14151,14 @@ function yv(e) {
|
|
|
14093
14151
|
else throw Error(`Unexpected type "${e.type}" in definition:\n${JSON.stringify(e, null, 2)}`);
|
|
14094
14152
|
return r;
|
|
14095
14153
|
}
|
|
14096
|
-
function*
|
|
14154
|
+
function* Cv(e) {
|
|
14097
14155
|
e.type !== void 0 && (yield e);
|
|
14098
|
-
for (let t of
|
|
14156
|
+
for (let t of bv(e)) t.type === "article" ? yield t : yield* Cv(t);
|
|
14099
14157
|
}
|
|
14100
14158
|
//#endregion
|
|
14101
14159
|
//#region src/lib/links.ts
|
|
14102
|
-
var
|
|
14103
|
-
function
|
|
14160
|
+
var wv = ["Exploratrice", "Forgejo"];
|
|
14161
|
+
function Tv(e, t, n) {
|
|
14104
14162
|
if (n.match(Ke) === null) throw Error(`Unknown ID format: ${n}`);
|
|
14105
14163
|
switch (e) {
|
|
14106
14164
|
case "Exploratrice": return new URL(`legifrance/articles/${n}/versions`, t).toString();
|
|
@@ -14108,7 +14166,7 @@ function Sv(e, t, n) {
|
|
|
14108
14166
|
default: c("urlFromArticleVersionsId linkType", e);
|
|
14109
14167
|
}
|
|
14110
14168
|
}
|
|
14111
|
-
function
|
|
14169
|
+
function Ev(e, t, n) {
|
|
14112
14170
|
let r = n.match(Ke);
|
|
14113
14171
|
if (r === null) throw Error(`Unknown ID format: ${n}`);
|
|
14114
14172
|
switch (e) {
|
|
@@ -14129,19 +14187,19 @@ function Cv(e, t, n) {
|
|
|
14129
14187
|
}
|
|
14130
14188
|
//#endregion
|
|
14131
14189
|
//#region src/lib/linkers/html.ts
|
|
14132
|
-
function
|
|
14190
|
+
function Dv(e, t) {
|
|
14133
14191
|
if (e !== void 0) return e;
|
|
14134
|
-
if (t !== void 0) return new
|
|
14192
|
+
if (t !== void 0) return new K_(t);
|
|
14135
14193
|
throw Error("A Canutes database or legal resolver is required");
|
|
14136
14194
|
}
|
|
14137
|
-
function
|
|
14195
|
+
function Ov(e, t) {
|
|
14138
14196
|
return t.type === "reference_et_action" ? JSON.stringify({
|
|
14139
14197
|
...e,
|
|
14140
14198
|
action: t.action
|
|
14141
14199
|
}) : JSON.stringify(e);
|
|
14142
14200
|
}
|
|
14143
|
-
async function
|
|
14144
|
-
let h = new xe("addLinksToHtml"), g =
|
|
14201
|
+
async function kv({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl: o, linkType: s, logIgnoredReferencesTypes: l, logPartialReferences: u, logReferences: d, onLink: f, previousContext: p, state: m }) {
|
|
14202
|
+
let h = new xe("addLinksToHtml"), g = Dv(t, e);
|
|
14145
14203
|
await h.time("preloadTextTitlesInfos", () => g.preloadTextTitlesInfos());
|
|
14146
14204
|
let _ = h.timeSync("simplifyHtml", () => a({ removeAWithHref: !0 })(i), {
|
|
14147
14205
|
inputSize: i.length,
|
|
@@ -14150,7 +14208,7 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14150
14208
|
v.currentArticle = p?.currentArticle, v.currentText = p?.currentText;
|
|
14151
14209
|
let y = [], ee = { value: 0 }, te = -1;
|
|
14152
14210
|
await h.time("extractTextLinks", async () => {
|
|
14153
|
-
for await (let e of
|
|
14211
|
+
for await (let e of q_({
|
|
14154
14212
|
legiResolver: g,
|
|
14155
14213
|
context: v,
|
|
14156
14214
|
date: r,
|
|
@@ -14163,7 +14221,7 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14163
14221
|
case "article_definition": {
|
|
14164
14222
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
14165
14223
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
14166
|
-
|
|
14224
|
+
jv({
|
|
14167
14225
|
inputHtml: i,
|
|
14168
14226
|
originalTransformation: n,
|
|
14169
14227
|
output: { replacements: y },
|
|
@@ -14176,10 +14234,10 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14176
14234
|
let { articleId: t, historyArticleId: n, originalTransformation: r } = e;
|
|
14177
14235
|
if (t === void 0 && n === void 0) break;
|
|
14178
14236
|
if (r === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
14179
|
-
let a = t === void 0 ?
|
|
14237
|
+
let a = t === void 0 ? Tv(s, o, n) : Ev(s, o, t);
|
|
14180
14238
|
if (a === void 0) break;
|
|
14181
14239
|
let c = t === void 0 ? `class="lien_article_historique" href="${a}" title="Versions de l'article"` : `class="lien_article_externe" href="${a}"`;
|
|
14182
|
-
|
|
14240
|
+
jv({
|
|
14183
14241
|
inputHtml: i,
|
|
14184
14242
|
originalTransformation: r,
|
|
14185
14243
|
output: { replacements: y },
|
|
@@ -14192,12 +14250,12 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14192
14250
|
let { originalTransformation: t, sectionTaId: n } = e;
|
|
14193
14251
|
if (n !== void 0) {
|
|
14194
14252
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
14195
|
-
|
|
14253
|
+
jv({
|
|
14196
14254
|
inputHtml: i,
|
|
14197
14255
|
originalTransformation: t,
|
|
14198
14256
|
output: { replacements: y },
|
|
14199
14257
|
replacementCounter: ee,
|
|
14200
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${
|
|
14258
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_division_externe" href="${Ev(s, o, n)}">${e}</a>`
|
|
14201
14259
|
});
|
|
14202
14260
|
}
|
|
14203
14261
|
break;
|
|
@@ -14209,12 +14267,12 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14209
14267
|
continue;
|
|
14210
14268
|
}
|
|
14211
14269
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14212
|
-
|
|
14270
|
+
jv({
|
|
14213
14271
|
inputHtml: i,
|
|
14214
14272
|
originalTransformation: t,
|
|
14215
14273
|
output: { replacements: y },
|
|
14216
14274
|
replacementCounter: ee,
|
|
14217
|
-
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${
|
|
14275
|
+
tagHtmlFromOriginal: (e) => `<a class="lien_texte_externe" href="${Ev(s, o, n.cid)}">${e}</a>`
|
|
14218
14276
|
});
|
|
14219
14277
|
break;
|
|
14220
14278
|
}
|
|
@@ -14222,7 +14280,7 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14222
14280
|
let { url: t, originalTransformation: n } = e;
|
|
14223
14281
|
if (t === void 0) continue;
|
|
14224
14282
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(e, null, 2)}`);
|
|
14225
|
-
|
|
14283
|
+
jv({
|
|
14226
14284
|
inputHtml: i,
|
|
14227
14285
|
originalTransformation: n,
|
|
14228
14286
|
output: { replacements: y },
|
|
@@ -14234,7 +14292,7 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14234
14292
|
case "internal_article": {
|
|
14235
14293
|
let { definition: t, originalTransformation: n } = e;
|
|
14236
14294
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
14237
|
-
|
|
14295
|
+
jv({
|
|
14238
14296
|
inputHtml: i,
|
|
14239
14297
|
originalTransformation: n,
|
|
14240
14298
|
output: { replacements: y },
|
|
@@ -14246,7 +14304,7 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14246
14304
|
default: c("Link", e);
|
|
14247
14305
|
}
|
|
14248
14306
|
}, { count: te + 1 });
|
|
14249
|
-
let ne = h.timeSync("applyHtmlReplacements", () =>
|
|
14307
|
+
let ne = h.timeSync("applyHtmlReplacements", () => Av(i, y), {
|
|
14250
14308
|
count: y.length,
|
|
14251
14309
|
inputSize: i.length
|
|
14252
14310
|
});
|
|
@@ -14258,13 +14316,13 @@ async function Ev({ canutesDb: e, legiResolver: t, date: r, html: i, linkBaseUrl
|
|
|
14258
14316
|
output: y.length === 0 ? null : ne
|
|
14259
14317
|
};
|
|
14260
14318
|
}
|
|
14261
|
-
function
|
|
14319
|
+
function Av(e, t) {
|
|
14262
14320
|
if (t.length === 0) return e;
|
|
14263
14321
|
let n = [], r = 0;
|
|
14264
14322
|
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);
|
|
14265
14323
|
return n.push(e.slice(r)), n.join("");
|
|
14266
14324
|
}
|
|
14267
|
-
function
|
|
14325
|
+
function jv({ inputHtml: e, originalTransformation: t, output: n, replacementCounter: r, tagHtmlFromOriginal: i }) {
|
|
14268
14326
|
let a = d(t, i(s(e, t, 0) ?? ""));
|
|
14269
14327
|
n.replacements.push({
|
|
14270
14328
|
order: r.value++,
|
|
@@ -14273,11 +14331,11 @@ function Ov({ inputHtml: e, originalTransformation: t, output: n, replacementCou
|
|
|
14273
14331
|
stop: t.position.stop
|
|
14274
14332
|
});
|
|
14275
14333
|
}
|
|
14276
|
-
function
|
|
14334
|
+
function Mv({ attributes: e, inputHtml: t, originalTransformation: n, outputByType: r, replacementCounter: i }) {
|
|
14277
14335
|
let a = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
14278
14336
|
for (let e of ["links", "links_or_references"]) {
|
|
14279
14337
|
let o = r[e];
|
|
14280
|
-
o !== void 0 &&
|
|
14338
|
+
o !== void 0 && jv({
|
|
14281
14339
|
inputHtml: t,
|
|
14282
14340
|
originalTransformation: n,
|
|
14283
14341
|
output: o,
|
|
@@ -14286,11 +14344,11 @@ function kv({ attributes: e, inputHtml: t, originalTransformation: n, outputByTy
|
|
|
14286
14344
|
});
|
|
14287
14345
|
}
|
|
14288
14346
|
}
|
|
14289
|
-
function
|
|
14347
|
+
function Nv({ id: e, outputByType: t }) {
|
|
14290
14348
|
return t.references !== void 0 || e === void 0 && t.links_or_references !== void 0;
|
|
14291
14349
|
}
|
|
14292
|
-
async function
|
|
14293
|
-
let h =
|
|
14350
|
+
async function Pv({ 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 }) {
|
|
14351
|
+
let h = Dv(t, e);
|
|
14294
14352
|
await h.preloadTextTitlesInfos();
|
|
14295
14353
|
let g = new n(a.output), _ = {}, v = {};
|
|
14296
14354
|
for (let e of p) v[e] = {
|
|
@@ -14299,7 +14357,7 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14299
14357
|
replacements: []
|
|
14300
14358
|
};
|
|
14301
14359
|
let y = { value: 0 };
|
|
14302
|
-
for await (let e of
|
|
14360
|
+
for await (let e of q_({
|
|
14303
14361
|
legiResolver: h,
|
|
14304
14362
|
context: g,
|
|
14305
14363
|
date: r,
|
|
@@ -14312,7 +14370,7 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14312
14370
|
case "article_definition": {
|
|
14313
14371
|
let { article: t, originalTransformation: n, textId: r } = e;
|
|
14314
14372
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in article definition: ${JSON.stringify(e, null, 2)}`);
|
|
14315
|
-
for (let e of Object.values(v))
|
|
14373
|
+
for (let e of Object.values(v)) jv({
|
|
14316
14374
|
inputHtml: o,
|
|
14317
14375
|
originalTransformation: n,
|
|
14318
14376
|
output: e,
|
|
@@ -14325,10 +14383,10 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14325
14383
|
let { article: t, articleId: n, historyArticleId: r, originalTransformation: i } = e;
|
|
14326
14384
|
if (i === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
14327
14385
|
if (n !== void 0) {
|
|
14328
|
-
if (
|
|
14386
|
+
if (Mv({
|
|
14329
14387
|
attributes: {
|
|
14330
14388
|
class: "lien_article_externe",
|
|
14331
|
-
href:
|
|
14389
|
+
href: Ev(l, s, n)
|
|
14332
14390
|
},
|
|
14333
14391
|
inputHtml: o,
|
|
14334
14392
|
originalTransformation: i,
|
|
@@ -14339,8 +14397,8 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14339
14397
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
14340
14398
|
}
|
|
14341
14399
|
} else if (r !== void 0) {
|
|
14342
|
-
let e =
|
|
14343
|
-
e !== void 0 &&
|
|
14400
|
+
let e = Tv(l, s, r);
|
|
14401
|
+
e !== void 0 && Mv({
|
|
14344
14402
|
attributes: {
|
|
14345
14403
|
class: "lien_article_historique",
|
|
14346
14404
|
href: e,
|
|
@@ -14352,14 +14410,14 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14352
14410
|
replacementCounter: y
|
|
14353
14411
|
});
|
|
14354
14412
|
}
|
|
14355
|
-
|
|
14413
|
+
Nv({
|
|
14356
14414
|
id: n,
|
|
14357
14415
|
outputByType: v
|
|
14358
|
-
}) &&
|
|
14416
|
+
}) && Fv({
|
|
14359
14417
|
attributes: {
|
|
14360
14418
|
class: "reference_article",
|
|
14361
14419
|
style: "background-color: #eae462",
|
|
14362
|
-
title:
|
|
14420
|
+
title: Ov(t, e.reference)
|
|
14363
14421
|
},
|
|
14364
14422
|
id: n,
|
|
14365
14423
|
inputHtml: o,
|
|
@@ -14372,10 +14430,10 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14372
14430
|
case "external_division": {
|
|
14373
14431
|
let { division: t, originalTransformation: n, sectionTaId: r } = e;
|
|
14374
14432
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
14375
|
-
if (r !== void 0 && (
|
|
14433
|
+
if (r !== void 0 && (Mv({
|
|
14376
14434
|
attributes: {
|
|
14377
14435
|
class: "lien_division_externe",
|
|
14378
|
-
href:
|
|
14436
|
+
href: Ev(l, s, r)
|
|
14379
14437
|
},
|
|
14380
14438
|
inputHtml: o,
|
|
14381
14439
|
originalTransformation: n,
|
|
@@ -14385,14 +14443,14 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14385
14443
|
let e = await h.getTextIdFromSegmentId(r);
|
|
14386
14444
|
e != null && (_[e] = (_[e] ?? 0) + 1);
|
|
14387
14445
|
}
|
|
14388
|
-
|
|
14446
|
+
Nv({
|
|
14389
14447
|
id: r,
|
|
14390
14448
|
outputByType: v
|
|
14391
|
-
}) &&
|
|
14449
|
+
}) && Fv({
|
|
14392
14450
|
attributes: {
|
|
14393
14451
|
class: "reference_division",
|
|
14394
14452
|
style: "background-color: #eae462",
|
|
14395
|
-
title:
|
|
14453
|
+
title: Ov(t, e.reference)
|
|
14396
14454
|
},
|
|
14397
14455
|
id: r,
|
|
14398
14456
|
inputHtml: o,
|
|
@@ -14405,7 +14463,7 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14405
14463
|
case "european_text": {
|
|
14406
14464
|
let { url: t, originalTransformation: n, text: r, titleId: i } = e;
|
|
14407
14465
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14408
|
-
|
|
14466
|
+
Mv({
|
|
14409
14467
|
attributes: {
|
|
14410
14468
|
class: "lien_texte_european",
|
|
14411
14469
|
href: t,
|
|
@@ -14415,14 +14473,14 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14415
14473
|
originalTransformation: n,
|
|
14416
14474
|
outputByType: v,
|
|
14417
14475
|
replacementCounter: y
|
|
14418
|
-
}),
|
|
14476
|
+
}), Nv({
|
|
14419
14477
|
id: i,
|
|
14420
14478
|
outputByType: v
|
|
14421
|
-
}) &&
|
|
14479
|
+
}) && Fv({
|
|
14422
14480
|
attributes: {
|
|
14423
14481
|
class: "reference_texte",
|
|
14424
14482
|
style: "background-color: #eae462",
|
|
14425
|
-
title:
|
|
14483
|
+
title: Ov(r, e.reference)
|
|
14426
14484
|
},
|
|
14427
14485
|
id: i,
|
|
14428
14486
|
inputHtml: o,
|
|
@@ -14435,23 +14493,23 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14435
14493
|
case "external_text": {
|
|
14436
14494
|
let { originalTransformation: t, text: n } = e;
|
|
14437
14495
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(e, null, 2)}`);
|
|
14438
|
-
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (
|
|
14496
|
+
n.cid === void 0 ? !n.present && d && console.error(`Link to text "${g.text(n.position)}" without CID: ${JSON.stringify(n, null, 2)}`) : (Mv({
|
|
14439
14497
|
attributes: {
|
|
14440
14498
|
class: "lien_texte_externe",
|
|
14441
|
-
href:
|
|
14499
|
+
href: Ev(l, s, n.cid)
|
|
14442
14500
|
},
|
|
14443
14501
|
inputHtml: o,
|
|
14444
14502
|
originalTransformation: t,
|
|
14445
14503
|
outputByType: v,
|
|
14446
14504
|
replacementCounter: y
|
|
14447
|
-
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)),
|
|
14505
|
+
}), m && (_[n.cid] = (_[n.cid] ?? 0) + 1)), Nv({
|
|
14448
14506
|
id: n.cid,
|
|
14449
14507
|
outputByType: v
|
|
14450
|
-
}) &&
|
|
14508
|
+
}) && Fv({
|
|
14451
14509
|
attributes: {
|
|
14452
14510
|
class: "reference_texte",
|
|
14453
14511
|
style: "background-color: #eae462",
|
|
14454
|
-
title:
|
|
14512
|
+
title: Ov(n, e.reference)
|
|
14455
14513
|
},
|
|
14456
14514
|
id: n.cid,
|
|
14457
14515
|
inputHtml: o,
|
|
@@ -14464,7 +14522,7 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14464
14522
|
case "internal_article": {
|
|
14465
14523
|
let { definition: t, originalTransformation: n } = e;
|
|
14466
14524
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
14467
|
-
for (let e of Object.values(v))
|
|
14525
|
+
for (let e of Object.values(v)) jv({
|
|
14468
14526
|
inputHtml: o,
|
|
14469
14527
|
originalTransformation: n,
|
|
14470
14528
|
output: e,
|
|
@@ -14475,18 +14533,18 @@ async function jv({ canutesDb: e, legiResolver: t, date: r, defaultTextId: i, ht
|
|
|
14475
14533
|
}
|
|
14476
14534
|
default: c("Link", e);
|
|
14477
14535
|
}
|
|
14478
|
-
for (let e of Object.values(v)) e.html =
|
|
14536
|
+
for (let e of Object.values(v)) e.html = Av(o, e.replacements);
|
|
14479
14537
|
return {
|
|
14480
14538
|
outputByType: v,
|
|
14481
14539
|
referredLegifranceTextCountByCid: _
|
|
14482
14540
|
};
|
|
14483
14541
|
}
|
|
14484
|
-
function
|
|
14542
|
+
function Fv({ attributes: e, id: t, inputHtml: n, originalTransformation: r, outputByType: i, replacementCounter: a }) {
|
|
14485
14543
|
let o = Object.entries(e).map(([e, t]) => `${e}="${et(t, !0)}"`).join(" ");
|
|
14486
14544
|
for (let e of ["links_or_references", "references"]) {
|
|
14487
14545
|
if (e === "links_or_references" && t !== void 0) continue;
|
|
14488
14546
|
let s = i[e];
|
|
14489
|
-
s !== void 0 &&
|
|
14547
|
+
s !== void 0 && jv({
|
|
14490
14548
|
inputHtml: n,
|
|
14491
14549
|
originalTransformation: r,
|
|
14492
14550
|
output: s,
|
|
@@ -14496,4 +14554,4 @@ function Mv({ attributes: e, id: t, inputHtml: n, originalTransformation: r, out
|
|
|
14496
14554
|
}
|
|
14497
14555
|
}
|
|
14498
14556
|
//#endregion
|
|
14499
|
-
export { bp as $,
|
|
14557
|
+
export { bp as $, Um as A, D as At, xm as B, dt as Bt, Ih as C, Dt as Ct, Ym as D, mt as Dt, Zm as E, Ot as Et, zm as F, ot as Ft, $ as G, bm as H, st as Ht, Bm as I, rt as It, Zp as J, Kp as K, Mm as L, it as Lt, Km as M, xt as Mt, qm as N, tt as Nt, Jm as O, ht as Ot, Vm as P, nt as Pt, yp as Q, Am as R, at as Rt, Lh as S, Vt as St, Xm as T, zt as Tt, vm as U, lt as Ut, ym as V, ft as Vt, dm as W, ct as Wt, jp as X, Gp as Y, Rp as Z, M_ as _, Xt as _t, Ev as a, xn as at, Qh as b, Yt as bt, bv as c, gn as ct, yv as d, tn as dt, Wp as et, K_ as f, rn as ft, z_ as g, Qt as gt, N_ as h, sn as ht, Tv as i, vn as it, Gm as j, O as jt, Hm as k, _t as kt, Cv as l, fn as lt, B_ as m, nn as mt, kv as n, Tn as nt, xv as o, wn as ot, j_ as p, an as pt, qp as q, wv as r, _n as rt, Sv as s, pn as st, Pv as t, dp as tt, q_ as u, un as ut, ng as v, qt as vt, eh as w, Rt as wt, Xh as x, Bt as xt, Zh as y, Jt as yt, Om as z, ut as zt };
|