1import{_ as Ee}from"./pMGUb7q5.js";import{_ as De}from"./DK6lQ68Z.js";import{u as Le,_ as Re,a as qe}from"./B4eHZv2K.js";import{_ as Ae}from"./Cw9jy5Ul.js";import{d as ne,o as r,x as N,w as M,b as o,Z as Pe,h as k,g as t,c,t as d,i as se,F as g,r as E,a4 as Q,y as O,n as U,a5 as Fe,a3 as Be,Y as Ne,j as s,D as Me,q as Oe,l as Ve,m as X,a6 as ee,k as ze,a0 as je,a7 as He,I as te,e as A,p as We,a8 as Ge}from"./DjUjRTxR.js";import{_ as Ke}from"./BurRv7bd.js";import{$ as V}from"./WweIJJst.js";import{u as Qe}from"./BVGpt9TG.js";import{u as Ue}from"./Ccx08mft.js";import{buildCalendarEntries as Ye}from"./pH4xID6Y.js";import{u as Ze}from"./DWWdV8x_.js";import{u as Je}from"./Cyp3h_wz.js";import{u as Xe}from"./D3XKq3mv.js";import{$ as ae}from"./B0Yev4sz.js";import"./DhdqehsD.js";import"./BQHSZ1rp.js";import"./B51w9WgX.js";import"./B-G3Xx3n.js";import"./D1fKpC9K.js";import"./Cchh0342.js";const et={class:"relative w-32 shrink-0 overflow-hidden lg:w-72.5"},tt={class:"absolute top-0"},at={class:"relative z-1 flex flex-1 flex-col justify-between p-sm lg:p-md"},nt={key:0,class:"sr-only"},st={key:1,class:"overflow-hidden pt-[0.2em] text-title-sm font-bold uppercase lg:text-title-lg"},ot={class:"card-title-motion"},rt={class:"card-title-1"},lt={class:"motion-text__text"},it={class:"motion-text__text motion-text__text--clone","aria-hidden":"true"},ct={class:"motion-text__text"},ut={class:"motion-text__text motion-text__text--clone","aria-hidden":"true"},dt={class:"card-title-3"},mt={class:"motion-text__text"},pt={class:"motion-text__text motion-text__text--clone","aria-hidden":"true"},_t={key:2,class:"flex list-none flex-wrap gap-xs p-0"},vt=ne({__name:"CardEventList",props:{title:{},date:{},dateEnd:{},tags:{},to:{},timeLabel:{},image:{},theme:{}},setup(p){const l=p,f=s(()=>!l.to),T=s(()=>isNaN(new Date(l.date).getTime())?null:{day:V.day(l.date),month:V.month(l.date),time:V.time(l.date,l.dateEnd)}),{line2:I,line3:S,line1Words:z,line2Words:D,line3Words:j,line2Class:H,line2Offset:P,line3Offset:W}=Qe(()=>l.title),G=Ne;return(h,u)=>{const L=Pe,F=Ke;return r(),N(Be(t(f)?"div":t(G)),Fe(t(f)?{}:{to:p.to},{class:"card-event-list flex h-32 bg-theme-surface-neutral-primary lg:h-50","data-card":t(f)?void 0:"event-list","data-theme":p.theme??"default","aria-label":p.title??void 0,role:t(f)?"article":void 0}),{default:M(()=>[o("div",et,[p.image?(r(),N(L,{key:0,image:p.image,w:290,h:200,"use-srcset":"",sizes:"(min-width: 1024px) 290px, 128px",class:"h-full w-full object-cover","data-card-image":""},null,8,["image"])):k("",!0),o("div",tt,[t(T)?(r(),N(F,{key:0,day:t(T).day,month:t(T).month,time:p.timeLabel??t(T).time,disabled:t(f)},null,8,["day","month","time","disabled"])):k("",!0)])]),o("div",at,[t(f)?(r(),c("span",nt,d(("$t"in h?h.$t:t(se)).UDSOLGT),1)):k("",!0),p.title?(r(),c("h3",st,[o("span",ot,[o("span",rt,[(r(!0),c(g,null,E(t(z),(m,_)=>(r(),c(g,{key:"l1-"+_},[o("span",{class:"motion-text__word",style:Q({"--word-index":_})},[o("span",lt,d(m),1),o("span",it,d(m),1)],4),u[0]||(u[0]=O(d(" "),-1))],64))),128))]),t(I)?(r(),c(g,{key:0},[u[2]||(u[2]=o("br",null,null,-1)),o("span",{class:U(t(H))},[(r(!0),c(g,null,E(t(D),(m,_)=>(r(),c(g,{key:"l2-"+_},[o("span",{class:"motion-text__word",style:Q({"--word-index":t(P)+_})},[o("span",ct,d(m),1),o("span",ut,d(m),1)],4),u[1]||(u[1]=O(d(" "),-1))],64))),128))],2)],64)):k("",!0),t(S)?.length?(r(),c(g,{key:1},[u[4]||(u[4]=o("br",null,null,-1)),o("span",dt,[(r(!0),c(g,null,E(t(j),(m,_)=>(r(),c(g,{key:"l3-"+_},[o("span",{class:"motion-text__word",style:Q({"--word-index":t(W)+_})},[o("span",mt,d(m),1),o("span",pt,d(m),1)],4),u[3]||(u[3]=O(d(" "),-1))],64))),128))])],64)):k("",!0)])])):k("",!0),p.tags?.length?(r(),c("ul",_t,[(r(!0),c(g,null,E(p.tags,(m,_)=>(r(),c("li",{key:m.name??_,class:U(["card-event-list-tag inline-block p-xs text-eyebrow font-light",m.isHighlighted?"card-event-list-tag--highlighted":"bg-theme-surface-neutral-secondary"])},d(m.name),3))),128))])):k("",!0)])]),_:1},16,["data-card","data-theme","aria-label","role"])}}}),yt=Object.assign(Me(vt,[["__scopeId","data-v-2ec7a80b"]]),{__name:"CardEventList"}),ft={æ:"ae",ø:"oe",Ã¥:"aa"};function y(p){return p.toLowerCase().trim().replace(/[æøå]/g,l=>ft[l]??l).normalize("NFD").replace(/[Ì-ͯ]/g,"").replace(/\s+/g,"-")}const ht={class:"frame frame--noTop"},gt={class:"relative ml-auto flex items-center gap-xs py-sm lg:pt-md"},xt={key:1,class:"gutter pb-sm"},bt={class:"pb-md text-title-sm"},kt={class:"flex flex-wrap gap-xs"},wt=["aria-pressed","onClick"],Ct={"data-tab-description":""},$t={class:"border-t border-theme-contour pt-lg pb-md text-title-lg text-theme-ink uppercase"},Tt={class:"flex flex-col gap-xs"},Kt=ne({__name:"index",async setup(p){let l,f;const T=Oe(),{data:I}=Ve()?([l,f]=X(()=>We(T.EventsQuery)),l=await l,f(),l):([l,f]=X(async()=>ee("events",async()=>{const[e,a]=await Promise.all([$fetch("/api/events").catch(n=>(console.error("[events] Failed to fetch Sanity events:",n),[])),$fetch("/api/understory/events").catch(n=>(console.error("[events] Failed to fetch Understory events:",n),{items:[]}))]);return{events:e,understoryItems:a.items}})),l=await l,f(),l),S=s(()=>I.value&&!Array.isArray(I.value)?I.value:null),z=s(()=>{const e=new Map;for(const a of S.value?.understoryItems??[]){const n=e.get(a.experience_id)??[];n.push(a),e.set(a.experience_id,n)}return e}),D=s(()=>[...new Set((S.value?.understoryItems??[]).map(e=>e.experience_id))]),{data:j,status:H}=ee("events-availability",()=>D.value.length?$fetch("/api/understory/availability",{query:{experienceId:D.value}}):Promise.resolve({items:[]}),{watch:[D]}),P=s(()=>H.value==="success"),W=s(()=>P.value?new Map((j.value?.items??[]).map(e=>[e.event_id,e.available])):new Map),G=Ze(),h=s(()=>G?.data?.value?.event_calendar);Je({title:h.value?.title,seo:h.value?.seo}),ze("invert"),Xe();const u=je(),L=He(),F=s(()=>h.value?.title||""),m=s(()=>h.value?.image??null),_=s(()=>h.value?.video?.source?.muxPlaybackId??null),oe=s(()=>h.value?.heroTheme??"primary"),re=s(()=>h.value?.description),Y=s(()=>h.value?.informationsbar??null),{primaryLabel:le,primaryTo:ie,primaryTarget:ce,primaryRel:ue,secondaryLabel:de,secondaryTo:me,secondaryTarget:pe,secondaryRel:_e,hasBarContent:ve,onPrimaryClick:ye,onSecondaryClick:fe}=Ue(Y,"giftcard",""),R=s(()=>{const e=I.value;return e?S.value?S.value.events??[]:e:[]}),K=s(()=>{const e=new Set,a=[];for(const n of R.value)n.category&&!e.has(n.category._id)&&(e.add(n.category._id),a.push(n.category));return a.sort((n,i)=>{const x=n.order??1/0,w=i.order??1/0;return x-w})}),he=s(()=>[{title:"Vis Alle",path:ae.events.path},...K.value.map(e=>({title:e.title??"",path:`${ae.events.path}?category=${encodeURIComponent(y(e.title??""))}`}))]),$=s(()=>u.query.category),ge=s(()=>
1{if(!$.value)return 0;const e=K.value.findIndex(a=>y(a.title??"")===$.value);return e===-1?0:e+1}),Z=()=>{Ge(()=>{const e=document.querySelector("[data-tabs]");if(!e)return;const a=parseFloat(window.getComputedStyle(e).top)||0;if(e.getBoundingClientRect().top>a)return;const n=document.querySelector("[data-tab-description]");if(!n)return;const i=n.getBoundingClientRect().top+window.scrollY;window.scrollTo({top:Math.max(0,i-e.offsetHeight-a),behavior:"smooth"})})};te($,Z);const xe=e=>{if(typeof e!="number")return;const a={...u.query};if(e===0)delete a.category;else{const n=K.value[e-1];n?.title&&(a.category=y(n.title))}if(a.tag){const n=a.category,i=new Set(R.value.filter(v=>!n||y(v.category?.title??"")===n).flatMap(v=>v.tags??[]).filter(v=>v.name).map(v=>y(v.name))),w=(Array.isArray(a.tag)?a.tag:[a.tag]).filter(v=>!!v&&i.has(v));w.length?a.tag=w:delete a.tag}L.replace({query:a})},be=s(()=>$.value?R.value.filter(e=>y(e.category?.title??"")===$.value):R.value),J=s(()=>{const e=new Set,a=[];for(const n of be.value)for(const i of n.tags??[])if(i.name){const x=y(i.name);e.has(x)||(e.add(x),a.push({...i,name:i.name.trim()}))}return a}),ke=s(()=>J.value.length>0),q=s(()=>{const e=u.query.tag;return e?(Array.isArray(e)?e:[e]).filter(a=>!!a):[]}),we=e=>{const a=y(e),n={...u.query},i=q.value,x=i.includes(a)?i.filter(w=>w!==a):[...i,a];x.length?n.tag=x:delete n.tag,L.replace({query:n})},Ce=s(()=>{let e=R.value;return $.value&&(e=e.filter(a=>y(a.category?.title??"")===$.value)),q.value.length&&(e=e.filter(a=>!!a.tags?.some(n=>n.name&&q.value.includes(y(n.name))))),e}),B=Le(),$e=s(()=>!!B.value.date);te(()=>B.value.date,Z);const Te=e=>{const a={...u.query};e?a.date=e:delete a.date,L.replace({query:a})},Ie=s(()=>{const e=Ye(Ce.value,z.value,W.value,P.value);if(!$e.value)return e;const a=B.value.date;return e.filter(n=>{const i=V.sortKey(n.date).slice(0,10);return!!i&&i>=a})});return(e,a)=>{const n=Ee,i=De,x=qe,w=Ae,v=yt,Se=Re;return r(),c("div",ht,[A(n,{class:"break-out--frame",title:t(F),image:t(m),"video-playback-id":t(_),"hero-theme":t(oe)},null,8,["title","image","video-playback-id","hero-theme"]),t(ve)?(r(),N(i,{key:0,overlap:"",title:t(Y)?.title||t(F)||void 0,to:t(ie),target:t(ce),rel:t(ue),"secondary-label":t(de),"secondary-to":t(me),"secondary-target":t(pe),"secondary-rel":t(_e),onClick:t(ye),onSecondaryClick:t(fe)},{default:M(()=>[O(d(t(le)),1)]),_:1},8,["title","to","target","rel","secondary-label","secondary-to","secondary-target","secondary-rel","onClick","onSecondaryClick"])):k("",!0),A(w,{links:t(he),"active-index":t(ge),"portable-text":t(re)??void 0,"text-alignment":"left",onSelect:xe},{controls:M(()=>[o("div",gt,[A(x,{value:t(B).date,onChange:Te},null,8,["value"])])]),_:1},8,["links","active-index","portable-text"]),t(ke)?(r(),c("div",xt,[o("h3",bt,d(("$t"in e?e.$t:t(se)).VAELG_KATEGORIER),1),o("div",kt,[(r(!0),c(g,null,E(t(J),C=>(r(),c("button",{key:C._id,type:"button",class:U(["flex h-9 cursor-pointer items-center px-sm text-label uppercase transition-colors",t(q).includes(t(y)(C.name??""))?"bg-theme-ink text-theme-ink-invert":"bg-theme-surface-neutral-primary text-theme-ink hover:bg-theme-ink hover:text-theme-ink-invert"]),"aria-pressed":t(q).includes(t(y)(C.name??"")),onClick:b=>we(C.name??"")},d(C.name),11,wt))),128))])])):k("",!0),o("div",Ct,[A(Se,{rows:t(Ie),"hide-year":""},{month:M(({group:C})=>[o("h2",$t,d(C.label),1),o("ul",Tt,[(r(!0),c(g,null,E(C.rows,b=>(r(),c("li",{key:b.event_id},[A(v,{title:b.title??null,date:b.date,"date-end":b.date_end,tags:b.tags,image:b.image??null,to:b.to,"time-label":b.timeLabel,theme:b.theme},null,8,["title","date","date-end","tags","image","to","time-label","theme"])]))),128))])]),_:1},8,["rows"])])])}}});export{Kt 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.