1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2306],{74734:function(t,e,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/favourite/comparison",function(){return a(24632)}])},75526:function(t,e,a){"use strict";a.d(e,{O:function(){return C},k:function(){return i}});var r,i,o=a(85893),s=a(13604),n=a(27340),c=a(84224),l=a(93967),d=a.n(l),u=a(41664),_=a.n(u),m=a(11163),p=a(18267),h=a(85876),f=a.n(h);function C(t){let{routes:e,className:a,variant:r="dark"}=t,i=(0,m.useRouter)(),l=d()(f().pagination,a),{isTablet:u}=(0,s.t)(),h="light"===r&&!u,C=(0,n.g)(),g=t=>i.asPath===t||"".concat(i.asPath,"/")===t||i.asPath.split("?")[0]===t,x=t=>{g(t)||Object.values(i.query)[0]===t||i.push(t)};return(0,o.jsxs)("div",{className:l,children:[(0,o.jsx)(_(),{className:d()(f().route,{[f().light]:h}),href:"/",children:C.breadcrumbs.home}),e.map(t=>(0,o.jsxs)("div",{className:d()(f().routeNext,{[f().nonClick]:g(t.link),[f().light]:h}),children:[(0,o.jsx)(p.e0,{color:h?"white":"black",className:f().arrow,size:u?12:24}),(0,o.jsx)("span",{onClick:()=>x(t.link),className:d()(f().route,{[f().light]:h}),children:(0,c.n)(t.text)})]},t.link))]})}(r=i||(i={})).Dark="dark",r.Light="light"},11852:function(t,e,a){"use strict";a.d(e,{D:function(){return u},e:function(){return i}});var r,i,o=a(85893),s=a(93967),n=a.n(s),c=a(45091),l=a.n(c),d=a(40886);function u(t){let{className:e,text:a,variant:r=d.vs.Primary,heading:i,font:s="segoe",bold:c}=t,u=n()(l().wrapper,{[l().secondary]:r===d.vs.Secondary,[l().inter]:"inter"===s,[l().bold]:c},e);return i?(0,o.jsx)("h1",{className:u,children:a}):(0,o.jsx)("div",{className:u,children:a})}(r=i||(i={})).Segoe="segoe",r.Inter="inter"},50925:function(t,e,a){"use strict";a.d(e,{x:function(){return o}});var r=a(67294),i=a(33299);let o=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{data:e,status:a}=(0,i.useSession)();return(0,r.useEffect)(()=>{if("loading"!==a&&"unauthenticated"===a&&t){(0,i.signOut)({redirect:!0,callbackUrl:"/"});return}},[a,t]),{session:e,status:a,isLoading:"loading"===a,isAuthenticated:"authenticated"===a,isUnauthenticated:"unauthenticated"===a,token:null==e?void 0:e.user.accessToken,handleAuthError:()=>{(0,i.signOut)({redirect:!0,callbackUrl:"/"})}}}},93385:function(t,e,a){"use strict";a.d(e,{l:function(){return s}});var r=a(67294),i=a(40886),o=a(66238);let s=t=>{let[e,a]=(0,r.useState)([]),[s,n]=(0,r.useState)(!0),[c,l]=(0,r.useState)(null),[d,u]=(0,r.useState)(!1),[_,m]=(0,r.useState)([]),[p,h]=(0,r.useState)(!1),[f,C]=(0,r.useState)(null),g=(0,r.useCallback)(async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t){n(!1);return}try{s||n(!0),l(null);let c=e.inStock?"&inStock=true":"",d="/favourite/list?page=".concat(r,"&limit=20&sort=").concat(e.sort).concat(c),_=await (0,o.r)({url:d,method:i.hC.GET,headers:{Authorization:"Bearer ".concat(t)}});if(_.success){let t=_.data.results;a(e=>s?[...e,...t]:t),u(t.length<20)}else throw Error("Failed to fetch favourites")}catch(t){l(t instanceof Error?t.message:"An error occurred")}finally{n(!1)}},[t]),x=(0,r.useCallback)(async()=>{if(t)try{h(!0),C(null);let e=await (0,o.r)({url:"/favourite/list?page=1&limit=1000",method:i.hC.GET,headers:{Authorization:"Bearer ".concat(t)}});if(e.success){let t=e.data.results.filter(t=>t.price),a={};t.forEach(t=>{var e,r,i,o;let s=t.categories.find(t=>1===t.level),n=null!==(o=null!==(i=null==s?void 0:null===(e=s.name)||void 0===e?void 0:e.ru)&&void 0!==i?i:null==s?void 0:null===(r=s.name)||void 0===r?void 0:r.en)&&void 0!==o?o:"Ðез каÑегоÑии";a[n]||(a[n]=[]),a[n].push(t)});let r=Object.entries(a).map(t=>{let[e,a]=t;return{categoryTitle:e,products:a}});m(r)}else throw Error("Failed to fetch grouped favourites")}catch(t){C(t instanceof Error?t.message:"An error occurred")}finally{h(!1)}},[t]),v=(0,r.useCallback)(t=>{g(t,1,!1)},[g]),j=(0,r.useCallback)((t,e)=>{g(t,e+1,!0)},[g]);return(0,r.useEffect)(()=>{t&&(g({sort:i.TO.Popular,inStock:!1}),x())},[t,g,x]),{items:e,isLoading:s,error:c,limitExceeded:d,refetch:v,loadMore:j,groupedByCategory:_,isGroupedLoading:p,groupedError:f,fetchFavouritesGroupedByCategory:x}}},24632:function(t,e,a){"use strict";a.r(e),a.d(e,{default:function(){return A}});var r=a(85893),i=a(91065),o=a(17953),s=a(86270),n=a.n(s),c=a(75526),l=a(11852),d=a(67294),u=a(27340),_=a(50925),m=a(93385),p=a(54111),h=a(19134),f=a(8978),C=a(19843),g=a(96451),x=a(83392),v=a(26009),j=a(74728),P=a(19353),k=a(93967),N=a.n(k),y=a(41664),w=a.n(y),b=a(35432),S=a(42014),T=a(34644),B=a(49446),L=a.n(B);function E(t){var e,a;let{hot:i,good:o,isSmall:s,characs:n,showOnlyDiff:c=!1,differentCharacs:l=[]}=t,d="variable"===o.type,{getIsFavourite:u,addToFavourite:_,removeFromFavourite:m}=(0,C.q)(),{addToCart:p}=(0,f.W)(),k=N()(L().wrapper),y=N()(L().square,{[L().squareSmall]:s}),B=N()(L().tags,{[L().tagsSmall]:s}),E=t=>{t.stopPropagation(),p({id:o.id})},q=(0,j.x)(o.images?o.images[0]:""),{getTranslations:O}=(0,g.T)(),R=c?n.filter(t=>l.includes(t.title.ru)):n;return(0,r.jsx)(w(),{href:(0,P.p)(o.fullSlug),className:L().link,
1children:(0,r.jsx)("div",{className:L().container,children:(0,r.jsxs)("div",{className:k,children:[(0,r.jsxs)("div",{className:y,children:[(0,r.jsx)("img",{src:q,alt:O(o.name),className:L().img,loading:"lazy"}),(0,r.jsx)("button",{type:"button",className:L().like,onClick:t=>{t.stopPropagation(),t.preventDefault(),u(o.id)?m(o.id):_(o.id)},style:{background:"none",border:"none",padding:0,margin:0,cursor:"pointer"},children:(0,r.jsx)("img",{src:u(o.id)?"/svg/heart-filled.svg":"/svg/heart.svg",alt:"like"})}),i&&(0,r.jsx)(S.P,{color:h._8,text:"ÐкÑÑÑаÑкидка"})]}),(0,r.jsx)("div",{className:B,children:o.tags.map((t,e)=>(0,r.jsx)(T.V,{text:O(t.text),code:t.tag},e))}),!d&&(0,r.jsx)("button",{className:L().addCart,onClick:t=>E(t),children:(0,r.jsx)("img",{src:"/svg/cart.svg",alt:"cart",width:"100%"})}),(0,r.jsxs)("div",{className:L().info,children:[(0,r.jsx)("span",{className:L().name,children:O(o.name)}),(0,r.jsxs)("div",{className:N()(L().priceRow,{[L().priceRowSmall]:s}),children:[(0,r.jsxs)("span",{className:L().price,children:[(0,r.jsx)("span",{className:L().priceText,children:(0,v.T)(null!==(e=o.price)&&void 0!==e?e:0)}),(0,r.jsx)("span",{children:"â¸"})]}),!!o.oldPrice&&(0,x.W)(o.price,o.oldPrice)>0&&(0,r.jsxs)("div",{className:L().discountRow,children:[(0,r.jsxs)("span",{className:L().oldPrice,children:[(0,r.jsx)("span",{className:L().oldPriceText,children:(0,v.T)(null!==(a=o.oldPrice)&&void 0!==a?a:0)}),(0,r.jsx)("span",{children:"â¸"})]}),(0,r.jsx)(b.s,{discount:(0,x.W)(o.price,o.oldPrice),className:L().discount})]})]}),null==R?void 0:R.map((t,e)=>(0,r.jsxs)("div",{className:L().characsItem,children:[(0,r.jsxs)("span",{className:L().characsName,children:[O(t.title),":\xa0"]}),"size"===t.type?(0,r.jsxs)("span",{className:L().characsText,children:[t.length," x ",t.width," x ",t.height]}):(0,r.jsx)("span",{className:L().characsText,children:O(t.text)})]},e))]})]})})})}var q=a(14492),O=a(2261),R=a(9008),z=a.n(R);function A(){var t;let{token:e,isLoading:a,handleAuthError:s}=(0,_.x)(!0),{groupedByCategory:h,isLoading:f,error:C}=(0,m.l)(e),[g,x]=(0,d.useState)(null),[v,j]=(0,d.useState)(!1),P=(0,u.g)();(0,d.useEffect)(()=>{(null==h?void 0:h.length)&&!g&&x(h[0].categoryTitle)},[h,g]);let k=null==h?void 0:h.find(t=>t.categoryTitle===g),N=null!==(t=null==k?void 0:k.products.filter(t=>t.price))&&void 0!==t?t:[],y=(0,d.useMemo)(()=>{if(!N.length)return[];let t=N.map(t=>t.specifications),e=new Set;t.forEach(t=>{t.forEach(t=>{e.add(t.title.ru)})});let a=[];return e.forEach(e=>{let r=new Set;t.forEach(t=>{let a=t.find(t=>t.title.ru===e);a&&("size"===a.type?r.add("".concat(a.length,"x").concat(a.width,"x").concat(a.height)):r.add(a.text.ru))}),r.size>1&&a.push(e)}),a},[N]);return a||f||C?(C&&s(),(0,r.jsx)(p.a,{fullScreen:!0})):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z(),{children:(0,r.jsx)("link",{rel:"canonical",href:"".concat(i.E3,"/favourite/comparison")})}),(0,r.jsx)(o.A,{meta:i.bi,children:(0,r.jsxs)("main",{className:n().main,children:[(0,r.jsx)(c.O,{routes:[{link:"/favourite",text:P.favourite.title}]}),(0,r.jsx)(l.D,{text:P.comparison.title,className:n().title,heading:!0}),(0,r.jsx)("div",{className:n().categoryButtons,children:h.map(t=>(0,r.jsx)("button",{className:g===t.categoryTitle?"".concat(n().categoryButton," ").concat(n().activeCategoryButton):n().categoryButton,onClick:()=>x(t.categoryTitle),children:t.categoryTitle},t.categoryTitle))}),(0,r.jsxs)("div",{className:n().radioGroup,children:[(0,r.jsx)("input",{type:"radio",id:"all",name:"characsFilter",value:"all",checked:!v,onChange:()=>j(!1)}),(0,r.jsx)("label",{htmlFor:"all",children:"ÐÑе паÑамеÑÑÑ"}),(0,r.jsx)("input",{type:"radio",id:"diff",name:"characsFilter",value:"diff",checked:v,onChange:()=>j(!0)}),(0,r.jsx)("label",{htmlFor:"diff",children:"ТолÑко ÑазлиÑаÑÑиеÑÑ"})]}),(0,r.jsx)(q.i,{children:N.map((t,e)=>(0,r.jsx)(O.o5,{className:"swiper-slide-custom",children:(0,r.jsx)(E,{good:t,hot:!1,className:n().card,characs:t.specifications,showOnlyDiff:v,differentCharacs:y})},e))})]})})]})}},85876:function(t){t.exports={pagination:"Breadcrumbs_pagination__Zf_Ba",route:"Breadcrumbs_route__2H7Bi",nonClick:"Breadcrumbs_nonClick__LYijq",routeNext:"Breadcrumbs_routeNext__mag3a",arrow:"Breadcrumbs_arrow__9S3PZ",light:"Breadcrumbs_light__XZ_J0"}},49446:function(t){t.exports={container:"ListProductCardComparison_container__oEQoT",link:"ListProductCardComparison_link__8ttPX",wrapper:"ListProductCardComparison_wrapper__ycyj1",characsName:"ListProductCardComparison_characsName__3t4_E",characsText:"ListProductCardComparison_characsText__sigBx",square:"ListProductCardComparison_square__9TdcL",squareSmall:"ListProductCardComparison_squareSmall__ICstI",like:"ListProductCardComparison_like__kfmGN",img:"ListProductCardComparison_img__rkONc",priceRow:"ListProductCardComparison_priceRow__kVpm4",priceRowSmall:"ListProductCardComparison_priceRowSmall__dUAMk",name:"ListProductCardComparison_name__2tYXq",tags:"ListProductCardComparison_tags__qXsOI",info:"ListProductCardComparison_info__3vbq3",price:"ListProductCardComparison_price__zlC0f",priceText:"ListProductCardComparison_priceText__IPUrf",oldPrice:"ListProductCardComparison_oldPrice__bUl1_",oldPriceText:"ListProductCardComparison_oldPriceText__X9o0g",discount:"ListProductCardComparison_discount__5Q1od",cartButton:"ListProductCardComparison_cartButton__nPlJr",cartButtonBig:"ListProductCardComparison_cartButtonBig__GKroP",addCart:"ListProductCardComparison_addCart__QoL_Q",cartButtonSmall:"ListProductCardComparison_cartButtonSmall__IvVft",cartButtonWide:"ListProductCardComparison_cartButtonWide__xFgBO",discountRow:"ListProductCardComparison_discountRow__wfWFP"}},45091:function(t){t.exports={wrapper:"Title_wrapper__DIf2F",secondary:"Title_secondary__LSHDu",inter:"Title_inter__1zn2y",bold:"Title_bold__yjKsP"}},86270:function(t){t.exports={main:"Comparison_main__hphHq",title:"Comparison_title__RewtB",row:"Comparison_row__C9W4p",view:"Comparison_view__fc9TO",icon:"Comparison_icon__Lc09_",card:"Comparison_card__V__Ge",inStock:"Comparison_inStock__miJev",inStockMobile:"Comparison_inStockMobile__qRAMa",actions:"Comparison_actions__zVg_A",actionsMobile:"Comparison_actionsMobile__ziNdc",inStockText:"Comparison_inStockText__6BdGP",button:"Comparison_button__7qrvI",empty:"Comparison_empty__f__ER",emptyText:"Comparison_emptyText__br5Z0",categoryButtons:"Comparison_categoryButtons__LCxAm",categoryButton:"Comparison_categoryButton__4iqU7",activeCategoryButton:"Comparison_activeCategoryButton__Dyilh",radioGroup:"Comparison_radioGroup__rqRod"}}},function(t){t.O(0,[1011,1555,2888,9774,179],function(){return t(t.s=74734)}),_N_E=t.O()}]); 2//# sourceMappingURL=comparison-4877dbff3257d2be.js.map
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.