import{j as o,ap as N,a1 as I,k as R,Z as W,b as X,g as Z,ad as K}from"./main-7700519c.js";import{r as c,R as Y}from"./chunk-react-caacd912.js";import{c as J}from"./chunk-index-cacabe40.js";import{D as O}from"./chunk-index-5977a1b4.js";import{m as T,G as l,d as x,g as _,ao as V,q as M,e as U,I as L,aB as ee,aC as oe,B as $,L as te,a8 as re}from"./chunk-material-ui-241eb317.js";import{S as ae}from"./chunk-index-355ad0d2.js";import{b as ne}from"./chunk-index-69956742.js";import{D as ie}from"./chunk-index-8609782e.js";import{U as se}from"./chunk-index-d61a2e64.js";import{r as le,i as ce}from"./chunk-createSvgIcon-f41b980c.js";const de=T(e=>({sizeBlock:{marginBlockEnd:9,"@media (max-width: 280px)":{maxWidth:"100%",flexBasis:"100%"}},baseText:{fontFamily:"TTFirsNeue-Light, sans-serif","& > $baseText":{paddingLeft:e.spacing(2),whiteSpace:"nowrap"}},chooseSizeBlock:{cursor:"pointer",marginBlockEnd:9,"& p":{color:"#1e6ee4"}}}),{name:"CurrentSize"});function pe({sizeTitle:e,isShowPickSizeButton:t,pickSizeButtonTitle:n,gridSizeContent:d}){const r=de(),[i,s]=c.useState(!1),a=()=>s(!1),h=()=>s(!0);return o.jsxs(o.Fragment,{children:[o.jsx(l,{item:!0,xs:4,classes:{root:r.sizeBlock},children:o.jsxs(x,{classes:{root:r.baseText},component:"p",variant:"body1",color:"secondary",children:["Размер:",o.jsx(x,{classes:{root:r.baseText},component:"span",variant:"body1",color:"primary",children:e})]})}),t&&o.jsxs(o.Fragment,{children:[o.jsx(l,{item:!0,xs:"auto",sm:5,md:"auto",onClick:h,className:r.chooseSizeBlock,children:o.jsx(x,{classes:{root:r.baseText},variant:"body1",children:n||"Подобрать размер"})}),o.jsx(O,{open:i,onClose:a,onCloseIcon:a,dialogTitle:n||"Подобрать размер",scroll:"paper",maxWidth:!1,children:o.jsx(l,{container:!0,children:o.jsx(l,{item:!0,xs:12,children:d})})})]})]})}const ue=T(e=>({baseText:{fontFamily:"TTFirsNeue-Light, sans-serif","& > $baseText":{paddingLeft:e.spacing(2)}}}),{name:"CurrentSize"}),xe=({colorName:e})=>{const t=ue();return e?o.jsx(l,{item:!0,xs:12,children:o.jsxs(x,{classes:{root:t.baseText},component:"p",variant:"body1",color:"secondary",children:["Цвет:",o.jsx(x,{classes:{root:t.baseText},component:"span",variant:"body1",color:"primary",children:e})]})}):null},he=T(e=>({sizesChip:{width:78,height:40,borderRadius:10,margin:0,fontSize:"1rem","&:after":{content:'""',position:"absolute",top:0,left:0,width:"200%",height:"180%",background:`linear-gradient(to top right,
                transparent calc(49% - 1px),
                #E0E3E6 calc(49.5% - 1px),
                #E0E3E6 calc(48.5% + 1px),
                transparent calc(48% + 1px))`},"& span":{paddingInline:7}},CardPreviewSizeBtn:{minWidth:71,minHeight:32,color:e.color.black100,borderRadius:10,backgroundColor:"#FFFFFF","@media (min-width: 1656px)":{minWidth:87,minHeight:35}},sizesChipOutline:{borderColor:e.color.black40,overflow:"hidden","&:after":{content:'""',position:"absolute",top:0,left:0,width:"200%",height:"180%",background:`linear-gradient(to top right,
                transparent calc(48.5% - 1px),
                #E0E3E6 calc(49% - 1px),
                #E0E3E6 calc(48% + 1px),
                transparent calc(46% + 1px))`},"&:hover":{"background-color":"#FFFFFF !important"}},noQuantity:{color:e.color.black40,borderColor:e.color.black40},popover:{pointerEvents:"none"},paper:{maxWidth:230,padding:"8px 12px",borderRadius:4},popoverText:{fontSize:e.typography.pxToRem(14)},dialogRoot:{minWidth:300,maxWidth:400,padding:24,"& .MuiDialogContent-dividers":{overflow:"initial",border:"none"},"& .MuiDialogTitle-root":{padding:0,"margin-block-end":24,"& h2":{fontSize:"20px",lineHeight:"30px"}}}}),{name:"NoQuantitySize"}),Ne=e=>{const t=he(),[n,d]=c.useState(null),[r,i]=c.useState(!1),[s,a]=c.useState(!1),[h,y]=c.useState(""),v=g=>{d(g.currentTarget)},S=()=>{d(null)},m=g=>{i(!0)},j=!!n,u=()=>i(!1),[C,{isLoading:k}]=N(),p=()=>{C({email:h,product_id:e.product_id}).unwrap().then(({})=>{a(g=>!0)})},b=g=>{y(g.target.value)};return o.jsxs(o.Fragment,{children:[o.jsx(_,{"aria-owns":j?"mouse-over-popover":void 0,"aria-haspopup":"true",clickable:!0,onMouseEnter:v,onMouseLeave:S,variant:"outlined",classes:{root:e.productPreview?t.CardPreviewSizeBtn:t.sizesChip,outlinedPrimary:J([t.sizesChipOutline,t.noQuantity])},onClick:m,color:"primary",label:e.sizeTitle}),o.jsx(V,{open:j,className:t.popover,style:{top:10},classes:{paper:t.paper},anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:0,onClose:S,disableRestoreFocus:!0,children:o.jsx(x,{variant:"body1",classes:{root:t.popoverText},children:"Кликните на размер для возможности подписаться на его поступления"})}),o.jsx(O,{open:r,PaperProps:{classes:{root:t.dialogRoot}},scroll:"paper",onClose:u,onCloseIcon:u,dialogTitle:s?"Товар добавлен в подписки":"Подписаться на товар",children:o.jsxs(l,{container:!0,item:!0,spacing:3,children:[!s&&o.jsxs(o.Fragment,{children:[o.jsx(xe,{colorName:e.colorName}),o.jsx(pe,{sizeTitle:e.sizeTitle}),o.jsx(l,{item:!0,xs:12,children:o.jsx(M,{required:!0,fullWidth:!0,placeholder:"email",type:"email",onChange:b,value:h})})]}),s&&o.jsx(l,{item:!0,xs:12,children:o.jsx(x,{children:"Мы сообщим вам, когда он поступит на склад"})}),o.jsx(l,{item:!0,xs:12,children:o.jsx(U,{color:"default",variant:"contained",fullWidth:!0,onClick:s?u:p,children:s?"Готово":"Подписаться"})})]})})]})},ge=T(e=>({productRoot:{position:"relative",paddingBottom:e.spacing(5),"&:hover $favoriteIconStyle":{display:"block"}},productSmall:{width:280,"@media (max-width: 1440px)":{width:256},"@media (max-width: 1280px)":{width:256}},productMedium:{width:325,"@media (max-width: 1440px)":{width:256},"@media (max-width: 1280px)":{width:256}},productBig:{width:"100%","@media (max-width: 1440px)":{width:"100%"},"@media (max-width: 1280px)":{width:"100%"},"@media (max-width: 479px)":{width:"100%"}},productMain:{width:"100%","@media (max-width: 1440px)":{width:"100%"},"@media (max-width: 1280px)":{width:"100%"},"@media (max-width: 479px)":{width:"100%"}},containerLink:{height:"inherit"},badgeGrid:{display:"flex",flexDirection:"column",alignItems:"start",position:"absolute",left:"8px",top:"8px",zIndex:1,textTransform:"uppercase","& div":{height:24,fontSize:e.typography.pxToRem(14)},"& div + div":{marginBlockStart:15}},badgeStyle:{borderRadius:9,backgroundColor:e.color.black0,border:"1px solid currentcolor"},badgeSoon:{color:"#b1dff1"},badgeNew:{color:"#1e6ee4"},productImgGrid:{width:"100%",display:"flex",justifyContent:"center","@media (min-width: 540px)":{marginBlockEnd:15}},imgHover:{" :first-child":{display:"block"},"& :last-child":{display:"none"},"&:hover :first-child":{display:"none"},"&:hover :last-child":{display:"block"}},productImg:{objectFit:"contain"},productImgTechno:{width:"20%",position:"absolute",bottom:"-5%"},setNoQuantity:{flexDirection:"column","& svg":{margin:"0 !important"}},sizeContainer:{position:"absolute",left:0,bottom:0,padding:"0 10px",zIndex:1e3},sizeBtn:{minWidth:71,minHeight:32,color:e.color.black100,borderRadius:10,backgroundColor:"#FFFFFF","@media (min-width: 1656px)":{minWidth:87,minHeight:35}},sizeBtnClickable:{"&$sizeBtnOutlined":{"&:hover, &:focus":{backgroundColor:"#F0F3F6"}}},favoriteIconStyle:{display:"none",color:"#E0E3E6"},productPageFavoriteIconStyle:{color:e.color.black100},sizeBtnOutlined:{borderColor:e.color.black40},favoriteIcon:{margin:"16px 16px 0 0",right:0,position:"absolute",zIndex:2e3},btnAddToWish:{borderColor:e.color.black100,borderWidth:"1.25px",borderStyle:"solid",borderRadius:"1rem",width:"100%",padding:16,height:"100%"},paper:{maxWidth:230,padding:"8px 12px",borderRadius:4},popoverText:{fontSize:e.typography.pxToRem(14)},customPaperStyle:{width:"230px",padding:"8px 12px",borderRadius:"4px",position:"absolute",zIndex:1,backgroundColor:"#fff",border:"1px solid rgba(0, 16, 61, 0.16)",opacity:1,transform:"none",transition:"opacity 232ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 155ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%)"},productPopUpPosition:{transform:"translateX(-50%)",left:"50%"},catalogPopUpPosition:{top:"32px",left:"50%",transform:"translateX(-50%)"}}),{name:"CardPreview"}),me=({wishListItem:e,open:t,handleClose:n})=>o.jsx(ae,{open:t,onClose:n,title:"Товар добавлен в избранное",children:o.jsx(o.Fragment,{children:!Array.isArray(e==null?void 0:e.data)&&o.jsx(ne,{sku:e==null?void 0:e.data.SKU_ID,itemName:e==null?void 0:e.data.NAME,link:e==null?void 0:e.data.URL,imgPath:e==null?void 0:e.data.IMAGE.PATH,color:e==null?void 0:e.data.COLOR,size:e==null?void 0:e.data.SIZE,currentPrice:e==null?void 0:e.data.PRICES.RETAIL.PRICE_DISPLAY})})}),be=({event:e,inWishlist:t,handleDeleteWishlist:n,handleClick:d,colorRef:r,setClickOnWishListIcon:i,setOpenUserAuth:s,setOpenPopUp:a})=>t?n():(d(r),e.preventDefault(),i&&i(!0),s(!0),a(!0)),fe=e=>{var t;(t=e==null?void 0:e.current)==null||t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},Re=({setClickOnWishListIcon:e,inWishlist:t,productSku:n,isUserAuth:d,addWishList:r,wishListItem:i,colorRef:s,parentRef:a,type:h})=>{const[y]=I(),v=()=>{y({url:X.user.wishlist.delete,...Z({SITE_ID:"lid",bitrix_sessid:"bitrix_sessid"}),id:n})},[S,m]=c.useState(!1),[j,u]=Y.useState(!1),[C,k]=c.useState(!1),p=ge(),b=h==="productPage",g=b?p.productPageFavoriteIconStyle:p.favoriteIconStyle,z=b?p.btnAddToWish:p.favoriteIcon,P=b?p.productPopUpPosition:p.catalogPopUpPosition,F=R(f=>f.userAuth.authScreen),G=!t&&d&&j,q=i==null?void 0:i.data;c.useEffect(()=>{const f=B=>{var A;a!=null&&a.current&&!((A=a==null?void 0:a.current)!=null&&A.contains(B.target))&&(u(!1),e&&e(!1))};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[a]),c.useEffect(()=>{r&&(m(r),u(!1))},[r]);const Q=(f,B)=>{B!=="clickaway"&&m(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(L,{onClick:f=>{be({event:f,inWishlist:t,handleDeleteWishlist:v,handleClick:fe,colorRef:s,setClickOnWishListIcon:e,setOpenUserAuth:k,setOpenPopUp:u})},classes:{root:z},type:"button",color:"secondary",children:t&&o.jsx(ee,{color:"primary"})||o.jsx(oe,{className:g})}),G&&o.jsx($,{className:`${p.customPaperStyle} ${P}`,children:o.jsx(x,{variant:"body1",classes:{root:p.popoverText},children:"Чтобы добавить товар в избранное кликните на цвет, затем на размер."})}),q&&o.jsx(me,{wishListItem:i,open:S,handleClose:Q}),!d&&o.jsx(ie,{isWrapped:!0,showCloseIcon:!0,open:C,onClose:()=>k(!1),handlerCloseIcon:()=>k(!1),closeIconPosition:"right",anchor:"right",title:W[F].title,subTitle:W[F].subTitle,children:o.jsx(se,{})})]})};var D={},ye=ce;Object.defineProperty(D,"__esModule",{value:!0});var H=D.default=void 0,ve=ye(le()),w=o,Se=(0,ve.default)([(0,w.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},"0"),(0,w.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime");H=D.default=Se;const je=T(()=>({mainBlock:{width:"100%"},soonGrid:{width:"48%"},boxStyle:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",fontSize:"1rem",fontFamily:"TTFirsNeue-Regular,sans-serif",fontWeight:300,lineHeight:"24px",textTransform:"none",padding:9,"& .MuiLink-root:hover":{color:"#3A474E",borderBottom:"1px #3A474E dashed"},"& .MuiLink-underlineAlways":{color:"#1e6ee4",borderBottom:"1px #1e6ee4 dashed",textDecoration:"none"}},soonLogo:{marginInlineEnd:7,color:"#1e6ee4"},soonText:{fontFamily:"CirceWebBold,sans-serif",fontSize:"1.1rem",marginBlockStart:1,color:"#1e6ee4",fontWeight:550},subscribedText:{marginBlockEnd:15},dialogRoot:{minWidth:300,maxWidth:400,padding:24,"& .MuiDialogContent-dividers":{overflow:"initial",border:"none"},"& .MuiDialogTitle-root":{padding:0,"margin-block-end":24,"& h2":{fontSize:"20px",lineHeight:"30px"}}}}),{name:"ComingSoon"}),Oe=({productId:e,selectedColor:t,isComingSoon:n,setIsComingSoon:d})=>{var z,P,F;const r=je(),[i,s]=c.useState(!1),[a,h]=c.useState(!1),[y,v]=c.useState(""),[S]=N(),m=R(E=>E.userAuth.isAuth),j=t?"СКОРО":"Нет в наличии",{data:u}=K(),C=(F=(P=(z=u==null?void 0:u.data)==null?void 0:z.MAIN)==null?void 0:P.PROFILE)==null?void 0:F.EMAIL,k=()=>s(!0),p=()=>{s(!1),n&&d(!1)},b=()=>{S({email:y,product_id:e}).unwrap().then(E=>{if(E.status==="error")return h(!1);h(!0)})},g=E=>{v(E.target.value)};return c.useEffect(()=>{n&&s(!0)},[]),c.useEffect(()=>v(m?C:""),[m,C]),o.jsxs(l,{item:!0,container:!0,spacing:3,classes:{root:r.mainBlock},children:[!n&&o.jsxs(o.Fragment,{children:[o.jsxs(l,{item:!0,container:!0,direction:"row",classes:{root:r.soonGrid},children:[t&&o.jsx(H,{className:r.soonLogo}),o.jsx(x,{className:r.soonText,children:j})]}),o.jsx($,{className:r.boxStyle,onClick:k,children:o.jsx(te,{href:"#",underline:"always",children:"Хочу узнать о поступлении"})})]}),o.jsx(re,{open:i,PaperProps:{classes:{root:r.dialogRoot}},scroll:"paper",onClose:p,dialogTitle:a?"Товар добавлен в подписки":"Подписаться на товар",children:o.jsxs(l,{container:!0,item:!0,spacing:3,children:[!a&&o.jsx(o.Fragment,{children:o.jsxs(l,{item:!0,xs:12,children:[o.jsx(x,{className:r.subscribedText,children:"Этот товар скоро поступит в продажу. Хотите узнать об этом первыми? Пожалуйста, оставьте свой e-mail для оповещения."}),o.jsx(M,{required:!0,fullWidth:!0,placeholder:"email",type:"email",onChange:g,value:y})]})}),a&&o.jsx(l,{item:!0,container:!0,justifyContent:"center",xs:12,children:o.jsx(x,{children:"Мы сообщим вам, когда он поступит на склад"})}),o.jsx(l,{item:!0,xs:12,children:o.jsx(U,{color:"default",variant:"contained",fullWidth:!0,onClick:a?()=>p():b,children:a?"Готово":"Подписаться"})})]})})]})};function Ce(e){if(e&&e.indexOf("/")>-1){const[t,n]=e.split("/");return`linear-gradient(90deg, ${t} 0%, ${n} 100%)`}return e}const ke=T(e=>({chipStyle:{fontFamily:"TTFirsNeue-Light, sans-serif",fontSize:16}}),{name:"Badge"}),_e=e=>{const t=ke(),{badge_text:n,badge_text_color:d,badge_background_color:r}=e,i={color:d,background:Ce(r)};return o.jsx(_,{classes:{root:t.chipStyle},style:i,label:n})};export{_e as B,xe as C,Ne as N,Re as W,pe as a,Oe as b,Ce as g,ge as s};