1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[230],{646:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/products/[index]",function(){return r(4380)}])},3539:function(e,t,r){"use strict";function s(e){var t=[];try{t=JSON.parse(e.productTypes).sort((function(e,t){return e.label<t.label?-1:e.label>t.label?1:0}))}catch(r){}return t}r.d(t,{Z:function(){return s}})},4380:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return C},default:function(){return F}});var s=r(5893),c=(r(9008),r(506)),o=r(1664),l=r.n(o),n=r(5675),i=r.n(n),a=r(5822);function d(e){var t=e.products,r=e.clearAll,c=e.prodRemove,o=e.typeId,n=[];for(var a in[0,1,2,3])n[a]=t[a];return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{"data-testid":"product-comparisons",className:"lexcms-product-comparisons",children:[n.map((function(e,t){return e?(0,s.jsxs)("div",{id:"compare-product-".concat(e.id),className:"lexcms-product-compare-slot",children:[(0,s.jsx)("button",{onClick:function(){c(e)},children:"X"}),(0,s.jsx)(i(),{priority:!0,src:e.image,height:65,width:65,alt:"",className:"lexcms-product-compare-thumbnail"}),(0,s.jsx)("span",{children:e.name})]},t):(0,s.jsx)("div",{className:"lexcms-product-compare-slot"},t)})),t&&t.length>1&&(0,s.jsx)(l(),{href:"/lex-cms/product-comparison/".concat(o,"?")+t.map((function(e,t){return"ids=".concat(e.id)})).join("&"),children:(0,s.jsxs)("a",{className:"lexcms-product-compare-trigger-compare-button",children:[(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1441.9 895.3",children:(0,s.jsx)("g",{fill:"#ffffff",children:(0,s.jsx)("path",{d:"m754 516q-54 0-105-32t-80-66t-83-104q-48-62-75-94t-78-77t-107-66t-122-21l-104 0l0 140l104 0q54 0 106 32t81 66t83 104q62 82 101 126t116 88t163 44l36 0l0 120l210-180l-210-180l0 100l-36 0z m-484-88q-74 78-166 78l-104 0l0 140l104 0q140 0 254-108q-14-16-37-45t-27-33q-8-12-24-32z m520-242l0 100l210-180l-210-180l0 120l-36 0q-140 0-260 116q46 58 72 92q0 2 6 9t8 11q84-88 174-88l36 0z"})})}),"Compare"]})}),r&&(0,s.jsx)("button",{onClick:r,className:"lexcms-product-compare-clear-all-button",children:"Clear All"})]})})}var u=r(857),p=r(8192),m=r(5273),h=r(5585),f=r(5921),x=r(7294),g=r(129),v=r.n(g),_=r(4947),j=(r(9275),r(5426)),b=r(9815),y=function(){var e;return window&&window.localStorage&&(e=window.localStorage.getItem("compared")),e?e.split(","):[]};function w(e,t){switch(t.type){case"addCompareProduct":return function(e){if(window&&window.localStorage){var t=y();t.push(e.id),window.localStorage.setItem("compared",t.join(","))}}(t.product),(0,b.Z)(e).concat([t.product]);case"prodRemove":return function(e){if(window&&window.localStorage){var t=y();t=t.filter((function(t){return e.id.toString()!==t})),window.localStorage.setItem("compared",t.join(","))}}(t.product),e.filter((function(e,r){return e.id!==t.product.id}));case"filterByCurrentProducts":return e.filter((function(e,r){return t.products.map((function(e,t){return e.id})).includes(e.id)}
1));case"clearAllComparisons":return window&&window.localStorage&&(y(),window.localStorage.setItem("compared",null)),[];default:throw new Error}}var N=r(3539);var C=!0,F=function(e){var t=e.products,r=e.rating_aggregation,o=e.compatible_product_name,l=e.accessory_product_name,n=e.collection_filters,i=e.attribute_filters,g=e.brand_filters,b=e.total_count,C=e.initialSearch,F=e.page_layout,S=e.favicon,q=e.stylesheet,P=e.cart_enabled,A=e.attribute_filters_position,R=e.enable_infinite_scroll_on_product_pages,Z=(0,x.useReducer)(w,[]),k=Z[0],O=Z[1],E=(0,x.useState)(!1),T=E[0],I=E[1],B=(0,x.useState)(!1),K=B[0],z=B[1],D=(0,x.useContext)(j.d),X=function(e){var t;if(e)return e["q[tags_id_eq]"]?null===(t=D.typeOptions)||void 0===t?void 0:t.find((function(t,r){return t.value.toString()===e["q[tags_id_eq]"].toString()})):""},H=function(e,t){I((function(e){return!0})),z(t),t||R&&D.setPage(1),fetch("/lex-api/products?"+v().stringify(e,{arrayFormat:"brackets",encode:!0})).then((function(e){return e.json()})).then((function(e){I((function(e){return!1})),R&&t?D.appendProducts(e.products):D.setItems(e.products),D.setTotalCount(e.total_count),D.setAttributeFilters(e.attribute_filters),D.setCollectionFilters(e.collection_filters),D.setRatingAggregation(e.rating_aggregation),D.setBrandFilters(e.brand_filters),e.product_type_filters&&D.setTypeOptions(e.product_type_filters),t||O({type:"filterByCurrentProducts",products:e.products})}))};return(0,x.useEffect)((function(){var s,c,o;!((null===D||void 0===D||null===(s=D.items)||void 0===s?void 0:s.length)>0)&&D.setItems(t),!((null===D||void 0===D?void 0:D.totalCount)>0)&&D.setTotalCount(b),!((null===D||void 0===D?void 0:D.attributeFilters.length)>0)&&D.setAttributeFilters(i||[]),!((null===D||void 0===D?void 0:D.typeOptions.length)>0)&&D.setTypeOptions((0,N.Z)(e)||[]),!((null===D||void 0===D||null===(c=D.collectionFilters)||void 0===c?void 0:c.length)>0)&&D.setCollectionFilters(n||[]),!((null===D||void 0===D||null===(o=D.brandFilters)||void 0===o?void 0:o.length)>0)&&D.setBrandFilters(g||[]),!(Object.keys((null===D||void 0===D?void 0:D.ratingAggregation)||{}).length>0)&&D.setRatingAggregation(r||{})}),[]),(0,x.useEffect)((function(){var e,t=y();null===(e=D.items)||void 0===e||e.filter((function(e){return t.includes(e.id.toString())})).forEach((function(e,t){O({type:"addCompareProduct",product:e})}))}),[]),(0,s.jsx)(c.Z,{title:"Product Search",page_layout:F,cart_enabled:P,favicon:S,stylesheet:q,children:(0,s.jsx)(f.Z,{initialSearch:C,search:H,children:function(e){var t,r,c;return(0,s.jsxs)("section",{className:"lexcms-product-search-page-container",children:[(0,s.jsxs)("section",{className:"lexcms-product-search-page-header-container",children:[(0,s.jsxs)("div",{className:"lexcms-page-body-header-text",children:[X(e.search)&&(0,s.jsx)("h1",{className:"lexcms-product-search-selected-product-type",children:X(e.search).label}),!X(e.search)&&!o&&!l&&(0,s.jsx)("h1",{className:"lexcms-product-search-selected-product-type",children:"All Products"}),o&&(0,s.jsx)("h1",{className:"lexcms-product-search-selected-product-type",children:"All Compatible Products"}),o&&(0,s.jsxs)("p",{className:"lexcms-product-search-refine-products-count",children:["Compatible with: ",(0,s.jsxs)("strong",{children:[o," "]})]}),l&&(0,s.jsx)("h1",{className:"lexcms-product-search-selected-product-type",children:"All Hardware & Accessories"}),l&&(0,s.jsxs)("p",{className:"lexcms-product-search-refine-products-count",children:["Accessory For: ",(0,s.jsxs)("strong",{children:[l," "]})]}),(0,s.jsxs)("p",{className:"lexcms-product-search-refine-products-count",children:["Refine ",D.totalCount," Products"]})]}),(0,s.jsxs)("div",{className:"lexcms-product-search-top-filter-container",children:[(0,s.jsxs)("div",{className:"lexcms-product-search-top-filters",children:[(0,s.jsx)(a.Z,{searchKey:"q[tags_id_eq]",className:"lexcms-product-search-top-product-type-filter",searchState:e,options:D.typeOptions,label:"Product Type Filter"}),D.showRatingFilter()&&(0,s.jsx)(a.Z,{searchKey:"q[product_rating_eq]",className:"lexcms-product-search-top-rating-filter",searchState:e,options:D._productRatingOptions(),label:"Rating Filter"}),(null===(t=D.collectionFilters)||void 0===t?void 0:t.length)>0&&(0,s.jsx)(a.Z,{searchKey:"q[collections_id_eq]",className:"lexcms-product-search-top-collections-filter",searchState:e,options:D.collectionFilters,label:"Collections Filter"}),(null===(r=D.brandFilters)||void 0===r?void 0:r.length)>0&&(0,s.jsx)(a.Z,{searchKey:"q[manufacturer_id_eq]",className:"lexcms-product-search-top-collections-filter",searchState:e,options:D.brandFilters,label:"Brands Filter"}),(0,s.jsx)("button",{onClick:function(){H({}),e.clearAll(),O({type:"clearAllComparisons"})},className:"lexcms-regular-button lexcms-product-search-clear-results-button",children:"Clear Results"})]}),(0,s.jsx)("div",{className:"lexcms-product-search-top-filter-pills-container",children:D.selectedAttributes(e.search).map((function(t,r){return(0,s.jsxs)("div",{className:"lexcms-product-search-top-filter-pill",children:[t.display_value,(0,s.jsx)("div",{onClick:function(){return e.removeFromValuesAtKey("q[has_attribute_values][]",t.id.toString())},className:"lexcms-product-search-top-filter-pill-close",children:"x"})]},r)}))})]})]}
1),!R&&(0,s.jsx)("div",{className:"lex-cms-pagination-top",children:D.totalCount>50&&(0,s.jsx)(u.Z,{itemsPerPage:50,pageRangeDisplayed:5,totalCount:D.totalCount,search:e})}),(0,s.jsxs)("section",{className:"lexcms-product-search-page-body-container",children:[(0,s.jsx)(m.Z,{attributeFiltersPosition:A,attributeFilters:D.attributeFilters,searchState:e}),(0,s.jsxs)("div",{className:"lexcms-product-tile-grid-container "+(D.attributeFilters.length>0?"lexcms-product-search-tile-grid-container-with-sidebar":"lexcms-product-search-tile-grid-container-no-sidebar"),children:[T&&(!R||!K)&&(0,s.jsx)(_.Z,{}),(null===(c=D.items)||void 0===c?void 0:c.length)<=0&&(0,s.jsxs)("div",{className:"lexcms-no-results-found-container",children:[(0,s.jsx)("div",{className:"lexcms-no-results-found-image"}),(0,s.jsx)("h2",{className:"lexcms-no-results-found-text",children:"No Results Found. Try Refining Your Search"})]}),D.items&&D.items.length>0&&D.items.map((function(t,r){return(0,s.jsx)(h.Z,{attributesApplied:D.attributesApplied,addCompareProduct:function(){return O({type:"addCompareProduct",product:t})},prodRemove:function(){return O({type:"prodRemove",product:t})},canCompare:!!X(e.search),isCompared:k.map((function(e,t){return e.id})).includes(t.id),product:t,compareProducts:k},t.id)}))]})]}),R?(0,s.jsx)(p.Z,{itemsPerPage:50,pageRangeDisplayed:5,totalCount:D.totalCount,loading:T,search:e}):(0,s.jsx)("div",{className:"lex-cms-pagination-bottom",children:D.totalCount>50&&(0,s.jsx)(u.Z,{itemsPerPage:50,pageRangeDisplayed:5,totalCount:D.totalCount,search:e})}),k.length>0&&X(e.search)&&(0,s.jsx)("div",{className:"lexcms-product-comparisons-container",children:(0,s.jsx)(d,{products:k,prodRemove:function(e){return O({type:"prodRemove",product:e})},typeId:X(e.search).value,clearAll:function(){return O({type:"clearAllComparisons"})}})})]})}})})}}},function(e){e.O(0,[996,675,608,793,322,585,219,774,888,179],(function(){return t=646,e(e.s=t);var t}));var t=e.O();_N_E=t}]); 2//# sourceMappingURL=[index]-a7f49a08dc6ebe4f.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.