PageSourceSearch

https://slovakiana.sk/assets/EduMaterialsPage-D-ZYi9Qx.js

js slovakiana.sk collected 2026-09-24 09:30:45 UTC 6,176 bytes, 1 lines download raw bytes

1import{a0 as O,aW as A,r as u,aq as I,as as N,c8 as q,ab as L,a1 as t,av as h,a5 as R,a4 as M,a8 as _,a$ as W,aD as G,c9 as Q,a6 as X,a2 as Y,ca as Z}from"./index-DTrOxaLL.js";import{I as ee}from"./ItemCard-CRltPQ_l.js";import{L as te,C as se}from"./CustomTextField-3x0KwBU3.js";import{P as re,a as ae}from"./CustomChip-uA-7JYT1.js";import{u as oe}from"./useWindowSize-CCpMx3H1.js";import{E as ne}from"./EduLabel-DuYaRmGd.js";import{L as ie}from"./Loading-_1BHl9wM.js";import{C as le}from"./Container-C5ZoBjQh.js";import{C as ce}from"./CustomPopupTree-Cj9mfAvQ.js";import{C as ue}from"./CircularProgress-DvgAQojB.js";import{H as de}from"./HeroSection-DngfeSmH.js";import{C as pe}from"./ImgBox-CDo21mwv.js";import"./Heart-B7G8UNoP.js";import"./CustomTextFieldWithDropdown-C49vt3Zf.js";import"./webalize-vpuhK1RI.js";const ge=R("div")(({theme:e})=>({padding:e.spacing(1,0,4,0),backgroundColor:e.palette.background.paper}));function he(){const{translate:e,currentLang:g}=O(),[o]=A(),[y,x]=u.useState([]),[C,S]=u.useState(0),{favourites:T}=I(s=>s.favourites),{EDUs:i,isLoading:j}=I(s=>s.edu),{totalCount:b}=i,l=Number(o.get("lm")||0),r=Number(o.get("page")||1),d=Number(o.get("perPage")||40),w=o.get("filter")||'{"category":[]}',[c,J]=u.useState(JSON.parse(w)),m=o.get("search")||"",v=(o.get("sort")||"").replaceAll("-"," "),E=(o.get("sortDirection")||"").replaceAll("-"," "),[$,P]=u.useState(3),[p,k]=u.useState([0,1,2,3]),f=oe(),{categoryKeys:D}=c,B=m?[{title:e("sort.name"),value:"name",icon:"mdi:sort-alphabetical-"},{title:e("sort.date"),value:"updated",icon:"mdi:sort-date-"},{title:e("sort.relevance"),value:"rank",icon:"mdi:sort-bool-"}]:[{title:e("sort.name"),value:"name",icon:"mdi:sort-alphabetical-"},{title:e("sort.date"),value:"updated",icon:"mdi:sort-date-"}];u.useEffect(()=>{J(s=>JSON.stringify(s)===w?s:JSON.parse(w))},[w]),u.useEffect(()=>{i.results&&x(l===0?i.results:s=>i.results.reduce((a,K)=>(a.includes(K)||a.push(K),a),[...s])),i.results&&S(i.totalCount)},[l,i]),u.useEffect(()=>{f==="xs"&&p.length!==1?k([0]):f==="sm"&&p.length!==2?k([0,1]):f==="lg"&&$===3&&p.length!==4?k([0,1,2,3]):f==="lg"&&$===6&&p.length!==2&&k([0,1])},[f,$,p]),u.useEffect(()=>{const s=new AbortController;return N(q({searchText:m,size:d,sortDirection:E||1,sortAttribute:v||"created",page:r,categoryKeys:D,searchByKeywords:o.get("searchByKeywords")||!0,loadMore:l,signal:s.signal,locale:g.getValue})),()=>s.abort()},[m,g.getValue,c,r,d,v,E,D]);const F=s=>{P(s===2?6:3)},U=s=>{N(W({...s,type:"edu"}))},V=u.useCallback((s,n)=>{let a;return s.url.includes("http")?a=s.url:a=`https://${s.url}`,a.includes(L.get().VITE_HOST)&&(l===0?c.index=(r-1)*d+n:c.index=(r-1)*d+n-d*l,c.total=b,c.sort=v,c.sortDirection=E,c.searchText=m,c.searchByKeywords=o.get("searchByKeywords")||!0,c.page=r,a=window.location.pathname.includes("en/")?a.replace("kulturne-objekty","en/edu-materials"):a.replace("kulturne-objekty","edu-materialy"),a=`${a.split("?")[0].replace("www.","").replace(`https://${L.get().VITE_HOST}`,"")}?url=${encodeURIComponent(JSON.stringify(c))}&fromPage=edu`),a},[c,l,r,d,o,m,v,E,b]),z=s=>{switch(s){case 1:return e("articles.countArticle1");case 2:case 3:case 4:return e("articles.countArticle234");default:return e("articles.countArticle")}},H=p.map(s=>t.jsx(h,{xs:12,sm:6,md:$,item:!0,children:y.map((n,a)=>t.jsx("div",{children:a%p.length===s&&t.jsx(ee,{img:n.thumbnail!==void 0&&n.thumbnail!==""?`${L.get().VITE_API_URL}/image/download/${n.thumbnail}?sizeIndex=0`:"",favorite:T.findIndex(K=>K.key===n.key)!==-1,width:12,fixedWidth:!0,heartAction:()=>U(n),action:V(n,a),children:t.jsx(ne,{title:n.name?.length>0?n.name:e("default.noText"),categories:n.categories,download:n.download})})},a))},s));return t.jsx(t.Fragment,{children:t.jsx(ge,{id:"content-page",children:t.jsxs(le,{component:M,sx:{position:"relative",height:"100%"},children:[t.jsx(te,{text:`${i.totalCount}${z(i.totalCount)}`,count:i.totalCount||0,sort:!0,sortValues:B,setTilesTwo:()=>F(2),setTilesFour:()=>F(4)}),t.jsxs(h,{container:!0,spacing:"24px",sx:{position:"relative"},children:[j&&t.jsx(ie,{}),H]}),y.length===0&&!j&&t.jsx(h,{item:!0,sx:{mt:5,pb:5,textAlign:"center"},children:t.jsx(_,{variant:"h6",children:e("default.noResults")})}),t.jsx(re,{total:+C})]})})})}function me(){const[e,g]=A(),o=JSON.parse(e.get("filter")||'{"categoryKeys":[]}'),{filterEDuOptions:y,isLoading:x}=G(l=>l.filters),{translate:C,currentLang:{getValue:S}}=O(),T=y||[],i=o?.categoryKeys||[],j=l=>
1{const r=new URLSearchParams(e),d={...o};d.categoryKeys=l,r.set("filter",JSON.stringify(d)),r.set("page",1),g(r)},b=u.useCallback(l=>{const r=JSON.parse(e.get("filter")||'{"categoryKeys":[]}');r.searchText=e.get("search")||"",r.categoryKeys=[],r.searchByKeywords=e.get("searchByKeywords")||!0,r.searchByKeywords=!r.searchText?.includes('"'),r.searchText=r.searchText?.replaceAll('"',""),N(Q({categoryTypeKey:6,autocompleteText:l,size:100,page:0,locale:S,filter:r}))},[e,S]);return t.jsx(se,{children:t.jsx(X.div,{children:x?t.jsx(ue,{}):t.jsxs(h,{container:!0,spacing:2,alignItems:"center",justifyContent:"center",sx:{pt:"0 !important"},children:[t.jsx(h,{item:!0,xs:12,sx:{pt:"0 !important"},children:t.jsx(ae,{filter:o,categories:T,categoryName:"edu.chooseCat"})}),t.jsx(h,{item:!0,xs:12,sm:6,lg:3.15,sx:{mr:0,pt:"0 !important"},children:t.jsx(ce,{label:C("edu.chooseCat"),placeholder:C("articles.searchCatMap"),options:T,onChange:j,value:i,param:"key",loadFunction:b,clearInput:JSON.stringify(o)===JSON.stringify({categoryKeys:[]}),unselectable:1})})]})})})}const fe=R("div")(({theme:e})=>({paddingTop:e.spacing(3),[e.breakpoints.up("md")]:{paddingTop:e.spacing(5)}}));function Oe(){const{translate:e}=O(),g={description:`${e("edu.title")} ${e("edu.subtitle")}`,keywords:`${e("edu.title")} ${e("edu.subtitle")}`.split(" "),social:{ogTitle:`Slovakiana | ${e("default.funny")}`,ogDescription:`${e("edu.title")} ${e("edu.subtitle")}`}};return t.jsxs(Y,{children:[t.jsx(pe,{title:`Slovakiana | ${e("default.funny")}`,meta:g}),t.jsxs(fe,{children:[t.jsx(de,{title:"edu.title",subtitle:"edu.subtitle",searchPlaceholder:"edu.searchText",searchCount:10,searchFunction:Z,children:t.jsx(me,{})}),t.jsx(he,{})]})]})}export{Oe 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.