PageSourceSearch

https://fromdust.art/static/js/3695.f8feaf12.chunk.js

js fromdust.art collected 2026-09-30 12:17:00 UTC 29,773 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[3695],{23695:(e,n,t)=>{t.r(n),t.d(n,{default:()=>c});var i=t(89379),o=t(65043),r=t(79722),s=t(63331),a=t(31555),l=t(70579);const d={page:{minHeight:"100vh",background:"#f6f4ef",fontFamily:"-apple-system, 'Segoe UI', Roboto, Arial, sans-serif",color:"#2b3a35"},tete:{background:"#fff",borderBottom:"1px solid #e5e0d6",padding:"16px 22px",display:"flex",alignItems:"baseline",gap:"10px",flexWrap:"wrap"},nom:{fontFamily:"Georgia, serif",fontSize:"19px",color:"#46685b",fontWeight:700},corps:{maxWidth:"720px",margin:"28px auto 60px",padding:"0 16px"},carte:{background:"#fff",border:"1px solid #e5e0d6",borderRadius:"12px",padding:"20px 24px",marginBottom:"16px"},h2:{fontSize:"16px",color:"#46685b",marginBottom:"12px",marginTop:0},champ:{width:"100%",padding:"10px 13px",border:"1.5px solid #ddd6c8",borderRadius:"8px",fontSize:"14.5px",boxSizing:"border-box",background:"#fdfcfa"},bouton:{background:"#46685b",color:"#fff",border:"none",borderRadius:"9px",padding:"11px 22px",fontSize:"14.5px",fontWeight:700,cursor:"pointer"},boutonSec:{background:"transparent",color:"#46685b",border:"1.5px solid #46685b",borderRadius:"9px",padding:"9px 18px",fontSize:"13.5px",fontWeight:600,cursor:"pointer"},doux:{color:"#64726d",fontSize:"13.5px",lineHeight:1.55},erreur:{background:"#fdf1ee",border:"1px solid #eccfc6",color:"#8a3a28",borderRadius:"8px",padding:"10px 14px",fontSize:"13.5px",marginTop:"10px"},succes:{background:"#ecf6f1",border:"1px solid #cfe6da",color:"#2e7d5b",borderRadius:"8px",padding:"10px 14px",fontSize:"13.5px",marginTop:"10px"},ligne:{display:"flex",alignItems:"center",gap:"12px",padding:"11px 14px",background:"#faf8f4",border:"1px solid #eee8dc",borderRadius:"10px",marginBottom:"8px",flexWrap:"wrap"},badge:{fontSize:"11px",fontWeight:700,borderRadius:"14px",padding:"3px 10px"}};function c(e){var n,t,c,p,u,x,m,h,f,v,g,y;let{siteRef:b}=e;const j="espace_client_".concat(window.location.host),[A,S]=(0,o.useState)(null),[_,z]=(0,o.useState)(localStorage.getItem(j)||null),[k,w]=(0,o.useState)("chargement"),[C,B]=(0,o.useState)(""),[q,I]=(0,o.useState)(""),[R,T]=(0,o.useState)(null),[W,L]=(0,o.useState)(null),[V,E]=(0,o.useState)(!1),[D,F]=(0,o.useState)(null),[H,P]=(0,o.useState)(null),[N,G]=(0,o.useState)(null),[M,O]=(0,o.useState)(null),[J,K]=(0,o.useState)(null),[Q,U]=(0,o.useState)(!1),X=(0,o.useCallback)(async(e,n)=>{try{const n=await r.A.get("".concat(s.n,"/public/espace-client/moi"),{headers:{Authorization:"Bearer ".concat(e)}});T(n.data),w("connecte");try{const n=await r.A.get("".concat(s.n,"/public/espace-client/questionnaires"),{headers:{Authorization:"Bearer ".concat(e)}});F(n.data)}catch(t){}}catch(t){localStorage.removeItem(j),z(null),w("login")}},[j]);(0,o.useEffect)(()=>{(async()=>{try{const a=b&&b.startsWith("custom:")?"".concat(s.n,"/public/website-from-host"):"".concat(s.n,"/public/websites/by-subdomain/").concat(b),l=await r.A.get(a),d=l.data.website||l.data;S(d);const c=window.location.hash.match(/majorite=([^&]+)/);if(c){window.history.replaceState(null,"",window.location.pathname);let t={};try{t=(await r.A.get("".concat(s.n,"/public/espace-client/majorite-info"),{params:{token:c[1]}})).data}catch(o){var e,n;I((null===(e=o.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.detail)||"Lien invalide ou expir\xe9.")}return K({token:c[1],vue:"choix",info:t}),void w("majorite")}const p=window.location.hash.match(/jeton=([^&]+)/);if(p){window.history.replaceState(null,"",window.location.pathname);try{const e=await r.A.post("".concat(s.n,"/public/espace-client/echange"),{token:p[1]});return localStorage.setItem(j,e.data.session),z(e.data.session),void await X(e.data.session,d.id)}catch(o){var t,i;I((null===(t=o.response)||void 0===t||null===(i=t.data)||void 0===i?void 0:i.detail)||"Lien invalide ou expir\xe9 \u2014 demandez un nouveau lien.")}}const u=localStorage.getItem(j);u?await X(u,d.id):w("login")}catch(o){I("Impossible de charger le site."),w("login")}})()},[]);const Y=(e=>{const n=(null===A||void 0===A||null===(e=A.content)||void 0===e?void 0:e.settings)||{},t=(null===A||void 0===A?void 0:A.settings)||{};let i=(null===A||void 0===A?void 0:A.business_name)||n.businessName||n.business_name||t.businessName||t.business_name||(null===A||void 0===A?void 0:A.name)||"";return"object"===typeof i&&i&&(i=i.fr||i.en||""),i||""})(),Z=async()=>
1{if(I(""),C.trim())try{await r.A.post("".concat(s.n,"/public/espace-client/demande-lien"),{email:C.trim(),website_id:A.id}),w("envoye")}catch(t){var e,n;I((null===(e=t.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.detail)||"Impossible d'envoyer le lien pour le moment.")}},$=e=>{try{return new Date("".concat(e,"T12:00:00")).toLocaleDateString("fr-CA",{weekday:"long",day:"numeric",month:"long",year:"numeric"})}catch(n){return e}},ee=e=>e.date>=(new Date).toISOString().slice(0,10)&&"cancelled"!==e.statut;return(0,l.jsxs)("div",{style:d.page,children:[(0,l.jsxs)("div",{style:d.tete,children:[(0,l.jsx)("span",{style:d.nom,children:Y||"Espace client"}),(0,l.jsx)("span",{style:(0,i.A)((0,i.A)({},d.doux),{},{fontSize:"12.5px"}),children:"majorite"===k?"Votre dossier sant\xe9 \u2014 majorit\xe9":"Espace client"}),"connecte"===k&&(0,l.jsx)("button",{onClick:()=>{localStorage.removeItem(j),z(null),T(null),w("login")},style:(0,i.A)((0,i.A)({},d.boutonSec),{},{marginLeft:"auto",padding:"6px 14px",fontSize:"12.5px"}),children:"Se d\xe9connecter"})]}),(0,l.jsxs)("div",{style:d.corps,children:["chargement"===k&&(0,l.jsx)("p",{style:d.doux,children:"Chargement\u2026"}),"majorite"===k&&J&&"choix"===J.vue&&(0,l.jsxs)("div",{style:d.carte,children:[(0,l.jsxs)("h2",{style:{fontFamily:"Georgia, serif",fontSize:"19px",color:"#46685b",margin:"0 0 10px"},children:["Bonjour ",(null===(n=J.info)||void 0===n?void 0:n.prenom)||"",", votre dossier sant\xe9 vous appartient d\xe9sormais"]}),(0,l.jsxs)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{marginBottom:"14px"}),children:["Vous avez maintenant ",(null===(t=J.info)||void 0===t?void 0:t.seuil)||18," ans. Jusqu'ici, votre dossier chez ",Y," \xe9tait rattach\xe9 au compte de ",(null===(c=J.info)||void 0===c?void 0:c.parent)||"un membre de votre famille",". La d\xe9cision vous revient maintenant :"]}),(null===(p=J.info)||void 0===p?void 0:p.deja_choisi)&&(0,l.jsx)("div",{style:d.succes,children:"Votre choix a d\xe9j\xe0 \xe9t\xe9 enregistr\xe9."}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"9px",maxWidth:"460px",marginTop:"10px"},children:[(0,l.jsx)("button",{style:(0,i.A)((0,i.A)({},d.bouton),{},{width:"100%"}),disabled:null===(u=J.info)||void 0===u?void 0:u.deja_choisi,onClick:async()=>{try{const e=await r.A.post("".concat(s.n,"/public/espace-client/majorite"),{token:J.token,choix:"propre"});K((0,i.A)((0,i.A)({},J),{},{vue:"fait",choix:"propre",horodatage:e.data.horodatage}))}catch(t){var e,n;I((null===(e=t.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.detail)||"Lien invalide ou expir\xe9.")}},children:"Cr\xe9er mon propre compte"}),(0,l.jsxs)("button",{style:(0,i.A)((0,i.A)({},d.boutonSec),{},{width:"100%"}),disabled:null===(x=J.info)||void 0===x?void 0:x.deja_choisi,onClick:()=>{I(""),U(!1),K((0,i.A)((0,i.A)({},J),{},{vue:"rattache"}))},children:["Rester rattach\xe9 au compte de ",(null===(m=J.info)||void 0===m?void 0:m.parent_prenom)||"ma fam
1ille"]})]}),(0,l.jsx)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{fontSize:"11.5px",marginTop:"12px"}),children:"Tant que vous n'avez pas choisi, vos r\xe9ponses pass\xe9es restent en place, mais tout nouveau questionnaire exigera votre propre consentement."}),q&&(0,l.jsx)("div",{style:d.erreur,children:q})]}),"majorite"===k&&J&&"rattache"===J.vue&&(0,l.jsxs)("div",{children:[(0,l.jsxs)("h2",{style:{fontFamily:"Georgia, serif",fontSize:"21px",color:"#46685b",margin:"0 0 6px"},children:["Rester rattach\xe9 au compte de ",(null===(h=J.info)||void 0===h?void 0:h.parent_prenom)||"ma famille"]}),(0,l.jsx)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{marginBottom:"16px"}),children:"Votre choix \u2014 vous pouvez le retirer en tout temps depuis votre espace client."}),(0,l.jsxs)("div",{style:(0,i.A)((0,i.A)({},d.carte),{},{border:"1.5px solid #6b8f80",background:"#f4f7f5",maxWidth:"560px"}),children:[(0,l.jsx)("h2",{style:d.h2,children:"Autorisation"}),(0,l.jsxs)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{fontSize:"13px",marginBottom:"12px"}),children:["En restant rattach\xe9, ",(null===(f=J.info)||void 0===f?void 0:f.parent)||"le titulaire du compte"," pourra continuer de prendre des rendez-vous pour vous et de consulter vos questionnaires sant\xe9. Cette autorisation est renouvel\xe9e aux 12 mois."]}),(0,l.jsxs)("label",{style:{display:"flex",gap:"10px",fontSize:"13.5px",lineHeight:1.5,marginBottom:"10px",cursor:"pointer"},children:[(0,l.jsx)("input",{type:"checkbox",style:{accentColor:"#46685b",marginTop:"3px",flexShrink:0},checked:Q,onChange:e=>U(e.target.checked)}),(0,l.jsxs)("span",{children:["J'autorise moi-m\xeame, en toute connaissance, le maintien du rattachement de mon dossier au compte de ",(null===(v=J.info)||void 0===v?void 0:v.parent)||"ma famille","."]})]}),(0,l.jsx)("p",{style:{fontSize:"12px",color:"#7d8a84",borderTop:"1px dashed #c9d4cd",paddingTop:"10px",margin:0},children:"Autorisation enregistr\xe9e \xe0 votre nom, avec la date, l'heure et votre adresse courriel \u2014 aucune signature requise."})]}),(0,l.jsxs)("div",{style:{marginTop:"16px"},children:[(0,l.jsx)("button",{style:(0,i.A)((0,i.A)({},d.bouton),Q?{}:{background:"#c9c3b8",cursor:"not-allowed"}),disabled:!Q,onClick:async()=>{try{const e=await r.A.post("".concat(s.n,"/public/espace-client/majorite"),{token:J.token,choix:"rattache"});K((0,i.A)((0,i.A)({},J),{},{vue:"fait",choix:"rattache",horodatage:e.data.horodatage}))}catch(t){var e,n;I((null===(e=t.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.detail)||"Lien invalide ou expir\xe9.")}},children:"Confirmer mon autorisation"}),(0,l.jsx)("button",{style:(0,i.A)((0,i.A)({},d.boutonSec),{},{marginLeft:"10px"}),onClick:()=>{I(""),K((0,i.A)((0,i.A)({},J),{},{vue:"choix"}))},children:"Revenir au courriel"})]}),q&&(0,l.jsx)("div",{style:d.erreur,children:q})]}),"majorite"===k&&J&&"fait"===J.vue&&"propre"===J.choix&&(0,l.jsxs)("div",{style:{textAlign:"center",padding:"36px 20px"},children:[(0,l.jsx)("div",{style:{width:"62px",height:"62px",borderRadius:"50%",background:"#ecf6f1",color:"#2e7d5b",fontSize:"30px",fontWeight:800,display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 18px"},children:"\u2713"}),(0,l.jsx)("h2",{style:{fontFamily:"Georgia, serif",fontSize:"21px",color:"#46685b",margin:"0 0 8px"},children:"Votre dossier est maintenant ind\xe9pendant"}),(0,l.jsxs)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{maxWidth:"460px",margin:"8px auto 18px"}),children:["Votre historique de questionnaires vous suit. ",(null===(g=J.info)||void 0===g?void 0:g.parent)||"Le titulaire du compte"," n'a plus acc\xe8s \xe0 votre dossier et n'en verra rien de nouveau. Vous acc\xe9dez \xe0 votre espace client avec votre propre courriel."]}),(0,l.jsx)("button",{style:d.boutonSec,onClick:()=>{K((0,i.A)((0,i.A)({},J),{},{vue:"choix",info:(0,i.A)((0,i.A)({},J.info),{},{deja_choisi:!0})}))},children:"Revenir au courriel"})]}),"majorite"===k&&J&&"fait"===J.vue&&"rattache"===J.choix&&(0,l.jsxs)("div",{style:d.carte,children:[(0,l.jsx)("h2",{style:d.h2,children:"Autorisation enregistr\xe9e"}),(0,l.jsxs)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{marginBottom:"14px"}),children:["Autorisation horodat\xe9e enregistr\xe9e \u2014 ",(null===(y=J.info)||void 0===y?void 0:y.parent)||"le titulaire du compte"," conserve l'acc\xe8s, renouvellement dans 12 mois."]}),(0,l.jsx)("button",{style:d.boutonSec,onClick:()=>{K((0,i.A)((0,i.A)({},J),{},{vue:"choix",info:(0,i.A)((0,i.A)({},J.info),{},{deja_choisi:!0})}))},children:"Revenir au courriel"})]}),"login"===k&&A&&(0,l.jsxs)("div",{style:d.carte,children:[(0,l.jsx)("h2",{style:d.h2,children:"Acc\xe9der \xe0 mon espace client"}),(0,l.jsx)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{marginBottom:"14px"}),children:"Entrez le courriel utilis\xe9 lors de votre r\xe9servation. Vous recevrez un lien de connexion s\xe9curis\xe9 \u2014 aucun mot de passe \xe0 retenir."}),(0,l.jsxs)("div",{style:{display:"flex",gap:"10px",flexWrap:"wrap"},children:[(0,l.jsx)("input",{style:(0,i.A)((0,i.A)({},d.champ),{},{flex:1,minWidth:"220px"}),type:"email",placeholder:"[email protected]",value:C,onChange:e=>B(e.target.value),onKeyDown:e=>"Enter"===e.key&&Z()}),(0,l.jsx)("button",{style:d.bouton,onClick:Z,children:"Recevoir mon lien"})]}),q&&(0,l.jsx)("div",{style:d.erreur,children:q})]}),"envoye"===k&&(0,l.jsxs)("div",{style:d.carte,children:[(0,l.jsx)("h2",{style:d.h2,children:"V\xe9rifiez votre bo\xeete courriel"}),(0,l.jsxs)("p",{style:d.doux,children:["Si un dossier existe pour ",(0,l.jsx)("strong",{children:C}),", un lien de connexion vient d'y \xeatre envoy\xe9. Pour votre s\xe9curit\xe9, il est valide 72 heures et ne sert qu'une fois. Pensez \xe0 v\xe9rifier vos courriels ind\xe9sirables."]})]}),"connecte"===k&&R&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:d.carte,children:[(0,l.jsxs)("h2",{style:d.h2,children:["Bonjour ",R.contact.first_name||R.contact.email]}),(0,l.jsxs)("p",{style:d.doux,children:["Voici votre dossier chez ",Y,"."]})]}),(0,l.jsxs)("div",{style:d.carte,children:[(0,l.jsx)("h2",{style:d.h2,children:"Mes rendez-vous"}),0===R.rendez_vous.length?(0,l.jsx)("p",{style:d.doux,children:"Aucun rendez-vous au dossier."}):R.rendez_vous.map(e=>(0,l.jsxs)("div",{style:d.ligne,children:[(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("div",{style:{fontWeight:700,fontSize:"14px"},children:e.type||"Rendez-vous"}),(0,l.jsxs)("div",{style:(0,i.A)((0,i.A)({},d.doux),{},{fontSize:"12.5px"}),children:[$(e.date)," \xe0 ",e.time,e.duree?" \u2014 ".concat(e.duree," min"):""]})]}),(0,l.jsx)("span",{style:(0,i.A)((0,i.A)({},d.badge),{},{background:"cancelled"===e.statut?"#fdf1ee":ee(e)?"#ecf6f1":"#f1f0ec",color:"cancelled"===e.statut?"#b3452f":ee(e)?"#2e7d5b":"#8a857a"}),children:"cancelled"===e.statut?"Annul\xe9":ee(e)?"\xc0 venir":"Pass\xe9"}),ee(e)&&e.annulation_url&&(0,l.jsx)("a",{href:e.annulation_url,style:{fontSize:"12.5px",color:"#b3452f"},children:"Annuler"})]},e.id))]}),(0,l.jsxs)("div",{style:d.carte,children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"10px"},children:[(0,l.jsx)("h2",{style:(0,i.A)((0,i.A)({},d.h2),{},{marginBottom:0}),children:"Ma famille"}),(0,l.jsx)("button",{style:(0,i.A)((0,i.A)({},d.boutonSec),{},{padding:"7px 14px",fontSize:"13px"}),onClick:()=>L(W?null:{first_name:"",last_name:"",lien_parente:"",date_naissance:"",email:"",ph
1one:""}),children:W?"Annuler":"+ Inscrire un membre"})]}),(0,l.jsx)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{marginBottom:"12px"}),children:"Inscrivez les membres de votre famille qui consultent \u2014 chacun aura son propre dossier."}),W&&(0,l.jsxs)("div",{style:{background:"#faf8f4",border:"1px solid #eee8dc",borderRadius:"10px",padding:"14px",marginBottom:"12px"},children:[(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px",marginBottom:"8px"},children:[(0,l.jsx)("input",{style:d.champ,placeholder:"Pr\xe9nom *",value:W.first_name,onChange:e=>L((0,i.A)((0,i.A)({},W),{},{first_name:e.target.value}))}),(0,l.jsx)("input",{style:d.champ,placeholder:"Nom *",value:W.last_name,onChange:e=>L((0,i.A)((0,i.A)({},W),{},{last_name:e.target.value}))}),(0,l.jsx)("input",{style:d.champ,placeholder:"Lien de parent\xe9 * (ex. fille)",value:W.lien_parente,onChange:e=>L((0,i.A)((0,i.A)({},W),{},{lien_parente:e.target.value}))}),(0,l.jsx)("input",{style:d.champ,type:"date",title:"Date de naissance",value:W.date_naissance,onChange:e=>L((0,i.A)((0,i.A)({},W),{},{date_naissance:e.target.value}))}),(0,l.jsx)("input",{style:d.champ,type:"email",placeholder:"Courriel (facultatif)",value:W.email,onChange:e=>L((0,i.A)((0,i.A)({},W),{},{email:e.target.value}))}),(0,l.jsx)("input",{style:d.champ,placeholder:"T\xe9l\xe9phone (facultatif)",value:W.phone,onChange:e=>L((0,i.A)((0,i.A)({},W),{},{phone:e.target.value}))})]}),(0,l.jsx)("button",{style:d.bouton,disabled:V,onClick:async()=>{if(I(""),W.first_name.trim()&&W.last_name.trim()&&W.lien_parente.trim())try{E(!0);const e=(0,i.A)({},W);["email","phone","date_naissance"].forEach(n=>{e[n]||delete e[n]}),await r.A.post("".concat(s.n,"/public/espace-client/famille"),e,{headers:{Authorization:"Bearer ".concat(_)}}),L(null),await X(_,A.id)}catch(t){var e,n;I((null===(e=t.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.detail)||"Impossible d'ajouter ce membre.")}finally{E(!1)}else I("Pr\xe9nom, nom et lien de parent\xe9 sont requis.")},children:V?"Enregistrement\u2026":"Inscrire ce membre"})]}),0===R.membres.length?(0,l.jsx)("p",{style:d.doux,children:"Aucun membre inscrit pour l'instant."}):R.membres.map(e=>(0,l.jsxs)("div",{style:d.ligne,children:[(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsxs)("span",{style:{fontWeight:700,fontSize:"14px"},children:[e.first_name," ",e.last_name]}),(0,l.jsxs)("span",{style:(0,i.A)((0,i.A)({},d.doux),{},{fontSize:"12.5px",marginLeft:"8px"}),children:[e.lien_parente,null!==e.age&&void 0!==e.age?" \xb7 ".concat(e.age," ans"):""]})]}),"mineur"===e.famille_statut&&(0,l.jsx)("span",{style:(0,i.A)((0,i.A)({},d.badge),{},{background:"#fdf6e8",color:"#9a6a1f"}),children:"mineur"})]},e._id)),q&&(0,l.jsx)("div",{style:d.erreur,children:q})]}),D&&D.formulaire&&(0,l.jsxs)("div",{style:d.carte,children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"10px"},children:[(0,l.jsx)("h2",{style:(0,i.A)((0,i.A)({},d.h2),{},{marginBottom:0}),children:"Mes questionnaires"}),!H&&(0,l.jsx)("button",{style:(0,i.A)((0,i.A)({},d.boutonSec),{},{padding:"7px 14px",fontSize:"13px"}),onClick:()=>P({contact_id:R.contact._id,nom:"".concat(R.contact.first_name," ").concat(R.contact.last_name)}),children:"Remplir un questionnaire"})]}),H?(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{marginBottom:"10px"}),children:["Pour qui ?"," ",(0,l.jsxs)("select",{style:(0,i.A)((0,i.A)({},d.champ),{},{width:"auto",display:"inline-block",padding:"6px 10px"}),value:H.contact_id,onChange:e=>{const n=e.target.value,t=R.membres.find(e=>e._id===n);P({contact_id:n,nom:t?"".concat(t.first_name," ").concat(t.last_name):"".concat(R.contact.first_name," ").concat(R.contact.last_name)})},children:[(0,l.jsxs)("option",{value:R.contact._id,children:[R.contact.first_name," ",R.contact.last_name," (moi)"]}),R.membres.map(e=>(0,l.jsxs)("option",{value:e._id,children:[e.first_name," ",e.last_name," (",e.lien_parente,")"]},e._id))]}),"  ",(0,l.jsx)("button",{style:(0,i.A)((0,i.A)({},d.boutonSec),{},{padding:"5px 12px",fontSize:"12px",marginLeft:"8px"}),onClick:()=>P(null),children:"Annuler"})]}),(0,l.jsx)(a.A,{formulaire:D.formulaire,nomEntreprise:Y,session:_,membre:{contact_id:H.contact_id},onTermine:async()=>{P(null),await X(_,A.id)}})]}):0===(D.remplis||[]).length?(0,l.jsx)("p",{style:d.doux,children:"Aucun questionnaire rempli pour l'instant."}):(D.remplis||[]).map(e=>(0,l.jsxs)("div",{style:(0,i.A)((0,i.A)({},d.ligne),{},{flexDirection:"column",alignItems:"stretch"}),children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[(0,l.jsxs)("div",{style:{flex:1},children:[(0,l.jsx)("span",{style:{fontWeight:700,fontSize:"14px"},children:e.membre_nom||"Questionnaire"}),(0,l.jsxs)("span",{style:(0,i.A)((0,i.A)({},d.doux),{},{fontSize:"12.5px",marginLeft:"8px"}),children:["rempli le ",new Date(e.created_at).toLocaleDateString("fr-CA")]}),e.demande_suppression&&(0,l.jsx)("span",{style:(0,i.A)((0,i.A)({},d.badge),{},{background:"#fdf6e8",color:"#9a6a1f",marginLeft:"8px"}),children:"suppression demand\xe9e"})]}),(0,l.jsx)("button",{style:(0,i.A)((0,i.A)({},d.boutonSec),{},{padding:"5px 12px",fontSize:"12px"}),onClick:()=>O(M===e.id?null:e.id),children:M===e.id?"Masquer":"Consulter"}),(0,l.jsx)("button",{style:(0,i.A)((0,i.A)({},d.boutonSec),{},{padding:"5px 12px",fontSize:"12px"}),onClick:()=>{O(null),G(N===e.id?null:e.id)},children:N===e.id?"Annuler la rectification":"Rectifier"}),!e.demande_suppression&&(0,l.jsx)("button",{style:{background:"none",border:"none",color:"#b3452f",fontSize:"12px",cursor:"pointer"},onClick:async()=>{window.confirm("Demander la suppression de ce questionnaire ?")&&(await r.A.post("".concat(s.n,"/public/espace-client/questionnaires/").concat(e.id,"/demande-suppression"),{},{headers:{Authorization:"Bearer ".concat(_)}}),await X(_,A.id))},children:"Demander la suppression"})]}),N===e.id&&(0,l.jsxs)("div",{style:{marginTop:"10px"},children:[(0,l.jsx)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{fontSize:"12.5px",marginBottom:"10px"}),children:"Corrigez vos r\xe9ponses puis enregistrez \u2014 vos consentements d'origine restent valides."}),(0,l.jsx)(a.A,{formulaire:D.formulaire,nomEntreprise:Y,session:_,valeursInitiales:e.reponses,rectifierId:e.id,onTermine:async()=>{G(null),await X(_,A.id)}})]}),M===e.id&&(0,l.jsx)("div",{style:{marginTop:"10px",fontSize:"13px",color:"#2b3a35"},children:(D.formulaire.sections||[]).map((n,t)=>(0,l.jsxs)("div",{style:{marginBottom:"8px"},children:[(0,l.jsx)("div",{style:{fontWeight:700,color:"#46685b",fontSize:"12.5px"},children:n.titre}),(n.questions||[]).filter(e=>"note"!==e.type).map(n=>{const t=e.reponses[n.id];let i="\u2014";return void 0!==t&&null!==t&&""!==t&&(i="oui_non"===n.type?"oui"===t.valeur?"Oui".concat(t.precision?" \u2014 "+t.precision:""):"Non":Array.isArray(t)?t.join(", ")||"\u2014":"echelle"===n.type?"".concat(t,"/10"):String(t)),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:"12px",padding:"2px 0",borderBottom:"1px dashed #eee8dc"},children:[(0,l.jsx)("span",{style:{color:"#64726d"},children:n.libelle}),(0,l.jsx)("span",{style:{fontWeight:600,textAlign:"right"},children:i})]},n.id)})]},t))})]},e.id))]}),(0,l.jsxs)("p",{style:(0,i.A)((0,i.A)({},d.doux),{},{fontSize:"12px",textAlign:"center"}),children:["Vos renseignements sont confidentiels et servent uniquement \xe0 la gestion de vos rendez-vous. Vous pouvez demander la rectification ou la suppression de votre dossier en tout temps aupr\xe8s de ",Y,"."]})]})]})]})}},31555:(e,n,t)=>{t.d(n,{A:()=>p});var i=t(89379),o=t(65043),r=t(79722),s=t(63331),a=t(70579);const l={carte:{background:"#fff",border:"1px solid #e3ded5",borderRadius:"12px",padding:"20px 24px",marginBottom:"16
1px"},h3:{fontSize:"15px",color:"#46685b",margin:"0 0 12px"},lib:{fontSize:"14px",marginBottom:"7px",color:"#2b3a35"},req:{color:"#b3452f"},champ:{width:"100%",padding:"9px 12px",border:"1.5px solid #e3ded5",borderRadius:"8px",fontSize:"14px",boxSizing:"border-box",background:"#fdfcfa",fontFamily:"inherit"},pilule:e=>({border:"1.5px solid ".concat(e?"#46685b":"#e3ded5"),background:e?"#f1f5f2":"#fff",fontWeight:e?600:400,borderRadius:"20px",padding:"7px 15px",fontSize:"13px",cursor:"pointer",display:"inline-flex",alignItems:"center",marginRight:"8px",marginBottom:"8px"}),note:{background:"#fdf1ee",border:"1px solid #eccfc6",borderRadius:"8px",padding:"10px 14px",fontSize:"13px",color:"#8a3a28",margin:"10px 0 6px"},erreur:{background:"#fdf1ee",border:"1px solid #eccfc6",color:"#8a3a28",borderRadius:"8px",padding:"10px 14px",fontSize:"13.5px",marginTop:"10px"},bouton:{background:"#46685b",color:"#fff",border:"none",borderRadius:"10px",padding:"13px 26px",fontSize:"15px",fontWeight:700,cursor:"pointer"}};function d(e,n){const t=e.visible_si;if(!t)return!0;const i=n[t.id];return i&&"object"===typeof i&&"valeur"in i?i.valeur===t.valeur:i===t.valeur}function c(e){let{q:n,valeur:t,onChange:o}=e;if("note"===n.type)return(0,a.jsx)("div",{style:l.note,children:n.libelle});const r=(0,a.jsxs)("div",{style:l.lib,children:[n.libelle," ",n.obligatoire&&(0,a.jsx)("span",{style:l.req,children:"*"})]});if("texte"===n.type)return(0,a.jsxs)("div",{style:{marginBottom:"14px"},children:[r,(0,a.jsx)("input",{style:l.champ,placeholder:n.placeholder||"",value:t||"",onChange:e=>o(e.target.value)})]});if("texte_long"===n.type)return(0,a.jsxs)("div",{style:{marginBottom:"14px"},children:[r,(0,a.jsx)("textarea",{style:(0,i.A)((0,i.A)({},l.champ),{},{minHeight:"64px",resize:"vertical"}),value:t||"",placeholder:n.placeholder||"",onChange:e=>o(e.target.value)})]});if("choix_unique"===n.type)return(0,a.jsxs)("div",{style:{marginBottom:"14px"},children:[r,(0,a.jsx)("div",{children:(n.options||[]).map(e=>(0,a.jsx)("span",{style:l.pilule(t===e),onClick:()=>o(e),children:e},e))})]});if("choix_multiple"===n.type){const e=Array.isArray(t)?t:[],i=n=>o(e.includes(n)?e.filter(e=>e!==n):[...e,n]);return(0,a.jsxs)("div",{style:{marginBottom:"14px"},children:[r,(0,a.jsx)("div",{children:(n.options||[]).map(n=>(0,a.jsx)("span",{style:l.pilule(e.includes(n)),onClick:()=>i(n),children:n},n))})]})}if("oui_non"===n.type){const e=t||{};return(0,a.jsxs)("div",{style:{marginBottom:"14px"},children:[r,(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{style:l.pilule("oui"===e.valeur),onClick:()=>o((0,i.A)((0,i.A)({},e),{},{valeur:"oui"})),children:"Oui"}),(0,a.jsx)("span",{style:l.pilule("non"===e.valeur),onClick:()=>o({valeur:"non"}),children:"Non"})]}),"oui"===e.valeur&&n.precision_si_oui&&(0,a.jsxs)("div",{style:{marginTop:"8px"},children:[(0,a.jsx)("div",{style:(0,i.A)((0,i.A)({},l.lib),{},{fontSize:"13px",color:"#64726d"}),children:n.precision_si_oui}),(0,a.jsx)("input",{style:l.champ,value:e.precision||"",onChange:n=>o((0,i.A)((0,i.A)({},e),{},{precision:n.target.value}))})]})]})}return"echelle"===n.type?(0,a.jsxs)("div",{style:{marginBottom:"14px"},children:[r,(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[(0,a.jsx)("input",{type:"range",min:"0",max:"10",style:{flex:1,accentColor:"#46685b"},value:null!==t&&void 0!==t?t:0,onChange:e=>o(parseInt(e.target.value,10))}),(0,a.jsxs)("strong",{style:{minWidth:"46px",textAlign:"center",fontSize:"17px",color:"#46685b"},children:[null!==t&&void 0!==t?t:0," / 10"]})]})]}):null}function p(e){let{formulaire:n,nomEntreprise:t,jeton:p,session:u,membre:x,onTermine:m,apercu:h,valeursInitiales:f,rectifierId:v}=e;const[g,y]=(0,o.useState)(f||{}),[b,j]=(0,o.useState)({}),[A,S]=(0,o.useState)(""),[_,z]=(0,o.useState)(!1),k=!!v||(n.consentements||[]).every(e=>b[e.id]);return(0,a.jsxs)("div",{children:[(n.sections||[]).map((e,n)=>(0,a.jsxs)("div",{style:l.carte,children:[(0,a.jsxs)("h3",{style:l.h3,children:[n+1,". ",e.titre]}),(e.questions||[]).filter(e=>d(e,g)).map(e=>(0,a.jsx)(c,{q:e,valeur:g[e.id],onChange:n=>((e,n)=>y(t=>(0,i.A)((0,i.A)({},t),{},{[e]:n})))(e.id,n)},e.id))]},n)),!v&&(0,a.jsxs)("div",{style:(0,i.A)((0,i.A)({},l.carte),{},{border:"1.5px solid #6b8f80",background:"#f4f7f5"}),children:[(0,a.jsx)("h3",{style:l.h3,children:"Consentement"}),(0,a.jsxs)("p",{style:{fontSize:"13px",color:"#64726d",lineHeight:1.55,marginTop:0,marginBottom:"12px"},children:["Vos r\xe9ponses servent uniquement \xe0 pr\xe9parer et adapter vos s\xe9ances avec ",t||"votre professionnel",", responsable de la protection de vos renseignements. Elles sont chiffr\xe9es, ne sont jamais transmises par courriel et sont conserv\xe9es au maximum ",n.retention_annees||3," ans apr\xe8s votre dernier rendez-vous, puis d\xe9truites."]}),(n.consentements||[]).map(e=>(0,a.jsxs)("label",{style:{display:"flex",gap:"10px",fontSize:"13.5px",lineHeight:1.5,marginBottom:"10px",cursor:"pointer"},children:[(0,a.jsx)("input",{type:"checkbox",style:{accentColor:"#46685b",marginTop:"3px",flexShrink:0},checked:!!b[e.id],onChange:n=>j(t=>(0,i.A)((0,i.A)({},t),{},{[e.id]:n.target.checked}))}),(0,a.jsx)("span",{children:e.texte})]},e.id)),(0,a.jsx)("p",{style:{fontSize:"12px",color:"#7d8a84",borderTop:"1px dashed #c9d4cd",paddingTop:"10px",margin:"4px 0 0"},children:"Vous pouvez en tout temps consulter, rectifier ou demander la suppression de vos r\xe9ponses depuis votre espace client. Consentement enregistr\xe9 avec la date, l'heure et la ver
1sion du pr\xe9sent texte \u2014 aucune signature requise."})]}),!h&&A&&(0,a.jsx)("div",{style:l.erreur,children:A}),!h&&(0,a.jsxs)("div",{style:{marginTop:"20px"},children:[(0,a.jsx)("button",{style:(0,i.A)((0,i.A)({},l.bouton),k?{}:{background:"#c9c3b8",cursor:"not-allowed"}),disabled:!k||_,onClick:async()=>{S("");for(const o of n.sections||[])for(const e of o.questions||[]){if(!e.obligatoire||!d(e,g))continue;const n=g[e.id];if(void 0===n||""===n||"oui_non"===e.type&&!(n&&n.valeur)||"choix_multiple"===e.type&&(!Array.isArray(n)||0===n.length))return void S("Veuillez r\xe9pondre \xe0 : \xab ".concat(e.libelle," \xbb"))}try{z(!0);const e=u?{headers:{Authorization:"Bearer ".concat(u)}}:{};if(v)await r.A.post("".concat(s.n,"/public/espace-client/questionnaires/").concat(v,"/rectifier"),{reponses:g},e),m&&m(v,null);else{const t={form_id:n.id,reponses:g,consentements:b};p&&(t.jeton=p),null!==x&&void 0!==x&&x.contact_id&&(t.membre_contact_id=x.contact_id),null!==x&&void 0!==x&&x.nouveau&&(t.nouveau_membre=x.nouveau);const i=await r.A.post("".concat(s.n,"/public/intake/soumettre"),t,e);m&&m(i.data.submission_id,i.data.horodatage)}}catch(i){var e,t;S((null===(e=i.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Impossible de transmettre le questionnaire pour le moment.")}finally{z(!1)}},children:_?"Transmission\u2026":v?"Enregistrer mes corrections":"Transmettre mes r\xe9ponses"}),!v&&(0,a.jsx)("span",{style:{fontSize:"12.5px",color:"#64726d",marginLeft:"10px"},children:"Le bouton s'active quand les deux consentements sont coch\xe9s."})]})]})}}}]);
2//# sourceMappingURL=3695.f8feaf12.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.