PageSourceSearch

https://denekt.com/assets/Clarifier-CbsdyuFb.js

js denekt.com collected 2026-10-04 17:45:32 UTC 15,555 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-Cc3LfMzt.js";import{e as re,g as ne,r as a,L as x}from"./vendor-react-CRevFlg9.js";import{u as ie,h as oe,a as l,S,A as g,C as le}from"./index-CJYdpUa3.js";import{C as ce}from"./circle-alert-1G0Oml8D.js";import{C as de}from"./circle-check-big-BxPTYy0p.js";import{L as me}from"./loader-circle-Dr445XB8.js";import{S as ue}from"./save-DNy3p60A.js";import"./vendor-supabase-DRR_Es6B.js";const P=["Vos réponses vous attendent.","Reprenez là où vous en étiez.","Le fil de votre réflexion est intact."],h="J'engage la séance de lecture.",v="Je laisse cette situation reposer.",xe=5,ye=()=>{ie();const[k]=re(),O=ne(),r=k.get("token"),w=k.get("test")==="1",{toast:u}=oe(),[B,F]=a.useState(!1),[Q,_]=a.useState(!0),[b,C]=a.useState(!1),[t,K]=a.useState(null),[o,E]=a.useState(0),[p,z]=a.useState(""),[c,L]=a.useState(""),[d,T]=a.useState(""),[m,j]=a.useState(""),[D,A]=a.useState(!1),[G,U]=a.useState(!1),[R,q]=a.useState(!1),[M,V]=a.useState(null),[$,J]=a.useState(!1),N=a.useRef(null);a.useEffect(()=>{if(!r){_(!1);return}(async()=>{const{data:i,error:n}=await l.rpc("get_qualification_for_clarification",{p_token:r}),I=Array.isArray(i)?i[0]:null;n||!I?C(!1):(C(!0),K(I)),_(!1)})()},[r]),a.useEffect(()=>{if(!r||!b||!t||$)return;(async()=>{const{data:i}=await l.rpc("get_clarification_draft",{p_token:r}),n=Array.isArray(i)?i[0]:null;n&&(n.step>0&&E(n.step),n.statut&&z(n.statut),n.blocage&&L(n.blocage),n.deja_fait&&T(n.deja_fait),n.rapport_temps&&j(n.rapport_temps),V(new Date(n.updated_at)),F(!0)),J(!0)})()},[r,b,t,$,u]);const y=a.useCallback(async s=>{if(!(!r||!t)){q(!0);try{await l.rpc("upsert_clarification_draft",{p_token:r,p_qualification_id:t.id,p_name:t.name,p_email:t.email,p_step:(s==null?void 0:s.currentStep)??o,p_statut:p,p_blocage:c,p_deja_fait:d,p_rapport_temps:m}),V(new Date),s!=null&&s.silent||u({title:"Enregistré",description:"Vos réponses sont sauvegardées. Vous pouvez quitter et revenir."})}catch{s!=null&&s.silent||u({title:"Erreur",description:"La sauvegarde a échoué. Réessayez.",variant:"destructive"})}finally{q(!1)}}},[r,t,o,p,c,d,m,u]),f=a.useCallback(s=>{E(s),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{y({silent:!0,currentStep:s})},800)},[y]),H=async()=>{if(!t)return;A(!0);const s=m;try{const i=crypto.randomUUID();if(await l.from("clarification_responses").insert({id:i,qualification_id:t.id,name:t.name,email:t.email,statut:p,blocage:c,deja_fait:d,rapport_temps:s,token:r}),await l.rpc("delete_clarification_draft",{p_token:r}),s===v&&await l.functions.invoke("send-transactional-email",{body:{templateName:"clarification-confirmation",recipientEmail:t.email,idempotencyKey:`clarif-confirm-${i}`,templateData:{name:t.name}}}),await l.functions.invoke("send-transactional-email",{body:{templateName:"admin-notification",recipientEmail:le,idempotencyKey:`clarif-admin-${i}`,templateData:{type:"clarification",senderName:t.name,senderEmail:t.email,preview:`[${s}] ${c.substring(0,180)}`}}}),s===h&&r){O(`/options/${r}`);return}U(!0)}catch{u({title:"Erreur",description:"Une erreur est survenue. Réessayez.",variant:"destructive"})}finally{A(!1)}},W=async()=>{await y(),t&&r&&await l.functions.invoke("send-transactional-email",{body:{templateName:"clarification-draft-saved",recipientEmail:t.email,idempotencyKey:`clarif-draft-${r}-${Date.now()}`,templateData:{name:t.name,clarificationToken:r}}})};if(Q)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Vérification en cours…"})});if(!r||!b)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(S,{title:"Mise en mots de la situation",description:"Accès protégé au formulaire de mise en mots Denekt.",path:"/clarifier",noIndex:!0}),e.jsxs("div",{className:"max-w-xl mx-auto px-6 pt-28 pb-16",children:[e.jsx(x,{to:"/",className:"font-serif text-lg text-foreground hover:text-accent transition-colors",children:"Denekt"}),e.jsxs("div",{className:"mt-12",children:[e.jsx(ce,{className:"w-8 h-8 text-muted-foreground mb-6"}),e.jsx("h1",{className:"font-serif text-xl md:text-2xl font-light text-foreground mb-4 leading-snug",children:"Cet espace de mise en mots n'est pas en accès libre."}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-3",children:"Cet espace est envoyé par email uniquement aux personnes déjà en lecture avec Denekt."}),e.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed mb-8",children:["Si vous pensez que votre situation correspond,"," ",e.jsx(x,{to:"/qualifier",className:"text-accent hover:text-foreground transition-colors underline underline-offset-4",children:"commencez par vous porter volontaire pour tester Denekt"}),"."]})]})]})]});if(G)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(S,{title:"Situation posée",description:"Votre situation a été posée.",path:"/clarifier",noIndex:!0}),e.jsxs("div",{className:"max-w-xl mx-auto px-6 pt-28 pb-16",children:[e.jsx(x,{to:"/",className:"font-serif text-lg text-foreground hover:text-accent transition-colors",children:"Denekt"}),e.jsxs("div",{className:"mt-12 animate-fade-in",children:[e.jsx(de,{className:"w-8 h-8 text-accent mb-6"}),e.jsx("h2",{className:"font-serif text-xl md:text-2xl font-light text-foreground mb-4 leading-snug",children:"Merci. Nous avons bien reçu votre message."}),e.jsx("p",{className:"text-sm text-foreground font-medium leading-relaxed mb-3",children:"Elle sera lue."}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-3",children:"Si la situation appelle une lecture, vous recevrez les modalités pour la séance."}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-3",children:"La mise en mots engage déjà une décision."}
1),e.jsx("p",{className:"text-sm text-foreground/70 leading-relaxed mb-8",children:"Ce travail demande du courage. Vous l'avez fait."}),e.jsx(x,{to:"/",className:"text-sm text-accent hover:text-foreground transition-colors underline underline-offset-4",children:"Retour au site"})]})]})]});const X=o===0,Y=o===1,Z=o===2,ee=o===3,te=o===4,se=()=>o>0?e.jsxs("button",{onClick:W,disabled:R,className:"flex items-center gap-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",type:"button",children:[R?e.jsx(me,{className:"w-3 h-3 animate-spin"}):e.jsx(ue,{className:"w-3 h-3"}),"Enregistrer et continuer plus tard"]}):null,ae=()=>M?e.jsxs("p",{className:"text-[10px] text-muted-foreground/60 mt-1",children:["Dernière sauvegarde"," ",M.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})]}):null;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(S,{title:"Mise en mots de la situation",description:"Espace de mise en forme de votre situation. Formulaire préparatoire à la lecture structurelle.",path:"/clarifier",noIndex:!0}),e.jsxs("div",{className:"max-w-xl mx-auto px-6 pt-28 pb-16",children:[e.jsx(x,{to:"/",className:"font-serif text-lg text-foreground hover:text-accent transition-colors",children:"Denekt"}),e.jsxs("div",{className:"mt-12",children:[e.jsx("p",{className:"font-sans text-[11px] font-medium tracking-[0.25em] uppercase text-accent mb-6",children:"Mise en mots de la situation"}),e.jsx("div",{className:"flex gap-1.5 mb-8",children:Array.from({length:xe}).map((s,i)=>e.jsx("div",{className:`h-0.5 flex-1 rounded-full transition-all duration-500 ${i<o?"bg-accent":i===o?"bg-accent/50":"bg-border"}`},i))}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx(se,{}),e.jsx(ae,{})]}),B&&e.jsxs("div",{className:"mb-8 p-5 border border-accent/20 bg-accent/5 rounded-sm animate-fade-in",children:[e.jsxs("p",{className:"font-serif text-foreground mb-1",children:[t==null?void 0:t.name,", vous êtes de retour."]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:P[Math.floor(Math.random()*P.length)]})]}),X&&e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("h1",{className:"font-serif text-xl md:text-2xl font-light text-foreground mb-6 leading-snug",children:t!=null&&t.name?`${t.name}, cet espace sert à poser votre situation.`:"Cet espace sert à poser votre situation."}),e.jsxs("div",{className:"space-y-4 text-sm text-muted-foreground leading-relaxed",children:[e.jsxs("p",{children:["Ce formulaire prépare une lecture structurelle de ",e.jsx("strong",{className:"text-foreground font-medium",children:"quatre-vingt-dix minutes"}),", par téléphone ou en visio. L'objectif est de ",e.jsx("strong",{className:"text-foreground font-medium",children:"rendre visible la structure de votre blocage"}),"."]}),e.jsxs("p",{children:["Décrivez votre situation avec précision. ",e.jsx("strong",{className:"text-foreground font-medium",children:"Trente minutes"})," sont nécessaires. Vous pouvez enregistrer et revenir."]}),e.jsx("p",{className:"text-foreground/60 font-serif italic",children:"Toute demande ne donne pas lieu à une lecture."})]}),e.jsxs("button",{onClick:()=>f(1),className:"mt-8 w-full px-5 py-3.5 text-xs font-sans font-medium tracking-[0.1em] uppercase bg-primary text-primary-foreground rounded-sm hover:opacity-90 transition-opacity inline-flex items-center justify-center gap-2",children:["Envoyer",e.jsx(g,{className:"w-3.5 h-3.5"})]})]}),Y&&e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("p",{className:"text-[11px] font-medium tracking-[0.15em] uppercase text-accent mb-2",children:"Contexte"}),e.jsx("h1",{className:"font-serif text-xl md:text-2xl font-light text-foreground mb-2 leading-snug",children:"Cette demande est faite à titre"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-8",children:[t==null?void 0:t.name," · ",t==null?void 0:t.email]}),e.jsx("div",{className:"space-y-3",children:["Personnel","Professionnel"].map(s=>e.jsx("button",{onClick:()=>{z(s),setTimeout(()=>f(2),400)},className:`w-full text-left px-5 py-4 border rounded-sm text-sm leading-relaxed transition-all hover:border-accent hover:bg-accent/5 ${p===s?"border-accent bg-accent/10 text-foreground":"border-border text-foreground
1/80"}`,children:s},s))})]}),Z&&e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("p",{className:"text-[11px] font-medium tracking-[0.15em] uppercase text-accent mb-2",children:"Question 1 · La situation"}),e.jsx("h1",{className:"font-serif text-xl md:text-2xl font-light text-foreground mb-2 leading-snug",children:"Qu'observez-vous ?"}),e.jsxs("div",{className:"space-y-1 text-sm text-muted-foreground mb-8",children:[e.jsx("p",{children:"Décrivez les faits et le moment où la situation a commencé à se manifester."}),e.jsx("p",{children:"Précisez la dynamique qui se joue pour vous dans cette situation."}),e.jsx("p",{children:"Indiquez le coût réel que cette situation représente aujourd'hui dans votre quotidien ou votre activité."})]}),e.jsx("textarea",{value:c,onChange:s=>L(s.target.value),rows:6,className:"w-full px-4 py-3.5 border border-border rounded-sm bg-background text-foreground text-sm placeholder:text-muted-foreground/50 focus:outline-none focus:border-accent transition-colors resize-none leading-relaxed",placeholder:"Prenez le temps de décrire vos observations.",maxLength:3e3}),e.jsx("div",{className:"flex items-center justify-between mt-2 mb-4",children:e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[c.length,"/3000"]})}),e.jsxs("button",{onClick:()=>f(3),disabled:!w&&c.trim().length<30,className:"w-full px-5 py-3.5 text-xs font-sans font-medium tracking-[0.1em] uppercase bg-primary text-primary-foreground rounded-sm hover:opacity-90 transition-opacity disabled:opacity-30 inline-flex items-center justify-center gap-2",children:["Continuer",e.jsx(g,{className:"w-3.5 h-3.5"})]})]}),ee&&e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("p",{className:"text-[11px] font-medium tracking-[0.15em] uppercase text-accent mb-2",children:"Question 2 · Les tentatives déjà engagées"}),e.jsx("h1",{className:"font-serif text-xl md:text-2xl font-light text-foreground mb-2 leading-snug",children:"Qu'avez-vous déjà mis en place face à cette situation."}),e.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:"Décrivez les actions engagées, les décisions prises et les démarches effectuées. Incluez également les tentatives qui n'ont pas produit le résultat attendu."}),e.jsx("textarea",{value:d,onChange:s=>T(s.target.value),rows:6,className:"w-full px-4 py-3.5 border border-border rounded-sm bg-background text-foreground text-sm placeholder:text-muted-foreground/50 focus:outline-none focus:border-accent transition-colors resize-none leading-relaxed",placeholder:"Décrivez vos tentatives, y compris les impasses. Chaque tentative éclaire la lecture.",maxLength:3e3}),e.jsx("div",{className:"flex items-center justify-between mt-2 mb-4",children:e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[d.length,"/3000"]})}),e.jsxs("button",{onClick:()=>f(4),disabled:!w&&d.trim().length<20,className:"w-full px-5 py-3.5 text-xs font-sans font-medium tracking-[0.1em] uppercase bg-primary text-primary-foreground rounded-sm hover:opacity-90 transition-opacity disabled:opacity-30 inline-flex items-center justify-center gap-2",children:["Continuer",e.jsx(g,{className:"w-3.5 h-3.5"})]})]}),te&&e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("p",{className:"text-[11px] font-medium tracking-[0.15em] uppercase text-accent mb-2",children:"Décision"}),e.jsx("h1",{className:"font-serif text-xl md:text-2xl font-light text-foreground mb-3 leading-snug",children:"Vous avez posé votre situation."}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-3",children:"À ce point, deux voies s'ouvrent. L'une et l'autre sont entières. Aucune réponse n'est meilleure que l'autre."}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-8",children:"Choisissez celle qui correspond à votre rapport au temps."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("button",{onClick:()=>j(h),className:`w-full text-left px-5 py-5 border rounded-sm transition-all hover:border-accent hover:bg-accent/5 ${m===h?"border-accent bg-accent/10":"border-border"}`,children:[e.jsx("p",{className:"text-sm text-foreground font-medium leading-relaxed mb-1",children:h}),e.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed",children:"Vous recevez par mail les modalités précises et le lien pour engager la séance."})]}),e.jsxs("button",{onClick:()=>j(v),className:`w-full text-left px-5 py-5 border rounded-sm transition-all hover:border-accent hover:bg-accent/5 ${m===v?"border-accent bg-accent/10":"border-border"}`,children:[e.jsx("p",{className:"text-sm text-foreground font-medium leading-relaxed mb-1",children:v}),e.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed",children:"Ce que vous avez écrit reste lu. Vous pouvez revenir lorsque le moment est juste."})]})]}),e.jsxs("button",{onClick:H,disabled:D||!m,className:"mt-6 w-full px-5 py-3.5 text-xs font-sans font-medium tracking-[0.1em] uppercase bg-primary text-primary-foreground rounded-sm hover:opacity-90 transition-opacity disabled:opacity-30 inline-flex items-center justify-center gap-2",children:[D?"Envoi…":"Confirmer ma décision",e.jsx(g,{className:"w-3.5 h-3.5"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground text-center mt-3",children:"Confidentiel. Lu uniquement par Dénénodji M'Bondjim."})]})]})]})]})};export{ye as default};

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.