1import{d as J,y as Q,A as Y,k as z,m as H,c as a,e as l,g as I,w as W,F as d,r as f,u as r,h as S,t as p,f as v,j as M,_ as X,b as n,n as K,q as Z,p as ee,v as c}from"./bAKZjgHi.js";import{_ as te}from"./BsOmbeaX.js";import{f as se,g as le,a as ne}from"./CVULQbLn.js";import"./DH99RbVd.js";import"./CH91s2mw.js";const ae={class:"relative flex h-[100px] lg:h-[280px] items-center justify-center bg-purple-500"},re={class:"switch-tu absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2"},oe={class:"container-tu pb-20 pt-16"},ie={class:"relative mb-6 lg:px-12"},ue=["aria-pressed","onClick"],pe={class:"font-extrabold uppercase"},de={class:"font-normal"},ce={class:"mb-2"},be={class:"flex justify-end"},ge=["aria-expanded"],fe={class:"font-icons text-[28px] leading-none","aria-hidden":"true"},ve={key:0,id:"spielplan-filter",class:"relative mt-4"},ye={class:"flex flex-wrap gap-4"},me=["aria-expanded","aria-controls","onClick"],he={class:"font-icons text-2xl font-bold","aria-hidden":"true"},xe=["id"],we=["aria-pressed","onClick"],ke={key:0,class:"font-icons","aria-hidden":"true"},_e={key:0,class:"m-0 px-6 py-3 text-neutral-500"},Se={class:"flex flex-wrap items-center gap-4"},Ce=["aria-label","onClick"],Fe={key:1,class:"mb-0 mt-8 text-xl font-bold text-purple-500",role:"status","aria-live":"polite"},$e={class:"mb-8 mt-20 font-display text-5xl display-bold uppercase leading-none"},qe={key:2,class:"py-10 text-neutral-500"},Ne=J({__name:"index",async setup(Ve){let i,y;const m=Q(),C=Y(),h=M(!1),b=M(null),j=M();function w(s){const e=m.query[s];return e?(Array.isArray(e)?e:[e]).flatMap(o=>String(o).split(",")).filter(Boolean):[]}function E(s,e){C.replace({query:{...m.query,[s]:e.length?e.join(","):void 0}})}const x=c({get:()=>typeof m.query.month=="string"?m.query.month:"",set:s=>C.replace({query:{...m.query,month:s||void 0}})}),F=c(()=>new Set(w("sparte"))),k=c(()=>new Set(w("typ"))),$=c(()=>new Set(w("ort"))),q=c(()=>new Set(w("abo"))),{data:O}=([i,y]=z(()=>se()),i=await i,y(),i),{data:P}=([i,y]=z(()=>le("stuecke")),i=await i,y(),i),{data:V,pending:A}=([i,y]=z(()=>ne(()=>({month:x.value||void 0}))),i=await i,y(),i),R=s=>s.label.split(" ")[0].slice(0,3);function B(s){j.value?.scrollBy({left:s*3*116,behavior:"smooth"})}const T=c(()=>[{key:"sparte",label:"Sparten",auswahl:F.value,optionen:(P.value??[]).map(s=>s.name)},{key:"typ",label:"Vorstellungstyp",auswahl:k.value,optionen:["Premiere","Uraufführung"]},{key:"ort",label:"Spielstätten",auswahl:$.value,optionen:[...new Set((V.value??[]).map(s=>s.ort).filter(Boolean))]},{key:"abo",label:"Abonnement",auswahl:q.value,optionen:[...new Set((V.value??[]).flatMap(s=>s.abos?.map(e=>e.name)??[]))]}]),N=c(()=>T.value.flatMap(s=>[...s.auswahl].map(e=>({gruppe:s.key,wert:e,auswahl:s.auswahl}))));function D(s,e,o){const g=new Set(e);g.has(o)?g.delete(o):g.add(o),E(s,[...g])}function U(s){b.value=b.value===s?null:s}function G(){C.replace({query:{...m.query,sparte:void 0,typ:void 0,ort:void 0,abo:void 0}}),b.value=null}const _=c(()=>(V.value??[]).filter(s=>!(F.value.size&&!s.kategorie.some(e=>F.value.has(e))||k.value.size&&!(k.value.has("Premiere")&&s.premiere||k.value.has("Uraufführung")&&s.urauffuehrung)||$.value.size&&!$.value.has(s.ort)||q.value.size&&!s.abos?.some(e=>q.value.has(e.name))))),L=c(()=>{const s=new Map;for(const e of _.value){const o=e.beginn.slice(0,7);if(!s.has(o)){const g=new Date(e.beginn).toLocaleDateString("de-DE",{month:"long"})+(o.slice(0,4)!==String(new Date(_.value[0].beginn).getFullYear())?` ${o.slice(0,4)}`:"");s.set(o,{key:o,label:g,rows:[]})}s.get(o).rows.push(e)}return[...s.values()]});return H({title:"Spielplan",description:"Spielplan des Theater Ulm: alle Termine, Premieren und Vorstellungen aus Schauspiel, Musiktheater, Tanz und Jungem Theater."}),(s,e)=>{const o=X,g=te;return n(),a("div",null,[l("div",ae,[e[6]||(e[6]=l("h1",{class:"m-0 font-display text-[clamp(2.5rem,4.5vw,4rem)] display-bold uppercase leading-none"},"Spielplan",-1)),l("div",re,[e[5]||(e[5]=l("span",{class:"switch-item switch-item-active","aria-current":"page"},"Termine",-1)),I(o,{class:"switch-item",to:"/spielplan/stuecke"},{default:W(()=>[...e[4]||(e[4]=[S("Stücke",-1)])]),_:1})])]),l("div",oe,[l("div",ie,[l("button",{type:"button",class:"absolute left-0 top-1/2 hidden -translate-y-1/2 cursor-pointer border-0 bg-transparent font-icons text-[27px] lg:block","aria-label":"Frühere Monate",onClick:e[0]||(e[0]=t=>B(-1))},"â"),l("div",{ref_key:"timeline",ref:j,class:"flex overflow-x-auto [scrollbar-width:none]"},[(n(!0),a(d,null,f(r(O)??[],t=>(n(),a("button",{key:t.value,type:"button",class:K(["-mr-[2px] flex h-[112px] w-[118px] shrink-0 cursor-pointer flex-col items-center justify-center gap-3 border-2 border-black font-display text-2xl leading-[1.2]",r(x)===t.value?"bg-purple-500":"bg-white"]),"aria-pressed":r(x)===t.value,onClick:u=>x.value=r(x)===t.value?"":t.value},[l("span",pe,p(R(t)),1),l("span",de,p(t.value.slice(0,4)),1)],10,ue))),128))],512),l("button",{type:"button",class:"absolute right-0 top-1/2 hidden -translate-y-1/2 cursor-pointer border-0 bg-transparent font-icons text-[27px] lg:block","aria-label":"Spätere Monate",onClick:e[1]||(e[1]=t=>B(1))},"â")]),l("div",ce,[l("div",be,[l("button",{type:"button",class:"flex cursor-pointer items-center gap-2 border-0 bg-transparent font-display text-2xl display-bold text-purple-500","aria-expanded":r(h),"aria-controls":"spielplan-filter",onClick:e[2]||(e[2]=t=>h.value=!r(h))},[S(p(r(h)?"Filter schlieÃen":"Filter öffnen")+" ",1),l("span",fe,p(r(h)?"â":"+"),1)],8,ge)]),r(h)?(n(),a("div",ve,[l("div",ye,[(n(!0),a(d,null,f(r(T),t=>(n(),a("div",{key:t.key,class:"relative"},[l("button",{type:"button",class:"flex h-[72px] w-[308px] max-w-full cursor-pointer items-center justify-between border-2 border-black bg-white px-6 font-display text-2xl display-bold leading-[1.4]","aria-expanded":r(b)===t.key,"aria-controls":`filter-options-${t.key}`,onClick:u=>U(t.key)},[l("span",null,p(t.label),1),l("span",he,p(r(b)===t.key?"Ë":"Ë
"),1)],8,me),r(b)===t.key?(n(),a("div",{key:0,id:`filter-options-${t.key}`,class:"absolute left-0 top-full z-20 max-h-80 w-[308px] overflow-y-auto border-2 border-t-0 border-black bg-white shadow-lg"},[(n(!0),a(d,null,f(t.optionen,u=>(n(),a("button",{key:u,type:"button",class:K(["flex w-full cursor-pointer items-center justify-between gap-3 border-0 bg-white px-6 py-3 text-left font-display text-xl display-bold hover:bg-purple-100",{"bg-purple-200 shadow-[inset_0_0_0_2px_var(--color-purple-500)]":t.auswahl.has(u)}]),"aria-pressed":t.auswahl.has(u),onClick:ze=>D(t.key,t.auswahl,u)},[S(p(u)+" ",1),t.auswahl.has(u)?(n(),a("span",ke,"â")):v("",!0)],10,we))),128)),t.optionen.length?v("",!0):(n(),a("p",_e,"Keine Optionen"))],8,xe)):v("",!0)]))),128))]),r(N).length?(n(),a(d,{key:0},[e[8]||(e[8]=l("p",{class:"mb-3 mt-8 text-xl font-bold"},"Filter ausgewählt:",-1)),l("div",Se,[(n(!0),a(d,null,f(r(N),t=>(n(),a("button",{key:t.gruppe+t.wert,type:"button","aria-label":`Filter ${t.wert} entfernen`,class:"tag cursor-pointer gap-2 border-0",onClick:u=>D(t.gruppe,t.auswahl,t.wert)},[S(p(t.wert)+" ",1),e[7]||(e[7]=l("span",{class:"font-icons","aria-hidden":"true"}
1,"â",-1))],8,Ce))),128)),l("button",{type:"button",class:"tag tag-outline cursor-pointer border-0 bg-transparent",onClick:G}," Alle Filter löschen ")])],64)):v("",!0),r(A)?v("",!0):(n(),a("p",Fe,p(r(_).length)+" Ergebnis"+p(r(_).length===1?"":"se")+": ",1))])):v("",!0)]),r(A)?(n(),a(d,{key:0},[e[10]||(e[10]=l("p",{class:"sr-only",role:"status"},"Spielplan wird geladen",-1)),(n(),a(d,null,f(3,t=>l("article",{key:t,class:"grid animate-pulse grid-cols-[120px_1fr] gap-6 border-t-2 border-black pb-[22px] pt-3.5 last-of-type:border-b-2 lg:grid-cols-[190px_1fr_270px]"},[...e[9]||(e[9]=[Z('<div class="flex flex-col items-start gap-2 pt-2"><div class="h-6 w-16 bg-grey"></div><div class="h-[clamp(4rem,7.8vw,7rem)] w-20 bg-grey"></div><div class="mt-2 h-16 w-28 bg-grey"></div></div><div class="pt-3.5"><div class="mb-7 h-8 w-24 bg-grey"></div><div class="mb-6 h-10 w-3/4 bg-grey"></div><div class="h-6 w-1/2 bg-grey"></div></div><div class="col-span-full pt-3.5 lg:col-span-1"><div class="ml-auto h-[54px] w-32 bg-grey"></div></div>',3)])])),64))],64)):r(L).length?(n(!0),a(d,{key:1},f(r(L),t=>(n(),a("section",{key:t.key},[l("h2",$e,p(t.label),1),(n(!0),a(d,null,f(t.rows,u=>(n(),ee(g,{key:u.id,vorstellung:u},null,8,["vorstellung"]))),128))]))),128)):(n(),a("p",qe,"Keine Vorstellungen für diese Auswahl gefunden."))]),r(b)?(n(),a("div",{key:0,class:"fixed inset-0 z-10",onClick:e[3]||(e[3]=t=>b.value=null)})):v("",!0)])}}});export{Ne 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.