function t_forms__initForms(){var recBlocks=document.querySelectorAll('.r:not([data-record-type="1093"])');window.t_forms__inputData={},t_forms__addRecaptcha(),Array.prototype.forEach.call(recBlocks,(function(rec){var recid=rec.id;window.initForms[recid]||(t_forms__initEventPlaceholder(rec),t_forms__addInputItsGood(rec),t_forms__addAttrAction(rec),t_forms__onSubmit(rec),t_forms__onClick(rec),t_forms__onRender(rec),t_forms__addFocusOnTab(rec),t_onFuncLoad("t_throttle",(function(){window.addEventListener("resize",t_throttle((function(){t_forms__calculateInputsWidth(recid)})))})),window.initForms[recid]=!0)}))}function t_forms__addFocusOnTab(rec){if(!window.isMobile){var focusableElements=rec.querySelectorAll(".t-input, .t-select");if(focusableElements){var handlerType=null;document.addEventListener("keydown",(function(){handlerType="keyboard"})),document.addEventListener("mousedown",(function(){handlerType="mouse"})),document.addEventListener("visibilitychange",(function(){handlerType="mouse"})),Array.prototype.forEach.call(focusableElements,(function(focusableElement){focusableElement.addEventListener("focus",(function(){"keyboard"===handlerType&&((focusableElement.classList.contains("t-input_pvis")||focusableElement.classList.contains("t-input-phonemask"))&&(focusableElement=focusableElement.parentElement),focusableElement.classList.add("t-focusable"),handlerType=null)})),focusableElement.addEventListener("blur",(function(){focusableElement.classList.remove("t-focusable")}))}))}}}function t_forms__initEventPlaceholder(rec){var eventFocus="focus",eventBlur="blur";document.addEventListener||(eventFocus="focusin",eventBlur="focusout"),t_removeEventListener(rec,eventFocus,t_forms__removePlaceholder),t_addEventListener(rec,eventFocus,t_forms__removePlaceholder,!0),t_removeEventListener(rec,eventBlur,t_forms__addPlaceholder),t_addEventListener(rec,eventBlur,t_forms__addPlaceholder,!0)}function t_forms__removePlaceholder(event){var input=(event=event||window.event).target||event.srcElement;if("INPUT"===input.tagName){var inputGroup=input.closest("[data-input-lid]"),strPlace=input.getAttribute("placeholder"),inputId="";if(inputGroup)inputId=inputGroup.getAttribute("data-input-lid");else{var form=input.closest("form");form&&(inputId=form.getAttribute("data-input-lid"))}strPlace&&inputId&&(window.t_forms__inputData[inputId]=strPlace,input.setAttribute("placeholder",""))}}function t_forms__moveToErrorInput(inputId,currentErrorItem){var t_forms__focusIntoInput=function(event){var input;event.preventDefault(),document.getElementById(inputId).focus()};currentErrorItem&&(currentErrorItem.removeEventListener("click",t_forms__focusIntoInput),currentErrorItem.addEventListener("click",t_forms__focusIntoInput))}function t_forms__addPlaceholder(event){var input=(event=event||window.event).target||event.srcElement,inputGroup=input.closest("[data-input-lid]"),inputId="";if(inputGroup)inputId=inputGroup.getAttribute("data-input-lid");else{var form=input.closest("form");form&&(inputId=form.getAttribute("data-input-lid"))}var strPlace=window.t_forms__inputData[inputId]||"";strPlace&&inputId&&(input.setAttribute("placeholder",strPlace),window.t_forms__inputData[inputId]="")}function t_forms__addInputItsGood(rec){var allForms=rec.querySelectorAll(".js-form-proccess[data-formactiontype]");Array.prototype.forEach.call(allForms,(function(form){var formActionType=form.getAttribute("data-formactiontype"),inputItsGood=form.querySelector('input[name="form-spec-comments"]');"1"===formActionType||inputItsGood||form.insertAdjacentHTML("beforeend",'
')}))}function t_forms__addAttrAction(rec){var allForms=rec.querySelectorAll(".js-form-proccess");Array.prototype.forEach.call(allForms,(function(form){var formType;"2"===form.getAttribute("data-formactiontype")&&form.setAttribute("action","#")}))}function t_forms__calculateInputsWidth(recId){recId&&(recId=recId.replace("rec",""));var rec=document.querySelector("#rec"+recId);if(recId||!document.body.classList.contains("t706__body_cartwinshowed")&&!document.body.classList.contains("t706__body_cartpageshowed")||(rec=document.querySelector(".t706")),rec){var formWrapper=rec.querySelector(".t-form__inputsbox");if(formWrapper){formWrapper.closest(".t706")&&formWrapper.classList.add("t-form__inputsbox_inrow");var fields=rec.querySelectorAll(".t-input-group_widthdef, .t-input-group_inrow");if(formWrapper.classList.contains("t-form__inputsbox_inrow")||(fields=rec.querySelectorAll(".t-input-block_width")),0!==fields.length){(formWrapper.classList.contains("t-form__inputsbox_vertical-form")||formWrapper.closest(".t706"))&&formWrapper.classList.add("t-form__inputsbox_flex");var formWrapperWidth=formWrapper.offsetWidth,fieldsType=["rd","ri","uc","ws","hd","fr","st"];Array.prototype.forEach.call(fields,(function(field){if(formWrapper.classList.contains("t-form__inputsbox_inrow")||(field=field.closest(".t-input-group")),field&&field.classList.contains("t-input-group_inrow-withsibling")){var nextField=field.nextElementSibling,incorrectType=fieldsType.filter((function(type){return nextField.classList.contains("t-input-group_"+type)}));if(!nextField||0!==incorrectType.length||!(nextField.classList.contains("t-input-group_inrow")&&!field.classList.contains("t-input-group_widthdef")||field.classList.contains("t-input-group_widthdef")&&nextField.classList.contains("t-input-group")&&!nextField.classList.contains("t-input-group_inrow")))return field.classList.remove("t-input-group_inrow-withsibling"),void field.classList.add("t-input-group_inrow-last");nextField.classList.add("t-input-group_inonerow")}else field.classList.add("t-input-group_inrow-last");nextField&&field.classList.contains("t-input-group_widthdef")&&field.classList.contains("t-input-group_inrow-withsibling")&&nextField.classList.contains("t-input-group_inonerow")&&!nextField.classList.contains("t-input-group_inrow")&&(nextField.classList.add("t-input-group_widthdef"),nextField.classList.contains("t-input-group_inrow-withsibling")||nextField.classList.add("t-input-group_inrow-last"),nextField.classList.contains("t-input-group_inrow")&&field.classList.add("t-input-group_inrow-last")),formWrapper.classList.contains("t-form__inputsbox_inrow")||t_forms__calculateFieldsWidthInJS(field,formWrapperWidth)}));var allLastFieldsWithCertainWidth=rec.querySelectorAll(".t-input-group_inrow.t-input-group_inonerow.t-input-group_inrow-last");allLastFieldsWithCertainWidth.length>0&&t_forms__moveFieldToNextRow(allLastFieldsWithCertainWidth);var allLastFieldsWithDefWidth=rec.querySelectorAll(".t-input-group_widthdef.t-input-group_inrow-last");formWrapper.classList.contains("t-form__inputsbox_inrow")&&allLastFieldsWithDefWidth.length>0&&t_forms__combineFieldsWithDefWidth(allLastFieldsWithDefWidth,recId)}}}}function t_forms__moveFieldToNextRow(allLastFields){var rows;t_forms__createArrWithAllRows(allLastFields,"t-input-group_inrow").forEach((function(row){var isLongNextField=!1;if(row.forEach((function(field){field.classList.contains("t-input-group_inrow-last")&&field.nextElementSibling&&!field.nextElementSibling.classList.contains("t-input-group_inonerow")&&(isLongNextField=!0)})),!isLongNextField){var commonWidth=row.reduce((function(sum,field){var fieldClasses,widthClass=field.classList.value.split(" ").filter((function(fieldClass){return-1!==fieldClass.indexOf("t-input-group_width")})),characterQuantity=2,fieldWidth;return-1!==(widthClass=widthClass[0]).indexOf("100")&&(characterQuantity=3),sum+Number(widthClass.substr(widthClass.length-2,characterQuantity))}),0);commonWidth<=100||row.forEach((function(field){field.classList.contains("t-input-group_inrow-last")&&(field.style.marginRight="calc(100% - ("+(commonWidth-100)+"%)",field.style.flex="0 0 auto")}))}}))}function t_forms__combineFieldsWithDefWidth(allLastFields,recId){var allRowsWithDefWidth=[],rows;t_forms__createArrWithAllRows(allLastFields,"t-input-group_widthdef").forEach((function(row){var maxRowLength=4;if(row.length>4)for(var i=0;i'+innerText+"
")})),allError=form.querySelectorAll(".js-errorbox-all .js-rule-error-all")),{errorBoxes:errorBoxes,allError:allError}}function t_forms__addRecaptcha(){var allRecaptchas=document.querySelectorAll(".js-tilda-captcha");Array.prototype.forEach.call(allRecaptchas,(function(recaptcha){var captchaKey=recaptcha.getAttribute("data-tilda-captchakey");if(captchaKey){var formId=recaptcha.getAttribute("id");if(!window.tildaForm.isRecaptchaScriptInit){var head=document.head,script=document.createElement("script");window.tildaForm.isRecaptchaScriptInit=!0,script.type="text/javascript",script.src="https://www.google.com/recaptcha/api.js?render=explicit",script.async=!0,head.appendChild(script),head.insertAdjacentHTML("beforeend",'')}document.getElementById(formId+"recaptcha")||recaptcha.insertAdjacentHTML("beforeend",'')}else t_removeClass(recaptcha,"js-tilda-captcha")}))}function t_forms__getMsg(msg){var dict=[],lang=window.t_forms__lang;return dict.EN={success:"Thank you! Your data has been submitted.",successorder:"Thank you! Order created. Please wait while you are redirected to the payment page...",email:"Please enter a valid email address",url:"Please put a correct URL",phone:"Please put a correct phone number",number:"Please put a correct number",date:"Please put a correct date",time:"Please put a correct time (HH:mm)",name:"Please put a name",namerus:"Please put a correct name (only cyrillic letters)",nameeng:"Please put a correct name (only latin letters)",string:"You put incorrect symbols. Only letters, numbers and punctuation symbols are allowed",req:"Please fill out all required fields",reqfield:"Required field",minlength:"Value is too short",maxlength:"Value too big",emptyfill:"None of the fields are filled in",chosevalue:"Please select an address from the options",deliveryreq:"It is not possible to place an order without delivery. Please refresh the page and try again",promocode:"Please activate promo code or clear input field"},dict.RU={success:"Спасибо! Данные успешно отправлены.",successorder:"Спасибо! Заказ оформлен. Пожалуйста, подождите. Идет переход к оплате...",email:"Укажите, пожалуйста, корректный email",url:"Укажите, пожалуйста, корректный URL",phone:"Укажите, пожалуйста, корректный номер телефона",number:"Укажите, пожалуйста, корректный номер",date:"Укажите, пожалуйста, корректную дату",time:"Укажите, пожалуйста, корректное время (ЧЧ:ММ)",name:"Укажите, пожалуйста, имя",namerus:"Укажите, пожалуйста, имя (только кириллица)",nameeng:"Укажите, пожалуйста, имя (только латиница)",string:"Вы написали некорректные символы. Разрешены только буквы, числа и знаки пунктуации",req:"Пожалуйста, заполните все обязательные поля",reqfield:"Обязательное поле",minlength:"Слишком короткое значение",maxlength:"Слишком длинное",emptyfill:"Ни одно поле не заполнено",chosevalue:"Пожалуйста, выберите адрес из предложенных вариантов",deliveryreq:"Невозможно оформить заказ без доставки. Пожалуйста, перезагрузите страницу и попробуйте еще раз.",promocode:"Активируйте, пожалуйста, промокод или очистите поле"},"function"==typeof t_forms__getDict&&"RU"!==lang&&"EN"!==lang&&(dict=t_forms__getDict()),dict[lang]?dict[lang][msg]:dict.EN[msg]}function checkVerifyTildaCaptcha(event){if(-1!==(event=event||window.event).origin.indexOf(window.tildaForm.endpoint)){var tildaCaptcha=document.getElementById("js-tildaspec-captcha"),formCaptchaBox=document.getElementById("tildaformcaptchabox");if("closeiframe"==event.data)return formCaptchaBox&&t_removeEl(formCaptchaBox),void(tildaCaptcha&&t_removeEl(tildaCaptcha));var capthaKey=event.data;if(tildaCaptcha){tildaCaptcha.value=capthaKey,formCaptchaBox&&t_removeEl(formCaptchaBox);var form=tildaCaptcha.closest("form");form&&t_forms__submitEvent(form)}}}function t_parseScripts(main,className){var scripts=main.querySelectorAll(className+"script");Array.prototype.forEach.call(scripts,(function(oldScript){for(var newScript=document.createElement("script"),j=0;j