1class SmartSearchAnalytics { 2 handleFirstClick = (event) => { 3 const link = event.target.closest('a, button'); 4 if (!link) { 5 return; 6 } 7 8 const url = link.href || link.dataset?.action; 9 if (url) { 10 SmartSearchAnalytics.sendTransitionPage(this.analyticId, url); 11 this.wrapper.removeEventListener('click', this.handleFirstClick); 12 } 13 } 14 15 constructor(analyticId, wrapper = null) { 16 this.analyticId = analyticId; 17 this.wrapper = wrapper || document; 18 this.wrapper.addEventListener('click', this.handleFirstClick) 19 } 20 21 static sendTransitionPage(analyticId, url) { 22 navigator.sendBeacon( 23 '/bitrix/services/main/ajax.php?action=sotbit:smartsearchpro.analytics.addTransition&sessid=' + BX.message('bitrix_sessid'), 24 new Blob([JSON.stringify({ 25 analyticId, 26 url 27 })], {type: 'application/json'}) 28 ); 29 } 30 31 setAnalyticId(id) { 32 this.analyticId = id; 33 } 34}
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.