9001try {9002if (product && product.json_options) {9003const json_options =9004typeof product.json_options === 'string' ? JSON.parse(product.json_options) : product.json_options;9005if (json_options) {9006// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)9007// @ts-expect-error ST-2949_29008json_options.forEach(optionObj => {9009if (optionObj.params && optionObj.title && optionObj.title === p) {9010productParams = optionObj.params;9011}
}); } } } catch (error) { console.error(error); } return Object.assign({}, globalParams, productParams);}// 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_product_getEditionOptionsArr_getImgValues(prop, editions) { var values = {}; // @ts-expect-error ST-2949_2 editions.forEach(function (curEdition) { var val = curEdition[prop]; // @ts-expect-error ST-2949_2 if (!values[val]) { // @ts-expect-error ST-2949_2 values[val] = curEdition.img; } }); return values;}// 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_combineOptionIdByName(text) { return text.replace(/[\\'"<>{}]/g, '');}// 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_getProductFirstImg(product) { if (product.gallery && product.gallery[0] === '[') { var galleryArr = JSON.parse(product.gallery); if (galleryArr[0] && galleryArr[0].img) { return galleryArr[0].img; } } return '';}// 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_loadMoreBtn_display(recid) { var rec = document.getElementById('rec' + recid); if (!rec) return; var loadMoreWrap = rec.querySelector('.t-catalog__load-more-btn-wrap'); var mobileGridCont = rec.querySelector('.js-catalog-grid-cont.t-catalog__grid-cont_mobile-one-row'); var isMobileOneRow = !!(window.innerWidth < 960 && mobileGridCont); if (loadMoreWrap) { loadMoreWrap.classList.toggle('t-catalog__load-more-btn-wrap_hidden', isMobileOneRow); }}/* Used in the tpl only */// 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_oneProduct_init(recid, options) { var el_prod = document.querySelector('#rec' + recid + ' .js-catalog-product_single'); if (!el_prod) return; var uid = el_prod.getAttribute('data-product-gen-uid'); uid = t_catalog_oneProduct_clearUid(uid); el_prod.setAttribute('data-product-gen-uid', uid); if (!window.tCatalogIsSearchBot) { t_catalog_oneProduct_preloader_add(recid); } options.isPublishedPage = t_catalog__isPublishedMode(); var requestOnBlockChangeInRedactor = window.tStoreSingleProdsObj && !options.previewmode; // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (!window.tStoreSingleProductsIsRequested || requestOnBlockChangeInRedactor) { t_catalog_oneProduct_requestAllSingle(options); // @ts-expect-error ST-2949_1 window.tStoreSingleProductsIsRequested = true; el_prod.addEventListener('tStoreSingleProductsLoaded', function () { // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 t_catalog_oneProduct_fill(recid, window.tStoreSingleProdsObj[uid], options);