`):(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()}]);