1"use strict";(self.webpackChunksmartfire=self.webpackChunksmartfire||[]).push([[6372],{87085(e,t,n){n.d(t,["FO",0,(e,t)=>{const n=new URLSearchParams(window.location.search),o=n.get("filters");let a=o?o.split(","):[];return t?a=a.filter(t=>parseInt(t)!==e):a.includes(e.toString())||a.push(e),n.set("filters",a),0===a.length&&n.delete("filters"),n.has("page")&&n.delete("page"),n.toString()?"".concat(window.location.pathname,"?").concat(n):window.location.pathname},"ot",0,()=>{document.dispatchEvent(new CustomEvent("onSbmArchiveProductCloseFiltersPannel",{detail:!1}))},"uI",0,e=>{document.dispatchEvent(new CustomEvent("onSbmArchiveProductTotal",{detail:{total:e}}))}])},45408(e,t,n){n.r(t),n.d(t,{default:()=>f});var o=n(89379),a=n(5544),r=n(74888),i=n(19508),l=n.n(i),s=n(41594),c=n(81093),d=n(96394),u=n(31083),b=n(87085);const p={desktopBreakpoint:"1200px",tabletBreakpoint:"992px",mobileBreakpoint:"767px",darkerGreen:"#11391c",darkGreen0:"#146432",darkGreen:"#165227",green:"#06ae5c",green1:"#09a255",lightGreen:"#afc620",darkBrown:"#895f4e",brown:"#996b59",darkBeige:"#e0c6a2",beige:"#eddeca",mediumBeige:"#f4efe9",lightBeige:"#f5f4ef",winter:"#7091ca",spring:"#f0858d",springHover:"#ea6c75",summer:"#ffb100",summerHover:"#ffa700",autumn:"#f75013",autumnHover:"#e0360e",winterHover:"#4f70a8",seasonColor:"var(--seasonColorRoot, #f0858d)",seasonColorHover:"var(--seasonColorHoverRoot, #ea6c75)",biogentsBlue:"#208bec","content-width":"block_content-width__pU305","sbm-list":"block_sbm-list__12ZsM","overflow-without-scrollbar":"block_overflow-without-scrollbar__+cFio","exceeding-overflow-list":"block_exceeding-overflow-list__rp2j4","full-width":"block_full-width__9L41s",productBuyStickyButtonArea:"block_productBuyStickyButtonArea__RxPLv",block:"block_block__mKZiU",listing:"block_listing__pqL2y"};var h=n(70579);const f=(0,r.defineBlock)({Block:e=>{let t=e.initialProducts,n=e.initialPage,i=e.initialNbProducts,f=e.initialFilters,m=e.initialUniverse,g=void 0===m?null:m,k=e.perPage,v=e.buyWithAmazon,w=void 0!==v&&v;const _=(0,d.QJ)(f).selectedFilters,y=(0,s.useState)(t),B=(0,a.A)(y,2),S=B[0],j=B[1],P=(0,s.useState)(n),O=(0,a.A)(P,2),x=O[0],A=O[1],C=(0,s.use
1State)(i),E=(0,a.A)(C,2),L=E[0],R=E[1],F=(0,s.useRef)(!1),H=Math.ceil(L/k),U=(0,s.useState)(!1),N=(0,a.A)(U,2),G=N[0],W=N[1],I=[...Array(k).keys()],T=(0,s.useCallback)((e,t,n)=>{const o=new URLSearchParams(window.location.search);o.set("page",t.toString());let a=0;Object.values(e).forEach(e=>{a+=Object.keys(e).length});let r="";if(Object.values(e).forEach(e=>{const t=Object.keys(e);r+=t.join(","),t.length>0&&(r+=",")}),r=r.substring(0,r.length-1),0===a)o.delete("filters");else{const e=o.get("filters"),t=e?e.split(","):[],a=r?r.split(","):[];(0,u.kd)(t,a)||n(1),o.set("filters",r)}window.history.replaceState({},"","".concat(window.location.pathname,"?").concat(o))},[]);return(0,s.useEffect)(()=>{if(!F.current)return void(F.current=!0);W(!0),T(_,x,A);let e=(0,o.A)({page:x,per_page:k,orderby:"menu_order",order:"asc"},g&&{product_universe:g});Object.keys(_).forEach(t=>{const n=_[t];Object.values(n).length>0&&(e[t]=Object.keys(n))}),e=new URLSearchParams(e).toString(),l()({path:"/wp/v2/product?"+e,parse:!1}).then(e=>{e.json().then(e=>j((e=>e.map(e=>{var t,n,o;return{id:e.id,brand:e.sbm_data.brand,link:e.link,title:null!==(t=e.title.rendered)&&void 0!==t?t:"",image:e.sbm_data.image,enableBuyOnline:null!==(n=e.sbm_data.enableBuyOnline)&&void 0!==n&&n,buyOnlineLink:null!==(o=e.sbm_data.buyOnlineLink)&&void 0!==o?o:[]}}))(e)));const t=e.headers.get("X-WP-Total");R(t),(0,b.uI)(t)}).catch(e=>{console.warn("apiFetch error: /wp/v2/product",e)}).finally(()=>W(!1))},[_,x,k,g,T]),(0,s.useEffect)(()=>{F&&window.scrollTo({top:0,behavior:"smooth"})},[x]),(0,h.jsxs)(r.BlockWrapper.Div,{className:p.block,children:[S.length>0&&(0,h.jsx)("div",{className:p.listing,children:G?I.map(e=>(0,h.jsx)("div",{className:p.postSkeleton,children:(0,h.jsx)(c.uv,{})},e)):S.map((e,t)=>(0,h.jsx)(c.Yt,{product:e,className:p.product,buyWithAmazon:w},"".concat(e.id,"-").concat(t)))}),H>1&&(0,h.jsx)(c.dK,{currentPagination:x,numberOfPages:H,setCurrentPage:A})]})}})}}]); 2//# sourceMappingURL=block-archive-product---listing.c631419a.chunk.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.