@tricoteuses/tisseuse 0.18.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{html-B0V8X0v6.js → html-EuDDYMr2.js} +5156 -5098
- package/dist/index.js +116 -116
- package/dist/{resolver-cn-qJE70.js → resolver-tBQRf8TL.js} +332 -307
- package/dist/server-f-legi.js +18 -12
- package/dist/server.js +655 -643
- package/dist/src/lib/assemblee_document_date.d.ts +5 -0
- package/dist/src/lib/assemblee_document_date.test.d.ts +1 -0
- package/dist/src/lib/extractors/links.code_titles.test.d.ts +1 -0
- package/dist/src/lib/index.d.ts +1 -0
- package/dist/src/lib/legi/text_titles_infos.d.ts +7 -1
- package/dist/src/lib/text_parsers/action_words.d.ts +1 -1
- package/dist/src/lib/text_parsers/articles.d.ts +16 -21
- package/dist/src/lib/text_parsers/ast.d.ts +2 -0
- package/dist/src/lib/text_parsers/texts.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as
|
|
1
|
+
import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, Ct as o, Dt as s, Et as c, F as l, Ft as u, G as d, Gt as f, H as p, Ht as m, I as ee, It as te, J as ne, Jt as re, K as ie, Kt as ae, L as oe, Lt as se, Mt as ce, Ot as le, P as ue, Pt as de, Q as fe, Qt as pe, R as me, Rt as he, St as ge, T as _e, Tt as h, U as ve, Ut as ye, V as be, Vt as xe, W as Se, Wt as Ce, X as we, Xt as Te, Y as Ee, Yt as De, Z as Oe, Zt as ke, _ as Ae, _t as je, a as g, at as Me, b as Ne, bt as Pe, c as Fe, ct as Ie, d as _, dt as Le, f as Re, ft as ze, g as Be, gt as Ve, ht as He, i as Ue, it as We, jt as Ge, kt as Ke, l as qe, lt as Je, mt as Ye, n as Xe, nt as Ze, o as v, ot as Qe, p as $e, pt as et, q as tt, qt as nt, r as y, rt, s as it, st as at, t as ot, tt as st, u as ct, v as lt, vt as ut, wt as dt, xt as ft, y as pt, yt as mt, z as ht, zt as gt } from "./html-EuDDYMr2.js";
|
|
2
|
+
import { $ as _t, A as b, At as x, C as vt, Ct as yt, D as bt, Dt as S, E as xt, Et as St, F as Ct, Ft as C, G as wt, H as Tt, I as Et, It as Dt, J as Ot, L as kt, Lt as At, M as jt, N as Mt, Nt as w, O as Nt, Ot as T, P as Pt, Pt as Ft, Q as It, R as E, Rt as Lt, S as Rt, St as zt, T as Bt, U as Vt, X as Ht, Y as Ut, Z as Wt, _ as Gt, at as Kt, b as D, bt as O, c as qt, ct as Jt, d as Yt, et as Xt, f as Zt, ft as Qt, g as $t, gt as en, h as tn, ht as nn, j as rn, k as an, kt as k, l as on, m as sn, mt as cn, n as ln, nt as A, p as un, pt as dn, q as fn, r as pn, rt as mn, s as hn, t as gn, u as _n, ut as vn, w as yn, wt as bn, x as j, y as xn, z as M, zt as N } from "./resolver-tBQRf8TL.js";
|
|
3
3
|
//#region ../../node_modules/@tricoteuses/legifrance/dist/legal/index.js
|
|
4
4
|
function Sn(e, t) {
|
|
5
5
|
if (e != null) {
|
|
@@ -10,10 +10,10 @@ function Sn(e, t) {
|
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/lib/loaders/legifrance.ts
|
|
13
|
-
function
|
|
13
|
+
function P({ data: e, num: t }) {
|
|
14
14
|
return t !== null && (e.num = t), e;
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
16
|
+
async function F(e, t, n) {
|
|
17
17
|
let r = t.get("ARTICLE");
|
|
18
18
|
r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("ARTICLE", r));
|
|
19
19
|
let i = r.get(n);
|
|
@@ -21,7 +21,7 @@ async function P(e, t, n) {
|
|
|
21
21
|
SELECT data, num
|
|
22
22
|
FROM legifrance.article
|
|
23
23
|
WHERE id = ${n}
|
|
24
|
-
`).map(
|
|
24
|
+
`).map(P)[0], r.set(n, i ?? null)), i ?? void 0;
|
|
25
25
|
}
|
|
26
26
|
async function Cn(e, t, n) {
|
|
27
27
|
let r = t.get("JO");
|
|
@@ -34,7 +34,7 @@ async function Cn(e, t, n) {
|
|
|
34
34
|
WHERE id = ${n}
|
|
35
35
|
`)[0]?.data, r.set(n, i ?? null)), i ?? void 0;
|
|
36
36
|
}
|
|
37
|
-
async function
|
|
37
|
+
async function I(e, t, n) {
|
|
38
38
|
let r = t.get("SECTION_TA");
|
|
39
39
|
r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("SECTION_TA", r));
|
|
40
40
|
let i = r.get(n);
|
|
@@ -131,65 +131,65 @@ async function An(e, t, n) {
|
|
|
131
131
|
SELECT data, num
|
|
132
132
|
FROM legifrance.article
|
|
133
133
|
${n}
|
|
134
|
-
`).map(
|
|
134
|
+
`).map(P)) r.set(t.META.META_COMMUN.ID, t), i.push(t);
|
|
135
135
|
return i;
|
|
136
136
|
}
|
|
137
137
|
//#endregion
|
|
138
138
|
//#region src/lib/articles.ts
|
|
139
|
-
var
|
|
140
|
-
function L(e) {
|
|
141
|
-
return [e, ...e.TM === void 0 ? [] : L(e.TM)];
|
|
142
|
-
}
|
|
139
|
+
var L = ["2222-02-22", "2999-01-01"];
|
|
143
140
|
function R(e) {
|
|
144
|
-
return e
|
|
141
|
+
return [e, ...e.TM === void 0 ? [] : R(e.TM)];
|
|
142
|
+
}
|
|
143
|
+
function z(e) {
|
|
144
|
+
return e !== void 0 && L.includes(e);
|
|
145
145
|
}
|
|
146
146
|
function jn({ dateDebut: e, sourceDateDebut: t, sourceDateFin: n }) {
|
|
147
|
-
return t !== void 0 && n !== void 0 && !
|
|
147
|
+
return t !== void 0 && n !== void 0 && !z(t) && !z(n) && n <= t ? "never_effective" : e === void 0 || z(e) ? "unknown" : n === "2999-01-01" ? "open_ended" : n === void 0 || z(n) ? "unknown" : n > e ? "dated" : "unknown";
|
|
148
148
|
}
|
|
149
149
|
var Mn = (e) => {
|
|
150
150
|
if (e !== void 0) for (let t = 0; t < e.length; ++t) {
|
|
151
|
-
let n =
|
|
151
|
+
let n = A(new S(e, t));
|
|
152
152
|
if (typeof n == "string") return n;
|
|
153
153
|
}
|
|
154
|
-
},
|
|
154
|
+
}, B = (e) => (e === void 0 ? [] : Array.isArray(e) ? e : [e]).map((e) => Mn(e["#text"])).find((e) => e !== void 0), Nn = (e) => {
|
|
155
155
|
let t = e.META.META_SPEC.META_ARTICLE.DATE_DEBUT;
|
|
156
|
-
if (t !== void 0 && !
|
|
157
|
-
let n = e.CONTEXTE.TEXTE, r = n.TITRE_TXT, i = [...r === void 0 ? [] : (Array.isArray(r) ? r : [r]).map((e) => e["@debut"]), ...n.TM === void 0 ? [] :
|
|
156
|
+
if (t !== void 0 && !L.includes(t)) return t;
|
|
157
|
+
let n = e.CONTEXTE.TEXTE, r = n.TITRE_TXT, i = [...r === void 0 ? [] : (Array.isArray(r) ? r : [r]).map((e) => e["@debut"]), ...n.TM === void 0 ? [] : R(n.TM).map((e) => (Array.isArray(e.TITRE_TM) ? e.TITRE_TM : [e.TITRE_TM]).map((e) => e["@debut"])).flat()].filter((e) => !L.includes(e));
|
|
158
158
|
if (i.length > 0) return i.sort().at(-1);
|
|
159
159
|
let a = n["@date_publi"];
|
|
160
|
-
if (a !== void 0 && !
|
|
160
|
+
if (a !== void 0 && !L.includes(a)) return a;
|
|
161
161
|
let o = n["@date_signature"];
|
|
162
|
-
if (o !== void 0 && !
|
|
162
|
+
if (o !== void 0 && !L.includes(o)) return o;
|
|
163
163
|
let s = e.META.META_SPEC.META_ARTICLE.DATE_FIN;
|
|
164
|
-
if (s !== void 0 && !
|
|
165
|
-
let c =
|
|
164
|
+
if (s !== void 0 && !L.includes(s)) return s;
|
|
165
|
+
let c = B(r);
|
|
166
166
|
if (c !== void 0) return c;
|
|
167
|
-
if (
|
|
167
|
+
if (L.includes(t ?? "")) return t;
|
|
168
168
|
throw Error(`Missing date signature in article ${e.META.META_COMMUN.ID}`);
|
|
169
|
-
},
|
|
169
|
+
}, V = (e) => {
|
|
170
170
|
let t = e.META.META_SPEC.META_ARTICLE.DATE_DEBUT;
|
|
171
|
-
if (t !== void 0 && !
|
|
171
|
+
if (t !== void 0 && !L.includes(t)) return t;
|
|
172
172
|
let n = e.CONTEXTE.TEXTE, r = n["@date_signature"];
|
|
173
|
-
if (r !== void 0 && !
|
|
173
|
+
if (r !== void 0 && !L.includes(r)) return r;
|
|
174
174
|
let i = n["@date_publi"];
|
|
175
|
-
if (i !== void 0 && !
|
|
176
|
-
let a = n.TITRE_TXT, o = [...a === void 0 ? [] : (Array.isArray(a) ? a : [a]).map((e) => e["@debut"]), ...n.TM === void 0 ? [] :
|
|
175
|
+
if (i !== void 0 && !L.includes(i)) return i;
|
|
176
|
+
let a = n.TITRE_TXT, o = [...a === void 0 ? [] : (Array.isArray(a) ? a : [a]).map((e) => e["@debut"]), ...n.TM === void 0 ? [] : R(n.TM).map((e) => (Array.isArray(e.TITRE_TM) ? e.TITRE_TM : [e.TITRE_TM]).map((e) => e["@debut"])).flat()].filter((e) => !L.includes(e));
|
|
177
177
|
if (o.length > 0) return o.sort().at(-1);
|
|
178
178
|
let s = e.META.META_SPEC.META_ARTICLE.DATE_FIN;
|
|
179
|
-
if (s !== void 0 && !
|
|
180
|
-
let c =
|
|
179
|
+
if (s !== void 0 && !L.includes(s)) return s;
|
|
180
|
+
let c = B(a);
|
|
181
181
|
if (c !== void 0) return c;
|
|
182
|
-
if (
|
|
182
|
+
if (L.includes(t ?? "")) return t;
|
|
183
183
|
throw Error(`Missing date signature in article ${e.META.META_COMMUN.ID}`);
|
|
184
184
|
};
|
|
185
185
|
async function Pn(e, t, n, r) {
|
|
186
|
-
let i = await
|
|
186
|
+
let i = await F(e, t, n);
|
|
187
187
|
if (i === void 0) return;
|
|
188
|
-
let a =
|
|
188
|
+
let a = V(i), o = i.META.META_COMMUN.ORIGINE;
|
|
189
189
|
if (o === "KALI") return;
|
|
190
190
|
let s = i.CONTEXTE.TEXTE;
|
|
191
191
|
if (s.TM === void 0) return;
|
|
192
|
-
let c =
|
|
192
|
+
let c = R(s.TM).reverse(), l;
|
|
193
193
|
switch (o) {
|
|
194
194
|
case "JORF":
|
|
195
195
|
l = c.map((e) => e.TITRE_TM["@id"]);
|
|
@@ -197,14 +197,14 @@ async function Pn(e, t, n, r) {
|
|
|
197
197
|
case "LEGI":
|
|
198
198
|
l = c.map((e) => Sn(e.TITRE_TM, a)?.["@id"]);
|
|
199
199
|
break;
|
|
200
|
-
default:
|
|
200
|
+
default: N("getOrLoadArticleSiblingId origine", o);
|
|
201
201
|
}
|
|
202
|
-
return await (r === -1 ?
|
|
202
|
+
return await (r === -1 ? K : G)(e, t, n, a, i.num, l);
|
|
203
203
|
}
|
|
204
|
-
async function
|
|
204
|
+
async function H(e, t, n, r, i, a) {
|
|
205
205
|
let o = r[n];
|
|
206
206
|
if (o === void 0) {
|
|
207
|
-
let s = await
|
|
207
|
+
let s = await I(e, t, n);
|
|
208
208
|
if (s === void 0) return;
|
|
209
209
|
let c = s.STRUCTURE_TA;
|
|
210
210
|
if (c === void 0) return;
|
|
@@ -232,8 +232,8 @@ async function V(e, t, n, r, i, a) {
|
|
|
232
232
|
}
|
|
233
233
|
return o;
|
|
234
234
|
}
|
|
235
|
-
async function
|
|
236
|
-
let r = await
|
|
235
|
+
async function U(e, t, n) {
|
|
236
|
+
let r = await I(e, t, n);
|
|
237
237
|
if (r === void 0) return;
|
|
238
238
|
let i = r.STRUCTURE_TA;
|
|
239
239
|
if (i === void 0) return;
|
|
@@ -241,26 +241,26 @@ async function H(e, t, n) {
|
|
|
241
241
|
if (a !== void 0) return a[0]["@id"];
|
|
242
242
|
let o = i.LIEN_SECTION_TA;
|
|
243
243
|
if (o !== void 0) for (let n of o) {
|
|
244
|
-
let r = await
|
|
244
|
+
let r = await U(e, t, n["@id"]);
|
|
245
245
|
if (r !== void 0) return r;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
async function
|
|
249
|
-
let r = await
|
|
248
|
+
async function W(e, t, n) {
|
|
249
|
+
let r = await I(e, t, n);
|
|
250
250
|
if (r === void 0) return;
|
|
251
251
|
let i = r.STRUCTURE_TA;
|
|
252
252
|
if (i === void 0) return;
|
|
253
253
|
let a = i.LIEN_SECTION_TA;
|
|
254
254
|
if (a !== void 0) for (let n of a.toReversed()) {
|
|
255
|
-
let r = await
|
|
255
|
+
let r = await W(e, t, n["@id"]);
|
|
256
256
|
if (r !== void 0) return r;
|
|
257
257
|
}
|
|
258
258
|
return i.LIEN_ART?.at(-1)?.["@id"];
|
|
259
259
|
}
|
|
260
|
-
async function
|
|
260
|
+
async function G(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
|
|
261
261
|
let l = a[o];
|
|
262
262
|
if (l === void 0) return;
|
|
263
|
-
let u = await
|
|
263
|
+
let u = await H(e, t, l, s, n, c);
|
|
264
264
|
if (u === void 0) return;
|
|
265
265
|
let { area: d, index: f, sectionTa: p } = u, m = p.STRUCTURE_TA;
|
|
266
266
|
switch (d) {
|
|
@@ -269,32 +269,32 @@ async function W(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
|
|
|
269
269
|
for (let n = f + 1; n < c.length; n++) {
|
|
270
270
|
let a = c[n];
|
|
271
271
|
if (a["@num"] !== i) {
|
|
272
|
-
let n = await
|
|
273
|
-
if (n !== void 0 &&
|
|
272
|
+
let n = await F(e, t, a["@id"]);
|
|
273
|
+
if (n !== void 0 && V(n) <= r) return a["@id"];
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
let u = m.LIEN_SECTION_TA;
|
|
277
277
|
if (u !== void 0) for (let n of u) {
|
|
278
|
-
let r = await
|
|
278
|
+
let r = await U(e, t, n["@id"]);
|
|
279
279
|
if (r !== void 0) return r;
|
|
280
280
|
}
|
|
281
|
-
return await
|
|
281
|
+
return await G(e, t, n, r, i, a, o + 1, s, l);
|
|
282
282
|
}
|
|
283
283
|
case "LIEN_SECTION_TA": {
|
|
284
284
|
let c = m.LIEN_SECTION_TA;
|
|
285
285
|
for (let n = f + 1; n < c.length; n++) {
|
|
286
|
-
let r = await
|
|
286
|
+
let r = await U(e, t, c[n]["@id"]);
|
|
287
287
|
if (r !== void 0) return r;
|
|
288
288
|
}
|
|
289
|
-
return await
|
|
289
|
+
return await G(e, t, n, r, i, a, o + 1, s, l);
|
|
290
290
|
}
|
|
291
|
-
default:
|
|
291
|
+
default: N("moveToNextArticleId area", d);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
async function
|
|
294
|
+
async function K(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
|
|
295
295
|
let l = a[o];
|
|
296
296
|
if (l === void 0) return;
|
|
297
|
-
let u = await
|
|
297
|
+
let u = await H(e, t, l, s, n, c);
|
|
298
298
|
if (u === void 0) return;
|
|
299
299
|
let { area: d, index: f, sectionTa: p } = u, m = p.STRUCTURE_TA;
|
|
300
300
|
switch (d) {
|
|
@@ -303,21 +303,21 @@ async function G(e, t, n, r, i, a, o = 0, s = {}, c = void 0) {
|
|
|
303
303
|
for (let n = f - 1; n >= 0; n--) {
|
|
304
304
|
let a = c[n];
|
|
305
305
|
if (a["@num"] !== i) {
|
|
306
|
-
let n = await
|
|
307
|
-
if (n !== void 0 &&
|
|
306
|
+
let n = await F(e, t, a["@id"]);
|
|
307
|
+
if (n !== void 0 && V(n) <= r) return a["@id"];
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
return await
|
|
310
|
+
return await K(e, t, n, r, i, a, o + 1, s, l);
|
|
311
311
|
}
|
|
312
312
|
case "LIEN_SECTION_TA": {
|
|
313
313
|
for (let n = f - 1; n >= 0; n--) {
|
|
314
|
-
let r = await
|
|
314
|
+
let r = await W(e, t, m.LIEN_SECTION_TA[n]["@id"]);
|
|
315
315
|
if (r !== void 0) return r;
|
|
316
316
|
}
|
|
317
317
|
let c = m.LIEN_ART;
|
|
318
|
-
return c === void 0 ? await
|
|
318
|
+
return c === void 0 ? await K(e, t, n, r, i, a, o + 1, s, l) : (u.area = "LIEN_ART", u.index = c.length, await K(e, t, n, r, i, a, o, s));
|
|
319
319
|
}
|
|
320
|
-
default:
|
|
320
|
+
default: N("moveToPreviousArticleId area", d);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
var Fn = (e) => (t, n) => {
|
|
@@ -339,16 +339,16 @@ var Fn = (e) => (t, n) => {
|
|
|
339
339
|
if (m <= i) return 1;
|
|
340
340
|
}
|
|
341
341
|
throw Error(`TODO: Unable to sort articles ${a.ID} & ${s.ID} by date.`);
|
|
342
|
-
},
|
|
343
|
-
assemblee:
|
|
344
|
-
legifrance:
|
|
345
|
-
}),
|
|
346
|
-
function
|
|
347
|
-
return
|
|
342
|
+
}, q = () => /* @__PURE__ */ new Map(), In = () => /* @__PURE__ */ new Map(), Ln = () => ({
|
|
343
|
+
assemblee: q(),
|
|
344
|
+
legifrance: In()
|
|
345
|
+
}), Rn = new Intl.DateTimeFormat("fr-FR", { dateStyle: "long" });
|
|
346
|
+
function zn(e) {
|
|
347
|
+
return Rn.format(new Date(e)).replace(/^1 /, "1er ");
|
|
348
348
|
}
|
|
349
349
|
//#endregion
|
|
350
350
|
//#region src/lib/json.ts
|
|
351
|
-
var
|
|
351
|
+
var Bn = (e, t) => t instanceof Object && !Array.isArray(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t;
|
|
352
352
|
//#endregion
|
|
353
353
|
//#region src/lib/markdown.ts
|
|
354
354
|
function J(e) {
|
|
@@ -356,11 +356,11 @@ function J(e) {
|
|
|
356
356
|
}
|
|
357
357
|
//#endregion
|
|
358
358
|
//#region src/lib/linkers/markdown.ts
|
|
359
|
-
async function
|
|
360
|
-
let s = t ?? (e === void 0 ? void 0 : new
|
|
359
|
+
async function Vn({ canutesDb: e, legiResolver: t, date: n, linkBaseUrl: r, linkType: i, previousContext: a, text: o }) {
|
|
360
|
+
let s = t ?? (e === void 0 ? void 0 : new $e(e));
|
|
361
361
|
if (s === void 0) throw Error("A Canutes database or legal resolver is required");
|
|
362
362
|
await s.preloadTextTitlesInfos();
|
|
363
|
-
let c =
|
|
363
|
+
let c = b(o), l = new S(c.output);
|
|
364
364
|
l.currentArticle = a?.currentArticle, l.currentText = a?.currentText;
|
|
365
365
|
let u = o, d = 0;
|
|
366
366
|
for await (let e of _({
|
|
@@ -374,7 +374,7 @@ async function Y({ canutesDb: e, legiResolver: t, date: n, linkBaseUrl: r, linkT
|
|
|
374
374
|
let { articleId: t, historyArticleId: n, originalTransformation: a } = e, o = t === void 0 ? n === void 0 ? void 0 : g(i, r, n) : v(i, r, t);
|
|
375
375
|
if (o !== void 0) {
|
|
376
376
|
if (a === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(e, null, 2)}`);
|
|
377
|
-
let t =
|
|
377
|
+
let t = M(a, `[${J(E(u, a, d))}](${o})`);
|
|
378
378
|
u = u.slice(0, a.position.start + d) + t + u.slice(a.position.stop + d), d += t.length - (a.position.stop - a.position.start);
|
|
379
379
|
}
|
|
380
380
|
break;
|
|
@@ -383,7 +383,7 @@ async function Y({ canutesDb: e, legiResolver: t, date: n, linkBaseUrl: r, linkT
|
|
|
383
383
|
let { originalTransformation: t, sectionTaId: n } = e;
|
|
384
384
|
if (n !== void 0) {
|
|
385
385
|
if (t === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(e, null, 2)}`);
|
|
386
|
-
let a =
|
|
386
|
+
let a = M(t, `[${J(E(u, t, d))}](${v(i, r, n)})`);
|
|
387
387
|
u = u.slice(0, t.position.start + d) + a + u.slice(t.position.stop + d), d += a.length - (t.position.stop - t.position.start);
|
|
388
388
|
}
|
|
389
389
|
break;
|
|
@@ -412,14 +412,14 @@ async function Y({ canutesDb: e, legiResolver: t, date: n, linkBaseUrl: r, linkT
|
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
c === void 0 && (c = v(i, r, a.cid));
|
|
415
|
-
let f =
|
|
415
|
+
let f = M(t, `[${J(E(u, t, d))}](${c})`);
|
|
416
416
|
u = u.slice(0, t.position.start + d) + f + u.slice(t.position.stop + d), d += f.length - (t.position.stop - t.position.start);
|
|
417
417
|
break;
|
|
418
418
|
}
|
|
419
419
|
case "internal_article": {
|
|
420
420
|
let { definition: t, originalTransformation: n } = e;
|
|
421
421
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(e, null, 2)}`);
|
|
422
|
-
let r =
|
|
422
|
+
let r = M(n, `[${J(E(u, n, d))}](#definition_article_${t.textId}_${t.article.num.replaceAll(" ", "_")})`);
|
|
423
423
|
u = u.slice(0, n.position.start + d) + r + u.slice(n.position.stop + d), d += r.length - (n.position.stop - n.position.start);
|
|
424
424
|
break;
|
|
425
425
|
}
|
|
@@ -427,11 +427,11 @@ async function Y({ canutesDb: e, legiResolver: t, date: n, linkBaseUrl: r, linkT
|
|
|
427
427
|
let { url: t, originalTransformation: n } = e;
|
|
428
428
|
if (t === void 0) continue;
|
|
429
429
|
if (n === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(e, null, 2)}`);
|
|
430
|
-
let r =
|
|
430
|
+
let r = E(u, n, d), i = M(n, `<a class="lien_texte_european" href="${t}"${t.startsWith("/") ? "" : " target=\"_blank\""}>${r}</a>`);
|
|
431
431
|
u = u.slice(0, n.position.start + d) + i + u.slice(n.position.stop + d), d += i.length - (n.position.stop - n.position.start);
|
|
432
432
|
break;
|
|
433
433
|
}
|
|
434
|
-
default:
|
|
434
|
+
default: N("Link", e);
|
|
435
435
|
}
|
|
436
436
|
return {
|
|
437
437
|
context: l,
|
|
@@ -440,7 +440,7 @@ async function Y({ canutesDb: e, legiResolver: t, date: n, linkBaseUrl: r, linkT
|
|
|
440
440
|
}
|
|
441
441
|
//#endregion
|
|
442
442
|
//#region src/lib/loaders/assemblee.ts
|
|
443
|
-
async function
|
|
443
|
+
async function Hn(e, t, n) {
|
|
444
444
|
let r = t.get("Document");
|
|
445
445
|
r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("Document", r));
|
|
446
446
|
let i = r.get(n);
|
|
@@ -450,7 +450,7 @@ async function Bn(e, t, n) {
|
|
|
450
450
|
WHERE uid = ${n}
|
|
451
451
|
`)[0]?.data, r.set(n, i ?? null)), i ?? void 0;
|
|
452
452
|
}
|
|
453
|
-
async function
|
|
453
|
+
async function Un(e, t, n) {
|
|
454
454
|
let r = t.get("Document");
|
|
455
455
|
return r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("Document", r)), (await e`
|
|
456
456
|
SELECT data, uid
|
|
@@ -458,7 +458,7 @@ async function Vn(e, t, n) {
|
|
|
458
458
|
WHERE data ->> 'dossierRef' = ${n}
|
|
459
459
|
`).map(({ data: e, uid: t }) => (r.set(t, e ?? null), e));
|
|
460
460
|
}
|
|
461
|
-
async function
|
|
461
|
+
async function Wn(e, t, n) {
|
|
462
462
|
let r = t.get("DossierParlementaire");
|
|
463
463
|
r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("DossierParlementaire", r));
|
|
464
464
|
let i = r.get(n);
|
|
@@ -470,15 +470,15 @@ async function Hn(e, t, n) {
|
|
|
470
470
|
}
|
|
471
471
|
//#endregion
|
|
472
472
|
//#region src/lib/text_parsers/search_queries.ts
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
w(
|
|
476
|
-
|
|
473
|
+
var Gn = C("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i" }), Y = k([
|
|
474
|
+
Gn,
|
|
475
|
+
w(O, { default: "" }),
|
|
476
|
+
T(h, c)
|
|
477
477
|
], { value: (e, t) => ({
|
|
478
478
|
num: e[2],
|
|
479
479
|
position: t.position(),
|
|
480
480
|
type: "article"
|
|
481
|
-
}) }),
|
|
481
|
+
}) }), X = T(C("c(?:ode|\\.)? ?civ(?:il)?", {
|
|
482
482
|
flags: "i",
|
|
483
483
|
value: (e, t) => ({
|
|
484
484
|
cid: "LEGITEXT000006070721",
|
|
@@ -487,7 +487,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
487
487
|
title: "Code civil",
|
|
488
488
|
type: "texte"
|
|
489
489
|
})
|
|
490
|
-
}),
|
|
490
|
+
}), C("c(?:ode|\\.)? ?trav(?:ail)?", {
|
|
491
491
|
flags: "i",
|
|
492
492
|
value: (e, t) => ({
|
|
493
493
|
cid: "LEGITEXT000006072050",
|
|
@@ -496,7 +496,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
496
496
|
title: "Code du travail",
|
|
497
497
|
type: "texte"
|
|
498
498
|
})
|
|
499
|
-
}),
|
|
499
|
+
}), C("c(?:ode|\\.)? ?p[eé]n(?:al)?", {
|
|
500
500
|
flags: "i",
|
|
501
501
|
value: (e, t) => ({
|
|
502
502
|
cid: "LEGITEXT000006070719",
|
|
@@ -505,7 +505,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
505
505
|
title: "Code pénal",
|
|
506
506
|
type: "texte"
|
|
507
507
|
})
|
|
508
|
-
}),
|
|
508
|
+
}), C("c(?:ode|\\.)? ?pr(?:oc(?:[eé]dure)?)? ?p[eé]n(?:al)?|cpp", {
|
|
509
509
|
flags: "i",
|
|
510
510
|
value: (e, t) => ({
|
|
511
511
|
cid: "LEGITEXT000006071154",
|
|
@@ -514,7 +514,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
514
514
|
title: "Code de procédure pénale",
|
|
515
515
|
type: "texte"
|
|
516
516
|
})
|
|
517
|
-
}),
|
|
517
|
+
}), C("c(?:ode|\\.)? ?pr(?:oc(?:[eé]dure)?)? ?civ(?:il)?|cpc", {
|
|
518
518
|
flags: "i",
|
|
519
519
|
value: (e, t) => ({
|
|
520
520
|
cid: "LEGITEXT000006070716",
|
|
@@ -523,7 +523,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
523
523
|
title: "Code de procédure civile",
|
|
524
524
|
type: "texte"
|
|
525
525
|
})
|
|
526
|
-
}),
|
|
526
|
+
}), C("c(?:ode|\\.)? ?s[eé]cur(?:it[eé])? ?soc(?:iale)?|css", {
|
|
527
527
|
flags: "i",
|
|
528
528
|
value: (e, t) => ({
|
|
529
529
|
cid: "LEGITEXT000006073189",
|
|
@@ -532,7 +532,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
532
532
|
title: "Code de la sécurité sociale",
|
|
533
533
|
type: "texte"
|
|
534
534
|
})
|
|
535
|
-
}),
|
|
535
|
+
}), C("c(?:ode|\\.)? ?rur(?:al)?(?: et de la p[êe]che maritime)?", {
|
|
536
536
|
flags: "i",
|
|
537
537
|
value: (e, t) => ({
|
|
538
538
|
cid: "LEGITEXT000006071367",
|
|
@@ -541,7 +541,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
541
541
|
title: "Code rural et de la pêche maritime",
|
|
542
542
|
type: "texte"
|
|
543
543
|
})
|
|
544
|
-
}),
|
|
544
|
+
}), C("c(?:ode|\\.)? ?env(?:ironnement)?", {
|
|
545
545
|
flags: "i",
|
|
546
546
|
value: (e, t) => ({
|
|
547
547
|
cid: "LEGITEXT000006074220",
|
|
@@ -550,7 +550,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
550
550
|
title: "Code de l'environnement",
|
|
551
551
|
type: "texte"
|
|
552
552
|
})
|
|
553
|
-
}),
|
|
553
|
+
}), C("c(?:ode|\\.)? ?urb(?:anisme)?", {
|
|
554
554
|
flags: "i",
|
|
555
555
|
value: (e, t) => ({
|
|
556
556
|
cid: "LEGITEXT000006074075",
|
|
@@ -559,7 +559,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
559
559
|
title: "Code de l'urbanisme",
|
|
560
560
|
type: "texte"
|
|
561
561
|
})
|
|
562
|
-
}),
|
|
562
|
+
}), C("c(?:ode|\\.)? ?jus(?:tice)? ?adm(?:in(?:istrative)?)?|cja", {
|
|
563
563
|
flags: "i",
|
|
564
564
|
value: (e, t) => ({
|
|
565
565
|
cid: "LEGITEXT000006070933",
|
|
@@ -568,7 +568,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
568
568
|
title: "Code de justice administrative",
|
|
569
569
|
type: "texte"
|
|
570
570
|
})
|
|
571
|
-
}),
|
|
571
|
+
}), C("cgi", {
|
|
572
572
|
flags: "i",
|
|
573
573
|
value: (e, t) => ({
|
|
574
574
|
cid: "LEGITEXT000006069577",
|
|
@@ -577,7 +577,7 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
577
577
|
title: "Code général des impôts",
|
|
578
578
|
type: "texte"
|
|
579
579
|
})
|
|
580
|
-
}),
|
|
580
|
+
}), C("c(?:ode|\\.)? ?com(?:merce)?", {
|
|
581
581
|
flags: "i",
|
|
582
582
|
value: (e, t) => ({
|
|
583
583
|
cid: "LEGITEXT000005634379",
|
|
@@ -586,30 +586,30 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
586
586
|
title: "Code de commerce",
|
|
587
587
|
type: "texte"
|
|
588
588
|
})
|
|
589
|
-
})),
|
|
589
|
+
})), Z = T(X, x(j, { value: (e, t) => e === void 0 ? void 0 : {
|
|
590
590
|
...e,
|
|
591
591
|
position: t.position()
|
|
592
|
-
} }),
|
|
592
|
+
} }), x(D, { value: (e, t) => ({
|
|
593
593
|
...e,
|
|
594
594
|
position: t.position()
|
|
595
|
-
}) })),
|
|
595
|
+
}) })), Q = w(C(" (?:du |de la |de l'|des |de |d')?", { flags: "i" }), { default: "" }), Kn = C(".+?(?=\\s*(?:du |de la |de l'|des |de |d')?\\s*(?:art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?))", {
|
|
596
596
|
flags: "i",
|
|
597
597
|
value: (e, t) => ({
|
|
598
598
|
type: "texte",
|
|
599
599
|
title: e[0].trim(),
|
|
600
600
|
position: t.position()
|
|
601
601
|
})
|
|
602
|
-
}),
|
|
602
|
+
}), $ = C(".+", {
|
|
603
603
|
flags: "i",
|
|
604
604
|
value: (e, t) => ({
|
|
605
605
|
type: "texte",
|
|
606
606
|
title: e[0].trim(),
|
|
607
607
|
position: t.position()
|
|
608
608
|
})
|
|
609
|
-
}),
|
|
609
|
+
}), qn = T(k([
|
|
610
|
+
Z,
|
|
610
611
|
Q,
|
|
611
|
-
|
|
612
|
-
Z
|
|
612
|
+
Y
|
|
613
613
|
], { value: (e, t) => {
|
|
614
614
|
let n = e[0];
|
|
615
615
|
return {
|
|
@@ -618,19 +618,19 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
618
618
|
position: t.position(),
|
|
619
619
|
type: "parent-enfant"
|
|
620
620
|
};
|
|
621
|
-
} }),
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
621
|
+
} }), k([
|
|
622
|
+
Y,
|
|
623
|
+
Q,
|
|
624
|
+
Z
|
|
625
625
|
], { value: (e, t) => ({
|
|
626
626
|
child: e[0],
|
|
627
627
|
parent: e[2],
|
|
628
628
|
position: t.position(),
|
|
629
629
|
type: "parent-enfant"
|
|
630
|
-
}) }),
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
630
|
+
}) }), k([
|
|
631
|
+
Kn,
|
|
632
|
+
Q,
|
|
633
|
+
Y
|
|
634
634
|
], { value: (e, t) => {
|
|
635
635
|
let n = e[0];
|
|
636
636
|
return {
|
|
@@ -639,15 +639,15 @@ var X = E("art(?:icle|icl|ic|i|s)?\\.?|al(?:inéa|inea|in|i)?\\.?", { flags: "i"
|
|
|
639
639
|
position: t.position(),
|
|
640
640
|
type: "parent-enfant"
|
|
641
641
|
};
|
|
642
|
-
} }),
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
642
|
+
} }), k([
|
|
643
|
+
Y,
|
|
644
|
+
Q,
|
|
645
|
+
$
|
|
646
646
|
], { value: (e, t) => ({
|
|
647
647
|
child: e[0],
|
|
648
648
|
parent: e[2],
|
|
649
649
|
position: t.position(),
|
|
650
650
|
type: "parent-enfant"
|
|
651
|
-
}) }),
|
|
651
|
+
}) }), Y, Z, $), Jn = Vn;
|
|
652
652
|
//#endregion
|
|
653
|
-
export {
|
|
653
|
+
export { gn as LegiResolver, S as TextParserContext, Se as action, _e as actionDirective, m as actionTargets, te as addChildLeftToLastChild, ot as addLinksOrReferencesToHtmlPage, Xe as addLinksToHtml, Vn as addLinksToMarkdown, Jn as addLinksToText, it as addPositionsToTableOfContentsItems, Kt as adjectifNumeralCardinal, Jt as adjectifNumeralOrdinalCourt, Ot as adjectifTemporelSingulier, vn as adverbeMultiplicatifLatin, Tt as adverbeRelatif, T as alternatives, ut as article, mt as articles, N as assertNever, r as auPortion, Ge as auxPortions, ln as buildAndInstallTextTitlesInfos, rt as buildArticlePortionTreeFromHtml, pn as buildTextTitlesInfos, k as chain, Mt as chainTransformers, we as citation, Oe as citationLigne, fe as citationSimple, e as citationToText, y as citedArticleNumFromTextCitation, jn as classifyArticleTemporalStatus, hn as cleanTexteTitle, ye as compoundReferencesSeparators, x as convert, vt as convertHtmlElementsToText, se as createEnumerationOrBoundedInterval, he as createParentChildTreeFromReferences, A as date, yn as decodeNamedHtmlEntities, Bt as decodeNumericHtmlEntities, Pe as definitionArticleDansCitation, ft as definitionArticleDansProjetOuPropositionLoi, ze as definitionDivision, Yt as definitionTexteFrancais, ge as designationArticle, et as designationDivision, Ut as ditPluriel, Ht as ditSingulier, Ye as division, Ce as divisionTypes, He as divisions, mn as duDate, O as espace, Vt as espaceAdverbeRelatif, f as europeanLawNatures, P as extendLoadedArticle, Be as extractActionDirectiveAstsFromText, Ae as extractActionDirectivesFromHtml, lt as extractActionDirectivesFromText, o as extractArticleDefinitionsFromCitation, Le as extractBillDefinitions, ue as extractCitationReferences, st as extractFrenchCitations, We as extractPortionSelectors, l as extractReferences, ee as extractReferencesWithOriginalTransformations, _ as extractTextLinks, n as findBoundaryPositionCue, zn as formatLongDate, ae as frenchLawNatures, Nn as getArticleDateDebut, V as getArticleDateSignature, oe as getExtractedReferences, me as getExtractedReferencesWithOriginalTransformations, Fe as getExtractedTableOfContentsFromTextBill, Me as getLegalPhraseTextBounds, F as getOrLoadArticle, Pn as getOrLoadArticleSiblingId, Hn as getOrLoadDocument, Un as getOrLoadDocumentsByDossierParlementaireUid, Wn as getOrLoadDossierParlementaire, Cn as getOrLoadJo, I as getOrLoadSectionTa, wn as getOrLoadSectionsTa, kn as getOrLoadTexteVersion, En as getOrLoadTextekali, Tn as getOrLoadTextelr, On as getOrLoadTextesVersions, Dn as getOrLoadTexteslr, qe as getTableOfContentsItems, Qe as getTableUnitNoteRanges, qt as getTexteVersionDateDebut, on as getTexteVersionDateSignature, Zt as identificationTexteEuropeen, nt as internationalLawNatures, Wt as introPluriel, It as introSingulier, at as isArticlePortionStructuralStart, z as isLegifranceSentinelDate, re as isTextAstAtomicReference, De as isTextAstDivision, Te as isTextAstPortion, gt as iterAtomicFirstParentReferences, a as iterAtomicReferences, xe as iterIncludedReferences, Re as iterReferenceLinks, Bn as jsonReplacer, ke as lawNatures, zt as lettreAscii, _t as liaisonPluriel, Xt as liaisonSingulier, Ue as linkTypes, dt as listeArticles, ht as listeReferencesSeules, An as loadArticles, pe as localizationAdverbs, Ve as natureDivisionSingulier, un as natureTexteFrancais, q as newAssembleeObjectCache, In as newLegifranceObjectCache, Ln as newObjectCache, Pt as newReverseTransformationsMergedFromPositionsIterator, h as nomArticle, c as nomSpecialArticle, Qt as nombreAsTextAstNumber, dn as nombreCardinal, cn as nombreRomainCardinal, nn as nombreRomainOrdinal, en as nombreRomainOu0iAsTextAstNumber, yt as nonLettre, s as normalizeBillArticleNumber, bn as numero, je as numeroDivision, sn as numeroEtOuDateTexteFrancais, ce as numeroPortion, tn as numeroTexteEuropeen, $t as numeroTexteFrancais, w as optional, Gt as optionalEspaceDuTerritoire, le as parseArticleNumber, Ie as parseArticleSubdivisionMarker, Ke as parseBillArticleLabel, Ze as parseFrenchCitationAt, Ft as parseText, t as portionTypes, de as portions, i as reference, d as referenceDoctrinale, ie as referenceDoctrinaleArticleAvantSource, tt as referenceDoctrinaleArticlesAvantSource, ne as referenceDoctrinaleSourceAvantArticle, be as referenceSeule, C as regExp, wt as relatifPlurielPrepose, fn as relatifSingulierPrepose, Dt as repeat, xt as replaceHtmlPatterns, bt as replacePattern, Nt as replaceTextPatterns, pt as resolveActionDirectivesFromHtml, Ne as resolveActionDirectivesFromText, Je as resolvePortionSelector, Ct as reversePositionsSplitFromPositions, Et as reverseTransformationFromPosition, kt as reverseTransformationsMergedFromPositions, E as reverseTransformedInnerFragment, M as reverseTransformedReplacement, Y as searchArticle, Gn as searchArticleKeyword, qn as searchQueryReference, Z as searchTexte, X as searchTexteAbbreviations, an as simplifyHtml, b as simplifyPlainText, rn as simplifyText, jt as simplifyUnicodeCharacters, Fn as sortArticlesByDate, _n as sortTextesVersionsByDate, xn as texte, D as texteEuropeen, j as texteFrancais, Ee as texteFrancaisAbrege, Rt as texteInternational, u as unePortion, p as uniteBasePreciseeSingulier, ve as uniteBaseSingulier, g as urlFromArticleVersionsId, v as urlFromLegalId, At as variable, St as virguleOuEspace, ct as walkTableOfContents, Lt as wordsTree };
|