8301return new URL(editionImageUrl)?.pathname;8302} catch (error) {8303return '';8304}8305})();83068307if (imgPathName && imgPathName !== '/') {8308const editionImage = el_product.querySelector(8309`.t-slds__item .t-slds__bgimg[data-original$="${imgPathName}"]`8310);8311if (editionImage) {8312// 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 editionSlide = editionImage.closest('.t-slds__item'); } } } // случай: сайт был экспортирован if (editionImageUrl.indexOf('http://') !== -1 || editionImageUrl.indexOf('https://') !== -1) { try { var url = new URL(editionImageUrl); var pathname = url.pathname; if (pathname[0] === '/') { pathname = pathname.slice(1).replace(/\//, '__'); } var exportedEditionImage = el_product.querySelector( '.t-slds__item .t-slds__bgimg[data-original$="' + pathname + '"]' ); if (!editionSlide && exportedEditionImage) { // 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 editionSlide = exportedEditionImage.closest('.t-slds__item'); } } catch (error) { console.error(error); } } // определяем позицию изображения внутри слайдера if (editionSlide) { // если она нулевая (0 это фейковый слайд для анимации), то перемещаем к последнему слайду // 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 sliderPosition = parseInt(editionSlide.getAttribute('data-slide-index'), 10); if (sliderPosition === 0) { sliderPosition = totalSlides; } } // перемещаем слайдер без анимации sliderWrapper.setAttribute('data-slider-pos', sliderPosition.toString()); // блок ST215 не содержит слайдер if (!el_product.classList.contains('t922')) { t_catalog_onFuncLoad('t_slideMoveInstantly', function () { // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 t_slideMoveInstantly(recid + ' .js-catalog-product'); }); }}// 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_triggerSoldOutMsg(recid, productElement, isSoldOut, options) { var el_product = productElement; t_catalog__removeElement(el_product.querySelector('.js-catalog-prod-sold-out')); var el_buyBtn = el_product.querySelectorAll( '.t-catalog__card__btns-wrapper [href="#order"], .t-catalog__prod-popup__btn-wrapper [href="#order"]' ); // у одиночных товаров wrapper кнопок с другими классами if (el_buyBtn.length === 0) { el_buyBtn = el_product.querySelectorAll('[href="#order"]'); } // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 if (window.jQuery && el_product instanceof jQuery) { // @ts-expect-error ST-2949_4 el_product = $(el_product).get(0); } var orderBtn1 = options.prodCard && options.prodCard.btnLink1 === 'order'; var orderBtn2 = options.prodCard && options.prodCard.btnLink2 === 'order'; var el_buyBtnTxt; if (el_buyBtn[0]) { el_buyBtnTxt = el_buyBtn[0].querySelector('.js-catalog-prod-popup-buy-btn-txt'); if (el_product.getAttribute('data-card-size') === 'small') { el_buyBtnTxt = el_buyBtn[0].querySelector('.t-catalog__card__btn-text'); } if (!el_buyBtnTxt) { el_buyBtnTxt = el_buyBtn[0].querySelector('.js-catalog-prod-buy-btn-txt'); } }