import{j as e,as as O,L as g}from"./main-ac2fa4b1.js";import{r as f}from"./chunk-react-162a731f.js";import{m as C,f as T,ak as F,B as N,ar as q,b1 as w,ac as V,at as W,au as K,ab as $,aL as Q,ae as U,aI as G,af as J}from"./chunk-material-ui-42c43899.js";import{c as y}from"./chunk-index-89b7ba38.js";import{i}from"./chunk-styled-bfd8e494.js";import{r as c}from"./chunk-createSvgIcon-288b305d.js";const M=C(o=>({navigation:{position:"relative",width:"100%"},menuBtn:{position:"relative",zIndex:o.zIndex.modal,backgroundColor:"#F0F3F6",color:o.color.black100,fontSize:o.typography.pxToRem(16),padding:"14px 16px",justifyContent:"space-between","&:active, &:hover":{backgroundColor:"#E0E3E6",color:o.color.black100}},menuListWrapper:{width:"100%",zIndex:o.zIndex.drawer},menuListContainer:{borderRadius:16,paddingTop:40,borderLeft:"1px solid rgba(0, 16, 61, 0.16)",borderRight:"1px solid rgba(0, 16, 61, 0.16)",borderBottom:"1px solid rgba(0, 16, 61, 0.16)"},menuListPadding:{padding:"8px 8px"},menuListItem:{padding:"0 8px",borderRadius:16,minHeight:48,"& > *":{paddingRight:16}},menuListItemActive:{backgroundColor:"#F3F4F5",marginBlock:4},menuBtnDescription:{display:"flex",alignItems:"center","& > *":{paddingRight:16}}}),{name:"MobilePersonalMenu"});var b={},X=i;Object.defineProperty(b,"__esModule",{value:!0});var S=b.default=void 0,Y=X(c()),Z=e;S=b.default=(0,Y.default)((0,Z.jsx)("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home");var h={},ee=i;Object.defineProperty(h,"__esModule",{value:!0});var B=h.default=void 0,oe=ee(c()),te=e;B=h.default=(0,oe.default)((0,te.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"}),"History");var j={},ae=i;Object.defineProperty(j,"__esModule",{value:!0});var A=j.default=void 0,re=ae(c()),se=e;A=j.default=(0,re.default)((0,se.jsx)("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"}),"FavoriteBorder");var _={},le=i;Object.defineProperty(_,"__esModule",{value:!0});var E=_.default=void 0,ne=le(c()),ie=e;E=_.default=(0,ne.default)((0,ie.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6m0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20"}),"AccountCircle");var I={},ce=i;Object.defineProperty(I,"__esModule",{value:!0});var D=I.default=void 0,ue=ce(c()),de=e;D=I.default=(0,ue.default)((0,de.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H6l-2 2V4h16z"}),"ChatBubbleOutline");var k={},pe=i;Object.defineProperty(k,"__esModule",{value:!0});var H=k.default=void 0,ve=pe(c()),me=e;H=k.default=(0,ve.default)((0,me.jsx)("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-1 9H9V9h10zm-4 4H9v-2h6zm4-8H9V5h10z"}),"LibraryBooks");var L={},fe=i;Object.defineProperty(L,"__esModule",{value:!0});var z=L.default=void 0,xe=fe(c()),ge=e;z=L.default=(0,xe.default)((0,ge.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16"}),"MonetizationOn");const P={Главная:e.jsx(S,{}),"Рстория заказов":e.jsx(B,{}),"Рзбранные товары":e.jsx(A,{}),"Личные данные":e.jsx(E,{}),Обращения:e.jsx(D,{}),"Адресная РєРЅРёРіР°":e.jsx(H,{}),Бонусы:e.jsx(z,{})},x=o=>o.replace(/\/$/,""),R=({LINK:o,onClick:t,PARAMS:u,NAME:l})=>{const a=M(),d=o===x(location.pathname);return e.jsxs($,{component:g,to:o,onClick:t,classes:{root:y(a.menuListItem,{[a.menuListItemActive]:d})},children:[P[l],l]})},Re=({menuLinks:o=[]})=>{const t=M(),u=f.useRef(null),[l,a]=f.useState(null),[d]=O();if(o.length===0)return e.jsx("div",{});const r=v=>{a(v.currentTarget)},p=()=>{a(null)},s=o.find(v=>x(v.LINK)===x(location.pathname)),m=[{NAME:"Бонусы",LINK:"/personal/bonuses"}];return e.jsxs("div",{className:t.navigation,ref:u,children:[e.jsx(T,{ref:u,fullWidth:!0,"aria-controls":"simple-menu","aria-haspopup":"true",variant:"contained",classes:{root:t.menuBtn},onClick:r,endIcon:e.jsx(F,{color:"primary"}),children:e.jsxs(N,{className:t.menuBtnDescription,children:[P[s==null?void 0:s.NAME],s==null?void 0:s.NAME]})}),e.jsx(q,{open:!!l,anchorEl:l,transition:!0,disablePortal:!0,modifiers:{offset:{enabled:!0,offset:"0, -40px"}},className:t.menuListWrapper,placement:"top-start",children:({TransitionProps:v})=>e.jsx(w,{...v,style:{transformOrigin:"left top"},timeout:350,children:e.jsx(V,{classes:{root:t.menuListContainer},elevation:0,children:e.jsx(W,{onClickAway:p,children:e.jsxs(K,{classes:{padding:t.menuListPadding},autoFocusItem:!!u.current,id:"menu-list-grow",children:[o.map(n=>e.jsx(R,{...n,onClick:p},n.NAME)),m.map(n=>e.jsx(R,{...n,onClick:p},n.NAME)),e.jsxs($,{component:g,to:"",onClick:n=>{n.preventDefault(),d()},classes:{root:t.menuListItem},children:[e.jsx(Q,{}),"Выйти"]})]})})})})})]})},be=C(o=>({listItemRoot:{padding:"12px 16px"},listItemDark:{borderRadius:16,"&:hover":{color:o.color.black0,backgroundColor:"#3A474E","& $textItemRoot":{color:o.color.black0},"& $iconStyle":{color:o.color.black0}}},listItemLight:{borderRadius:0,"&:hover":{color:o.color.black0,backgroundColor:"transparent","& $textItemRoot":{color:o.color.blue}}},activeLinkDark:{marginBlock:4,color:o.color.black0,backgroundColor:"#3A474E","& $textItemRoot":{color:o.color.black0},"& $iconStyle":{color:o.color.black0}},activeLinkLight:{color:o.color.blue,backgroundColor:"transparent","& $textItemRoot":{color:o.color.blue}},textItemRoot:{color:o.color.black100},iconStyle:{color:"#3A474E"}}),{name:"TMenuListItem"}),Ce=({active:o,icon:t,to:u,primary:l,variant:a,component:d})=>{const r=be(),p=y([r.listItemRoot,{[r.activeLinkDark]:a!=="light"&&o,[r.activeLinkLight]:a==="light"&&o},a==="light"?r.listItemLight:r.listItemDark]);return e.jsxs(U,{classes:{root:p},component:d||f.forwardRef((s,m)=>e.jsx(g,{to:u,...s,ref:m})),children:[t?e.jsx(G,{classes:{root:r.iconStyle},children:t}):null,e.jsx(J,{primary:l,primaryTypographyProps:{classes:{root:r.textItemRoot}}})]})};export{Re as T,Ce as a,B as b,A as c,S as d,E as e,D as f,H as g,z as h};