PageSourceSearch

https://messtechnik-events.com/assets/_slug-gcRgX9hh.js

js messtechnik-events.com collected 2026-10-09 22:03:54 UTC 13,941 bytes, 1 lines download raw bytes

1import{Q as G,r as o,s as c,j as e,B as I,L as N,I as xe}from"./index-D9jIKKOn.js";import{S as U}from"./SiteShell-mTn5lWVi.js";import{J as _e}from"./JobCard-CKi-RWMS.js";import{S as X,a as ee,b as te,c as se,d as y}from"./select-CZhZxbf8.js";import{s as pe}from"./sanitize-D95wOuCE.js";import{B as re}from"./BannerSlot-CibveaB5.js";import{h as be}from"./geocode-DSCffeoo.js";import{L as ve}from"./ListingHeroSection-CGypZpuH.js";import{C as ae}from"./chevron-right-D3FpvDUb.js";import{S as je}from"./search-BaKFlrHu.js";import{S as we}from"./sliders-horizontal-ukvH7ns2.js";import{A as Ne}from"./arrow-right-Bq2yYvtB.js";import"./format-B1MfoHm1.js";import"./building-2-DmBEbkUK.js";import"./star-D8IyRHzH.js";import"./map-pin-B4c6Sg0R.js";import"./tag-DmBJHPqS.js";import"./index-C6kUatHC.js";import"./index-pcCAjn_P.js";import"./chevron-down-D7TYpaCT.js";import"./chevron-up-BpZEolNT.js";import"./listing-hero-DcgkRn3Q.js";function We(){const{slug:M}=G.useParams(),p=G.useLoaderData(),[f,S]=o.useState(p?.page??null),[b,E]=o.useState(p?.eventCards??[]),[R,A]=o.useState(!p?.eventCards?.length),[le,V]=o.useState(!1),[W,ne]=o.useState([]),[q,ie]=o.useState(10),[oe,J]=o.useState(1),[F,ce]=o.useState(""),[d,de]=o.useState("upcoming"),[P,me]=o.useState("upcoming");o.useEffect(()=>(V(!1),(async()=>{const s=p?.page??null;if(!s){V(!0),A(!1);return}const t=s;S(t);const{data:n}=await c.from("landing_pages").select("view_count").eq("id",t.id).single();c.from("landing_pages").update({view_count:(n?.view_count??0)+1}).eq("id",t.id).then(()=>{});const _=await Promise.all([t.filter_category_slug?c.from("categories").select("id").eq("slug",t.filter_category_slug).maybeSingle():Promise.resolve({data:null}),t.filter_job_type_slug?c.from("job_types").select("id").eq("slug",t.filter_job_type_slug).maybeSingle():Promise.resolve({data:null}),t.filter_career_level_slug?c.from("career_levels").select("id").eq("slug",t.filter_career_level_slug).maybeSingle():Promise.resolve({data:null}),t.filter_remote_slug?c.from("remote_options").select("id").eq("slug",t.filter_remote_slug).maybeSingle():Promise.resolve({data:null}),t.filter_job_function_slug?c.from("job_functions").select("id").eq("slug",t.filter_job_function_slug).maybeSingle():Promise.resolve({data:null})]),[Y,k,r,a,h]=_.map(l=>l.data?.id);let g=null;const x=async(l,u,i)=>{if(!i)return;const{data:L}=await c.from(l).select("job_id").eq(u,i),w=new Set((L??[]).map(z=>z.job_id));g=g?new Set([...g].filter(z=>w.has(z))):w};await x("job_categories","category_id",Y),await x("job_job_types","job_type_id",k),await x("job_career_levels","career_level_id",r),await x("job_remote_options","remote_option_id",a),await x("job_job_functions","job_function_id",h);let j=null,m=c.from("jobs").select("id, slug, title, city, country, is_featured, published_at, short_description, latitude, longitude, start_at, end_at, event_format, is_on_demand, is_free, price_on_request, price_cents, price_currency, companies(name, slug, logo_url), job_categories(categories(name, slug))").eq("status","active");if(t.filter_country&&(m=m.eq("country",t.filter_country)),t.filter_event_format&&(m=m.eq("event_format",t.filter_event_format)),t.filter_city&&(m=m.ilike("city",`%${t.filter_city}%`)),t.filter_admin_area){let l=c.from("dach_locations").select("place_name").eq("admin_name1",t.filter_admin_area);t.filter_country&&(l=l.eq("country",t.filter_country));const u=[],i=1e3;for(let L=0;L<3e4;L+=i){const{data:w,error:z}=await l.range(L,L+i-1);if(z||!w||w.length===0)break;for(const he of w){const Z=he.place_name?.split(",")[0]?.trim();Z&&u.push(Z.toLowerCase())}if(w.length<i)break}if(j=new Set(u),j.size===0){E([]),A(!1),H(t,[]);return}}if(g){const l=[...g];if(l.length===0){E([]),A(!1),H(t,[]);return}m=m.in("id",l)}const O=t.filter_center_lat!=null&&t.filter_center_lng!=null&&(t.filter_radius_km??0)>0,{data:ge}=await m.order("is_featured",{ascending:!1}).order("published_at",{ascending:!1}).limit(O||j?1e3:500);let D=ge??[];if(j){const l=j,u=i=>(i||"").replace(/^\s*\d{4,5}\s+/,"").split(",")[0].trim().toLowerCase();D=D.filter(i=>l.has(u(i.city))).slice(0,500)}if(O){const l={lat:t.filter_center_lat,lng:t.filter_center_lng},u=t.filter_radius_km;D=D.filter(i=>i.latitude!=null&&i.longitude!=null&&be(l,{lat:i.latitude,lng:i.longitude})<=u).slice(0,500)}E(D),H(t,D),A(!1);const K="slug, title, h1, intro_text, filter_admin_area, filter_country",Q=new Set([t.slug]),T=[],B=l=>{for(const u of l??[])if(!Q.has(u.slug)&&(Q.add(u.slug),T.push(u),T.length>=6))break};if(t.filter_admin_area){const{data:l}=await c.from("landing_pages").select(K).eq("is_published",!0).eq("filter_admin_area",t.filter_admin_area).neq("slug",t.slug).order("sort_order").limit(6);B(l)}if(T.length<6&&t.filter_country){const{data:l}=await c.from("landing_pages").select(K).eq("is_published",!0).eq("filter_country",t.filter_country).neq("slug",t.slug).order("sort_order").limit(10);B(l)}if(T.length<6){const{data:l}=await c.from("landing_pages").select(K).eq("is_published",!0).neq("slug",t.slug).order("sort_order").limit(10);B(l)}ne(T)})(),()=>{document.querySelector("script[data-landing-jsonld]")?.remove()}),[M,p]),o.useEffect(()=>{J(1)},[q,M,F,d,P]);const ue=o.useMemo(()=>{const s=new Set;for(const t of b)t.start_at&&s.add(new Date(t.start_at).getFullYear());return[...s].sort((t,n)=>t-n)},[b]),C=o.useMemo(()=>{const s=new Date;let t,n;if(d==="week")n=new Date(s),n.setDate(n.getDate()+7),t=s;else if(d==="month"){const r=new Date(s.getFullYear(),s.getMonth(),1);t=s>r?s:r,n=new Date(s.getFullYear(),s.getMonth()+1,0,23,59,59)}else if(d==="4weeks")n=new Date(s),n.setDate(n.getDate()+28),t=s;else if(d==="3months")n=new Date(s),n.setMonth(n.getMonth()+3),t=s;else if(/^\d{4}$/.test(d)){const r=parseInt(d,10);
1t=new Date(r,0,1),n=new Date(r,11,31,23,59,59)}else d==="upcoming"&&(t=s);const _=F.trim().toLowerCase(),k=[...b.filter(r=>{if(_&&!`${r.title??""} ${r.short_description??""} ${r.city??""} ${r.companies?.name??""}`.toLowerCase().includes(_))return!1;if(d!=="all"){const a=r.start_at?new Date(r.start_at):null;if(d==="upcoming"){if(!r.is_on_demand&&!(a&&a>=s)&&a!=null)return!1}else if(t&&n){if(r.is_on_demand)return!0;if(!a||a<t||a>n)return!1}}return!0})];return P==="newest"?k.sort((r,a)=>{const h=Number(a.is_featured)-Number(r.is_featured);if(h)return h;const g=r.published_at?new Date(r.published_at).getTime():0;return(a.published_at?new Date(a.published_at).getTime():0)-g}):P==="relevance"?k.sort((r,a)=>{const h=Number(a.is_featured)-Number(r.is_featured);if(h)return h;if(_){const j=(r.title?.toLowerCase().includes(_)?2:0)+(r.short_description?.toLowerCase().includes(_)?1:0),m=(a.title?.toLowerCase().includes(_)?2:0)+(a.short_description?.toLowerCase().includes(_)?1:0);if(m!==j)return m-j}const g=r.start_at?new Date(r.start_at).getTime():1/0,x=a.start_at?new Date(a.start_at).getTime():1/0;return g-x}):k.sort((r,a)=>{const h=Number(a.is_featured)-Number(r.is_featured);if(h)return h;const g=r.start_at?new Date(r.start_at).getTime():1/0,x=a.start_at?new Date(a.start_at).getTime():1/0;return g-x}),k},[b,F,d,P]),$=Math.max(1,Math.ceil(C.length/q)),v=Math.min(oe,$),fe=o.useMemo(()=>C.slice((v-1)*q,v*q),[C,v,q]);return le?e.jsx(U,{children:e.jsxs("div",{className:"container mx-auto px-4 max-w-7xl py-20 text-center",children:[e.jsx("h1",{className:"text-3xl font-bold mb-3",children:"Seite nicht gefunden"}),e.jsx(I,{asChild:!0,children:e.jsx(N,{to:"/events",children:"Alle Events"})})]})}):e.jsxs(U,{children:[e.jsx(ve,{children:e.jsxs("div",{className:"container mx-auto px-4 max-w-7xl py-10",children:[e.jsxs("nav",{className:"text-xs text-muted-foreground mb-3 flex items-center gap-1",children:[e.jsx(N,{to:"/",className:"hover:text-foreground",children:"Start"}),e.jsx(ae,{className:"h-3 w-3"}),e.jsx("span",{className:"text-foreground",children:f?.title})]}),f?.hero_image_url&&e.jsx("img",{src:f.hero_image_url,alt:"",className:"rounded-lg mb-6 max-h-64 w-full object-cover"}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-3",children:f?.h1||f?.title}),f?.intro_text&&e.jsx("p",{className:"text-muted-foreground max-w-3xl text-lg",children:f.intro_text})]})}),e.jsxs("section",{className:"container mx-auto px-4 max-w-7xl py-10",children:[e.jsxs("div",{className:"bg-card rounded-lg border border-border p-2 flex flex-col md:flex-row gap-2 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 flex-1",children:[e.jsx(je,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx(xe,{value:F,onChange:s=>ce(s.target.value),placeholder:"Innerhalb dieser Seite suchen…",className:"border-0 shadow-none focus-visible:ring-0 h-11"})]}),e.jsx(I,{asChild:!0,variant:"outline",size:"lg",className:"h-11",children:e.jsxs(N,{to:"/events",children:[e.jsx(we,{className:"h-4 w-4 mr-2"}),"Alle Filter"]})})]}),e.jsxs("div",{className:"grid lg:grid-cols-[280px_1fr] gap-8",children:[e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-card p-5",children:[e.jsx("h2",{className:"font-semibold mb-2",children:"Alle Events durchsuchen"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Nutze die volle Suche mit allen Filtern - Kategorien (Messen, Kongresse, Seminare, Schulungen, Webinare, etc.), alle Länder, alle Orte und alle Formate."}),e.jsx(I,{asChild:!0,className:"w-full",children:e.jsxs(N,{to:"/events",children:["Alle Events & Filter ",e.jsx(Ne,{className:"h-4 w-4 ml-2"})]})})]}),e.jsx(re,{slug:"job_detail_sidebar"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:[{value:"upcoming",label:"Alle Termine"},{value:"week",label:"Diese Woche"},{value:"month",label:"Diesen Monat"},{value:"4weeks",label:"Nächste 4 Wochen"},{value:"3months",label:"Nächste 3 Monate"},...ue.map(s=>({value:String(s),label:String(s)}))].map(s=>{const t=d===s.value;return e.jsx("button",{type:"button",onClick:()=>
1de(s.value),className:`px-3 py-1.5 rounded-full text-sm border transition-colors ${t?"bg-primary text-primary-foreground border-primary":"bg-background text-foreground border-border hover:bg-accent hover:text-accent-foreground"}`,children:s.label},s.value)})}),e.jsxs("div",{className:"flex items-center justify-between mb-4 gap-2",children:[e.jsxs("h2",{className:"text-xl font-bold",children:["Events ",R?"":`(${C.length})`]}),!R&&C.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(X,{value:P,onValueChange:s=>me(s),children:[e.jsx(ee,{className:"w-[180px]",children:e.jsx(te,{})}),e.jsxs(se,{children:[e.jsx(y,{value:"upcoming",children:"Nächster Termin"}),e.jsx(y,{value:"newest",children:"Neueste zuerst"}),e.jsx(y,{value:"relevance",children:"Relevanz"})]})]}),e.jsxs(X,{value:String(q),onValueChange:s=>ie(parseInt(s,10)),children:[e.jsx(ee,{className:"w-[140px]",children:e.jsx(te,{})}),e.jsxs(se,{children:[e.jsx(y,{value:"10",children:"10 pro Seite"}),e.jsx(y,{value:"20",children:"20 pro Seite"}),e.jsx(y,{value:"50",children:"50 pro Seite"}),e.jsx(y,{value:"100",children:"100 pro Seite"})]})]})]})]}),R?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Lade …"}):C.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border p-12 text-center",children:[e.jsx("p",{className:"text-muted-foreground mb-4",children:b.length===0?"Aktuell keine passenden Events.":"Keine Events für diese Auswahl."}),e.jsx(I,{asChild:!0,variant:"outline",children:e.jsx(N,{to:"/events",children:"Alle Events ansehen"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-3",children:fe.map(s=>e.jsx(_e,{job:s},s.id))}),$>1&&e.jsxs("div",{className:"flex items-center justify-between mt-6",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Seite ",v," von ",$]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{variant:"outline",size:"sm",disabled:v<=1,onClick:()=>J(v-1),children:"Zurück"}),e.jsx(I,{variant:"outline",size:"sm",disabled:v>=$,onClick:()=>J(v+1),children:"Weiter"})]})]})]}),f?.content_html&&e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx("div",{className:"rich-content max-w-none text-foreground",dangerouslySetInnerHTML:{__html:pe(f.content_html)}})})]})]})]}),e.jsx("div",{className:"container mx-auto px-4 max-w-7xl pb-10",children:e.jsx(re,{slug:"footer_above",className:"max-w-5xl mx-auto"})}),W.length>0&&e.jsx("section",{className:"border-t border-border bg-surface",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-7xl py-10",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Verwandte Themenseiten"}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-3",children:W.map(s=>e.jsxs(N,{to:"/themen/$slug",params:{slug:s.slug},className:"group rounded-lg border border-border bg-card p-4 hover:border-primary hover:shadow-sm transition-all",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"font-semibold text-sm group-hover:text-primary line-clamp-2",children:s.h1||s.title}),e.jsx(ae,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary shrink-0 mt-0.5"})]}),s.intro_text&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:s.intro_text})]},s.slug))}),e.jsx("div",{className:"mt-4 text-sm",children:e.jsx(N,{to:"/themen",className:"text-primary hover:underline",children:"Alle Themenseiten →"})})]})})]})}function H(M,p){document.querySelector("script[data-landing-jsonld]")?.remove();const f={"@context":"https://schema.org","@type":"ItemList",name:M.h1||M.title,numberOfItems:p.length,itemListElement:p.slice(0,20).map((b,E)=>({"@type":"ListItem",position:E+1,url:`${typeof window<"u"?window.location.origin:""}/events/detail/${b.slug}`,name:b.title}))},S=document.createElement("script");S.type="application/ld+json",S.dataset.landingJsonld="true",S.text=JSON.stringify(f),document.head.appendChild(S)}export{We as component};

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.