1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__||=[]).push([[4607],{69198(e,t,a){a.d(t,{Uk:()=>n,a7:()=>s});var n="sfVttMG0iKwNjrcW",s="COk0nKbbKQGHp4Sn"},67950(e,t,a){a.d(t,{v:()=>x});var n=a(3495),s=a(65993),l=a.n(s),r=a(66751),c=a(40765),o=a(30696),i=a(55729),u=a(6369),d=a(54685);const h={slot1:{kind:"icon",attrs:{name:"Search"}},slot2:{kind:"typography",attrs:{level:"BERLIN_2"}},slot3:{kind:"icon",attrs:{name:"Cross"}},slot4:{kind:"button",attrs:{buttonMode:"quaternary"}},slot6:{kind:"typography",attrs:{level:"BERLIN_1"}},slot9:{kind:"icon",attrs:{name:"MagicWand"}},slot10:{kind:"typography",attrs:{level:"MADRID_1"}},slot12:{kind:"icon",attrs:{name:"Loading"}}},p=({label:e,onClick:t,className:a})=>{const{slot3:s}=(0,u.H)(h);return(0,n.jsx)("button",{type:"button","aria-label":e,title:e,className:a,onClick:t,children:(0,n.jsx)(i.In,{...s.attrs,className:"OQXLnoh9lEBBK8_g"})})};var m=a(7117);const b=({className:e,id:t,inputRef:a,inputValue:s,label:r,placeholder:c,onChange:o})=>{const{slot2:i}=(0,u.H)(h),p=r||c||void 0;return(0,n.jsx)(m.o,{...i.attrs,component:"div",className:l()("DS13cC6SPbM_ArLw",e),children:(0,n.jsx)("input",{id:t,type:"search","aria-label":p,placeholder:c,className:d.fl,ref:a,value:s,onChange:o,autoFocus:!0})})},g=({className:e,inputRef:t,submitButtonLabel:a,clearButtonLabel:s,placeholder:m,inputValue:g,setInputValue:j,label:x,onChange:y,onClear:v,isLoading:N=!1})=>{const{slot1:f,slot4:k,slot12:C}=(0,u.H)(h),L=(0,c.jF)(t),B=(0,r.useCallback)(e=>{g&&t?.current&&("function"==typeof v&&v(e),j(""),t.current.focus())},[t,g,v,j]);return(0,n.jsxs)("div",{className:l()("bQWS41OZ100juhd6","OTVigRq5EFMZx3Df",e,{[d.VX]:L}),children:[(0,n.jsxs)("div",{className:"TdJPlkN_V_wpMZx_",children:[(0,n.jsx)("label",{htmlFor:"search-input",children:(0,n.jsx)(i.In,{className:"Yumw1cXKQ1Cib32p",...f.attrs})}),(0,n.jsx)(b,{id:"search-input",inputRef:t,inputValue:g,label:x,placeholder:m,onCh
1ange:e=>{j(e.target.value),"function"==typeof y&&y(e)}})]}),(0,n.jsxs)("div",{className:"PBMfelT5BxA2QhCG",children:[N?(0,n.jsx)(i.In,{...C.attrs,className:"yCthGBolf6Balan3"}):null,s?(0,n.jsx)(p,{label:s,onClick:B,className:g.length?void 0:"ceLUfTy3M2KTEXEc"}):null,a?(0,n.jsx)(o.$,{...k.attrs,type:"submit",label:a,"aria-disabled":0===g.trim().length}):null]})]})},j=({className:e,children:t})=>{const{slot6:a}=(0,u.H)(h);return(0,n.jsx)(m.o,{...a.attrs,component:"p","aria-live":"polite",className:l()("elGdbXM8ZcFu0oNO","aqmVAtouYrOs0KlD",e),children:t})},x=({onSubmit:e,className:t,inputRef:a,inputLabel:s,inputValue:r,setInputValue:c,placeholder:o,clearButtonLabel:i,onClear:u,submitButtonLabel:d,onInputChange:h,isLoading:p=!1,children:m})=>(0,n.jsxs)("form",{role:"search",className:l()("PDPPcbgOiA8zTnkE","WalnXNQTvgqdT1Fc","k7d5qM0zL92xUpKj",t),onSubmit:e,children:[(0,n.jsx)(g,{className:"J0tm21dseu4y20yE",inputRef:a,inputValue:r,setInputValue:c,label:s,placeholder:o,clearButtonLabel:i,submitButtonLabel:d,isLoading:p,onChange:h,onClear:u}),(0,n.jsx)(j,{children:m})]})},34235(e,t,a){a.r(t),a.d(t,{default:()=>q});var n=a(3495),s=a(43629),l=a(66751),r=a(70333),c=a(2740),o=a(86945),i=a(67950),u=a(54685),d=a(51057),h=a(2631),p=a.n(h),m=a(27742),b=a(54980);const g=({search:e})=>e.results,j=({search:e})=>e.lastSearch||"",x=({search:e})=>!e.hasResults,y=e=>x(e)?0:Object.entries(g(e)).reduce((e,[,t])=>t?.content?.items?e+t?.content?.items?.length:e,0),v=({search:e})=>!!e.failure,N=({search:{inProgress:e}})=>e;var f=a(96940),k=a(50969),C=a(25628),L=a(65993),B=a.n(L),I=a(7117),T=a(59224),S=a(70550),R=a(76024),_=a(54516),M=a(34053);const V=(0,l.memo)(({blockTemplateName:e=M.Q5.block,contentTemplateName:t=M.Q5.content,i18nKey:a,lastSearch:s,pagination:l,items:c=[],facet:o})=>{const{t:i}=(0,r.Bd)(),d=(0,_.$)(a,c),h=c.length;if(!h)return null;const p=R.r[e];return(0,n.jsxs)("section",{className:"H9Sy5z9qLYYanC8t",children:[(0,n.jsx)("div",{className:B()(u.kL,"Dt643QZ3Q1cRamPb"),children:(0,n.jsx)(I.o,{level:"OTTAWA_3",component:"h2",children:i(a,{number:h,count:h})})}),(0,n.jsx)(p,{id:a,contentTemplateId:t,items:d,ActionComponent:S.o,buildActionProps:T.zL,pagination:l,onSlide:e=>(e=>{const t=Math.round(e);(0,m.BI)({input:s,key:"searchResultBrowsing",progressBar:t,type:o})})(e)})]})});var A=a(26666);const O=[],D={},E=e=>`${e}${f.O5.frontspace}search`,K=(e,t,a)=>({blockTemplateName:p().get(a,`${e}.content.blockTemplateId`),contentTemplateName:p().get(a,`${e}.content.contentTemplateId`),facet:e,i18nKey:M.I0[e],lastSearch:t,pagination:p().get(a,`${e}.content.pagination`)||D,items:p().get(a,`${e}.content.items`)||O}),F=()=>{const e=(0,c.d4)(v),t=(0,c.d4)(x),a=(0,c.d4)(j),s=(0,c.d4)(y),{t:l}=(0,r.Bd)();if(!a)return(0,n.jsx)(n.Fragment,{children:l("search.minSearchMessage",{count:3})});let o;return o=e&&t?l("search.failure"):t?l("search.noResults"):l("search.resultCount",{count:s}),(0,n.jsx)(n.Fragment,{children:o})};var P=a(69198);const Q=({layout:e})=>{const{t}=(0,r.Bd)(),{hash:a}=(0,o.zy)(),s=(0,c.wA)(),h=(e=>{const t=(0,c.d4)(g),a=(0,c.d4)(j),s=(0,c.d4)(x),l=!a||s,r=(0,c.d4)(k.Sb);return l?e?(0,n.jsx)(C._,{blocks:e.blocks,layoutTheme:p().get(e,"layout.theme"),entityType:f.O5.frontspace,entityId:"search",transitionId:E}):null:r.filter(A.l).map(e=>(0,n.jsx)(V,{...K(e,a,t)},e))})(e),{sendEvent:y}=(0,l.useContext)(d.lo),v=(0,l.useRef)(null),{launchSearch:L}=(e=>{const t=(0,c.wA)(),a=(0,c.d4)(j);return{launchSearch:(0,l.useMemo)(()=>p().debounce(()=>{const n=e.current?.value||"";return 0===n.length?t((0,b.qp)()):n.length<3?a?t((0,b.qp)()):Promise.resolve():((0,m.BI)({key:"searchInput",input:n}),t((0,b.mU)({query:n,lastSearch:n,status:"search-keywords"})))},600),[t,e,a]),inputRef:e}})(v),B=(0,c.d4)(j),I=(0,c.d4)(N),T=a?decodeURI(a.substring(1)):B,[S,R]=(0,l.useState)(T),_=(0,l.useMemo)(()=>(e=>({inputLabel:e("search.a11y.classicInputLabel",{count:3}),placeholder:e("search.search"),clearButtonLabel:e("search.clearButton")}))(t),[t]),M=(0,l.useCallback)(e=>{e.preventDefault(),v?.current&&""===v.current.value.trim()||(s((0,b.Tg)(!0)),L())},[s,L]),O=(0,l.useCallback)(()=>{v?.current&&y({key:"searchTermDeleted",input:v.current.value.trim()}),L()},[L,y]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.v,{..._,className:u.kL,inputRef:v,inputValue:S,setInputValue:R,onInputChange:e=>{R(e.target.value),L()},isLoading:I,onClear:O,onSubmit:M,children:(0,n.jsx)(F,{})}),(0,n.jsx)("div",{className:P.a7,"aria-live":"polite",children:h})]})},q=({layout:e})=>(0,n.jsx)(s.c,{layout:e,navInFlow:!0,children:(0,n.jsx)("div",{className:P.Uk,children:(0,n.jsx)(Q,{layout:e})})})}}]); 2//# sourceMappingURL=sourcemaps/legacy-search-08f9104a48861113.bundle.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.