1function t_popup__trapFocus(t){var e=t.querySelectorAll('a, button, input:not([type="hidden"]):not(.js-form-spec-comments), select, textarea, embed, video, iframe, [tabindex="0"]'),o=e[0],p=e[e.length-1];document.addEventListener("keydown",(function(t){if(document.body.classList.contains("t-body_popupshowed")){var e="Tab"===t.key||9===t.keyCode,n;(e||e&&t.shiftKey)&&(t.shiftKey&&document.activeElement.classList.contains("t-popup_show")&&p.focus(),"Tab"!==t.key||t.shiftKey||document.activeElement!==p||(t.preventDefault(),o.focus()),"Tab"===t.key&&t.shiftKey&&document.activeElement===o&&(t.preventDefault(),p.focus()))}}))}function t_popup__addAttributesForAccessibility(t){var e=document.querySelectorAll('a[href="'+t+'"]');Array.prototype.forEach.call(e,(function(t){t&&(t.setAttribute("role","button"),t.setAttribute("aria-haspopup","dialog"))}))}function t_popup__resizePopup(t){var e=document.getElementById("rec"+t);if(e){var o=e.querySelector(".t-popup__container");if(o){var p=getComputedStyle(o,null),n=parseInt(p.paddingTop)||0,r=parseInt(p.paddingBottom)||0,s=o.clientHeight-(n+r),c=120,u=e.getAttribute("data-parenttplid")||e.getAttribute("data-record-type"),a,i="1093"===u||"121"===u&&e.querySelector(".t1093");"364"!==u&&"365"!==u||(c=30),("868"===u||"331"===u||"358"===u||"1013"===u||"746"===u||i)&&(c=0),s>window.innerHeight-c?o.classList.add("t-popup__container-static"):o.classList.remove("t-popup__container-static")}}}function t_popup__showPopup(t){t&&(t.style.display="block"),setTimeout((function(){t.focus();var e=t?t.querySelector(".t-popup__container"):null;e&&e.classList.add("t-popup__container-animated"),t&&t.classList.add("t-popup_show"),t_onFuncLoad("t_popup__trapFocus",(function(){t_popup__trapFocus(t)}))}),50)}function t_popup__closePopup(t){var e=document.querySelector(".t-popup.t-popup_show"),o=t.querySelector(".t-popup__container");if(t===e){var p=document.body;p.dispatchEvent(new CustomEvent("popupHidden")),p.classList.remove("t-body_popupshowed"),p.cl …Длинные строки сокращены. Полная версия доступна по ссылке «Полный текст».