"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6700],{3194:function(e,n,t){t.d(n,{Z:function(){return NavbarLinks_NavbarLinks}});var r=t(3067),i=t(4235),o=t(3339),a=t(6355),s=t(4194),l=t(6652),c=t(9009),u=t(2614),d=t(3412),f=t(31),b=t(4018),p=t(6422),v=t(1549),RegionButton_RegionButton=function(e){var{icon:n,label:t}=e,{openModal:r,openPopover:i}=(0,l.l8)(),{city:o,postalCode:a}=(0,f.kP)(),{isValidationComplete:j}=(0,p.g)(),g=(0,s.useRef)(null),h=!!(null!==d.session&&void 0!==d.session&&d.session.postalCode)&&a===d.session.postalCode||!a&&!d.deliveryPromise.mandatory;return(0,s.useEffect)(()=>{d.deliveryPromise.enabled&&j&&j&&h&&g.current&&i({isOpen:!0,triggerRef:g})},[j]),(0,v.jsx)(c.Z,{variant:"tertiary",size:"small",icon:(0,v.jsx)(u.Z,{name:n,width:18,height:18,weight:"bold"}),iconPosition:"left",onClick:r,ref:g,children:o&&a?"".concat((0,b._W)(o),", ").concat(a):t})},j=t(2011),RegionFilterButton_RegionFilterButton=function(e){var n,{filterByPickupPoint:{label:t,icon:{icon:r,alt:i}={}}={}}=e,{openRegionSlider:o}=(0,l.l8)(),{globalPickupPoint:a}=(0,j.z0)(),d=(0,s.useRef)(null);return(0,v.jsx)(c.Z,{variant:"tertiary",size:"small",icon:(0,v.jsx)(u.Z,{name:r,width:18,height:18,weight:"bold","aria-label":i}),iconPosition:"left",onClick:()=>o(l.gK.globalChangePickupPoint),ref:d,children:null!==(n=null==a?void 0:a.name)&&void 0!==n?n:t})},g=t(7345),h=t(9746),k=t(3303),y=["links","onClickLink","region"];function ownKeys(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function _objectSpread(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ownKeys(Object(t),!0).forEach(function(n){(0,r.Z)(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var NavbarLinks_NavbarLinks=function(e){var{links:n,onClickLink:t,region:{icon:r,label:s,shouldDisplayRegion:l}}=e,c=(0,i.Z)(e,y),{NavbarLinks:u,NavbarLinksList:d}=(0,h.r3)(),b=(0,o.useRouter)(),{postalCode:p}=(0,f.kP)(),{deliveryPromise:{filterByPickupPoint:P}={}}=(0,k.T)(),{isEnabled:m}=(0,j.z0)(),O=m&&!!p&&(null==P?void 0:P.enabled);return(0,v.jsx)(u.Component,_objectSpread(_objectSpread(_objectSpread({},c),u.props),{},{children:(0,v.jsxs)("div",{"data-fs-navbar-links-wrapper":!0,"data-fs-content":"navbar",children:[l&&(0,v.jsx)(RegionButton_RegionButton,{icon:r,label:s}),O&&(0,v.jsx)(RegionFilterButton_RegionFilterButton,{filterByPickupPoint:P}),(0,v.jsx)(d.Component,_objectSpread(_objectSpread({},d.props),{},{children:n.map(e=>{var{url:n,text:r}=e;return(0,v.jsx)(a.Z,{children:(0,v.jsx)(g.Z,{variant:"display",href:b.asPath.includes(n)?"#":n,prefetch:!1,onClick:t,children:r})},r)})}))]})}))}},6700:function(e,n,t){t.r(n),t.d(n,{default:function(){return r.Z}});var r=t(3194)},6355:function(e,n,t){var r=t(4194);let i=(0,r.forwardRef)(function({children:e,testId:n="fs-navbar-links-list-item",...t},i){return r.createElement("li",{"data-fs-navbar-links-list-item":!0,ref:i,"data-testid":n,...t},e)});n.Z=i}}]);