"use strict";jQuery(document).ready((function(a){var o,i,e;window.location.pathname.replace(/^(.*\/)?([^/]*)$/,(function(a,i,e){o=i})),e=o=(o=o.split("/")).filter((function(a){return a})),i=window.location.host,a.inArray("classic",e)>=0||a.inArray("exclusive",e)>=0||a.inArray("prime",e)>=0||a.inArray("private",e)>=0||a.inArray("inovacao",e)>=0||a.inArray("aliadosbia",e)>=0||a.inArray("canaisdigitais",e)>=0?(a("head").append('<link rel="stylesheet" type="text/css" href="//'+i+'/assets/common/chatbia/css/chatbia-dist.css">'),a.inArray("consorcios",e)>=0&&a("body").addClass("chatbia-desktop"),"function"!=typeof Cookies&&a.getScript("//"+i+"/assets/common/cookies/vendor/js-cookie.min.js",(function(){})),a("#cookies").is(":visible")?a(".cookies__closed.js-fechar, .cookies__cta a.js-aceitar").on("click",(function(){a("#chatbia").addClass("show")})):a("#chatbia").addClass("show"),a("#chatbia").on("transitionend webkitTransitionEnd oTransitionEnd",(function(){a(this).hasClass("show")&&!Cookies.get("chatbia-balloon")&&(a("#chatbia-balloon").addClass("show"),a(this).off())})),a("#chatbia-fechar").on("click",(function(o){o.preventDefault(),a("#chatbia-balloon").removeClass("show"),Cookies.set("chatbia-balloon","false")})),a("#chatbia-button a").on("click",(function(o){var i,t;o.preventDefault();var n=a(this).attr("href");if(a("#chatbia-fechar").click(),a.inArray("consorcios",e)>=0&&a.inArray("classic",e)>=0&&"localhost"!=window.location.hostname)dataLayer.push({event:"interaction",EventCategory:"consorcio-home",EventAction:"consorcio-clique-bia",EventLabel:"botao-fale-com-a-bia"}),i="origin=consorcio";else if((a.inArray("classic",e)>=0||a.inArray("exclusive",e)>=0||a.inArray("prime",e)>=0||a.inArray("private",e)>=0)&&"localhost"!=window.location.hostname){var c=e[1];null!=(s=e[e.length-1])&&s!=c||(s="home"),dataLayer.push({event:"ga.custom_event","custom.category":c,"custom.action":s+" – Clique BIA","custom.label":"Botão Fale com a BIA"}),i=""}else if("localhost"!=window.location.hostname){var s;c=e[0];null!=(s=e[e.length-1])&&s!=c||(s="home"),dataLayer.push({event:"ga.custom_event","custom.category":c,"custom.action":s+" – Clique BIA","custom.label":"Botão Fale com a BIA"}),i=""}t=a("body").hasClass("mobile")?"&platform=MOBILE":"&platform=WEB",a("#chatbia-iframe").length?a("#chatbia-iframe").toggleClass("show"):(a("#chatbia").append("<div id='chatbia-iframe'><iframe src='"+n+"?"+i+t+"' /></div>"),a("#chatbia-iframe iframe").on("load",(function(){a("#chatbia-iframe").addClass("show"),a.inArray("consorcios",e)>=0&&a.inArray("classic",e)>=0&&"localhost"!=window.location.hostname&&dataLayer.push({event:"PageviewVirtual",virtualPageUrl:"consorcio/home-bia",virtualPageTitle:"Bia é a IA do Bradesco"})})))}))):a("#chatbia").remove(),setTimeout((function(){null!=window.parent&&null!=window.parent&&window.addEventListener("message",(function(o){if("FechaModal"==o.data)if(console.info(o.data),console.log("MODAL_CHAT_BIA_FECHADO"),a("#chatbia-iframe").removeClass("show"),a("#chatbia-iframe").remove(),a.inArray("consorcios",e)>=0&&a.inArray("classic",e)>=0&&"localhost"!=window.location.hostname)dataLayer.push({event:"interaction",EventCategory:"consorcio-home",EventAction:"consorcio-clique-bia",EventLabel:"Fechar modal"});else if((a.inArray("classic",e)>=0||a.inArray("exclusive",e)>=0||a.inArray("prime",e)>=0||a.inArray("private",e)>=0)&&"localhost"!=window.location.hostname){var i=e[1];null!=(t=e[e.length-1])&&t!=i||(t="home"),dataLayer.push({event:"ga.custom_event","custom.category":i,"custom.action":t+" – Clique BIA","custom.label":"Fechar modal"})}else if("localhost"!=window.location.hostname){var t;i=e[0];null!=(t=e[e.length-1])&&t!=i||(t="home"),dataLayer.push({event:"ga.custom_event","custom.category":i,"custom.action":t+" – Clique BIA","custom.label":"Fechar modal"})}}),!1)}),500)}));
//# sourceMappingURL=chatbia-dist.js.map