1import{u as de,_ as ce}from"./BmFutZYE.js";import{S as ve}from"./Cz80Inv4.js";import{b as Q,k as fe,L as ge,y as me,bb as he,ar as _e,bc as be,bd as we,b9 as ye,al as Se,be as Ee,a as Ue,ak as Ce,ba as Ne}from"./DyKNP8cS.js";import{af as g,_ as m,ai as u,aj as a,ap as i,a1 as t,K as P,ak as U,F as q,M as Z,c as N,o as xe,j as E,ah as H,r}from"./BYiS32D8.js";import{e as ze,u as Ie,C as d,g as ke,J as R,V as f,W,X,Y,A as Le}from"./KBacoI0J.js";import{S as Ve}from"./Dzr0v2hr.js";import{I as Ae}from"./B5vJUwCU.js";import{I as Pe}from"./D6RdPXLD.js";import{u as Re}from"./CRYoWObI.js";import{u as qe}from"./DBnEWrZw.js";import{M as De,L as Be,d as Oe}from"./DbtWmddp.js";import"./pyXvGVJk.js";import"./CsFZhptG.js";const Te={class:"vibe"},$e={class:"vibe__head"},Fe={class:"vibe__icon","aria-hidden":"true"},Me=["value"],je={class:"vibe__suggestions"},Je=["onClick"],k=40,Ke={__name:"SettingsVibeField",props:{modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(x,{emit:v}){const c=x,z=v,C=["⨠En mode cocooning","ð¿ Besoin d'air","ð Envie de rire","â Dispo ce week-end","ð Curieuse de tout"],p=N(()=>(c.modelValue||"").length),y=N(()=>p.value>=k-5);function h(b){z("update:modelValue",b.target.value)}function _(b){z("update:modelValue",c.modelValue===b?"":b)}return(b,S)=>(g(),m("section",Te,[u("header",$e,[u("span",Fe,[a(t(ze),{size:20},{default:i(()=>[a(t(fe))]),_:1})]),S[0]||(S[0]=u("div",null,[u("h3",{class:"vibe__title"},"Ta vibe du moment"),u("p",{class:"vibe__hint"},"Une phrase qui donne envie de venir te parler.")],-1))]),u("label",{class:P(["vibe__field",{"is-near-limit":y.value}])},[S[1]||(S[1]=u("span",{class:"vibe__label"},"Ta vibe du moment",-1)),u("input",{value:x.modelValue||"",type:"text",class:"vibe__input",maxlength:k,placeholder:"En mode cocooning, dispo ce week-endâ¦",onInput:h},null,40,Me),u("span",{class:P(["vibe__count",{"is-full":p.value>=k}])},U(p.value)+" / "+U(k),3)],2),u("div",je,[(g(),m(q,null,Z(C,e=>u("button",{key:e,type:"button",class:P(["vibe__chip",{"is-active":x.modelValue===e}]),onClick:I=>_(e)},U(e),11,Je)),64))])]))}},Ge=Q(Ke,[["__scopeId","data-v-9e64a851"]]),He={id:"presentation",class:"page container text-light mx-auto w-full max-w-3xl settings-screen"},We={class:"is-full"},Xe={key:0,class:"is-full"},Ye={class:"settings-screen__coordonnees"},Qe={key:1,class:"is-full"},Ze={key:2,class:"is-full"},es={class:"is-full"},ss={class:"settings-screen__toggle-label"},ts={class:"settings-screen__measure"},as={class:"settings-screen__toggle-label"},ls={class:"settings-screen__measure"},ns={__name:"EditPresentation",setup(x){const v=ge().public,c=Ue("settings"),z=r(null),C=Ie(),p=me(),y=r(null),h=r(!1),_=r(!1),b=l=>{l||(e.value.size=null)},S=l=>{l||(e.value.weight=null)},e=r({presentation:null,status:null,relationship:null,gender:null,preference:null,origin:null,size:null,weight:null,search:null,attraction:null,shape:null,glasses:null,eyes:null,hair:null,piercings:null,tattoos:null}),I=N(()=>Oe(e.value.presentation||"")),L=N(()=>I.value.length>0),D=["presentation","status","gender","relationship","search"],ee=N(()=>D.filter(l=>{const s=e.value[l];return Array.isArray(s)?s.length>0:s!=null&&s!==""}).length),B=r(),se=r(),te=r(),O=r(),T=r(),ae=r(),$=r(),F=r(),M=r(),j=r(),J=r(),K=r(),le=async()=>{try{const l=await be(v.URL_BACKEND,"profil",{"populate[gender]":"*","populate[preference]":"*","populate[origin]":"*","populate[relationship]":"*","populate[search]":"*","populate[shape]":"*","populate[glasses]":"*","populate[eyes]":"*","populate[hair]":"*","populate[piercings]":"*","populate[tattoos]":"*"})||{};B.value=l?.gender,se.value=l?.preference,te.value=l?.origin,O.value=l?.relationship,ae.value=l?.gender,T.value=we(l?.search).map(s=>({label:s.label,value:s.slug})),$.value=l?.shape,F.value=l?.glasses,M.value=l?.eyes,j.value=l?.hair,J.value=l?.piercings,K.value=l?.tattoos}catch(l){c.error("settings.presentation.lists_failed",{error:l}),C.error("Problème technique : recharge la page ou réessaie plus tard.")}},ne=async()=>{try{if(!p.User?.id){c.warn("settings.user.load_skipped",{reason:"missing_user_id"});return}const l={data:await ye(v.URL_BACKEND,p.User.id,void 0,{params:{"fields[0]":"gender","fields[1]":"preference","fields[2]":"status"}})??{}};e.value.gender=l.data.gender||null,e.value.preference=l.data.preference||null,e.value.status=l.data.status||null}catch(l){c.error("settings.user.load_failed",{error:l}),C.error("Problème technique : recharge la page ou réessaie plus tard.")}},G=async()=>{try{if(!p.User?.id){c.warn("settings.profile.load_skipped",{reason:"missing_user_id"});return}const s=(await Se(v.URL_BACKEND,"user-profiles",{filters:{userId:{$eq:p.User.id}},pagination:{pageSize:1},"fields[0]":"presentation","fields[1]":"relationship","fields[2]":"attraction","fields[3]":"search","fields[4]":"size","fields[5]":"weight","fields[6]":"shape","fields[7]":"glasses","fields[8]":"eyes","fields[9]":"hair","fields[10]":"piercings","fields[11]":"tattoos"}))?.[0]||{};y.value=s?.documentId||s?.id||null;const o=s?.attributes||s||{};e.value.presentation=o?.presentation||"",e.value.relationship=o?.relationship||null,e.value.attraction=o?.attraction||[],e.value.search=(o?.search||[]).map(w=>Ee(w)),e.value.size=o?.size||null,e.value.weight=o?.weight||null,e.value.shape=o?.shape||null,e.value.glasses=o?.glasses||null,e.value.eyes=o?.eyes||null,e.value.hair=o?.hair||null,e.value.piercings=o?.piercings||null,e.value.tattoos=o?.tattoos||null,h.value=e.value.size!=null&&e.value.size>0,_.value=e.value.weight!=null&&e.value.weight>0,c.debug("settings.profile.loaded")}catch(l){c.error("settings.profile.load_failed",{error:l}),C.error("Problème technique : recharge la page ou réessaie plus tard.")}};async function ie(){await Ne(v.URL_BACKEND,p.jwt,{gender:e.value.gender,preference:e.value.preference,status:e.value.status})}async function oe(){if(!p.User?.id)throw new Error("settings.autosave.user_not_loaded");if(L.value)throw c.debug("settings.presentation.coordonnees_bloquees",{types:[...new Set(I.value.map(o=>o.type))]}),new Error("settings.autosave.presentation_coordonnees");await ie();const l={},s=["relationship","shape","glasses","eyes","hair","piercings","tattoos"];e.value.presentation!==void 0&&(l.presentation=e.value.presentation);for(const o of s){const w=e.value[o];w!==void 0&&(l[o]=w===0?null:w)}if(e.value.attraction!==void 0&&(l.attraction=e.value.attraction),e.value.search!==void 0&&(l.search=e.value.search),e.value.size>0&&(l.size=e.value.size),e.value.weight>0&&(l.weight=e.value.weight),y.value||await G(),!y.value)throw new Error("settings.autosave.missing_record_id");try{await Ce(v.URL_BACKEND,"user-profiles",y.value,l,p.jwt)}catch(o){throw ue.signaler(o)?new Error("settings.autosave.presentation_explicite"):o}p.setUser()}const ue=Re(),V=de(e,oe),re=()=>V.retry();return xe(async()=>{qe(".n-scrollbar-container"),await Promise.all([le(),ne(),G()]),V.arm()}),(l,s)=>{const o=ce,w=ve,pe=Ge,A=Ve;return g(),m("div",He,[a(w,{icon:t(he),title:"Je me présente",subt
1itle:"Deux phrases sur qui tu es et ce que tu cherches. Câest ce qui déclenche les premiers messages.",completion:{filled:ee.value,total:D.length}},{status:i(()=>[a(o,{status:t(V).status.value,onRetry:re},null,8,["status"])]),_:1},8,["icon","completion"]),a(pe,{modelValue:e.value.status,"onUpdate:modelValue":s[0]||(s[0]=n=>e.value.status=n)},null,8,["modelValue"]),a(t(Le),{ref_key:"formRef",ref:z,model:e.value},{default:i(()=>[a(A,{first:"",icon:t(_e),title:"Ma présentation",hint:"La première chose quâon lit sur ton profil."},{default:i(()=>[u("div",We,[a(t(d),{path:"presentation",label:"Je me présente","validation-status":L.value?"error":void 0},{default:i(()=>[a(t(ke),{value:e.value.presentation,"onUpdate:value":s[1]||(s[1]=n=>e.value.presentation=n),type:"textarea",placeholder:"Je suis plutôt rando + bons restos, jâadore les échanges simples. Ici je cherche des rencontres sans pression, et si ça matche, on voit où ça nous mène.",autosize:{minRows:4},maxlength:"300","show-count":""},null,8,["value"])]),_:1},8,["validation-status"]),s[17]||(s[17]=u("p",{class:"settings-screen__note"},"120 à 300 caractères conseillés.",-1))]),L.value?(g(),m("div",Xe,[a(t(R),{type:"error",class:"settings-screen__alert"},{default:i(()=>[E(U(t(De))+" ",1),u("ul",Ye,[(g(!0),m(q,null,Z(I.value,n=>(g(),m("li",{key:n.index},[E(U(t(Be)[n.type])+" : ",1),u("strong",null,"« "+U(n.fragment)+" »",1)]))),128))])]),_:1})])):(g(),m("div",Qe,[a(t(R),{type:"warning",class:"settings-screen__alert"},{default:i(()=>[...s[18]||(s[18]=[E(" ð Pour ta sécurité, nâindique ici aucun téléphone, e-mail, lien, réseau social ou adresse personnelle. ",-1)])]),_:1})])),t(v).APP_CODE==="raw"?(g(),m("div",Ze,[a(t(R),{title:"Info Social Rawww",type:"success",closable:""},{default:i(()=>[...s[19]||(s[19]=[E(" Au-delà de lâalimentation et du bien-être, Social Rawww facilite aussi les rencontres. Certaines questions sont donc plus personnelles, mais elles restent facultatives. ",-1)])]),_:1})])):H("",!0)]),_:1},8,["icon"]),a(A,{icon:t(Ae),title:"Ce que je cherche",hint:"Ce qui permet de te proposer les bons profils â et dâéviter les malentendus."},{default:i(()=>[a(t(d),{path:"gender",label:"Je suis"},{default:i(()=>[a(t(f),{value:e.value.gender,"onUpdate:value":s[2]||(s[2]=n=>e.value.gender=n),options:B.value,placeholder:"Choisis"},null,8,["value","options"])]),_:1}),a(t(d),{path:"relationship",label:"Situation amoureuse"},{default:i(()=>[a(t(f),{value:e.value.relationship,"onUpdate:value":s[3]||(s[3]=n=>e.value.relationship=n),options:O.value,placeholder:"Choisis"},null,8,["value","options"])]),_:1}),u("div",es,[a(t(d),{path:"search",label:"Je recherche ici"},{default:i(()=>[a(t(f),{value:e.value.search,"onUpdate:value":s[4]||(s[4]=n=>e.value.search=n),multiple:"",options:T.value,placeholder:"Une ou plusieurs réponses"},null,8,["value","options"])]),_:1})])]),_:1},8,["icon"]),a(A,{collapsible:"",optional:"",icon:t(Pe),title:"Mon apparence",hint:"Quelques détails qui ne se voient pas toujours sur les photos."},{default:i(()=>[a(t(d),{path:"size"},{label:i(()=>[u("span",ss,[a(t(Y),{value:h.value,"onUpdate:value":[s[5]||(s[5]=n=>h.value=n),b],size:"small"},null,8,["value"]),s[20]||(s[20]=E(" Taille (cm) ",-1))])]),default:i(()=>[u("div",ts,[a(t(W),{value:e.value.size,"onUpdate:value":s[6]||(s[6]=n=>e.value.size=n),disabled:!h.value,min:120,max:220,step:1},null,8,["value","disabled"]),a(t(X),{value:e.value.size,"onUpdate:value":s[7]||(s[7]=n=>e.value.size=n),disabled:!h.value,min:120,max:220,size:"small",class:"settings-screen__measure-input"},null,8,["value","disabled"])])]),_:1}),a(t(d),{path:"weight"},{label:i(()=>[u("span",as,[a(t(Y),{value:_.value,"onUpdate:value":[s[8]||(s[8]=n=>_.value=n),S],size:"small"},null,8,["value"]),s[21]||(s[21]=E(" Poids (kg) ",-1))])]),default:i(()=>[u("div",ls,[a(t(W),{value:e.value.weight,"onUpdate:value":s[9]||(s[9]=n=>e.value.weight=n),disabled:!_.value,min:35,max:200,step:1},null,8,["value","disabled"]),a(t(X),{value:e.value.weight,"onUpdate:value":s[10]||(s[10]=n=>e.value.weight=n),disabled:!_.value,min:35,max:200,size:"small",class:"settings-screen__measure-input"},null,8,["value","disabled"])])]),_:1}),a(t(d),{path:"shape",label:"Silhouette"},{default:i(()=>[a(t(f),{value:e.value.shape,"onUpdate:value":s[11]||(s[11]=n=>e.value.shape=n),options:$.value,placeholder:"Choisis"}
1,null,8,["value","options"])]),_:1}),a(t(d),{path:"glasses",label:"Lunettes"},{default:i(()=>[a(t(f),{value:e.value.glasses,"onUpdate:value":s[12]||(s[12]=n=>e.value.glasses=n),options:F.value,placeholder:"Choisis"},null,8,["value","options"])]),_:1}),a(t(d),{path:"eyes",label:"Yeux"},{default:i(()=>[a(t(f),{value:e.value.eyes,"onUpdate:value":s[13]||(s[13]=n=>e.value.eyes=n),options:M.value,placeholder:"Choisis"},null,8,["value","options"])]),_:1}),a(t(d),{path:"hair",label:"Cheveux"},{default:i(()=>[a(t(f),{value:e.value.hair,"onUpdate:value":s[14]||(s[14]=n=>e.value.hair=n),options:j.value,placeholder:"Choisis"},null,8,["value","options"])]),_:1}),t(v).APP_CODE!=="raw"?(g(),m(q,{key:0},[a(t(d),{path:"piercings",label:"Piercings"},{default:i(()=>[a(t(f),{value:e.value.piercings,"onUpdate:value":s[15]||(s[15]=n=>e.value.piercings=n),options:J.value,placeholder:"Choisis"},null,8,["value","options"])]),_:1}),a(t(d),{path:"tattoos",label:"Tatouages"},{default:i(()=>[a(t(f),{value:e.value.tattoos,"onUpdate:value":s[16]||(s[16]=n=>e.value.tattoos=n),options:K.value,placeholder:"Choisis"},null,8,["value","options"])]),_:1})],64)):H("",!0)]),_:1},8,["icon"])]),_:1},8,["model"])])}}},bs=Q(ns,[["__scopeId","data-v-d1f9b567"]]);export{bs 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.