7201columnSizeForMainImage,7202galleryImageAspectRatio,7203thumbsSize,7204marginBetweenThumbs7205);7206// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)7207// @ts-expect-error ST-2949_27208var strBullets;72097210var oneBulletTpl;7211var oneBulletStr;7212
if ( (thumbsCount !== maxThumbsCount && galleryArr.length >= maxThumbsCount) || (thumbsCount < maxThumbsCount && thumbsCount !== galleryArr.length) ) { Array.prototype.forEach.call(galleryArr, function (image, index) { if (index <= maxThumbsCount - 1) { if (index <= maxThumbsCount - 2 || index === galleryArr.length - 1) { oneBulletTpl = t_catalog_get_productcard_oneSliderBullet_html(options); oneBulletStr = oneBulletTpl .replace('[[videoPlayIcon]]', '') .replace('[[activeClass]]', index === 0 ? 't-slds__bullet_active' : '') // 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 .replace(/\[\[index\]\]/g, index + 1) .replace(/\[\[imgsource_lazy\]\]/g, t_catalog_getLazyUrl(options, image.img)) .replace(/\[\[imgsource\]\]/g, image.img) .replace(/\[\[imgalttext\]\]/g, t_catalog_escapeQuote(image.alt)); } else { oneBulletTpl = t_catalog_get_productcard_thumbsGallery_html( options, galleryArr.length, maxThumbsCount ); oneBulletStr = oneBulletTpl .replace('[[activeClass]]', index === 0 ? 't-slds__bullet_active' : '') // 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 .replace(/\[\[index\]\]/g, index + 1) .replace(/\[\[imgsource_lazy\]\]/g, t_catalog_getLazyUrl(options, image.img)) .replace(/\[\[imgsource\]\]/g, image.img) .replace(/\[\[imgalttext\]\]/g, t_catalog_escapeQuote(image.alt)); } // 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 strBullets += oneBulletStr; } }); // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 var thumbsWrapper = rec.querySelector('.t-slds__thumbsbullet-wrapper'); // @ts-expect-error ST-2949_3 thumbsWrapper.innerHTML = strBullets; var sliderOptions; if (options.sliderthumbsside === 'l') { sliderOptions = { thumbsbulletGallery: true, storeOptions: options, }; } // 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 t_sldsInit(recid + ' .js-catalog-product', sliderOptions); t_catalog_popup_updateLazyLoad(); }}// 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_prodPopup_gallery_calcMaxThumbsCount(columnSize, galleryImageRatio, thumbSize, marginBetweenThumbs) { var columnWidth = t_catalog_getColumnWidth(columnSize); var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; // hack for popup columns if (windowWidth >= 960 && windowWidth <= 1240) { columnWidth = 440; } var mainImageHeightPercent = Math.floor(galleryImageRatio * 100); var mainImageHeight = Math.floor( (mainImageHeightPercent * (columnWidth - (thumbSize + marginBetweenThumbs))) / 100 ); var maxPreviewsCount = Math.floor(mainImageHeight / (thumbSize + marginBetweenThumbs)); if ((thumbSize + marginBetweenThumbs) * (maxPreviewsCount + 1) - marginBetweenThumbs <= mainImageHeight) { maxPreviewsCount += 1; } return maxPreviewsCount;}// 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_get_productcard_slider_html(rec, options) {