var RUMSpeedIndex=function(t){var e,n,a=(t=t||window).document,r=function(e){var n=!1;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();(n={top:Math.max(r.top,0),left:Math.max(r.left,0),bottom:Math.min(r.bottom,t.innerHeight||a.documentElement.clientHeight),right:Math.min(r.right,t.innerWidth||a.documentElement.clientWidth)}).bottom<=n.top||n.right<=n.left?n=!1:n.area=(n.bottom-n.top)*(n.right-n.left)}return n},o=function(t,e){if(e){var n=r(t);n&&i.push({url:e,area:n.area,rect:n})}},i=[],d=[],m=.1;try{var c=t.performance.timing.navigationStart;!function(){for(var e=a.getElementsByTagName("*"),n=/url\(.*(http.*)\)/gi,d=0;d<e.length;d++){var m=e[d],c=t.getComputedStyle(m);if("IMG"==m.tagName&&o(m,m.src),c["background-image"]){n.lastIndex=0;var s=n.exec(c["background-image"]);s&&s.length>1&&o(m,s[1].replace('"',""))}if("IFRAME"==m.tagName)try{var l=r(m);if(l){var g=RUMSpeedIndex(m.contentWindow);g&&i.push({tm:g,area:l.area,rect:l})}}catch(t){}}}(),function(){for(var e={},n=t.performance.getEntriesByType("resource"),a=0;a<n.length;a++)e[n[a].name]=n[a].responseEnd;for(var r=0;r<i.length;r++)"tm"in i[r]||(i[r].tm=void 0!==e[i[r].url]?e[i[r].url]:0)}(),function(){try{for(var n=performance.getEntriesByType("paint"),r=0;r<n.length;r++)if("first-paint"==n[r].name){c=performance.getEntriesByType("navigation")[0].startTime,e=n[r].startTime-c;break}}catch(t){}if(void 0===e&&"msFirstPaint"in t.performance.timing&&(e=t.performance.timing.msFirstPaint-c),void 0===e&&"chrome"in t&&"loadTimes"in t.chrome){var o=t.chrome.loadTimes();if("firstPaintTime"in o&&o.firstPaintTime>0){var i=o.startLoadTime;"requestTime"in o&&(i=o.requestTime),o.firstPaintTime>=i&&(e=1e3*(o.firstPaintTime-i))}}if(void 0===e||e<0||e>12e4){e=t.performance.timing.responseStart-c;var d={},m=a.getElementsByTagName("head")[0].children;for(r=0;r<m.length;r++){var s=m[r];"SCRIPT"==s.tagName&&s.src&&!s.async&&(d[s.src]=!0),"LINK"==s.tagName&&"stylesheet"==s.rel&&s.href&&(d[s.href]=!0)}for(var l=t.performance.getEntriesByType("resource"),g=!1,f=0;f<l.length;f++)if(g||!d[l[f].name]||"script"!=l[f].initiatorType&&"link"!=l[f].initiatorType)g=!0;else{var h=l[f].responseEnd;(void 0===e||h>e)&&(e=h)}}e=Math.max(e,0)}(),function(){for(var n={0:0},r=0,o=0;o<i.length;o++){var c=e;"tm"in i[o]&&i[o].tm>e&&(c=i[o].tm),void 0===n[c]&&(n[c]=0),n[c]+=i[o].area,r+=i[o].area}var s=Math.max(a.documentElement.clientWidth,t.innerWidth||0)*Math.max(a.documentElement.clientHeight,t.innerHeight||0);if(s>0&&(s=Math.max(s-r,0)*m,void 0===n[e]&&(n[e]=0),n[e]+=s,r+=s),r){for(var l in n)n.hasOwnProperty(l)&&d.push({tm:l,area:n[l]});d.sort((function(t,e){return t.tm-e.tm}));for(var g=0,f=0;f<d.length;f++)g+=d[f].area,d[f].progress=g/r}}(),function(){if(d.length){n=0;for(var t=0,a=0,r=0;r<d.length;r++){var o=d[r].tm-t;o>0&&a<1&&(n+=(1-a)*o),t=d[r].tm,a=d[r].progress}}else n=e}()}catch(t){}return n};"undefined"!=typeof module&&module.exports&&(module.exports=RUMSpeedIndex);var minRandom=1,maxRandom=100,randomNumber=Math.floor(Math.random()*(maxRandom-minRandom+1))+minRandom;if(randomNumber<=10&&-1===location.host.indexOf("local")&&-1===location.host.indexOf("staging")&&-1===location.host.indexOf("qa")){var domLoaded,load,speedIndexResult=RUMSpeedIndex();"performance"in window&&"timing"in window.performance&&"navigation"in window.performance&&(window.addEventListener("DOMContentLoaded",(function t(e){var n=(new Date).getTime();window.removeEventListener("load",t,!1),domLoaded=n-performance.timing.navigationStart,callbackPerformance()}),!1),window.addEventListener("load",(function t(e){var n=(new Date).getTime();window.removeEventListener("load",t,!1),load=n-performance.timing.navigationStart,callbackPerformance()}),!1)),callbackPerformance=function(){void 0!==domLoaded&&void 0!==load&&null!==domLoaded&&null!==load&&$(window).ready((function(){var t=window.performance.timing,e=t.redirectEnd-t.redirectStart,n=t.fetchStart-t.navigationStart,a=t.domainLookupStart-t.navigationStart,r=t.domainLookupEnd-t.domainLookupStart,o=t.connectStart-t.navigationStart,i=t.connectEnd-t.connectStart,d=t.requestStart-t.navigationStart,m=t.responseStart-t.requestStart,c=t.responseStart-t.navigationStart,s=t.responseEnd-t.responseStart,l=navigator.userAgent,g=window.innerWidth,f=window.innerHeight,h=window.location,u={type:"performance",domContentLoadedEvent:Math.round(domLoaded),loadEventEnd:Math.round(load),speedIndexResult:Math.round(speedIndexResult),redirectTime:Math.round(e),fetchStart:Math.round(n),dnsTime:Math.round(r),tcpTime:Math.round(i),requestTime:Math.round(m),ttfbTime:Math.round(c),responseTime:Math.round(s),domainLookupStart:Math.round(a),connectStart:Math.round(o),requestStart:Math.round(d),userAgent:l,width:g,height:f,url:h};llamadaAjax(u)}))},llamadaAjax=function(t){var e=getLoggerUrl();$.ajax({url:e,type:"POST",data:JSON.stringify(t),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")}}