PageSourceSearch

https://www.levi.fi/component---src-contentful-templates-event-pages-events-page-tsx-f13b288c61c6ce3fae6d.js

js levi.fi collected 2026-09-24 18:55:57 UTC 6,476 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkvisit_levi_website_2025=self.webpackChunkvisit_levi_website_2025||[]).push([[878],{19971:function(e,t,l){l.d(t,{A:function(){return o}});var i=l(96540),n=l(26250),a=l(26204),s=l(74848);const r=i.lazy(()=>Promise.resolve().then(l.bind(l,73326))),c=(0,s.jsx)("div",{className:"h-[400px] flex items-center justify-center",children:(0,s.jsx)(n.A,{})});var o=e=>(0,s.jsx)(a.A,{fallback:c,children:(0,s.jsx)(i.Suspense,{fallback:c,children:(0,s.jsx)(r,{...e})})})},23603:function(e,t,l){l.r(t),l.d(t,{Head:function(){return S},default:function(){return w}});var i=l(96540),n=l(24794),a=l(29318),s=l(17471),r=l(88702),c=l(78380),o=l(8471),u=l(44397),d=l(86203),h=l(32734),f=l(57590),m=l(89201),p=l(29407);function g(e,t){const l=(0,p.a)(e,t?.in);return l.setHours(23,59,59,999),l}var v=l(71325),b=l(216),x=l(60967),y=l(80726),j=l(38137),k=l(38196),L=l(5582),F=l(19971),A=l(74848);const C=[{id:"Well-being",titleEN:"Well-being",titleFI:"Hyvinvointi"},{id:"Culture and entertainment",titleEN:"Culture and entertainment",titleFI:"Kulttuuri ja viihde"},{id:"Music",titleEN:"Music",titleFI:"Musiikki"},{id:"Families",titleEN:"Families",titleFI:"Perheet"},{id:"Sports",titleEN:"Sports",titleFI:"Urheilu"},{id:"Slope events",titleEN:"Slope events",titleFI:"Rinnetapahtumat"}];var w=e=>{let{data:{events:{edges:t},contentfulPage:{sections:l}},location:a}=e;t=(0,y.YO)(t);const p=(0,f.mb)(a),w=(0,r.A)({cards:t.filter(e=>{let{node:{startDate:t,endDate:l,hideFromLocalization:i}}=e;return!("fi"!==p&&i)&&(l?l>=(0,m.GP)(new Date,"yyyy-MM-dd"):t>=(0,m.GP)(new Date,"yyyy-MM-dd"))}),type:s.b.Event}),{sortedData:S}=(0,o.A)({data:w,sortBy:e=>{let{date:t}=e;return(0,u.oM)(t)?t.start.getTime():t.getTime()}}),[D,N]=i.useState(""),[R,_]=(0,k.A)({location:a,paramName:"dates",initialValue:[]}),[I,E]=(0,k.A)({location:a,paramName:"category",initialValue:[]}),M=i.useMemo(()=>{const e=[(0,L.Fw)("title",D),(0,L._I)("categories",I)],t=(0,y.t1)(R);return t&&(0,u.O5)(t)?(t.end=g(t.end),[].concat(e,[(0,L.h)("date",t)])):e},[R,D,I]),P=i.useMemo(()=>[{name:"categoryFilter",label:(0,f.kg)("filters.listFilters.category"),items:C.map(e=>{let{id:t,titleFI:l,titleEN:i}=e;return{value:String(t),label:"fi"===p?l:i}}),onChange:E,value:I,variant:"primary"}],[C,I,E]),{filteredData:T}=(0,L.Ay)({data:S,filters:M}),O=i.useCallback(()=>{(0,n.navigate)(`${a.pathname}`,{state:{disableScrollUpdate:!0}})},[a.pathname]);return(0,A.jsxs)("main",{children:[null==l?void 0:l.map(e=>(0,A.jsx)(h.A,{...e},e.id)),(0,A.jsx)(v.iD,{$noAside:!0,children:(0,A.jsxs)(b.A.MainSection,{children:[(0,A.jsx)(x.o5.Display,{children:(0,f.kg)("events.headline")}),(0,A.jsx)(b.A.PrimaryFilterDateOnly,{children:(0,A.jsx)(F.A,{selectedRange:(0,y.t1)(R),onSelectedDateRangeChange:e=>e&&(0,u.O5)(e)?_([(0,y.sm)(e)]):_([])})}),(0,A.jsx)(j.A,{filters:P,searchTerm:D,setSearchTerm:N,onResetClick:O}),(0,A.jsx)(d.A,{title:(0,f.kg)("searchResults.seachResultsTitle"),count:T.length}),(0,A.jsx)(c.A,{cards:T,columns:3,mobileScrollable:!1})]})})]})};const S=e=>(0,A.jsx)(a.ec,{...e})},38137:function(e,t,l){l.d(t,{A:function(){return F}});var i=l(96540),n=l(26193),a=l(54506),s=l(2404),r=l.n(s),c=l(97685),o=l(81678),u=l(1317),d=l(86918),h=l(74848);var f=e=>{let{label:t,value:l=[],onChange:n,items:s=[],variant:f="primary"}=e;const m=i.useRef(null),p=i.useRef(null),{isOpen:g,onDropdownClick:v}=(0,u.A)({ref:m}),{recalculate:b}=(0,d.k)({refWrapper:m,refContainer:p,anchorPoint:"left"}),x=i.useRef(l||[]);(0,i.useLayoutEffect)(()=>{b()},[b,g]),(0,i.useEffect)(()=>{const e=l?l instanceof Array?(0,a.A)(l):[l]:[];var t,i,n,s;(r()(x.current,e)||(x.current=e),x.current.length>0)?null!==(t=m.current)&&void 0!==t&&t.classList.contains("hasValue")||null===(i=m.current)||void 0===i||i.classList.add("hasValue"):null!==(n=m.current)&&void 0!==n&&n.classList.contains("hasValue")&&(null===(s=m.current)||void 0===s||s.classList.remove("hasValue"))},[l]);const y=i.useCallback(e=>{const{checked:t,value:l}=e.currentTarget;x.current=t?[].concat((0,a.A)(x.current),[l]):x.current.filter(e=>e!==l),n&&n(x.current)},[n]),j=i.useCallback(e=>x.current.includes(e),[x]);return 0===s.length?null:(0,h.jsxs)(c.A.Dropdown,{ref:m,className:x.current.length>0?"hasValue":"",$isOpen:g,$variant:f,children:[(0,h.jsx)(o.A,{label:t,onClick:v}),(0,h.jsx)(c.A.DropdownOptions,{ref:p,children:s.map(e=>{let{value:t,label:l,component:i}=e;return(0,h.jsxs)(c.A.DropdownOptionLabel,{children:[(0,h.jsx)("input",{type:"checkbox",name:l,value:t,onChange:y,checked:j(t)}),i||l]},l)})})]})},m=l(63679),p=l(15805),g=l(88061),v=l(77412),b=l(60967);var x={ListFiltersContainer:m.default.div.withConfig({displayName:"ListFiltersstyled__ListFiltersContainer",componentId:"sc-3jgbog-0"})(["display:flex;flex-direction:row;align-items:flex-start;gap:1rem;"]),ListFiltersLabel:(0,m.default)(b.o5.LabelSmall).withConfig({displayName:"ListFiltersstyled__ListFiltersLabel",componentId:"sc-3jgbog-1"})(["padding-top:0.5rem;flex-shrink:0;color:",";","{display:none;}"],g.D.LeviBlue,(0,p.Gz)(p.EA.md)),ListFilters:m.default.div.withConfig({displayName:"ListFiltersstyled__ListFilters",componentId:"sc-3jgbog-2"})(["display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem;"]),ResetButton:(0,m.default)(b.o5.LabelSmall).attrs({as:"button"}).withConfig({displayName:"ListFiltersstyled__ResetButton",componentId:"sc-3jgbog-3"})(["line-height:1;padding:0.5rem 0;margin:0 1rem;display:block;align-self:baseline;color:",";","{cursor:pointer;"," &:hover{","}}"],g.D.LeviBlue,v.PT,b.G$,b.sS)};var y=e=>{let{label:t,children:l,filters:a=[],onResetClick:s,resetLabel:r}=e;const c=i.useRef(null);(0,n.N)({ref:c});const o=i.useCallback(e=>(0,h.jsx)(f,{...e},e.name),[]);return 0===a.length?null:(0,h.jsxs)(x.ListFiltersContainer,{ref:c,children:[(0,h.jsx)(x.ListFiltersLabel,{children:t}),(0,h.jsxs)(x.ListFilters,{children:[l,a.map(o),s&&(0,h.jsx)(x.ResetButton,{onClick:s,children:r})]})]})},j=l(216),k=l(32575),L=l(57590);var F=e=>{let{filters:t,searchTerm:l,children:i,setSearchTerm:n,onResetClick:a}=e;return(0,h.jsx)(j.A.Filters,{children:(0,h.jsxs)(y,{label:(0,L.kg)("filters.filterBy"),resetLabel:(0,L.kg)("filters.listFilters.resetLabel"),filters:t,onResetClick:a,children:[(0,h.jsx)(j.A.Input,{type:"text",placeholder:(0,L.kg)("search.form.inputPlaceholder"),value:l,onCh
1ange:e=>{n(e.target.value)},trailingIcon:{type:k.F.SearchLarge}}),i]})})}}}]);
2//# sourceMappingURL=component---src-contentful-templates-event-pages-events-page-tsx-f13b288c61c6ce3fae6d.js.map

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.