@tricoteuses/assemblee 2.0.2 → 2.1.0

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.
Files changed (168) hide show
  1. package/README.md +26 -8
  2. package/lib/amendements-40Z7OJLT.js +682 -0
  3. package/lib/amendements-DcffXOt8.js +154 -0
  4. package/lib/api.d.ts +0 -1
  5. package/lib/cleaners/actes_legislatifs.d.ts +0 -1
  6. package/lib/cleaners/acteurs.d.ts +0 -1
  7. package/lib/cleaners/amendements.d.ts +0 -1
  8. package/lib/cleaners/debats.d.ts +0 -1
  9. package/lib/cleaners/documents.d.ts +0 -1
  10. package/lib/cleaners/dossiers_legislatifs.d.ts +0 -1
  11. package/lib/cleaners/index.d.ts +0 -1
  12. package/lib/cleaners/organes.d.ts +0 -1
  13. package/lib/cleaners/questions.d.ts +0 -1
  14. package/lib/cleaners/reunions.d.ts +0 -1
  15. package/lib/cleaners/scrutins.d.ts +0 -1
  16. package/lib/cleaners/xml.d.ts +0 -1
  17. package/lib/cleaners.js +508 -1082
  18. package/lib/datasets.d.ts +0 -1
  19. package/lib/dates.d.ts +0 -1
  20. package/lib/dossiers_legislatifs.d.ts +1 -3
  21. package/lib/file_systems.d.ts +0 -1
  22. package/lib/git.d.ts +0 -1
  23. package/lib/index.d.ts +8 -9
  24. package/lib/index.js +857 -1211
  25. package/lib/inserters.d.ts +0 -1
  26. package/lib/loaders-DX6btNsl.js +4201 -0
  27. package/lib/loaders.d.ts +0 -1
  28. package/lib/loaders.js +27 -983
  29. package/lib/logger.d.ts +0 -1
  30. package/lib/organes.d.ts +0 -1
  31. package/lib/parse-Ccs6wcUg.js +2512 -0
  32. package/lib/parsers/index.d.ts +0 -1
  33. package/lib/parsers/plf.d.ts +0 -1
  34. package/lib/parsers/recherche_amendements.d.ts +3 -1
  35. package/lib/parsers/textes_lois.d.ts +0 -1
  36. package/lib/parsers.js +292 -287
  37. package/lib/raw_types/acteurs_et_organes.d.ts +0 -1
  38. package/lib/raw_types/agendas.d.ts +0 -1
  39. package/lib/raw_types/amendements.d.ts +0 -1
  40. package/lib/raw_types/debats.d.ts +0 -1
  41. package/lib/raw_types/dossiers_legislatifs.d.ts +8 -9
  42. package/lib/raw_types/questions.d.ts +0 -1
  43. package/lib/raw_types/scrutins.d.ts +0 -1
  44. package/lib/schemas/acteurs_et_organes.json +26 -26
  45. package/lib/schemas/agendas.json +47 -47
  46. package/lib/schemas/amendements.json +69 -68
  47. package/lib/schemas/dossiers_legislatifs.json +112 -112
  48. package/lib/schemas/questions.json +25 -25
  49. package/lib/schemas/scrutins.json +15 -15
  50. package/lib/scripts/add_links_to_documents.d.ts +0 -1
  51. package/lib/scripts/clean_reorganized_data.d.ts +0 -1
  52. package/lib/scripts/copy-schemas.d.ts +0 -1
  53. package/lib/scripts/diff_amendements.d.ts +0 -1
  54. package/lib/scripts/document_dossiers_legislatifs.d.ts +0 -1
  55. package/lib/scripts/generate-json-schemas.d.ts +0 -1
  56. package/lib/scripts/get_today_reunions.d.ts +0 -1
  57. package/lib/scripts/merge_scrutins.d.ts +0 -1
  58. package/lib/scripts/process_open_dataset.d.ts +0 -1
  59. package/lib/scripts/raw_types_from_amendements.d.ts +0 -1
  60. package/lib/scripts/reorganize_data.d.ts +0 -1
  61. package/lib/scripts/retrieve_deputes_photos.d.ts +0 -1
  62. package/lib/scripts/retrieve_documents.d.ts +0 -1
  63. package/lib/scripts/retrieve_open_data.d.ts +0 -1
  64. package/lib/scripts/retrieve_pending_amendments.d.ts +0 -1
  65. package/lib/scripts/retrieve_senateurs_photos.d.ts +0 -1
  66. package/lib/scripts/shared/cli_helpers.d.ts +0 -1
  67. package/lib/scripts/test_iter_load.d.ts +0 -1
  68. package/lib/scripts/test_load.d.ts +0 -1
  69. package/lib/scripts/test_load_big_files.d.ts +0 -1
  70. package/lib/scripts/validate_json.d.ts +0 -1
  71. package/lib/shared_types/codes_actes.d.ts +0 -1
  72. package/lib/strings.d.ts +0 -1
  73. package/lib/types/acteurs_et_organes.d.ts +26 -27
  74. package/lib/types/agendas.d.ts +21 -22
  75. package/lib/types/amendements.d.ts +76 -51
  76. package/lib/types/debats.d.ts +0 -1
  77. package/lib/types/dossiers_legislatifs.d.ts +51 -52
  78. package/lib/types/legislatures.d.ts +0 -1
  79. package/lib/types/questions.d.ts +22 -25
  80. package/lib/types/scrutins.d.ts +15 -16
  81. package/lib/urls.d.ts +0 -1
  82. package/package.json +12 -4
  83. package/lib/amendements-CN7bRFdP.js +0 -259
  84. package/lib/amendements-CN7bRFdP.js.map +0 -1
  85. package/lib/amendements-Cg1lyCBp.js +0 -735
  86. package/lib/amendements-Cg1lyCBp.js.map +0 -1
  87. package/lib/api.d.ts.map +0 -1
  88. package/lib/cleaners/actes_legislatifs.d.ts.map +0 -1
  89. package/lib/cleaners/acteurs.d.ts.map +0 -1
  90. package/lib/cleaners/amendements.d.ts.map +0 -1
  91. package/lib/cleaners/debats.d.ts.map +0 -1
  92. package/lib/cleaners/documents.d.ts.map +0 -1
  93. package/lib/cleaners/dossiers_legislatifs.d.ts.map +0 -1
  94. package/lib/cleaners/index.d.ts.map +0 -1
  95. package/lib/cleaners/organes.d.ts.map +0 -1
  96. package/lib/cleaners/questions.d.ts.map +0 -1
  97. package/lib/cleaners/reunions.d.ts.map +0 -1
  98. package/lib/cleaners/scrutins.d.ts.map +0 -1
  99. package/lib/cleaners/xml.d.ts.map +0 -1
  100. package/lib/cleaners.js.map +0 -1
  101. package/lib/datasets.d.ts.map +0 -1
  102. package/lib/dates.d.ts.map +0 -1
  103. package/lib/debats-BwZYgzXe.js +0 -3978
  104. package/lib/debats-BwZYgzXe.js.map +0 -1
  105. package/lib/dossiers_legislatifs.d.ts.map +0 -1
  106. package/lib/file_systems.d.ts.map +0 -1
  107. package/lib/git.d.ts.map +0 -1
  108. package/lib/index.d.ts.map +0 -1
  109. package/lib/index.js.map +0 -1
  110. package/lib/inserters.d.ts.map +0 -1
  111. package/lib/loaders.d.ts.map +0 -1
  112. package/lib/loaders.js.map +0 -1
  113. package/lib/logger.d.ts.map +0 -1
  114. package/lib/organes.d.ts.map +0 -1
  115. package/lib/parse-CzW8NHW5.js +0 -2850
  116. package/lib/parse-CzW8NHW5.js.map +0 -1
  117. package/lib/parsers/index.d.ts.map +0 -1
  118. package/lib/parsers/plf.d.ts.map +0 -1
  119. package/lib/parsers/recherche_amendements.d.ts.map +0 -1
  120. package/lib/parsers/textes_lois.d.ts.map +0 -1
  121. package/lib/parsers.js.map +0 -1
  122. package/lib/raw_types/acteurs_et_organes.d.ts.map +0 -1
  123. package/lib/raw_types/agendas.d.ts.map +0 -1
  124. package/lib/raw_types/amendements.d.ts.map +0 -1
  125. package/lib/raw_types/debats.d.ts.map +0 -1
  126. package/lib/raw_types/dossiers_legislatifs.d.ts.map +0 -1
  127. package/lib/raw_types/questions.d.ts.map +0 -1
  128. package/lib/raw_types/scrutins.d.ts.map +0 -1
  129. package/lib/schemas/acteurs_et_organes.d.json +0 -982
  130. package/lib/schemas/agendas.d.json +0 -1561
  131. package/lib/schemas/amendements.d.json +0 -1901
  132. package/lib/schemas/debats.d.json +0 -623
  133. package/lib/schemas/dossiers_legislatifs.d.json +0 -3690
  134. package/lib/schemas/legislatures.d.json +0 -17
  135. package/lib/schemas/questions.d.json +0 -520
  136. package/lib/schemas/scrutins.d.json +0 -517
  137. package/lib/scripts/add_links_to_documents.d.ts.map +0 -1
  138. package/lib/scripts/clean_reorganized_data.d.ts.map +0 -1
  139. package/lib/scripts/copy-schemas.d.ts.map +0 -1
  140. package/lib/scripts/diff_amendements.d.ts.map +0 -1
  141. package/lib/scripts/document_dossiers_legislatifs.d.ts.map +0 -1
  142. package/lib/scripts/generate-json-schemas.d.ts.map +0 -1
  143. package/lib/scripts/get_today_reunions.d.ts.map +0 -1
  144. package/lib/scripts/merge_scrutins.d.ts.map +0 -1
  145. package/lib/scripts/process_open_dataset.d.ts.map +0 -1
  146. package/lib/scripts/raw_types_from_amendements.d.ts.map +0 -1
  147. package/lib/scripts/reorganize_data.d.ts.map +0 -1
  148. package/lib/scripts/retrieve_deputes_photos.d.ts.map +0 -1
  149. package/lib/scripts/retrieve_documents.d.ts.map +0 -1
  150. package/lib/scripts/retrieve_open_data.d.ts.map +0 -1
  151. package/lib/scripts/retrieve_pending_amendments.d.ts.map +0 -1
  152. package/lib/scripts/retrieve_senateurs_photos.d.ts.map +0 -1
  153. package/lib/scripts/shared/cli_helpers.d.ts.map +0 -1
  154. package/lib/scripts/test_iter_load.d.ts.map +0 -1
  155. package/lib/scripts/test_load.d.ts.map +0 -1
  156. package/lib/scripts/test_load_big_files.d.ts.map +0 -1
  157. package/lib/scripts/validate_json.d.ts.map +0 -1
  158. package/lib/shared_types/codes_actes.d.ts.map +0 -1
  159. package/lib/strings.d.ts.map +0 -1
  160. package/lib/types/acteurs_et_organes.d.ts.map +0 -1
  161. package/lib/types/agendas.d.ts.map +0 -1
  162. package/lib/types/amendements.d.ts.map +0 -1
  163. package/lib/types/debats.d.ts.map +0 -1
  164. package/lib/types/dossiers_legislatifs.d.ts.map +0 -1
  165. package/lib/types/legislatures.d.ts.map +0 -1
  166. package/lib/types/questions.d.ts.map +0 -1
  167. package/lib/types/scrutins.d.ts.map +0 -1
  168. package/lib/urls.d.ts.map +0 -1
package/lib/cleaners.js CHANGED
@@ -1,1138 +1,564 @@
1
- import assert from "node:assert";
2
- import { c as cleanXmlArtefacts, a as cleanBooleanAttribute, b as cleanIntegerAttribute } from "./amendements-CN7bRFdP.js";
3
- import { d } from "./amendements-CN7bRFdP.js";
4
- function cleanActeur(acteur) {
5
- cleanXmlArtefacts(acteur);
6
- assert.strictEqual(acteur.uid["@xsi:type"], "IdActeur_type");
7
- acteur.uid = acteur.uid["#text"];
8
- assert(acteur.uid);
9
- const etatCivil = acteur.etatCivil;
1
+ import t from "node:assert";
2
+ import { c as f, a as S, b as _ } from "./amendements-DcffXOt8.js";
3
+ import { d as Y } from "./amendements-DcffXOt8.js";
4
+ function $(e) {
5
+ f(e), t.strictEqual(e.uid["@xsi:type"], "IdActeur_type"), e.uid = e.uid["#text"], t(e.uid);
6
+ const n = e.etatCivil;
10
7
  {
11
- cleanXmlArtefacts(etatCivil);
12
- const ident = etatCivil.ident;
8
+ f(n);
9
+ const o = n.ident;
13
10
  {
14
- cleanXmlArtefacts(ident);
15
- const infoNaissance = etatCivil.infoNaissance;
16
- {
17
- cleanXmlArtefacts(infoNaissance);
18
- }
19
- }
20
- }
21
- const profession = acteur.profession;
22
- if (profession !== void 0) {
23
- cleanXmlArtefacts(profession);
24
- const socProcInsee = profession.socProcINSEE;
25
- assert(socProcInsee);
26
- cleanXmlArtefacts(socProcInsee);
27
- delete profession.socProcINSEE;
28
- profession.socProcInsee = socProcInsee;
29
- }
30
- const uriHatvp = acteur.uri_hatvp;
31
- if (uriHatvp !== void 0) {
32
- acteur.uriHatvp = uriHatvp;
33
- delete acteur.uri_hatvp;
34
- }
35
- let adresses = acteur.adresses;
36
- if (adresses !== void 0) {
37
- adresses = adresses.adresse;
38
- if (adresses === void 0) {
39
- delete acteur.adresses;
40
- adresses = void 0;
41
- } else if (Array.isArray(adresses)) {
42
- acteur.adresses = adresses;
43
- } else {
44
- assert.notStrictEqual(adresses, null);
45
- assert.strictEqual(typeof adresses, "object");
46
- acteur.adresses = adresses = [adresses];
47
- }
48
- if (adresses !== void 0) {
49
- for (const adresse of adresses) {
50
- cleanXmlArtefacts(adresse);
51
- const xsiType = adresse["@xsi:type"];
52
- assert([
11
+ f(o);
12
+ const s = n.infoNaissance;
13
+ f(s);
14
+ }
15
+ }
16
+ const d = e.profession;
17
+ if (d !== void 0) {
18
+ f(d);
19
+ const o = d.socProcINSEE;
20
+ t(o), f(o), delete d.socProcINSEE, d.socProcInsee = o;
21
+ }
22
+ const r = e.uri_hatvp;
23
+ r !== void 0 && (e.uriHatvp = r, delete e.uri_hatvp);
24
+ let c = e.adresses;
25
+ if (c !== void 0 && (c = c.adresse, c === void 0 ? (delete e.adresses, c = void 0) : Array.isArray(c) ? e.adresses = c : (t.notStrictEqual(c, null), t.strictEqual(typeof c, "object"), e.adresses = c = [c]), c !== void 0))
26
+ for (const o of c) {
27
+ f(o);
28
+ const s = o["@xsi:type"];
29
+ t(
30
+ [
53
31
  "AdresseMail_Type",
54
32
  "AdressePostale_Type",
55
33
  "AdresseSiteWeb_Type",
56
34
  "AdresseTelephonique_Type"
57
- ].includes(xsiType), `Unexpected "@xsi:type": ${xsiType}`);
58
- adresse.xsiType = xsiType;
59
- delete adresse["@xsi:type"];
60
- assert.notStrictEqual(adresse.uid, void 0);
61
- assert.notStrictEqual(adresse.type, void 0);
62
- assert.notStrictEqual(adresse.typeLibelle, void 0);
63
- if (xsiType === "AdressePostale_Type") {
64
- assert.strictEqual(adresse.adresseDeRattachement, void 0);
65
- }
66
- }
67
- }
68
- }
69
- let mandats = acteur.mandats;
70
- if (mandats !== void 0) {
71
- let mandat = mandats.mandat;
72
- if (Array.isArray(mandat)) {
73
- mandats = acteur.mandats = mandat;
74
- } else if (typeof mandat === "object") {
75
- mandats = acteur.mandats = [mandat];
76
- }
77
- for (const mandat2 of mandats) {
78
- cleanXmlArtefacts(mandat2);
79
- const xsiType = mandat2["@xsi:type"];
80
- if (xsiType !== void 0) {
81
- mandat2.xsiType = xsiType;
82
- delete mandat2["@xsi:type"];
83
- }
84
- const infosQualite = mandat2.infosQualite;
85
- {
86
- cleanXmlArtefacts(infosQualite);
87
- }
88
- const organes = mandat2.organes;
89
- delete mandat2.organes;
90
- let organesRefs = organes.organeRef;
91
- assert(organesRefs);
92
- if (!Array.isArray(organesRefs)) {
93
- organesRefs = [organesRefs];
94
- }
95
- mandat2.organesRefs = organesRefs;
96
- let suppleant = mandat2.suppleants;
97
- delete mandat2.suppleants;
98
- if (suppleant) {
99
- suppleant = suppleant.suppleant;
100
- assert(suppleant);
101
- mandat2.suppleant = suppleant;
102
- cleanXmlArtefacts(suppleant);
103
- }
104
- const election = mandat2.election;
105
- if (election !== void 0) {
106
- cleanXmlArtefacts(election);
107
- const lieu = election.lieu;
108
- cleanXmlArtefacts(lieu);
109
- }
110
- const mandature = mandat2.mandature;
111
- if (mandature !== void 0) {
112
- cleanXmlArtefacts(mandature);
113
- }
114
- assert.strictEqual(mandat2.chambre, void 0);
115
- let collaborateurs = mandat2.collaborateurs;
116
- if (collaborateurs !== void 0) {
117
- const collaborateursArray = Array.isArray(collaborateurs) ? collaborateurs.filter((collaborateur) => collaborateur !== null) : [collaborateurs];
118
- collaborateurs = [];
119
- collaborateursArray.map(({ collaborateur }) => {
120
- if (Array.isArray(collaborateur)) {
121
- for (const collaborateurItem of collaborateur) {
122
- if (collaborateurItem !== null) {
123
- collaborateurs.push(collaborateurItem);
124
- }
125
- }
126
- } else if (collaborateur) {
127
- collaborateurs.push(collaborateur);
128
- }
129
- });
130
- if (collaborateurs.length === 0) {
131
- delete mandat2.collaborateurs;
132
- collaborateurs = void 0;
133
- } else {
134
- mandat2.collaborateurs = collaborateurs;
135
- }
136
- for (const collaborateur of collaborateurs || []) {
137
- cleanXmlArtefacts(collaborateur);
138
- assert.strictEqual(collaborateur.dateDebut, void 0);
139
- assert.strictEqual(collaborateur.dateFin, void 0);
140
- }
141
- }
142
- const infosHorsSian = mandat2.InfosHorsSIAN;
143
- if (infosHorsSian !== void 0) {
144
- cleanXmlArtefacts(infosHorsSian);
145
- assert.strictEqual(infosHorsSian.HATVP_URI, void 0);
146
- assert.strictEqual(Object.keys(infosHorsSian).length, 0);
147
- delete mandat2.InfosHorsSIAN;
148
- }
149
- }
150
- mandats.sort((a, b) => a.uid.length === b.uid.length ? a.uid.localeCompare(b.uid) : a.uid.length - b.uid.length);
151
- }
152
- let deports = acteur.deports;
153
- if (deports !== void 0) {
154
- let deport = deports.deport;
155
- if (Array.isArray(deport)) {
156
- deports = acteur.deports = deport;
157
- } else if (typeof deport === "object") {
158
- deports = acteur.deports = [deport];
159
- }
160
- for (const deport2 of deports) {
161
- cleanXmlArtefacts(deport2);
162
- const cible = deport2.cible;
163
- {
164
- cleanXmlArtefacts(cible);
165
- assert.strictEqual(cible.references, void 0);
166
- }
167
- }
168
- deports.sort((a, b) => a.uid.length === b.uid.length ? a.uid.localeCompare(b.uid) : a.uid.length - b.uid.length);
35
+ ].includes(s),
36
+ `Unexpected "@xsi:type": ${s}`
37
+ ), o.xsiType = s, delete o["@xsi:type"], t.notStrictEqual(o.uid, void 0), t.notStrictEqual(o.type, void 0), t.notStrictEqual(o.typeLibelle, void 0), s === "AdressePostale_Type" && t.strictEqual(o.adresseDeRattachement, void 0);
38
+ }
39
+ let l = e.mandats;
40
+ if (l !== void 0) {
41
+ let o = l.mandat;
42
+ Array.isArray(o) ? l = e.mandats = o : typeof o == "object" && (l = e.mandats = [o]);
43
+ for (const s of l) {
44
+ f(s);
45
+ const u = s["@xsi:type"];
46
+ u !== void 0 && (s.xsiType = u, delete s["@xsi:type"]);
47
+ const m = s.infosQualite;
48
+ f(m);
49
+ const i = s.organes;
50
+ delete s.organes;
51
+ let a = i.organeRef;
52
+ t(a), Array.isArray(a) || (a = [a]), s.organesRefs = a;
53
+ let v = s.suppleants;
54
+ delete s.suppleants, v && (v = v.suppleant, t(v), s.suppleant = v, f(v));
55
+ const R = s.election;
56
+ if (R !== void 0) {
57
+ f(R);
58
+ const D = R.lieu;
59
+ f(D);
60
+ }
61
+ const q = s.mandature;
62
+ q !== void 0 && f(q), t.strictEqual(s.chambre, void 0);
63
+ let y = s.collaborateurs;
64
+ if (y !== void 0) {
65
+ const D = Array.isArray(y) ? y.filter((A) => A !== null) : [y];
66
+ y = [], D.map(({ collaborateur: A }) => {
67
+ if (Array.isArray(A))
68
+ for (const O of A)
69
+ O !== null && y.push(O);
70
+ else A && y.push(A);
71
+ }), y.length === 0 ? (delete s.collaborateurs, y = void 0) : s.collaborateurs = y;
72
+ for (const A of y || [])
73
+ f(A), t.strictEqual(A.dateDebut, void 0), t.strictEqual(A.dateFin, void 0);
74
+ }
75
+ const E = s.InfosHorsSIAN;
76
+ E !== void 0 && (f(E), t.strictEqual(E.HATVP_URI, void 0), t.strictEqual(Object.keys(E).length, 0), delete s.InfosHorsSIAN);
77
+ }
78
+ l.sort(
79
+ (s, u) => s.uid.length === u.uid.length ? s.uid.localeCompare(u.uid) : s.uid.length - u.uid.length
80
+ );
81
+ }
82
+ let p = e.deports;
83
+ if (p !== void 0) {
84
+ let o = p.deport;
85
+ Array.isArray(o) ? p = e.deports = o : typeof o == "object" && (p = e.deports = [o]);
86
+ for (const s of p) {
87
+ f(s);
88
+ const u = s.cible;
89
+ f(u), t.strictEqual(u.references, void 0);
90
+ }
91
+ p.sort(
92
+ (s, u) => s.uid.length === u.uid.length ? s.uid.localeCompare(u.uid) : s.uid.length - u.uid.length
93
+ );
169
94
  }
170
95
  }
171
- function cleanRapporteur(rapporteur) {
172
- const etudePlfRef = rapporteur.etudePLFRef;
173
- if (rapporteur.etudePLFRef !== void 0) {
174
- delete rapporteur.etudePLFRef;
175
- rapporteur.etudePlfRef = etudePlfRef;
176
- }
96
+ function C(e) {
97
+ const n = e.etudePLFRef;
98
+ e.etudePLFRef !== void 0 && (delete e.etudePLFRef, e.etudePlfRef = n);
177
99
  }
178
- function cleanDocumentOrDivision(d2) {
179
- cleanXmlArtefacts(d2);
180
- if (d2.metadatas?.dateSuppression !== void 0) {
181
- for (const key of Object.getOwnPropertyNames(d2)) {
182
- delete d2[key];
183
- }
100
+ function w(e) {
101
+ if (f(e), e.metadatas?.dateSuppression !== void 0) {
102
+ for (const i of Object.getOwnPropertyNames(e))
103
+ delete e[i];
184
104
  return;
185
105
  }
186
- const xsiType = d2["@xsi:type"];
187
- if (xsiType !== void 0) {
188
- d2.xsiType = xsiType;
189
- delete d2["@xsi:type"];
190
- }
191
- const cycleDeVie = d2.cycleDeVie;
192
- assert(cycleDeVie);
106
+ const n = e["@xsi:type"];
107
+ n !== void 0 && (e.xsiType = n, delete e["@xsi:type"]);
108
+ const d = e.cycleDeVie;
109
+ t(d);
193
110
  {
194
- const chrono = cycleDeVie.chrono;
195
- assert(chrono);
196
- cleanXmlArtefacts(chrono);
197
- }
198
- let divisions = d2.divisions;
199
- if (divisions !== void 0) {
200
- divisions = divisions.division;
201
- if (!Array.isArray(divisions)) {
202
- assert(divisions);
203
- divisions = [divisions];
204
- }
205
- d2.divisions = divisions;
206
- for (const division of divisions) {
207
- cleanDocumentOrDivision(division);
208
- }
209
- }
210
- assert.strictEqual(d2.redacteur, void 0);
211
- const classification = d2.classification;
212
- assert(classification);
213
- cleanXmlArtefacts(classification);
214
- let auteurs = d2.auteurs;
215
- if (auteurs !== void 0) {
216
- auteurs = auteurs.auteur;
217
- if (!Array.isArray(auteurs)) {
218
- assert(auteurs);
219
- auteurs = [auteurs];
220
- }
221
- d2.auteurs = auteurs;
222
- for (const auteur of auteurs) {
223
- let organeRef = auteur.organe;
224
- if (organeRef !== void 0) {
225
- auteur.organeRef = organeRef.organeRef;
226
- delete auteur.organe;
227
- }
228
- }
229
- }
230
- const notice = d2.notice;
231
- {
232
- cleanBooleanAttribute(notice, "adoptionConforme");
233
- }
234
- let coSignataires = d2.coSignataires;
235
- if (coSignataires !== void 0) {
236
- coSignataires = coSignataires.coSignataire;
237
- if (!Array.isArray(coSignataires)) {
238
- assert(coSignataires);
239
- coSignataires = [coSignataires];
240
- }
241
- d2.coSignataires = coSignataires;
242
- for (const coSignataire of coSignataires) {
243
- cleanXmlArtefacts(coSignataire);
244
- cleanBooleanAttribute(coSignataire, "edite");
245
- let acteurRef = coSignataire.acteur;
246
- if (acteurRef !== void 0) {
247
- acteurRef = acteurRef.acteurRef;
248
- assert(acteurRef);
249
- delete coSignataire.acteur;
250
- coSignataire.acteurRef = acteurRef;
251
- }
252
- const organe = coSignataire.organe;
253
- if (organe !== void 0) {
254
- cleanBooleanAttribute(organe, "etApparentes");
255
- }
256
- }
257
- }
258
- const depotAmendements = d2.depotAmendements;
259
- if (depotAmendements !== void 0) {
260
- cleanXmlArtefacts(depotAmendements);
261
- const amendementsSeance = depotAmendements.amendementsSeance;
262
- {
263
- cleanXmlArtefacts(amendementsSeance);
264
- cleanBooleanAttribute(amendementsSeance, "amendable");
265
- }
266
- let amendementsCommission = depotAmendements.amendementsCommission;
267
- if (amendementsCommission !== void 0) {
268
- amendementsCommission = amendementsCommission.commission;
269
- if (!Array.isArray(amendementsCommission)) {
270
- assert(amendementsCommission);
271
- amendementsCommission = [amendementsCommission];
272
- }
273
- depotAmendements.amendementsCommission = amendementsCommission;
274
- for (const commision of amendementsCommission) {
275
- cleanXmlArtefacts(commision);
276
- cleanBooleanAttribute(commision, "amendable");
277
- assert.strictEqual(commision.dateLimiteDepot, void 0);
278
- }
279
- }
280
- }
281
- const imprimerie = d2.imprimerie;
282
- if (imprimerie !== void 0) {
283
- cleanXmlArtefacts(imprimerie);
284
- const dian = imprimerie.DIAN;
285
- if (dian !== void 0) {
286
- delete imprimerie.DIAN;
287
- imprimerie.dian = dian;
288
- }
289
- const isbn = imprimerie.ISBN;
290
- if (isbn !== void 0) {
291
- delete imprimerie.ISBN;
292
- imprimerie.isbn = isbn;
293
- }
294
- assert.strictEqual(imprimerie.ISSN, void 0);
295
- }
296
- cleanBooleanAttribute(d2, "rapportPublie");
297
- let organesReferents = d2.organesReferents;
298
- if (organesReferents !== void 0) {
299
- organesReferents = organesReferents.organeRef;
300
- if (!Array.isArray(organesReferents)) {
301
- assert(organesReferents);
302
- organesReferents = [organesReferents];
303
- }
304
- d2.organesReferents = organesReferents;
305
- }
111
+ const i = d.chrono;
112
+ t(i), f(i);
113
+ }
114
+ let r = e.divisions;
115
+ if (r !== void 0) {
116
+ r = r.division, Array.isArray(r) || (t(r), r = [r]), e.divisions = r;
117
+ for (const i of r)
118
+ w(i);
119
+ }
120
+ t.strictEqual(e.redacteur, void 0);
121
+ const c = e.classification;
122
+ t(c), f(c);
123
+ let l = e.auteurs;
124
+ if (l !== void 0) {
125
+ l = l.auteur, Array.isArray(l) || (t(l), l = [l]), e.auteurs = l;
126
+ for (const i of l) {
127
+ let a = i.organe;
128
+ a !== void 0 && (i.organeRef = a.organeRef, delete i.organe);
129
+ }
130
+ }
131
+ const p = e.notice;
132
+ S(p, "adoptionConforme");
133
+ let o = e.coSignataires;
134
+ if (o !== void 0) {
135
+ o = o.coSignataire, Array.isArray(o) || (t(o), o = [o]), e.coSignataires = o;
136
+ for (const i of o) {
137
+ f(i), S(i, "edite");
138
+ let a = i.acteur;
139
+ a !== void 0 && (a = a.acteurRef, t(a), delete i.acteur, i.acteurRef = a);
140
+ const v = i.organe;
141
+ v !== void 0 && S(v, "etApparentes");
142
+ }
143
+ }
144
+ const s = e.depotAmendements;
145
+ if (s !== void 0) {
146
+ f(s);
147
+ const i = s.amendementsSeance;
148
+ f(i), S(i, "amendable");
149
+ let a = s.amendementsCommission;
150
+ if (a !== void 0) {
151
+ a = a.commission, Array.isArray(a) || (t(a), a = [a]), s.amendementsCommission = a;
152
+ for (const v of a)
153
+ f(v), S(v, "amendable"), t.strictEqual(v.dateLimiteDepot, void 0);
154
+ }
155
+ }
156
+ const u = e.imprimerie;
157
+ if (u !== void 0) {
158
+ f(u);
159
+ const i = u.DIAN;
160
+ i !== void 0 && (delete u.DIAN, u.dian = i);
161
+ const a = u.ISBN;
162
+ a !== void 0 && (delete u.ISBN, u.isbn = a), t.strictEqual(u.ISSN, void 0);
163
+ }
164
+ S(e, "rapportPublie");
165
+ let m = e.organesReferents;
166
+ m !== void 0 && (m = m.organeRef, Array.isArray(m) || (t(m), m = [m]), e.organesReferents = m);
306
167
  }
307
- function cleanActeLegislatif(acteLegislatif) {
308
- cleanXmlArtefacts(acteLegislatif);
309
- const xsiType = acteLegislatif["@xsi:type"];
310
- if (xsiType !== void 0) {
311
- acteLegislatif.xsiType = xsiType;
312
- delete acteLegislatif["@xsi:type"];
313
- }
314
- let auteursRefs = acteLegislatif.auteurs;
315
- if (auteursRefs !== void 0) {
316
- auteursRefs = auteursRefs.acteurRef;
317
- if (!Array.isArray(auteursRefs)) {
318
- assert(auteursRefs);
319
- auteursRefs = [auteursRefs];
320
- }
321
- acteLegislatif.auteursRefs = auteursRefs;
322
- delete acteLegislatif.auteurs;
323
- }
324
- const casSaisine = acteLegislatif.casSaisine;
325
- if (casSaisine !== void 0) {
326
- cleanTypeDeclaration(casSaisine);
327
- }
328
- const contributionInternaute = acteLegislatif.contributionInternaute;
329
- if (contributionInternaute !== void 0) {
330
- cleanXmlArtefacts(contributionInternaute);
331
- }
332
- assert.strictEqual(acteLegislatif.dateRetrait, void 0);
333
- const decision = acteLegislatif.decision;
334
- if (decision !== void 0) {
335
- cleanTypeDeclaration(decision);
336
- }
337
- const infoJo = acteLegislatif.infoJO;
338
- if (infoJo !== void 0) {
339
- cleanInfoJo(infoJo);
340
- acteLegislatif.infoJo = infoJo;
341
- delete acteLegislatif.infoJO;
342
- }
343
- const infoJoce = acteLegislatif.infoJOCE;
344
- if (infoJoce !== void 0) {
345
- acteLegislatif.infoJoce = infoJoce;
346
- delete acteLegislatif.infoJOCE;
347
- const refJoce = infoJoce.refJOCE;
348
- if (refJoce !== void 0) {
349
- infoJoce.refJoce = refJoce;
350
- delete infoJoce.refJOCE;
351
- }
352
- const dateJoce = infoJoce.dateJOCE;
353
- if (dateJoce !== void 0) {
354
- infoJoce.dateJoce = dateJoce;
355
- delete infoJoce.dateJOCE;
356
- }
357
- }
358
- let infoJoRect = acteLegislatif.infoJORect;
359
- if (infoJoRect !== void 0) {
360
- if (!Array.isArray(infoJoRect)) {
361
- infoJoRect = [infoJoRect];
362
- }
363
- acteLegislatif.infoJoRect = infoJoRect;
364
- delete acteLegislatif.infoJORect;
365
- for (const infoJoRectItem of infoJoRect) {
366
- cleanInfoJo(infoJoRectItem);
367
- }
368
- }
369
- cleanActeOuDossierInitiateur(acteLegislatif);
370
- let initiateur = acteLegislatif.initiateurs;
371
- if (initiateur !== void 0) {
372
- assert.strictEqual(acteLegislatif.initiateur, void 0);
373
- if (initiateur.acteurRef === void 0) {
374
- assert.notStrictEqual(initiateur.organeRef, void 0);
375
- } else {
376
- if (!Array.isArray(initiateur)) {
377
- assert(initiateur);
378
- initiateur = [initiateur];
379
- }
380
- initiateur = {
381
- acteurs: initiateur
382
- };
383
- }
384
- acteLegislatif.initiateur = initiateur;
385
- delete acteLegislatif.initiateurs;
386
- }
387
- assert.strictEqual(acteLegislatif.odSeancejRef, void 0);
388
- const provenanceRef = acteLegislatif.provenance;
389
- if (provenanceRef !== void 0) {
390
- delete acteLegislatif.provenance;
391
- acteLegislatif.provenanceRef = provenanceRef;
392
- }
393
- let rapporteurs = acteLegislatif.rapporteurs;
394
- if (rapporteurs !== void 0) {
395
- rapporteurs = rapporteurs.rapporteur;
396
- if (!Array.isArray(rapporteurs)) {
397
- assert(rapporteurs);
398
- rapporteurs = [rapporteurs];
399
- }
400
- acteLegislatif.rapporteurs = rapporteurs;
401
- for (const rapporteur of rapporteurs) {
402
- cleanRapporteur(rapporteur);
403
- }
404
- }
405
- const referenceNor = acteLegislatif.referenceNOR;
406
- if (referenceNor !== void 0) {
407
- acteLegislatif.referenceNor = referenceNor;
408
- delete acteLegislatif.referenceNOR;
409
- }
410
- assert.strictEqual(acteLegislatif.reunion, void 0);
411
- const statutAdoption = acteLegislatif.statutAdoption;
412
- if (statutAdoption !== void 0) {
413
- cleanTypeDeclaration(statutAdoption);
414
- }
415
- const statutConclusion = acteLegislatif.statutConclusion;
416
- if (statutConclusion !== void 0) {
417
- cleanTypeDeclaration(statutConclusion);
418
- if (statutConclusion.famCode === "TSORTFnull") {
419
- delete acteLegislatif.statutConclusion;
420
- }
421
- }
422
- const texteAdopteRef = acteLegislatif.texteAdopte;
423
- if (texteAdopteRef !== void 0) {
424
- delete acteLegislatif.texteAdopte;
425
- acteLegislatif.texteAdopteRef = texteAdopteRef;
426
- }
427
- const texteAssocieRef = acteLegislatif.texteAssocie;
428
- if (texteAssocieRef !== void 0) {
429
- delete acteLegislatif.texteAssocie;
430
- acteLegislatif.texteAssocieRef = texteAssocieRef;
431
- }
432
- let textesAssocies = acteLegislatif.textesAssocies;
433
- if (textesAssocies !== void 0) {
434
- textesAssocies = textesAssocies.texteAssocie;
435
- if (!Array.isArray(textesAssocies)) {
436
- assert(textesAssocies);
437
- textesAssocies = [textesAssocies];
438
- }
439
- acteLegislatif.textesAssocies = textesAssocies;
440
- for (const texteAssocie of textesAssocies) {
441
- const texteAssocieRef2 = texteAssocie.refTexteAssocie;
442
- if (texteAssocieRef2 !== void 0) {
443
- delete texteAssocie.refTexteAssocie;
444
- texteAssocie.texteAssocieRef = texteAssocieRef2;
445
- }
446
- }
447
- }
448
- const typeDeclaration = acteLegislatif.typeDeclaration;
449
- if (typeDeclaration !== void 0) {
450
- cleanTypeDeclaration(typeDeclaration);
451
- }
452
- const typeMotion = acteLegislatif.typeMotion;
453
- if (typeMotion !== void 0) {
454
- cleanTypeDeclaration(typeMotion);
455
- }
456
- const typeMotionCensure = acteLegislatif.typeMotionCensure;
457
- if (typeMotionCensure !== void 0) {
458
- cleanTypeDeclaration(typeMotionCensure);
459
- }
460
- let voteRefs = acteLegislatif.voteRefs;
461
- if (voteRefs !== void 0) {
462
- voteRefs = voteRefs.voteRef;
463
- if (!Array.isArray(voteRefs)) {
464
- assert(voteRefs);
465
- voteRefs = [voteRefs];
466
- }
467
- acteLegislatif.voteRefs = voteRefs;
468
- }
469
- let actesLegislatifs = acteLegislatif.actesLegislatifs;
470
- if (actesLegislatifs !== void 0) {
471
- actesLegislatifs = actesLegislatifs.acteLegislatif;
472
- if (!Array.isArray(actesLegislatifs)) {
473
- assert(actesLegislatifs);
474
- actesLegislatifs = [actesLegislatifs];
475
- }
476
- acteLegislatif.actesLegislatifs = actesLegislatifs;
477
- for (const acteLegislatif2 of actesLegislatifs) {
478
- cleanActeLegislatif(acteLegislatif2);
479
- }
168
+ function j(e) {
169
+ f(e);
170
+ const n = e["@xsi:type"];
171
+ n !== void 0 && (e.xsiType = n, delete e["@xsi:type"]);
172
+ let d = e.auteurs;
173
+ d !== void 0 && (d = d.acteurRef, Array.isArray(d) || (t(d), d = [d]), e.auteursRefs = d, delete e.auteurs);
174
+ const r = e.casSaisine;
175
+ r !== void 0 && V(r);
176
+ const c = e.contributionInternaute;
177
+ c !== void 0 && f(c), t.strictEqual(e.dateRetrait, void 0);
178
+ const l = e.decision;
179
+ l !== void 0 && V(l);
180
+ const p = e.infoJO;
181
+ p !== void 0 && (P(p), e.infoJo = p, delete e.infoJO);
182
+ const o = e.infoJOCE;
183
+ if (o !== void 0) {
184
+ e.infoJoce = o, delete e.infoJOCE;
185
+ const b = o.refJOCE;
186
+ b !== void 0 && (o.refJoce = b, delete o.refJOCE);
187
+ const h = o.dateJOCE;
188
+ h !== void 0 && (o.dateJoce = h, delete o.dateJOCE);
189
+ }
190
+ let s = e.infoJORect;
191
+ if (s !== void 0) {
192
+ Array.isArray(s) || (s = [s]), e.infoJoRect = s, delete e.infoJORect;
193
+ for (const b of s)
194
+ P(b);
195
+ }
196
+ F(e);
197
+ let u = e.initiateurs;
198
+ u !== void 0 && (t.strictEqual(e.initiateur, void 0), u.acteurRef === void 0 ? t.notStrictEqual(u.organeRef, void 0) : (Array.isArray(u) || (t(u), u = [u]), u = {
199
+ acteurs: u
200
+ }), e.initiateur = u, delete e.initiateurs), t.strictEqual(e.odSeancejRef, void 0);
201
+ const m = e.provenance;
202
+ m !== void 0 && (delete e.provenance, e.provenanceRef = m);
203
+ let i = e.rapporteurs;
204
+ if (i !== void 0) {
205
+ i = i.rapporteur, Array.isArray(i) || (t(i), i = [i]), e.rapporteurs = i;
206
+ for (const b of i)
207
+ C(b);
208
+ }
209
+ const a = e.referenceNOR;
210
+ a !== void 0 && (e.referenceNor = a, delete e.referenceNOR), t.strictEqual(e.reunion, void 0);
211
+ const v = e.statutAdoption;
212
+ v !== void 0 && V(v);
213
+ const R = e.statutConclusion;
214
+ R !== void 0 && (V(R), R.famCode === "TSORTFnull" && delete e.statutConclusion);
215
+ const q = e.texteAdopte;
216
+ q !== void 0 && (delete e.texteAdopte, e.texteAdopteRef = q);
217
+ const y = e.texteAssocie;
218
+ y !== void 0 && (delete e.texteAssocie, e.texteAssocieRef = y);
219
+ let E = e.textesAssocies;
220
+ if (E !== void 0) {
221
+ E = E.texteAssocie, Array.isArray(E) || (t(E), E = [E]), e.textesAssocies = E;
222
+ for (const b of E) {
223
+ const h = b.refTexteAssocie;
224
+ h !== void 0 && (delete b.refTexteAssocie, b.texteAssocieRef = h);
225
+ }
226
+ }
227
+ const D = e.typeDeclaration;
228
+ D !== void 0 && V(D);
229
+ const A = e.typeMotion;
230
+ A !== void 0 && V(A);
231
+ const O = e.typeMotionCensure;
232
+ O !== void 0 && V(O);
233
+ let x = e.voteRefs;
234
+ x !== void 0 && (x = x.voteRef, Array.isArray(x) || (t(x), x = [x]), e.voteRefs = x);
235
+ let J = e.actesLegislatifs;
236
+ if (J !== void 0) {
237
+ J = J.acteLegislatif, Array.isArray(J) || (t(J), J = [J]), e.actesLegislatifs = J;
238
+ for (const b of J)
239
+ j(b);
480
240
  }
481
241
  }
482
- function cleanActeOuDossierInitiateur(acteOuDossier) {
483
- const initiateur = acteOuDossier.initiateur;
484
- if (initiateur !== void 0) {
485
- let acteurs = initiateur.acteurs;
486
- if (acteurs !== void 0) {
487
- acteurs = acteurs.acteur;
488
- if (!Array.isArray(acteurs)) {
489
- assert(acteurs);
490
- acteurs = [acteurs];
491
- }
492
- if (acteurs.length > 0) {
493
- initiateur.acteurs = acteurs;
494
- } else {
495
- delete initiateur.acteurs;
496
- }
497
- }
498
- let organeRef = initiateur.organes;
499
- if (organeRef !== void 0) {
500
- organeRef = organeRef.organe.organeRef.uid;
501
- assert.notStrictEqual(organeRef, void 0);
502
- initiateur.organeRef = organeRef;
503
- delete initiateur.organes;
504
- }
505
- if (initiateur.acteurs === void 0 && initiateur.organeRef === void 0) {
506
- delete acteOuDossier.initiateur;
507
- }
242
+ function F(e) {
243
+ const n = e.initiateur;
244
+ if (n !== void 0) {
245
+ let d = n.acteurs;
246
+ d !== void 0 && (d = d.acteur, Array.isArray(d) || (t(d), d = [d]), d.length > 0 ? n.acteurs = d : delete n.acteurs);
247
+ let r = n.organes;
248
+ r !== void 0 && (r = r.organe.organeRef.uid, t.notStrictEqual(r, void 0), n.organeRef = r, delete n.organes), n.acteurs === void 0 && n.organeRef === void 0 && delete e.initiateur;
508
249
  }
509
250
  }
510
- function cleanInfoJo(infoJo) {
511
- cleanXmlArtefacts(infoJo);
512
- const typeJo = infoJo.typeJO;
513
- if (typeJo !== void 0) {
514
- infoJo.typeJo = typeJo;
515
- delete infoJo.typeJO;
516
- }
517
- const dateJo = infoJo.dateJO;
518
- if (dateJo !== void 0) {
519
- infoJo.dateJo = dateJo;
520
- delete infoJo.dateJO;
521
- }
522
- assert.strictEqual(infoJo.pageJO, void 0);
523
- const numJo = infoJo.numJO;
524
- if (numJo !== void 0) {
525
- infoJo.numJo = numJo;
526
- delete infoJo.numJO;
527
- }
528
- const referenceNor = infoJo.referenceNOR;
529
- if (referenceNor !== void 0) {
530
- infoJo.referenceNor = referenceNor;
531
- delete infoJo.referenceNOR;
532
- }
251
+ function V(e) {
252
+ e.famCode = e.fam_code, delete e.fam_code, t(e.famCode), e.libelle || (e.libelle = e.famCode);
533
253
  }
534
- function cleanTypeDeclaration(typeDeclaration) {
535
- typeDeclaration.famCode = typeDeclaration.fam_code;
536
- delete typeDeclaration.fam_code;
537
- assert(typeDeclaration.famCode);
538
- if (!typeDeclaration.libelle) {
539
- typeDeclaration.libelle = typeDeclaration.famCode;
540
- }
254
+ function P(e) {
255
+ f(e);
256
+ const n = e.typeJO;
257
+ n !== void 0 && (e.typeJo = n, delete e.typeJO);
258
+ const d = e.dateJO;
259
+ d !== void 0 && (e.dateJo = d, delete e.dateJO), t.strictEqual(e.pageJO, void 0);
260
+ const r = e.numJO;
261
+ r !== void 0 && (e.numJo = r, delete e.numJO);
262
+ const c = e.referenceNOR;
263
+ c !== void 0 && (e.referenceNor = c, delete e.referenceNOR);
541
264
  }
542
- function cleanDossierParlementaire(dossierParlementaire) {
543
- cleanXmlArtefacts(dossierParlementaire);
544
- const xsiType = dossierParlementaire["@xsi:type"];
545
- if (xsiType !== void 0) {
546
- dossierParlementaire.xsiType = xsiType;
547
- delete dossierParlementaire["@xsi:type"];
548
- }
549
- const titreDossier = dossierParlementaire.titreDossier;
550
- cleanXmlArtefacts(titreDossier);
551
- cleanActeOuDossierInitiateur(dossierParlementaire);
552
- let actesLegislatifs = dossierParlementaire.actesLegislatifs;
553
- if (actesLegislatifs !== void 0) {
554
- actesLegislatifs = actesLegislatifs.acteLegislatif;
555
- if (!Array.isArray(actesLegislatifs)) {
556
- assert(actesLegislatifs);
557
- actesLegislatifs = [actesLegislatifs];
558
- }
559
- dossierParlementaire.actesLegislatifs = actesLegislatifs;
560
- for (const acteLegislatif of actesLegislatifs) {
561
- cleanActeLegislatif(acteLegislatif);
562
- }
563
- }
564
- let plf = dossierParlementaire.PLF;
565
- if (plf !== void 0) {
566
- plf = plf.EtudePLF;
567
- assert(Array.isArray(plf));
568
- delete dossierParlementaire.PLF;
569
- dossierParlementaire.plf = plf;
570
- for (const etudePlf of plf) {
571
- let rapporteurs = etudePlf.rapporteur;
572
- if (rapporteurs !== void 0) {
573
- if (!Array.isArray(rapporteurs)) {
574
- assert(rapporteurs);
575
- rapporteurs = [rapporteurs];
576
- }
577
- delete etudePlf.rapporteur;
578
- etudePlf.rapporteurs = rapporteurs;
579
- for (const rapporteur of rapporteurs) {
580
- cleanRapporteur(rapporteur);
581
- }
582
- }
583
- let missionMinefi = etudePlf.missionMinefi;
584
- if (missionMinefi !== void 0) {
585
- cleanMission(missionMinefi);
586
- }
587
- etudePlf.ordreDiqs = etudePlf.ordreDIQS;
588
- delete etudePlf.ordreDIQS;
589
- assert(etudePlf.ordreDiqs);
265
+ function B(e) {
266
+ f(e);
267
+ const n = e["@xsi:type"];
268
+ n !== void 0 && (e.xsiType = n, delete e["@xsi:type"]);
269
+ const d = e.titreDossier;
270
+ f(d), F(e);
271
+ let r = e.actesLegislatifs;
272
+ if (r !== void 0) {
273
+ r = r.acteLegislatif, Array.isArray(r) || (t(r), r = [r]), e.actesLegislatifs = r;
274
+ for (const l of r)
275
+ j(l);
276
+ }
277
+ let c = e.PLF;
278
+ if (c !== void 0) {
279
+ c = c.EtudePLF, t(Array.isArray(c)), delete e.PLF, e.plf = c;
280
+ for (const l of c) {
281
+ let p = l.rapporteur;
282
+ if (p !== void 0) {
283
+ Array.isArray(p) || (t(p), p = [p]), delete l.rapporteur, l.rapporteurs = p;
284
+ for (const s of p)
285
+ C(s);
286
+ }
287
+ let o = l.missionMinefi;
288
+ o !== void 0 && M(o), l.ordreDiqs = l.ordreDIQS, delete l.ordreDIQS, t(l.ordreDiqs);
590
289
  }
591
290
  }
592
291
  }
593
- function cleanMission(mission) {
594
- let missions = mission.missions;
595
- if (missions !== void 0) {
596
- missions = missions.mission;
597
- if (!Array.isArray(missions)) {
598
- assert(missions);
599
- missions = [missions];
600
- }
601
- mission.missions = missions;
602
- for (const missionItem of missions) {
603
- cleanMission(missionItem);
604
- }
292
+ function M(e) {
293
+ let n = e.missions;
294
+ if (n !== void 0) {
295
+ n = n.mission, Array.isArray(n) || (t(n), n = [n]), e.missions = n;
296
+ for (const d of n)
297
+ M(d);
605
298
  }
606
299
  }
607
- function cleanOrgane(organe) {
608
- cleanXmlArtefacts(organe);
609
- const xsiType = organe["@xsi:type"];
610
- if (xsiType !== void 0) {
611
- organe.xsiType = xsiType;
612
- delete organe["@xsi:type"];
613
- }
614
- const viMoDe = organe.viMoDe;
615
- cleanXmlArtefacts(viMoDe);
616
- const organeParentRef = organe.organeParent;
617
- if (organeParentRef !== void 0) {
618
- delete organe.organeParent;
619
- organe.organeParentRef = organeParentRef;
620
- }
621
- assert.strictEqual(organe.chambre, void 0);
622
- const secretariat = organe.secretariat;
623
- if (secretariat !== void 0) {
624
- cleanXmlArtefacts(secretariat);
625
- }
626
- const lieu = organe.lieu;
627
- if (lieu !== void 0) {
628
- cleanXmlArtefacts(lieu);
629
- const region = lieu.region;
630
- if (region !== void 0) {
631
- cleanXmlArtefacts(region);
632
- }
633
- const departement = lieu.departement;
634
- if (departement !== void 0) {
635
- cleanXmlArtefacts(departement);
636
- }
637
- }
638
- const couleurAssociee = organe.couleurAssociee;
639
- if (couleurAssociee === null) {
640
- delete organe.couleurAssociee;
641
- }
642
- let listePays = organe.listePays;
643
- if (listePays !== void 0) {
644
- listePays = listePays.paysRef;
645
- if (!Array.isArray(listePays)) {
646
- assert.strictEqual(typeof listePays, "string");
647
- listePays = [listePays];
648
- }
649
- organe.listePays = listePays;
650
- }
300
+ function k(e) {
301
+ f(e);
302
+ const n = e["@xsi:type"];
303
+ n !== void 0 && (e.xsiType = n, delete e["@xsi:type"]);
304
+ const d = e.viMoDe;
305
+ f(d);
306
+ const r = e.organeParent;
307
+ r !== void 0 && (delete e.organeParent, e.organeParentRef = r), t.strictEqual(e.chambre, void 0);
308
+ const c = e.secretariat;
309
+ c !== void 0 && f(c);
310
+ const l = e.lieu;
311
+ if (l !== void 0) {
312
+ f(l);
313
+ const s = l.region;
314
+ s !== void 0 && f(s);
315
+ const u = l.departement;
316
+ u !== void 0 && f(u);
317
+ }
318
+ e.couleurAssociee === null && delete e.couleurAssociee;
319
+ let o = e.listePays;
320
+ o !== void 0 && (o = o.paysRef, Array.isArray(o) || (t.strictEqual(typeof o, "string"), o = [o]), e.listePays = o);
651
321
  }
652
- function cleanCycleDeVie(cycleDeVie) {
653
- cleanXmlArtefacts(cycleDeVie);
654
- const chrono = cycleDeVie.chrono;
655
- assert(chrono);
322
+ function g(e) {
323
+ f(e);
324
+ const n = e.chrono;
325
+ t(n);
656
326
  {
657
- cleanXmlArtefacts(chrono);
658
- let creation = chrono.creation;
659
- assert.strictEqual(typeof creation, "string");
660
- creation = new Date(creation);
661
- chrono.creation = creation;
662
- let cloture = chrono.cloture;
663
- if (cloture !== void 0) {
664
- assert.strictEqual(typeof cloture, "string");
665
- cloture = new Date(cloture);
666
- chrono.cloture = cloture;
667
- }
327
+ f(n);
328
+ let d = n.creation;
329
+ t.strictEqual(typeof d, "string"), d = new Date(d), n.creation = d;
330
+ let r = n.cloture;
331
+ r !== void 0 && (t.strictEqual(typeof r, "string"), r = new Date(r), n.cloture = r);
668
332
  }
669
333
  }
670
- function cleanReunion(reunion) {
671
- cleanXmlArtefacts(reunion);
672
- cleanBooleanAttribute(reunion, "captationVideo");
673
- cleanBooleanAttribute(reunion, "comiteSecret");
674
- cleanBooleanAttribute(reunion, "ouverturePresse");
675
- const xsiType = reunion["@xsi:type"];
676
- if (xsiType !== void 0) {
677
- reunion.xsiType = xsiType;
678
- delete reunion["@xsi:type"];
679
- }
680
- const timestampDebut = reunion.timeStampDebut;
681
- assert.notStrictEqual(timestampDebut, void 0);
682
- reunion.timestampDebut = timestampDebut;
683
- delete reunion.timeStampDebut;
684
- let timestampFin = reunion.timeStampFin;
685
- if (timestampFin !== void 0) {
686
- assert.strictEqual(typeof timestampFin, "string");
687
- timestampFin = new Date(timestampFin);
688
- reunion.timestampFin = timestampFin;
689
- delete reunion.timeStampFin;
690
- }
691
- const lieu = reunion.lieu;
692
- if (lieu !== void 0) {
693
- cleanXmlArtefacts(lieu);
694
- }
695
- const cycleDeVie = reunion.cycleDeVie;
696
- assert.notStrictEqual(cycleDeVie, void 0);
697
- cleanCycleDeVie(cycleDeVie);
698
- const demandeurs = reunion.demandeurs;
699
- if (demandeurs !== void 0) {
700
- let acteurs = demandeurs.acteur;
701
- if (acteurs !== void 0) {
702
- if (!Array.isArray(acteurs)) {
703
- assert.notStrictEqual(acteurs, null);
704
- assert.strictEqual(typeof acteurs, "object");
705
- acteurs = [acteurs];
706
- }
707
- demandeurs.acteurs = acteurs;
708
- delete demandeurs.acteur;
709
- for (const acteur of acteurs) {
710
- cleanXmlArtefacts(acteur);
711
- }
712
- }
713
- const organe = demandeurs.organe;
714
- if (organe !== void 0) {
715
- cleanXmlArtefacts(organe);
716
- }
717
- }
718
- const demandeur = reunion.demandeur;
719
- if (demandeur !== void 0) {
720
- assert.strictEqual(reunion.demandeurs, void 0);
721
- delete reunion.demandeur;
722
- let acteur = demandeur.acteur;
723
- if (acteur !== void 0) {
724
- assert.notStrictEqual(acteur, null);
725
- assert.strictEqual(typeof acteur, "object");
726
- const acteurs = [acteur];
727
- demandeur.acteurs = acteurs;
728
- delete demandeur.acteur;
729
- reunion.demandeurs = demandeur;
730
- for (const acteur2 of acteurs) {
731
- cleanXmlArtefacts(acteur2);
732
- }
733
- }
734
- const organe = demandeur.organe;
735
- if (organe !== void 0) {
736
- cleanXmlArtefacts(organe);
737
- }
738
- }
739
- const participants = reunion.participants;
740
- if (participants !== void 0) {
741
- cleanXmlArtefacts(participants);
742
- let participantsInternes = participants.participantsInternes;
743
- if (participantsInternes !== void 0) {
744
- participantsInternes = participantsInternes.participantInterne;
745
- if (!Array.isArray(participantsInternes)) {
746
- assert.notStrictEqual(participantsInternes, null);
747
- assert.strictEqual(typeof participantsInternes, "object");
748
- participantsInternes = [participantsInternes];
749
- }
750
- participants.participantsInternes = participantsInternes;
751
- }
752
- let personnesAuditionnees = participants.personnesAuditionnees;
753
- if (personnesAuditionnees !== void 0) {
754
- personnesAuditionnees = personnesAuditionnees.personneAuditionnee;
755
- if (personnesAuditionnees === null) {
756
- delete participants.personnesAuditionnees;
757
- } else {
758
- if (!Array.isArray(personnesAuditionnees)) {
759
- assert.strictEqual(typeof personnesAuditionnees, "object");
760
- personnesAuditionnees = [personnesAuditionnees];
761
- }
762
- personnesAuditionnees = personnesAuditionnees.filter((personneAudionnee) => personneAudionnee !== null);
763
- if (personnesAuditionnees.length > 0) {
764
- participants.personnesAuditionnees = personnesAuditionnees;
765
- } else {
766
- delete participants.personnesAuditionnees;
767
- }
768
- for (const personneAudionnee of personnesAuditionnees) {
769
- const xsiType2 = personneAudionnee.uid["@xsi:type"];
770
- assert(xsiType2);
771
- personneAudionnee.xsiType = xsiType2;
772
- const uid = personneAudionnee.uid["#text"];
773
- assert(uid);
774
- personneAudionnee.uid = uid;
775
- const ident = personneAudionnee.ident;
776
- assert(ident);
777
- {
778
- cleanXmlArtefacts(ident);
779
- }
334
+ function U(e) {
335
+ f(e), S(e, "captationVideo"), S(e, "comiteSecret"), S(e, "ouverturePresse");
336
+ const n = e["@xsi:type"];
337
+ n !== void 0 && (e.xsiType = n, delete e["@xsi:type"]);
338
+ const d = e.timeStampDebut;
339
+ t.notStrictEqual(d, void 0), e.timestampDebut = d, delete e.timeStampDebut;
340
+ let r = e.timeStampFin;
341
+ r !== void 0 && (t.strictEqual(typeof r, "string"), r = new Date(r), e.timestampFin = r, delete e.timeStampFin);
342
+ const c = e.lieu;
343
+ c !== void 0 && f(c);
344
+ const l = e.cycleDeVie;
345
+ t.notStrictEqual(l, void 0), g(l);
346
+ const p = e.demandeurs;
347
+ if (p !== void 0) {
348
+ let i = p.acteur;
349
+ if (i !== void 0) {
350
+ Array.isArray(i) || (t.notStrictEqual(i, null), t.strictEqual(typeof i, "object"), i = [i]), p.acteurs = i, delete p.acteur;
351
+ for (const v of i)
352
+ f(v);
353
+ }
354
+ const a = p.organe;
355
+ a !== void 0 && f(a);
356
+ }
357
+ const o = e.demandeur;
358
+ if (o !== void 0) {
359
+ t.strictEqual(e.demandeurs, void 0), delete e.demandeur;
360
+ let i = o.acteur;
361
+ if (i !== void 0) {
362
+ t.notStrictEqual(i, null), t.strictEqual(typeof i, "object");
363
+ const v = [i];
364
+ o.acteurs = v, delete o.acteur, e.demandeurs = o;
365
+ for (const R of v)
366
+ f(R);
367
+ }
368
+ const a = o.organe;
369
+ a !== void 0 && f(a);
370
+ }
371
+ const s = e.participants;
372
+ if (s !== void 0) {
373
+ f(s);
374
+ let i = s.participantsInternes;
375
+ i !== void 0 && (i = i.participantInterne, Array.isArray(i) || (t.notStrictEqual(i, null), t.strictEqual(typeof i, "object"), i = [i]), s.participantsInternes = i);
376
+ let a = s.personnesAuditionnees;
377
+ if (a !== void 0)
378
+ if (a = a.personneAuditionnee, a === null)
379
+ delete s.personnesAuditionnees;
380
+ else {
381
+ Array.isArray(a) || (t.strictEqual(typeof a, "object"), a = [a]), a = a.filter(
382
+ (v) => v !== null
383
+ ), a.length > 0 ? s.personnesAuditionnees = a : delete s.personnesAuditionnees;
384
+ for (const v of a) {
385
+ const R = v.uid["@xsi:type"];
386
+ t(R), v.xsiType = R;
387
+ const q = v.uid["#text"];
388
+ t(q), v.uid = q;
389
+ const y = v.ident;
390
+ t(y), f(y);
780
391
  }
781
392
  }
782
- }
783
393
  }
784
- if (reunion.ODJ !== void 0) {
785
- const odj = reunion.ODJ;
786
- reunion.odj = odj;
787
- delete reunion.ODJ;
394
+ if (e.ODJ !== void 0) {
395
+ const i = e.ODJ;
396
+ e.odj = i, delete e.ODJ;
788
397
  {
789
- cleanXmlArtefacts(odj);
790
- let convocationOdj = odj.convocationODJ;
791
- if (convocationOdj !== void 0) {
792
- if (Array.isArray(convocationOdj.item)) {
793
- convocationOdj = convocationOdj.item;
794
- } else {
795
- assert(convocationOdj.item);
796
- convocationOdj = [convocationOdj.item];
398
+ f(i);
399
+ let a = i.convocationODJ;
400
+ a !== void 0 && (Array.isArray(a.item) ? a = a.item : (t(a.item), a = [a.item]), i.convocationOdj = a, delete i.convocationODJ);
401
+ let v = i.resumeODJ;
402
+ v !== void 0 && (Array.isArray(v.item) ? v = v.item : (t(v.item), v = [v.item]), i.resumeOdj = v, delete i.resumeODJ);
403
+ let R = i.pointsODJ;
404
+ if (R !== void 0) {
405
+ let q = R.pointODJ;
406
+ Array.isArray(q) ? R = q : (t(q), R = [q]), i.pointsOdj = R;
407
+ for (const y of R) {
408
+ f(y), S(y, "comiteSecret");
409
+ const E = y["@xsi:type"];
410
+ E !== void 0 && (y.xsiType = E, delete y["@xsi:type"]);
411
+ const D = y.cycleDeVie;
412
+ t.notStrictEqual(D, void 0), g(D), t.strictEqual(y.demandeurPoint, void 0);
413
+ let A = y.dossiersLegislatifsRefs;
414
+ A !== void 0 && (Array.isArray(A.dossierRef) ? A = A.dossierRef : (t(A.dossierRef), A = [A.dossierRef]), y.dossiersLegislatifsRefs = A), y.typePointOdj = y.typePointODJ, delete y.typePointODJ, t.strictEqual(y.textesAssocies, void 0), y.natureTravauxOdj = y.natureTravauxODJ, delete y.natureTravauxODJ;
415
+ let O = y.dateConfPres;
416
+ O !== void 0 && (t.strictEqual(typeof O, "string"), t(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(O)), O = new Date(O.split("+")[0]), y.dateConfPres = O);
417
+ let x = y.dateLettreMinistre;
418
+ x !== void 0 && (t.strictEqual(typeof x, "string"), t(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(x)), x = new Date(x.split("+")[0]), y.dateLettreMinistre = x);
797
419
  }
798
- odj.convocationOdj = convocationOdj;
799
- delete odj.convocationODJ;
800
- }
801
- let resumeOdj = odj.resumeODJ;
802
- if (resumeOdj !== void 0) {
803
- if (Array.isArray(resumeOdj.item)) {
804
- resumeOdj = resumeOdj.item;
805
- } else {
806
- assert(resumeOdj.item);
807
- resumeOdj = [resumeOdj.item];
808
- }
809
- odj.resumeOdj = resumeOdj;
810
- delete odj.resumeODJ;
811
- }
812
- let pointsOdj = odj.pointsODJ;
813
- if (pointsOdj !== void 0) {
814
- let pointOdj = pointsOdj.pointODJ;
815
- if (Array.isArray(pointOdj)) {
816
- pointsOdj = pointOdj;
817
- } else {
818
- assert(pointOdj);
819
- pointsOdj = [pointOdj];
820
- }
821
- odj.pointsOdj = pointsOdj;
822
- for (const pointOdj2 of pointsOdj) {
823
- cleanXmlArtefacts(pointOdj2);
824
- cleanBooleanAttribute(pointOdj2, "comiteSecret");
825
- const xsiType2 = pointOdj2["@xsi:type"];
826
- if (xsiType2 !== void 0) {
827
- pointOdj2.xsiType = xsiType2;
828
- delete pointOdj2["@xsi:type"];
829
- }
830
- const cycleDeVie2 = pointOdj2.cycleDeVie;
831
- assert.notStrictEqual(cycleDeVie2, void 0);
832
- cleanCycleDeVie(cycleDeVie2);
833
- assert.strictEqual(pointOdj2.demandeurPoint, void 0);
834
- let dossiersLegislatifsRefs = pointOdj2.dossiersLegislatifsRefs;
835
- if (dossiersLegislatifsRefs !== void 0) {
836
- if (Array.isArray(dossiersLegislatifsRefs.dossierRef)) {
837
- dossiersLegislatifsRefs = dossiersLegislatifsRefs.dossierRef;
838
- } else {
839
- assert(dossiersLegislatifsRefs.dossierRef);
840
- dossiersLegislatifsRefs = [dossiersLegislatifsRefs.dossierRef];
841
- }
842
- pointOdj2.dossiersLegislatifsRefs = dossiersLegislatifsRefs;
843
- }
844
- pointOdj2.typePointOdj = pointOdj2.typePointODJ;
845
- delete pointOdj2.typePointODJ;
846
- assert.strictEqual(pointOdj2.textesAssocies, void 0);
847
- pointOdj2.natureTravauxOdj = pointOdj2.natureTravauxODJ;
848
- delete pointOdj2.natureTravauxODJ;
849
- let dateConfPres = pointOdj2.dateConfPres;
850
- if (dateConfPres !== void 0) {
851
- assert.strictEqual(typeof dateConfPres, "string");
852
- assert(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(dateConfPres));
853
- dateConfPres = new Date(dateConfPres.split("+")[0]);
854
- pointOdj2.dateConfPres = dateConfPres;
855
- }
856
- let dateLettreMinistre = pointOdj2.dateLettreMinistre;
857
- if (dateLettreMinistre !== void 0) {
858
- assert.strictEqual(typeof dateLettreMinistre, "string");
859
- assert(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(dateLettreMinistre));
860
- dateLettreMinistre = new Date(dateLettreMinistre.split("+")[0]);
861
- pointOdj2.dateLettreMinistre = dateLettreMinistre;
862
- }
863
- }
864
- delete odj.pointsODJ;
420
+ delete i.pointsODJ;
865
421
  }
866
422
  }
867
423
  }
868
- const identifiants = reunion.identifiants;
869
- if (identifiants !== void 0) {
870
- cleanXmlArtefacts(identifiants);
871
- const numSeanceJo = identifiants.numSeanceJO;
872
- if (numSeanceJo !== void 0) {
873
- identifiants.numSeanceJo = numSeanceJo;
874
- delete identifiants.numSeanceJO;
875
- }
876
- const idJo = identifiants.idJO;
877
- if (idJo !== void 0) {
878
- identifiants.idJo = idJo;
879
- delete identifiants.idJO;
880
- }
881
- let dateSeance = identifiants.DateSeance;
882
- assert.strictEqual(typeof dateSeance, "string");
883
- assert(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(dateSeance));
884
- dateSeance = new Date(dateSeance.split("+")[0]);
885
- identifiants.dateSeance = dateSeance;
886
- delete identifiants.DateSeance;
424
+ const u = e.identifiants;
425
+ if (u !== void 0) {
426
+ f(u);
427
+ const i = u.numSeanceJO;
428
+ i !== void 0 && (u.numSeanceJo = i, delete u.numSeanceJO);
429
+ const a = u.idJO;
430
+ a !== void 0 && (u.idJo = a, delete u.idJO);
431
+ let v = u.DateSeance;
432
+ t.strictEqual(typeof v, "string"), t(/^\d{4}-\d{2}-\d{2}\+\d{2}:00$/.test(v)), v = new Date(v.split("+")[0]), u.dateSeance = v, delete u.DateSeance;
887
433
  }
888
- const infosReunionsInternationale = reunion.infosReunionsInternationale;
889
- if (infosReunionsInternationale !== void 0) {
890
- cleanXmlArtefacts(infosReunionsInternationale);
891
- cleanBooleanAttribute(infosReunionsInternationale, "estReunionInternationale");
892
- let listePays = infosReunionsInternationale.listePays;
893
- if (listePays !== void 0) {
894
- listePays = listePays.paysRef;
895
- if (!Array.isArray(listePays)) {
896
- assert.strictEqual(typeof listePays, "string");
897
- listePays = [listePays];
898
- }
899
- infosReunionsInternationale.listePays = listePays;
900
- }
434
+ const m = e.infosReunionsInternationale;
435
+ if (m !== void 0) {
436
+ f(m), S(
437
+ m,
438
+ "estReunionInternationale"
439
+ );
440
+ let i = m.listePays;
441
+ i !== void 0 && (i = i.paysRef, Array.isArray(i) || (t.strictEqual(typeof i, "string"), i = [i]), m.listePays = i);
901
442
  }
902
443
  }
903
- function cleanDecompteNominatif(decompteNominatif) {
904
- cleanXmlArtefacts(decompteNominatif);
905
- let nonVotants = decompteNominatif.nonVotants;
906
- if (nonVotants === void 0) {
907
- nonVotants = decompteNominatif.nonVotant;
908
- delete decompteNominatif.nonVotant;
909
- } else {
910
- assert.strictEqual(decompteNominatif.nonVotant, void 0);
911
- }
912
- if (nonVotants !== void 0) {
913
- if (typeof nonVotants === "string") {
914
- assert.strictEqual(nonVotants, "0");
915
- nonVotants = [];
916
- } else if (!Array.isArray(nonVotants)) {
917
- assert(nonVotants);
918
- nonVotants = [nonVotants];
919
- }
920
- const nonVotantsArray = nonVotants;
921
- nonVotants = [];
922
- for (let nonVotant of nonVotantsArray) {
923
- if (nonVotant === null) {
924
- continue;
925
- }
926
- nonVotant = nonVotant.votant;
927
- if (Array.isArray(nonVotant)) {
928
- nonVotants.push(...nonVotant);
929
- } else {
930
- assert(nonVotant);
931
- nonVotants.push(nonVotant);
932
- }
933
- }
934
- if (nonVotants.length === 0) {
935
- delete decompteNominatif.nonVotants;
936
- } else {
937
- decompteNominatif.nonVotants = nonVotants;
938
- for (const votant of nonVotants) {
939
- cleanVotant(votant);
940
- }
941
- }
942
- }
943
- let pour = decompteNominatif.pour;
944
- if (pour === void 0) {
945
- pour = decompteNominatif.pours;
946
- delete decompteNominatif.pours;
947
- } else {
948
- assert.strictEqual(decompteNominatif.pours, void 0);
949
- }
950
- if (pour !== void 0) {
951
- pour = pour.votant;
952
- if (!Array.isArray(pour)) {
953
- assert(pour);
954
- pour = [pour];
955
- }
956
- if (pour.length === 0) {
957
- delete decompteNominatif.pour;
958
- } else {
959
- decompteNominatif.pour = pour;
960
- for (const votant of pour) {
961
- cleanVotant(votant);
962
- }
963
- }
964
- }
965
- let contre = decompteNominatif.contre;
966
- if (contre === void 0) {
967
- contre = decompteNominatif.contres;
968
- delete decompteNominatif.contres;
969
- } else {
970
- assert.strictEqual(decompteNominatif.contres, void 0);
971
- }
972
- if (contre !== void 0) {
973
- contre = contre.votant;
974
- if (!Array.isArray(contre)) {
975
- assert(contre);
976
- contre = [contre];
977
- }
978
- if (contre.length === 0) {
979
- delete decompteNominatif.contre;
980
- } else {
981
- decompteNominatif.contre = contre;
982
- for (const votant of contre) {
983
- cleanVotant(votant);
984
- }
985
- }
986
- }
987
- let abstentions = decompteNominatif.abstentions;
988
- if (abstentions === void 0) {
989
- abstentions = decompteNominatif.abstention;
990
- delete decompteNominatif.abstention;
991
- } else {
992
- assert.strictEqual(decompteNominatif.abstention, void 0);
993
- }
994
- if (abstentions !== void 0) {
995
- if (!Array.isArray(abstentions)) {
996
- assert(abstentions);
997
- abstentions = [abstentions];
998
- }
999
- const abstentionsArray = abstentions;
1000
- abstentions = [];
1001
- for (let absentionsItem of abstentionsArray) {
1002
- if (absentionsItem === null) {
1003
- continue;
1004
- }
1005
- absentionsItem = absentionsItem.votant;
1006
- if (Array.isArray(absentionsItem)) {
1007
- abstentions.push(...absentionsItem);
1008
- } else {
1009
- assert(absentionsItem);
1010
- abstentions.push(absentionsItem);
1011
- }
1012
- }
1013
- if (abstentions.length === 0) {
1014
- delete decompteNominatif.abstentions;
1015
- } else {
1016
- decompteNominatif.abstentions = abstentions;
1017
- for (const votant of abstentions) {
1018
- cleanVotant(votant);
1019
- }
1020
- }
1021
- }
1022
- let nonVotantsVolontaires = decompteNominatif.nonVotantsVolontaires;
1023
- if (nonVotantsVolontaires !== void 0) {
1024
- if (!Array.isArray(nonVotantsVolontaires)) {
1025
- nonVotantsVolontaires = [nonVotantsVolontaires];
1026
- }
1027
- const nonVotantsVolontairesArray = nonVotantsVolontaires;
1028
- nonVotantsVolontaires = [];
1029
- for (let absentionsItem of nonVotantsVolontairesArray) {
1030
- if (absentionsItem === null) {
1031
- continue;
1032
- }
1033
- absentionsItem = absentionsItem.votant;
1034
- if (Array.isArray(absentionsItem)) {
1035
- nonVotantsVolontaires.push(...absentionsItem);
1036
- } else {
1037
- assert(absentionsItem);
1038
- nonVotantsVolontaires.push(absentionsItem);
1039
- }
1040
- }
1041
- if (nonVotantsVolontaires.length === 0) {
1042
- delete decompteNominatif.nonVotantsVolontaires;
1043
- } else {
1044
- decompteNominatif.nonVotantsVolontaires = nonVotantsVolontaires;
1045
- for (const votant of nonVotantsVolontaires) {
1046
- cleanVotant(votant);
1047
- }
444
+ function T(e) {
445
+ f(e);
446
+ let n = e.nonVotants;
447
+ if (n === void 0 ? (n = e.nonVotant, delete e.nonVotant) : t.strictEqual(e.nonVotant, void 0), n !== void 0) {
448
+ typeof n == "string" ? (t.strictEqual(n, "0"), n = []) : Array.isArray(n) || (t(n), n = [n]);
449
+ const p = n;
450
+ n = [];
451
+ for (let o of p)
452
+ o !== null && (o = o.votant, Array.isArray(o) ? n.push(...o) : (t(o), n.push(o)));
453
+ if (n.length === 0)
454
+ delete e.nonVotants;
455
+ else {
456
+ e.nonVotants = n;
457
+ for (const o of n)
458
+ I(o);
459
+ }
460
+ }
461
+ let d = e.pour;
462
+ if (d === void 0 ? (d = e.pours, delete e.pours) : t.strictEqual(e.pours, void 0), d !== void 0)
463
+ if (d = d.votant, Array.isArray(d) || (t(d), d = [d]), d.length === 0)
464
+ delete e.pour;
465
+ else {
466
+ e.pour = d;
467
+ for (const p of d)
468
+ I(p);
469
+ }
470
+ let r = e.contre;
471
+ if (r === void 0 ? (r = e.contres, delete e.contres) : t.strictEqual(e.contres, void 0), r !== void 0)
472
+ if (r = r.votant, Array.isArray(r) || (t(r), r = [r]), r.length === 0)
473
+ delete e.contre;
474
+ else {
475
+ e.contre = r;
476
+ for (const p of r)
477
+ I(p);
478
+ }
479
+ let c = e.abstentions;
480
+ if (c === void 0 ? (c = e.abstention, delete e.abstention) : t.strictEqual(e.abstention, void 0), c !== void 0) {
481
+ Array.isArray(c) || (t(c), c = [c]);
482
+ const p = c;
483
+ c = [];
484
+ for (let o of p)
485
+ o !== null && (o = o.votant, Array.isArray(o) ? c.push(...o) : (t(o), c.push(o)));
486
+ if (c.length === 0)
487
+ delete e.abstentions;
488
+ else {
489
+ e.abstentions = c;
490
+ for (const o of c)
491
+ I(o);
492
+ }
493
+ }
494
+ let l = e.nonVotantsVolontaires;
495
+ if (l !== void 0) {
496
+ Array.isArray(l) || (l = [l]);
497
+ const p = l;
498
+ l = [];
499
+ for (let o of p)
500
+ o !== null && (o = o.votant, Array.isArray(o) ? l.push(...o) : (t(o), l.push(o)));
501
+ if (l.length === 0)
502
+ delete e.nonVotantsVolontaires;
503
+ else {
504
+ e.nonVotantsVolontaires = l;
505
+ for (const o of l)
506
+ I(o);
1048
507
  }
1049
508
  }
1050
509
  }
1051
- function cleanScrutin(scrutin) {
1052
- cleanXmlArtefacts(scrutin);
1053
- const demandeur = scrutin.demandeur;
1054
- assert(demandeur);
1055
- {
1056
- cleanXmlArtefacts(demandeur);
1057
- assert.strictEqual(demandeur.referenceLegislative, void 0);
1058
- }
1059
- const objet = scrutin.objet;
1060
- assert(objet);
510
+ function W(e) {
511
+ f(e);
512
+ const n = e.demandeur;
513
+ t(n), f(n), t.strictEqual(n.referenceLegislative, void 0);
514
+ const d = e.objet;
515
+ t(d), f(d), t.strictEqual(d.referenceLegislative, void 0);
516
+ let r = e.ventilationVotes;
517
+ t(r);
1061
518
  {
1062
- cleanXmlArtefacts(objet);
1063
- assert.strictEqual(objet.referenceLegislative, void 0);
1064
- }
1065
- let ventilationVotes = scrutin.ventilationVotes;
1066
- assert(ventilationVotes);
1067
- {
1068
- ventilationVotes = ventilationVotes.organe;
1069
- assert(ventilationVotes);
1070
- let groupes = ventilationVotes.groupes;
1071
- assert(groupes);
519
+ r = r.organe, t(r);
520
+ let l = r.groupes;
521
+ t(l);
1072
522
  {
1073
- groupes = groupes.groupe;
1074
- assert(Array.isArray(groupes));
1075
- for (const groupe of groupes) {
1076
- const vote = groupe.vote;
1077
- assert(vote);
523
+ l = l.groupe, t(Array.isArray(l));
524
+ for (const p of l) {
525
+ const o = p.vote;
526
+ t(o);
1078
527
  {
1079
- const decompteVoix = vote.decompteVoix;
1080
- assert(decompteVoix);
1081
- {
1082
- if (decompteVoix.abstention !== void 0) {
1083
- assert.strictEqual(decompteVoix.abstentions, void 0);
1084
- decompteVoix.abstentions = decompteVoix.abstention;
1085
- delete decompteVoix.abstention;
1086
- }
1087
- if (decompteVoix.nonVotant !== void 0) {
1088
- assert.strictEqual(decompteVoix.nonVotants, void 0);
1089
- decompteVoix.nonVotants = decompteVoix.nonVotant;
1090
- delete decompteVoix.nonVotant;
1091
- }
1092
- }
1093
- const decompteNominatif = vote.decompteNominatif;
1094
- assert(decompteNominatif);
1095
- cleanDecompteNominatif(decompteNominatif);
528
+ const s = o.decompteVoix;
529
+ t(s), s.abstention !== void 0 && (t.strictEqual(s.abstentions, void 0), s.abstentions = s.abstention, delete s.abstention), s.nonVotant !== void 0 && (t.strictEqual(s.nonVotants, void 0), s.nonVotants = s.nonVotant, delete s.nonVotant);
530
+ const u = o.decompteNominatif;
531
+ t(u), T(u);
1096
532
  }
1097
533
  }
1098
- ventilationVotes.groupes = groupes;
534
+ r.groupes = l;
1099
535
  }
1100
- scrutin.ventilationVotes = ventilationVotes;
536
+ e.ventilationVotes = r;
1101
537
  }
1102
- const miseAuPoint = scrutin.miseAuPoint;
1103
- if (miseAuPoint !== void 0) {
1104
- cleanDecompteNominatif(miseAuPoint);
1105
- let dysfonctionnement = miseAuPoint.dysfonctionnement;
1106
- if (dysfonctionnement !== void 0) {
1107
- cleanDecompteNominatif(dysfonctionnement);
1108
- if (Object.values(dysfonctionnement).filter((value) => value !== void 0).length === 0) {
1109
- delete miseAuPoint.dysfonctionnement;
1110
- }
1111
- }
1112
- if (Object.values(miseAuPoint).filter((value) => value !== void 0).length === 0) {
1113
- delete scrutin.miseAuPoint;
1114
- }
538
+ const c = e.miseAuPoint;
539
+ if (c !== void 0) {
540
+ T(c);
541
+ let l = c.dysfonctionnement;
542
+ l !== void 0 && (T(l), Object.values(l).filter((p) => p !== void 0).length === 0 && delete c.dysfonctionnement), Object.values(c).filter((p) => p !== void 0).length === 0 && delete e.miseAuPoint;
1115
543
  }
1116
544
  }
1117
- function cleanVotant(votant) {
1118
- cleanBooleanAttribute(votant, "parDelegation");
1119
- cleanIntegerAttribute(votant, "numPlace");
545
+ function I(e) {
546
+ S(e, "parDelegation"), _(e, "numPlace");
1120
547
  }
1121
- function cleanQuestion(question) {
1122
- cleanXmlArtefacts(question);
548
+ function X(e) {
549
+ f(e);
1123
550
  }
1124
- function cleanCompteRendu(compteRendu) {
1125
- cleanXmlArtefacts(compteRendu);
551
+ function z(e) {
552
+ f(e);
1126
553
  }
1127
554
  export {
1128
- cleanActeur,
1129
- d as cleanAmendement,
1130
- cleanCompteRendu,
1131
- cleanDocumentOrDivision,
1132
- cleanDossierParlementaire,
1133
- cleanOrgane,
1134
- cleanQuestion,
1135
- cleanReunion,
1136
- cleanScrutin
555
+ $ as cleanActeur,
556
+ Y as cleanAmendement,
557
+ z as cleanCompteRendu,
558
+ w as cleanDocumentOrDivision,
559
+ B as cleanDossierParlementaire,
560
+ k as cleanOrgane,
561
+ X as cleanQuestion,
562
+ U as cleanReunion,
563
+ W as cleanScrutin
1137
564
  };
1138
- //# sourceMappingURL=cleaners.js.map