import{r as o,_ as t,j as e,h as s,L as a}from"./react-B_SyE9nW.js";import{g as i,a as n,s as r,c as l,e as c,S as p,o as m,V as d,R as u,x as h,F as x,W as v,n as g,y as j,G as f}from"./index-Flm6m8Wj.js";import{E as b}from"./EnjotyNavIco-BWFv8fU-.js";import{U as y}from"./Url-C83vkALQ.js";import{A as w}from"./ActivityIco-COZM1sRH.js";import{P as N}from"./ProfileIco-DxJkB7_v.js";import{P as S}from"./PublishIco-BCc4bLWD.js";import{S as C}from"./SearchIco-DT1PnKLK.js";import{P as M}from"./PublishContext-DeaOYrx6.js";import{P as B}from"./PublishRedirect-D5jUBP0T.js";import{_ as L}from"./history-CBi_mSPs.js";import{B as R,P}from"./index-C6Ujt1Uk.js";import{B as k}from"./Badge-CCxj2pVR.js";import"./styled-components-D7wwngcN.js";import"./sentry-Br0bWdGN.js";import"./BusinessReviewStore-DfTzlAZI.js";import"./CoreServices-DM9GVdcj.js";import"./index-BQVK4Wpw.js";import"./usePreviousProps-GIwTB3Ki.js";function A(o){return i("MuiBottomNavigation",o)}n("MuiBottomNavigation",["root"]);const I=["children","className","component","onChange","showLabels","value"],F=r("div",{name:"MuiBottomNavigation",slot:"Root",overridesResolver:(o,t)=>t.root})((({theme:o})=>({display:"flex",justifyContent:"center",height:56,backgroundColor:(o.vars||o).palette.background.paper}))),D=o.forwardRef((function(a,i){const n=l({props:a,name:"MuiBottomNavigation"}),{children:r,className:p,component:m="div",onChange:d,showLabels:u=!1,value:h}=n,x=t(n,I),v=L({},n,{component:m,showLabels:u}),g=(o=>{const{classes:t}=o;return c({root:["root"]},A,t)})(v);return e.jsx(F,L({as:m,className:s(g.root,p),ref:i,ownerState:v},x,{children:o.Children.map(r,((t,e)=>{if(!o.isValidElement(t))return null;const s=void 0===t.props.value?e:t.props.value;return o.cloneElement(t,{selected:s===h,showLabel:void 0!==t.props.showLabel?t.props.showLabel:u,value:s,onChange:d})}))}))}));function E(o){return i("MuiBottomNavigationAction",o)}const T=n("MuiBottomNavigationAction",["root","iconOnly","selected","label"]),z=["className","icon","label","onChange","onClick","selected","showLabel","value"],H=r(R,{name:"MuiBottomNavigationAction",slot:"Root",overridesResolver:(o,t)=>{const{ownerState:e}=o;return[t.root,!e.showLabel&&!e.selected&&t.iconOnly]}})((({theme:o,ownerState:t})=>L({transition:o.transitions.create(["color","padding-top"],{duration:o.transitions.duration.short}),padding:"0px 12px",minWidth:80,maxWidth:168,color:(o.vars||o).palette.text.secondary,flexDirection:"column",flex:"1"},!t.showLabel&&!t.selected&&{paddingTop:14},!t.showLabel&&!t.selected&&!t.label&&{paddingTop:0},{[`&.${T.selected}`]:{color:(o.vars||o).palette.primary.main}}))),O=r("span",{name:"MuiBottomNavigationAction",slot:"Label",overridesResolver:(o,t)=>t.label})((({theme:o,ownerState:t})=>L({fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(12),opacity:1,transition:"font-size 0.2s, opacity 0.2s",transitionDelay:"0.1s"},!t.showLabel&&!t.selected&&{opacity:0,transitionDelay:"0s"},{[`&.${T.selected}`]:{fontSize:o.typography.pxToRem(14)}}))),U=o.forwardRef((function(o,a){const i=l({props:o,name:"MuiBottomNavigationAction"}),{className:n,icon:r,label:p,onChange:m,onClick:d,value:u}=i,h=t(i,z),x=i,v=(o=>{const{classes:t,showLabel:e,selected:s}=o;return c({root:["root",!e&&!s&&"iconOnly",s&&"selected"],label:["label",!e&&!s&&"iconOnly",s&&"selected"]},E,t)})(x);return e.jsxs(H,L({ref:a,className:s(v.root,n),focusRipple:!0,onClick:o=>{m&&m(o,u),d&&d(o)},ownerState:x},h,{children:[r,e.jsx(O,{className:v.label,ownerState:x,children:p})]}))}));function V(o){return e.jsx(p,{...o,children:e.jsx("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"})})}const W=m((function(){var t;const s=o.useContext(M),[a,i,n,r,l]=o.useMemo((()=>[String(d(u.Home)),String(d(u.Search)),String(d(u.Publish)),String(d(u.Activity)),String(d(u.MyProfile))]),[h.language]);return e.jsxs(D,{showLabels:!0,value:x.navigator,onChange:x.onChangeNavigator,className:"bottom-nav",children:[e.jsx(U,{"data-test":"enj-nav-button-home",value:v.HOME,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:a}),g("home")]}),icon:e.jsx(V,{}),onClick:()=>j.push(a)}),e.jsx(U,{"data-test":"enj-nav-button-explore",value:v.SEARCH,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:i}),g("explore")]}),icon:e.jsx(C,{}),onClick:()=>j.push(i)}),e.jsx(U,{"data-test":"enj-nav-button-publish",value:v.PUBLISH,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:n}),g("publish")]}),icon:e.jsx(S,{}),onClick:()=>{B(s)}}),e.jsx(U,{"data-test":"enj-nav-button-activity",value:v.ACTIVITY,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:r}),g("activity")]}),icon:e.jsx(w,{}),onClick:()=>j.push(r)}),e.jsx(U,{"data-test":"enj-nav-button-profile",value:v.PROFILE,label:e.jsxs(e.Fragment,{children:[e.jsx(y,{route:l}),g("profile")]}),icon:e.jsx(k,{sx:{"& .MuiBadge-badge":{right:f.isDesktop?"6px !important":"2px !important",top:"1px !important"}},color:"warning",variant:"dot",invisible:!(null==(t=x.getUser)?void 0:t.has_pending_notifications),children:e.jsx(N,{})}),onClick:()=>j.push(l)})]})})),_=r(P)`
  & .MuiBottomNavigation-root {
    align-self: center;

    .MuiBottomNavigationAction {
      &-root,
      &-root.Mui-selected {
        padding: 5px 4px 4px;
        min-width: max-content;
      }

      &-label {
        font-size: 12px;

        &.Mui-selected {
          font-weight: bold;
        }
      }

      transition: all 300ms ease-in;
    }
  }
`;const G=m((function(){const{isDesktop:t,sx:s}=o.useMemo((()=>{const o=f.isDesktop;let t={height:(o?82:66)+"px",overflow:"hidden",borderRadius:o?0:"24px 24px 0 0",position:"fixed",[o?"top":"bottom"]:0,left:0,right:0,visibility:x.showNavigator||o?"visible":"hidden",zIndex:5,"&.MuiPaper-root":{boxShadow:"0 3px 20px 0 rgba(0, 0, 0, 0.16)"},"& > a":{alignSelf:"center",width:"fit-content"}};return o&&(t={...t,display:"grid",gridTemplateColumns:"1fr 1fr",px:"138px","& .MuiBottomNavigationAction-root":{display:"flex",p:"5px 4px!important",flexDirection:"row","& .MuiSvgIcon-root":{mr:"5px"}}}),{isDesktop:o,sx:t}}),[f.isDesktop,x.showNavigator]);return!x.showNavigator||f.isMobile&&x.navigator===v.REGISTER?e.jsx(e.Fragment,{}):e.jsxs(_,{sx:s,elevation:4,className:"bottom-navbar-container",children:[t&&e.jsx(a,{href:d(u.Home),to:d(u.Home),"data-test":"enj-header-logo",children:e.jsx(b,{sx:{"&&.MuiSvgIcon-root":{height:"44px",width:"auto"}}})}),e.jsx(W,{})]})}));export{G as default};