$(window).ready((function(){window.errorBattery=[];-1===location.href.indexOf("local")&&"true"!==function(t){for(var e=t+"=",o=document.cookie.split(";"),r=0;r<o.length;r++){for(var n=o[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(e))return n.substring(e.length,n.length)}return null}("debug")&&(window.onerror=function(t,e,o,r,n){window.handleError(n);return!0},$(window.onerror).on("change",(function(){window.onerror=function(t,e,o,r,n){window.handleError(n);return!0}})),window.console.error=function(t){window.handleError(t);return!0},window.handleError=function(t){if(null!=t&&errorNotExceptionExactMessage(t.toString())&&errorNotException(t.toString())){var e=t.toString(),o=t.stack;if(null!=e&&""!==e||null!=o&&""!==o){null!=o&&(o=o.replace(/\n/g,""));var r={type:"error",msg:e,extendedMsg:o,userAgent:navigator.userAgent,width:window.innerWidth,height:window.innerHeight,url:window.location};$.getJSON("//jsonip.com/?callback=?",(function(t){r.ip=t.ip})).always((function(){-1===location.host.indexOf("staging")&&-1===location.host.indexOf("local")&&-1===location.host.indexOf("qa")||console.log(r);let t=$.extend(!0,{},r);delete t.width,delete t.height,-1===$.inArray(JSON.stringify(t),window.errorBattery)&&(window.errorBattery.push(JSON.stringify(t)),llamadaAjax(r),setTimeout((function(){let e=$.inArray(JSON.stringify(t),window.errorBattery);window.errorBattery.splice(e,1)}),6e3))}))}}},llamadaAjax=function(t){var e=getLoggerUrl(),o=JSON.stringify(t);errorNotException(o)&&$.ajax({url:e,type:"POST",data:o,contentType:"application/json",dataType:"json"})},getLoggerUrl=function(){return-1!==document.location.host.indexOf("local")?"https://local.civitatis.com/logger":-1!==document.location.host.indexOf("staging")?"https://staging.civitatis.com/logger":-1!==document.location.host.indexOf("qa")?"https://qa.civitatis.com/logger":(document.location.host.indexOf("www.civitatis.com"),"https://www.civitatis.com/logger")},errorNotException=function(t){var e=[],o=!0;return e.push(/facebook pixel error/),e.push(/sealserver.trustwave/),e.push(/vars.hotjar/),e.push(/fls.doubleclick.net/),e.push(/\'insertrule\' of null/),e.push(/googlebot/),e.push(/adsbot-google/),e.push(/document.getelementsbyclassname.tostring/),e.push(/webcache.googleusercontent/),e.push(/file:/),e.push(/diablenightmode/),e.push(/cc.bingj.com/),e.push(/trustwave secure web gateway/),e.push(/avast/),e.push(/plugin \"linkid\" has already been required on tracker \"global\"/),e.push(/creative is not defined/),e.push(/pktannotationhighlighter/),e.push(/microdatajsonld/),e.push(/failed to initialize webgl/),e.push(/failed to read the \'sessionstorage\' property from \'window\'/),e.push(/moatmak/),e.push(/abtasty/),e.push(/googletagmanager/),e.push(/grecaptcha/),e.push(/mraidbridge/),e.push(/cmpint=paidsearch/),e.push(/gargoylesoftware/),e.push(/sdk.privacy-center.org/),e.push(/_autofillcallbackhandler/),$.each(e,(function(e,r){r.test(t.toLowerCase())&&(o=!1)})),o},errorNotExceptionExactMessage=function(t){var e=[];return result=!0,e.push("error"),$.each(e,(function(e,o){$.trim(t.toLowerCase())===o&&(result=!1)})),result})}));