PageSourceSearch

https://www.mos.org/themes/custom/mos/dist/js/chunks/Search.render-CIqD-Kfu.js

js mos.org collected 2026-09-24 08:29:55 UTC 9,231 bytes, 2 lines download raw bytes

1import{r as m,p as d}from"./client-Ccjntm70.js";import{p as J}from"./parseArgs-DzaNEh_D.js";import{a as w,_ as K,r as O,c as C}from"./scrollHelpers-DOiNc8lH.js";import{j as s,a as N,c as X}from"./index-BkphYt3n.js";import"./vendor-WXjio88j.js";import{t as T,_ as W,p as H,R as Q,P as U,d as Y,a as Z}from"./Pagination-DCYmCHBx.js";/* empty css                 */import{a as S,b as ee,M as te,u as se,S as re}from"./MultiSelect-DknH3nlv.js";import{f as ae}from"./flatten-sSSDJdNq.js";import{f as E,p as $}from"./propEq-C-SE6J_F.js";import{a as k}from"./_isArrayLike-BIfcrEEP.js";import{d as ne,a as q,b as le,p as g,g as ie}from"./sortBy-DOCck7E5.js";import{_ as oe,k as ce}from"./reject-C7pH2NM0.js";import{L as ue}from"./LoadingIcon-5S-pTC9W.js";import{u as de}from"./uniqueId-DNZ-u8Kr.js";var I=w(function(e,t){return e===1?k(t):K(e,ne(e,[],t))}),pe=w(function(e,t){if(e===t)return t;function a(h,u){if(h>u!=u>h)return u>h?u:h}var l=a(e,t);if(l!==void 0)return l;var o=a(typeof e,typeof t);if(o!==void 0)return o===typeof e?e:t;var i=T(e),c=a(i,T(t));return c!==void 0&&c===i?e:t}),he=function(){function r(e,t){this.xf=t,this.f=e}return r.prototype["@@transducer/init"]=q.init,r.prototype["@@transducer/result"]=q.result,r.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},r}(),me=function(e){return function(t){return new he(e,t)}},D=w(le(["fantasy-land/map","map"],me,function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return I(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return oe(function(a,l){return a[l]=e(t[l]),a},{},ce(t));default:return W(e,t)}})),fe=w(function(e,t){return D(g(e),t)}),xe=k(function(e){return I(O(pe,0,fe("length",e)),function(){for(var t=0,a=e.length;t<a;){if(!e[t].apply(this,arguments))return!1;t+=1}return!0})});function ye(r){var e=Object.prototype.toString.call(r);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"}var ge=w(function(e,t){return I(e+1,function(){var a=arguments[e];if(a!=null&&ye(a[t]))return a[t].apply(a,Array.prototype.slice.call(arguments,0,e));throw new TypeError(T(a)+' does not have a method named "'+t+'"')})}),je=ge(1,"split"),_=`	
2\v\f\r                 \u2028\u2029\uFEFF`,ve="​",be=typeof String.prototype.trim=="function",_e=!be||_.trim()||!ve.trim()?k(function(e){var t=new RegExp("^["+_+"]["+_+"]*"),a=new RegExp("["+_+"]["+_+"]*$");return e.replace(t,"").replace(a,"")}):k(function(e){return e.trim()});const M=()=>{const{facetGroups:r,handlers:e,searchState:t,dictionary:a}=m.useContext(S),{appliedFacets:l}=t,{clearFacet:o,clearAllFacets:i}=e,{clear_all:c,clear:h}=a.facets,u=(n,p)=>{if(!r)return;const f=C(ae,O((j,x)=>[...j,x.facets],[]))(r);return C(g("name"),E(xe([$(n,"id"),$(p,"parentGroupAlias")])))(f)};return s.jsx("div",{className:"selected-filters",children:l&&l.length>0?s.jsxs("div",{className:"selected-filters__wrapper",children:[s.jsx("div",{className:"selected-filters__group",children:l.map(n=>s.jsx("button",{type:"button",className:"btn btn--pill",onClick:()=>o(n),"aria-label":`${h} ${n.name} Filter`,children:(n==null?void 0:n.name)||u(n.id,n.parentGroupAlias)},n.id))}),s.jsx("button",{type:"button",className:"btn btn--clear select-filters__clear",onClick:i,"aria-label":c,children:s.jsx("span",{children:c})})]}):null})},Ne={},R=r=>{const{searchState:e,handlers:t,dictionary:a}=m.useContext(S),{handleKeywordChange:l}=t,o=m.useRef(),i=`${m.useId()}-keyword`,[c,h]=m.useState(r.defaultValue&&r.defaultValue!==""),{placeholder:u,clear:n,submit:p}=a.keyword,f=v=>{v.preventDefault(),l(o.current.value)},j=()=>{o.current.value="",o.current.focus()},x=v=>{h(v.target.value!=="")};return s.jsx("div",{children:s.jsxs("form",{className:"keyword",action:"/search",role:"search",onSubmit:f,children:[s.jsx("label",{htmlFor:i,className:"visually-hidden",children:u}),s.jsxs("div",{className:"keyword__input-wrap",style:{overflow:"hidden"},children:[s.jsx("input",{ref:o,type:"search",className:"keyword__input",placeholder:u,name:"q",id:i,defaultValue:e.query,onChange:x,onBlur:x}),s.jsx("button",{type:"button",className:N("keyword__clear",{"slide-in-bottom":c,"slide-out-top":!c}),"aria-hidden":!c,tabIndex:c?0:-1,"aria-label":n,onClick:j})]}),s.jsx("button",{type:"submit",className:"keyword__submit btn btn--primary btn--fw",children:s.jsx("span",{children:p})})]})})};R.defaultProps={defaultValue:""};R.propTypes=Ne;const we={itemToString:d.func.isRequired,items:d.arrayOf(d.object).isRequired,label:d.string,placeholder:d.string,handleChange:d.func,defaultValue:d.object,getIsSelected:d.func,className:d.string,
2showSelectedInPlaceholder:d.bool},Se={placeholder:"Select",label:"Select Option"},A=({itemToString:r,items:e,label:t,placeholder:a,handleChange:l,defaultValue:o,getIsSelected:i,className:c,showSelectedInPlaceholder:h})=>{const u=m.useId(),[n,p]=m.useState(o),{isOpen:f,getToggleButtonProps:j,getLabelProps:x,getMenuProps:v,highlightedIndex:G,getItemProps:z}=ee({items:e,itemToString:r,selectedItem:n,onSelectedItemChange:({selectedItem:y})=>{l(y.identifier),p(y)}});return s.jsxs("div",{className:N("select",c),children:[s.jsxs("div",{children:[s.jsx("label",{className:"visually-hidden",...x(),children:t}),s.jsxs("div",{className:"select__toggle",...j(),children:[h?s.jsx("span",{children:n==null?void 0:n.label}):s.jsx("span",{children:a}),s.jsx("span",{className:N("select__icon icon--down-chevron",{"is-open":f})})]})]}),s.jsx("div",{className:N("select__dropdown",{"is-visible":f}),children:s.jsx("ul",{className:"select__options",...v(),children:e&&e.map((y,b)=>s.jsxs("li",{className:N("select__option",G===b&&"is-highlighted",n===y&&"is-selected"),...z({item:y,index:b}),children:[s.jsx("input",{id:`${u}-opt-${b}`,className:"checkbox",type:"checkbox",checked:i(y),readOnly:!0}),s.jsx("label",{htmlFor:`${u}-opt-${b}`,children:r(y)})]},`${JSON.stringify(y)}-${b}`))})})]})};A.propTypes=we;A.defaultProps=Se;const Ce={},L=()=>{const{sorters:r,handlers:e,dictionary:t,searchState:a}=m.useContext(S),{handleSortChange:l}=e,{label:o}=t.sort;return r?s.jsx("div",{className:"sort",children:s.jsx(A,{items:r,itemToString:g("label"),handleChange:i=>l(i),getIsSelected:$(a==null?void 0:a.sortBy,"identifier"),getText:g("label"),getValue:g("identifier"),defaultValue:E($(a==null?void 0:a.sortBy,"identifier"))(r),placeholder:o,showSelectedInPlaceholder:!1,className:"select--inline"})}):!1};L.propTypes=Ce;const $e={...H,id:d.string.isRequired,isLoading:d.bool,keyword:d.string},ke={id:"result-info"},F=()=>{const{searchState:r,pager:e,status:t,dictionary:a}=m.useContext(S);if(!e)return!1;const{result_info:l}=a,{current_page:o,total_results:i,items_per_page:c}=e,[h,u,n,p]=C(D(_e),je("#"))(l),f=()=>{const j=o+1||1;if(!c||i<=c)return`${i}`;let x=j*c,v=x-c+1;return x>i&&(x=i),` ${v}–${x}`};return i>0?s.jsx("div",{role:"alert","aria-live":"polite",className:"results-info","aria-busy":t!=="idle",children:f&&`${h} ${f()} ${u} ${i} ${n} ${r!=null&&r.query?` ${p} "${r.query}"`:""}`}):null};F.defaultProps=ke;F.propTypes=$e;const B=({inlineStyle:r,showClearAll:e})=>{const{facetGroups:t,handlers:a,searchState:l,dictionary:o}=m.useContext(S),{appliedFacets:i}=l,{clearFacetGroup:c,handleFacetClick:h}=a,{facets:u}=o,n=m.useMemo(p=>C(ie(g("parentGroupAlias")))(i),[i]);if(t)return s.jsx("aside",{className:"facets",children:s.jsx("div",{className:"facet__groups",children:t==null?void 0:t.map((p,f)=>s.jsx(te,{index:f,length:t.length,itemToString:g("name"),items:p.facets,label:p.label,handleChange:h,getValue:g("id"),selectedItems:n[p.urlAlias]||[],id:p.id,handleClear:()=>c(p),clearTxt:u.clear,showClearAll:!1,className:"select--block"},JSON.stringify(p.id)))})})};B.propTypes={children:d.node,inline:d.bool,showClearAll:d.bool};B.defaultProps={inlineStyle:!1,showClearAll:!1};const V=r=>{const[e]=se(["(min-width: 1200px)"]),{perPage:t,title:a,dictionary:l,...o}=r;return s.jsx(re,{initialState:{results:null,status:"initializing",error:null,hasMore:!0,appliedFacets:[],facetGroups:[],page:0,query:"",sortBy:"relevance",perPage:Number(t)||10,pager:null,sorters:null},...o,dictionary:l,children:s.jsxs("div",{className:"container-fluid search theme theme--white",children:[s.jsx(ue,{}),s.jsx("div",{className:"row",children:s.jsx("div",{className:"col",children:s.jsx("div",{className:"container",children:s.jsx("div",{className:"row",children:s.jsxs("div",{className:"col",children:[s.jsxs("div",{className:"search__header",children:[s.jsxs("div",{className:"search__title",children:[a&&s.jsx("h1",{className:"heading-a-clamp",children:a}),s.jsx(F,{})]}),s.jsx("div",{className:"search__keyword",children:s.jsx(R,{})}),s.jsx(L,{})]}),s.jsxs("div",{className:"search__content",children:[s.jsxs("div",{className:"search__col",children:[!e&&s.jsx(M,{}),s.jsx(B,{})]}),s.jsxs("div",{className:"search__col",children:[e&&s.jsx(M,{}),s.jsx(Q,{}),s.jsx(U,{})]})]})]})})})})})]})})};V.defaultProps=Y;V.propTypes=Z;let P=null;const ze=r=>
2{const e=r.closest(".js-model").dataset,t=(r==null?void 0:r.id)||de("search-");P=X(P,r),P.render(m.createElement(V,{...J(e),uid:t,key:t}))};export{ze 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.