!function(e,t){"use strict";function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,!!r):e.attachEvent&&e.attachEvent("on"+t,n,!!r)}function r(e){var t=decodeURIComponent(y.cookie).match(new RegExp(e+"=([^;]+)"));return t&&t.length>1?t[1]:null}function o(e,t){return"string"==typeof e&&e.length>t?[e.slice(0,t/2),"...",e.length-t,"...",e.slice(-t/2)].join(""):e}function i(e,t){"number"==typeof t&&T.random()>t||(e instanceof E?(e.url||(e.url="//www.tumblr.com/"),a(e.message,e.url,e.ln,e.col,e)):I.push(L(e)))}function a(e,t,n,i,a){try{if(t=o(t,300)||"",x.test(t)&&!F.test(t))return;if(a=L(o(a&&a.stack,1e3)||""),x.test(a)&&!F.test(a))return;w.push({path:(y.location||{}).pathname||"NO_LOCATION_OR_PATHNAME",msg:o(e,200)||"",url:t,ln:v(n,10)||-1,col:v(i,10)||-1,err:a,group:k("js_errors_a")("A",k("js_errors_b")("B","*")),logged_in:!!r("logged_in")}),O.___err=!0}catch(a){}}function u(){return-1!==((y.head||{}).innerHTML||"").indexOf("#missinge_button")}function c(e){var t=M();return t.name=e,L(t)}function s(e){for(var t,n,r=e.length;r>0;)n=T.floor(T.random()*r),r--,t=e[r],e[r]=e[n],e[n]=t;return e}function l(e){if(!b||!b.getEntriesByType)return e;var t=b.getEntriesByType("resource"),n={};D(t,function(e){var t=(e.name.match(/\/\/([^\/]+)/)||"")[1];if(-1!==t.indexOf(".tumblr.")){n[e.initiatorType]||(n[e.initiatorType]=[]);var r=t.split(".")[0];n[e.initiatorType].push({name:e.name.split(t)[1],duration:e.duration,bucket:r})}}),A.entries||(A.entries=[]);for(var r=[{type:"img",num:10},{type:"link",num:2},{type:"script",num:2},{type:"css",num:2}],o=0;o<r.length;++o){var i=r[o],a=n[i.type];if(a)for(i.num<a.length&&s(a);i.num&&a.length;)A.entries.push(a.pop()),--i.num}return S(A)&&((e||(e={})).perf=A,A.timing=b.timing,A.memory=b.memory,A.navigation=b.navigation),e}function g(){try{R||(w.length=0,i(new E("PAGE_DID_NOT_LOAD")));var t;if(!u()&&k("enable_js_errors_log")(function(){w.length&&((t||(t={})).errors=w)}),k("js_performance_logging")(function(){try{t=l(t)}catch(e){}}),k("enable_js_ephemeral_log")(function(){I.length&&((t||(t={})).ephemeral=I)}),k("js_debugger_1")(function(){(t||(t={})).ephemeral=[c("js_debugger_1")]}),k("js_debugger_2")(function(){(t||(t={})).ephemeral=[c("js_debugger_2")]}),!t)return;t.cdn=h||"CDN_LOOKUP_FAILED";var n=JSON.stringify({form_key:(y.getElementById("tumblr_form_key")||y.body).getAttribute("content"),gpop:(y.getElementById("tumblr_gpop")||y.body).getAttribute("content"),log:t}),r=new j;r.open("POST","/svc/log/capture/exceptions",!1),r.setRequestHeader("Content-type","text/plain"),r.onreadystatechange=function(){4===r.readyState&&(w.length=I.length=0)},r.send(n)}catch(o){if(!e.jQuery)return;(t||(t={})).errors||(t.errors=w),e.jQuery.ajax({async:!1,dataType:"json",contentType:"text/plain",type:"POST",data:{form_key:e.jQuery("#tumblr_form_key").attr("content"),log:t},url:"/svc/log/capture/exceptions",withFormKey:!0}),i(o)}}function f(){A.page_info={},A.page_info.path=y.location.pathname||"n/a"}function p(){var e=(new N).getTime(),t=e-b.timing.navigationStart;A.page_load_time=t}function m(){if(b&&b.timing)try{f(),p()}catch(e){}}function _(){R=!0,m()}var h,y=e.document,d=(e.encodeURIComponent,e.navigator),v=e.parseInt,b=e.performance,O=e.window,N=e.Date,E=e.Error,T=e.Math,j=e.XMLHttpRequest,I=[],w=[],A={},R=!1,S=function(e){return e&&e.keys||function(t){var n=[],r=e.prototype.hasOwnProperty;for(var o in t)r.call(t,o)&&n.push(o);return n}}(e.Object),D=function(e,t,n){if("function"==typeof t)for(var r=(e&&e.length)>>>0,o=0;r>o;o++)t.call(n,e[o],o,e)},L=function(e){return e&&e.stringify&&function(t){try{return e.stringify(t)}catch(n){return i(n),'"FAILED_JSON_STRINGIFY"'}}||function(){return'"NO_JSON_STRINGIFY"'}}(e.JSON),k=function(e){return e&&e.Flags||function(){function e(e,t){return"function"==typeof e?e.call(this,t):e}i(new E("Missing Tumblr.Flags in exceptions.js"));var t={enable_js_errors_log:!0,enable_js_ephemeral_log:!0};return function(n){var r=!!t[n];return function o(t,n){var i=e.call(this,r?t:n,r);return void 0!==i?i:o}}}()}(e.Tumblr);!function(){try{var e=new j;e.open("GET","https://assets.tumblr.com/delivery/cdn.json"),e.onreadystatechange=function(){if(e.readyState===j.DONE)try{h=JSON.parse(e.response).cdn}catch(t){h="CDN_BAD_RESPONSE"}},e.send()}catch(t){}}();var x=/https?:\/\//,F=/https?:\/\/[^\/]*tumblr[^\/]*/,M=i.debugDump=function(){var t=[];return D(y.getElementsByTagName("script"),function(e){t.push(e.src)}),{timestamp:+new N,path:(y.location||{}).href||"NO_HREF",lang:(d||{}).userLanguage||(d||{}).language||"NO_LANG",referrer:y.referrer||"NO_REFERRER",ua:(d||{}).userAgent||"NO_UA",timing:(b||{}).timing||"NO_TIMING",scripts:t,globals:S(e),cookie:y.cookie,ephemeral:I,errors:w,document:(y.documentElement||{}).innerHTML||"NO_DOCUMENT"}};!function(){n(O,"beforeunload",g),O.onerror=a}(),(t.Utils||(t.Utils={})).exceptions=i,n(O,"load",_)}(this,this.Tumblr||(this.Tumblr={}));