@amsom-habitat/cresol 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cresol.js CHANGED
@@ -1,46 +1,69 @@
1
- import { AmsomModal as e, AmsomOverlay as t } from "@amsom-habitat/ui";
2
- import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, guardReactiveProps as d, inject as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, provide as _, reactive as v, ref as y, renderList as b, renderSlot as x, resolveComponent as S, toDisplayString as C, toHandlers as ee, toRef as w, unref as T, vShow as E, withCtx as D, withDirectives as te } from "vue";
3
- import { AmsomNavTabsHorizontal as ne } from "@amsom-habitat/nav-tabs";
4
- import re from "@amsom-habitat/horizontal-stepper";
5
- import { AmsomAutocomplete as O } from "@amsom-habitat/amsom-autocomplete";
6
- import ie from "@amsom-habitat/axios-overlay";
7
- import k from "@amsom-habitat/user-manager";
8
- import { library as ae } from "@fortawesome/fontawesome-svg-core";
9
- import { AmsomTextarea as oe } from "@amsom-habitat/amsom-textarea";
10
- import { AmsomUploadFile as se } from "@amsom-habitat/file-manager";
1
+ import { library as e } from "@fortawesome/fontawesome-svg-core";
2
+ import { faBriefcase as t, faBuilding as n, faBuildingShield as r, faCheck as i, faChevronLeft as a, faChevronRight as o, faCircleExclamation as s, faCircleInfo as c, faCircleQuestion as l, faDungeon as u, faFileSignature as d, faHandsHolding as f, faHourglass as p, faHouse as ee, faInfo as m, faLayerGroup as h, faLocationDot as te, faMagnifyingGlass as ne, faPersonShelter as re, faSquareParking as ie, faStore as ae, faTag as oe, faUser as se, faUserGraduate as ce, faXmark as le } from "@fortawesome/free-solid-svg-icons";
3
+ import { AmsomModal as ue, AmsomOverlay as g } from "@amsom-habitat/ui";
4
+ import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as C, createTextVNode as w, createVNode as T, guardReactiveProps as E, inject as de, mergeProps as fe, normalizeClass as D, normalizeProps as O, openBlock as k, provide as pe, reactive as A, ref as j, renderList as M, renderSlot as N, resolveComponent as P, toDisplayString as F, toHandlers as me, toRef as I, unref as L, vShow as he, withCtx as R, withDirectives as ge } from "vue";
5
+ import { AmsomNavTabsHorizontal as _e } from "@amsom-habitat/nav-tabs";
6
+ import ve from "@amsom-habitat/horizontal-stepper";
7
+ import { AmsomAutocomplete as z } from "@amsom-habitat/amsom-autocomplete";
8
+ import ye from "@amsom-habitat/axios-overlay";
9
+ import B from "@amsom-habitat/user-manager";
10
+ import { AmsomTextarea as be } from "@amsom-habitat/amsom-textarea";
11
+ import { AmsomUploadFile as xe } from "@amsom-habitat/file-manager";
12
+ //#region src/icons.js
13
+ e.add(t, n, r, i, a, o, s, c, l, u, d, f, p, ee, m, h, te, ne, re, ie, ae, oe, se, ce, le);
14
+ //#endregion
11
15
  //#region src/utils/provenanceContact.js
12
- var ce = [
13
- {
14
- id: "T",
15
- libelle: "Téléphone",
16
- icon: "phone"
17
- },
18
- {
19
- id: "M",
20
- libelle: "Email",
21
- icon: "envelope"
22
- },
23
- {
24
- id: "G",
25
- libelle: "Gardien",
26
- icon: "user-shield"
16
+ var V = {
17
+ T: "phone",
18
+ M: "envelope",
19
+ G: "user-shield",
20
+ V: "building",
21
+ IP: "exclamation-triangle",
22
+ C: "envelope-open"
23
+ }, Se = "comment-dots", Ce = (e) => V[e] ?? "comment-dots", we = Object.keys(V), Te = "T", H = {
24
+ locataire: {
25
+ libelle: "Locataire",
26
+ icon: "house-user",
27
+ couleur: "primary"
27
28
  },
28
- {
29
- id: "V",
30
- libelle: "Visite au siège",
31
- icon: "building"
29
+ demandeur: {
30
+ libelle: "Demandeur",
31
+ icon: "hourglass-half",
32
+ couleur: "info"
32
33
  },
33
- {
34
- id: "IP",
35
- libelle: "Incident de permanence",
36
- icon: "exclamation-triangle"
34
+ tiers: {
35
+ libelle: "Tiers",
36
+ icon: "user-tie",
37
+ couleur: "warning"
37
38
  },
38
- {
39
- id: "C",
40
- libelle: "Courrier",
41
- icon: "envelope-open"
39
+ autre: {
40
+ libelle: "Autre",
41
+ icon: "user",
42
+ couleur: "secondary"
43
+ },
44
+ fournisseur: {
45
+ libelle: "Fournisseur",
46
+ icon: "truck",
47
+ couleur: "success"
48
+ },
49
+ personnel: {
50
+ libelle: "Personnel",
51
+ icon: "id-badge",
52
+ couleur: "dark"
53
+ },
54
+ inconnu: {
55
+ libelle: "Inconnu",
56
+ icon: "circle-question",
57
+ couleur: "danger"
42
58
  }
43
- ], le = "T", ue = Symbol("cresol:draft"), A = () => ({
59
+ }, Ee = ["L", "P"], De = {
60
+ ...Object.fromEntries(Ee.map((e) => [e, "locataire"])),
61
+ D: "demandeur",
62
+ T: "tiers",
63
+ U: "autre",
64
+ F: "fournisseur",
65
+ E: "personnel"
66
+ }, U = Object.keys(De), Oe = (e) => [...new Set(e.map((e) => De[e]))], ke = (e) => e ? H[e.categorie] ? e.categorie : De[e.type] ?? "inconnu" : null, Ae = (e) => H[ke(e)] ?? null, je = Symbol("cresol:draft"), W = () => ({
44
67
  idCommune: null,
45
68
  commune: null,
46
69
  idEntree: null,
@@ -55,7 +78,7 @@ var ce = [
55
78
  typeContratActuel: null,
56
79
  idContratActuel: null,
57
80
  occupantActuel: null
58
- }), j = () => ({
81
+ }), Me = () => ({
59
82
  idMotif: null,
60
83
  idCategorie: null,
61
84
  idType: null,
@@ -73,7 +96,7 @@ var ce = [
73
96
  dateFaits: null,
74
97
  dateFaitsOverride: !1,
75
98
  fichier: null
76
- }), M = [
99
+ }), Ne = [
77
100
  "reclamant",
78
101
  "provenance",
79
102
  "motif",
@@ -82,23 +105,19 @@ var ce = [
82
105
  "dateFaits",
83
106
  "responsable",
84
107
  "fichier"
85
- ], de = [
86
- "D",
87
- "U",
88
- "T"
89
- ], N = (e = "T") => ({
108
+ ], Pe = (e = "T") => ({
90
109
  reclamant: {
91
110
  type: null,
92
111
  id: null
93
112
  },
94
113
  provenance: e,
95
114
  lignes: [{
96
- ...j(),
115
+ ...Me(),
97
116
  cibleMode: "contrat",
98
- patrimoine: A(),
117
+ patrimoine: W(),
99
118
  description: ""
100
119
  }]
101
- }), fe = (e) => e?.id ?? e ?? null, pe = (e) => {
120
+ }), Fe = (e) => e?.id ?? e ?? null, Ie = (e) => {
102
121
  if (!e) return "Cible non définie";
103
122
  let t = [
104
123
  e.commune,
@@ -106,17 +125,17 @@ var ce = [
106
125
  e.libelleModule
107
126
  ].filter(Boolean);
108
127
  return e.etage != null && !e.libelleModule && t.push(`Étage ${e.etage}`), t.length ? t.join(" — ") : "Cible non définie";
109
- }, me = (e) => !!e && (e.idModule != null || e.idEntree != null), he = (e, t) => e.cibleMode === "demande" || !e.cibleOverride && e.patrimoine == null ? !0 : e.cibleMode === "contrat" ? !!(e.contratReclamant && t || e.contratCible) && e.patrimoine?.idModule != null : e.modulePrecis ? e.patrimoine?.idModule != null : me(e.patrimoine), ge = (e, t) => e.description == null ? !t : e.description.trim().length > 0, _e = (e = {}) => {
128
+ }, Le = (e) => !!e && (e.idModule != null || e.idEntree != null), Re = (e, t) => e.cibleMode === "demande" || !e.cibleOverride && e.patrimoine == null ? !0 : e.cibleMode === "contrat" ? !!(e.contratReclamant && t || e.contratCible) && e.patrimoine?.idModule != null : e.modulePrecis ? e.patrimoine?.idModule != null : Le(e.patrimoine), ze = (e, t) => e.description == null ? !t : e.description.trim().length > 0, Be = (e = {}) => {
110
129
  let t = {
111
- ...j(),
130
+ ...Me(),
112
131
  ...e
113
132
  };
114
133
  return e.patrimoine && (t.patrimoine = {
115
- ...A(),
134
+ ...W(),
116
135
  ...e.patrimoine
117
136
  }), t;
118
- }, ve = (e) => {
119
- let t = N();
137
+ }, Ve = (e) => {
138
+ let t = Pe();
120
139
  if (!e) return t;
121
140
  let n = Array.isArray(e.lignes) && e.lignes.length ? e.lignes : null;
122
141
  return {
@@ -129,168 +148,168 @@ var ce = [
129
148
  provenance: e.provenance ?? t.provenance,
130
149
  lignes: n ? n.map((e, n) => n === 0 ? {
131
150
  ...t.lignes[0],
132
- ..._e(e)
133
- } : _e(e)) : t.lignes
151
+ ...Be(e)
152
+ } : Be(e)) : t.lignes
134
153
  };
135
154
  };
136
- function ye({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly: i = y(!1) } = {}) {
137
- let a = v(N()), o = r(() => {
138
- let e = T(i);
139
- return e === !0 ? M : Array.isArray(e) ? e : [];
140
- }), s = (e) => o.value.includes(e), c = r(() => a.lignes[0]), l = r(() => a.lignes.slice(1)), u = r(() => T(e) ?? []), d = y(null), f = (e, t) => e.type === t.type && String(e.id) === String(t.id), p = r(() => {
141
- let e = d.value;
142
- return !e || u.value.some((t) => f(t, e)) ? u.value : [...u.value, e];
143
- }), m = r(() => p.value.find((e) => f(e, a.reclamant)) ?? p.value[0] ?? null), h = r(() => {
144
- let e = T(t) ?? [], r = T(n);
155
+ function He({ reclamants: e, modules: t, idModulePrefere: n = j(null), readonly: r = j(!1) } = {}) {
156
+ let i = A(Pe()), a = v(() => {
157
+ let e = L(r);
158
+ return e === !0 ? Ne : Array.isArray(e) ? e : [];
159
+ }), o = (e) => a.value.includes(e), s = v(() => i.lignes[0]), c = v(() => i.lignes.slice(1)), l = v(() => L(e) ?? []), u = j(null), d = (e, t) => e.type === t.type && String(e.id) === String(t.id), f = v(() => {
160
+ let e = u.value;
161
+ return !e || l.value.some((t) => d(t, e)) ? l.value : [...l.value, e];
162
+ }), p = v(() => f.value.find((e) => d(e, i.reclamant)) ?? f.value[0] ?? null), ee = v(() => {
163
+ let e = L(t) ?? [], r = L(n);
145
164
  return (r == null ? null : e.find((e) => String(e.idModule) === String(r))) ?? e.find((e) => e.estModulePrincipal) ?? e[0] ?? null;
146
- }), g = r(() => !!m.value && !de.includes(m.value.type)), _ = {
147
- draft: a,
148
- lignePrincipale: c,
149
- lignesAssociees: l,
150
- reclamantsFournis: u,
151
- reclamantsDisponibles: p,
152
- reclamantSelectionne: m,
153
- moduleReclamantPrincipal: h,
154
- reclamantEstContrat: g,
155
- ciblesValid: r(() => a.lignes.every((e) => he(e, g.value))),
156
- detailsValid: r(() => a.lignes.every((e, t) => ge(e, t === 0))),
157
- isReadonly: s,
165
+ }), m = v(() => !!p.value && Ee.includes(p.value.type)), h = {
166
+ draft: i,
167
+ lignePrincipale: s,
168
+ lignesAssociees: c,
169
+ reclamantsFournis: l,
170
+ reclamantsDisponibles: f,
171
+ reclamantSelectionne: p,
172
+ moduleReclamantPrincipal: ee,
173
+ reclamantEstContrat: m,
174
+ ciblesValid: v(() => i.lignes.every((e) => Re(e, m.value))),
175
+ detailsValid: v(() => i.lignes.every((e, t) => ze(e, t === 0))),
176
+ isReadonly: o,
158
177
  reset(e = null) {
159
- let t = ve(e);
160
- Object.assign(a, t), a.lignes = t.lignes;
178
+ let t = Ve(e);
179
+ Object.assign(i, t), i.lignes = t.lignes;
161
180
  },
162
181
  setProvenance(e) {
163
- a.provenance = e;
182
+ i.provenance = e;
164
183
  },
165
184
  syncReclamant() {
166
- let e = m.value;
167
- _.setReclamant({
185
+ let e = p.value;
186
+ h.setReclamant({
168
187
  type: e?.type ?? null,
169
188
  id: e?.id ?? null
170
189
  });
171
190
  },
172
191
  selectReclamant(e) {
173
- e && (u.value.some((t) => f(t, e)) || (d.value = e), _.setReclamant(e));
192
+ e && (l.value.some((t) => d(t, e)) || (u.value = e), h.setReclamant(e));
174
193
  },
175
194
  setReclamant({ type: e, id: t }) {
176
- if (a.reclamant = {
195
+ if (i.reclamant = {
177
196
  type: e ?? null,
178
197
  id: t ?? null
179
- }, s("cible")) return;
180
- let n = a.lignes[0];
181
- e === "D" ? (n.cibleMode = "demande", n.patrimoine = null) : (n.cibleMode = g.value ? "contrat" : "patrimoine", n.contratReclamant = g.value, n.contratCible = null, n.reprendreLocataireActuel = !1, n.patrimoine = A(), _.prefillCiblePrincipale());
198
+ }, o("cible")) return;
199
+ let n = i.lignes[0];
200
+ e === "D" ? (n.cibleMode = "demande", n.patrimoine = null) : (n.cibleMode = m.value ? "contrat" : "patrimoine", n.contratReclamant = m.value, n.contratCible = null, n.reprendreLocataireActuel = !1, n.patrimoine = W(), h.prefillCiblePrincipale());
182
201
  },
183
202
  prefillCiblePrincipale() {
184
- if (s("cible")) return;
185
- let e = h.value;
186
- e && _.prefillFromModule(0, e);
203
+ if (o("cible")) return;
204
+ let e = ee.value;
205
+ e && h.prefillFromModule(0, e);
187
206
  },
188
207
  _resetAfterNomenclature() {
189
- a.lignes[0].responsable = null, a.lignes.splice(1);
208
+ i.lignes[0].responsable = null, i.lignes.splice(1);
190
209
  },
191
210
  setCategorie(e) {
192
- let t = a.lignes[0];
193
- t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
211
+ let t = i.lignes[0];
212
+ t.idCategorie = e, t.idType = null, t.idNature = null, t.idMotif = null, h._resetAfterNomenclature();
194
213
  },
195
214
  setType(e) {
196
- let t = a.lignes[0];
197
- t.idType = e, t.idNature = null, t.idMotif = null, _._resetAfterNomenclature();
215
+ let t = i.lignes[0];
216
+ t.idType = e, t.idNature = null, t.idMotif = null, h._resetAfterNomenclature();
198
217
  },
199
218
  setNature(e) {
200
- let t = a.lignes[0];
201
- t.idNature = e, t.idMotif = null, _._resetAfterNomenclature();
219
+ let t = i.lignes[0];
220
+ t.idNature = e, t.idMotif = null, h._resetAfterNomenclature();
202
221
  },
203
222
  setMotif(e) {
204
- a.lignes[0].idMotif = e, _._resetAfterNomenclature();
223
+ i.lignes[0].idMotif = e, h._resetAfterNomenclature();
205
224
  },
206
225
  selectMotifChain(e) {
207
- let t = a.lignes[0];
208
- t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null, _._resetAfterNomenclature();
226
+ let t = i.lignes[0];
227
+ t.idCategorie = e?.idCategorie ?? null, t.idType = e?.idType ?? null, t.idNature = e?.idNature ?? null, t.idMotif = e?.id ?? null, h._resetAfterNomenclature();
209
228
  },
210
229
  toggleLigneAssociee(e, t = {}) {
211
- let n = a.lignes.findIndex((t, n) => n > 0 && t.idMotif === e);
212
- n === -1 ? a.lignes.push({
213
- ...j(),
230
+ let n = i.lignes.findIndex((t, n) => n > 0 && t.idMotif === e);
231
+ n === -1 ? i.lignes.push({
232
+ ...Me(),
214
233
  idMotif: e,
215
234
  ...t
216
- }) : a.lignes.splice(n, 1);
235
+ }) : i.lignes.splice(n, 1);
217
236
  },
218
237
  _patrimoine(e) {
219
- return a.lignes[e]?.patrimoine ?? null;
238
+ return i.lignes[e]?.patrimoine ?? null;
220
239
  },
221
240
  setCibleMode(e, t) {
222
- let n = a.lignes[e];
223
- n && (n.cibleMode = t, n.reprendreLocataireActuel = !1, n.modulePrecis = !0, n.contratReclamant = t === "contrat" && g.value, n.contratCible = null, t === "demande" ? n.patrimoine = null : n.patrimoine ??= A());
241
+ let n = i.lignes[e];
242
+ n && (n.cibleMode = t, n.reprendreLocataireActuel = !1, n.modulePrecis = !0, n.contratReclamant = t === "contrat" && m.value, n.contratCible = null, t === "demande" ? n.patrimoine = null : n.patrimoine ??= W());
224
243
  },
225
244
  setModulePrecis(e, t) {
226
- let n = a.lignes[e];
227
- n && (n.modulePrecis = !!t, n.modulePrecis || _.setPatrimoineModule(e, null));
245
+ let n = i.lignes[e];
246
+ n && (n.modulePrecis = !!t, n.modulePrecis || h.setPatrimoineModule(e, null));
228
247
  },
229
248
  toggleContratReclamant(e, t) {
230
- let n = a.lignes[e];
231
- n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine && _.setPatrimoineModule(e, null));
249
+ let n = i.lignes[e];
250
+ n && (n.contratReclamant = t ?? !n.contratReclamant, n.contratCible = null, n.patrimoine && h.setPatrimoineModule(e, null));
232
251
  },
233
252
  setContratCible(e, t) {
234
- let n = a.lignes[e];
253
+ let n = i.lignes[e];
235
254
  n && (n.contratCible = t ? {
236
255
  typeContrat: t.typeContrat,
237
256
  idContrat: t.idContrat,
238
257
  libelle: t.libelle ?? null
239
- } : null, _.setPatrimoineModule(e, null));
258
+ } : null, h.setPatrimoineModule(e, null));
240
259
  },
241
260
  setPatrimoineCommune(e, t) {
242
- let n = _._patrimoine(e);
243
- n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null, _.setPatrimoineEntree(e, null));
261
+ let n = h._patrimoine(e);
262
+ n && (n.idCommune = t?.idCommune ?? null, n.commune = t?.commune ?? null, h.setPatrimoineEntree(e, null));
244
263
  },
245
264
  setPatrimoineEntree(e, t) {
246
- let n = _._patrimoine(e);
247
- n && (n.idEntree = t?.idEntree ?? null, n.entree = t?.entree ?? null, n.codeProgramme = t?.codeProgramme ?? null, n.codeTranche = t?.codeTranche ?? null, n.codeBatiment = t?.codeBatiment ?? null, n.codeEscalier = t?.codeEscalier ?? null, n.etage = null, _.setPatrimoineModule(e, null));
265
+ let n = h._patrimoine(e);
266
+ n && (n.idEntree = t?.idEntree ?? null, n.entree = t?.entree ?? null, n.codeProgramme = t?.codeProgramme ?? null, n.codeTranche = t?.codeTranche ?? null, n.codeBatiment = t?.codeBatiment ?? null, n.codeEscalier = t?.codeEscalier ?? null, n.etage = null, h.setPatrimoineModule(e, null));
248
267
  },
249
268
  setPatrimoineEtage(e, t) {
250
- let n = _._patrimoine(e);
251
- n && (n.etage = t, _.setPatrimoineModule(e, null));
269
+ let n = h._patrimoine(e);
270
+ n && (n.etage = t, h.setPatrimoineModule(e, null));
252
271
  },
253
272
  setPatrimoineModule(e, t) {
254
- let n = _._patrimoine(e);
273
+ let n = h._patrimoine(e);
255
274
  n && (n.idModule = t?.idModule ?? null, n.libelleModule = t?.libelleModule ?? null, n.typeContratActuel = t?.typeContratActuel ?? null, n.idContratActuel = t?.idContratActuel ?? null, n.occupantActuel = t?.occupantActuel ?? null, t && (n.codeProgramme = t.codeProgramme ?? n.codeProgramme, n.codeTranche = t.codeTranche ?? n.codeTranche, n.codeBatiment = t.codeBatiment ?? n.codeBatiment, n.codeEscalier = t.codeEscalier ?? n.codeEscalier, t.idEntree != null && (n.idEntree = t.idEntree), t.etage != null && (n.etage = t.etage)));
256
275
  },
257
276
  prefillFromModule(e, t) {
258
- let n = _._patrimoine(e);
277
+ let n = h._patrimoine(e);
259
278
  n && t && (n.idCommune = t.idCommune ?? null, n.commune = t.commune ?? null, n.idEntree = t.idEntree ?? null, n.entree = t.adresse ?? t.numeroRue ?? null, n.codeProgramme = t.codeProgramme ?? null, n.codeTranche = t.codeTranche ?? null, n.codeBatiment = t.codeBatiment ?? null, n.codeEscalier = t.codeEscalier ?? null, n.etage = t.etage ?? null, n.idModule = t.idModule ?? null, n.libelleModule = t.libelleModule ?? t.adresse ?? null, n.typeContratActuel = t.typeContratActuel ?? null, n.idContratActuel = t.idContratActuel ?? null, n.occupantActuel = t.occupantActuel ?? null);
260
279
  },
261
280
  toggleCibleOverride(e) {
262
- let t = a.lignes[e];
281
+ let t = i.lignes[e];
263
282
  if (!t) return;
264
- let n = a.lignes[0];
283
+ let n = i.lignes[0];
265
284
  t.cibleOverride ? (t.cibleOverride = !1, t.cibleMode = null, t.patrimoine = null, t.reprendreLocataireActuel = !1, t.modulePrecis = !0, t.contratReclamant = !0, t.contratCible = null) : (t.cibleOverride = !0, t.cibleMode = n.cibleMode, t.patrimoine = n.cibleMode === "demande" ? null : { ...n.patrimoine }, t.reprendreLocataireActuel = n.reprendreLocataireActuel, t.modulePrecis = n.modulePrecis, t.contratReclamant = n.contratReclamant, t.contratCible = n.contratCible ? { ...n.contratCible } : null);
266
285
  },
267
286
  setReprendreLocataireActuel(e, t) {
268
- let n = a.lignes[e];
287
+ let n = i.lignes[e];
269
288
  n && (n.reprendreLocataireActuel = !!t);
270
289
  },
271
290
  setDescription(e, t) {
272
- let n = a.lignes[e];
291
+ let n = i.lignes[e];
273
292
  n && (n.description = t);
274
293
  },
275
294
  setDateFaits(e, t) {
276
- let n = a.lignes[e];
295
+ let n = i.lignes[e];
277
296
  n && (n.dateFaits = t);
278
297
  },
279
298
  setResponsable(e, t) {
280
- let n = a.lignes[e];
299
+ let n = i.lignes[e];
281
300
  n && (n.responsable = t);
282
301
  },
283
302
  setFichier(e, t) {
284
- let n = a.lignes[e];
303
+ let n = i.lignes[e];
285
304
  n && (n.fichier = t);
286
305
  },
287
306
  toggleDescriptionOverride(e) {
288
- let t = a.lignes[e];
307
+ let t = i.lignes[e];
289
308
  t && (t.description = t.description == null ? "" : null);
290
309
  },
291
310
  toggleDateFaitsOverride(e) {
292
- let t = a.lignes[e];
293
- t && (t.dateFaitsOverride = !t.dateFaitsOverride, t.dateFaits = t.dateFaitsOverride ? a.lignes[0].dateFaits : null);
311
+ let t = i.lignes[e];
312
+ t && (t.dateFaitsOverride = !t.dateFaitsOverride, t.dateFaits = t.dateFaitsOverride ? i.lignes[0].dateFaits : null);
294
313
  },
295
314
  _patrimoinePayload(e) {
296
315
  return e.idModule == null ? {
@@ -302,26 +321,26 @@ function ye({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly:
302
321
  } : { idModule: e.idModule };
303
322
  },
304
323
  _lignePayload(e, t) {
305
- let n = a.lignes[0], r = t > 0 && !e.cibleOverride ? n : e, i = (e.description ?? "").trim() || (n.description ?? "").trim(), o = e.dateFaits == null ? n.dateFaits : e.dateFaits, s = a.reclamant.type === "D", c = {
324
+ let n = i.lignes[0], r = t > 0 && !e.cibleOverride ? n : e, a = (e.description ?? "").trim() || (n.description ?? "").trim(), o = e.dateFaits == null ? n.dateFaits : e.dateFaits, s = i.reclamant.type === "D", c = {
306
325
  categorie: e.idCategorie,
307
326
  type: e.idType,
308
327
  nature: e.idNature,
309
328
  motif: e.idMotif,
310
- description: i,
329
+ description: a,
311
330
  dateFaits: o,
312
- responsable: fe(e.responsable)
331
+ responsable: Fe(e.responsable)
313
332
  };
314
333
  if (r.cibleMode === "demande") return {
315
334
  ...c,
316
335
  codeTypeCible: "D",
317
- idCible: a.reclamant.id,
336
+ idCible: i.reclamant.id,
318
337
  deduireCible: !1
319
338
  };
320
- let l = _._patrimoinePayload(r.patrimoine);
339
+ let l = h._patrimoinePayload(r.patrimoine);
321
340
  if (r.cibleMode === "contrat" && !r.reprendreLocataireActuel) {
322
- let e = r.contratReclamant && g.value ? {
323
- typeContrat: a.reclamant.type,
324
- idContrat: a.reclamant.id
341
+ let e = r.contratReclamant && m.value ? {
342
+ typeContrat: i.reclamant.type,
343
+ idContrat: i.reclamant.id
325
344
  } : r.contratCible;
326
345
  return {
327
346
  ...c,
@@ -340,57 +359,57 @@ function ye({ reclamants: e, modules: t, idModulePrefere: n = y(null), readonly:
340
359
  };
341
360
  },
342
361
  cibleResume(e) {
343
- let t = a.lignes[0], n = e !== t && !e.cibleOverride ? t : e;
362
+ let t = i.lignes[0], n = e !== t && !e.cibleOverride ? t : e;
344
363
  if (n.cibleMode === "demande") return "La demande";
345
- let r = pe(n.patrimoine);
364
+ let r = Ie(n.patrimoine);
346
365
  if (n.cibleMode === "patrimoine" && !n.modulePrecis) return `Parties communes — ${r}`;
347
366
  if (n.cibleMode !== "contrat") return r;
348
- let i = "Contrat non défini";
349
- if (n.contratReclamant && g.value) i = "Contrat du réclamant";
367
+ let a = "Contrat non défini";
368
+ if (n.contratReclamant && m.value) a = "Contrat du réclamant";
350
369
  else if (n.contratCible) {
351
370
  let e = n.contratCible;
352
- i = `${e.libelle ?? "Contrat"} (${e.typeContrat}/${e.idContrat})`;
371
+ a = `${e.libelle ?? "Contrat"} (${e.typeContrat}/${e.idContrat})`;
353
372
  }
354
- return `${i} — ${r}`;
373
+ return `${a} — ${r}`;
355
374
  },
356
375
  lignesPayload() {
357
- return a.lignes.map((e, t) => _._lignePayload(e, t));
376
+ return i.lignes.map((e, t) => h._lignePayload(e, t));
358
377
  },
359
378
  creationPayload() {
360
- let e = m.value;
379
+ let e = p.value;
361
380
  return {
362
381
  typeReclamant: e?.type ?? null,
363
382
  reclamant: e?.id ?? null,
364
- lignes: _.lignesPayload(),
365
- provenance: a.provenance
383
+ lignes: h.lignesPayload(),
384
+ provenance: i.provenance
366
385
  };
367
386
  }
368
387
  };
369
- return v(_);
388
+ return A(h);
370
389
  }
371
- function be(e) {
372
- return _(ue, e), e;
390
+ function Ue(e) {
391
+ return pe(je, e), e;
373
392
  }
374
- function P() {
375
- let e = f(ue, null);
393
+ function G() {
394
+ let e = de(je, null);
376
395
  if (!e) throw Error("useSollicitationDraft() hors de <creer-sollicitation-form>");
377
396
  return e;
378
397
  }
379
398
  //#endregion
380
399
  //#region \0plugin-vue:export-helper
381
- var F = (e, t) => {
400
+ var K = (e, t) => {
382
401
  let n = e.__vccOpts || e;
383
402
  for (let [e, r] of t) n[e] = r;
384
403
  return n;
385
- }, xe = {
404
+ }, We = {
386
405
  name: "AsideBlock",
387
- components: { AmsomNavTabsHorizontal: ne },
406
+ components: { AmsomNavTabsHorizontal: _e },
388
407
  props: { nbSimilaires: {
389
408
  type: Number,
390
409
  default: 0
391
410
  } },
392
411
  setup() {
393
- return { draft: P() };
412
+ return { draft: G() };
394
413
  },
395
414
  data() {
396
415
  return { activeTab: null };
@@ -426,44 +445,44 @@ var F = (e, t) => {
426
445
  e.some((e) => e.id === this.activeTab) || (this.activeTab = e[0]?.id ?? null);
427
446
  }
428
447
  } }
429
- }, Se = {
448
+ }, Ge = {
430
449
  key: 0,
431
450
  class: "badge bg-danger ms-1"
432
- }, Ce = { style: { "min-height": "320px" } }, we = { key: 0 }, Te = { key: 1 };
433
- function Ee(e, t, n, r, c, l) {
434
- let f = S("font-awesome-icon"), p = S("amsom-nav-tabs-horizontal");
435
- return l.tabs.length ? (g(), i(p, {
451
+ }, Ke = { style: { "min-height": "320px" } }, qe = { key: 0 }, Je = { key: 1 };
452
+ function Ye(e, t, n, r, i, a) {
453
+ let o = P("font-awesome-icon"), s = P("amsom-nav-tabs-horizontal");
454
+ return a.tabs.length ? (k(), y(s, {
436
455
  key: 0,
437
- modelValue: c.activeTab,
438
- "onUpdate:modelValue": t[0] ||= (e) => c.activeTab = e,
439
- items: l.tabs,
456
+ modelValue: i.activeTab,
457
+ "onUpdate:modelValue": t[0] ||= (e) => i.activeTab = e,
458
+ items: a.tabs,
440
459
  "item-key": "id",
441
460
  "tab-spacing": 1
442
461
  }, {
443
- libelle: D(({ item: e }) => [
444
- u(f, { icon: e.icon }, null, 8, ["icon"]),
445
- s("span", null, C(e.label), 1),
446
- e.id === "similarite" && n.nbSimilaires > 0 ? (g(), o("span", Se, C(n.nbSimilaires), 1)) : a("", !0)
462
+ libelle: R(({ item: e }) => [
463
+ T(o, { icon: e.icon }, null, 8, ["icon"]),
464
+ S("span", null, F(e.label), 1),
465
+ e.id === "similarite" && n.nbSimilaires > 0 ? (k(), x("span", Ge, F(n.nbSimilaires), 1)) : b("", !0)
447
466
  ]),
448
- content: D(() => [s("div", Ce, [e.$slots.similaires ? te((g(), o("div", we, [x(e.$slots, "similaires", h(d(l.scope)))], 512)), [[E, c.activeTab === "similarite"]]) : a("", !0), e.$slots.evenements ? te((g(), o("div", Te, [x(e.$slots, "evenements")], 512)), [[E, c.activeTab === "evenements"]]) : a("", !0)])]),
467
+ content: R(() => [S("div", Ke, [e.$slots.similaires ? ge((k(), x("div", qe, [N(e.$slots, "similaires", O(E(a.scope)))], 512)), [[he, i.activeTab === "similarite"]]) : b("", !0), e.$slots.evenements ? ge((k(), x("div", Je, [N(e.$slots, "evenements")], 512)), [[he, i.activeTab === "evenements"]]) : b("", !0)])]),
449
468
  _: 3
450
- }, 8, ["modelValue", "items"])) : a("", !0);
469
+ }, 8, ["modelValue", "items"])) : b("", !0);
451
470
  }
452
- var De = /*#__PURE__*/ F(xe, [["render", Ee]]), I = {
471
+ var Xe = /*#__PURE__*/ K(We, [["render", Ye]]), Ze = {
453
472
  baseUrl: "",
454
- getToken: () => k.getToken(),
455
- setToken: (e) => k.setToken(e),
456
- logout: () => k.logout(),
457
- goToLoginPage: () => k.goToLoginPage()
473
+ getToken: () => B.getToken(),
474
+ setToken: (e) => B.setToken(e),
475
+ logout: () => B.logout(),
476
+ goToLoginPage: () => B.goToLoginPage()
458
477
  };
459
- function Oe(e = {}) {
460
- Object.assign(I, e);
478
+ function Qe(e = {}) {
479
+ Object.assign(Ze, e);
461
480
  }
462
- var L = () => I;
481
+ var $e = () => Ze;
463
482
  //#endregion
464
483
  //#region src/api/transport/axiosOverlayConnector.js
465
- function ke(e, t = {}) {
466
- let n = L(), r = {
484
+ function et(e, t = {}) {
485
+ let n = $e(), r = {
467
486
  getToken: () => n.getToken?.() ?? null,
468
487
  setToken: (e) => n.setToken?.(e),
469
488
  logout: () => n.logout?.(),
@@ -485,69 +504,74 @@ function ke(e, t = {}) {
485
504
  }, t.functions.errorsHandlers = {
486
505
  ...r.errorsHandlers,
487
506
  ...t.functions.errorsHandlers ?? {}
488
- }, ie(e, t);
507
+ }, ye(e, t);
489
508
  }
490
509
  //#endregion
491
510
  //#region src/api/transport/httpClient.js
492
- var Ae = (e, t) => {
493
- let n = t || L().baseUrl;
511
+ var tt = (e, t) => {
512
+ let n = t || $e().baseUrl;
494
513
  if (!n) throw Error("Cresol : baseUrl non renseignée (configureCresol ou prop baseUrl)");
495
514
  return `${n}${e}`;
496
- }, je = (e = {}) => {
515
+ }, nt = (e = {}) => {
497
516
  let t = new URLSearchParams();
498
517
  Object.entries(e).forEach(([e, n]) => {
499
518
  n != null && n !== "" && t.append(e, typeof n == "object" ? JSON.stringify(n) : n);
500
519
  });
501
520
  let n = t.toString();
502
521
  return n ? `?${n}` : "";
503
- }, R = ({ method: e, path: t, params: n, data: r, signal: i, baseUrl: a }, o = {}) => ke({
504
- url: Ae(`${t}${je(n)}`, a),
522
+ }, rt = ({ method: e, path: t, params: n, data: r, signal: i, baseUrl: a }, o = {}) => et({
523
+ url: tt(`${t}${nt(n)}`, a),
505
524
  method: e,
506
525
  ...r === void 0 ? {} : { data: r },
507
526
  ...i ? { signal: i } : {}
508
- }, o), z = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) => R({
527
+ }, o), q = (e, { params: t, signal: n, overlay: r, baseUrl: i } = {}) => rt({
509
528
  method: "GET",
510
529
  path: e,
511
530
  params: t,
512
531
  signal: n,
513
532
  baseUrl: i
514
- }, r).then((e) => e.data), Me = (e, t, { params: n, signal: r, overlay: i, baseUrl: a } = {}) => R({
533
+ }, r).then((e) => e.data), it = (e, t, { params: n, signal: r, overlay: i, baseUrl: a } = {}) => rt({
515
534
  method: "POST",
516
535
  path: e,
517
536
  params: n,
518
537
  data: t,
519
538
  signal: r,
520
539
  baseUrl: a
521
- }, i).then((e) => e.data), Ne = { mustBeAuthenticated: !1 }, B = (e, { signal: t, baseUrl: n } = {}) => z(e, {
540
+ }, i).then((e) => e.data), at = { mustBeAuthenticated: !1 }, J = (e, { signal: t, baseUrl: n } = {}) => q(e, {
522
541
  signal: t,
523
542
  baseUrl: n,
524
- overlay: Ne
525
- }), Pe = (e) => B("/v2/sollicitation/motifs", e), Fe = (e) => B("/v2/sollicitation/categories", e), Ie = (e) => B("/v2/sollicitation/types", e), Le = (e) => B("/v2/sollicitation/natures", e), Re = (e) => B("/v2/sollicitation/etats", e), ze = ({ signal: e, baseUrl: t } = {}) => z("/collaborateurs", {
543
+ overlay: at
544
+ }), ot = (e) => J("/v2/sollicitation/motifs", e), st = (e) => J("/v2/sollicitation/categories", e), ct = (e) => J("/v2/sollicitation/types", e), lt = (e) => J("/v2/sollicitation/natures", e), ut = (e) => J("/v2/sollicitation/etats", e), dt = ({ signal: e, baseUrl: t } = {}) => q("/v2/sollicitation/provenances", {
545
+ params: { estDesactive: !1 },
546
+ signal: e,
547
+ baseUrl: t,
548
+ overlay: at
549
+ }), ft = ({ signal: e, baseUrl: t } = {}) => q("/collaborateurs", {
526
550
  params: { actif: !0 },
527
551
  signal: e,
528
552
  baseUrl: t
529
- }), Be = async ({ signal: e, baseUrl: t } = {}) => (await z("/v2/patrimoine/communes", {
553
+ }), pt = async ({ signal: e, baseUrl: t } = {}) => (await q("/v2/patrimoine/communes", {
530
554
  signal: e,
531
555
  baseUrl: t
532
556
  }) ?? []).map((e) => ({
533
557
  idCommune: e.id,
534
558
  commune: e.libelle
535
- })), Ve = (e, { signal: t, baseUrl: n } = {}) => z("/v2/patrimoine/entrees", {
559
+ })), mt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/entrees", {
536
560
  params: { idCommune: e },
537
561
  signal: t,
538
562
  baseUrl: n
539
- }), He = (e, { signal: t, baseUrl: n } = {}) => z("/v2/patrimoine/modules", {
563
+ }), ht = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/modules", {
540
564
  params: { codeProgramme: e },
541
565
  signal: t,
542
566
  baseUrl: n
543
- }), Ue = ({ idContrat: e, typeContrat: t }, { signal: n, baseUrl: r } = {}) => z("/v2/patrimoine/contrat_modules", {
567
+ }), gt = ({ idContrat: e, typeContrat: t }, { signal: n, baseUrl: r } = {}) => q("/v2/patrimoine/contrat_modules", {
544
568
  params: {
545
569
  idContrat: e,
546
570
  typeContrat: t
547
571
  },
548
572
  signal: n,
549
573
  baseUrl: r
550
- }), We = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, baseUrl: a } = {}) => z("/v2/sollicitation/responsables", {
574
+ }), _t = ({ motif: e, categorie: t, type: n, nature: r }, { signal: i, baseUrl: a } = {}) => q("/v2/sollicitation/responsables", {
551
575
  params: {
552
576
  motif: e,
553
577
  categorie: t,
@@ -556,11 +580,11 @@ var Ae = (e, t) => {
556
580
  },
557
581
  signal: i,
558
582
  baseUrl: a
559
- }), Ge = (e, { signal: t, baseUrl: n } = {}) => z("/v2/patrimoine/contrat_module_rechercher", {
583
+ }), vt = (e, { signal: t, baseUrl: n } = {}) => q("/v2/patrimoine/contrat_module_rechercher", {
560
584
  params: { recherche: e },
561
585
  signal: t,
562
586
  baseUrl: n
563
- }), Ke = ({ categorie: e, recherche: t }, { signal: n, baseUrl: r } = {}) => z("/v2/cresol/reclamant_rechercher", {
587
+ }), yt = ({ categorie: e, recherche: t }, { signal: n, baseUrl: r } = {}) => q("/v2/cresol/reclamant_rechercher", {
564
588
  params: {
565
589
  categorie: e,
566
590
  recherche: t
@@ -570,86 +594,88 @@ var Ae = (e, t) => {
570
594
  });
571
595
  //#endregion
572
596
  //#region src/utils/apiError.js
573
- function V(e) {
597
+ function bt(e) {
574
598
  let t = e?.response?.data;
575
599
  return t?.error ? t.error : t?.errorList ? t.errorList.map((e) => e.message).join(", ") : e?.response?.status === 500 ? "Erreur interne" : e?.response?.status === 401 ? "Non autorisé à faire cette action" : "Erreur";
576
600
  }
577
- var qe = (e) => e?.name === "AbortError" || e?.name === "CanceledError", Je = Symbol("cresol:data"), Ye = () => ({
601
+ var xt = (e) => e?.name === "AbortError" || e?.name === "CanceledError", St = Symbol("cresol:data"), Ct = () => ({
578
602
  motifs: null,
579
603
  categories: null,
580
604
  types: null,
581
605
  natures: null,
582
606
  etats: null,
607
+ provenances: null,
583
608
  collaborateurs: null,
584
609
  communes: null,
585
610
  adressesByCommune: {},
586
611
  modulesByProgramme: {},
587
612
  modulesByContrat: {},
588
613
  responsablesByMotif: {}
589
- }), H = /* @__PURE__ */ new Map(), Xe = (e) => (H.has(e) || H.set(e, v(Ye())), H.get(e)), U = /* @__PURE__ */ new Map();
590
- function Ze() {
591
- H.clear(), U.clear();
614
+ }), wt = /* @__PURE__ */ new Map(), Tt = (e) => (wt.has(e) || wt.set(e, A(Ct())), wt.get(e)), Y = /* @__PURE__ */ new Map();
615
+ function Et() {
616
+ wt.clear(), Y.clear();
592
617
  }
593
- var W = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n, G = (e, t, n) => e?.find((e) => e[t] === n)?.icon ?? null;
594
- function Qe({ onError: e, baseUrl: t } = {}) {
595
- let n = y(0), i = () => ({ baseUrl: T(t) || null }), a = () => T(t) || L().baseUrl || "", o = () => Xe(a()), s = (t, r) => {
596
- let i = `${a()}|${t}`;
597
- if (U.has(i)) return U.get(i);
618
+ var X = (e, t, n) => e?.find((e) => e[t] === n)?.libelle ?? n, Dt = (e, t, n) => e?.find((e) => e[t] === n)?.icon ?? null;
619
+ function Ot({ onError: e, baseUrl: t } = {}) {
620
+ let n = j(0), r = () => ({ baseUrl: L(t) || null }), i = () => L(t) || $e().baseUrl || "", a = () => Tt(i()), o = (t, r) => {
621
+ let a = `${i()}|${t}`;
622
+ if (Y.has(a)) return Y.get(a);
598
623
  n.value += 1;
599
- let o = Promise.resolve().then(r).catch((t) => (qe(t) || e?.(V(t)), null)).finally(() => {
600
- --n.value, U.delete(i);
624
+ let o = Promise.resolve().then(r).catch((t) => (xt(t) || e?.(bt(t)), null)).finally(() => {
625
+ --n.value, Y.delete(a);
601
626
  });
602
- return U.set(i, o), o;
603
- }, c = (e, t) => o()[e]?.length ? Promise.resolve(o()[e]) : s(`referentiel:${e}`, async () => (o()[e] = await t(i()), o()[e])), l = {
627
+ return Y.set(a, o), o;
628
+ }, s = (e, t) => a()[e]?.length ? Promise.resolve(a()[e]) : o(`referentiel:${e}`, async () => (a()[e] = await t(r()), a()[e])), c = {
604
629
  get cache() {
605
- return o();
630
+ return a();
606
631
  },
607
632
  loading: n,
608
- isLoading: r(() => n.value > 0),
633
+ isLoading: v(() => n.value > 0),
609
634
  loadNomenclature() {
610
635
  return Promise.all([
611
- c("motifs", Pe),
612
- c("categories", Fe),
613
- c("types", Ie),
614
- c("natures", Le),
615
- c("etats", Re)
636
+ s("motifs", ot),
637
+ s("categories", st),
638
+ s("types", ct),
639
+ s("natures", lt),
640
+ s("etats", ut)
616
641
  ]);
617
642
  },
618
- loadCollaborateurs: () => c("collaborateurs", ze),
643
+ loadCollaborateurs: () => s("collaborateurs", ft),
644
+ loadProvenances: () => s("provenances", dt),
619
645
  loadCommunes() {
620
- return o().communes?.length ? Promise.resolve(o().communes) : s("communes", async () => (o().communes = await Be(i()), o().communes));
646
+ return a().communes?.length ? Promise.resolve(a().communes) : o("communes", async () => (a().communes = await pt(r()), a().communes));
621
647
  },
622
648
  loadAdresses(e) {
623
- return e == null ? Promise.resolve([]) : o().adressesByCommune[e] ? Promise.resolve(o().adressesByCommune[e]) : s(`adresses:${e}`, async () => {
624
- let t = await Ve(e, i());
625
- return o().adressesByCommune[e] = t ?? [], t;
649
+ return e == null ? Promise.resolve([]) : a().adressesByCommune[e] ? Promise.resolve(a().adressesByCommune[e]) : o(`adresses:${e}`, async () => {
650
+ let t = await mt(e, r());
651
+ return a().adressesByCommune[e] = t ?? [], t;
626
652
  });
627
653
  },
628
654
  loadModulesOfProgramme(e) {
629
- return e == null ? Promise.resolve([]) : o().modulesByProgramme[e] ? Promise.resolve(o().modulesByProgramme[e]) : s(`modules:${e}`, async () => {
630
- let t = await He(e, i());
631
- return o().modulesByProgramme[e] = t ?? [], t;
655
+ return e == null ? Promise.resolve([]) : a().modulesByProgramme[e] ? Promise.resolve(a().modulesByProgramme[e]) : o(`modules:${e}`, async () => {
656
+ let t = await ht(e, r());
657
+ return a().modulesByProgramme[e] = t ?? [], t;
632
658
  });
633
659
  },
634
660
  loadModulesOfContrat({ idContrat: e, typeContrat: t }) {
635
661
  if (e == null) return Promise.resolve([]);
636
662
  let n = `${t ?? ""}|${e}`;
637
- return o().modulesByContrat[n] ? Promise.resolve(o().modulesByContrat[n]) : s(`contratModules:${n}`, async () => {
638
- let r = await Ue({
663
+ return a().modulesByContrat[n] ? Promise.resolve(a().modulesByContrat[n]) : o(`contratModules:${n}`, async () => {
664
+ let i = await gt({
639
665
  idContrat: e,
640
666
  typeContrat: t
641
- }, i());
642
- return o().modulesByContrat[n] = r ?? [], r;
667
+ }, r());
668
+ return a().modulesByContrat[n] = i ?? [], i;
643
669
  });
644
670
  },
645
671
  async searchContrats(e, { signal: t } = {}) {
646
672
  let n = (e ?? "").trim();
647
673
  if (!n) return [];
648
- let r = await Ge(n, {
649
- ...i(),
674
+ let i = await vt(n, {
675
+ ...r(),
650
676
  signal: t
651
677
  }), a = /* @__PURE__ */ new Map();
652
- for (let e of r ?? []) {
678
+ for (let e of i ?? []) {
653
679
  let t = `${e.typeContrat}|${e.idContrat}`;
654
680
  (!a.has(t) || e.estModulePrincipal) && a.set(t, {
655
681
  typeContrat: e.typeContrat,
@@ -658,19 +684,20 @@ function Qe({ onError: e, baseUrl: t } = {}) {
658
684
  adresse: e.adresse ?? null,
659
685
  commune: e.commune ?? null,
660
686
  estSorti: !!e.estContratSorti,
687
+ dateSortie: e.dateSortieContrat ?? null,
661
688
  nbModules: e.nbModulesContrat ?? 1
662
689
  });
663
690
  }
664
691
  return [...a.values()].sort((e, t) => Number(e.estSorti) - Number(t.estSorti) || (e.libelle ?? "").localeCompare(t.libelle ?? ""));
665
692
  },
666
693
  async searchReclamants(e, t, { signal: n } = {}) {
667
- let r = (t ?? "").trim();
668
- if (!r) return [];
669
- let a = await Ke({
694
+ let i = (t ?? "").trim();
695
+ if (!i) return [];
696
+ let a = await yt({
670
697
  categorie: e,
671
- recherche: r
698
+ recherche: i
672
699
  }, {
673
- ...i(),
700
+ ...r(),
674
701
  signal: n
675
702
  }), o = /* @__PURE__ */ new Map();
676
703
  for (let t of a ?? []) {
@@ -700,25 +727,25 @@ function Qe({ onError: e, baseUrl: t } = {}) {
700
727
  };
701
728
  });
702
729
  },
703
- loadResponsables({ motif: e, categorie: t, type: n, nature: r }) {
704
- return e == null ? Promise.resolve([]) : o().responsablesByMotif[e] ? Promise.resolve(o().responsablesByMotif[e]) : s(`responsables:${e}`, async () => {
705
- let a = await We({
730
+ loadResponsables({ motif: e, categorie: t, type: n, nature: i }) {
731
+ return e == null ? Promise.resolve([]) : a().responsablesByMotif[e] ? Promise.resolve(a().responsablesByMotif[e]) : o(`responsables:${e}`, async () => {
732
+ let o = await _t({
706
733
  motif: e,
707
734
  categorie: t,
708
735
  type: n,
709
- nature: r
710
- }, i());
711
- return o().responsablesByMotif[e] = a ?? [], a;
736
+ nature: i
737
+ }, r());
738
+ return a().responsablesByMotif[e] = o ?? [], o;
712
739
  });
713
740
  },
714
- adressesOfCommune: (e) => o().adressesByCommune[e] ?? null,
715
- modulesOfProgramme: (e) => o().modulesByProgramme[e] ?? null,
716
- modulesOfContrat: ({ idContrat: e, typeContrat: t }) => o().modulesByContrat[`${t ?? ""}|${e}`] ?? null,
717
- allAdresses: () => Object.values(o().adressesByCommune).flat(),
741
+ adressesOfCommune: (e) => a().adressesByCommune[e] ?? null,
742
+ modulesOfProgramme: (e) => a().modulesByProgramme[e] ?? null,
743
+ modulesOfContrat: ({ idContrat: e, typeContrat: t }) => a().modulesByContrat[`${t ?? ""}|${e}`] ?? null,
744
+ allAdresses: () => Object.values(a().adressesByCommune).flat(),
718
745
  getResponsableSuggere({ idMotif: e, codeProgramme: t, codeTranche: n, codeBatiment: r, codeEscalier: i }) {
719
- let a = o().responsablesByMotif[e];
720
- if (!a?.length || t == null) return null;
721
- let s = a.filter((e) => String(e.codeProgramme) === String(t) && (e.codeTranche == null || e.codeTranche === n) && (e.codeBatiment == null || e.codeBatiment === r) && (e.codeEscalier == null || e.codeEscalier === i));
746
+ let o = a().responsablesByMotif[e];
747
+ if (!o?.length || t == null) return null;
748
+ let s = o.filter((e) => String(e.codeProgramme) === String(t) && (e.codeTranche == null || e.codeTranche === n) && (e.codeBatiment == null || e.codeBatiment === r) && (e.codeEscalier == null || e.codeEscalier === i));
722
749
  if (!s.length) return null;
723
750
  let c = (e) => (e.codeEscalier == null ? 0 : 4) + (e.codeBatiment == null ? 0 : 2) + (e.codeTranche == null ? 0 : 1), l = s.reduce((e, t) => c(t) > c(e) ? t : e);
724
751
  return {
@@ -726,54 +753,89 @@ function Qe({ onError: e, baseUrl: t } = {}) {
726
753
  libelle: l.libelleResponsable
727
754
  };
728
755
  },
729
- motifLibelle: (e) => W(o().motifs, "id", e),
730
- categorieLibelle: (e) => W(o().categories, "id", e),
731
- typeLibelle: (e) => W(o().types, "id", e),
732
- natureLibelle: (e) => W(o().natures, "id", e),
733
- etatLibelle: (e) => W(o().etats, "code", e),
734
- motifIcon: (e) => G(o().motifs, "id", e),
735
- categorieIcon: (e) => G(o().categories, "id", e),
736
- typeIcon: (e) => G(o().types, "id", e),
737
- natureIcon: (e) => G(o().natures, "id", e)
756
+ motifLibelle: (e) => X(a().motifs, "id", e),
757
+ categorieLibelle: (e) => X(a().categories, "id", e),
758
+ typeLibelle: (e) => X(a().types, "id", e),
759
+ natureLibelle: (e) => X(a().natures, "id", e),
760
+ etatLibelle: (e) => X(a().etats, "code", e),
761
+ motifIcon: (e) => Dt(a().motifs, "id", e),
762
+ categorieIcon: (e) => Dt(a().categories, "id", e),
763
+ typeIcon: (e) => Dt(a().types, "id", e),
764
+ natureIcon: (e) => Dt(a().natures, "id", e)
738
765
  };
739
- return v(l);
766
+ return A(c);
740
767
  }
741
- function $e(e) {
742
- return _(Je, e), e;
768
+ function kt(e) {
769
+ return pe(St, e), e;
743
770
  }
744
- function K() {
745
- let e = f(Je, null);
771
+ function Z() {
772
+ let e = de(St, null);
746
773
  if (!e) throw Error("useCresolData() hors de <creer-sollicitation-form>");
747
774
  return e;
748
775
  }
749
776
  //#endregion
750
777
  //#region src/utils/fontAwesomeIcons.js
751
- var et = (e) => "fa" + e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
752
- async function tt(e) {
753
- let t = await import("@fortawesome/free-solid-svg-icons");
754
- [...new Set(e.filter(Boolean))].forEach((e) => {
755
- let n = t[et(e)];
756
- n && ae.add(n);
778
+ var At = (e) => "fa" + e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
779
+ async function jt(t) {
780
+ let n = await import("@fortawesome/free-solid-svg-icons");
781
+ [...new Set(t.filter(Boolean))].forEach((t) => {
782
+ let r = n[At(t)];
783
+ r && e.add(r);
757
784
  });
758
785
  }
759
786
  //#endregion
760
787
  //#region src/utils/date.js
761
- function nt(e) {
788
+ function Mt(e) {
762
789
  return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toISOString().slice(0, 10);
763
790
  }
764
- function rt(e) {
791
+ function Nt(e) {
765
792
  return e ? Math.floor(new Date(e).getTime() / 1e3) : null;
766
793
  }
767
- function it(e) {
794
+ function Pt(e) {
768
795
  return e == null ? "" : (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("fr-FR");
769
796
  }
770
797
  //#endregion
771
- //#region src/components/ReclamantRechercheBlock.vue
772
- var q = [
798
+ //#region src/composables/useCresolContext.js
799
+ var Ft = Symbol("cresol:options"), It = (e) => pe(Ft, e), Q = () => de(Ft, {}), Lt = j(!1);
800
+ jt(Object.values(H).map((e) => e.icon)).then(() => {
801
+ Lt.value = !0;
802
+ });
803
+ var Rt = {
804
+ name: "ReclamantTypeBadgeComponent",
805
+ props: {
806
+ reclamant: {
807
+ type: Object,
808
+ default: null
809
+ },
810
+ iconOnly: {
811
+ type: Boolean,
812
+ default: !1
813
+ }
814
+ },
815
+ setup() {
816
+ return { iconsReady: Lt };
817
+ },
818
+ computed: { type() {
819
+ return Ae(this.reclamant);
820
+ } }
821
+ }, zt = ["title"], Bt = { key: 1 };
822
+ function Vt(e, t, n, r, i, a) {
823
+ let o = P("font-awesome-icon");
824
+ return a.type ? (k(), x("span", {
825
+ key: 0,
826
+ class: D(["badge d-inline-flex align-items-center gap-1 border flex-shrink-0", `bg-${a.type.couleur}-subtle text-${a.type.couleur}-emphasis border-${a.type.couleur}-subtle`]),
827
+ title: a.type.libelle
828
+ }, [r.iconsReady ? (k(), y(o, {
829
+ key: 0,
830
+ icon: a.type.icon,
831
+ "fixed-width": ""
832
+ }, null, 8, ["icon"])) : b("", !0), n.iconOnly ? b("", !0) : (k(), x("span", Bt, F(a.type.libelle), 1))], 10, zt)) : b("", !0);
833
+ }
834
+ var Ht = /*#__PURE__*/ K(Rt, [["render", Vt]]), Ut = [
773
835
  {
774
836
  key: "locataire",
775
837
  label: "Locataire",
776
- icon: "house-user",
838
+ icon: H.locataire.icon,
777
839
  recherche: "Rechercher un locataire",
778
840
  aucun: "Aucun locataire trouvé.",
779
841
  placeholder: "Nom, prénom, n° de contrat ou de module, adresse, téléphone ou mail…"
@@ -781,7 +843,7 @@ var q = [
781
843
  {
782
844
  key: "demandeur",
783
845
  label: "Demandeur",
784
- icon: "hourglass-half",
846
+ icon: H.demandeur.icon,
785
847
  recherche: "Rechercher un demandeur",
786
848
  aucun: "Aucun demandeur trouvé.",
787
849
  placeholder: "Nom, prénom, n° de demande ou unique, téléphone ou mail…"
@@ -789,7 +851,7 @@ var q = [
789
851
  {
790
852
  key: "tiers",
791
853
  label: "Tiers",
792
- icon: "user-tie",
854
+ icon: H.tiers.icon,
793
855
  recherche: "Rechercher un tiers",
794
856
  aucun: "Aucun tiers trouvé.",
795
857
  placeholder: "Raison sociale, adresse, téléphone ou mail…"
@@ -797,11 +859,27 @@ var q = [
797
859
  {
798
860
  key: "autre",
799
861
  label: "Autre",
800
- icon: "user",
862
+ icon: H.autre.icon,
801
863
  recherche: "Rechercher un individu « Autre »",
802
864
  aucun: "Aucun individu « Autre » trouvé.",
803
865
  placeholder: "Nom, prénom, adresse, téléphone ou mail…"
804
866
  },
867
+ {
868
+ key: "fournisseur",
869
+ label: "Fournisseur",
870
+ icon: H.fournisseur.icon,
871
+ recherche: "Rechercher un fournisseur",
872
+ aucun: "Aucun fournisseur trouvé.",
873
+ placeholder: "Raison sociale, adresse, téléphone ou mail…"
874
+ },
875
+ {
876
+ key: "personnel",
877
+ label: "Personnel",
878
+ icon: H.personnel.icon,
879
+ recherche: "Rechercher un collaborateur",
880
+ aucun: "Aucun collaborateur trouvé.",
881
+ placeholder: "Nom, prénom, téléphone ou mail…"
882
+ },
805
883
  {
806
884
  key: "tout",
807
885
  label: "Tout",
@@ -810,45 +888,51 @@ var q = [
810
888
  aucun: "Aucun réclamant trouvé.",
811
889
  placeholder: "Nom, prénom, n° de contrat, de module ou de demande, adresse, téléphone ou mail…"
812
890
  }
813
- ], at = {
891
+ ], Wt = {
814
892
  signataire: "Signataire",
815
893
  occupant: "Occupant",
816
894
  demandeur: "Demandeur"
817
- }, J = (e) => e ? e.categorie ? e.categorie : {
818
- D: "demandeur",
819
- T: "tiers",
820
- U: "autre"
821
- }[e.type] ?? "locataire" : null, ot = {
895
+ }, Gt = {
822
896
  name: "ReclamantRechercheBlock",
823
- components: { AmsomAutocomplete: O },
897
+ components: {
898
+ AmsomAutocomplete: z,
899
+ ReclamantTypeBadgeComponent: Ht
900
+ },
824
901
  setup() {
825
902
  return {
826
- draft: P(),
827
- data: K()
903
+ draft: G(),
904
+ data: Z(),
905
+ options: Q()
828
906
  };
829
907
  },
830
908
  data() {
831
909
  return {
832
910
  iconsReady: !1,
833
- categorie: J(this.draft.reclamantSelectionne) ?? "locataire",
911
+ categorie: null,
834
912
  trouves: [],
835
913
  rechercheEnCours: !1,
836
914
  rechercheFaite: !1
837
915
  };
838
916
  },
839
917
  computed: {
918
+ typesAutorises() {
919
+ return this.options.typesReclamant ?? U;
920
+ },
921
+ autorisees() {
922
+ return Oe(this.typesAutorises);
923
+ },
840
924
  categories() {
841
- return q;
925
+ return Ut.filter((e) => e.key === "tout" ? this.autorisees.length > 1 : this.autorisees.includes(e.key));
842
926
  },
843
927
  categorieCourante() {
844
- return q.find((e) => e.key === this.categorie);
928
+ return Ut.find((e) => e.key === this.categorie);
845
929
  },
846
930
  selectionne() {
847
931
  return this.draft.reclamantSelectionne;
848
932
  },
849
933
  selectedTrouve: {
850
934
  get() {
851
- return this.categorie === "tout" || J(this.selectionne) === this.categorie ? this.selectionne : null;
935
+ return this.categorie === "tout" || this.categorieOf(this.selectionne) === this.categorie ? this.selectionne : null;
852
936
  },
853
937
  set(e) {
854
938
  this.select(e);
@@ -856,14 +940,14 @@ var q = [
856
940
  }
857
941
  },
858
942
  async created() {
859
- await tt(q.map((e) => e.icon)), this.iconsReady = !0;
943
+ this.categorie = this.categorieOf(this.selectionne) ?? this.categories[0]?.key ?? null, await jt(Ut.map((e) => e.icon)), this.iconsReady = !0;
860
944
  },
861
945
  beforeUnmount() {
862
946
  clearTimeout(this.rechercheTimeout), this.controller?.abort();
863
947
  },
864
948
  methods: {
865
949
  select(e) {
866
- e && (this.draft.selectReclamant(e), this.categorie !== "tout" && (this.categorie = J(e)));
950
+ e && (this.draft.selectReclamant(e), this.categorie !== "tout" && (this.categorie = this.categorieOf(e) ?? this.categorie));
867
951
  },
868
952
  setCategorie(e) {
869
953
  e !== this.categorie && (this.categorie = e, clearTimeout(this.rechercheTimeout), this.controller?.abort(), this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1);
@@ -873,8 +957,8 @@ var q = [
873
957
  },
874
958
  rechercher(e) {
875
959
  let t = (e ?? "").trim();
876
- t.length < 2 ? (this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1) : (this.controller?.abort(), this.controller = new AbortController(), this.rechercheEnCours = !0, this.data.searchReclamants(this.categorie, t, { signal: this.controller.signal }).then((e) => {
877
- this.trouves = e ?? [], this.rechercheFaite = !0, this.rechercheEnCours = !1;
960
+ t.length < 2 ? (this.trouves = [], this.rechercheEnCours = !1, this.rechercheFaite = !1) : (this.controller?.abort(), this.controller = new AbortController(), this.rechercheEnCours = !0, this.data.searchReclamants(this.categorie === "tout" ? this.autorisees.join(",") : this.categorie, t, { signal: this.controller.signal }).then((e) => {
961
+ this.trouves = (e ?? []).filter((e) => this.typesAutorises.includes(e.type)), this.rechercheFaite = !0, this.rechercheEnCours = !1;
878
962
  }).catch(() => {
879
963
  this.rechercheEnCours = !1;
880
964
  }));
@@ -882,82 +966,90 @@ var q = [
882
966
  cleReclamant(e) {
883
967
  return e ? `${e.type}|${e.id}` : null;
884
968
  },
885
- categorieOf: J,
886
- sortiLibelle(e) {
887
- return e?.dateSortie == null ? "sorti" : `sorti le ${it(e.dateSortie)}`;
969
+ categorieOf(e) {
970
+ let t = ke(e);
971
+ return this.autorisees.includes(t) ? t : null;
888
972
  },
889
- iconOf(e) {
890
- return q.find((t) => t.key === J(e))?.icon ?? "user";
973
+ sortiLibelle(e) {
974
+ return e?.dateSortie == null ? "sorti" : `sorti le ${Pt(e.dateSortie)}`;
891
975
  },
892
976
  nomsOf(e) {
893
977
  return (e?.individus ?? []).map((e) => [e.nom, e.prenom].filter(Boolean).join(" ")).filter(Boolean).join(", ");
894
978
  },
895
979
  titreOf(e) {
896
980
  if (!e?.individus) return e?.libelle ?? "";
897
- let t = J(e);
981
+ let t = this.categorieOf(e);
898
982
  return t === "locataire" ? e.libelleReclamant || this.nomsOf(e) : t === "demandeur" ? this.nomsOf(e) : e.libelleReclamant;
899
983
  },
900
984
  referenceOf(e) {
901
985
  if (!e?.individus) return "";
902
- let t = J(e);
903
- return t === "locataire" ? [`Contrat ${e.type}/${e.id}`, e.idModule && `Module ${e.idModule}`].filter(Boolean).join(" — ") : t === "demandeur" ? e.libelleReclamant : t === "autre" ? "Individu « Autre »" : "Tiers";
986
+ let t = this.categorieOf(e);
987
+ return t === "locataire" ? [`Contrat ${e.type}/${e.id}`, e.idModule && `Module ${e.idModule}`].filter(Boolean).join(" — ") : t === "demandeur" ? e.libelleReclamant : t === "autre" ? "Individu « Autre »" : Ae(e).libelle;
904
988
  },
905
989
  detailOf(e) {
906
990
  let t = e?.individus ?? [];
907
- if (["tiers", "autre"].includes(J(e))) {
991
+ if (!["locataire", "demandeur"].includes(ke(e))) {
908
992
  let e = t[0];
909
993
  return e ? [e.telephone, e.mail].filter(Boolean).join(" — ") : "";
910
994
  }
911
995
  return t.map((t) => {
912
- let n = [t.nom, t.prenom].filter(Boolean).join(" "), r = e.estActif && t.dateSortie != null && t.dateSortie * 1e3 < Date.now() ? `sorti le ${it(t.dateSortie)}` : null, i = [at[t.role]?.toLowerCase(), r].filter(Boolean).join(", ");
996
+ let n = [t.nom, t.prenom].filter(Boolean).join(" "), r = e.estActif && t.dateSortie != null && t.dateSortie * 1e3 < Date.now() ? `sorti le ${Pt(t.dateSortie)}` : null, i = [Wt[t.role]?.toLowerCase(), r].filter(Boolean).join(", ");
913
997
  return i ? `${n} (${i})` : n;
914
998
  }).join(", ");
915
999
  }
916
1000
  }
917
- }, st = {
1001
+ }, Kt = {
918
1002
  key: 0,
919
1003
  class: "d-flex flex-column gap-3"
920
- }, ct = { class: "d-flex flex-wrap gap-2" }, lt = ["onClick"], ut = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, dt = { class: "min-w-0" }, ft = {
1004
+ }, qt = { class: "d-flex flex-wrap gap-2" }, Jt = ["onClick"], Yt = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, Xt = { class: "min-w-0" }, Zt = {
921
1005
  key: 0,
922
1006
  class: "badge bg-warning-subtle text-warning-emphasis ms-1"
923
- }, pt = { class: "text-muted d-block text-truncate" }, mt = { key: 0 }, ht = {
1007
+ }, Qt = { class: "text-muted d-block text-truncate" }, $t = { key: 0 }, en = {
924
1008
  key: 0,
925
1009
  class: "text-muted d-block text-truncate"
926
- }, gt = {
1010
+ }, tn = {
927
1011
  key: 0,
928
1012
  class: "text-muted"
929
1013
  };
930
- function _t(e, t, r, c, d, f) {
931
- let p = S("font-awesome-icon"), h = S("amsom-autocomplete");
932
- return d.iconsReady ? (g(), o("div", st, [s("div", null, [t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le réclamant est… ", -1), s("div", ct, [(g(!0), o(n, null, b(f.categories, (e) => (g(), o("button", {
1014
+ function nn(e, t, n, r, i, a) {
1015
+ let o = P("font-awesome-icon"), s = P("reclamant-type-badge-component"), c = P("amsom-autocomplete");
1016
+ return i.iconsReady ? (k(), x("div", Kt, [S("div", null, [t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le réclamant est… ", -1), S("div", qt, [(k(!0), x(_, null, M(a.categories, (e) => (k(), x("button", {
933
1017
  key: e.key,
934
1018
  type: "button",
935
- class: m(["btn btn-sm d-inline-flex align-items-center gap-2", d.categorie === e.key ? "btn-primary" : "btn-outline-primary"]),
936
- onClick: (t) => f.setCategorie(e.key)
937
- }, [u(p, {
1019
+ class: D(["btn btn-sm d-inline-flex align-items-center gap-2", i.categorie === e.key ? "btn-primary" : "btn-outline-primary"]),
1020
+ onClick: (t) => a.setCategorie(e.key)
1021
+ }, [T(o, {
938
1022
  icon: e.icon,
939
1023
  "fixed-width": ""
940
- }, null, 8, ["icon"]), s("span", null, C(e.label), 1)], 10, lt))), 128))])]), s("div", null, [
941
- s("label", ut, C(f.categorieCourante.recherche), 1),
942
- (g(), i(h, {
943
- key: d.categorie,
944
- modelValue: f.selectedTrouve,
945
- "onUpdate:modelValue": t[0] ||= (e) => f.selectedTrouve = e,
946
- items: d.trouves,
1024
+ }, null, 8, ["icon"]), S("span", null, F(e.label), 1)], 10, Jt))), 128))])]), S("div", null, [
1025
+ S("label", Yt, F(a.categorieCourante.recherche), 1),
1026
+ (k(), y(c, {
1027
+ key: i.categorie,
1028
+ modelValue: a.selectedTrouve,
1029
+ "onUpdate:modelValue": t[0] ||= (e) => a.selectedTrouve = e,
1030
+ items: i.trouves,
947
1031
  "filtering-function": ({ items: e }) => e,
948
- loading: d.rechercheEnCours,
949
- "get-id": f.cleReclamant,
1032
+ loading: i.rechercheEnCours,
1033
+ "get-id": a.cleReclamant,
950
1034
  "get-input-libelle": (e) => e?.libelle ?? "",
951
- placeholder: f.categorieCourante.placeholder,
1035
+ placeholder: a.categorieCourante.placeholder,
952
1036
  "input-size": "sm",
953
1037
  "hide-choices": "",
954
1038
  "debounce-delay": 0,
955
- onSearch: f.rechercherPlusTard
1039
+ onSearch: a.rechercherPlusTard
956
1040
  }, {
957
- options: D((e) => [s("div", dt, [
958
- s("div", { class: m(["fw-medium text-truncate", e?.estActif ? "" : "text-muted"]) }, [l(C(f.titreOf(e)) + " ", 1), e?.estActif ? a("", !0) : (g(), o("span", ft, C(f.categorieOf(e) === "demandeur" ? "inactive" : f.sortiLibelle(e)), 1))], 2),
959
- s("small", pt, [l(C(f.referenceOf(e)) + " ", 1), e?.adresse ? (g(), o("span", mt, " — " + C(e.adresse), 1)) : a("", !0)]),
960
- f.detailOf(e) ? (g(), o("small", ht, C(f.detailOf(e)), 1)) : a("", !0)
1041
+ options: R((e) => [S("div", Xt, [
1042
+ S("div", { class: D(["fw-medium text-truncate", e?.estActif ? "" : "text-muted"]) }, [
1043
+ T(s, {
1044
+ reclamant: e,
1045
+ "icon-only": "",
1046
+ class: "me-1"
1047
+ }, null, 8, ["reclamant"]),
1048
+ w(" " + F(a.titreOf(e)) + " ", 1),
1049
+ e?.estActif ? b("", !0) : (k(), x("span", Zt, F(a.categorieOf(e) === "demandeur" ? "inactive" : a.sortiLibelle(e)), 1))
1050
+ ], 2),
1051
+ S("small", Qt, [w(F(a.referenceOf(e)) + " ", 1), e?.adresse ? (k(), x("span", $t, " — " + F(e.adresse), 1)) : b("", !0)]),
1052
+ a.detailOf(e) ? (k(), x("small", en, F(a.detailOf(e)), 1)) : b("", !0)
961
1053
  ])]),
962
1054
  _: 1
963
1055
  }, 8, [
@@ -970,89 +1062,110 @@ function _t(e, t, r, c, d, f) {
970
1062
  "placeholder",
971
1063
  "onSearch"
972
1064
  ])),
973
- d.rechercheFaite && !d.rechercheEnCours && !d.trouves.length ? (g(), o("small", gt, C(f.categorieCourante.aucun), 1)) : a("", !0)
974
- ])])) : a("", !0);
1065
+ i.rechercheFaite && !i.rechercheEnCours && !i.trouves.length ? (k(), x("small", tn, F(a.categorieCourante.aucun), 1)) : b("", !0)
1066
+ ])])) : b("", !0);
975
1067
  }
976
- var vt = /*#__PURE__*/ F(ot, [["render", _t]]), yt = {
1068
+ var rn = /*#__PURE__*/ K(Gt, [["render", nn]]), an = {
977
1069
  name: "ProvenanceSelecteurBlock",
978
1070
  setup() {
979
- return { draft: P() };
1071
+ return {
1072
+ draft: G(),
1073
+ data: Z(),
1074
+ options: Q()
1075
+ };
1076
+ },
1077
+ data() {
1078
+ return { iconsReady: !1 };
980
1079
  },
981
1080
  computed: {
982
1081
  provenances() {
983
- return ce;
1082
+ return this.options.provenances;
1083
+ },
1084
+ loaded() {
1085
+ return this.data.cache.provenances != null;
984
1086
  },
985
1087
  selected() {
986
1088
  return this.draft.draft.provenance;
987
1089
  },
1090
+ libelleFige() {
1091
+ return this.data.cache.provenances?.find((e) => e.id === this.selected)?.libelle ?? this.selected ?? "—";
1092
+ },
988
1093
  provenanceChoisie() {
989
1094
  return this.provenances.find((e) => e.id === this.selected) ?? null;
990
1095
  }
991
- }
992
- }, bt = {
1096
+ },
1097
+ async created() {
1098
+ await jt([...Object.values(V), Se]), this.iconsReady = !0;
1099
+ },
1100
+ methods: { iconOf: Ce }
1101
+ }, on = {
993
1102
  key: 0,
994
1103
  class: "fs-7 text-muted"
995
- }, xt = { class: "fw-medium" }, St = { key: 1 }, Ct = { class: "d-flex flex-wrap gap-2" }, wt = ["onClick"], Tt = {
1104
+ }, sn = { class: "fw-medium" }, cn = { key: 1 }, ln = { class: "d-flex flex-wrap gap-2" }, un = ["onClick"], dn = {
996
1105
  key: 0,
997
1106
  class: "fs-7 text-danger mt-1"
998
1107
  };
999
- function Et(e, t, r, c, d, f) {
1000
- let p = S("font-awesome-icon");
1001
- return c.draft.isReadonly("provenance") ? (g(), o("div", bt, [t[0] ||= l(" Provenance du contact : ", -1), s("span", xt, [f.provenanceChoisie?.icon ? (g(), i(p, {
1108
+ function fn(e, t, n, r, i, a) {
1109
+ let o = P("font-awesome-icon");
1110
+ return r.draft.isReadonly("provenance") ? (k(), x("div", on, [t[0] ||= w(" Provenance du contact : ", -1), S("span", sn, [i.iconsReady && a.selected ? (k(), y(o, {
1002
1111
  key: 0,
1003
- icon: f.provenanceChoisie.icon,
1112
+ icon: a.iconOf(a.selected),
1004
1113
  "fixed-width": ""
1005
- }, null, 8, ["icon"])) : a("", !0), l(" " + C(f.provenanceChoisie?.libelle ?? "—"), 1)])])) : (g(), o("div", St, [
1006
- t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, [l(" Provenance du contact "), s("span", { class: "text-danger" }, "*")], -1),
1007
- s("div", Ct, [(g(!0), o(n, null, b(f.provenances, (e) => (g(), o("button", {
1114
+ }, null, 8, ["icon"])) : b("", !0), w(" " + F(a.libelleFige), 1)])])) : (k(), x("div", cn, [
1115
+ t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, [w(" Provenance du contact "), S("span", { class: "text-danger" }, "*")], -1),
1116
+ S("div", ln, [(k(!0), x(_, null, M(a.provenances, (e) => (k(), x("button", {
1008
1117
  key: e.id,
1009
1118
  type: "button",
1010
- class: m(["btn btn-sm d-inline-flex align-items-center gap-2", e.id === f.selected ? "btn-primary" : "btn-outline-primary"]),
1011
- onClick: (t) => c.draft.setProvenance(e.id)
1012
- }, [u(p, {
1119
+ class: D(["btn btn-sm d-inline-flex align-items-center gap-2", e.id === a.selected ? "btn-primary" : "btn-outline-primary"]),
1120
+ onClick: (t) => r.draft.setProvenance(e.id)
1121
+ }, [i.iconsReady ? (k(), y(o, {
1122
+ key: 0,
1013
1123
  icon: e.icon,
1014
1124
  "fixed-width": ""
1015
- }, null, 8, ["icon"]), s("span", null, C(e.libelle), 1)], 10, wt))), 128))]),
1016
- f.selected ? a("", !0) : (g(), o("div", Tt, " Sélectionnez par quel canal la sollicitation vous est parvenue. "))
1125
+ }, null, 8, ["icon"])) : b("", !0), S("span", null, F(e.libelle), 1)], 10, un))), 128))]),
1126
+ a.loaded && !a.provenanceChoisie ? (k(), x("div", dn, " Sélectionnez par quel canal la sollicitation vous est parvenue. ")) : b("", !0)
1017
1127
  ]));
1018
1128
  }
1019
- var Dt = /*#__PURE__*/ F(yt, [["render", Et]]), Ot = {
1129
+ var pn = /*#__PURE__*/ K(an, [["render", fn]]), mn = {
1020
1130
  name: "EtapeReclamantBlock",
1021
1131
  components: {
1022
- ReclamantRechercheBlock: vt,
1023
- ProvenanceSelecteurBlock: Dt
1132
+ ReclamantRechercheBlock: rn,
1133
+ ProvenanceSelecteurBlock: pn
1024
1134
  },
1025
1135
  props: { premiere: {
1026
1136
  type: Boolean,
1027
1137
  default: !1
1028
1138
  } },
1029
1139
  setup() {
1030
- return { draft: P() };
1140
+ return { draft: G() };
1031
1141
  }
1032
- }, kt = { class: "d-flex flex-column gap-3" }, At = { class: "alert alert-light border py-2 px-3 mb-0 fs-7" };
1033
- function jt(e, t, n, r, c, d) {
1034
- let f = S("provenance-selecteur-block"), p = S("font-awesome-icon"), m = S("reclamant-recherche-block");
1035
- return g(), o("div", kt, [n.premiere ? (g(), i(f, { key: 0 })) : a("", !0), x(e.$slots, "reclamant", {
1142
+ }, hn = { class: "d-flex flex-column gap-3" }, gn = { class: "alert alert-light border py-2 px-3 mb-0 fs-7" };
1143
+ function _n(e, t, n, r, i, a) {
1144
+ let o = P("provenance-selecteur-block"), s = P("font-awesome-icon"), c = P("reclamant-recherche-block");
1145
+ return k(), x("div", hn, [n.premiere ? (k(), y(o, { key: 0 })) : b("", !0), N(e.$slots, "reclamant", {
1036
1146
  reclamant: r.draft.reclamantSelectionne,
1037
1147
  select: r.draft.selectReclamant
1038
- }, () => [s("div", At, [u(p, {
1148
+ }, () => [S("div", gn, [T(s, {
1039
1149
  icon: "user",
1040
1150
  class: "text-primary me-2"
1041
- }), t[0] ||= l(" Pour qui cette sollicitation est-elle créée\xA0? ", -1)]), u(m)])]);
1151
+ }), t[0] ||= w(" Pour qui cette sollicitation est-elle créée\xA0? ", -1)]), T(c)])]);
1042
1152
  }
1043
- var Mt = /*#__PURE__*/ F(Ot, [["render", jt]]), Nt = Symbol("cresol:options"), Pt = (e) => _(Nt, e), Y = () => f(Nt, {});
1153
+ var vn = /*#__PURE__*/ K(mn, [["render", _n]]);
1044
1154
  //#endregion
1045
1155
  //#region src/utils/text.js
1046
- function X(e, t = !0) {
1156
+ function $(e, t = !0) {
1047
1157
  if (!e) return null;
1048
1158
  let n = e.toString().normalize("NFD").replace(/[̀-ͯ]/g, "");
1049
1159
  return t ? n.toLowerCase() : n;
1050
1160
  }
1051
1161
  //#endregion
1052
1162
  //#region src/components/ReclamantSelecteurBlock.vue
1053
- var Ft = {
1163
+ var yn = {
1054
1164
  name: "ReclamantSelecteurBlock",
1055
- components: { AmsomAutocomplete: O },
1165
+ components: {
1166
+ AmsomAutocomplete: z,
1167
+ ReclamantTypeBadgeComponent: Ht
1168
+ },
1056
1169
  props: {
1057
1170
  mode: {
1058
1171
  type: String,
@@ -1065,8 +1178,8 @@ var Ft = {
1065
1178
  },
1066
1179
  setup() {
1067
1180
  return {
1068
- draft: P(),
1069
- options: Y()
1181
+ draft: G(),
1182
+ options: Q()
1070
1183
  };
1071
1184
  },
1072
1185
  computed: {
@@ -1092,66 +1205,73 @@ var Ft = {
1092
1205
  this.draft.selectReclamant(e);
1093
1206
  },
1094
1207
  filterReclamants({ search: e, items: t }) {
1095
- let n = (X(e) ?? "").trim();
1096
- return n ? t.filter((e) => (X(e?.libelle) ?? "").includes(n)) : t;
1208
+ let n = ($(e) ?? "").trim();
1209
+ return n ? t.filter((e) => ($(e?.libelle) ?? "").includes(n)) : t;
1097
1210
  }
1098
1211
  }
1099
- }, It = {
1212
+ }, bn = {
1100
1213
  key: 0,
1101
1214
  class: "fs-7 text-muted"
1102
- }, Lt = { class: "fw-medium" }, Rt = {
1215
+ }, xn = { class: "fw-medium" }, Sn = {
1103
1216
  key: 0,
1104
1217
  class: "btn-group btn-group-sm",
1105
1218
  role: "group"
1106
- }, zt = ["onClick"], Bt = ["value"], Vt = ["value"];
1107
- function Ht(e, t, r, a, c, u) {
1108
- let d = S("amsom-autocomplete");
1109
- return u.estFige ? (g(), o("div", It, [t[2] ||= l(" Réclamant : ", -1), s("span", Lt, C(u.reclamantSelectionne?.libelle), 1)])) : (g(), o("div", {
1219
+ }, Cn = ["onClick"], wn = ["value"], Tn = ["value"];
1220
+ function En(e, t, n, r, i, a) {
1221
+ let o = P("reclamant-type-badge-component"), s = P("amsom-autocomplete");
1222
+ return a.estFige ? (k(), x("div", bn, [t[2] ||= w(" Réclamant : ", -1), S("span", xn, F(a.reclamantSelectionne?.libelle), 1)])) : (k(), x("div", {
1110
1223
  key: 1,
1111
- class: m(r.inline ? "d-flex align-items-center justify-content-between gap-2 border-bottom pb-2" : "d-flex flex-column gap-1")
1112
- }, [t[3] ||= s("span", { class: "fs-7 fw-semibold text-muted text-uppercase" }, "Réclamant", -1), u.presentation === "switch" ? (g(), o("div", Rt, [(g(!0), o(n, null, b(u.reclamants, (e, t) => (g(), o("button", {
1224
+ class: D(n.inline ? "d-flex align-items-center justify-content-between gap-2 border-bottom pb-2" : "d-flex flex-column gap-1")
1225
+ }, [t[3] ||= S("span", { class: "fs-7 fw-semibold text-muted text-uppercase" }, "Réclamant", -1), a.presentation === "switch" ? (k(), x("div", Sn, [(k(!0), x(_, null, M(a.reclamants, (e, t) => (k(), x("button", {
1113
1226
  key: t,
1114
1227
  type: "button",
1115
- class: m(["btn btn-sm py-0", e === u.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
1116
- onClick: (t) => u.select(e)
1117
- }, C(e.libelle), 11, zt))), 128))])) : u.presentation === "autocomplete" ? (g(), i(d, {
1228
+ class: D(["btn btn-sm py-0", e === a.reclamantSelectionne ? "btn-primary" : "btn-outline-primary"]),
1229
+ onClick: (t) => a.select(e)
1230
+ }, F(e.libelle), 11, Cn))), 128))])) : a.presentation === "autocomplete" ? (k(), y(s, {
1118
1231
  key: 1,
1119
- "model-value": u.reclamantSelectionne,
1120
- items: u.reclamants,
1121
- "get-id": u.reclamantId,
1232
+ "model-value": a.reclamantSelectionne,
1233
+ items: a.reclamants,
1234
+ "get-id": a.reclamantId,
1122
1235
  "get-input-libelle": (e) => e?.libelle ?? "",
1123
- "filtering-function": u.filterReclamants,
1236
+ "filtering-function": a.filterReclamants,
1124
1237
  placeholder: "Rechercher un réclamant…",
1125
1238
  "input-size": "sm",
1126
1239
  "hide-choices": "",
1127
- class: m(r.inline ? "" : "w-100"),
1128
- "onUpdate:modelValue": t[0] ||= (e) => u.select(e)
1129
- }, null, 8, [
1240
+ class: D(n.inline ? "" : "w-100"),
1241
+ "onUpdate:modelValue": t[0] ||= (e) => a.select(e)
1242
+ }, {
1243
+ options: R((e) => [T(o, {
1244
+ reclamant: e,
1245
+ "icon-only": "",
1246
+ class: "me-1"
1247
+ }, null, 8, ["reclamant"]), w(" " + F(e?.libelle), 1)]),
1248
+ _: 1
1249
+ }, 8, [
1130
1250
  "model-value",
1131
1251
  "items",
1132
1252
  "get-id",
1133
1253
  "get-input-libelle",
1134
1254
  "filtering-function",
1135
1255
  "class"
1136
- ])) : (g(), o("select", {
1256
+ ])) : (k(), x("select", {
1137
1257
  key: 2,
1138
- class: m(["form-select form-select-sm", r.inline ? "w-auto" : ""]),
1139
- value: u.reclamants.indexOf(u.reclamantSelectionne),
1140
- onChange: t[1] ||= (e) => u.select(u.reclamants[e.target.value])
1141
- }, [(g(!0), o(n, null, b(u.reclamants, (e, t) => (g(), o("option", {
1258
+ class: D(["form-select form-select-sm", n.inline ? "w-auto" : ""]),
1259
+ value: a.reclamants.indexOf(a.reclamantSelectionne),
1260
+ onChange: t[1] ||= (e) => a.select(a.reclamants[e.target.value])
1261
+ }, [(k(!0), x(_, null, M(a.reclamants, (e, t) => (k(), x("option", {
1142
1262
  key: t,
1143
1263
  value: t
1144
- }, C(e.libelle), 9, Vt))), 128))], 42, Bt))], 2));
1264
+ }, F(e.libelle), 9, Tn))), 128))], 42, wn))], 2));
1145
1265
  }
1146
1266
  //#endregion
1147
1267
  //#region src/components/EtapeCategorieBlock.vue
1148
- var Ut = {
1268
+ var Dn = {
1149
1269
  name: "EtapeCategorieBlock",
1150
1270
  components: {
1151
- AmsomOverlay: t,
1152
- AmsomAutocomplete: O,
1153
- ReclamantSelecteurBlock: /* @__PURE__ */ F(Ft, [["render", Ht]]),
1154
- ProvenanceSelecteurBlock: Dt
1271
+ AmsomOverlay: g,
1272
+ AmsomAutocomplete: z,
1273
+ ReclamantSelecteurBlock: /* @__PURE__ */ K(yn, [["render", En]]),
1274
+ ProvenanceSelecteurBlock: pn
1155
1275
  },
1156
1276
  props: { premiere: {
1157
1277
  type: Boolean,
@@ -1159,9 +1279,9 @@ var Ut = {
1159
1279
  } },
1160
1280
  setup() {
1161
1281
  return {
1162
- draft: P(),
1163
- data: K(),
1164
- options: Y()
1282
+ draft: G(),
1283
+ data: Z(),
1284
+ options: Q()
1165
1285
  };
1166
1286
  },
1167
1287
  data() {
@@ -1278,7 +1398,7 @@ var Ut = {
1278
1398
  });
1279
1399
  },
1280
1400
  registerIcons() {
1281
- return tt([
1401
+ return jt([
1282
1402
  ...this.data.cache.categories ?? [],
1283
1403
  ...this.data.cache.types ?? [],
1284
1404
  ...this.data.cache.natures ?? [],
@@ -1286,11 +1406,11 @@ var Ut = {
1286
1406
  ].map((e) => e.icon));
1287
1407
  },
1288
1408
  filterMotifs({ search: e, items: t }) {
1289
- let n = (X(e) ?? "").trim();
1409
+ let n = ($(e) ?? "").trim();
1290
1410
  if (!n) return t;
1291
1411
  let r = n.split(/\s+/);
1292
1412
  return t.filter((e) => {
1293
- let t = X(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
1413
+ let t = $(`${e.libelle} ${e.categorie} ${e.type} ${e.nature}`) ?? "";
1294
1414
  return r.every((e) => t.includes(e));
1295
1415
  });
1296
1416
  },
@@ -1313,57 +1433,57 @@ var Ut = {
1313
1433
  return this.activeMotifs.find((t) => t.id === e)?.libelle ?? e;
1314
1434
  }
1315
1435
  }
1316
- }, Wt = {
1436
+ }, On = {
1317
1437
  key: 0,
1318
1438
  class: "d-flex flex-column gap-3"
1319
- }, Gt = { key: 2 }, Kt = { class: "d-flex flex-wrap align-items-center gap-2" }, qt = { class: "badge rounded-pill bg-primary d-inline-flex align-items-center gap-2" }, Jt = { key: 3 }, Yt = { class: "d-flex align-items-center gap-2" }, Xt = { class: "min-w-0" }, Zt = { class: "fw-medium text-truncate" }, Qt = { class: "text-muted d-block text-truncate" }, $t = {
1439
+ }, kn = { key: 2 }, An = { class: "d-flex flex-wrap align-items-center gap-2" }, jn = { class: "badge rounded-pill bg-primary d-inline-flex align-items-center gap-2" }, Mn = { key: 3 }, Nn = { class: "d-flex align-items-center gap-2" }, Pn = { class: "min-w-0" }, Fn = { class: "fw-medium text-truncate" }, In = { class: "text-muted d-block text-truncate" }, Ln = {
1320
1440
  key: 4,
1321
1441
  class: "d-flex align-items-center gap-2 text-muted fs-7"
1322
- }, en = {
1442
+ }, Rn = {
1323
1443
  key: 5,
1324
1444
  class: "d-flex flex-wrap align-items-center gap-2"
1325
- }, tn = ["onClick"], nn = { key: 6 }, rn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-2" }, an = { class: "row justify-content-around g-3" }, on = ["title", "onClick"], sn = { class: "fs-7 mt-1 lh-sm" }, cn = {
1445
+ }, zn = ["onClick"], Bn = { key: 6 }, Vn = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-2" }, Hn = { class: "row justify-content-around g-3" }, Un = ["title", "onClick"], Wn = { class: "fs-7 mt-1 lh-sm" }, Gn = {
1326
1446
  key: 0,
1327
1447
  class: "col-12 text-muted fs-7"
1328
- }, ln = [
1448
+ }, Kn = [
1329
1449
  "id",
1330
1450
  "checked",
1331
1451
  "disabled",
1332
1452
  "onChange"
1333
- ], un = ["for"];
1334
- function dn(e, t, r, c, d, f) {
1335
- let p = S("provenance-selecteur-block"), m = S("reclamant-selecteur-block"), h = S("font-awesome-icon"), _ = S("amsom-autocomplete"), v = S("amsom-overlay");
1336
- return g(), i(v, { loading: c.data.isLoading && !c.data.cache.motifs || !d.iconsReady }, {
1337
- default: D(() => [d.iconsReady ? (g(), o("div", Wt, [
1338
- r.premiere ? (g(), i(p, { key: 0 })) : a("", !0),
1339
- c.options.reclamantMode === "step" ? a("", !0) : (g(), i(m, { key: 1 })),
1340
- f.motifFige && f.selectionChain.length ? (g(), o("div", Gt, [t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Motif", -1), s("div", Kt, [(g(!0), o(n, null, b(f.selectionChain, (e, t) => (g(), o(n, { key: e.level }, [t > 0 ? (g(), i(h, {
1453
+ ], qn = ["for"];
1454
+ function Jn(e, t, n, r, i, a) {
1455
+ let o = P("provenance-selecteur-block"), s = P("reclamant-selecteur-block"), c = P("font-awesome-icon"), l = P("amsom-autocomplete"), u = P("amsom-overlay");
1456
+ return k(), y(u, { loading: r.data.isLoading && !r.data.cache.motifs || !i.iconsReady }, {
1457
+ default: R(() => [i.iconsReady ? (k(), x("div", On, [
1458
+ n.premiere ? (k(), y(o, { key: 0 })) : b("", !0),
1459
+ r.options.reclamantMode === "step" ? b("", !0) : (k(), y(s, { key: 1 })),
1460
+ a.motifFige && a.selectionChain.length ? (k(), x("div", kn, [t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Motif", -1), S("div", An, [(k(!0), x(_, null, M(a.selectionChain, (e, t) => (k(), x(_, { key: e.level }, [t > 0 ? (k(), y(c, {
1341
1461
  key: 0,
1342
1462
  icon: "fa-solid fa-chevron-right",
1343
1463
  class: "text-muted fs-7"
1344
- })) : a("", !0), s("span", qt, [e.icon ? (g(), i(h, {
1464
+ })) : b("", !0), S("span", jn, [e.icon ? (k(), y(c, {
1345
1465
  key: 0,
1346
1466
  icon: e.icon,
1347
1467
  "fixed-width": ""
1348
- }, null, 8, ["icon"])) : a("", !0), l(" " + C(e.libelle), 1)])], 64))), 128))])])) : a("", !0),
1349
- f.motifFige ? a("", !0) : (g(), o("div", Jt, [t[2] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Rechercher un motif ", -1), u(_, {
1350
- modelValue: f.motifRecherche,
1351
- "onUpdate:modelValue": t[0] ||= (e) => f.motifRecherche = e,
1352
- items: f.allowedMotifs,
1353
- "get-id": f.getMotifId,
1354
- "get-input-libelle": f.getMotifInputLibelle,
1355
- "get-input-libelle-from-id": f.motifLibelleFromId,
1356
- "filtering-function": f.filterMotifs,
1468
+ }, null, 8, ["icon"])) : b("", !0), w(" " + F(e.libelle), 1)])], 64))), 128))])])) : b("", !0),
1469
+ a.motifFige ? b("", !0) : (k(), x("div", Mn, [t[2] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Rechercher un motif ", -1), T(l, {
1470
+ modelValue: a.motifRecherche,
1471
+ "onUpdate:modelValue": t[0] ||= (e) => a.motifRecherche = e,
1472
+ items: a.allowedMotifs,
1473
+ "get-id": a.getMotifId,
1474
+ "get-input-libelle": a.getMotifInputLibelle,
1475
+ "get-input-libelle-from-id": a.motifLibelleFromId,
1476
+ "filtering-function": a.filterMotifs,
1357
1477
  placeholder: "Rechercher (motif, catégorie, type, nature)…",
1358
1478
  "input-size": "sm",
1359
1479
  "hide-choices": ""
1360
1480
  }, {
1361
- options: D((e) => [s("div", Yt, [e?.icon ? (g(), i(h, {
1481
+ options: R((e) => [S("div", Nn, [e?.icon ? (k(), y(c, {
1362
1482
  key: 0,
1363
1483
  icon: e.icon,
1364
1484
  class: "text-primary",
1365
1485
  "fixed-width": ""
1366
- }, null, 8, ["icon"])) : a("", !0), s("div", Xt, [s("div", Zt, C(e?.libelle), 1), s("small", Qt, C(e?.categorie) + " › " + C(e?.type) + " › " + C(e?.nature), 1)])])]),
1486
+ }, null, 8, ["icon"])) : b("", !0), S("div", Pn, [S("div", Fn, F(e?.libelle), 1), S("small", In, F(e?.categorie) + " › " + F(e?.type) + " › " + F(e?.nature), 1)])])]),
1367
1487
  _: 1
1368
1488
  }, 8, [
1369
1489
  "modelValue",
@@ -1373,67 +1493,67 @@ function dn(e, t, r, c, d, f) {
1373
1493
  "get-input-libelle-from-id",
1374
1494
  "filtering-function"
1375
1495
  ])])),
1376
- f.motifFige ? a("", !0) : (g(), o("div", $t, [...t[3] ||= [
1377
- s("hr", { class: "flex-grow-1 my-0" }, null, -1),
1378
- s("span", null, "ou sélection guidée", -1),
1379
- s("hr", { class: "flex-grow-1 my-0" }, null, -1)
1496
+ a.motifFige ? b("", !0) : (k(), x("div", Ln, [...t[3] ||= [
1497
+ S("hr", { class: "flex-grow-1 my-0" }, null, -1),
1498
+ S("span", null, "ou sélection guidée", -1),
1499
+ S("hr", { class: "flex-grow-1 my-0" }, null, -1)
1380
1500
  ]])),
1381
- !f.motifFige && f.selectionChain.length ? (g(), o("div", en, [(g(!0), o(n, null, b(f.selectionChain, (e, t) => (g(), o(n, { key: e.level }, [t > 0 ? (g(), i(h, {
1501
+ !a.motifFige && a.selectionChain.length ? (k(), x("div", Rn, [(k(!0), x(_, null, M(a.selectionChain, (e, t) => (k(), x(_, { key: e.level }, [t > 0 ? (k(), y(c, {
1382
1502
  key: 0,
1383
1503
  icon: "fa-solid fa-chevron-right",
1384
1504
  class: "text-muted fs-7"
1385
- })) : a("", !0), s("button", {
1505
+ })) : b("", !0), S("button", {
1386
1506
  type: "button",
1387
1507
  class: "btn btn-sm btn-primary rounded-pill d-inline-flex align-items-center gap-2",
1388
- onClick: (t) => f.goBackTo(e.level)
1508
+ onClick: (t) => a.goBackTo(e.level)
1389
1509
  }, [
1390
- e.icon ? (g(), i(h, {
1510
+ e.icon ? (k(), y(c, {
1391
1511
  key: 0,
1392
1512
  icon: e.icon,
1393
1513
  "fixed-width": ""
1394
- }, null, 8, ["icon"])) : a("", !0),
1395
- s("span", null, C(e.libelle), 1),
1396
- u(h, {
1514
+ }, null, 8, ["icon"])) : b("", !0),
1515
+ S("span", null, F(e.libelle), 1),
1516
+ T(c, {
1397
1517
  icon: "fa-solid fa-xmark",
1398
1518
  class: "fs-7 opacity-75"
1399
1519
  })
1400
- ], 8, tn)], 64))), 128))])) : a("", !0),
1401
- !f.motifFige && f.currentLevel ? (g(), o("div", nn, [s("label", rn, C(f.currentLevel.title), 1), s("div", an, [(g(!0), o(n, null, b(f.currentLevel.options, (e) => (g(), o("div", {
1520
+ ], 8, zn)], 64))), 128))])) : b("", !0),
1521
+ !a.motifFige && a.currentLevel ? (k(), x("div", Bn, [S("label", Vn, F(a.currentLevel.title), 1), S("div", Hn, [(k(!0), x(_, null, M(a.currentLevel.options, (e) => (k(), x("div", {
1402
1522
  key: e.id,
1403
1523
  class: "col-3 text-center"
1404
- }, [s("button", {
1524
+ }, [S("button", {
1405
1525
  type: "button",
1406
1526
  class: "btn btn-lg btn-outline-primary btn-circle d-flex align-items-center justify-content-center mx-auto",
1407
1527
  title: e.libelle,
1408
- onClick: (t) => f.currentLevel.select(e.id)
1409
- }, [e.icon ? (g(), i(h, {
1528
+ onClick: (t) => a.currentLevel.select(e.id)
1529
+ }, [e.icon ? (k(), y(c, {
1410
1530
  key: 0,
1411
1531
  icon: e.icon,
1412
1532
  size: "lg"
1413
- }, null, 8, ["icon"])) : a("", !0)], 8, on), s("div", sn, C(e.libelle), 1)]))), 128)), f.currentLevel.options.length ? a("", !0) : (g(), o("div", cn, " Aucun choix disponible "))])])) : a("", !0),
1414
- f.motifsAssocies.length ? (g(), o(n, { key: 7 }, [t[4] ||= s("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
1415
- s("hr", { class: "flex-grow-1 my-0" }),
1416
- s("span", null, "Autres motifs liés"),
1417
- s("hr", { class: "flex-grow-1 my-0" })
1418
- ], -1), (g(!0), o(n, null, b(f.motifsAssocies, (e) => (g(), o("div", {
1533
+ }, null, 8, ["icon"])) : b("", !0)], 8, Un), S("div", Wn, F(e.libelle), 1)]))), 128)), a.currentLevel.options.length ? b("", !0) : (k(), x("div", Gn, " Aucun choix disponible "))])])) : b("", !0),
1534
+ a.motifsAssocies.length ? (k(), x(_, { key: 7 }, [t[4] ||= S("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
1535
+ S("hr", { class: "flex-grow-1 my-0" }),
1536
+ S("span", null, "Autres motifs liés"),
1537
+ S("hr", { class: "flex-grow-1 my-0" })
1538
+ ], -1), (k(!0), x(_, null, M(a.motifsAssocies, (e) => (k(), x("div", {
1419
1539
  key: e.idMotif,
1420
1540
  class: "form-check form-switch"
1421
- }, [s("input", {
1541
+ }, [S("input", {
1422
1542
  id: `assoc-${e.idMotif}`,
1423
1543
  class: "form-check-input",
1424
1544
  type: "checkbox",
1425
- checked: f.isActive(e.idMotif),
1426
- disabled: f.motifFige,
1427
- onChange: (t) => f.toggleMotifAssocie(e)
1428
- }, null, 40, ln), s("label", {
1545
+ checked: a.isActive(e.idMotif),
1546
+ disabled: a.motifFige,
1547
+ onChange: (t) => a.toggleMotifAssocie(e)
1548
+ }, null, 40, Kn), S("label", {
1429
1549
  class: "form-check-label fs-7",
1430
1550
  for: `assoc-${e.idMotif}`
1431
- }, C(e.libelle) + " ? ", 9, un)]))), 128))], 64)) : a("", !0)
1432
- ])) : a("", !0)]),
1551
+ }, F(e.libelle) + " ? ", 9, qn)]))), 128))], 64)) : b("", !0)
1552
+ ])) : b("", !0)]),
1433
1553
  _: 1
1434
1554
  }, 8, ["loading"]);
1435
1555
  }
1436
- var fn = /*#__PURE__*/ F(Ut, [["render", dn]]), pn = {
1556
+ var Yn = /*#__PURE__*/ K(Dn, [["render", Jn]]), Xn = {
1437
1557
  B: "briefcase",
1438
1558
  M: "store",
1439
1559
  W: "dungeon",
@@ -1443,17 +1563,17 @@ var fn = /*#__PURE__*/ F(Ut, [["render", dn]]), pn = {
1443
1563
  S: "square-parking",
1444
1564
  V: "hands-holding"
1445
1565
  };
1446
- function mn(e, t = !1, n = "circle-question") {
1447
- return e === "L" ? t ? "building" : "house" : pn[e] ?? n;
1566
+ function Zn(e, t = !1, n = "circle-question") {
1567
+ return e === "L" ? t ? "building" : "house" : Xn[e] ?? n;
1448
1568
  }
1449
- function hn(e) {
1569
+ function Qn(e) {
1450
1570
  return e ? e.idCategorieModule === "L" ? e.estCollectif ? "Appartement" : "Maison" : e.categorieModule ?? "" : "";
1451
1571
  }
1452
1572
  //#endregion
1453
1573
  //#region src/components/CiblePickerBlock.vue
1454
- var gn = 0, _n = {
1574
+ var $n = 0, er = {
1455
1575
  name: "CiblePickerBlock",
1456
- components: { AmsomAutocomplete: O },
1576
+ components: { AmsomAutocomplete: z },
1457
1577
  props: {
1458
1578
  patrimoine: {
1459
1579
  type: Object,
@@ -1504,11 +1624,11 @@ var gn = 0, _n = {
1504
1624
  "set-module-precis"
1505
1625
  ],
1506
1626
  setup() {
1507
- return { data: K() };
1627
+ return { data: Z() };
1508
1628
  },
1509
1629
  data() {
1510
1630
  return {
1511
- uid: ++gn,
1631
+ uid: ++$n,
1512
1632
  rechercheContrat: "",
1513
1633
  contratsTrouves: [],
1514
1634
  rechercheEnCours: !1,
@@ -1655,6 +1775,7 @@ var gn = 0, _n = {
1655
1775
  clearTimeout(this.rechercheTimeout), this.controller?.abort();
1656
1776
  },
1657
1777
  methods: {
1778
+ formatDate: Pt,
1658
1779
  rechercherPlusTard(e) {
1659
1780
  clearTimeout(this.rechercheTimeout), this.rechercheTimeout = setTimeout(() => this.rechercherContrat(e), 400);
1660
1781
  },
@@ -1674,16 +1795,16 @@ var gn = 0, _n = {
1674
1795
  },
1675
1796
  filterOn(e) {
1676
1797
  return ({ search: t, items: n }) => {
1677
- let r = (X(t) ?? "").trim();
1678
- return r ? n.filter((t) => (X(t?.[e]) ?? "").includes(r)) : n;
1798
+ let r = ($(t) ?? "").trim();
1799
+ return r ? n.filter((t) => ($(t?.[e]) ?? "").includes(r)) : n;
1679
1800
  };
1680
1801
  },
1681
1802
  filterModules({ search: e, items: t }) {
1682
- let n = (X(e) ?? "").trim();
1683
- return n ? t.filter((e) => String(e?.idModule ?? "").includes(n) || (X(this.moduleInputLibelle(e)) ?? "").includes(n) || (X(e?._autreLibelle) ?? "").includes(n)) : t;
1803
+ let n = ($(e) ?? "").trim();
1804
+ return n ? t.filter((e) => String(e?.idModule ?? "").includes(n) || ($(this.moduleInputLibelle(e)) ?? "").includes(n) || ($(e?._autreLibelle) ?? "").includes(n)) : t;
1684
1805
  },
1685
- getCategorieModuleIcon: mn,
1686
- categorieLibelle: hn,
1806
+ getCategorieModuleIcon: Zn,
1807
+ categorieLibelle: Qn,
1687
1808
  moduleLibelle(e) {
1688
1809
  return e ? e.libelleModule ?? e.adresse ?? `Module ${e.idModule}` : "";
1689
1810
  },
@@ -1695,84 +1816,84 @@ var gn = 0, _n = {
1695
1816
  return !!e?.dateFin && e.dateFin < Math.floor(Date.now() / 1e3);
1696
1817
  }
1697
1818
  }
1698
- }, vn = { class: "d-flex flex-column gap-3" }, yn = {
1819
+ }, tr = { class: "d-flex flex-column gap-3" }, nr = {
1699
1820
  class: "btn-group w-100",
1700
1821
  role: "group"
1701
- }, bn = ["onClick"], xn = { class: "text-muted d-block mt-1" }, Sn = {
1822
+ }, rr = ["onClick"], ir = { class: "text-muted d-block mt-1" }, ar = {
1702
1823
  key: 0,
1703
1824
  class: "form-check"
1704
- }, Cn = ["id", "checked"], wn = ["for"], Tn = { key: 1 }, En = { class: "min-w-0" }, Dn = { class: "fw-medium text-truncate text-capitalize" }, On = { class: "d-flex flex-wrap align-items-center gap-1" }, kn = { class: "text-muted" }, An = {
1825
+ }, or = ["id", "checked"], sr = ["for"], cr = { key: 1 }, lr = { class: "min-w-0" }, ur = { class: "fw-medium text-truncate text-capitalize" }, dr = { class: "d-flex flex-wrap align-items-center gap-1" }, fr = { class: "text-muted" }, pr = {
1705
1826
  key: 0,
1706
1827
  class: "badge bg-info"
1707
- }, jn = {
1828
+ }, mr = {
1708
1829
  key: 1,
1709
1830
  class: "badge bg-warning"
1710
- }, Mn = {
1831
+ }, hr = {
1711
1832
  key: 0,
1712
1833
  class: "text-muted d-block text-truncate"
1713
- }, Nn = { key: 1 }, Pn = { class: "row g-2" }, Fn = ["aria-pressed", "onClick"], In = { class: "min-w-0" }, Ln = { class: "d-block fw-semibold fs-6" }, Rn = { class: "d-block text-muted" }, zn = {
1834
+ }, gr = { key: 1 }, _r = { class: "row g-2" }, vr = ["aria-pressed", "onClick"], yr = { class: "min-w-0" }, br = { class: "d-block fw-semibold fs-6" }, xr = { class: "d-block text-muted" }, Sr = {
1714
1835
  key: 2,
1715
1836
  class: "row g-3"
1716
- }, Bn = { class: "min-w-0" }, Vn = { class: "fw-medium text-truncate" }, Hn = { class: "text-muted d-block text-truncate" }, Un = ["value"], Wn = ["value"], Gn = ["value"], Kn = {
1837
+ }, Cr = { class: "min-w-0" }, wr = { class: "fw-medium text-truncate" }, Tr = { class: "text-muted d-block text-truncate" }, Er = ["value"], Dr = ["value"], Or = ["value"], kr = {
1717
1838
  key: 0,
1718
1839
  class: "col-12 col-md-6"
1719
- }, qn = { class: "d-flex flex-wrap align-items-center gap-1" }, Jn = ["title"], Yn = { class: "text-muted" }, Xn = {
1840
+ }, Ar = { class: "d-flex flex-wrap align-items-center gap-1" }, jr = ["title"], Mr = { class: "text-muted" }, Nr = {
1720
1841
  key: 1,
1721
1842
  class: "d-block text-truncate"
1722
- }, Zn = {
1843
+ }, Pr = {
1723
1844
  key: 2,
1724
1845
  class: "text-muted d-block"
1725
- }, Qn = {
1846
+ }, Fr = {
1726
1847
  key: 0,
1727
1848
  class: "mt-2 d-flex flex-column gap-2"
1728
- }, $n = { class: "form-check mb-0 ms-3" }, er = ["id", "checked"], tr = ["for"];
1729
- function nr(e, t, r, c, d, f) {
1730
- let p = S("font-awesome-icon"), h = S("amsom-autocomplete");
1731
- return g(), o("div", vn, [
1732
- s("div", null, [
1733
- t[7] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " La sollicitation concerne… ", -1),
1734
- s("div", yn, [(g(!0), o(n, null, b(f.availableModes, (t) => (g(), o("button", {
1849
+ }, Ir = { class: "form-check mb-0 ms-3" }, Lr = ["id", "checked"], Rr = ["for"];
1850
+ function zr(e, t, n, r, i, a) {
1851
+ let o = P("font-awesome-icon"), s = P("amsom-autocomplete");
1852
+ return k(), x("div", tr, [
1853
+ S("div", null, [
1854
+ t[7] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " La sollicitation concerne… ", -1),
1855
+ S("div", nr, [(k(!0), x(_, null, M(a.availableModes, (t) => (k(), x("button", {
1735
1856
  key: t.key,
1736
1857
  type: "button",
1737
- class: m(["btn btn-sm", r.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
1858
+ class: D(["btn btn-sm", n.cibleMode === t.key ? "btn-primary" : "btn-outline-primary"]),
1738
1859
  onClick: (n) => e.$emit("change-mode", t.key)
1739
- }, [u(p, {
1860
+ }, [T(o, {
1740
1861
  icon: t.icon,
1741
1862
  class: "me-1"
1742
- }, null, 8, ["icon"]), l(" " + C(t.label), 1)], 10, bn))), 128))]),
1743
- s("small", xn, C(f.currentMode?.aide), 1)
1863
+ }, null, 8, ["icon"]), w(" " + F(t.label), 1)], 10, rr))), 128))]),
1864
+ S("small", ir, F(a.currentMode?.aide), 1)
1744
1865
  ]),
1745
- r.cibleMode === "contrat" ? (g(), o(n, { key: 0 }, [r.afficheCaseContratReclamant ? (g(), o("div", Sn, [s("input", {
1746
- id: `contrat-reclamant-${d.uid}`,
1866
+ n.cibleMode === "contrat" ? (k(), x(_, { key: 0 }, [n.afficheCaseContratReclamant ? (k(), x("div", ar, [S("input", {
1867
+ id: `contrat-reclamant-${i.uid}`,
1747
1868
  class: "form-check-input",
1748
1869
  type: "checkbox",
1749
- checked: r.contratReclamant,
1870
+ checked: n.contratReclamant,
1750
1871
  onChange: t[0] ||= (t) => e.$emit("toggle-contrat-reclamant", t.target.checked)
1751
- }, null, 40, Cn), s("label", {
1872
+ }, null, 40, or), S("label", {
1752
1873
  class: "form-check-label fs-7",
1753
- for: `contrat-reclamant-${d.uid}`
1754
- }, " Contrat du réclamant ", 8, wn)])) : a("", !0), r.contratReclamant ? a("", !0) : (g(), o("div", Tn, [t[8] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Contrat ciblé ", -1), u(h, {
1755
- modelValue: f.selectedContrat,
1756
- "onUpdate:modelValue": t[1] ||= (e) => f.selectedContrat = e,
1757
- items: d.contratsTrouves,
1874
+ for: `contrat-reclamant-${i.uid}`
1875
+ }, " Contrat du réclamant ", 8, sr)])) : b("", !0), n.contratReclamant ? b("", !0) : (k(), x("div", cr, [t[8] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Contrat ciblé ", -1), T(s, {
1876
+ modelValue: a.selectedContrat,
1877
+ "onUpdate:modelValue": t[1] ||= (e) => a.selectedContrat = e,
1878
+ items: i.contratsTrouves,
1758
1879
  "filtering-function": ({ items: e }) => e,
1759
- loading: d.rechercheEnCours,
1880
+ loading: i.rechercheEnCours,
1760
1881
  "get-id": (e) => e ? `${e.typeContrat}|${e.idContrat}` : null,
1761
- "get-input-libelle": f.contratInputLibelle,
1882
+ "get-input-libelle": a.contratInputLibelle,
1762
1883
  placeholder: "N° de contrat, locataire, module ou adresse…",
1763
1884
  "input-size": "sm",
1764
1885
  "hide-choices": "",
1765
1886
  "debounce-delay": 0,
1766
- onSearch: f.rechercherPlusTard
1887
+ onSearch: a.rechercherPlusTard
1767
1888
  }, {
1768
- options: D((e) => [s("div", En, [
1769
- s("div", Dn, C(e?.libelle ?? `Contrat ${e?.idContrat}`), 1),
1770
- s("div", On, [
1771
- s("small", kn, "N° " + C(e?.typeContrat) + "/" + C(e?.idContrat), 1),
1772
- e?.nbModules > 1 ? (g(), o("span", An, C(e.nbModules) + " modules", 1)) : a("", !0),
1773
- e?.estSorti ? (g(), o("span", jn, "Sorti")) : a("", !0)
1889
+ options: R((e) => [S("div", lr, [
1890
+ S("div", ur, F(e?.libelle ?? `Contrat ${e?.idContrat}`), 1),
1891
+ S("div", dr, [
1892
+ S("small", fr, "N° " + F(e?.typeContrat) + "/" + F(e?.idContrat), 1),
1893
+ e?.nbModules > 1 ? (k(), x("span", pr, F(e.nbModules) + " modules", 1)) : b("", !0),
1894
+ e?.estSorti ? (k(), x("span", mr, F(e.dateSortie ? `Sorti le ${a.formatDate(e.dateSortie)}` : "Sorti"), 1)) : b("", !0)
1774
1895
  ]),
1775
- f.contratAdresse(e) ? (g(), o("small", Mn, C(f.contratAdresse(e)), 1)) : a("", !0)
1896
+ a.contratAdresse(e) ? (k(), x("small", hr, F(a.contratAdresse(e)), 1)) : b("", !0)
1776
1897
  ])]),
1777
1898
  _: 1
1778
1899
  }, 8, [
@@ -1783,28 +1904,28 @@ function nr(e, t, r, c, d, f) {
1783
1904
  "get-id",
1784
1905
  "get-input-libelle",
1785
1906
  "onSearch"
1786
- ])]))], 64)) : a("", !0),
1787
- r.cibleMode === "patrimoine" ? (g(), o("div", Nn, [t[9] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le problème concerne… ", -1), s("div", Pn, [(g(!0), o(n, null, b(f.portees, (t) => (g(), o("div", {
1907
+ ])]))], 64)) : b("", !0),
1908
+ n.cibleMode === "patrimoine" ? (k(), x("div", gr, [t[9] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Le problème concerne… ", -1), S("div", _r, [(k(!0), x(_, null, M(a.portees, (t) => (k(), x("div", {
1788
1909
  key: t.titre,
1789
1910
  class: "col-12 col-md-6"
1790
- }, [s("button", {
1911
+ }, [S("button", {
1791
1912
  type: "button",
1792
- class: m(["btn w-100 h-100 text-start d-flex align-items-center gap-3 p-3 rounded border text-primary", t.modulePrecis === r.modulePrecis ? "border-primary bg-light" : "bg-white"]),
1793
- "aria-pressed": t.modulePrecis === r.modulePrecis,
1913
+ class: D(["btn w-100 h-100 text-start d-flex align-items-center gap-3 p-3 rounded border text-primary", t.modulePrecis === n.modulePrecis ? "border-primary bg-light" : "bg-white"]),
1914
+ "aria-pressed": t.modulePrecis === n.modulePrecis,
1794
1915
  onClick: (n) => e.$emit("set-module-precis", t.modulePrecis)
1795
- }, [u(p, {
1916
+ }, [T(o, {
1796
1917
  icon: t.icon,
1797
1918
  class: "fs-4",
1798
1919
  "fixed-width": ""
1799
- }, null, 8, ["icon"]), s("span", In, [s("span", Ln, C(t.titre), 1), s("small", Rn, C(t.aide), 1)])], 10, Fn)]))), 128))])])) : a("", !0),
1800
- r.cibleMode === "contrat" || r.cibleMode === "patrimoine" ? (g(), o("div", zn, [s("div", { class: m(["col-12 d-flex flex-column gap-3", { "col-md-6": f.afficheModule }]) }, [r.cibleMode === "patrimoine" ? (g(), o(n, { key: 0 }, [
1801
- s("div", null, [t[10] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), u(h, {
1802
- modelValue: f.selectedCommune,
1803
- "onUpdate:modelValue": t[2] ||= (e) => f.selectedCommune = e,
1804
- items: c.data.cache.communes || [],
1920
+ }, null, 8, ["icon"]), S("span", yr, [S("span", br, F(t.titre), 1), S("small", xr, F(t.aide), 1)])], 10, vr)]))), 128))])])) : b("", !0),
1921
+ n.cibleMode === "contrat" || n.cibleMode === "patrimoine" ? (k(), x("div", Sr, [S("div", { class: D(["col-12 d-flex flex-column gap-3", { "col-md-6": a.afficheModule }]) }, [n.cibleMode === "patrimoine" ? (k(), x(_, { key: 0 }, [
1922
+ S("div", null, [t[10] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), T(s, {
1923
+ modelValue: a.selectedCommune,
1924
+ "onUpdate:modelValue": t[2] ||= (e) => a.selectedCommune = e,
1925
+ items: r.data.cache.communes || [],
1805
1926
  "get-id": (e) => e?.idCommune,
1806
1927
  "get-input-libelle": (e) => e?.commune ?? "",
1807
- "filtering-function": f.filterOn("commune"),
1928
+ "filtering-function": a.filterOn("commune"),
1808
1929
  placeholder: "Rechercher une commune…",
1809
1930
  "input-size": "sm",
1810
1931
  "hide-choices": ""
@@ -1815,19 +1936,19 @@ function nr(e, t, r, c, d, f) {
1815
1936
  "get-input-libelle",
1816
1937
  "filtering-function"
1817
1938
  ])]),
1818
- s("div", null, [t[11] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), u(h, {
1819
- modelValue: f.selectedAdresse,
1820
- "onUpdate:modelValue": t[3] ||= (e) => f.selectedAdresse = e,
1821
- items: f.adresses,
1939
+ S("div", null, [t[11] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), T(s, {
1940
+ modelValue: a.selectedAdresse,
1941
+ "onUpdate:modelValue": t[3] ||= (e) => a.selectedAdresse = e,
1942
+ items: a.adresses,
1822
1943
  "get-id": (e) => e?.idEntree,
1823
1944
  "get-input-libelle": (e) => e?.entree ?? "",
1824
- "filtering-function": f.filterOn("entree"),
1825
- disabled: !r.patrimoine.idCommune,
1945
+ "filtering-function": a.filterOn("entree"),
1946
+ disabled: !n.patrimoine.idCommune,
1826
1947
  placeholder: "Rechercher une adresse…",
1827
1948
  "input-size": "sm",
1828
1949
  "hide-choices": ""
1829
1950
  }, {
1830
- options: D((e) => [s("div", Bn, [s("div", Vn, C(e?.entree), 1), s("small", Hn, C(e?.commune) + " — Programme " + C(e?.codeProgramme), 1)])]),
1951
+ options: R((e) => [S("div", Cr, [S("div", wr, F(e?.entree), 1), S("small", Tr, F(e?.commune) + " — Programme " + F(e?.codeProgramme), 1)])]),
1831
1952
  _: 1
1832
1953
  }, 8, [
1833
1954
  "modelValue",
@@ -1837,13 +1958,13 @@ function nr(e, t, r, c, d, f) {
1837
1958
  "filtering-function",
1838
1959
  "disabled"
1839
1960
  ])]),
1840
- s("div", null, [t[12] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), u(h, {
1841
- modelValue: f.selectedEtage,
1842
- "onUpdate:modelValue": t[4] ||= (e) => f.selectedEtage = e,
1843
- items: f.etages,
1961
+ S("div", null, [t[12] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), T(s, {
1962
+ modelValue: a.selectedEtage,
1963
+ "onUpdate:modelValue": t[4] ||= (e) => a.selectedEtage = e,
1964
+ items: a.etages,
1844
1965
  "get-id": (e) => e?.id,
1845
1966
  "get-input-libelle": (e) => e?.libelle ?? "",
1846
- disabled: !r.patrimoine.idEntree,
1967
+ disabled: !n.patrimoine.idEntree,
1847
1968
  placeholder: "Tous les étages…",
1848
1969
  "input-size": "sm",
1849
1970
  "hide-choices": ""
@@ -1854,50 +1975,50 @@ function nr(e, t, r, c, d, f) {
1854
1975
  "get-input-libelle",
1855
1976
  "disabled"
1856
1977
  ])])
1857
- ], 64)) : (g(), o(n, { key: 1 }, [
1858
- s("div", null, [t[13] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), s("input", {
1978
+ ], 64)) : (k(), x(_, { key: 1 }, [
1979
+ S("div", null, [t[13] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Commune ", -1), S("input", {
1859
1980
  class: "form-control form-control-sm",
1860
1981
  disabled: "",
1861
- value: r.patrimoine.commune ?? "—"
1862
- }, null, 8, Un)]),
1863
- s("div", null, [t[14] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), s("input", {
1982
+ value: n.patrimoine.commune ?? "—"
1983
+ }, null, 8, Er)]),
1984
+ S("div", null, [t[14] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Adresse ", -1), S("input", {
1864
1985
  class: "form-control form-control-sm",
1865
1986
  disabled: "",
1866
- value: r.patrimoine.entree ?? "—"
1867
- }, null, 8, Wn)]),
1868
- s("div", null, [t[15] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), s("input", {
1987
+ value: n.patrimoine.entree ?? "—"
1988
+ }, null, 8, Dr)]),
1989
+ S("div", null, [t[15] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Étage", -1), S("input", {
1869
1990
  class: "form-control form-control-sm",
1870
1991
  disabled: "",
1871
- value: r.patrimoine.etage ?? "—"
1872
- }, null, 8, Gn)])
1873
- ], 64))], 2), f.afficheModule ? (g(), o("div", Kn, [
1874
- t[16] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Module", -1),
1875
- u(h, {
1876
- modelValue: f.selectedModule,
1877
- "onUpdate:modelValue": t[5] ||= (e) => f.selectedModule = e,
1878
- items: f.modules,
1992
+ value: n.patrimoine.etage ?? "—"
1993
+ }, null, 8, Or)])
1994
+ ], 64))], 2), a.afficheModule ? (k(), x("div", kr, [
1995
+ t[16] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Module", -1),
1996
+ T(s, {
1997
+ modelValue: a.selectedModule,
1998
+ "onUpdate:modelValue": t[5] ||= (e) => a.selectedModule = e,
1999
+ items: a.modules,
1879
2000
  "get-id": (e) => e?.idModule,
1880
- "get-input-libelle": (e) => f.moduleInputLibelle(e),
1881
- "filtering-function": f.filterModules,
1882
- disabled: f.areModulesLocked,
2001
+ "get-input-libelle": (e) => a.moduleInputLibelle(e),
2002
+ "filtering-function": a.filterModules,
2003
+ disabled: a.areModulesLocked,
1883
2004
  placeholder: "Rechercher un module…",
1884
2005
  "input-size": "sm",
1885
2006
  "hide-choices": ""
1886
2007
  }, {
1887
- options: D((e) => [s("div", { class: m(["min-w-0 w-100 rounded position-relative", e?._autreLibelle ? "bg-yellow-subtle p-2" : ""]) }, [
1888
- e?._autreLibelle ? (g(), i(p, {
2008
+ options: R((e) => [S("div", { class: D(["min-w-0 w-100 rounded position-relative", e?._autreLibelle ? "bg-yellow-subtle p-2" : ""]) }, [
2009
+ e?._autreLibelle ? (k(), y(o, {
1889
2010
  key: 0,
1890
2011
  icon: "building",
1891
2012
  class: "position-absolute top-0 end-0 m-1 text-muted",
1892
2013
  title: "Autre adresse ou étage du même programme"
1893
- })) : a("", !0),
1894
- s("div", { class: m(["fw-medium text-truncate", [e?._autreLibelle ? "text-muted" : "", f.isExit(e) ? "text-decoration-line-through" : ""]]) }, C(f.moduleLibelle(e)), 3),
1895
- s("div", qn, [f.categorieLibelle(e) ? (g(), o("span", {
2014
+ })) : b("", !0),
2015
+ S("div", { class: D(["fw-medium text-truncate", [e?._autreLibelle ? "text-muted" : "", a.isExit(e) ? "text-decoration-line-through" : ""]]) }, F(a.moduleLibelle(e)), 3),
2016
+ S("div", Ar, [a.categorieLibelle(e) ? (k(), x("span", {
1896
2017
  key: 0,
1897
2018
  class: "badge bg-info",
1898
2019
  title: e?.categorieModule
1899
- }, [u(p, { icon: f.getCategorieModuleIcon(e?.idCategorieModule, e?.estCollectif) }, null, 8, ["icon"])], 8, Jn)) : a("", !0), s("small", Yn, "N° " + C(e?.idModule), 1)]),
1900
- e?._autreLibelle ? (g(), o("small", Xn, C(e._autreLibelle), 1)) : e?.etage == null ? a("", !0) : (g(), o("small", Zn, " Étage " + C(e.etage), 1))
2020
+ }, [T(o, { icon: a.getCategorieModuleIcon(e?.idCategorieModule, e?.estCollectif) }, null, 8, ["icon"])], 8, jr)) : b("", !0), S("small", Mr, "N° " + F(e?.idModule), 1)]),
2021
+ e?._autreLibelle ? (k(), x("small", Nr, F(e._autreLibelle), 1)) : e?.etage == null ? b("", !0) : (k(), x("small", Pr, " Étage " + F(e.etage), 1))
1901
2022
  ], 2)]),
1902
2023
  _: 1
1903
2024
  }, 8, [
@@ -1908,35 +2029,35 @@ function nr(e, t, r, c, d, f) {
1908
2029
  "filtering-function",
1909
2030
  "disabled"
1910
2031
  ]),
1911
- r.locataireActuelOption ? (g(), o("div", Qn, [s("div", { class: m(["alert d-flex align-items-start gap-2 py-2 px-3 mt-2 mb-0 fs-7", r.locataireActuelOption.reprendre ? "alert-warning" : "alert-secondary border"]) }, [u(p, {
2032
+ n.locataireActuelOption ? (k(), x("div", Fr, [S("div", { class: D(["alert d-flex align-items-start gap-2 py-2 px-3 mt-2 mb-0 fs-7", n.locataireActuelOption.reprendre ? "alert-warning" : "alert-secondary border"]) }, [T(o, {
1912
2033
  icon: "circle-info",
1913
2034
  class: "mt-1"
1914
- }), s("span", null, C(r.locataireActuelOption.hint), 1)], 2), s("div", $n, [s("input", {
1915
- id: `locataire-actuel-${d.uid}`,
2035
+ }), S("span", null, F(n.locataireActuelOption.hint), 1)], 2), S("div", Ir, [S("input", {
2036
+ id: `locataire-actuel-${i.uid}`,
1916
2037
  class: "form-check-input",
1917
2038
  type: "checkbox",
1918
- checked: r.locataireActuelOption.reprendre,
2039
+ checked: n.locataireActuelOption.reprendre,
1919
2040
  onChange: t[6] ||= (t) => e.$emit("toggle-reprendre-locataire-actuel", t.target.checked)
1920
- }, null, 40, er), s("label", {
2041
+ }, null, 40, Lr), S("label", {
1921
2042
  class: "form-check-label fs-7",
1922
- for: `locataire-actuel-${d.uid}`
1923
- }, " Rattacher au locataire actuel du module ", 8, tr)])])) : a("", !0)
1924
- ])) : a("", !0)])) : a("", !0)
2043
+ for: `locataire-actuel-${i.uid}`
2044
+ }, " Rattacher au locataire actuel du module ", 8, Rr)])])) : b("", !0)
2045
+ ])) : b("", !0)])) : b("", !0)
1925
2046
  ]);
1926
2047
  }
1927
2048
  //#endregion
1928
2049
  //#region src/components/EtapeCibleBlock.vue
1929
- var rr = {
2050
+ var Br = {
1930
2051
  name: "EtapeCibleBlock",
1931
2052
  components: {
1932
- AmsomOverlay: t,
1933
- CiblePickerBlock: /* @__PURE__ */ F(_n, [["render", nr]])
2053
+ AmsomOverlay: g,
2054
+ CiblePickerBlock: /* @__PURE__ */ K(er, [["render", zr]])
1934
2055
  },
1935
2056
  setup() {
1936
2057
  return {
1937
- draft: P(),
1938
- data: K(),
1939
- options: Y()
2058
+ draft: G(),
2059
+ data: Z(),
2060
+ options: Q()
1940
2061
  };
1941
2062
  },
1942
2063
  computed: {
@@ -2036,78 +2157,78 @@ var rr = {
2036
2157
  e === "contrat" ? this.draft.prefillFromModule(t, this.mainModule) : this.mainModule && (this.draft.prefillFromModule(t, this.mainModule), this.mainModule.idCommune != null && await this.data.loadAdresses(this.mainModule.idCommune), this.mainModule.codeProgramme != null && await this.data.loadModulesOfProgramme(this.mainModule.codeProgramme));
2037
2158
  }
2038
2159
  }
2039
- }, ir = { class: "d-flex flex-column gap-3" }, ar = {
2160
+ }, Vr = { class: "d-flex flex-column gap-3" }, Hr = {
2040
2161
  key: 0,
2041
2162
  class: "alert alert-light border py-2 px-3 mb-0 d-flex align-items-center gap-2"
2042
- }, or = { class: "fs-7" }, sr = {
2163
+ }, Ur = { class: "fs-7" }, Wr = {
2043
2164
  key: 1,
2044
2165
  class: "d-flex flex-column gap-1"
2045
- }, cr = {
2166
+ }, Gr = {
2046
2167
  key: 0,
2047
2168
  class: "text-muted me-1"
2048
- }, lr = { class: "d-flex align-items-center gap-2" }, ur = { class: "fw-medium fs-7" }, dr = { class: "form-check form-switch mb-0" }, fr = [
2169
+ }, Kr = { class: "d-flex align-items-center gap-2" }, qr = { class: "fw-medium fs-7" }, Jr = { class: "form-check form-switch mb-0" }, Yr = [
2049
2170
  "id",
2050
2171
  "checked",
2051
2172
  "onChange"
2052
- ], pr = ["for"], mr = {
2173
+ ], Xr = ["for"], Zr = {
2053
2174
  key: 0,
2054
2175
  class: "mt-2"
2055
2176
  };
2056
- function hr(e, t, r, c, d, f) {
2057
- let m = S("font-awesome-icon"), h = S("cible-picker-block"), _ = S("amsom-overlay");
2058
- return g(), i(_, { loading: c.data.isLoading }, {
2059
- default: D(() => [s("div", ir, [
2060
- f.motifLibelle ? (g(), o("div", ar, [u(m, {
2177
+ function Qr(e, t, n, r, i, a) {
2178
+ let o = P("font-awesome-icon"), s = P("cible-picker-block"), c = P("amsom-overlay");
2179
+ return k(), y(c, { loading: r.data.isLoading }, {
2180
+ default: R(() => [S("div", Vr, [
2181
+ a.motifLibelle ? (k(), x("div", Hr, [T(o, {
2061
2182
  icon: "tag",
2062
2183
  class: "text-primary"
2063
- }), s("span", or, [t[9] ||= s("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1), l(C(f.motifLibelle), 1)])])) : a("", !0),
2064
- f.cibleFigee ? (g(), o("div", sr, [(g(!0), o(n, null, b(c.draft.draft.lignes, (e, t) => (g(), o("span", {
2184
+ }), S("span", Ur, [t[9] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1), w(F(a.motifLibelle), 1)])])) : b("", !0),
2185
+ a.cibleFigee ? (k(), x("div", Wr, [(k(!0), x(_, null, M(r.draft.draft.lignes, (e, t) => (k(), x("span", {
2065
2186
  key: t,
2066
2187
  class: "fs-7"
2067
2188
  }, [
2068
- u(m, {
2189
+ T(o, {
2069
2190
  icon: "location-dot",
2070
2191
  class: "text-primary me-2"
2071
2192
  }),
2072
- f.lignesAssociees.length ? (g(), o("span", cr, C(t === 0 ? f.motifLibelle : e.libelle) + " : ", 1)) : a("", !0),
2073
- l(" " + C(c.draft.cibleResume(e)), 1)
2074
- ]))), 128))])) : (g(), i(h, p({ key: 2 }, f.pickerProps(f.lignePrincipale), {
2075
- onChangeMode: t[0] ||= (e) => f.onChangeMode(e),
2076
- onSelectCommune: t[1] ||= (e) => f.onSelectCommune(e),
2077
- onSelectAdresse: t[2] ||= (e) => f.onSelectAdresse(e),
2078
- onSelectEtage: t[3] ||= (e) => f.onSelectEtage(e),
2079
- onSelectModule: t[4] ||= (e) => f.onSelectModule(e),
2080
- onSelectContrat: t[5] ||= (e) => f.onSelectContrat(e),
2081
- onToggleContratReclamant: t[6] ||= (e) => f.onToggleContratReclamant(e),
2082
- onToggleReprendreLocataireActuel: t[7] ||= (e) => f.onToggleReprendre(e),
2083
- onSetModulePrecis: t[8] ||= (e) => c.draft.setModulePrecis(0, e)
2193
+ a.lignesAssociees.length ? (k(), x("span", Gr, F(t === 0 ? a.motifLibelle : e.libelle) + " : ", 1)) : b("", !0),
2194
+ w(" " + F(r.draft.cibleResume(e)), 1)
2195
+ ]))), 128))])) : (k(), y(s, fe({ key: 2 }, a.pickerProps(a.lignePrincipale), {
2196
+ onChangeMode: t[0] ||= (e) => a.onChangeMode(e),
2197
+ onSelectCommune: t[1] ||= (e) => a.onSelectCommune(e),
2198
+ onSelectAdresse: t[2] ||= (e) => a.onSelectAdresse(e),
2199
+ onSelectEtage: t[3] ||= (e) => a.onSelectEtage(e),
2200
+ onSelectModule: t[4] ||= (e) => a.onSelectModule(e),
2201
+ onSelectContrat: t[5] ||= (e) => a.onSelectContrat(e),
2202
+ onToggleContratReclamant: t[6] ||= (e) => a.onToggleContratReclamant(e),
2203
+ onToggleReprendreLocataireActuel: t[7] ||= (e) => a.onToggleReprendre(e),
2204
+ onSetModulePrecis: t[8] ||= (e) => r.draft.setModulePrecis(0, e)
2084
2205
  }), null, 16)),
2085
- !f.cibleFigee && f.lignesAssociees.length && f.reclamantType !== "D" ? (g(), o(n, { key: 3 }, [t[10] ||= s("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
2086
- s("hr", { class: "flex-grow-1 my-0" }),
2087
- s("span", null, "Cible des autres motifs"),
2088
- s("hr", { class: "flex-grow-1 my-0" })
2089
- ], -1), (g(!0), o(n, null, b(f.lignesAssociees, (e, t) => (g(), o("div", {
2206
+ !a.cibleFigee && a.lignesAssociees.length && a.reclamantType !== "D" ? (k(), x(_, { key: 3 }, [t[10] ||= S("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
2207
+ S("hr", { class: "flex-grow-1 my-0" }),
2208
+ S("span", null, "Cible des autres motifs"),
2209
+ S("hr", { class: "flex-grow-1 my-0" })
2210
+ ], -1), (k(!0), x(_, null, M(a.lignesAssociees, (e, t) => (k(), x("div", {
2090
2211
  key: e.idMotif,
2091
2212
  class: "border rounded p-2"
2092
- }, [s("div", lr, [s("span", ur, C(e.libelle), 1), s("div", dr, [s("input", {
2213
+ }, [S("div", Kr, [S("span", qr, F(e.libelle), 1), S("div", Jr, [S("input", {
2093
2214
  id: `memecible-${e.idMotif}`,
2094
2215
  class: "form-check-input",
2095
2216
  type: "checkbox",
2096
2217
  checked: !e.patrimoine,
2097
- onChange: (e) => c.draft.toggleCibleOverride(t + 1)
2098
- }, null, 40, fr), s("label", {
2218
+ onChange: (e) => r.draft.toggleCibleOverride(t + 1)
2219
+ }, null, 40, Yr), S("label", {
2099
2220
  class: "form-check-label fs-7",
2100
2221
  for: `memecible-${e.idMotif}`
2101
- }, " Même cible que la ligne principale ", 8, pr)])]), e.patrimoine ? (g(), o("div", mr, [u(h, p({ ref_for: !0 }, f.pickerProps(e), {
2102
- onChangeMode: (e) => f.onChangeMode(e, t + 1),
2103
- onSelectCommune: (e) => f.onSelectCommune(e, t + 1),
2104
- onSelectAdresse: (e) => f.onSelectAdresse(e, t + 1),
2105
- onSelectEtage: (e) => f.onSelectEtage(e, t + 1),
2106
- onSelectModule: (e) => f.onSelectModule(e, t + 1),
2107
- onSelectContrat: (e) => f.onSelectContrat(e, t + 1),
2108
- onToggleContratReclamant: (e) => f.onToggleContratReclamant(e, t + 1),
2109
- onToggleReprendreLocataireActuel: (e) => f.onToggleReprendre(e, t + 1),
2110
- onSetModulePrecis: (e) => c.draft.setModulePrecis(t + 1, e)
2222
+ }, " Même cible que la ligne principale ", 8, Xr)])]), e.patrimoine ? (k(), x("div", Zr, [T(s, fe({ ref_for: !0 }, a.pickerProps(e), {
2223
+ onChangeMode: (e) => a.onChangeMode(e, t + 1),
2224
+ onSelectCommune: (e) => a.onSelectCommune(e, t + 1),
2225
+ onSelectAdresse: (e) => a.onSelectAdresse(e, t + 1),
2226
+ onSelectEtage: (e) => a.onSelectEtage(e, t + 1),
2227
+ onSelectModule: (e) => a.onSelectModule(e, t + 1),
2228
+ onSelectContrat: (e) => a.onSelectContrat(e, t + 1),
2229
+ onToggleContratReclamant: (e) => a.onToggleContratReclamant(e, t + 1),
2230
+ onToggleReprendreLocataireActuel: (e) => a.onToggleReprendre(e, t + 1),
2231
+ onSetModulePrecis: (e) => r.draft.setModulePrecis(t + 1, e)
2111
2232
  }), null, 16, [
2112
2233
  "onChangeMode",
2113
2234
  "onSelectCommune",
@@ -2118,14 +2239,14 @@ function hr(e, t, r, c, d, f) {
2118
2239
  "onToggleContratReclamant",
2119
2240
  "onToggleReprendreLocataireActuel",
2120
2241
  "onSetModulePrecis"
2121
- ])])) : a("", !0)]))), 128))], 64)) : a("", !0)
2242
+ ])])) : b("", !0)]))), 128))], 64)) : b("", !0)
2122
2243
  ])]),
2123
2244
  _: 1
2124
2245
  }, 8, ["loading"]);
2125
2246
  }
2126
- var gr = /*#__PURE__*/ F(rr, [["render", hr]]), _r = {
2247
+ var $r = /*#__PURE__*/ K(Br, [["render", Qr]]), ei = {
2127
2248
  name: "LigneDocumentBlock",
2128
- components: { AmsomUploadFile: se },
2249
+ components: { AmsomUploadFile: xe },
2129
2250
  props: {
2130
2251
  index: {
2131
2252
  type: Number,
@@ -2142,9 +2263,9 @@ var gr = /*#__PURE__*/ F(rr, [["render", hr]]), _r = {
2142
2263
  },
2143
2264
  emits: ["update"]
2144
2265
  };
2145
- function vr(e, t, n, r, i, a) {
2146
- let c = S("amsom-upload-file");
2147
- return g(), o("div", null, [t[1] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Document", -1), u(c, {
2266
+ function ti(e, t, n, r, i, a) {
2267
+ let o = P("amsom-upload-file");
2268
+ return k(), x("div", null, [t[1] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, "Document", -1), T(o, {
2148
2269
  "model-value": n.fichier,
2149
2270
  renameable: "",
2150
2271
  "output-format": "object",
@@ -2158,12 +2279,12 @@ function vr(e, t, n, r, i, a) {
2158
2279
  "read-only"
2159
2280
  ])]);
2160
2281
  }
2161
- var yr = /*#__PURE__*/ F(_r, [["render", vr]]), br = 4e3, xr = {
2282
+ var ni = /*#__PURE__*/ K(ei, [["render", ti]]), ri = 4e3, ii = {
2162
2283
  name: "LigneDetailBlock",
2163
2284
  components: {
2164
- AmsomAutocomplete: O,
2165
- AmsomTextarea: oe,
2166
- LigneDocumentBlock: yr
2285
+ AmsomAutocomplete: z,
2286
+ AmsomTextarea: be,
2287
+ LigneDocumentBlock: ni
2167
2288
  },
2168
2289
  props: { index: {
2169
2290
  type: Number,
@@ -2171,12 +2292,12 @@ var yr = /*#__PURE__*/ F(_r, [["render", vr]]), br = 4e3, xr = {
2171
2292
  } },
2172
2293
  setup() {
2173
2294
  return {
2174
- draft: P(),
2175
- data: K()
2295
+ draft: G(),
2296
+ data: Z()
2176
2297
  };
2177
2298
  },
2178
2299
  computed: {
2179
- descriptionMaxLength: () => br,
2300
+ descriptionMaxLength: () => ri,
2180
2301
  isPrincipale() {
2181
2302
  return this.index === 0;
2182
2303
  },
@@ -2194,107 +2315,107 @@ var yr = /*#__PURE__*/ F(_r, [["render", vr]]), br = 4e3, xr = {
2194
2315
  }
2195
2316
  },
2196
2317
  methods: {
2197
- timestampToDateInput: nt,
2198
- dateInputToTimestamp: rt,
2318
+ timestampToDateInput: Mt,
2319
+ dateInputToTimestamp: Nt,
2199
2320
  responsableLibelle(e) {
2200
2321
  let t = e && typeof e != "object" ? this.collaborateurs.find((t) => String(t.id) === String(e)) : e;
2201
2322
  return t ? `${t.prenom} ${t.nom}` : "";
2202
2323
  },
2203
2324
  filterCollaborateurs({ search: e, items: t }) {
2204
- let n = (X(e) ?? "").trim();
2205
- return n ? t.filter((e) => (X(`${e.prenom} ${e.nom} ${e.service}`) ?? "").includes(n)) : t;
2325
+ let n = ($(e) ?? "").trim();
2326
+ return n ? t.filter((e) => ($(`${e.prenom} ${e.nom} ${e.service}`) ?? "").includes(n)) : t;
2206
2327
  }
2207
2328
  }
2208
- }, Sr = { class: "d-flex flex-column gap-2" }, Cr = { class: "d-flex align-items-center gap-2 mb-1" }, wr = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, Tr = {
2329
+ }, ai = { class: "d-flex flex-column gap-2" }, oi = { class: "d-flex align-items-center gap-2 mb-1" }, si = { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, ci = {
2209
2330
  key: 0,
2210
2331
  class: "ms-1 text-danger"
2211
- }, Er = {
2332
+ }, li = {
2212
2333
  key: 0,
2213
2334
  class: "form-check form-switch mb-0"
2214
- }, Dr = [
2335
+ }, ui = [
2215
2336
  "id",
2216
2337
  "checked",
2217
2338
  "disabled"
2218
- ], Or = ["for"], kr = {
2339
+ ], di = ["for"], fi = {
2219
2340
  key: 1,
2220
2341
  class: "text-muted d-block",
2221
2342
  style: { "white-space": "pre-line" }
2222
- }, Ar = { class: "row g-3" }, jr = { class: "col-6" }, Mr = { class: "d-flex align-items-center gap-2 mb-1" }, Nr = {
2343
+ }, pi = { class: "row g-3" }, mi = { class: "col-6" }, hi = { class: "d-flex align-items-center gap-2 mb-1" }, gi = {
2223
2344
  key: 0,
2224
2345
  class: "form-check form-switch mb-0"
2225
- }, Pr = [
2346
+ }, _i = [
2226
2347
  "id",
2227
2348
  "checked",
2228
2349
  "disabled"
2229
- ], Fr = ["for"], Ir = ["value"], Lr = {
2350
+ ], vi = ["for"], yi = ["value"], bi = {
2230
2351
  key: 1,
2231
2352
  class: "text-muted d-block"
2232
- }, Rr = {
2353
+ }, xi = {
2233
2354
  key: 0,
2234
2355
  class: "text-muted d-block"
2235
- }, zr = { class: "min-w-0" }, Br = { class: "fw-medium text-truncate" }, Vr = {
2356
+ }, Si = { class: "min-w-0" }, Ci = { class: "fw-medium text-truncate" }, wi = {
2236
2357
  key: 0,
2237
2358
  class: "text-muted d-block"
2238
- }, Hr = {
2359
+ }, Ti = {
2239
2360
  key: 2,
2240
2361
  class: "text-muted"
2241
- }, Ur = { class: "col-12 col-md-6" };
2242
- function Wr(e, t, n, r, c, d) {
2243
- let f = S("amsom-textarea"), p = S("amsom-autocomplete"), m = S("ligne-document-block");
2244
- return g(), o("div", Sr, [s("div", null, [s("div", Cr, [s("label", wr, [t[6] ||= l(" Description", -1), d.isPrincipale ? (g(), o("span", Tr, "*")) : a("", !0)]), d.isPrincipale ? a("", !0) : (g(), o("div", Er, [s("input", {
2245
- id: `memedetail-${d.ligne.idMotif}`,
2362
+ }, Ei = { class: "col-12 col-md-6" };
2363
+ function Di(e, t, n, r, i, a) {
2364
+ let o = P("amsom-textarea"), s = P("amsom-autocomplete"), c = P("ligne-document-block");
2365
+ return k(), x("div", ai, [S("div", null, [S("div", oi, [S("label", si, [t[6] ||= w(" Description", -1), a.isPrincipale ? (k(), x("span", ci, "*")) : b("", !0)]), a.isPrincipale ? b("", !0) : (k(), x("div", li, [S("input", {
2366
+ id: `memedetail-${a.ligne.idMotif}`,
2246
2367
  class: "form-check-input",
2247
2368
  type: "checkbox",
2248
- checked: d.ligne.description == null,
2369
+ checked: a.ligne.description == null,
2249
2370
  disabled: r.draft.isReadonly("description"),
2250
2371
  onChange: t[0] ||= (e) => r.draft.toggleDescriptionOverride(n.index)
2251
- }, null, 40, Dr), s("label", {
2372
+ }, null, 40, ui), S("label", {
2252
2373
  class: "form-check-label fs-7",
2253
- for: `memedetail-${d.ligne.idMotif}`
2254
- }, " Même description ", 8, Or)]))]), !r.draft.isReadonly("description") && (d.isPrincipale || d.ligne.description != null) ? (g(), i(f, {
2374
+ for: `memedetail-${a.ligne.idMotif}`
2375
+ }, " Même description ", 8, di)]))]), !r.draft.isReadonly("description") && (a.isPrincipale || a.ligne.description != null) ? (k(), y(o, {
2255
2376
  key: 0,
2256
- "model-value": d.ligne.description,
2377
+ "model-value": a.ligne.description,
2257
2378
  "input-size": "sm",
2258
- rows: d.isPrincipale ? 4 : 3,
2259
- maxlength: d.descriptionMaxLength,
2260
- placeholder: d.isPrincipale ? "Décrivez la sollicitation…" : "Décrivez ce motif…",
2379
+ rows: a.isPrincipale ? 4 : 3,
2380
+ maxlength: a.descriptionMaxLength,
2381
+ placeholder: a.isPrincipale ? "Décrivez la sollicitation…" : "Décrivez ce motif…",
2261
2382
  "onUpdate:modelValue": t[1] ||= (e) => r.draft.setDescription(n.index, e)
2262
2383
  }, null, 8, [
2263
2384
  "model-value",
2264
2385
  "rows",
2265
2386
  "maxlength",
2266
2387
  "placeholder"
2267
- ])) : (g(), o("small", kr, C((d.ligne.description ?? d.lignePrincipale.description) || "—"), 1))]), s("div", Ar, [s("div", jr, [s("div", null, [s("div", Mr, [t[7] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, " Date des faits ", -1), d.isPrincipale ? a("", !0) : (g(), o("div", Nr, [s("input", {
2268
- id: `memedate-${d.ligne.idMotif}`,
2388
+ ])) : (k(), x("small", fi, F((a.ligne.description ?? a.lignePrincipale.description) || "—"), 1))]), S("div", pi, [S("div", mi, [S("div", null, [S("div", hi, [t[7] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-0" }, " Date des faits ", -1), a.isPrincipale ? b("", !0) : (k(), x("div", gi, [S("input", {
2389
+ id: `memedate-${a.ligne.idMotif}`,
2269
2390
  class: "form-check-input",
2270
2391
  type: "checkbox",
2271
- checked: !d.ligne.dateFaitsOverride,
2392
+ checked: !a.ligne.dateFaitsOverride,
2272
2393
  disabled: r.draft.isReadonly("dateFaits"),
2273
2394
  onChange: t[2] ||= (e) => r.draft.toggleDateFaitsOverride(n.index)
2274
- }, null, 40, Pr), s("label", {
2395
+ }, null, 40, _i), S("label", {
2275
2396
  class: "form-check-label fs-7",
2276
- for: `memedate-${d.ligne.idMotif}`
2277
- }, " Même date ", 8, Fr)]))]), !r.draft.isReadonly("dateFaits") && (d.isPrincipale || d.ligne.dateFaitsOverride) ? (g(), o("input", {
2397
+ for: `memedate-${a.ligne.idMotif}`
2398
+ }, " Même date ", 8, vi)]))]), !r.draft.isReadonly("dateFaits") && (a.isPrincipale || a.ligne.dateFaitsOverride) ? (k(), x("input", {
2278
2399
  key: 0,
2279
- value: d.timestampToDateInput(d.ligne.dateFaits),
2400
+ value: a.timestampToDateInput(a.ligne.dateFaits),
2280
2401
  type: "date",
2281
2402
  class: "form-control form-control-sm",
2282
- onInput: t[3] ||= (e) => r.draft.setDateFaits(n.index, d.dateInputToTimestamp(e.target.value))
2283
- }, null, 40, Ir)) : (g(), o("small", Lr, C(d.timestampToDateInput(d.dateFaits) || "—"), 1))]), s("div", null, [
2284
- t[8] ||= s("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Responsable ", -1),
2285
- r.draft.isReadonly("responsable") ? (g(), o("small", Rr, C(d.responsableLibelle(d.ligne.responsable) || "Déterminé automatiquement"), 1)) : (g(), i(p, {
2403
+ onInput: t[3] ||= (e) => r.draft.setDateFaits(n.index, a.dateInputToTimestamp(e.target.value))
2404
+ }, null, 40, yi)) : (k(), x("small", bi, F(a.timestampToDateInput(a.dateFaits) || "—"), 1))]), S("div", null, [
2405
+ t[8] ||= S("label", { class: "form-label fs-7 fw-semibold text-muted text-uppercase mb-1" }, " Responsable ", -1),
2406
+ r.draft.isReadonly("responsable") ? (k(), x("small", xi, F(a.responsableLibelle(a.ligne.responsable) || "Déterminé automatiquement"), 1)) : (k(), y(s, {
2286
2407
  key: 1,
2287
- "model-value": d.ligne.responsable,
2288
- items: d.collaborateurs,
2408
+ "model-value": a.ligne.responsable,
2409
+ items: a.collaborateurs,
2289
2410
  "get-id": (e) => e?.id,
2290
- "get-input-libelle": d.responsableLibelle,
2291
- "filtering-function": d.filterCollaborateurs,
2411
+ "get-input-libelle": a.responsableLibelle,
2412
+ "filtering-function": a.filterCollaborateurs,
2292
2413
  placeholder: "Rechercher un responsable…",
2293
2414
  "input-size": "sm",
2294
2415
  "hide-choices": "",
2295
2416
  "onUpdate:modelValue": t[4] ||= (e) => r.draft.setResponsable(n.index, e ?? null)
2296
2417
  }, {
2297
- options: D((e) => [s("div", zr, [s("div", Br, C(e?.prenom) + " " + C(e?.nom), 1), e?.service ? (g(), o("small", Vr, C(e.service), 1)) : a("", !0)])]),
2418
+ options: R((e) => [S("div", Si, [S("div", Ci, F(e?.prenom) + " " + F(e?.nom), 1), e?.service ? (k(), x("small", wi, F(e.service), 1)) : b("", !0)])]),
2298
2419
  _: 1
2299
2420
  }, 8, [
2300
2421
  "model-value",
@@ -2303,10 +2424,10 @@ function Wr(e, t, n, r, c, d) {
2303
2424
  "get-input-libelle",
2304
2425
  "filtering-function"
2305
2426
  ])),
2306
- d.isPrincipale && !d.ligne.responsable && !r.draft.isReadonly("responsable") ? (g(), o("small", Hr, " Aucun paramétrage trouvé : le responsable sera déterminé automatiquement. ")) : a("", !0)
2307
- ])]), s("div", Ur, [u(m, {
2427
+ a.isPrincipale && !a.ligne.responsable && !r.draft.isReadonly("responsable") ? (k(), x("small", Ti, " Aucun paramétrage trouvé : le responsable sera déterminé automatiquement. ")) : b("", !0)
2428
+ ])]), S("div", Ei, [T(c, {
2308
2429
  index: n.index,
2309
- fichier: d.ligne.fichier,
2430
+ fichier: a.ligne.fichier,
2310
2431
  readonly: r.draft.isReadonly("fichier"),
2311
2432
  onUpdate: t[5] ||= (e) => r.draft.setFichier(n.index, e)
2312
2433
  }, null, 8, [
@@ -2317,16 +2438,16 @@ function Wr(e, t, n, r, c, d) {
2317
2438
  }
2318
2439
  //#endregion
2319
2440
  //#region src/components/EtapeDetailsBlock.vue
2320
- var Gr = {
2441
+ var Oi = {
2321
2442
  name: "EtapeDetailsBlock",
2322
2443
  components: {
2323
- AmsomOverlay: t,
2324
- LigneDetailBlock: /* @__PURE__ */ F(xr, [["render", Wr]])
2444
+ AmsomOverlay: g,
2445
+ LigneDetailBlock: /* @__PURE__ */ K(ii, [["render", Di]])
2325
2446
  },
2326
2447
  setup() {
2327
2448
  return {
2328
- draft: P(),
2329
- data: K()
2449
+ draft: G(),
2450
+ data: Z()
2330
2451
  };
2331
2452
  },
2332
2453
  computed: {
@@ -2377,67 +2498,67 @@ var Gr = {
2377
2498
  }
2378
2499
  }
2379
2500
  }
2380
- }, Kr = { class: "d-flex flex-column gap-3" }, qr = { class: "alert alert-light border py-2 px-3 mb-0 d-flex flex-column gap-1" }, Jr = {
2501
+ }, ki = { class: "d-flex flex-column gap-3" }, Ai = { class: "alert alert-light border py-2 px-3 mb-0 d-flex flex-column gap-1" }, ji = {
2381
2502
  key: 0,
2382
2503
  class: "fs-7"
2383
- }, Yr = { class: "fs-7" }, Xr = { class: "bg-light rounded px-2 py-1 d-flex flex-column gap-1" }, Zr = { class: "fs-7" }, Qr = { class: "fs-7" };
2384
- function $r(e, t, r, c, d, f) {
2385
- let p = S("font-awesome-icon"), m = S("ligne-detail-block"), h = S("amsom-overlay");
2386
- return g(), i(h, { loading: c.data.isLoading && !c.data.cache.collaborateurs }, {
2387
- default: D(() => [s("div", Kr, [
2388
- s("div", qr, [f.motifLibelle ? (g(), o("span", Jr, [
2389
- u(p, {
2504
+ }, Mi = { class: "fs-7" }, Ni = { class: "bg-light rounded px-2 py-1 d-flex flex-column gap-1" }, Pi = { class: "fs-7" }, Fi = { class: "fs-7" };
2505
+ function Ii(e, t, n, r, i, a) {
2506
+ let o = P("font-awesome-icon"), s = P("ligne-detail-block"), c = P("amsom-overlay");
2507
+ return k(), y(c, { loading: r.data.isLoading && !r.data.cache.collaborateurs }, {
2508
+ default: R(() => [S("div", ki, [
2509
+ S("div", Ai, [a.motifLibelle ? (k(), x("span", ji, [
2510
+ T(o, {
2390
2511
  icon: "tag",
2391
2512
  class: "text-primary me-2"
2392
2513
  }),
2393
- t[0] ||= s("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
2394
- l(C(f.motifLibelle), 1)
2395
- ])) : a("", !0), s("span", Yr, [
2396
- u(p, {
2514
+ t[0] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
2515
+ w(F(a.motifLibelle), 1)
2516
+ ])) : b("", !0), S("span", Mi, [
2517
+ T(o, {
2397
2518
  icon: "location-dot",
2398
2519
  class: "text-primary me-2"
2399
2520
  }),
2400
- t[1] ||= s("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Cible", -1),
2401
- l(" " + C(c.draft.cibleResume(f.lignePrincipale)), 1)
2521
+ t[1] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Cible", -1),
2522
+ w(" " + F(r.draft.cibleResume(a.lignePrincipale)), 1)
2402
2523
  ])]),
2403
- u(m, { index: 0 }),
2404
- f.lignesAssociees.length ? (g(), o(n, { key: 0 }, [t[4] ||= s("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
2405
- s("hr", { class: "flex-grow-1 my-0" }),
2406
- s("span", null, "Détail des autres motifs"),
2407
- s("hr", { class: "flex-grow-1 my-0" })
2408
- ], -1), (g(!0), o(n, null, b(f.lignesAssociees, (e, n) => (g(), o("div", {
2524
+ T(s, { index: 0 }),
2525
+ a.lignesAssociees.length ? (k(), x(_, { key: 0 }, [t[4] ||= S("div", { class: "d-flex align-items-center gap-2 text-muted fs-7" }, [
2526
+ S("hr", { class: "flex-grow-1 my-0" }),
2527
+ S("span", null, "Détail des autres motifs"),
2528
+ S("hr", { class: "flex-grow-1 my-0" })
2529
+ ], -1), (k(!0), x(_, null, M(a.lignesAssociees, (e, n) => (k(), x("div", {
2409
2530
  key: e.idMotif,
2410
2531
  class: "border rounded p-2 d-flex flex-column gap-2"
2411
- }, [s("div", Xr, [s("span", Zr, [
2412
- u(p, {
2532
+ }, [S("div", Ni, [S("span", Pi, [
2533
+ T(o, {
2413
2534
  icon: "tag",
2414
2535
  class: "text-primary me-2"
2415
2536
  }),
2416
- t[2] ||= s("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
2417
- l(" " + C(e.libelle), 1)
2418
- ]), s("span", Qr, [
2419
- u(p, {
2537
+ t[2] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Motif", -1),
2538
+ w(" " + F(e.libelle), 1)
2539
+ ]), S("span", Fi, [
2540
+ T(o, {
2420
2541
  icon: "location-dot",
2421
2542
  class: "text-primary me-2"
2422
2543
  }),
2423
- t[3] ||= s("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Cible", -1),
2424
- l(" " + C(c.draft.cibleResume(e)), 1)
2425
- ])]), u(m, { index: n + 1 }, null, 8, ["index"])]))), 128))], 64)) : a("", !0)
2544
+ t[3] ||= S("span", { class: "text-muted text-uppercase fw-semibold me-1" }, "Cible", -1),
2545
+ w(" " + F(r.draft.cibleResume(e)), 1)
2546
+ ])]), T(s, { index: n + 1 }, null, 8, ["index"])]))), 128))], 64)) : b("", !0)
2426
2547
  ])]),
2427
2548
  _: 1
2428
2549
  }, 8, ["loading"]);
2429
2550
  }
2430
2551
  //#endregion
2431
2552
  //#region src/components/StepperBlock.vue
2432
- var ei = {
2553
+ var Li = {
2433
2554
  name: "StepperBlock",
2434
2555
  components: {
2435
- AmsomHorizontalStepper: re,
2436
- AmsomOverlay: t,
2437
- EtapeReclamantBlock: Mt,
2438
- EtapeCategorieBlock: fn,
2439
- EtapeCibleBlock: gr,
2440
- EtapeDetailsBlock: /* @__PURE__ */ F(Gr, [["render", $r]])
2556
+ AmsomHorizontalStepper: ve,
2557
+ AmsomOverlay: g,
2558
+ EtapeReclamantBlock: vn,
2559
+ EtapeCategorieBlock: Yn,
2560
+ EtapeCibleBlock: $r,
2561
+ EtapeDetailsBlock: /* @__PURE__ */ K(Oi, [["render", Ii]])
2441
2562
  },
2442
2563
  props: {
2443
2564
  step: {
@@ -2456,9 +2577,9 @@ var ei = {
2456
2577
  ],
2457
2578
  setup() {
2458
2579
  return {
2459
- draft: P(),
2460
- data: K(),
2461
- options: Y()
2580
+ draft: G(),
2581
+ data: Z(),
2582
+ options: Q()
2462
2583
  };
2463
2584
  },
2464
2585
  computed: {
@@ -2496,11 +2617,14 @@ var ei = {
2496
2617
  let e = this.lignePrincipale.idMotif;
2497
2618
  return e ? this.data.cache.motifs?.find((t) => t.id === e)?.aide ?? null : null;
2498
2619
  },
2620
+ provenanceValid() {
2621
+ return this.options.provenances.some((e) => e.id === this.draft.draft.provenance);
2622
+ },
2499
2623
  canGoNext() {
2500
2624
  return this.gatePassed(this.currentKey);
2501
2625
  },
2502
2626
  canCreer() {
2503
- return !!this.lignePrincipale.idMotif && !!this.draft.draft.provenance && this.draft.ciblesValid && this.draft.detailsValid && this.draft.reclamantSelectionne != null;
2627
+ return !!this.lignePrincipale.idMotif && this.provenanceValid && this.draft.ciblesValid && this.draft.detailsValid && this.draft.reclamantSelectionne != null;
2504
2628
  },
2505
2629
  stepperSteps() {
2506
2630
  return this.steps.map((e, t) => {
@@ -2529,7 +2653,7 @@ var ei = {
2529
2653
  } },
2530
2654
  methods: {
2531
2655
  gatePassed(e) {
2532
- return e === "reclamant" ? this.draft.reclamantSelectionne != null && !!this.draft.draft.provenance : e === "categorie" ? !!this.lignePrincipale.idMotif && !!this.draft.draft.provenance : e !== "cible" || this.draft.ciblesValid;
2656
+ return e === "reclamant" ? this.draft.reclamantSelectionne != null && this.provenanceValid : e === "categorie" ? !!this.lignePrincipale.idMotif && this.provenanceValid : e !== "cible" || this.draft.ciblesValid;
2533
2657
  },
2534
2658
  onStepClick(e) {
2535
2659
  e < this.step && this.$emit("update:step", e);
@@ -2549,73 +2673,73 @@ var ei = {
2549
2673
  }));
2550
2674
  }
2551
2675
  }
2552
- }, ti = { class: "d-flex flex-column gap-3" }, ni = {
2676
+ }, Ri = { class: "d-flex flex-column gap-3" }, zi = {
2553
2677
  key: 0,
2554
2678
  class: "w-100 fs-6 fw-medium my-3 alert alert-info",
2555
2679
  style: { "white-space": "pre-line" }
2556
- }, ri = { style: { "min-height": "260px" } }, ii = { class: "d-flex justify-content-between" }, ai = { key: 1 }, oi = ["disabled"], si = ["disabled"];
2557
- function ci(e, t, n, r, f, p) {
2558
- let m = S("amsom-horizontal-stepper"), _ = S("font-awesome-icon"), v = S("etape-reclamant-block"), y = S("etape-categorie-block"), b = S("etape-cible-block"), ee = S("etape-details-block"), w = S("amsom-overlay");
2559
- return g(), i(w, { loading: n.creating }, {
2560
- default: D(() => [s("div", ti, [
2561
- u(m, {
2562
- steps: p.stepperSteps,
2680
+ }, Bi = { style: { "min-height": "260px" } }, Vi = { class: "d-flex justify-content-between" }, Hi = { key: 1 }, Ui = ["disabled"], Wi = ["disabled"];
2681
+ function Gi(e, t, n, r, i, a) {
2682
+ let o = P("amsom-horizontal-stepper"), s = P("font-awesome-icon"), c = P("etape-reclamant-block"), l = P("etape-categorie-block"), u = P("etape-cible-block"), d = P("etape-details-block"), f = P("amsom-overlay");
2683
+ return k(), y(f, { loading: n.creating }, {
2684
+ default: R(() => [S("div", Ri, [
2685
+ T(o, {
2686
+ steps: a.stepperSteps,
2563
2687
  size: "md",
2564
- onStepClick: p.onStepClick
2688
+ onStepClick: a.onStepClick
2565
2689
  }, null, 8, ["steps", "onStepClick"]),
2566
- p.aideMotif ? (g(), o("div", ni, [u(_, {
2690
+ a.aideMotif ? (k(), x("div", zi, [T(s, {
2567
2691
  icon: "circle-info",
2568
2692
  class: "text-info-emphasis me-2"
2569
- }), s("span", null, C(p.aideMotif), 1)])) : a("", !0),
2570
- s("div", ri, [p.currentKey === "reclamant" ? (g(), i(v, {
2693
+ }), S("span", null, F(a.aideMotif), 1)])) : b("", !0),
2694
+ S("div", Bi, [a.currentKey === "reclamant" ? (k(), y(c, {
2571
2695
  key: 0,
2572
2696
  premiere: n.step === 1
2573
- }, c({ _: 2 }, [e.$slots.reclamant ? {
2697
+ }, C({ _: 2 }, [e.$slots.reclamant ? {
2574
2698
  name: "reclamant",
2575
- fn: D((t) => [x(e.$slots, "reclamant", h(d(t)))]),
2699
+ fn: R((t) => [N(e.$slots, "reclamant", O(E(t)))]),
2576
2700
  key: "0"
2577
- } : void 0]), 1032, ["premiere"])) : p.currentKey === "categorie" ? (g(), i(y, {
2701
+ } : void 0]), 1032, ["premiere"])) : a.currentKey === "categorie" ? (k(), y(l, {
2578
2702
  key: 1,
2579
2703
  premiere: n.step === 1
2580
- }, null, 8, ["premiere"])) : p.currentKey === "cible" ? (g(), i(b, { key: 2 })) : p.currentKey === "details" ? (g(), i(ee, { key: 3 })) : a("", !0)]),
2581
- s("div", ii, [n.step > 1 ? (g(), o("button", {
2704
+ }, null, 8, ["premiere"])) : a.currentKey === "cible" ? (k(), y(u, { key: 2 })) : a.currentKey === "details" ? (k(), y(d, { key: 3 })) : b("", !0)]),
2705
+ S("div", Vi, [n.step > 1 ? (k(), x("button", {
2582
2706
  key: 0,
2583
2707
  class: "btn btn-sm btn-outline-secondary",
2584
- onClick: t[0] ||= (...e) => p.goPrevious && p.goPrevious(...e)
2585
- }, [u(_, {
2708
+ onClick: t[0] ||= (...e) => a.goPrevious && a.goPrevious(...e)
2709
+ }, [T(s, {
2586
2710
  icon: "chevron-left",
2587
2711
  class: "me-1"
2588
- }), t[3] ||= l(" Précédent ", -1)])) : (g(), o("span", ai)), n.step < p.steps.length ? (g(), o("button", {
2712
+ }), t[3] ||= w(" Précédent ", -1)])) : (k(), x("span", Hi)), n.step < a.steps.length ? (k(), x("button", {
2589
2713
  key: 2,
2590
2714
  class: "btn btn-sm btn-primary",
2591
- disabled: !p.canGoNext,
2592
- onClick: t[1] ||= (...e) => p.goNext && p.goNext(...e)
2593
- }, [t[4] ||= l(" Suivant ", -1), u(_, {
2715
+ disabled: !a.canGoNext,
2716
+ onClick: t[1] ||= (...e) => a.goNext && a.goNext(...e)
2717
+ }, [t[4] ||= w(" Suivant ", -1), T(s, {
2594
2718
  icon: "chevron-right",
2595
2719
  class: "ms-1"
2596
- })], 8, oi)) : (g(), o("button", {
2720
+ })], 8, Ui)) : (k(), x("button", {
2597
2721
  key: 3,
2598
2722
  class: "btn btn-sm btn-success",
2599
- disabled: !p.canCreer || n.creating,
2723
+ disabled: !a.canCreer || n.creating,
2600
2724
  onClick: t[2] ||= (t) => e.$emit("submit")
2601
- }, [u(_, {
2725
+ }, [T(s, {
2602
2726
  icon: "check",
2603
2727
  class: "me-1"
2604
- }), t[5] ||= l(" Créer la sollicitation ", -1)], 8, si))])
2728
+ }), t[5] ||= w(" Créer la sollicitation ", -1)], 8, Wi))])
2605
2729
  ])]),
2606
2730
  _: 3
2607
2731
  }, 8, ["loading"]);
2608
2732
  }
2609
- var li = /*#__PURE__*/ F(ei, [["render", ci]]), ui = (e, { signal: t, baseUrl: n } = {}) => Me("/v2/cresol/creer_sollicitation", e, {
2733
+ var Ki = /*#__PURE__*/ K(Li, [["render", Gi]]), qi = (e, { signal: t, baseUrl: n } = {}) => it("/v2/cresol/creer_sollicitation", e, {
2610
2734
  signal: t,
2611
2735
  baseUrl: n
2612
- }), di = ({ idSollicitation: e, pj: t }, { signal: n, baseUrl: r } = {}) => Me("/v2/cresol/upload_sollicitation_ged", {
2736
+ }), Ji = ({ idSollicitation: e, pj: t }, { signal: n, baseUrl: r } = {}) => it("/v2/cresol/upload_sollicitation_ged", {
2613
2737
  idSollicitation: e,
2614
2738
  pj: t
2615
2739
  }, {
2616
2740
  signal: n,
2617
2741
  baseUrl: r
2618
- }), Z = {
2742
+ }), Yi = {
2619
2743
  modelValue: {
2620
2744
  type: Object,
2621
2745
  default: null
@@ -2634,10 +2758,28 @@ var li = /*#__PURE__*/ F(ei, [["render", ci]]), ui = (e, { signal: t, baseUrl: n
2634
2758
  "step"
2635
2759
  ].includes(e)
2636
2760
  },
2761
+ typesReclamant: {
2762
+ type: Array,
2763
+ default: null,
2764
+ validator: (e) => e.every((e) => U.includes(e))
2765
+ },
2766
+ typesReclamantExclus: {
2767
+ type: Array,
2768
+ default: () => [],
2769
+ validator: (e) => e.every((e) => U.includes(e))
2770
+ },
2771
+ provenances: {
2772
+ type: Array,
2773
+ default: () => [...we]
2774
+ },
2775
+ provenancesExclues: {
2776
+ type: Array,
2777
+ default: () => []
2778
+ },
2637
2779
  readonly: {
2638
2780
  type: [Boolean, Array],
2639
2781
  default: !1,
2640
- validator: (e) => typeof e == "boolean" || e.every((e) => M.includes(e))
2782
+ validator: (e) => typeof e == "boolean" || e.every((e) => Ne.includes(e))
2641
2783
  },
2642
2784
  modules: {
2643
2785
  type: Array,
@@ -2663,7 +2805,7 @@ var li = /*#__PURE__*/ F(ei, [["render", ci]]), ui = (e, { signal: t, baseUrl: n
2663
2805
  type: String,
2664
2806
  default: null
2665
2807
  }
2666
- }, fi = Object.keys(Z), Q = [
2808
+ }, Xi = Object.keys(Yi), Zi = [
2667
2809
  "update:modelValue",
2668
2810
  "reclamantChange",
2669
2811
  "motifChange",
@@ -2672,33 +2814,44 @@ var li = /*#__PURE__*/ F(ei, [["render", ci]]), ui = (e, { signal: t, baseUrl: n
2672
2814
  "created",
2673
2815
  "createError",
2674
2816
  "error"
2675
- ], pi = {
2817
+ ], Qi = {
2676
2818
  name: "CreerSollicitationForm",
2677
2819
  components: {
2678
- AsideBlock: De,
2679
- StepperBlock: li
2820
+ AsideBlock: Xe,
2821
+ StepperBlock: Ki
2680
2822
  },
2681
- props: { ...Z },
2682
- emits: [...Q],
2823
+ props: { ...Yi },
2824
+ emits: [...Zi],
2683
2825
  setup(e, { emit: t }) {
2684
- let n = (e) => t("error", e), i = { baseUrl: w(e, "baseUrl") }, a = $e(Qe({
2826
+ let n = (e) => t("error", e), r = { baseUrl: I(e, "baseUrl") }, i = kt(Ot({
2685
2827
  onError: n,
2686
- ...i
2687
- })), o = y(null), s = r(() => o.value ?? e.modules ?? []), c = be(ye({
2688
- reclamants: r(() => e.reclamantMode === "step" ? [] : e.reclamants),
2689
- modules: s,
2690
- idModulePrefere: w(e, "idModule"),
2691
- readonly: w(e, "readonly")
2828
+ ...r
2829
+ })), a = j(null), o = v(() => a.value ?? e.modules ?? []), s = Ue(He({
2830
+ reclamants: v(() => e.reclamantMode === "step" ? [] : e.reclamants),
2831
+ modules: o,
2832
+ idModulePrefere: I(e, "idModule"),
2833
+ readonly: I(e, "readonly")
2692
2834
  }));
2693
- return Pt(v({
2694
- nomenclatureFilter: w(e, "nomenclatureFilter"),
2695
- reclamantMode: w(e, "reclamantMode"),
2696
- modulesReclamant: s,
2697
- ...i
2835
+ return It(A({
2836
+ nomenclatureFilter: I(e, "nomenclatureFilter"),
2837
+ reclamantMode: I(e, "reclamantMode"),
2838
+ typesReclamant: v(() => (e.typesReclamant ?? U).filter((t) => !e.typesReclamantExclus.includes(t))),
2839
+ provenances: v(() => {
2840
+ let t = i.cache.provenances ?? [];
2841
+ return (e.provenances ?? t.map((e) => e.id)).filter((t) => !e.provenancesExclues.includes(t)).flatMap((e) => {
2842
+ let n = t.find((t) => t.id === e);
2843
+ return n ? [{
2844
+ ...n,
2845
+ icon: Ce(e)
2846
+ }] : [];
2847
+ });
2848
+ }),
2849
+ modulesReclamant: o,
2850
+ ...r
2698
2851
  })), {
2699
- data: a,
2700
- draft: c,
2701
- modulesCharges: o,
2852
+ data: i,
2853
+ draft: s,
2854
+ modulesCharges: a,
2702
2855
  onError: n
2703
2856
  };
2704
2857
  },
@@ -2734,7 +2887,7 @@ var li = /*#__PURE__*/ F(ei, [["render", ci]]), ui = (e, { signal: t, baseUrl: n
2734
2887
  let e = this.draft.reclamantSelectionne;
2735
2888
  this.$watch("draft.reclamantSelectionne", async (t) => {
2736
2889
  this.$emit("reclamantChange", t), await this.chargerModulesReclamant(t, e) && this.draft.syncReclamant();
2737
- }), this.$watch(() => JSON.stringify(this.motifChoisi), () => this.$emit("motifChange", this.motifChoisi)), this.data.loadNomenclature(), await this.chargerModulesReclamant(e, e) && this.draft.prefillCiblePrincipale();
2890
+ }), this.$watch(() => JSON.stringify(this.motifChoisi), () => this.$emit("motifChange", this.motifChoisi)), this.data.loadNomenclature(), this.data.loadProvenances(), await this.chargerModulesReclamant(e, e) && this.draft.prefillCiblePrincipale();
2738
2891
  },
2739
2892
  methods: {
2740
2893
  async chargerModulesReclamant(e, t) {
@@ -2754,10 +2907,10 @@ var li = /*#__PURE__*/ F(ei, [["render", ci]]), ui = (e, { signal: t, baseUrl: n
2754
2907
  if (!await this.autoriserCreation(e)) return;
2755
2908
  let t;
2756
2909
  try {
2757
- t = await ui(e, this.requestOptions) ?? [];
2910
+ t = await qi(e, this.requestOptions) ?? [];
2758
2911
  } catch (t) {
2759
- if (qe(t)) return;
2760
- let n = V(t);
2912
+ if (xt(t)) return;
2913
+ let n = bt(t);
2761
2914
  this.$emit("createError", {
2762
2915
  error: t,
2763
2916
  message: n,
@@ -2807,7 +2960,7 @@ var li = /*#__PURE__*/ F(ei, [["render", ci]]), ui = (e, { signal: t, baseUrl: n
2807
2960
  message: t
2808
2961
  };
2809
2962
  };
2810
- return a?.id ? di({
2963
+ return a?.id ? Ji({
2811
2964
  idSollicitation: a.id,
2812
2965
  pj: {
2813
2966
  name: n.name,
@@ -2818,34 +2971,34 @@ var li = /*#__PURE__*/ F(ei, [["render", ci]]), ui = (e, { signal: t, baseUrl: n
2818
2971
  ...o,
2819
2972
  ok: !0,
2820
2973
  message: null
2821
- })).catch((e) => s(V(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
2974
+ })).catch((e) => s(bt(e))) : Promise.resolve(s("sollicitation introuvable dans la réponse"));
2822
2975
  });
2823
2976
  return Promise.all(n);
2824
2977
  }
2825
2978
  }
2826
- }, mi = { class: "row g-3" }, hi = {
2979
+ }, $i = { class: "row g-3" }, ea = {
2827
2980
  key: 0,
2828
2981
  class: "col-12 col-lg-4"
2829
2982
  };
2830
- function gi(e, t, n, r, i, l) {
2831
- let f = S("aside-block"), p = S("stepper-block");
2832
- return g(), o("div", mi, [e.aside ? (g(), o("div", hi, [x(e.$slots, "aside", {}, () => [u(f, { "nb-similaires": e.nbSimilaires }, c({ _: 2 }, [e.$slots["aside-similaires"] ? {
2983
+ function ta(e, t, n, r, i, a) {
2984
+ let o = P("aside-block"), s = P("stepper-block");
2985
+ return k(), x("div", $i, [e.aside ? (k(), x("div", ea, [N(e.$slots, "aside", {}, () => [T(o, { "nb-similaires": e.nbSimilaires }, C({ _: 2 }, [e.$slots["aside-similaires"] ? {
2833
2986
  name: "similaires",
2834
- fn: D((t) => [x(e.$slots, "aside-similaires", h(d(t)))]),
2987
+ fn: R((t) => [N(e.$slots, "aside-similaires", O(E(t)))]),
2835
2988
  key: "0"
2836
2989
  } : void 0, e.$slots["aside-evenements"] ? {
2837
2990
  name: "evenements",
2838
- fn: D(() => [x(e.$slots, "aside-evenements")]),
2991
+ fn: R(() => [N(e.$slots, "aside-evenements")]),
2839
2992
  key: "1"
2840
- } : void 0]), 1032, ["nb-similaires"])])])) : a("", !0), s("div", { class: m(["col-12", e.aside ? "col-lg-8" : ""]) }, [u(p, {
2993
+ } : void 0]), 1032, ["nb-similaires"])])])) : b("", !0), S("div", { class: D(["col-12", e.aside ? "col-lg-8" : ""]) }, [T(s, {
2841
2994
  step: i.currentStep,
2842
2995
  "onUpdate:step": t[0] ||= (e) => i.currentStep = e,
2843
2996
  creating: i.creating,
2844
2997
  onStepChange: t[1] ||= (t) => e.$emit("stepChange", t),
2845
- onSubmit: l.creer
2846
- }, c({ _: 2 }, [e.$slots.reclamant ? {
2998
+ onSubmit: a.creer
2999
+ }, C({ _: 2 }, [e.$slots.reclamant ? {
2847
3000
  name: "reclamant",
2848
- fn: D((t) => [x(e.$slots, "reclamant", h(d(t)))]),
3001
+ fn: R((t) => [N(e.$slots, "reclamant", O(E(t)))]),
2849
3002
  key: "0"
2850
3003
  } : void 0]), 1032, [
2851
3004
  "step",
@@ -2853,14 +3006,14 @@ function gi(e, t, n, r, i, l) {
2853
3006
  "onSubmit"
2854
3007
  ])], 2)]);
2855
3008
  }
2856
- var $ = /*#__PURE__*/ F(pi, [["render", gi]]), _i = {
3009
+ var na = /*#__PURE__*/ K(Qi, [["render", ta]]), ra = {
2857
3010
  name: "CreerSollicitationModal",
2858
3011
  components: {
2859
- AmsomModal: e,
2860
- CreerSollicitationForm: $
3012
+ AmsomModal: ue,
3013
+ CreerSollicitationForm: na
2861
3014
  },
2862
3015
  props: {
2863
- ...Z,
3016
+ ...Yi,
2864
3017
  titre: {
2865
3018
  type: String,
2866
3019
  default: "Nouvelle sollicitation"
@@ -2870,36 +3023,36 @@ var $ = /*#__PURE__*/ F(pi, [["render", gi]]), _i = {
2870
3023
  default: !0
2871
3024
  }
2872
3025
  },
2873
- emits: [...Q, "close"],
3026
+ emits: [...Zi, "close"],
2874
3027
  computed: {
2875
3028
  formProps() {
2876
- return Object.fromEntries(fi.map((e) => [e, this[e]]));
3029
+ return Object.fromEntries(Xi.map((e) => [e, this[e]]));
2877
3030
  },
2878
3031
  formListeners() {
2879
- return Object.fromEntries(Q.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
3032
+ return Object.fromEntries(Zi.filter((e) => e !== "created").map((e) => [e, (...t) => this.$emit(e, ...t)]));
2880
3033
  }
2881
3034
  },
2882
3035
  methods: { onCreated(...e) {
2883
3036
  this.$emit("created", ...e), this.closeOnCreated && this.$emit("close");
2884
3037
  } }
2885
- }, vi = { class: "fw-medium fs-5" };
2886
- function yi(e, t, n, r, a, o) {
2887
- let l = S("creer-sollicitation-form"), f = S("amsom-modal");
2888
- return g(), i(f, {
3038
+ }, ia = { class: "fw-medium fs-5" };
3039
+ function aa(e, t, n, r, i, a) {
3040
+ let o = P("creer-sollicitation-form"), s = P("amsom-modal");
3041
+ return k(), y(s, {
2889
3042
  "close-option": "",
2890
3043
  size: "xl",
2891
3044
  onClose: t[0] ||= (t) => e.$emit("close")
2892
3045
  }, {
2893
- default: D(() => [s("span", vi, C(n.titre), 1), u(l, p({ class: "pt-3" }, o.formProps, ee(o.formListeners), { onCreated: o.onCreated }), c({ _: 2 }, [b(e.$slots, (t, n) => ({
3046
+ default: R(() => [S("span", ia, F(n.titre), 1), T(o, fe({ class: "pt-3" }, a.formProps, me(a.formListeners), { onCreated: a.onCreated }), C({ _: 2 }, [M(e.$slots, (t, n) => ({
2894
3047
  name: n,
2895
- fn: D((t) => [x(e.$slots, n, h(d(t ?? {})))])
3048
+ fn: R((t) => [N(e.$slots, n, O(E(t ?? {})))])
2896
3049
  }))]), 1040, ["onCreated"])]),
2897
3050
  _: 3
2898
3051
  });
2899
3052
  }
2900
- var bi = /*#__PURE__*/ F(_i, [["render", yi]]), xi = {
2901
- CreerSollicitationModal: bi,
2902
- CreerSollicitationForm: $
3053
+ var oa = /*#__PURE__*/ K(ra, [["render", aa]]), sa = {
3054
+ CreerSollicitationModal: oa,
3055
+ CreerSollicitationForm: na
2903
3056
  };
2904
3057
  //#endregion
2905
- export { $ as CreerSollicitationForm, bi as CreerSollicitationModal, le as DEFAULT_PROVENANCE_CONTACT, ce as PROVENANCES_CONTACT, M as READONLY_FIELDS, Oe as configureCresol, xi as default, N as getDefaultDraft, j as getDefaultLigne, A as getDefaultPatrimoine, Ze as resetCresolCache };
3058
+ export { na as CreerSollicitationForm, oa as CreerSollicitationModal, Te as DEFAULT_PROVENANCE_CONTACT, we as PROVENANCES_CONTACT_DEFAUT, V as PROVENANCE_CONTACT_ICONS, Ne as READONLY_FIELDS, Qe as configureCresol, sa as default, Pe as getDefaultDraft, Me as getDefaultLigne, W as getDefaultPatrimoine, Et as resetCresolCache };