**/function t_catalog_getLazyUrl(options, imgSrc) { // lazyLoad works just in published pages, so in redactor and previewmode we do not add smaller images // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (!options.isPublishedPage || window.lazy !== 'y') { return imgSrc; } if (imgSrc.indexOf('static.tildacdn.' + t_catalog__getRootZone()) === -1) { // we can't apply lazy load to image, hosted to another servers return imgSrc; } var arr = imgSrc.split('/'); arr.splice(imgSrc.split('/').length - 1, 0, '-/resizeb/x20'); return arr.join('/');}/** * Get URL for SRC attr of lazyload image * * @param options - an object with the following properties: * @param imgSrc - the original image URL **/// 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_getLazySrc(options, imgSrc) { // lazyLoad works just in published pages, so in redactor and previewmode we do not add smaller images if (!options.isPublishedPage || window.lazy !== 'y') { return imgSrc; } if ( imgSrc.indexOf('.tildacdn.com') === -1 || imgSrc.indexOf('-/empty/') !== -1 || imgSrc.indexOf('-/resize/') !== -1 ) { return imgSrc; } var arr = imgSrc.split('/'); arr.splice(imgSrc.split('/').length - 1, 0, '-/empty'); return arr.join('/');}/** * Translated string based on the current language * * If the message is not empty and the dictionary exists and the message is in the dictionary, return * the message from the dictionary. Otherwise, return a message saying the text was not found. * * @param {string} msg - the text to translate * @returns {string} - translated text **/function t_catalog_dict(msg) { if (!window.tCatalogDict) { t_catalog__setGlobalDictObj(); } // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 return window.tCatalogDict[msg] || 'Text not found for "' + msg + '"';}/** * Escaping the quote character in the text * * @param {string} text * @returns {string} - text without quotes **/function t_catalog_escapeQuote(text) { if (!text) { return ''; } var map = { '"': '"', "'": ''', }; return text.replace(/["']/g, function (m) { // 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 return map[m]; });}