PageSourceSearch

https://www.mandg.com/etc.clientlibs/mandg/clientlibs/clientlib-re…/chunks/519.1a6357c874c0e5685dad.chunk.js

js mandg.com collected 2026-09-24 08:56:09 UTC 11,534 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([[519],{9519:function(e,a,t){t.r(a),t.d(a,{default:function(){return b}});var l=t(4848),n=t(6540),r=t(4653),s=t(1231),i=t(8528),c=t(1449),o=t(7099),d=t(1256);const u=({tag:e,title:a,publication_date:t,custom_url:n,all_tags:r,catalogue_code:u,description:m,tagParent:h,typeLabel:p,codeLabel:g,codeColumnEnabled:x,tagColumnEnabled:v,currentPage:f,interactionId:b,rank:w,searchTerm:j,totalItems:y,filters:N,searchLocation:k})=>{var C,T,S,_;const P=((e,a,t)=>{if(!a)return[];const l=(e=>e?Array.isArray(e)?e:[e]:[])(e),n=`${a}`,r=e=>e.toLowerCase().replace(/[-_]/g," ").trim(),s=(e,a)=>{var t;for(const l of e){if(r(l.baseName)===r(a))return l.name;if(null===(t=l.children)||void 0===t?void 0:t.length){const e=s(l.children,a);if(e)return e}}};return l.filter(e=>e.startsWith(a)).map(e=>{const a=e.slice(n.length+1);return s(t,a)}).filter(Boolean)})(null==r?void 0:r.raw,h,N),L=P.length>0?P.join("|"):"",I="text-p2-xxs font-body-reg leading-p2 tracking-p2 !text-dark-grey-80",{attrs:$}=(0,s.Y)({componentId:null!=b?b:"",title:"Document Centre",description:"Document Centre Component",searchTerm:null!=j?j:"",currentPage:null!=f?f:"",fileUrl:null!==(C=null==n?void 0:n.raw)&&void 0!==C?C:"",itemTitle:null!==(T=null==a?void 0:a.raw)&&void 0!==T?T:"",clickType:"In Page Search - Manual Search",fileType:null!==(S=(0,o.Q)(n.raw))&&void 0!==S?S:"",searchRank:w+1,searchType:`In Page Search - Manual Search - ${k}`,totalResults:null!=y?y:"",publicationDate:null!==(_=null==t?void 0:t.raw)&&void 0!==_?_:"",key:`${null==n?void 0:n.raw}-${w}`,documentType:null!=L?L:"",overrideId:b});return(0,l.jsx)("a",Object.assign({href:n.raw,target:"_blank"},$,{rel:"noopener noreferrer",className:"group block h-max !text-dark-grey !no-underline hover:!text-dark-teal",onClick:()=>{var e,l,r,s,i,u;(0,c.T6)("document:SearchClick",{id:null!=b?b:"",title:"Document Centre",description:"Document Centre Component",searchTerm:null!=j?j:"",currentPage:null!=f?f:"",fileUrl:null!==(e=null==n?void 0:n.raw)&&void 0!==e?e:"",itemTitle:null!==(l=null==a?void 0:a.raw)&&void 0!==l?l:"",clickType:null!==(s=(0,d.q)(null!==(r=null==n?void 0:n.raw)&&void 0!==r?r:""))&&void 0!==s?s:"",fileType:null!==(i=(0,o.Q)(n.raw))&&void 0!==i?i:"",searchRank:w,searchType:`In Page Search - Manual Search - ${null!=k?k:""}`,totalResults:null!=y?y:"",publicationDate:null!==(u=null==t?void 0:t.raw)&&void 0!==u?u:"",documentType:null!=L?L:"",searchResultClickPosition:w})},children:(0,l.jsxs)("div",{className:"document-teaser flex flex-row gap-12 border-xs border-stone p-p16 hover:cursor-pointer hover:bg-stone-30 xs:flex-col xs:gap-8 lg:p-p24","data-cmp-id":b,children:[(0,l.jsxs)("div",{className:"flex shrink-0 grow-0 basis-[57%] flex-col gap-4 sm:basis-[52%]",children:[e&&(0,l.jsx)("div",{className:"w-max rounded-xs bg-stone-30",children:(0,l.jsx)("p",{className:"w-max px-p8 py-p2 text-p2 uppercase leading-p2 tracking-p2 !text-dark-grey",children:e.raw})}),a&&(0,l.jsx)("span",{className:"text-p1 font-body-mid leading-p1 tracking-p1 !text-inherit group-hover:!underline xs:leading-p3 lg:text-featured lg:leading-featured lg:tracking-featured",children:a.raw}),m&&(0,l.jsx)("p",{className:"mb-m12 text-p2 leading-p2 tracking-p2 !text-dark-grey lg:text-p1 lg:leading-p1 lg:tracking-p1",children:m.raw}),t&&(0,l.jsxs)("div",{className:"flex flex-row items-center",children:[(0,l.jsx)("span",{className:"icon-calendar size-12 min-h-12 min-w-12 !text-dark-teal"}),(0,l.jsxs)("p",{className:I,children:["Last updated: ",(0,i.Yq)(t.raw)]})]})]}),(0,l.jsxs)("div",{className:"flex basis-[43%] flex-row gap-4 sm:basis-[48%]",children:[P&&v&&(0,l.jsxs)("div",{className:"flex w-1/2 flex-col gap-4 xs:gap-0",children:[(0,l.jsx)("span",{className:`sm:hidden lg:hidden ${I}
1 !font-body-mid`,children:p}),null==P?void 0:P.map((e,a)=>(0,l.jsx)("span",{className:`${I} break-words`,children:e},`${e}-${a}`))]}),u&&x&&(0,l.jsxs)("div",{className:"flex w-1/2 flex-col gap-4 xs:gap-0",children:[(0,l.jsx)("span",{className:`sm:hidden lg:hidden ${I} !font-body-mid`,children:g}),(0,l.jsx)("span",{className:I,children:u.raw})]})]})]})}))},m=({content:e,data:a,currentPage:t,resultsId:n,searchQuery:r,filters:s})=>{const i="text-p2-xxs font-body-mid leading-p2 tracking-p2 !text-dark-grey-80";return(0,l.jsx)("div",{className:"pt-p8",children:a.results.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-row gap-12 border-b-sm border-dark-teal px-p24 pb-p8 pt-p0 xs:hidden sm:pl-p16",children:[(0,l.jsx)("div",{className:`shrink-0 grow-0 basis-[57%] ${i} sm:basis-[52%]`,children:e.mainColumnTitle}),(0,l.jsxs)("div",{className:"flex basis-[43%] flex-row gap-4 sm:basis-[48%]",children:[e.tagColumnEnabled&&(0,l.jsx)("div",{className:`w-1/2 ${i}`,children:e.tagColumnTitle}),e.catCodeColumnEnabled&&(0,l.jsx)("div",{className:`w-1/2 ${i}`,children:e.catCodeColumnTitle})]})]}),(0,l.jsx)("ul",{className:"document-list flex flex-col gap-4 pt-p8 ",children:a.results.map((i,c)=>{var o;return(0,l.jsx)("li",{children:(0,l.jsx)(u,{title:i.title,publication_date:i.publication_date,custom_url:i.custom_url,all_tags:i.all_tags,catalogue_code:i.catalogue_code,description:i.description,tagParent:e.tagColumnParentTag,typeLabel:e.tagColumnTitle,codeLabel:e.catCodeColumnTitle,codeColumnEnabled:e.catCodeColumnEnabled,tagColumnEnabled:e.tagColumnEnabled,currentPage:t,rank:(a.meta.page.current-1)*a.meta.page.size+c+1,interactionId:n,searchTerm:r,totalItems:a.meta.page.total_results,filters:s,searchLocation:null==e?void 0:e.searchLocationTag})},`${null===(o=i.custom_url)||void 0===o?void 0:o.raw}-${c}`)})})]}):(0,l.jsx)("div",{className:"pt-p16",children:(0,l.jsx)("span",{className:"text-featured font-body-mid leading-featured tracking-featured !text-dark-grey",children:e.noResultsLabel})})})};var h=t(6184),p=t(6527);const g=({title:e,description:a,imagePath:t,onSearch:r,searchPlaceholder:s,imageAltText:i})=>{const[c,o]=(0,n.useState)("");return(0,l.jsx)("div",{className:"herobannerteaser teaser",children:(0,l.jsxs)("div",{className:"cmp-teaser cmp-teaser--hero_banner_article",children:[(0,l.jsxs)("div",{className:"cmp-teaser__content xs:w-full",children:[(0,l.jsx)("h1",{className:"cmp-teaser__content",children:e}),(0,l.jsx)("div",{className:"cmp-teaser__description p-p0",children:(0,l.jsx)("p",{children:a})}),(0,l.jsx)("div",{className:"hero-search-container w-full",children:(0,l.jsx)(p.I,{enableAutoSuggest:!1,searchPhrase:c,setSearchPhrase:o,onSubmit:e=>{o(e),r(e)},isDocSearch:!0,placeholder:s})})]}),(0,l.jsx)("div",{className:"cmp-teaser__image",children:(0,l.jsx)("div",{className:"cmp-image-container",children:(0,l.jsx)("div",{className:"cmp-image-wrapper",children:(0,l.jsx)("div",{className:"cmp-image",children:(0,l.jsx)("img",{src:t,alt:i})})})})})]})})};var x=t(3370),v=t(3977);const f=()=>{var e;const{content:a}=(0,r.o)(),[t,i]=(0,n.useState)(window.location.search),[o,d]=(0,n.useState)(!1),[u,p]=(0,n.useState)(1),f=(0,n.useRef)(null),b=(0,n.useMemo)(()=>{if(!Array.isArray(a.filters))return[];const e=a=>{const t=new Set;return a.filter(e=>!t.has(e.value)&&(t.add(e.value),!0)).map(a=>Object.assign(Object.assign({},a),{children:a.children?e(a.children):[]}))};return a.filters.map(a=>Object.assign(Object.assign({},a),{children:a.children?e(a.children):[]}))},[a.filters]),w=(0,n.useMemo)(()=>{var e;return null!==(e=new URLSearchParams(t).get("q"))&&void 0!==e?e:""},[t]),j=(0,n.useMemo)(()=>{const e=new URLSearchParams(t).get("t");if(!e||!b.length)return[];const a=(e=>{const a=new Map,t=(e,l)=>{e.forEach(e=>{var n;(null===(n=e.children)||void 0===n?void 0:n.length)?t(e.children,l):a.set(e.value,l)})};return e.forEach(e=>{var a;t(null!==(a=e.children)&&void 0!==a?a:[],e.name)}),a})(b);return e.split(",").map(e=>{const t=a.get(e);return t?{value:e,group:t}:null}).filter(e=>null!==e)},[t,b]),y=a.documentCentreType&&"documentCentreType"!==a.documentCentreType,N=!!a.imagePath&&"imagePath"!==a.imagePath,k=(0,n.useMemo)(()=>
1{if((null==a?void 0:a.endpointBase)&&(null==a?void 0:a.engineName))return`${a.endpointBase}/api/as/v1/engines/${a.engineName}/search.json`},[a]),{data:C,isLoading:T,isFetching:S,isSuccess:_}=(0,h.ok)({url:k,keyword:w,page:u,searchKey:a.searchKey,siteId:a.siteId,documentCentreType:a.documentCentreType,documentTags:(()=>{const e=j.reduce((e,{value:a,group:t})=>(e[t]||(e[t]=[]),e[t].push(a),e),{});const a=Object.values(e).filter(e=>e.length>0).map(e=>({any:{all_tags:e}}));return a.length?{all:a}:void 0})(),sortOrder:"PUBLICATION_DATE"},{skip:!k||!a.siteId||!y}),P=null!==(e=null==C?void 0:C.meta.page.total_results)&&void 0!==e?e:0,L=null==a?void 0:a.id,{attrs:I}=(0,s.Y)({componentId:null!=L?L:"",title:"Document Search",key:"document-search",searchTerm:w||void 0,searchType:`In Page Search - Manual Search - ${null==a?void 0:a.searchLocationTag}`,searchResults:P,description:"Document Centre",overrideId:L});(0,n.useEffect)(()=>{var e;if(!w)return;if(S||!_)return;if(f.current===w)return;f.current=w;const t=P>0?"document:Search":"document:nullSearch";(0,c.T6)(t,{id:L,title:"Document Centre",description:"Document Centre Component",searchTerm:w,searchType:`In Page Search - Manual Search - ${null!==(e=null==a?void 0:a.searchLocationTag)&&void 0!==e?e:""}`,searchResults:P})},[w,P,S,_,L]);const $=(0,n.useRef)(null);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g,{title:a.title,description:a.description,imagePath:N?a.imagePath:"",onSearch:e=>{const a=new URLSearchParams(window.location.search);e&&e.trim()?a.set("q",e):a.delete("q");const t=a.toString()?`${window.location.pathname}?${a.toString()}`:window.location.pathname;window.history.replaceState({},"",t),i(window.location.search)},searchPlaceholder:a.searchBarPlaceholder,imageAltText:a.alt}),(0,l.jsxs)("div",{className:"mobile-filter-toggle light flex h-40 flex-row items-center justify-between py-p24 sm:hidden lg:hidden",children:[(0,l.jsx)("h3",{className:"mb-m0 !text-dark-grey",children:a.resultsTableTitle}),(0,l.jsx)("button",{type:"button","aria-label":o?a.hideFiltersLabel:a.showFiltersLabel,onClick:()=>d(e=>!e),children:(0,l.jsx)("span",{className:"size-12 min-h-12 min-w-12 !text-dark-teal "+(o?"icon-close":"icon-filter")})})]}),(0,l.jsxs)("div",{className:"light flex flex-row gap-8 pt-p32 xs:pt-p0",children:[(0,l.jsx)("div",{className:"basis-1/3 xs:basis-full "+(o?"":"xs:hidden"),children:(0,l.jsx)(v.C,{activeLabel:a.activeFiltersLabel,clearLabel:a.clearAllLabel,filterValues:b,onFilterChange:e=>{const a=new URLSearchParams(window.location.search);e.length?a.set("t",e.map(e=>e.value).join(",")):a.delete("t");const t=a.toString()?`${window.location.pathname}?${a.toString()}`:window.location.pathname;window.history.replaceState({},"",t),i(window.location.search)},selectedTags:j})}),(0,l.jsxs)("div",Object.assign({className:"basis-2/3 pb-p32 xs:basis-full "+(o?"xs:hidden":"")},I,{ref:$,children:[(0,l.jsx)("h3",{className:"mb-m0 border-b-lg border-dark-teal pb-p12 pt-p8 !text-dark-grey xs:hidden sm:pb-[9px] sm:pt-p16",children:a.resultsTableTitle}),C&&!T&&(0,l.jsx)(m,{content:a,data:C,currentPage:C.meta.page.current,resultsId:L,searchQuery:w,filters:b}),C&&C.meta.page.total_pages>1?(0,l.jsx)("div",{className:"py-p32 sm:py-p24",children:(0,l.jsx)(x.d,{totalPages:C.meta.page.total_pages,currentPage:C.meta.page.current,parentId:L,onPageChange:e=>{var a;p(e),null===(a=$.current)||void 0===a||a.scrollIntoView({behavior:"smooth",block:"start"})}})}):null]}))]})]})};function b(){return(0,l.jsx)(f,{})}}}]);

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.