1import{_ as U}from"./DHJwEhI6.js";import{z as B,G as E,a6 as j,K as A,Q as D,N as R,S as V,e as p,o as z,k as a,v as y,x as l,F as g,m as w,j as r,I as s,g as o,l as c,_ as F,E as O,f as P}from"#entry";import{_ as G}from"./BFhQvHZB.js";const H={key:0,class:"flex flex-col gap-4"},K={class:"flex items-start gap-4"},M=["src","alt"],Q={class:"text-lg font-semibold text-gray-800"},q={key:0,class:"text-sm text-gray-500"},J={class:"mt-1 text-sm text-gray-600"},W={key:0},X={key:1},Y={key:2},Z={class:"text-sm text-gray-500"},ee={key:1,class:"text-xs text-gray-400"},te={key:1},oe={class:"mt-10 text-center text-[30px]"},ce=B({__name:"my-certificates",setup(ae){const{listCustomerCertificates:N,downloadCustomerCertificatePdf:I}=E(),{getApiError:h}=j(),{t:k}=A(),v=D(),$=R(),x=V(),d=p(!0),_=p([]),i=p(null);z(async()=>{if(await x.waitUntilConfigLoaded(),!x.permissions.includes("EventCertificates")){$.replace({name:"dashboard-my-tickets"});return}S()});function b(t){try{return new Date(t).toLocaleString()}catch{return t}}function S(){d.value=!0,N().then(function(t){_.value=t,d.value=!1},function(t){d.value=!1,v.add({title:k(h(t)),color:"error"})})}async function L(t){i.value=t.orderTicketId;try{const u=await I(t.orderTicketId),f=URL.createObjectURL(u),n=document.createElement("a"),m=t.eventName.replace(/[^\w\s-]/g,"").trim().replace(/\s+/g,"-");n.href=f,n.download=`certificado-${m||"evento"}.pdf`,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(f)}catch(u){v.add({title:k(h(u)),color:"error"})}finally{i.value=null}}return(t,u)=>{const f=U,n=F,m=O,T=G;return o(),a("div",null,[y(f,{title:t.$t("dashboard.myCertificates")},null,8,["title"]),l(d)===!1?(o(),a(g,{key:0},[l(_).length>=1?(o(),a("div",H,[(o(!0),a(g,null,w(l(_),e=>(o(),a("div",{key:e.orderTicketId,class:"flex flex-col gap-3 rounded-lg border border-gray-200 bg-white p-4 sm:flex-row sm:items-center sm:justify-between"},[r("div",K,[e.eventImage?(o(),a("img",{key:0,src:e.eventImage,alt:e.eventName,class:"h-20 w-28 rounded object-cover"},null,8,M)):c("",!0),r("div",null,[r("p",Q,s(e.eventName),1),e.eventDateStart?(o(),a("p",q,s(b(e.eventDateStart)),1)):c("",!0),r("p",J,[e.sectorName?(o(),a("span",W,s(e.sectorName),1)):c("",!0),e.sectorName&&e.lotName?(o(),a("span",X," · ")):c("",!0),e.lotName?(o(),a("span",Y,s(e.lotName),1)):c("",!0)]),r("p",Z,s(e.participantName),1),e.usedAt?(o(),a("p",ee,s(t.$t("dashboard.certificateEntryAt"))+" "+s(b(e.usedAt)),1)):c("",!0)])]),y(n,{color:"primary",loading:l(i)===e.orderTicketId,label:l(i)===e.orderTicketId?t.$t("dashboard.downloadingCertificate"):t.$t("dashboard.downloadCertificate"),onClick:C=>L(e)},null,8,["loading","label","onClick"])]))),128))])):(o(),a("div",te,[r("div",oe,[r("b",null,s(t.$t("dashboard.noCertificates")),1),y(m,{class:"text-dark m-auto text-center",size:"300px",name:"mdi:certificate-outline"})])]))],64)):(o(!0),a(g,{key:1},w([].constructor(8),(e,C)=>(o(),P(T,{key:C,class:"mt-5 h-28 w-full rounded-md bg-gray-200"}))),128))])}}});export{ce 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.