1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3225],{40174:function(e,t,n){n.d(t,{Z:function(){return d}});var s=n(85893),a=n(67294),l=n(11163),r=n(36127),i=n(23432),c=n(3350),o=n(31275),u=n(93655);function d(e){let{cities:t=[],lang:n="en",currency:d="EUR",loading:h=!1}=e,m=(0,l.useRouter)(),[p,v]=(0,a.useState)(""),g=(0,a.useMemo)(()=>{let e=p.trim().toLowerCase();return e?t.filter(t=>"".concat(t.name||""," ").concat(t.subtitle||""," ").concat(t.country||"").toLowerCase().includes(e)):t},[t,p]);return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h2",{className:"text-xl font-bold text-slate-900",children:(0,o.t)("events.landing.popularCities",n)})}),t.length>8?(0,s.jsxs)("div",{className:"relative w-full sm:max-w-xs",children:[(0,s.jsx)(r.Z,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),(0,s.jsx)("input",{type:"search",value:p,onChange:e=>v(e.target.value),placeholder:(0,o.t)("events.landing.filterCities",n),className:"h-11 w-full rounded-xl bg-white pl-10 pr-3 text-sm text-slate-900 outline-none ring-1 ring-slate-200 placeholder:text-slate-400 focus:ring-2 focus:ring-teal-500"})]}):null]}),h?(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-2xl bg-white px-4 py-8 text-sm text-slate-500 ring-1 ring-slate-200",children:[(0,s.jsx)(i.Z,{className:"h-4 w-4 animate-spin text-teal-600"}),(0,o.t)("events.landing.loadingCities",n)]}):g.length?(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:g.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{(null==e?void 0:e.id)&&m.push(function(e){let{lang:t,currency:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=new URLSearchParams({lang:t||"en",currency:n||(0,u.OF)()||"EUR"});return(null==e?void 0:e.id)&&s.set("cityId",String(e.id)),(null==e?void 0:e.name)&&s.set("q",e.name),"/events/search?".concat(s.toString())}(e,{lang:n,currency:d}))},className:"flex items-center gap-3 rounded-2xl bg-white px-3.5 py-3.5 text-left shadow-sm ring-1 ring-slate-200 transition hover:ring-teal-400 hover:shadow-md",children:[(0,s.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-teal-50 text-teal-700",children:(0,s.jsx)(c.Z,{className:"h-4 w-4"})}),(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block truncate text-sm font-semibold text-slate-900",children:e.name}),e.subtitle||e.country?(0,s.jsx)("span",{className:"block truncate text-xs text-slate-500",children:e.subt
1itle||e.country}):null]})]},e.id))}):(0,s.jsx)("p",{className:"rounded-2xl bg-white px-4 py-8 text-center text-sm text-slate-500 ring-1 ring-slate-200",children:(0,o.t)("events.landing.noCities",n)})]})}},22396:function(e,t,n){n.d(t,{Z:function(){return y}});var s=n(85893),a=n(67294),l=n(11163),r=n(3350),i=n(89176),c=n(1781),o=n(95263),u=n(39889),d=n(23432),h=n(36127),m=n(31275),p=n(93655),v=n(33277);function g(){let e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(s)}let x={city:r.Z,participant:i.Z,tournament:c.Z,eventType:o.Z,venue:u.Z,event:o.Z},f={city:"events.suggest.city",cities:"events.suggest.city",participant:"events.suggest.participant",participants:"events.suggest.participant",tournament:"events.suggest.tournament",tournaments:"events.suggest.tournament",eventType:"events.suggest.category",category:"events.suggest.category",venue:"events.suggest.venue",venues:"events.suggest.venues",event:"events.suggest.event",events:"events.suggest.events"};function y(e){let{lang:t,initialQuery:n="",compact:r=!1,className:i=""}=e,c=(0,l.useRouter)(),u=t||(0,m.getUiLang)(),[y,w]=(0,a.useState)(n),[b,j]=(0,a.useState)(!1),[N,k]=(0,a.useState)(!1),[E,Z]=(0,a.useState)([]),[M,S]=(0,a.useState)(280),L=(0,a.useRef)(null),R=(0,a.useRef)(null),C=(0,a.useRef)(null);function U(){L.current&&S(Math.min(320,function(e){if(!e)return 280;let t=e.getBoundingClientRect(),n=window.visualViewport;return Math.max(120,Math.floor((n?n.offsetTop+n.height:window.innerHeight)-t.bottom-12))}(L.current)))}function z(e){if((null==e?void 0:e.type)==="event"&&(null==e?void 0:e.id)){let t=(0,p.OF)()||"EUR";j(!1),c.push("/events/".concat(e.id,"?lang=").concat(encodeURIComponent(u),"¤cy=").concat(encodeURIComponent(t)));return}let t=new URLSearchParams({lang:u,currency:(0,p.OF)()||"EUR",dateFrom:g()});(null==e?void 0:e.type)==="city"?t.set("cityId",e.id):(null==e?void 0:e.type)==="participant"?t.set("participantId",e.id):(null==e?void 0:e.type)==="tournament"?t.set("tournamentId",e.id):(null==e?void 0:e.type)==="eventType"?t.set("eventTypeId",e.id):(null==e?void 0:e.type)==="venue"&&t.set("venueId",e.id),(null==e?void 0:e.name)&&t.set("q",e.name),j(!1),c.push("/events/search?".concat(t.toString()))}(0,a.useEffect)(()=>{w(n||"")},[n]),(0,a.useEffect)(()=>{let e=e=>{L.current&&!L.current.contains(e.target)&&j(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e,{passive:!0}),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[]),(0,a.useEffect)(()=>{if(!b)return;U();let e=()=>U();window.addEventListener("resize",e),window.addEventListener("scroll",e,!0);let t=window.visualViewport;return null==t||t.addEventListener("resize",e),null==t||t.addEventListener("scroll",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),null==t||t.removeEventListener("resize",e),null==t||t.removeEventListener("scroll",e)}},[b,E.length]),(0,a.useEffect)(()=>(C.current&&clearTimeout(C.current),C.current=setTimeout(async()=>{k(!0);try{let e=new URLSearchParams({q:y.trim(),lang:u}),t=await fetch("/api/events/suggest?".concat(e)),n=await (0,v.cX)(t);n.success&&Z(n.suggestions||[])}catch(e){Z([])}finally{k(!1)}},280),()=>{C.current&&clearTimeout(C.current)}),[y,u]);let F=b&&E.length>0;return(0,s.jsxs)("form",{ref:L,onSubmit:function(e){var t;if(null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),E[0]){z(E[0]);return}let n=new URLSearchParams({lang:u,currency:(0,p.OF)()||"EUR",dateFrom:g()});if(!y.trim()){j(!0);return}n.set("q",y.trim()),j(!1),c.push("/events/search?".concat(n.toString()))},className:"relative z-50 ".concat(i),autoComplete:"off",children:[(0,s.jsxs)("div",{className:"relative z-20 flex items-stretch gap-2 rounded-2xl bg-white shadow-md ring-1 ring-slate-200 ".concat(r?"p-1.5":"p-2"),children:[(0,s.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,s.jsx)(o.Z,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"}),(0,s.jsx)("input",{ref:R,type:"search",enterKeyHint:"search",value:y,onChange:e=>{w(e.target.value),j(!0)},onFocus:function(){j(!0),requestAnimationFrame(()=>{try{var e;null===(e=L.current)||void 0===e||e.scrollIntoView({block:"start",behavior:"smooth"})}catch(e){}U()})},placeholder:(0,m.t)("home.events.searchPlaceholder",u),className:"w-full rounded-xl border-0 bg-transparent pl-10 pr-10 text-slate-900 outline-none placeholder:text-slate-400 ".concat(r?"h-11 text-sm":"h-12 text-base")}),N&&(0,s.jsx)(d.Z,{className:"absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-teal-600"})]}),(0,s.jsxs)("button",{type:"submit",className:"inline-flex shrink-0 items-center gap-2 rounded-xl bg-teal-700 px-4 font-semibold text-white transition hover:bg-teal-800 ".concat(r?"h-11 text-sm":"h-12 px-5 text-sm sm:text-base"),children:[(0,s.jsx)(h.Z,{className:"h-4 w-4"}),(0,m.t)("home.events.searchButton",u)]})]}),F?(0,s.jsx)("div",{id:"events-suggest-menu",role:"listbox",className:"absolute left-0 right-0 top-full z-10 mt-2 overflow-y-auto overscroll-contain rounded-xl bg-white py-1.5 shadow-2xl ring-1 ring-slate-200",style:{maxHeight:M,WebkitOverflowScrolling:"touch"},children:E.map(e=>{let t=x[e.type]||o.Z,n=f[e.type]?(0,m.t)(f[e.type],u):e.type;return(0,s.jsxs)("button",{type:"button",role:"option",onMouseDown:t=>{t.preventDefault(),z(e)},className:"flex w-full items-center gap-3 px-3.5 py-2.5 text-left active:bg-slate-100 hover:bg-slate-50",children:[(0,s.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-slate-100 text-slate-700",children:(0,s.jsx)(t,{className:"h-4 w-4"})}),(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block truncate text-sm font-semibold text-slate-900",children:e.name}),(0,s.jsx)("span",{className:"block truncate text-xs text-slate-500",children:[n,e.subtitle].filter(
1Boolean).join(" \xb7 ")})]})]},"".concat(e.type,"-").concat(e.id))})}):null]})}},39889:function(e,t,n){n.d(t,{Z:function(){return s}});let s=(0,n(31134).Z)("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]])},23432:function(e,t,n){n.d(t,{Z:function(){return s}});let s=(0,n(31134).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},1781:function(e,t,n){n.d(t,{Z:function(){return s}});let s=(0,n(31134).Z)("trophy",[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]])}}]);
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.