1import{d as o,y as N,u as e}from"./preact-971bee61.js";import{u as q}from"./App-7c78f7fc.js";import{u as I}from"./graphql-hooks-acaa8737.js";import{n as T}from"./queries-3d0fb885.js";import $ from"./PublicPageLayout-3476c2b4.js";import{P as M}from"./Pager-1e4a4f61.js";import{$ as D}from"./react-loader-spinner-a6e8d2c0.js";import"./@babel-8566b309.js";import"./index-9a4c20d8.js";import"./graphql-hooks-memcache-b5ca36d6.js";import"./events-0fc3cbe6.js";import"./@0no-co-366d1881.js";import"./use-deep-compare-effect-bebc9126.js";import"./dequal-5d0cf067.js";import"./extract-files-ef74ebf3.js";import"./react-router-dom-55fcdc76.js";import"./react-router-9f441233.js";import"./@remix-run-9290f067.js";import"./react-toastify-02f9031c.js";import"./tiny-slider-react-908e574e.js";import"./prop-types-c16989f4.js";import"./tiny-slider-02091193.js";import"./axios-153d7d05.js";import"./he-cd46cda0.js";import"./graphql-tag-d88a12ea.js";import"./tslib-e256ba82.js";import"./graphql-0d2def3c.js";import"./MetaTags-a2549200.js";import"./react-helmet-556c15bf.js";import"./react-side-effect-6220c7e1.js";import"./react-fast-compare-405844fa.js";import"./object-assign-f805cfb9.js";import"./SanitizedHtml-2469575d.js";import"./@mui-79d199dc.js";import"./clsx-0839fdbe.js";import"./@emotion-82fdae77.js";import"./hoist-non-react-statics-3f8ebaa8.js";import"./stylis-79144faa.js";import"./react-is-1f97129c.js";import"./react-transition-group-476bb507.js";import"./styled-components-58dda6cc.js";const E=(l,s)=>Math.ceil(l/s);function xe(){var g,u,f,_,w,v,C,L,b;const l=q(),[s,p]=o({title:"",page:"",field_faculty_target_id:"All"}),[x,n]=o(0),[m,y]=o(0),[c,d]=o(!1),{data:r,error:h,loading:P}=I(T,{variables:{field_faculty_target_id:`${s.field_faculty_target_id}`,title:`${s.title}`,page:x}});N(()=>{c&&(window.scrollTo({top:0,behavior:"smooth"}),d(!1))},[c]),N(()=>{var t;if((t=r==null?void 0:r.departmentsGraphql1)!=null&&t.pageInfo){const{total:a,pageSize:i}=r.departmentsGraphql1.pageInfo;y(E(a,i))}},[r]);const S=t=>{t.preventDefault();const a=t.target.elements.searchInput.value,i=t.target.elements.facultiesFilter.value;p({title:a,field_faculty_target_id:i}),n(0)},G=t=>{const a=t.target.value;p(i=>({...i,field_faculty_target_id:a})),n(0)},V=t=>{d(!0),n(t)};return h?e("p",{children:["Error: ",h.message]}):e($,{pageSeo:(g=r==null?void 0:r.departmentsGraphql1)==null?void 0:g.pageSeo,fallbackTitle:l==="en"&&"Department"||"ÐаÑедÑи",children:e("div",{className:"departments-page",children:[e("div",{className:"departments-page__header",children:e("div",{className:"container",children:e("form",{className:"departments-page__filter-form",onSubmit:S,children:[e("label",{className:"departments-page__faculties-filter",children:[e("select",{name:"facultiesFilter",value:s.field_faculty_target_id,onChange:G,children:[e("option",{value:"All",children:l==="en"&&"All"||"ÐÑÑ"}),((_=(f=(u=r==null?void 0:r.departmentsGraphql1)==null?void 0:u.filters)==null?void 0:f[0])==null?void 0:_.options)&&Object.entries((C=(v=(w=r==null?void 0:r.departmentsGraphql1)==null?void 0:w.filters)==null?void 0:v[0])==null?void 0:C.options).map(([t,a])=>e("option",{value:t,children:a},t))]}),e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"37",viewBox:"0 0 46 37",fill:"none",children:e("path",{d:"M37.0444 13.7119C36.3647 13.0953 35.3451 13.0953 34.6654 13.7119L28.7179 19.1078L22.7704 13.7119C22.0907 13.0953 21.0711 13.0953 20.3914 13.7119C19.7117 14.3286 19.7117 15.2536 20.3914 15.8703L27.5284 22.3453C27.8682 22.6536 28.2081 22.8078 28.7179 22.8078C29.2277 22.8078 29.5675 22.6536 29.9074 22.3453L37.0444 15.8703C37.7241 15.2536 37.7241 14.3286 37.0444 13.7119Z",fill:"#561111"})})]}),e("label",{className:"departments-page__search",children:[e("input",{name:"searchInput",placeholder:l==="en"&&"Search"||"ÐоÑÑк",type:"text"}),e("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"35",height:"28",viewBox:"0 0 50 50",fill:"currentColor",children:e("path",{d:"M 21 3 C 11.601563 3 4 10.601563 4 20 C 4 29.398438 11.601563 37 21 37 C 24.355469 37 27.460938 36.015625 30.09375 34.34375 L 42.375 46.625 L 46.625 42.375 L 34.5 30.28125 C 36.679688 27.421875 38 23.878906 38 20 C 38 10.601563 30.398438 3 21 3 Z M 21 7 C 28.199219 7 34 12.800781 34 20 C 34 27.199219 28.199219 33 21 33 C 13.800781 33 8 27.199219 8 20 C 8 12.800781 13.800781 7 21 7 Z"})}),e("button",{type:"submit",children:l==="en"&&"Search"||"ÐоÑÑк"})]})]})})}),e("div",{className:"departments-page__result-container container",children:P?e("div",{className:"loading-indicator",children:e(D,{visible:!0,height:"80",
1width:"80",ariaLabel:"loading",wrapperStyle:{},wrapperClass:"color-ring-wrapper",colors:["#561111","#561111","#561111","#561111","#561111"]})}):((b=(L=r==null?void 0:r.departmentsGraphql1)==null?void 0:L.results)==null?void 0:b.length)>0?r.departmentsGraphql1.results.map((t,a)=>{var i;return e("div",{className:"departments-page__result-item",children:[e("div",{className:"departments-page__result-title",children:t==null?void 0:t.title}),e("div",{className:"departments-page__result-faculty",children:(i=t==null?void 0:t.faculty)==null?void 0:i.title}),e("a",{className:"departments-page__result-link",href:t==null?void 0:t.path,children:[l==="en"&&"Read more"||"ÐеÑалÑнÑÑе",e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"10",viewBox:"0 0 32 10",fill:"none",children:e("path",{d:"M22.7921 9.90829L21.2923 9.08333L27.6551 5.58332L0 5.58332L0 5.58329L0 4.41662L0 4.41658L27.6549 4.41658L21.2923 0.916688L22.7921 0.0917196L31.7151 5.00001L22.7921 9.90829Z",fill:"#561111"})})]})]},a)}):e("p",{className:"no-results",children:l==="en"&&"No results found"||"ÐÑÑого не знайдено"})}),m>1&&e(M,{totalPages:m,onPageChange:V})]})})}export{xe 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.