From 84976dd1f02831cf29e426165f888e1d30f716f0 Mon Sep 17 00:00:00 2001 From: fundead Date: Thu, 26 Mar 2015 17:30:39 +1300 Subject: [PATCH 1/4] Checkpoint sanitize implementation --- src/raygun.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/raygun.js b/src/raygun.js index 379f586a..425689c5 100644 --- a/src/raygun.js +++ b/src/raygun.js @@ -451,6 +451,44 @@ var raygunFactory = function (window, $, undefined) { return reference; } + function sanitizePayload (errorPayload) { + var hasFiltered = false; + + var getFilter = function (keysToSanitize) { + var recursiveMap = function (value, key, list) { + if (_.contains(keysToSanitize, key)) { + hasFiltered = true; + + if (typeof list[key] === 'object') { + return list[key] = ''; + } else { + return list[key] = ''; + } + + } else if (typeof value === 'object') { + return list[key] = _.each(value, arguments.callee); + } + else { + return list[key] = value + } + }; + + return recursiveMap; + }; + + var keysToFilter = ['username', 'password', 'cvv', 'Url', 'QueryString', 'Version', 'User']; + + var filteredDetails = _.mapObject(errorPayload.Details, getFilter(_keysToSanitize)); + + if (hasFiltered) { + filteredDetails.Tags.push('Filtered'); + + errorPayload.Details = filteredDetails; + } + + return errorPayload; + } + function processUnhandledException(stackTrace, options) { var stack = [], qs = {}; From ae2b559e51e87e651f5245560089d653f51b5ae2 Mon Sep 17 00:00:00 2001 From: fundead Date: Fri, 27 Mar 2015 11:18:20 +1300 Subject: [PATCH 2/4] Add new setFilterScope public function and extend algorithm to support filtering across entire payload Supported scopes are "all" and "customData" (current and default behaviour) --- src/raygun.js | 66 +++++++++++++++++++-------------------------------- 1 file changed, 25 insertions(+), 41 deletions(-) diff --git a/src/raygun.js b/src/raygun.js index 425689c5..9bdb3511 100644 --- a/src/raygun.js +++ b/src/raygun.js @@ -31,6 +31,7 @@ var raygunFactory = function (window, $, undefined) { _raygunApiUrl = 'https://api.raygun.io', _excludedHostnames = null, _excludedUserAgents = null, + _filterScope = 'customData', $document; if ($) { @@ -181,6 +182,13 @@ var raygunFactory = function (window, $, undefined) { return Raygun; }, + setFilterScope: function (scope) { + if (scope === 'customData' || scope === 'all') { + _filterScope = scope; + } + return Raygun; + }, + whitelistCrossOriginDomains: function (whitelist) { _whitelistedScriptDomains = whitelist; return Raygun; @@ -425,7 +433,7 @@ var raygunFactory = function (window, $, undefined) { return value; } - function filterObject(reference) { + function filterObject(reference, parentKey) { if (reference == null) { return reference; } @@ -442,53 +450,19 @@ var raygunFactory = function (window, $, undefined) { } if (Object.prototype.toString.call(propertyValue) === '[object Object]') { - reference[propertyName] = filterObject(propertyValue); + if ((parentKey !== 'Details' || propertyName !== 'Client')) { + reference[propertyName] = filterObject(filterValue(propertyName, propertyValue), propertyName); + } } else { + if (typeof parentKey !== 'undefined' || propertyName !== 'OccurredOn') { reference[propertyName] = filterValue(propertyName, propertyValue); + } } } return reference; } - function sanitizePayload (errorPayload) { - var hasFiltered = false; - - var getFilter = function (keysToSanitize) { - var recursiveMap = function (value, key, list) { - if (_.contains(keysToSanitize, key)) { - hasFiltered = true; - - if (typeof list[key] === 'object') { - return list[key] = ''; - } else { - return list[key] = ''; - } - - } else if (typeof value === 'object') { - return list[key] = _.each(value, arguments.callee); - } - else { - return list[key] = value - } - }; - - return recursiveMap; - }; - - var keysToFilter = ['username', 'password', 'cvv', 'Url', 'QueryString', 'Version', 'User']; - - var filteredDetails = _.mapObject(errorPayload.Details, getFilter(_keysToSanitize)); - - if (hasFiltered) { - filteredDetails.Tags.push('Filtered'); - - errorPayload.Details = filteredDetails; - } - - return errorPayload; - } - function processUnhandledException(stackTrace, options) { var stack = [], qs = {}; @@ -597,7 +571,13 @@ var raygunFactory = function (window, $, undefined) { var screen = window.screen || { width: getViewPort().width, height: getViewPort().height, colorDepth: 8 }; var custom_message = options.customData && options.customData.ajaxErrorMessage; - var finalCustomData = filterObject(options.customData); + + var finalCustomData; + if (_filterScope === 'customData') { + finalCustomData = filterObject(options.customData, 'UserCustomData'); + } else { + finalCustomData = options.customData; + } try { JSON.stringify(finalCustomData); @@ -654,6 +634,10 @@ var raygunFactory = function (window, $, undefined) { ensureUser(); payload.Details.User = _user; + if (_filterScope === 'all') { + payload = filterObject(payload); + } + if (typeof _beforeSendCallback === 'function') { var mutatedPayload = _beforeSendCallback(payload); From 69e5447b7dde3b6c0ee537f5cc5ae559e78131d2 Mon Sep 17 00:00:00 2001 From: fundead Date: Fri, 27 Mar 2015 11:29:54 +1300 Subject: [PATCH 3/4] Docs/version bump --- CHANGELOG.md | 3 +++ README.md | 16 ++++++++++++---- bower.json | 2 +- package.json | 2 +- raygun4js.nuspec | 2 +- src/raygun.js | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fb8051d..05995638 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +* v1.18.0 + - Add new setFilterScope() function for supporting applying the filterSensitiveData keys across the entire payload (supported scopes are 'all' and 'customData') + * v1.17.0 - Add location.hash to Request.Url before payload is sent diff --git a/README.md b/README.md index 138f2ab3..9f1a1431 100644 --- a/README.md +++ b/README.md @@ -269,15 +269,23 @@ Raygun.setVersion('1.0.0.0'); This will allow you to filter the errors in the dashboard by that version. You can also select only the latest version, to ignore errors that were triggered by ancient versions of your code. The parameter needs to be a string in the format x.x.x.x, where x is a positive integer. -### Filter sensitive request data +### Filtering sensitive data -The library automatically transmits query string key-values. To filter sensitive keys from this, call: +You can blacklist keys to prevent their values from being sent it the payload by providing an array of key names: ```javascript -Raygun.filterSensitiveData(['pwd']); +Raygun.filterSensitiveData(['password', 'credit_card']); ``` -It accepts an array of strings. If a key in the query string matches any in this array, it won't be sent. +By default this is applied to the UserCustomData object only (legacy behavior). To apply this to any key-value pair, you can change the filtering scope: + +```javascript +// Filter any key in the payload +Raygun.setFilterScope('all'); + +// Just filter the custom data (default) +Raygun.setFilterScope('customData'); +``` ### Source maps support diff --git a/bower.json b/bower.json index 1108f50e..0bd29b8a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "raygun4js", - "version": "1.17.0", + "version": "1.18.0", "homepage": "http://raygun.io", "authors": [ "Mindscape " diff --git a/package.json b/package.json index d26f8083..d2135329 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "main": "dist/raygun.js", "title": "Raygun4js", "description": "Raygun.io plugin for JavaScript", - "version": "1.17.0", + "version": "1.18.0", "homepage": "https://github.com/MindscapeHQ/raygun4js", "author": { "name": "MindscapeHQ", diff --git a/raygun4js.nuspec b/raygun4js.nuspec index da880178..3c6c40d5 100644 --- a/raygun4js.nuspec +++ b/raygun4js.nuspec @@ -2,7 +2,7 @@ raygun4js - 1.17.0 + 1.18.0 Raygun4js Mindscape Limited Mindscape Limited diff --git a/src/raygun.js b/src/raygun.js index 9bdb3511..5043d7cd 100644 --- a/src/raygun.js +++ b/src/raygun.js @@ -614,7 +614,7 @@ var raygunFactory = function (window, $, undefined) { }, 'Client': { 'Name': 'raygun-js', - 'Version': '1.16.2' + 'Version': '1.18.0' }, 'UserCustomData': finalCustomData, 'Tags': options.tags, From 7aac1692fb56272fd084c80db936a6c2cfa373b5 Mon Sep 17 00:00:00 2001 From: fundead Date: Fri, 27 Mar 2015 11:30:38 +1300 Subject: [PATCH 4/4] Artifacts --- dist/raygun.js | 32 +++++++++++++++++++++++++++----- dist/raygun.min.js | 4 ++-- dist/raygun.vanilla.js | 32 +++++++++++++++++++++++++++----- dist/raygun.vanilla.min.js | 4 ++-- 4 files changed, 58 insertions(+), 14 deletions(-) diff --git a/dist/raygun.js b/dist/raygun.js index bd60749b..054fa1d1 100644 --- a/dist/raygun.js +++ b/dist/raygun.js @@ -1,4 +1,4 @@ -/*! Raygun4js - v1.17.0 - 2015-03-20 +/*! Raygun4js - v1.18.0 - 2015-03-27 * https://github.com/MindscapeHQ/raygun4js * Copyright (c) 2015 MindscapeHQ; Licensed MIT */ (function(window, undefined) { @@ -1223,6 +1223,7 @@ var raygunFactory = function (window, $, undefined) { _raygunApiUrl = 'https://api.raygun.io', _excludedHostnames = null, _excludedUserAgents = null, + _filterScope = 'customData', $document; if ($) { @@ -1373,6 +1374,13 @@ var raygunFactory = function (window, $, undefined) { return Raygun; }, + setFilterScope: function (scope) { + if (scope === 'customData' || scope === 'all') { + _filterScope = scope; + } + return Raygun; + }, + whitelistCrossOriginDomains: function (whitelist) { _whitelistedScriptDomains = whitelist; return Raygun; @@ -1617,7 +1625,7 @@ var raygunFactory = function (window, $, undefined) { return value; } - function filterObject(reference) { + function filterObject(reference, parentKey) { if (reference == null) { return reference; } @@ -1634,9 +1642,13 @@ var raygunFactory = function (window, $, undefined) { } if (Object.prototype.toString.call(propertyValue) === '[object Object]') { - reference[propertyName] = filterObject(propertyValue); + if ((parentKey !== 'Details' || propertyName !== 'Client')) { + reference[propertyName] = filterObject(filterValue(propertyName, propertyValue), propertyName); + } } else { + if (typeof parentKey !== 'undefined' || propertyName !== 'OccurredOn') { reference[propertyName] = filterValue(propertyName, propertyValue); + } } } @@ -1751,7 +1763,13 @@ var raygunFactory = function (window, $, undefined) { var screen = window.screen || { width: getViewPort().width, height: getViewPort().height, colorDepth: 8 }; var custom_message = options.customData && options.customData.ajaxErrorMessage; - var finalCustomData = filterObject(options.customData); + + var finalCustomData; + if (_filterScope === 'customData') { + finalCustomData = filterObject(options.customData, 'UserCustomData'); + } else { + finalCustomData = options.customData; + } try { JSON.stringify(finalCustomData); @@ -1788,7 +1806,7 @@ var raygunFactory = function (window, $, undefined) { }, 'Client': { 'Name': 'raygun-js', - 'Version': '1.16.2' + 'Version': '1.18.0' }, 'UserCustomData': finalCustomData, 'Tags': options.tags, @@ -1808,6 +1826,10 @@ var raygunFactory = function (window, $, undefined) { ensureUser(); payload.Details.User = _user; + if (_filterScope === 'all') { + payload = filterObject(payload); + } + if (typeof _beforeSendCallback === 'function') { var mutatedPayload = _beforeSendCallback(payload); diff --git a/dist/raygun.min.js b/dist/raygun.min.js index 23d17bbf..8bf47184 100644 --- a/dist/raygun.min.js +++ b/dist/raygun.min.js @@ -1,4 +1,4 @@ -/*! Raygun4js - v1.17.0 - 2015-03-20 +/*! Raygun4js - v1.18.0 - 2015-03-27 * https://github.com/MindscapeHQ/raygun4js * Copyright (c) 2015 MindscapeHQ; Licensed MIT */ -(function(n){function e(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function t(n){return n===undefined}var r={},i=n.TraceKit,a=[].slice,o="?";r.noConflict=function(){return n.TraceKit=i,r},r.wrap=function(n){function e(){try{return n.apply(this,arguments)}catch(e){throw r.report(e),e}}return e},r.report=function(){function t(n){l(),g.push(n)}function i(n){for(var e=g.length-1;e>=0;--e)g[e]===n&&g.splice(e,1)}function o(n,t){var i=null;if(!t||r.collectWindowErrors){for(var o in g)if(e(g,o))try{g[o].apply(null,[n].concat(a.call(arguments,2)))}catch(u){i=u}if(i)throw i}}function u(n,e,t,i,a){var u=null;if(a)u=r.computeStackTrace(a);else if(h)r.computeStackTrace.augmentStackTraceWithInitialElement(h,e,t,n),u=h,h=null,p=null;else{var l={url:e,line:t,column:i};l.func=r.computeStackTrace.guessFunctionName(l.url,l.line),l.context=r.computeStackTrace.gatherContext(l.url,l.line),u={mode:"onerror",message:n,url:document.location.href,stack:[l],useragent:navigator.userAgent}}return o(u,"from window.onerror"),s?s.apply(this,arguments):!1}function l(){f!==!0&&(s=n.onerror,n.onerror=u,f=!0)}function c(e){var t=a.call(arguments,1);if(h){if(p===e)return;var i=h;h=null,p=null,o.apply(null,[i,null].concat(t))}var u=r.computeStackTrace(e);throw h=u,p=e,n.setTimeout(function(){p===e&&(h=null,p=null,o.apply(null,[u,null].concat(t)))},u.incomplete?2e3:0),e}var s,f,g=[],p=null,h=null;return c.subscribe=t,c.unsubscribe=i,c}(),r.computeStackTrace=function(){function i(e){if(!r.remoteFetching)return"";try{var t=function(){try{return new n.XMLHttpRequest}catch(e){return new n.ActiveXObject("Microsoft.XMLHTTP")}},i=t();return i.open("GET",e,!1),i.send(""),i.responseText}catch(a){return""}}function a(n){if(!e(S,n)){var t="";n=n||"",n.indexOf&&-1!==n.indexOf(document.domain)&&(t=i(n)),S[n]=t?t.split("\n"):[]}return S[n]}function u(n,e){var r,i=/function ([^(]*)\(([^)]*)\)/,u=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,l="",c=10,s=a(n);if(!s.length)return o;for(var f=0;c>f;++f)if(l=s[e-f]+l,!t(l)){if(r=u.exec(l))return r[1];if(r=i.exec(l))return r[1]}return o}function l(n,e){var i=a(n);if(!i.length)return null;var o=[],u=Math.floor(r.linesOfContext/2),l=u+r.linesOfContext%2,c=Math.max(0,e-u-1),s=Math.min(i.length,e+l-1);e-=1;for(var f=c;s>f;++f)t(i[f])||o.push(i[f]);return o.length>0?o:null}function c(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function s(n){return c(n).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function f(n,e){for(var t,r,i=0,o=e.length;o>i;++i)if((t=a(e[i])).length&&(t=t.join("\n"),r=n.exec(t)))return{url:e[i],line:t.substring(0,r.index).split("\n").length,column:r.index-t.lastIndexOf("\n",r.index)-1};return null}function g(n,e,t){var r,i=a(e),o=RegExp("\\b"+c(n)+"\\b");return t-=1,i&&i.length>t&&(r=o.exec(i[t]))?r.index:null}function p(e){for(var t,r,i,a,o=[n.location.href],u=document.getElementsByTagName("script"),l=""+e,g=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,p=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,h=0;u.length>h;++h){var d=u[h];d.src&&o.push(d.src)}if(i=g.exec(l)){var m=i[1]?"\\s+"+i[1]:"",v=i[2].split(",").join("\\s*,\\s*");t=c(i[3]).replace(/;$/,";?"),r=RegExp("function"+m+"\\s*\\(\\s*"+v+"\\s*\\)\\s*{\\s*"+t+"\\s*}")}else r=RegExp(c(l).replace(/\s+/g,"\\s+"));if(a=f(r,o))return a;if(i=p.exec(l)){var y=i[1];if(t=s(i[2]),r=RegExp("on"+y+"=[\\'\"]\\s*"+t+"\\s*[\\'\"]","i"),a=f(r,o[0]))return a;if(r=RegExp(t),a=f(r,o))return a}return null}function h(n){if(!n.stack)return null;for(var e,t,r=/^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|http|https|chrome-extension):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=/^\s*(\S*)(?:\((.*?)\))?@?((?:file|http|https):.*?):(\d+)(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=n.stack.split("\n"),s=[],f=/^(.*) is undefined$/.exec(n.message),p=0,h=c.length;h>p;++p){if(e=i.exec(c[p]))t={url:e[3],func:e[1]||o,args:e[2]?e[2].split(","):"",line:+e[4],column:e[5]?+e[5]:null};else if(e=r.exec(c[p]))t={url:e[2],func:e[1]||o,line:+e[3],column:e[4]?+e[4]:null};else{if(!(e=a.exec(c[p])))continue;t={url:e[2],func:e[1]||o,line:+e[3],column:e[4]?+e[4]:null}}!t.func&&t.line&&(t.func=u(t.url,t.line)),t.line&&(t.context=l(t.url,t.line)),s.push(t)}return s[0]&&s[0].line&&!s[0].column&&f&&(s[0].column=g(f[1],s[0].url,s[0].line)),s.length?{mode:"stack",name:n.name,message:n.message,url:document.location.href,stack:s,useragent:navigator.userAgent}:null}function d(n){for(var e,t=n.stacktrace,r=/ line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,i=t.split("\n"),a=[],o=0,c=i.length;c>o;o+=2)if(e=r.exec(i[o])){var s={line:+e[1],column:+e[2],func:e[3]||e[4],args:e[5]?e[5].split(","):[],url:e[6]};if(!s.func&&s.line&&(s.func=u(s.url,s.line)),s.line)try{s.context=l(s.url,s.line)}catch(f){}s.context||(s.context=[i[o+1]]),a.push(s)}return a.length?{mode:"stacktrace",name:n.name,message:n.message,url:document.location.href,stack:a,useragent:navigator.userAgent}:null}function m(t){var r=t.message.split("\n");if(4>r.length)return null;var i,o,c,g,p=/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,h=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,d=/^\s*Line (\d+) of function script\s*$/i,m=[],v=document.getElementsByTagName("script"),y=[];for(o in v)e(v,o)&&!v[o].src&&y.push(v[o]);for(o=2,c=r.length;c>o;o+=2){var x=null;if(i=p.exec(r[o]))x={url:i[2],func:i[3],line:+i[1]};else if(i=h.exec(r[o])){x={url:i[3],func:i[4]};var w=+i[1],k=y[i[2]-1];if(k&&(g=a(x.url))){g=g.join("\n");var S=g.indexOf(k.innerText);S>=0&&(x.line=w+g.substring(0,S).split("\n").length)}}else if(i=d.exec(r[o])){var b=n.location.href.replace(/#.*$/,""),T=i[1],A=RegExp(s(r[o+1]));g=f(A,[b]),x={url:b,line:g?g.line:T,func:""}}if(x){x.func||(x.func=u(x.url,x.line));var O=l(x.url,x.line),R=O?O[Math.floor(O.length/2)]:null;x.context=O&&R.replace(/^\s*/,"")===r[o+1].replace(/^\s*/,"")?O:[r[o+1]],m.push(x)}}return m.length?{mode:"multiline",name:t.name,message:r[0],url:document.location.href,stack:m,useragent:navigator.userAgent}:null}function v(n,e,t,r){var i={url:e,line:t};if(i.url&&i.line){n.incomplete=!1,i.func||(i.func=u(i.url,i.line)),i.context||(i.context=l(i.url,i.line));var a=/ '([^']+)' /.exec(r);if(a&&(i.column=g(a[1],i.url,i.line)),n.stack.length>0&&n.stack[0].url===i.url){if(n.stack[0].line===i.line)return!1;if(!n.stack[0].line&&n.stack[0].func===i.func)return n.stack[0].line=i.line,n.stack[0].context=i.context,!1}return n.stack.unshift(i),n.partial=!0,!0}return n.incomplete=!0,!1}function y(n,e){for(var t,i,a,l=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],s={},f=!1,h=y.caller;h&&!f;h=h.caller)if(h!==x&&h!==r.report){if(i={url:null,func:o,line:null,column:null},h.name?i.func=h.name:(t=l.exec(""+h))&&(i.func=t[1]),i.func===undefined)try{i.func=t.input.substring(0,t.input.indexOf("{"))}catch(d){}if(a=p(h)){i.url=a.url,i.line=a.line,i.func===o&&(i.func=u(i.url,i.line));var m=/ '([^']+)' /.exec(n.message||n.description);m&&(i.column=g(m[1],a.url,a.line))}s[""+h]?f=!0:s[""+h]=!0,c.push(i)}e&&c.splice(0,e);var w={mode:"callers",name:n.name,message:n.message,url:document.location.href,stack:c,useragent:navigator.userAgent};return v(w,n.sourceURL||n.fileName,n.line||n.lineNumber,n.message||n.description),w}function x(n,e){var t=null;e=null==e?0:+e;try{if(t=d(n))return t}catch(r){if(k)throw r}try{if(t=h(n))return t}catch(r){if(k)throw r}try{if(t=m(n))return t}catch(r){if(k)throw r}try{if(t=y(n,e+1))return t}catch(r){if(k)throw r}return{mode:"failed"}}function w(n){n=(null==n?0:+n)+1;try{throw Error()}catch(e){return x(e,n+1)}}var k=!1,S={};return x.augmentStackTraceWithInitialElement=v,x.guessFunctionName=u,x.gatherContext=l,x.ofCaller=w,x}(),r.extendToAsynchronousCallbacks=function(){var e=function e(e){var t=n[e];n[e]=function(){var n=a.call(arguments),e=n[0];return"function"==typeof e&&(n[0]=r.wrap(e)),t.apply?t.apply(this,n):t(n[0],n[1])}};e("setTimeout"),e("setInterval")},r.remoteFetching||(r.remoteFetching=!0),r.collectWindowErrors||(r.collectWindowErrors=!0),(!r.linesOfContext||1>r.linesOfContext)&&(r.linesOfContext=11),n.TraceKit=r})(window),function(n,e){"use strict";if(n){var t=n.event.add;n.event.add=function(r,i,a,o,u){var l;return a.handler?(l=a.handler,a.handler=e.wrap(a.handler)):(l=a,a=e.wrap(a)),a.guid=l.guid?l.guid:l.guid=n.guid++,t.call(this,r,i,a,o,u)};var r=n.fn.ready;n.fn.ready=function(n){return r.call(this,e.wrap(n))};var i=n.ajax;n.ajax=function(t,r){"object"==typeof t&&(r=t,t=void 0),r=r||{};for(var a,o=["complete","error","success"];a=o.pop();)n.isFunction(r[a])&&(r[a]=e.wrap(r[a]));try{return t?i.call(this,t,r):i.call(this,r)}catch(u){throw e.report(u),u}}}}(window.jQuery,window.TraceKit);var raygunFactory=function(n,e,t){function r(n){var e=n,t=n.split("//")[1];if(t){var r=t.indexOf("?"),i=(""+t).substring(0,r),a=i.split("/").slice(0,4).join("/"),o=i.substring(0,48);e=a.lengtht;t++)e.call(null,t,n[t])}function c(n){for(var e in n)if(n.hasOwnProperty(e))return!1;return!0}function s(){return Math.floor(9007199254740992*Math.random())}function f(){var e=document.documentElement,t=document.getElementsByTagName("body")[0],r=n.innerWidth||e.clientWidth||t.clientWidth,i=n.innerHeight||e.clientHeight||t.clientHeight;return{width:r,height:i}}function g(n){var e=(new Date).toJSON();try{var r="raygunjs="+e+"="+s();localStorage[r]===t&&(localStorage[r]=n)}catch(i){X.log("Raygun4JS: LocalStorage full, cannot save exception")}}function p(){try{return"localStorage"in n&&null!==n.localStorage}catch(e){return!1}}function h(){if(p()&&localStorage&&localStorage.length>0)for(var n in localStorage)"raygunjs="===n.substring(0,9)&&(x(JSON.parse(localStorage[n])),localStorage.removeItem(n))}function d(){if(!b&&!$){var n,e="raygun4js-userid",t=X.readCookie(e);t?n=t:(n=X.getUuid(),X.createCookie(e,n,744)),q.setUser(n,!0,null,null,null,n)}}function m(n,e){if(A)if(Array.prototype.indexOf&&A.indexOf===Array.prototype.indexOf){if(-1!==A.indexOf(n))return"[removed by filter]"}else for(var t=0;A.length>t;t++)if(A[t]===n)return"[removed by filter]";return e}function v(n){if(null==n)return n;if("[object Object]"!==Object.prototype.toString.call(n))return n;for(var e in n){var t=n[e];null!=t&&(n[e]="[object Object]"===Object.prototype.toString.call(t)?v(t):m(e,t))}return n}function y(e,r){var i=[],a={};if(M){if(!e.stack||!e.stack.length)return X.log("Raygun4JS: Cancelling send due to null stacktrace"),t;var o=X.parseUrl("domain"),u="Script error",s=e.message||r.status||u;if(s.substring(0,u.length)===u&&null!==e.stack[0].url&&-1===e.stack[0].url.indexOf(o)&&(0===e.stack[0].line||"?"===e.stack[0].func))return X.log("Raygun4JS: cancelling send due to third-party script error with no stacktrace and message"),t;if(null!==e.stack[0].url&&-1===e.stack[0].url.indexOf(o)){var g=!1;for(var p in H)e.stack[0].url.indexOf(H[p])>-1&&(g=!0);if(!g)return X.log("Raygun4JS: cancelling send due to error on non-origin, non-whitelisted domain"),t}}if(W instanceof Array)for(var h in W)if(n.location.hostname&&n.location.hostname.match(W[h]))return X.log("Raygun4JS: cancelling send as error originates from an excluded hostname"),t;if(B instanceof Array)for(var y in B)if(navigator.userAgent.match(B[y]))return X.log("Raygun4JS: cancelling send as error originates from an excluded user agent"),t;e.stack&&e.stack.length&&l(e.stack,function(n,e){i.push({LineNumber:e.line,ColumnNumber:e.column,ClassName:"line "+e.line+", column "+e.column,FileName:e.url,MethodName:e.func||"[anonymous]"})});var w=X.parseUrl("?");w.length>0&&l(w.split("&"),function(n,e){var t=e.split("=");if(t&&2===t.length){var r=decodeURIComponent(t[0]),i=m(r,t[1]);a[r]=i}}),r===t&&(r={}),c(r.customData)&&(r.customData="function"==typeof I?I():I),c(r.tags)&&(r.tags="function"==typeof J?J():J);var k=n.screen||{width:f().width,height:f().height,colorDepth:8},S=r.customData&&r.customData.ajaxErrorMessage,A=v(r.customData);try{JSON.stringify(A)}catch(R){var s="Cannot add custom data; may contain circular reference";A={error:s},X.log("Raygun4JS: "+s)}var C=S||e.message||r.status||"Script error";C=C.substring(0,512);var j={OccurredOn:new Date,Details:{Error:{ClassName:e.name,Message:C,StackTrace:i},Environment:{UtcOffset:(new Date).getTimezoneOffset()/-60,"User-Language":navigator.userLanguage,"Document-Mode":document.documentMode,"Browser-Width":f().width,"Browser-Height":f().height,"Screen-Width":k.width,"Screen-Height":k.height,"Color-Depth":k.colorDepth,Browser:navigator.appCodeName,"Browser-Name":navigator.appName,"Browser-Version":navigator.appVersion,Platform:navigator.platform},Client:{Name:"raygun-js",Version:"1.16.2"},UserCustomData:A,Tags:r.tags,Request:{Url:[location.protocol,"//",location.host,location.pathname,location.hash].join(""),QueryString:a,Headers:{"User-Agent":navigator.userAgent,Referer:document.referrer,Host:document.domain}},Version:T||"Not supplied"}};if(d(),j.Details.User=b,"function"==typeof O){var E=O(j);E&&x(E)}else x(j)}function x(n){if(a()){X.log("Sending exception data to Raygun:",n);var e=L+"/entries?apikey="+encodeURIComponent(S);k(e,JSON.stringify(n))}}function w(e,t){var r;return r=new n.XMLHttpRequest,"withCredentials"in r?r.open(e,t,!0):n.XDomainRequest&&(F&&(t=t.slice(6)),r=new n.XDomainRequest,r.open(e,t)),r.timeout=1e4,r}function k(e,r){var i=w("POST",e,r);return"withCredentials"in i?(i.onreadystatechange=function(){4===i.readyState&&(202===i.status?h():U&&403!==i.status&&400!==i.status&&g(r))},i.onload=function(){X.log("logged error to Raygun")}):n.XDomainRequest&&(i.ontimeout=function(){U&&(X.log("Raygun: saved error locally"),g(r))},i.onload=function(){X.log("logged error to Raygun"),h()}),i.onerror=function(){X.log("failed to log error to Raygun")},i?(i.send(r),t):(X.log("CORS not supported"),t)}var S,b,T,A,O,R,C=TraceKit,j=n.Raygun,E=!1,F=!1,N=!1,D=!1,U=!1,M=!1,$=!1,_=!1,I={},J=[],H=[],L="https://api.raygun.io",W=null,B=null;e&&(R=e(document));var q={noConflict:function(){return n.Raygun=j,q},constructNewRaygun:function(){var e=n.raygunFactory(n,n.jQuery);return n.raygunJsUrlFactory(n,e),e},init:function(n,e,r){return S=n,C.remoteFetching=!1,I=r,e&&(F=e.allowInsecureSubmissions||!1,N=e.ignoreAjaxAbort||!1,D=e.ignoreAjaxError||!1,$=e.disableAnonymousUserTracking||!1,W=e.excludedHostnames||!1,B=e.excludedUserAgents||!1,e.wrapAsynchronousCallbacks!==t&&(_=e.wrapAsynchronousCallbacks),e.debugMode&&(E=e.debugMode),e.ignore3rdPartyErrors&&(M=!0)),h(),q},withCustomData:function(n){return I=n,q},withTags:function(n){return J=n,q},attach:function(){return a()?(C.report.subscribe(y),_&&C.extendToAsynchronousCallbacks(),R&&!D&&R.ajaxError(i),q):q},detach:function(){return C.report.unsubscribe(y),R&&R.unbind("ajaxError",i),q},send:function(n,e,t){try{y(C.computeStackTrace(n),{customData:"function"==typeof I?o(I(),e):o(I,e),tags:u(J,t)})}catch(r){if(n!==r)throw r}return q},setUser:function(n,e,r,i,a,o){return b={Identifier:n},e!==t&&(b.IsAnonymous=e),r!==t&&(b.Email=r),i!==t&&(b.FullName=i),a!==t&&(b.FirstName=a),o!==t&&(b.UUID=o),q},resetAnonymousUser:function(){X.clearCookie("raygun4js-userid")},setVersion:function(n){return T=n,q},saveIfOffline:function(n){return n!==t&&"boolean"==typeof n&&(U=n),q},filterSensitiveData:function(n){return A=n,q},whitelistCrossOriginDomains:function(n){return H=n,q},onBeforeSend:function(n){return O=n,q}},X=q._private=q._private||{},P=q._seal=q._seal||function(){delete q._private,delete q._seal,delete q._unseal},K=q._unseal=q._unseal||function(){q._private=X,q._seal=P,q._unseal=K};return X.getUuid=function(){function n(n){var e=(Math.random().toString(16)+"000000000").substr(2,8);return n?"-"+e.substr(0,4)+"-"+e.substr(4,4):e}return n()+n(!0)+n(!0)+n()},X.createCookie=function(n,e,t){var r;if(t){var i=new Date;i.setTime(i.getTime()+1e3*60*60*t),r="; expires="+i.toGMTString()}else r="";document.cookie=n+"="+e+r+"; path=/"},X.readCookie=function(n){for(var e=n+"=",t=document.cookie.split(";"),r=0;t.length>r;r++){for(var i=t[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(e))return i.substring(e.length,i.length)}return null},X.clearCookie=function(n){X.createCookie(n,"",-1)},X.log=function(e,t){n.console&&n.console.log&&E&&(n.console.log(e),t&&n.console.log(t))},n.Raygun||(n.Raygun=q),q};raygunFactory(window,window.jQuery);var raygunJsUrlFactory=function(n,e){e._private.parseUrl=function(e,t){function r(n){return!isNaN(parseFloat(n))&&isFinite(n)}return function(e,t){var i=t||""+n.location;if(!e)return i;e=""+e,"//"===i.substring(0,2)?i="http:"+i:1===i.split("://").length&&(i="http://"+i),t=i.split("/");var a={auth:""},o=t[2].split("@");1===o.length?o=o[0].split(":"):(a.auth=o[0],o=o[1].split(":")),a.protocol=t[0],a.hostname=o[0],a.port=o[1]||("https"===a.protocol.split(":")[0].toLowerCase()?"443":"80"),a.pathname=(t.length>3?"/":"")+t.slice(3,t.length).join("/").split("?")[0].split("#")[0];var u=a.pathname;"/"===u.charAt(u.length-1)&&(u=u.substring(0,u.length-1));var l=a.hostname,c=l.split("."),s=u.split("/");if("hostname"===e)return l;if("domain"===e)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(l)?l:c.slice(-2).join(".");if("sub"===e)return c.slice(0,c.length-2).join(".");if("port"===e)return a.port;if("protocol"===e)return a.protocol.split(":")[0];if("auth"===e)return a.auth;if("user"===e)return a.auth.split(":")[0];if("pass"===e)return a.auth.split(":")[1]||"";if("path"===e)return a.pathname;if("."===e.charAt(0)){if(e=e.substring(1),r(e))return e=parseInt(e,10),c[0>e?c.length+e:e-1]||""}else{if(r(e))return e=parseInt(e,10),s[0>e?s.length+e:e]||"";if("file"===e)return s.slice(-1)[0];if("filename"===e)return s.slice(-1)[0].split(".")[0];if("fileext"===e)return s.slice(-1)[0].split(".")[1]||"";if("?"===e.charAt(0)||"#"===e.charAt(0)){var f=i,g=null;if("?"===e.charAt(0)?f=(f.split("?")[1]||"").split("#")[0]:"#"===e.charAt(0)&&(f=f.split("#")[1]||""),!e.charAt(1))return f;e=e.substring(1),f=f.split("&");for(var p=0,h=f.length;h>p;p++)if(g=f[p].split("="),g[0]===e)return g[1]||"";return null}}return""}(e,t)}};raygunJsUrlFactory(window,window.Raygun),window.Raygun._seal(); \ No newline at end of file +(function(e){function n(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function t(e){return e===undefined}var r={},a=e.TraceKit,i=[].slice,o="?";r.noConflict=function(){return e.TraceKit=a,r},r.wrap=function(e){function n(){try{return e.apply(this,arguments)}catch(n){throw r.report(n),n}}return n},r.report=function(){function t(e){l(),g.push(e)}function a(e){for(var n=g.length-1;n>=0;--n)g[n]===e&&g.splice(n,1)}function o(e,t){var a=null;if(!t||r.collectWindowErrors){for(var o in g)if(n(g,o))try{g[o].apply(null,[e].concat(i.call(arguments,2)))}catch(u){a=u}if(a)throw a}}function u(e,n,t,a,i){var u=null;if(i)u=r.computeStackTrace(i);else if(h)r.computeStackTrace.augmentStackTraceWithInitialElement(h,n,t,e),u=h,h=null,p=null;else{var l={url:n,line:t,column:a};l.func=r.computeStackTrace.guessFunctionName(l.url,l.line),l.context=r.computeStackTrace.gatherContext(l.url,l.line),u={mode:"onerror",message:e,url:document.location.href,stack:[l],useragent:navigator.userAgent}}return o(u,"from window.onerror"),s?s.apply(this,arguments):!1}function l(){f!==!0&&(s=e.onerror,e.onerror=u,f=!0)}function c(n){var t=i.call(arguments,1);if(h){if(p===n)return;var a=h;h=null,p=null,o.apply(null,[a,null].concat(t))}var u=r.computeStackTrace(n);throw h=u,p=n,e.setTimeout(function(){p===n&&(h=null,p=null,o.apply(null,[u,null].concat(t)))},u.incomplete?2e3:0),n}var s,f,g=[],p=null,h=null;return c.subscribe=t,c.unsubscribe=a,c}(),r.computeStackTrace=function(){function a(n){if(!r.remoteFetching)return"";try{var t=function(){try{return new e.XMLHttpRequest}catch(n){return new e.ActiveXObject("Microsoft.XMLHTTP")}},a=t();return a.open("GET",n,!1),a.send(""),a.responseText}catch(i){return""}}function i(e){if(!n(S,e)){var t="";e=e||"",e.indexOf&&-1!==e.indexOf(document.domain)&&(t=a(e)),S[e]=t?t.split("\n"):[]}return S[e]}function u(e,n){var r,a=/function ([^(]*)\(([^)]*)\)/,u=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,l="",c=10,s=i(e);if(!s.length)return o;for(var f=0;c>f;++f)if(l=s[n-f]+l,!t(l)){if(r=u.exec(l))return r[1];if(r=a.exec(l))return r[1]}return o}function l(e,n){var a=i(e);if(!a.length)return null;var o=[],u=Math.floor(r.linesOfContext/2),l=u+r.linesOfContext%2,c=Math.max(0,n-u-1),s=Math.min(a.length,n+l-1);n-=1;for(var f=c;s>f;++f)t(a[f])||o.push(a[f]);return o.length>0?o:null}function c(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function s(e){return c(e).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function f(e,n){for(var t,r,a=0,o=n.length;o>a;++a)if((t=i(n[a])).length&&(t=t.join("\n"),r=e.exec(t)))return{url:n[a],line:t.substring(0,r.index).split("\n").length,column:r.index-t.lastIndexOf("\n",r.index)-1};return null}function g(e,n,t){var r,a=i(n),o=RegExp("\\b"+c(e)+"\\b");return t-=1,a&&a.length>t&&(r=o.exec(a[t]))?r.index:null}function p(n){for(var t,r,a,i,o=[e.location.href],u=document.getElementsByTagName("script"),l=""+n,g=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,p=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,h=0;u.length>h;++h){var d=u[h];d.src&&o.push(d.src)}if(a=g.exec(l)){var m=a[1]?"\\s+"+a[1]:"",v=a[2].split(",").join("\\s*,\\s*");t=c(a[3]).replace(/;$/,";?"),r=RegExp("function"+m+"\\s*\\(\\s*"+v+"\\s*\\)\\s*{\\s*"+t+"\\s*}")}else r=RegExp(c(l).replace(/\s+/g,"\\s+"));if(i=f(r,o))return i;if(a=p.exec(l)){var y=a[1];if(t=s(a[2]),r=RegExp("on"+y+"=[\\'\"]\\s*"+t+"\\s*[\\'\"]","i"),i=f(r,o[0]))return i;if(r=RegExp(t),i=f(r,o))return i}return null}function h(e){if(!e.stack)return null;for(var n,t,r=/^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|http|https|chrome-extension):.*?):(\d+)(?::(\d+))?\)?\s*$/i,a=/^\s*(\S*)(?:\((.*?)\))?@?((?:file|http|https):.*?):(\d+)(?::(\d+))?\s*$/i,i=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=e.stack.split("\n"),s=[],f=/^(.*) is undefined$/.exec(e.message),p=0,h=c.length;h>p;++p){if(n=a.exec(c[p]))t={url:n[3],func:n[1]||o,args:n[2]?n[2].split(","):"",line:+n[4],column:n[5]?+n[5]:null};else if(n=r.exec(c[p]))t={url:n[2],func:n[1]||o,line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=i.exec(c[p])))continue;t={url:n[2],func:n[1]||o,line:+n[3],column:n[4]?+n[4]:null}}!t.func&&t.line&&(t.func=u(t.url,t.line)),t.line&&(t.context=l(t.url,t.line)),s.push(t)}return s[0]&&s[0].line&&!s[0].column&&f&&(s[0].column=g(f[1],s[0].url,s[0].line)),s.length?{mode:"stack",name:e.name,message:e.message,url:document.location.href,stack:s,useragent:navigator.userAgent}:null}function d(e){for(var n,t=e.stacktrace,r=/ line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,a=t.split("\n"),i=[],o=0,c=a.length;c>o;o+=2)if(n=r.exec(a[o])){var s={line:+n[1],column:+n[2],func:n[3]||n[4],args:n[5]?n[5].split(","):[],url:n[6]};if(!s.func&&s.line&&(s.func=u(s.url,s.line)),s.line)try{s.context=l(s.url,s.line)}catch(f){}s.context||(s.context=[a[o+1]]),i.push(s)}return i.length?{mode:"stacktrace",name:e.name,message:e.message,url:document.location.href,stack:i,useragent:navigator.userAgent}:null}function m(t){var r=t.message.split("\n");if(4>r.length)return null;var a,o,c,g,p=/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,h=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,d=/^\s*Line (\d+) of function script\s*$/i,m=[],v=document.getElementsByTagName("script"),y=[];for(o in v)n(v,o)&&!v[o].src&&y.push(v[o]);for(o=2,c=r.length;c>o;o+=2){var x=null;if(a=p.exec(r[o]))x={url:a[2],func:a[3],line:+a[1]};else if(a=h.exec(r[o])){x={url:a[3],func:a[4]};var w=+a[1],k=y[a[2]-1];if(k&&(g=i(x.url))){g=g.join("\n");var S=g.indexOf(k.innerText);S>=0&&(x.line=w+g.substring(0,S).split("\n").length)}}else if(a=d.exec(r[o])){var b=e.location.href.replace(/#.*$/,""),T=a[1],A=RegExp(s(r[o+1]));g=f(A,[b]),x={url:b,line:g?g.line:T,func:""}}if(x){x.func||(x.func=u(x.url,x.line));var O=l(x.url,x.line),C=O?O[Math.floor(O.length/2)]:null;x.context=O&&C.replace(/^\s*/,"")===r[o+1].replace(/^\s*/,"")?O:[r[o+1]],m.push(x)}}return m.length?{mode:"multiline",name:t.name,message:r[0],url:document.location.href,stack:m,useragent:navigator.userAgent}:null}function v(e,n,t,r){var a={url:n,line:t};if(a.url&&a.line){e.incomplete=!1,a.func||(a.func=u(a.url,a.line)),a.context||(a.context=l(a.url,a.line));var i=/ '([^']+)' /.exec(r);if(i&&(a.column=g(i[1],a.url,a.line)),e.stack.length>0&&e.stack[0].url===a.url){if(e.stack[0].line===a.line)return!1;if(!e.stack[0].line&&e.stack[0].func===a.func)return e.stack[0].line=a.line,e.stack[0].context=a.context,!1}return e.stack.unshift(a),e.partial=!0,!0}return e.incomplete=!0,!1}function y(e,n){for(var t,a,i,l=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],s={},f=!1,h=y.caller;h&&!f;h=h.caller)if(h!==x&&h!==r.report){if(a={url:null,func:o,line:null,column:null},h.name?a.func=h.name:(t=l.exec(""+h))&&(a.func=t[1]),a.func===undefined)try{a.func=t.input.substring(0,t.input.indexOf("{"))}catch(d){}if(i=p(h)){a.url=i.url,a.line=i.line,a.func===o&&(a.func=u(a.url,a.line));var m=/ '([^']+)' /.exec(e.message||e.description);m&&(a.column=g(m[1],i.url,i.line))}s[""+h]?f=!0:s[""+h]=!0,c.push(a)}n&&c.splice(0,n);var w={mode:"callers",name:e.name,message:e.message,url:document.location.href,stack:c,useragent:navigator.userAgent};return v(w,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),w}function x(e,n){var t=null;n=null==n?0:+n;try{if(t=d(e))return t}catch(r){if(k)throw r}try{if(t=h(e))return t}catch(r){if(k)throw r}try{if(t=m(e))return t}catch(r){if(k)throw r}try{if(t=y(e,n+1))return t}catch(r){if(k)throw r}return{mode:"failed"}}function w(e){e=(null==e?0:+e)+1;try{throw Error()}catch(n){return x(n,e+1)}}var k=!1,S={};return x.augmentStackTraceWithInitialElement=v,x.guessFunctionName=u,x.gatherContext=l,x.ofCaller=w,x}(),r.extendToAsynchronousCallbacks=function(){var n=function n(n){var t=e[n];e[n]=function(){var e=i.call(arguments),n=e[0];return"function"==typeof n&&(e[0]=r.wrap(n)),t.apply?t.apply(this,e):t(e[0],e[1])}};n("setTimeout"),n("setInterval")},r.remoteFetching||(r.remoteFetching=!0),r.collectWindowErrors||(r.collectWindowErrors=!0),(!r.linesOfContext||1>r.linesOfContext)&&(r.linesOfContext=11),e.TraceKit=r})(window),function(e,n){"use strict";if(e){var t=e.event.add;e.event.add=function(r,a,i,o,u){var l;return i.handler?(l=i.handler,i.handler=n.wrap(i.handler)):(l=i,i=n.wrap(i)),i.guid=l.guid?l.guid:l.guid=e.guid++,t.call(this,r,a,i,o,u)};var r=e.fn.ready;e.fn.ready=function(e){return r.call(this,n.wrap(e))};var a=e.ajax;e.ajax=function(t,r){"object"==typeof t&&(r=t,t=void 0),r=r||{};for(var i,o=["complete","error","success"];i=o.pop();)e.isFunction(r[i])&&(r[i]=n.wrap(r[i]));try{return t?a.call(this,t,r):a.call(this,r)}catch(u){throw n.report(u),u}}}}(window.jQuery,window.TraceKit);var raygunFactory=function(e,n,t){function r(e){var n=e,t=e.split("//")[1];if(t){var r=t.indexOf("?"),a=(""+t).substring(0,r),i=a.split("/").slice(0,4).join("/"),o=a.substring(0,48);n=i.lengtht;t++)n.call(null,t,e[t])}function c(e){for(var n in e)if(e.hasOwnProperty(n))return!1;return!0}function s(){return Math.floor(9007199254740992*Math.random())}function f(){var n=document.documentElement,t=document.getElementsByTagName("body")[0],r=e.innerWidth||n.clientWidth||t.clientWidth,a=e.innerHeight||n.clientHeight||t.clientHeight;return{width:r,height:a}}function g(e){var n=(new Date).toJSON();try{var r="raygunjs="+n+"="+s();localStorage[r]===t&&(localStorage[r]=e)}catch(a){P.log("Raygun4JS: LocalStorage full, cannot save exception")}}function p(){try{return"localStorage"in e&&null!==e.localStorage}catch(n){return!1}}function h(){if(p()&&localStorage&&localStorage.length>0)for(var e in localStorage)"raygunjs="===e.substring(0,9)&&(x(JSON.parse(localStorage[e])),localStorage.removeItem(e))}function d(){if(!b&&!$){var e,n="raygun4js-userid",t=P.readCookie(n);t?e=t:(e=P.getUuid(),P.createCookie(n,e,744)),X.setUser(e,!0,null,null,null,e)}}function m(e,n){if(A)if(Array.prototype.indexOf&&A.indexOf===Array.prototype.indexOf){if(-1!==A.indexOf(e))return"[removed by filter]"}else for(var t=0;A.length>t;t++)if(A[t]===e)return"[removed by filter]";return n}function v(e,n){if(null==e)return e;if("[object Object]"!==Object.prototype.toString.call(e))return e;for(var r in e){var a=e[r];null!=a&&("[object Object]"===Object.prototype.toString.call(a)?("Details"!==n||"Client"!==r)&&(e[r]=v(m(r,a),r)):(n!==t||"OccurredOn"!==r)&&(e[r]=m(r,a)))}return e}function y(n,r){var a=[],i={};if(M){if(!n.stack||!n.stack.length)return P.log("Raygun4JS: Cancelling send due to null stacktrace"),t;var o=P.parseUrl("domain"),u="Script error",s=n.message||r.status||u;if(s.substring(0,u.length)===u&&null!==n.stack[0].url&&-1===n.stack[0].url.indexOf(o)&&(0===n.stack[0].line||"?"===n.stack[0].func))return P.log("Raygun4JS: cancelling send due to third-party script error with no stacktrace and message"),t;if(null!==n.stack[0].url&&-1===n.stack[0].url.indexOf(o)){var g=!1;for(var p in H)n.stack[0].url.indexOf(H[p])>-1&&(g=!0);if(!g)return P.log("Raygun4JS: cancelling send due to error on non-origin, non-whitelisted domain"),t}}if(W instanceof Array)for(var h in W)if(e.location.hostname&&e.location.hostname.match(W[h]))return P.log("Raygun4JS: cancelling send as error originates from an excluded hostname"),t;if(B instanceof Array)for(var y in B)if(navigator.userAgent.match(B[y]))return P.log("Raygun4JS: cancelling send as error originates from an excluded user agent"),t;n.stack&&n.stack.length&&l(n.stack,function(e,n){a.push({LineNumber:n.line,ColumnNumber:n.column,ClassName:"line "+n.line+", column "+n.column,FileName:n.url,MethodName:n.func||"[anonymous]"})});var w=P.parseUrl("?");w.length>0&&l(w.split("&"),function(e,n){var t=n.split("=");if(t&&2===t.length){var r=decodeURIComponent(t[0]),a=m(r,t[1]);i[r]=a}}),r===t&&(r={}),c(r.customData)&&(r.customData="function"==typeof I?I():I),c(r.tags)&&(r.tags="function"==typeof J?J():J);var k,S=e.screen||{width:f().width,height:f().height,colorDepth:8},A=r.customData&&r.customData.ajaxErrorMessage;k="customData"===q?v(r.customData,"UserCustomData"):r.customData;try{JSON.stringify(k)}catch(C){var s="Cannot add custom data; may contain circular reference";k={error:s},P.log("Raygun4JS: "+s)}var R=A||n.message||r.status||"Script error";R=R.substring(0,512);var j={OccurredOn:new Date,Details:{Error:{ClassName:n.name,Message:R,StackTrace:a},Environment:{UtcOffset:(new Date).getTimezoneOffset()/-60,"User-Language":navigator.userLanguage,"Document-Mode":document.documentMode,"Browser-Width":f().width,"Browser-Height":f().height,"Screen-Width":S.width,"Screen-Height":S.height,"Color-Depth":S.colorDepth,Browser:navigator.appCodeName,"Browser-Name":navigator.appName,"Browser-Version":navigator.appVersion,Platform:navigator.platform},Client:{Name:"raygun-js",Version:"1.18.0"},UserCustomData:k,Tags:r.tags,Request:{Url:[location.protocol,"//",location.host,location.pathname,location.hash].join(""),QueryString:i,Headers:{"User-Agent":navigator.userAgent,Referer:document.referrer,Host:document.domain}},Version:T||"Not supplied"}};if(d(),j.Details.User=b,"all"===q&&(j=v(j)),"function"==typeof O){var D=O(j);D&&x(D)}else x(j)}function x(e){if(i()){P.log("Sending exception data to Raygun:",e);var n=L+"/entries?apikey="+encodeURIComponent(S);k(n,JSON.stringify(e))}}function w(n,t){var r;return r=new e.XMLHttpRequest,"withCredentials"in r?r.open(n,t,!0):e.XDomainRequest&&(F&&(t=t.slice(6)),r=new e.XDomainRequest,r.open(n,t)),r.timeout=1e4,r}function k(n,r){var a=w("POST",n,r);return"withCredentials"in a?(a.onreadystatechange=function(){4===a.readyState&&(202===a.status?h():U&&403!==a.status&&400!==a.status&&g(r))},a.onload=function(){P.log("logged error to Raygun")}):e.XDomainRequest&&(a.ontimeout=function(){U&&(P.log("Raygun: saved error locally"),g(r))},a.onload=function(){P.log("logged error to Raygun"),h()}),a.onerror=function(){P.log("failed to log error to Raygun")},a?(a.send(r),t):(P.log("CORS not supported"),t)}var S,b,T,A,O,C,R=TraceKit,j=e.Raygun,D=!1,F=!1,E=!1,N=!1,U=!1,M=!1,$=!1,_=!1,I={},J=[],H=[],L="https://api.raygun.io",W=null,B=null,q="customData";n&&(C=n(document));var X={noConflict:function(){return e.Raygun=j,X},constructNewRaygun:function(){var n=e.raygunFactory(e,e.jQuery);return e.raygunJsUrlFactory(e,n),n},init:function(e,n,r){return S=e,R.remoteFetching=!1,I=r,n&&(F=n.allowInsecureSubmissions||!1,E=n.ignoreAjaxAbort||!1,N=n.ignoreAjaxError||!1,$=n.disableAnonymousUserTracking||!1,W=n.excludedHostnames||!1,B=n.excludedUserAgents||!1,n.wrapAsynchronousCallbacks!==t&&(_=n.wrapAsynchronousCallbacks),n.debugMode&&(D=n.debugMode),n.ignore3rdPartyErrors&&(M=!0)),h(),X},withCustomData:function(e){return I=e,X},withTags:function(e){return J=e,X},attach:function(){return i()?(R.report.subscribe(y),_&&R.extendToAsynchronousCallbacks(),C&&!N&&C.ajaxError(a),X):X},detach:function(){return R.report.unsubscribe(y),C&&C.unbind("ajaxError",a),X},send:function(e,n,t){try{y(R.computeStackTrace(e),{customData:"function"==typeof I?o(I(),n):o(I,n),tags:u(J,t)})}catch(r){if(e!==r)throw r}return X},setUser:function(e,n,r,a,i,o){return b={Identifier:e},n!==t&&(b.IsAnonymous=n),r!==t&&(b.Email=r),a!==t&&(b.FullName=a),i!==t&&(b.FirstName=i),o!==t&&(b.UUID=o),X},resetAnonymousUser:function(){P.clearCookie("raygun4js-userid")},setVersion:function(e){return T=e,X},saveIfOffline:function(e){return e!==t&&"boolean"==typeof e&&(U=e),X},filterSensitiveData:function(e){return A=e,X},setFilterScope:function(e){return("customData"===e||"all"===e)&&(q=e),X},whitelistCrossOriginDomains:function(e){return H=e,X},onBeforeSend:function(e){return O=e,X}},P=X._private=X._private||{},K=X._seal=X._seal||function(){delete X._private,delete X._seal,delete X._unseal},V=X._unseal=X._unseal||function(){X._private=P,X._seal=K,X._unseal=V};return P.getUuid=function(){function e(e){var n=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+n.substr(0,4)+"-"+n.substr(4,4):n}return e()+e(!0)+e(!0)+e()},P.createCookie=function(e,n,t){var r;if(t){var a=new Date;a.setTime(a.getTime()+1e3*60*60*t),r="; expires="+a.toGMTString()}else r="";document.cookie=e+"="+n+r+"; path=/"},P.readCookie=function(e){for(var n=e+"=",t=document.cookie.split(";"),r=0;t.length>r;r++){for(var a=t[r];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(n))return a.substring(n.length,a.length)}return null},P.clearCookie=function(e){P.createCookie(e,"",-1)},P.log=function(n,t){e.console&&e.console.log&&D&&(e.console.log(n),t&&e.console.log(t))},e.Raygun||(e.Raygun=X),X};raygunFactory(window,window.jQuery);var raygunJsUrlFactory=function(e,n){n._private.parseUrl=function(n,t){function r(e){return!isNaN(parseFloat(e))&&isFinite(e)}return function(n,t){var a=t||""+e.location;if(!n)return a;n=""+n,"//"===a.substring(0,2)?a="http:"+a:1===a.split("://").length&&(a="http://"+a),t=a.split("/");var i={auth:""},o=t[2].split("@");1===o.length?o=o[0].split(":"):(i.auth=o[0],o=o[1].split(":")),i.protocol=t[0],i.hostname=o[0],i.port=o[1]||("https"===i.protocol.split(":")[0].toLowerCase()?"443":"80"),i.pathname=(t.length>3?"/":"")+t.slice(3,t.length).join("/").split("?")[0].split("#")[0];var u=i.pathname;"/"===u.charAt(u.length-1)&&(u=u.substring(0,u.length-1));var l=i.hostname,c=l.split("."),s=u.split("/");if("hostname"===n)return l;if("domain"===n)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(l)?l:c.slice(-2).join(".");if("sub"===n)return c.slice(0,c.length-2).join(".");if("port"===n)return i.port;if("protocol"===n)return i.protocol.split(":")[0];if("auth"===n)return i.auth;if("user"===n)return i.auth.split(":")[0];if("pass"===n)return i.auth.split(":")[1]||"";if("path"===n)return i.pathname;if("."===n.charAt(0)){if(n=n.substring(1),r(n))return n=parseInt(n,10),c[0>n?c.length+n:n-1]||""}else{if(r(n))return n=parseInt(n,10),s[0>n?s.length+n:n]||"";if("file"===n)return s.slice(-1)[0];if("filename"===n)return s.slice(-1)[0].split(".")[0];if("fileext"===n)return s.slice(-1)[0].split(".")[1]||"";if("?"===n.charAt(0)||"#"===n.charAt(0)){var f=a,g=null;if("?"===n.charAt(0)?f=(f.split("?")[1]||"").split("#")[0]:"#"===n.charAt(0)&&(f=f.split("#")[1]||""),!n.charAt(1))return f;n=n.substring(1),f=f.split("&");for(var p=0,h=f.length;h>p;p++)if(g=f[p].split("="),g[0]===n)return g[1]||"";return null}}return""}(n,t)}};raygunJsUrlFactory(window,window.Raygun),window.Raygun._seal(); \ No newline at end of file diff --git a/dist/raygun.vanilla.js b/dist/raygun.vanilla.js index 8800963d..bb58ba11 100644 --- a/dist/raygun.vanilla.js +++ b/dist/raygun.vanilla.js @@ -1,4 +1,4 @@ -/*! Raygun4js - v1.17.0 - 2015-03-20 +/*! Raygun4js - v1.18.0 - 2015-03-27 * https://github.com/MindscapeHQ/raygun4js * Copyright (c) 2015 MindscapeHQ; Licensed MIT */ (function(window, undefined) { @@ -1159,6 +1159,7 @@ var raygunFactory = function (window, $, undefined) { _raygunApiUrl = 'https://api.raygun.io', _excludedHostnames = null, _excludedUserAgents = null, + _filterScope = 'customData', $document; if ($) { @@ -1309,6 +1310,13 @@ var raygunFactory = function (window, $, undefined) { return Raygun; }, + setFilterScope: function (scope) { + if (scope === 'customData' || scope === 'all') { + _filterScope = scope; + } + return Raygun; + }, + whitelistCrossOriginDomains: function (whitelist) { _whitelistedScriptDomains = whitelist; return Raygun; @@ -1553,7 +1561,7 @@ var raygunFactory = function (window, $, undefined) { return value; } - function filterObject(reference) { + function filterObject(reference, parentKey) { if (reference == null) { return reference; } @@ -1570,9 +1578,13 @@ var raygunFactory = function (window, $, undefined) { } if (Object.prototype.toString.call(propertyValue) === '[object Object]') { - reference[propertyName] = filterObject(propertyValue); + if ((parentKey !== 'Details' || propertyName !== 'Client')) { + reference[propertyName] = filterObject(filterValue(propertyName, propertyValue), propertyName); + } } else { + if (typeof parentKey !== 'undefined' || propertyName !== 'OccurredOn') { reference[propertyName] = filterValue(propertyName, propertyValue); + } } } @@ -1687,7 +1699,13 @@ var raygunFactory = function (window, $, undefined) { var screen = window.screen || { width: getViewPort().width, height: getViewPort().height, colorDepth: 8 }; var custom_message = options.customData && options.customData.ajaxErrorMessage; - var finalCustomData = filterObject(options.customData); + + var finalCustomData; + if (_filterScope === 'customData') { + finalCustomData = filterObject(options.customData, 'UserCustomData'); + } else { + finalCustomData = options.customData; + } try { JSON.stringify(finalCustomData); @@ -1724,7 +1742,7 @@ var raygunFactory = function (window, $, undefined) { }, 'Client': { 'Name': 'raygun-js', - 'Version': '1.16.2' + 'Version': '1.18.0' }, 'UserCustomData': finalCustomData, 'Tags': options.tags, @@ -1744,6 +1762,10 @@ var raygunFactory = function (window, $, undefined) { ensureUser(); payload.Details.User = _user; + if (_filterScope === 'all') { + payload = filterObject(payload); + } + if (typeof _beforeSendCallback === 'function') { var mutatedPayload = _beforeSendCallback(payload); diff --git a/dist/raygun.vanilla.min.js b/dist/raygun.vanilla.min.js index 40be9eb8..64fb4eff 100644 --- a/dist/raygun.vanilla.min.js +++ b/dist/raygun.vanilla.min.js @@ -1,4 +1,4 @@ -/*! Raygun4js - v1.17.0 - 2015-03-20 +/*! Raygun4js - v1.18.0 - 2015-03-27 * https://github.com/MindscapeHQ/raygun4js * Copyright (c) 2015 MindscapeHQ; Licensed MIT */ -(function(n){function e(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function t(n){return n===undefined}var r={},i=n.TraceKit,o=[].slice,a="?";r.noConflict=function(){return n.TraceKit=i,r},r.wrap=function(n){function e(){try{return n.apply(this,arguments)}catch(e){throw r.report(e),e}}return e},r.report=function(){function t(n){l(),g.push(n)}function i(n){for(var e=g.length-1;e>=0;--e)g[e]===n&&g.splice(e,1)}function a(n,t){var i=null;if(!t||r.collectWindowErrors){for(var a in g)if(e(g,a))try{g[a].apply(null,[n].concat(o.call(arguments,2)))}catch(u){i=u}if(i)throw i}}function u(n,e,t,i,o){var u=null;if(o)u=r.computeStackTrace(o);else if(h)r.computeStackTrace.augmentStackTraceWithInitialElement(h,e,t,n),u=h,h=null,p=null;else{var l={url:e,line:t,column:i};l.func=r.computeStackTrace.guessFunctionName(l.url,l.line),l.context=r.computeStackTrace.gatherContext(l.url,l.line),u={mode:"onerror",message:n,url:document.location.href,stack:[l],useragent:navigator.userAgent}}return a(u,"from window.onerror"),s?s.apply(this,arguments):!1}function l(){f!==!0&&(s=n.onerror,n.onerror=u,f=!0)}function c(e){var t=o.call(arguments,1);if(h){if(p===e)return;var i=h;h=null,p=null,a.apply(null,[i,null].concat(t))}var u=r.computeStackTrace(e);throw h=u,p=e,n.setTimeout(function(){p===e&&(h=null,p=null,a.apply(null,[u,null].concat(t)))},u.incomplete?2e3:0),e}var s,f,g=[],p=null,h=null;return c.subscribe=t,c.unsubscribe=i,c}(),r.computeStackTrace=function(){function i(e){if(!r.remoteFetching)return"";try{var t=function(){try{return new n.XMLHttpRequest}catch(e){return new n.ActiveXObject("Microsoft.XMLHTTP")}},i=t();return i.open("GET",e,!1),i.send(""),i.responseText}catch(o){return""}}function o(n){if(!e(S,n)){var t="";n=n||"",n.indexOf&&-1!==n.indexOf(document.domain)&&(t=i(n)),S[n]=t?t.split("\n"):[]}return S[n]}function u(n,e){var r,i=/function ([^(]*)\(([^)]*)\)/,u=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,l="",c=10,s=o(n);if(!s.length)return a;for(var f=0;c>f;++f)if(l=s[e-f]+l,!t(l)){if(r=u.exec(l))return r[1];if(r=i.exec(l))return r[1]}return a}function l(n,e){var i=o(n);if(!i.length)return null;var a=[],u=Math.floor(r.linesOfContext/2),l=u+r.linesOfContext%2,c=Math.max(0,e-u-1),s=Math.min(i.length,e+l-1);e-=1;for(var f=c;s>f;++f)t(i[f])||a.push(i[f]);return a.length>0?a:null}function c(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function s(n){return c(n).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function f(n,e){for(var t,r,i=0,a=e.length;a>i;++i)if((t=o(e[i])).length&&(t=t.join("\n"),r=n.exec(t)))return{url:e[i],line:t.substring(0,r.index).split("\n").length,column:r.index-t.lastIndexOf("\n",r.index)-1};return null}function g(n,e,t){var r,i=o(e),a=RegExp("\\b"+c(n)+"\\b");return t-=1,i&&i.length>t&&(r=a.exec(i[t]))?r.index:null}function p(e){for(var t,r,i,o,a=[n.location.href],u=document.getElementsByTagName("script"),l=""+e,g=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,p=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,h=0;u.length>h;++h){var m=u[h];m.src&&a.push(m.src)}if(i=g.exec(l)){var d=i[1]?"\\s+"+i[1]:"",v=i[2].split(",").join("\\s*,\\s*");t=c(i[3]).replace(/;$/,";?"),r=RegExp("function"+d+"\\s*\\(\\s*"+v+"\\s*\\)\\s*{\\s*"+t+"\\s*}")}else r=RegExp(c(l).replace(/\s+/g,"\\s+"));if(o=f(r,a))return o;if(i=p.exec(l)){var y=i[1];if(t=s(i[2]),r=RegExp("on"+y+"=[\\'\"]\\s*"+t+"\\s*[\\'\"]","i"),o=f(r,a[0]))return o;if(r=RegExp(t),o=f(r,a))return o}return null}function h(n){if(!n.stack)return null;for(var e,t,r=/^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|http|https|chrome-extension):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=/^\s*(\S*)(?:\((.*?)\))?@?((?:file|http|https):.*?):(\d+)(?::(\d+))?\s*$/i,o=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=n.stack.split("\n"),s=[],f=/^(.*) is undefined$/.exec(n.message),p=0,h=c.length;h>p;++p){if(e=i.exec(c[p]))t={url:e[3],func:e[1]||a,args:e[2]?e[2].split(","):"",line:+e[4],column:e[5]?+e[5]:null};else if(e=r.exec(c[p]))t={url:e[2],func:e[1]||a,line:+e[3],column:e[4]?+e[4]:null};else{if(!(e=o.exec(c[p])))continue;t={url:e[2],func:e[1]||a,line:+e[3],column:e[4]?+e[4]:null}}!t.func&&t.line&&(t.func=u(t.url,t.line)),t.line&&(t.context=l(t.url,t.line)),s.push(t)}return s[0]&&s[0].line&&!s[0].column&&f&&(s[0].column=g(f[1],s[0].url,s[0].line)),s.length?{mode:"stack",name:n.name,message:n.message,url:document.location.href,stack:s,useragent:navigator.userAgent}:null}function m(n){for(var e,t=n.stacktrace,r=/ line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,i=t.split("\n"),o=[],a=0,c=i.length;c>a;a+=2)if(e=r.exec(i[a])){var s={line:+e[1],column:+e[2],func:e[3]||e[4],args:e[5]?e[5].split(","):[],url:e[6]};if(!s.func&&s.line&&(s.func=u(s.url,s.line)),s.line)try{s.context=l(s.url,s.line)}catch(f){}s.context||(s.context=[i[a+1]]),o.push(s)}return o.length?{mode:"stacktrace",name:n.name,message:n.message,url:document.location.href,stack:o,useragent:navigator.userAgent}:null}function d(t){var r=t.message.split("\n");if(4>r.length)return null;var i,a,c,g,p=/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,h=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,m=/^\s*Line (\d+) of function script\s*$/i,d=[],v=document.getElementsByTagName("script"),y=[];for(a in v)e(v,a)&&!v[a].src&&y.push(v[a]);for(a=2,c=r.length;c>a;a+=2){var x=null;if(i=p.exec(r[a]))x={url:i[2],func:i[3],line:+i[1]};else if(i=h.exec(r[a])){x={url:i[3],func:i[4]};var w=+i[1],k=y[i[2]-1];if(k&&(g=o(x.url))){g=g.join("\n");var S=g.indexOf(k.innerText);S>=0&&(x.line=w+g.substring(0,S).split("\n").length)}}else if(i=m.exec(r[a])){var b=n.location.href.replace(/#.*$/,""),T=i[1],A=RegExp(s(r[a+1]));g=f(A,[b]),x={url:b,line:g?g.line:T,func:""}}if(x){x.func||(x.func=u(x.url,x.line));var O=l(x.url,x.line),R=O?O[Math.floor(O.length/2)]:null;x.context=O&&R.replace(/^\s*/,"")===r[a+1].replace(/^\s*/,"")?O:[r[a+1]],d.push(x)}}return d.length?{mode:"multiline",name:t.name,message:r[0],url:document.location.href,stack:d,useragent:navigator.userAgent}:null}function v(n,e,t,r){var i={url:e,line:t};if(i.url&&i.line){n.incomplete=!1,i.func||(i.func=u(i.url,i.line)),i.context||(i.context=l(i.url,i.line));var o=/ '([^']+)' /.exec(r);if(o&&(i.column=g(o[1],i.url,i.line)),n.stack.length>0&&n.stack[0].url===i.url){if(n.stack[0].line===i.line)return!1;if(!n.stack[0].line&&n.stack[0].func===i.func)return n.stack[0].line=i.line,n.stack[0].context=i.context,!1}return n.stack.unshift(i),n.partial=!0,!0}return n.incomplete=!0,!1}function y(n,e){for(var t,i,o,l=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],s={},f=!1,h=y.caller;h&&!f;h=h.caller)if(h!==x&&h!==r.report){if(i={url:null,func:a,line:null,column:null},h.name?i.func=h.name:(t=l.exec(""+h))&&(i.func=t[1]),i.func===undefined)try{i.func=t.input.substring(0,t.input.indexOf("{"))}catch(m){}if(o=p(h)){i.url=o.url,i.line=o.line,i.func===a&&(i.func=u(i.url,i.line));var d=/ '([^']+)' /.exec(n.message||n.description);d&&(i.column=g(d[1],o.url,o.line))}s[""+h]?f=!0:s[""+h]=!0,c.push(i)}e&&c.splice(0,e);var w={mode:"callers",name:n.name,message:n.message,url:document.location.href,stack:c,useragent:navigator.userAgent};return v(w,n.sourceURL||n.fileName,n.line||n.lineNumber,n.message||n.description),w}function x(n,e){var t=null;e=null==e?0:+e;try{if(t=m(n))return t}catch(r){if(k)throw r}try{if(t=h(n))return t}catch(r){if(k)throw r}try{if(t=d(n))return t}catch(r){if(k)throw r}try{if(t=y(n,e+1))return t}catch(r){if(k)throw r}return{mode:"failed"}}function w(n){n=(null==n?0:+n)+1;try{throw Error()}catch(e){return x(e,n+1)}}var k=!1,S={};return x.augmentStackTraceWithInitialElement=v,x.guessFunctionName=u,x.gatherContext=l,x.ofCaller=w,x}(),r.extendToAsynchronousCallbacks=function(){var e=function e(e){var t=n[e];n[e]=function(){var n=o.call(arguments),e=n[0];return"function"==typeof e&&(n[0]=r.wrap(e)),t.apply?t.apply(this,n):t(n[0],n[1])}};e("setTimeout"),e("setInterval")},r.remoteFetching||(r.remoteFetching=!0),r.collectWindowErrors||(r.collectWindowErrors=!0),(!r.linesOfContext||1>r.linesOfContext)&&(r.linesOfContext=11),n.TraceKit=r})(window);var raygunFactory=function(n,e,t){function r(n){var e=n,t=n.split("//")[1];if(t){var r=t.indexOf("?"),i=(""+t).substring(0,r),o=i.split("/").slice(0,4).join("/"),a=i.substring(0,48);e=o.lengtht;t++)e.call(null,t,n[t])}function c(n){for(var e in n)if(n.hasOwnProperty(e))return!1;return!0}function s(){return Math.floor(9007199254740992*Math.random())}function f(){var e=document.documentElement,t=document.getElementsByTagName("body")[0],r=n.innerWidth||e.clientWidth||t.clientWidth,i=n.innerHeight||e.clientHeight||t.clientHeight;return{width:r,height:i}}function g(n){var e=(new Date).toJSON();try{var r="raygunjs="+e+"="+s();localStorage[r]===t&&(localStorage[r]=n)}catch(i){X.log("Raygun4JS: LocalStorage full, cannot save exception")}}function p(){try{return"localStorage"in n&&null!==n.localStorage}catch(e){return!1}}function h(){if(p()&&localStorage&&localStorage.length>0)for(var n in localStorage)"raygunjs="===n.substring(0,9)&&(x(JSON.parse(localStorage[n])),localStorage.removeItem(n))}function m(){if(!b&&!$){var n,e="raygun4js-userid",t=X.readCookie(e);t?n=t:(n=X.getUuid(),X.createCookie(e,n,744)),q.setUser(n,!0,null,null,null,n)}}function d(n,e){if(A)if(Array.prototype.indexOf&&A.indexOf===Array.prototype.indexOf){if(-1!==A.indexOf(n))return"[removed by filter]"}else for(var t=0;A.length>t;t++)if(A[t]===n)return"[removed by filter]";return e}function v(n){if(null==n)return n;if("[object Object]"!==Object.prototype.toString.call(n))return n;for(var e in n){var t=n[e];null!=t&&(n[e]="[object Object]"===Object.prototype.toString.call(t)?v(t):d(e,t))}return n}function y(e,r){var i=[],o={};if(M){if(!e.stack||!e.stack.length)return X.log("Raygun4JS: Cancelling send due to null stacktrace"),t;var a=X.parseUrl("domain"),u="Script error",s=e.message||r.status||u;if(s.substring(0,u.length)===u&&null!==e.stack[0].url&&-1===e.stack[0].url.indexOf(a)&&(0===e.stack[0].line||"?"===e.stack[0].func))return X.log("Raygun4JS: cancelling send due to third-party script error with no stacktrace and message"),t;if(null!==e.stack[0].url&&-1===e.stack[0].url.indexOf(a)){var g=!1;for(var p in H)e.stack[0].url.indexOf(H[p])>-1&&(g=!0);if(!g)return X.log("Raygun4JS: cancelling send due to error on non-origin, non-whitelisted domain"),t}}if(W instanceof Array)for(var h in W)if(n.location.hostname&&n.location.hostname.match(W[h]))return X.log("Raygun4JS: cancelling send as error originates from an excluded hostname"),t;if(B instanceof Array)for(var y in B)if(navigator.userAgent.match(B[y]))return X.log("Raygun4JS: cancelling send as error originates from an excluded user agent"),t;e.stack&&e.stack.length&&l(e.stack,function(n,e){i.push({LineNumber:e.line,ColumnNumber:e.column,ClassName:"line "+e.line+", column "+e.column,FileName:e.url,MethodName:e.func||"[anonymous]"})});var w=X.parseUrl("?");w.length>0&&l(w.split("&"),function(n,e){var t=e.split("=");if(t&&2===t.length){var r=decodeURIComponent(t[0]),i=d(r,t[1]);o[r]=i}}),r===t&&(r={}),c(r.customData)&&(r.customData="function"==typeof I?I():I),c(r.tags)&&(r.tags="function"==typeof J?J():J);var k=n.screen||{width:f().width,height:f().height,colorDepth:8},S=r.customData&&r.customData.ajaxErrorMessage,A=v(r.customData);try{JSON.stringify(A)}catch(R){var s="Cannot add custom data; may contain circular reference";A={error:s},X.log("Raygun4JS: "+s)}var C=S||e.message||r.status||"Script error";C=C.substring(0,512);var j={OccurredOn:new Date,Details:{Error:{ClassName:e.name,Message:C,StackTrace:i},Environment:{UtcOffset:(new Date).getTimezoneOffset()/-60,"User-Language":navigator.userLanguage,"Document-Mode":document.documentMode,"Browser-Width":f().width,"Browser-Height":f().height,"Screen-Width":k.width,"Screen-Height":k.height,"Color-Depth":k.colorDepth,Browser:navigator.appCodeName,"Browser-Name":navigator.appName,"Browser-Version":navigator.appVersion,Platform:navigator.platform},Client:{Name:"raygun-js",Version:"1.16.2"},UserCustomData:A,Tags:r.tags,Request:{Url:[location.protocol,"//",location.host,location.pathname,location.hash].join(""),QueryString:o,Headers:{"User-Agent":navigator.userAgent,Referer:document.referrer,Host:document.domain}},Version:T||"Not supplied"}};if(m(),j.Details.User=b,"function"==typeof O){var E=O(j);E&&x(E)}else x(j)}function x(n){if(o()){X.log("Sending exception data to Raygun:",n);var e=L+"/entries?apikey="+encodeURIComponent(S);k(e,JSON.stringify(n))}}function w(e,t){var r;return r=new n.XMLHttpRequest,"withCredentials"in r?r.open(e,t,!0):n.XDomainRequest&&(N&&(t=t.slice(6)),r=new n.XDomainRequest,r.open(e,t)),r.timeout=1e4,r}function k(e,r){var i=w("POST",e,r);return"withCredentials"in i?(i.onreadystatechange=function(){4===i.readyState&&(202===i.status?h():U&&403!==i.status&&400!==i.status&&g(r))},i.onload=function(){X.log("logged error to Raygun")}):n.XDomainRequest&&(i.ontimeout=function(){U&&(X.log("Raygun: saved error locally"),g(r))},i.onload=function(){X.log("logged error to Raygun"),h()}),i.onerror=function(){X.log("failed to log error to Raygun")},i?(i.send(r),t):(X.log("CORS not supported"),t)}var S,b,T,A,O,R,C=TraceKit,j=n.Raygun,E=!1,N=!1,F=!1,D=!1,U=!1,M=!1,$=!1,_=!1,I={},J=[],H=[],L="https://api.raygun.io",W=null,B=null;e&&(R=e(document));var q={noConflict:function(){return n.Raygun=j,q},constructNewRaygun:function(){var e=n.raygunFactory(n,n.jQuery);return n.raygunJsUrlFactory(n,e),e},init:function(n,e,r){return S=n,C.remoteFetching=!1,I=r,e&&(N=e.allowInsecureSubmissions||!1,F=e.ignoreAjaxAbort||!1,D=e.ignoreAjaxError||!1,$=e.disableAnonymousUserTracking||!1,W=e.excludedHostnames||!1,B=e.excludedUserAgents||!1,e.wrapAsynchronousCallbacks!==t&&(_=e.wrapAsynchronousCallbacks),e.debugMode&&(E=e.debugMode),e.ignore3rdPartyErrors&&(M=!0)),h(),q},withCustomData:function(n){return I=n,q},withTags:function(n){return J=n,q},attach:function(){return o()?(C.report.subscribe(y),_&&C.extendToAsynchronousCallbacks(),R&&!D&&R.ajaxError(i),q):q},detach:function(){return C.report.unsubscribe(y),R&&R.unbind("ajaxError",i),q},send:function(n,e,t){try{y(C.computeStackTrace(n),{customData:"function"==typeof I?a(I(),e):a(I,e),tags:u(J,t)})}catch(r){if(n!==r)throw r}return q},setUser:function(n,e,r,i,o,a){return b={Identifier:n},e!==t&&(b.IsAnonymous=e),r!==t&&(b.Email=r),i!==t&&(b.FullName=i),o!==t&&(b.FirstName=o),a!==t&&(b.UUID=a),q},resetAnonymousUser:function(){X.clearCookie("raygun4js-userid")},setVersion:function(n){return T=n,q},saveIfOffline:function(n){return n!==t&&"boolean"==typeof n&&(U=n),q},filterSensitiveData:function(n){return A=n,q},whitelistCrossOriginDomains:function(n){return H=n,q},onBeforeSend:function(n){return O=n,q}},X=q._private=q._private||{},P=q._seal=q._seal||function(){delete q._private,delete q._seal,delete q._unseal},K=q._unseal=q._unseal||function(){q._private=X,q._seal=P,q._unseal=K};return X.getUuid=function(){function n(n){var e=(Math.random().toString(16)+"000000000").substr(2,8);return n?"-"+e.substr(0,4)+"-"+e.substr(4,4):e}return n()+n(!0)+n(!0)+n()},X.createCookie=function(n,e,t){var r;if(t){var i=new Date;i.setTime(i.getTime()+1e3*60*60*t),r="; expires="+i.toGMTString()}else r="";document.cookie=n+"="+e+r+"; path=/"},X.readCookie=function(n){for(var e=n+"=",t=document.cookie.split(";"),r=0;t.length>r;r++){for(var i=t[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(e))return i.substring(e.length,i.length)}return null},X.clearCookie=function(n){X.createCookie(n,"",-1)},X.log=function(e,t){n.console&&n.console.log&&E&&(n.console.log(e),t&&n.console.log(t))},n.Raygun||(n.Raygun=q),q};raygunFactory(window,window.jQuery);var raygunJsUrlFactory=function(n,e){e._private.parseUrl=function(e,t){function r(n){return!isNaN(parseFloat(n))&&isFinite(n)}return function(e,t){var i=t||""+n.location;if(!e)return i;e=""+e,"//"===i.substring(0,2)?i="http:"+i:1===i.split("://").length&&(i="http://"+i),t=i.split("/");var o={auth:""},a=t[2].split("@");1===a.length?a=a[0].split(":"):(o.auth=a[0],a=a[1].split(":")),o.protocol=t[0],o.hostname=a[0],o.port=a[1]||("https"===o.protocol.split(":")[0].toLowerCase()?"443":"80"),o.pathname=(t.length>3?"/":"")+t.slice(3,t.length).join("/").split("?")[0].split("#")[0];var u=o.pathname;"/"===u.charAt(u.length-1)&&(u=u.substring(0,u.length-1));var l=o.hostname,c=l.split("."),s=u.split("/");if("hostname"===e)return l;if("domain"===e)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(l)?l:c.slice(-2).join(".");if("sub"===e)return c.slice(0,c.length-2).join(".");if("port"===e)return o.port;if("protocol"===e)return o.protocol.split(":")[0];if("auth"===e)return o.auth;if("user"===e)return o.auth.split(":")[0];if("pass"===e)return o.auth.split(":")[1]||"";if("path"===e)return o.pathname;if("."===e.charAt(0)){if(e=e.substring(1),r(e))return e=parseInt(e,10),c[0>e?c.length+e:e-1]||""}else{if(r(e))return e=parseInt(e,10),s[0>e?s.length+e:e]||"";if("file"===e)return s.slice(-1)[0];if("filename"===e)return s.slice(-1)[0].split(".")[0];if("fileext"===e)return s.slice(-1)[0].split(".")[1]||"";if("?"===e.charAt(0)||"#"===e.charAt(0)){var f=i,g=null;if("?"===e.charAt(0)?f=(f.split("?")[1]||"").split("#")[0]:"#"===e.charAt(0)&&(f=f.split("#")[1]||""),!e.charAt(1))return f;e=e.substring(1),f=f.split("&");for(var p=0,h=f.length;h>p;p++)if(g=f[p].split("="),g[0]===e)return g[1]||"";return null}}return""}(e,t)}};raygunJsUrlFactory(window,window.Raygun),window.Raygun._seal(); \ No newline at end of file +(function(e){function n(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function t(e){return e===undefined}var r={},a=e.TraceKit,o=[].slice,i="?";r.noConflict=function(){return e.TraceKit=a,r},r.wrap=function(e){function n(){try{return e.apply(this,arguments)}catch(n){throw r.report(n),n}}return n},r.report=function(){function t(e){l(),g.push(e)}function a(e){for(var n=g.length-1;n>=0;--n)g[n]===e&&g.splice(n,1)}function i(e,t){var a=null;if(!t||r.collectWindowErrors){for(var i in g)if(n(g,i))try{g[i].apply(null,[e].concat(o.call(arguments,2)))}catch(u){a=u}if(a)throw a}}function u(e,n,t,a,o){var u=null;if(o)u=r.computeStackTrace(o);else if(h)r.computeStackTrace.augmentStackTraceWithInitialElement(h,n,t,e),u=h,h=null,p=null;else{var l={url:n,line:t,column:a};l.func=r.computeStackTrace.guessFunctionName(l.url,l.line),l.context=r.computeStackTrace.gatherContext(l.url,l.line),u={mode:"onerror",message:e,url:document.location.href,stack:[l],useragent:navigator.userAgent}}return i(u,"from window.onerror"),s?s.apply(this,arguments):!1}function l(){f!==!0&&(s=e.onerror,e.onerror=u,f=!0)}function c(n){var t=o.call(arguments,1);if(h){if(p===n)return;var a=h;h=null,p=null,i.apply(null,[a,null].concat(t))}var u=r.computeStackTrace(n);throw h=u,p=n,e.setTimeout(function(){p===n&&(h=null,p=null,i.apply(null,[u,null].concat(t)))},u.incomplete?2e3:0),n}var s,f,g=[],p=null,h=null;return c.subscribe=t,c.unsubscribe=a,c}(),r.computeStackTrace=function(){function a(n){if(!r.remoteFetching)return"";try{var t=function(){try{return new e.XMLHttpRequest}catch(n){return new e.ActiveXObject("Microsoft.XMLHTTP")}},a=t();return a.open("GET",n,!1),a.send(""),a.responseText}catch(o){return""}}function o(e){if(!n(S,e)){var t="";e=e||"",e.indexOf&&-1!==e.indexOf(document.domain)&&(t=a(e)),S[e]=t?t.split("\n"):[]}return S[e]}function u(e,n){var r,a=/function ([^(]*)\(([^)]*)\)/,u=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,l="",c=10,s=o(e);if(!s.length)return i;for(var f=0;c>f;++f)if(l=s[n-f]+l,!t(l)){if(r=u.exec(l))return r[1];if(r=a.exec(l))return r[1]}return i}function l(e,n){var a=o(e);if(!a.length)return null;var i=[],u=Math.floor(r.linesOfContext/2),l=u+r.linesOfContext%2,c=Math.max(0,n-u-1),s=Math.min(a.length,n+l-1);n-=1;for(var f=c;s>f;++f)t(a[f])||i.push(a[f]);return i.length>0?i:null}function c(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function s(e){return c(e).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function f(e,n){for(var t,r,a=0,i=n.length;i>a;++a)if((t=o(n[a])).length&&(t=t.join("\n"),r=e.exec(t)))return{url:n[a],line:t.substring(0,r.index).split("\n").length,column:r.index-t.lastIndexOf("\n",r.index)-1};return null}function g(e,n,t){var r,a=o(n),i=RegExp("\\b"+c(e)+"\\b");return t-=1,a&&a.length>t&&(r=i.exec(a[t]))?r.index:null}function p(n){for(var t,r,a,o,i=[e.location.href],u=document.getElementsByTagName("script"),l=""+n,g=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,p=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,h=0;u.length>h;++h){var m=u[h];m.src&&i.push(m.src)}if(a=g.exec(l)){var d=a[1]?"\\s+"+a[1]:"",v=a[2].split(",").join("\\s*,\\s*");t=c(a[3]).replace(/;$/,";?"),r=RegExp("function"+d+"\\s*\\(\\s*"+v+"\\s*\\)\\s*{\\s*"+t+"\\s*}")}else r=RegExp(c(l).replace(/\s+/g,"\\s+"));if(o=f(r,i))return o;if(a=p.exec(l)){var y=a[1];if(t=s(a[2]),r=RegExp("on"+y+"=[\\'\"]\\s*"+t+"\\s*[\\'\"]","i"),o=f(r,i[0]))return o;if(r=RegExp(t),o=f(r,i))return o}return null}function h(e){if(!e.stack)return null;for(var n,t,r=/^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|http|https|chrome-extension):.*?):(\d+)(?::(\d+))?\)?\s*$/i,a=/^\s*(\S*)(?:\((.*?)\))?@?((?:file|http|https):.*?):(\d+)(?::(\d+))?\s*$/i,o=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=e.stack.split("\n"),s=[],f=/^(.*) is undefined$/.exec(e.message),p=0,h=c.length;h>p;++p){if(n=a.exec(c[p]))t={url:n[3],func:n[1]||i,args:n[2]?n[2].split(","):"",line:+n[4],column:n[5]?+n[5]:null};else if(n=r.exec(c[p]))t={url:n[2],func:n[1]||i,line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=o.exec(c[p])))continue;t={url:n[2],func:n[1]||i,line:+n[3],column:n[4]?+n[4]:null}}!t.func&&t.line&&(t.func=u(t.url,t.line)),t.line&&(t.context=l(t.url,t.line)),s.push(t)}return s[0]&&s[0].line&&!s[0].column&&f&&(s[0].column=g(f[1],s[0].url,s[0].line)),s.length?{mode:"stack",name:e.name,message:e.message,url:document.location.href,stack:s,useragent:navigator.userAgent}:null}function m(e){for(var n,t=e.stacktrace,r=/ line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,a=t.split("\n"),o=[],i=0,c=a.length;c>i;i+=2)if(n=r.exec(a[i])){var s={line:+n[1],column:+n[2],func:n[3]||n[4],args:n[5]?n[5].split(","):[],url:n[6]};if(!s.func&&s.line&&(s.func=u(s.url,s.line)),s.line)try{s.context=l(s.url,s.line)}catch(f){}s.context||(s.context=[a[i+1]]),o.push(s)}return o.length?{mode:"stacktrace",name:e.name,message:e.message,url:document.location.href,stack:o,useragent:navigator.userAgent}:null}function d(t){var r=t.message.split("\n");if(4>r.length)return null;var a,i,c,g,p=/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,h=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http|https)\S+)(?:: in function (\S+))?\s*$/i,m=/^\s*Line (\d+) of function script\s*$/i,d=[],v=document.getElementsByTagName("script"),y=[];for(i in v)n(v,i)&&!v[i].src&&y.push(v[i]);for(i=2,c=r.length;c>i;i+=2){var x=null;if(a=p.exec(r[i]))x={url:a[2],func:a[3],line:+a[1]};else if(a=h.exec(r[i])){x={url:a[3],func:a[4]};var w=+a[1],k=y[a[2]-1];if(k&&(g=o(x.url))){g=g.join("\n");var S=g.indexOf(k.innerText);S>=0&&(x.line=w+g.substring(0,S).split("\n").length)}}else if(a=m.exec(r[i])){var b=e.location.href.replace(/#.*$/,""),T=a[1],A=RegExp(s(r[i+1]));g=f(A,[b]),x={url:b,line:g?g.line:T,func:""}}if(x){x.func||(x.func=u(x.url,x.line));var O=l(x.url,x.line),C=O?O[Math.floor(O.length/2)]:null;x.context=O&&C.replace(/^\s*/,"")===r[i+1].replace(/^\s*/,"")?O:[r[i+1]],d.push(x)}}return d.length?{mode:"multiline",name:t.name,message:r[0],url:document.location.href,stack:d,useragent:navigator.userAgent}:null}function v(e,n,t,r){var a={url:n,line:t};if(a.url&&a.line){e.incomplete=!1,a.func||(a.func=u(a.url,a.line)),a.context||(a.context=l(a.url,a.line));var o=/ '([^']+)' /.exec(r);if(o&&(a.column=g(o[1],a.url,a.line)),e.stack.length>0&&e.stack[0].url===a.url){if(e.stack[0].line===a.line)return!1;if(!e.stack[0].line&&e.stack[0].func===a.func)return e.stack[0].line=a.line,e.stack[0].context=a.context,!1}return e.stack.unshift(a),e.partial=!0,!0}return e.incomplete=!0,!1}function y(e,n){for(var t,a,o,l=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],s={},f=!1,h=y.caller;h&&!f;h=h.caller)if(h!==x&&h!==r.report){if(a={url:null,func:i,line:null,column:null},h.name?a.func=h.name:(t=l.exec(""+h))&&(a.func=t[1]),a.func===undefined)try{a.func=t.input.substring(0,t.input.indexOf("{"))}catch(m){}if(o=p(h)){a.url=o.url,a.line=o.line,a.func===i&&(a.func=u(a.url,a.line));var d=/ '([^']+)' /.exec(e.message||e.description);d&&(a.column=g(d[1],o.url,o.line))}s[""+h]?f=!0:s[""+h]=!0,c.push(a)}n&&c.splice(0,n);var w={mode:"callers",name:e.name,message:e.message,url:document.location.href,stack:c,useragent:navigator.userAgent};return v(w,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),w}function x(e,n){var t=null;n=null==n?0:+n;try{if(t=m(e))return t}catch(r){if(k)throw r}try{if(t=h(e))return t}catch(r){if(k)throw r}try{if(t=d(e))return t}catch(r){if(k)throw r}try{if(t=y(e,n+1))return t}catch(r){if(k)throw r}return{mode:"failed"}}function w(e){e=(null==e?0:+e)+1;try{throw Error()}catch(n){return x(n,e+1)}}var k=!1,S={};return x.augmentStackTraceWithInitialElement=v,x.guessFunctionName=u,x.gatherContext=l,x.ofCaller=w,x}(),r.extendToAsynchronousCallbacks=function(){var n=function n(n){var t=e[n];e[n]=function(){var e=o.call(arguments),n=e[0];return"function"==typeof n&&(e[0]=r.wrap(n)),t.apply?t.apply(this,e):t(e[0],e[1])}};n("setTimeout"),n("setInterval")},r.remoteFetching||(r.remoteFetching=!0),r.collectWindowErrors||(r.collectWindowErrors=!0),(!r.linesOfContext||1>r.linesOfContext)&&(r.linesOfContext=11),e.TraceKit=r})(window);var raygunFactory=function(e,n,t){function r(e){var n=e,t=e.split("//")[1];if(t){var r=t.indexOf("?"),a=(""+t).substring(0,r),o=a.split("/").slice(0,4).join("/"),i=a.substring(0,48);n=o.lengtht;t++)n.call(null,t,e[t])}function c(e){for(var n in e)if(e.hasOwnProperty(n))return!1;return!0}function s(){return Math.floor(9007199254740992*Math.random())}function f(){var n=document.documentElement,t=document.getElementsByTagName("body")[0],r=e.innerWidth||n.clientWidth||t.clientWidth,a=e.innerHeight||n.clientHeight||t.clientHeight;return{width:r,height:a}}function g(e){var n=(new Date).toJSON();try{var r="raygunjs="+n+"="+s();localStorage[r]===t&&(localStorage[r]=e)}catch(a){P.log("Raygun4JS: LocalStorage full, cannot save exception")}}function p(){try{return"localStorage"in e&&null!==e.localStorage}catch(n){return!1}}function h(){if(p()&&localStorage&&localStorage.length>0)for(var e in localStorage)"raygunjs="===e.substring(0,9)&&(x(JSON.parse(localStorage[e])),localStorage.removeItem(e))}function m(){if(!b&&!$){var e,n="raygun4js-userid",t=P.readCookie(n);t?e=t:(e=P.getUuid(),P.createCookie(n,e,744)),X.setUser(e,!0,null,null,null,e)}}function d(e,n){if(A)if(Array.prototype.indexOf&&A.indexOf===Array.prototype.indexOf){if(-1!==A.indexOf(e))return"[removed by filter]"}else for(var t=0;A.length>t;t++)if(A[t]===e)return"[removed by filter]";return n}function v(e,n){if(null==e)return e;if("[object Object]"!==Object.prototype.toString.call(e))return e;for(var r in e){var a=e[r];null!=a&&("[object Object]"===Object.prototype.toString.call(a)?("Details"!==n||"Client"!==r)&&(e[r]=v(d(r,a),r)):(n!==t||"OccurredOn"!==r)&&(e[r]=d(r,a)))}return e}function y(n,r){var a=[],o={};if(M){if(!n.stack||!n.stack.length)return P.log("Raygun4JS: Cancelling send due to null stacktrace"),t;var i=P.parseUrl("domain"),u="Script error",s=n.message||r.status||u;if(s.substring(0,u.length)===u&&null!==n.stack[0].url&&-1===n.stack[0].url.indexOf(i)&&(0===n.stack[0].line||"?"===n.stack[0].func))return P.log("Raygun4JS: cancelling send due to third-party script error with no stacktrace and message"),t;if(null!==n.stack[0].url&&-1===n.stack[0].url.indexOf(i)){var g=!1;for(var p in H)n.stack[0].url.indexOf(H[p])>-1&&(g=!0);if(!g)return P.log("Raygun4JS: cancelling send due to error on non-origin, non-whitelisted domain"),t}}if(W instanceof Array)for(var h in W)if(e.location.hostname&&e.location.hostname.match(W[h]))return P.log("Raygun4JS: cancelling send as error originates from an excluded hostname"),t;if(B instanceof Array)for(var y in B)if(navigator.userAgent.match(B[y]))return P.log("Raygun4JS: cancelling send as error originates from an excluded user agent"),t;n.stack&&n.stack.length&&l(n.stack,function(e,n){a.push({LineNumber:n.line,ColumnNumber:n.column,ClassName:"line "+n.line+", column "+n.column,FileName:n.url,MethodName:n.func||"[anonymous]"})});var w=P.parseUrl("?");w.length>0&&l(w.split("&"),function(e,n){var t=n.split("=");if(t&&2===t.length){var r=decodeURIComponent(t[0]),a=d(r,t[1]);o[r]=a}}),r===t&&(r={}),c(r.customData)&&(r.customData="function"==typeof I?I():I),c(r.tags)&&(r.tags="function"==typeof J?J():J);var k,S=e.screen||{width:f().width,height:f().height,colorDepth:8},A=r.customData&&r.customData.ajaxErrorMessage;k="customData"===q?v(r.customData,"UserCustomData"):r.customData;try{JSON.stringify(k)}catch(C){var s="Cannot add custom data; may contain circular reference";k={error:s},P.log("Raygun4JS: "+s)}var R=A||n.message||r.status||"Script error";R=R.substring(0,512);var j={OccurredOn:new Date,Details:{Error:{ClassName:n.name,Message:R,StackTrace:a},Environment:{UtcOffset:(new Date).getTimezoneOffset()/-60,"User-Language":navigator.userLanguage,"Document-Mode":document.documentMode,"Browser-Width":f().width,"Browser-Height":f().height,"Screen-Width":S.width,"Screen-Height":S.height,"Color-Depth":S.colorDepth,Browser:navigator.appCodeName,"Browser-Name":navigator.appName,"Browser-Version":navigator.appVersion,Platform:navigator.platform},Client:{Name:"raygun-js",Version:"1.18.0"},UserCustomData:k,Tags:r.tags,Request:{Url:[location.protocol,"//",location.host,location.pathname,location.hash].join(""),QueryString:o,Headers:{"User-Agent":navigator.userAgent,Referer:document.referrer,Host:document.domain}},Version:T||"Not supplied"}};if(m(),j.Details.User=b,"all"===q&&(j=v(j)),"function"==typeof O){var D=O(j);D&&x(D)}else x(j)}function x(e){if(o()){P.log("Sending exception data to Raygun:",e);var n=L+"/entries?apikey="+encodeURIComponent(S);k(n,JSON.stringify(e))}}function w(n,t){var r;return r=new e.XMLHttpRequest,"withCredentials"in r?r.open(n,t,!0):e.XDomainRequest&&(F&&(t=t.slice(6)),r=new e.XDomainRequest,r.open(n,t)),r.timeout=1e4,r}function k(n,r){var a=w("POST",n,r);return"withCredentials"in a?(a.onreadystatechange=function(){4===a.readyState&&(202===a.status?h():U&&403!==a.status&&400!==a.status&&g(r))},a.onload=function(){P.log("logged error to Raygun")}):e.XDomainRequest&&(a.ontimeout=function(){U&&(P.log("Raygun: saved error locally"),g(r))},a.onload=function(){P.log("logged error to Raygun"),h()}),a.onerror=function(){P.log("failed to log error to Raygun")},a?(a.send(r),t):(P.log("CORS not supported"),t)}var S,b,T,A,O,C,R=TraceKit,j=e.Raygun,D=!1,F=!1,E=!1,N=!1,U=!1,M=!1,$=!1,_=!1,I={},J=[],H=[],L="https://api.raygun.io",W=null,B=null,q="customData";n&&(C=n(document));var X={noConflict:function(){return e.Raygun=j,X},constructNewRaygun:function(){var n=e.raygunFactory(e,e.jQuery);return e.raygunJsUrlFactory(e,n),n},init:function(e,n,r){return S=e,R.remoteFetching=!1,I=r,n&&(F=n.allowInsecureSubmissions||!1,E=n.ignoreAjaxAbort||!1,N=n.ignoreAjaxError||!1,$=n.disableAnonymousUserTracking||!1,W=n.excludedHostnames||!1,B=n.excludedUserAgents||!1,n.wrapAsynchronousCallbacks!==t&&(_=n.wrapAsynchronousCallbacks),n.debugMode&&(D=n.debugMode),n.ignore3rdPartyErrors&&(M=!0)),h(),X},withCustomData:function(e){return I=e,X},withTags:function(e){return J=e,X},attach:function(){return o()?(R.report.subscribe(y),_&&R.extendToAsynchronousCallbacks(),C&&!N&&C.ajaxError(a),X):X},detach:function(){return R.report.unsubscribe(y),C&&C.unbind("ajaxError",a),X},send:function(e,n,t){try{y(R.computeStackTrace(e),{customData:"function"==typeof I?i(I(),n):i(I,n),tags:u(J,t)})}catch(r){if(e!==r)throw r}return X},setUser:function(e,n,r,a,o,i){return b={Identifier:e},n!==t&&(b.IsAnonymous=n),r!==t&&(b.Email=r),a!==t&&(b.FullName=a),o!==t&&(b.FirstName=o),i!==t&&(b.UUID=i),X},resetAnonymousUser:function(){P.clearCookie("raygun4js-userid")},setVersion:function(e){return T=e,X},saveIfOffline:function(e){return e!==t&&"boolean"==typeof e&&(U=e),X},filterSensitiveData:function(e){return A=e,X},setFilterScope:function(e){return("customData"===e||"all"===e)&&(q=e),X},whitelistCrossOriginDomains:function(e){return H=e,X},onBeforeSend:function(e){return O=e,X}},P=X._private=X._private||{},K=X._seal=X._seal||function(){delete X._private,delete X._seal,delete X._unseal},V=X._unseal=X._unseal||function(){X._private=P,X._seal=K,X._unseal=V};return P.getUuid=function(){function e(e){var n=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+n.substr(0,4)+"-"+n.substr(4,4):n}return e()+e(!0)+e(!0)+e()},P.createCookie=function(e,n,t){var r;if(t){var a=new Date;a.setTime(a.getTime()+1e3*60*60*t),r="; expires="+a.toGMTString()}else r="";document.cookie=e+"="+n+r+"; path=/"},P.readCookie=function(e){for(var n=e+"=",t=document.cookie.split(";"),r=0;t.length>r;r++){for(var a=t[r];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(n))return a.substring(n.length,a.length)}return null},P.clearCookie=function(e){P.createCookie(e,"",-1)},P.log=function(n,t){e.console&&e.console.log&&D&&(e.console.log(n),t&&e.console.log(t))},e.Raygun||(e.Raygun=X),X};raygunFactory(window,window.jQuery);var raygunJsUrlFactory=function(e,n){n._private.parseUrl=function(n,t){function r(e){return!isNaN(parseFloat(e))&&isFinite(e)}return function(n,t){var a=t||""+e.location;if(!n)return a;n=""+n,"//"===a.substring(0,2)?a="http:"+a:1===a.split("://").length&&(a="http://"+a),t=a.split("/");var o={auth:""},i=t[2].split("@");1===i.length?i=i[0].split(":"):(o.auth=i[0],i=i[1].split(":")),o.protocol=t[0],o.hostname=i[0],o.port=i[1]||("https"===o.protocol.split(":")[0].toLowerCase()?"443":"80"),o.pathname=(t.length>3?"/":"")+t.slice(3,t.length).join("/").split("?")[0].split("#")[0];var u=o.pathname;"/"===u.charAt(u.length-1)&&(u=u.substring(0,u.length-1));var l=o.hostname,c=l.split("."),s=u.split("/");if("hostname"===n)return l;if("domain"===n)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(l)?l:c.slice(-2).join(".");if("sub"===n)return c.slice(0,c.length-2).join(".");if("port"===n)return o.port;if("protocol"===n)return o.protocol.split(":")[0];if("auth"===n)return o.auth;if("user"===n)return o.auth.split(":")[0];if("pass"===n)return o.auth.split(":")[1]||"";if("path"===n)return o.pathname;if("."===n.charAt(0)){if(n=n.substring(1),r(n))return n=parseInt(n,10),c[0>n?c.length+n:n-1]||""}else{if(r(n))return n=parseInt(n,10),s[0>n?s.length+n:n]||"";if("file"===n)return s.slice(-1)[0];if("filename"===n)return s.slice(-1)[0].split(".")[0];if("fileext"===n)return s.slice(-1)[0].split(".")[1]||"";if("?"===n.charAt(0)||"#"===n.charAt(0)){var f=a,g=null;if("?"===n.charAt(0)?f=(f.split("?")[1]||"").split("#")[0]:"#"===n.charAt(0)&&(f=f.split("#")[1]||""),!n.charAt(1))return f;n=n.substring(1),f=f.split("&");for(var p=0,h=f.length;h>p;p++)if(g=f[p].split("="),g[0]===n)return g[1]||"";return null}}return""}(n,t)}};raygunJsUrlFactory(window,window.Raygun),window.Raygun._seal(); \ No newline at end of file