"use strict";(self.webpackChunkgulp_template=self.webpackChunkgulp_template||[]).push([[6465],{4965:function(t,e,n){function o(){const t=document.querySelectorAll(".js-accordion");t.length&&t.forEach((t=>{const e=t.querySelector(".js-accordion-content"),n=t.querySelector(".js-accordion-button");n&&e&&n.addEventListener("click",(function(){t.classList.toggle("show"),t.classList.contains("show")?e.style.maxHeight=`${e.scrollHeight}px`:e.style.maxHeight=0}))}))}n.d(e,{A:function(){return o}})},3218:function(t,e,n){function o(){const t=document.body,e=window.innerWidth-t.clientWidth;if(t.style.transition="margin-right 0.3s easy-in-out",t.style.marginRight=`${e}px`,t.style.overflow="hidden",!window.matchMedia("(min-width: 996px)").matches){const e=window.pageYOffset;t.style.top=-e+"px",t.style.position="fixed",t.style.width="100%"}}function i(){const t=document.body;if(t.style.transition="margin-right 0s easy-in-out",t.style.marginRight="0",t.style.overflow="unset",!window.matchMedia("(min-width: 996px)").matches){const e=Math.abs(parseInt(t.style.top||0,10));t.style.position="static",t.style.width="auto",t.style.removeProperty("top"),window.scrollTo(0,e||0)}}n.d(e,{$:function(){return o},W:function(){return i}})},3109:function(t,e,n){n.d(e,{A:function(){return c}});var o=n(9476);function i(t,e,n){if(t&&e&&n){const o=t.querySelector(".js-dropdown-label"),i={minValue:Number(e.dataset.min),maxValue:Number(n.dataset.max),currentMinValue:Number(e.value)||Number(e.dataset.min),currentMaxValue:Number(n.value)||Number(n.dataset.max)};i.minValue!==i.currentMinValue||i.maxValue!==i.currentMaxValue?(t.classList.contains("selected")||t.classList.add("selected"),o.innerText=`${i.currentMinValue||i.minValue} - ${i.currentMaxValue||i.maxValue}`):(t.classList.contains("selected")&&t.classList.remove("selected"),o.innerText=o.dataset.placeholder)}}function c(t,e){const n=document.querySelectorAll(".js-cost-range");n.length&&n.forEach((n=>{var c,s;const r=n.closest(".js-dropdown"),a=n.querySelector(".js-cost-range-element"),l=n.querySelectorAll(".js-cost-range-value"),d=e?Number(null===(c=n.querySelector("[data-min]"))||void 0===c?void 0:c.dataset.min):"",u=e?Number(null===(s=n.querySelector("[data-max]"))||void 0===s?void 0:s.dataset.max):"";if(a&&2===l.length){const n=[e?Number(l[0].dataset.costRangeValueMin)||d:Number(l[0].nextElementSibling.value),e?Number(l[1].dataset.costRangeValueMax)||u:Number(l[1].nextElementSibling.value)];i(r,l[0].nextElementSibling,l[1].nextElementSibling),o.Ay.create(a,{start:n,range:{min:e?d:Number(l[0].dataset.min),max:e?u:Number(l[1].dataset.max)},step:1,connect:!0}),a.noUiSlider.on("update",(function(t,e){l[e].innerText=t[e]})),a.noUiSlider.on("change",(function(e,n){l[n].nextElementSibling.value=e[n],i(r,l[0].nextElementSibling,l[1].nextElementSibling),l[n].closest(".js-dialog-filters")||l[n].nextElementSibling.dispatchEvent(new Event("change")),t&&t([...e])}))}}))}},2585:function(t,e,n){n.r(e),n.d(e,{default:function(){return i}});var o=n(3218);function i(t,e=null,n=[]){const i=document.querySelector(".js-navigation");t&&(i.classList.contains("navigation__fixed--white")||i.classList.add("navigation__fixed--white"),t.on("show",(()=>{(0,o.$)(),e&&e(...n)})),t.on("hide",(()=>{(0,o.W)(),t.destroy()})),t.show())}},7343:function(t,e,n){function o(t){const e=document.querySelector(".js-grid-two"),n=document.querySelector(".js-grid-auto");if(n&&e){const o=document.querySelector(".js-catalog-grid");e.addEventListener("click",(function(){this.classList.contains("catalog-page-actions__grid-button--active")||(this.classList.add("catalog-page-actions__grid-button--active"),o.classList.add(`${t}--two-columns`),this.nextElementSibling.classList.remove("catalog-page-actions__grid-button--active"))})),n.addEventListener("click",(function(){this.classList.contains("catalog-page-actions__grid-button--active")||(this.classList.add("catalog-page-actions__grid-button--active"),o.classList.remove(`${t}--two-columns`),this.previousElementSibling.classList.remove("catalog-page-actions__grid-button--active"))}))}}n.d(e,{A:function(){return o}})},4636:function(t,e,n){n.d(e,{F:function(){return v}});var o=n(600);function i(t,e,n,o,i,c,s){try{var r=t[c](s),a=r.value}catch(t){return void n(t)}r.done?e(a):Promise.resolve(a).then(o,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(o,c){var s=t.apply(e,n);function r(t){i(s,o,c,r,a,"next",t)}function a(t){i(s,o,c,r,a,"throw",t)}r(void 0)}))}}const s="active",r=document.querySelectorAll(".js-favorites-button-count"),a=document.querySelectorAll(".js-compare-button-count"),l=document.querySelectorAll(".js-basket-button-count");function d(t,e){return u.apply(this,arguments)}function u(){return u=c((function*(t,e,n=!1){var i;if((null===(i=window.APP)||void 0===i?void 0:i.FAVORITES)&&window.APP.FAVORITES.includes(Number(e))&&t.classList.add(s),!n)try{const n=yield(0,o.A)({ACTION:"add2favorites",ITEM_ID:e});if("OK"===n.STATUS){if(y(t,r,n.EVENT),g(r),"REMOVE"===n.EVENT){const t=window.APP.FAVORITES.indexOf(+e);-1!==t&&window.APP.FAVORITES.splice(t,1)}else window.APP.FAVORITES.push(+e);"REMOVE"===n.EVENT&&"/favorites/"===window.location.pathname&&(t.closest(".js-product-card").remove(),0===document.querySelectorAll(".js-product-card").length&&(document.querySelector(".js-wrap-favorites").innerHTML="",document.querySelector(".js-empty-info").classList.remove("hidden")))}}catch(t){console.log(t)}})),u.apply(this,arguments)}function f(t,e){return m.apply(this,arguments)}function m(){return m=c((function*(t,e,n=!1,i=1){var c;if((null===(c=window.APP)||void 0===c?void 0:c.BASKET)&&Object.keys(window.APP.BASKET).includes(String(e))&&(t.innerText=t.dataset.incart,t.classList.add("js-added-to-cart")),!n&&t.classList.contains("js-added-to-cart"))window.location.href="/cart/";else if(!n)try{"OK"===(yield(0,o.A)({ACTION:"add2basket",ITEM_ID:e,QUANTITY:i})).STATUS&&(l.forEach((t=>{const e=t.innerText;Number(e)>98?t.innerText="99":t.innerText=Number(e)+1})),t.innerText=t.dataset.incart,t.classList.add("js-added-to-cart"),window.APP.BASKET[e]={PRODUCT_ID:Number(e),QUANTITY:i},t.classList.contains("js-reload-page")&&location.reload())}catch(t){console.log(t)}})),m.apply(this,arguments)}function h(t,e){return p.apply(this,arguments)}function p(){return p=c((function*(t,e,n=!1){var i;if((null===(i=window.APP)||void 0===i?void 0:i.COMPARE)&&window.APP.COMPARE.includes(Number(e))&&t.classList.add(s),!n)try{const n=yield(0,o.A)({ACTION:"add2compare",ITEM_ID:e});if("OK"===n.STATUS)if(y(t,a,n.EVENT),g(a),"REMOVE"===n.EVENT){const t=window.APP.COMPARE.indexOf(+e);-1!==t&&window.APP.COMPARE.splice(t,1)}else window.APP.COMPARE.push(+e)}catch(t){console.log(t)}})),p.apply(this,arguments)}function g(t){t.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;Number(e)<=0?t.classList.add("hidden"):t.classList.remove("hidden")}))}function y(t,e,n){t.classList.toggle(s),"REMOVE"===n?e.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;t.innerText=Number(e)-1})):e.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;t.innerText=Number(e)+1}))}function v(t){t.length&&window.APP&&(t.forEach((t=>{const e=t.querySelectorAll(".js-add-to-cart"),n=t.querySelectorAll(".js-add-to-cart-obrazec"),i=t.querySelectorAll(".js-add-to-cart-catalog"),s=t.querySelectorAll(".js-add-to-favorite"),r=t.querySelectorAll(".js-add-to-compare"),a=t.querySelectorAll(".js-one-click-buy"),l=Number(t.dataset.id);e.length&&e.forEach((t=>{f(t,l,!0),t.addEventListener("click",(function(){const e=this.closest(".js-actions-container"),n=null==e?void 0:e.querySelector(".js-count-picker-input"),o=n?Number(n.value):1;f(this,t.dataset.id||l,!1,o)}))})),s.length&&s.forEach((t=>{d(t,l,!0),t.addEventListener("click",(function(e){e.stopPropagation(),d(this,t.dataset.id||l)}))})),r.length&&r.forEach((t=>{h(t,l,!0),t.addEventListener("click",(function(e){e.stopPropagation(),h(this,t.dataset.id||l)}))})),n.length&&n.forEach((t=>{const e=t.dataset.id;if(f(t,e,!0),window.APP.BASKET&&window.APP.BASKET[e]){const n=t.closest(".js-actions-container"),o=null==n?void 0:n.querySelector(".js-obrazec-checkbox");o&&(o.checked=!!window.APP.BASKET[e].NO_CUT)}t.addEventListener("click",c((function*(){const n=this.closest(".js-actions-container"),i=window.matchMedia("(min-width: 996px)").matches?t.previousElementSibling.querySelector(".js-count-picker-input"):n.querySelector(".js-count-picker-input"),c=Number(i.value);yield f(this,e,!1,c);try{yield(0,o.A)({ACTION:"setDntCut",ITEM_ID:e})}catch(t){console.log(t)}})))})),i.length&&i.forEach((t=>{const e=t.dataset.id;f(t,e,!0),t.addEventListener("click",c((function*(){f(this,e)})))})),a.length&&a.forEach((t=>{t.addEventListener("click",c((function*(){const e=document.querySelector(".js-count-picker-input"),n=e?Number(e.value):1,o=t.dataset.id||l;yield f(this,o,!1,n),window.location.replace("/order/")})))}))})),g(a),g(r))}},2048:function(t,e,n){n.d(e,{A:function(){return i}});var o=n(3218);function i(t,e=!0){const n=document.querySelector(".js-loader");n&&(e?n.classList.add("loader-fixed"):n.classList.remove("loader-fixed"),n.classList.toggle(t),n.classList.contains("loader-fixed")&&(n.classList.contains("show-global")?(0,o.$)():(0,o.W)()))}},8180:function(t,e,n){n.d(e,{A:function(){return i}});var o=n(9889);function i(){document.querySelectorAll(".js-quick-links").forEach(c)}function c(t){const e=t.querySelector(".js-quick-links-toggle-item"),n=t.querySelector(".js-quick-links-toggle-btn"),i=Array.from(t.querySelectorAll(".js-quick-links-item"));if(!e||!n||!i.length)return;t.classList.add("init");let c=!1;function s(){a(i,!0),e.classList.add("quick-links__item--hidden");const t=function(t){const e=new Map;return t.forEach((t=>{const n=Math.round(t.getBoundingClientRect().top);e.has(n)||e.set(n,[]),e.get(n).push(t)})),Array.from(e.values())}(i);t.length<=2||(a([...r(t[1]),...t.slice(2).flat()],!1),e.classList.remove("quick-links__item--hidden"),n.textContent="Показать ещё")}function r(t){return[t[t.length-1]]}function a(t,e){t.forEach((t=>t.classList.toggle("quick-links__item--hidden",!e)))}e.classList.add("quick-links__item--hidden"),n.addEventListener("click",(function(){c=!c,c?(a(i,!0),e.classList.remove("quick-links__item--hidden"),n.textContent="Скрыть"):s()})),s(),window.addEventListener("resize",(0,o.A)((()=>{c||s()}),150))}},8342:function(t,e,n){function o(){const t=document.querySelectorAll(".js-read-more-container");if(t.length){const e=document.querySelectorAll(".js-language-radio");let n="RU";if(0!==e.length){const t=Array.from(e).find((t=>t.checked));n=t.value}t.forEach((t=>{const e=t.querySelector(".js-read-more"),o=t.querySelector(".js-read-more-block");o&&e&&e.addEventListener("click",(function(){o.classList.toggle("open"),o.classList.contains("open")?(this.innerText="RU"===n?"Скрыть":"Hide",o.style.maxHeight=`${o.scrollHeight}px`):(this.innerText="RU"===n?"Читать далее":"Read more",o.style.maxHeight="310px")}))}))}}n.d(e,{A:function(){return o}})},600:function(t,e,n){function o(t,e,n,o,i,c,s){try{var r=t[c](s),a=r.value}catch(t){return void n(t)}r.done?e(a):Promise.resolve(a).then(o,i)}function i(t){return c.apply(this,arguments)}function c(){return t=function*(t){const e=new FormData;for(let n in t)e.append(n,t[n]);e.append("IS_AJAX_ACTION","Y");try{const t=yield fetch("/",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:e});return yield t.json()}catch(t){return console.log("error",t),!1}},c=function(){var e=this,n=arguments;return new Promise((function(i,c){var s=t.apply(e,n);function r(t){o(s,i,c,r,a,"next",t)}function a(t){o(s,i,c,r,a,"throw",t)}r(void 0)}))},c.apply(this,arguments);var t}n.d(e,{A:function(){return i}})},6014:function(t,e,n){n.d(e,{A:function(){return s}});var o=n(2048);function i(t,e,n,o,i,c,s){try{var r=t[c](s),a=r.value}catch(t){return void n(t)}r.done?e(a):Promise.resolve(a).then(o,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(o,c){var s=t.apply(e,n);function r(t){i(s,o,c,r,a,"next",t)}function a(t){i(s,o,c,r,a,"throw",t)}r(void 0)}))}}function s(t,e,n){const i=document.querySelector(".js-catalog-infinity-scroll"),s=new IntersectionObserver(((t,n)=>{t.forEach((t=>{if(t.isIntersecting&&!a){const t=document.querySelectorAll(e);t.length&&(n.unobserve(t[t.length-1]),l())}}))}),{threshold:.5});let r=i?i.dataset.firstPage:2,a=!1;window.showMore=!0;const l=function(){var e=c((function*(){""!==i.dataset.firstPage&&0===Number(i.dataset.firstPage)||(r=i.dataset.firstPage||2,a=!0,(0,o.A)("show",!1),setTimeout(c((function*(){try{const e=yield t(r);"success"===e.status?(e.data.collections.length&&(r=e.data.nextPage,i.dataset.firstPage=r,(t=>{i.insertAdjacentHTML("beforeend",t)})(e.data.collections),s.observe(i.lastElementChild)),0===Number(e.data.nextPage)&&(window.showMore=!1,s.unobserve(i.lastElementChild))):console.log("error",e)}catch(t){console.log("error",t)}finally{a=!1,(0,o.A)("show",!1),"function"==typeof n&&n()}})),500))}));return function(){return e.apply(this,arguments)}}();null!==i&&s.observe(i.lastElementChild)}},1238:function(t,e,n){n.d(e,{A:function(){return a}});var o=n(4965),i=n(600),c=n(3218);function s(t,e,n,o,i,c,s){try{var r=t[c](s),a=r.value}catch(t){return void n(t)}r.done?e(a):Promise.resolve(a).then(o,i)}function r(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var c=t.apply(e,n);function r(t){s(c,o,i,r,a,"next",t)}function a(t){s(c,o,i,r,a,"throw",t)}r(void 0)}))}}function a(){(0,o.A)();const t=document.querySelectorAll(".js-split-price");t.length&&t.forEach(function(){var t=r((function*(t){if(document.querySelector("[data-sum-discount-all-products]")){let t=document.querySelector("[data-sum-discount-all-products]").getAttribute("data-sum-discount-all-products");const e=yield(0,i.A)({ACTION:"getHalvaPlanHtml",PRICE:t});let n=document.querySelector(".split-price__cost"),o=document.querySelector(".js-split-price"),c=o?o.querySelector(".card-split-cost"):void 0;"success"===e.STATUS?(c&&c.remove(),n.innerHTML="Разбить на части без переплат",o.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),o.appendChild((new DOMParser).parseFromString(e.html,"text/html").querySelector(".card-split-cost"))):("USER"===e.CODE?o.closest(".basket-aside__info-split").classList.add("basket-aside__info-split--without-border"):o.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),n.innerHTML=e.MESSAGE,c&&c.classList.add("hidden"))}t.addEventListener("click",(t=>{t.preventDefault()}));const e=t.querySelectorAll('[data-modal="open"]'),n=document.querySelector('[data-modal="container"]'),o=n.querySelectorAll('[data-modal="close"]');e&&e.forEach((t=>{t&&t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),n.classList.add("active"),(0,c.$)()}))})),o&&o.forEach((t=>{t&&t.addEventListener("click",(t=>{t.stopPropagation(),n.classList.contains("active")&&(n.classList.remove("active"),(0,c.W)())}))}))}));return function(e){return t.apply(this,arguments)}}())}},9681:function(t,e,n){n.d(e,{A:function(){return s},u:function(){return r}});var o=n(9743);function i(t){t.forEach((t=>{"Y"===t.getAttribute("data-clear-active")?t.hasAttribute("disabled")&&(t.removeAttribute("disabled"),t.classList.remove("disabled")):t.hasAttribute("disabled")||(t.setAttribute("disabled",!0),t.classList.add("disabled"))}))}function c(t,e,n){let o=0;e.forEach((t=>{t.checked&&(0===o&&(n.innerText=""),o++,o>1&&(n.innerText+=", "),n.innerText+=t.dataset.label)})),o>0&&!t.classList.contains("selected")&&t.classList.add("selected"),0===o&&(t.classList.contains("selected")&&t.classList.remove("selected"),n.innerText=n.dataset.placeholder)}function s(){const t=document.querySelectorAll(".js-filters-container"),e=document.querySelectorAll(".js-clear-filters");t.length&&(t.forEach((t=>{const n=t.querySelectorAll(".js-dropdown");n.length&&n.forEach((t=>{const n=t.querySelectorAll(".js-checkbox"),o=t.querySelector(".js-dropdown-label");n.length&&(n.forEach((s=>{s.addEventListener("change",(function(){c(t,n,o),i(e)}))})),c(t,n,o))}))})),i(e))}function r(){const t=document.querySelector(".js-tags-scroll");t&&t&&new o.A(t,{autoHide:!1})}},1136:function(t,e,n){function o(t,e){const n=e.querySelector(".js-video-play"),o=e.querySelector(".js-video-poster"),i=e.querySelector(".js-video-dimmer");"play"===t?(i.style.bacgroundColor="transparent",n.style.display="none",o.style.display="none"):(i.style.backgroundColor="rgba(0, 0, 0, 0.35)",n.style.display="flex",o.style.display="block")}function i(){const t=document.querySelectorAll(".js-video");t&&t.length&&t.forEach((t=>{const e=t.closest(".video-block");e.querySelector(".js-video-dimmer").addEventListener("click",(()=>{t.paused?(o("play",e),t.play()):(o("pause",e),t.pause())}))}))}n.d(e,{S:function(){return o},r:function(){return i}})},4430:function(t,e,n){var o=n(7083),i=n(2585),c=n(1136),s=n(7343),r=n(8342),a=n(9681),l=n(3109),d=n(1238),u=n(6014);function f(t,e,n,o,i,c,s){try{var r=t[c](s),a=r.value}catch(t){return void n(t)}r.done?e(a):Promise.resolve(a).then(o,i)}function m(t){return h.apply(this,arguments)}function h(){return t=function*(t){try{const t=window.location.pathname,e=new URLSearchParams(window.location.search),n=document.querySelector("[data-first-page]");if(e.has("PAGEN_1")?e.set("PAGEN_1",+e.get("PAGEN_1")+1):e.set("PAGEN_1",+n.dataset.firstPage||1),+n.dataset.firstPage>0){const n=new Promise(((n,o)=>{BX.ajax({url:t+`?${e.toString()}`,method:"GET",dataType:"html",processData:!1,processScripts:!1,onsuccess(t){n(p(t))}})}));return n}}catch(t){return console.log(t),!1}},h=function(){var e=this,n=arguments;return new Promise((function(o,i){var c=t.apply(e,n);function s(t){f(c,o,i,s,r,"next",t)}function r(t){f(c,o,i,s,r,"throw",t)}s(void 0)}))},h.apply(this,arguments);var t}const p=t=>{const e=document.createElement("div");e.innerHTML=t;const n=e.querySelector("[data-first-page]"),o=n?n.dataset.firstPage:2;return{data:{collections:n.innerHTML,nextPage:o},errors:[],status:"success"}};var g=n(4636),y=n(8180);function v(t){const e=[];window.dataLayer=window.dataLayer||[],t.forEach((t=>{if(function(t){const e=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,o=window.innerWidth||document.documentElement.clientWidth;return e.bottom>0&&e.right>0&&e.top{window.matchMedia("(min-width: 996px)").matches?(0,s.A)("stenova-home-catalog-grid__items"):(0,r.A)(),window.addEventListener("scroll",(()=>v(document.querySelectorAll('.js-catalog-grid [data-ecom="0"]')))),(0,l.A)(),(0,a.A)(),(0,a.u)(),function(){const t=document.querySelector(".js-dialog-filters");document.querySelectorAll(".js-dialog-filters-button").forEach((e=>{e.addEventListener("click",(function(){if(t){const e=new o.default(t);(0,i.default)(e)}}))}))}(),(0,c.r)(),(0,d.A)(),(0,u.A)(m,".stenova-home-catalog-card",(()=>{const t=document.querySelectorAll(".js-product");(0,d.A)(),v(document.querySelectorAll('.js-catalog-grid [data-ecom="0"]')),(0,g.F)(t)})),(0,y.A)(),v(document.querySelectorAll('.js-catalog-grid [data-ecom="0"]'))}))},9889:function(t,e,n){function o(t,e){let n;return function(){const o=this,i=arguments;clearTimeout(n),n=setTimeout((()=>{t.apply(o,i)}),e)}}n.d(e,{A:function(){return o}})}},function(t){t.O(0,[8096],(function(){return t(t.s=4430)})),t.O()}]);