raygun4js
Version:
Raygun.io plugin for JavaScript
6 lines (5 loc) • 56.6 kB
JavaScript
/*! Raygun4js - v2.15.0 - 2019-04-08
* https://github.com/MindscapeHQ/raygun4js
* Copyright (c) 2019 MindscapeHQ; Licensed MIT */
!function(a,b){function c(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function d(a){return"undefined"==typeof a}var e,f={},g=a.TraceKit,h=[].slice,i="?";f.setRaygun=function(a){e||(e=a)},f.noConflict=function(){return a.TraceKit=g,f},f.wrap=function(a){function b(){try{return a.apply(this,arguments)}catch(b){throw f.report(b),b}}return b},f.report=function(){function b(a){j(),n.push(a)}function d(a){for(var b=n.length-1;b>=0;--b)n[b]===a&&n.splice(b,1)}function g(a,b){var d=null;if(!b||f.collectWindowErrors){for(var e in n)if(c(n,e))try{n[e].apply(null,[a].concat(h.call(arguments,2)))}catch(g){d=g}if(d)throw d}}function i(a,b,c,d,e){var h=null;if(e)h=f.computeStackTrace(e);else if(p)f.computeStackTrace.augmentStackTraceWithInitialElement(p,b,c,a),h=p,p=null,o=null;else{var i={url:b,line:c,column:d};i.func=f.computeStackTrace.guessFunctionName(i.url,i.line),i.context=f.computeStackTrace.gatherContext(i.url,i.line),h={mode:"onerror",message:a,url:document.location.href,stack:[i],useragent:navigator.userAgent}}return g(h,"from window.onerror"),!!l&&l.apply(this,arguments)}function j(){m!==!0&&(l=a.onerror,a.onerror=i,m=!0)}function k(b){var c;if("undefined"!=typeof document&&(c=h.call(arguments,1)),p){if(o===b)return;var d=p;p=null,o=null,g.apply(null,[d,null].concat(c))}var i=f.computeStackTrace(b);if(p=i,o=b,a.setTimeout(function(){o===b&&(p=null,o=null,g.apply(null,[i,null].concat(c)))},i.incomplete?2e3:0),!e.Utilities.isReactNative())throw b}var l,m,n=[],o=null,p=null;return k.subscribe=b,k.unsubscribe=d,k}(),f.computeStackTrace=function(){function b(a){return"string"!=typeof a?[]:""}function g(d){if(!c(x,d)){var e="";d=d||"";var f;f="undefined"!=typeof document?document.domain:a.location.hostname,d.indexOf&&d.indexOf(f)!==-1&&(e=b(d)),x[d]=e?e.split("\n"):[]}return x[d]}function h(a,b){var c,e=/function ([^(]*)\(([^)]*)\)/,f=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,h="",j=10,k=g(a);if(!k.length)return i;for(var l=0;l<j;++l)if(h=k[b-l]+h,!d(h)){if(c=f.exec(h))return c[1];if(c=e.exec(h))return c[1]}return i}function j(a,b){var c=g(a);if(!c.length)return null;var e=[],h=Math.floor(f.linesOfContext/2),i=h+f.linesOfContext%2,j=Math.max(0,b-h-1),k=Math.min(c.length,b+i-1);b-=1;for(var l=j;l<k;++l)d(c[l])||e.push(c[l]);return e.length>0?e:null}function k(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function l(a){return k(a).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function m(a,b){for(var c,d,e=0,f=b.length;e<f;++e)if((c=g(b[e])).length&&(c=c.join("\n"),d=a.exec(c)))return{url:b[e],line:c.substring(0,d.index).split("\n").length,column:d.index-c.lastIndexOf("\n",d.index)-1};return null}function n(a,b,c){var d,e=g(b),f=new RegExp("\\b"+k(a)+"\\b");return c-=1,e&&e.length>c&&(d=f.exec(e[c]))?d.index:null}function o(b){for(var c,d,e,f,g=[a.location.href],h=document.getElementsByTagName("script"),i=""+b,j=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,n=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,o=0;o<h.length;++o){var p=h[o];p.src&&g.push(p.src)}if(e=j.exec(i)){var q=e[1]?"\\s+"+e[1]:"",r=e[2].split(",").join("\\s*,\\s*");c=k(e[3]).replace(/;$/,";?"),d=new RegExp("function"+q+"\\s*\\(\\s*"+r+"\\s*\\)\\s*{\\s*"+c+"\\s*}")}else d=new RegExp(k(i).replace(/\s+/g,"\\s+"));if(f=m(d,g))return f;if(e=n.exec(i)){var s=e[1];if(c=l(e[2]),d=new RegExp("on"+s+"=[\\'\"]\\s*"+c+"\\s*[\\'\"]","i"),f=m(d,g[0]))return f;if(d=new RegExp(c),f=m(d,g))return f}return null}function p(a){if(!a.stack)return null;var b,c,d=/^\s*at (.*?) ?\(((?:file|https?|\s*|blob|chrome-extension|native|webpack|eval|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,f=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,g=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,k=a.stack.split("\n"),l=[],m=/^(.*) is undefined$/.exec(a.message);if(e.Utilities.isReactNative())for(var o=/^(.*@)?.*\/[^\.]+(\.app|CodePush)\/?(.*)/,p="file://reactnative.local/",q=0;q<k.length;q++)if(b=o.exec(k[q]),null!==b){var r=b[1]?b[1]:"anonymous@",s=b[3];k[q]=r+p+s}for(var q=0,t=k.length;q<t;++q){if(b=f.exec(k[q]))c={url:b[3],func:b[1]||i,args:b[2]?b[2].split(","):"",line:+b[4],column:b[5]?+b[5]:null};else if(b=d.exec(k[q]))c={url:b[2],func:b[1]||i,line:+b[3],column:b[4]?+b[4]:null};else{if(!(b=g.exec(k[q])))continue;c={url:b[2],func:b[1]||i,line:+b[3],column:b[4]?+b[4]:null}}!c.func&&c.line&&(c.func=h(c.url,c.line)),"undefined"!=typeof document&&c.line&&(c.context=j(c.url,c.line)),l.push(c)}if(l[0]&&l[0].line&&!l[0].column&&m?l[0].column=n(m[1],l[0].url,l[0].line):l[0].column||"undefined"==typeof a.columnNumber||(l[0].column=a.columnNumber+1),!l.length)return null;var u={mode:"stack",name:a?a.name:"",message:a?a.message:"",url:"undefined"!=typeof document?document.location.href:"",stack:l,useragent:navigator?navigator.userAgent:"",stackstring:a&&a.stack?a.stack.toString():""};return u}function q(a){for(var b,c=a.stacktrace,d=/ line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,e=c?c.split("\n"):[],f=[],g=0,i=e.length;g<i;g+=2)if(b=d.exec(e[g])){var k={line:+b[1],column:+b[2],func:b[3]||b[4],args:b[5]?b[5].split(","):[],url:b[6]};if(!k.func&&k.line&&(k.func=h(k.url,k.line)),k.line)try{k.context=j(k.url,k.line)}catch(l){}k.context||(k.context=[e[g+1]]),f.push(k)}return f.length?{mode:"stacktrace",name:a.name,message:a.message,url:document.location.href,stack:f,useragent:navigator.userAgent,stackstring:c}:null}function r(b){var d=b.message.split("\n");if(d.length<4)return null;var e,f,i,k,n=/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,p=/^\s*Line (\d+) of function script\s*$/i,q=[],r=document.getElementsByTagName("script"),s=[];for(f in r)c(r,f)&&!r[f].src&&s.push(r[f]);for(f=2,i=d.length;f<i;f+=2){var t=null;if(e=n.exec(d[f]))t={url:e[2],func:e[3],line:+e[1]};else if(e=o.exec(d[f])){t={url:e[3],func:e[4]};var u=+e[1],v=s[e[2]-1];if(v&&(k=g(t.url))){k=k.join("\n");var w=k.indexOf(v.innerText);w>=0&&(t.line=u+k.substring(0,w).split("\n").length)}}else if(e=p.exec(d[f])){var x=a.location.href.replace(/#.*$/,""),y=e[1],z=new RegExp(l(d[f+1]));k=m(z,[x]),t={url:x,line:k?k.line:y,func:""}}if(t){t.func||(t.func=h(t.url,t.line));var A=j(t.url,t.line),B=A?A[Math.floor(A.length/2)]:null;A&&B.replace(/^\s*/,"")===d[f+1].replace(/^\s*/,"")?t.context=A:t.context=[d[f+1]],q.push(t)}}return q.length?{mode:"multiline",name:b.name,message:d[0],url:document.location.href,stack:q,useragent:navigator.userAgent}:null}function s(a,b,c,d){var e={url:b,line:c};if(e.url&&e.line){a.incomplete=!1,e.func||(e.func=h(e.url,e.line)),e.context||(e.context=j(e.url,e.line));var f=/ '([^']+)' /.exec(d);if(f&&(e.column=n(f[1],e.url,e.line)),a.stack.length>0&&a.stack[0].url===e.url){if(a.stack[0].line===e.line)return!1;if(!a.stack[0].line&&a.stack[0].func===e.func)return a.stack[0].line=e.line,a.stack[0].context=e.context,!1}return a.stack.unshift(e),a.partial=!0,!0}return a.incomplete=!0,!1}function t(a,b){for(var c,d,e,g=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,j=[],k={},l=!1,m=t.caller;m&&!l;m=m.caller)if(m!==u&&m!==f.report){if(d={url:null,func:i,line:null,column:null},m.name?d.func=m.name:(c=g.exec(m.toString()))&&(d.func=c[1]),"undefined"==typeof d.func)try{d.func=c.input.substring(0,c.input.indexOf("{"))}catch(p){}if(e=o(m)){d.url=e.url,d.line=e.line,d.func===i&&(d.func=h(d.url,d.line));var q=/ '([^']+)' /.exec(a.message||a.description);q&&(d.column=n(q[1],e.url,e.line))}k[""+m]?l=!0:k[""+m]=!0,j.push(d)}b&&j.splice(0,b);var r={mode:"callers",name:a.name,message:a.message,url:document.location.href,stack:j,useragent:navigator.userAgent};return s(r,a.sourceURL||a.fileName,a.line||a.lineNumber,a.message||a.description),r}function u(a,b){var c=null;b=null==b?0:+b;try{if(c=q(a))return c}catch(d){if(w)throw d}try{if(c=p(a))return c}catch(d){if(w)throw d}try{if(c=r(a))return c}catch(d){if(w)throw d}try{if(c=t(a,b+1))return c}catch(d){if(w)throw d}return{tracekitResult:"failedToComputeAnyStackTrace"}}function v(a){a=(null==a?0:+a)+1;try{throw new Error}catch(b){return u(b,a+1)}}var w=!1,x={};return u.augmentStackTraceWithInitialElement=s,u.guessFunctionName=h,u.gatherContext=j,u.ofCaller=v,u}(),f.extendToAsynchronousCallbacks=function(){var b=function(b){var c=a[b];a[b]=function(){var a=h.call(arguments),b=a[0];return"function"==typeof b&&(a[0]=f.wrap(b)),c.apply?c.apply(this,a):c(a[0],a[1])}};b("setTimeout"),b("setInterval")},f.remoteFetching||(f.remoteFetching=!0),f.collectWindowErrors||(f.collectWindowErrors=!0),(!f.linesOfContext||f.linesOfContext<1)&&(f.linesOfContext=11),a.TraceKit=f}(window),function(a,b){"use strict";if(a&&a.event&&a.event.add){var c=a.event.add;a.event.add=function(d,e,f,g,h){if("function"!=typeof f&&"function"!=typeof f.handler)return c.call(this,d,e,f,g,h);var i;return f.handler?(i=f.handler,f.handler=b.wrap(f.handler)):(i=f,f=b.wrap(f)),i.guid?f.guid=i.guid:f.guid=i.guid=a.guid++,c.call(this,d,e,f,g,h)};var d=a.fn.ready;a.fn.ready=function(a){return d.call(this,b.wrap(a))};var e=a.ajax;a.ajax=function(c,d){"object"==typeof c&&(d=c,c=void 0),d=d||{};for(var f,g=["complete","error","success"];f=g.pop();)a.isFunction(d[f])&&(d[f]=b.wrap(d[f]));try{return c?e.call(this,c,d):e.call(this,d)}catch(h){throw b.report(h),h}}}}(window.jQuery,window.TraceKit),Date.prototype.toISOString||!function(){function a(a){var b=String(a);return 1===b.length&&(b="0"+b),b}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}(),Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c;if(null==this)throw new TypeError('"this" is null or not defined');var d=Object(this),e=d.length>>>0;if(0===e)return-1;var f=0|b;if(f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);c<e;){if(c in d&&d[c]===a)return c;c++}return-1}),Array.prototype.map||(Array.prototype.map=function(a){var b,c,d;if(null==this)throw new TypeError("this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(b=arguments[1]),c=new Array(f),d=0;d<f;){var g,h;d in e&&(g=e[d],h=a.call(b,g,d,e),c[d]=h),d++}return c}),Array.prototype.forEach||(Array.prototype.forEach=function(a){var b,c;if(null==this)throw new TypeError("this is null or not defined");var d=Object(this),e=d.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(b=arguments[1]),c=0;c<e;){var f;c in d&&(f=d[c],a.call(b,f,c,d)),c++}}),Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),window.raygunUtilityFactory=function(a,b){var c,d={getUuid:function(){function a(a){var b=(Math.random().toString(16)+"000000000").substr(2,8);return a?"-"+b.substr(0,4)+"-"+b.substr(4,4):b}return a()+a(!0)+a(!0)+a()},createCookie:function(a,b,c,d){if(!this.isReactNative()){var e;if(c){var f=new Date;f.setTime(f.getTime()+60*c*60*1e3),e="; expires="+f.toGMTString()}else e="";var g=d?"; secure":"";document.cookie=a+"="+b+e+"; path=/"+g}},readCookie:function(a){if(this.isReactNative())return"none";for(var b=a+"=",c=document.cookie.split(";"),d=0;d<c.length;d++){for(var e=c[d];" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(b))return e.substring(b.length,e.length)}return null},clearCookie:function(a){this.isReactNative()||this.createCookie(a,"",-1)},log:function(c,d){a.console&&a.console.log&&b.Options._debugMode&&(a.console.log(c),d&&a.console.log(d))},isApiKeyConfigured:function(){return!(!b.Options._raygunApiKey||""===b.Options._raygunApiKey)||(b.Utilities.log("Raygun API key has not been configured, make sure you call Raygun.init(yourApiKey)"),!1)},isReactNative:function(){return"undefined"==typeof document&&"undefined"!=typeof __DEV__},defaultReactNativeGlobalHandler:function(a,b){"function"==typeof c&&c(a,b)},localStorageAvailable:function(){try{return"localStorage"in a&&null!==a.localStorage}catch(b){return!1}},sessionStorageAvailable:function(){try{return"sessionStorage"in a&&null!==a.sessionStorage}catch(b){return!1}},truncateURL:function(a){var b=a,c=a.split("//")[1];if(c){var d=c.indexOf("?"),e=c.toString().substring(0,d),f=e.split("/").slice(0,4).join("/"),g=e.substring(0,48);b=f.length<g.length?f:g,b!==e&&(b+="..")}return b},merge:function(a,b){var c,d={};for(c in a)d[c]=a[c];for(c in b)d[c]=b[c];return d},mergeMutate:function(a,b){var c;for(c in b)a[c]=b[c];return a},mergeArray:function(a,b){return null!=b?a.concat(b):a.slice(0)},forEach:function(a,b){for(var c=0;c<a.length;c++)b.call(null,c,a[c])},isEmpty:function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},contains:function(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1},getRandomInt:function(){return Math.floor(9007199254740992*Math.random())},getViewPort:function(){if(this.isReactNative())return{width:"Not available",height:"Not available"};var b=document.documentElement,c=document.getElementsByTagName("body")[0],d=a.innerWidth||b.clientWidth||c.clientWidth,e=a.innerHeight||b.clientHeight||c.clientHeight;return{width:d,height:e}},parseUrl:function(b,c){function d(a){return!isNaN(parseFloat(a))&&isFinite(a)}return function(b,c){if("undefined"==typeof document)return"";var e=c||a.location.toString();if(!b)return e;b=b.toString(),"//"===e.substring(0,2)?e="http:"+e:1===e.split("://").length&&(e="http://"+e),c=e.split("/");var f={auth:""},g=c[2].split("@");1===g.length?g=g[0].split(":"):(f.auth=g[0],g=g[1].split(":")),f.protocol=c[0],f.hostname=g[0],f.port=g[1]||("https"===f.protocol.split(":")[0].toLowerCase()?"443":"80"),f.pathname=(c.length>3?"/":"")+c.slice(3,c.length).join("/").split("?")[0].split("#")[0];var h=f.pathname;"/"===h.charAt(h.length-1)&&(h=h.substring(0,h.length-1));var i=f.hostname,j=i.split("."),k=h.split("/");if("hostname"===b)return i;if("domain"===b)return/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(i)?i:j.slice(-2).join(".");if("sub"===b)return j.slice(0,j.length-2).join(".");if("port"===b)return f.port;if("protocol"===b)return f.protocol.split(":")[0];if("auth"===b)return f.auth;if("user"===b)return f.auth.split(":")[0];if("pass"===b)return f.auth.split(":")[1]||"";if("path"===b)return f.pathname;if("."===b.charAt(0)){if(b=b.substring(1),d(b))return b=parseInt(b,10),j[b<0?j.length+b:b-1]||""}else{if(d(b))return b=parseInt(b,10),k[b<0?k.length+b:b]||"";if("file"===b)return k.slice(-1)[0];if("filename"===b)return k.slice(-1)[0].split(".")[0];if("fileext"===b)return k.slice(-1)[0].split(".")[1]||"";if("?"===b.charAt(0)||"#"===b.charAt(0)){var l=e,m=null;if("?"===b.charAt(0)?l=(l.split("?")[1]||"").split("#")[0]:"#"===b.charAt(0)&&(l=l.split("#")[1]||""),!b.charAt(1))return l;b=b.substring(1),l=l.split("&");for(var n=0,o=l.length;n<o;n++)if(m=l[n].split("="),m[0]===b)return m[1]||"";return null}}return""}(b,c)},enhance:function(a,b,c){var d=a[b];return a[b]=function(){c.apply(this,arguments),"function"==typeof d&&d.apply(this,arguments)},function(){a[b]=d}},addEventHandler:function(a,b,c,d){var e=d||!1;return a.addEventListener?a.addEventListener(b,c,e):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c,function(){a.removeEventListener?a.removeEventListener(b,c,e):a.detachEvent?a.detachEvent("on"+b,c):a["on"+b]=function(){}}},nodeText:function(a){var b=a.textContent||a.innerText||"";return["submit","button"].indexOf(a.type)!==-1&&(b=a.value||b),b=b.replace(/^\s+|\s+$/g,"")},nodeSelector:function(a){var b=[a.tagName];return a.id&&b.push("#"+a.id),a.className&&a.className.length&&b.push("."+a.className.split(" ").join(".")),b.join("")},truncate:function(a,b){var c="(...)";return a.length>b?a.slice(0,b-c.length)+c:a},getOrigin:function(){return a.location.origin?a.location.origin:a.location.protocol+"//"+a.location.hostname+(a.location.port?":"+a.location.port:"")},resolveFullUrl:function(b){if(b&&a.location.pathname&&b.indexOf("://")===-1){var c=this.getOrigin();if(0!==b.indexOf("/")){var d=a.location.pathname,e=d.split("/");return e.pop(),c+e.join("/")+"/"+b}return c+b}return b},removeFromArray:function(a,b){for(var c=[],d=0;d<a.length;d++)a[d]!==b&&c.push(a[d]);return c},isIE:function(){return a.navigator.userAgent.indexOf("Trident")>-1||a.navigator.userAgent.indexOf("MSIE")>-1}};return d.isReactNative()&&__DEV__!==!0&&a.ErrorUtils&&a.ErrorUtils.getGlobalHandler&&(c=a.ErrorUtils.getGlobalHandler()),d},window.raygunNetworkTrackingFactory=function(a,b){var c=function(){this.requestHandlers=[],this.responseHandlers=[],this.errorHandlers=[],this.wrapWithHandler=function(a){return function(){try{return a.apply(this,arguments)}catch(c){b.Utilities.log(c)}}},this.executeHandlers=this.wrapWithHandler(function(a,b){for(var c=0;c<a.length;c++)a[c](JSON.parse(JSON.stringify(b)))}),this.wrapPrototypeWithHandlers(),this.attach()};return c.prototype.on=function(a,b){switch(a){case"request":this.requestHandlers.push(b);break;case"response":this.responseHandlers.push(b);break;case"error":this.errorHandlers.push(b)}},c.prototype.off=function(a,c){switch(a){case"request":this.requestHandlers=b.Utilities.removeFromArray(this.requestHandlers,c);break;case"response":this.responseHandlers=b.Utilities.removeFromArray(this.responseHandlers,c);break;case"error":this.errorHandlers=b.Utilities.removeFromArray(this.errorHandlers,c)}},c.prototype.attach=function(){var c=this;a.XMLHttpRequest.prototype.addEventListener&&b.Utilities.enhance(a.XMLHttpRequest.prototype,"open",c.wrapWithHandler(function(){var a=(new Date).getTime(),d=b.Utilities.resolveFullUrl(arguments[1])||"Unknown",e=d.split("?")[0],f=arguments[0];b.Utilities.enhance(this,"send",c.wrapWithHandler(function(){var a={method:f,requestURL:d,baseUrl:e};arguments[0]&&"string"==typeof arguments[0]&&(a.body=arguments[0]),c.executeHandlers(c.requestHandlers,a)})),this.addEventListener("load",c.wrapWithHandler(function(){var f="N/A for non text responses";""!==this.responseType&&"text"!==this.responseType||(f=this.responseText),b.Utilities.log("tracking xhr response for",d),c.executeHandlers(c.responseHandlers,{status:this.status,requestURL:d,responseURL:this.responseURL,baseUrl:e,body:f,duration:(new Date).getTime()-a})})),this.addEventListener("error",c.wrapWithHandler(function(){c.executeHandlers(c.errorHandlers,{requestURL:d,responseURL:this.responseURL,duration:(new Date).getTime()-a})}))}));var d=function(){};if("function"==typeof a.fetch&&"undefined"==typeof a.fetch.polyfill&&!b.Utilities.isIE()){var e=a.fetch;a.fetch=function(){var d,f,g=arguments[0],h=arguments[1],i=h&&h.method||"GET",j=(new Date).getTime();"string"==typeof g?d=g:"undefined"!=typeof a.Request&&g instanceof a.Request?(d=g.url,g.method&&(i=g.method)):d=String(g),d=b.Utilities.resolveFullUrl(d),f=d.split("?")[0];var k=e.apply(null,arguments);try{var l={method:i,requestURL:d,baseUrl:f};h&&h.body&&(l.body=h.body),c.executeHandlers(c.requestHandlers,l),k.then(c.wrapWithHandler(function(a){function e(){b.Utilities.log("tracking fetch response for",d),c.executeHandlers(c.responseHandlers,{status:a.status,requestURL:d,responseURL:a.url,body:g,baseUrl:f,duration:(new Date).getTime()-j})}var g="N/A when the fetch response does not support clone()",h="function"==typeof a.clone?a.clone():void 0;h?h.text().then(function(a){g=b.Utilities.truncate(a,500),e()}):e()})),k["catch"](c.wrapWithHandler(function(a){c.executeHandlers(c.errorHandlers,{metadata:{requestUrl:d,error:a.toString(),duration:(new Date).getTime()-j}})}))}catch(m){b.Utilities.log(m)}return k},d=function(){a.fetch=e}}},c.prototype.wrapPrototypeWithHandlers=function(){var a,b;for(a in c.prototype)b=c.prototype[a],"function"==typeof b&&(c.prototype[a]=this.wrapWithHandler(b))},new c},window.raygunBreadcrumbsFactory=function(a,b){function c(a,b){for(var c=0;c<b.length;c++){var d=b[c];if("string"==typeof d&&a&&a.indexOf(d)>-1)return!0;if("object"==typeof d&&d.exec(a))return!0}return!1}var d=function(){this.MAX_BREADCRUMBS=32,this.MAX_MESSAGE_SIZE=1024,this.BREADCRUMB_LEVELS=["debug","info","warning","error"],this.DEFAULT_BREADCRUMB_LEVEL="info",this.DEFAULT_XHR_IGNORED_HOSTS=["raygun"],this.breadcrumbLevel="info",this.logXhrContents=!1,this.xhrIgnoredHosts=[].concat(this.DEFAULT_XHR_IGNORED_HOSTS),this.breadcrumbs=[],this.wrapWithHandler=function(a){return function(){try{return a.apply(this,arguments)}catch(c){b.Utilities.log(c)}}},this.disableConsoleFunctions=[],this.disableNavigationFunctions=[],this.disableXHRLogging=function(){},this.disableClicksTracking=function(){},this.enableAutoBreadcrumbs(),this.wrapPrototypeWithHandlers()};return d.prototype.recordBreadcrumb=function(a,c){var d={level:this.DEFAULT_BREADCRUMB_LEVEL,timestamp:(new Date).getTime(),type:"manual"};switch(typeof a){case"object":d=b.Utilities.merge(d,a);break;case"string":d=b.Utilities.merge(b.Utilities.merge(d,{message:a,metadata:c}));break;default:return void b.Utilities.log("expected first argument to recordBreadcrumb to be a 'string' or 'object', got "+typeof a)}this.BREADCRUMB_LEVELS.indexOf(d.level)===-1&&(b.Utilities.log("unknown breadcrumb level "+d.level+" setting to default of '"+this.DEFAULT_BREADCRUMB_LEVEL+"'"),d.level=this.DEFAULT_BREADCRUMB_LEVEL),this.shouldRecord(d)&&(d.message=b.Utilities.truncate(d.message,this.MAX_MESSAGE_SIZE),this.breadcrumbs.push(d),this.breadcrumbs=this.breadcrumbs.slice(-this.MAX_BREADCRUMBS))},d.prototype.shouldRecord=function(a){var b=this.BREADCRUMB_LEVELS.indexOf(a.level),c=this.BREADCRUMB_LEVELS.indexOf(this.breadcrumbLevel);return b>=c},d.prototype.setBreadcrumbLevel=function(a){return this.BREADCRUMB_LEVELS.indexOf(a)===-1?void b.Utilities.log("Breadcrumb level of '"+a+"' is invalid, setting to default of '"+this.DEFAULT_BREADCRUMB_LEVEL+"'"):void(this.breadcrumbLevel=a)},d.prototype.setOption=function(a,b){if("breadcrumbsLevel"===a)this.setBreadcrumbLevel(b);else if("xhrIgnoredHosts"===a){this.xhrIgnoredHosts=b.concat(this.DEFAULT_XHR_IGNORED_HOSTS);var d=this;this.removeBreadcrumbsWithPredicate(function(a){return"request"===a.type&&c(a.metadata.requestURL||a.metadata.responseURL,d.xhrIgnoredHosts)})}else"logXhrContents"===a&&(this.logXhrContents=b)},d.prototype.any=function(){return this.breadcrumbs.length>0},d.prototype.all=function(){for(var a=[],b=0;b<this.breadcrumbs.length;b++){var c=this.breadcrumbs[b];c&&"request"===c.type&&!this.logXhrContents&&c.metadata&&c.metadata.body&&(c.metadata.body="Disabled because logContentsOfXhrCalls has not been enabled"),a.push(c)}return a},d.prototype.enableAutoBreadcrumbs=function(){this.enableAutoBreadcrumbsXHR(),this.enableAutoBreadcrumbsClicks(),this.enableAutoBreadcrumbsConsole(),this.enableAutoBreadcrumbsNavigation()},d.prototype.disableAutoBreadcrumbs=function(){this.disableAutoBreadcrumbsXHR(),this.disableAutoBreadcrumbsClicks(),this.disableAutoBreadcrumbsConsole(),this.disableAutoBreadcrumbsNavigation()},d.prototype.removeBreadcrumbsWithPredicate=function(a){for(var b=this.breadcrumbs,c=[],d=0;d<b.length;d++){var e=b[d];a(e)||c.push(e)}this.breadcrumbs=c},d.prototype.removeCrumbsOfType=function(a){this.removeBreadcrumbsWithPredicate(function(b){return b.type===a})},d.prototype.enableAutoBreadcrumbsConsole=function(){if("undefined"!=typeof a.console){var c=function(a,b){for(var c=[],d=0;d<b.length;d++){var e=b[d];null!==e&&void 0!==e&&c.push(e.toString())}this.recordBreadcrumb({type:"console",level:a,message:Array.prototype.slice.call(c).join(", ")})}.bind(this),d=["log","warn","error"],e=this;this.disableConsoleFunctions=d.map(function(a){return b.Utilities.enhance(console,a,e.wrapWithHandler(function(){var b="log"===a?"info":"warn"===a?"warning":"error";c(b,arguments)}))})}},d.prototype.disableAutoBreadcrumbsConsole=function(){this.disableConsoleFunctions.forEach(function(a){a()}),this.removeCrumbsOfType("console")},d.prototype.enableAutoBreadcrumbsNavigation=function(){if(a.addEventListener&&a.history&&a.history.pushState){var c=function(b,c,d,e){var f=location.pathname+location.search+location.hash,g=null;return a.history.state&&(g=history.state),{message:"History "+b,type:"navigation",level:"info",metadata:{from:f,to:e||f,prevState:JSON.stringify(g)||"unsupported",nextState:JSON.stringify(c)}}}.bind(this),d=function(a){return a.split("#")[1]||""},e=["pushState","replaceState"];this.disableNavigationFunctions=this.disableNavigationFunctions.concat(e.map(function(a){return b.Utilities.enhance(history,a,this.wrapWithHandler(function(b,d,e){this.recordBreadcrumb(c(a,b,d,e))}.bind(this)))}.bind(this)));var f=function(a){var b,c=a.oldURL,e=a.newURL;return b=c&&e?{from:d(c),to:d(e)}:{to:location.hash},{type:"navigation",message:"Hash change",metadata:b}},g=function(a){return this.wrapWithHandler(function(){this.recordBreadcrumb(a.apply(null,arguments))}.bind(this))}.bind(this),h=[{element:a,event:"hashchange",handler:f},{element:a,event:"load",handler:function(){return{type:"navigation",message:"Page loaded"}}},{element:a,event:"popstate",handler:function(){return{type:"navigation",message:"Navigated back"}}},{element:a,event:"pagehide",handler:function(){return{type:"navigation",message:"Page hidden"}}},{element:a,event:"pageshow",handler:function(){return{type:"navigation",message:"Page shown"}}},{element:document,event:"DOMContentLoaded",handler:function(){return{type:"navigation",message:"DOMContentLoaded"}}}];this.disableNavigationFunctions=this.disableNavigationFunctions.concat(h.map(function(a){return b.Utilities.addEventHandler(a.element,a.event,g(a.handler))}.bind(this)))}},d.prototype.disableAutoBreadcrumbsNavigation=function(){this.disableNavigationFunctions.forEach(function(a){a()}),this.disableNavigationFunctions=[],this.removeCrumbsOfType("navigation")},d.prototype.enableAutoBreadcrumbsClicks=function(){this.disableClicksTracking=b.Utilities.addEventHandler(a,"click",this.wrapWithHandler(function(a){var c,d;try{c=b.Utilities.truncate(b.Utilities.nodeText(a.target),150),d=b.Utilities.nodeSelector(a.target)}catch(e){c="[unknown]",d="[unknown]",b.Utilities.log("Error retrieving node text/selector. Most likely due to a cross domain error")}this.recordBreadcrumb({type:"click-event",message:"UI Click",level:"info",metadata:{text:c,selector:d}})}.bind(this),!0))},d.prototype.disableAutoBreadcrumbsClicks=function(){this.disableClicksTracking(),this.removeCrumbsOfType("click-event")},d.prototype.enableAutoBreadcrumbsXHR=function(){var a=this,d=a.wrapWithHandler(function(d){c(d.url,a.xhrIgnoredHosts)||(d.body&&(d.body=b.Utilities.truncate(d.body,500)),a.recordBreadcrumb({type:"request",message:"Opening request to "+d.requestURL,level:"info",metadata:d}))}),e=a.wrapWithHandler(function(d){c(d.requestURL,a.xhrIgnoredHosts)||c(d.responseURL,a.xhrIgnoredHosts)||(d.body&&(d.body=b.Utilities.truncate(d.body,500)),d.duration=d.duration+"ms",a.recordBreadcrumb({type:"request",message:"Finished request to "+d.requestURL,level:"info",metadata:d}))}),f=a.wrapWithHandler(function(b){c(b.requestURL,a.xhrIgnoredHosts)||(b.duration=b.duration+"ms",a.recordBreadcrumb({type:"request",message:"Failed request to "+b.requestUrl,level:"info",metadata:b}))});b.NetworkTracking.on("request",d),b.NetworkTracking.on("response",e),b.NetworkTracking.on("error",f),this.disableXHRLogging=function(){b.NetworkTracking.off("request",d),b.NetworkTracking.off("response",e),b.NetworkTracking.off("error",f)}},d.prototype.disableAutoBreadcrumbsXHR=function(){this.disableXHRLogging(),this.removeCrumbsOfType("request")},d.prototype.wrapPrototypeWithHandlers=function(){var a,b;for(a in d.prototype)b=d.prototype[a],"function"==typeof b&&(d.prototype[a]=this.wrapWithHandler(b))},d};var raygunFactory=function(a,b,c){function d(a){"function"==typeof F&&F(a)}function e(){y||T?j():w(f)}function f(a){var b="Unknown";a?b=a:(b=x.Utilities.getUuid(),u(b)),x.setUser(b,!0,null,null,null,b),j()}function g(a){var b=a.reason;!b&&a.detail&&a.detail.reason&&(b=a.detail.reason),b instanceof Error||!a.reason||!a.reason.error||(b=a.reason.error),b||(b=a),na.send(b,null,["UnhandledPromiseRejection"])}function h(){I=x.Utilities.addEventHandler(a,"unhandledrejection",g)}function i(){I&&I()}function j(){if(ga!==J.READY){if(ga=J.READY,x.RealUserMonitoring!==c&&!V){var b=function(){ca=new x.RealUserMonitoring(x.Options._raygunApiKey,$,t,y,z,Y,_,aa,N,ea,fa,ja,C,la),ca.attach()};"onLoad"===G?b():a.addEventListener?a.addEventListener("load",b):a.attachEvent("onload",b)}k(),m()}}function k(){var a;for(a=0;a<ha.length;a++)q(ha[a].stackTrace,ha[a].options,ha[a].userTriggered,ha[a].error);for(ha=[],a=0;a<ia.length;a++)na.trackEvent(ia[a].type,ia[a].options);ia=[]}function l(a,b){var c=(new Date).toJSON();try{var d="raygunjs+"+x.Options._raygunApiKey+"="+c+"="+x.Utilities.getRandomInt();"undefined"==typeof localStorage[d]&&(localStorage[d]=JSON.stringify({url:a,data:b}))}catch(e){x.Utilities.log("Raygun4JS: LocalStorage full, cannot save exception")}}function m(){if(x.Utilities.localStorageAvailable())for(var a in localStorage)if(a.indexOf("raygunjs+"+x.Options._raygunApiKey)>-1){try{var b=JSON.parse(localStorage[a]);t(b.url,b.data)}catch(c){x.Utilities.log("Raygun4JS: Invalid JSON object in LocalStorage")}try{localStorage.removeItem(a)}catch(c){x.Utilities.log("Raygun4JS: Unable to remove error")}}}function n(a,b){if(A)for(var d=0;d<A.length;d++)if("object"==typeof A[d]&&"function"==typeof A[d].exec){var e=A[d].exec(a);if(null!==e&&e!==c)return"[removed by filter]"}else if(A[d]===a)return"[removed by filter]";return b}function o(a,b){if(null==a)return a;if("[object Object]"!==Object.prototype.toString.call(a))return a;var c={};for(var d in a){var e=a[d];"[object Object]"===Object.prototype.toString.call(e)?"Details"!==b||"Client"!==d?c[d]=o(n(d,e),d):c[d]=e:"[object Function]"!==Object.prototype.toString.call(e)&&("undefined"!=typeof b?c[d]=n(d,e):"OccurredOn"===d&&(c[d]=e))}return c}function p(a,b,d,e){var f="AJAX Error: "+(b.statusText||"unknown")+" "+(d.type||"unknown")+" "+(x.Utilities.truncateURL(d.url)||"unknown");(!P||0!==b.status&&b.getAllResponseHeaders())&&x.send(e||a.type,{status:b.status,statusText:b.statusText,type:d.type,url:d.url,ajaxErrorMessage:f,contentType:d.contentType,requestData:d.data&&d.data.slice?d.data.slice(0,10240):c,responseData:b.responseText&&b.responseText.slice?b.responseText.slice(0,10240):c,activeTarget:a.target&&a.target.activeElement&&a.target.activeElement.outerHTML&&a.target.activeElement.outerHTML.slice?a.target.activeElement.outerHTML.slice(0,10240):c})}function q(b,d,e,f){if(ga!==J.READY)return void ha.push({stackTrace:b,options:d,userTriggered:e,error:f});var g="Script error",h=[],i={};if(S){if(!b.stack||!b.stack.length)return void x.Utilities.log("Raygun4JS: Cancelling send due to null stacktrace");var j=x.Utilities.parseUrl("domain"),k=g;if(b.message?k=b.message:d&&d.status&&(k=d.status),"undefined"==typeof k&&(k=g),!x.Utilities.isReactNative()&&"function"==typeof k.substring&&k.substring(0,g.length)===g&&null!==b.stack[0].url&&b.stack[0].url!==c&&b.stack[0].url.indexOf(j)===-1&&(0===b.stack[0].line||"?"===b.stack[0].func))return void x.Utilities.log("Raygun4JS: cancelling send due to third-party script error with no stacktrace and message");for(var l=!1,m=0;!l&&b.stack&&m<b.stack.length;m++)if(null!==b.stack[m]&&b.stack[m]!==c&&null!==b.stack[m].url&&b.stack[m].url!==c){
for(var p in Z)b.stack[m].url.indexOf(Z[p])>-1&&(l=!0);b.stack[m].url.indexOf(j)>-1&&(l=!0)}if(!l)return void x.Utilities.log("Raygun4JS: cancelling send due to error on non-origin, non-whitelisted domain")}if(_ instanceof Array)for(var q in _)if(_.hasOwnProperty(q)&&a.location.hostname&&a.location.hostname.match(_[q]))return void x.Utilities.log("Raygun4JS: cancelling send as error originates from an excluded hostname");if(aa instanceof Array&&!x.Utilities.isReactNative())for(var s in aa)if(aa.hasOwnProperty(s)&&navigator.userAgent.match(aa[s]))return void x.Utilities.log("Raygun4JS: cancelling send as error originates from an excluded user agent");if(x.Utilities.isReactNative()||!navigator.userAgent.match("RaygunPulseInsightsCrawler")){b.stack&&b.stack.length&&x.Utilities.forEach(b.stack,function(a,b){h.push({LineNumber:b.line,ColumnNumber:b.column,ClassName:"line "+b.line+", column "+b.column,FileName:b.url,MethodName:b.func||"[anonymous]"})});var t=x.Utilities.parseUrl("?");t.length>0&&x.Utilities.forEach(t.split("&"),function(a,b){var c=b.split("=");if(c&&2===c.length){var d=decodeURIComponent(c[0]),e=n(d,c[1]);i[d]=e}}),d===c&&(d={}),x.Utilities.isEmpty(d.customData)&&("function"==typeof X?d.customData=X():d.customData=X),x.Utilities.isEmpty(d.tags)&&("function"==typeof Y?d.tags=Y():"string"==typeof Y?d.tags=[Y]:d.tags=Y),e||(d.tags||(d.tags=[]),x.Utilities.contains(d.tags,"UnhandledException")||d.tags.push("UnhandledException")),x.Utilities.isReactNative()&&!x.Utilities.contains(d.tags,"React Native")&&d.tags.push("React Native");var u,v=a.screen||{width:x.Utilities.getViewPort().width,height:x.Utilities.getViewPort().height,colorDepth:8},w=d.customData&&d.customData.ajaxErrorMessage;u="customData"===ba?o(d.customData,"UserCustomData"):d.customData;try{JSON.stringify(u)}catch(A){var C="Cannot add custom data; may contain circular reference";u={error:C},x.Utilities.log("Raygun4JS: "+C)}var E=g;w?E=w:b.message?E=b.message:d&&d.status?E=d.status:"string"==typeof f&&(E=f),"undefined"==typeof E&&(E=g),E&&"string"==typeof E&&(E=E.substring(0,512));var F;F=x.Utilities.isReactNative()?"/":[location.protocol,"//",location.host,location.pathname,location.hash].join("");var G={OccurredOn:new Date,Details:{Error:{ClassName:b.name,Message:E,StackTrace:h,StackString:b.stackstring},Environment:{UtcOffset:(new Date).getTimezoneOffset()/-60,"User-Language":navigator.userLanguage,"Document-Mode":x.Utilities.isReactNative()?"Not available":document.documentMode,"Browser-Width":x.Utilities.getViewPort().width,"Browser-Height":x.Utilities.getViewPort().height,"Screen-Width":v.width,"Screen-Height":v.height,"Color-Depth":v.colorDepth,Browser:navigator.appCodeName,"Browser-Name":navigator.appName,"Browser-Version":navigator.appVersion,Platform:navigator.platform},Client:{Name:"raygun-js",Version:"2.15.0"},UserCustomData:u,Tags:d.tags,Request:{Url:F,QueryString:i,Headers:{"User-Agent":navigator.userAgent,Referer:x.Utilities.isReactNative()?"Not available":document.referrer,Host:x.Utilities.isReactNative()?"Not available":document.domain}},Version:z||"Not supplied"}};if(G.Details.User=y,da.any()){G.Details.Breadcrumbs=[];var H=da.all()||[];H.forEach(function(a){a.metadata&&(a.CustomData=a.metadata,delete a.metadata),G.Details.Breadcrumbs.push(a)})}if("all"===ba&&(G=o(G)),"function"==typeof D&&(x.Utilities.log("Raygun4JS: calling custom grouping key"),G.Details.GroupingKey=D(G,b,d)),"function"==typeof B){var I=B(G);I&&r(I)}else r(G)}}function r(a){if(x.Utilities.isApiKeyConfigured()){x.Utilities.log("Sending exception data to Raygun:",a);var b=$+"/entries?apikey="+encodeURIComponent(x.Options._raygunApiKey);t(b,JSON.stringify(a))}}function s(b,c){var d;return d=new a.XMLHttpRequest,"withCredentials"in d||x.Utilities.isReactNative()?d.open(b,c,!0):a.XDomainRequest&&(O&&(c=c.slice(6)),d=new a.XDomainRequest,d.open(b,c)),d.timeout=1e4,d}function t(b,c,e,f){var g=s("POST",b,c);return"function"==typeof g.setRequestHeader&&g.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),"function"==typeof E&&E(g),x.Utilities.log("Is offline enabled? "+R),"withCredentials"in g||x.Utilities.isReactNative()?(g.onreadystatechange=function(){4===g.readyState&&(202===g.status?m():R&&403!==g.status&&400!==g.status&&429!==g.status&&l(b,c))},g.onload=function(){x.Utilities.log("posted to Raygun"),d(this),e&&"function"==typeof e&&e(g,b,c)}):a.XDomainRequest&&(g.ontimeout=function(){R&&(x.Utilities.log("Raygun: saved locally"),l(b,c))},g.onload=function(){x.Utilities.log("posted to Raygun"),m(),d(this),e&&"function"==typeof e&&e(g,b,c)}),g.onerror=function(){x.Utilities.log("failed to post to Raygun"),d(this),f&&"function"==typeof f&&f(g,b,c)},g?(x.Utilities.isReactNative()&&g.setRequestHeader("Content-type","application/json;charset=UTF-8"),void g.send(c)):void x.Utilities.log("CORS not supported")}function u(a){x.Utilities.localStorageAvailable()?localStorage.setItem(K,a):x.Utilities.createCookie(K,a,744,la)}function v(){x.Utilities.localStorageAvailable()?localStorage.removeItem(K):x.Utilities.clearCookie(K)}function w(a){var b;return x.Utilities.localStorageAvailable()&&(b=localStorage.getItem(K),null!==b)?void a(b):(b=x.Utilities.readCookie(K),null!==b&&x.Utilities.localStorageAvailable()&&(x.Utilities.clearCookie(K),localStorage.setItem(K,b)),void a(b))}var x={};x.Utilities=raygunUtilityFactory(a,x),x.NetworkTracking=raygunNetworkTrackingFactory(a,x),x.Breadcrumbs=raygunBreadcrumbsFactory(a,x);var y,z,A,B,C,D,E,F,G,H,I,J={LOADING:0,READY:1},K="raygun4js-userid",L=TraceKit,M=a.Raygun,N=!1,O=!1,P=!1,Q=!1,R=!1,S=!1,T=!1,U=!1,V=!0,W=!1,X={},Y=[],Z=[],$="https://api.raygun.io",_=null,aa=null,ba="customData",ca=null,da=new x.Breadcrumbs,ea=null,fa=!0,ga=J.LOADING,ha=[],ia=[],ja=null,ka=!0,la=!1,ma=Math.random(),na={Rand:ma,Options:{},noConflict:function(){return M&&(a.Raygun=M),x},constructNewRaygun:function(){var b=raygunFactory(a,a.jQuery);return b},init:function(a,d,f){return L.remoteFetching=!1,this.Options._raygunApiKey=a,f&&(X=f),b&&(H=b(document)),d&&(O=d.allowInsecureSubmissions||!1,P=d.ignoreAjaxAbort||!1,Q=d.ignoreAjaxError||!1,T=d.disableAnonymousUserTracking||!1,U=d.disableErrorTracking||!1,V=d.disablePulse===c||d.disablePulse,_=d.excludedHostnames||!1,aa=d.excludedUserAgents||!1,ea=d.pulseMaxVirtualPageDuration||null,fa=d.pulseIgnoreUrlCasing||!1,ja=d.pulseCustomLoadTimeEnabled||!1,la=d.setCookieAsSecure||!1,d.apiUrl&&($=d.apiUrl),"undefined"!=typeof d.wrapAsynchronousCallbacks&&(W=d.wrapAsynchronousCallbacks),"undefined"!=typeof d.captureUnhandledRejections&&(ka=d.captureUnhandledRejections),d.debugMode&&(N=d.debugMode),this.Options._debugMode=N,d.ignore3rdPartyErrors&&(S=!0),d.apiEndpoint&&($=d.apiEndpoint),d.from&&(G=d.from)),e(),x},withCustomData:function(a){return X=a,x},withTags:function(a){return Y=a,ca!==c&&null!==ca&&ca.withTags(a),x},attach:function(){return!x.Utilities.isApiKeyConfigured()||U?x:(a.RaygunObject&&a[a.RaygunObject]&&a[a.RaygunObject].q&&(a.onerror=null),ka&&h(),x.Utilities.isReactNative()&&__DEV__!==!0&&a.ErrorUtils&&a.ErrorUtils.setGlobalHandler&&a.ErrorUtils.setGlobalHandler(function(a,b){var c=F;F=function(){"function"==typeof c&&c(),x.Utilities.defaultReactNativeGlobalHandler(a,b),F=c},TraceKit.report(a)}),L.report.subscribe(q),W&&L.extendToAsynchronousCallbacks(),H&&H.ajaxError&&!Q&&H.ajaxError(p),x)},detach:function(){return L.report.unsubscribe(q),H&&H.unbind("ajaxError",p),ka&&i(),x},send:function(a,b,c){if(U)return x.Utilities.log("Error not sent due to disabled error tracking"),x;try{q(L.computeStackTrace(a),{customData:"function"==typeof X?x.Utilities.merge(X(),b):x.Utilities.merge(X,b),tags:"function"==typeof Y?x.Utilities.mergeArray(Y(),c):x.Utilities.mergeArray(Y,c)},!0,a)}catch(d){if(a!==d)throw d}return x},setUser:function(a,b,d,e,f,g){return y={Identifier:a},"boolean"==typeof b&&(y.IsAnonymous=b),d&&(y.Email=d),e&&(y.FullName=e),f&&(y.FirstName=f),g&&(y.UUID=g),ca!==c&&null!==ca&&ca.setUser(y),x},resetAnonymousUser:function(){v()},setVersion:function(a){return z=a,x},saveIfOffline:function(a){return"undefined"!=typeof a&&"boolean"==typeof a&&(R=a),x},filterSensitiveData:function(a){return A=a,x},setFilterScope:function(a){return"customData"!==a&&"all"!==a||(ba=a),x},whitelistCrossOriginDomains:function(a){return Z=a,x},onBeforeSend:function(a){return B=a,x},onBeforeSendRum:function(a){return C=a,x},groupingKey:function(a){return D=a,x},onBeforeXHR:function(a){return E=a,x},onAfterSend:function(a){return F=a,x},endSession:function(){x.RealUserMonitoring!==c&&ca&&ca.endSession()},trackEvent:function(a,b){return ga!==J.READY?void ia.push({type:a,options:b}):void(x.RealUserMonitoring!==c&&ca&&("pageView"===a&&b.path?ca.virtualPageLoaded(b.path):"customTimings"===a&&b.timings&&ca.sendCustomTimings(b.timings)))},recordBreadcrumb:function(){da.recordBreadcrumb.apply(da,arguments)},enableAutoBreadcrumbs:function(a){a?da["enableAutoBreadcrumbs"+a]():da.enableAutoBreadcrumbs()},disableAutoBreadcrumbs:function(a){a?da["disableAutoBreadcrumbs"+a]():da.disableAutoBreadcrumbs()},setBreadcrumbOption:function(a,b){da.setOption(a,b)},setBreadcrumbs:function(a){da=a},getBreadcrumbs:function(){return da.all()}};return x=x.Utilities.mergeMutate(x,na),a.__raygunNoConflict||(a.Raygun=x),TraceKit.setRaygun(x),x};window.__instantiatedRaygun=raygunFactory(window,window.jQuery);var raygunRumFactory=function(a,b,c){c.RealUserMonitoring=function(b,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(){return null!==fa.heartBeatInterval?void V("Raygun4JS: Heartbeat already exists. Skipping heartbeat creation."):void(fa.heartBeatInterval=setInterval(function(){w(),x()},fa.heartBeatIntervalTime))}function r(){z({sessionId:fa.sessionId,timestamp:(new Date).toISOString(),type:"session_start",user:fa.user,version:fa.version||"Not supplied",tags:fa.tags,device:navigator.userAgent})}function s(a){var b=new Date($(a,"timestamp")),c=new Date(new Date-18e5);return b<c}function t(a){var b=Z(),c=null===b,d=!1;if(c||(d=s(b)),c||d)fa.sessionId=R(32),Y(fa.sessionId),a(!0);else{var e=$(b,"id");Y(e),fa.sessionId=e,a(!1)}}function u(){var a=Z(),b=!1;a&&(b=s(a)),!b&&a||(fa.sessionId=R(32)),Y(fa.sessionId),b&&r()}function v(a){var b=E(fa.virtualPage,a);null===b||b.length<0||D(b,!1)}function w(a){a&&y();var b=[];F(b),D(b,a)}function x(){if(fa.queuedItems.length>0){fa.queuedItems=ea(fa.queuedItems,"timestamp");var a=fa.queuedItems.splice(0,fa.maxQueueItemsSent);A(a)}}function y(){var a,b=0;for(b;b<fa.queuedPerformanceTimings.length;b++)a=fa.queuedPerformanceTimings[b],a.timing.t===ha.VirtualPage&&a.timing.pending&&(a.timing=K(a.timing))}function z(a){var b=[a];A(b)}function A(a){var b={eventData:a},c=function(){V("Raygun4JS: Items sent successfully. Queue length: "+fa.queuedItems.length)},d=function(b){C(a),V("Raygun4JS: Items failed to send. Queue length: "+fa.queuedItems.length+" Response status code: "+b.status)};M(b,c,d)}function B(a){if(!fa.pendingPayloadData||a){var b,c,d=[],e=[],f=!1,g=function(){e.push(W(d)),d=[],f=!1},h=function(){d.length>0&&g(),e.length>0&&(A(e),d=[],f=!1)};for(c=0;c<fa.queuedPerformanceTimings.length;c++){b=fa.queuedPerformanceTimings[c];var i=b.timing.t===ha.Page||b.timing.t===ha.VirtualPage;if(f&&i&&g(),d.length>0&&i&&g(),i&&X(),b.timing.t===ha.VirtualPage&&b.timing.pending)return h(),void fa.queuedPerformanceTimings.splice(0,c);d.push(b),f=f||b.timing.t===ha.Page||b.timing.t===ha.VirtualPage}h(),fa.queuedPerformanceTimings=[]}}function C(a){fa.queuedItems=a.concat(fa.queuedItems)}function D(a,b){fa.queuedPerformanceTimings=fa.queuedPerformanceTimings.concat(a),B(b)}function E(b,c){if(!S("timing","object")||void 0===a.performance.timing.fetchStart||isNaN(a.performance.timing.fetchStart))return null;var d=[];return c&&d.push(G()),F(d),b&&(d.push(H(b,T(0))),F(d,!0)),d}function F(b,c){if(S("getEntries","function"))try{for(var d=a.performance.getEntries(),e=fa.offset;e<d.length;e++){var f=d[e].name.split("?")[0];P(f)||b.push(ja(d[e],c))}ia(b),fa.offset=d.length}catch(g){V(g)}}function G(){var b=a.location.pathname;fa.ignoreUrlCasing&&(b=b.toLowerCase());var c=a.location.protocol+"//"+a.location.host+b;return c.length>800&&(c=c.substring(0,800)),{url:c,userAgent:navigator.userAgent,timing:I(a.performance.timing,0),size:0}}function H(b,c){fa.ignoreUrlCasing&&(b=b.toLowerCase()),b.indexOf("?")!==-1&&(b=b.split("?")[0]);var d=a.location.protocol+"//"+a.location.host+b;return d.length>800&&(d=d.substring(0,800)),{url:d,userAgent:navigator.userAgent,timing:L(c),size:0}}function I(a,b){var c={du:a.duration,t:ha.Page};return c.a=b+a.fetchStart,a.domainLookupStart&&a.domainLookupStart>0&&(c.b=b+a.domainLookupStart-c.a),a.domainLookupEnd&&a.domainLookupEnd>0&&(c.c=b+a.domainLookupEnd-c.a),a.connectStart&&a.connectStart>0&&(c.d=b+a.connectStart-c.a),a.connectEnd&&a.connectEnd>0&&(c.e=b+a.connectEnd-c.a),a.responseStart&&a.responseStart>0&&(c.f=b+a.responseStart-c.a),a.responseEnd&&a.responseEnd>0&&(c.g=b+a.responseEnd-c.a),a.domLoading&&a.domLoading>0&&(c.h=b+a.domLoading-c.a),a.domInteractive&&a.domInteractive>0&&(c.i=b+a.domInteractive-c.a),a.domContentLoadedEventEnd&&a.domContentLoadedEventEnd>0&&(c.j=b+a.domContentLoadedEventEnd-c.a),a.domComplete&&a.domComplete>0&&(c.k=U(b+a.domComplete-c.a)),a.loadEventStart&&a.loadEventStart>0&&(c.l=b+a.loadEventStart-c.a),a.loadEventEnd&&a.loadEventEnd>0&&(c.m=b+a.loadEventEnd-c.a),a.secureConnectionStart&&a.secureConnectionStart>0&&(c.n=b+(a.secureConnectionStart-a.connectStart)-c.a),c=Q(c)}function J(a,b){var c={du:U(a.duration).toFixed(2),t:_(a),a:b+a.fetchStart};return a.domainLookupStart&&a.domainLookupStart>0&&(c.b=b+a.domainLookupStart-c.a),a.domainLookupEnd&&a.domainLookupEnd>0&&(c.c=b+a.domainLookupEnd-c.a),a.connectStart&&a.connectStart>0&&(c.d=b+a.connectStart-c.a),a.connectEnd&&a.connectEnd>0&&(c.e=b+a.connectEnd-c.a),a.responseStart&&a.responseStart>0&&(c.f=b+a.responseStart-c.a),a.responseEnd&&a.responseEnd>0&&(c.g=b+a.responseEnd-c.a),a.secureConnectionStart&&a.secureConnectionStart>0&&(c.n=b+(a.secureConnectionStart-a.connectStart)-c.a),c.a=c.a.toFixed(2),c=Q(c)}function K(a){var b=T(0);return{t:a.t,du:Math.min(fa.maxVirtualPageDuration,b-a.startTime),o:Math.min(fa.maxVirtualPageDuration,b-a.staticLoad)}}function L(a){return{t:ha.VirtualPage,startTime:a,staticLoad:fa.initalStaticPageLoadTimestamp,pending:!0}}function M(a,b,c){"function"!=typeof b&&(b=function(){}),"function"!=typeof c&&(c=function(){}),N(fa.apiUrl+"/events?apikey="+encodeURIComponent(fa.apiKey),a,b,c)}function N(b,c,d,f){if(fa.excludedUserAgents instanceof Array)for(var g in fa.excludedUserAgents)if(fa.excludedUserAgents.hasOwnProperty(g)&&navigator.userAgent.match(fa.excludedUserAgents[g]))return void V("Raygun4JS: cancelling send as error originates from an excluded user agent");if(fa.excludedHostNames instanceof Array)for(var h in fa.excludedHostNames)if(fa.excludedHostNames.hasOwnProperty(h)&&a.location.hostname&&a.location.hostname.match(fa.excludedHostNames[h]))return void V("Raygun4JS: cancelling send as error originates from an excluded hostname");if(!navigator.userAgent.match("RaygunPulseInsightsCrawler")){var i=fa.beforeSend(c);if(!i)return void V("Raygun4JS: cancelling send because onBeforeSendRUM returned falsy value");if(i.eventData)for(var j=0;j<i.eventData.length;j++)i.eventData[j].data&&"string"!=typeof i.eventData[j].data&&(i.eventData[j].data=JSON.stringify(i.eventData[j].data));e(b,JSON.stringify(i),d,f)}}function O(a){this.xhrStatusMap[a.baseUrl]||(this.xhrStatusMap[a.baseUrl]=[]),V("adding response to xhr status map",a),this.xhrStatusMap[a.baseUrl].push(a)}function P(a){return 0===a.indexOf(fa.apiUrl)||(a.indexOf("favicon.ico")>0||(0===a.indexOf("about:blank")||("j"===a[0]&&1===a.indexOf("avascript:")||(0===a.indexOf("chrome-extension://")||(0===a.indexOf("res://")||0===a.indexOf("file://"))))))}function Q(a){for(var b in a)isNaN(a[b])&&"string"!=typeof a[b]&&(a[b]=0);return a}function R(a){return Math.round(Math.pow(36,a+1)-Math.random()*Math.pow(36,a)).toString(36).slice(1)}function S(b,c){return"object"==typeof a.performance&&(!b||b&&typeof a.performance[b]===c)}function T(b){return S("now","function")?a.performance.now():b}function U(a){return Math.min(a,3e5)}function V(b,c){fa.debugMode&&a.console&&a.console.log&&(c?a.console.log(b,c):a.console.log(b))}function W(a){return{sessionId:fa.sessionId,requestId:fa.requestId,timestamp:(new Date).toISOString(),type:"web_request_timing",user:fa.user,version:fa.version||"Not supplied",device:navigator.userAgent,tags:fa.tags,data:a}}function X(){fa.requestId=R(16)}function Y(a){var b=(new Date).toISOString(),d="id|"+a+"×tamp|"+b;c.Utilities.sessionStorageAvailable()?sessionStorage.setItem(fa.cookieName,d):c.Utilities.createCookie(fa.cookieName,d,null,fa.setCookieAsSecure)}function Z(){var a;return c.Utilities.sessionStorageAvailable()&&(a=sessionStorage.getItem(fa.cookieName),null!==a)?a:(a=c.Utilities.readCookie(fa.cookieName),null!==a&&c.Utilities.sessionStorageAvailable()&&(c.Utilities.clearCookie(fa.cookieName),sessionStorage.setItem(fa.cookieName,a)),a)}function $(a,b){var c=a.split(/[|&]/);return"id"===b?c[1]:"timestamp"===b?c[3]:void 0}function _(a){return"xmlhttprequest"===a.initiatorType||"fetch"===a.initiatorType?ha.XHR:ba(a)?ca(a):aa(a)?ha.XHR:ca(a)}function aa(a){return"string"==typeof a.initiatorType&&""===a.initiatorType}function ba(a){switch(a.initiatorType){case"img":case"css":case"script":case"link":case"other":case"use":return!0}return!1}function ca(a){return 0===a.duration?ha.CachedChildAsset:ha.ChildAsset}function da(a){return function(b,c){if(!b.hasOwnProperty(a)||!c.hasOwnProperty(a))return V('Raygun4JS: Property "'+a+'" not found in items in this collection'),0;var d=b[a],e=c[a],f=0;return d>e?f=1:d<e&&(f=-1),f}}function ea(a,b){return a.sort(