1(function () { 2 'use strict'; 3 var PHONE_ACCOUNT = '551140048006'; 4 var PHONE_HELP = '551140048808'; 5 var ONELINK_MOBILE = 'https://jota.onelink.me/NG7q/okqzufyo'; 6 var APP_DESKTOP = 'https://app.jota.ai'; 7 var AB_FLAG = 'cta-home'; 8 var paths = { 9 '/tarefas': ['page-tarefas', 'tarefas'], '/open-finance': ['page-open-finance', 'open-finance'], 10 '/rendimento': ['page-rendimento', 'rendimento'], '/cobrancas': ['page-cobrancas', 'cobrancas'], 11 '/pix-whatsapp': ['page-pix-whatsapp', 'pix-whatsapp'], '/falatap': ['page-falatap', 'falatap'], 12 '/conta-pessoa-fisica': ['page-conta-pf', 'conta-pf'], '/conta-pessoa-juridica': ['page-conta-pj', 'conta-pj'], 13 '/radar-de-boletos': ['page-radar-de-boletos', 'radar-de-boletos'], '/casos-de-uso': ['page-casos-de-uso', 'casos-de-uso'] 14 }; 15 function mobile() { return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); } 16 function path() { return location.pathname.replace(/\.html$/i, '').replace(/\/+$/, '').toLowerCase() || '/'; } 17 function cell() { var cells = window.JOTA_LD_CELLS; var value = cells ? cells[AB_FLAG] : window.JOTA_LD_CELL; return value && /^[a-z0-9_-]+$/i.test(value) ? value : ''; } 18 function persona() { var on = document.querySelector('.scrolly .toggle button.on'); return on && on.getAttribute('data-p') || 'pj'; } 19 // Direto pro ads.jota.ai, sem passar pela ponte /ads-redirect (ver adsTarget em attribution.v2.js). 20 function bridge(copy, feature, position) { 21 var query = new URLSearchParams({ pagina: path().slice(1) || 'home', position: position || '', feature: feature || '' }); 22 var currentCell = cell(); if (currentCell) query.set('cell', currentCell); 23 // ponytail: páginas que carregam /js/*.js sem ?v podem ter o attribution.v2.js antigo no cache (1 h + 7 d de swr); nelas a ponte continua. 24 if (!window.JotaAttribution.adsTarget) { query.set('copy', copy); return '/ads-redirect?' + query.toString(); } 25 return window.JotaAttribution.adsTarget(window.JotaAttribution.read(), query, window.JotaMessages.get(copy)); 26 } 27 function whatsApp(phone, message) { var q = 'phone=' + phone + '&text=' + encodeURIComponent(message); return mobile() ? 'whatsapp://send?' + q : 'https://wa.me/' + phone + '?text=' + encodeURIComponent(message) + '&type=phone_number&app_absent=0'; } 28 function push(message, feature, position) { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: 'OpenWhatsApp', message: message, platform: mobile() ? 'Mobile' : 'Desktop', feature: feature || null, position: position, cell: cell() || null }); } 29 // OneLink com atribuicao (GRO-533), mesmas chaves do onelink-builder.js da lp.jota.ai. 30 // Sem campanha capturada o href continua o OneLink puro: link cru de loja nao e medido. 31 var SUBS = { c: 'utm_campaign', af_channel: 'utm_medium', af_ad: 'utm_content', af_keywords: 'utm_term', 32 af_sub1: 'gclid', af_sub2: 'fbclid', af_sub3: 'gbraid', af_sub4: 'wbraid' }; 33 function oneLink() { 34 var record = window.JotaAttribution.read(); 35 if (!record) return ONELINK_MOBILE; 36 // pid = midia real; 'jota_site' marca a origem sem inventar plataforma na AppsFlyer. 37 var query = new URLSearchParams({ pid: record.params.utm_source || 'jota_site' }); 38 Object.keys(SUBS).forEach(function (key) { var value = record.params[SUBS[key]]; if (value) query.set(key, value); }); 39 query.set('af_sub5', String(record.capturedAt)); 40 return ONELINK_MOBILE + '?' + query.toString(); 41 } 42 // Mesmo esquema do onelink-builder.js da lp.jota.ai: template Gsil em qualquer aparelho, 43 // pid = mÃdia real ou 'jota_site', click ids em af_sub1-4, hora da captura em af_sub5 e o botão em af_adset 44 // (o pid é sobrescrito por quem chega de mÃdia paga; o af_adset guarda de onde saiu o clique). 45 var ONELINK_LP = 'https://jota.onelink.me/Gsil'; 46 function oneLinkLp(adset) { 47 var record = window.JotaAttribution.read(), params = record ? record.params : {}; 48 var query = new URLSearchParams({ pid: params.utm_source || 'jota_site' }); 49 Object.keys(SUBS).forEach(function (key) { var value = params[SUBS[key]]; if (value) query.set(key, value); }); 50 if (record) query.set('af_sub5', String(record.capturedAt)); 51 query.set('af_adset', adset); 52 // desktop: página intermediária /app (QR code, as duas lojas e compartilhar o link). Em produção jota.ai/app; num preview, o /app 53 // do próprio preview (o domÃnio precisa estar na allowlist de redirect da AppsFlyer, senão cai no destino padrão do template). 54 if (!mobile()) query.set('af_web_dp', (/(^|\.)jota\.ai$/.test(location.hostname) ? 'https://jota.ai' : location.origin) + '/app'); 55 return ONELINK_LP + '?' + query.toString(); 56 } 57 function resolve(el, position) { 58 var kind = el.getAttribute('data-cta'); 59 if (kind === 'download-app' && el.getAttribute('data-onelink-adset')) { 60 var adset = el.getAttribute('data-onelink-adset'); 61 el.setAttribute('href', oneLinkLp(adset)); 62 if (el.__jotaCta) return; 63 el.__jotaCta = true; 64 el.addEventListener('click', function () { 65 el.setAttribute('href', oneLinkLp(adset)); 66 window.dataLayer = window.dataLayer || []; 67 window.dataLayer.push({ event: 'app_click_to_download', cta: 'download-app', pagina: path().slice(1) || 'home', adset: adset, platform: mobile() ? 'Mobile' : 'Desktop', cell: cell() || null }); 68 }); 69 return; 70 } 71 if (kind === 'download-app') { el.setAttribute('href', mobile() ? oneLink() : APP_DESKTOP); return; } 72 if (kind === 'help') { el.setAttribute('href', whatsApp(PHONE_HELP, 'Oi. Preciso de ajuda.')); return; } 73 if (kind === 'contact') { el.setAttribute('href', whatsApp(PHONE_ACCOUNT, window.JotaMessages.get('default'))); return; } 74 if (kind !== 'open-account' || el.__jotaCta) return; 75 el.__jotaCta = true; 76 // data-cta-copy/-feature/-position: CTA que sabe o próprio assunto (ex.: cada tela da /chat) 77 if (el.getAttribute('data-cta-position')) position = el.getAttribute('data-cta-position'); 78 var toggle = el.hasAttribute('data-cta-persona'); 79 var entry = el.getAttribute('data-cta-copy') ? [el.getAttribute('data-cta-copy'), el.getAttribute('data-cta-feature') || ''] : paths[path()] || ['default', '']; 80 function values() { var copy = toggle ? 'persona-' + persona() : entry[0]; return { copy: copy, feature: toggle ? 'home-persona' : entry[1], message: window.JotaMessages.get(copy) }; }
81 function update() { var value = values(); el.setAttribute('href', bridge(value.copy, value.feature, position)); return value; } 82 update(); 83 el.addEventListener('click', function () { var value = update(); push(value.message, value.feature, position); }); 84 } 85 function init() { 86 window.JotaAttribution.capture(location.search); 87 var open = Array.prototype.slice.call(document.querySelectorAll("[data-cta='open-account']")).filter(function (el) { return !el.closest('.mega, .nav-sheet, #navSheet'); }); 88 Array.prototype.forEach.call(document.querySelectorAll('[data-cta]'), function (el) { var i = open.indexOf(el); resolve(el, i < 0 ? '' : i === 0 ? 'cabecalho' : i === open.length - 1 ? 'rodape' : 'cta'); }); 89 } 90 window.JotaCta = { resolve: function (el) { resolve(el, ''); } }; 91 if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); else init(); 92})();
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.