1import{V as u,a9 as y,aa as b,ab as w,j as e}from"./@wbk/hooks-FtCTMeyH.js";import{e as x,L as v,r as N}from"./vendor-Cc9w-i99.js";import{u as $}from"./@wbk/analytics-B-_ZPhJq.js";import{bf as _,bV as P}from"./@wbk/queue-8-09eRJS.js";import{t as k,w as E,B as S,l as M}from"./@wbk/ui-DZdD23Ta.js";import{ba as g,C as h,a$ as F}from"./@wbk/contentful-C-wfS48z.js";import{F as T,E as A,S as C}from"./index-DZ2Htu0z.js";import{C as G}from"./@wbk/currency-BxlCDaIM.js";import{u as f}from"./react-i18next-Dxy0wzdl.js";import"./@wbk/api-DFKMxA3e.js";import"./@wbk/config-DuwrGB8a.js";import"./@wbk/logger-DfNVpG3P.js";import"./@wbk/svg-Bua7FxzL.js";import"./react-hook-form-D_m77UuM.js";import"./@wbk/auth-Djoddyo0.js";import"./@wbk/ticketing-Og7zkUfp.js";import"./@wbk/payment-cL5x8D1N.js";import"./@wbk/flights-Cjxxns74.js";import"./@wbk/hotels-CFdSoV_6.js";import"./@smc/ads-C1pDiBF5.js";import"./i18next-http-backend-C2uFdLra.js";import"./i18next-Ce0fiPMx.js";import"./i18next-browser-languagedetector-Bv2FoO1s.js";import"./react-helmet-BcOPeyN0.js";import"./@wbk/auction-CsNezADS.js";const B=({startDateTime:t,endDateTime:o,className:s="",showTime:l=!0})=>{var d;const{lang:n}=x(),c=((d=n==null?void 0:n.split("-"))==null?void 0:d[0])||"en",r=u(t*1e3,`${c}-GB`,{month:"short",day:"numeric",year:void 0}),a=u(o*1e3,`${c}-GB`,{month:"short",day:"numeric",year:void 0}),i=y(t,o),m=b(t,o),p=w(t,o);return e.jsx("div",{className:k("flex items-center gap-1.5 text-sm uppercase",s),children:e.jsx("p",{"data-testid":"event-date",children:p?`${r.day} ${r.month} ${r.year} ${l?` - ${r.time}`:""}`:i&&m?`${r.day} - ${a.day} ${r.month} ${r.year} ${l?` | ${r.time}`:""}`:i?`${r.day} ${r.month} - ${a.day} ${a.month} ${a.year}`:`${r.day} ${r.month} ${r.year} - ${a.day} ${a.month} ${a.year}`})})},L=({event:t})=>{var r,a;const{lang:o}=x(),{t:s}=f(["event"]),l=t.events.upcoming,n=((r=l[0])==null?void 0:r.price)||0,c=l.reduce((i,m)=>Math.min(i,m.price),n);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-4 pb-6",children:[e.jsx("div",{className:"pb-2 xl:hidden",children:t.gallery_images.length>0?e.jsx(g,{poster:{url:t.poster},carousel:(a=t.gallery_images)==null?void 0:a.map(i=>({url:i}))}):e.jsxs("figure",{children:[e.jsx(h,{className:"aspect-1 mx-auto w-full max-w-2xl overflow-hidden rounded-lg object-cover sm:hidden",media:{title:t.title,url:t.poster,height:600,width:600,contentType:"image",sys:{id:"",publishedAt:""}},placeholder:!0}),e.jsx(h,{className:"mx-auto hidden aspect-[3/1] w-full max-w-2xl overflow-hidden rounded-lg object-cover sm:block",media:{title:t.title,url:t.poster,height:400,width:600,contentType:"image",sys:{id:"",publishedAt:""}},placeholder:!0})]})}),e.jsx("div",{className:"flex flex-col-reverse justify-between",children:e.jsx("div",{className:"flex flex-col-reverse items-center gap-6 md:flex-row",children:e.jsx("h1",{className:"text-2xl sm:text-4xl",children:t.title})})}),e.jsx(_,{}),e.jsxs("div",{className:"flex items-center justify-between gap-4 md:justify-start",children:[c>0&&e.jsxs("div",{className:"bg-body-dark/5 rounded-md p-4 ltr:pr-14 rtl:pl-14",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:s("event:starts_from")}),e.jsx(G,{originalPrice:c,currency:"SAR",priceClassName:"font-semibold text-lg"})]}),e.jsx("p",{className:"text-text-tertiary text-[11px]",children:s("event:vat_included")})]}),e.jsx(E,{data:{title:t==null?void 0:t.title,text:t==null?void 0:t.title},poster:t.poster})]}),l.length>0&&e.jsxs("div",{className:"space-y-4 border-t border-white/20 py-6",children:[e.jsx("h2",{className:"text-xl",children:s("event:select_your_ticket")}),e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:l.map(i=>e.jsxs(S,{as:v,to:`/${o}/events/${i.slug}/book`,className:"flex w-full cursor-pointer items-start justify-between gap-2 rounded-md bg-white/5 px-3 py-4 hover:bg-white/10 active:bg-white/5",children:[e.jsxs("div",{className:"space-y-2 text-start",children:[e.jsx("p",{className:"text-sm font-semibold",children:i.title}
1),e.jsx(B,{startDateTime:i.start_date,endDateTime:i.end_date,className:"text-text-tertiary text-[11px]",showTime:!1})]}),e.jsx("img",{src:"/icons/common/arrow.svg",width:20,height:20,className:"rtl:rotate-180",alt:s("common:back")})]},i._id))})]})]})})},R=({event:t})=>{const{t:o}=f(["common","event"]),l=(n=>{const c=/\d+__/;return n.replace(c,"")})(t.description_rt);return e.jsxs("div",{className:"space-y-2 border-t border-white/20 py-6","data-testid":"event-description",children:[e.jsx("h2",{className:"text-xl",children:o("event:about")}),e.jsx(F,{text:l,className:"[&div]:prose [&>p]:m-0 [&>ul>li]:m-0 [&>ul]:m-0",btnProps:{"aria-label":`Read More About ${t.title}`}})]})},me=()=>{var c,r;const{slug:t,lang:o}=x(),{data:s,isLoading:l}=P({slug:t,lang:o}),{viewItemEvent:n}=$();return N.useEffect(()=>{var a;if(s){const i=s.events.upcoming,m=((a=i[0])==null?void 0:a.price)||0,p=i.reduce((d,j)=>Math.min(d,j.price),m);n({event:{_id:s._id,slug:t||"",title:s.title,startingPrice:p}})}},[s]),l?e.jsx(T,{}):s?e.jsxs(e.Fragment,{children:[e.jsx(C,{}),e.jsxs("div",{className:"container flex flex-col items-start gap-6 space-y-6 py-4 pb-20 xl:flex-row xl:space-y-0",children:[e.jsxs("section",{className:"w-full grow overflow-hidden",children:[e.jsx(L,{event:s}),e.jsx(R,{event:s})]}),e.jsx("aside",{className:"sticky top-24 mx-auto w-full max-w-xl shrink-0 grow gap-8 xl:max-w-lg",children:((c=s.gallery_images)==null?void 0:c.length)>0?e.jsx(g,{poster:{url:s.poster},carousel:(r=s.gallery_images)==null?void 0:r.map(a=>({url:a}))}):e.jsx("figure",{className:"rounded-lg",children:e.jsx(M,{className:"aspect-1 overflow-hidden rounded-lg object-cover",src:s.poster,width:600,height:600,alt:s.title})})})]})]}):e.jsx(A,{})};export{me 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.