"use strict";(self.webpackChunkgulp_template=self.webpackChunkgulp_template||[]).push([[57,5994,6955],{3782:function(e,t,n){var o=n(9336),i=n(2240),r=n(2585),c=n(7083),s=n(883),a=n(600),l=n(837),u=n(9845),d=n(2840),p=n(1238),f=n(5994),m=n(9889);function h(e,t,n,o,i,r,c){try{var s=e[r](c),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function c(e){h(r,o,i,c,s,"next",e)}function s(e){h(r,o,i,c,s,"throw",e)}c(void 0)}))}}const b={slidesPerView:1,spaceBetween:20,preloadImages:!1,lazy:{enabled:!0,loadPrevNext:!0,loadPrevNextAmount:5},breakpoints:{996:{slidesPerView:"auto",navigation:{nextEl:".slider-button-next",prevEl:".slider-button-prev"}}},on:{init(e){e.isLocked&&window.matchMedia("(min-width: 996px)").matches&&(e.navigation.nextEl.style.display="none",e.navigation.prevEl.style.display="none")}}};window.addEventListener("DOMContentLoaded",(()=>{function e(e=null){let t=document.querySelectorAll(".js-basket-product");t=[...t].filter(((e,n)=>{var o,i,r,c,s;return(null==e||null===(o=e.querySelector(".selective-product-checkbox .js-code-checkbox"))||void 0===o?void 0:o.checked)||(null===(r=t[n-1])||void 0===r||null===(i=r.querySelector(".selective-product-checkbox .js-code-checkbox"))||void 0===i?void 0:i.checked)&&(null===(s=t[n-1])||void 0===s||null===(c=s.querySelector(".switcher"))||void 0===c?void 0:c.classList.contains("acitev"))}));const n=document.querySelector(".js-count-all-products"),o=document.querySelector(".js-sum-all-products"),r=document.querySelector(".js-products-nds"),c=document.querySelector(".js-sum-discount-all-products");if(e){const t=e.target.closest(".js-basket-product");(0,i.D)(t)}(0,i.Te)(t,n),(0,i.v1)(t,o,"productBaseSum","data-sum-all-products"),(0,i.R$)(r,Number(null==o?void 0:o.dataset.sumAllProducts)||0),(0,i.v1)(t,c,"productSum"),function(e){const t=document.querySelector(".js-confirm-order");t&&(parseInt(e)<=0?t.classList.add("disabled"):t.classList.remove("disabled"))}(null==c?void 0:c.textContent),function(e,t){const n=document.querySelector(".js-confirm-order-fixed"),o=document.querySelector(".js-total-order-fixed");n&&parseInt(t)<=0?(n.classList.add("disabled"),o.textContent="0 шт,. 0 ₽"):(n.classList.remove("disabled"),o.textContent=`${e.textContent},. ${t} ₽`)}(n,c.textContent)}function t(e){"Enter"===e.code&&e.target.blur()}function h(e){return y.apply(this,arguments)}function y(){return y=v((function*(t){const o=t.target.closest(".js-basket-product");let i=o.dataset.productId||"",r=o.dataset.card||"";const c=t.target.closest(".js-count-picker").querySelector(".js-count-picker-input");if(e(t),o.getAttribute("data-package-id")&&(i=o.getAttribute("data-package-id"),r=o.getAttribute("data-package-id")),c){const o=yield(0,a.A)({ACTION:"updateQuantity",ITEM_ID:i,QUANTITY:c.value});if("ERROR"===o.STATUS&&o.LIMIT_EXCEEDED){const{default:i}=yield n.e(3768).then(n.bind(n,3768));i(o.MAX_QUANTITY),window.APP.BASKET[r]&&(c.value=window.APP.BASKET[r].QUANTITY,e(t))}if("SUCCESS"===o.STATUS){const e=document.querySelector(".js-products-discount");if(e&&o.TOTAL_DISCOUNT&&(e.setAttribute("data-products-discount",o.TOTAL_DISCOUNT),e.innerHTML=o.TOTAL_DISCOUNT),e&&!o.TOTAL_DISCOUNT){const t=e.closest(".basket-aside__info-list-item");t&&t.remove()}window.APP.BASKET[r]&&(window.APP.BASKET[r].QUANTITY=c.value)}}})),y.apply(this,arguments)}function g(e,t){return A.apply(this,arguments)}function A(){return A=v((function*(e,t){C(!1);try{"all"==e?yield(0,a.A)({ACTION:"addAll2delay"}):yield(0,a.A)({ACTION:"add2delay",ITEM_ID:e||"",PACKAGE_ID:t||""})}catch(e){console.log(e)}})),A.apply(this,arguments)}function E(){return E=v((function*(e,t){return C(!1),yield(0,a.A)({ACTION:"add2basketComplect",ITEM_ID:e||"",QUANTITY:t||1})})),E.apply(this,arguments)}function k(){return k=v((function*(e){return C(!1),yield(0,a.A)({ACTION:"removeFromBasket",ITEM_ID:e||""})})),k.apply(this,arguments)}function S(e,t,n,o){return T.apply(this,arguments)}function T(){return T=v((function*(e,t,n,o){C(!1);try{return"all"==e?yield(0,a.A)({ACTION:"removeAllFromDelay"}):yield(0,a.A)({ACTION:"add2basket",ITEM_ID:e||"",QUANTITY:t||1,PACKAGE_ID:n||"",QUANTITY_PACKAGE:o||1})}catch(e){console.log(e)}})),T.apply(this,arguments)}function w(e,t,n,o,i){return L.apply(this,arguments)}function L(){return L=v((function*(e,t,n,o,i){C(!1);try{const r=yield(0,a.A)({ACTION:"removeFromBasket",ITEM_ID:e||""});if(i&&(yield(0,a.A)({ACTION:"removeFromBasket",ITEM_ID:i||""})),"SUCCESS"===r.STATUS){const e=document.querySelector(".js-products-discount");if(o.length&&o.forEach((e=>{Number(r.AMOUNT)>99?e.innerText="99":e.innerText=r.AMOUNT})),e&&r.TOTAL_DISCOUNT&&(e.setAttribute("data-products-discount",r.TOTAL_DISCOUNT),e.innerHTML=r.TOTAL_DISCOUNT),e&&!r.TOTAL_DISCOUNT){const t=e.closest(".basket-aside__info-list-item");t&&t.remove()}0===Number(r.AMOUNT)&&t&&Number(0===r.AMOUNT_DELAY)&&(t.innerHTML=n)}}catch(e){console.log(e)}})),L.apply(this,arguments)}function N(){return N=v((function*(e,t,n){try{(0,d.Yj)("SHOW_BASKET_PROMOTION"),yield(0,a.A)({ACTION:"clear-basket"}),n.length&&n.forEach((e=>{e.innerText=0})),e&&(e.innerHTML=t)}catch(e){console.log(e)}})),N.apply(this,arguments)}function I(e){const t=document.querySelector(".basket"),n='\n
\n
Ваша корзина пуста
\n \n
\n ',o=document.querySelectorAll(".js-basket-button-count");if("all"!==e){const r=document.querySelector(`.js-basket-product[data-product-id="${e}"]`);var i;if(r)if(r.parentNode.removeChild(r),null===(i=r.querySelector(".switcher"))||void 0===i?void 0:i.classList.contains("active")){const e=r.querySelector(".js-basket-product.basket-table__package").getAttribute("data-product-id");w(r.getAttribute("data-product-id"),t,n,o,e)}else w(r.getAttribute("data-product-id"),t,n,o)}else!function(e,t,n){N.apply(this,arguments)}(t,n,o)}function _(e){const t=e.target.closest(".js-basket-product").dataset.productId||"";(0,a.A)({ACTION:"setDntCut",ITEM_ID:t}).then((t=>{t||(e.target.checked=!e.target.checked)}))}function x(e){const t=e.target.closest(".js-basket-promo"),n=t.querySelector(".js-basket-promo-message"),o=t.querySelector(".js-basket-promo-input");o&&(o.addEventListener("change",(function(){t.classList.remove("error"),t.classList.remove("success"),n.classList.add("hidden")})),o.addEventListener("keyup",(function(){t.classList.remove("error"),t.classList.remove("success"),n.classList.add("hidden")})),(0,a.A)({ACTION:"addDiscount",PROMOCODE:o.value}).then((e=>{e.MESSAGE&&(n.innerHTML=e.MESSAGE,n.classList.remove("hidden")),t.classList.remove("success"),t.classList.remove("error"),"ERROR"===e.STATUS?t.classList.add("error"):"SUCCESS"===e.STATUS&&(t.classList.add("success"),setTimeout((()=>{window.location.reload()}),1e3))})))}function C(n=!0){const o=document.querySelectorAll(".js-basket-product"),r=document.querySelector(".js-basket-promo-button");r&&(n||r.removeEventListener("click",x),r.addEventListener("click",x)),o.length&&o.forEach((e=>{const o=e.querySelector(".js-count-picker"),r=e.querySelector(".js-count-picker-input"),c=(e.querySelectorAll(".js-delete-product"),o.querySelector(".js-count-picker-decrease")),s=o.querySelector(".js-count-picker-increase"),a=e.querySelector(".js-dont-cut-checkbox");if((0,i.D)(e),c&&s&&r){n||(c.removeEventListener("click",h),s.removeEventListener("click",h),r.removeEventListener("blur",h),r.removeEventListener("keypress",t),a&&a.removeEventListener("change",_));const e=(0,m.A)(h,500);c.addEventListener("click",e),s.addEventListener("click",e),r.addEventListener("blur",h),r.addEventListener("keypress",t)}a&&a.addEventListener("change",_)})),e()}function j(){return j=v((function*(){const{default:e}=yield Promise.all([n.e(8096),n.e(6531)]).then(n.bind(n,6531));e(b,"js-products-slider"),(0,p.A)()})),j.apply(this,arguments)}const q=function(){var e=v((function*(){if(document.querySelector(".js-dialog-reg-fiz")){const{default:e}=yield n.e(5439).then(n.bind(n,7820));e()}}));return function(){return e.apply(this,arguments)}}();!function(){const t=document.querySelectorAll("[data-package]"),n=document.querySelectorAll("[data-switcher]");n.length&&t.length&&n.forEach(((n,o)=>{n.classList.contains("active")?t[o].classList.remove("hidden"):t[o].classList.add("hidden"),n.addEventListener("click",(i=>{var r;n.classList.contains("active")?t[o].classList.add("hidden"):t[o].classList.remove("hidden"),n.classList.toggle("acitev"),n.classList.contains("acitev")&&(null===(r=n.closest(".js-basket-product").querySelector(".selective-product-checkbox .js-code-checkbox"))||void 0===r?void 0:r.checked)?function(e,t){return E.apply(this,arguments)}(n.closest(".js-basket-product").getAttribute("data-card")).then((e=>{e.itemId&&n.closest(".js-basket-product").querySelector(".basket-table__package.js-basket-product").setAttribute("data-product-id",e.itemId)})):function(e){k.apply(this,arguments)}(n.closest(".js-basket-product").querySelector(".basket-table__package.js-basket-product").getAttribute("data-product-id")),e()}))}))}(),function(){const e=document.querySelectorAll('[data-switcher="switcher"]');e.length&&e.forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault(),e.classList.toggle("active")}))}))}(),function(){const e=document.querySelectorAll(".js-discount-accordion");e.length&&e.forEach((e=>{e.querySelector(".js-discount-accordion-button").addEventListener("click",(()=>{e.classList.toggle("opened")}))}))}(),(0,o.default)(),C(),function(){const e=document.querySelector(".js-dialog-save-basket"),t=document.querySelectorAll(".js-dialog-save-basket-button");if(e&&t.length){const n=e.querySelector(".js-form-save-basket");(0,s.A)(n),t.forEach((t=>{t.addEventListener("click",(function(){(0,r.default)(new c.default(e))}))}))}}(),(0,l.A)(I,"productId"),(0,u.A)(),function(){const e=document.querySelector(".js-dialog-promotion");if(e){const t=new c.default(e);(0,d.Ri)("SHOW_BASKET_PROMOTION")||window.addEventListener("showBasketPromotion",(()=>{(0,r.default)(t),t.on("destroy",(()=>{(0,d.TV)("SHOW_BASKET_PROMOTION","Y",{"max-age":3600})}))}))}}(),function(){const t=()=>document.querySelectorAll(".js-selective-product-checkbox--desktop .js-code-checkbox"),o=()=>document.querySelectorAll(".js-selective-product-checkbox--mobile .js-code-checkbox"),i=document.querySelectorAll(".js-basket-table__actions-select-all .js-code-checkbox"),r=document.querySelectorAll(".js-basket-table__actions-delete-selected");if(!(t().length||o().length||i.length||r.length))return;const c=e=>{[...t(),...o()].forEach((t=>t.checked=e))},s=e=>i.forEach((t=>t.checked=e)),a=()=>[...t(),...o()].every((e=>e.checked));i.forEach((t=>{t.addEventListener("change",(t=>{const n=t.target.checked;n?S("all"):g("all"),c(n),s(n),e()}))})),(0,l.A)(((e,t)=>{"undefined"===e?u().forEach((e=>{I(e)})):I(e),r.forEach((e=>{a()||s(!1)}),"productId")})),[...t()].forEach(((e,t)=>{[...o()][t].checked=e.checked}));const u=()=>[...new Set([...t(),...o()].filter((e=>e.checked)).map((e=>e.value)))],d=e=>new Map([...e].map((e=>[e.value,e]))),f=(e,t)=>{const n=t.get(e.value);n&&(n.checked=e.checked)},m=(t,o)=>{t().forEach((t=>{t.addEventListener("change",(i=>{let r=i.target.getAttribute("data-product-id");if(i.target.checked){var c;let e=i.target.closest(".js-basket-product").querySelector(".js-count-picker-input").value;if(null===(c=i.target.closest(".js-basket-product").querySelector(".switcher"))||void 0===c?void 0:c.classList.contains("active")){const c=i.target.closest(".js-basket-product").querySelector(".basket-table__package.js-basket-product");S(r,e,c.getAttribute("data-product-id"),c.querySelector(".count-picker__input").value).then(function(){var e=v((function*(e){if("ERROR"===e.STATUS&&e.LIMIT_EXCEEDED){const{default:r}=yield n.e(3768).then(n.bind(n,3768));r(e.MAX_QUANTITY),i.target.checked=!1,f(t,o)}}));return function(t){return e.apply(this,arguments)}}())}else S(r,e).then(function(){var e=v((function*(e){if("ERROR"===e.STATUS&&e.LIMIT_EXCEEDED){const{default:e}=yield n.e(3768).then(n.bind(n,3768));e(data.MAX_QUANTITY),i.target.checked=!1,f(t,o)}}));return function(t){return e.apply(this,arguments)}}())}else{var l;const e=null===(l=i.target.closest(".js-basket-product").querySelector(".basket-table__package.js-basket-product:not(.hidden)"))||void 0===l?void 0:l.getAttribute("data-product-id");e?g(r,e):g(r)}f(t,o),a()?s(!0):s(!1),e(),(0,p.A)()}))}))};window.getMobileCheckboxes=o,window.createCheckboxMap=d,m(t,d(o())),m(o,d(t()))}(),function(){j.apply(this,arguments)}(),function(){const e=document.querySelector(".js-confirm-order-fixed"),t=document.querySelector(".js-confirm-order");if(e&&t){const n=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting?e.classList.add("hidden"):window.matchMedia("(max-width: 996px)").matches&&e.classList.remove("hidden")}))}),{threshold:.5,rootMargin:"-104px 0px -52px 0px"});n.observe(t)}}(),(0,f.default)(),q()}))},4965:function(e,t,n){function o(){const e=document.querySelectorAll(".js-accordion:not(.init)");e.length&&e.forEach((e=>{const t=e.querySelector(".js-accordion-content"),n=e.querySelector(".js-accordion-button");n&&t&&(e.classList.add("init"),n.addEventListener("click",(function(){e.classList.toggle("show"),e.classList.contains("show")?t.style.maxHeight=`${t.scrollHeight}px`:t.style.maxHeight=0})))}))}n.d(t,{A:function(){return o}})},2240:function(e,t,n){function o(e){const t=e.querySelector(".js-product-cost"),n=Number(t.dataset.productCost),o=Number(t.dataset.productBasePrice),i=e.querySelector(".js-product-sum"),r=Number(e.querySelector(".js-count-picker-input").value),c=n*r,s=o*r,a=e=>{e.setAttribute("data-product-sum",c),e.setAttribute("data-product-base-sum",s),e.innerText=`${c.toLocaleString("ru-RU")} ₽`};t&&i&&(window.matchMedia("(min-width: 996px)").matches?a(i):a(t))}function i(e=[],t){let n=0;e.forEach((e=>{const t=Number(e.querySelector(".js-count-picker-input").value);n+=t})),t&&(t.setAttribute("data-count-all-products",n),t.innerText=`${n} шт.`)}function r(e=[],t,n,o){let i=0;e.forEach((e=>{const t=window.matchMedia("(min-width: 996px)").matches?e.querySelector(".js-product-sum"):e.querySelector(".js-product-cost"),o=Number(t.dataset[n]);i+=o})),t&&(o&&t.setAttribute(o,i),t.innerText=`${i.toLocaleString("ru-RU")} ₽`)}function c(e,t=0){const n=t/122*22;e&&(e.setAttribute("data-products-nds",n),e.innerText=`${n.toLocaleString("ru-RU",{minimumFractionDigits:2,maximumFractionDigits:2})} ₽`)}n.d(t,{D:function(){return o},R$:function(){return c},Te:function(){return i},v1:function(){return r}})},3218:function(e,t,n){function o(){const e=document.body,t=window.innerWidth-e.clientWidth;if(e.style.transition="margin-right 0.3s easy-in-out",e.style.marginRight=`${t}px`,e.style.overflow="hidden",!window.matchMedia("(min-width: 996px)").matches){const t=window.pageYOffset;e.style.top=-t+"px",e.style.position="fixed",e.style.width="100%"}}function i(){const e=document.body;if(e.style.transition="margin-right 0s easy-in-out",e.style.marginRight="0",e.style.overflow="unset",!window.matchMedia("(min-width: 996px)").matches){const t=Math.abs(parseInt(e.style.top||0,10));e.style.position="static",e.style.width="auto",e.style.removeProperty("top"),window.scrollTo(0,t||0)}}n.d(t,{$:function(){return o},W:function(){return i}})},9336:function(e,t,n){function o(e){const t=(e||document).querySelectorAll(".js-count-picker");t&&t.length&&t.forEach((e=>{const t=e.querySelector(".js-count-picker-increase"),n=e.querySelector(".js-count-picker-decrease"),o=e.querySelector(".js-count-picker-input"),i=o.getAttribute("step")?parseFloat(o.getAttribute("step")):1,r=o.getAttribute("step")?parseFloat(o.getAttribute("step")):1,c=o.getAttribute("min-value")?parseFloat(o.getAttribute("min-value")):1,s=o.getAttribute("max-value")?parseFloat(o.getAttribute("max-value")):1/0;n.setAttribute("disabled",!0),setTimeout((()=>{parseFloat(o.value)>c&&n.removeAttribute("disabled"),parseFloat(o.value)>=s&&t.setAttribute("disabled",!0)}),300),o.addEventListener("keydown",(function(e){-1===o.value.indexOf(",")&&-1===o.value.indexOf(".")||","!==e.key&&"."!==e.key||e.preventDefault(),1!==r?","!==e.key&&"."!==e.key&&(e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&8!==e.keyCode&&46!==e.keyCode&&e.preventDefault():(e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&8!==e.keyCode&&46!==e.keyCode&&e.preventDefault(),o.dispatchEvent(new Event("input"))})),o.addEventListener("change",(function(){if(isNaN(parseFloat(o.value))||""===o.value.trim())return o.value=c,n.setAttribute("disabled",!0),t.removeAttribute("disabled"),void o.dispatchEvent(new Event("input"));Number(o.value)<=c?n.setAttribute("disabled",!0):n.removeAttribute("disabled"),Number(o.value)>=s?t.setAttribute("disabled",!0):t.removeAttribute("disabled"),Number(o.value)>s&&(o.value=s),parseFloat(o.value)i&&n.removeAttribute("disabled"),Number(o.value)>=s&&t.setAttribute("disabled",!0)})),n.addEventListener("click",(function(){o.value=o.value.replace(",","."),o.value=Number(o.value)-r,Number.isInteger(Number(o.value))||(o.value=Number(o.value).toFixed(1)),o.dispatchEvent(new Event("input")),Number(o.value)===c&&n.setAttribute("disabled",!0),Number(o.value){c.addEventListener("click",(function(){const c=this.dataset.alertTitle,d=this.dataset.alertDescription,p=this.dataset[t];s&&c&&(s.innerText=c),a&&d&&(a.innerText=d),r&&e&&(r.removeEventListener("click",l),r.addEventListener("click",l)),(0,i.default)(new o.default(n),r?u:null,r?[r,p,t]:[])}))}))}}},9845:function(e,t,n){n.d(t,{A:function(){return l}});var o=n(7083),i=n(2585),r=n(600),c=n(3016);function s(e,t,n,o,i,r,c){try{var s=e[r](c),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function c(e){s(r,o,i,c,a,"next",e)}function a(e){s(r,o,i,c,a,"throw",e)}c(void 0)}))}}function l(){return u.apply(this,arguments)}function u(){return u=a((function*(){const e=document.querySelector(".js-dialog-buy-click");let t;if(e){const n=document.querySelectorAll(".js-dialog-buy-click-button");if(n.length){n.forEach((t=>{t.addEventListener("click",a((function*(){e&&(0,i.default)(new o.default(e))})))}));let u,d,p=e.querySelector("[data-buy-click-form]"),f=e.querySelectorAll(".js-input-base[data-validations]:not(.novalidate)"),m=e.querySelector("[data-buy-click-user]"),h=n[0].getAttribute("data-id"),v=document.querySelector(".js-buy-click");if("/cart/"===window.location.pathname){if(d=yield(0,r.A)({ACTION:"getBasketData"}),d){let g=document.querySelector("[data-products-buy-click]");g.innerHTML="",d.PRODUCTS.forEach(((e,t)=>{g.innerHTML+=`
\n \n ${e.NAME}\n \n
\n
${e.NAME}
\n
Артикул: ${e.ARTICLE}
\n ${e.COLLECTION?'
Коллекция: '+e.COLLECTION+"
":""}\n
\n
`}))}}else u=yield(0,r.A)({ACTION:"getProductData",ITEM_ID:h}),u&&(document.querySelector("[data-products-buy-click]").innerHTML=`
\n \n ${u.NAME}\n \n
\n
${u.NAME}
\n
Артикул: ${u.ARTICLE}
\n ${u.COLLECTION?'
Коллекция: '+u.COLLECTION+"
":""}\n
\n
`);let b=yield(0,r.A)({ACTION:"getUserData"});function y(e){"string"==typeof e&&e.length>0&&v.removeAttribute("disabled")}if(0!==b.USER_ID?(m.classList.remove("hidden"),m.innerHTML=`
\n ${b.LAST_NAME} ${b.NAME} ${b.SECOND_NAME}\n
\n
${b.PHONE}
\n
${b.EMAIL}
`):(p.classList.remove("hidden"),t=window.smartCaptcha.render("captcha-container-buy1Click",{sitekey:b.CAPTCHA_CLIENT,hideShield:!0,callback:y})),v){function A(){return E.apply(this,arguments)}function E(){return E=a((function*(){let e=Number(document.querySelector(".js-count-picker-input").value),t={sessid:BX.bitrix_sessid()};0===b.USER_ID?(0,c.MG)([...f])&&(b.NAME=p.querySelector('.js-input-base[name="NAME"]').value,b.EMAIL=p.querySelector('.js-input-base[name="EMAIL"]').value,b.PHONE=p.querySelector('.js-input-base[name="PHONE"]').value,t.NAME=b.NAME,t.EMAIL=b.EMAIL,t.PHONE=b.PHONE,window.smartCaptchaInit&&(t["smart-token"]=window.smartCaptcha.getResponse(),"/cart/"===window.location.pathname?t.ACTION="buy1ClickBasket":(t.ACTION="buy1Click",t.ITEM_ID=h,t.QUANTITY=e),yield s(t))):(t.userData=b,"/cart/"===window.location.pathname?t.ACTION="buy1ClickBasket":(t.ACTION="buy1Click",t.ITEM_ID=h,t.QUANTITY=e),yield s(t))})),E.apply(this,arguments)}v.removeEventListener("click",A),v.addEventListener("click",A)}}function s(e){return l.apply(this,arguments)}function l(){return(l=a((function*(n){const o=yield(0,r.A)(n);let i=e.querySelector("[data-error-item]");"SUCCESS"===o.STATUS?(window.location=o.LINK,i.innerHTML="",i.classList.add("hidden")):(i.innerHTML="",i.classList.remove("hidden"),o.ERRORS.forEach(((e,t)=>{0!==t&&(i.innerHTML+="
"),i.innerHTML+=e})),e.querySelector(".dialog-wrapper").scrollTo({behavior:"smooth",top:i.offsetTop})),window.smartCaptcha.reset(t)}))).apply(this,arguments)}}})),u.apply(this,arguments)}},2585:function(e,t,n){n.r(t),n.d(t,{default:function(){return i}});var o=n(3218);function i(e,t=null,n=[]){const i=document.querySelector(".js-navigation");e&&(i.classList.contains("navigation__fixed--white")||i.classList.add("navigation__fixed--white"),e.on("show",(()=>{(0,o.$)(),t&&t(...n)})),e.on("hide",(()=>{(0,o.W)(),e.destroy()})),e.show())}},5994:function(e,t,n){n.r(t),n.d(t,{default:function(){return r}});var o=n(7083),i=n(2585);function r(){const e=document.querySelector(".js-dialog-reg-fiz"),t=document.querySelectorAll(".js-short-reg");if(!e)return;const n=e.classList.contains("has-error");let r=null;n&&(r=new o.default(e),(0,i.default)(r)),t.forEach((t=>{t.addEventListener("click",(()=>{r=new o.default(e),(0,i.default)(r)}))}))}},883:function(e,t,n){n.d(t,{A:function(){return c}});var o=n(3016);function i(e,t,n,o,i,r,c){try{var s=e[r](c),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(o,r){var c=e.apply(t,n);function s(e){i(c,o,r,s,a,"next",e)}function a(e){i(c,o,r,s,a,"throw",e)}s(void 0)}))}}function c(e,t,n=!0){e&&e.addEventListener("submit",function(){var i=r((function*(i){i.preventDefault();const r=this.querySelectorAll(".js-input-base[data-validations]:not(.novalidate)"),c=this.querySelectorAll(".js-select[data-validations]:not(.novalidate)"),s=Array.from(c).map((e=>(e.selectedOptions[0].classList.add(".js-select-option"),e.selectedOptions[0].dataset.validations=e.dataset.validations,e.selectedOptions[0]))),a=(0,o.MG)([...r,...s]);if(n&&a)if(e.classList.contains("js-registration-form")){let n=new FormData(e),o=yield fetch("/local/templates/stenova/ajax/checkEmail.php",{method:"POST",body:JSON.stringify({EMAIL:n.get("REGISTER[EMAIL]")})}),i=yield o.json();if(i.success)"function"==typeof t&&t(),function(e){const t=e.querySelectorAll('[name="UF_INN"]');let n="";for(const e of t)e.value?n=e.value:e.value=n;e.submit()}(e);else{const t=e.querySelector('[name="REGISTER[EMAIL]"]').closest(".input-base");t.classList.add("error"),t.querySelector(".input-base__error").textContent=i.message,t.style.marginBottom="2.8rem",t.scrollIntoView({block:"center",behavior:"smooth"})}}else e.classList.contains("js-buy-cards-form")?(document.addEventListener("capchaVerified",(()=>{ym(25098083,"reachGoal","oplata_cards"),this.submit()})),window.smartCaptcha.reset(),window.smartCaptcha.execute()):("function"==typeof t&&t(),this.submit())}));return function(e){return i.apply(this,arguments)}}())}},600:function(e,t,n){function o(e,t,n,o,i,r,c){try{var s=e[r](c),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function i(e){return r.apply(this,arguments)}function r(){return e=function*(e){const t=new FormData;for(let n in e)t.append(n,e[n]);t.append("IS_AJAX_ACTION","Y");try{const e=yield fetch("/",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:t});return yield e.json()}catch(e){return console.log("error",e),!1}},r=function(){var t=this,n=arguments;return new Promise((function(i,r){var c=e.apply(t,n);function s(e){o(c,i,r,s,a,"next",e)}function a(e){o(c,i,r,s,a,"throw",e)}s(void 0)}))},r.apply(this,arguments);var e}n.d(t,{A:function(){return i}})},1238:function(e,t,n){n.d(t,{A:function(){return a}});var o=n(4965),i=n(600),r=n(3218);function c(e,t,n,o,i,r,c){try{var s=e[r](c),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function s(e){c(r,o,i,s,a,"next",e)}function a(e){c(r,o,i,s,a,"throw",e)}s(void 0)}))}}function a(){(0,o.A)();const e=document.querySelectorAll(".js-split-price");e.length&&e.forEach(function(){var e=s((function*(e){if(document.querySelector("[data-sum-discount-all-products]")){let e=document.querySelector("[data-sum-discount-all-products]").getAttribute("data-sum-discount-all-products");const t=yield(0,i.A)({ACTION:"getHalvaPlanHtml",PRICE:e});let n=document.querySelector(".split-price__cost"),o=document.querySelector(".js-split-price"),r=o?o.querySelector(".card-split-cost"):void 0;"success"===t.STATUS?(r&&r.remove(),n.innerHTML="Разбить на части без переплат",o.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),o.appendChild((new DOMParser).parseFromString(t.html,"text/html").querySelector(".card-split-cost"))):("USER"===t.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=t.MESSAGE,r&&r.classList.add("hidden"))}e.addEventListener("click",(e=>{e.preventDefault()}));const t=e.querySelectorAll('[data-modal="open"]'),n=document.querySelector('[data-modal="container"]'),o=n.querySelectorAll('[data-modal="close"]');t&&t.forEach((e=>{e&&e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),n.classList.add("active"),(0,r.$)()}))})),o&&o.forEach((e=>{e&&e.addEventListener("click",(e=>{e.stopPropagation(),n.classList.contains("active")&&(n.classList.remove("active"),(0,r.W)())}))}))}));return function(t){return e.apply(this,arguments)}}())}},3016:function(e,t,n){n.d(t,{LF:function(){return r},M2:function(){return l},MG:function(){return v},Nh:function(){return p},X5:function(){return d},bB:function(){return c},lZ:function(){return i},tJ:function(){return u}});const o=e=>!isNaN(Number(e.trim())),i=e=>11===String(e).replace(/[^\d]/g,"").substring(0,11).length,r=e=>new RegExp(/^(\+?\d)\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{2})[- ]?(\d{2})$/).test(e),c=e=>o(e)&&12===String(e.trim()).length,s=e=>new RegExp(/^[^@]+@[\w\-]+(\.\w+)+\w$/).test(e)||0===e.trim().length,a=e=>new RegExp(/^[^@]+@[\w\-]+(\.\w+)*\.ru$/).test(e)||0===e.trim().length,l=e=>o(e)&&6===String(e).length,u=e=>{let t=!0;for(let n=0;n10){t=!1;break}return t},d=e=>e.files.length<=10,p=(e,t,n=".input-base",o="RU")=>{const i=e.closest(n);if(i){const e=i.querySelector(`${n}__error`);i.classList.add(h),e&&(e.innerText=m[t].text[o])}},f=e=>{const t=e.closest(".input-base-captcha")||e.closest(".input-base")||e.closest(".input-file-base")||e.closest(".js-select-wrapper"),n=document.querySelector(".js-navigation");if(t&&n){const e=t.getBoundingClientRect();document.querySelector('.dialog:not([aria-hidden="true"])')?document.querySelector('.dialog:not([aria-hidden="true"]) .dialog-wrapper').scrollTo({top:t.offsetTop-30,behavior:"smooth"}):window.scrollTo({top:e.top+window.pageYOffset-n.clientHeight-60,behavior:"smooth"})}},m={required:{text:{RU:"Поле должно быть заполнено",EN:"Field must be filled"},action:e=>0!==String(e).length},requiredFiles:{text:{RU:"Поле должно быть заполнено",EN:"Field must be filled"},action:e=>e.files&&e.files.length},phone:{text:{RU:"Номер телефона должен состоять из 11 цифр",EN:"Phone number must be 11 digits"},action:i},inn:{text:{RU:"ИНН должен состоять из 10 или 12 цифр",EN:"TIN must be 10 or 12 digits"},action:e=>o(e)&&(10===String(e.trim()).length||12===String(e.trim()).length)},innIP:{text:{RU:"ИНН должен состоять из 12 цифр",EN:"TIN must be 12 digits"},action:c},kpp:{text:{RU:"КПП должен состоять из 9 цифр",EN:"PPC must consist of 9 digits"},action:e=>o(e)&&9===String(e.trim()).length||0===String(e.trim()).length},email:{text:{RU:"Формат почты: name@domain.ru",EN:"Mail format: name@domain.ru"},action:s},emailWithRuDomain:{text:{RU:"Допустимы только адреса в домене .ru",EN:"Only addresses in domain . ru"},action:a},onlyNumbers:{text:{RU:"Поле должно содержать только цифры",EN:"The field must contain only numbers"},action:o},cardNumber:{text:{RU:"Номер карты должен состоять из 15 цифр",EN:"Card number must be 15 digits"},action:e=>{const t=e.replace(/\s/g,"");return 15===t.length&&o(t)||0===t.length}},cost:{text:{RU:"Поле должно состоять только из цифр",EN:"The field must contain only numbers"},action:e=>{const t=e.replace(/\s/g,"");return o(t)||0===t.length}},password:{text:{RU:"Пароль должен содержать не менее 8 символов",EN:"Password must contain at least 8 characters"},action:e=>e.length>7||0===e.length},confirmPassword:{text:{RU:"Пароли должны совпадать",EN:"Passwords must match"},action:({oldPassword:e,newPassword:t})=>e===t},korCheck:{text:{RU:"Корреспондентский счет должен состоять из 11 цифр",EN:"Correspondent account must be 11 digits"},action:e=>o(e)&&11===String(e.trim()).length||0===String(e.trim()).length},payCheck:{text:{RU:"Расчетный счет должен состоять из 14 цифр",EN:"Account must be 14 digits long"},action:e=>o(e)&&14===String(e.trim()).length||0===String(e.trim()).length},bik:{text:{RU:"БИК должен состоять из 12 цифр",EN:"BIC must be 12 digits"},action:e=>o(e)&&12===String(e.trim()).length||0===String(e.trim()).length},phoneOrEmail:{text:{RU:"Не корректно заполнен email или телефон",EN:"Incorrectly filled email or phone"},action:e=>r(e)||s(e)||0===String(e.trim()).length},phoneOrEmailWithRuDomain:{text:{RU:"Не корректно заполнен email (допустимы адреса в домене .ru) или телефон",EN:"Incorrectly filled email (only addresses in domain . ru) or phone"},action:e=>r(e)||s(e)&&a(e)||0===String(e.trim()).length},confirmCode:{text:{RU:"Код должен состоять из 6 цифр",EN:"Code must be 6 digits"},action:l},fileMaxWeight:{text:{RU:"Вес одного файла должен быть не более 10 Мбайт",EN:"The weight of one file should be no more than 10 MB"},action:u},filesMaxCount:{text:{RU:"Можно загрузить не более 10 файлов",EN:"You can upload a maximum of 10 files"},action:d},doNotConfirmPhone:{text:{RU:"Номер должен быть подтвержден",EN:"Number must be confirmed"},action:e=>!1},nominalMin1000:{text:{RU:"Номинал карты не может быть менее 1000",EN:"The denomination of the card cannot be less than 1000"},action:e=>e>=1e3}},h="error";function v(e){let t=!0,n=null;if(e.length){const o=document.querySelectorAll(".js-language-radio");let i="RU";if(0!==o.length){const e=Array.from(o).find((e=>e.checked));i=e.value}e.forEach((e=>{const o=e.dataset.validations.split(",");for(let n of o){let o=".input-base",c=e.classList.contains("js-file-input")?{files:e.files,maxWeight:10}:e.value;if(e.classList.contains("js-file-input")&&(o=".input-file-base"),e.classList.contains(".js-select-option")&&(o=".select-wrapper"),"confirmPassword"===n){const t=e.closest(".js-form-container");if(t){var r;const n=(null===(r=t.querySelector(".js-input-password"))||void 0===r?void 0:r.value)||null;n&&(c={oldPassword:n,newPassword:e.value})}}if(!m[n].action(c)){t&&(t=!1),p(e,n,o,i);break}}t||n||(n=e)}))}return n&&f(n),t}},2840:function(e,t,n){function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){for(var t=1;t{e.apply(o,i)}),t)}}n.d(t,{A:function(){return o}})}},function(e){e.O(0,[8096],(function(){return e(e.s=3782)})),e.O()}]);