1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[629],{60629:(e,l,t)=>{t.r(l),t.d(l,{default:()=>m});var r,a=t(6029),s=t(67549),n=t(71024),o=t.n(n),i=t(55729),c=t(60024),d=t(2910),u=t(99938),h=t(93398),b=t(8097),f=((r=f||{}).Retailer="retailer",r.NewFlyers="new-flyers",r);function x({retailerFlyers:e,newFlyers:l,retailerName:t}){let{t:r}=(0,s.md)(c.GS),n=e.length>0,[o,d]=(0,i.useState)(n?"retailer":"new-flyers"),u=(0,i.useRef)(null),f=n?[{type:"retailer",label:t??r("PRODUCTSFILTER_RETAILER_TITLE")},{type:"new-flyers",label:r("CROSSELL_NEW_FLYERS_FILTER")}]:null,p="retailer"===o?e:l,m=f?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)("div",{ref:u,className:"flex gap-2 overflow-x-auto scrollbar-hidden",children:f.map((e,l)=>(0,a.jsx)(h.A,{variant:o===e.type?"primary":"grayed",size:"md",className:"rounded-full shrink-0",onClick:()=>((e,l)=>{if(d(e),u.current){let e=u.current.querySelectorAll("button");e[l]&&e[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}})(e.type,l),children:e.label},e.type))})}):void 0;return(0,a.jsx)(b.A,{data:p,gridColumns:2,headerContent:m,headerContainerClassName:"justify-start",headerTextClassName:"text-lg font-bold",headerTextDataTestId:"viewer_cross_sell_header_is_desktop"})}let p=o()(()=>t.e(4385).then(t.bind(t,14385)),{loadableGenerated:{webpack:()=>[14385]},ssr:!1});function m({contentV2PublicationId:e,contentV2Publication:l}){let{retailer:t}=(0,s.md)(c.dn),{t:r}=(0,s.md)(c.GS),{crossellFlyers:n,crossellNewFlyers:o}=(0,s.md)(c.tS),h=(0,i.useRef)(null),[b,f]=(0,i.useState)(!1),[w,v]=(0,i.useState)(!0),y=(0,i.useCallback)(()=>{let e=h.current;e&&(f(e.scrollTop>0),v(e.scrollTop+e.clientHeight<e.scrollHeight-1))},[]),C=(0,i.useCallback)(e=>{h.current?.scrollBy({top:"down"===e?400:-400,behavior:"smooth"})},[]);return(0,a.jsxs)("div",{className:"flex h-full",children:[(0,a.jsxs)("div",{className:"w-full relative bg-neutral-extralight-base desktop:w-[calc(100%-384px)]",children:[(0,a.jsx)("div",{ref:h,className:"h-full overflow-auto",onScroll:y,children:(0,a.jsx)(p,{publicationId:e,publication:l})}),b&&(0,a.jsx)("button",{type:"button",onClick:()=>C("up"),className:"absolute top-2 left-1/2 -translate-x-1/2 z-10 flex rounded-full bg-neutral-extralight-base/80 w-12 h-12 items-center justify-center shadow-md hover:bg-neutral-extralight-base transition-colors","aria-label":r?.("ARIALABEL_SCROLL_UP")||"Scroll up",children:(0,a.jsx)(d.IconChevronUp,{size:u.I.L})}),w&&(0,a.jsx)("button",{type:"button",onClick:()=>C("down"),className:"absolute bottom-2 left-1/2 -translate-x-1/2 z-10 flex rounded-full bg-neutral-extralight-base/80 w-12 h-12 items-center justify-center shadow-md hover:bg-neutral-extralight-base transition-colors animate-flippScrollBounce","aria-label":r?.("ARIALABEL_SCROLL_DOWN")||"Scroll down",children:(0,a.jsx)(d.IconChevronDown,{size:u.I.L})})]}),(0,a.jsx)("div",{className:"hidden desktop:block w-[384px] relative",children:(0,a.jsx)(x,{retailerFlyers:n||[],newFlyers:o||[],retailerName:t?.name})})]})}}}]);
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.