1import S from"./C-K-oo1Q.js";import{f as V,j as H,b as z,s as O}from"./DHXfx9Tn.js";import{_ as q,a as F,M as W,b as J,c as K,d as B,e as Q,f as X}from"./CtbuXHS2.js";import{u as Y,b as Z}from"./B4UvzY1k.js";import{u as ee}from"./BswuA-TX.js";import{bd as G,b6 as i,b7 as u,b8 as v,be as D,bf as I,bg as t,b9 as L,bh as m,ba as b,bi as te,bj as C,bk as g,bl as ae,bm as le,bn as ie,bo as se,bp as oe,bq as ne,b5 as U,bb as y,bc as re,br as d,bs as ue,bt as ce}from"./fkuu-W5h.js";import{_ as M}from"./DgWeR8Ll.js";import{u as de}from"./3h4KjhmU.js";import"./C8tdCacw.js";import"./B5JyLIAz.js";import"./BzxX8ifo.js";import"./Boum7PQV.js";import"./DS2DVREE.js";import"./oiFKoxUv.js";import"./CEjRYkCO.js";import"./DhWLh6xd.js";import"./D8JXwWvr.js";import"./RZVKh3za.js";import"./oJ9ed6P5.js";import"./DQDhvwn8.js";import"./BBmBCefi.js";import"./-VedwdA4.js";import"./CTQHR4Z4.js";import"./ukfdQzAc.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new s.Error().stack;
1n&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[n]="784dae8a-bc38-40f5-9c2b-ce43ebd28d04",s._sentryDebugIdIdentifier="sentry-dbid-784dae8a-bc38-40f5-9c2b-ce43ebd28d04")}catch{}})();const me={class:"flex flex-col gap-6"},ge={class:"columns-2 gap-2 md:columns-3 lg:gap-3"},pe=["aria-label","onClick"],he=["src","width","height","loading"],fe={key:0,class:"flex flex-col items-center gap-2"},be={class:"text-sm text-ink-muted"},A=40,ve=G({__name:"MediaGalleryGrid",props:{images:{},title:{},allowDownload:{type:Boolean}},setup(s){const n=s,{t:p}=Y(),{assetUrl:o}=ee(),w=C(A),$=g(()=>n.images.slice(0,w.value)),k=g(()=>w.value<n.images.length),h=C(!1),c=C(0);function e(P){c.value=P,h.value=!0}return(P,_)=>(i(),u("div",me,[v("div",ge,[(i(!0),u(D,null,I(t($),(r,x)=>(i(),u("button",{key:r.file_id,type:"button",class:"group mb-2 block w-full overflow-hidden rounded-lg bg-surface-hover lg:mb-3","aria-label":t(p)("mediaPages.galleries.openImage",{index:x+1,total:s.images.length}),onClick:j=>e(x)},[v("img",{src:t(o)(r.file_id,{width:640,quality:75,format:"webp"})??void 0,alt:"",width:r.width??void 0,height:r.height??void 0,loading:x<8?"eager":"lazy",class:"h-auto w-full transition-transform duration-300 group-hover:scale-[1.03]"},null,8,he)],8,pe))),128))]),t(k)?(i(),u("div",fe,[v("p",be,L(t(p)("mediaPages.galleries.showing",{shown:t($).length,total:s.images.length})),1),v("button",{type:"button",class:"flex h-12 items-center rounded-slab border border-primary-transitionBlue px-5 text-sm font-bold text-primary-transitionBlue transition-colors hover:bg-surface-tint",onClick:_[0]||(_[0]=r=>w.value+=A)},L(t(p)("mediaPages.galleries.loadMore")),1)])):m("",!0),b(q,{open:t(h),"onUpdate:open":_[1]||(_[1]=r=>te(h)?h.value=r:null),images:s.images,"start-index":t(c),"allow-download":s.allowDownload,title:s.title},null,8,["open","images","start-index","allow-download","title"])]))}}),_e={key:0,class:"bg-surface-page"},ye=["href"],we={class:"flex flex-col gap-1"},xe={class:"flex flex-col gap-1"},$e={class:"flex flex-col gap-1"},Je=G({__name:"[slug]",async setup(s){let n,p;const{t:o,locale:w}=ae(),$=le(),k=ce(),{htmlToPlainText:h}=de(),c=g(()=>String($.params.slug??"")),{data:e,error:P}=([n,p]=ie(()=>se(`gallery-${c.value}`,()=>$fetch(`/api/media/galleries/${c.value}`))),n=await n,p(),n);if(P.value||!e.value)throw oe({statusCode:404,fatal:!0});const _=g(()=>!!h(e.value?.introduction).trim()),r=g(()=>ue(e.value?.published_at,w.value)),x=g(()=>{const a=[];return e.value?.author_name&&a.push(o("mediaPages.byline.by",{name:e.value.author_name})),r.value&&a.push(r.value),a.push(o("mediaPages.galleries.photoCount",{count:e.value?.images.length??0})),a}),j=g(()=>{const a=e.value;return!!(a&&(a.event||a.athletes.length||a.articles.length||a.videos.length||a.galleries.length))}),f=ne().url?.replace(/\/$/,"")??"",N=f||"https://triathlon.org",E=g(()=>{const a=e.value;if(!a)return"";const T=O(h(a.introduction));return T.length>=40?T:o("mediaPages.galleries.seoItemFallback",{title:a.title,count:a.images.length})});return U({title:()=>e.value?Z(o("mediaPages.galleries.seoItemTitle",{title:e.value.title})):void 0,meta:[{name:"description",content:()=>E.value},{property:"og:image",content:()=>e.value?.cover_image?`${k.public.directusCmsUri}/assets/${e.value.cover_image}?width=1200&height=630&fit=cover&format=jpg`:void 0},{property:"og:image:alt",content:()=>e.value?.title}]}),U({link:[{rel:"canonical",href:`${f}/galleries/${c.value}`}],script:()=>e.value?[{type:"application/ld+json",innerHTML:H({"@context":"https://schema.org","@type":"ImageGallery",name:e.value.title,description:E.value,datePublished:e.value.published_at,...e.value.updated_at?{dateModified:e.value.updated_at}:{},...e.value.cover_image?{image:`${k.public.directusCmsUri}/assets/${e.value.cover_image}`}:{},publisher:{"@type":"Organization",name:"World Triathlon",url:f||"https://triathlon.org"},mainEntityOfPage:`${f}/galleries/${c.value}`})},{type:"application/ld+json",innerHTML:H(z([{name:"World Triathlon",url:`${f}/`},{name:o("mediaPages.galleries.title"),url:`${f}/galleries`},{name:e.value.title,url:`${f}/galleries/${c.value}`}]))}]:[]}),(a,T)=>{const R=S;return t(e)?(i(),u("div",_e,[b(F,{title:t(e).title,"cover-image":t(e).cover_image,meta:t(x)},{default:y(()=>[t(e).gallery_link?(i(),u("a",{key:0,href:t(e).gallery_link,target:"_blank",rel:"noopener noreferrer",class:"mt-5 inline-flex h-11 w-fit items-center gap-2 rounded-chip bg-white px-5 text-sm font-bold text-ink transition-colors hover:bg-surface-page"},[b(R,{name:"lucide:external-link",class:"size-4","aria-hidden":"true"}),re(" "+L(t(o)("mediaPages.galleries.mediaGallery")),1)],8,ye)):m("",!0)]),_:1},8,["title","cover-image","meta"]),b(Q,{"max-width-class":"max-w-[1600px]","has-rail":t(j)},{rail:y(()=>[t(e).event?(i(),d(J,{key:0,event:t(e).event,page:"gallery","link-base":t(N),"hide-results-link":""},null,8,["event","link-base"])):m("",!0),b(K,{athletes:t(e).athletes,"event-id":t(e).event?.id},null,8,["athletes","event-id"]),t(e).articles.length?(i(),d(B,{key:1,title:t(o)("mediaPages.related.articles")},{default:y(()=>[v("div",we,[(i(!0),u(D,null,I(t(e).articles.slice(0,4),l=>(i(),d(M,{key:l.id,to:`/news/${l.slug}`,title:l.title,"cover-image":l.cover_image,"published-at":l.published_at},null,8,["to","title","cover-image","published-at"]))),128))])]),_:1},8,["title"])):m("",!0),t(e).videos.length?(i(),d(B,{key:2,title:t(o)("mediaPages.related.videos")},{default:y(()=>[v("div",xe,[(i(!0),u(D,null,I(t(e).videos.slice(0,4),l=>(i(),d(M,{key:l.id,to:`/videos/${l.slug}`,title:l.title,"cover-image":l.cover_image,"published-at":l.published_at,meta:("formatDuration"in a?a.formatDuration:t(V))(l.duration)},null,8,["to","title","cover-image","published-at","meta"]))),128))])]),_:1},8,["title"])):m("",!0),t(e).galleries.length?(i(),d(B,{key:3,title:t(o)("mediaPages.related.galleries")},{default:y(()=>[v("div",$e,[(i(!0),u(D,null,I(t(e).galleries.slice(0,4),l=>(i(),d(M,{key:l.id,to:`/galleries/${l.slug}`,title:l.title,"cover-image":l.cover_image,"published-at":l.published_at},null,8,["to","title","cover-image","published-at"]))),128))])]),_:1},8,["title"])):m("",!0)]),default:y(()=>[t(_)?(i(),d(W,{key:0,html:t(e).introduction,class:"mb-6 max-w-[720px] !text-base"},null,8,["html"])):m("",!0),b(ve,{images:t(e).images,title:t(e).title,"allow-download":t(e).is_highres},null,8,["images","title","allow-download"])]),_:1},8,["has-rail"]),b(X)])):m("",!0)}}});
1export{Je 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.