https://a-markets.org/wp-content/plugins/amarkets-partials/mobile_app_links/js/index.js?ver=403.1175
1document.addEventListener('DOMContentLoaded', () => { 2 class StoreLinks { 3 constructor() { 4 this.store_section = document.querySelectorAll('.mobile__store'); 5 this.app_links = document.querySelectorAll('.app__links'); 6 7 this.show_blocks(); 8 this.add_event_listeners(); 9 this.set_active_store_links(); 10 } 11 12 show_blocks() { 13 this.store_section?.forEach(item => item.style = ''); 14 this.app_links.forEach(item => item.style = ''); 15 } 16 17 add_event_listeners() { 18 this.store_section.forEach(section => { 19 const qr_link = section.querySelector('.qr__block-link'); 20 const qr_popup = section.querySelector('.qr__popup'); 21 const btn_close = qr_popup.querySelector('.qr__popup-close'); 22 23 qr_link.addEventListener('click', () => { 24 qr_popup.classList.add('qr__popup--show'); 25 this.send_gtm_event_on_qr_popup_visibility_change(true); 26 }); 27 28 qr_popup.addEventListener('click', (e) => { 29 if (e.target.closest('.qr__popup-inner')) return; 30 this.hide_qr_popup(qr_popup); 31 }); 32 33 btn_close.addEventListener('click', () => { 34 this.hide_qr_popup(qr_popup); 35 }); 36 }); 37 } 38 39 hide_qr_popup(qr_popup) { 40 qr_popup.classList.remove('qr__popup--show'); 41 this.send_gtm_event_on_qr_popup_visibility_change(false); 42 } 43 44 send_gtm_event_on_qr_popup_visibility_change(is_visible) { 45 window.send_gtm_event?.({ 46 eventCategory1: 'main', 47 eventAction: is_visible ? 'open' : 'close', 48 eventLabel: 'modal-app-qr', 49 }); 50 } 51 52 set_active_store_links() { 53 const app_links = document.querySelectorAll('.app__links'); 54 if (app_links.length === 0) return; 55 56 this.user_agent = this.get_user_agent(); 57 if (!this.user_agent) return; 58 59 app_links.forEach(el => el.classList.add(`app__links--${this.user_agent}`)); 60 } 61 62 get_user_agent() { 63 const user_agent = navigator.userAgent.toLowerCase(); 64 65 if (user_agent.includes('android')) { 66 return 'android'; 67 } 68 69 if (user_agent.includes('iphone')) { 70 return 'iphone'; 71 } 72 73 return null; 74 } 75 } 76 77 const store_links = new StoreLinks(); 78});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.