let officeSwiper = null function isMobile() { return /iPhone|Android|Mobile/i.test(navigator.userAgent) } function initSwiper() { const officeCards = document.querySelector('.office-cards') if (officeCards) { if (!isMobile()) officeCards.classList.add('swiper-no-swiping') const swiperOptions = isMobile() ? { autoplay: true, loop: true } : {} officeSwiper = new Swiper( officeCards, Object.assign({ speed: 1000 }, swiperOptions) ) } } function registerMapLocations() { /** @type {HTMLDivElement} */ const officeContainer = document.querySelector('.office-container') /** @type {HTMLDivElement} */ const locationContainer = document.querySelector('.location-container') if (officeContainer && locationContainer) { /** @type {HTMLDivElement} */ const officeCards = officeContainer.querySelector('.office-cards') if (officeCards && locationContainer) { const handleLocationToggle = async function () { const slideList = officeCards.querySelectorAll('.swiper-slide') for (let i = 0; i < slideList.length; i++) { await new Promise((resolve, reject) => { const timer = setTimeout(() => { const dotGroup = document.createElement('div') const city = slideList[i].dataset?.city || '' dotGroup.className = i === 0 && !isMobile() ? 'dot-container current' : 'dot-container' dotGroup.dataset.city = city dotGroup.dataset.index = i dotGroup.innerHTML = `