PageSourceSearch

https://www.connect-events.fr/_next/static/chunks/pages/profile/mes-billets-963aea190361c106.js

js connect-events.fr collected 2026-10-02 00:03:05 UTC 27,220 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7111],{4708:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>V});var a=l(6029),n=l(73492),s=l(52278),r=l(39794),i=l(37890),c=l(55801),o=l(43099),d=l.n(o),u=l(81278),x=l(55729),p=l(34245),m=l(96930),f=l(17325),h=l(40334),g=l(33027),v=l(33481),y=l(13731),b=l.n(y),j=l(59018),w=l.n(j),N=l(4516),k=l(34759),T=l(16972),C=l(91993),D=l(21053);let S=e=>{let{src:t,x:l,y:n,width:s,height:r,containerWidth:i,containerHeight:c}=e;return(0,a.jsx)("div",{className:"relative size-full rounded-t-[9px]",style:{overflow:"hidden"},children:(0,a.jsx)("div",{className:"image-part",style:{backgroundImage:"url(".concat(t,")"),backgroundPosition:"-".concat(l,"px -").concat(n,"px"),backgroundSize:"auto",width:"".concat(s,"px"),height:"".concat(r,"px"),backgroundRepeat:"no-repeat",overflow:"hidden",transform:"scale(".concat(i/s,", ").concat(c/r,")"),transformOrigin:"top left"}})})};var P=l(65403),I=l(13471),O=l(74312),A=l.n(O),E=l(38372),M=l.n(E),R=l(74010);let z=["janvier","f\xe9vrier","mars","avril","mai","juin","juillet","ao\xfbt","septembre","octobre","novembre","d\xe9cembre"],B=e=>{var t,l,s,i;let{data:c,isOpen:o,onClose:d,handleDownload:u}=e,p=(0,r.al)(),{data:m}=(0,n.UH6)(c[0].badgeType.event.id),[g,v]=(0,x.useState)(),[y,b]=(0,x.useState)(0),[j,N]=(0,x.useState)(0),[O,E]=(0,x.useState)([]),{getFileUrl:B}=(0,h.Co)(),L=w()(c.map(e=>{var t,l,a,n,s,r;let{orderItem:i}=e;return B(null==i||null==(a=i.order.onlineDetails)||null==(l=a.invoice)||null==(t=l.file)?void 0:t.key,null==i||null==(r=i.order.onlineDetails)||null==(s=r.invoice)||null==(n=s.file)?void 0:n.type)}).filter(e=>e.length>0));(0,x.useEffect)(()=>{g&&(N(g.scrollSnapList().length),b(g.selectedScrollSnap()+1),g.on("select",()=>{b(g.selectedScrollSnap()+1)}))},[g]),(0,x.useEffect)(()=>{(async()=>{let e=c.map(e=>{var t;return R.toDataURL(JSON.stringify({data:e.hmac,badgeId:e.id,type:"badge",gateIds:(null==(t=e.badgeType.eventGates)?void 0:t.map(e=>e.id))||[]}))});E(await Promise.all(e))})()},[c]);let _=(0,x.useMemo)(()=>{let e=c.flatMap(e=>e.badgeType.validityDates.map(e=>A()(e)));if(0===e.length)return"";let t=A()(Math.min(...e.map(e=>e.valueOf()))),l=A()(Math.max(...e.map(e=>e.valueOf()))),a=t.date(),n=l.date(),s=t.year(),r=l.year(),i=t.month(),o=l.month(),d=a===n,u=i===o,x=s===r,p=u?"":" ".concat(z[i]),m=x?"":" ".concat(s);return d&&u&&x?"".concat(a," ").concat(z[i]," ").concat(s):"".concat(a).concat(p).concat(m," - ").concat(n," ").concat(z[o]," ").concat(r)},[c]),$=(0,x.useMemo)(()=>{var e,t,l,a,n;let s=null!=(n=null==(t=c.at(0))||null==(e=t.badgeType.event.dates)?void 0:e.schedules)?n:[],r=null==(l=s.at(0))?void 0:l.fromDate,i=s.length>0?null==(a=s.at(s.length-1))?void 0:a.toDate:void 0,o=r?new Date(r).toISOString():"",d=i?new Date(i).toISOString():"";return r&&i?U(o,d):""},[c]),F=null!=(s=null==(t=c.at(0))?void 0:t.badgeType.customAppearance)?s:n.NK$,K=(0,f.oF5)(null!=(i=F.color)?i:"white");return(0,a.jsxs)(k.lG,{open:o,onOpenChange:d,children:[(0,a.jsx)(k.LC,{}),(0,a.jsxs)(k.Cf,{className:(0,r.cn)("bg-background max-w-[529px] overflow-auto p-0",{"h-full":p}),children:[(0,a.jsxs)(k.c7,{className:(0,r.cn)("flex flex-row items-center px-10 pb-2 pt-6 text-center text-2xl font-extrabold leading-[24px]",{"pt-4":p,"pb-0":p}),children:[c.length>1?"Badges":"Badge"," ",_,(0,a.jsx)(k.HM,{onClick:d})]}),(0,a.jsx)(T.w,{className:"w-full max-w-[527px]"}),(0,a.jsxs)("div",{className:(0,r.cn)("flex w-full flex-col justify-around py-2 text-center",{hidden:p}),children:[(0,a.jsx)("p",{className:"text-[18px] font-extrabold leading-[21.6px]",children:null==(l=c.at(0))?void 0:l.badgeType.event.name}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:$})]}),(0,a.jsxs)(C.FN,{setApi:v,className:"max-h-[calc(100vh-100px)] max-w-[529px] overflow-hidden",children:[(0,a.jsx)(C.Wk,{className:"flex",children:c.map((e,t)=>{var l,n;return(0,a.jsx)(C.A7,{className:(0,r.cn)("ml-4 flex basis-auto flex-col items-center justify-center",{"pl-[calc((100%-270.3px)/2)]":0===t},{"pr-[calc((100%-270.3px)/2)]":t===c.length-1}),children:(0,a.jsx)(D.Zp,{className:"w-full max-w-[288px] justify-center",children:(0,a.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-0",{"flex-col-reverse":"qrCodeFirst"===F.order}),children:[(0,a.jsxs)(D.Zp,{className:"border-gray flex w-[250px] flex-col justify-center border shadow-lg",style:{backgroundColor:K},children:[F.picture&&(0,a.jsx)("div",{className:"h-[150px] w-[250px] overflow-hidden object-fill",children:(0,a.jsx)(S,{src:B(F.picture.key,"media"),x:F.xPicture,y:F.yPicture,width:F.wPicture,height:F.hPicture,containerWidth:250,containerHeight:150})}),(0,a.jsxs)("div",{className:"flex flex-row justify-between gap-2 px-3 py-2",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("h2",{className:"text-lg font-extrabold",children:e.badgeType.event.name}),(0,a.jsx)("h3",{className:"text-sm font-extrabold",children:e.badgeType.name})]}),(0,a.jsx)("span",{className:"m-0 flex items-center whitespace-nowrap text-xs font-semibold",children:(null==(l=e.badgeType.pricing)?void 0:l.price)?(0,f.$gu)(null!=(n=e.badgeType.pricing.price.priceTTC)?n:0,0,!0,{asCents:!0}):"Gratuit"})]}),(0,a.jsx)("span",{className:"m-0 flex flex-wrap gap-1 self-center px-3 py-2 text-sm font-normal",children:$})," "]}),(0,a.jsx)(D.Zp,{className:"border-gray flex w-[250px] justify-center border px-4 py-3 text-lg font-extrabold shadow-lg",style:{backgroundColor:K},children:(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1",children:[O[t]?(0,a.jsx)(I.A,{src:O[t],alt:"qrcode",width:200,height:200,className:"static"}):(0,a.jsx)("p",{children:"QR code en cours de g\xe9n\xe9ration..."}),(0,a.jsx)("p",{className:"text-[14px] font-bold leading-[21px]",children:e.code})]})})]})})},t)})}),(0,a.jsx)(C.Q8,{className:"left-16"}),(0,a.jsx)(C.Oj,{className:"right-16"})]}),(0,a.jsxs)("div",{className:(0,r.cn)("text-muted-foreground text-center text-sm",{"py-2":!p,"py-0":p}),children:["Badge ",y," sur ",j]}),(0,a.jsx)(T.w,{className:"w-full max-w-[527px]"}),(0,a.jsxs)("div",{className:"flex max-w-[527px] flex-col items-center gap-2 px-[40px] pb-[16px]",children:[(0,a.jsx)(P.$,{className:"h-[44px] w-[257px] px-[16px] py-[10px] text-[16px] font-semibold leading-[24px]",variant:"blue",onClick:()=>m&&c.length>0&&(0,n.V3p)(m.id,c[0].badgeTypeId,m.name,M()),children:"T\xe9l\xe9charger mes badges"}),(0,a.jsxs)(P.$,{className:(0,r.cn)("h-[44px] w-[257px] px-[16px] py-[10px] text-[16px] font-semibold leading-[24px]",{hidden:!p||0===L.length}),variant:"outline-blue",onClick:e=>u(e,L),children:["T\xe9l\xe9charger ",L.length>1?"mes factures":"ma facture"]})]})]})]})},L=e=>{var t,l,s;let{data:i,isOpen:c,onClose:o,handleDownload:d}=e,u=(0,r.al)(),{data:p}
1=(0,n.UH6)(i[0].ticketType.event.id),[m,g]=(0,x.useState)(),[v,y]=(0,x.useState)(0),[b,j]=(0,x.useState)(0),[N,O]=(0,x.useState)([]),{getFileUrl:M}=(0,h.Co)(),z=w()(i.map(e=>{let{invoice:t}=e;return M(null==t?void 0:t.key,null==t?void 0:t.type)}).filter(e=>e.length>0));(0,x.useEffect)(()=>{m&&(j(m.scrollSnapList().length),y(m.selectedScrollSnap()+1),m.on("select",()=>{y(m.selectedScrollSnap()+1)}))},[m]),(0,x.useEffect)(()=>{(async()=>{let e=i.map(e=>R.toDataURL(JSON.stringify({data:e.hmac,ticketId:e.id,type:"ticket",gateIds:e.ticketType.gateIds})));O(await Promise.all(e))})()},[i]);let B=(0,x.useMemo)(()=>{let e=i.flatMap(e=>e.ticketType.validityDates.map(e=>A()(e)));if(0===e.length)return"";let t=A()(Math.min(...e.map(e=>e.valueOf()))),l=A()(Math.max(...e.map(e=>e.valueOf()))),a=t.date(),n=l.date(),s=t.year(),r=l.year(),c=t.month(),o=l.month(),d=a===n,u=c===o,x=s===r,p=u?"":" ".concat((0,f.cjS)(c)),m=x?"":" ".concat(s);return d&&u&&x?"".concat(a," ").concat((0,f.cjS)(c)," ").concat(s):"".concat(a).concat(p).concat(m," - ").concat(n," ").concat((0,f.cjS)(o)," ").concat(r)},[i]),L=(0,x.useMemo)(()=>{var e,t,l,a,n;let s=null!=(n=null==(t=i.at(0))||null==(e=t.ticketType.event.dates)?void 0:e.schedules)?n:[],r=null==(l=s.at(0))?void 0:l.fromDate,c=s.length>0?null==(a=s.at(s.length-1))?void 0:a.toDate:void 0,o=r?new Date(r).toISOString():"",d=c?new Date(c).toISOString():"";return r&&c?U(o,d):""},[i]),_=null!=(s=null==(t=i.at(0))?void 0:t.ticketType.customAppearance)?s:n.NK$;return(0,a.jsxs)(k.lG,{open:c,onOpenChange:o,children:[(0,a.jsx)(k.LC,{}),(0,a.jsxs)(k.Cf,{className:(0,r.cn)("bg-background max-w-[529px] overflow-auto p-0 md:max-h-[calc(100vh-120px)]",{"h-full":u}),children:[(0,a.jsxs)(k.c7,{className:(0,r.cn)("flex flex-row items-center px-10 pb-2 pt-6 text-center text-2xl font-extrabold leading-[24px]",{"pt-4":u,"pb-0":u}),children:[i.length>1?"Billets":"Billet"," ",B,(0,a.jsx)(k.HM,{onClick:o})]}),(0,a.jsx)(T.w,{className:"w-full max-w-[527px]"}),(0,a.jsxs)("div",{className:(0,r.cn)("flex w-full flex-col justify-around py-2 text-center",{hidden:u}),children:[(0,a.jsx)("p",{className:"text-[18px] font-extrabold leading-[21.6px]",children:null==(l=i.at(0))?void 0:l.ticketType.event.name}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:L})]}),(0,a.jsxs)(C.FN,{setApi:g,className:"max-h-[calc(100vh-100px)] max-w-[529px] overflow-hidden",children:[(0,a.jsx)(C.Wk,{className:"flex",children:i.map((e,t)=>{var l,n,s;return(0,a.jsx)(C.A7,{className:(0,r.cn)("ml-4 flex basis-auto flex-col items-center justify-center",{"pl-[calc((100%-270.3px)/2)]":0===t},{"pr-[calc((100%-270.3px)/2)]":t===i.length-1}),children:(0,a.jsx)(D.Zp,{className:"w-full max-w-[288px] justify-center",children:(0,a.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-0",{"flex-col-reverse":"qrCodeFirst"===_.order}),children:[(0,a.jsxs)(D.Zp,{className:"border-gray flex w-[250px] flex-col justify-center border shadow-lg",style:{backgroundColor:null!=(l=_.color)?l:"#ffffff"},children:[_.picture&&(0,a.jsx)("div",{className:"h-[150px] w-[250px] overflow-hidden object-fill",children:(0,a.jsx)(S,{src:M(_.picture.key,"media"),x:_.xPicture,y:_.yPicture,width:_.wPicture,height:_.hPicture,containerWidth:250,containerHeight:150})}),(0,a.jsxs)("div",{className:"flex flex-row justify-between gap-2 px-3 py-2",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("h2",{className:"text-lg font-extrabold",children:e.ticketType.event.name}),(0,a.jsx)("h3",{className:"text-sm font-extrabold",children:e.ticketType.name})]}),(0,a.jsx)("span",{className:"m-0 flex items-center whitespace-nowrap text-xs font-semibold",children:e.ticketType.price?(0,f.$gu)(null!=(n=e.ticketType.price.priceTTC)?n:0,0,!0,{asCents:!0}):"Gratuit"})]}),(0,a.jsx)("span",{className:"m-0 flex flex-wrap gap-1 self-center px-3 py-2 text-sm font-normal",children:L})]}),(0,a.jsx)(D.Zp,{className:"border-gray flex w-[250px] justify-center border px-4 py-3 text-lg font-extrabold shadow-lg",style:{backgroundColor:null!=(s=_.color)?s:"#ffffff"},children:(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1",children:[N[t]?(0,a.jsx)(I.A,{src:N[t],alt:"qrcode",width:200,height:200,className:"static"}):(0,a.jsx)("p",{children:"QR code en cours de g\xe9n\xe9ration..."}),(0,a.jsx)("p",{className:"text-[14px] font-bold leading-[21px]",children:e.code})]})})]})})},t)})}),(0,a.jsx)(C.Q8,{className:"left-16"}),(0,a.jsx)(C.Oj,{className:"right-16"})]}),(0,a.jsxs)("div",{className:(0,r.cn)("text-muted-foreground text-center text-sm",{"py-2":!u,"py-0":u}),children:["Billet ",v," sur ",b]}),(0,a.jsx)(T.w,{className:"w-full max-w-[527px]"}),(0,a.jsxs)("div",{className:"flex max-w-[527px] flex-col items-center gap-2 px-[40px] pb-[16px]",children:[(0,a.jsx)(P.$,{className:"h-[44px] w-[257px] px-[16px] py-[10px] text-[16px] font-semibold leading-[24px]",variant:"blue",onClick:()=>p&&i.length>0&&(0,n._oc)(p.id,i[0].ticketTypeId,p.name,E.saveAs),children:"T\xe9l\xe9charger mes billets"}),(0,a.jsxs)(P.$,{className:(0,r.cn)("h-[44px] w-[257px] px-[16px] py-[10px] text-[16px] font-semibold leading-[24px]",{hidden:!u||0===z.length}),variant:"outline-blue",onClick:e=>d(e,z),children:["T\xe9l\xe9charger ",z.length>1?"mes factures":"ma facture"]})]})]})]})};function _(e){return e&&0!==e.length?{startDate:e[0],endDate:e[e.length-1]}
1:{startDate:null,endDate:null}}let U=(e,t)=>{let l=new Date(e),a=new Date(t);return(0,f.tXX)(l,a,{monthFormat:"MMMM"})},$=(e,t)=>{let l=e?new Date(e):null,a=t?new Date(t):null;return l&&a?(0,f.tXX)(l,a):""},F={activity:"Animation",event:"Billet",badge:"Badge"},K={activity:"ticket",event:"ticket",badge:"badge"},Z=e=>{let{handleOpenDetail:t,imgUrl:l,eventName:n,dateText:s,count:i,addressText:c,type:o,invoiceCount:d,name:u,handleDownload:x}=e,p=(0,r.Ww)(),m=(0,r.al)(),f=i>1,h=d>0;return(0,a.jsx)("div",{className:"rounded-2xl border bg-white shadow-sm",children:(0,a.jsxs)("div",{className:"relative flex max-w-full gap-1",role:"button",tabIndex:0,onClick:t,onKeyDown:e=>["Enter"," "].includes(e.key)&&t(),children:[(0,a.jsxs)("div",{className:"relative h-[120px] w-[159px] flex-none rounded-lg",children:[(0,a.jsx)("img",{src:l,alt:n,className:"size-full flex-none rounded-l-2xl rounded-r-lg object-cover"}),(0,a.jsx)("p",{className:"absolute left-2 top-2 size-fit w-[75%] truncate rounded-full bg-gray-100 px-2 text-[12px] font-semibold leading-[18px] text-black",children:s}),(0,a.jsxs)("p",{className:"absolute bottom-2 right-2 size-fit w-fit truncate rounded-full bg-gray-100 px-2 text-[12px] font-semibold leading-[18px] text-black",children:["x",i]})]}),(0,a.jsxs)("div",{className:"ml-4 flex h-[120px] grow flex-col justify-between gap-2 truncate py-4",children:[(0,a.jsxs)("div",{className:"flex w-full flex-col",children:[(0,a.jsx)("h2",{className:"truncate text-lg font-bold",children:n}),(0,a.jsxs)("div",{className:"flex w-full items-center gap-1",children:[(0,a.jsx)(N.sR,{width:16,height:16,fill:"#98A2B3"}),(0,a.jsx)("p",{className:"truncate text-sm text-gray-500",children:c})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-1",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-row items-center gap-1",children:[(0,a.jsx)("img",{className:"size-4",src:"/images/".concat(K[o],".png"),alt:"Icone du billet"}),(0,a.jsxs)("p",{className:"truncate text-sm text-gray-500",children:[F[o]," : ",u]})]}),p&&!m&&h&&(0,a.jsx)("div",{className:"flex w-fit shrink-0",children:(0,a.jsx)(G,{handleOpenDetail:t,isBadge:"badge"===o,isPlural:f})})]})]}),(0,a.jsxs)("div",{className:(0,r.cn)("flex flex-row items-center justify-between",{"absolute bottom-2 right-0 flex-col-reverse items-end":p&&!m,"justify-end":!h||m}),children:[!m&&h&&(0,a.jsx)(q,{handleDownload:x,hasMultipleInvoices:d>1}),(!p||m||!h)&&(0,a.jsx)(G,{handleOpenDetail:t,isBadge:"badge"===o,isPlural:f})]})]})]})})},q=e=>{let{handleDownload:t,hasMultipleInvoices:l}=e;return(0,a.jsxs)("button",{className:"flex cursor-pointer justify-end pr-4 text-blue-500 hover:underline",onClick:e=>t(e),children:["T\xe9l\xe9charger ",l?"mes factures":"ma facture"]})},G=e=>{let{handleOpenDetail:t,isPlural:l,isBadge:n}=e;return(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),t()},children:(0,a.jsx)("p",{className:"flex cursor-pointer justify-end pr-4 text-blue-500 hover:underline",children:n?"Voir le".concat(l?"s":""," badge").concat(l?"s":""):"Voir le".concat(l?"s":""," billet").concat(l?"s":"")})})},H=function(e){let{tickets:t,activePanel:l,badges:n,url:s,isLoadingUserBadges:i,isLoadingUserTickets:c}=e,{getFileUrl:o}=(0,h.Co)(),d=(0,r.al)(),[y,j]=(0,x.useState)(),[k,T]=(0,x.useState)(),[C,D]=(0,x.useState)([]),S=e=>{var t;return null!=(t=e.split("#")[1])?t:""},[P,I]=(0,x.useState)(S(s)),[O,A]=(0,x.useState)([]),E=(0,u.useRouter)(),{toast:M}=(0,p.dj)();(0,x.useEffect)(()=>{I(S(s))},[s]);let R=(0,x.useMemo)(()=>"ticketOpen"===P,[P]),z=(0,x.useMemo)(()=>"badgeOpen"===P,[P]);(0,x.useEffect)(()=>{t&&D(Object.values(null==t?void 0:t.reduce((e,t)=>{let l=t.userId,a=t.ticketType.id,n="".concat(l,"-").concat(a);return e[n]?e[n].count+=1:e[n]={...t,count:1},e},{})))},[t]),(0,x.useEffect)(()=>{n&&A(Object.values(b()(n,e=>"".concat(e.userId,"-").concat(e.badgeTypeId))).map(e=>({...e[0],count:e.length})))},[n]);let U=(0,x.useCallback)(e=>{let t=new Date,a=(0,g.D)(e[e.length-1]),n=(0,v.d)(t,a);return"incoming"===l&&!n||"past"===l&&n},[l]),F=(0,x.useMemo)(()=>C.filter(e=>U(e.ticketType.validityDates.map(e=>(0,f.jKi)(e)))),[U,C]),K=(0,x.useMemo)(()=>O.filter(e=>U(e.badgeType.validityDates.map(e=>(0,f.jKi)(e)))),[O,U]),q=(e,t)=>
1{let l=void 0!==t&&t.length>0;if(e.stopPropagation(),!l)return;let a=w()(t),n=a.map(e=>window.open(e,"_blank")).filter(e=>null!==e);n.length!==a.length&&(M({title:"Erreur",description:"Une erreur est survenue lors de l'ouverture, veuillez autoriser les popups"}),n.forEach(e=>e.close()))};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:(0,r.cn)("rounded-3xl border bg-gray-50",{"border-none px-4 py-3":d,"px-8 py-6":!d}),children:[i||c?(0,a.jsx)(m.R,{}):null,F.length>0||K.length>0||i||c?(0,a.jsxs)("div",{className:(0,r.cn)("grid gap-4",{"grid-cols-1":d,"grid-cols-2":!d}),children:[F.map(e=>{let{address:l,image:n,name:s}=e.ticketType.event,{startDate:r,endDate:i}=_(e.ticketType.validityDates),c=t.filter(t=>t.ticketTypeId===e.ticketTypeId).map(e=>{let{invoice:t}=e;return o(null==t?void 0:t.key,null==t?void 0:t.type)}).filter(e=>e.length>0),d=$(r,i);return(0,a.jsx)(Z,{addressText:(0,f.Z2L)(l),imgUrl:o(null==n?void 0:n.key,null==n?void 0:n.type)||"/images/event.jpeg",invoiceCount:w()(c).length,eventName:s,count:e.count,dateText:d,type:e.ticket.type,name:e.ticketType.name,handleOpenDetail:()=>(e=>{let l=null==t?void 0:t.filter(t=>t.ticketType.id===e.ticketType.id);j(null!=l?l:[]),E.push("#ticketOpen")})(e),handleDownload:e=>q(e,c)},e.id)}),K.map(e=>{let{address:t,image:l,name:s}=e.badgeType.event,{startDate:r,endDate:i}=_(e.badgeType.validityDates),c=n.filter(t=>t.badgeTypeId===e.badgeTypeId).map(e=>{var t,l,a,n,s,r;let{orderItem:i}=e;return o(null==i||null==(a=i.order.onlineDetails)||null==(l=a.invoice)||null==(t=l.file)?void 0:t.key,null==i||null==(r=i.order.onlineDetails)||null==(s=r.invoice)||null==(n=s.file)?void 0:n.type)}).filter(e=>e.length>0),d=$(r,i);return(0,a.jsx)(Z,{addressText:(0,f.Z2L)(t),imgUrl:o(null==l?void 0:l.key,null==l?void 0:l.type)||"/images/event.jpeg",eventName:s,count:e.count,dateText:d,name:e.badgeType.name,type:"badge",handleOpenDetail:()=>(e=>{let t=null==n?void 0:n.filter(t=>t.badgeType.id===e.badgeType.id);T(null!=t?t:[]),E.push("#badgeOpen")})(e),invoiceCount:w()(c).length,handleDownload:e=>q(e,c)},e.id)})]}):(0,a.jsxs)("div",{className:"flex h-[450px] flex-col items-center justify-center gap-[11px]",children:[(0,a.jsx)(N.qy,{width:24,height:24,fill:"#98A2B3"}),(0,a.jsxs)("p",{className:"font-semibold text-gray-500",children:["Aucun billet pour les ","past"===l?"\xe9v\xe9nements":"prochains \xe9v\xe9nements"]})]})]}),R&&y&&(0,a.jsx)(L,{data:y,isOpen:R,handleDownload:q,onClose:()=>E.back()}),z&&k&&(0,a.jsx)(B,{data:k,isOpen:z,handleDownload:q,onClose:()=>E.back()})]})};var Q=l(56623);let W="flex grow cursor-pointer flex-col items-center px-2 py-2",X=[{value:"all",label:"Tous les billets"},{value:"tickets",label:"Billets"},{value:"badge",label:"Badges"},{value:"activity",label:"Billets animation"}],V=function(){let e=(0,r.al)(),{data:t,isLoading:l}=(0,n.dY6)(),{data:o,isLoading:p}=(0,n.hIV)(),m=(0,u.useRouter)(),f=(0,x.useRef)(m.asPath),[h,g]=(0,x.useState)("all"),{type:v,invitationId:y}=(0,c.A)(),{user:b,isLoading:j,isAuthenticated:w}=(0,i.u)(),{mutate:N}=(0,n.oBy)();(0,x.useEffect)(()=>{!j&&y&&v&&"validation"===v&&N(y),(0,Q.j)({router:m,isAuthenticated:w,isLoading:j,redirectPath:"/",preserveCurrentQuery:!0})},[j,b,y,v,w]),(0,x.useEffect)(()=>{let e=e=>{e!==f.current&&(f.current=e)};return m.events.on("hashChangeStart",e),()=>{m.events.off("hashChangeStart",e)}},[m]);let k=(0,x.useCallback)(e=>e&&b?e.map(e=>{var t,l,a,n,s,r,i,c,o,d,u,x;return{code:e.code,ticketType:{...e.ticketType,price:{priceTTC:null!=(o=null==(l=e.ticketType.pricing)||null==(t=l.price)?void 0:t.priceTTC)?o:0},validityDates:e.ticketType.validityDates,numberEntriesPerDay:e.ticketType.numberEntriesPerDay,isInfiniteEntries:e.ticketType.isInfiniteEntries,isPaid:null!=(d=null==(a=e.ticketType.pricing)?void 0:a.isPaid)&&d,customAppearance:e.ticketType.customAppearance,customPdfAppearance:e.ticketType.customPdfAppearance,gateIds:e.ticketType.eventGates.map(e=>e.id)},createdAt:e.createdAt,userId:b.id,hmac:e.hmac,id:e.id,ticket:{id:e.id,type:null!==e.ticketType.activity?"activity":"event",count:1,name:e.ticketType.name,price:null!=(u=null==(s=e.ticketType.pricing)||null==(n=s.price)?void 0:n.priceTTC)?u:0,validityDates:e.ticketType.validityDates},ticketTypeId:e.ticketType.id,user:b,updatedAt:e.updatedAt,invoice:null!=(x=null==(c=e.orderItem)||null==(i=c.order.onlineDetails)||null==(r=i.invoice)?void 0:r.file)?x:null}}):[],[b]),T=(0,x.useMemo)(()=>k(t),[t,k]),C=(0,x.useMemo)(()=>("all"===h||"badge"===h)&&null!=o?o:[],[o,h]),D=(0,x.useMemo)(()=>
1{if("badge"===h)return[];if("all"===h)return T;let[e,t]=d()(T,e=>null!==e.ticketType.activity);return"tickets"===h?t:e},[h,T]),[S,P]=(0,x.useState)("incoming");return(0,a.jsxs)("div",{className:(0,r.cn)("p-20",{"p-0":e}),children:[(0,a.jsxs)("div",{className:(0,r.cn)("flex w-full justify-between",{"justify-end p-2":e}),children:[(0,a.jsx)("h1",{className:(0,r.cn)("text-3xl font-extrabold",{hidden:e}),children:"Mes billets"}),(0,a.jsxs)(s.l6,{value:h,onValueChange:g,children:[(0,a.jsx)(s.bq,{className:"h-[41px] w-[160px]",children:(0,a.jsx)(s.yv,{})}),(0,a.jsx)(s.gC,{ref:e=>{e&&(e.ontouchstart=e=>e.preventDefault())},children:X.map(e=>{let{value:t,label:l}=e;return(0,a.jsx)(s.eb,{value:t,children:l},t)})})]})]}),(0,a.jsxs)("div",{className:(0,r.cn)("flex px-2 pb-2 pt-6 xl:px-6",{"pt-2":e}),children:[(0,a.jsx)("div",{className:(0,r.cn)(W,{"border-b-2 border-blue-500":"incoming"===S,"border-gray-400":"incoming"!==S}),onClick:()=>{P("incoming")},onKeyDown:()=>{P("incoming")},role:"button",tabIndex:0,children:(0,a.jsx)("p",{className:(0,r.cn)("font-bold",{"text-blue-500":"incoming"===S,"text-gray-400":"incoming"!==S}),children:"Billets \xe0 venir"})}),(0,a.jsx)("div",{className:(0,r.cn)(W,{"border-b-2 border-blue-500":"past"===S,"border-gray-400":"past"!==S}),onClick:()=>{P("past")},onKeyDown:()=>{P("past")},role:"button",tabIndex:0,children:(0,a.jsx)("p",{className:(0,r.cn)("font-bold",{"text-blue-500":"past"===S,"text-gray-400":"past"!==S}),children:"Billets pass\xe9s"})})]}),(0,a.jsx)(H,{badges:C,tickets:D,activePanel:S,url:f.current,isLoadingUserTickets:l,isLoadingUserBadges:p})]})}},24213:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/mes-billets",function(){return l(4708)}])},56623:(e,t,l)=>{"use strict";l.d(t,{A:()=>i,j:()=>r});var a=l(55729),n=l(81278),s=l(37890);let r=e=>{let{router:t,isAuthenticated:l,isLoading:a,redirectPath:n="/",params:s={},preserveCurrentQuery:r=!1}=e;if(!a&&!l)if(r){let e=new URL(n,window.location.origin);Object.entries(t.query).forEach(t=>{let[l,a]=t;a&&e.searchParams.set(l,Array.isArray(a)?a[0]:a)}),s&&Object.entries(s).forEach(t=>{let[l,a]=t;e.searchParams.set(l,a)}),t.push(e.toString().replace(e.origin,""))}else{let e=new URL(n,window.location.origin);s&&Object.entries(s).forEach(t=>{let[l,a]=t;e.searchParams.set(l,a)}),t.push(n)}},i=e=>{let{redirectPath:t="/",params:l={},preserveCurrentQuery:i=!1}=e,{isAuthenticated:c,isLoading:o}=(0,s.u)(),d=(0,n.useRouter)();(0,a.useEffect)(()=>{r({router:d,isAuthenticated:c,isLoading:o,redirectPath:t,params:l,preserveCurrentQuery:i})},[c,o,t,i,d,l])}},91993:(e,t,l)=>{"use strict";l.d(t,{A7:()=>m,FN:()=>x,Oj:()=>h,Q8:()=>f,Wk:()=>p,dw:()=>g});var a=l(6029),n=l(38471),s=l(58472),r=l(39477),i=l(55729),c=l(39794),o=l(65403);let d=i.createContext(null);function u(){let e=i.useContext(d);if(!e)throw Error("useCarousel must be used within a <Carousel />");return e}let x=i.forwardRef((e,t)=>{let{orientation:l="horizontal",opts:s,setApi:r,plugins:o,className:u,children:x,...p}=e,[m,f]=(0,n.A)({...s,axis:"horizontal"===l?"x":"y"},o),[h,g]=i.useState(!1),[v,y]=i.useState(!1),[b,j]=i.useState(0),w=i.useCallback(e=>{e&&(g(e.canScrollPrev()),y(e.canScrollNext()))},[]),N=i.useCallback(()=>{null==f||f.scrollPrev()},[f]),k=i.useCallback(()=>{null==f||f.scrollNext()},[f]),T=i.useCallback(()=>null==f?void 0:f.scrollSnapList(),[f]),C=i.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),N()):"ArrowRight"===e.key&&(e.preventDefault(),k())},[N,k]);return i.useEffect(()=>{f&&r&&r(f)},[f,r]),i.useEffect(()=>{if(f)return w(f),f.on("reInit",w),f.on("select",w),()=>{null==f||f.off("select",w)}},[f,w]),(0,a.jsx)(d.Provider,{value:{carouselRef:m,api:f,opts:s,orientation:l||((null==s?void 0:s.axis)==="y"?"vertical":"horizontal"),scrollPrev:N,scrollNext:k,canScrollPrev:h,canScrollNext:v,selectedScrollSnap:b,scrollSnapList:T},children:(0,a.jsx)("div",{ref:t,onKeyDownCapture:C,className:(0,c.cn)("relative",u),role:"region","aria-roledescription":"carousel",...p,children:x})})});x.displayName="Carousel";let p=i.forwardRef((e,t)=>{let{className:l,...n}=e,{carouselRef:s,orientation:r}=u();return(0,a.jsx)("div",{ref:s,className:"overflow-hidden",children:(0,a.jsx)("div",{ref:t,className:(0,
1c.cn)("flex","horizontal"===r?"-ml-4":"-mt-4 flex-col",l),...n})})});p.displayName="CarouselContent";let m=i.forwardRef((e,t)=>{let{className:l,...n}=e,{orientation:s}=u();return(0,a.jsx)("div",{ref:t,role:"group","aria-roledescription":"slide",className:(0,c.cn)("min-w-0 shrink-0 grow-0 basis-full","horizontal"===s?"pl-4":"pt-4",l),...n})});m.displayName="CarouselItem";let f=i.forwardRef((e,t)=>{let{className:l,variant:n="outline",size:r="icon",...i}=e,{orientation:d,scrollPrev:x,canScrollPrev:p}=u();return(0,a.jsxs)(o.$,{ref:t,variant:n,size:r,className:(0,c.cn)("absolute  h-8 w-8 rounded-full","horizontal"===d?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",l),disabled:!p,onClick:x,...i,children:[(0,a.jsx)(s.A,{className:"size-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Previous slide"})]})});f.displayName="CarouselPrevious";let h=i.forwardRef((e,t)=>{let{className:l,variant:n="outline",size:s="icon",...i}=e,{orientation:d,scrollNext:x,canScrollNext:p}=u();return(0,a.jsxs)(o.$,{ref:t,variant:n,size:s,className:(0,c.cn)("absolute h-8 w-8 rounded-full","horizontal"===d?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",l),disabled:!p,onClick:x,...i,children:[(0,a.jsx)(r.A,{className:"size-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Next slide"})]})});h.displayName="CarouselNext";let g=i.forwardRef((e,t)=>{var l,n;let{className:s,variant:r="outline",size:i="icon",...o}=e,{orientation:d,selectedScrollSnap:x,scrollSnapList:p}=u(),m=null!=(n=null==(l=p())?void 0:l.length)?n:0;return(0,a.jsx)("div",{className:(0,c.cn)("absolute flex w-full justify-center","horizontal"===d?"-bottom-12 flex-row gap-1":"-right-12 flex-col gap-1",s),children:Array.from({length:m},(e,t)=>(0,a.jsx)("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:t===x?"white":"gray",border:"1px solid black"}},t))})});g.displayName="CarouselSummary"}},e=>{e.O(0,[3076,7396,636,6593,8792],()=>e(e.s=24213)),_N_E=e.O()}]);
2//# sourceMappingURL=mes-billets-963aea190361c106.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.