1if (typeof appEvents == "undefined") { 2 appEvents = []; 3 appEvents.isReady = false; 4} 5 6appEvents.googleAnalyticsEvents = (event = 'view_item', params = {}, ga4 = true) => { 7 if (!appEvents.isReady) { 8 return; 9 } 10 11 window.flutter_inappwebview.callHandler('googleAnalytics', { 12 referer: window.location.pathname, 13 event: event, 14 params: params, 15 page_name: document.title, 16 ga4: ga4 17 }); 18} 19 20appEvents.setPageType = () => { 21 if (!appEvents.isReady) { 22 return; 23 } 24 25 if (typeof window.flutter_inappwebview === 'undefined') { 26 return; 27 } 28 29 const pageType = document.querySelector('.page-type'); 30 31 if (!pageType) { 32 return; 33 } 34 35 window.flutter_inappwebview.callHandler('pageType', parseInt(pageType.value)); 36} 37 38appEvents.setSessionInfos = () => { 39 let quantity = 0; 40 let user = null; 41 42 if (typeof window.flutter_inappwebview === 'undefined') { 43 return; 44 } 45 46 if (typeof appElements != 'undefined') { 47 const quantityEl = document.querySelector(appElements?.quantity); 48 quantity = quantityEl ? parseInt(quantityEl.innerText) : 0; 49 50 const name = document.querySelector(appElements?.name); 51 const email = document.querySelector(appElements?.email); 52 53 if (name && email) { 54 user = { 55 pessoa: { 56 nome: name.innerText.trim(), 57 email: email.innerText.trim() 58 } 59 } 60 } 61 } 62 63 window.flutter_inappwebview.callHandler('sessionInfos', { 64 cartLength: quantity, 65 user: user 66 }); 67} 68 69appEvents.initialize = () => { 70 appEvents.isReady = true; 71 72 const event = new Event('ajaxcache.needupdate'); 73 document.dispatchEvent(event); 74 75 if (typeof demo !== 'undefined') { 76 demo.updateCart(); 77 } else { 78 appEvents.setSessionInfos(); 79 } 80 81 appEvents.setPageType(); 82} 83 84window.addEventListener('flutterInAppWebViewPlatformReady', function () { 85 appEvents.initialize(); 86});
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.