6701return `0 0 ${shadowSize} rgba(0,0,0,${opacityNum})`;6702}67036704/**6705* Применяет конфигурацию типографики, преобразуя настройки в CSS-правила6706* @param {Object} conf - Объект конфигурации со стилевыми настройками6707* @param {Array<string>} rulesArr - Массив для накопления CSS-правил6708* @param {Object} mapSimpleProps - Карта соответствия названий свойств конфигурации CSS-свойствам6709* @param {string} mapSimpleProps.color - Соответствие для цвета6710* @param {string} mapSimpleProps.fontsize - Соответствие для размера шрифта6711* @param {string} mapSimpleProps.lineheight - Соответствие для межстрочного интервала
* @param {string} mapSimpleProps.fontweight - Соответствие для жирности шрифта * @param {string} mapSimpleProps.letterspacing - Соответствие для межбуквенного интервала * @param {string} mapSimpleProps.margintop - Соответствие для верхнего отступа * @param {string} mapSimpleProps.marginbottom - Соответствие для нижнего отступа * @param {string} mapSimpleProps.opacity - Соответствие для прозрачности * @param {object} [includeProps] - Объект включаемых CSS-свойств. Если передан, в результирующий CSS попадут только указанные свойства. Если не передан, включаются все свойства. * @returns {void} */function t_catalog_applyTypoConfig(conf, rulesArr, mapSimpleProps, includeProps) { const shadowOptions = { shadowSize: null, shadowOpacity: null, }; // Проверяем, передан ли фильтр включаемых свойств const includePropsMap = includeProps || null; // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) // @ts-expect-error ST-2949_2 const shouldInclude = prop => !includePropsMap || includePropsMap[prop]; Object.keys(conf).forEach(key => { // @ts-expect-error ST-2949_2 const rawVal = conf[key]; switch (key) { case 'shadowsize': shadowOptions.shadowSize = rawVal; break; case 'shadowopacity': shadowOptions.shadowOpacity = rawVal; break; case 'opacity': if (shouldInclude('opacity')) { t_catalog_addRule(rulesArr, mapSimpleProps[key], t_catalog_percentToFloat(rawVal)); } break; case 'color': if (shouldInclude('color')) { t_catalog_addTextColorRule(rulesArr, rawVal); } break; default: // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) // @ts-expect-error ST-2949_2 if (mapSimpleProps[key] && shouldInclude(mapSimpleProps[key])) { // @ts-expect-error ST-2949_2 t_catalog_addRule(rulesArr, mapSimpleProps[key], rawVal); } break; } }); // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) // @ts-expect-error ST-2949_5 const baseShadow = t_catalog_buildTextShadow(shadowOptions); if (baseShadow && shouldInclude('text-shadow')) { t_catalog_addRule(rulesArr, 'text-shadow', baseShadow); }}/** * Removes font-size and padding-top/padding-bottom styles from a styles line string. * * @param {string} styleString - A string representing a styles line. * @return {string} - The filtered styles line, with font-size and padding-top/padding-bottom styles removed. If the input is falsy, returns an empty string. */function t_catalog_removeSizesFromStylesLine(styleString) { // Return an empty string if input is falsy if (!styleString) { return ''; } else { // Split the style string into an array var styleArray = styleString.split(';'); // Filter the array to exclude font-size and padding-top/padding-bottom var filteredStyles = styleArray.filter(function (style) { return !style.match(/(font-size|padding-(top|bottom)|line-height)/); }); // Join the filtered styles back into a string and return it return filteredStyles.join(';'); }}// Функция вызывается каждый раз, при открытии нового попапа,// Или один раз для страницы со сниппетом// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_drawProdPopup_drawGallery(recid, popupElement, product, options) { var GALLERY_BREAKPOINT = 980;