import{_ as E,a as S,m as L,f as p,i as D,o as a,b as e,d as i,g as l,c as n,F as u,t as r,x as h,l as y,h as $,H as A,w as B,r as F,y as V}from"./index-BSoZUQlM.js";import{C as N}from"./ClientLayout-Bem4ha1T.js";import{L as T}from"./LoadingSpinner-Cc4Dbt2l.js";import{E as M}from"./ErrorMessage-5CbE-StE.js";import{S as H}from"./StatusBadge-EcRctg7x.js";import{u as P}from"./useClientExpediente-DyHmJraw.js";import"./LogoutButton-cwsYC0rL.js";const j={key:0,class:"exp-gallery card","aria-labelledby":"exp-gallery-title"},q={class:"exp-section-desc"},z={class:"exp-masonry"},G=["aria-label","onClick"],I=["src","alt"],J={class:"exp-thumb__meta"},K={key:1,class:"card exp-empty"},O={class:"exp-empty__text"},Q={class:"card exp-timeline","aria-labelledby":"exp-timeline-title"},R={key:0,class:"exp-section-desc"},U={key:1,class:"exp-list"},W={class:"exp-row__main"},X={class:"exp-row__date"},Y={class:"exp-row__time"},Z={class:"exp-row__svc"},ee={class:"exp-row__barber"},te={key:2,class:"exp-no-apt"},se={class:"exp-lightbox__figure"},ae=["src"],oe={key:0,class:"exp-lightbox__cap"},ne={__name:"ExpedienteView",setup(ie){const b=S(),{expedientePhotos:_,expedienteAppointments:m,expedienteLoading:x,expedienteError:g,loadExpediente:k}=P(),c=F(null),f=V(()=>{const o=c.value;if(!o)return"";const t=d(o.taken_at),s=o.appointment?.service?.name;return s?`${t} · ${s}`:t});function v(o){c.value=o}function w(o){return o?new Date(o).toLocaleDateString("es-ES",{day:"2-digit",month:"short",year:"numeric"}):""}function C(o){if(!o)return"";const t=String(o);return t.length>=5?t.slice(0,5):t}function d(o){return o?new Date(o).toLocaleDateString("es-ES",{day:"2-digit",month:"short",year:"numeric"}):""}return L(()=>{k()}),(o,t)=>(a(),p(N,null,{default:D(()=>[t[6]||(t[6]=e("header",{class:"exp-head"},[e("p",{class:"exp-head__eyebrow"},"Tu historial"),e("h2",{class:"exp-head__title"},"Expediente"),e("p",{class:"exp-head__lead"}," Fotos de tus cortes y registro de citas. Tocá una foto para verla en grande. ")],-1)),i(g)?(a(),p(M,{key:0,message:i(g)},null,8,["message"])):l("",!0),i(x)?(a(),p(T,{key:1})):l("",!0),i(x)?l("",!0):(a(),n(u,{key:2},[i(_).length?(a(),n("section",j,[t[2]||(t[2]=e("h3",{id:"exp-gallery-title",class:"exp-section-title"},"Galería",-1)),e("p",q,r(i(_).length)+" foto(s)",1),e("div",z,[(a(!0),n(u,null,h(i(_),s=>(a(),n("button",{key:s.id,type:"button",class:"exp-thumb","aria-label":`Ampliar foto del ${d(s.taken_at)}`,onClick:re=>v(s)},[e("img",{src:s.url,alt:`Foto ${d(s.taken_at)}`,loading:"lazy"},null,8,I),e("span",J,[y(r(d(s.taken_at))+" ",1),s.appointment?.service?(a(),n(u,{key:0},[y(" · "+r(s.appointment.service.name),1)],64)):l("",!0)])],8,G))),128))])])):(a(),n("div",K,[t[3]||(t[3]=e("div",{class:"exp-empty__icon","aria-hidden":"true"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),e("circle",{cx:"8.5",cy:"10",r:"1.5",fill:"currentColor"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 17-5-5-6.5 6.5L6 14.5 3 17.5"})])],-1)),t[4]||(t[4]=e("p",{class:"exp-empty__title"},"Aún no hay fotos",-1)),e("p",O," Cuando el "+r(i(b).staffLabelSingular.toLowerCase())+" registre fotos de tus citas, aparecerán aquí. ",1)])),e("section",Q,[t[5]||(t[5]=e("h3",{id:"exp-timeline-title",class:"exp-section-title"},"Citas",-1)),i(m).length?(a(),n("p",R,"Historial completo")):l("",!0),i(m).length?(a(),n("ul",U,[(a(!0),n(u,null,h(i(m),s=>(a(),n("li",{key:s.id,class:"exp-row"},[e("div",W,[e("span",X,r(w(s.appointment_date)),1),e("span",Y,r(C(s.start_time)),1),e("span",Z,r(s.service?.name),1),e("span",ee,r(s.barber?.user?.name),1)]),$(H,{status:s.status},null,8,["status"])]))),128))])):(a(),n("p",te,"No tenés citas registradas todavía."))])],64)),(a(),p(A,{to:"body"},[c.value?(a(),n("div",{key:0,class:"exp-lightbox",role:"dialog","aria-modal":"true","aria-label":"Foto ampliada",onClick:t[1]||(t[1]=B(s=>c.value=null,["self"]))},[e("button",{type:"button",class:"exp-lightbox__close","aria-label":"Cerrar",onClick:t[0]||(t[0]=s=>c.value=null)},"×"),e("figure",se,[e("img",{src:c.value.url,alt:"Foto ampliada del expediente"},null,8,ae),f.value?(a(),n("figcaption",oe,r(f.value),1)):l("",!0)])])):l("",!0)]))]),_:1}))}},xe=E(ne,[["__scopeId","data-v-b34fb0fb"]]);export{xe as default};
