401element && element.classList.add('t-contact-method__hidden');402}403404/** @param {Element} element */405function t_contactMethod__show(element) {406element && element.classList.remove('t-contact-method__hidden');407}408409/**410* @param {ContactMethodElement} element411*/412function t_contactMethod__disable(element) {
if (!element) return; element.disabled = true; element.classList.remove('js-tilda-rule');}/** * @param {ContactMethodElement} element */function t_contactMethod__enable(element) { if (!element) return; element.disabled = false; element.classList.add('js-tilda-rule');}function t_contactMethod__getRootZone() { const allrecords = document.getElementById('allrecords'); const rootZone = allrecords && allrecords.getAttribute('data-tilda-root-zone'); return rootZone || 'com';}/** * * @param {Element} inputGroup */function t_contactMethod__applyTranslation(inputGroup) { const phoneTypeTitle = inputGroup.querySelector('.t-contact-method__title[data-contact-method="phone"]'); if (phoneTypeTitle) { phoneTypeTitle.textContent = t_contactMethod__tranlsate('phone'); } const usernameInptus = inputGroup.querySelectorAll('.js-username-input'); usernameInptus.forEach(input => { const contactMethod = input.getAttribute('data-contact-method'); if (!contactMethod) return; const usernameInputBlock = input.closest('.t-input-block'); // плейсхолдеры, которые оставются видимыми при фокусе в поле const visiblePlaceholder = usernameInputBlock.querySelector('.t-input__vis-ph'); if (visiblePlaceholder) { visiblePlaceholder.textContent = t_contactMethod__getPlaceholder(contactMethod); } else { input.placeholder = t_contactMethod__getPlaceholder(contactMethod); } });}function t_contactMethod__tranlsate(key) { const dict = { phone: { RU: 'Телефон', EN: 'Phone', DE: 'Telefon', ES: 'Teléfono', PT: 'Telefone', }, username_email_or_phone: { RU: 'Имя пользователя, почта или телефон', EN: 'Username, email or phone number', DE: 'Nutzername, E-Mail oder Telefonnummer', ES: 'Nombre de usuario, e-mail o número de teléfono', PT: 'Nome de utilizador, e-mail ou número de telefone', }, username_or_phone: { RU: 'Имя пользователя или телефон', EN: 'Username or phone number', DE: 'Nutzername oder Telefonnummer', ES: 'Nombre de usuario o número de teléfono', PT: 'Nome de utilizador ou número de telefone', }, username_id_or_link: { RU: 'Имя пользователя, ID или ссылка', EN: 'Username, ID or link', DE: 'Nutzername, ID oder Link', ES: 'Nombre de usuario, ID o enlace', PT: 'Nome de utilizador, ID ou ligação', }, link_or_phone: { RU: 'Cсылка или телефон', EN: 'Link or phone number', DE: 'Link oder Telefonnummer', ES: 'Enlace o número de teléfono', PT: 'Ligação ou número de telefone', }, link: { RU: 'Cсылка', EN: 'Link',