mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-17 19:12:40 -05:00
3 lines
17 KiB
JavaScript
3 lines
17 KiB
JavaScript
|
/*! Raven.js 1.2.0 (feb5e65) | github.com/getsentry/raven-js */
|
||
|
!function(a,b){"use strict";function c(){return"undefined"==typeof document?"":document.location.href}function d(a,b){var c,d;if(Q){b=b||{},a="raven"+a.substr(0,1).toUpperCase()+a.substr(1),document.createEvent?(c=document.createEvent("HTMLEvents"),c.initEvent(a,!0,!0)):(c=document.createEventObject(),c.eventType=a);for(d in b)m(b,d)&&(c[d]=b[d]);if(document.createEvent)document.dispatchEvent(c);else try{document.fireEvent("on"+c.eventType.toLowerCase(),c)}catch(e){}}}function e(a){this.name="RavenConfigError",this.message=a}function f(a){var b=aa.exec(a),c={},d=7;try{for(;d--;)c[_[d]]=b[d]||""}catch(f){throw new e("Invalid DSN: "+a)}if(c.pass)throw new e("Do not specify your private key in the DSN!");return c}function g(a){return void 0===a}function h(a){return"function"==typeof a}function i(a){return"[object String]"===U.toString.call(a)}function j(a){return"object"==typeof a&&null!==a}function k(a){for(var b in a)return!1;return!0}function l(a){return j(a)&&"[object Error]"===U.toString.call(a)||a instanceof Error}function m(a,b){return U.hasOwnProperty.call(a,b)}function n(a,b){var c,d;if(g(a.length))for(c in a)m(a,c)&&b.call(null,c,a[c]);else if(d=a.length)for(c=0;d>c;c++)b.call(null,c,a[c])}function o(a,b){var c=[];a.stack&&a.stack.length&&n(a.stack,function(a,b){var d=p(b);d&&c.push(d)}),d("handle",{stackInfo:a,options:b}),r(a.name,a.message,a.url,a.lineno,c,b)}function p(a){if(a.url){var b,c={filename:a.url,lineno:a.line,colno:a.column,"function":a.func||"?"},d=q(a);if(d){var e=["pre_context","context_line","post_context"];for(b=3;b--;)c[e[b]]=d[b]}return c.in_app=!(S.includePaths.test&&!S.includePaths.test(c.filename)||/(Raven|TraceKit)\./.test(c["function"])||/raven\.(min\.)?js$/.test(c.filename)),c}}function q(a){if(a.context&&S.fetchContext){for(var b=a.context,c=~~(b.length/2),d=b.length,e=!1;d--;)if(b[d].length>300){e=!0;break}if(e){if(g(a.column))return;return[[],b[c].substr(a.column,50),[]]}return[b.slice(0,c),b[c],b.slice(c+1)]}}function r(a,b,c,d,e,f){var g,h;S.ignoreErrors.test&&S.ignoreErrors.test(b)||(b+="",b=t(b,S.maxMessageLength),h=a+": "+b,h=t(h,S.maxMessageLength),e&&e.length?(c=e[0].filename||c,e.reverse(),g={frames:e}):c&&(g={frames:[{filename:c,lineno:d,in_app:!0}]}),S.ignoreUrls.test&&S.ignoreUrls.test(c)||(!S.whitelistUrls.test||S.whitelistUrls.test(c))&&w(s({exception:{type:a,value:b},stacktrace:g,culprit:c,message:h},f)))}function s(a,b){return b?(n(b,function(b,c){a[b]=c}),a):a}function t(a,b){return a.length<=b?a:a.substr(0,b)+"…"}function u(){return+new Date}function v(){if(Q&&document.location&&document.location.href){var a={headers:{"User-Agent":navigator.userAgent}};return a.url=document.location.href,document.referrer&&(a.headers.Referer=document.referrer),a}}function w(a){var b={project:N,logger:S.logger,platform:"javascript"},c=v();c&&(b.request=c),a=s(b,a),a.tags=s(s({},R.tags),a.tags),a.extra=s(s({},R.extra),a.extra),a.extra=s({"session:duration":u()-Y},a.extra),k(a.tags)&&delete a.tags,R.user&&(a.user=R.user),S.release&&(a.release=S.release),h(S.dataCallback)&&(a=S.dataCallback(a)||a),a&&!k(a)&&(!h(S.shouldSendCallback)||S.shouldSendCallback(a))&&(K=a.event_id||(a.event_id=B()),C("debug","Raven about to send:",a),z()&&(S.transport||x)({url:L,auth:{sentry_version:"4",sentry_client:"raven-js/"+$.VERSION,sentry_key:M},data:a,options:S,onSuccess:function(){d("success",{data:a,src:L})},onError:function(){d("failure",{data:a,src:L})}}))}function x(a){a.auth.sentry_data=JSON.stringify(a.data);var b=y(),c=a.url+"?"+E(a.auth);(a.options.crossOrigin||""===a.options.crossOrigin)&&(b.crossOrigin=a.options.crossOrigin),b.onload=a.onSuccess,b.onerror=b.onabort=a.onError,b.src=c}function y(){return document.createElement("img")}function z(){return P?L?!0:(ba||C("error","Error: Raven has not been configured."),ba=!0,!1):!1}function A(a){for(var b,c=[],d=0,e=a.length;e>d;d++)b=a[d],i(b)?c.push(b.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):b&&b.source&&c.push(b.source);return new RegExp(c.join("|"),"i")}function B(){var b=a.crypto||a.msCrypto;if(!g(b)&&b.getRandomValues){var c=new Uint16A
|
||
|
//# sourceMappingURL=raven.min.map
|