Это первая доступная в Git версия файла.
1/**2* tilda-catalog работает во всех блоках категории ST (store), а также на отдельных страницах товаров, подключенных к каталогу3**/45import { t_cart__useRootZone } from '../src/tilda-cart/shared/rootZone/index.ts';6import {7t_catalog__addVideoIconForGallery,8t_catalog__getVideoElement,9t_catalog__svgVideoIcon,10} from '../src/tilda-catalog/gallery-video/index.ts';1112
// global variables declarationwindow.tStoreIsSearchBot = /Bot/i.test(navigator.userAgent);window.tStoreIsMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);window.tStoreBrowserLang = (window.navigator.userLanguage || window.navigator.language).toUpperCase().slice(0, 2);window.t_store_endpoint = 'store.tildaapi.com';const t_store_POPUP_SHOWED_EVENT_NAME = 'catalog:popupShowed';const t_store_POPUP_CLOSED_EVENT_NAME = 'catalog:popupClosed';/** * Language override based on attribute **/t_onReady(function () { const allRecords = document.getElementById('allrecords'); if (allRecords) { const projectLang = allRecords.getAttribute('data-tilda-project-lang'); if (projectLang) { window.tStoreBrowserLang = projectLang; } t_store__setupEndpoint(); } t_store_getDictObj(); t_store_fixImgs();});// Временный фикс для Safari 16.3: картинки с position: absolute непропорционально растягивались// object-fit: contain исправляет это поведение. Фикс надо удалить по истечению времениfunction t_store_fixImgs() { var isSafari16_3 = /Version\/16\.3/.test(navigator.userAgent) && /Safari/.test(navigator.userAgent); if (!isSafari16_3) return; var recTypes = ['754', '776', '778', '786', '1025']; recTypes.forEach(function (recType) { var imgs = document.querySelectorAll( `[data-record-type="${recType}"] .t-img, [data-parenttplid="${recType}"] .t-img` ); Array.prototype.forEach.call(imgs, function (img) { img.style.objectFit = 'contain'; }); });}/** * This function is responsible for initializing the store * * @param {string} recid * @param {TildaStoreOptions} options **/function t_store_init(recid, options) { t_onReady(function () { var rec = document.getElementById('rec' + recid); if (!rec) return; if (!window.tStoreInit) { window.tStoreInit = {}; } window.tStoreInit[recid] = true; const allRecords = document.getElementById('allrecords'); if (allRecords) { t_store__setupEndpoint(); } // apply lazy init, if block's count > 7th if ('IntersectionObserver' in window && Object.keys(window.tStoreInit).length > 7) { window.tStoreInit[recid] = 'lazy'; var recordObserver = new IntersectionObserver( function (entries, observer) { entries.forEach(function (entry) { if (entry.isIntersecting) { var target = entry.target; observer.unobserve(target); if (window.tStoreInit[recid] === 'lazy') { t_store_lazyInit(recid, options); window.tStoreInit[recid] = true; } } }); }, { rootMargin: '150px 0px', } ); recordObserver.observe(rec);