function t_form_splittingOnStep(t){var e=document.querySelector("#rec"+t);if(e){var r=e.querySelector(".t-form");if(r){var o=r.querySelectorAll(".t-input-group.t-input-group_st"),n=e.querySelector(".t-form__inputsbox"),i=n.querySelectorAll(".t-input-group_st"),a,s,c,l=0,u=n.querySelectorAll(".t-form-step-divider"),p=null;f()}}function f(){0!==i.length&&(Array.prototype.forEach.call(o,(function(t){t.style.margin="0px"})),n.classList.add("t-form__screen"),_(),c=n.querySelector(".t-form__screen-current-view"),y(),a=n.querySelectorAll(".t-form__screen-wrapper"),l=d(a),s=a.length,r.classList.contains("t-conditional-form")&&t_form__onFuncLoad("t_form__conditionals__initStepForm",(function(){var e;p=t_form__conditionals__initStepForm({recId:t,steps:a,activeStepIndex:l,onConditionalFieldChange:function t(e){s=e.totalActiveStepsCount,k(e.activePossibleStepIndex+1,e.totalActiveStepsCount),S()}}),s=p.getState().totalActiveStepsCount,S()})),g(),h(),n&&L())}function d(t){var e;return Array.from(t).findIndex((function(t){var e=t.querySelector(".t-input-group:not(.t-form__hidden)");return Boolean(e)}))}function _(){var t=n.querySelector(".t-form__submit"),r="",o="",i="",a="",s="",c="";a=window.t_forms__lang,u&&u[l]?(s=u[l].getAttribute("data-tilda-form-step-btn-next"),c=u[l].getAttribute("data-tilda-form-step-btn-prev")):l===u.length&&u&&u[l-1]&&(s=u[l-1].getAttribute("data-tilda-form-step-btn-next"),c=u[l-1].getAttribute("data-tilda-form-step-btn-prev")),o=s||("RU"===a&&a?"Далее":"Next"),i=c||("RU"===a&&a?"Назад":"Back");var p=e.querySelector(".t-form__screen-btn-next"),f=e.querySelector(".t-form__screen-btn-prev");if(!p||!f){var r='",d='
',t;return(t=n.querySelector(".t-form__submit")).insertAdjacentHTML("beforeend",r),t.insertAdjacentHTML("beforeend",d),void t_onFuncLoad("t_forms__parseVariables",(function(){t_forms__parseVariables(t)}))}p.textContent=o,f.textContent=i,t_onFuncLoad("t_forms__parseVariables",(function(){t_forms__parseVariables(p),t_forms__parseVariables(f)}))}function y(){var t=n.querySelectorAll(".t-input-group"),e=v(),r=[],o=[];Array.prototype.forEach.call(t,(function(t){t.classList.contains("t-input-group_st")?(r.push(e),e=v()):e.appendChild(t)})),r.push(e),Array.prototype.forEach.call(n.children,(function(t,e){t.classList.contains("t-input-group_st")&&o.push(e)})),o.push(o[o.length-1]+1),Array.prototype.forEach.call(r,(function(t,e){n.insertBefore(t,n.children[o[e]]),m(o,e+1)}))}function m(t,e){for(var r=e;r'}function h(){var o=e.querySelector(".t-form__screen-btn-prev"),n=e.querySelector(".t-form__screen-btn-next"),i=e.querySelector(".t-submit"),s=e.querySelector(".t-form-step-divider_novalidate"),c=e.querySelector(".t-form__screen-number_opacity"),u=e.querySelector(".t-form__screen-progress-bar"),f=t_throttle(x,300,this);function d(){Array.prototype.forEach.call(a,(function(t){t.style.display="none",t.classList.remove("t-form__screen-wrapper_active")})),a[l].style.display="block",a[l].classList.add("t-form__screen-wrapper_active"),E()?(r.classList.add("js-form-proccess"),i.style.display="inline-block"):(r.classList.remove("js-form-proccess"),i.style.display="none");var t=N();m(c,t),b(u,t),q(),A(e),y(a[l])}function y(e){var r;e&&e.querySelectorAll('input[type="range"]').forEach((function(e){var r=e.getAttribute("id").replace("input_","");"function"==typeof t_inputRange__updateVal&&t_inputRange__updateVal(t,r)}))}function m(t,e){t.innerHTML=e}function v(t){t.preventDefault(),C()||(l=H(),p&&p.onStepChange(l),S(),d(),w(),_())}function g(t){var e;t.preventDefault(),!s&&F(r,a,l)||E()||(l=T(),p&&p.onStepChange(l),S(),d(),w(),t_form__lazyLoad(),_())}function h(t){var e=a[l].querySelectorAll(".t-input-group.t-input-group_ta");if(13===t.keyCode&&!r.classList.contains("js-form-proccess")&&0===e.length){var o;if(!s&&F(r,a,l))return void t.preventDefault();g(t),t.preventDefault()}}o.addEventListener("click",v),n.addEventListener("click",g),Array.prototype.forEach.call(a,(function(t){t.addEventListener("keypress",h)})),window.addEventListener("resize",f),d()}function b(t,e){var r=parseFloat(t.getAttribute("stroke-dasharray")).toFixed(3),o=parseFloat(r/s).toFixed(3),n=parseFloat(r-e*o).toFixed(3);t.style.strokeDashoffset=n,t.setAttribute("stroke-dashoffset",n)}function S(){var t=e.querySelector(".t-form__screen-btn-prev"),o=e.querySelector(".t-form__screen-btn-next"),n=e.querySelector(".t-submit"),i=E(),a=C();return i?(a||(t.style.display="inline-block"),o.style.display="none",r.classList.add("js-form-proccess"),void(n.style.display="inline-block")):a?(i||(r.classList.remove("js-form-proccess"),n.style.display="none"),t.style.display="none",void(o.style.display="inline-block")):(r.classList.remove("js-form-proccess"),n.style.display="none",t.style.display="inline-block",void(o.style.display="inline-block"))}function w(){var t=e.querySelector(".t-popup"),o=0;if(t){o=r.offsetTop;var n=document.querySelector(".t702");if(n){var i=n.querySelector(".t702__text-wrapper"),a=n.querySelector(".t702__close, .t-popup__close");if(i){var s=window.getComputedStyle(i),c=parseFloat(s.height),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom);isNaN(l)||isNaN(c)||(c+=l),isNaN(u)||isNaN(c)||(c+=u),o=o-c-4}if(a){var p=window.getComputedStyle(a),f=parseFloat(p.height),d=parseFloat(p.marginTop),_=parseFloat(p.marginBottom);isNaN(d)||isNaN(f)||(f+=d),isNaN(_)||isNaN(f)||(f+=_),o=o-f-4}}t.scrollTop=o}else(o=e.querySelector(".t-form__screen").getBoundingClientRect().top+window.pageYOffset-150)300&&(i+=120),i>1e3&&(i+=100),i0&&(console.log("correct video from cover_fixcontentheight"),t_form__onFuncLoad("setWidthAndHeightVideo",(function(){setWidthAndHeightVideo(o,i+"px","youtube")})))}}}function x(){q(),n&&L()}function A(t){var e=t.querySelector(".t-popup__container");if(e){var r,o=120,n;parseFloat(getComputedStyle(e,null).height.replace("px",""))>window.innerHeight-o?e.classList.add("t-popup__container-static"):e.classList.remove("t-popup__container-static")}}function L(){window.innerWidth<640?c.style.display="none":c.style.display="block"}function F(t,e,r){var o=e[r],n=window.tildaForm.validate(o),i;window.tildaForm.hideErrors(t);var a=n[0],s;a&&(i="emptyfill"!=a.type[0]&&window.tildaForm.showErrors(t,n));return i}function k(t,r){var o=c.querySelector(".t-form__screen-number-current"),n=c.querySelector(".t-form__screen-number-total"),i;o.innerHTML=t,n.innerHTML=r,b(e.querySelector(".t-form__screen-progress-bar"),t)}function N(){return p?p.getState().activePossibleStepIndex+1:l+1}function E(){var t;return N()===s}function C(){var t;return 1===N()}function T(){return p?p.getState().nextStepIndex:l+1}function H(){return p?p.getState().prevStepIndex:l-1}}function t_form__lazyLoad(){var t=document.querySelector("#allrecords");t&&(t.getAttribute("data-tilda-mode")||"y"!==window.lazy&&"yes"!==t.getAttribute("data-tilda-lazy")||t_form__onFuncLoad("t_lazyload_update",(function(){t_lazyload_update()})))}function t_form__onFuncLoad(t,e,r){"function"==typeof window[t]?e():setTimeout((function o(){if("function"!=typeof window[t]){if("complete"===document.readyState&&"function"!=typeof window[t])throw new Error(t+" is undefined");setTimeout(o,r||100)}else e()}))}function t_form__getRootZone(){var t=document.getElementById("allrecords"),e;return t&&t.getAttribute("data-tilda-root-zone")||"com"}t_onReady((function(){var t="https://static.tildacdn."+t_form__getRootZone()+"/css/tilda-step-form-1.0.min.css",e;document.querySelector('link[href^="'+t+'"]')||document.head.insertAdjacentHTML("beforeend",'')}));