function load_typekit(){"undefined"==typeof Typekit&&(TypekitConfig={kitId:"dzi2tiv"},function(){var t=document.createElement("script");t.src="/load/view.php?a=aHR0cDovL3VzZS50eXBla2l0LmNvbS8"+TypekitConfig.kitId+".js",t.type="text/javascript",t.async="true",t.onload=t.onreadystatechange=function(){var t=this.readyState;if(!t||"complete"==t||"loaded"==t)try{Typekit.load(TypekitConfig)}catch(e){}};var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)}())}function select_field(t){if(t.createTextRange){var e=t.createTextRange();e.moveStart("character",0),e.moveEnd("character",t.value.length),e.select()}else t.setSelectionRange&&t.setSelectionRange(0,t.value.length)}function get_cookie(t){var e,i,o=document.cookie,s=o.split(";"),n=s.length;for(i=0;i/g,">"),e=this.animations_to_text(this.animations).replace(//g,">");return t+e},toString:function(){return this.css_text()}},s.instances=[],s.browser_prefixes=["webkit","moz","ms","o"],s.default_properties_order=["font","font-family","font-size","font-style","font-variant","font-weight","@font-face","font-size-adjust","font-stretch","padding","padding-top","padding-right","padding-bottom","padding-left","margin","margin-top","margin-right","margin-bottom","margin-left","border","border-top","border-top-color","border-top-style","border-top-width","border-right","border-right-color","border-right-style","border-right-width","border-bottom","border-bottom-color","border-bottom-style","border-bottom-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","background","background-color","background-position","background-size","background-repeat","background-origin","background-clip","background-attachment","background-image","overflow","overflow-x","overflow-y","transition","transition-property","transition-duration","transition-timing-function","transition-delay","transform","transform-origin","transform-style"],s.create_stylesheet=function(t){var e=document.createElement("style");return e.type="text/css",t&&(e.id=t),e},s.register=function(t){this.instances.push(t)},t.Styler=s}(this.Tumblr||(this.Tumblr={})),/*! scripts/tumblelog/legacy_tumblelog_video.js */ "Tumblr"in window||(window.Tumblr={}),Tumblr.flashVersion=function(){if(navigator.plugins&&navigator.plugins.length>0){var t=navigator.mimeTypes;if(t&&t["application/x-shockwave-flash"]&&t["application/x-shockwave-flash"].enabledPlugin&&t["application/x-shockwave-flash"].enabledPlugin.description)return parseInt(t["application/x-shockwave-flash"].enabledPlugin.description.split(" ")[2].split(".")[0],10)}else if(navigator.appVersion.indexOf("Mac")===-1&&window.execScript){try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),i=e.GetVariable("$version");return i.split(",")[0].split(" ")[1]}catch(o){}return 0}},Tumblr.replaceIfFlash=function(t,e,i){Tumblr.flashVersion()>=t&&(document.getElementById(e).innerHTML=i)},/*! scripts/tumblelog/utilities.js */ "Tumblr"in window||(window.Tumblr={}),Tumblr.hasClass=function(t,e){return new RegExp("(\\s|^)"+e+"(\\s|$)").test(t.className)},Tumblr.addClass=function(t,e){Tumblr.hasClass(t,e)||(t.className+=" "+e)},Tumblr.removeClass=function(t,e){if(Tumblr.hasClass(t,e)){var i=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(i," ")}},Tumblr.toggleClass=function(t,e){Tumblr.hasClass(t,e)?Tumblr.removeClass(t,e):Tumblr.addClass(t,e)},/*! scripts/tumblelog/lightbox.js */ "Tumblr"in window||(window.Tumblr={}),Tumblr.windowDimensions=function(){return void 0!==window.innerWidth?{width:window.innerWidth,height:window.innerHeight}:document.documentElement?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}},Tumblr.Lightbox=function(){function t(){return void 0!==window.innerWidth?{width:window.innerWidth,height:window.innerHeight}:document.documentElement?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function e(t,e){if(!document.getElementById("tumblr_lightbox")){if(e||(e=1),c=t,navigator&&navigator.userAgent.indexOf("Firefox")!=-1){var s=document.createElement("input");s.setAttribute("id","Tumblr_Lightbox_focus_input"),s.setAttribute("type","text"),s.style.position="fixed",s.style.top=0,s.style.left=0,document.body.appendChild(s),s.focus(),document.body.removeChild(s)}else window.focus();a||(window.onkeydown&&(l=window.onkeydown),window.onkeydown=function(t){if(document.getElementById("tumblr_lightbox")){t||(t=window.event);var e=t.charCode?t.charCode:t.keyCode;if(t.shiftKey||t.ctrlKey||t.altKey||t.metaKey){if((t.ctrlKey||t.metaKey)&&87==e)return i(),!1}else 37==e?d>1&&o(d-1):39==e?d1&&s("left",t-2),ts&&("high-res"==o.className||o.style.maxWidth)?(i.style.width=s+"px",i.style.height=n+"px"):(i.style.height=n*(t().width*r/s)+"px",i.style.width=t().width*r+"px")}else.85*t().height>n&&("high-res"==o.className||o.style.maxHeight)?(i.style.width=s+"px",i.style.height=n+"px"):(i.style.width=s*(.85*t().height/n)+"px",i.style.height=.85*t().height+"px");"center"==stage_name?(i.style.left=0-parseInt(i.style.width,10)/2+"px",i.style.top=0-parseInt(i.style.height,10)/2+"px"):"right"==stage_name?(i.style.left=.42*t().width+"px",i.style.top=0-parseInt(i.style.height,10)/2+"px"):(i.style.left=0-parseInt(i.style.width,10)-.42*t().width+"px",i.style.top=0-parseInt(i.style.height,10)/2+"px"),i.src=o.src,i.style.backgroundColor="placeholder"==o.className?navigator&&navigator.userAgent.indexOf("MSIE")!=-1?"#444":"rgba(255,255,255,0.05)":"transparent","center"==stage_name&&c[d-1].caption?(document.getElementById("tumblr_lightbox_caption").innerHTML=c[d-1].caption,document.getElementById("tumblr_lightbox_caption").style.width=.7*t().width+"px",document.getElementById("tumblr_lightbox_caption").style.top=.5*parseInt(i.style.height,10)+"px",document.getElementById("tumblr_lightbox_caption").style.left=0-.35*t().width+"px",document.getElementById("tumblr_lightbox_caption").style.display="block"):"center"==stage_name&&(document.getElementById("tumblr_lightbox_caption").style.display="none")}else i.style.display="none"}}}function r(){return!!document.getElementById("tumblr_lightbox")}var a=!1,l=!1,h=!1,c=[],_=!1,d=!1,u=!1,p=!1,g={left:!1,center:!1,right:!1};return Tumblr.Events&&Tumblr.Events.on("lightbox-open-request",e),{init:e,isOpen:r}}(),/*! scripts/tumblelog/iframe_preloader.js */ Tumblr.IframePreloader=function(t){for(var e in t)if("object"==typeof e)for(var i in e)this.options[e][i]=e[i];else this.options[e]=t[e];this.__create()},Tumblr.IframePreloader.prototype={options:{iframe_src:"",iframe_before_onload:function(){},iframe_after_onload:function(){},iframe_class:"",iframe_styles:{zIndex:8675309,position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",width:"100%",height:"100%",background:"transparent",border:"0px",overflow:"hidden"},preloader_class:"",preloader_innerHTML:'
',preloader_styles:{zIndex:8675310,position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",width:"100%",height:"100%",overflow:"hidden",background:"rgba(17,17,17,0.92)"},close_class:"",close_innerHTML:"×",close_styles:{zIndex:8675311,position:"fixed",top:"10px",right:"15px",cursor:"pointer",font:"bold 20px Helvetica, sans-serif"}},iframe_loaded:!1,__create:function(){this.id=Math.random().toString().split(".")[1],this.$container=document.createElement("div"),this.$preloader=document.createElement("div"),this.$preloader.id="iframe_preloader-preloader-"+this.id,this.$preloader.className=this.options.preloader_class;for(var t in this.options.preloader_styles)this.$preloader.style[t]=this.options.preloader_styles[t];this.$preloader.innerHTML=this.options.preloader_innerHTML,this.$iframe=document.createElement("iframe"),this.$iframe.id="iframe_preloader-iframe-"+this.id,this.$iframe.className=this.options.iframe_class;for(var e in this.options.iframe_styles)this.$iframe.style[e]=this.options.iframe_styles[e];this.$iframe.src=this.options.iframe_src,this.$iframe.scrolling="no",this.$iframe.frameborder="0",this.$close=document.createElement("div"),this.$close.id="iframe_preloader-close-"+this.id,this.$close.className=this.options.close_class;for(var i in this.options.close_styles)this.$close.style[i]=this.options.close_styles[i];this.$close.innerHTML=this.options.close_innerHTML;var o=this;this.$close.onclick=function(){"undefined"!=typeof pano_iframe_preloader&&pano_iframe_preloader&&pano_iframe_preloader.remove()},this.$iframe.onload=function(){o.options.iframe_before_onload(),o.iframe_loaded=!0,o.show(),o.$close.style.display="none",o.options.iframe_after_onload()},this.hide_iframe(),this.lock_body(),this.$container.appendChild(this.$preloader),this.$container.appendChild(this.$iframe),this.$container.appendChild(this.$close),document.body.appendChild(this.$container)},hide:function(){this.hide_iframe(),this.hide_preloader(),this.unlock_body()},show:function(){this.iframe_loaded?(this.show_iframe(),this.hide_preloader()):(this.hide_iframe(),this.show_preloader()),this.lock_body()},remove:function(){this.hide(),document.body.removeChild(this.$container),delete this.$container,delete this.$preloader,delete this.$iframe},lock_body:function(){document.body.style.overflow="hidden"},unlock_body:function(){document.body.style.overflow=""},show_preloader:function(){this.window.focus(),this.$preloader.style.display="block"},hide_preloader:function(){this.$preloader.style.display="none"},show_iframe:function(){this.$iframe.contentWindow.focus(),this.$iframe.style.opacity=1},hide_iframe:function(){this.$iframe.style.opacity=0}};var pano_iframe_preloader=!1;Tumblr.PanoLightboxInit=function(t,e){return!!(!t&&window.event&&(window.event.metaKey||window.event.altKey)||t&&(t.metaKey||t.altKey))||(pano_iframe_preloader=new Tumblr.IframePreloader({iframe_src:e}),!1)},/*! scripts/tumblelog/like_button.js */ "Tumblr"in window||(window.Tumblr={}),function(){var t;window.JSON&&window.JSON.stringify&&window.JSON.parse?t=window.JSON:_t&&(t=_t.getCleanObject("JSON")),Tumblr.LikeButtonUpdate=function(){return{post_message_event:function(t,e){if("tumblelog_like"===t[0]&&t[1]&&document.getElementById("like_button_"+t[1])){var i=document.getElementById("like_button_"+t[1]);"liked"===t[2]?Tumblr.addClass(i,"liked"):Tumblr.removeClass(i,"liked")}}}}(),Tumblr.LikeButton={loaded_iframes:{},like_statuses:{},get_status_by_page:function(e){var i=document.getElementById("tumblr_controls");if(i){var o="get_like_states;"+t.stringify({page:e});i.contentWindow.postMessage(o,"*")}},get_status_by_post_ids:function(e){var i=document.getElementById("tumblr_controls");if(i){var o="get_like_states;"+t.stringify({ids:e});i.contentWindow.postMessage(o,"*")}},post_message_event:function(e,i){if("like_state_update"===e[0]){var o=t.parse(e[1]);if(o.length)for(var s=0,n=o.length;s0&&Tumblr.LikeButton.get_status_by_post_ids(n)}}},like_iframe_loaded:function(e,i){if("like_iframe_load"===e[0]){var o=t.parse(e[1]);o.post_id&&(Tumblr.LikeButton.loaded_iframes[o.post_id]=1,Tumblr.LikeButton.check_like_status(o.post_id,!0))}},check_like_status:function(t,e){var i=Tumblr.LikeButton.like_statuses[t];if(i){var o={post_id:t,state:"liked"===i};Tumblr.LikeButton.update_like_state(o)}},queue_like_status:function(t){t.post_id&&(Tumblr.LikeButton.like_statuses[t.post_id]=t.state?"liked":"unliked")},update_like_state:function(e){if(e.post_id){var i=document.getElementById("like_iframe_"+e.post_id);i&&i.contentWindow.postMessage("state_update;"+t.stringify(e),"https://assets.tumblr.com")}}}}.call(this),/*! scripts/tumblelog/post_message_form_resize.js */ "Tumblr"in window||(window.Tumblr={}),Tumblr.TumblelogFormResize=function(){return{post_message_event:function(t,e){if("resize_tumblelog_form_iframe"===t[0]){var i=t[1],o=document.getElementById(i),s=parseInt(t[2],10);i&&(o.height=s)}}}}();/*! scripts/tumblelog/post_message_photoset_resize.js */ var Tumblr=window.Tumblr||{};Tumblr.PhotosetResize=function(){return{post_message_event:function(t,e){if("resize_photoset_iframe"===t[0]){var i=t[1],o=parseInt(t[2],10),s=document.getElementById("photoset_iframe_"+i);s&&(s.height=o)}}}}(),/*! scripts/tumblelog/feature_analytics.js */ "Tumblr"in window||(window.Tumblr={}),Tumblr.AnalyticsFeatureSupport=function(){return{post_message_event:function(t,e){if("openInMobileAppSuccess"===t[0]&&"function"==typeof open_in_mobile_app&&t[1]&&t[1].length){var i=parseInt(t[1],10);open_in_mobile_app(i)}}}}(),/*! scripts/tumblelog/feature_iframe.js */ Tumblr.IframeFeatureSupport=function(){function t(){var t,e=document.querySelector('meta[name="color:Tumblr Controls"]');e&&(t=e.getAttribute("content")),t||(t="default"),i.contentWindow.postMessage("color_match;"+t,o)}function e(t,e){var o;"string"==typeof t&&t.match(/\d+%/)||(t=parseInt(t,10)||0),"string"==typeof e&&e.match(/\d+%/)||(e=parseInt(e,10)||0),Tumblr.addClass(i,"visible"),t&&(i.width=t,o=/%/.test(t)?"":"px",n.set("#tumblr_controls","width",t+o)),e&&(i.height=e,o=/%/.test(e)?"":"px",n.set("#tumblr_controls","height",e+o))}var i,o,s,n=new Tumblr.Styler({id:"tumblr_iframe_css",styles:{".tumblr_controls":{position:"absolute",top:"0",right:"0",display:"block",opacity:"1",width:"1px",height:"1px","z-index":"2147483647",visibility:"hidden","pointer-events":"none"},".tumblr_controls.visible":{visibility:"visible","pointer-events":"all"},".tumblr_controls.sticky":{position:"fixed"},".tumblr_controls.transition":{"-webkit-transition":"top 0.1s ease","-moz-transition":"top 0.1s ease","-ms-transition":"top 0.1s ease","-o-transition":"top 0.1s ease",transition:"top 0.1s ease"},"iframe#tumblr_controls.tumblr_controls.sticky.transition":{"-webkit-animation":"tumblr_controls_fade_in 0.3s 0.2s linear 1 both","-moz-animation":"tumblr_controls_fade_in 0.3s 0.2s linear 1 both","-ms-animation":"tumblr_controls_fade_in 0.3s 0.2s linear 1 both","-o-animation":"tumblr_controls_fade_in 0.3s 0.2s linear 1 both",animation:"tumblr_controls_fade_in 0.3s 0.2s linear 1 both",top:"0 !important"},".tumblr_controls.sticky.transition":{"-webkit-animation":"tumblr_controls_fade_in 0.3s 0.2s linear 1 both","-moz-animation":"tumblr_controls_fade_in 0.3s 0.2s linear 1 both","-ms-animation":"tumblr_controls_fade_in 0.3s 0.2s linear 1 both","-o-animation":"tumblr_controls_fade_in 0.3s 0.2s linear 1 both",animation:"tumblr_controls_fade_in 0.3s 0.2s linear 1 both",top:"0 !important"},".tumblr_controls.flash_fix":{visibility:"hidden !important"},"body.mobile_bar":{"-webkit-transition":"padding-top 0.1s ease","-moz-transition":"padding-top 0.1s ease","-ms-transition":"padding-top 0.1s ease","-o-transition":"padding-top 0.1s ease",transition:"padding-top 0.1s ease","padding-top":"44px"}},animations:{tumblr_controls_fade_in:{"0%":{opacity:0},"100%":{opacity:1}}}}),r=function(){function t(){window.addEventListener?window.addEventListener("scroll",i):window.attachEvent&&window.attachEvent("onscroll",i)}function e(){window.removeEventListener?window.removeEventListener("scroll",i):window.detachEvent&&window.detachEvent("onscroll",i)}function i(t){if(r)return void clearTimeout(l);for(var e=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop||0,o=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft||0,s=0;s=l+(h=a.clientHeight)&&s()}function s(){Tumblr.addClass(a,"sticky")}function n(){Tumblr.removeClass(a,"sticky")}var a,l=0,h=0,c=0;return window.addEventListener?window.addEventListener("DOMContentLoaded",e,!1):window.attachEvent&&window.attachEvent("onload",e),{stick:s,unstick:n,check:o}})(n);return{post_message_event:function(n,r){if(s=document.getElementById("mobile_iframe"),i=document.getElementById("tumblr_controls"),o=n[n.length-1],s)"show_mobile_banner"===n[0]&&("1"===n[1]?(Tumblr.MobileBanner.showBanner(),Tumblr.MobileBanner.mobile_origin=o):Tumblr.MobileBanner.showHeaderBanner());else if(i&&o){if("color_match"===n[0]&&t(),"location_change"===n[0]&&(Tumblr.addClass(i,"flash_fix"),document.getElementById("tumblr_controls").onload=function(){Tumblr.removeClass(i,"flash_fix")}),"request_keywords"===n[0]&&"undefined"!=typeof tumblr_meta_keyboards&&i.contentWindow.postMessage("keywords;"+tumblr_meta_keyboards,o),"teaser_iframe"===n[0]){if(n.length<2||!Tumblr.Teaser)return!1;switch(n[1]){case"initialize":return i.contentWindow.postMessage("teaser;enable",o),Tumblr.Teaser.initialize({slide_page:n.length>2&&"slide"===n[2]});case"load":return Tumblr.Teaser.load_once();case"open":return Tumblr.Teaser.open();case"close":return Tumblr.Teaser.close();case"toggle":return Tumblr.Teaser.toggle()}}if("tagged_teaser_iframe"===n[0]){if(n.length<2||!Tumblr.TaggedTeaser)return!1;switch(n[1]){case"show":return void Tumblr.TaggedTeaser.initialize({once:!0,open:!0});case"open":return Tumblr.TaggedTeaser.open(n.length>2&&n[2]);case"close":return Tumblr.TaggedTeaser.close();case"toggle":return Tumblr.TaggedTeaser.toggle()}}if("resize_iframe"===n[0]&&(e(n[1],n[2]),n.length>2))switch(n[3]){case"body_class":n.length>3&&n[4]&&Tumblr.addClass(document.body,n[4])}}}}}(),/*! scripts/tumblelog/feature_video.js */ Tumblr.VideoFeatureSupport=function(){function t(){if(document.getElementById("tumblr_video_iframe_fullscreen"))return!0;var t=document.createElement("style");t.id="tumblr_video_iframe_fullscreen",t.innerHTML=".tumblr_video_iframe.fullwindow { top: 0; bottom: 0; right: 0; left: 0; position: fixed; z-index: 8675309; height: 100%; width: 100%; }",document.body.appendChild(t)}function e(e){t(),e?n.iframe.className="tumblr_video_iframe fullwindow":n.iframe.className="tumblr_video_iframe"}function i(t){var e=document.getElementById("tumblr_controls");return t?(s(),n.parent_post&&(n.parent_post.className+=" is_lightbox"),document.body.className+=" is_lightbox",document.body.style.overflow="hidden",n.iframe.style.position="fixed",n.iframe.style.height="100%",n.iframe.style.width="100%",n.iframe.style.top=0,n.iframe.style.right=0,n.iframe.style.left=0,n.iframe.style.bottom=0,n.iframe.style.zIndex=90210,void(e&&(e.style.display="none"))):(n.parent_post&&(n.parent_post.className=n.parent_post.className.replace(/\s+is_lightbox/g,"")),document.body.className=document.body.className.replace(/\s+is_lightbox/g,""),document.body.style.overflow="visible",n.iframe.style.position="static",n.iframe.style.height="100%",n.iframe.style.width="100%",n.iframe.style.zIndex=0,void(e&&(e.style.display="block")))}function o(t){return t?(n.parent_post&&(n.parent_post.className+=" is_fullscreen"),void(document.body.className+=" is_fullscreen")):(n.parent_post&&(n.parent_post.className=n.parent_post.className.replace(/\s+is_fullscreen/g,"")),void(document.body.className=document.body.className.replace(/\s+is_fullscreen/g,"")))}function s(){if(!n.setup_controls[n.id]){var t=document.querySelector("#post_"+n.id+" .tumblr_lightbox_controls .close_button");t&&t.addEventListener("click",function(t){return n.iframe.contentWindow.postMessage("exit_lightbox",n.origin_url),!1});var e=document.querySelector("#post_"+n.id+" .tumblr_lightbox_controls .like_button");e&&e.addEventListener("click",function(t){var e=this,i={id:e.getAttribute("data-post-id"),key:e.getAttribute("data-reblog_key")||e.getAttribute("data-reblog-key")};return Tumblr.hasClass(e,"already_like")?Tumblr.unlike(i,{success:function(){Tumblr.removeClass(e,"already_like")}}):Tumblr.like(i,{success:function(){Tumblr.addClass(e,"already_like")}}),!1}),n.setup_controls[n.id]=!0}}var n={setup_controls:{}};return{post_message_event:function(t,s){var r=t[2];n.iframe=document.getElementById("tumblr_video_iframe_"+r),n.iframe&&(n.id=r,n.origin_url=n.iframe.getAttribute("data-origin"),n.parent_post=document.getElementById("post_"+r),"lightbox"===t[0]&&i("true"===t[1]),"full_window"===t[0]&&e("true"===t[1]),"full_screen"===t[0]&&o("true"===t[1]))}}}(),/*! scripts/tumblelog/mobile_fullscreen_iframe.js */ "Tumblr"in window||(window.Tumblr={}),Tumblr.mobileFullscreenIframe={og_store:function(){this.og_body_position=document.body.style.position,this.og_body_overflow=document.body.style.overflow,this.og_html_bg=this.html_el.style.backgroundColor,this.win_height=window.innerHeight+"px"},set_frame_height:function(){this.win_height=window.innerHeight+"px",this.win_width=window.innerWidth+"px",this.frame.style.height=this.win_height,this.frame.style.minWidth=this.win_width},enable:function(t){this.frame=document.getElementById(t),this.frame&&(this.html_el=document.getElementsByTagName("html")[0],this.og_store(),this.orientation_height_change=this.set_frame_height.bind(this),window.addEventListener("orientationchange",this.orientation_height_change,!1),window.addEventListener("resize",this.orientation_height_change,!1),this.frame.className+=" is_lightbox",document.body.className+=" is_lightbox",document.body.style.position="relative",document.body.style.left="-99999px",document.body.style.overflow="hidden",this.html_el.style.backgroundColor="#000000",this.frame.style.cssText="position:fixed; overflow:hidden; width: 100%; top:0; left:0; right:0; bottom:0; z-index: 90210;",this.frame.style.height=this.win_height,document.getElementById("tumblr_controls")&&(document.getElementById("tumblr_controls").style.display="none"))},disable:function(t){this.frame=this.frame||document.getElementById(t),this.frame&&(this.frame.className=this.frame.className.replace(/\s+is_lightbox/,""),document.body.className=document.body.className.replace(/\s+is_lightbox/,""),document.body.style.overflow=this.og_body_overflow,document.body.style.position=this.og_body_position,this.html_el.style.backgroundColor=this.og_html_bg,this.frame.style.cssText="",document.getElementById("tumblr_controls")&&(document.getElementById("tumblr_controls").style.display="block"),window.removeEventListener("orientationchange",this.orientation_height_change,!1),window.removeEventListener("resize",this.orientation_height_change,!1))}},/*! scripts/tumblelog/post_message_listener.js */ "Tumblr"in window||(window.Tumblr={}),Tumblr.PostMessageListener=function(){return{initialize:function(t){t=t||function(){};var e=window.addEventListener?"addEventListener":"attachEvent",i=window[e],o="attachEvent"==e?"onmessage":"message";i(o,function(e){if("string"==typeof e.data){var i=e.data.split(";");t(i,e.origin)}},!1)}}}(),Tumblr.PostMessageListener.initialize(function(t,e){Tumblr.VideoFeatureSupport.post_message_event(t,e),Tumblr.IframeFeatureSupport.post_message_event(t,e),Tumblr.AnalyticsFeatureSupport.post_message_event(t,e),Tumblr.TumblelogFormResize.post_message_event(t,e),Tumblr.PhotosetResize.post_message_event(t,e),Tumblr.LikeButtonUpdate.post_message_event(t,e),Tumblr.LikeButton.logged_in_iframe_loaded(t,e),Tumblr.LikeButton.post_message_event(t,e),Tumblr.LikeButton.like_iframe_loaded(t,e)}),/*! scripts/application/glass.js */ function(t,e){var i=new(Backbone.View.extend({id:"glass_overlay",events:{click:"click"},locked:!1,visible:!1,initialize:function(){},render:function(){t(document.body).prepend(this.$el),this.rendered=!0,Tumblr.Events.on("DOMEventor:escape",_.bind(this.keydown,this))},click:function(){this.locked||this.hide()},keydown:function(t){this.locked||this.visible&&this.hide()},show:function(t,e){_.isObject(Tumblr.KeyCommands)&&!Tumblr.KeyCommands.suspended&&(Tumblr.KeyCommands.suspend(),this.glass_suspended_keys=!0),this.rendered||this.render(),e=e||"",this.on_close=t||function(){},this.visible=!0,Tumblr.Events.trigger("Glass:show",this),this.$el.addClass("show"),setTimeout(_.bind(function(){this.$el.addClass(e)},this),0)},hide:function(){this.visible=!1,Tumblr.Events.trigger("Glass:hide",this),this.$el.removeClass("show"),this.on_close(),this.glass_suspended_keys&&(_.isObject(Tumblr.KeyCommands)&&Tumblr.KeyCommands.resume(),this.glass_suspended_keys=!1)},lock:function(){this.locked=!0},unlock:function(){this.locked=!1}}));e.Glass=i}(jQuery,Tumblr),/*! scripts/application/cookie.js */ function(t){var e={get:function(t){return new RegExp(t+"=([^;]+)").test(unescape(document.cookie))?RegExp.$1:null},set:function(t,e,i,o){o=o||{};var s=new Date,n=o.path?o.path:"/",r=!!o.is_secure,a=o.domain?o.domain:"";s.setTime(s.getTime()+1e3*i),document.cookie=t+"="+escape(e)+(null==i?"":";expires="+s.toGMTString())+";path="+n+(r===!1?"":";secure")+(""===a?"":";domain="+a)},unset:function(t){e.set(t,"",-1)}};t.Cookie=e}(Tumblr),/*! scripts/application/document_width_cookie.js */ function(t,e,i,o){o.documentWidth=function(e){e||(e=t(document).width()),Tumblr.Cookie.set("documentWidth",e,86400)}}(jQuery,Backbone,_,Tumblr),/*! scripts/application/device_pixel_ratio.js */ function(t,e,i,o){o.devicePixelRatio=function(){Tumblr.Cookie.set("devicePixelRatio",window.devicePixelRatio,86400)}}(jQuery,Backbone,_,Tumblr),/*! scripts/application/popover.js */ function(t,e){"use strict";var i=Backbone.View.extend({events:{click:"click"},initialize:function(e){this.button=t(e.el||this.$el),this.popover=e.popover||this.$el.find(".popover"),this.on_hide=e.on_hide||function(){},this.on_show=e.on_show||function(){},this.auto_show=e.auto_show||!1,this.prevent_default_click=e.prevent_default_click||!1,this.auto_show&&this.show(),i.register(this)},click:function(t){this.prevent_default_click&&t.preventDefault(),this.toggle()},is_showing:!1,show:function(){Tumblr.Glass.show(_.bind(function(){this.hide(),this.on_hide()},this)),this.popover.show(),this.on_show(),this.is_showing=!0},hide:function(){this.is_showing&&(Tumblr.Glass.on_close=_.bind(function(){this.is_showing&&(this.popover.hide(),this.on_hide())},this),Tumblr.Glass.hide(),this.is_showing=!1)},toggle:function(){return this.is_showing?this.hide():this.show()}});i.instances=[],i.register=function(t){this.instances.push(t)},i.hide_all=function(){for(var t=0;ts&&i.bottomr-s&&this.$scroll.css("height",r-s),o=this.$container.outerHeight(!0),e=this.$container.offset().top-t(window).scrollTop(),i=parseInt(this.$container.css("top"),10),e<30?(i-=e-30,this.$container.css("top",i<23?i:23)):e+o>r-30&&(i-=e+o-r+50,this.$container.css("top",i>-(o-80)?i:-(o-68))),this.scrollbar&&this.scrollbar.update()}}})}(jQuery,Backbone,_,Tumblr),/*! scripts/application/popover_legal.js */ function(t,e,i,o){"use strict";o.LegalPopover=e.View.extend({initialize:function(){this.$el.length&&(this.popover=new Tumblr.Popover({el:this.$el,glassless:!0,glassless_options:{prevent_clicks:!0},on_show:i.bind(function(){this.$el.addClass("show"),this.$el.closest("#sidebar_footer_nav").addClass("show_popover"),this.close_on_scroll()},this),on_hide:i.bind(function(){this.$el.removeClass("show"),this.$el.closest("#sidebar_footer_nav").removeClass("show_popover")},this)}),this.popover_button=this.$el.find(".popover_legal_link"),this.popover_button.on("click",i.bind(function(){return this.popover.show(),!1},this)),this.update_position())},update_position:function(){var t=Math.floor(this.popover.popover.outerWidth()/2);this.popover.popover.css({marginLeft:-t+"px"})},close_on_scroll:function(){t(window).on("scroll.legalpopover",i.bind(function(){this.popover.hide(),t(window).off("scroll.legalpopover")},this))}})}(jQuery,Backbone,_,Tumblr),/*! scripts/application/popover_search_base.js */ function(t,e,i,o){"use strict";o.BaseSearchPopover=e.View.extend({el:"#user_tools",initialize:function(e){this.options=e||{},this.popover_selector=this.options.popover_selector||"#popover_tracked_tags",this.$search_field=this.$("#search_field"),this.$search_form=this.$("#search_form"),this.$search_query=this.$("#search_query"),this.$popover=this.$(this.popover_selector),this.$tracked_tags=this.$(this.popover_selector+" .tracked_tags"),this.winRect=Tumblr.Prima.DOMEventor.rect(),this.popover=new Tumblr.Popover({el:this.$search_query,glassless:!0,glassless_options:{click_root:this.$search_field,prevent_clicks:!0},left:this.$search_field.position().left+2,skip_offset:!0,popover:this.$popover,disable_auto_show:!0,on_show:i.bind(function(){this.bind_key_nav(),this.resize_view(),this.init_scroll()},this),on_hide:i.bind(function(){t("#unread_tag_notice").show(),t("#search_query").addClass("with_unread"),t(".ui_search").removeClass("active"),this.$search_field.removeClass("active"),this.unbind_key_nav(),this.destroy_scroll()},this)}),this.cached_popover_height=this.popover.popover.height(),this.$scrollable_container=this.$el.find(".popover_scroll"),this.scrollbar=null,this.setup_autocomplete(),this.keyevents={bind_key_down:i.bind(this.keydown,this),bind_key_up:i.bind(this.keyup,this)},Tumblr.Events.on("DOMEventor:flatresize",i.debounce(this.resize_view,300).bind(this)),Tumblr.Events.on("SearchPopover:update",i.debounce(this.on_update,300).bind(this))},init_scroll:function(){this.scrollbar||(this.scrollbar=new Tumblr.Prima.Scrollbar(this.$scrollable_container))},destroy_scroll:function(){this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null)},resize_view:function(){var t={},e=this.popover.popover;this.cached_popover_height+e.position().top>this.winRect.windowHeight?e.height()+e.position().top>this.winRect.windowHeight-200&&(t={"max-height":this.winRect.windowHeight-200+"px","overflow-y":"auto"},this.$scrollable_container.css(t)):(t={"max-height":"auto",overflow:"visible"},this.$scrollable_container.css(t))},on_update:function(){this.$scrollable_container.css({"max-height":"auto",overflow:"visible"}),this.cached_popover_height=this.popover.popover.height(),this.resize_view()},setup_autocomplete:function(){},focus_search_query:function(){},mouseenter:function(){this.in_popover(this.in_focus())&&this.in_focus().blur()},has_children:function(t){return!!t&&t.children().length>0},click_popover:function(t){},bind_key_nav:function(){t(document).off("keydown",this.keyevents.bind_key_down),t(document).off("keyup",this.keyevents.bind_key_up),t(document).on("keydown",this.keyevents.bind_key_down),t(document).on("keyup",this.keyevents.bind_key_up)},unbind_key_nav:function(){t(document).off("keyup",this.keyevents.bind_key_up),t(document).off("keydown",this.keyevents.bind_key_down)},next:function(){this.$search_query.blur(),this.currentIndex++,this.set_active("next")},previous:function(){this.$search_query.blur(),this.currentIndex--,this.set_active("previous")},set_active:function(t){},in_focus:function(){return t(document.activeElement)},contains:function(t){return!(!this.in_popover(t)&&!this.$search_query.is(t))},in_popover:function(t){return this.$popover.has(t).length},keyup:function(t){9===t.keyCode&&(this.contains(this.in_focus())||(this.popover.hide(),this.unbind_key_nav()))},keydown:function(t){switch(t.keyCode){case 27:return void this.$search_query.blur();case 38:t.preventDefault(),this.previous();break;case 40:t.preventDefault(),this.next()}},submit:function(){return""!==t.trim(this.$search_query.val())}})}(jQuery,Backbone,_,Tumblr),/*! scripts/css_webfonts.js */ function(t){t.webfonts={"1785 GLC Baskerville":{display_name:"1785 Baskerville",family:"'1785 GLC Baskerville', serif",path:"1785glcbaskerville",_v:"1"},"Alternate Gothic":{display_name:"Alternate Gothic",family:"'Alternate Gothic', sans-serif",path:"alternategothic",_v:"3"},Arquitecta:{display_name:"Arquitecta",family:"'Arquitecta', sans-serif",path:"arquitecta",_v:"3"},Avalon:{display_name:"Avalon",family:"'Avalon', sans-serif",path:"avalon",_v:"1"},Baskerville:{display_name:"Baskerville",family:"Baskerville, 'Times New Roman', Times, serif"},"Bodoni Recut FS":{display_name:"Bodoni",family:"'Bodoni Recut FS', serif",path:"bodonirecutfs",_v:"3"},Bookmania:{display_name:"Bookmania",family:"'Bookmania', serif",path:"bookmania",_v:"1"},"Brutal Type":{display_name:"Brutal Type",family:"'Brutal Type', sans-serif",path:"brutaltype",_v:"1"},Calluna:{display_name:"Calluna",family:"'Calluna', serif",path:"calluna",_v:"3"},"Calluna Sans":{display_name:"Calluna Sans",family:"'Calluna Sans', sans-serif",path:"callunasans",_v:"3"},Capita:{display_name:"Capita",family:"'Capita', serif",path:"capita",_v:"1"},"Caslon FS":{display_name:"Caslon FS",family:"'Caslon FS', serif",path:"caslonfs",_v:"3"},"Clarendon Text Pro":{display_name:"Clarendon",family:"'Clarendon Text Pro', serif",path:"clarendontextpro",_v:"3"},"Clearface FS":{display_name:"Clearface",family:"'Clearface FS', serif",path:"clearface",_v:"4"},"Courier New":{display_name:"Courier New",family:"'Courier New', Courier, monospace"},Favorit:{display_name:"Favorit",family:"'Favorit', sans-serif",path:"favorit",_v:"1"},Futura:{display_name:"Futura",family:"Futura, 'Century Gothic', AppleGothic, sans-serif"},"Garamond Classic FS":{display_name:"Garamond",family:"'Garamond Classic FS', serif",path:"garamondclassicfs",_v:"3"},Georgia:{display_name:"Georgia",family:"Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif"},Gibson:{display_name:"Gibson",family:"'Gibson', sans-serif",path:"gibson",_v:"3"},"Grumpy Black 48":{display_name:"Grumpy",family:"'Grumpy Black 48', serif",path:"grumpyblack48",_v:"3"},"Helvetica Neue":{display_name:"Helvetica",family:"'Helvetica Neue', Arial, Helvetica, sans-serif"},"Lorimer No 2":{display_name:"Lorimer No 2",family:"'Lorimer No 2', sans-serif",path:"lorimerno2",_v:"3"},"Lucida Sans":{display_name:"Lucida Sans",family:"'Lucida Sans', 'Lucida Grande', 'Lucida Sans Unicode', sans-serif"},"News Gothic FS":{display_name:"News Gothic",family:"'News Gothic FS', sans-serif",path:"newsgothicfs",_v:"3"},"Pratt Pro":{display_name:"Pratt Pro",family:"'Pratt Pro', serif",path:"prattpro",_v:"1"},Quadrat:{display_name:"Quadrat",family:"'Quadrat', serif",path:"quadrat",_v:"1"},"Sofia Pro":{display_name:"Sofia Pro",family:"'Sofia Pro', sans-serif",path:"sofiapro",_v:"2"},Spade:{display_name:"Spade",family:"'Spade', serif",path:"spade",_v:"1"},"Square Serif":{display_name:"Square Serif",family:"'Square Serif', serif",path:"squareserif",_v:"4"},Streetscript:{display_name:"Streetscript",family:"'Streetscript', sans-serif",path:"streetscript",_v:"1"},"Typewriter FS":{display_name:"Typewriter",family:"'Typewriter FS', serif",path:"typewriterfs",_v:"1"},Verdana:{display_name:"Verdana",family:"Verdana, Geneva, Tahoma, sans-serif"},Ziclets:{display_name:"Ziclets",family:"'Ziclets', serif",path:"ziclets",_v:"1"}}}(Tumblr),/*! scripts/color_utilities.js */ function(t,e,i){var o={rgb_to_hex:function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},hex_to_rgb:function(t){t=new String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},rgb_to_hsv:function(t,e,i){var o=Math.min(Math.min(t,e),i),s=Math.max(Math.max(t,e),i),n=s-o,r={h:6,s:s?(s-o)/s:0,v:s/255};return n?s===t?r.h+=(e-i)/n:s===e?r.h+=2+(i-t)/n:r.h+=4+(t-e)/n:r.h=0,r.h=60*r.h%360,r},hsv_to_rgb:function(t,e,i){var o,s,n;if(e){o=s=n=0;var r=(t+360)%360/60,a=i*e,l=i-a,h=a*(1-Math.abs(r%2-1));r<1?(o=a,s=h):r<2?(o=h,s=a):r<3?(s=a,n=h):r<4?(s=h,n=a):r<5?(n=a,o=h):(n=h,o=a),o+=l,s+=l,n+=l}else o=s=n=i;return{r:Math.round(255*o),g:Math.round(255*s),b:Math.round(255*n)}},hex_to_hsv:function(t){t=new String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var o=i.ColorUtilities.hex_to_rgb(t),s=i.ColorUtilities.rgb_to_hsv.apply(i.ColorUtilities,e.toArray(o));return s},hsv_to_hex:function(t,o,s){var n=i.ColorUtilities.hsv_to_rgb(t,o,s),r=i.ColorUtilities.rgb_to_hex.apply(i.ColorUtilities,e.toArray(n));return r},hex_brightness:function(t,e){t=String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),e=e||0;var i,o,s,n=parseInt(t,16),r=e<0?0:255,a=e<0?-e:e,l=n>>16,h=n>>8&255,c=255&n;return i=Math.round((r-l)*a)+l,o=Math.round((r-h)*a)+h,s=Math.round((r-c)*a)+c,"#"+(16777216+65536*i+256*o+s).toString(16).slice(1)},hsv_to_readable:function(t){return"string"==typeof t&&(t=i.ColorUtilities.hex_to_hsv(t)),t.s<.2&&t.v>.8?"#444":"#FFF"},compare_colors:function(t,i,o){var s={upper_bound:.8,lower_bound:.2,diff_bound:.1,hue_bound:15};e.extend(s,o);var n=s.upper_bound,r=s.lower_bound,a=s.diff_bound,l=s.hue_bound,h=Math.abs(t.h-i.h),c=Math.abs(t.s-i.s),_=Math.abs(t.v-i.v);return h<=a&&c<=a&&_<=a||c<=a&&_<=a&&(c>=n||c<=r&&_>=n||_<=r&&h<=l)}};i.ColorUtilities=o}(jQuery,_,Tumblr),/*! scripts/indash_blog/views/header/popover.js */ Tumblr.IndashBlog||(Tumblr.IndashBlog={}),Tumblr.IndashBlog.Header||(Tumblr.IndashBlog.Header={}),function(t,e,i,o){var s=i.View.extend({className:"indash_header_popover",defaults:{direction:"left",edit_field:null,template:!1,template_data:{},trigger:null,glassless:!0},__close:function(){this.hide()},initialize:function(i){this.options=e.extend({},this.defaults,i),this.template=this.options.template,this.template_data=this.options.template_data,this.checkbox_template=e.template(t("#tumblelog_header_checkbox_template").html()),this.color_picker_template=e.template(t("#tumblelog_header_color_picker_template").html()),this.is_showing=!1,this.$popover=null,this.popover_view=null,o.Popover.register(this)},render:function(){var i=this.template(this.template_data);return this.$popover=t(i).appendTo(this.$el).hide(),this.popover_view=new Tumblr.Popover({el:this.options.trigger,popover:this.$popover,glassless:this.options.glassless,glassless_options:this.options.glassless_options,auto_show:!1,direction:this.options.direction,skip_offset:!0,on_show:e.bind(function(){this.is_showing||(Tumblr.Events.trigger("indashblog:popover:show",this,this.options.edit_field),this.is_showing=!0)},this),on_hide:e.bind(function(){this.is_showing&&(Tumblr.Events.trigger("indashblog:popover:hide",this,this.options.edit_field),this.is_showing=!1)},this)}),this},show:function(){this.popover_view.show()},hide:function(){this.is_showing&&(Tumblr.Events.trigger("indashblog:popover:hide",this,this.options.edit_field),this.is_showing=!1,this.popover_view.hide())}});s.instances=[],s.register=function(t){this.instances.push(t)},s.hide_all=function(){for(var t=0,e=this.instances.length;t",{id:s,rel:"stylesheet",type:"text/css",href:n}).appendTo(t("head"))}}}},__log_recommendation_dismissal:function(){t.ajax({method:"POST",url:"/svc/search/log_dismissal",data:{tumblelog_name:this.model.get("name")},withFormKey:!0})},__addSnowMan:function(){var t={el:this.$("[data-snowman-container]"),tumblelogName:this.model.get("name")};Tumblr.Flags.bool("is_logged_in")&&this.options.include_info_popover&&(t.infoPopover={el:this.$el,auto_show:!1,trigger:this.$el.find(".info_popover_button"),useRecipient:!0,showAsks:!0,showAnonymousAsks:!0,skip_glass:!0,targetPost:this.targetPost||this.$el,show_flag_button:!Tumblr.IndashBlog.is_peepr}),this.snowman=new Tumblr.Prima.Snowman(t)},initialize:function(i){if(this.options=e.extend({},this.defaults,i),this.hide_posts_on_unfollow=this.options.hide_posts_on_unfollow,this.current_data=this.options.current_data,this.on_render=this.options.on_render,this.targetPost=this.options.targetPost,this.is_rendered=!1,this.assets_host=Tumblr.Prima.Lib.hosts.get("assets")||"",this.template=e.template(t("#tumblelog_header_template").html()),this.$description=null,this.$description_inner=null,this.listenTo(this.model,"add:global_theme_params",this.render),this.listenTo(this.model,"change:global_theme_params",this.render),this.listenTo(this.model,"change:following",this._render_follow_button),!e.isEmpty(this.current_data)){var o=e.extend({},this.current_data,this.model.toJSON());this.model.set(o,{silent:!0})}},render:function(){var t=this.model.toJSON();if(t.following||(t.following=!1),this.is_rendered||!t.global_theme_params)return this;var i=e.result(Tumblr.webfonts,t.global_theme_params.title_font),o=Tumblr.ColorUtilities.hex_to_rgb(t.global_theme_params.title_color);return this.$el.html(this.template(e.merge({},t,{hide_headers_flag:Tumblr.Flags.bool("hide_default_headers_blog_cards"),show_navigation:!0,show_share_controls:!1,show_user_controls:!0,show_follow_button:!0,show_dismiss_controls:!1,title_font_family:!!i&&i.family,title_color_rgb:String(e.values(o).join(",")),is_verified:!1},this.options.template_data))),this.$description=this.$(".description"),this.$description_inner=this.$(".description .description_inner"),this._render_font_styles(),this._render_inline_styles(),this.__addSnowMan(),this.is_rendered=!0,this.on_render(),this.$description.length&&(e.delay(e.bind(this.truncate_description,this),100),this.options.strip_description_line_breaks&&this.strip_description_line_breaks()),this.pixelateAndShowAvatars(),this},pixelateAndShowAvatars:function(){s.drawPixelatedImages(this),this.$el.find(".pixelated-avatar").removeClass("hide").addClass("show")},strip_description_line_breaks:function(){this.$description_inner.find("br").remove();var t=this.$description_inner.html(),e=t.replace(/[\n\r]/g," ");this.$description_inner.html(e)},destroy:function(){this.$el.fadeOut(500,e.bind(function(){this.unbind(),this.$el.parent().hasClass("post_container")&&this.$el.parent().remove(),this.__log_recommendation_dismissal(),Events.trigger("DOMEventor:updateRect"),Events.trigger("posts:destroyed",this.$el),this.remove()},this))},truncate_description:function(){var t=this.$description_inner.get(0);if(!(t.scrollHeight<=t.clientHeight)){var i=this.model.get("global_theme_params"),o=i.background_color,s=Tumblr.ColorUtilities.hex_to_rgb(o);this.$description.append(this.description_gradient_template({background_color:String(e.values(s).join(","))}))}},description_gradient_template:e.template('
')});o.HeaderCompact=n}(jQuery,_,Backbone,Tumblr.IndashBlog),/*! scripts/tumblelog_popover/views/tumblelog_popover.js */ function(t,e,i,o){var s=i.View.extend({el:"body",initialize:function(i){if(o.Flags.bool("indash_blogs")!==!1){this.options=i||{},this.popover_template=e.template(t.trim(this.options.template||t("#tumblelog_popover_template").html())),this.cache_timeout=this.options.cache_timeout||36e5,this.mention_hostname=this.options.mention_hostname||"tmblr.co",this.hide_posts_on_unfollow=this.options.hide_posts_on_unfollow||!1,this.$popover=null,this.popover=null,this.subviews={},this.current_target=null,this.current_data={},this.current_tumblelog="",this.current_post={},this.current_mouse_x=0,this.model={},this.hide_timeout=null,this.queued_event=null,this.hover_bounds={},this.target_bounds={},this.is_open=!1,this.is_user_mention=!1,this.is_mobile=!!("ontouchstart"in document.documentElement),this.is_poptica=!0,this.is_menu_open=!1,this.session_storage_key=this.is_poptica?"optica_header":"tumblelog_popover",this.listenTo(o.Events,"TumblelogPopover:follow",this.on_follow),this.listenTo(o.Events,"TumblelogPopover:follow_hover",this.on_follow_hover),this.listenTo(o.Events,"TumblelogPopover:unfollow",this.on_unfollow),this.listenTo(o.Events,"TumblelogPopover:inserted_posts",this.set_hover_bounds),this.listenTo(o.Events,"TumblelogPopover:track_engagement",this.track_engagement),this.listenTo(o.Events,"TumblelogPopover:toggle_navigation_menu",this.on_toggle_navigation_menu),this.listenTo(o.Events,"TumblelogPopover:navigation_menu_item_clicked",this.on_navigation_menu_item_clicked),this.listenTo(o.Events,"peepr:open",this.on_peepr_open),this.listenTo(o.Events,"peepr-open-request",this.hide),this.listenTo(o.Events,"Dashboard:hide_posts_on_unfollow",this.set_hide_posts_on_unfollow),o.Events.trigger("Dashboard:should_hide_posts_on_unfollow");var s=['a.post_avatar_link:not(".animating")','a.post_sub_avatar:not(".animating")',"a.reblog-avatar",'.post_info_link:not(".reblog_follow_button,.blogless-advertiser")',".asker .name",".post .avatar a",'.post_content .post_content_inner a[href*=".tumblr.com"]:not(".tmblr-truncated-link")','.post_content .post_content_inner a[href*="tmblr.co"]',".follower .avatar",".follower .name-link",".crushes .crush",".notification .username",".notification .avatar_frame",".notification .preview_frame",".ui_tops .tops_fans .ui_jumbo_avatar",".ui_avatar a",".user_list .follow_list_item_blog",".post .tumblr_blog","a.radar_avatar","#dashboard_controls_open_blog .open_blog_link",".members_list .member_avatar",".members_list .member_name",".posts_view_masonry a.tumblelog_info",".js-hover-trigger-TumblelogPopover"],n=t(s.join(","));if(this.is_mobile){var r=n.find("a[data-tumblelog-popover]");r.addClass("no_pop"),r.on("touchend",e.bind(this.on_touch_open,this))}else this.$el.hoverIntent({selector:s.join(","),over:e.bind(this.on_mouseover,this),out:t.noop});if(window.sessionStorage)try{this.sync_storage()}catch(a){}}},sync_storage:function(){o.Utils&&o.Utils.popover&&(o.Utils.popover.get_session_storage(this.session_storage_key,this.cache_timeout),t(window).on("beforeunload",e.bind(function(){o.Utils.popover.sync_session_storage(this.session_storage_key)},this)))},update_current_data:function(){this.current_data=this.model.toJSON()},show:function(){var i,s=!0,n=t(this.current_target),r=o.Utils.popover.cache?o.Utils.popover.cache[this.current_tumblelog]:null;r&&r.data&&(i=e.isObject(r.data)?r.data:JSON.parse(r.data),e.size(i)>1&&(this.current_data=i)),this.$popover=t(this.popover_template({is_poptica:this.is_poptica||!1,context_path:this.context_path})),this.$popover.appendTo(this.$el).hide(),this.popover=new o.Popover({button:n,popover:this.$popover,skip_glass:!0}),e.isEmpty(this.current_data)||(this.popover.show(),s=!1),this.targetPost=n.closest(".post"),this.is_poptica?(this.subviews.poptica_header=new o.TumblelogPopover.PopticaHeader({model:this.model,popover:this.$popover,current_data:this.current_data,tumblelog:this.current_tumblelog,hide_posts_on_unfollow:this.hide_posts_on_unfollow,on_render:e.bind(this.position,this),targetPost:this.targetPost}),this.$popover.find(".popover_inner").prepend(this.subviews.poptica_header.render().el),(n.hasClass("post_avatar_link")||n.hasClass("post_sub_avatar"))&&this.$popover.addClass("avatar_hover")):this.subviews.tumblelog_info=new o.TumblelogPopover.Info({model:this.model,popover:this.$popover,tumblelog:this.current_tumblelog,post:this.current_post,current_data:this.current_data,on_close:e.bind(this.animate_out,this),hide_posts_on_unfollow:this.hide_posts_on_unfollow,is_user_mention:this.is_user_mention}),this.context_path&&this.$popover.find("[data-context-path]").each(e.partial(function(e){var i=t(this);i.attr("data-context-path",e+"/"+i.attr("data-context-path"))},this.context_path)),this.subviews.highlighted_posts=new o.TumblelogPopover.Posts({model:this.model,post:this.current_post,popover:this.$popover,parent:this.$popover.find(".popover_inner").first(),on_bottom:this.is_poptica}),s!==!1||e.isEmpty(this.current_data)||this.popover.show(),this.position(),this.animate_in(),this.is_open=!0,this.bind_events(),this.log_impression(r),o.Events.trigger("TumblelogPopover:show",this.current_target)},hide:function(){this.$popover&&(this.$popover.remove(),this.$popover=null,o.Events.trigger("TumblelogPopover:hide",this.current_target)),t(".tumblelog_popover").length&&t(".tumblelog_popover").remove(),this.subviews.tumblelog_info&&this.subviews.tumblelog_info.close(),e.each(this.subviews,e.bind(function(t,e){t&&t.remove(),this.subviews[e]=null},this)),this.current_data={},this.current_tumblelog="",this.current_post={},this.is_open=!1,this.is_user_mention=!1;try{this.stopListening(this.model)}catch(i){}this.queued_event&&(this.on_mouseover(this.queued_event),this.queued_event=null)},animate_in:function(){this.hide_timeout&&(clearTimeout(this.hide_timeout),this.hide_timeout=null),this.$popover&&this.$popover.removeClass("is_closed").addClass("is_open")},animate_out:function(){this.hide_timeout&&(clearTimeout(this.hide_timeout),this.hide_timeout=null),this.$popover&&this.$popover.removeClass("is_open").addClass("is_closed");try{this.stopListening(this.model)}catch(t){}this.unbind_events(),this.hide_timeout=setTimeout(e.bind(this.hide,this),300)},position:function(){if(this.$popover&&this.current_target){this.$popover.show();var e=t(window),i=t(this.current_target),s=this.$popover.height(),n={};n.top=e.scrollTop(),n.left=e.scrollLeft(),n.bottom=n.top+e.height(),n.right=n.left+e.width();var r=i.offset().top-s,a=i.offset().top+i.height(),l=i.offset().left+.5*i.width();i.css("white-space","nowrap"),l=i.offset().top>top?this.current_mouse_x:l,i.css("white-space",""),this.$popover.removeClass("down up left right nipple_on_top nipple_on_bottom"),this.is_poptica?(this.$popover.addClass("down nipple_on_top"),this.$popover.css({left:l,top:a})):(this.$popover.addClass("up nipple_on_bottom"),this.$popover.css({left:l,top:r}));var h=o.Utils.popover.get_bounds(this.$popover),c=20,_=365;this.target_bounds=o.Utils.popover.get_bounds(i);var d=this.is_poptica?h.top+_:h.bottom;d>n.bottom-c&&(this.$popover.css("top",r),this.$popover.removeClass("down nipple_on_top").addClass("up nipple_on_bottom"),h=o.Utils.popover.get_bounds(this.$popover));var u=this.is_poptica?h.bottom-_:h.top;un.right-c&&(this.is_poptica&&this.$popover.css("left",n.right-c-this.$popover.width()),this.$popover.removeClass("right").addClass("left"),h=o.Utils.popover.get_bounds(this.$popover)),this.set_hover_bounds(h);var p=i.closest("[data-tumblelog-popover-zindex]");p.length>0&&this.$popover.css("z-index",p.attr("data-tumblelog-popover-zindex"))}},set_hover_bounds:function(t){t||(t=o.Utils.popover.get_bounds(this.$popover)),this.hover_bounds.left=Math.min(t.left,this.target_bounds.left),this.hover_bounds.top=Math.min(t.top,this.target_bounds.top),this.hover_bounds.right=Math.max(t.right,this.target_bounds.right),this.hover_bounds.bottom=Math.max(t.bottom,this.target_bounds.bottom)},bind_events:function(){this.is_mobile?t(document).on("touchstart.tumblelog_popover",e.bind(this.on_touch_close,this)):t(document).on("mousemove.tumblelog_popover",e.throttle(e.bind(this.on_mousemove,this),50))},unbind_events:function(){t(document).off(".tumblelog_popover")},set_hide_posts_on_unfollow:function(){this.hide_posts_on_unfollow=!0},on_mouseover:function(i){var s,n,r,a,l=t(i.currentTarget),h=l.attr("href"),c=!!l.attr("data-tumblelog-popover"),_=l.text().replace(/\s+/g," ").length>1,d=l.hasClass("post_avatar_link")||l.hasClass("reblog-avatar")||l.hasClass("post-avatar-link"),u=l.hasClass("post_sub_avatar");if(!l.hasClass("safemode")&&0===l.closest(".post").find(".safemode").length){this.current_mouse_x=i.clientX;var p=l.closest(".post").data("post-id")||l.closest(".radar").data("post-id")||"";if(this.current_post=o.Posts.get(p)||{},c||_||d||u){if(this.is_open)return void(i.currentTarget.href&&this.current_target.href!==i.currentTarget.href&&(this.queued_event=i,this.animate_out()));if(this.context_path=t(i.target).closest("[data-context-path]").data("context-path"),c)this.current_data=t.parseJSON(l.attr("data-tumblelog-popover")),this.current_tumblelog=this.current_data.name.toString();else if(l[0].hostname&&l[0].hostname===this.mention_hostname&&l[0].pathname.match(/^\/m/))s="/"===h.substr(-1)?h.substr(0,h.length-1):h,n=s.split("/"),this.is_user_mention=!0,this.current_tumblelog=n[n.length-1];else if(_||d||u){if(s=h.replace(/.*?:\/\//g,""),n=s.split("/"),n.length>1&&n[1].length&&"post"!==n[1])return;r=h.match(/([^\/\.]+\/\/)([^\/\.]+)(\..*)/i),a=r&&r[2],a&&(this.current_tumblelog=a.toLowerCase())}if(!e.isUndefined(this.current_tumblelog)){this.current_target=i.currentTarget;var g=this.is_user_mention?this.get_model_from_token():this.get_model_from_name();g.then(e.bind(function(t){this.model=t,this.listenTo(this.model,"change",this.update_current_data),this.show()},this))}}}},get_model_from_token:function(){return o.Prima.Models.Tumblelog.modelFromToken(this.current_tumblelog)},get_model_from_name:function(){var e=t.Deferred(),i=new o.Prima.Models.Tumblelog({name:this.current_tumblelog});return e.resolve(i),e.promise()},on_mousemove:function(i){if(!(this.is_menu_open||this.subviews.tumblelog_info&&this.subviews.tumblelog_info.is_disabled||!this.hover_bounds||e.isEmpty(this.hover_bounds))){var o=!(this.hover_bounds.left<=i.pageX&&i.pageX<=this.hover_bounds.right),s=!(this.hover_bounds.top<=i.pageY&&i.pageY<=this.hover_bounds.bottom),n=t(i.target).hasClass("icon_close");(o||s||n)&&this.animate_out()}},on_touch_open:function(t){t.preventDefault(),t.stopPropagation(),this.is_open?this.animate_out():this.on_mouseover(t)},on_touch_close:function(t){this.on_mousemove(t.originalEvent)},log_impression:function(t){o.Events.trigger("Capture:push","tumblelog_popover","impressions",{post_type:"highlighted",cached:!!t})},on_follow:function(){this.show_recommendations()},on_follow_hover:function(t){if(t){var e=!!t.get("following");e||this.setup_recommendations(t.get("name"))}},on_unfollow:function(){this.animate_out()},on_peepr_open:function(){e.delay(e.bind(this.hide,this),50)},setup_recommendations:function(t){this.subviews.recommended_blogs||(this.subviews.recommended_blogs=new o.TumblelogPopover.Recommendations({popover:this.$popover,followed_blog:t,recommendations_needed:this.is_poptica?4:3,is_poptica:this.is_poptica}))},should_show_recommendations:function(){return!(!e.isEmpty(this.current_post)&&this.current_post.get("sponsored")||!this.subviews.recommended_blogs||!this.subviews.recommended_blogs.has_recommendations||this.subviews.recommended_blogs.is_visible)},show_recommendations:function(){this.should_show_recommendations()&&this.subviews.recommended_blogs.render()},on_navigation_menu_item_clicked:function(){this.animate_out()},on_toggle_navigation_menu:function(t){this.is_menu_open=t||!1,this.$popover&&this.$popover.length&&this.$popover.toggleClass("nav_menu_open",this.is_menu_open),e.isEmpty(this.current_post)||o.Events.trigger("TumblelogPopover:click:menu",{model:this.current_post,loggingData:this.loggingData({userAction:"popover_menu"})})},track_engagement:function(t){if(o.Utils&&o.Utils.popover){var i=this.current_post;e.isEmpty(i)&&this.targetPost&&(i=o.Posts.get(this.targetPost.data("post-id"))),o.Utils.popover.track_premium_engagement(t,i)}}});o.Prima.Mixins.loggingData.applyTo(s.prototype),o.TumblelogPopover=s}(jQuery,_,Backbone,Tumblr),/*! scripts/tumblelog_popover/views/tumblelog_info.js */ function(t,e,i,o){var s=i.View.extend({className:"tumblelog_info",events:{"click .follow":"on_follow_click","mouseenter .follow":"on_follow_hover","click .unfollow":"on_follow_click","click .tumblelog_menu_btn":"on_menu_click","click .ask":"on_ask_click","click .fan_mail":"on_fan_mail_click","click .toggle_spam":"on_spam_click","click .toggle_suspended":"on_suspended_click","click .toggle_nsfw":"on_nsfw_click","click a.avatar":"on_avatar_click","click .name a":"on_blog_name_click",mouseenter:"on_mouseenter"},initialize:function(i){if(this.options=i||{},this.template=e.template(this.options.template||t("#tumblelog_popover_info").html()),this.$popover=this.options.popover||t(),this.$parent=this.options.parent||this.$popover.find(".popover_inner"),this.is_recommendation=this.options.is_recommendation===!0,this.recommendation_data=this.options.recommendation_data||{},this.on_close=this.options.on_close||t.noop,this.on_menu_toggle=this.options.on_menu_toggle||t.noop,this.min_load_time=this.options.min_load_time||500,this.current_data=this.options.current_data||{},this.hide_posts_on_unfollow=this.options.hide_posts_on_unfollow!==!1,this.is_user_mention=this.options.is_user_mention||!1,this.post=this.options.post||{},this.is_mobile=e.has(document.documentElement,"ontouchstart"),this.is_disabled=!1,this.is_menu_open=!1,this.xhr=null,this.model=this.options.model||new o.Prima.Models.Tumblelog({name:this.options.tumblelog}),this.listenTo(this.model,"add",this.render),this.listenTo(this.model,"change",this.render),!e.isEmpty(this.current_data)){var s=this.model.toJSON();e.extend(this.current_data,s),this.model.set(this.current_data,{silent:!0})}this.update_cache(),this.$el.addClass(this.model.get("name")),this.$parent.append(this.$el),this.render()},render:function(){var t=e.extend(this.model.toJSON(),{show_menu:!this.is_recommendation});return this.$el.html(this.template(t)),this.update_cache(),this},close:function(){this.on_close(),this.xhr&&(this.xhr.abort(),this.xhr=null),t(document).off(".tumblelog_popover_menu"),this.remove()},update_cache:function(){var t=this.model.toJSON(),e=this.model.get("name");o.Utils.popover.cache[e]={timestamp:(new Date).getTime(),data:JSON.stringify(t)}},open_dialog:function(i,o){o=o||t.noop,this.is_disabled=!0,i.fail(e.bind(function(){this.is_disabled=this.is_menu_open},this)),i.done(e.bind(function(){this.is_disabled=this.is_menu_open,o()},this))},hide_posts:function(){o.Posts.whereBy({tumblelog:this.model.get("name"),sponsored:!1}).invoke("dismiss"),this.close()},show_menu:function(){this.is_menu_open=!0,this.is_disabled=!0,this.$popover.addClass("admin_menu_open")},hide_menu:function(){this.is_menu_open=!1,this.is_disabled=!1,this.$popover.removeClass("admin_menu_open")},on_follow_click:function(i){if(i.preventDefault(),i.stopPropagation(),t(i.currentTarget).hasClass("unfollow"))if(this.is_recommendation)this.model.save_following({following:!1},{source:"UNFOLLOW_SOURCE_TUMBLELOG_POPOVER_RECOMMENDATIONS",from_popover:!0,placement_id:this.post instanceof o.Prima.Models.Post&&this.post.get("placement_id")||""});else{var s=o.TumblelogActions.confirm_unfollow({tumblelog:this.model.get("name"),avatar_url:this.model.get("avatar_url")||""});this.open_dialog(s,e.bind(function(){this.model.save_following({following:!1},{source:"UNFOLLOW_SOURCE_TUMBLELOG_POPOVER",from_popover:!0,placement_id:this.post instanceof o.Prima.Models.Post&&this.post.get("placement_id")||""}),this.hide_posts_on_unfollow&&this.hide_posts(),o.Utils.popover.track_premium_engagement("popover_unfollow",this.post)},this))}else{var n,r,a=this.is_recommendation?"FOLLOW_SOURCE_TUMBLELOG_POPOVER_RECOMMENDATIONS":"FOLLOW_SOURCE_TUMBLELOG_POPOVER";this.post instanceof o.Prima.Models.Post&&(r=this.post.get("placement_id"),n=this.post.get("pt")),this.model.save_following({following:!0},{source:a,from_popover:!0,placement_id:r,pt:n}),o.Utils.popover.track_premium_engagement("popover_follow",this.post),o.Events.trigger("TumblelogPopover:follow",this.model.get("name"))}},on_menu_click:function(i){i.preventDefault(),this.is_menu_open||(this.show_menu(),t(document).on("mouseup.tumblelog_popover_menu",e.bind(this.on_menu_mouseup,this))),o.Utils.popover.track_premium_engagement("popover_menu",this.post)},on_menu_mouseup:function(e){var i=o.Utils.popover.get_bounds(this.$popover.find(".tumblelog_menu_popover")),s=!(i.left<=e.pageX&&e.pageX<=i.right),n=!(i.top<=e.pageY&&e.pageY<=i.bottom);(s||n)&&(t(document).off(".tumblelog_popover_menu"),this.hide_menu())},on_ask_click:function(e){e.preventDefault();var i=t(e.currentTarget),s=i.attr("data-tumblelog-name"),n="1"===i.data("anonymous-ask");o.Events.trigger("ask:form:open",{recipient:s,allow_anonymous:n}),this.close()},on_fan_mail_click:function(t){if(e.isObject(o.FanMail)){var i={href:o.FanMail.make_url_from_tumblelog(this.model.get("name"))};t.preventDefault(),o.FanMail.show(i),this.close()}},on_spam_click:function(t){t.preventDefault();var i=this.model.toggle_spam();i.success(e.bind(function(t){this.model.set("spam",!!t.spammer)},this))},on_suspended_click:function(t){t.preventDefault();var i=this.model.toggle_suspended();i.success(e.bind(function(t){this.model.set("suspended",!!t.suspended)},this))},on_nsfw_click:function(t){t.preventDefault();var i=this.model.toggle_nsfw();i.success(e.bind(function(t){this.model.set("nsfw",t.nsfw)},this))},on_avatar_click:function(t){o.Utils.popover.capture_tumblelog_click(t),o.Utils.popover.track_premium_engagement("popover_avatar",this.post)},on_blog_name_click:function(t){o.Utils.popover.capture_tumblelog_click(t),o.Utils.popover.track_premium_engagement("popover_blog",this.post)},on_mouseenter:function(t){o.Events.trigger("TumblelogPopover:mouseenter_tumblelog_info",this.model)},on_follow_hover:function(t){this.is_recommendation||o.Events.trigger("TumblelogPopover:follow_hover",this.model)}});o.TumblelogPopover.Info=s}(jQuery,_,Backbone,Tumblr),/*! scripts/tumblelog_popover/views/recommendations.js */ function(t,e,i,o){var s=i.View.extend({className:"popover_inner recommended_blogs",initialize:function(s){this.options=s||{},this.is_poptica=this.options.is_poptica||!1,this.followed_blog=this.options.followed_blog||"",this.posts_insert_delay=this.options.posts_insert_delay||50,this.posts_update_delay=this.options.posts_update_delay||300,this.recommendations_needed=this.options.recommendations_needed||3,this.$popover=this.options.popover||t(),this.$popover_wrapper=this.$popover.find(".popover_content_wrapper"),this.template=e.template(this.options.template||t("#recommended_blogs_template").html()),this.posts_template=e.template(this.options.posts_template||t("#highlighted_posts_template").html()),this.is_visible=!1,this.showing_posts=!1,this.has_recommendations=!1,this.subviews={blogs:[],posts:null},this.viewed=[],this.original_popover_height=0;var n=i.Collection.extend({model:o.Prima.Models.Tumblelog,url:"/svc/related_blogs",parse:e.bind(function(t){return e.isEmpty(t)||(this.has_recommendations=!0),t},this)});this.blogs=new n,this.fetch_tumblelog_data()},fetch_tumblelog_data:function(){this.blogs.fetch({data:{tumblelog:this.followed_blog,minimum:this.recommendations_needed},merge:!0,withFormKey:!0,remove:!1})},render:function(){this.is_poptica&&(this.original_popover_height=this.$popover.height(),this.$popover.css("height",this.original_popover_height)),this.is_visible||(this.$popover_wrapper.append(this.$el),this.is_visible=!0);var t={followed_blog:this.followed_blog};this.$popover.find(".recommended_blogs").html(this.template(t));var e=1;return this.blogs.forEach(function(t){var i=new o.TumblelogPopover.Info({popover:this.$popover,parent:this.$el,current_data:t.toJSON(),model:t,recommendation_data:{rank:e,recommendation_ct:this.blogs.length,position:{}},is_recommendation:!0});i.recommendation_data.position=i.$el.offset(),e+=1,this.subviews.blogs.push(i)},this),this.$popover.addClass("showing_recommendations"),this.after_render(),this},log_impressions:function(){var t=function(){return window.location.pathname.split("/")[1]},i=1;e.forEach(this.subviews.blogs,function(s){var n=s.model,r=e.find(this.subviews.blogs,{model:n});if(!e.isEmpty(r)&&e.indexOf(this.viewed,n)===-1){this.viewed.push(n);var a=(o.getRealNow||e.now)();o.Events.trigger("Capture:push","recommended_blog_impressions","impressions",{tumblelog_name:n.get("name"),algorithm_id:"reblog_related",page:t(),ts:Math.floor(a/1e3),position:r.$el.offset(),format:"RECOMMEND_FORMAT_TUMBLELOG_POPOVER",rank:i}),i+=1,this.viewed.push(n)}},this)},insert_posts:function(t){if(!this.subviews.posts){this.subviews.posts=new o.TumblelogPopover.Posts({popover:this.$popover,parent:this.$el,model:t,on_bottom:this.is_poptica||this.$popover.hasClass("nipple_on_top")}),this.$popover.one("transitionend webkitTransitionEnd MSTransitionEnd",this._after_insert_posts),setTimeout(this._after_insert_posts,600);var e=this;setTimeout(function(){e.$popover.addClass("slide_up")},this.posts_insert_delay),this.listenTo(o.Events,"TumblelogPopover:mouseenter_tumblelog_info",this.update_posts),this.listenTo(o.Events,"TumblelogPopover:mouseenter_posts",this.cancel_update_posts)}},_after_insert_posts:function(){o.Events.trigger("TumblelogPopover:inserted_posts")},update_posts:function(t){if(this.subviews.posts||this.insert_posts(t),this.cancel_update_posts(),this.subviews.posts.model!==t){this.subviews.posts.$el.removeClass("blink");var e=this;this.queued_post_update=setTimeout(function(){e.subviews.posts.$el.addClass("blink"),e.subviews.posts.update_posts(t)},this.posts_update_delay)}},cancel_update_posts:function(){this.queued_post_update&&clearTimeout(this.queued_post_update)},after_render:function(){var i=t.Deferred();if(i.then(e.bind(this._after_animation,this)),this.$popover.one("animationend webkitAnimationEnd MSAnimationEnd",i.resolve),setTimeout(i.resolve,600),this.log_impressions(),this.is_poptica){this.$popover.css("height",""),this.$popover_wrapper.css("background-color","#FFF");var o={height:this.$popover.height()-this.original_popover_height};if(this.$popover.hasClass("up")){var s=parseInt(this.$popover.css("margin-top"));o["margin-top"]=this.original_popover_height-o.height+s}this.$popover.css(o)}},_after_animation:function(){this.$popover.find(".popover_inner:not(.recommended_blogs)").remove(),this.$popover.removeClass("showing_recommendations"),this.insert_posts(e.last(this.blogs.models))}});o.TumblelogPopover.Recommendations=s}(jQuery,_,Backbone,Tumblr);/*! scripts/tumblelog_popover/views/poptica_info_popover.js */ var TumblrData=TumblrData||{};Tumblr.TumblelogPopover||(Tumblr.TumblelogPopover={}),function(t,e,i,o){"use strict";var s=Tumblr.Popover.extend({template:e.template(t("#tumblelog_header_info_popover_template").html()),defaults:{auto_show:!1,skip_glass:!1,template_data:{},trigger:t(),standalone:!1,show_flag_button:!0,show_user_controls:!1,can_subscribe:!1,is_blocking:!1,blogSubHelpThreshold:250},events:{"click .ask_menu_item":"__ask_menu_item_clicked","click .fan_mail_menu_item":"__fan_mail_menu_item_clicked","click .messaging_menu_item":"__messaging_menu_item_clicked","click .archive_menu_item":"__archive_menu_item_clicked","click .toggle_spam":"__toggle_spam_click","click .toggle_suspended":"__toggle_suspended_click","click .toggle_nsfw":"__toggle_nsfw_click","click .likes":"__likes_menu_item_clicked","click .block":"__block_click","click .unblock":"__unblock_click","click .flag_menu_item":"__flag_click","click .panel_menu_item":"__panel_menu_item_clicked","click [data-flag-subscribed-item]":"__toggleBlogSubscription","click .help-slidedown":"__preventSubscribe","mouseenter .web-subscribe-how-to":"_checkHelpNotificationHover","mouseleave .web-subscribe-how-to":"_checkHelpNotificationHover"},__toggleBlogSubscription:function(t){t.preventDefault();var i=new Tumblr.Prima.Models.Tumblelog({name:this.model.get("name")}),o=e.bind(this._afterSubscriptionToggle,this,"success",i),s=e.bind(this._afterSubscriptionToggle,this,"failure",i);i.toggleSubscription().then(o).otherwise(s)},_afterSubscriptionToggle:function(t,e){if("success"===t){var i=e.get("is_subscribed");this.$subscriptionStatus.toggleClass("is-subscribed",i)}this.hide()},__panel_menu_item_clicked:function(t){Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__block_click:function(t){t.preventDefault();var i={blockedTumblelog:this.model.get("name")};Tumblr.Prima.Block.confirmBlock(i).then(e.bind(this.__onBlockConfirm,this)),Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__unblock_click:function(t){t.preventDefault();var i={blockedTumblelog:this.model.get("name")};Tumblr.Prima.Block.unblock(i).then(e.bind(this.__onUnblockConfirm,this)),Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__onUnblockConfirm:function(){var t=new Tumblr.Prima.Models.Tumblelog({name:this.model.get("name")});t.unblock().then(e.bind(this._afterUnblock,this))},_afterUnblock:function(){this.model.set("blocking",!1),this.trigger("change",this.model)},__onBlockConfirm:function(){var t=new Tumblr.Prima.Models.Tumblelog({name:this.model.get("name")});t.block().then(e.bind(this._afterBlock,this))},_afterBlock:function(){this.model.set("blocking",!0),this._hide_posts(),this.options.targetPost&&this.options.targetPost.addClass("is_flagged"),Tumblr.Prima.Events&&Tumblr.Prima.Events.trigger("Kraken:blocks:block_added",{loggingData:{from:"popover"}})},__flag_click:function(t){t.preventDefault(),Tumblr.Events.trigger("abuseform:open",{mode:"blogcard",tumblelog:this.model.get("name")}),Tumblr.Events.trigger("Kraken:abuseform:open",{mode:"blogcard",tumblelog:this.model.get("name")}),this.hide()},__ask_menu_item_clicked:function(t){t.preventDefault(),Tumblr.Events.trigger("ask:form:open",{recipient:this.model.get("name"),allow_anonymous:this.model.get("anonymous_asks")}),Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__messaging_menu_item_clicked:function(t){t.preventDefault(t),Tumblr.Prima.Events.trigger("messaging:conversation:open:tumblelogs",[this.model],"blog-card"),this.hide()},__fan_mail_menu_item_clicked:function(t){e.isObject(Tumblr.FanMail)&&(t.preventDefault(),Tumblr.FanMail.show(null,{href:Tumblr.FanMail.make_url_from_tumblelog(this.model.get("name"))}),Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide())},__archive_menu_item_clicked:function(t){Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__likes_menu_item_clicked:function(t){Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__toggle_spam_click:function(t){t.preventDefault();var i=this.model.toggle_spam();i.success(e.bind(function(t){this.model.set("spam",!!t.spammer)},this)),Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__toggle_suspended_click:function(t){t.preventDefault();var i=this.model.toggle_suspended();i.success(e.bind(function(t){this.model.set("suspended",!!t.suspended)},this)),Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__toggle_nsfw_click:function(t){t.preventDefault();var i=this.model.toggle_nsfw();i.success(e.bind(function(t){this.model.set("nsfw",t.nsfw)},this)),Tumblr.Events.trigger("TumblelogPopover:navigation_menu_item_clicked"),this.hide()},__model_change:function(){var t=this.model.toJSON();this.$(".toggle_spam").toggleClass("is_flagged",!!t.spam),this.$(".toggle_nsfw").toggleClass("is_flagged",!!t.nsfw),this.model.hasChanged("can_subscribe")&&this.$subscriptionStatus.toggleClass("can-subscribe",this.model.get("can_subscribe"));var e=this.model.has("blocking")?this.model.get("blocking"):t.is_blocking;this.__blocking_change(e),this.model.hasChanged("is_subscribed")&&this.$subscriptionStatus.toggleClass("is-subscribed",this.model.get("is_subscribed"))},__blocking_change:function(t){this.$(".block").toggle(!t),this.$(".unblock").toggle(t)},__document_click:function(t){if(Tumblr.Utils&&Tumblr.Utils.popover){var e=Tumblr.Utils.popover.get_bounds(this.$popover),i=!(e.left<=t.pageX&&t.pageX<=e.right),o=!(e.top<=t.pageY&&t.pageY<=e.bottom);(i||o)&&this.hide()}},_hide_posts:function(){Tumblr.Posts.whereBy({tumblelog:this.model.get("name"),sponsored:!1}).invoke("dismiss")},_open_dialog:function(i,o){o=o||t.noop,this.is_disabled=!0,i.fail(e.bind(function(){this.is_disabled=this.is_menu_open},this)),i.done(e.bind(function(){this.is_disabled=this.is_menu_open,o()},this))},_toggleHelpSlider:function(t,e){this.$subscribeHowto.slideToggle(250),this.hasHoveredOverCopy&&(this.hasHoveredOverCopy=!1)},_checkHelpIconHover:function(t){"mouseleave"===t.type?this.toggleTimeout=setTimeout(e.bind(this._toggleHelpSlider,this),this.options.blogSubHelpThreshold):this.hasHoveredOverCopy?clearTimeout(this.toggleTimeout):this._toggleHelpSlider()},_checkHelpNotificationHover:function(t){"mouseenter"===t.type?(this.hasHoveredOverCopy=!0,clearTimeout(this.toggleTimeout)):this.toggleTimeout=setTimeout(e.bind(this._toggleHelpSlider,this),this.options.blogSubHelpThreshold)},__preventSubscribe:function(t){t.stopPropagation()},initialize:function(i){if(this.options=e.extend({},this.defaults,i),this.$trigger=i.trigger,this.targetPost=this.options.targetPost,this.model){this.$(".block").hide(),this.$(".unblock").hide();var o=this.model.toJSON();o.show_user_controls=this.options.show_user_controls,e.defaults(o,this.options),o.subscriptionStatus=o.can_subscribe?"can-subscribe":"",o.can_subscribe&&o.is_subscribed&&(o.subscriptionStatus+=" is-subscribed"),this.$doc=t(document),this.$popover=t(this.template(o)).appendTo(this.$el).hide(),this.$subscribeHowto=this.$(".web-subscribe-how-to"),this.$subscriptionStatus=this.$("[data-flag-subscribed-item]"),this.listenTo(this.model,"change",this.__model_change),Tumblr.Popover.prototype.initialize.call(this,e.extend(this.options,{popover:this.$popover})),this.__blocking_change(o.is_blocking),this.$(".help-slidedown").hoverIntent({over:e.bind(this._checkHelpIconHover,this),out:e.bind(this._checkHelpIconHover,this),sensitivity:6})}},show:function(){Tumblr.Events.trigger("TumblelogPopover:toggle_navigation_menu",!0),this.options.standalone||this.$doc.on("click.poptica_info_popover",e.bind(this.__document_click,this)),Tumblr.Popover.prototype.show.call(this)},hide:function(){return Tumblr.Events.trigger("TumblelogPopover:toggle_navigation_menu",!1),this.$doc.off(".poptica_info_popover"),Tumblr.Popover.prototype.hide.call(this)}});!function(){function t(t){o&&o.hide();var e=t.options||{};o=new s(e)}function e(){o&&o.show()}function i(){o&&o.hide()}var o;Tumblr.Events.on("popticainfopopover:initialize",t),Tumblr.Events.on("popticainfopopover:show",e),Tumblr.Events.on("popticainfopopover:hide",i)}(),o.PopticaInfoPopover=s}(jQuery,_,Backbone,Tumblr.TumblelogPopover);/*! scripts/tumblelog_popover/views/poptica_header.js */ var TumblrData=TumblrData||{};Tumblr.IndashBlog||(Tumblr.IndashBlog={}),Tumblr.TumblelogPopover||(Tumblr.TumblelogPopover={}),function(t,e,i,o){var s=Tumblr.IndashBlog.HeaderCompact.extend({className:"poptica_header",defaults:{current_data:{},on_render:t.noop,popover:null,hide_posts_on_unfollow:!1,is_recommendation:!1,template_data:{popover:!0},include_info_popover:!0},events:function(){return e.extend({},Tumblr.IndashBlog.HeaderCompact.prototype.events,{"click .avatar a":"__on_avatar_click","click a.blog_name":"__on_blog_name_click","mouseenter .follow":"__on_follow_hover",mouseenter:"__on_mouseenter"})},__on_follow_click:function(i){if(i.preventDefault(),i.stopPropagation(),t(i.currentTarget).hasClass("unfollow"))if(this.is_recommendation)this.model.save_following({following:!1},{source:"UNFOLLOW_SOURCE_TUMBLELOG_POPOVER_RECOMMENDATIONS",from_popover:!0,pt:this.post instanceof Tumblr.Prima.Models.Post&&this.post.get("pt")||""});else{var o=Tumblr.TumblelogActions.confirm_unfollow({tumblelog:this.model.get("name"),avatar_url:this.model.get("avatar_url")||""});this._open_dialog(o,e.bind(function(){this.model.save_following({following:!1},{source:"UNFOLLOW_SOURCE_TUMBLELOG_POPOVER",from_popover:!0,pt:this.post instanceof Tumblr.Prima.Models.Post&&this.post.get("pt")||""}),this.hide_posts_on_unfollow&&this._hide_posts(),Tumblr.Events.trigger("TumblelogPopover:track_engagement","popover_unfollow")},this)),Tumblr.Events.trigger("TumblelogPopover:unfollow")}else{var s=this.is_recommendation?"FOLLOW_SOURCE_TUMBLELOG_POPOVER_RECOMMENDATIONS":"FOLLOW_SOURCE_TUMBLELOG_POPOVER",n={source:s,from_popover:!0,pt:this.post instanceof Tumblr.Prima.Models.Post&&this.post.get("pt")||""},r=t(i.target).closest("[data-context-path]").data("context-path");r&&(n.tlt=r),this.model.save_following({following:!0},n),Tumblr.Events.trigger("TumblelogPopover:track_engagement","popover_follow"),Tumblr.Events.trigger("TumblelogPopover:follow",this.model.get("name"))}},__info_popover_button_clicked:function(t){Tumblr.IndashBlog.HeaderCompact.prototype.__info_popover_button_clicked.call(this,t),Tumblr.Events.trigger("TumblelogPopover:track_engagement","popover_menu")},__on_avatar_click:function(t){Tumblr.Utils.popover.capture_tumblelog_click(t),Tumblr.Events.trigger("TumblelogPopover:track_engagement","popover_avatar"),Tumblr.Events.trigger("TumblelogPopover:click:avatar",{model:this.current_post,loggingData:this.loggingData({userAction:"popover_avatar"})})},__on_blog_name_click:function(t){Tumblr.Utils.popover.capture_tumblelog_click(t),Tumblr.Events.trigger("TumblelogPopover:track_engagement","popover_blog"),Tumblr.Events.trigger("TumblelogPopover:click:blog",{model:this.current_post,loggingData:this.loggingData({userAction:"popover_blog"})})},__on_mouseenter:function(t){Tumblr.Events.trigger("TumblelogPopover:mouseenter_tumblelog_info",this.model)},__on_follow_hover:function(t){this.is_recommendation||Tumblr.Events.trigger("TumblelogPopover:follow_hover",this.model)},_update_cache:function(){Tumblr.Utils&&Tumblr.Utils.popover&&Tumblr.Utils.popover.cache_tumblelog_data(this.model.get("name"),this.model.toJSON())},initialize:function(t){this.listenTo(this.model,"change",this._update_cache),Tumblr.IndashBlog.HeaderCompact.prototype.initialize.call(this,t),this.is_recommendation=this.options.is_recommendation,t.targetPost&&(this.post=Tumblr.Posts.get(t.targetPost.data("post-id")))}});Tumblr.Prima.Mixins.loggingData.applyTo(s.prototype),o.PopticaHeader=s}(jQuery,_,Backbone,Tumblr.TumblelogPopover),/*! scripts/tumblelog_popover/views/posts.js */ function(t,e,i,o){var s=i.View.extend({className:"recent_posts",events:{"click a":"on_post_click",mouseenter:"on_mouseenter"},initialize:function(i){i||(i={}),this.template=e.template(t("#highlighted_posts_template").html()),this.$popover=i.popover||t(),this.$parent=i.parent||t(),this.min_load_time=i.min_load_time||500,this.model=i.model||{},this.dashboard_post=i.post||{},this.model&&(this.listenTo(this.model,"change:highlighted_posts",this.render),this.listenTo(this.model,"change:global_theme_params",this.render_inline_styles),this.render_loader(),this.render_inline_styles(),i.on_bottom?this.$parent.append(this.$el):this.$parent.prepend(this.$el),this.posts=this.model.get("highlighted_posts"),e.isUndefined(this.posts)?this.fetch_posts():this.render(!0))},fetch_posts:function(){this.model.fetch_popover_data({is_tumblelog_popover:!0})},update_posts:function(t){this.model=t,this.posts=this.model.get("highlighted_posts"),e.isUndefined(this.posts)?this.fetch_posts():this.render(!0)},render_loader:function(){var t=this.model.toJSON();this.$el.html(this.template({loader_color:t.global_theme_params?t.global_theme_params.title_color:"#D9D9D9"}))},render_inline_styles:function(){var t=this.model.get("global_theme_params");t&&(this.$el.css("background-color",t.background_color),this.$el.css("color",t.title_color))},render:function(t){var i=this.posts||this.model.get("highlighted_posts");if(e.isArray(i)){var o=i.join("");return i.length<2?void setTimeout(e.bind(function(){this.$popover.addClass("is_empty"),this.$el.html("")},this),this.min_load_time):(this.$el.addClass("has_"+i.length+"_posts"),t===!0?void this.$el.addClass("is_cached").html(o):(setTimeout(e.bind(function(){this.$el.addClass("is_loaded").html(o)},this),this.min_load_time),this))}},on_post_click:function(t){o.Utils.popover.capture_tumblelog_click(t),o.Utils.popover.track_premium_engagement("popover_post",this.dashboard_post),o.Events.trigger("TumblelogPopover:click:posts",{model:this.current_post,loggingData:this.loggingData({userAction:"popover_posts"})})},on_mouseenter:function(t){o.Events.trigger("TumblelogPopover:mouseenter_posts")}});o.Prima.Mixins.loggingData.applyTo(s.prototype),o.TumblelogPopover.Posts=s}(jQuery,_,Backbone,Tumblr),/*! scripts/tumblr/utils/popover.js */ Tumblr.Utils||(Tumblr.Utils={}),function(t,e){var i={cache:{},cache_tumblelog_data:function(t,e){t&&_.isString(t)&&_.isObject(e)&&(e.customizable||(this.cache[t]={timestamp:(new Date).getTime(),data:JSON.stringify(e)}))},get_session_storage:function(t,e){if(window.sessionStorage&&window.sessionStorage.length){t=t||"optica_header",e=e||36e5;var i=sessionStorage.getItem(t);if(i){var o=JSON.parse(i),s=(new Date).getTime();for(key in o)(s-o[key].timestamp>e||!_.has(o[key],"data")||o[key].data.customizable)&&delete o[key];return this.cache=_.extend({},this.cache,o),o}}},sync_session_storage:function(t){if(!(_.size(this.cache)<1)&&window.sessionStorage){t=t||"optica_header";var e,i,o=_.size(this.cache),s=50;if(o>s){e=0;for(i in this.cache)this.cache[i]&&(e++,e<=o-s&&delete this.cache[i])}try{sessionStorage.setItem(t,JSON.stringify(this.cache))}catch(n){}}},clear_session_storage:function(t){window.sessionStorage&&window.sessionStorage.length&&(t=t||"optica_header",sessionStorage.getItem(t)&&sessionStorage.removeItem(t))},get_bounds:function(e){var i=t(e),o={left:0,right:0,top:0,bottom:0};return i.length&&(o=i.offset(),o.right=o.left+i.width(),o.bottom=o.top+i.height()),o},capture_tumblelog_click:function(t){Tumblr.CaptureTumblelogClick&&Tumblr.CaptureTumblelogClick.track_click(t)},track_premium_engagement:function(t,e){if(e instanceof Tumblr.Prima.Models.Post)if(Tumblr.CapturePremiumRadar&&e===Tumblr.radar.postModel&&(e.get("placement_id")||e.get("premium_tracked")))Tumblr.CapturePremiumRadar.force_track_radar_controls(t);else if(e.get("sponsored")||e.get("premium_tracked")){var i=_.find(Tumblr.postsView.postViews,{model:e});if(!i)return;i.capture_web_instream.force_track_sponsored_controls(t)}}};e.popover=i}(jQuery,Tumblr.Utils),/*! scripts/color_utilities.js */ function(t,e,i){var o={rgb_to_hex:function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},hex_to_rgb:function(t){t=new String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},rgb_to_hsv:function(t,e,i){var o=Math.min(Math.min(t,e),i),s=Math.max(Math.max(t,e),i),n=s-o,r={h:6,s:s?(s-o)/s:0,v:s/255};return n?s===t?r.h+=(e-i)/n:s===e?r.h+=2+(i-t)/n:r.h+=4+(t-e)/n:r.h=0,r.h=60*r.h%360,r},hsv_to_rgb:function(t,e,i){var o,s,n;if(e){o=s=n=0;var r=(t+360)%360/60,a=i*e,l=i-a,h=a*(1-Math.abs(r%2-1));r<1?(o=a,s=h):r<2?(o=h,s=a):r<3?(s=a,n=h):r<4?(s=h,n=a):r<5?(n=a,o=h):(n=h,o=a),o+=l,s+=l,n+=l}else o=s=n=i;return{r:Math.round(255*o),g:Math.round(255*s),b:Math.round(255*n)}},hex_to_hsv:function(t){t=new String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var o=i.ColorUtilities.hex_to_rgb(t),s=i.ColorUtilities.rgb_to_hsv.apply(i.ColorUtilities,e.toArray(o));return s},hsv_to_hex:function(t,o,s){var n=i.ColorUtilities.hsv_to_rgb(t,o,s),r=i.ColorUtilities.rgb_to_hex.apply(i.ColorUtilities,e.toArray(n));return r},hex_brightness:function(t,e){t=String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),e=e||0;var i,o,s,n=parseInt(t,16),r=e<0?0:255,a=e<0?-e:e,l=n>>16,h=n>>8&255,c=255&n;return i=Math.round((r-l)*a)+l,o=Math.round((r-h)*a)+h,s=Math.round((r-c)*a)+c,"#"+(16777216+65536*i+256*o+s).toString(16).slice(1)},hsv_to_readable:function(t){return"string"==typeof t&&(t=i.ColorUtilities.hex_to_hsv(t)),t.s<.2&&t.v>.8?"#444":"#FFF"},compare_colors:function(t,i,o){var s={upper_bound:.8,lower_bound:.2,diff_bound:.1,hue_bound:15};e.extend(s,o);var n=s.upper_bound,r=s.lower_bound,a=s.diff_bound,l=s.hue_bound,h=Math.abs(t.h-i.h),c=Math.abs(t.s-i.s),_=Math.abs(t.v-i.v);return h<=a&&c<=a&&_<=a||c<=a&&_<=a&&(c>=n||c<=r&&_>=n||_<=r&&h<=l)}};i.ColorUtilities=o}(jQuery,_,Tumblr),/*! scripts/color_editor/views/_palette.js */ Tumblr.ColorEditor||(Tumblr.ColorEditor={}),function(t,e,i,o){var s=i.View.extend({className:"color_palette",defaults:{colors:[],current_color:!1,current_page:0,on_change:t.noop},events:{"click .swatch":"__color_click","click .pagination a.dot":"__pagination_click","click .pagination a.next":"__pagination_next_click","click .pagination a.previous":"__pagination_previous_click"},__color_click:function(e){e.preventDefault();var i=t(e.currentTarget);i.hasClass("selected")||(this.$(".swatch.selected").removeClass("selected"),i.addClass("selected"),this.update_color(i.data("color")))},__pagination_click:function(e){e.preventDefault();var i=t(e.currentTarget);i.hasClass("selected")||(this.current_page=i.data("page"),this.render(!0))},__pagination_next_click:function(e){e.preventDefault(),!t(e.currentTarget).hasClass("disabled")&&this.current_page0&&(this.current_page--,this.render(!0))},initialize:function(t){this.options=e.extend({},this.defaults,t),this.colors=this.options.colors,this.current_color=this.options.current_color,this.current_page=this.options.current_page,this.page_count=this.colors.length},render:function(t){return this.$el.html(this.template({colors:this.colors[this.current_page],current_color:this.current_color,page:this.current_page,page_color:this.colors[this.current_page][4],page_count:this.page_count})),this.$el.toggleClass("paginating",t||!1),this},update_color:function(t){this.current_color=t,this.options.on_change(this.current_color)},template:e.template(' <% var previous_arrow_class = "arrow previous icon_arrow_carrot_left"; previous_arrow_class += (page === 0) ? " disabled" : ""; var next_arrow_class = "arrow next icon_arrow_carrot_right"; next_arrow_class += (page === page_count - 1) ? " disabled" : ""; %> <% _.each(colors, function(color) { %> " data-color="<%= color %>" style="background-color:<%= color %>"> <% }); %> <% if(page_count > 1) { %> <% } %> ')});o.Palette=s}(jQuery,_,Backbone,Tumblr.ColorEditor),/*! scripts/color_editor/views/_picker.js */ Tumblr.ColorEditor||(Tumblr.ColorEditor={}),function(t,e,i,o){var s=i.View.extend({className:"color_picker",defaults:{color:{r:0,g:0,b:0},debounce:30,on_change:t.noop},events:{paste:"__paste","mousedown .hue_selector":"__hue_mousedown","mousedown .saturation_wrapper":"__saturation_mousedown","focus .color_text":"__color_text_focus","keyup .color_text":"__color_text_keyup"},__hue_mousedown:function(i){this.hue_width=this.$hue.width();var o=(i.pageX-this.$hue.offset().left)/this.hue_width;this.hsv.h=Math.round(360*o),this.update_hue(),t("body").on("mousemove.pickerhue",e.bind(e.throttle(this.__hue_mousemove,this.options.debounce),this)),t("body").on("mouseup.pickerhue",e.bind(this.__hue_mouseup,this))},__hue_mousemove:function(t){var e=this.$hue.offset().left;if(t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0,t.returnValue=!1,!(t.pageXe+this.hue_width)){var i=(t.pageX-this.$hue.offset().left)/this.hue_width;return this.hsv.h=Math.round(360*i),this.update_hue(),!1}},__hue_mouseup:function(e){e.preventDefault(),e.stopPropagation(),t("body").off(".pickerhue")},__saturation_mousedown:function(i){var o=this.$saturation.offset(),s=i.pageX-o.left,n=i.pageY-o.top;this.saturation_width=this.$saturation.width(),this.saturation_height=this.$saturation.height(),this.hsv.s=Math.max(0,Math.min(s/this.saturation_width,1)),this.hsv.v=Math.max(0,Math.min(1-n/this.saturation_height,1)),this.update_saturation(),this.$saturation_indicator.addClass("dragging"),t("body").on("mousemove.pickersaturation",e.bind(e.throttle(this.__saturation_mousemove,this.options.debounce),this)),t("body").on("mouseup.pickersaturation",e.bind(this.__saturation_mouseup,this))},__saturation_mousemove:function(t){var e=this.$saturation.offset(),i=t.pageX-e.left,o=t.pageY-e.top;return t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0,t.returnValue=!1,this.hsv.s=Math.max(0,Math.min(i/this.saturation_width,1)),this.hsv.v=Math.max(0,Math.min(1-o/this.saturation_height,1)),this.update_saturation(),!1},__saturation_mouseup:function(){this.$saturation_indicator.removeClass("dragging"),t("body").off(".pickersaturation")},__color_text_keyup:function(e){var i=t(e.currentTarget).val().replace(/[^0-9a-f]/gi,"");13!==e.which||3!==i.length&&6!==i.length||(this.hsv=Tumblr.ColorUtilities.hex_to_hsv(i),this.update_hue(),this.update_saturation(!1))},__paste:function(t){t.preventDefault(),t.stopPropagation();var e=!1;if(window.clipboardData&&window.clipboardData.getData?e=window.clipboardData.getData("Text"):t.originalEvent.clipboardData&&t.originalEvent.clipboardData.getData&&(e=t.originalEvent.clipboardData.getData("text/plain")),e){e=String(e).replace(/[^0-9a-f]/gi,"");var i=/(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i.test(e);i&&(this.hsv=Tumblr.ColorUtilities.hex_to_hsv(e),this.update_hue(),this.update_saturation(!1))}return!1},initialize:function(i){this.options=e.extend({},this.defaults,i),this.current_color=e.isObject(this.options.color)?this.options.color:Tumblr.ColorUtilities.hex_to_rgb(this.options.color),this.hsv=Tumblr.ColorUtilities.rgb_to_hsv.apply(this,e.toArray(this.current_color)),this.current_hex=!1,this.hue_width=0,this.saturation_height=0,this.saturation_width=0,this.$hue=t(),this.$hue_indicator=t(),this.$saturation=t(),this.$color=t(),this.$color_text=t()},render:function(){return this.$el.html(this.template({color:this.current_color,hue_position:this.hue_position})),this.$hue=this.$(".hue_selector"),this.$hue_indicator=this.$(".hue_selector .indicator"),this.$saturation=this.$(".saturation_wrapper"),this.$saturation_indicator=this.$(".saturation_wrapper .indicator"),this.$color=this.$(".color_value"),this.$color_text=this.$(".color_value .color_text"),this.update_hue(),this.update_saturation(!1),this},update_hue:function(){var t=e.toArray(Tumblr.ColorUtilities.hsv_to_rgb(this.hsv.h,1,1)),i="rgb("+t.toString()+")";this.$hue_indicator.css({"background-color":i,left:Math.round(this.hsv.h/360*100)+"%"}),this.$saturation.css("background-color",i),this.update_color_value()},update_saturation:function(t){t=t||!0,this.$saturation_indicator.css({left:Math.round(100*this.hsv.s)+"%",top:Math.round(100-100*this.hsv.v)+"%"}),t&&this.update_color_value()},update_color_value:function(){var t=Tumblr.ColorUtilities.hsv_to_hex.apply(this,e.toArray(this.hsv)),i=this.hsv.s,o=this.hsv.v;this.$saturation_indicator.css("background-color",t),this.$color.css("background-color",t),this.$color_text.css("color",i<.2&&o>.8?"#444":"#FFF").val(t),this.current_hex&&t!==this.current_hex&&this.options.on_change(t),this.current_hex=t},template:e.template('
')});o.Picker=s}(jQuery,_,Backbone,Tumblr.ColorEditor),/*! scripts/color_editor/views/color_editor_view.js */ Tumblr.ColorEditor||(Tumblr.ColorEditor={}),function(t,e,i,o){var s=i.View.extend({className:"color_editor",colors:{red:["#D95E40","#FB4C16","#FF4141","#F0BFB6","#FF7373"],yellow:["#F2992E","#FFD800","#FFF231","#DECBA4","#E7EC6C"],green:["#56BC8A","#56BF4B","#5ACDB3","#9BCACA","#BFE4A8"],blue:["#529ECC","#5AC9E1","#5289DB","#394ACB","#6154C4"],purple:["#A77DC2","#B09BD5","#D969C3","#E1B7D2","#FE3B80"],grayscale:["#FFFFFF","#F6F6F6","#EEEEEE","#CCCCCC","#888888","#666666","#444444","#222222","#000000"]},defaults:{color:"#444444",debounce:30,on_change:t.noop},events:{"click .palette_selector":"__palette_selector_click","click .picker_selector":"__picker_selector_click"},__palette_selector_click:function(e){e.preventDefault();var i=t(e.currentTarget);i.hasClass("selected")||(this.$(".color_selectors .selected").removeClass("selected"),i.addClass("selected"),i.hasClass("custom")?this.render_custom_palette():this.render_palette(i.data("color")))},__picker_selector_click:function(e){e.preventDefault();var i=t(e.currentTarget);i.hasClass("selected")||(this.$(".color_selectors .selected").removeClass("selected"),i.addClass("selected"),this.render_picker())},__custom_palette_change:function(t){this.custom_palette=t,this.$custom_palette_selector.html(this.custom_palette_template({colors:t[0].slice(0,3)})),this.$el.addClass("has_custom_palette"),this.is_custom_palette_open&&this.render_custom_palette()},__color_change:function(t){e.isObject(t)?this.current_color=Tumblr.ColorUtilities.rgb_to_hex(t.r,t.g,t.b):this.current_color=t,this.$picker_selector.css("border-color",this.current_color),this.options.on_change(this.current_color)},initialize:function(i){this.options=e.extend({},this.defaults,i),this.current_color=this.options.color,this.current_color_palette=!1,this.current_color_palette_page=0,this.current_view=null,this.color_palette=null,this.custom_palette=null,this.is_custom_palette_open=!1,this.$color_view=t(),this.$custom_palette_selector=t(),this.$picker_selector=t(),Tumblr.Events&&Tumblr.Flags.bool("indash_header_image_colors")&&this.listenTo(Tumblr.Events,"coloreditor:custompalette",this.__custom_palette_change),this.generate_colors()},render:function(){return this.$el.html(this.template({colors:this.colors})),this.$color_view=this.$(".color_view"),this.$custom_palette_selector=this.$(".palette_selector.custom"),this.$picker_selector=this.$(".picker_selector").css("border-color",this.current_color),this.$(".color_selectors .selected").removeClass("selected"),this.current_color_palette?(this.$('.palette_selector[data-color="'+this.current_color_palette+'"]').addClass("selected"),this.render_palette(this.current_color_palette,this.current_color_palette_page)):(this.$(".picker_selector").addClass("selected"),this.render_picker()),this},render_palette:function(t,i){this.remove_current_view(),this.current_view=new o.Palette({colors:this.color_palette[t],current_color:this.current_color,current_page:i||0,on_change:e.bind(this.__color_change,this)}),this.$color_view.html(this.current_view.render().el)},render_custom_palette:function(){this.custom_palette&&(this.remove_current_view(),this.current_view=new o.Palette({colors:this.custom_palette,current_color:this.current_color,current_page:0,on_change:e.bind(this.__color_change,this)}),this.$color_view.html(this.current_view.render().el),this.is_custom_palette_open=!0)},render_picker:function(){this.remove_current_view(),this.current_view=new o.Picker({color:Tumblr.ColorUtilities.hex_to_rgb(this.current_color),debounce:this.options.debounce,on_change:e.bind(this.__color_change,this)}),this.$color_view.html(this.current_view.render().el)},remove_current_view:function(){this.current_view&&(this.current_view.remove(),this.current_view=null),this.is_custom_palette_open=!1},generate_colors:function(){var t={};e.each(this.colors,function(e,i){if(t[i]=[],"grayscale"===i)e.indexOf(this.current_color)>-1&&(this.current_color_palette=i,this.current_color_palette_page=0),t[i].push(e);else for(var o=0,s=e.length;o-1&&(this.current_color_palette=i,this.current_color_palette_page=o),t[i].push(n)}},this),this.color_palette=t},get_color_variations:function(t){for(var e=[],i=(Tumblr.ColorUtilities.hex_to_hsv(t),.2),o=4;o>0;o--){var s=i*o;e.push(Tumblr.ColorUtilities.hex_brightness(t,s))}e.push(t);for(var o=1;o<=4;o++){var s=-(i*o);e.push(Tumblr.ColorUtilities.hex_brightness(t,s))}return e},template:e.template('
'),custom_palette_template:e.template(' <% _.each(colors, function(color) { %> <% }) %> ')});o.Editor=s}(jQuery,_,Backbone,Tumblr.ColorEditor),/*! scripts/application/ajax_request.js */ function(t,e,i,o){"use strict";for(var s=window.l10n_str||{},n=[{useraction:"follow",url:"/svc/follow"},{useraction:"unfollow",url:"/svc/unfollow"},{useraction:"like",url:"/svc/like"},{useraction:"unlike",url:"/svc/unlike"},{useraction:"reply",url:"/svc/reply"},{useraction:"report",url:"/svc/report"}],r=function(e,i){return function(o,n){if(e){o=o||{},n=n||{},n.init&&n.init();var r=t.ajax({url:e,type:"POST",data:{form_key:t("#tumblr_form_key").attr("content"),data:o},withFormKey:!0});return r.success(function(){n.success&&n.success(),Tumblr.Events&&Tumblr.Events.trigger("useraction:xhr:success",i,o)}),r.error(function(t){return t&&403===t.status?void(n.success&&n.success()):(n.error?n.error():Tumblr.Dialog&&Tumblr.Dialog.alert(s.ajax_error),void(Tumblr.Events&&Tumblr.Events.trigger("useraction:xhr:error",i,o)))}),r.complete(function(){n.complete&&n.complete()}),r}}},a=n.length,l=a-1;l>=0;l--)o[n[l].useraction]=r(n[l].url,n[l].useraction)}(jQuery,Backbone,_,Tumblr),function(t,e,i,o){"use strict";o.Tabs=i.View.extend({el:"#user_tools",events:{"click #logout_button":"logout"},initialize:function(){},logout:function(i){i.preventDefault();var o=t(i.currentTarget),s=o.data("confirm-message"),n=o.attr("href");if(e.isObject(Tumblr.Dialog))return Tumblr.Dialog.confirm(s,e.bind(function(){window.location.href=n})),!1}})}(jQuery,_,Backbone,Tumblr),/*! scripts/application/language_menu.js */ function(t,e,i,o){"use strict";o.LanguageMenu=Tumblr.Popover.extend({events:{click:"toggle","click .popover_menu_item a":"select_language"},initialize:function(){this.$el.length&&(Tumblr.Popover.prototype.initialize.apply(this,arguments),this.update_timezone(),this.update_position(),this.language_form=this.$el.find("#set_language"),this.language_form_type=this.language_form.attr("method"),this.language_form_url=this.language_form.attr("action"))},show:function(){Tumblr.Popover.prototype.show.call(this),this.$el.closest("#sidebar_footer_nav").addClass("show_popover"),this.update_position()},hide:function(){Tumblr.Popover.prototype.hide.call(this),this.$el.closest("#sidebar_footer_nav").removeClass("show_popover")},select_language:function(e){var i=t(e.target);e.preventDefault(),t("#language_selected").val(i.attr("data-lang")),t("#language_switcher .current").removeClass("current"),this.set_language()},set_language:function(){var e=i(this.language_form.serializeArray()).map(function(t){return[t.name,t.value]}).zipObject().value();t.ajax({type:this.language_form_type,url:this.language_form_url,data:e,complete:function(){window.location.reload()}})},update_position:function(){var t=Math.floor(this.popover.outerWidth()/2);this.popover.css({marginLeft:-t+"px"})},update_timezone:function(){var t=new Date,e=new Date(t.getFullYear(),0,1,0,0,0,0),i=new Date(e.toGMTString().replace(/(.*)(\s\S+)/,"$1")),o=Math.round((e-i)/36e5);switch(this.$el.removeClass("americas europe_africa asia_pacific"),o){case-12:case-11:case-10:case-9:case-8:case-7:case-6:case-4:case-3:case-2:case-1:this.$el.addClass("americas");break;case 0:case 1:case 2:case 3:case 4:case 5:this.$el.addClass("europe_africa");break;case 6:case 7:case 8:case 9:case 10:case 11:case 12:this.$el.addClass("asia_pacific");break;default:this.$el.addClass("americas")}return o}})}(jQuery,Backbone,_,Tumblr),/*! scripts/application/password_strength_meter.js */ function(t,e,i,o){"use strict";o.PasswordStrengthMeter=e.View.extend({defaults:{password:"#signup_password",email:"#signup_email",tumblelog:"#signup_username"},initialize:function(e){this.options=e||{},this.options=i.extend(this.defaults,this.options),this.$password_meter=t("#password_strength_meter"),this.$password=t(this.options.password),this.$email=t(this.options.email),this.$tumblelog=t(this.options.tumblelog),this.$password.length&&(this.class_name="password_strength_meter",this.password_meter_markup='
',this.render(),this.test_password(),this.$password.on("keydown keyup focus blur",i.throttle(i.bind(function(t){this.last_checked!==this.get_password()&&this.test_password(t)},this),250)))},render:function(){this.$password_meter.length||(this.$password.after(this.password_meter_markup),this.$password_meter=t("#password_strength_meter"))},set_inactive:function(){this.$password_meter.addClass("inactive")},set_active:function(){this.$password_meter.removeClass("inactive")},set_level:function(t){switch(this.set_active(),t){case 1:this.$password_meter[0].className=this.class_name+" level_1";break;case 2:this.$password_meter[0].className=this.class_name+" level_2";break;case 3:this.$password_meter[0].className=this.class_name+" level_3";break;case 4:this.$password_meter[0].className=this.class_name+" level_4";break;case 5:this.$password_meter[0].className=this.class_name+" level_5";break;default:this.$password_meter[0].className=this.class_name}},test_password:function(t){return this.last_checked=this.$password.val(),t&&this.$password.val().length?void this.get_password_strength():void this.set_inactive()},update:function(){this.test_password()},get_email:function(){return this.$email.val()},get_password:function(){return this.$password.val()},get_username:function(){return this.$tumblelog.val()},get_form_data:function(){var t={};return t.username=this.get_username(),t.email=this.get_email(),t.password=this.get_password(),t},get_password_strength:function(){this.pw_xhr&&this.pw_xhr.abort(),this.pw_xhr=t.ajax({url:"/svc/account/validation",dataType:"json",type:"POST",withFormKey:!0,data:this.get_form_data()}),this.pw_xhr.done(i.bind(function(t){var e=t.score||0;this.set_level(e),this.block_registration_step=!!t.reject_reason&&t.reject_reason,delete this.pw_xhr},this))}})}(jQuery,Backbone,_,Tumblr),/*! scripts/application/report_tumblelog.js */ function(t,e,i,o){"use strict";o.ReportTumblelogView=e.View.extend({el:"#report_tumblelog_bar",events:{"click .spam":"report_spam","click .harassment":"report_harassment","click .dismiss":"dismiss",mouseenter:"delay_dismiss",mouseleave:"timeout_dismiss"},initialize:function(){Tumblr.Events.on("block_tumblelog",i.bind(this.block_tumblelog,this))},block_tumblelog:function(t){t.can_report&&(this.tumblelog=t.tumblelog,this.animate_in(),this.timeout_dismiss())},animate_in:function(){this.$el.find("#report_tumblelog_with_name").show(),this.$el.find("#report_tumblelog_name").html(this.tumblelog),this.$el.fadeIn(300)},report_spam:function(){var t=this.tumblelog;Tumblr.report({tumblelog:t,reason:"1"}).done(function(){Tumblr.Events.trigger("report_tumblelog",{tumblelog:t,reason:"spam"})}).always(i.bind(function(){this.dismiss()},this))},report_harassment:function(){var t=this.tumblelog;Tumblr.report({tumblelog:t,reason:"2"}).done(function(){Tumblr.Events.trigger("report_tumblelog",{tumblelog:t,reason:"harassment"})}).always(i.bind(function(){this.dismiss()},this))},dismiss:function(){this.$el.fadeOut(300,i.bind(function(){this.$el.find("#report_tumblelog_name").html(""),this.$el.find("#report_tumblelog_with_name").hide()},this))},timeout_dismiss:function(t){t=t||3e3,clearTimeout(this.dismissTimeout),this.dismissTimeout=setTimeout(i.bind(function(){this.dismiss()},this),3e3)},delay_dismiss:function(){clearTimeout(this.dismissTimeout)}})}(jQuery,Backbone,_,Tumblr),/*! scripts/application/full_height_no_posts_found.js */ function(t,e,i,o){"use strict";o.FullHeightNoPostsFound=e.View.extend({initialize:function(){if(this.$no_posts_found=t(".no_posts_found"),this.$left_column=t("#left_column"),this.$right_column=t("#right_column"),this.$no_posts_found.length&&this.$left_column.length&&this.$right_column.length){if("0px"!==this.$right_column.css("min-height"))return;var e=this.$left_column.height(),i=this.$right_column.height(),o=0,s="+";ei&&(s="-",o=e-i,o>=50&&(o=0)),this.center_padding(o,s)}},center_padding:function(t,e){if(t>0&&("+"===e||"-"===e)){var i=t/2;this.$no_posts_found.css("padding-top",e+"="+i).css("padding-bottom",e+"="+i)}}})}(jQuery,Backbone,_,Tumblr),/*! scripts/application/blog_name_helper.js */ function(t,e,i,o){"use strict";o.BlogNameHelper={validate_tumblelog_name:function(t){return!/^-|-$|[^\-a-z0-9]/i.test(t)},has_starting_hyphen:function(t){return/^-/.test(t)},has_ending_hyphen:function(t){return/-$/.test(t)},clean_tumblelog_name:function(t){return t.toLowerCase().replace(/[^\-a-z0-9]/g,"-").replace(/^-+|-+$/g,"")}}}(jQuery,Backbone,_,Tumblr),/*! scripts/application/fan_mail.js */ function(t,e,i,o){"use strict";o.FanMail={show:function(e,o){o=o||{};var s=!!i.has(o,"transparent_lightbox")&&o.transparent_lightbox,n=!!i.has(o,"href")&&o.href,r=!i.has(o,"show_loader")||o.show_loader;if(!n&&e&&e.href&&(n=e.href),n+=(n.indexOf("?")!==-1?"&":"?")+"lightbox=true",s&&(n+="&transparent_lightbox=true"),r){var a=t('
');a.css({zIndex:4294967294,position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",width:"100%",height:"100%",background:"transparent url('/images/fan_mail/grid_bg_lightbox.png?709') center"}),a.html('
'),t("body").append(a)}var l=t('