text: webpackJsonp([31],[function(t,e,i){i(1678),i(1679),i(1680),i(1681),i(1682),i(1683),i(1684),i(1685),i(1686),i(1687),i(1688),i(1689),i(1690),i(1691),i(1692),i(1693),i(1694),i(1695),i(1696),i(1697),i(1698),i(1699),i(1700),i(1701),i(1702),i(1703),i(1704),i(1705),i(1706),i(1707),i(1708),i(1709),i(1710),i(1711),i(1712),i(1713),i(1714),i(1715),i(1716),i(1717),i(1718),i(1719),i(1720),i(1721),i(1722),i(1723),i(1724),i(1725),i(1726),i(1727),i(1728),i(1729),i(1730),i(1731),i(1732),t.exports=i(1733)},,,,,function(t,e,i){"use strict";var s=i(3),n=i(6).sprintf,o=i(7),r=i(9),a=i(96),l=i(105);l();var h=i(99),c=i(102),u=i(107),d=i(108),p=i(110),g=i(153),_=i(725),m=i(728),f=i(966),v=i(970),b=i(450),y=i(1001),w=a.extend({getName:function(){return this.name=h.get("Context/name"),n("Context/%s",this.name)},logs:function(){var t=[i(1004),i(1019),i(1020),i(1021),i(1022),i(1023),i(1024),i(1025),i(1026),i(1027),i(1028),i(1029),i(1030),i(1031),i(1032),i(1033),i(1034),i(1035),i(1036),i(1037),i(1040),i(1041),i(1042),i(1043),i(1044),i(1045),i(1046),i(1047),i(1048)];return s.union(t,a.prototype.logs.apply(this))},constructor:function(){a.apply(this,arguments),this.startHistory(),this.initializeApp()},bootloader:function(t){a.prototype.bootloader.apply(this,arguments),d.init(),c.log("Exec","Bootstrap/DOMEventor"),c.log("Exec","Bootstrap/Legacy"),i(1049)},initializeApp:function(){u.bool("is_mobile_handset")&&u.bool("responsive_help_docs")?new v:new g,new _,u.bool("indash_blogs")&&(this.peepr=new m),u.bool("ask_form")&&(this.askForm=new f({user:p()})),u.bool("livephotos_web")&&(this.livePhotos=b.getInstance()),r.locale(h.get("Context.language")),u.bool("lrec_on_blog_pages_peepr")&&(this.yamPlusAd=new y)},startHistory:function(t){o.History.started||s.isEmpty(this.routes)||(this.routeFound=o.history.start({pushState:"pushState"in window.history,hashChange:t?!("pushState"in window.history):!1,root:this.root}))}});t.exports=w},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(7),o=i(97),r=i(99),a=i(100),l=i(102),h=i(104),c=n.Router.extend({root:"/",constructor:function(t){t||(t={}),t.bootstrap||(t.bootstrap=o()),this.bootloader(t.bootstrap),n.Router.apply(this,arguments)},getName:function(){return"Prima/Router"},logs:function(){return[]},bootloader:function(t){s.isEmpty(t),r.setup(t),l.log("Exec","Bootstrap/Data"),a.setup(t.Translations,s.get(t,"Context.language_simple","en")),l.log("Exec","Bootstrap/Translations"),h.startLogs(this.logs()),l.log("Exec","Bootstrap/logs")}},{start:function(t){return new this(t)}});t.exports=c},function(t,e,i){"use strict";var s=i(98),n=function(){var t=s("JSON"),e={},i=document.getElementById("bootloader");if(i){try{e=t.parse(i.getAttribute("data-bootstrap"))}catch(n){}i.parentNode.removeChild(i)}return e};t.exports=n},function(t,e){"use strict";function i(t,e){if(t in s)return s[t];var i=window[t];if(!e||!e(i)){var n=document.createElement("iframe");document.body.appendChild(n),i=n.contentWindow[t],document.body.removeChild(n)}return s[t]=i,i}var s={};t.exports=i},function(t,e,i){"use strict";function s(t){if(!r)throw new Error("Data hasn't been initialized with `setup`.");if(!a.isString(t))return null;var e=a.get(r,t.replace(/\//g,"."));return a.cloneDeep(e)}function n(t){if(!r)throw new Error("Data hasn't been initialized with `setup`.");return a.isString(t)?a.has(r,t.replace(/\//g,".")):null}function o(t){r=a.isObject(t)?t:{}}var r,a=i(3);t.exports={get:s,has:n,setup:a.once(o)}},function(t,e,i){"use strict";function s(t,e){r.addEntries(n.isObject(t)?t:{}),this.locale=e}var n=i(3),o=i(101),r=new o({name:"Translations"}),a=n.bind(r.get,r);a.setup=n.once(s),t.exports=a},function(t,e,i){"use strict";function s(t){t=n.extend({entries:{},name:"Dictionary"},t),this._hadLastLookup=!1,this._entries=t.entries,this._name=t.name}var n=i(3),o=(i(102),i(6).sprintf),r=function(t,e,i){null!=i||(i=this);var s=t.apply(i,e);return e=Array.prototype.slice.call(e,1),e.unshift(s),e};s.prototype.addEntries=function(t){return n.extend(this._entries,t),this},s.prototype.lookup=function(t){return n.has(this._entries,t)?(this._hadLastLookup=!0,this._entries[t]):(this._hadLastLookup=!1,t)},s.prototype.lookupWithFormatting=function(t){var e;return arguments.length>1?(e=this.lookup(o.apply(this,arguments)),this._hadLastLookup||(e=o.apply(this,r(this.lookup,arguments,this)))):e=this.lookup(t),e},s.prototype.get=function(t){var e=this.lookupWithFormatting.apply(this,arguments);return!this._hadLastLookup&&this.logMissing,e},s.prototype.getEntries=function(){return n.cloneDeep(this._entries)},t.exports=s},,,function(t,e,i){"use strict";var s=i(3),n={loadedLogs:[],startLogs:function(t){s.each(t,function(t){var e=t.start();this.loadedLogs.push(e.logKey)},this)},startLog:function(t){this.startLogs([t])}};t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(6).sprintf,o=i(100),r=i(106),a=(i(102),{__:o,sprintf:n,_subview:r}),l=function(){return s.extend(s.templateSettings.imports,a),a};t.exports=l},function(t,e){"use strict";t.exports=function(t){return'<noscript data-subview="'+t+'"></noscript>'}},,function(t,e,i){"use strict";function s(){g.documentHeight=p.documentHeight,p.documentHeight=u.height(),g.windowHeight=p.windowHeight,p.windowHeight=d.height(),g.windowWidth=p.windowWidth,p.windowWidth=d.width(),g.windowScrollTop=g.windowScrollY=p.windowScrollTop,p.windowScrollTop=p.windowScrollY=d.scrollTop()}function n(){function t(t){s(),c.trigger("DOMEventor:flatresize",p),e=!1}var e;d.on("resize.DOMEventor-nextResizeLoop",function(){e||(m(t),e=!0)})}function o(){function t(t){i--||(g.documentHeight=p.documentHeight,p.documentHeight=u.height(),i=1),g.windowScrollTop=g.windowScrollY=p.windowScrollTop,p.windowScrollTop=p.windowScrollY=d.scrollTop(),c.trigger("DOMEventor:flatscroll",p),e=!1}var e,i=0;d.on("scroll.DOMEventor-nextScrollLoop",function(){e||(m(t),e=!0)})}function r(){u.off("keydown.DOMEventor keyup.DOMEventor"),c.on("DOMEventor:startKeyboardObserver",_),c.off("DOMEventor:stopKeyboardObserver")}function a(){s(),o(),n(),_(),c.on("DOMEventor:updateRect",s)}var l=i(3),h=i(8),c=i(109),u=h(document),d=h(window),p={},g={};p.documentHeight=g.documentHeight=null,p.windowHeight=g.windowHeight=null,p.windowWidth=g.windowHeight=null,p.windowScrollTop=g.windowScrollTop=null,p.windowScrollY=g.windowScrollY=null;var _,m=!Object.hasOwnProperty.call(window,"requestAnimationFrame")&&window.requestAnimationFrame||!Object.hasOwnProperty.call(window,"webkitRequestAnimationFrame")&&window.webkitRequestAnimationFrame||!Object.hasOwnProperty.call(window,"mozRequestAnimationFrame")&&window.mozRequestAnimationFrame||!Object.hasOwnProperty.call(window,"oRequestAnimationFrame")&&window.oRequestAnimationFrame||function(t){window.setTimeout(function(){t()},50)};_=function(){var t=[],e={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"escape",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"leftmeta",92:"rightmeta",93:"rightmeta",96:"num0",97:"num1",98:"num2",99:"num3",100:"num4",101:"num5",102:"num6",103:"num7",104:"num8",105:"num9",106:"multiply",107:"add",109:"subtract",110:"decimal",111:"devide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:"semicolon",187:"equal",188:"comma",189:"dash",190:"period",191:"forwardslash",192:"graveaccent",219:"openbracket",220:"backslash",221:"closebracket",222:"singlequote"};u.on("keydown.DOMEventor keyup.DOMEventor",function(i){var s=i.type;if("keyup"===s||"keydown"===s){var n=h(i.target),o=i.which;if(!((n.is("input")||n.is("textarea")||n.is("select"))&&o>=48&&90>=o)||i.metaKey||i.ctrlKey||i.altKey){o>=48&&90>=o&&"keydown"===s&&(t[o]=1);var r="";for(var a in t)"keydown"===s&&o!==parseInt(a,10)&&(r+=e[a]?e[a]+"+":"");var l=s+":"+(i.altKey&&18!==o?"alt+":"")+(i.ctrlKey&&17!==o?"ctrl+":"")+(i.metaKey&&91!==o&&92!==o&&93!==o?"meta+":"")+(i.shiftKey&&16!==o?"shift+":"")+(r||"")+(e[o]||"");c.trigger("DOMEventor:"+l,i,l),"keyup"===s&&(t=[])}}}),c.off("DOMEventor:startKeyboardObserver"),c.on("DOMEventor:stopKeyboardObserver",r)};var f={init:l.once(a),rect:function(){return p},lastRect:function(){return g}};t.exports=f},function(t,e,i){"use strict";var s=i(3),n=i(7),o=function(){};o.extend=n.Model.extend,s.extend(o.prototype,n.Events),o.prototype.trigger=function(){return s.isObject(arguments[1])&&(arguments[1].loggingData=arguments[1].loggingData||{}),n.Events.trigger.apply(this,arguments)},t.exports=new o},function(t,e,i){"use strict";var s,n=i(111),o=i(99),r=i(109),a=function(){if(null==s){var t=o.get("Context/userinfo");s=t&&t.name?new n(t):!1,s&&(s.listenTo(r,"post:like:set",s.incrementLikeCount),s.listenTo(r,"post:unlike:set",s.decrementLikeCount),s.listenTo(r,"tumblelog:follow",s.incrementFollowingCount),s.listenTo(r,"tumblelog:unfollow",s.decrementFollowingCount))}return s};t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(112),o=i(113),r=i(117),a=n.extend({idAttribute:"name",initialize:function(t){this.channels=new r(t.channels)},incrementLikeCount:function(){var t=this.get("liked_post_count");this.set("liked_post_count",t+1)},decrementLikeCount:function(){var t=this.get("liked_post_count");t>0&&this.set("liked_post_count",t-1)},incrementFollowingCount:function(){var t=this.get("friend_count");this.set("friend_count",t+1)},decrementFollowingCount:function(){var t=this.get("friend_count");t>0&&this.set("friend_count",t-1)},getUnreadCount:function(){return this.channels.reduce(function(t,e){return parseInt(t,10)+parseInt(e.get("unread_count"),10)},0)},getChannel:function(t){return null==t&&(t=this.get("primary")),this.channels.findWhere({name:t})},canMessage:function(){return this.get("can_message")},isSoundsEnabled:function(){return this.get("is_sounds_enabled")},isVerifiedEmail:function(){return this.get("is_verified_email")},getChannelsEnabledForMessaging:function(){return this.channels.where({can_send_messages:!0})},getCurrentMessagingChannelUuid:function(){var t;return s.isEmpty(this._currentMessagingChannelUuid)&&(t=this.channels.findWhere({is_current:!0,can_send_messages:!0})||s.first(this.getChannelsEnabledForMessaging()),t&&(this._currentMessagingChannelUuid=t.get("uuid"))),this._currentMessagingChannelUuid},setCurrentMessagingChannelUuid:function(t){this._currentMessagingChannelUuid=t},toJSON:function(){var t=o.prototype.toJSON.apply(this,arguments);return t.channels=this.channels.toJSON(),t},getChannelProperty:function(t,e){var i=this.getChannel(t);if(!(i&&"get"in i))return null;var s=i.get(e);return"undefined"==typeof s?null:s}});t.exports=a},function(t,e,i){"use strict";function s(t,e){function i(t,e){var i,s;if(!n.isObject(t))throw new Error("SingletonModel requires attributes");if(i=t[d],n.isEmpty(i)&&!n.isNumber(i)&&n.defer(function(){throw new Error('SingletonModel attributes require a "'+d+'"')}),s=c[i],u[i]++||(u[i]=1),s)n.keys(t).length>=2&&s.set(t,e),s.collection!==!0&&(s.collection=!0);else{c[i]=this;try{Object.defineProperty(this,"collection",{value:!0,configurable:!1,enumerable:!0,writable:!1})}finally{this.collection||(this.collection=!0)}this.constructor.__super__.constructor.call(this,t,e),h.add(this)}return s||this}function s(){return this.id}function a(){return h}function l(){0===--u[this.id]&&(delete c[this.id],delete u[this.id],h.remove(this))}t||(t={}),e||(e={});var h=new o.Collection,c=Object.create(null),u=Object.create(null),d=t.idAttribute||r.prototype.idAttribute;return t.constructor=i,t.release=l,t.toString=s,t.toJSON=t.toJSON||r.prototype.toJSON,e.getCollection=a,r.extend(t,e)}var n=i(3),o=i(7),r=i(113);t.exports.extend=s},function(t,e,i){"use strict";var s=i(7),n=i(114),o=i(116),r=s.Model.extend({});n.applyTo(r.prototype),o.applyTo(r),t.exports=r},function(t,e,i){"use strict";var s=i(115),n=new s({before:{sync:function(t,e,i){i.withFormKey=!0}}});t.exports=n},function(t,e,i){"use strict";function s(t,e){c.each(e,function(e,i){var s=t[i];t[i]=function(){return e.apply(this,arguments),s.apply(this,arguments)}})}function n(t,e){c.each(e,function(e,i){var s=t[i];t[i]=function(){var t=s.apply(this,arguments);return e.apply(this,arguments),t}})}function o(t,e){c.each(e,function(e,i){var s=t[i];t[i]=function(){var t=c.toArray(arguments);return t.unshift(c.bind(s,this)),e.apply(this,t)}})}function r(t,e){c.each(e,function(e,i){var s=i in t?t[i]:!1;t[i]=function(){var t=c.toArray(arguments),i=s?c.bind(s,this):c.noop;return t.unshift(i),e.apply(this,t)}})}function a(t,e){c.defaults(t,e)}function l(t,e){c.extend(t,e)}function h(){this.mixins=c.filter(arguments,function(t){return t instanceof h}),this.properties=arguments[this.mixins.length]||{}}var c=i(3);h.prototype.mixins=null,h.prototype.properties=null,h.prototype.applyTo=function(t){var e=this.properties;a(t,e.defaults),l(t,e.extend),c.extend(t,c.omit(e,"before","after","around","onto","defaults","extend","applyTo")),c.invoke(this.mixins,"applyTo",t),s(t,e.before),n(t,e.after),o(t,e.around),r(t,e.onto),c.isFunction(e.applyTo)&&e.applyTo.apply(this,arguments)},h.before=s,h.after=n,h.around=o,h.onto=r,t.exports=h},function(t,e,i){"use strict";function s(t){var e=r.apply(this,arguments);return o.has(t,"mixins")&&t.mixins.forEach(function(t){t.applyTo(e.prototype)}),e}function n(t){t.extend=s}var o=i(3),r=i(7).Model.extend;t.exports.applyTo=n},function(t,e,i){"use strict";var s=i(118),n=i(119),o=s.extend({model:n});t.exports=o},function(t,e,i){"use strict";var s=i(7).Collection,n=i(114),o=i(116),s=s.extend();n.applyTo(s.prototype),o.applyTo(s),t.exports=s},function(t,e,i){"use strict";function s(t,e,i){var s=a.Deferred(),n={data:{tumblelog:t.get("name")}};["placement_id","pt","source","context","tlt","offset"].forEach(function(t){i.hasOwnProperty(t)&&(n.data[t]=i[t])});var o=function(){i.wait||t.set({following:e.following},i)},r=function(n,o){i.wait||t.set({following:!e.following},i),s.reject(o)},l=function(){i.wait&&t.set({following:e.following},i),s.resolve()},h=e.following?"/svc/follow":"/svc/unfollow";return a.ajax({beforeSend:o,cache:!i.force,data:n,error:r,type:"POST",success:l,url:h,withFormKey:!0}),s.promise()}function n(t,e){var i=a.Deferred(),s={};l.has(e,"is_tumblelog_popover")&&(s.is_tumblelog_popover=e.is_tumblelog_popover),l.has(e,"is_user_mention")&&(s.is_user_mention=e.is_user_mention);var n=function(t,e){i.reject(e)},o=function(e){l.has(e,"highlighted_posts")||(e={highlighted_posts:e}),t.set(e),i.resolve()};return a.ajax({cache:!e.force,data:s,error:n,type:"GET",success:o,url:p(t),withFormKey:!0}),i.promise()}function o(t,e){return h.promise(function(i,s){var n={tumblelog:t.get("name")};l.has(e,"include_member_data")&&(n.include_member_data=e.include_member_data),l.has(e,"include_activity_data")&&l.has(e,"include_member_data")&&(n.include_activity_data=e.include_activity_data),l.has(e,"include_activity_notifications")&&l.has(e,"include_member_data")&&(n.include_activity_notifications=e.include_activity_notifications);var o=function(t,e){s(e)},r=function(e){t.set(e.response),i()};a.ajax({data:n,type:"GET",error:o,success:r,url:"/svc/data/tumblelog",withFormKey:!0})})}function r(t,e){return a.ajax({cache:!e.force,data:e.data,type:"GET",url:"/svc/tumblelog_popover/"+t,withFormKey:!0})}var a=i(8),l=i(3),h=i(120),c=i(109),u=i(141),d=i(112),p=function(){function t(t){return t.has("avatar_url")&&t.has("global_theme_params")}return function(e){return t(e)?"/svc/"+e.get("name")+"/posts/highlighted":"/svc/tumblelog_popover/"+e.get("name")}}(),g=d.extend({save_following:function(t,e){e||(e={}),t||(t={}),t.following=!!t.following;var i=this;return e.force||i.get("following")!==t.following?s(i,t,e).then(l.bindKey(i,"save_following",t)):a.when(i.get("following"))},fetch_popover_data:function(t){t||(t={}),t.is_user_mention=!!t.is_user_mention,t.is_tumblelog_popover=!!t.is_tumblelog_popover;var e=this;return!t.force&&e.has("highlighted_posts")?a.when(e.get("highlighted_posts")):n(e,t).then(l.bindKey(e,"fetch_popover_data",null))},fetch_analytics_data:function(){return o(this,{include_member_data:!0,include_activity_data:!0})},fetch_activity_notifications:function(){return o(this,{include_member_data:!0,include_activity_data:!0,include_activity_notifications:!0})},toggle_spam:function(){return a.ajax({url:"/spam/toggle",type:"POST",data:{tumblelog:this.id},withFormKey:!0})},toggle_nsfw:function(){return a.ajax({url:"/nsfw/toggle",type:"POST",data:{tumblelog:this.id},withFormKey:!0})},toggle_adult:function(){return a.ajax({url:"/adult/toggle",type:"POST",data:{tumblelog:this.id},withFormKey:!0})},toggle_uniblock:function(){return a.ajax({url:"/uniblock/toggle",type:"POST",data:{tumblelog:this.id},withFormKey:!0})},toggle_suspended:function(){return a.ajax({url:"/suspended/toggle",type:"POST",data:{tumblelog:this.id},withFormKey:!0})},follow:function(t){this.save_following({following:!0},t)},_unfollow:function(t){this.save_following({following:!1},t)},requestUnfollow:function(t){var e=h.defer();return e.promise.then(l.bind(this._unfollow,this,t))["catch"](l.noop),e},block:function(){return u.block({blockedTumblelog:this.id})},unblock:function(){return u.unblock({blockedTumblelog:this.id})},toggleSubscription:function(t){var e=this.get("name"),i=!!this.get("is_subscribed"),s=i?"DELETE":"POST",n={url:"/svc/blog/"+e+"/subscription",type:s,withFormKey:!0};return t&&(n.data={source:t}),h.promise(function(t,e){a.ajax(l.assign(n,{success:t,error:e}))}).then(l.bind(function(){this.set({is_subscribed:!i})},this))},defaults:null,idAttribute:"name",initialize:function(){this.bindEvents()},bindEvents:function(){var t=this.get("name");this.on("change:following",function(){if(this.previous("following")){var e=this.get("following")?"tumblelog:follow":"tumblelog:unfollow";c.trigger(e,{name:t,loggingData:t})}this._updateSubscriptionStatus()},this),this.on("change:twitter_send_posts",this._updateUserSocial),this.on("change:facebook_opengraph_send_posts",this._updateUserSocial)},_updateSubscriptionStatus:function(){this.get("following")?this.set("can_subscribe",!0):this.set({can_subscribe:!1,is_subscribed:!1})},_updateUserSocial:function(){var t={tumblelog_name_or_id:this.get("name"),page:"tumblelog","tumblelog[facebook_opengraph_send_posts]":this.get("facebook_opengraph_send_posts")?"on":"off","tumblelog[twitter_send_posts]":this.get("twitter_send_posts")?"on":"off"};a.ajax({data:t,type:"POST",url:"/settings/save",withFormKey:!0})},getDisplayName:function(){return this.get("is_legacy_private_channel")?this.get("directory_safe_title"):this.get("name")},parse:function(t){return t},validate:function(){return!1},destroy:function(){return this},fetch:function(){return this},save:function(){return this},url:function(){},urlRoot:function(){}},{collection:null,modelFromToken:function(t){var e,i=g.getCollection(),s=a.Deferred(),n=i.findWhere({token:t});return n?s.resolve(n):(e={data:{is_user_mention:!0}},r(t,e).then(function(e){var i=new g(e);i.set({token:t}),s.resolve(i)},function(){s.reject()})),s.promise()}});g.collection=g.getCollection(),t.exports=g},,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(100),r=i(99),a=i(142),l=i(120),h={_getCurrentTumblelog:function(){var t="",e=r.get("Context/userinfo");return e&&n.each(e.channels,function(e){e.is_current&&(t=e.name)}),t},block:function(t){t=t||{};var e={};return e.tumblelog=t.currentTumblelog||this._getCurrentTumblelog(),t.blockedTumblelog?e.blocked_tumblelog=t.blockedTumblelog:t.blockedPost&&(e.blocked_post=t.blockedPost),t.context&&(e.block_context=t.context),s.ajax({url:"/svc/block/add",type:"POST",data:e,withFormKey:!0})},unblock:function(t){t=t||{};var e={};return e.tumblelog=t.currentTumblelog||this._getCurrentTumblelog(),e.blocked_tumblelog=t.blockedTumblelog,s.ajax({url:"/svc/block/remove",type:"POST",data:e,withFormKey:!0})},confirmBlock:function(t){t=t||{};var e,i=t.currentTumblelog||this._getCurrentTumblelog(),s=l.defer();if(t.blockedTumblelog)e=o("%1$sAre you sure you want to block %2$s from %3$s?%4$sThey won't be able to follow %3$s, send %3$s messages, see %3$s in search results, or interact with any of %3$s's posts.%5$s","<h3>",t.blockedTumblelog,i,"</h3><small>","</small>");else{if(!t.blockedPost)return s.reject(),s.promise;e=o("%1$sBlock messages from this sender?%2$sAny further messages sent from their IP address will be blocked from your inbox. This can't be undone, by the way.%3$s","<h3>","</h3><small>","</small>")}return a.confirm(e,function(){s.resolve(t.blockedTumblelog?t.blockedTumblelog:t.blockedPost)},function(){s.reject()},o("Block"),o("Nevermind")),s.promise["catch"](n.noop),s.promise}};t.exports=h},function(t,e,i){"use strict";var s=i(3),n=i(143),o=i(147),r=n.extend({name:"Dialog",initialize:function(t){this.dialogView=o,this.options=s.extend({},this.defaults,t)},alert:function(t,e,i){return this.dialogView.alert.call(this.dialogView,t,e,i)},confirm:function(t,e,i,s,n){return this.dialogView.confirm.call(this.dialogView,t,e,i,s,n)},dialog:function(t){return this.dialogView.dialog.call(this.dialogView,t)},isActive:function(t){return this.dialogView.isActive.call(this.dialogView,t)},close:function(t){return this.dialogView.close.call(this.dialogView,t)},getDialogEl:function(){return this.dialogView.getDialogEl.call(this.dialogView)},__:function(t){return this.dialogView.__.call(this.dialogView,t)}});t.exports=new r},function(t,e,i){"use strict";var s=i(3),n=i(7),o=i(144),r=i(99),a=(i(102),i(145)),l=i(146),h=["selector","container","rootEl","view","viewOptions","autoAppend"],c=o.extend({name:null,rootEl:null,selector:null,view:null,viewOptions:{},autoAppend:!1,defaults:{},constructor:function(t){t||(t={}),this.cid=s.uniqueId("component"),s.extend(this,s.pick(t,h));var e=s.result(this,"defaults"),i=s.extend({},e,s.pick(t,s.keys(e)));this.attributes={},this.set(i,{silent:!0}),this.changed={},(this.autoAppend||this.selector)&&this.setContainer(),this.selector||(this.selector=this.defaultSelector);var o=s.isFunction(this.viewOptions)?this.viewOptions.call(this.viewOptions,this):this.viewOptions;this.view&&this.view.prototype&&this.view.prototype instanceof n.View?this.view=new this.view(o):s.isFunction(this.view)&&(this.view=this.view.call(this,o)),this.initialize.apply(this,arguments),this.autoAppend&&this.append()},initialize:s.noop,setContainer:function(){return this.selector||(this.selector=this.defaultSelector),this.container=this.selector,this.container},getOwnData:function(){return this.data},remove:function(){s.result(this,"beforeRemove"),this.view&&s.isFunction(this.view.remove)&&this.view.remove();var t=["container","view","defaults","attributes"];return s.each(t,s.bind(function(t){this[t]&&delete this[t]},this)),this.stopListening(),this.trigger("remove"),this},append:function(){return this.view&&s.isFunction(this.view.render)&&(this.container?this.container.appendChild(this.view.render().el):this.view.render()),this.trigger("append"),this}});Object.defineProperties(c.prototype,{defaultSelector:{get:function(){return"[prima-component="+this.name+"]"},set:function(){}},container:{get:function(){return this._container},set:function(t){var e=a(t,this.rootEl);this._container=e}},data:{get:function(){return this._data||(this._data=r.get("Components/"+this.name)),this._data},set:function(t){this._data=t}}}),l.mixin.applyTo(c.prototype),t.exports=c},function(t,e,i){"use strict";function s(){}var n=i(7),o=i(116);s.extend=n.Model.extend,o.applyTo(s),t.exports=s},function(t,e,i){"use strict";function s(t){return t&&t.nodeType&&1===t.nodeType}var n=i(3);t.exports=function(t,e){if(s(t))return t;if(n.isString(t)){var i=(e||document).querySelector(t);if(s(i))return i}return t&&t.jquery?t.get(0):!1}},function(t,e,i){"use strict";var s=i(3),n=i(7),o=i(115),r=n.Model.prototype,a={get:r.get,has:r.has,set:r.set,unset:r.unset,clear:r.clear,hasChanged:r.hasChanged,changedAttributes:r.changedAttributes,previous:r.previous,toJSON:r.toJSON,toggle:function(t){this.set(t,!this.get(t))},_validate:s.constant(!0)},l=new o(s.extend({},a,{defaults:s.extend({},n.Events)}));t.exports={props:a,mixin:l}},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(148),r=i(109),a=i(100),l=i(149),h=o.extend({el:".ui_dialog",translations:{},defaultTemplates:{dialog:i(150),content:i(151),button:i(152)},events:{"click .ui_button":"buttonClick"},defaultDialog:{text:"",type:"default",has_form:"auto",visible_glass:!0,confirm_by_enter:!0,close_by_space:!0,key_tab:!0,key_close:!0,scroll_lock:!1,keycommand_maintain:!1,animate:!0,animate_in:{dialog_el:".ui_dialog",dialog_class:"fade-in-up"},on_close:function(){},on_open:function(){}},initialize:function(t){this.options=n.extend(this.defaults,this.options),this.templates=this.defaultTemplates,this.is_visible=!1,this.dialogQueueOrder=[],this.dialogQueue={},this.queueCounter=0,this.currentDialog=!1,this.currentDialogId=0,this.uid=0,this.$body=s("body"),this._initClickLock(),this._setupKeys(),r&&!e.Dialog&&(this.listenTo(r,"dialog:dialog",this.dialog),this.listenTo(r,"dialog:confirm",this.confirm),this.listenTo(r,"dialog:confirm:promise",this.confirmPromise),this.listenTo(r,"dialog:alert",this.alert),this.listenTo(r,"dialog:close",this.close))},dialog:function(t){return n.isObject(t)?this._dialog(t):!1},confirm:function(t,e,i,s,o){n.isString(t)&&(t={text:t});var r={callback_ok:e,callback_cancel:i,text_ok:s,text_cancel:o};t=n.extend(this.defaultDialog,r,t);var l={text:t.text,customClass:t.customClass||null,type:"confirm",visible_glass:!0,keycommand_maintain:t.keycommand_maintain||!1,templates:t.templates||null,escape_button:0,animate_in:{dialog_el:t.animate_in.dialog_el||".ui_dialog",dialog_class:t.animate_in.dialog_class||"fade-in-up"},buttons:{0:{text:t.text_cancel||a("Cancel"),close:!0,callback:n.isFunction(t.callback_cancel)?t.callback_cancel:function(){}},1:{text:t.text_ok||a("OK"),selected:!0,btn_class:"blue",close:!0,callback:n.isFunction(t.callback_ok)?t.callback_ok:function(){}}}};return this._dialog(l)},confirmPromise:function(t,e){this.confirm(e,t.resolve,t.reject)},alert:function(t,e,i){n.isString(t)&&(t={text:t});var s={callback_ok:e,text_ok:i};t=n.extend({},s,t);var o={text:t.text,customClass:t.customClass||null,type:"alert",visible_glass:!0,keycommand_maintain:t.keycommand_maintain||!1,templates:t.templates||null,escape_button:0,buttons:{0:{text:t.text_ok||a("OK"),selected:!0,btn_class:"blue",close:!0,callback:n.isFunction(t.callback_ok)?t.callback_ok:function(){}}}};return this._dialog(o)},getDialogEl:function(){return this.el},buttonClick:function(t){var e=s(t.currentTarget),i=e.data("btn-id");if(n.isUndefined(this.currentDialog.buttons[i])||e.hasClass("disabled"))return!1;var o=this.currentDialog.buttons[i],r=null;n.isFunction(o.callback)&&(r=o.callback(this)),r!==!1&&(!n.isUndefined(o.close)&&o.close||n.isUndefined(o.close))&&this.close()},isActive:function(t){return this.currentDialog!==!1&&this.currentDialog.uid===t},close:function(t){if(this.currentDialog===!1)return!1;if(n.isUndefined(t)&&(t=!1),t!==!1&&this.currentDialog.uid!==t)return!1;if(this.$dialog_lock.removeClass("opaque"),this.$dialog_el.addClass("fade-out-down"),l.transition(this.$dialog_lock,n.bind(function(){this.$dialog_lock.hide()},this)),l.animation(this.$dialog_el,n.bind(function(){s(".ui_dialog_pos").remove()},this)),this.is_visible=!1,this.currentDialog.keycommand_maintain||r.trigger("keycommands:resume"),n.isFunction(this.currentDialog.on_close)&&this.currentDialog.on_close(),r.trigger("dialog:closed"),this.currentDialog=!1,s("html").removeClass("dialog_lock"),this.dialogQueueOrder.length>0){var e=this.dialogQueueOrder.shift(),i=this.dialogQueue[e];delete this.dialogQueue[e],this._dialog(i)}},_tab:function(t){var e=this.$el.find(".buttons .tab_frame"),i=e.filter(".focus"),s=e.index(i),n=e.length,o=!1;o=n>s+1?s+1:0,i.removeClass("focus init_focus");var r=e.eq(o);r.length>0&&(r.addClass("focus"),r.find("button").focus())},_formIsTabToButton:function(t,e){var i=this.$el.find(":focus");if(0===i.length)return!0;var s=this.$el.find(".buttons .tab_frame"),n=this.$el.find(":input:visible"),o=n.index(i);if(e&&o===n.length-1)return this.$el.find(":input:visible:first").focus(),t.preventDefault(),s.removeClass("focus init_focus"),!1;if(o>=0){var r=this.$el.find(":input:visible:eq("+(o+1)+")");if(r.length>0&&r.hasClass("ui_button"))return!0}return s.removeClass("focus init_focus"),!1},_select:function(t){var e=this.$el.find(".buttons .tab_frame.focus"),i=e;1===i.length&&i.find(".ui_button").click()},_formIsFocusOnButton:function(t){var e=this.$el.find(":focus");return 0===e.length?!1:e.hasClass("ui_button")},_escape:function(t){if(!n.isUndefined(this.currentDialog.escape_button)){var e=this.$el.find(".btn_"+this.currentDialog.escape_button);e.length&&e.click()}},_dialog:function(t){if(n.isUndefined(t.uid)&&(t.uid=this._getUid()),this.currentDialog!==!1)return this.dialogQueueOrder.push(this.queueCounter),this.dialogQueue[this.queueCounter]=t,this.queueCounter++,t.uid;n.defaults(t,this.defaultDialog);var e=this._buildButtons(t.buttons);n.extend(t,{buttons_html:e});var i=this.templates;n.isObject(t.templates)&&(i=n.extend({},this.templates,t.templates));var o=n.isString(i.dialog)?n.template(i.dialog):i.dialog,a=n.isString(i.content)?n.template(i.content):i.content;t.content_html=a(t);var l=o(t);this.$dialog_lock.show(),n.isUndefined(t.visible_glass)?this.$dialog_lock.removeClass("opaque"):t.visible_glass&&n.defer(n.bind(function(){this.$dialog_lock.addClass("opaque")},this)),!n.isUndefined(t.scroll_lock)&&t.scroll_lock&&s("html").addClass("dialog_lock"),this.currentDialogId=t.uid,this.currentDialog=t;var h=s('<div id="dialog_'+this.currentDialogId+'" class="ui_dialog_pos">'+l+"</div>");return n.isString(t.customClass)&&h.addClass(t.customClass),h.appendTo(this.$body),this.setElement(h),this.is_visible=!0,this.$dialog_el=this.$el.find(t.animate_in.dialog_el),t.animate&&n.isObject(t.animate_in)&&this.$dialog_el.length&&this.$dialog_el.addClass(t.animate_in.dialog_class),this._focus(),this.currentDialog.keycommand_maintain||r.trigger("keycommands:suspend"),n.isUndefined(t.has_form)&&(t.has_form="auto"),"auto"===t.has_form&&(t.has_form=this.$el.find("form, input").length>0),n.isFunction(t.on_open)&&t.on_open(),this.el=this.$el[0],this.delegateEvents(),r.trigger("dialog:opened"),t.uid},_button:function(t,e,i,s){var o=n.isString(this.templates.button)?n.template(this.templates.button):this.templates.button,r=o({btn_class:e,text:t,btn_id:n.isUndefined(i)?"":i});return r='<div class="tab_frame">'+r+"</div>"},_focus:function(){if(!this.currentDialog)return!1;for(var t in this.currentDialog.buttons){var e=this.currentDialog.buttons[t];if(!n.isUndefined(e.selected)&&e.selected){var i=this.$el.find(".btn_"+t);i.length>0&&i.parent().addClass("focus init_focus")}}},_setupKeys:function(){s(document).on("keydown",n.bind(function(t){var e=t.ctrlKey||t.shiftKey||t.metaKey;if(this.is_visible&&!e){var i=t.keyCode||t.which;if(9===i&&this.currentDialog.key_tab){if(this.currentDialog.has_form&&!this._formIsTabToButton(t,!0))return;t.preventDefault(),this._tab(t)}if(13===i&&this.currentDialog.confirm_by_enter||32===i&&this.currentDialog.close_by_space){if(this.currentDialog.has_form&&32===i&&!this._formIsFocusOnButton(t))return;t.preventDefault(),this._select(t)}27===i&&this.currentDialog.key_close&&(t.preventDefault(),this._escape(t))}},this))},_buildButtons:function(t){if(!n.isObject(t))return"";var e=0;for(var i in t)t.hasOwnProperty(i)&&e++;for(var s="",o=0;e>o;o++)if(!n.isUndefined(t[o])){var r=n.isUndefined(t[o].text)?"":t[o].text,a=n.isUndefined(t[o].btn_class)?"":t[o].btn_class,l=n.isUndefined(t[o].selected)?!1:t[o].selected;s+=this._button(r,a,o,l)}return s;
  },_initClickLock:function(){var t=this.$dialog_lock=s("<div>",{"class":"ui_dialog_lock",css:{display:"none"}});s(document).ready(function(){t.prependTo("body")})},_getUid:function(){return this.uid++},__:function(t){return a(t)}});t.exports=new h},function(t,e,i){"use strict";function s(t,e){e||(e={}),t||(t=[]),n.each(t,function(t){n.isFunction(this[t])&&this[t].call(this,e)},this)}var n=i(3),o=i(7),r=i(116),a=["model","collection","el","id","attributes","className","tagName","events"],l=["_setup"],h=o.View.extend({constructor:function(t){this.cid=n.uniqueId("view"),t||(t={}),n.extend(this,n.pick(t,a)),this._elAttributes=this.attributes,this.attributes={},this._ensureElement(),this.setupMethods=n.union(l,this.constructor.__super__.setupMethods,this.setupMethods),s.call(this,this.setupMethods,t),this.initialize.apply(this,arguments),this.delegateEvents()},_setup:n.noop,_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"),!1);else{var t=n.extend({},n.result(this,"_elAttributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t["class"]=n.result(this,"className"));var e=o.$("<"+n.result(this,"tagName")+">").attr(t);this.setElement(e,!1)}}});r.applyTo(h),t.exports=h},function(t,e,i){"use strict";function s(){var t,e,i={animation:null,transition:null},s=document.createElement("div"),n={animation:"animationend",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(e in n)if(e in s.style){i.animation=n[e];break}var o={transition:"transitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in o)if(t in s.style){i.transition=o[t];break}return i}function n(t,e){a.animation?r(t).one(a.animation,function(t){e(t)}):setTimeout(function(t){e(t)},0)}function o(t,e){a.transition?r(t).one(a.transition,function(t){e(t)}):setTimeout(function(t){e(t)},0)}var r=i(8),a=s();t.exports={animation:n,transition:o}},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<div class="ui_dialog '+(null==(__t=type)?"":__t)+'"> '+(null==(__t=content_html)?"":__t)+' <div class="buttons">'+(null==(__t=buttons_html)?"":__t)+"</div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<span class="text">'+(null==(__t=text)?"":__t)+"</span>";return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<button class="ui_button btn_'+(null==(__t=btn_id)?"":__t)+" chrome "+(null==(__t=btn_class)?"":__t)+'" data-btn-id="'+(null==(__t=btn_id)?"":__t)+'"><span>'+(null==(__t=text)?"":__t)+"</span></button>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s,n=i(143),o=i(154),r=n.extend({name:"header",autoAppend:!0,append:function(){this.headerView=new o({el:this.container}),this.enableFunctionality()},enableFunctionality:function(){this.headerView.enableCompose()},disableSticky:function(){this.headerView.disableSticky()}});t.exports=function(){return s||(s=new r),s}},function(t,e,i){"use strict";var s=i(8),n=i(155),o=i(107),r=i(109),a=i(158),l=i(160),h=i(550),c=i(551),u=i(562),d=i(591),p=i(110),g=n.extend({defaults:{headerHeight:52,headerTop:0},events:{"click .tab_discover > a":"onClickExplore",mouseenter:"__mouseenter",mouseleave:"__mouseleave"},initialize:function(){var t=o.bool("is_logged_in");this.logo=new h({el:'[prima-component="header-logo"]'}),t&&(this.accountMenu=new c({el:".tab_nav_account"}),s(".tab_activity").length&&(this.activityMenu=new u({el:".tab_activity"})),this._initializeMessaging()),this.set("headerTop",this.$el.position().top),this.listenTo(r,"Header:hide",this.hide),this.listenTo(r,"Header:show",this.show),this.listenTo(r,"Header:setTransparent",this.setTransparent),this.$window=s(window)},enableCompose:function(){this.composeBtn=new a,this.switcher=new l},disableSticky:function(){this.$el.addClass("l-header-container--unstuck")},setTransparent:function(t){this.$el.toggleClass("l-header-container--transparent",!!t)},hide:function(){var t=this.$window.scrollTop()+this.get("headerTop"),e=t<this.get("headerHeight")?t:this.get("headerHeight");this.$el.css({position:"absolute",top:t+"px"}),this.$el.velocity({translateY:[-e,0],translateZ:"0px"},150).velocity({translateY:"0px",translateZ:"0px",top:0},0)},show:function(){var t=this.$window.scrollTop(),e=t<this.get("headerHeight")?t:this.get("headerHeight");this.$el.css({position:"absolute",top:t+"px",transform:"translateY("+-e+"px) translateZ(0)"}),this.$el.velocity({translateY:[0,-e],translateZ:"0px"},150).css({position:"fixed",top:this.get("headerTop")})},onClickExplore:function(){r.trigger("explore-links:click",{loggingData:{source:"app-header"}})},_initializeMessaging:function(){var t=p(),e=this.$(".tab_messaging"),i=o.bool("is_logged_in")&&e.length>0&&t.canMessage();i?this.messaging=new d({inboxAnchorEl:e,inboxPopoverOptions:{isFixedPosition:"fixed"===this.$el.css("position")}}).render():e.length&&e.hide()},__mouseenter:function(){r.trigger("Header:mouseenter")},__mouseleave:function(){r.trigger("Header:mouseleave")}});t.exports=g},function(t,e,i){"use strict";function s(t,e,i){return n.isFunction(t)&&(t=t(e,i)),t instanceof o?t:e.$(t)}var n=i(3),o=i(8),r=i(7),a=i(120),l=i(156),h=i(157),c=i(146),u=i(148),d=u.extend({rendered:!1,disposed:!1,keepElement:!1,_setup:function(t){t||(t={});var e=n.extend({},n.result(this.constructor.__super__,"defaults"),n.result(this,"defaults"));n.extend(e,n.pick(t,n.keys(e))),this.attributes={},this.set(e),this.changed={};var i=this.render;this.render=n.bind(function(){this._beforeRender.apply(this,arguments),this.beforeRender.apply(this,arguments);var t=i.apply(this,arguments);return this.afterRender.apply(this,arguments),this._afterRender.apply(this,arguments),t},this);var s=this.remove;this.remove=n.bind(function(){if(this.disposed)return this;this._beforeRemove.apply(this,arguments),this.beforeRemove.apply(this,arguments);var t=s.apply(this,arguments);return this.afterRemove.apply(this,arguments),this._afterRemove.apply(this,arguments),t},this),this.subviews=n.extend({},this.subviews,t.subviews)},initialize:n.noop,_registerSubview:function(t){return this._subviews||(this._subviews=[]),this._subviews.push(t),t},appendSubview:function(t,e){return n.isString(e)&&(e=this.$(e)),this._registerSubview(t),t.render(),(e||this.$el).append(t.el),t},removeSubviews:function(){var t=n.flatten(this._subviews);t&&(n.invoke(t,"remove"),delete this._subviews)},renderSubviews:function(){this.subviews&&n.forEach(this.subviews,function(t,e){t instanceof r.View?this.renderSubview(t,{name:e}):t.collection?this.renderCollectionSubviews(e):this.renderSubview(e)},this)},_createDefaultContainerFunction:function(t){return n.bind(function(){return this.$('[data-subview="'+t+'[]"]')},this)},_createDefaultPrepareViewFunction:function(t){var e=this.subviews[t];return n.bind(function(i,s){var n=new e.constructor(s);return n.$el.attr("data-subview",t),i.append(n.$el),n},this)},renderCollectionSubviews:function(t){var e=this.subviews[t];if(e){var i=e.container||this._createDefaultContainerFunction(t),s=e.prepareView||this._createDefaultPrepareViewFunction(t),n=e.options||{},o=this.createCollectionSubviewRenderer(e.collection,i,s,n,t);this.rendered?o():this.once("rendered",o,this)}},renderSubview:function(t,e){var i,s,o,a;if(n.isString(t)){if(a=t,t=this.subviews[a],!t)return;i=t.container||'[data-subview="'+a+'"]',o=t.options||{},s=t.prepareView||function(e,i){if(!n.isEmpty(e)){var s=new t.constructor(i);return s.$el.attr("data-subview",a),e.replaceWith(s.$el),s}}}else t instanceof r.View&&(e||(e={}),a=e.name||"",i=e.container||'[data-subview="'+a+'"]',o=e.options||{},s=e.prepareView||function(e){return t.$el.attr("data-subview",a),e.replaceWith(t.$el),t});var l=this.createSubviewRenderer(i,s,o,a);this.rendered?l():this.once("rendered",l,this)},createSubviewRenderer:function(t,e,i,o){return n.bind(function(){if(this.el){i=i||{},n.isFunction(i)&&(i=i.call(i,this));var r=s(t,this,o);if(!n.isEmpty(r)){var a=e.call(this,r,i);o&&n.set(this,o,a),a.render(),this._registerSubview(a)}}},this)},createCollectionSubviewRenderer:function(t,e,i,o,a,l,h){var c;return n.bind(function(){if(this.el){var u=0;if(a&&(l?u=this[a].length:this[a]=[]),t===!0&&(t=this.collection),n.isFunction(t)&&(t=t(this)),t instanceof r.Collection&&(t=t.models),!n.isEmpty(t)){var d=s(e,this,a);n.isEmpty(d)||(l||(c=d,d=c.clone()),n.forEach(t,function(t,e){var s;s=n.isFunction(o)?o.call(o,this,t)||{}:n.extend({},o),s.model||(s.model=t);var r="";a&&(r=a+"["+(u+e)+"]"),h&&n.extend(s,h),this.createSubviewRenderer(d,i,s,r).call(this)},this),l||c.replaceWith(d))}}},this)},_beforeRender:n.noop,beforeRender:n.noop,render:function(){return this.disposed?!1:(this.renderWithTemplate(),this)},afterRender:n.noop,_afterRender:function(){this.renderSubviews(),this.rendered=!0,this.trigger("rendered",this),this._verifySubviewsRendered()},getTemplateData:function(){var t=l(this);return this.model&&(t.model=l(this.model)),this.collection&&(t.collection={items:l(this.collection),length:this.collection.length}),t},renderWithTemplate:function(t){if(n.isUndefined(this.template))throw new Error("Template function needed.");var e;return e=n.isFunction(this.template)?this.template(t||this.getTemplateData()):this.template,this.$el.html(e),this},afterRenderSubviews:n.noop,_verifySubviewsRendered:function(){var t=n.bind(function(){this.afterRenderSubviews(),this.trigger("renderedSubviews")},this),e=n.reject(this._subviews,function(t){return t.rendered===!0||t._rendered===!0});n.isEmpty(e)?t():a.map(e,function(t){return a.promise(n.partial(function(e,i){t.once("rendered",e)},t))}).then(t)},_beforeRemove:function(){this.removeSubviews()},beforeRemove:n.noop,remove:function(){return this.keepElement?(this.undelegateEvents(),this.stopListening()):u.prototype.remove.apply(this,arguments),this},afterRemove:n.noop,_afterRemove:function(){var t=["el","$el","options","model","collection","subviews","_subviews","defaults","attributes"];n.forEach(t,n.bind(function(t){this[t]&&delete this[t]},this)),this.rendered=!1,this.disposed=!0}},{subviewWithOptions:function(t){return h.call(null,this,t)}});c.mixin.applyTo(d.prototype),t.exports=d},function(t,e,i){"use strict";function s(t){return n.isFunction(t.serialize)?t.serialize():n.isFunction(t.toJSON)?t.toJSON():void 0}var n=i(3);t.exports=s},function(t,e,i){"use strict";function s(t,e){return{constructor:t,options:function(t){var i=n.isFunction(e)?e(t):e;return n.extend(n.pick(t,t.viewOptionKeys),i)}}}var n=i(3);t.exports=s},function(t,e,i){"use strict";var s=i(107),n=i(148),o=i(109),r=i(159),a=n.extend({mixins:[r],el:".compose-button",events:{click:"toggleOpen"},defaults:{open:!1},loggingData:{source:"compose-button"},initialize:function(){this.on("change:open",this.onChangeOpen),s.bool("dashboard_refresh")?(this.listenTo(o,"fastCompose:init:complete",this.open),this.listenTo(o,"fastCompose:dismiss:complete",this.close)):(this.listenTo(o,"fastCompose:init:complete",this.open),this.listenTo(o,"fastCompose:dismiss:complete",this.close))},toggleOpen:function(){this.toggle("open")},open:function(){this.set("open",!0)},close:function(){this.set("open",!1)},onChangeOpen:function(t,e){s.bool("dashboard_refresh")?e?o.trigger("fastCompose:init",{loggingData:this.loggingData}):o.trigger("fastCompose:dismiss",{loggingData:this.loggingData}):e?o.trigger("fastCompose:init"):o.trigger("fastCompose:dismiss")}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(7),o=i(115),r=i(146),a=new o(s.extend({},r.props,{defaults:s.extend({},n.Events),before:{initialize:function(){var t=s.defaults({},s.result(this,"defaults"));this.attributes={},this.set(t),this.changed={}}}}));t.exports=a},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(143),r=i(109),a=i(161),l=i(163),h=o.extend({name:"switcher",mixins:[a],keycommands:{"keydown:alt+c":"macFastCompose","keydown:z+c":"winFastCompose"},loggingData:{},initialize:function(){this.$body=s("body"),this.$glass=null,this.suspended=!1,this.bindEvents()},bindEvents:function(){this.listenTo(r,"keycommands:suspend",this.suspend),this.listenTo(r,"keycommands:resume",this.resume),this.listenTo(r,"fastCompose:close:complete",this.dismissFastCompose),this.listenTo(r,"fastCompose:dismiss",this.dismissFastCompose),this.listenTo(r,"fastCompose:init",this.initFastCompose)},suspend:function(){this.suspended=!0},resume:function(){this.suspended=!1},macFastCompose:function(t){"MacIntel"===navigator.platform&&this.initFastCompose(t)},winFastCompose:function(t){"Win32"===navigator.platform&&this.initFastCompose(t)},initFastCompose:function(t){this.suspended||this.fastCompose||(this.determineSource(t),this.fastCompose=new l({loggingData:this.loggingData}),this.$body.append(this.fastCompose.render().el),this.showPlexi(),this.fastCompose.open(),r.trigger("fastCompose:init:complete"))},dismissFastCompose:function(){this.fastCompose&&(this.hidePlexi(),this.fastCompose.teardown(),this.fastCompose=null),r.trigger("fastCompose:dismiss:complete")},showPlexi:function(){this.$glass=s("<div>",{"class":"glass show"}).appendTo(this.$body),n.defer(n.bind(function(){this.$glass.addClass("blue")},this)),r.trigger("drawer:suspend")},hidePlexi:function(){this.$glass.remove(),this.$glass=null,r.trigger("drawer:resume")},determineSource:function(t){this.loggingData.source="fast-compose",t&&(t.originalEvent instanceof window.KeyboardEvent?this.loggingData.source="keycommand":t.loggingData&&t.loggingData.source&&(this.loggingData.source=t.loggingData.source))}});t.exports=h},function(t,e,i){"use strict";var s=i(115),n=i(109),o=i(3),r=i(162),a=new s({__bindKeycommands:function(){o.result(this,"keycommands")&&(o.each(o.result(this,"keycommands"),this.__bindKey,this),r.add({id:this.__keyId,keys:o.keys(o.result(this,"keycommands"))}))},__bindKey:function(t,e){this.listenTo(n,"DOMEventor:"+e,this.__keyFn)},__keyFn:function(t,e){!this.__keysDisabled&&r.shouldRun(e,this.__keyId)&&this[this.keycommands[e]].apply(this,arguments)},focusKeys:function(){r.focus(this.__keyId)},unfocusKeys:function(){r.unfocus(this.__keyId)},soloKeys:function(t){r.solo(this.__keyId,t)},unSoloKeys:function(){r.unSolo(this.__keyId)},disableKeys:function(){this.__keysDisabled=!0},enableKeys:function(){this.__keysDisabled=!1},before:{initialize:function(){this.keycommands||(this.keycommands={}),this.__keysDisabled=!1,this.__keyId=o.uniqueId("keycomms"),this.__bindKeycommands()},stopListening:function(t){(o.isEmpty(t)||t===this)&&r.remove(this.__keyId)}}});t.exports=a},function(t,e,i){"use strict";var s=i(144),n=i(3),o=s.extend({soloId:null,constructor:function(){this.keySets=[],this.soloBubblingWhitelist=[]},add:function(t){this.keySets.unshift(t)},remove:function(t){var e=this.getSetForId(t);e&&(this.unSolo(t),this.keySets=n.without(this.keySets,e),this.soloBubblingWhitelist=n.without(this.soloBubblingWhitelist,t))},focus:function(t){var e=this.getSetForId(t);e&&(this.keySets=n.without(this.keySets,e),this.keySets.unshift(e))},unfocus:function(t){var e=this.getSetForId(t);e&&(this.keySets=n.without(this.keySets,e),this.keySets.push(e))},solo:function(t,e){var i=this.getSetForId(t);i&&(this.soloId=t,e===!0&&this.soloBubblingWhitelist.push(t))},unSolo:function(t){this.soloId===t&&(this.soloId=null,this.soloBubblingWhitelist=n.without(this.soloBubblingWhitelist,t))},getSetForId:function(t){return this.keySets[n.findIndex(this.keySets,{id:t})]},getSetsWithKey:function(t){return n.where(this.keySets,{keys:[t]})},shouldRun:function(t,e){var i=this.getSetsWithKey(t);return this.soloId===e?!0:n.isEmpty(this.soloBubblingWhitelist)||n.contains(this.soloBubblingWhitelist,e)?i.length>1?i[0].id===e:!0:!1}});t.exports=new o},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(164),r=i(99),a=i(100),l=i(120),h=i(148),c=i(109),u=i(107),d=i(161),p=i(159),g=i(165),_=i(549),m=h.extend({template:_,className:"fast-compose",defaults:{tabIndex:-1,icons:[{name:"text",label:"Text"},{name:"photo",label:"Photo"},{name:"quote",label:"Quote"},{name:"link",label:"Link"},{name:"chat",label:"Chat"},{name:"audio",label:"Audio"},{name:"video",label:"Video"}]},events:{"click .post-tab-switching .tab-post-type":"clickCreate","mouseover .post-tab-switching .tab-post-type":"mouseoverIcon","click .post-tab-switching":"close"},mixins:[p,d],keycommands:{"keydown:c":"nextIcon","keydown:shift+c":"previousIcon","keydown:tab":"nextIcon","keydown:shift+tab":"previousIcon","keydown:right":"nextIcon","keydown:left":"previousIcon","keydown:enter":"enterCreate","keydown:escape":"close"},initialize:function(t){this.loggingData=t?t.loggingData:{},n.forEach(this.get("icons"),function(t){t.label=a(t.label)}),this.$body=s("body"),this.$glass=null,this.$plexiInstance=s('.plexi[data-token="body-plexi"]'),this.resumeKeycommandsOnClose=!0},bindEvents:function(){this.listenTo(c,"DOMEventor:keydown:tab",this.disableKey),this.listenTo(c,"DOMEventor:keydown:shift+tab",this.disableKey),this.listenTo(this,"change:tabIndex",function(t,e){this.$(".selected").removeClass("selected"),this.$('[data-index="'+e+'"]').addClass("selected")})},render:function(){return this.$el.append(this.template(this.toJSON())),this.bindEvents(),this},open:function(){n.defer(n.bind(this.show,this))},show:function(){c.trigger("keycommands:suspend");var t=50;n.forEach(this.$(".tab-post-type"),function(e,i){var n=s(e),r=n.find(".post-type-icon"),a=n.find(".post-type-name");o.animate(r,{opacity:["1","0"],translateY:["0px","15px"]},{duration:150,delay:i*t}),o.animate(a,{opacity:["1","0"],translateY:["0px","-15px"]},{duration:150,delay:i*t})},this),s(".post-tab-switching").addClass("finish-animating")},enterCreate:function(t){var e=this.$(".selected");if(e.length){var i=e.attr("data-post-type");this.createNew(i),this.close()}},clickCreate:function(t){this.createNew(s(t.currentTarget).data("postType"))},disableKey:function(t){t.preventDefault()},mouseoverIcon:function(t){this.$(".selected").removeClass("selected"),this.set("tabIndex",s(t.currentTarget).data("index"))},nextIcon:function(t){var e=this.get("tabIndex")+1;e>=this.get("icons").length&&(e=0),this.set("tabIndex",e)},previousIcon:function(t){var e=this.get("tabIndex")-1;0>e&&(e=this.get("icons").length-1),this.set("tabIndex",e)},createNew:function(t){this.resumeKeycommandsOnClose=!1,r.has("Components/PostFormBuilder")?c.trigger("postForms:open",{updateURL:!1,postFormType:g.containerType("modal"),postType:t,fastCompose:!0,loggingData:this.loggingData}):c.trigger("fastCompose:create",{type:t,loggingData:this.loggingData})},close:function(){var t=50,e=this.$(".tab-post-type"),i=Math.floor(.5*(e.length-1));l.all(n.map(e,function(e,n){var r=s(e),a=Math.floor(Math.abs(n-i))*t;return o.animate(r,{opacity:["0","1"],translateY:["-500px","0px"]},{duration:150,delay:a})},this)).then(function(){c.trigger("fastCompose:close:complete")})},teardown:function(){return this.resumeKeycommandsOnClose&&c.trigger("keycommands:resume"),this.remove()}});t.exports=u.bool("is_logged_in")?m:n.noop},,function(t,e,i){"use strict";var s=(i(166),i(3)),n=i(8),o=i(120),r=i(167),a=i(169),l=i(143),h=i(109),c=i(108),u=(i(102),i(7)),d=(i(170),i(171)),p=i(172),g=i(175),_="/dashboard",m=i(100),f=n("body"),v=i(176),b=i(142),y=i(110),w=i(180),k=i(283),C=i(540),x=i(541),S=i(543),T=i(548),E=l.extend({name:"PostFormBuilder",initialize:function(){var t=this.data;if(this.user=y(),this.user){v(s.bind(function(t){this.PostFormComponent=t},this));var e={baseRoute:null,currentChannel:null,supportImageSearch:!1,minFullWidthSize:300,redirectTo:!1,reblogActionContext:!1,updateURL:!0};s.extend(this,e,s.pick(t,s.keys(e))),this._addGlobalEventListeners(),this.user.set(t.limits),this.user.set(t.dashboardSettings),this.user.set("language",t.language||"en_US"),k.setEmbedRegexes(t.embedRegexes),this.glass=new C,this.modal=new x,this.modalContainer=new S({className:"post-form-modal-content",animateHeightWithContent:!0}),this.modal.setContentSubView(this.modalContainer),this.postButtons=new T({el:"#new_post"}),this.postButtonsContainer=new S({el:this.postButtons.$el.parent(),originalContent:this.postButtons,transitionBackground:!0,animateHeightWithContent:!0,useLoader:!1}),this.scrollHelper=new d,this.saveHook=new p(s.extend({$postButtonsContainer:this.postButtonsContainer.$el},t)),this.legacyEvents(),this._updateData=s.once(this.updateData),this.render()}},updateData:function(){var t=n.ajax({url:"/svc/post/get_post_form_builder_data",type:"POST",withFormKey:!0,data:{}});return t.then(s.bind(function(t){var e=t.response;return s.forEach(e.channels,function(t){var e=t.name?this.user.getChannel(t.name):!1;e&&e.set(s.omit(t,"name"))},this),this.user.set(e.limits),e},this))},legacyEvents:function P(){var P={"postForms:closed":["post:form:hide","keycommands:resume"],"postForms:saved":["post:form:success"],"postForms:opened":["post:form:show","keycommands:suspend"]};s.forEach(P,function(t,e){this.listenTo(h,e,function(){var e=s.toArray(arguments);s.each(t,function(t){h.trigger.apply(h,[].concat(t,e))},this)})},this)},_addGlobalEventListeners:function(){this.listenTo(h,"postForms:open",this.fetchAndCreatePostFormComponent),this.listenTo(h,"postForms:new",this._createPostFormNew),this.listenTo(h,"postForms:edit",this._createPostFormEdit),this.listenTo(h,"postForms:reblog",this._createPostFormReblog),this.listenTo(h,"postForms:saved",this.destroyPostForm),this._registerDismissListener(),this.listenTo(h,"postForms:dismissListener:suspend",function(){this._toggleDismissListener(!1)}),this.listenTo(h,"postForms:dismissListener:resume",function(){this._toggleDismissListener(!0)})},_toggleDismissListener:function(t){this.stopListening(h,"postForms:close"),t&&this._registerDismissListener()},_registerDismissListener:function(){this.listenTo(h,"postForms:close",this.dismissPostForm)},createInlineContainer:function(t){return t?new S({el:t.parent(),originalContent:t,transitionBackground:!0}):!1},fetchAndCreatePostFormComponent:function(t){s.isEmpty(this.PostFormComponent)?v(s.bind(function(e){this.PostFormComponent=e,this._createPostForm(t)},this)):this._createPostForm(t)},_createPostFormNew:function(t){this.fetchAndCreatePostFormComponent(t)},_createPostFormEdit:function(t){t.postEl&&(t.containerView=this.createInlineContainer(t.postEl),t.postFormType=g.inline),this.fetchAndCreatePostFormComponent(t)},_createPostFormReblog:function(t){this.fetchAndCreatePostFormComponent(t)},_createPostForm:function(t){if(this.postForm)return this.destroyPostForm(t).then(s.bind(function(){return this._createPostForm(t)},this));t=s.extend({fastCompose:!1,supportImageSearch:this.supportImageSearch,minFullWidthSize:this.minFullWidthSize,updateURL:this.updateURL,glass:!0,postFormType:g.modal},t),s.defaults(t,{containerView:t.postFormType===g.inline?this.postButtonsContainer:null}),t.post||(t.post=this._createPostModel(t)),t.url||(t.url=this._postFormUrl(t.post)),t.containerView===this.postButtonsContainer&&this.postButtons.setPostType(t.post.get("type")),this._updateData();var e=t.postFormType===g.modal,i=["supportImageSearch","minFullWidthSize","post"];"photo"===t.post.get("type")&&i.push("showPhotoBooth");var a=this.postForm=new this.PostFormComponent(s.extend(s.pick(t,i),{isModal:e,popoverContainer:e?this.modal.$el:f,redirectTo:this.redirectTo,reblogActionContext:this.reblogActionContext,fastCompose:t.fastCompose})),l=this.postFormContainer=t.containerView||this.modalContainer;if(!l)throw new Error("No post form container!");this.listenTo(a,"pauseScrollHelper",this.pauseScrollHelper),this.listenTo(a,"resumeScrollHelper",this.resumeScrollHelper),l.isRendered()||l.render(),l.setPostFormComponent(a);var d=s.once(s.bind(function(){return t.glass?this.glass.show():o.resolve()},this)),p=r([function(){return h.trigger("Header:hide"),o.join(l.prepare(d),a.whenRendered(!0))},function(){return a.disable(),l.attach(d)},function(){return t.updateURL&&u.history.navigate(t.url,{replace:!0}),function(){var t=c.rect(),i=t.windowScrollTop,o=t.windowHeight,r=a.getRect(),u=r.offsetHeight,d=l.$el.offset().top,p=d+u,g=20,_=n("[prima-component=header]").height()||0,m=o>u+2*g,f=this.scrollHelper.calculateScrollTop(d-g,p+g+_,o,m),v=400,b=e?this.modal.$el:null;l===this.postButtonsContainer&&f>i&&o>u&&(f=i),this.previousScrollPosition=e?!1:i,this.scrollHelper.scrollToPosition(f,v,b),this.listenTo(h,"Photoset:dragScroll",function(t,e){s.isNumber(e)||(e=50);var i=c.rect().windowScrollTop+t;this.scrollHelper.scrollToPosition(i,e,b)}),this.listenTo(h,"Photoset:scrollToRow",function(t,e,i){s.isNumber(i)||(i=50),t+=0,this.scrollHelper.checkScrollBounds(!1,{keepInside:!0,contentPadding:70,contentRect:{offsetTop:t,offsetHeight:e}})})}.call(this),l.showPostForm(d)},function(){return d()},function(){a.enable()}],this).then(s.bind(function(){return h.trigger("postForms:opened"),f.addClass("postforms-open"),a},this),s.bind(function(){this.destroyPostForm()},this));return t.postFormType===g.inline&&p.then(s.bind(function(){this.scrollHelper.start({el:l.$el})},this)),p["catch"](function(t){t instanceof Error&&s.defer(function(){throw t})}),p},_postFormStateChanged:function(t){if(this.postForm){var e=this.postForm.initialPostState,i=this.postForm.post;return i.deepHasChanged(e)}return!1},dismissPostForm:function(){this.postForm&&!this.postForm.isEnabled()||(this._postFormStateChanged()?this._buildDismissPrompt():this.destroyPostForm())},_buildDismissPrompt:function(){var t=m("Discard this post?");this.postForm&&this.postForm.post&&"edit"===this.postForm.post.get("mode")&&(t=m("Discard edits to this post?"));var e={text:t,text_ok:m("Discard"),text_cancel:m("Nevermind"),keycommand_maintain:!0};b.confirm(e,s.bind(function(){this.destroyPostForm(),h.trigger("postForms:dismissListener:resume")},this),function(){s.defer(function(){h.trigger("postForms:dismissListener:resume")})}),h.trigger("postForms:dismissListener:suspend")},destroyPostForm:function(t,e){t=s.extend({updateURL:this.updateURL,url:this.baseRoute,glass:!0},t),this.scrollHelper.stop();var i=this.postForm,n=this.postFormContainer,a=!!i.fastCompose;this.postForm=null,this.postFormContainer=null,this.stopListening(i),this.stopListening(h,"Photoset:dragScroll");var l=s.once(s.bind(function(){return t.glass?this.glass.hide():o.resolve()},this)),c=i&&!!i.postForm.get("saved"),d=r([function(){c&&this.saveHook.preExecute(e)},function(){i&&i.disable()},function(){return function(){if(this.previousScrollPosition!==!1){var t=this.previousScrollPosition,e=400;this.scrollHelper.scrollToPosition(t,e)}}.call(this),n?n.hidePostForm(l).then(function(){n.teardown()}):void 0},function(){if(i&&i.remove(),t.updateURL){var e=u.history.root||"",s=t.url?t.url.replace(new RegExp("^"+e),""):"";u.history.navigate(s,{replace:!0})}},function(){return l()},function(){c&&e&&(this.saveHook.$inlinePostEl=n.$el,this.saveHook.execute(e,{fastCompose:a}))}],this).then(function(){return h.trigger("postForms:closed"),h.trigger("Header:show"),f.removeClass("postforms-open"),i});return d["catch"](function(t){t instanceof Error&&s.defer(function(){throw t})}),d},pauseScrollHelper:function(){this.scrollHelper&&this.scrollHelper.pause()},resumeScrollHelper:function(){this.scrollHelper&&this.scrollHelper.resume()},_createPostModel:function(t){"string"==typeof t&&(t={postType:t});var e=s.extend({tumblelog:t.channelId||this.currentChannel||this.user.getChannel().get("name"),editorType:this.user.get("defaultEditorType"),contextData:{baseRoute:this.baseRoute}},s.pick(t,"tags","sourceUrl","loggingData"));return t.reblogId?s.defaults(e,{lookupData:{reblog_id:t.reblogId,reblog_key:t.reblogKey,carousel_index:t.carousel_index},mode:"reblog",pt:t.pt,reblogSource:t.reblogSource}):t.editId?s.defaults(e,{lookupData:{post_id:t.editId,channel_id:t.channelId||this.redirectChannel},mode:"edit"}):s.defaults(e,{type:t.postType||t.type||"text",mode:"new"}),new w(e)},_postFormUrl:function(t){if(t){if(t.has("lookupData")){var e=t.get("lookupData");return e.reblog_id?this._reblogPostUrl(e.reblog_id,e.reblog_key):e.post_id?this._editPostUrl(e.post_id):this._newPostUrl(t.get("type"))}return t.has("reblog_id")?this._reblogPostUrl(t.get("reblog_id"),t.get("reblog_key")):t.has("id")?this._editPostUrl(t.get("id")):this._newPostUrl(t.get("type"))}return this._newPostUrl("text")},_newPostUrl:function(t){var e=this.baseRoute!==_?this.baseRoute:"";return e+"/new/"+t},_editPostUrl:function(t){return"/edit/"+t},_reblogPostUrl:function(t,e){return"/reblog/"+t+"/"+e},render:function(){return this.glass.render().$el.appendTo("body"),this.modal.render().$el.appendTo("body"),this},updateBaseRoute:function(t){var e;t?this.baseRoute=t:(e=u&&u.history?u.history.location.pathname:_,this.baseRoute=e)}},{containerType:function(t){return g[t]}});a.applyTo(E.prototype),t.exports=E},function(t,e,i){"use strict";function s(t,e){e=e||"Exposer";var i=window;n.each(t,function(t,s){if(n.has(i,s))throw new Error('"'+s+'" already exists');o.log(e,"%s.%s",i,s),n.set(i,s,t)})}var n=i(3),o=i(102);t.exports=s},function(t,e,i){"use strict";var s=i(3),n=i(168),o=function(t,e){t=s.map(t,function(t){return s.bind(t,this)},e||this);var i=Array.prototype.slice.call(arguments,1);return i[0]=t,n.apply(null,i)};t.exports=o},function(t,e,i){var s;/** @license MIT License (c) copyright 2011-2013 original author or authors */
  !function(n){s=function(t){var e=i(120),s=e.Promise.all,n=Array.prototype.slice;return function(t){function i(t){return o.push(t),o}var o=[];return s(n.call(arguments,1)).then(function(s){return e.reduce(t,function(t,n){return e(n.apply(void 0,s),i)},o)})}}.call(e,i,e,t),!(void 0!==s&&(t.exports=s))}(i(125))},function(t,e,i){"use strict";var s=i(3),n=i(120),o=i(115),r=new o({defaults:{whenEvent:function(t,e){return 1===arguments.length&&(e=t,t=this),n.promise(s.bind(function(i,s){this.listenToOnce(t,e,function(){i.call(null,arguments)})},this))}}});t.exports=r},function(t,e){"use strict";var i=1,s=function(t){return t*i};s.get=function(){return i},s.set=function(t){i=t},t.exports=s},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(164).animate,r=i(170),a=i(144),l=i(7),h=i(108),c=i(109),u=(i(102),n("html")),d=a.extend({defaults:{keepInside:!1,scrollSpeedMs:250,triggerPadding:-50,contentPadding:20,debounceMs:200},start:function(t){return this._running&&this.stop(),this._running=!0,t&&!s.isPlainObject(t)&&(t={el:t}),this.options=t=s.extend({},this.defaults,t),this.$el=n(t.el),this.updateContentRect(),this.listenTo(c,"DOMEventor:flatscroll",this.checkScrollBounds),this},stop:function(){return this._running=!1,this._scrollTop=!1,this.cancelEnforceScrollBounds(),this.stopListening(),this},pause:function(){this._running&&(this._ignoreScroll=!0)},resume:function(){this._running&&this._ignoreScroll&&(this._ignoreScroll=!1,this.checkScrollBounds())},updateContentRect:function(){this.contentRect||(this.contentRect={}),this.lastContentRect&&(this.lastContentRect.offsetTop=this.contentRect.offsetTop,this.lastContentRect.offsetLeft=this.contentRect.offsetLeft,this.lastContentRect.offsetHeight=this.contentRect.offsetHeight,this.lastContentRect.offsetWidth=this.contentRect.offsetWidth);var t=this.$el.offset();return this.contentRect.offsetTop=t.top,this.contentRect.offsetLeft=t.left,this.contentRect.offsetHeight=this.$el.outerHeight(),this.contentRect.offsetWidth=this.$el.outerWidth(),this.lastContentRect||(this.lastContentRect=s.clone(this.contentRect)),this.contentRect},calculateScrollTop:function(t,e,i,s){return s?t:e-i},checkScrollBounds:function(t,e){if(!this._ignoreScroll){e=e?s.extend({},this.defaults,this.options,e):this.options,t||(t=h.rect());var i,n,o=e.contentRect||this.updateContentRect(),r=e.triggerPadding||0,a=e.contentPadding||0,l=o.offsetHeight,c=o.offsetTop,u=c+l,d=t.windowHeight,p=Math.max(0,t.windowScrollTop),g=p+d;return e.keepInside?(i=p-c,n=u-g):(i=p-u,n=c-g),n>r?(this._scrollTop=this.calculateScrollTop(c-a,u+a,d,l+2*a>d),this.enforceScrollBounds(e),!0):i>r?(this._scrollTop=this.calculateScrollTop(c-a,u+a,d,e.bottom||d>l+2*a),this.enforceScrollBounds(e),!0):(this._scrollTop=!1,this.cancelEnforceScrollBounds(),!1)}},enforceScrollBounds:function(t){var e=null!=t.scrollTop?t.scrollTop:this._scrollTop,i=t.scrollSpeedMs,n=t.debounceMs,o=t.container;n?this._enforceTimeout||(this._enforceTimeout=s.delay(s.bind(function(){null==t.scrollTop&&(e=this._scrollTop),this.scrollTop!==!1&&this.scrollToPosition(e,i,o)},this),n)):this.scrollToPosition(e,i,o)},cancelEnforceScrollBounds:function(){this._enforceTimeout,clearTimeout(this._enforceTimeout),this._enforceTimeout=!1},scrollToPosition:function(t,e,i){this._ignoreScroll=!0,o(u,"stop"),o(u,"scroll",{offset:t,container:i,duration:r(e||this.defaults.scrollSpeedMs)}).then(s.bind(function(){this._ignoreScroll=!1},this))}});s.extend(d.prototype,l.Events),t.exports=d},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(173),r=i(109),a=i(174),l=i(110),h=function(){var t=".post_container",e=".post:not([data-is-pinned])",i=["dashboard","drafts","inbox"],h={preExecute:function(){return"queue"===this.contextData.contextPage?(n(window).off("beforeunload"),void window.location.replace(this.contextData.baseRoute)):void 0},execute:function(t,e){if(e=s.merge({fastCompose:!1},e||{}),this.saveResponse=t.responseJSON,-1!==i.indexOf(this.contextData.contextPage)){var r=!this.saveResponse.post.is_edit&&!this.saveResponse.post.is_reblog,a="post_dashboard_html"in this.saveResponse,h=!(!this.saveResponse.post||!this.saveResponse.post.is_edit)&&this.contextData.contextPage!==this.saveResponse.post_context_page&&this.$inlinePostEl.hasClass("post_container");if(r?this._fetchMorePosts():a&&(h?this._removeInline():this._updateInline()),this._displayNotification(this.saveResponse,e),this.saveResponse.context_tumblelog){var c=this.saveResponse.context_tumblelog.name_or_id,u=n('#dashboard_controls_open_blog[data-blog-name="'+c+'"]');s.forEach(this.saveResponse.context_tumblelog,function(t,e){if(e.match(/_count$/i)){var i=u.find('[data-blog-controls-count="'+e+'"]');i.toggleClass("count_0","0">=t),i.find(".count").text(o(t).format("0,0"))}},this);var d=l().getChannel(c),p=s.pick(this.saveResponse.context_tumblelog,d.keys());d.set(p)}}},_fetchMorePosts:function(){var t=this.contextData.baseRoute.replace(/^\/|\/$/g,""),e="drafts"===this.contextData.contextPage?"after":"before",i=this._findLatestPostId(),n=new a;n.fetch({pageRoot:t,direction:e,refPostID:i,success:s.bind(this._fetchSuccess,this),error:this._fetchFailure})},_fetchSuccess:function(i){var s=n(i.get("dashboardHTML")),o=this.contextData.$postButtonsContainer.nextAll(t).has(e).first();0===o.length?this.contextData.$postButtonsContainer.parent().append(s):s.insertBefore(o),n(".no_posts_found").remove(),r.trigger("posts:load")},_fetchFailure:function(){console.error("Failed loading dashboard HTML after successful post submission.")},_findLatestPostId:function(){var i=this.contextData.$postButtonsContainer.nextAll(t).find(e).first().data("post-id");return i},_updateInline:function(){var t=n(this.saveResponse.post_dashboard_html.trim());this.$inlinePostEl.replaceWith(t.eq(0)),r.trigger("posts:load")},_removeInline:function(){var t=this.contextData.baseRoute.split("/");t.splice(-1,1);var e=this.$inlinePostEl;return e.fadeOut(200,function(){e.remove()}),n("#posts .post").not(".new_post").length<=1?void(window.location=t.join("/")):void 0},_displayNotification:function(t,e){var i=this.contextData.baseRoute.split("/"),n=i[1]||"",o=t.message,a=s.parseInt(this.contextData.notificationDelay),l={type:"dashboard"===t.post_context_page?"dashReblog":t.post_context_page,url:t.post_tumblelog.post_url,tumblelog:{name:t.post_tumblelog.name_or_id,url:t.post_tumblelog.url,avatar:t.post_tumblelog.avatar}};(!t.created_post||t.post.is_reblog||e&&e.fastCompose||"tagged"===n.toLowerCase())&&s.delay(function(){r.trigger("postForms:saveHook:toast",o,l)},a)}},c=function(t){this.contextData=s.defaults(t||{},{notificationDelay:250}),s.extend(this,h)};return c}();t.exports=h},,function(t,e,i){"use strict";var s=i(3),n=i(6).sprintf,o=i(113),r=o.extend({endpoint:"/svc/post/%s/%s/%s",parse:function(t){return{dashboardHTML:t.trim()}},sync:function(t,e,i){if("read"!==t)throw new Error("The DashboardPostFetch model may only READ from server!");if(i=s.defaults(i||{},{pageRoot:!1,direction:!1,refPostID:!1}),!1===(i.pageRoot&&i.direction))throw new Error(n("These two fetch params must be passed: pageRoot [%s], direction [%s]",i.pageRoot,i.direction));return s.defaults(i,{dataType:"html",emulateHTTP:!0,url:n(this.endpoint,i.pageRoot,i.direction,i.refPostID)}),o.prototype.sync.call(this,t,e,i)}});t.exports=r},function(t,e){"use strict";var i={modal:1,inline:2};t.exports=i},function(t,e,i){"use strict";var s=i(177),n=function(t){i.e(1,function(e){try{t(i(178))}catch(n){s(n,"post-form")}})};t.exports=n},function(t,e,i){"use strict";var s=i(100),n=i(142),o=function(t,e,i){var o=s("Sorry, we seem to be having technical trouble. Please try again later.");throw"function"==typeof i?i(t):n.alert("string"==typeof i?i:o),new Error("require.ensure error: "+e+": "+t)};t.exports=o},,function(t,e,i){"use strict";var s=i(3),n=[16,24,30,40,48,64,96,128,512],o=s.last(n),r=128,a=function(t){return t>=o?o:s.find(n,function(e){return e>=t})},l=function(t,e){var i=function(e){return e=null==e?r:a(e),(t||"").replace(/^(.*_)?(\d+)(\D.*)?$/,"$1"+e+"$3")};return i.toString=function(){return this()},null!=e?i(e):i};t.exports=l},function(t,e,i){"use strict";var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},n=i(3),o=i(113),r=i(166),a=i(181),l=i(182),h=i(184),c=i(192),u=i(193),d=i(196),p=i(197),g=i(198),_=i(200),m=i(201),f=i(183),v=i(194),b=i(195),y=o.extend({mixins:[a],typeDelegateMap:{text:l,photo:h,quote:c,link:u,chat:d,audio:p,video:g,note:_},_VALID_STATES:{published:"0",draft:"1",queued:"2",scheduled:"on.2","private":"private",unapproved:"0 3",transcoding:"4"},_FORMAT_CODE_TO_EDITOR_TYPE:{0:"rich",1:"html",2:"markdown"},_STATE_CODE_TO_TEXT:{published:"published",0:"published","0 3":"published",1:"draft",2:"queued",3:"unapproved",4:"transcoding","on.2":"scheduled","private":"private"},defaults:{allow_photo_replies:Boolean(),carouselDisplay:!1,postDate:String(),customUrl:String(),sourceUrl:String(),carouselLinkUrl:String(),state:"published",editorType:"rich",tags:[],publish_on:String(),tumblelog:String(),uploading:!1,mode:"new",contentStats:{},loading:!1,hasLoadingInlineImages:!1,members_only:!1,owner_flagged_nsfw:!1,canBeLiked:!0,canBeReblogged:!0},shortUrlLength:29,typeAttributes:{},editorField:!1,resetPreserveFields:[],resetAttributes:[],allowAnswerFields:[],_syntheticAttributes:{pseudoState:function(){var t=this.get("state"),e=this.get("publish_on");return"published"===t&&1===parseInt(this.get("is_private"),10)&&(t="private"),"queued"===t?n.isEmpty(e)?"queued":"scheduled":t},formattedSourceUrl:function(){var t,e=this.get("sourceUrl");return n.isEmpty(e)?"":(t=v.addProtocolIfMissing(e,"http:"),b.isUrl(t)?t:e)},formattedCarouselLinkUrl:function(){var t,e=this.get("carouselLinkUrl");return n.isEmpty(e)?"":(t=v.addProtocolIfMissing(e,"http:"),b.isUrl(t)?t:e)}},initialize:function(t,e){n.has(t,"tags")||this.set("tags",[]),this._assignPostTypeFunctionality()},_assignPostTypeFunctionality:function(){var t=this.get("type"),e=n.bind(function(t){return t in this.typeDelegateMap?this.typeDelegateMap[t].prototype:!1},this);t?(this.delegateObject(e(t)),this.afterDelegate()):this.listenToOnce(this,"change:type",function(t,i){this.delegateObject(e(i)),this.afterDelegate()})},afterDelegate:function(){n.defaults(this.attributes,this.typeAttributes)},_normalizeType:function(t,e){var i={regular:"text",conversation:"chat"};return e===!1&&(i=n.invert(i)),t in i?i[t]:t},get:function(t){return(this._syntheticAttributes[t]||o.prototype.get).apply(this,arguments)},getHtmlStripped:function(t,e,i){return"undefined"!=typeof e||(e=!0),"undefined"!=typeof i||(i=" "),n.trim(f.stripHtml(this.get(t)||"",e,i))},fetch:function(t){var e={data:t};return o.prototype.fetch.call(this,e)},parse:function(t,e){if(e.parse===!1)return this.attributes;var i=t.post,s=e.data,o={},r=i.id?"edit":"reblog";o.type=this._normalizeType(i.type,!0),o.can_reblog_as=n.map(i.can_reblog_as,n.bind(function(t){return this._normalizeType(t,!0)},this)),this.set("type",o.type),n.forEach(this.genericFieldMap,function(t,e){o[t]=i[e]});var a=["one","two","three","state","publish_on","tags","type","can_reblog_as"];return n.extend(o,n.omit(i,a),{createdPost:!!t.created_post,postTumblelog:t.post_tumblelog||{},postContextPage:t.post_context_page}),"edit"===r?(o["post-id"]=i.id,o.tags=i.tags?i.tags.split(","):[],o.tumblelog=o.postTumblelog.name_or_id||!1):"reblog"===r&&n.extend(o,n.pick(s,["reblog_id","reblog_key"])),"state"in i&&(o.state=this._extractState(i)),i.from_app&&1===n.parseInt(i.format)||(o.editorType=this._FORMAT_CODE_TO_EDITOR_TYPE[n.parseInt(i.format||0)]),o.editorType||(o.editorType=this.get("editorType")||this._FORMAT_CODE_TO_EDITOR_TYPE[0]),n.has(i,"custom_tweet")&&(o.customTweet=i.custom_tweet),n.extend(o,{sourceUrl:o.source_url||"",carouselLinkUrl:o.carousel_link_url||"",carouselDisplay:o.carousel_display||!1,htmlEdited:"rich"!==o.format&&!(this.editorField&&!i[this.editorField]),postDate:o.date||"",customUrl:o.slug||"",canBeLiked:o.can_be_liked,canBeReblogged:o.can_be_reblogged},n.mapValues(n.pick(o,["allow_answers","allow_photo_replies","html_mode","members_only","carousel_display","owner_flagged_nsfw"]),m)),"edit"!==r||"queued"!==o.state||n.isEmpty(i.publish_on)||(o.state="scheduled",o.publish_on=i.publish_on),this.parseForType(o,i)},parseForType:function(t,e){return t},sync:function(t,e,i){var s={create:"/svc/post/update",read:"/svc/post/fetch",update:"/svc/post/update"};return n.defaults(i||(i={}),{emulateHTTP:!0,forServer:!0,url:s[t]}),i.parse="read"===t,o.prototype.sync.call(this,t,e,i)},toJSON:function(t){return t=n.defaults(t||{},{forServer:!1}),t.forServer?this.serializeForServer(t):o.prototype.toJSON.call(this,t)},serializeForServer:function(){var t=this,e=t.attributes,i={channel_id:e.tumblelog,post_id:e["post-id"],"post[date]":e.postDate,"post[one]":this.getAttributeFromGeneric("one"),"post[publish_on]":e.publish_on,"post[slug]":e.customUrl,"post[tags]":e.tags.join(),"post[two]":this.getAttributeFromGeneric("two"),"post[three]":this.getAttributeFromGeneric("three"),thumbnail:this.getAttributeFromGeneric("thumbnail"),editor_type:e.editorType,send_to_twitter:e.send_to_twitter,custom_tweet:e.customTweet,send_to_fbog:e.send_to_fbog,loggingData:e.loggingData,allow_photo_replies:e.allow_photo_replies,carousel_display:e.carouselDisplay,carousel_link_url:t.get("formattedCarouselLinkUrl"),members_only:e.members_only,owner_flagged_nsfw:e.owner_flagged_nsfw,content_stats:e.contentStats,carousel_index:e.carousel_index,can_be_liked:e.canBeLiked,can_be_reblogged:e.canBeReblogged};"edit"===e.mode&&(i.edit_post_id=e["post-id"]),i["post[source_url]"]=t.get("formattedSourceUrl"),i["post[state]"]=t._VALID_STATES[e.state],i["post[type]"]=this._normalizeType(e.type,!1);var s={reblog:e.is_reblog,reblog_key:e.reblog_key,reblog_post_id:e.reblog_id,pt:e.pt,remove_reblog_tree:e.remove_reblog_tree,reblog_source:e.reblogSource};n.extend(i,n.pick(s,function(t){return!n.isUndefined(t)})),e.allow_answers&&(i.allow_answers="on"),this.getAttributeFromGeneric("thumbnail")&&(i.thumbnail_pre_upload="1");var o=this.getContextPage();return n.extend(i,{context_id:e.tumblelog,context_page:o,"is_rich_text[one]":"0","is_rich_text[two]":"0","is_rich_text[three]":"0"}),this.editorField&&(i["is_rich_text["+this.editorField+"]"]="1"),e.reblogActionContext&&(i.reblog_source=e.reblogActionContext),e.shareData&&n.isObject(e.shareData)&&(e.shareData.canonicalUrl=i["post[source_url]"],i.share_data=e.shareData),i},validate:function(t,e){var i="errors"in e?e.errors:[];return t.state&&(n.has(this._VALID_STATES,t.state)||i.push('Invalid "state" value')),t.hasLoadingInlineImages&&i.push("There are still pending images."),n.each(this.defaults,function(e,n){("undefined"==typeof e?"undefined":s(e))!==s(t[n])&&i.push('Invalid "'+n+'" type. Expected '+("undefined"==typeof e?"undefined":s(e))+", got "+s(t[n])+".")}),i.length?i:void 0},_extractState:function(t){var e=this._STATE_CODE_TO_TEXT[t.state];return 1===parseInt(t.is_private,10)&&(e="private"),e},findBlogChannelByName:function(t){return this.attributes.tumblelog&&this.attributes.tumblelog.collection&&"findWhere"in this.attributes.tumblelog.collection?this.attributes.tumblelog.collection.findWhere({name_or_id:t}):void 0},getPreservedData:function(){return this.resetPreserveFields.some(n.bind(function(t){return this.get(t)&&this.get(t).length>0},this))},softReset:function(){n.forEach(this.resetAttributes,function(t){n.has(this.typeAttributes,t)?this.set(t,this.typeAttributes[t]):n.has(this.defaults,t)?this.set(t,this.defaults[t]):this.unset(t)},this)},getLookupData:function(){return"reblog"===this.get("mode")?{reblog_id:this.get("reblog_id"),reblog_key:this.get("reblog_key"),post_type:this.get("type")}:void 0},getContextPage:function(){var t=this.attributes,e="dashboard";return t.contextData&&"baseRoute"in t.contextData&&(e=t.contextData.baseRoute.split("/").pop()),e},getAttributeFromGeneric:function(t){return this.get(this.genericFieldMap[t])},getTweetText:function(){var t=this.get("customTweet");return n.isString(t)||(t=this.generateTweetText(140-this.shortUrlLength-1),t?t+=" [URL]":t="[URL]"),t},getTweetTextLength:function(t){n.isString(t)||(t=this.getTweetText()),t=n.trim(t).replace(/([^\s])\[URL\]/gi,"$1 [URL]").replace(/\[URL\]([^\s])/gi,"[URL] $1");var e=t.length;return e+=(this.shortUrlLength-5)*(t.match(/\[URL\]/gi)||"").length},generateTweetText:function(t){return""},canEditMedia:function(){return!this.get("is_reblog")},isReblog:function(){return!!this.get("is_reblog")},allowsTypeSwitch:function(t){return!1},canPreview:function(){return this.isValid()},deepHasChanged:function(t){var e=this.toJSON(),i=this.get("mode"),s=n.keys(t),o=n.keys(e);if(n.isEqual(t,e))return!1;if("new"!==i)return!0;var r=n.difference(o,s),a=n.reduce(r,function(t,i){var s=e[i],o=n.isUndefined(s)||n.isNull(s)?0:s.length;return t+o},0);return a>0?!0:(t=n.omit(t,r),e=n.omit(e,r),!n.isEqual(t,e))}});r({"Tumblr.Prima.PostForms.Post":y}),t.exports=y},function(t,e,i){"use strict";var s=i(3),n=i(115),o=new n({delegateObject:function(t){var e={},i={};t&&(s.each(t,function(t,s){"undefined"!=typeof t&&("function"==typeof t?e[s]=t:i[s]=t)},this),n.onto(this,e),s.extend(this,i))}});t.exports=o},function(t,e,i){"use strict";function s(){}var n=i(3),o=i(6).sprintf,r=i(183).truncateLongStrings;s.prototype.genericFieldMap={one:"title",two:"body"},s.prototype.editorField="two",s.prototype.typeAttributes={title:"",body:""},s.prototype.allowAnswerFields=["title","body"],s.prototype.generateTweetText=function(t,e){var i=this.getHtmlStripped("title"),s=this.getHtmlStripped("body");s=s.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,"");var n;return n=i&&s?o("%s - %s",i,s):i||s||"",r(n,e)},s.prototype.validate=function(t,e,i){var s=[],o=!n.isUndefined(e.reblog_tree)&&e.reblog_tree!==!1&&""!==e.reblog_tree;return(!e.body||e.body.length<1)&&(!e.title||e.title.length<1)&&(o||s.push("Post body empty.")),t.call(this,e,{errors:s})},t.exports=s},function(t,e,i){"use strict";var s=i(3),n={normalizeSpace:function(t){return t.trim().replace(" "," ").replace(/\s\s+/," ")},stripScripts:function(t){return t.replace(new RegExp("<script[^>]*>([\\S\\s]*?)</script\\s*>","img"),"")},stripTags:function(t){return t.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")},truncateLongStrings:function(t,e,i){return s.isString(t)||(t=""),i||(i="…"),t.length<=e?t:s.trunc(t,e-i.length,i)},stripHtml:function(t,e,i){if(!t)return"";"undefined"==typeof e&&(e=!0);var n=t;"string"==typeof i&&(n=s.trim(n.replace(/(<br\s*\/?>)/gi,"$1"+i).replace(/(<\/(?:p|figure|h[1-6])\s*>)/gi,"$1"+i)));try{var o=document.implementation.createHTMLDocument("");o.body.innerHTML=this.stripScripts(n),n=o.body.textContent||o.body.innerText||"",n=n.trim()}catch(r){n=this.stripScripts(this.stripTags(n)).trim()}return e&&(n=this.normalizeSpace(n)),n}};t.exports=n},function(t,e,i){"use strict";function s(){}var n=i(3),o=i(185),r=i(183).truncateLongStrings;s.prototype.genericFieldMap={two:"caption",three:"linkthrough"},s.prototype.editorField="two",s.prototype.typeAttributes={caption:"",layout:"",linkthrough:"",photos:[]},s.prototype.allowAnswerFields=["caption"],s.prototype.generateTweetText=function(t,e){var i=this.getHtmlStripped("caption");return i=i.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,""),r(i,e)},s.prototype.MAX_IMAGES=10,s.prototype.resetPreserveFields=["caption","tags"],s.prototype.afterDelegate=function(t){t.apply(this,n.rest(arguments)),this.photos=new o(this.attributes.photos,{parse:!0}),this.on("change:photos",function(t,e){this.photos.reset(e,{parse:!0}),delete this.attributes.photos},this),this.trigger("change:photos",this,this.get("photos")),this.listenTo(this.photos,"add remove change:preuploadUrl change:externalUrl",function(){this.trigger("validate")})},s.prototype.parseForType=function(t,e,i){return e.layout=i.photoset_layout,delete e.photoset_layout,e},s.prototype.serializeForServer=function(t){var e=this,i=t.apply(this,n.rest(arguments));return n.forEach(this.photos.toJSON(),function(t){i["images["+t.id+"]"]=t.uploadUrl,i["caption["+t.id+"]"]=(t.caption||"").substr(0,200),t.photoRaw&&(i.photo_raw=t.photoRaw,i.is_selfie_gif=t.isSelfieGif,i.is_selfie=t.isSelfie)}),i["post[carousel_display]"]=e.get("carouselDisplay"),i["post[carousel_link_url]"]=e.get("carouselLinkUrl"),i["post[photoset_layout]"]=e.get("layout"),i["post[photoset_order]"]=this.photos.pluck("id").join(","),i},s.prototype.canAddPhotos=function(t){return this.photos.length<this.MAX_IMAGES},s.prototype.validate=function(t,e,i){var s=[];0===this.photos.length&&s.push("No photos specified.");var n=this.photos.all(function(t){return t.getUploadUrl()||!t.has("upload")});return n||s.push("Uploads in progress."),t.call(this,e,{errors:s})},t.exports=s},function(t,e,i){"use strict";var s=i(3),n=i(118),o=i(186),r=n.extend({model:o,add:function(t,e){return t&&!s.isArray(t)&&(t=[t]),s.forEach(t,function(t,e){t.id||(s.isFunction(t.set)?t.set("id",this.generateId(e)):t.id=this.generateId(e))},this),n.prototype.add.apply(this,arguments)},generateId:function(t){var e=1+(t||0),i=s.map(s.range(this.length+1),function(t){return"o"+(e+t)});return s.find(i,function(t){return!this.get(t)},this)},setIdOrder:function(t,e){e||(e={}),this.models=s.map(t,function(t){return this.get(t)},this),e.silent||this.trigger("sort",this,e)}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(187),r=i(113),a=i(188),l=i(189),h=i(191),c=1080,u=r.extend({defaults:{url:"",preuploadUrl:"",externalUrl:"",file:null,photoRaw:null,base64:null,isSelfie:!1,isSelfieGif:!1,width:null,height:null,caption:"",id:"",livephotoUrl:"",livephotoStillImageTime:""},initialize:function(){this.on("change:externalUrl",function(t,e){e&&this.readUrl(e),this.set({preuploadUrl:null,base64:null})},this),this.get("externalUrl")&&!this.get("base64")&&this.trigger("change:file",this,this.get("file")),this.on("change:file",function(t,e){e&&this.readFile(e),this.set({externalUrl:null,base64:null})},this),this.get("file")&&!this.get("base64")&&this.trigger("change:file",this,this.get("file"))},readUrl:function(t,e){e||(e="photo:readUrl"),a.load(t).then(s.bind(function(t){this.set({url:t.src,width:t.width,height:t.height}),this.trigger(e,!0,this)},this),s.bind(function(i){this.set({url:t,width:null,height:null}),this.trigger(e,!1,this)},this))},readFile:function(t){return l.canReadFiles()?void l.read(t).then(s.bind(function(t){if(!t.file.type.match(/image\/(jpg|jpeg|png)/i))return this.readUrl(t.objectUrl||t.base64,"photo:readFile");var e=n("<img/>");e.attr("src",t.objectUrl||t.base64),a.load(t.objectUrl||t.base64).then(s.bind(function(i){var s=h.drawScaledAndRotated(e,i.width,i.height,t.rotation,t.mirrored,c);return this.readUrl(s.toDataURL(t.file.type),"photo:readFile")},this))},this),s.bind(function(){this.trigger("photo:readFile",!1,this)},this)):void this.trigger("photo:readFile",!1,this)},getDisplayUrl:function(){return this.get("preuploadUrl")?this.get("preuploadUrl"):this.get("externalUrl")?this.get("externalUrl"):this.get("base64")?this.get("base64"):this.get("url")},getUploadUrl:function(){return this.get("preuploadUrl")?this.get("preuploadUrl"):this.get("externalUrl")?this.get("externalUrl"):""},parse:function(t){return o(t,0)},toJSON:function(){var t=r.prototype.toJSON.apply(this,arguments);return t.displayUrl=this.getDisplayUrl(),t.uploadUrl=this.getUploadUrl(),t}});t.exports=u},function(t,e,i){"use strict";var s=i(3),n=function o(t,e){return null==e?e=5:s.isNumber(e)||(e=0),s.transform(t,function(t,i,n){e&&s.isObject(i)&&(i=o(i,e-1)),t[s.camelCase(n)]=i})};t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(120),o=i(144),r=o.extend({constructor:function(t){null!=t&&this.load(t)},load:function(t,e){if(this.src=t,!t)return n.reject("No URL to load");var i=this,o=n.promise(function(n,o){var r=new Image;r.src=t,i._img=r;var a;if(r.onload=function(){n(r),r.onload=null,r.error=null,clearInterval(a)},r.onerror=function(){o(r),r.onload=null,r.error=null,clearInterval(a)},r.complete)r.naturalWidth||r.naturalHeight?"function"==typeof r.onload&&r.onload():"function"==typeof r.onerror&&r.onerror();else if(e){var l=function(){return r.naturalWidth||r.naturalHeight?("function"==typeof r.onload&&r.onload(),!0):!1};l()||(s.isNumber(e)||(e=100),a=setInterval(l,e))}});return this.promise=o=o.then(s.bind(this._onLoad,this),s.bind(this._onError,this)),o},_onLoad:function(t){return this._img===t?(this.width=t.naturalWidth,this.height=t.naturalHeight,this.src=t.src,this.loaded=!0,n.resolve({width:this.width,height:this.height,src:this.src})):this.promise},_onError:function(t){return this._img===t?(this.width=null,this.height=null,this.src=t.src,this.loaded=!1,n.reject(this.src+" failed to load")):this.promise}},{load:function(t,e){var i=new r(t,e);return i.promise}});t.exports=r},function(t,e,i){"use strict";function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,i,s){return i&&t(e.prototype,i),s&&t(e,s),e}}(),o=i(3),r=i(120),a=i(190),l="FileReader"in window&&"readAsDataURL"in FileReader.prototype,h=(window.URL||window.webkitURL||window.mozURL||window.msURL||{}).createObjectURL,c=[],u=function(){function t(e){s(this,t),null!=e&&this.read(e)}return n(t,[{key:"read",value:function(t){var e=this,i=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if(this.file=t,!t)return r.reject("No file to read");if(!l)return r.reject("FileReader is not supported");t.type.match(/image\/(jpg|jpeg)/i)||(i=!1);var s=void 0;return s=i&&"readAsBinaryString"in FileReader.prototype?this.readBinaryString(t).then(function(i){try{var s=new a.JpegFile(i.binary,t.name);i.rotation=function(t){switch(t){case 1:return 0;case 2:return 0;case 3:return 180;case 4:return 180;case 5:return 270;case 6:return 90;case 7:return 90;case 8:return 270;default:return 0}}(s.tiff.Orientation.value),i.mirrored=function(t){switch(t){case 2:return!0;case 4:return!0;case 5:return!0;case 7:return!0;default:return!1}}(s.tiff.Orientation.value)}catch(n){}return e.readDataUrl(t).then(function(t){return o.extend(i,t)})}):this.readDataUrl(t),this.promise=s,s}},{key:"readDataUrl",value:function(t){var e=new FileReader;return"readAsDataURL"in e?r.promise(function(i,s){e.onload=function(t){var s=t.target.result;i(s),e.onload=null,e.onerror=null},e.onerror=function(){s(),e.onload=null,e.onerror=null},e.readAsDataURL(t)}).then(o.bind(this._onLoadDataUrl,this),o.bind(this._onError,this)):r.reject("FileReader.readAsDataURL is not supported")}},{key:"_onLoadDataUrl",value:function(t){var e={base64:t,file:this.file};return h&&(e.objectUrl=h(this.file),c.push(e.objectUrl)),r.resolve(e)}},{key:"readBinaryString",value:function(t){var e=new FileReader;return"readAsBinaryString"in e?r.promise(function(i,s){e.onload=function(t){var s=t.target.result;i(s),e.onload=null,e.onerror=null},e.onerror=function(){s(),e.onload=null,e.onerror=null},e.readAsBinaryString(t)}).then(o.bind(this._onLoadBinaryString,this),o.bind(this._onError,this)):r.reject("FileReader.readAsBinaryString is not supported")}},{key:"_onLoadBinaryString",value:function(t){return r.resolve({binary:t,file:this.file})}},{key:"_onError",value:function(t){return r.reject("Failed to read file")}}],[{key:"read",value:function(e,i){var s=new t(e,i);return s.promise}},{key:"canReadFiles",value:function(){return l}}]),t}();t.exports=u},function(t,e,i){"use strict";var s=function(){},n=t.exports={};n.stringIsClean=function(t){for(var e=0;e<t.length;e++)if(t.charCodeAt(e)<32)return!1;return!0},n.parseNum=function(t,e,i,s){var n,o,r=">"===t;for(void 0===i&&(i=0),void 0===s&&(s=e.length-i),n=r?i:i+s-1;r?i+s>n:n>=i;r?n++:n--)o<<=8,o+=e.charCodeAt(n);return o},n.parseSnum=function(t,e,i,s){var n,o,r,a=">"===t;for(void 0===i&&(i=0),void 0===s&&(s=e.length-i),n=a?i:i+s-1;a?i+s>n:n>=i;a?n++:n--)void 0===r&&(r=128===(128&e.charCodeAt(n))),o<<=8,o+=r?255&~e.charCodeAt(n):e.charCodeAt(n);return r&&(o+=1,o*=-1),o},n.Rational=function(t,e){return this.num=t,this.den=e||1,this},n.Rational.prototype.toString=function(){return 0===this.num?""+this.num:1===this.den?""+this.num:1===this.num?this.num+" / "+this.den:this.num/this.den},n.Rational.prototype.asFloat=function(){return this.num/this.den},n.MetaGroup=function(t,e){return this.fieldName=t,this.description=e,this.metaProps={},this},n.MetaGroup.prototype._addProperty=function(t,e,i){var s=new n.MetaProp(t,e,i);this[s.fieldName]=s,this.metaProps[s.fieldName]=s},n.MetaGroup.prototype.toString=function(){return"[MetaGroup "+this.description+"]"},n.MetaProp=function(t,e,i){return this.fieldName=t,this.description=e,this.value=i,this},n.MetaProp.prototype.toString=function(){return""+this.value},n.JpegFile=function(t,e){var i=this._SOS;this.metaGroups={},this._binary_data=t,this.filename=e;var s,o,r,a,l,h,c,u=0,d=0;if(this._binary_data.slice(0,2)!==this._SOI_MARKER)throw new Error("Doesn't look like a JPEG file. First two bytes are "+this._binary_data.charCodeAt(0)+","+this._binary_data.charCodeAt(1)+".");for(u+=2;u<this._binary_data.length&&(s=this._binary_data.charCodeAt(u++),o=this._binary_data.charCodeAt(u++),d=u,s==this._DELIM)&&o!==i;){for(l=n.parseNum(">",this._binary_data,u,2),u+=l;u<this._binary_data.length;)if(s=this._binary_data.charCodeAt(u++),s==this._DELIM&&(r=this._binary_data.charCodeAt(u++),0!==r)){u-=2;break}a=u-d,this._markers[o]?(h=this._markers[o][0],c=this._markers[o][1]):(h="UNKN",c=void 0),c&&this[c](o,d+2)}if(void 0===this.general)throw Error("Invalid JPEG file.");return this},n.JpegFile.prototype.toString=function(){return"[JpegFile "+this.filename+" "+this.general.type+" "+this.general.pixelWidth+"x"+this.general.pixelHeight+" Depth: "+this.general.depth+"]"},n.JpegFile.prototype._SOI_MARKER="ÿØ",n.JpegFile.prototype._DELIM=255,n.JpegFile.prototype._EOI=217,n.JpegFile.prototype._SOS=218,n.JpegFile.prototype._sofHandler=function(t,e){if(void 0!==this.general)throw Error("Unexpected multiple-frame image");this._addMetaGroup("general","General"),this.general._addProperty("depth","Depth",n.parseNum(">",this._binary_data,e,1)),this.general._addProperty("pixelHeight","Pixel Height",n.parseNum(">",this._binary_data,e+1,2)),this.general._addProperty("pixelWidth","Pixel Width",n.parseNum(">",this._binary_data,e+3,2)),this.general._addProperty("type","Type",this._markers[t][2])},n.JpegFile.prototype._JFIF_IDENT="JFIF\x00",n.JpegFile.prototype._JFXX_IDENT="JFXX\x00",n.JpegFile.prototype._EXIF_IDENT="Exif\x00",n.JpegFile.prototype._types={1:["BYTE",1],2:["ASCII",1],3:["SHORT",2],4:["LONG",4],5:["RATIONAL",8],6:["SBYTE",1],7:["UNDEFINED",1],8:["SSHORT",2],9:["SLONG",4],10:["SRATIONAL",8],11:["FLOAT",4],12:["DOUBLE",8]},n.JpegFile.prototype._tifftags={256:["Image width","ImageWidth"],257:["Image height","ImageLength"],258:["Number of bits per component","BitsPerSample"],259:["Compression scheme","Compression",{1:"uncompressed",6:"JPEG compression"}],262:["Pixel composition","PhotmetricInerpretation",{2:"RGB",6:"YCbCr"}],274:["Orientation of image","Orientation",{1:"Normal",2:"Reverse?",3:"Upside-down",4:"Upside-down Reverse",5:"90 degree CW",6:"90 degree CW reverse",7:"90 degree CCW",8:"90 degree CCW reverse"}],277:["Number of components","SamplesPerPixel"],284:["Image data arrangement","PlanarConfiguration",{1:"chunky format",2:"planar format"}],530:["Subsampling ratio of Y to C","YCbCrSubSampling"],531:["Y and C positioning","YCbCrPositioning",{1:"centered",2:"co-sited"}],282:["X Resolution","XResolution"],283:["Y Resolution","YResolution"],296:["Resolution Unit","ResolutionUnit",{2:"inches",3:"centimeters"}],273:["Image data location","StripOffsets"],278:["Number of rows per strip","RowsPerStrip"],279:["Bytes per compressed strip","StripByteCounts"],513:["Offset to JPEG SOI","JPEGInterchangeFormat"],514:["Bytes of JPEG Data","JPEGInterchangeFormatLength"],
  301:["Transfer function","TransferFunction"],318:["White point chromaticity","WhitePoint"],319:["Chromaticities of primaries","PrimaryChromaticities"],529:["Color space transformation matrix coefficients","YCbCrCoefficients"],532:["Pair of black and white reference values","ReferenceBlackWhite"],306:["Date and time","DateTime"],270:["Image title","ImageDescription"],271:["Make","Make"],272:["Model","Model"],305:["Software","Software"],315:["Person who created the image","Artist"],316:["Host Computer","HostComputer"],33432:["Copyright holder","Copyright"],34665:["Exif tag","ExifIfdPointer"],34853:["GPS tag","GPSInfoIfdPointer"]},n.JpegFile.prototype._exiftags={36864:["Exif Version","ExifVersion"],40960:["FlashPix Version","FlashpixVersion"],40961:["Color Space","ColorSpace"],37121:["Meaning of each component","ComponentsConfiguration"],37122:["Compressed Bits Per Pixel","CompressedBitsPerPixel"],40962:["Pixel X Dimension","PixelXDimension"],40963:["Pixel Y Dimension","PixelYDimension"],37500:["Manufacturer notes","MakerNote"],37510:["User comments","UserComment"],40964:["Related audio file","RelatedSoundFile"],36867:["Date Time Original","DateTimeOriginal"],36868:["Date Time Digitized","DateTimeDigitized"],37520:["DateTime subseconds","SubSecTime"],37521:["DateTimeOriginal subseconds","SubSecTimeOriginal"],37522:["DateTimeDigitized subseconds","SubSecTimeDigitized"],33434:["Exposure time","ExposureTime"],33437:["FNumber","FNumber"],34850:["Exposure program","ExposureProgram"],34852:["Spectral sensitivity","SpectralSensitivity"],34855:["ISO Speed Ratings","ISOSpeedRatings"],34856:["Optoelectric coefficient","OECF"],37377:["Shutter Speed","ShutterSpeedValue"],37378:["Aperture Value","ApertureValue"],37379:["Brightness","BrightnessValue"],37380:["Exposure Bias Value","ExposureBiasValue"],37381:["Max Aperture Value","MaxApertureValue"],37382:["Subject Distance","SubjectDistance"],37383:["Metering Mode","MeteringMode"],37384:["Light Source","LightSource"],37385:["Flash","Flash"],37386:["Focal Length","FocalLength"],37396:["Subject Area","SubjectArea"],41483:["Flash Energy","FlashEnergy"],41484:["Spatial Frequency Response","SpatialFrequencyResponse"],41486:["Focal Plane X Resolution","FocalPlaneXResolution"],41487:["Focal Plane Y Resolution","FocalPlaneYResolution"],41488:["Focal Plane Resolution Unit","FocalPlaneResolutionUnit"],41492:["Subject Location","SubjectLocation"],41493:["Exposure Index","ExposureIndex"],41495:["Sensing Method","SensingMethod"],41728:["File Source","FileSource"],41729:["Scene Type","SceneType"],41730:["CFA Pattern","CFAPattern"],41985:["Custom Rendered","CustomRendered"],41986:["Exposure Mode","Exposure Mode"],41987:["White Balance","WhiteBalance"],41988:["Digital Zoom Ratio","DigitalZoomRatio"],41989:["Focal length in 35 mm film","FocalLengthIn35mmFilm"],41990:["Scene Capture Type","SceneCaptureType"],41991:["Gain Control","GainControl"],41992:["Contrast","Contrast"],41993:["Saturation","Saturation"],41994:["Sharpness","Sharpness"],41995:["Device settings description","DeviceSettingDescription"],41996:["Subject distance range","SubjectDistanceRange"],42016:["Unique image ID","ImageUniqueID"],40965:["Interoperability tag","InteroperabilityIFDPointer"]},n.JpegFile.prototype._gpstags={0:["GPS tag version","GPSVersionID"],1:["North or South Latitude","GPSLatitudeRef"],2:["Latitude","GPSLatitude"],3:["East or West Longitude","GPSLongitudeRef"],4:["Longitude","GPSLongitude"],5:["Altitude reference","GPSAltitudeRef"],6:["Altitude","GPSAltitude"],7:["GPS time (atomic clock)","GPSTimeStamp"],8:["GPS satellites usedd for measurement","GPSSatellites"],9:["GPS receiver status","GPSStatus"],10:["GPS mesaurement mode","GPSMeasureMode"],11:["Measurement precision","GPSDOP"],12:["Speed unit","GPSSpeedRef"],13:["Speed of GPS receiver","GPSSpeed"],14:["Reference for direction of movement","GPSTrackRef"],15:["Direction of movement","GPSTrack"],16:["Reference for direction of image","GPSImgDirectionRef"],17:["Direction of image","GPSImgDirection"],18:["Geodetic survey data used","GPSMapDatum"],19:["Reference for latitude of destination","GPSDestLatitudeRef"],20:["Latitude of destination","GPSDestLatitude"],21:["Reference for longitude of destination","GPSDestLongitudeRef"],22:["Longitude of destination","GPSDestLongitude"],23:["Reference for bearing of destination","GPSDestBearingRef"],24:["Bearing of destination","GPSDestBearing"],25:["Reference for distance to destination","GPSDestDistanceRef"],26:["Distance to destination","GPSDestDistance"],27:["Name of GPS processing method","GPSProcessingMethod"],28:["Name of GPS area","GPSAreaInformation"],29:["GPS Date","GPSDateStamp"],30:["GPS differential correction","GPSDifferential"]},n.JpegFile.prototype._markers={192:["SOF0","_sofHandler","Baseline DCT"],193:["SOF1","_sofHandler","Extended sequential DCT"],194:["SOF2","_sofHandler","Progressive DCT"],195:["SOF3","_sofHandler","Lossless (sequential)"],197:["SOF5","_sofHandler","Differential sequential DCT"],198:["SOF6","_sofHandler","Differential progressive DCT"],199:["SOF7","_sofHandler","Differential lossless (sequential)"],200:["JPG",null,"Reserved for JPEG extensions"],201:["SOF9","_sofHandler","Extended sequential DCT"],202:["SOF10","_sofHandler","Progressive DCT"],203:["SOF11","_sofHandler","Lossless (sequential)"],205:["SOF13","_sofHandler","Differential sequential DCT"],206:["SOF14","_sofHandler","Differential progressive DCT"],207:["SOF15","_sofHandler","Differential lossless (sequential)"],196:["DHT",null,"Define Huffman table(s)"],204:["DAC",null,"Define arithmetic coding conditioning(s)"],208:["RST0",null,"Restart with modulo 8 count “0”"],209:["RST1",null,"Restart with modulo 8 count “1”"],210:["RST2",null,"Restart with modulo 8 count “2”"],211:["RST3",null,"Restart with modulo 8 count “3”"],212:["RST4",null,"Restart with modulo 8 count “4”"],213:["RST5",null,"Restart with modulo 8 count “5”"],214:["RST6",null,"Restart with modulo 8 count “6”"],215:["RST7",null,"Restart with modulo 8 count “7”"],216:["SOI",null,"Start of image"],217:["EOI",null,"End of image"],218:["SOS",null,"Start of scan"],219:["DQT",null,"Define quantization table(s)"],220:["DNL",null,"Define number of lines"],221:["DRI",null,"Define restart interval"],222:["DHP",null,"Define hierarchical progression"],223:["EXP",null,"Expand reference component(s)"],224:["APP0","_app0Handler","Reserved for application segments"],225:["APP1","_app1Handler"],226:["APP2",null],227:["APP3",null],228:["APP4",null],229:["APP5",null],230:["APP6",null],231:["APP7",null],232:["APP8",null],233:["APP9",null],234:["APP10",null],235:["APP11",null],236:["APP12",null],237:["APP13",null],238:["APP14",null],239:["APP15",null],240:["JPG0",null],241:["JPG1",null],242:["JPG2",null],243:["JPG3",null],244:["JPG4",null],245:["JPG5",null],246:["JPG6",null],247:["JPG7",null],248:["JPG8",null],249:["JPG9",null],250:["JPG10",null],251:["JPG11",null],252:["JPG12",null],253:["JPG13",null],254:["COM",null],1:["JPG13",null]},n.JpegFile.prototype._addMetaGroup=function(t,e){var i=new n.MetaGroup(t,e);return this[i.fieldName]=i,this.metaGroups[i.fieldName]=i,i},n.JpegFile.prototype._parseIfd=function(t,e,i,o,r,a,l){var h,c,u,d,p,g,_,m,f,v,b,y=n.parseNum(t,e,i+o,2);b=this._addMetaGroup(a,l);for(var w=0;y>w;w++)if(h=i+o+2+12*w,c=n.parseNum(t,e,h,2),d=n.parseNum(t,e,h+2,2),g=n.parseNum(t,e,h+4,4),_=n.parseNum(t,e,h+8,4),void 0!==this._types[d]){if(u=this._types[d][0],p=this._types[d][1],_=4>=p*g?h+8:i+_,"UNDEFINED"==u)m=void 0;else if("ASCII"==u)m=e.slice(_,_+g),m=m.split("\x00")[0],n.stringIsClean(m)||(m="");else{m=[];for(var k=0;g>k;k++,_+=p)"BYTE"!=u&&"SHORT"!=u&&"LONG"!=u||m.push(n.parseNum(t,e,_,p)),"SBYTE"!=u&&"SSHORT"!=u&&"SLONG"!=u||m.push(n.parseSnum(t,e,_,p)),"RATIONAL"==u&&(f=n.parseNum(t,e,_,4),v=n.parseNum(t,e,_+4,4),m.push(new n.Rational(f,v))),"SRATIONAL"==u&&(f=n.parseSnum(t,e,_,4),v=n.parseSnum(t,e,_+4,4),m.push(new n.Rational(f,v))),m.push();1===g&&(m=m[0])}r.hasOwnProperty(c)?b._addProperty(r[c][1],r[c][0],m):s("WARNING(jpegmeta.js): Unknown tag: ",c)}},n.JpegFile.prototype._jfifHandler=function(t,e){if(void 0!==this.jfif)throw Error("Multiple JFIF segments found");this._addMetaGroup("jfif","JFIF"),this.jfif._addProperty("version_major","Version Major",this._binary_data.charCodeAt(e+5)),this.jfif._addProperty("version_minor","Version Minor",this._binary_data.charCodeAt(e+6)),this.jfif._addProperty("version","JFIF Version",this.jfif.version_major.value+"."+this.jfif.version_minor.value),this.jfif._addProperty("units","Density Unit",this._binary_data.charCodeAt(e+7)),this.jfif._addProperty("Xdensity","X density",n.parseNum(">",this._binary_data,e+8,2)),this.jfif._addProperty("Ydensity","Y Density",n.parseNum(">",this._binary_data,e+10,2)),this.jfif._addProperty("Xthumbnail","X Thumbnail",n.parseNum(">",this._binary_data,e+12,1)),this.jfif._addProperty("Ythumbnail","Y Thumbnail",n.parseNum(">",this._binary_data,e+13,1))},n.JpegFile.prototype._app0Handler=function(t,e){var i=this._binary_data.slice(e,e+5);i==this._JFIF_IDENT?this._jfifHandler(t,e):i==this._JFXX_IDENT},n.JpegFile.prototype._app1Handler=function(t,e){var i=this._binary_data.slice(e,e+5);i==this._EXIF_IDENT&&this._exifHandler(t,e+6)},n.JpegFile.prototype._exifHandler=function(t,e){if(void 0!==this.exif)throw new Error("Multiple JFIF segments found");var i,s,o,r=this._binary_data.slice(e,e+2);if("II"===r)i="<";else{if("MM"!==r)throw new Error("Malformed TIFF meta-data. Unknown endianess: "+r);i=">"}if(s=n.parseNum(i,this._binary_data,e+2,2),42!==s)throw new Error("Malformed TIFF meta-data. Bad magic: "+s);if(o=n.parseNum(i,this._binary_data,e+4,4),this._parseIfd(i,this._binary_data,e,o,this._tifftags,"tiff","TIFF"),this.tiff.ExifIfdPointer&&this._parseIfd(i,this._binary_data,e,this.tiff.ExifIfdPointer.value,this._exiftags,"exif","Exif"),this.tiff.GPSInfoIfdPointer){if(this._parseIfd(i,this._binary_data,e,this.tiff.GPSInfoIfdPointer.value,this._gpstags,"gps","GPS"),this.gps.GPSLatitude){var a;a=this.gps.GPSLatitude.value[0].asFloat()+1/60*this.gps.GPSLatitude.value[1].asFloat()+1/3600*this.gps.GPSLatitude.value[2].asFloat(),"S"===this.gps.GPSLatitudeRef.value&&(a=-a),this.gps._addProperty("latitude","Dec. Latitude",a)}if(this.gps.GPSLongitude){var l;l=this.gps.GPSLongitude.value[0].asFloat()+1/60*this.gps.GPSLongitude.value[1].asFloat()+1/3600*this.gps.GPSLongitude.value[2].asFloat(),"W"===this.gps.GPSLongitudeRef.value&&(l=-l),this.gps._addProperty("longitude","Dec. Longitude",l)}}}},function(t,e,i){"use strict";var s=i(8),n=i(3),o=function(t,e,i){if(0===i)return 0;var s=null==i?e:e/i;return 2===arguments.length?Math.round(t*s):void 0},r=function(t,e,i){if(0===i)return 0;var s=null==i?e:e/i;return Math.round(t/s)},a=function(t,e,i,s){var n=t,a=e,l=t/e,h=i/s;return(t>i||e>s)&&(l>h?(n=i,a=r(n,l)):(a=s,n=o(a,l))),{width:n,height:a}},l=function(t,e,i,s,n,a){null!=n||(n=.5),null!=a||(a=.5);var l=0,h=0,c=t,u=e,d=t/e,p=i/s;return d>p?(c=o(e,p),l=Math.round(n*(t-c))):p>d&&(u=r(t,p),l=Math.round(a*(e-u))),{left:l,top:h,width:c,height:u}},h=function(t){var e;t instanceof s?(e=t,t=e.get(0)):e=s(t);var i=document.createElement("canvas");return i.width=t.width||e.width(),i.height=t.height||e.height(),i},c=function(t){var e=t.$(".needs-drawing");n.each(e,function(t){var e=t.getContext("2d"),i=new Image,n=4;e.mozImageSmoothingEnabled=!1,e.imageSmoothingEnabled=!1,e.msImageSmoothingEnabled=!1,e.imageSmoothingEnabled=!1;var o=function(){e.fillStyle="#FFF",e.fillRect(0,0,t.width,t.height),e.drawImage(i,0,0,n,n),e.drawImage(t,0,0,n,n,0,0,t.width,t.height)};i.onload=o,i.src=s(t).data("image-url")}),e.removeClass("needs-drawing")},u=function(t,e,i){var n;t instanceof s?(n=t,t=n.get(0)):n=s(t),e?e instanceof s&&(e=e.get(0)):e=h(t);var o=e.width,r=e.height,a=e.getContext("2d");return a.save(),i&&(a.translate(e.width,0),a.scale(-1,1)),a.drawImage(t,0,0,o,r),a.restore(),e},d=function(t,e,i,n,o,a){var l;t instanceof s?(l=t,t=l.get(0)):l=s(t);var h=90===n||270===n;h?a&&i>a&&(e=r(a,i,e),i=a):a&&e>a&&(i=r(a,e,i),e=a);var c=document.createElement("canvas");h?(c.width=i,c.height=e):(c.width=e,c.height=i);var u=c.getContext("2d");return u.save(),u.translate(.5*c.width,.5*c.height),u.rotate(n*Math.PI/180),o&&u.scale(-1,1),u.drawImage(t,-.5*e,-.5*i,e,i),u.restore(),c},p={widthForHeight:o,heightForWidth:r,maxSize:a,cropBox:l,createCanvasForEl:h,drawElToCanvas:u,drawScaledAndRotated:d,drawPixelatedImages:c};t.exports=p},function(t,e,i){"use strict";function s(){}var n=i(6).sprintf,o=i(183).truncateLongStrings;s.prototype.genericFieldMap={one:"quote",two:"source"},s.prototype.typeAttributes={quote:"",source:""},s.prototype.generateTweetText=function(t,e){var i=this.getHtmlStripped("quote"),s=this.getHtmlStripped("source");s=s.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,"");var r;return r=s&&i.length+(s.length>1?7:6)<=e?r=n("“%s” - %s",i,s):i?n("“%s”",o(i,e-2)):s,o(r,e)},s.prototype.editorField="two",s.prototype.validate=function(t,e,i){var s=[];return(!e.quote||e.quote.length<1)&&s.push("No quote."),t.call(this,e,{errors:s})},t.exports=s},function(t,e,i){"use strict";function s(){}var n=i(3),o=i(6).sprintf,r=i(194),a=i(183).truncateLongStrings,l=i(195);s.prototype.genericFieldMap={one:"title",two:"url",three:"caption",thumbnail:"thumbnail",excerpt:"excerpt",author:"author"},s.prototype.typeAttributes={title:"",url:"",caption:"",excerpt:"",author:""},s.prototype.allowAnswerFields=["caption"],s.prototype.generateTweetText=function(t,e){var i=this.getHtmlStripped("title"),s=this.getHtmlStripped("url"),n=this.getHtmlStripped("caption");n=n.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,"");var l;return l=i&&n?o("%s - %s",i,n):i||n||r.parseUrl(s).host||"",a(l,e)},s.prototype.editorField="three",s.prototype.typeAttributes={title:"",url:"",excerpt:"",author:""},s.prototype.resetPreserveFields=["caption","tags"],s.prototype.resetAttributes=["title","url","thumbnail","excerpt","author"],s.prototype.softReset=function(t){t.apply(this,n.rest(arguments)),n.isEmpty(this.get("thumbnail"))||"new"===this.get("mode")||this.set("remove_thumbnail",1)},s.prototype.serializeForServer=function(t){var e=t.apply(this,n.rest(arguments));return this.get("remove_thumbnail")&&(e.remove_thumbnail=this.get("remove_thumbnail")),n.extend(e,{author:this.getAttributeFromGeneric("author"),excerpt:this.getAttributeFromGeneric("excerpt")}),e},s.prototype.validate=function(t,e,i){var s=[];return e.loading&&s.push("Loading OpenGraph data."),(!e.url||e.url.length<1)&&s.push("No url."),l.isUrl(e.url)||s.push("Not a valid URL"),t.call(this,e,{errors:s})},t.exports=s},function(t,e,i){"use strict";var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},n=i(3),o={aElement:document.createElement("a"),acceptedProtocols:["http:","https:","tumblr:","mailto:"],_setUrl:function(t){return this.aElement.setAttribute("href",t),this.aElement.setAttribute("href",this.aElement.href),this.aElement.href},parseUrl:function(t){if(!n.startsWith(t,"http"))throw new URIError("Missing protocol in URL to be parsed. Must be http or https");return this._setUrl(t),{url:t,href:this.aElement.href,protocol:this.aElement.protocol,host:this.aElement.hostname,port:this.aElement.port,query:this.aElement.search,hash:this.aElement.hash,path:this.aElement.pathname}},parseTumblelogUrl:function(t){try{-1===t.indexOf("://")&&(t="http://"+t);var e=this.parseUrl(t),i=!1;if(n.endsWith(e.host,"tumblr.com")?i=e.host.match(/([a-zA-Z0-9-_]+)\.tumblr\.com/i):n.endsWith(e.host,"tumblr.net")?i=e.host.match(/(?:^|\/\/)(?:([\w\-\_]+)\.)(?:[\w\-\_]+\.)*tumblr\.net/i):n.endsWith(e.host,"t.dev")&&(i=e.host.match(/([a-zA-Z0-9-_]+)\.t\.dev/i)),i){var s=i[1];if("www"===s)return!1;var o={tumblelog_name:s},r=e.path.match(/post\/([0-9]+)/i);return r&&(o.post_id=r[1]),o}return!1}catch(a){return!1}},isTumblelogUrl:function(t){return this.parseTumblelogUrl(t)!==!1},parseTumblelogShortUrl:function(t){try{-1===t.indexOf("://")&&(t="http://"+t);var e=this.parseUrl(t);return"tmblr.co"!==e.host?!1:n.startsWith(e.path,"/m")?{mentionKey:e.path.match(/^\/m([^\/]+)/)[0]}:n.startsWith(e.path,"/Z")?{postTinyUrlHash:e.path.match(/^\/Z([^\/]+)/)[0]}:!1}catch(i){return!1}},isTumblelogShortUrl:function(t){return this.parseTumblelogShortUrl(t)!==!1},isTumblrMediaUrl:function(t){return t?(-1===t.indexOf("://")&&(t="http://"+t),!!t.match(/^https?:\/\/(\d+\.)media\.tumblr\.com\//i)):!1},hasAllowedProtocol:function(t){this._setUrl(t);var e=this.aElement.protocol;if(":"===e&&(e=location.protocol),-1===this.acceptedProtocols.indexOf(e))throw new Error("Unsupported protocol detected in URL: "+t);return!0},isAbsoluteUrl:function(t){var e=new RegExp("^(?:[a-z]+:)?//","i");return!!e.test(t||"")},getParameter:function(t){var e=new RegExp("[?|&]"+t+"=([^&;]+?)(&|#|;|$)"),i=e.exec(location.search)||[null,""],s=i[1].replace(/\+/g,"%20"),n=decodeURIComponent(s);return n||null},httpBuildQuery:function(t,e){var i=[];for(var n in t)if(t.hasOwnProperty(n)){var o=e?e+"["+n+"]":n,r=t[n];if(!r)continue;i.push("object"===("undefined"==typeof r?"undefined":s(r))?this.httpBuildQuery(r,o):encodeURIComponent(o)+"="+encodeURIComponent(r))}return i.join("&")},buildUrl:function(t,e){var i=this.httpBuildQuery(e);return t+(n.isEmpty(i)?"":"?"+i)},getQueryStringHash:function(t){var e={};return t.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(t,i,s,n){e[i]=n}),e},isProtocolRelative:function(t){var e=new RegExp("^//[^/]","i");return e.test(t||"")},getExtension:function(t){var e,i;return this.isProtocolRelative(t)&&(t=this.addProtocolIfMissing(t,"http:")),n.startsWith(t,"http")&&(i=this.parseUrl(t),n.isEmpty(i.path)||(e=i.path)),e||(e=t),n.last(e.split("."))},addProtocolIfMissing:function(t,e){if(n.any(this.acceptedProtocols,function(e){return n.startsWith(t,e)}))return t;if(-1===this.acceptedProtocols.indexOf(e))throw new Error("Attempting to add an unsupported protocol: "+e);return(this.isProtocolRelative(t)?e:e+"//")+t}};t.exports=o},function(t,e){"use strict";var i={isUrl:function(t){var e="%[0-9a-fA-F]{2}",i="(http|https):\\/\\/",s='([a-zA-Z0-9$\\-_.+!*"(),;:&=]|'+e+")+@",n="(25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9]|[1-9][0-9]|[0-9])",o="("+n+"(\\."+n+"){3})",r="a-zA-Z0-9\\-\\_\\~",a="\\u00C0-\\u017F",l="(["+r+a+"]+\\.)+([a-zA-Z]{2,})",h="[0-9]+",c="("+o+"|localhost|"+l+")(:"+h+")?",u="a-zA-Z0-9-._\\~:\\[\\]@!$&'()*+,;=",d="(["+u+"]|"+e+")*",p=d+"(\\/"+d+")*",g="\\?(["+u+"/?]|"+e+")*",_="\\#(["+u+"/?]|"+e+")*",m=new RegExp("^"+i+"("+s+")?"+c+"(\\/?("+p+")?("+g+")?("+_+")?)?$");return m.test(t)===!0},isImageUrl:function(t){var e=i.isUrl(t),s=/.+[.](jpg|jpeg|png|gif)([?]|$)/.test(t)===!0;return e&&s}};t.exports=i},function(t,e,i){"use strict";function s(){}var n=i(3),o=i(6).sprintf,r=i(183).truncateLongStrings;s.prototype.genericFieldMap={one:"title",two:"chat"},s.prototype.typeAttributes={title:"",chat:""},s.prototype.generateTweetText=function(t,e){var i,s=this.getHtmlStripped("title"),n=this.getHtmlStripped("chat");return i=s&&n?o("%s - %s",s,n):s||n||"",r(i,e)},s.prototype.validate=function(t,e,i){var s=[];return(!e.chat||e.chat.length<1)&&s.push("No chat."),t.call(this,e,{errors:s})},s.prototype.serializeForServer=function(t){var e=this,i=t.apply(this,n.rest(arguments));return i["post[two]"]=e.get("chat").replace(/\u00A0/gm," "),i},t.exports=s},function(t,e,i){"use strict";function s(){}var n=i(3),o=i(100),r=i(183).truncateLongStrings;s.prototype.genericFieldMap={two:"caption",three:"url"},s.prototype.editorField="two",s.prototype.allowsTypeSwitch=function(){return"new"===this.get("mode")},s.prototype.typeAttributes={service:!1,preuploadUrl:"",trackTitle:"",trackArtist:"",trackAlbum:"",preuploadAlbumArt:!1,albumArt:"",caption:"",confirmTos:!1},s.prototype.allowAnswerFields=["caption"],s.prototype.generateTweetText=function(t,e){var i=this.getHtmlStripped("caption");return i=i.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,""),r(i,e)},s.prototype.resetPreserveFields=["caption","tags"],s.prototype.resetAttributes=["service","url","preuploadUrl","trackTitle","trackArtist","trackAlbum","confirmTos","preuploadAlbumArt","albumArt","copyrightFallback"],s.prototype.parseForType=function(t,e,i){i.service&&"direct"!==i.service||(e.url=i.audio_url),delete e.audio_url,e.albumArt=i.audio_artwork,delete e.audio_artwork;var s=i.id3_tags||{};return delete e.id3_tags,e.trackTitle=s.Title||"",e.trackArtist=s.Artist||"",e.trackAlbum=s.Album||"",e},s.prototype.serializeForServer=function(t){var e=t.apply(this,n.rest(arguments)),i={"id3_tags[title]":this.get("trackTitle")||null,"id3_tags[artist]":this.get("trackArtist")||null,"id3_tags[album]":this.get("trackAlbum")||null,preuploaded_url:this.get("preuploadUrl"),confirm_tos:this.get("confirmTos"),artwork_pre_upload:this.get("preuploadAlbumArt"),album_art:this.get("albumArt"),remove_album_art:"edit"===this.get("mode")&&n.isEmpty(this.get("albumArt")),copyright_fallback:this.get("copyrightFallback")};return n.extend(e,n.pick(i,function(t){return!n.isUndefined(t)})),n.isEmpty(e.preuploaded_url)||(e["post[three]"]=null),e},s.prototype.validate=function(t,e,i){var s=[];return n.isEmpty(e.url)?s.push(o("Please choose an audio source before continuing.")):e.preuploadUrl?e.confirmTos||s.push(o("You must agree that you have permission to share this file.")):n.isEmpty(e.url)&&s.push(o("Please choose an audio source before continuing.")),t.call(this,e,{errors:s})},t.exports=s},function(t,e,i){"use strict";function s(){}var n=i(3),o=i(100),r=i(199),a=i(187),l=i(183).truncateLongStrings;s.prototype.genericFieldMap={one:"embedCode",two:"caption"},s.prototype.allowAnswerFields=["caption"],s.prototype.editorField="two",s.prototype.resetPreserveFields=["caption","tags"],s.prototype.resetAttributes=["preuploadUrl","preuploadKey","embedCode","confirmTos","copyrightFallback"],s.prototype.typeAttributes={caption:"",confirmTos:!1},s.prototype.generateTweetText=function(t,e){var i=this.getHtmlStripped("caption");return i=i.replace(/[\r\n\s]*\[\[MORE\]\].*$/gi,""),l(i,e)},s.prototype.validate=function(t,e,i){var s=[];return e.embedCode?0===e.embedCode.length&&s.push("No embed specified."):e.preuploadUrl?e.confirmTos||s.push(o("You must agree that you have permission to share this file.")):e.video?0===e.video.embed_code.length&&s.push("Direct embed missing."):s.push("No video specified."),t.call(this,e,{errors:s})},s.prototype.canPreview=function(){return!this.get("preuploadKey")&&this.isValid()},s.prototype.serializeForServer=function(t){var e=t.apply(this,n.rest(arguments)),i=n.omit({preuploaded_url:this.get("preuploadUrl"),preuploaded_ch:this.get("preuploadKey"),confirm_tos:this.get("confirmTos"),copyright_fallback:this.get("copyrightFallback")},n.isUndefined);return n.extend(e,i),e=r(e,{embedCode:"embed_code"})},s.prototype.getEmbedData=function(t){var e=!1;return this.has("video")?(e=a(this.get("video")),e={isNativeVideo:!0,embedRenderContext:"inline",width:e.dimensions.width,height:e.dimensions.height,previewIframe:e.previewIframe,embedCode:e.embedCode}):this.has("video_embed")&&(e=a(this.get("video_embed"))),e},t.exports=s},function(t,e,i){"use strict";function s(t,e){return o.zipObject(t,o.map(t,e))}function n(t,e){return o.isFunction(e)&&(e=s(o.keys(t),e)),o.transform(t,function(t,i,s){t[o.result(e,s)||s]=i},{})}var o=i(3);n.createKeyMap=s,t.exports=n},function(t,e,i){"use strict";function s(){}var n=i(3),o=i(183).truncateLongStrings;s.prototype.genericFieldMap={one:"ask",two:"answer",three:"caption"},s.prototype.editorField="three",s.prototype.typeAttributes={ask:"",answer:"",caption:""},s.prototype.generateTweetText=function(t,e){return o(this.getHtmlStripped("ask"),e)},s.prototype.parseForType=function(t,e,i){return e.ask=n.escape(e.ask),e},s.prototype.validate=function(t,e,i){var s=[];return e.ask||s.push("Post question empty."),t.call(this,e,{errors:s})},t.exports=s},function(t,e,i){"use strict";var s=i(3),n=function(t){if(s.isString(t)){if(t=t.toLowerCase(),"true"===t||"1"===t||"on"===t)return!0;if("false"===t||""===t||"off"===t)return!1;if(t=s.parseInt(t),s.isNaN(t))return!0}return!!t};t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(118),o=i(203),r=i(120),a=n.extend({model:o,_listenToUploadModel:function(t){this.listenTo(t,"change",this._onUploadModelChange)},_stopListeningToUploadModel:function(t){this.stopListening(t)},_onUploadModelChange:function(t){s.has(t.changed,"complete")&&this.trigger("complete",this,t),s.has(t.changed,"error")&&t.get("error")&&this.trigger("error",this,t),s.has(t.changed,"complete")&&this.allComplete()&&this.trigger("allComplete",this)},add:function(t){return s.isArray(t)?s.forEach(t,this._listenToUploadModel,this):this._listenToUploadModel(t),n.prototype.add.apply(this,arguments)},remove:function(t){return s.isArray(t)?s.forEach(t,this._stopListeningToUploadModel,this):this._stopListeningToUploadModel(t),n.prototype.remove.apply(this,arguments)},removeIncomplete:function(t){var e=this.where({uploading:!1,complete:!1});return this.remove(e,t)},removeFailed:function(t){var e=this.filter(function(t){return t.get("error")});return this.remove(e,t)},allComplete:function(){return this.length?this.every(function(t){return t.get("complete")}):!1},anyUploading:function(){return this.length>0&&this.any(function(t){return t.get("uploading")})},getProgress:function(){var t=0,e=0;return this.forEach(function(i){i.get("error")&&(t+=i.get("bytesLoaded")||0,e+=i.get("bytesTotal")||0)}),e?t/e:0},promise:function l(){if(this.allComplete())return r.resolve(this);var l=r.promise(s.bind(function(t,e){var i,n;i=s.bind(function(){this.stopListening(this,"uploads:allComplete",i),this.stopListening(this,"uploads:error",n),t.apply(this,arguments)},this),n=s.bind(function(){this.stopListening(this,"uploads:allComplete",i),this.stopListening(this,"uploads:error",n),e.apply(this,arguments)},this),this.listenToOnce(this,"uploads:allComplete",i),this.listenToOnce(this,"uploads:error",n)},this));return l}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(113),o=n.extend({defaults:{url:"",file:null,error:!1,uploading:!1,complete:!1,bytesLoaded:0,bytesTotal:0},initialize:function(t,e){this.options=s.extend({},e),this.options.jqXHR&&this.setUploadRequest(this.options.jqXHR)},setUploadRequest:function(t){return this.jqXHR=t,t.then(function(){}),t},_uploadDone:function(){this.set({error:!1,uploading:!1,complete:!0})},_uploadFail:function(){this.set({error:!0,uploading:!1,complete:!1})},cancelUpload:function(){var t;return this.jqXHR&&(t=this.jqXHR.abort(),this.jqXHR=null),t},getProgress:function(){return this.get("bytesTotal")?this.get("bytesLoaded")/this.get("bytesTotal"):0}});t.exports=o},,function(t,e,i){"use strict";var s=i(3),n=i(115),o=new n({defaults:{teardown:function(){return this},beforeTeardown:function(){},afterTeardown:function(){return this.teardownSubViews()},render:function(){return this},beforeRender:function(){},afterRender:function(){return this.renderSubViews()},attachSubView:function(t,e){if(1===arguments.length)if("string"==typeof t){if(e=t,t=this.subViews[e],!t)return this}else e=t.$el.data("subview")||"";var i=this.$('[data-subview="'+e+'"]');return i.length>1&&(i=i.first()),t&&i.length&&(i.replaceWith(t.$el),t.$el.attr("data-subview",e)),this},attachSubViews:function(t){return s.forEach(this.subViews,this.attachSubView,this),this},teardownSubViews:function(){return s.forEach(this.subViews,function(t,e){t&&s.isFunction(t.teardown)&&t.teardown(),this.subViews[e]=null},this),this.subViews={},this},renderSubViews:function(){return s.forEach(this.subViews,function(t){t&&s.isFunction(t.render)&&t.render()},this),this},isInitialized:function(){return this._initialized},isRendered:function(){return this._rendered},isRendering:function(){return this._rendering},isRemoved:function(){return this._removed}},around:{initialize:function(t){this._initialized=!1,this._rendering=!1,this._rendered=!1,this._removed=!1,this.subViews={};var e=t.apply(this,s.rest(arguments));return this._initialized=!0,e},teardown:function(t){var e=s.rest(arguments);s.isFunction(this.beforeTeardown)&&this.beforeTeardown.apply(this,e);var i=t.apply(this,e);return s.isFunction(this.afterTeardown)&&this.afterTeardown.apply(this,e),this._rendered=!1,i},render:function(t){var e=s.rest(arguments);this._rendering=!0,s.isFunction(this.beforeRender)&&this.beforeRender.apply(this,e);var i=t.apply(this,e);return s.isFunction(this.afterRender)&&this.afterRender.apply(this,e),this._rendering=!1,this._rendered=!0,this.trigger("rendered"),i}},after:{remove:function(){this._removed=!0,this.subViews=null}}});t.exports=o},function(t,e,i){"use strict";function s(t){return n.trim(t)}var n=i(3),o=i(115),r=function(t,e){return t=s(t),e&&n.isFunction(this.$$)&&this.$$.cache["delete"](t),t},a=function(t){return this.$$?(t=s(t),this.$(t)):void 0},l=function(t){this.$$&&(t=s(t),this.$$.cache["delete"](t))},h=function(t){return this.$$?(t=s(t),this.$$.cache["delete"](t),this.$(t)):void 0},c=function(){this.$$&&(this.$$.cache=new n.memoize.Cache)},u=function(t){return"[data-js-"+t+"]"},d=function(t){return function(){var t=n.memoize(n.bind(a,this),n.bind(r,this));t.update=n.bind(h,this),t.remove=n.bind(l,this),t.empty=n.bind(c,this);var e=function(e,i){return t(u(e),i)};return e.update=function(e){t.update(u(e))},e.remove=function(e){t.remove(u(e))},this.$$=t,this.js$=e,this.$$initialize=n.noop,t}.call(t)},p=new o({defaults:{$$cacheKeys:{},$$cacheSelectors:function(t){return"undefined"==typeof t&&(t=this.$$cacheKeys),n.forEach(t,function(t){this.$$.update(t)},this),this},$$initialize:function(){return d(this)},$$:function(){return d(this).apply(this,arguments)}},before:{initialize:function(){this.$$initialize()},render:function(){this.$$.empty()}},after:{setElement:function(){n.isFunction(this.$$.empty)&&this.$$.empty()},remove:function(){n.isFunction(this.$$.empty)&&this.$$.empty()},render:function(){n.isFunction(this.$$cacheSelectors)&&this.$$cacheSelectors()}}});t.exports=p},,,,,,function(t,e,i){"use strict";function s(t){return o.noop}var n=i(8),o=i(3),r=(i(6).sprintf,i(115)),a=i(109),l=!1,h=n("body"),c=n(window),u=i(213),d=new r({removeAutoTeardown:function(){this._popoverBase.clickOutside&&(this._popoverBase.clickOutside.remove(),this._popoverBase.clickOutside=null)},setupAutoTeardown:function(){this.isRendered()&&(this.removeAutoTeardown(),this._popoverBase.autoTeardown&&(this._popoverBase.clickOutside=new u(this.el,this.options),this._popoverBase.clickOutside.on("click:outside",this.onClickOutside,this)))},onClickOutside:function(){this._popoverBase.shouldTeardown?(this._popoverBase.lastAutoTeardown=o.now(),this.teardown()):this._popoverBase.shouldTeardown=!0},reposition:function(){if(!this.$pinned.closest("body").length)return void this.$el.css("visibility","hidden");var t=this.pinnedRect(),e={scrollTop:this.isContainerBody?0:this.$container.scrollTop(),scrollLeft:this.isContainerBody?0:this.$container.scrollLeft(),realTop:this.isContainerBody?0:this.$container.offset().top,realLeft:this.isContainerBody?0:this.$container.offset().left},i=this._popoverBase.shift,s=this._popoverBase.pinnedSide,n={visibility:"visible"},r={},a=this.$el.width(),l=null,h=null,c=null,u=null;this.debug("reposition: pinnedSide=%s, shift=%O, pinnedRect=%O",s,i,t),this._popoverBase.isFixedPosition&&(n.position="fixed"),"top"===s||"bottom"===s?(o.extend(n,{left:t.left+Math.floor(t.width/2)+i.x}),r={top:t.top+e.scrollTop-i.y,bottom:t.top+e.scrollTop+t.height+i.y,left:t.left+e.scrollLeft-i.x,right:t.left+e.scrollLeft+t.width+i.x},r.center=(r.right-r.left)/2,l=e.realTop+r.top-this.$el.height(),h=e.realTop+r.bottom+this.$el.height(),"top"===s&&this._crossesViewportEdge("top",l)&&!this._crossesViewportEdge("bottom",h)&&(s="bottom"),"bottom"===s&&this._crossesViewportEdge("bottom",h)&&!this._crossesViewportEdge("top",l)&&(s="top"),"bottom"===s?o.extend(n,{top:r.bottom,transform:"translateX(-50%)"}):"top"===s&&o.extend(n,{top:r.top,right:"",transform:"translateX(-50%) translateY(-100%)"
  }),c=e.realLeft+(r.center+r.left)-a/2,u=e.realLeft+(r.center+r.left)+a/2,this._crossesViewportEdge("left",c)&&!this._crossesViewportEdge("right",u)&&o.extend(n,{left:this._popoverBase.minDistanceFromContainer+"px",transform:"top"===s?"translateX(0) translateY(-100%)":"translateX(0)"}),!this._crossesViewportEdge("left",c)&&this._crossesViewportEdge("right",u)&&o.extend(n,{left:"auto",right:this._popoverBase.minDistanceFromContainer+"px",transform:"top"===s?"translateX(0) translateY(-100%)":"translateX(0)"})):"left"===s||"right"===s?(o.extend(n,{top:t.top-i.y}),r={left:t.left+e.scrollLeft-i.x,right:t.left+e.scrollLeft+t.width+i.x},c=e.realLeft+r.left-this.$el.width(),u=e.realLeft+r.right+this.$el.width(),"left"===s&&this._crossesViewportEdge("left",c)&&!this._crossesViewportEdge("right",u)&&(s="right"),"right"===s&&this._crossesViewportEdge("right",u)&&!this._crossesViewportEdge("left",c)&&(s="left"),"left"===s?o.extend(n,{left:r.left,transform:"translateX(-100%) translateY(-50%)"}):"right"===s&&o.extend(n,{left:r.right,transform:"translateY(-50%)"})):o.extend(n,{top:t.top-i.y,left:t.left+i.x,transform:""}),o.extend(n,{transform:n.transform}),this.$el.css(n),this.debug("reposition: ad-hoc css %O",n),this.$el.removeClass("top bottom left right").addClass(s)},_crossesViewportEdge:function(t,e){var i=n(window),s={top:i.scrollTop(),left:i.scrollLeft(),right:i.scrollLeft()+i.width(),bottom:i.scrollTop()+i.height()};return s=this._popoverBase.isFixedPosition?{top:0,left:0,right:i.width(),bottom:i.height()}:{top:i.scrollTop(),left:i.scrollLeft(),right:i.scrollLeft()+i.width(),bottom:i.scrollTop()+i.height()},this.debug("viewportCheck against %s side (%s) coordinate=[%s]",t,s[t],e),"top"===t?s.top>e:"bottom"===t?s.bottom<e:"left"===t?s.left>e:"right"===t?s.right<e:void 0},isRendered:function(){return this.rendered||this._rendered},isOrWasRecentlyRendered:function(t){o.isNumber(t)||(t=100);var e=this._popoverBase.lastAutoTeardown,i=o.now()-e;return t>i||this.isRendered()},setPinnedSide:function(t){return this._popoverBase.pinnedSide=t,this},setPinnedTarget:function(t){return this.$pinned=n(t).addClass("pinned-target"),this.debug("setPinnedTarget: %O",this.$pinned),this},setPopoverContainer:function(t){return this.$container=n(t),this.isContainerBody=this.$container.is(h),this.debug("setPopoverContainer: %O, isContainerBody=%s",this.$container,this.isContainerBody),this},setShift:function(t){if(!o.isObject(t)||!o.isNumber(t.x)||!o.isNumber(t.y))throw new Error("Popover shift needs to be: {Object} => x: {Number}, y: {Number}");return this._popoverBase.shift.x=t.x,this._popoverBase.shift.y=t.y,this},getShift:function(){return this._popoverBase.shift},_initializeDebugger:function(){this.debug=l?s(this):o.noop},defaults:{pinnedRect:function(){var t,e,i=this.$container.offset();t=this.$pinned.offset(),e=t,this._popoverBase.isFixedPosition&&(this.isContainerBody?t.top-=c.scrollTop():t.top-=this.$container.scrollTop());var s={};return s.height=this.$pinned.outerHeight(),s.width=this.$pinned.outerWidth(),s.top=Math.round(t.top-i.top),s.left=Math.round(e.left-i.left),s.bottom=Math.round(s.top+s.height),s.right=Math.round(s.left+s.width),this.debug("pinnedRect calculation: container %O, pinned %O, containerOffset %O, pinnedOffset %O",this.$container,this.$pinned,i,e),this.debug("pinnedRect results: height(pinnedOuterHeight)=%s, width(pinnedOuterWidth)=%s, top(pTop-cTop)=%s, left=(pLeft-cLeft)=%s, bottom(top+height)=%s, right(left+width)=%s",s.height,s.width,s.top,s.left,s.bottom,s.right),s},teardown:o.noop},after:{initialize:function(t){var e={identifier:"popover",pinnedSide:"bottom",className:"popover--base",autoTeardown:!0,teardownOnEscape:!0,minDistanceFromContainer:10,shift:{x:0,y:0},clickOutside:null,lastAutoTeardown:0,shouldTeardown:!0,isFixedPosition:!1};this._popoverBase=o.defaults(o.pick(t||{},o.keys(e)),e),this._initializeDebugger(),this.setPinnedTarget(t.pinnedTarget||null),this.setPopoverContainer(t.popoverContainer||h),this._popoverBase.autoTeardown&&this.listenTo(this,"rendered",this.setupAutoTeardown)},render:function(){this.$el.addClass(this._popoverBase.className),this.$el.appendTo(this.$container);var t=this.$el.children().first(),e=t.width();t.width(e-e%2),this.reposition(),this.isContainerBody&&(this.debug("DOMEventor subscribe: flatresize + flatscroll reposition active"),this.listenTo(a,"DOMEventor:flatresize",this.reposition),this._popoverBase.isFixedPosition||this.listenTo(a,"DOMEventor:flatscroll",this.reposition)),this._popoverBase.teardownOnEscape&&this.listenTo(a,"DOMEventor:keyup:escape",this.teardown),this.trigger("open",this),a.trigger(this._popoverBase.identifier+":open",this)},teardown:function(){this.$pinned.removeClass("pinned-target"),this._popoverBase.teardownOnEscape&&this.stopListening(a,"DOMEventor:keyup:escape"),this.removeAutoTeardown(),this.trigger("close",this),a.trigger(this._popoverBase.identifier+":close",this)}},before:{teardown:function(){this.$el.off("mousewheel DOMMouseScroll")}}});t.exports=d},function(t,e,i){"use strict";function s(t,e){this.options=n.extend({preventInteraction:!1,ignoreSelectors:[]},e),this._onClick=n.bind(this._onClick,this,t),document.addEventListener("click",this._onClick,!0)}var n=i(3),o=i(8),r=i(7);s.prototype._isForcedInsideTarget=function(t){return n.isEmpty(this.options.ignoreSelectors)?!1:!n.isEmpty(t.closest(this.options.ignoreSelectors.join(",")))},s.prototype._onClick=function(t,e){var i=o(e.target);t===e.target||o.contains(t,e.target)||this._isForcedInsideTarget(i)?this.trigger("click:inside",e):(this.trigger("click:outside"),this.options.preventInteraction&&(e.preventDefault(),e.stopPropagation()))},s.prototype.remove=function(){return document.removeEventListener("click",this._onClick,!0),this.off(),this},n.extend(s.prototype,r.Events),t.exports=s},,,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(148),r=i(109),a=i(222),l=i(205),h=i(206),c=i(159),u=i(240),d=o.extend({defaults:{placeholder:"",name:"",syncWithModel:!0,forceSingleLine:!1,smartQuotesEnabled:!1},events:{},mixins:[c,l,h],template:u,initialize:function(t){this.set(t),this.onChange=t.onChange||s.noop,this.onClientEvent=t.onClientEvent||s.noop,this.pasteHook=t.pasteHook||s.noop,this.smartQuotesEnabled=t.smartQuotesEnabled,this.disableEdit=t.disableEdit||!1;var e=this.get("name");e&&this.get("syncWithModel")&&this.$el.attr("data-name",e)},_initializeEditor:function(t,e){var i={placeholder:e,onChange:this._composeOnChange(),onClientEvent:this._composeOnClientEvent(),pasteHook:this.pasteHook,runIFrameSanitization:!0,forceSingleLine:this.get("forceSingleLine"),filterRules:{elements:["p","br"],attributes:{},remove_contents:["style","noscript","script","meta"],protocols:{}},smartQuotes:{enabled:this.smartQuotesEnabled}};this.editor=new a.PlainTextEditor(t,i),this.disableEdit&&this.disable()},_composeOnChange:function(){var t=[this.onChange],e=this;return this.get("syncWithModel")&&t.unshift(this.updateModelFromEditor),function(i){s.each(t,function(t){t.call(e,i)})}},_composeOnClientEvent:function(){var t=this.onClientEvent,e=this;return function(i){r.trigger("plainTextEditor:onClientEvent",i,e.editor),t.call(this,i)}},render:function(){this.$el.html(this.template({ariaLabel:this.get("ariaLabel")}));var t=this.js$("plainTextEditor").get(0);if(this._initializeEditor(t,this.get("placeholder")),this.get("syncWithModel")){var e=this._modelValue().length>0;e&&this.set("placeholder",!1),this.updateEditorFromModel()}return this},teardown:function(){return this.$el.empty(),delete this.editor,this},serialize:function(){return this.toJSON()},getEditorValue:function(t){return"undefined"!=typeof t||(t=!0),this.editor?this.editor.getData(t):null},setEditorValue:function(t){this.editor&&this.editor.setData(t)},updateModelFromEditor:function(){if(!this.editor)return!1;var t=this.get("name"),e=this.getEditorValue();""!==e?n(this.editor.element).addClass("has-text"):n(this.editor.element).removeClass("has-text"),this.model.get(t)!==e&&this.model.set(t,e)},updateEditorFromModel:function(){var t=this.getEditorValue(),e=this._modelValue();e.trim()&&e.trim()!==t.trim()&&this.setEditorValue(e)},_modelValue:function(){return this.model.get(this.get("name"))||""},focus:function(t){this.editor&&this.editor.focus(t)},blur:function(){this.editor&&this.editor.element.blur()},setCursorToEnd:function(){this.editor&&s.isFunction(this.editor.setCursorToEnd)&&this.editor.setCursorToEnd()},enable:function(){n(this.editor.element).attr("contenteditable",!0)},disable:function(){n(this.editor.element).removeAttr("contenteditable")}});t.exports=d},function(t,e,i){var s=i(3),n=i(223);t.exports=s.extend(n,{RichTextEditor:i(224),PlainTextEditor:i(239),SelectionContext:i(233),SelectionPersistence:i(227),Utils:i(226),HumanKeys:i(238)})},function(t,e){var i={debugMode:!1};t.exports=i},function(t,e,i){var s=i(3),n=i(8),o=i(164).animate,r=i(225),a=i(230),l=i(231),h=i(227),c=i(233),u=i(234),d=i(226),p=i(235),g=i(236),_=i(237),m=i(238),f=(window.URL||window.webkitURL||window.mozURL||window.msURL||{}).createObjectURL,v=i(229),b=function(){function t(t,e){return s.mapValues(t,function(t,e){return e.match(/^on[A-Z]/)&&s.isFunction(t)?s.bind(t,this):t},e)}function e(){B.call(this,ct);var t=n("<div />",{"data-js":"editor-wrapper","class":"editor-wrapper"}).css("position","relative"),e=n("<div />",{"data-js":"editor-slot","class":"editor-slot"}).css("position","relative");n(this.element).wrap(t).wrap(e),e=n(this.element).parent(),this.wrapper=e.parent().get(0),this.placeholderElement=n("<div />",{"data-js":"editor-placeholder","class":"editor-placeholder"}).css("position","absolute"),this.placeholderElement.on("click",s.bind(function(t){this.focus()},this)),e.append(this.contextualControls.element),e.append(this.linkControl.element),e.append(this.placeholderElement),e.append(this.inlineControls.element),j.call(this),this.controlBar=n("<div />",{"data-js":"control-bar","class":"control-bar disabled"});var o=n("<div />",{"class":"static-controls control"});this.controlBar.append(o),this.controlBar.append(this.staticControls.element);var r=this;o.on("mousedown",function(t){t.preventDefault(),t.stopPropagation();var e=c.getNodeList();r.staticControls.setActives(s.pluck(e,"nodeName"));var i=n(this).position();return r.staticControls.isShown?r.staticControls.hide():r.staticControls.open(i.left+n(this).width()/2,0),r.contextualControls.hide(),r.linkControl.close(),!1}),this.config.showStaticControls&&n(this.wrapper).append(this.controlBar),i.call(this),S.call(this)}function i(){var t=this,e=function(){var e=t.inlineControls.isTrayOpen||t.contextualControls.isShown||t.staticControls.isShown||t.linkControl.isShown;return e};n(this.element).on("input keydown keyup keypress mousedown mouseup",function(e){t.controlBar.removeClass("disabled"),t.config.onClientEvent.call(t,e)});var i=function(){A.call(this),this.onChange()};n(this.element).on("keydown",function(i){if(i.keyCode===vt.shift)t.keyModifiers.shift=!0;else{if(i.keyCode===vt.esc)return void(e()&&(t.contextualControls.hide(),t.staticControls.hide(),t.inlineControls.isTrayOpen&&t.inlineControls.toggleTrayWithIntent(!1),i.stopPropagation()));i.keyCode===vt.backspace?(x.call(t,i),q.call(t)):i.keyCode===vt.enter&&(w.call(t,i),y.call(t,i),d.browser.safari&&i.shiftKey&&(i.preventDefault(),b.call(t)))}F.call(t,i),A.call(t,i)}),n(this.element).on("keyup",function(e){e.keyCode===vt.shift?t.keyModifiers.shift=!1:e.keyCode===vt.enter?q.call(t):e.keyCode!==vt.backspace&&e.keyCode!==vt["delete"]||($.call(t),s.defer(function(){C.call(t)}));var n=!1;e.keyCode===vt.right&&!e.shiftKey&&t.inlineControls&&(n=t.inlineControls.isShown),e.keyCode===vt.esc||n||i.call(t)}),n(this.element).on("input",function(){i.call(t)});var o=!1;n(this.element).on("mouseup",function(){o=!1,A.call(t)}),n(this.element).on("mousedown",function(t){o=!0}),document.addEventListener("mousedown",function(e){var i=function(){o=!1,k.call(t),t.controlBar.addClass("disabled")};t.wrapper===e.target||n.contains(t.wrapper,e.target)||t.config.documentMousedownHook(e,i)||i()},!0),document.addEventListener("mouseup",function(e){o&&(A.call(t),o=!1)},!0),n(this.element).on("focus",function(){if(t.controlBar.removeClass("disabled"),!H.call(t)){var e=n(t.element).children(dt.join());if(e.length){var i=e.first().get(0);h.setToStart(i)}}s.defer(function(){t.onChange()})}),n(this.element).on("blur",function(i){var n=function(i){if(!e()){var n=c.getSelection();n&&c.isInContext(n,t.element)&&n.removeAllRanges(),A.call(t,function(){t.onChange(),s.isFunction(i)&&i()})}};t.config.blurHook(i,n)||s.defer(n)}),n(this.element).on("paste",function(e){var i=(e.originalEvent||e).clipboardData;i&&(t.config.pasteHook(i,t.keyModifiers.shift)||L.call(t,i),O.call(t),e.preventDefault())}),n(this.element).on("cut",function(e){t.contextualControls.hide(),t.staticControls.hide(),t.linkControl.close(),s.defer(function(){C.call(t),O.call(t),t.onChange()})})}function b(){for(var t=H.call(this),e=s.contains(gt,t.nodeName)?"\n":"<br>",i=c.isCursorAtEnd(t)&&!c.isCursorAtStart(t)?1:0,n=0;i>n;n++)e+=e;U.call(this,e)}function y(t){var e,i,o=c.getNodeByNames(gt);o&&!this.keyModifiers.shift&&c.isCursorAtEnd(o)&&(i=n(o),e=i.text(),t.preventDefault(),e.match(/\n\n$/)?(s.last(i.contents()).remove(),this.insertNewParagraphAfter(o)):(i.append("\n\n"),h.setToEnd(o)))}function w(t){var e=c.getNodeByNames(["BLOCKQUOTE"]);if(e&&!this.keyModifiers.shift&&c.isCursorAtEnd(e,!0)){var i="P"===e.lastElementChild.nodeName?e.lastChild:null;i&&i.previousSibling&&this.dataFilter.isEmptyElement(i,!0)&&(t.preventDefault(),n(i).remove(),this.insertNewParagraphAfter(e))}}function k(){this.contextualControls.hide(),this.staticControls.hide(),this.linkControl.close(),this.inlineControls.close()}function C(){if(!n(this.element).has(ft.join()).length){var t=n(this.element).find("ul:not(:has(li)),ol:not(:has(li))");t.remove();var e=s.some(n(this.element).children().toArray(),function(t){return t.textContent.length>0});e||(B.call(this,""),q.call(this),j.call(this))}}function x(t){var e=c.getSelection();if(e.isCollapsed){var i=H.call(this);if(i&&!(h.saveSelection(i).start>0)){var s=n(i).prev().get(0);s&&at.call(this,s)&&(n(s).remove(),t.preventDefault())}}}function S(){var t=this,e=n(t.element).offset().top,i=null,o="dragstart dragenter dragleave dragover dragend drop",r=!1,a=function(t){var e=t.dataTransfer.types&&s.some(t.dataTransfer.types,function(t){return"Files"===t});return e},l=function(t){return"false"===n(t.target||t.srcElement).attr("contenteditable")},h=function(e,i,n){e.length&&(t.onChange(),s.each(e,function(e){t.config.onFileAdded.call(t,e,i,n)}),A.call(t))},c=function(t,e){return t<e.top+.66*e.height},u=function(t,i){var s=n(i).offset().top-e,o=n(i).get(0).getBoundingClientRect().height,r=t>s+.66*o;return{element:i,top:s,bottom:s+o,height:o,isAfter:r}},d=function(){n(t.element).find(".over-top, .over-bottom").each(function(){n(this).removeClass("over-top").removeClass("over-bottom"),""===n(this).attr("class").trim()&&n(this).removeAttr("class")})},p=function(s){var o=null,r=s.pageY-e,a=n(t.element).children();i&&r>i.top&&c(r,i)||(a.each(function(){var t=u(r,this);return c(r,t)&&(s.target||s.srcElement)!==this?(o=t,!1):void 0}),o||(o=u(r,a.last().get(0)),o.isAfter=!0),o&&i&&i.element===o.element&&i.isAfter===o.isAfter||(d(),i=o))};n(t.element).unbind(o),n(t.element).on("dragleave",function(t){d()}),n(t.element).on("dragover",function(t){return r?(s.debounce(p,100)(t.originalEvent),i&&(n(i.element).addClass(i.isAfter?"over-bottom":"over-top"),a(t.originalEvent)&&t.stopPropagation()),void t.preventDefault()):(t.preventDefault(),void t.stopPropagation())}),n(t.element).on("dragenter",function(t){t.preventDefault(),a(t.originalEvent)&&(r="file")}),n(t.element).on("dragstart",function(e){if(k.call(t),l(e.originalEvent)){r="media";var i=e.originalEvent.target||e.originalEvent.srcElement,o=e.originalEvent.dataTransfer;if(o){o.effectAllowed="move",o.dropEffect="move";try{var a=n(i).find("img").attr("src")||"";a.match(/^\s*data:/)&&(a=""),o.setData("text/uri-list",a),o.setData("text/plain",a)}catch(e){}}s.defer(function(){n(i).addClass("dragging")})}}),n(t.element).on("drop",function(t){d(),a(t.originalEvent)&&h(t.originalEvent.dataTransfer.files,i.element,i.isAfter?1:-1),t.stopPropagation(),t.preventDefault()}),n(t.element).on("dragend",function(e){if(l(e.originalEvent)){d();var s=e.originalEvent.target||e.originalEvent.srcElement,o=n(s).data("origHeight"),a=s;if(i&&a!==i.element){var h=n(s).remove();i.isAfter?n(i.element).after(h):n(i.element).before(h),st.call(t,h)}n(a).animate({height:o},200,function(){n(a).removeClass("dragging")}),t.onChange(),A.call(t)}r=!1})}function T(t,e,i){var s=n(this.element),o=h.saveSelection(this.element);s.find(i).wrap("<"+e+">"),s.find(i).contents().unwrap(),h.restoreSelection(o),window.document.execCommand(t),s.find(e).wrap("<"+i+">"),s.find(e).contents().unwrap(),h.restoreSelection(o)}function E(t,e,i){var o=this,r=function(){window.document.execCommand(t),o.config.flattenBlocks&&N.call(o)},a=function(){var t=h.saveSelection(o.element),e=200,s=240;!i||i.isAnimating||t.selection.isCollapsed||setTimeout(function(){n(o.linkControl.linkEditInput).focus();var r=function(i,s){var r=i-n(o.wrapper).offset().left,a=s-n(o.wrapper).offset().top;o.linkControl.size(e),o.linkControl.show(r,a),o.linkControl.createLink(t)};i.closeWithShim(i.element.find(".link").get(0),e,s,r),t.selection.removeAllRanges(),o.blur(!0)},30)},l=function(t){var e=h.saveSelection(o.element),i=c.getRootElements();switch(s.each(pt,function(t){var e=c.getNodesByNames(i,[t]);e.length&&P.call(o,"formatBlock",t)}),M.call(o),t.toLowerCase()){case"blockquote":i=c.getRootElements();var r=[],a=[];i=s.each(i,function(t){s.contains(mt,t.nodeName.toUpperCase())?a.push(t):(r.push(a),a=[])}),a.length&&r.push(a),s.each(r,function(e){n(e).wrapAll(document.createElement(t))});break;case"pre":window.document.execCommand("formatBlock",!1,"<"+t+">"),I.call(this);break;default:window.document.execCommand("formatBlock",!1,"<"+t+">")}h.restoreSelection(e)},u=function(){var t=o.contextualControls.controls,e=o.contextualControls.getActiveStates();s.each(e,function(e,i){var s=t[i];e&&P.call(o,s.command,s.el)}),window.document.execCommand("removeFormat")};switch(t){case"formatBlock":l(e);break;case"createLink":a();break;case"insertOrderedList":r();break;case"insertUnorderedList":r();break;case"removeFormat":u();break;case"insertHTML":T.call(this,"underline","U",e);break;default:window.document.execCommand(t)}A.call(this),$.call(this),o.onChange()}function P(t,e){var i=this;switch(t){case"formatBlock":var o=h.saveSelection(this.element);M.call(i),s.each(c.getRootElements(),function(t){i.dataFilter.unBlock(t),"pre"===t.nodeName.toLowerCase()&&(t.innerHTML=t.innerHTML.replace("\n","<br>"));var e=t.nodeName.toUpperCase();if(s.contains(pt,e)){var o=n(t).contents();n(o).wrapAll("<p>"),n(t.firstChild).unwrap()}}),h.restoreSelection(o);break;case"insertOrderedList":M.call(this);break;case"insertUnorderedList":M.call(this);break;case"createLink":window.document.execCommand("unlink");break;case"insertHTML":T.call(this,"underline","U",e);break;default:window.document.execCommand(t)}$.call(this),A.call(this),this.onChange()}function F(t){var e=function(){var t=c.getNodeByNames(["UL","OL"]);return!!t};t.keyCode===vt.tab&&e()&&(t.preventDefault(),t.stopPropagation(),t.shiftKey?(E.call(this,"outdent"),e()||E.call(this,"formatBlock","p")):E.call(this,"indent"))}function I(){var t=c.getNodeByNames(gt);t&&n(t).find("br").replaceWith("\n")}function M(){var t=c.getNodeByNames(_t);if(t){do window.document.execCommand("outdent");while(c.getNodeByNames(_t));c.getNodeByNames(["H2"])||window.document.execCommand("formatBlock",!1,"<p>"),this.dataFilter.blockifyInlineNodes(this.element)}}function N(){var t=h.saveSelection(this.element),e=c.getNodeList(null,!0);this.dataFilter.unwrapParentBlocks(e),h.restoreSelection(t)}function $(){var t=h.saveSelection(this.element),e=c.getNodeList(),i=this.dataFilter.scrubSpansAndBadAttrs(e);i&&t.end>t.start&&h.restoreSelection(t)}function A(t){var e=this;setTimeout(function(){var i=c.getSelection();return i?(i.isCollapsed?R.call(e,i):D.call(e,i),tt.call(e),W.call(e),e.config.onSelection.call(e,i),c.isInContext(i,e.element)&&(e.lastSelection=h.saveSelection(e.element)),O.call(e),j.call(e),void(s.isFunction(t)&&t())):(tt.call(e),void(s.isFunction(t)&&t()))},20)}function D(t){if(c.isInContext(t,this.element)){var e=c.getContextCoordinates(n(this.element).parent().parent()),i=c.getNodeList(t);this.contextualControls.setActives(s.pluck(i,"nodeName")),this.staticControls.setActives(s.pluck(i,"nodeName")),this.linkControl.close(),this.inlineControls.close(),""!==t.toString().trim()&&e&&!this.staticControls.isShown&&this.contextualControls.open(e.x,e.y)}}function R(t){this.contextualControls.hide();var e=c.getNodeList(t),i=s.find(e,function(t){return"A"===t.nodeName});if(this.linkControl.isValidLink(i)){var o=c.getContextCoordinates(n(this.element).parent().parent(),i);this.linkControl.showOptions(i),this.linkControl.showOverTarget(o.x,o.y)}else this.linkControl.close();this.staticControls.setActives(s.pluck(e,"nodeName"))}function O(){var t=c.getSelection(),e=t&&t.isCollapsed;if(!e||!c.isInContext(t,this.element))return void this.inlineControls.close();var i=H.call(this);if(i&&"P"===i.nodeName&&this.dataFilter.isEmptyElement(i)&&!this.isEmpty())this.inlineControls.open(i);else if(this.isEmpty()){this.inlineControls.open(i);var s=d.calcTextWidth(this.placeholderElement,this.config.placeholder);this.inlineControls.open(i,s)}else this.inlineControls.close()}function j(){var t=this.isEmpty()?this.config.placeholder:"",e=n(this.placeholderElement);e.html(t);var i=e.outerHeight();i&&n(this.element).css("min-height",Math.max(parseInt(e.css("min-height"),10)||0,i))}function L(t){var e="";if(t.items&&t.items.length){var i=s.find(t.items,function(t){return/image\/\w+/.test(t.type)});if(i){var o=i.getAsFile();if(o)return void this.config.onFileAdded.call(this,o)}}s.contains(t.types,"text/html")?e=t.getData("text/html"):(e=t.getData("text/plain"),e=this.dataFilter.filterPlaintext(e,!0)),e=e.replace(new RegExp("</t(d|h)></tr>","g"),"<br></td></tr>"),e=e.replace(/\u00a0/g," "),e=this.dataFilter.filterHTML(e),e=this.dataFilter.convertToBrowserSpaces(e);var r=document.createElement("div");r.innerHTML=e,this.dataFilter.flattenBlocksDown(r,!0),n(r).find(ft.join()).remove();var a=s.some(r.children,function(t){return s.contains(dt,t.nodeName)});if(a){var l=c.getSelection(),h=l.getRangeAt(0);h.deleteContents();var u=H.call(this);if(""===n(u).text().trim()){var d=n(u).index(),p=n(u).parent(),g=d+r.children.length-1;n(u).replaceWith(r.children);var _=n(p).children().eq(g).get(0);h.selectNodeContents(_),h.collapse(!1),l.removeAllRanges(),l.addRange(h)}else this.dataFilter.inlinify(r),U.call(this,r.innerHTML)}else U.call(this,r.innerHTML);this.onChange()}function B(t){n(this.element).html(t)}function V(){return n(this.element).html().trim()}function U(t){if(!t)return void v.warn("Cannot insert empty data");var e=c.getSelection();if(!e||!e.focusNode)return void v.warn("Cannot insert without the editor having a cursor or selection");var i=e.getRangeAt(0);i.deleteContents(),t=this.dataFilter.convertToBrowserSpaces(t);var s=document.createElement("div");s.innerHTML=t;for(var n,o=s.lastChild,r=document.createDocumentFragment();n=s.firstChild;)r.appendChild(n);i.insertNode(r),i.setStartAfter(o),i.collapse(!1),e.removeAllRanges(),e.addRange(i)}function z(){var t=H.call(this);if(!t){var e=n(this.element).children(dt.join());if(!e.length)return null;t=e.last().get(0)}return t}function H(){var t=c.getSelection()||this.lastSelection;return c.getNodeByNames(dt,!0,t)}function q(){var t=z.call(this);if(t){if("div"===t.nodeName.toLowerCase())try{window.document.execCommand("formatBlock",!1,"<p>")}catch(e){}}else B.call(this,ct),this.setCursorToStart()}function W(){var t=n(this.element).children(mt.join()).last().get(0);t||n(this.element).append(ct)}function K(t,e,i,o,r){var a=this,l=function(t){var l,h,c,u,d=s.uniqueId(),p=0===t.lastIndexOf("data:",0)?"file":t;a.mediaTracker[d]={originalSource:p,file:e},h=n("<img />",{src:t}),l=h.get(0),u=n("<figure />"),c=u.get(0),h.attr(a.config.imgKeyAttr,d),u.append(h),X.call(a,c,i,o,r),Q.call(a,l,function(i){G.call(a,l,i),a.config.onAsyncImageAdded.call(a,d,t,e,i||{})}),a.onChange()};if(!t&&e)if(f)l(f(e));else{var h=new FileReader;h.onload=function(t){l(t.target.result)},h.readAsDataURL(e)}else{if("string"!=typeof t)return void a.config.onAsyncImageFailed.call(a);l(t)}}function G(t,e){var i,o={},r=this.config,a=n(t).parent("figure").get(0),l={toImg:t,toImgParent:a};r.addImgAttrs&&(i=s.reduce(l,function(t,e,i){return r.addImgAttrs!==!0&&r.addImgAttrs[i]!==!0||t.push(e),t},[])),s.isEmpty(i)||!r.imgSizeAttrs||s.isEmpty(e)||(r.imgSizeAttrs.height&&(o[r.imgSizeAttrs.height]=e.height),r.imgSizeAttrs.height&&(o[r.imgSizeAttrs.width]=e.width),n(i).attr(o))}function Q(t,e){var i=function(t){var i={width:t.naturalWidth,height:t.naturalHeight};s.isFunction(e)&&e.call(this,i)};t.complete?i.call(this,t):n(t).one({"load.getImageAttributes":s.bind(s.partial(i,t),this),error:s.bind(function(){n(t).off(".getImageAttributes"),e.call(this,null)},this)})}function J(t){return n(this.element).find("img["+this.config.imgKeyAttr+'="'+t+'"]').get(0)}function Y(t,e,i){var o=J.call(this,t);s.isEmpty(i)||o&&G.call(this,o,i),e&&(n(o).attr("src",e),this.mediaTracker[t].updatedSource=e)}function X(t,e,i,s){var o;e=e||z.call(this),o=this.dataFilter.isEmptyElement(e.outerHTML,!0)?0:c.isCursorAtStart(e)?-1:1,i="number"==typeof i?i:o;var r=n(t).get(0),a=it.call(this,r);st.call(this,a),0>i?n(e).before(a):i>0?n(e).after(a):0===i&&n(e).replaceWith(a),k.call(this);var l=n(a).nextAll(mt.join()).get(0);l||(l=n(ct).get(0),n(a).after(l)),s||(this.focus(!0),h.setToStart(l)),Z.call(this,a,!1,A)}function Z(t,e,i){var r=this;e=e||!1,i=i||s.noop;var a=n(t),l=a.find("figure"),h=a.find(".media-button"),c=200;return a.length&&l.length?(e&&h.length&&h.hide(),o(l,{opacity:e?0:[1,0],translateY:e?-25:[0,-25]},{duration:.9*c,easing:"easeOutQuad",complete:function(){l.removeAttr("style")}}),void o(t,e?"slideUp":"slideDown",{duration:c,easing:"easeOutQuart",begin:function(){a.css("pointer-events","none")},complete:function(){a.css("pointer-events",""),i.call(r,t)}})):void i.call(r)}function tt(){var t=this,e=H.call(this);n(e).removeClass(t.config.fakeClass),n(t.element).children("p").each(function(i,s){e!==s&&t.dataFilter.isEmptyElement(s)&&(0===i&&at.call(t,n(s).next().get(0))||n(s).is(":last-child")&&at.call(t,n(s).prev().get(0))?et.call(t,s):at.call(t,n(s).prev().get(0))&&at.call(t,n(s).next().get(0))?et.call(t,s):n(s).hasClass(t.config.fakeClass)&&n(s).remove()),void 0!==n(s).attr("class")&&""===n(s).attr("class").trim()&&n(s).removeAttr("class")}),n(this.element).children("."+this.config.mediaHolderClass).each(function(e,i){var s=n(this).next().get(0);s&&!at.call(t,s)||n(this).after(et.call(t));var o=n(this).prev().get(0);o||n(this).before(et.call(t))})}function et(t){return t=t||n(ct).get(0),n(t).addClass(this.config.fakeClass),t}function it(t){var e=n(t),i=n("<div />",{"class":this.config.mediaHolderClass,contentEditable:!1,draggable:!0});e.wrap(i),i=e.parent(),s.isFunction(this.config.mediaHolderCallback)&&this.config.mediaHolderCallback(this,t,e,i);var o=n(this.config.mediaKillerMarkup);o.addClass("media-killer"),i.append(o);var r=!i.hasClass("media-holder-draggable");if(r){var a=n(this.config.mediaMoverMarkup);a.addClass("media-mover"),i.append(a)}return i}function st(t){var e=this,i=t?n(t):n(this.element).find('[contenteditable="false"]'),s=this.config.mediaHolderEvents;i.each(function(t,i){var o=n(i),r=null;o.off("keydown").on("keydown",function(t){s.keydown.call(null,t,o),t.isPropagationStopped()||(t.keyCode!==vt["delete"]&&t.keyCode!==vt.backspace||o.remove(),t.preventDefault(),t.stopPropagation())}),o.off("keyup").on("keyup",function(t){s.keyup.call(null,t,o)}),o.on("mousedown",function(t){r=t.originalEvent.target,s.mousedown.call(null,t,o,r)}),o.on("mouseup",function(t){s.mouseup.call(null,t,o,r);var i=n(r);i.hasClass("media-killer")&&r===t.target&&Z.call(e,o,!0,function(){o.remove(),C.call(e),A.call(e),e.onChange()})}),o.on("mouseenter",function(t){n(t.currentTarget).addClass("show-controls"),s.mouseenter.call(null,t,o,r)}),o.on("mouseleave",function(t){n(t.currentTarget).removeClass("show-controls"),s.mouseleave.call(null,t,o,r)}),o.on("dragstart",function(t){var e=n(r);e.hasClass("media-killer")&&(t.preventDefault(),t.stopPropagation()),o.hasClass("media-holder-draggable")||e.hasClass("media-mover")||(t.preventDefault(),t.stopPropagation()),s.dragstart.call(null,t,o,r)})})}function nt(t){s.each(n(t).find("."+this.config.mediaHolderClass),function(t){n(t).find(".media-killer, .media-mover").remove();var e=n(t).children().first();e.length?n(e).unwrap():(n(t).contents().wrap("<div>"),n(t).children().first().unwrap().contents().unwrap())})}function ot(t){var e=this,i=n(t).find("."+this.config.fakeClass+", ."+this.config.fakeClass+"-intent");s.each(i,function(t){e.dataFilter.isEmptyElement(t)&&n(t).remove()})}function rt(){var t=this;s.each(n(this.element).find(ft.join()),function(e){var i=c.getParentNodes(e),n=s.some(i,function(t){return s.contains(ft,t.nodeName)});lt.call(t,e)||n||it.call(t,e)})}function at(t){return n(t).hasClass(this.config.mediaHolderClass)}function lt(t){var e=n(t).closest("[class="+this.config.mediaHolderClass+"]");return e.length?e.get(0):null}function ht(t,e,i){var o,r;return e=s.isBoolean(e)?e:!1,t=t||z.call(this),o=n(t)[e?"prev":"next"](),!i&&o.length>0&&this.dataFilter.isEmptyElement(o)?(h.setToStart(o.get(0)),o):(r=n(ct).get(0),n(t)[e?"before":"after"](r),h.setToStart(r),r)}var ct="<p><br></p>",ut="<p></p>",dt=["P","FIGURE","H2","BLOCKQUOTE","UL","OL","DIV","PRE"],pt=["H2","BLOCKQUOTE","PRE"],gt=["PRE"],_t=["UL","OL"],mt=["P","H2","BLOCKQUOTE","UL","OL","PRE"],ft=["IMG","IFRAME","FIGURE","HR"],vt={shift:16,enter:13,esc:27,backspace:8,"delete":46,tab:9,right:39},bt=function(i,o){if(!i)throw new Error("A valid element parameter is required to initalize the editor");o=o||{},this.element=i,this.humanKeys=new m,this.keyComboEvents=o.keyComboEvents||new _({element:this.element,humanKeys:this.humanKeys});var d=s.template("<%= title %> (<%= shortcut %>)"),f=s.bind(function(t,e){return d({title:t,shortcut:this.humanKeys.pretty(e)})},this);this.config={labels:{},placeholder:!1,onChange:s.noop,onSelection:function(t){},onAsyncImageAdded:function(t,e,i,s){},onAsyncImageFailed:function(){v.warn("Unknown source type for inserting an image.")},onFileAdded:function(t,e,i){},onClientEvent:function(t){},flattenBlocks:!0,smartQuotes:{enabled:!1,config:{}},runIFrameSanitization:!1,mediaHolderClass:"media-holder",mediaHolderCallback:function(t,e,i,n){i.is("hr, img, figure")&&s.isEmpty(i.find("iframe"))&&n.addClass("media-holder-draggable"),n.addClass("media-holder-"+i.prop("tagName").toLowerCase())},mediaHolderEvents:{keydown:s.noop,keyup:s.noop,mousedown:s.noop,mouseup:s.noop,mouseenter:s.noop,mouseleave:s.noop,click:s.noop,dragstart:s.noop},imgKeyAttr:"data-img-key",imgSizeAttrs:{width:"data-orig-width",height:"data-orig-height"},addImgAttrs:{toImg:!1,toImgParent:!1},fakeClass:"fake",mediaKillerMarkup:"<div>×</div>",mediaMoverMarkup:"<div>&#8597;</div>",pasteHook:function(t,e){return!1},blurHook:function(t){return!1},documentMousedownHook:function(t){return!1},filterForSetData:function(t){return t},filterForGetData:function(t){return t},filterRules:{elements:["a","b","i","ul","ol","li","p","h2","blockquote","img","iframe","figure","br","hr","pre","sub","sup","small"],attributes:{a:["href","title"],img:["src","alt","data-orig-width","data-orig-height"],hr:["data-label"],iframe:["src","width","height","frameborder"],figure:["data-orig-width","data-orig-height"]},classnames:{hr:["read-more"]},remove_contents:["style","noscript","script","meta"],protocols:{
  a:{href:["http","https","mailto"]}}},animateShowControls:function(t){t.element.show()},animateHideControls:function(t){t.element.hide()},linkConfig:{bypassClasses:[],labels:o.labels,onChange:function(){this.onChange.call(this)},onDismiss:function(){this.lastSelection&&(h.restoreSelection(this.lastSelection),A.call(this))}},inlineControlsConfig:{openTray:u.prototype.openTray,closeTray:u.prototype.closeTray,onTrayOpened:function(t){},onTrayClosed:function(t){},keyboardEvents:this.keyComboEvents},formattingControlsConfig:{controls:{bold:{el:"b",className:"bold",command:"bold",type:"inline",title:f("Bold","meta+b"),keyboard:"meta+b"},italic:{el:"i",className:"italic",command:"italic",type:"inline",title:f("Italic","meta+i"),keyboard:"meta+i"},headline:{el:"h2",className:"headline",command:"formatBlock",type:"block",title:f("Headline","meta+shift+2"),keyboard:"meta+shift+2"},link:{el:"a",className:"link",command:"createLink",type:"inline",title:f("Link","meta+k"),keyboard:"meta+k"},strikethrough:{el:"strike",className:"strikethrough",command:"strikethrough",type:"inline",title:f("Strikethrough","meta+shift+6"),keyboard:"meta+shift+6"},orderedList:{el:"ol",className:"ordered-list",command:"insertOrderedList",type:"list",title:f("Ordered List","meta+shift+7"),keyboard:"meta+shift+7"},unorderedList:{el:"ul",className:"unordered-list",command:"insertUnorderedList",type:"list",title:f("Unordered List","meta+shift+8"),keyboard:"meta+shift+8"},blockquote:{el:"blockquote",className:"quote",command:"formatBlock",type:"block",title:f("Blockquote","meta+shift+9"),keyboard:"meta+shift+9"},clear:{el:"",command:"removeFormat",type:"inline",keyboard:"meta+shift+0"},pre:{el:"pre",command:"formatBlock",type:"block",keyboard:"meta+alt+1"},superscript:{el:"sup",command:"superscript",type:"inline",keyboard:"meta+dot"},subscript:{el:"sub",command:"subscript",type:"inline",keyboard:"meta+comma"},small:{el:"small",command:"insertHTML",type:"inline",keyboard:"meta+shift+minus",keyboardInverse:"meta+shift+plus"}},controlsOrder:["bold","italic","headline","link","strikethrough","orderedList","unorderedList","blockquote"],onShow:function(t){s.isFunction(this.animateShowControls)?this.animateShowControls.call(this,t):t.element.show()},onHide:function(t){s.isFunction(this.animateHideControls)?this.animateHideControls.call(this,t):t.element.hide()},onAction:function(t){var e=c.getNodeList();t.setActives(e)}},showStaticControls:!0},s.merge(this.config,o||{}),this.applyCommand=s.bind(E,this),this.inverseCommand=s.bind(P,this),this.animateShowControls=s.bind(this.config.animateShowControls,this),this.animateHideControls=s.bind(this.config.animateHideControls,this),this.onChange=function(t){var e=V.call(this);this.previousRawData!==e&&(j.call(this),this.config.onChange.call(this),this.previousRawData=e)};var b=t(this.config.linkConfig,this);this.linkControl=new r(b);var y=t(this.config.inlineControlsConfig,this);this.inlineControls=new u(y);var w=t(s.defaults({keyboardEvents:this.keyComboEvents},this.config.formattingControlsConfig),this);this.contextualControls=new a(this.applyCommand,this.inverseCommand,w);var k=this.config.formattingControlsConfig.onShow,C=this.config.formattingControlsConfig.onHide,x=t(s.defaults({onShow:function(t){k.apply(this,arguments),t.listener=t.listener||function(e){var i=c.getNodeList();t.setActives(i),document.removeEventListener("mousedown",t.listener,!1)},document.addEventListener("mousedown",t.listener)},onHide:function(t){C.apply(this,arguments),document.removeEventListener("mousedown",t.listener,!1)}},this.config.formattingControlsConfig),this);this.staticControls=new a(this.applyCommand,this.inverseCommand,x),this.dataFilter=new l(this.config.filterRules),this.keyModifiers={shift:!1},this.undoManager=new p(this,s.bind(function(){for(var t in this.mediaTracker){var e=this.mediaTracker[t].updatedSource;if(e){var i=J.call(this,t);n(i).attr("src",e)}}O.call(this)},this)),this.config.smartQuotes.enabled&&(this.smartQuoter=new g(this,this.config.smartQuotes.config)),this.mediaTracker={},e.call(this)};return bt.prototype.getData=function(t,e){var i=this,o=V.call(this);o=this.config.filterForGetData.call(this,o),this.config.runIFrameSanitization&&(o=this.dataFilter.unSanitizeIFrames(o));var r=document.createElement("div");if(r.innerHTML=o,nt.call(this,r),ot.call(this,r),e||n(r).find("["+i.config.imgKeyAttr+"]").removeAttr(i.config.imgKeyAttr),t)for(var a=function(t){var e=n(r).children(":"+t+"-child").get(0);return e&&i.dataFilter.isEmptyElement(e,!0)?e:null},l=function(){return s.compact([a("first"),a("last")])};l().length;)s.forEach(l(),function(t){n(t).remove()});return r.innerHTML},bt.prototype.setData=function(t,e,i){e&&(t=this.config.filterForSetData.call(this,t),t=this.dataFilter.filterHTML(t)),this.config.runIFrameSanitization&&(t=this.dataFilter.sanitizeIFrames(t)),B.call(this,t),i?this.dataFilter.flattenBlocksDown(this.element):this.dataFilter.blockifyInlineNodes(this.element),q.call(this),rt.call(this),st.call(this),W.call(this),this.onChange()},bt.prototype.insertData=function(t,e,i){e&&(t=this.dataFilter.filterHTML(t)),U.call(this,t),i&&this.dataFilter.flattenBlocksDown(c.getNearestElement()),this.onChange()},bt.prototype.blur=function(t){return t||k.call(this),n(this.element).blur()},bt.prototype.focus=function(t){var e=n(this.element).focus();return t||this.setCursorToEnd(),e},bt.prototype.hasFocus=function(){return n(this.element).is(":focus")},bt.prototype.setPlaceholder=function(t){this.config.placeholder=t,j.call(this)},bt.prototype.insertMedia=function(t,e,i,s){e&&(t=this.dataFilter.filterHTML(t)),X.call(this,t,i,s),this.onChange()},bt.prototype.addControl=function(t){var e=n(this.wrapper).find("[data-js=control-bar]");e.append(t)},bt.prototype.isEmpty=function(){var t=V.call(this);return""===t||"<br>"===t||t===ct||t===ut},bt.prototype.getCurrentElement=function(){return c.getNearestElement()},bt.prototype.getAsyncImage=function(t){return J.call(this,t)},bt.prototype.insertAsyncImage=function(t,e,i,s,n){K.call(this,t,e,i,s,n),this.onChange()},bt.prototype.updateAsyncImage=function(t,e,i){Y.call(this,t,e,i),this.onChange("updateAsyncImage")},bt.prototype.setCursorToStart=function(t,e){var i=n(this.element);t=t&&i.find(t).first().get(0)||i.children().first().get(0),t&&h.setToStart(t),e||A.call(this)},bt.prototype.setCursorToEnd=function(t,e){var i=n(this.element);t=t&&i.find(t).last().get(0)||i.children().last().get(0),t&&h.setToEnd(t),e||A.call(this)},bt.prototype.insertNewParagraphAfter=function(t,e){return ht.call(this,t,!1,e)},bt.prototype.insertNewParagraphBefore=function(t,e){return ht.call(this,t,!0,e)},bt.prototype.isEmptyElement=function(t){return t=t||z.call(this),this.dataFilter.isEmptyElement(t)},bt.prototype.hasSelection=function(t){return t=t||z.call(this),c.hasSelection(t)},bt.prototype.isCursorAtEnd=function(t){return t=t||z.call(this),c.isCursorAtEnd(t)},bt.prototype.isCursorAtStart=function(t){return t=t||z.call(this),c.isCursorAtStart(t)},bt.prototype.teardown=function(){this.undoManager.teardown(),this.keyComboEvents.off()},bt}();t.exports=b},function(t,e,i){var s=i(3),n=i(8),o=i(164),r=i(226),a=i(227),l=i(228),h=i(229),c=function(){function t(){this.element=n("<div />",{"class":"link-bubbles"}).css({position:"absolute",top:0,left:0}),this.linkUrl=n("<div />",{"class":"url"}),this.linkEditInput=n("<input />",{type:"text",placeholder:"http://"}),this.linkEditDone=n("<div />",{"class":"done"}).text(this.actionNames.done),this.linkUrl.hide(),this.linkUrl.append(this.linkEditInput).append(this.linkEditDone),e.call(this),this.element.append(this.linkUrl),this.hide()}function e(){var t=this,e=n("<div />",{"class":"options"}),s={edit:function(){i.call(this)},remove:function(){var t=window.getSelection(),e=document.createRange();e.selectNodeContents(this.linkElement),t.removeAllRanges(),t.addRange(e),window.document.execCommand("unlink",!1,null),t.removeAllRanges(),this.onChange(),this.hide()},open:function(){var t=n(this.linkElement).attr("href");-1===t.indexOf("://")&&(t="http://"+t),window.open(t,"_blank")}};for(var o in s){var r=n("<div />",{"class":o}).text(this.actionNames[o]);n(r).on("click",function(e){return function(){e.call(t)}}(s[o])),e.append(r)}e.hide(),n(this.element).append(e)}function i(){this.linkElement||h.error("Cannot edit link without a valid linkElement");var t=this.linkElement;c.call(this,function(e){n(t).attr("href",e)},n(t).attr("href"))}function c(t,e){e&&(this.linkEditInput.val(e),this.linkUrl.addClass("modified"));var i=this,s=function(){var e=n(i.linkEditInput).val().trim();t(e),i.onChange(),i.close()};n(this.linkEditInput).on("keydown",function(t){i.linkUrl.addClass("modified"),t.keyCode===d.enter?(t.preventDefault(),s()):t.keyCode===d.esc&&(i.close(),i.onDismiss(),t.stopPropagation())}),n(this.linkEditInput).on("keyup",function(t){t.keyCode!==d.esc&&t.keyCode!==d.enter&&u.call(i)}),n(this.linkEditInput).on("paste",function(t){i.linkUrl.addClass("modified"),u.call(i)}),this.linkEditDone.on("click",function(t){t.preventDefault(),s()}),this.element.find(".options").hide(),this.linkUrl.show(),this.show(),u.call(this),n(this.linkEditInput).focus()}function u(){var t=n(this.linkEditInput).val(),e=n(this.linkEditDone).outerWidth(),i=n(this.linkUrl).outerWidth()-n(this.linkUrl).width(),s=r.calcTextWidth(n(this.linkEditInput).get(0),t),a=r.calcTextWidth(n(this.linkEditInput).get(0),"A"),l=s+e+i+a,h=l<this.minWidth?this.minWidth:l;h=h>this.maxWidth?this.maxWidth:h;var c=n(this.element),u=h-c.width();if(0!==u){var d=Math.floor(u/2);o(c,{width:h,left:"-="+d},{duration:40,easing:"ease"})}}var d={shift:16,enter:13,esc:27,"delete":8,tab:9},p=function(e){this.onChange="onChange"in e&&s.isFunction(e.onChange)?e.onChange:s.noop,this.onDismiss=e.onDismiss||s.noop,this.bypassClasses="bypassClasses"in e&&s.isArray(e.bypassClasses)?e.bypassClasses:[],this.maxWidth="maxWidth"in e&&s.isNumber(e.maxWidth)?e.maxWidth:600,this.minWidth="minWidth"in e&&s.isNumber(e.minWidth)?e.minWidth:200,this.linkElement=null,this.labels=s.extend({},{Edit:"Edit",Remove:"Remove",Open:"Open",Done:"Done"},e.labels),this.actionNames={edit:this.labels.Edit,remove:this.labels.Remove,open:this.labels.Open,done:this.labels.Done},t.call(this),l.call(this)};return s.assign(p.prototype,l.prototype),p.prototype.createLink=function(t){c.call(this,function(e){a.restoreSelection(t),window.document.execCommand("createLink",!1,e);var i=window.getSelection(),s=i.getRangeAt(0);s.collapse(!1),i.removeAllRanges(),i.addRange(s)})},p.prototype.showOptions=function(t){this.linkElement=t,this.linkUrl.hide(),this.element.css({width:"",left:0}),this.element.find(".options").show()},p.prototype.close=function(){this.linkUrl.hide(),this.element.find(".options").hide(),this.element.css("width",""),this.linkEditInput.val("").unbind(),this.linkEditDone.unbind(),this.linkUrl.removeClass("modified"),this.linkElement=null,this.hide()},p.prototype.isValidLink=function(t){return t?!s.some(this.bypassClasses,function(e){return n(t).hasClass(e)}):!1},p}();t.exports=c},function(t,e,i){var s=i(3),n=i(8),o=function(){var t=function(){};return t.calcTextWidth=function(t,e){var i=["font-style","font-weight","font-size","font-family"],o=s.reduce(i,function(e,i){return e+" "+n(t).css(i)},"").trim(),r=document.createElement("canvas"),a=r.getContext("2d");a.font=o;var l=a.measureText(e);return Math.round(l.width)},t.browser=function(){var t=function(t){t=t.toLowerCase();var e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(trident)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}},e=t(navigator.userAgent),i={};return e.browser&&(i[e.browser]=!0,i.version=e.version),i.trident&&(i.msie=!0),i.chrome?i.webkit=!0:i.webkit&&(i.safari=!0),i}(),t}();t.exports=o},function(t,e){var i=function(){return{saveSelection:function(t,e){if(e=e||window.getSelection(),!e||!e.rangeCount)return null;for(var i,s,n,o=e.getRangeAt(0),r=0,a=[t];!n&&(i=a.pop());){if(i.nodeType===i.TEXT_NODE)i===o.startContainer?(r+=o.startOffset,n=!0):r+=i.length;else{var l=i.childNodes.length;if("false"!==i.getAttribute("contenteditable"))for(;l--;)a.push(i.childNodes[l])}s=i}return{container:t,endContainer:o.endContainer,start:r,end:r+o.toString().length,selection:e,anchorNode:e.anchorNode}},restoreSelection:function(t){if(t){var e=0,i=document.createRange();i.setStart(t.container,0),i.collapse(!0);for(var s,n,o=[t.container],r=!1,a=!1;!a&&(s=o.pop());){if(s.nodeType===s.TEXT_NODE){var l=e+s.length;!r&&t.start>=e&&t.start<l&&(i.setStart(s,t.start-e),r=!0),r||l!==t.end||(i.setStart(s,t.end-e),r=!0),r&&t.end>=e&&t.end<=l&&(i.setEnd(s,t.end-e),a=!0),e=l}else{var h=s.childNodes.length;if("false"!==s.getAttribute("contenteditable"))for(;h--;)o.push(s.childNodes[h])}n=s}if(!a){var c=t.end-e;try{i.setEnd(t.endContainer,c)}catch(u){}}var d=window.getSelection();d.removeAllRanges();try{d.addRange(i)}catch(u){}}},setToStart:function(t){if(t){var e=document.createRange();e.setStart(t,0),e.setEnd(t,0),e.collapse(!0);var i=window.getSelection();i.removeAllRanges();try{i.addRange(e)}catch(s){}}},setToEnd:function(t){for(var e=[t],i=null,s=t,n=0;i=e.pop();)if(3===i.nodeType)s=i,n=i.length;else for(var o=i.childNodes.length;o--;)e.push(i.childNodes[o]);var r=document.createRange();r.setStart(s,n),r.setEnd(s,n),r.collapse(!0);var a=window.getSelection();a.removeAllRanges();try{a.addRange(r)}catch(l){}}}}();t.exports=i},function(t,e,i){var s=i(229),n=function(){function t(t,e){"number"==typeof t&&"number"==typeof e&&this.element.css({left:t+"px",top:e+"px"})}function e(){var t=this.element.get(0).getBoundingClientRect().left;0>t&&this.element.css("left","+="+-1*t+"px");var e=this.element.get(0).getBoundingClientRect().top;0>e&&this.element.css("top","+="+-1*e+"px")}var i=function(t){return this.element?(t=t||{},this.onShow=t.onShow||function(t){t.element.show()},this.onHide=t.onHide||function(t){t.element.hide()},this.isShown=!1,void this.element.hide()):(s.error("ControlBase requires an element"),null)};return i.prototype.hide=function(){this.isShown&&(this.isShown=!1,this.onHide(this))},i.prototype.showOverTarget=function(t,i){var s=t-this.element.width()/2,n=i-this.element.height()-10;this.show(s,n),e.call(this)},i.prototype.show=function(e,i){t.call(this,e,i),this.isShown||(this.isShown=!0,this.onShow(this))},i.prototype.size=function(t,e){t&&"number"==typeof t&&this.element.width(t),e&&"number"==typeof e&&this.element.width(e)},i}();t.exports=n},function(t,e,i){var s=i(3),n=i(223),o=["assert","clear","constructor","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","timeline","timelineEnd","trace","warn"],r=function(t){return function(){return n.debugMode?window.console[t].bind(window.console).apply(this,arguments):s.noop}},a={};s.each(o,function(t){a[t]=r(t)}),t.exports=a},function(t,e,i){var s=i(3),n=i(8),o=i(164),r=o.animate,a=i(228),l=function(){function t(){var t=this,e=s.reduce(this.controlsOrder,function(t,e){return s.has(this.controls,e)&&t.push(this.template(s.extend({name:e},this.controls[e]))),t},[],this);this.element=n("<div />",{"class":"bubbles"}).css({position:"absolute",top:0,left:0}).html(e),this.buttons=n(this.element).find("[data-command]"),this.hide(),this.buttons.on("mousedown",function(t){t.preventDefault()}),this.buttons.on("mouseup",function(e){e.preventDefault(),l.call(t,this)})}function e(){s.each(this.controls,function(t,e){s.has(t,"keyboard")&&this.keyboardEvents.on(t.keyboard,s.partial(o.bind(this),e)),s.has(t,"keyboardInverse")&&this.keyboardEvents.on(t.keyboardInverse,s.partial(i.bind(this),e))},this)}function i(t){s.has(this.controls,t)&&d[t]&&o.call(this,t)}function o(t){var e,i,n,o;s.has(this.controls,t)&&(e=d[t],i=this.controls[t],n=i.command,o=i.el,e&&this.inverseCommand&&"function"==typeof this.inverseCommand?this.inverseCommand(n,o,this):this.applyCommand&&"function"==typeof this.applyCommand&&this.applyCommand(n,o,this),this.onAction(this))}function l(t){o.call(this,n(t).attr("data-name"))}function h(){this.buttons.removeClass("active"),this.buttons.filter(function(){return d[n(this).attr("data-name")]}).addClass("active")}function c(t,e){var i=!1;return n.each(t,function(t,s){return s===e||"undefined"!=typeof s.nodeName&&s.nodeName===e?(i=!0,!1):void 0}),i}var u='<div class="<%= className %>" title="<%= title %>" data-name="<%= name %>" data-el="<%= el %>" data-command="<%= command %>" data-type="<%= type %>">&nbsp;</div>',d={},p=function(i,n,o){o=o||{},this.applyCommand=i,this.inverseCommand=n,this.template=s.template(o.template||u),this.controls=o.controls||{},this.controlsOrder=o.controlsOrder||s.keys(this.controls),this.onAction=o.onAction||s.noop,this.keyboardEvents=o.keyboardEvents,t.call(this),this.keyboardEvents&&e.call(this),a.call(this,o)};return s.assign(p.prototype,a.prototype),p.prototype.setActives=function(t){d=s.reduce(this.controls,function(e,i,s){var n=i.command,o=(i.el||"").toUpperCase(),r=c(t,o),a=!1;try{a=document.queryCommandEnabled(n)&&document.queryCommandState(n)}catch(l){a=!1}return e[s]=a||r,e},{},this),h.call(this)},p.prototype.open=function(t,e){if(!this.isShown){var i=n(this.element).children("[data-command]"),s=n(this.element).find(".shim");n(this.element).css({width:"auto"}),s.remove(),i.removeAttr("style")}this.showOverTarget(t,e)},p.prototype.closeWithShim=function(t,e,i,o){var a=n(this.element),l=n(t),h=n('<div class="shim">&nbsp;</div>').get(0),c=s.has(r,"Promise");i=c?i:200;var u=a.width();a.css("width",u+e);var d=l.position().left,p=u/2-(d+e/2);l.before(h).hide();var g=n(h).offset().left+p,_=n(h).offset().top;this.isAnimating=!0,s.forEach(this.buttons,function(t,e){r(t,"stop"),r(t,{opacity:0},{duration:.5*i})}),r(a,{left:"+="+p},{easing:"ease",duration:i});var m=r(h,{width:e},{easing:"ease",duration:i}),f=s.bind(function(){s.isFunction(o)&&o.call(this,g,_),this.isAnimating=!1,this.hide()},this);c?m.then(f):s.delay(f,i)},p.prototype.getActiveStates=function(){return d},p}();t.exports=l},function(t,e,i){var s=i(3),n=i(8),o=i(232),r=function(){function t(t){t.normalize();for(var e=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1);e.nextNode();){var i=e.currentNode,s=n(i).parent().is(t);s&&""!==i.nodeValue.trim()&&n(i).wrap("<p>")}}function e(e){t(e),n(e).children().each(function(){var t=n(this).get(0),e=t.nodeName===m,i=t.nodeName===f;v(t)||b(t)||e||i||n(this).wrap("<p>")})}function i(t){return s.filter(n(t).find("*").toArray(),function(t){return v(t)||w(t)})}function r(t,o){t.normalize(),o||e(t);var r=i(t);!r.length&&o||(o&&(e(t),r=i(t)),n(t).empty(),s.each(r,function(e){var i=s.some(n(e).children().toArray(),function(t){return v(t)});(w(e)||!u(e)&&!i)&&n(t).append(e)}))}function a(t){if(!w(t)){var e=n(t).children(g.join()).toArray(),i=!1;s.each(e,function(t){i||(n(t).unwrap(),i=!0),a(t)})}}function l(t,e){var o=i(t);s.each(o,function(t){n(t).find("li").contents().unwrap(),e&&(n(t).find("br:last-child").remove(),n(t).append("<br>")),n(t).contents().unwrap()})}function h(t){var i=k(t);i.shift();for(var s=i.shift();s&&!n(s).is("[contentEditable]");){var o=s.parentNode;n(s).contents().unwrap(),e(o),s=i.shift()}}function c(t){if(t&&t.length){for(var e=t.shift(),i=!1,o=["style","dir"];e;){var r=n(e).find("span").toArray();"SPAN"===e.nodeName&&r.push(e),r.length&&(i=!0),n(r).contents().unwrap(),s.each(o,function(t){n(e).removeAttr(t),n(e).find("["+t+"]").removeAttr(t)}),e=t.shift()}return i}}function u(t,e){var i=n(t).text();e&&(i=i.replace(/\n|\r/gm,"").trim());var s=t&&t.nodeName===f;return""===i&&!b(t)&&!y(t)&&!s}function d(t){var e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body}function p(t){var e=document.implementation.createHTMLDocument("");return e.body.appendChild(t.cloneNode(!0)),e.body}var g=["P","FIGURE","H2","BLOCKQUOTE","UL","OL","PRE"],_=["FIGURE","IFRAME","IMG","HR"],m="DIV",f="HR",v=function(t){return s.contains(g,t.nodeName)},b=function(t){return t&&s.contains(_,t.nodeName)},y=function(t){return n(t).find(_.join()).length},w=function(t){return"false"===n(t).attr("contenteditable")},k=function(t){return s.filter(t,function(t){return s.contains(g,t.nodeName)})},C=function(t){this.sanitizeConfig=t};return C.prototype.flattenBlocksDown=function(t,e){r(t,e)},C.prototype.unBlock=function(t){a(t)},C.prototype.unwrapParentBlocks=function(t){h(t)},C.prototype.scrubSpansAndBadAttrs=function(t,e){return c(t,e)},C.prototype.blockifyInlineNodes=function(t){e(t)},C.prototype.inlinify=function(t,e){l(t,e)},C.prototype.getBlockNodes=function(t){return i(t)},C.prototype.isEmptyElement=function(t,e){return u(t,e)},C.prototype.filterHTML=function(t){var e=d(t),i=new o(this.sanitizeConfig),s=i.clean_node(e),n=p(s),r=n.innerHTML,a=r.replace(/[<]p[>][ ]*[<]\/p[>]/g,"");return a},C.prototype.filterPlaintext=function(t,e){var i=s.escape(t);return i=i.replace(/\r\n/g,"\n"),i=i.replace(/\r/g,"\n"),e&&(i=i.replace(/\n([ ]*\n)+/g,"</p><p>")),i=i.replace(/\n/g,"<br>"),e&&(i="<p>"+i+"</p>"),i},C.prototype.convertToBrowserSpaces=function(t){return t.replace(/[ ]{2}/g,"  ").replace(/[ ]$/," ")},C.prototype.sanitizeIFrames=function(t){var e=d(t);return n(e).find("iframe").each(function(){n(this).attr("data-original-src",n(this).attr("src")),n(this).attr("src","javascript:''")}),e.innerHTML},C.prototype.unSanitizeIFrames=function(t){var e=d(t);return n(e).find("iframe[data-original-src]").each(function(){n(this).attr("src",n(this).attr("data-original-src")),n(this).removeAttr("data-original-src")}),e.innerHTML},C}();t.exports=r},function(t,e){function i(){var t,e;for(e=arguments[0]||{},this.config={},this.config.elements=e.elements?e.elements:[],this.config.attributes=e.attributes?e.attributes:{},this.config.attributes[i.ALL]=this.config.attributes[i.ALL]?this.config.attributes[i.ALL]:[],this.config.allow_comments=e.allow_comments?e.allow_comments:!1,this.allowed_elements={},this.config.protocols=e.protocols?e.protocols:{},this.config.classnames=e.classnames?e.classnames:{},this.config.add_attributes=e.add_attributes?e.add_attributes:{},this.dom=e.dom?e.dom:document,t=0;t<this.config.elements.length;t++)this.allowed_elements[this.config.elements[t]]=!0;if(this.config.remove_element_contents={},this.config.remove_all_contents=!1,e.remove_contents)if(e.remove_contents instanceof Array)for(t=0;t<e.remove_contents.length;t++)this.config.remove_element_contents[e.remove_contents[t]]=!0;else this.config.remove_all_contents=!0;this.transformers=e.transformers?e.transformers:[]}i.REGEX_PROTOCOL=/^([A-Za-z0-9\+\-\.\&\;\*\s]*?)(?:\:|&*0*58|&*x0*3a)/i,i.RELATIVE="__RELATIVE__",i.ALL="__ALL__",i.prototype.clean_node=function(t){function e(t,e){var i;for(i=0;i<e.length;i++)if(e[i]===t)return i;return-1}function s(){var t,e,i=[],s={};for(t=0;t<arguments.length;t++)if(arguments[t]&&arguments[t].length)for(e=0;e<arguments[t].length;e++)s[arguments[t][e]]||(s[arguments[t][e]]=!0,i.push(arguments[t][e]));return i}function n(t){var e;switch(t.nodeType){case 1:r.call(this,t);break;case 3:e=t.cloneNode(!1),this.current_element.appendChild(e);break;case 5:e=t.cloneNode(!1),this.current_element.appendChild(e);break;case 8:this.config.allow_comments&&(e=t.cloneNode(!1),this.current_element.appendChild(e));break;default:console&&console.log&&console.log("unknown node type",t.nodeType)}}function o(t,i){for(var s=[],n=0;n<t.length;n++)-1!==e(t[n],i)&&s.push(t[n]);return s}function r(t){var r,l,h,c,u,d,p,g,_,m,f=a.call(this,t);if(t=f.node,h=t.nodeName.toLowerCase(),l=this.current_element,this.allowed_elements[h]||f.whitelist){this.current_element=this.dom.createElement(t.nodeName),l.appendChild(this.current_element);var v=this.config.attributes;for(c=s(v[h],v[i.ALL],f.attr_whitelist),this.config.classnames[h]&&this.config.classnames[h].length&&c.push("class"),r=0;r<c.length;r++){d=c[r];var b="object"==typeof c[r]||c[r]instanceof Object;if(d=b?c[r].name:c[r],u=t.attributes[d]){g=u.value;var y=g.toLowerCase();if(m=!0,this.config.protocols[h]&&this.config.protocols[h][d]){m=!1,_=this.config.protocols[h][d],_.push(i.RELATIVE);for(var r in _)if(0===y.indexOf(_[r].toLowerCase())){m=!0;break}}"class"===d&&this.config.classnames[h]&&(g=o(g.split(" "),this.config.classnames[h]).join(" "),m=!!g),b&&(m=y.match(c[r].value)),m&&(p=document.createAttribute(d),p.value=g,this.current_element.setAttributeNode(p))}}if(this.config.add_attributes[h])for(d in this.config.add_attributes[h])p=document.createAttribute(d),p.value=this.config.add_attributes[h][d],this.current_element.setAttributeNode(p)}else if(-1!==e(t,this.whitelist_nodes)){for(this.current_element=t.cloneNode(!0);this.current_element.childNodes.length>0;)this.current_element.removeChild(this.current_element.firstChild);l.appendChild(this.current_element)}if(!this.config.remove_all_contents&&!this.config.remove_element_contents[h])for(r=0;r<t.childNodes.length;r++)n.call(this,t.childNodes[r]);this.current_element.normalize&&this.current_element.normalize(),this.current_element=l}function a(t){var i,n,o,r={attr_whitelist:[],node:t,whitelist:!1};for(i=0;i<this.transformers.length;i++)if(o=this.transformers[i]({allowed_elements:this.allowed_elements,config:this.config,node:t,node_name:t.nodeName.toLowerCase(),whitelist_nodes:this.whitelist_nodes,dom:this.dom}),null!==o){if("object"!=typeof o)throw new Error("transformer output must be an object or null");if(o.whitelist_nodes&&o.whitelist_nodes instanceof Array)for(n=0;n<o.whitelist_nodes.length;n++)-1===e(o.whitelist_nodes[n],this.whitelist_nodes)&&this.whitelist_nodes.push(o.whitelist_nodes[n]);r.whitelist=!!o.whitelist,o.attr_whitelist&&(r.attr_whitelist=s(r.attr_whitelist,o.attr_whitelist)),r.node=o.node?o.node:r.node}return r}var l=this.dom.createDocumentFragment();this.current_element=l,this.whitelist_nodes=[];for(var h=0;h<t.childNodes.length;h++)n.call(this,t.childNodes[h]);return l.normalize&&l.normalize(),l},t.exports=i},function(t,e,i){var s=i(3),n=i(8),o=function(){var t=function(t){return Array.prototype.indexOf.call(t.parentNode.childNodes,t)},e=function(t){return t instanceof HTMLElement},i={getParentNodes:function(t,e){if(e=e||[],!t||i.isEditorNode(t))return e;var s=t.parentNode;return i.isEditorNode(s)?e:s?(e.push(s),i.getParentNodes(s,e)):e},getRootElements:function(s){s=s||i.getSelection();var n=s&&s.anchorNode?s.anchorNode:null;if(!n||i.isEditorNode(n))return[];var o=i.getParentNodes(n),r=s.focusNode,a=i.getParentNodes(r),l=o.length?o.pop():n,h=a.length?a.pop():r,c=t(l),u=t(h);if(c>u){var d=c;c=u,u=d}for(var p=[],g=l.parentNode,_=c;u>=_;_++){var m=g.childNodes[_];e(m)&&p.push(m)}return p},getNodeList:function(t,e){t=t||i.getSelection();var n=t&&t.anchorNode?t.anchorNode:null;if(!n||i.isEditorNode(n))return[];var o=t.focusNode,r=[n];o&&!i.isEditorNode(o)&&(r=r.concat([o]));var a=i.getParentNodes(n);if(r=r.concat(a),!e){var l=i.getParentNodes(o);r=r.concat(l)}var h=s.union(r);return h},getNodeByNames:function(t,e,s){var n=i.getNodeList(s);return n=e?n.reverse():n,this.getNodesByNames(n,t)[0]},getNodesByNames:function(t,e){return s.filter(t,function(t){return-1!==s.indexOf(e,t.nodeName)})},getNearestElement:function(t){t=t||i.getSelection();var e=i.getNodeList();return s.find(e,function(t){return 1===t.nodeType})},getContextCoordinates:function(t,e){var s=i.getSelection(),o=s.getRangeAt(0).cloneRange(),r=n(t).offset();if(e||!s.isCollapsed){var a=(e||o).getBoundingClientRect();return{x:a.left+a.width/2-r.left,y:a.top-r.top+n(window).scrollTop()}}if(o.getClientRects){o.collapse(!0);var l=o.getClientRects()[0];if(l)return{x:l.left-r.left,y:l.top-r.top+n(window).scrollTop()}}},getSelection:function(){var t=window.getSelection();if(t.anchorNode){var e=n(t.anchorNode).closest("[contenteditable]").length;return e?t:null}return null},collapseToEnd:function(){var t=i.getSelection();t&&t.collapseToEnd()},collapseToStart:function(){var t=i.getSelection();t&&t.collapseToStart()},isInContext:function(t,e){return n(t.anchorNode).closest(e).length>0},isEditorNode:function(t){return n(t).is('[contentEditable="true"]')},hasSelection:function(){var t=i.getSelection();return t&&!t.isCollapsed},rangeFromElement:function(t){var e,s,n=i.getSelection();return n&&n.isCollapsed?(s=n.getRangeAt(0),e=s.cloneRange(),e.selectNodeContents(t),e.setEnd(s.startContainer,s.startOffset),e):!1},isCursorAtEnd:function(t,e){var i=this.rangeFromElement(t);if(!i)return!1;var s=i.toString(),n=t.textContent;return e&&(s=s.trim(),n=n.trim()),s.length===n.length},isCursorAtStart:function(t){var e=this.rangeFromElement(t);return e?0===e.startOffset&&0===e.endOffset:!1}};return i}();t.exports=o},function(t,e,i){var s=i(3),n=i(8),o=i(228),r=function(){function t(){this.element=n("<div />",{"class":"inline-controls"}).css({position:"absolute",top:0,left:0}),this.opener=n("<div />",{"class":"opener"}),this.isTrayOpen=!1;var t=this;this.opener.on("mousedown",function(i){return i.preventDefault(),i.stopPropagation(),e.call(t,null,!0),!1}),this.tray=n("<div />",{"class":"tray"}),this.element.append(this.opener),this.element.append(this.tray),this.hide()}function e(t,e){"boolean"!=typeof t&&(t=!this.isTrayOpen),t?(this.openTray.call(this,this.tray),this.isTrayOpen=!0,this.onTrayOpened.call(this,e)):(this.closeTray.call(this,this.tray),this.isTrayOpen=!1,this.onTrayClosed.call(this,e)),n(this.opener).toggleClass("open",this.isTrayOpen),e?n(this.opener).toggleClass("closed",!this.isTrayOpen):n(this.opener).removeClass("closed")}var i=function(e){e=e||{},this.openTray=e.openTray||this.openTray,this.closeTray=e.closeTray||this.closeTray,this.onTrayOpened=e.onTrayOpened||function(t){},this.onTrayClosed=e.onTrayClosed||function(t){},this.customOffset=e.customOffset||s.noop,this.keyboardEvents=e.keyboardEvents,t.call(this),o.call(this,e)};s.assign(i.prototype,o.prototype);var r=s.memoize(function(t,e){var i;return s.isFunction(e)?i=e.call():s.isObject(e)&&(i=e),s.pick(s.defaults(s.isObject(i)?i:{},{x:t.x||t,y:t.y||0}),["x","y"])});return i.prototype.addToTray=function(t,e){var i;e=e||{},this.tray.append(t),i=e.keyboard,this.keyboardEvents&&i&&this.keyboardEvents.on(i.shortcut,i.callback,i.context)},i.prototype.openTray=function(t){t.show()},i.prototype.closeTray=function(t){t.hide()},i.prototype.open=function(t,i){if(t){i=r(i||0,this.customOffset||0);var s=n(t).position(),o=parseInt(n(t).css("margin-top"),10)||0;e.call(this,!1),this.show(s.left+i.x,s.top+i.y+o)}},i.prototype.close=function(){e.call(this,!1),this.hide()},i.prototype.toggleTrayWithIntent=function(t){e.call(this,t,!0)},i}();t.exports=r},function(t,e,i){var s=i(3),n=i(8),o=i(227),r=function(){function t(){var t=this,s=function(t){return/Mac/.test(navigator.platform)?t.metaKey:t.ctrlKey};n(this.editor.element).on("keydown.undoManager",function(n){return n.keyCode===c.z&&s(n)&&!n.altKey?(n.shiftKey?i.call(t):e.call(t),n.preventDefault(),!1):void 0})}function e(){if(l.call(this),this.undoStates.length){var t=this.undoStates.pop();h.call(this,t),this.redoStates.push(this.currState),r.call(this)}}function i(){if(this.redoStates.length){var t=this.redoStates.pop();h.call(this,t),this.undoStates.push(this.currState),r.call(this)}}function r(){this.currState=a.call(this)}function a(){var t={data:this.editor.getData(!0,!0),selection:o.saveSelection(this.editor.element)};return t}function l(){var t=a.call(this);return this.currState?void(t.data!==this.currState.data&&(this.undoStates.push(this.currState),this.currState=t)):void(this.currState=t)}function h(t){if(this.isRestoring=!0,this.editor.setData(t.data,!0),t.selection)o.restoreSelection(t.selection);else{var e=window.getSelection();e.removeAllRanges()}this.afterRestore()}var c={command:91,control:17,shift:16,z:90},u=500,d=function(e,i){this.editor=e,this.modifierKeyCode=!1,this.isShift=!1,this.currState=null,this.undoStates=[],this.redoStates=[],this.afterRestore=i||function(){},
  this.isRestoring=!1;var n=this,o=s.debounce(function(){n.isTorndown||l.call(n)},u);this.defaultOnChange=e.onChange,e.onChange=function(t){if(n.isRestoring)n.isRestoring=!1;else{if("updateAsyncImage"===t)return;n.currState?o():l.call(n)}n.defaultOnChange.call(this)},t.call(this)};return d.prototype.undo=function(){e.call(this)},d.prototype.redo=function(){i.call(this)},d.prototype.teardown=function(){this.isTorndown=!0,this.editor.onChange=this.defaultOnChange,this.undoStates.length=0,this.redoStates.length=0,this.currState=null,n(this.editor.element).off(".undoManager")},d}();t.exports=r},function(t,e,i){var s=i(3),n=i(8),o=i(233),r=i(227),a=i(226),l=function(){function t(){var t=this;n(this.editor.element).on("keypress",function(s){var n=!1;if(34===s.charCode)n=i.call(t);else{if(39!==s.charCode)return;n=e.call(t)}n&&s.preventDefault()})}function e(){var t=this.config.singleQuotes;return l.call(this,t.open,t.close,t.prime)}function i(){var t=this.config.doubleQuotes;return l.call(this,t.open,t.close,t.prime)}function l(t,e,i){var a=o.getSelection();if(!a.isCollapsed)return!1;var l=a.anchorNode;l.normalize();var h=r.saveSelection(l),c=l.textContent,u=c.slice(0,h.start),d=u.charAt(u.length-1),p=l.lastChild&&"BR"===l.lastChild.nodeName?l.lastChild:null,g=s.any(this.config.openingMatches,function(t){return t.test(d)})||p,_="";_=!d||g?t:/\d/.test(d)?i:e;var m=document.createTextNode(_),f=a.getRangeAt(0);return f.deleteContents(),f.insertNode(m),p&&p.previousSibling&&"BR"===p.previousSibling.nodeName&&n(p).remove(),f.setEndAfter(m),f.collapse(!1),a.removeAllRanges(),a.addRange(f),!0}var h=function(e,i){return a.browser.msie?null:(this.editor=e,this.config={openingMatches:[/\s/,/\u200B/,/[=]/],singleQuotes:{open:"‘",close:"’",prime:"′"},doubleQuotes:{open:"“",close:"”",prime:"″"}},s.extend(this.config,i||{}),void t.call(this))};return h}();t.exports=l},function(t,e,i){var s=i(3),n=i(8),o=i(238),r=function(){function t(){n(this.element).on("keydown.keycombos",i.bind(this)),this.listening=!0}function e(){n(this.element).off("keydown.keycombos"),this.listening=!1}function i(t){var e=this.humanKeys.translate(t);e&&a.call(this,e)&&(r.call(this,e,t),t.preventDefault(),t.stopImmediatePropagation())}function r(t,e){s.each(h.call(this,t),function(i){s.has(i,"callback")&&s.has(i,"context")&&i.callback.call(i.context,e,t)})}function a(t){return h.call(this,t).length>0}function l(t,e){var i=h.call(this,t);return s.filter(i,{callback:e}).length>0}function h(t){return s.has(this.subscribers,t)?this.subscribers[t]:[]}function c(e,i,n){return l.call(this,e,i)?void 0:(s.has(this.subscribers,e)||(this.subscribers[e]=[]),this.subscribers[e].push({callback:i,context:n}),this.listening||t.call(this),this)}function u(){this.subscribers={},e.call(this)}function d(t,i){return t?s.has(this.subscribers,t)?(i&&(this.subscribers[t]=s.reject(this.subscribers[t],{callback:i})),i&&0!==this.subscribers[t].length||delete this.subscribers[t],0===s.values(this.subscribers).length&&e.call(this),this):this:(u.call(this),this)}var p=function(t){t=t||{},this.debounceRate=t.debounceRate||100,this.element=t.element||document,this.humanKeys=t.humanKeys||new o,this.subscribers={},this.listening=!1};return p.prototype.on=function(t,e,i){s.each((t||"").split(" "),function(t){c.call(this,this.humanKeys.normalize(t),e,i)},this)},p.prototype.off=function(t,e){t?s.each(t.split(" "),function(t){d.call(this,this.humanKeys.normalize(t),e)},this):d.call(this,null,e)},p}();t.exports=r},function(t,e,i){var s=i(3),n=function(){function t(){return navigator.platform.match(/^Win/i)?"Win":navigator.platform.match(/^Mac/i)?"Mac":navigator.platform.match(/^Linux/i)?"Linux":navigator.platform}function e(){return s.extend({},this.prettyMapping,this.platformPrettyMapping[t.call(this)])}function i(){return this.platformModifiers[t.call(this)]||{}}function n(){var e=t.call(this);return s.has(this.platformPrettySeperators,e)?this.platformPrettySeperators[e]:this.seperator}function o(t){return this.specialKeys[t.keyCode]||String.fromCharCode(t.keyCode)}function r(t){return s.filter(this.modifiers,function(e){return t[e+"Key"]})}function a(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}var l=["ctrl","meta","alt","shift"],h="+",c={37:"LEFT",38:"UP",39:"RIGHT",40:"DOWN",187:"PLUS",61:"PLUS",188:"COMMA",189:"MINUS",173:"MINUS",190:"DOT",32:"SPACE"},u={LEFT:"←",RIGHT:"→",DOWN:"↓",UP:"↑",PLUS:"+",COMMA:",",MINUS:"-",DOT:".",SPACE:"Space"},d={Win:{meta:"ctrl"},Linux:{meta:"ctrl"}},p={Mac:{meta:"⌘",shift:"⇧",alt:"⌥"}},g={Win:"-",Linux:"-",Mac:""},_=function(t){t=t||{},this.modifiers=t.modifiers||l,this.separator=t.separator||h,this.specialKeys=t.specialKeys||c,this.prettyMapping=t.prettyMapping||u,this.platformModifiers=t.platformsModififiers||d,this.platformPrettyMapping=t.platformPrettyModifiers||p,this.platformPrettySeperators=t.platformPrettySeperators||g};return _.prototype.translate=function(t){var e=r.call(this,t);return 0===e.length?null:e.concat(o.call(this,t)).join(this.separator)},_.prototype.normalize=function(t){var e=t.split(this.separator),n=i.call(this),o="";return s.each(this.modifiers,function(t){var i=s.indexOf(e,t.toLowerCase()),r=n[t]||t;i>=0&&(o+=r+this.separator,e.splice(i,1))},this),o+e.join(this.separator).toUpperCase()},_.prototype.pretty=function(t){var i=this.normalize(t),o=e.call(this),r=n.call(this);return s.map(i.split(this.separator),function(t){return o[t]||a(t)},this).join(r)},_}();t.exports=n},function(t,e,i){var s=i(3),n=i(8),o=i(231),r=i(227),a=i(233),l=i(235),h=i(236),c=i(237),u=i(229),d=function(){function t(){_.call(this,x);var t=n("<div />",{"data-js":"editor-wrapper","class":"editor-wrapper"}).css("position","relative"),i=n("<div />",{"data-js":"editor-slot","class":"editor-slot"}).css("position","relative");n(this.element).wrap(t).wrap(i),this.placeholderElement=n("<div />",{"data-js":"editor-placeholder","class":"editor-placeholder"}).css("position","absolute"),i=n(this.element).parent(),i.append(this.placeholderElement),d.call(this),e.call(this)}function e(){var t=this,e=function(){y.call(this),i.call(this),this.onChange()};n(this.element).on("input keydown keyup keypress mousedown mouseup",function(e){t.config.onClientEvent.call(t,e)}),n(this.element).on("keydown",function(e){if(e.keyCode===E.shift)t.keyModifiers.shift=!0;else if(e.keyCode===E.backspace)C.call(t);else if(e.keyCode===E.enter)return t.config.forceSingleLine||e.metaKey||v.call(t,this,!1),void e.preventDefault();s.defer(function(){t.onChange(e)})}),n(this.element).on("keyup",function(i){i.keyCode===E.shift?t.keyModifiers.shift=!1:i.keyCode===E.enter?C.call(t):i.keyCode!==E.backspace&&i.keyCode!==E["delete"]||s.defer(function(){C.call(t)}),e.call(t)}),n(this.element).on("input",function(i){e.call(t)}),n(this.element).on("blur",function(e){t.onChange()});var o=!1;n(this.element).on("mouseup",function(){o=!1,i.call(t)}),n(this.element).on("mousedown",function(t){o=!0}),n(this.element).on("mouseleave",function(){o&&i.call(t)}),n(this.element).on("paste",function(e){var i=(e.originalEvent||e).clipboardData;t.config.pasteHook(i,t.keyModifiers.shift)||p.call(t,i,e),e.preventDefault()}),n(this.element).on("drop",function(t){t.stopPropagation(),t.preventDefault()}),this.placeholderElement.on("click",function(){t.isEmpty()&&n(t.element).focus()}),n(this.element).on("focus",function(){s.defer(function(){t.onChange()})})}function i(){var t=this;setTimeout(function(){var e=a.getSelection();t.config.onSelection.call(t,e)},200)}function d(){var t=this.isEmpty()?this.config.placeholder:"",e=n(this.placeholderElement);e.html(t);var i=e.outerHeight();i&&n(this.element).css("min-height",Math.max(parseInt(e.css("min-height"),10)||0,i))}function p(t,e){var i="";if(s.contains(t.types,"text/plain"))i=t.getData("text/plain"),i=this.dataFilter.filterPlaintext(i),f.call(this,i);else{if(!s.contains(t.types,"text/html"))return;i=t.getData("text/html"),i=this.dataFilter.filterHTML(i);var n=i.replace(/<br(\s*)\/*>/gi,"\n").replace(/(<[p|div])/gi,"\n$1"),o=document.implementation.createHTMLDocument("");o.body.innerHTML=n;var r=o.body,a=r.textContent||r.innerText||"",l=a.split("\n").join("<br>");f.call(this,l)}if(this.config.forceSingleLine){var h=m.call(this).replace(/<br\s*\/*>/g," ");_.call(this,h)}this.onChange(e)}function g(){n(this.element).contents().filter(function(){return 3===this.nodeType}).wrap("<span></span>")}function _(t){n(this.element).html(t)}function m(){return n(this.element).html().trim()}function f(t){if(t=t.replace(/[<]br\s?\/?[>]$/,""),t=this.dataFilter.convertToBrowserSpaces(t),!t)return void u.warn("Cannot insert empty data");var e=a.getSelection();if(!e||!e.focusNode)return void u.warn("Cannot insert without the editor having a cursor or selection");var i=e.getRangeAt(0);i.deleteContents();var s=i.createContextualFragment(t);i.insertNode(s),e.removeAllRanges(),i.collapse(!1),e.addRange(i)}function v(t,e){e||t.lastChild&&"br"===t.lastChild.nodeName.toLowerCase()||t.appendChild(document.createElement("br"));var i=a.getSelection();if(i){var s=i.getRangeAt(0),n=document.createElement("br");s.deleteContents(),s.insertNode(n),s.setStartAfter(n),s.setEndAfter(n),s.collapse(!1),i.removeAllRanges(),i.addRange(s)}}function b(t){n(t).contents().each(function(t,e){e.nodeType===Node.TEXT_NODE?e.textContent=e.textContent.replace(T,""):e.nodeType===Node.ELEMENT_NODE&&b(e)})}function y(){if(!this.isEmpty()){var t=w.call(this);if(t&&t.nodeType===Node.ELEMENT_NODE){var e=t.textContent||t.innerText||"",i=e.match(T);if(i){var s=r.saveSelection(t);s.start-=(e.substr(0,s.start).match(T)||"").length||0,s.end-=(e.substr(0,s.end).match(T)||"").length||0,b(t),r.restoreSelection(s)}}}}function w(){var t=k.call(this);if(!t){var e=n(this.element).children();if(!e.length)return null;t=e.last().get(0)}return t}function k(t){return t||(t=!a.getSelection()&&this.lastSelection?a.getParentNodes(this.lastSelection.anchorNode):a.getNodeList()),s.find(t.reverse(),function(t){return t.nodeType===Node.ELEMENT_NODE})}function C(){this.isEmpty()&&(_.call(this,x),this.setCursorToEnd())}var x="<span>&#8203;</span>",S="<span>​</span>",T=/\u200B/g,E={shift:16,enter:13,esc:27,backspace:8,"delete":46,tab:9,right:39},P=function(e,i){if(!e)throw new Error("A valid element parameter is required to initalize the editor");this.element=e,this.keyComboEvents=i.keyComboEvents||new c({element:this.element}),this.keyComboEvents.on("meta+b meta+i meta+k meta+u",s.noop),this.config={placeholder:!1,onChange:function(){},onSelection:function(t){},onClientEvent:function(t){},pasteHook:function(t,e){return!1},filterForSetData:function(t){return t},filterForGetData:function(t){return t},filterRules:{elements:["p","br","div"],attributes:{},remove_contents:["style","noscript","script","meta"],protocols:{}},forceSingleLine:!1,smartQuotes:{enabled:!1,config:{}}},s.extend(this.config,i||{}),this.dataFilter=new o(this.config.filterRules),this.onChange=function(){this.previousRawData!==m.call(this)&&(g.call(this),d.call(this),this.config.onChange.apply(this,arguments),this.previousRawData=m.call(this))},this.keyModifiers={shift:!1},this.undoManager=new l(this),this.config.smartQuotes.enabled&&(this.smartQuoter=new h(this)),t.call(this)};return P.prototype.getData=function(t){var e=m.call(this);e=this.config.filterForGetData.call(this,e);var i=e.replace(/<br(\s*)\/*>/gi,"\n").replace(/(<[p|div])/gi,"\n$1").replace(T,""),s=document.createElement("div");s.innerHTML=i;var n=s.textContent||s.innerText||"",o=t?n.trim():n;return o},P.prototype.setData=function(t){t=this.config.filterForSetData.call(this,t),t=this.dataFilter.filterPlaintext(t),_.call(this,t),C.call(this),this.onChange()},P.prototype.setHTML=function(t){_.call(this,t),this.onChange()},P.prototype.getHTML=function(){return m.call(this)},P.prototype.insertData=function(t,e){e&&(t=this.dataFilter.filterHTML(t)),f.call(this,t),this.onChange()},P.prototype.blur=function(){return n(this.element).blur()},P.prototype.focus=function(t){var e=n(this.element).focus();return t||this.setCursorToEnd(),e},P.prototype.hasFocus=function(){return n(this.element).is(":focus")},P.prototype.setPlaceholder=function(t){this.config.placeholder=t,d.call(this)},P.prototype.isEmpty=function(){var t=this.getData(!1);if(""===t||"\n"===t||"\r\n"===t)return!0;var e=m.call(this);return e===x||e===S||""===e},P.prototype.getCurrentElement=function(){return a.getNearestElement()},P.prototype.setCursorToStart=function(t){var e=n(this.element);t=t&&e.find(t).first().get(0)||e.children().first().get(0),t&&r.setToStart(t)},P.prototype.setCursorToEnd=function(t){var e=n(this.element);t=t&&e.find(t).last().get(0)||e.children().last().get(0),t&&r.setToEnd(t)},P.prototype.teardown=function(){this.undoManager.teardown(),this.keyComboEvents.off()},P}();t.exports=d},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="editor editor-plaintext" aria-label="'+__e(ariaLabel)+'" contenteditable="true" data-js-plaintexteditor></div>';return __p}.toString()).apply(void 0,_values(_imports))},,,,function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(148),r=i(164),a=o.extend({initialize:function(t){this.el=t.el||null,this.itemSelector=t.itemSelector||".item",this.dropInParent=t.dropInParent||!1,this.transparentPlaceholder=t.transparentPlaceholder,this.beforeDragStart=t.beforeDragStart||s.noop,this.afterDragEnd=t.afterDragEnd||s.noop,this.scrollable=t.scrollable||!1,this.$items=this.$(this.itemSelector),this.isAnimating=!1,this.disableAnimation=t.disableAnimation||!1,this.disableAnimation&&(this.calculateDropTarget=s.throttle(this.calculateDropTarget,500)),this.$currentlyDraggedItem=null,this.$placeholder=null,this.placeholderElement=null,this.renderedPlaceholder=!1,this.reloadItems()},itemEvents:function(t){t||(t=this.itemSelector);var e={};return e["dragstart "+t]="setPlaceholder",e["dragenter "+t]="calculateDropTarget",e["dragend "+t]="resetPlaceholder",this.dropInParent?(e.dragover="cancelEvent",e.drop="dropItemAndResetPlaceholder"):(e["dragover "+t]="cancelEvent",e["drop "+t]="dropItem"),e},setPlaceholder:function(t){this.renderedPlaceholder=!1,t.originalEvent.dataTransfer.effectAllowed="move";try{t.originalEvent.dataTransfer.setData("text/html","")}catch(e){}if(this.$currentlyDraggedItem=n(t.currentTarget),this.$currentlyDraggedItem){if(this.$placeholder=this.$currentlyDraggedItem.clone().addClass("sortable-placeholder"),this.transparentPlaceholder&&this.$placeholder.addClass("transparent-placeholder"),!this.disableAnimation){var i=this.$currentlyDraggedItem.outerWidth();this.$placeholder.data("item-width",i).data("need-animation",!1)}this.placeholderElement=this.$placeholder.get(0),this.$currentlyDraggedItem.addClass("sortable-dragging"),this.beforeDragStart(),this.trigger("dragstart",this),this.scrollable&&(this.$el.on("dragover."+this.cid,s.throttle(function(t){var e=.2,i=window.innerHeight,s=t.originalEvent.clientY/i,n=this.getBoundingClientRect();e>s&&n.top<0?window.scrollBy(0,-(200*(e-s))):s>1-e&&window.scrollBy(0,200*(e+s-1)),t.preventDefault()},50)),this.$currentlyDraggedItem.one("dragend",s.bind(function(){this.$el.off(["dragenter."+this.cid,"dragover."+this.cid].join(" "))},this)))}},calculateDropTarget:function(t){if(this.$currentlyDraggedItem&&!this.isAnimating){t.preventDefault(),this.renderedPlaceholder=!0;var e=t.currentTarget,i=n(e);if(e===this.placeholderElement)return!1;this.$currentlyDraggedItem.hide();var s,o=i.index(this.itemSelector),r=this.$placeholder.index(this.itemSelector),a=this.$placeholder.data("need-animation")||!1,l=this.$placeholder.data("item-width");return this.disableAnimation||(s=n("<span>").css({width:l,display:"inline-block"}),this.$placeholder.after(s),a&&this.$placeholder.css({width:0,padding:0})),o>r?i.after(this.placeholderElement):i.before(this.placeholderElement),this.disableAnimation||(a?this.animatePlaceholderWidth(s,this.$placeholder,l,200):this.$placeholder.data("need-animation",!0)),this.lastDroppable=e,!1}},animatePlaceholderWidth:function(t,e,i,n){this.isAnimating=!0,r.animate(t,"stop"),r.animate(e,"stop"),r.animate(t,{width:0},n,"easeInOutQuart",s.bind(function(){t.remove(),this.isAnimating=!1},this)),r.animate(e,{width:i},n,"easeInOutQuart")},cancelEvent:function(t){this.$currentlyDraggedItem&&t.preventDefault()},dropItem:function(t){return this.$currentlyDraggedItem&&this.renderedPlaceholder&&this.placeholderElement&&(t.stopPropagation(),this.$currentlyDraggedItem.insertAfter(this.placeholderElement)),!1},resetPlaceholder:function(t){this.renderedPlaceholder=!1,this.placeholderElement=null,this.$currentlyDraggedItem&&(this.$currentlyDraggedItem.removeClass("sortable-dragging").show(),this.$currentlyDraggedItem=null,this.$placeholder.detach(),t.stopPropagation(),this.afterDragEnd(),this.trigger("dragend",this),this.lastDroppable=null)},dropItemAndResetPlaceholder:function(t){return this.dropItem(t),this.resetPlaceholder(t)},sequence:function(){var t=this.$(this.itemSelector).toArray();return s.uniq(s.pluck(t,"id"))},reloadItems:function(){return this.$items=this.$(this.itemSelector),s.each(this.$items,function(t){t.draggable=!0,n(t).find("a").attr("draggable",!1),n(t).find("img").attr("draggable",!1)}),this.delegateEvents(this.itemEvents(this.itemSelector)),this},disableItems:function(){return s.each(this.$items,function(t){t.draggable=!1}),this.undelegateEvents(),this},teardown:function(){return this.undelegateEvents(),this.scrollable&&this.$el.off(["dragenter."+this.cid,"dragover."+this.cid].join(" ")),s.each(this.$items,function(t){n(t).add("a, img",t).removeAttr("draggable")}),this.$items=null,this.$placeholder=null,this.beforeDragStart=null,this.afterDragEnd=null,this.calculateDropTarget=null,this}});t.exports=a},,,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(260);t.exports=s},function(t,e,i){"use strict";var s=i(155),n=i(261),o=s.extend({className:"knight-rider-container",template:n,defaults:{variation:"",loading:!1},_onChangeLoading:function(t,e){this.$el.toggleClass("loading",e),this.$el.find("[data-js-knightRider]").toggleClass("animate",e),this.$el.toggle(e)},afterRender:function(){this._onChangeLoading(this,this.get("loading")),this.listenTo(this,"change:loading",this._onChangeLoading)}});t.exports=o},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="knight-rider-loader '+__e(variation)+'" data-js-knightrider><div class="knight-rider-bar"></div><div class="knight-rider-bar"></div><div class="knight-rider-bar"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},,,,,,,,,function(t,e,i){"use strict";t.exports={SharePopoverView:i(271),FeatureHelpPopoverView:i(279)}},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(148),r=i(109),a=i(272),l=i(205),h=i(212),c=i(273),u=i(274),d=i(277),p=i(278),g=o.extend({className:"popover--post-share-popover",mixins:[l,h,p],template:c,defaults:{popoverData:{},forceSocialFallback:!1,forceEmailFallback:!1,tumblelogShare:!1},events:{"click .embed_post":"__embedPostClick","click .share_email":"__emailTriggerClick","click .share_facebook":"__shareFacebookClick","click .share_pinterest":"__sharePinterestClick","click .share_twitter":"__shareTwitterClick","click .share_reddit":"__shareRedditClick","click .share_permalink":"__sharePermalinkClick","click .flag_post":"__flagPostClick","click .cancel":"__cancelClick","click .popover_menu_item_anchor":"__checkIfPremiumPost","input .email_address":"__emailFormInput","input .twitter .share_message":"__shareTwitterInput","change .reply_to_input":"__replyToChange","keydown .share_form":"__submitKeydown","submit .share_form":"__submit","focus input":"__suspendKeyCommands","focus textarea":"__suspendKeyCommands","blur textarea":"__resumeKeyCommands","blur input":"__resumeKeyCommands"},__embedPostClick:function(t){t.preventDefault(),r.trigger("dashboard-share:embed"),this._showEmbedCode()},__emailTriggerClick:function(t){t.preventDefault(),r.trigger("dashboard-share:email"),this._toggleEmailForm()},__shareFacebookClick:function(t){t.preventDefault(),r.trigger("dashboard-share:facebook"),this._shareFacebook()},__sharePinterestClick:function(t){t.preventDefault(),r.trigger("dashboard-share:pinterest"),this._sharePinterest()},__shareRedditClick:function(t){t.preventDefault(),r.trigger("dashboard-share:reddit"),this._shareReddit()},__shareTwitterClick:function(t){t.preventDefault(),r.trigger("dashboard-share:twitter"),this._shareTwitter()},__sharePermalinkClick:function(){this.resetAndHide()},__flagPostClick:function(t){t.preventDefault(),this.onClickOutside(),r.trigger("abuseform:open",{mode:"post",post:this.model})},__cancelClick:function(t){t.preventDefault(),this._cancelOrClose()},__emailFormInput:function(){var t=g.validateEmail(this.$emailAddress.val());this.$submitButton.attr("disabled",!t)},__shareTwitterInput:function(t){t.preventDefault();var e=g.validateTwitter(this.$shareMessage.val(),this.$characterCount);this.$submitButton.attr("disabled",!e)},__replyToChange:function(t){var e=s(t.currentTarget).is(":checked");a.set("share_popover_reply_to",e,31536e3)},__submitKeydown:function(t){13===t.keyCode&&(t.ctrlKey||t.metaKey||t.altKey)&&(t.preventDefault(),t.stopPropagation(),this.submitForm())},__submit:function(){return this.submitForm(),!1},__submitSuccess:function(){this.$status.show(),this._fadeoutPopover()},__submitError:function(){this.$errorStatus.html(this.errorText),this.$submitButton.html(this.$submitButton.data("label")),this.$submitButton.attr("disabled",!1),this.$errorStatus.addClass("active")},__suspendKeyCommands:function(){r.trigger("keycommands:suspend indashblog:keycommands:suspend")},__resumeKeyCommands:function(){r.trigger("keycommands:resume indashblog:keycommands:resume")},__checkIfPremiumPost:function(){var t=s("[data-id="+this.options.popoverData.post_id+"]").data("json");if(t&&t.pt){var e=new d(t),i=this.loggingData({userAction:"share"});i&&i.modelData&&(i.modelData=e.toJSON()),r.trigger("useraction:explore_click:share",{model:e,loggingData:i})}},_shareTwitter:function(){!this.options.forceSocialFallback&&this.twitterUsername?(this.$serviceCancel.show(),this.$submitButton.html("Tweet"),this.$shareForm.data("type","twitter"),this.$shareLabel.text("@"+this.twitterUsername),this.$shareMessage.val(" [URL]"),this.$shareForm.addClass("active"),this.$shareOptions.removeClass("active"),this.$shareMessage.get(0).setSelectionRange(0,0),this.$shareMessage.attr("placeholder",""),this.$submitButton.attr("disabled",!1),this.$shareForm.addClass("twitter"),g.validateTwitter(this.$shareMessage.val(),this.$characterCount),this.$shareForm.hasClass("active")&&(this.$shareMessage.focus(),this.$shareMessage.get(0).setSelectionRange(0,0))):this._shareTwitterFallback()},_shareTwitterFallback:function(){var t=this.tinyUrl||this.url||this.model.get("url");window.open("https://twitter.com/intent/tweet?url="+encodeURIComponent(t),"twitter-share-dialog","width=626,height=258");var e=this._getGenericShareData();this.model.shareTwitter(e),this.resetAndHide()},_shareFacebook:function(){!this.options.forceSocialFallback&&this.hasFacebook?this.model.facebookStatus().done(n.bind(this._shareFacebookSuccess,this)).fail(n.bind(this._shareFacebookFallback,this)):this._shareFacebookFallback()},_shareFacebookSuccess:function(t){t?(this.$serviceCancel.show(),this.$submitButton.html(this.$submitButton.data("label")),this.$shareForm.data("type","facebook"),this.$shareLabel.text(t),this.$submitButton.attr("disabled",!1),this.$shareForm.addClass("facebook"),this.$shareOptions.toggleClass("active"),this.$shareForm.toggleClass("active"),this.$shareForm.hasClass("active")&&this.$shareMessage.focus()):this._shareFacebookFallback()},_shareFacebookFallback:function(){var t=this.url||this.model.get("url");window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t),"facebook-share-dialog","width=626,height=436");var e=this._getGenericShareData();this.model.shareFacebook(e),this.resetAndHide()},_sharePinterest:function(){var t=this.model.get("pinterest_share_window");window.open(t.url,t.name,t.dimensions);var e=this._getGenericShareData();this.model.sharePinterest(e),this.resetAndHide()},_shareReddit:function(){window.open("https://reddit.com/submit?url="+this.model.get("post_url"),"reddit-share-dialog","scrollbars=1,width=860,height=600");var t=this._getGenericShareData();this.model.shareReddit(t),this.resetAndHide()},_toggleEmailForm:function(){return this.options.forceEmailFallback||!this.model.get("tumblelog_share")&&!this.model.get("has_user")?void this._emailFormFallback():(this.$submitButton.html(this.$submitButton.data("label")),this.$shareForm.data("type","email"),this.$shareOptions.toggleClass("active"),this.$shareForm.toggleClass("active"),this.$replyTo.addClass("active"),void(this.$shareForm.hasClass("active")&&this.$emailAddress.length&&this.$emailAddress.focus()))},_emailFormFallback:function(){var t=this._getGenericShareData();this.model.shareEmail(t);var e="mailto:?body="+this.url;if(this.model.get("embed_key")){var i=window.open();i.document.write('<html><script>location.href = "'+e+'";setTimeout(function(){window.close();},500);</script></html>'),i.document.close()}else window.location.href=e;this.resetAndHide()},_showEmbedCode:function(){this.$serviceCancel.show(),this.$shareForm.data("type","embed"),this.$shareLabel.text(this.$shareLabel.data("embed-label")),this.$shareForm.addClass("active"),this.$shareOptions.removeClass("active"),this.$shareMessage.attr("placeholder",""),this.$shareForm.addClass("embed");var t=this.$shareForm.find(".embed_code_text");t.length&&(t.click(function(){t.select()}),setTimeout(function(){t.trigger("click")},100))},_fadeoutPopover:function(){setTimeout(n.bind(function(){this.$el.fadeOut(150,n.bind(this.resetAndHide,this))},this),1250)},_cancelOrClose:function(){var t=this.$emailAddress.val()||"";"email"===this.$shareForm.data("type")&&t.length?(this.$emailAddress.val(""),this.$submitButton.attr("disabled",!0)):this.resetForm()},_getGenericShareData:function(){return[{name:"post_id",value:this.model.get("post_id")},{name:"tumblelog_name",value:this.model.get("tumblelog_name")},{name:"share_fallback",value:!0}]},initialize:function(t){this.options=n.extend({},this.defaults,t),this.model=new u(this.options.popoverData),this.listenTo(this.model,"error",this.__submitError),this.listenTo(this.model,"success",this.__submitSuccess)},cacheSelectors:function(){this.$shareForm=this.$(".share_form"),this.$shareLabel=this.$(".share_label"),this.$replyTo=this.$(".reply_to"),this.$shareOptions=this.$(".share_options"),this.$submitButton=this.$("button.email_submit"),this.$emailAddress=this.$(".email_address"),this.$shareMessage=this.$(".share_message"),this.$embedCode=this.$(".embed_code_text"),this.$characterCount=this.$(".character_count"),this.$serviceCancel=this.$(".cancel.service"),this.$status=this.$(".status"),this.$errorStatus=this.$(".error_status"),this.$statusMessage=this.$(".status_message"),this.$replyToInput=this.$(".reply_to_input"),this.sentText=this.$status.data("sent")||"",this.errorText=this.$status.data("error")||"",this.$(".share_twitter").length&&(this.twitterUsername=this.$(".share_twitter").data("twitter-username")),this.$(".share_facebook").length&&(this.hasFacebook=this.$(".share_facebook").data("has-facebook")),this.url=this.$shareOptions.data("post-url"),this.tinyUrl=this.$shareOptions.data("post-tiny-url"),this.tumblelogName=this.$shareOptions.data("tumblelog-name"),this.embedKey=this.$shareOptions.data("embed-key"),this.postId=this.$shareOptions.data("post-id"),this.rootId=this.$shareOptions.data("root-id")},render:function(){return this.delegateEvents(),this.$el.html(this.template(this.model.toJSON())),this.cacheSelectors(),this.$replyToInput.prop("checked","true"===a.get("share_popover_reply_to")),this},resetForm:function(){this.$serviceCancel.hide(),this.$submitButton.html(this.$submitButton.data("label")),this.$submitButton.attr("disabled",!0),this.$emailAddress.val(""),this.$shareMessage.val(""),this.$shareMessage.attr("placeholder",this.$shareMessage.attr("title")),this.$shareOptions.addClass("active"),this.$shareForm.removeClass("active"),this.$shareForm.removeClass("facebook"),this.$shareForm.removeClass("twitter"),this.$shareForm.removeClass("embed"),this.$status.hide(),this.$statusMessage.html(this.sentText),this.$replyTo.removeClass("active"),this.$errorStatus.removeClass("active"),this.$el.show()},resetAndHide:function(){this.resetForm(),this.teardown()},submitForm:function(){var t=this.$shareForm.serializeArray();switch(this.$shareForm.data("type")){case"facebook":this.model.shareFacebook(t);break;case"twitter":this.model.shareTwitter(t);break;default:this.model.shareEmail(t)}this.$submitButton.attr("disabled",!0),this.$submitButton.html(this.$submitButton.data("label-sending"))},teardown:function(){return this.__resumeKeyCommands(),this.$el.remove(),this}},{placeholderSupport:function(){var t=document.createElement("input");return"placeholder"in t},validateEmail:function(t){var e=/\S+@\S+\.\S+/;return e.test(t)},validateTwitter:function(t,e){var i=t.match(/\[URL\]/gi),s=i?24*i.length:0,n=140-t.length-s,o=e&&e.length?e:!1;return o&&(o.removeClass("character-limit").html(n),10>n&&o.addClass("character-limit")),!(0>n||140===n)}});t.exports=g},function(t,e,i){"use strict";function s(t){return new RegExp(t+"=([^;]+)").test(decodeURIComponent(document.cookie))}function n(t){var e=decodeURIComponent(document.cookie).match(new RegExp(t+"=([^;]+)"));return e&&e.length>1?e[1]:null}function o(t,e,i,s){"object"===("undefined"==typeof e?"undefined":h(e))&&(e=JSON.stringify(e));var n=encodeURIComponent(t)+"="+encodeURIComponent(e);if(c.isPlainObject(i)&&(s=i,i=s?s.expires:!1),s=c.extend({expires:i},u,s),s.expires instanceof Date)n+=";expires="+s.expires.toGMTString();else if("number"==typeof s.expires){var o=new Date;o.setTime(o.getTime()+1e3*s.expires),n+=";expires="+o.toGMTString()}s.path&&(n+=";path="+encodeURI(s.path)),s.secure&&(n+=";secure"),s.domain&&(n+=";domain="+encodeURI(s.domain)),document.cookie=n}function r(t){o(t,"",-1)}function a(t,e){var i=n(t);try{i=JSON.parse(i)}catch(s){return i}return e?c.get(i,e):i}function l(t,e,i,s){var n;c.isPlainObject(e)?(s=i,n=e):(n=a(t)||{},c.isPlainObject(n)||(n={}),c.set(n,e,i)),o(t,JSON.stringify(n),s)}var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},c=i(3),u={path:"/",secure:!1,domain:""},d={has:s,get:n,set:o,unset:r,getHash:a,setHash:l};t.exports=d},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="popover popover_menu popover_gradient popover_share_social"><div class="popover_inner"><ul class="share_options active" data-tumblelog-name="'+__e(tumblelog_name)+'" data-post-id="'+__e(post_id)+'" data-root-id="'+__e(root_id)+'" data-post-url="'+__e(post_url)+'" data-post-tiny-url="'+__e(post_tiny_url)+'" data-embed-key="'+__e(embed_key)+'" data-embed-did="'+__e(embed_did)+'"> ',is_private||(__p+=" ",show_permalink&&(__p+=' <li class="share_permalink popover_menu_item"><a class="popover_menu_item_anchor" data-share-type="permalink" href="'+__e(post_url)+'" target="_blank" class="external" title="'+__e(permalink_label)+'" rel="noopener"> '+__e(permalink_label)+' <i class="icon icon_arrow_carrot_right"></i></a></li> '),
  __p+=" ",show_embed&&(__p+=' <li class="embed_post popover_menu_item"><a class="popover_menu_item_anchor" data-share-type="embed" href="#">'+__e(__("Embed"))+"</a></li> "),__p+=" ",show_email&&(__p+=' <li class="share_email popover_menu_item"><a class="popover_menu_item_anchor" data-share-type="email" href="#">'+__e(__("Email"))+"</a></li> "),__p+=" ",show_twitter&&(__p+=' <li class="share_twitter popover_menu_item" data-twitter-username="'+__e(twitter_username)+'"><a class="popover_menu_item_anchor" data-share-type="twitter" href="#">'+__e(__("Twitter"))+"</a></li> "),__p+=" ",show_facebook&&(__p+=' <li class="share_facebook popover_menu_item" data-has-facebook="'+(null==(__t=has_facebook?"1":"")?"":__t)+'"><a class="popover_menu_item_anchor" data-share-type="facebook" href="#">'+__e(__("Facebook"))+"</a></li> "),__p+=" ",show_pinterest&&(__p+=' <li class="share_pinterest popover_menu_item"><a class="popover_menu_item_anchor" data-share-type="pinterest" href="#">'+__e(__("Pinterest"))+"</a></li> "),__p+=" ",show_reddit&&(__p+=' <li class="share_reddit popover_menu_item"><a class="popover_menu_item_anchor" data-share-type="reddit" href="#">'+__e(__("Reddit"))+"</a></li> "),__p+=" ",show_flagging&&(__p+=' <li class="flag_post popover_menu_item"><a class="popover_menu_item_anchor" href="#">'+__e(__("Report this post"))+"</a></li> "),__p+=" ",show_reporting_links&&(__p+=' <li class="popover_menu_item"><a class="popover_menu_item_anchor" target="_blank" href="'+__e(abuse_url)+'">'+__e(__("Report Abuse"))+"</a></li> "),__p+=" "),__p+=" </ul> ",is_private||(__p+=' <form method="post" class="share_form email_form" id="share_email_'+__e(post_id)+'" novalidate><div class="form_wrapper"><div class="share_label" data-embed-label="'+__e(__("Embed"))+'"></div><span class="cancel service icon_arrow_thin_left"></span><div class="input_group"><ul><li><input type="email" class="email_address" name="email_address" maxlength="100" placeholder="'+__e(__("Email"))+'" title="'+__e(__("Email"))+'"> <input type="hidden" name="post_id" value="'+__e(post_id)+'"> <input type="hidden" name="tumblelog_name" value="'+__e(tumblelog_name)+'"> <span class="cancel icon_close"></span></li><li><textarea name="message" class="share_message" maxlength="255" placeholder="'+__e(__("Message (Optional)"))+'" title="'+__e(__("Message (Optional)"))+'"></textarea><div class="character_count">140</div></li></ul></div> ',show_embed&&(__p+=' <div class="embed_code_wrapper"><textarea name="embed_code" class="embed_code_text" spellcheck="false" readonly="readonly">'+__e(embed_code)+"</textarea></div> "),__p+=" ",has_user&&(__p+=' <div class="reply_to" title="'+__e(__("Let them reply to"))+'"><div class="menu_item_option"><label class="binary-switch"><input type="checkbox" id="allow_reply_to_'+__e(post_id)+'" class="reply_to_input" name="allow_reply_to"> <span class="binary-switch-track"></span> <span class="binary-switch-button"></span></label></div><label class="menu_item_label" for="allow_reply_to_'+__e(post_id)+'"> '+(null==(__t=__("Let them reply to <span>"))?"":__t)+" </label></div> "),__p+=' <div class="error_status"></div><button type="submit" class="tx-button blue email_submit" data-label-sending="'+__e(__("Sending..."))+'" data-label="'+__e(__("Send"))+'" disabled="disabled">'+__e(__("Send"))+'</button></div></form><div class="status" data-sent="'+__e(__("Sent!"))+'" data-error="'+__e(__("Error!"))+'"><span class="status_message">'+__e(__("Sent!"))+"</span></div> "),__p+=" </div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(113),r=i(99),a=i(107),l=i(275),h=o.extend({url:function(){return"/svc/post/share/"+this.get("tumblelog_name")+"/"+this.get("post_id")},parse:function(t){return!n.isUndefined(t)&&n.has(t,"response")?n.result(t.response,"share_popover_data")||{}:{}},hostname:function(){var t=r.get("Context/hosts");return n.isEmpty(t)?"http://www.tumblr.com":t.www_host},defaults:{abuse_url:"",embed_code:"",embed_did:"",form_key:s("#tumblr_form_key").attr("content"),has_facebook:!1,has_user:!1,is_private:!1,permalink_label:"",post_id:"",post_tiny_url:"",post_url:"",root_id:"",show_email:!0,show_embed:!0,show_facebook:!0,show_permalink:!0,show_pinterest:!0,show_reporting_links:!0,show_twitter:!0,show_reddit:!0,show_flagging:!0,tumblelog_name:"",twitter_username:"",embed_key:"",pinterest_share_window:{},tumblelog_share:!1},initialize:function(t){this.get("embed_code")||this.set("embed_code",new l(this.toJSON()).getCode()),a.bool("enable_share_embed_code")||this.set("show_embed",!1),a.bool("reddit_sharing")||this.set("show_reddit",!1)},shareEmail:function(t){return this.get("tumblelog_share")?this.share("/svc/email_tumblelog",t):this.share("/svc/share/email",t)},shareTwitter:function(t){return this.get("tumblelog_share")?void 0:this.share("/svc/share/twitter",t)},shareFacebook:function(t){return this.get("tumblelog_share")?void 0:this.share("/svc/share/facebook",t)},sharePinterest:function(t){return this.share("/svc/share/pinterest",t)},shareReddit:function(t){return this.share("/svc/share/reddit",t)},facebookStatus:function(){return s.ajax({url:this.hostname()+"/svc/facebook_status",type:"post",data:{form_key:this.get("form_key")}})},share:function(t,e){return e=e||[],e.push({name:"form_key",value:this.get("form_key")}),s.ajax({url:this.hostname()+t,type:"post",data:e,success:n.bind(function(){this.trigger("success")},this),error:n.bind(function(){this.trigger("error")},this)}),this}});t.exports=h},function(t,e,i){"use strict";var s=i(3),n=i(143),o=i(276),r=i(99),a=n.extend({name:"PostEmbedCodeGenerator",defaults:{embed_host:"//embed.tumblr.com",secure_assets_host:"https://assets.tumblr.com",tumblelog_mention_key:"",post_id:"",post_url:"",embed_key:"",embed_did:""},initialize:function(t){this.options=s.extend({},this.defaults,t);var e=r.get("Context/hosts");e&&(e.embed_host&&(this.options.embed_host=e.embed_host),e.secure_assets_host&&(this.options.secure_assets_host=e.secure_assets_host)),this.template=o},getCode:function(){return this.template(this.options)}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+="undefined"!=typeof language&&"undefined"!=typeof width?' <div class="tumblr-post" data-href="'+__e(embed_host)+"/embed/post/"+__e(embed_key)+"/"+__e(post_id)+'" data-did="'+__e(embed_did)+'" data-language="'+__e(language)+'" data-width="'+__e(width)+'"><a href="'+__e(post_url)+'">'+__e(post_url)+"</a></div> ":"undefined"!=typeof language?' <div class="tumblr-post" data-href="'+__e(embed_host)+"/embed/post/"+__e(embed_key)+"/"+__e(post_id)+'" data-did="'+__e(embed_did)+'" data-language="'+__e(language)+'"><a href="'+__e(post_url)+'">'+__e(post_url)+"</a></div> ":"undefined"!=typeof width?' <div class="tumblr-post" data-href="'+__e(embed_host)+"/embed/post/"+__e(embed_key)+"/"+__e(post_id)+'" data-did="'+__e(embed_did)+'" data-width="'+__e(width)+'"><a href="'+__e(post_url)+'">'+__e(post_url)+"</a></div> ":' <div class="tumblr-post" data-href="'+__e(embed_host)+"/embed/post/"+__e(embed_key)+"/"+__e(post_id)+'" data-did="'+__e(embed_did)+'"><a href="'+__e(post_url)+'">'+__e(post_url)+"</a></div> ",__p+=' <script async src="'+__e(secure_assets_host)+'/post.js"></script>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(113),r=i(109),a=i(119),l=i(142),h=i(275),c=i(100),u=o.extend({defaults:{},endpoints:{like:"/svc/like",unlike:"/svc/unlike",reblog:"/fast_reblog",reply:"/svc/reply",publish:"/publish",queue:"/publish",destroy:"/svc/post/delete",promote:"/svc/promote",unpromote:"/svc/unpromote",answer:"/answer",deny:"/deny_submission",approve:"/approve_submission",remove_source:"remove_app_attribution"},initialize:function(t){this._createPostTumblelogModel("tumblelog",this.get("tumblelog-data")),this._createPostTumblelogModel("parentTumblelog",this.get("tumblelog-parent-data")),this._createPostTumblelogModel("rootTumblelog",this.get("tumblelog-root-data"))},_createPostTumblelogModel:function(t,e){t=t||"tumblelog",e=e||!1;var i=!1;e&&e.name&&(i=new a(s(e).omit(s.isUndefined).omit(s.isNull).value())),this[t]=i},_setTumblelog:function(){this.tumblelog=new a(s({name:this.get("tumblelog"),ignoring:!1,sponsor:this.get("sponsored"),following:this.get("following"),mention_key:this.get("tumblelog_mention_key")}).omit(s.isUndefined).omit(s.isNull).value())},_setReblogTumblelog:function(){var t=this.get("reblog_source");t&&t.name&&(this.reblogTumblelog=new a(s({name:t.name,ignoring:!1,following:t.following}).omit(s.isUndefined).omit(s.isNull).value()))},getRootTumblelogUuid:function(){return this.get("tumblelog-root-data")?this.get("tumblelog-root-data").uuid:this.get("tumblelog-data")?this.get("tumblelog-data").uuid:this.get("reblogged_root_uuid")||this.get("tumblelog_uuid")},_xhrRequest:function(t,e,i){i.init&&i.init();var o=n.ajax({data:e,type:"POST",url:t,withFormKey:!0});return o.done(s.bind(function(t){i[200]&&i[200].call(this,t)},this)),o.fail(s.bind(function(t){i[t.status]&&i[t.status].call(this,t.status)},this)),o.always(s.bind(function(){i.always&&i.always()},this)),o},_xhrSuccess:function(t){this.trigger(t+":success")},_xhrFailure:function(t){l.alert(c("Sorry, we seem to be having technical trouble.  Please try again later.")),this.trigger(t+":failure")},_xhrForbidden:function(t){this.trigger(t+":forbidden")},_setCarouselIndex:function(t){return this.get("is_carousel")?s.extend(t,{offset:this.get("carousel_index")}):t},save:function(t,e,i){if(i||(i={}),this.endpoints[t]){var n={200:s.bind(this._xhrSuccess,this,t),401:s.bind(this._xhrFailure,this,t),404:s.bind(this._xhrFailure,this,t),403:s.bind(this._xhrForbidden,this,t),500:s.bind(this._xhrFailure,this,t)};return this._xhrRequest(this.endpoints[t],e,s.defaults(i,n))}throw new Error("Missing endpoint url for "+t)},like:function(t){if(!this.get("is_mine")){if(this.get("liked")===!1){this.set("liked",!0);var e=this.likePayload(t,this.getLikeSource("like"));this.save("like",{data:e})}this.trigger("like:set",this),r.trigger("post:like:set",this.get("id"),this,t)}},unlike:function(){if(this.get("liked")===!0){this.set("liked",!1);var t=this.likePayload("mouse",this.getLikeSource("unlike"));this.save("unlike",{data:t})}this.trigger("unlike:set",this),r.trigger("post:unlike:set",this.get("id"))},toggleLike:function(){this.get("liked")?this.unlike():this.like()},getLikeSource:function(t){t=t||"like";var e="LIKE_";switch(t){case"unlike":e="UNLIKE_";break;case"reply":e="REPLY_";break;case"ignore":e="IGNORE_"}var i=location.pathname;return i.match(/^\/dashboard/)?e+"SOURCE_DASHBOARD":i.match(/^\/tagged/)?e+"SOURCE_TAG_PAGE":i.match(/^\/likes/)?e+"SOURCE_LIKES_PAGE":i.match(/^\/inbox/)?e+"SOURCE_INBOX":i.match(/^\/search/)?e+"SOURCE_SEARCH_RESULTS_PAGE":i.match(/^\/explore/)?e+"SOURCE_DISCOVER":i.match(/^\/tv/)?e+"SOURCE_TV":i.match(/^\/indash_blog\/peepr/)?e+this.getPeeprSource():e+"SOURCE_UNKNOWN"},getPeeprSource:function(){if(window.parent&&window.parent.location){var t=window.parent.location.pathname;if(t.match(/search/))return"SOURCE_SEARCH_PEEPR"}return"SOURCE_PEEPR"},getEmbedCode:function(t,e){var i={embed_key:this.get("embed_key"),embed_did:this.get("embed_did"),post_id:this.get("id"),post_url:this.get("post_url")};t&&(i.language=t),e&&(i.width=e);var s=new h(i);return s.getCode()},likePayload:function(t,e){t=t||"mouse",e=e||"LIKE_SOURCE_UNKNOWN";var i={id:this.get("id"),root_id:this.get("root_id"),key:this.get("reblog_key"),placement_id:this.get("placement_id")||!1,is_recommended:this.get("is_recommended")||"",pt:this.get("pt"),method:t,source:e};return this._setCarouselIndex(i)},reblog:function(t){t=s.extend({},t,{reblogId:this.get("id"),reblogKey:this.get("reblog_key"),pt:this.get("pt")}),r.trigger("postForms:reblog",t)},fastReblog:function(t){t||(t=!1),this.trigger("fastreblog:success",t),r.trigger("post:fastreblog:set",{model:this});var e={reblog_key:this.get("reblog_key"),reblog_post_id:this.get("id"),queue:t,pt:this.get("pt")};e=this._setCarouselIndex(e);var i={200:s.bind(function(e){this.set("reblogged",!0),this.trigger("fastreblog:ajax:success",e.response);var i={model:this.clone(),toastOptions:{type:t?"queue":"selfReblog",avatar:e.response.post_tumblelog.avatar,fromTumblelogName:e.response.post_tumblelog.name_or_id}};r.trigger("post:fastReblog:showtoast",i)},this)};this.save("reblog",e,i)},reply:function(t){var e={reply_text:t,post_id:this.get("id"),tumblelog:this.get("tumblelog"),tumblelog_key:this.get("tumblelog-key")||this.get("tumblelog_key"),source:this.getLikeSource("reply")},i={200:s.bind(function(){this.trigger("replied")},this)};return this.save("reply",{data:e},i)},destroy:function(){var t={post_id:this.get("id"),channel_id:this.get("tumblelog")};this.save("destroy",t)},publish:function(){var t=this.save("publish",{id:this.get("id")});t.fail(s.bind(function(t){this.trigger("publish:failure",n.parseJSON(t.responseText))},this))},promote:function(t){var e={tag:t,post_id:this.get("id"),reblog_key:this.get("reblog_key"),tumblelog_name:this.get("tumblelog")};return this.save("promote",e)},unpromote:function(t){var e={tag_id:t,post_id:this.get("id"),reblog_key:this.get("reblog_key"),tumblelog_name:this.get("tumblelog")};return this.save("unpromote",e)},queue:function(){var t={id:this.get("id"),queue:"queue"};this.save("queue",t)},removeSource:function(){var t={post_id:this.get("id"),tumblelog_id:this.get("tumblelog")};return this.save("remove_source",t)},approve:function(t){var e={id:this.get("id"),queue:t};return this.save("approve",e)},deny:function(){return this.save("deny",{pid:this.get("id")})},answer:function(t){var e={post_id:this.get("id"),tumblelog:this.get("tumblelog"),key:this.get("tumblelog-key"),answer_text:t};return this.save("answer",e)},embedFocus:function(){this.trigger("embed:focus",this)},updateReblogControl:function(t){this.trigger("reblog:success",t)},dismiss:function(){this.trigger("dismiss",this)}});t.exports=u},function(t,e,i){"use strict";var s=i(3),n=i(115),o=new n({loggingData:function r(t){var r={};return!s.isEmpty(this.model)&&s.isFunction(this.model.toJSON)&&(r.modelData=this.model.toJSON()),s.isObject(t)&&(r=s.extend(r,t)),r}});t.exports=o},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(148),r=i(109),a=i(108),l=i(149).transition,h=i(280),c={TOP:1,BOTTOM:2,LEFT:4,RIGHT:8,CENTER:16},u=o.extend({className:"tour_guide",template:h,events:{"click .glass":"_onHide","click .ok_button":"_onDismiss"},_onDismiss:function(t){this.trigger("dismiss"),this._onHide(t)},_onHide:function(t){t.preventDefault(),this.hide(),this.trigger("hide")},_onScroll:function(t){n.get(this.config,"isFadeOnScroll",!0)&&(this.scrollPosition=t,this.isDim&&this.fadeGlass())},initialize:function(t){this.$body=s("body"),this.$highlighted=s(),this.$glass=s(),this.$popover=s(),this.isDim=!1,this.isOpen=!1,this.openScrollPosition=0,this.highlightedClass="",this.scrollPosition=a.rect(),this.listenTo(r,"DOMEventor:flatscroll",this._onScroll)},setHighlighted:function(t,e){this.$highlighted=t,this.highlightedClass=e},show:function(t){return this.config=t,this.$el.html(this.template(t)),this.$body.addClass("tour_guide_open").append(this.$el),this.isOpen=!0,this.config.pinnedTarget&&(this.$highlighted=s(this.config.pinnedTarget)),this.config.highlightedClass&&(this.highlightedClass=this.config.highlightedClass),this.config.glass&&(this.$el.addClass("dim"),this.isDim=!0),this.config.name&&this.$body.attr("data-help-popover",this.config.name),this.config.glass&&this.$highlighted.length&&this.$highlighted.addClass("tour_guide_element").addClass(this.highlightedClass),this.$highlighted.length?this.openScrollPosition=this.scrollPosition.windowScrollTop:this.openScrollPosition=this.scrollPosition.windowScrollTop+.5*this.scrollPosition.windowHeight,this.$glass=this.$(".glass"),this.$popover=this.$(".popover"),this.config.className&&this.$popover.addClass(this.config.className),this.delegateEvents(),this.positionPopover(),this},hide:function(){this.$el.addClass("removing"),this.$body.addClass("help-popover-removing"),l(this.$el,this.remove.bind(this))},remove:function(){this.undelegateEvents(),this.isDim=!1,this.isOpen=!1,this.config=null,this.$el.removeClass("dim removing").remove(),this.$body.removeClass("tour_guide_open help-popover-removing").removeAttr("data-help-popover"),this.$highlighted.length&&(this.$highlighted.off(".tour_guide_highlighted").removeClass("tour_guide_element").removeClass(this.highlightedClass),this.$highlighted=s(),this.highlightedClass=""),this.trigger("removed")},fadeGlass:function(){var t=(this.openScrollPosition-this.scrollPosition.windowScrollTop)/this.scrollPosition.windowHeight,e=t>0?1-t:t+1;return 0>=e?(this.isDim=!1,this.hide(),void this.trigger("hide")):void this.$glass.css("opacity",e)},positionPopover:function(){if(this.$popover.length){var t=this.$popover.outerHeight(!0),e=this.$popover.outerWidth(!0);if(this.$highlighted.length){var i,n,o=this.config.position,r=this.$highlighted.offset(),a=this.$highlighted.outerWidth(),l=r.left,h=r.top,u=h-t<this.scrollPosition.windowScrollTop+80;if(o||(o=c.CENTER|u?c.BOTTOM:c.TOP),o&c.LEFT?(n=l,this.$popover.addClass("horizontal-left")):o&c.RIGHT?(n=l-e+a,this.$popover.addClass("horizontal-right")):(n=l-.5*(e-a),this.$popover.addClass("horizontal-center")),this.$popover.css("left",n),this.config.fixed_position)return this.$popover.css("position","fixed"),void(s("#site_notice").length&&this.$popover.css("margin-top","+="+s("#site_notice").outerHeight()+"px"));o&c.TOP?(i=h-t,this.$popover.addClass("vertical-top")):(i=h+this.$highlighted.outerHeight(),this.$popover.addClass("vertical-bottom")),this.$popover.css("top",i)}else this.$popover.addClass("centered").css({top:.5*this.scrollPosition.windowHeight-.5*t,left:.5*this.scrollPosition.windowWidth-.5*e})}},getPopoverElement:function(){return this.$popover?this.$popover.get(0):void 0},getGlassElement:function(){return this.$glass}},{POSITION:c});t.exports=u},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)"undefined"!=typeof template&&"standard"===template?(__p+=' <div class="popover tutorial '+__e(name)+'_step"> ',"undefined"!=typeof title&&(__p+=' <h3 class="title">'+(null==(__t=title)?"":__t)+"</h3> "),__p+=' <p class="content">'+__e(content)+"</p> ","undefined"!=typeof ok_text&&(__p+=' <button class="chrome blue ok_button" type="button">'+__e(ok_text)+"</button> "),__p+=" </div> "):"undefined"!=typeof template&&"appearance"===template&&(__p+=' <div class="popover tutorial '+__e(name)+'_step"><div class="popover_inner"> ',"undefined"!=typeof title&&(__p+=' <h3 class="title">'+(null==(__t=title)?"":__t)+"</h3> "),__p+=' <p class="content">'+__e(content)+'</p></div><div class="appearance small" style="background-color:'+__e(appearance_data.global_theme_params.background_color)+"; color:"+__e(appearance_data.global_theme_params.background_color)+'"><div class="navigation"><a class="chrome edit_button" href="/settings/blog/'+__e(appearance_data.name)+'">'+__e(edit_text)+'</a></div><div class="header_image" style="background-image:url('+__e(appearance_data.global_theme_params.header_image_focused)+')"></div><div class="avatar '+__e(appearance_data.global_theme_params.avatar_shape)+'" style="background-image:url('+__e(appearance_data.avatar_url)+')"><img src="'+__e(appearance_data.avatar_url)+'" alt=""></div><div class="info" style="color:'+__e(appearance_data.global_theme_params.title_color)+'"> ',appearance_data.title&&(__p+=' <h1 class="title" style="font-weight:'+__e(appearance_data.global_theme_params.title_font_weight)+'">'+__e(appearance_data.title)+"</h1> "),__p+=" ",appearance_data.description&&(__p+=' <div class="description"><p class="description_inner">'+__e(appearance_data.description)+"</p></div> "),__p+=" </div></div></div> "),__p+=' <div class="glass blue"></div>';return __p}.toString()).apply(void 0,_values(_imports))},,,function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(120),r=i(284),a=2e3,l=i(144),a=2e3,h=function(t,e,i){this.name="EmbedError",this.message=t,this.input=e,this.data=i,this.stack=(new Error).stack};h.prototype=new Error;var c=l.extend({constructor:function(t){this.setEmbedRegexes(t||[])},setEmbedRegexes:function(t){this.regexes=t,this.services=s.unique(s.values(t))},isValidEmbedService:function(t){return s.any(this.regexes,function(e,i){return new RegExp(i,"mi").test(t)})},isValidEmbedServiceName:function(t){return s.contains(this.services,t)},getUrlFromEmbedCode:function(t){var e=n(r.nodeFromString(t)),i=e.find("iframe[src], embed[src], script[src]").first(),s=e.find("object[data]").first();return i.attr("src")||s.attr("data")||!1},fetchEmbedData:function(t,e,i){var r=n.ajax({url:"/svc/post/get_video_data",type:"POST",withFormKey:!0,data:JSON.stringify({embed_url:t,embed_width:e})});return o(r).then(s.bind(function(n){if(s.isEmpty(n)||"false"===n||!s.isPlainObject(n))throw new h("Invalid embed response",t,n);if(n.thumbnail||i)return n;var r=s.bind(this.fetchEmbedData,this,t,e,!0);return o.promise(function(t,e){s.delay(function(){r().then(function(t){return t},function(){return n})},a)})},this))["catch"](function(t){return o.reject(t)})},parseEmbedData:function(t,e){if(!s.isString(t))throw"The input is invalid. Expected a string";var i=s.trim(t);if(this.isValidEmbedService(i))return this.fetchEmbedData(i,e);var n=this.getUrlFromEmbedCode(i);return s.isEmpty(n)?o.reject(new h("Invalid embed code",t)):o.resolve({unsupported:!0,thumbnail:!1,embed_render_context:"blank",url:n,preview_iframe:"",embed_code:t})}});t.exports=new c},function(t,e,i){"use strict";function s(t){var e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body}function n(t){var e=document.implementation.createHTMLDocument("");return e.body.appendChild(t.cloneNode(!0)),e.body}function o(t){return n(t).innerHTML}function r(t){var e,i=document.implementation.createHTMLDocument("");return i.body.innerHTML=t,e=i.body.textContent||i.body.innerText||"",e=e.trim()}t.exports={nodeFromString:s,wrapNode:n,outerHTML:o,stripTags:r}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(212),r=i(366),a=n.extend({className:"popover--gif-search",mixins:[o],defaults:{query:null},initialize:function(t){this.gifSearch=new r(s.pick(t,"collection","query","imageWidth","loadFullImageBeforeSelect","selectedImageUrl","resultLimit","loggingContext")),this.listenTo(this,"change:query",function(t,e){this.gifSearch.setQuery(e)}),this.listenTo(this.gifSearch,"all",this.trigger)},render:function(){this.gifSearch.render().$el.appendTo(this.$el)},teardown:function(){return s.result(this.gifSearch,"remove"),this.$el.remove(),this}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(7),o=i(109),r=i(143),a=i(367),l=i(401),h=function(){};h.extend=n.Model.extend,s.extend(h.prototype,n.Events);var c=new h,u=r.extend({name:"ImageSearch",selector:"body",defaults:{resultLimit:200,imageWidth:250,loadFullImageBeforeSelect:!1,query:null,selectedImageUrl:null,loggingContext:null},initialize:function(t){t=t||{},s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"collection")),s.isEmpty(this.collection)&&(this.collection=new l),this.view=new a(s.extend({eventBus:c,collection:this.collection,query:this.get("query"),imageWidth:this.get("imageWidth"),loadFullImageBeforeSelect:this.get("loadFullImageBeforeSelect"),resultLimit:this.get("resultLimit"),selectedImageUrl:this.get("selectedImageUrl"),loggingContext:this.get("loggingContext")},this.viewOptions)),this.listenTo(c,"image:select",function(t,e){this.logGifSearchEvent("select",e),this.trigger("selectImage",t.toJSON(),this.getQuery())}),this.listenTo(c,"image:impression",function(t){this.logGifSearchEvent("impression",t)}),this.listenTo(c,"gifsearch:resultChange",function(t){this.logGifSearchResultChange("search",t)}),this.listenTo(this.view,"dismiss",function(){this.trigger("dismiss")})},render:function(){return this.view.render(),this.trigger("append"),this.view},setQuery:function(t){this.view.setQuery(t)},getQuery:function(){return this.view.getQuery()},getCurrentResults:function(){return this.view.get("currentResults")},logGifSearchEvent:function(t,e){var i={popularSearch:e.model.get("popularSearchTag")?e.model.get("popularSearchTag"):null,query:this.getQuery()?this.getQuery():null,resultsIndex:this.getCurrentResults().indexOf(e.model),top:Math.round(e.$el.position().top),left:Math.round(e.$el.position().left),postBlog:e.model.get("postBlog"),postId:e.model.get("postId"),context:this.get("loggingContext")};o.trigger("gifsearch:"+t,{loggingData:i})},logGifSearchResultChange:function(t,e){var i=this.getQuery();if(i){var s={query:i,context:this.get("loggingContext")};o.trigger("gifsearch:"+t,{loggingData:s})}}});t.exports=u},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(155),r=i(368),a=i(161),l=i(372),h=i(374),c=i(392),u=i(395),d=i(400),p=o.extend({className:"gif-search-container",template:d,mixins:[a],keycommands:{"keydown:tab":"_onKeyPressTab","keydown:shift+tab":"_onKeyPressShiftTab"},subviews:{searchInput:{constructor:l,options:function(t){return{eventBus:t.eventBus,keyboardManager:t.keyboardManager,keyboardNamespace:"gifsearch:input"}}},searchResults:{constructor:h,options:function(t){return{imageWidth:t.get("imageWidth"),selectedImageUrl:t.get("selectedImageUrl"),loadFullImageBeforeSelect:t.get("loadFullImageBeforeSelect"),eventBus:t.eventBus,keyboardManager:t.keyboardManager,keyboardNamespace:"gifsearch:results"}}},searchMessage:{constructor:c,options:function(t){return{eventBus:t.eventBus}}}},defaults:{imageWidth:null,loadFullImageBeforeSelect:!0,resultLimit:200,selectedImageUrl:"",query:null,loggingContext:null,focusIndex:0,tabbingView:null},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","collection")),this.keyboardManager=new r({allowMultipleActiveViews:!0}),this.noResults=[n("Nothing turned up. Bummer."),n("Looked around but didn't see anything about that."),n("Sadly, nothing."),n("Tragically, nothing."),n("Welcome to the void. There is nothing here."),n("We found nothing. Here it isn't."),n("Couldn't find that. Please, don't be upset. Please."),n("Sincerely, we found nothing."),n("Maybe try a similar search but use different words? Dunno.")],this.listenTo(this,"change:query",this._onChangeQuery),this.listenTo(this.eventBus,"image:tag",function(t,e){this.set("query",t),this.searchInput.setValue(this.get("query"))}),this.listenTo(this.eventBus,"showHiddenResults",function(){this.searchResults.setCollection(this.get("currentResults")),this.hasResults()&&this.searchMessage.hide()})},afterRenderSubviews:function(){this.listenTo(this,"change:focusIndex",this._onChangeFocusIndex),this.listenTo(this.searchInput,"focus",this._onChangeFocusView),this.listenTo(this.searchResults,"focus",this._onChangeFocusView),this.listenTo(this.searchInput,"userQueryChanged",function(t){this.setQuery(t)}),this.loader=new u({$container:this.$el,type:"bar",classModifiers:"top",loading:!1}),s.isString(this.get("query"))&&(this._onChangeQuery(this,this.get("query")),this.searchInput.setValue(this.get("query"))),s.defer(s.bind(function(){this.rendered&&this.searchInput.focus()},this)),this._focusViews=[this.searchInput,this.searchResults],this._tabbableViews=[this.searchResults],this.keyboardManager.add("gifsearch:main",this),this.focusKeys()},beforeRemove:function(){this.keyboardManager.remove("gifsearch"),this.currentQuery&&this.currentQuery.reject()},hasResults:function(){return!(s.isEmpty(this.get("currentResults"))||s.isEmpty(this.get("currentResults").models))},dismiss:function(){this.trigger("dismiss")},_onKeyPressTab:function(t){t.preventDefault(),this._moveFocusDown()},_onKeyPressShiftTab:function(t){t.preventDefault(),this._moveFocusUp()},_moveFocusUp:function(){var t=this.get("tabbingView");t&&t.set("isFocused",!1),this.set("focusIndex",Math.max(0,this.get("focusIndex")-1))},_moveFocusDown:function(){var t=this._focusViews||[];this.set("focusIndex",Math.min(t.length-1,this.get("focusIndex")+1))},_onChangeFocusView:function(t){var e=this._focusViews,i=s.indexOf(e,t);this.set("tabbingView",s.contains(this._tabbableViews,t)?t:null),this.set("focusIndex",i)},_onChangeFocusIndex:function(t,e){var i=s.get(this._focusViews,e);this.set("tabbingView",s.contains(this._tabbableViews,i)?i:null),s.result(i,"focus")},_onChangeQuery:function(t,e){s.isString(e)&&(this.rendered&&this.loader.set("loading",!0),this.currentQuery&&this.currentQuery.reject(),this.searchResults.cancelPreloads(),this.searchResults.cancelFullImageLoads(),this.currentQuery=this.collection.fetchGifs(e,this.get("resultLimit"),this.get("loggingContext")),this.currentQuery.promise.then(s.bind(function(t){if(this.set("currentResults",t.media),this.rendered){this.loader.set("loading",!1);var e=t.get("message");e&&(e.header||e.body)?this.searchMessage.setMessage(e.header,e.body,this.hasResults()):(this.searchResults.setCollection(this.get("currentResults")),this.hasResults()?this.searchMessage.hide():this.searchMessage.setMessage("",s.sample(this.noResults),!1))}this.currentQuery=null},this)))},setQuery:function(t){this.set("query",t)},getQuery:function(){return this.get("query")}});t.exports=p},function(t,e,i){"use strict";var s=i(3),n=i(369),o=n.extend({name:"MessagingKeyboardManager",addKeyboardAccess:function(t){return s.isFunction(s.get(t,"soloKeys"))?(t.enableKeys(),t.soloKeys(!0),!0):!1},removeKeyboardAccess:function(t){return s.isFunction(s.get(t,"unSoloKeys"))?(t.disableKeys(),t.unSoloKeys(),!0):!1}});t.exports=o},function(t,e,i){"use strict";var s=i(3),n=i(143),o=i(370),r=n.extend({name:"BaseKeyboardManager",defaults:{isDebugEnabled:!1,keepInactiveItems:!0,allowMultipleActiveViews:!1},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),this.collection=new o,this.listenTo(this.collection,"add",this._onAddItem),this.listenTo(this.collection,"remove",this._onRemoveItem),this.listenTo(this.collection,"change:isActive",this._onItemActiveChange)},addKeyboardAccess:s.noop,removeKeyboardAccess:s.noop,add:function(t,e){return t&&e?this.collection.get(t)?!1:(this.get("keepInactiveItems")||this.get("allowMultipleActiveViews")||this.collection.remove(this.collection.models),this.collection.unshift({namespace:t,view:e}),this._adjustActiveStates(),!0):!1},remove:function(t){var e=this.collection.getByNamespace(t);return s.isEmpty(e)?!1:(this.collection.remove(e),this._adjustActiveStates(),!0)},toggle:function(t,e,i){return i?this.add(t,e):this.remove(t)},_onAddItem:function(t){return this.addKeyboardAccess(t.get("view"))},_onRemoveItem:function(t){return this.removeKeyboardAccess(t.get("view"))},_adjustActiveStates:function(){var t,e;0!==this.collection.length&&(t=this.collection.first(),e=this.collection.rest(),t&&t.set("isActive",!0),this.get("allowMultipleActiveViews")||s.each(e,function(t){t.set("isActive",!1)},this))},_onItemActiveChange:function(t,e){return e?this.addKeyboardAccess(t.get("view")):this.removeKeyboardAccess(t.get("view"))}});t.exports=r},function(t,e,i){"use strict";var s=i(118),n=i(371),o=s.extend({model:n,getByNamespace:function(t){return this.filter(function(e){return this._isNamespaceMatch(t,e.get("namespace"))},this)},_isNamespaceMatch:function(t,e){return t===e?!0:0===e.indexOf(t+":")}});t.exports=o},function(t,e,i){"use strict";var s=i(113),n=s.extend({idAttribute:"namespace",defaults:{namespace:null,
  view:null,isActive:!0}});t.exports=n},function(t,e,i){"use strict";var s=i(155),n=i(161),o=i(206),r=i(373),a=i(100),l=i(3),h=i(221),c=s.extend({className:"gif-search-input",template:r,mixins:[n,o],defaults:{isFocused:!1},events:{"focus [data-js-plainTextEditor]":"_onFocus","blur [data-js-plainTextEditor]":"_onBlur"},subviews:{textEditor:{constructor:h,options:function(t){return{forceSingleLine:!0,placeholder:a("Find a GIF"),syncWithModel:!1,onChange:l.debounce(l.bind(t._onUserChangeInput,t),250)}}}},initialize:function(t){t=l.extend({},t),l.extend(this,l.pick(t,"eventBus","keyboardManager","keyboardNamespace"))},afterRender:function(){this.listenTo(this,"change:isFocused",this._onChangeIsFocused)},_onChangeIsFocused:function(t,e){e?(this.keyboardManager.add(this.keyboardNamespace,this),this.trigger("focus",this)):(this.keyboardManager.remove(this.keyboardNamespace),this.trigger("blur",this))},_onUserChangeInput:function(){this.trigger("userQueryChanged",this.textEditor.getEditorValue())},focus:function(){this.textEditor.focus()},_onFocus:function(){this.set("isFocused",!0)},_onBlur:function(){this.set("isFocused",!1)},setValue:function(t){this.textEditor.setEditorValue(t)}});t.exports=c},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="textEditor"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=n.prototype,r=i(375),a=i(161),l=i(376),h=i(377),c=i(379),u=i(164),d=u.animate,p=u.hook,g=i(120),_=i(390),m=function(t){var e=Math.round(t.position().top),i=Math.round(e+t.height());return{top:e,bottom:i}},f=function(t,e){return!(e.bottom<t.top||e.top>t.bottom)},v=function(t,e){return e.bottom>=t.bottom&&e.top<=t.top},b=function(t){return{top:Math.round(t.scrollTop()),bottom:Math.round(t.scrollTop()+t.height())}},y=function(t,e){return Math.floor(e.position().top/t.height())},w=function(t){return Math.floor(t.scrollTop()/t.outerHeight(!0))},k=function(t){return Math.ceil(t.get(0).scrollHeight/t.height())},C=n.extend({className:"gif-search-results",template:l,mixins:[a,r],keycommands:{"keydown:down":"_onKeyPressDown","keydown:up":"_onKeyPressUp","keydown:enter":"_onKeyPressEnter"},subviews:{searchResults:{constructor:h,options:function(t){return{eventBus:t.eventBus,imageWidth:t.get("imageWidth"),onSelect:s.bind(t._onSubviewSelect,t),onClear:s.bind(t._onSubviewClear,t),loadFullImageBeforeSelect:t.get("loadFullImageBeforeSelect")}},collection:function(t){return t.collection}}},defaults:{renderBatchSize:50,renderBatchDelay:5,selectedImageUrl:"",imageWidth:null,loadFullImageBeforeSelect:!0,enablePreloading:!0,isPreloading:!1,preloadPollInterval:1e3,selectedView:null,isFocused:!1},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","collection","keyboardManager","keyboardNamespace")),this.keyboardViewName="searchResults"},setCollection:function(t){this.collection&&this.stopListening(this.collection),this.collection=t,this.eventBus.trigger("gifsearch:resultChange",this.collection),this.rendered&&this.render()},populatePreloadQueue:function(){this._preloadQueue=s.range(k(this.$el)),this.sortPreloadQueue()},sortPreloadQueue:function(){var t;s.isEmpty(this._preloadQueue)||(t=w(this.$el),this._preloadQueue=s.sortBy(this._preloadQueue,function(e){return Math.abs(t-e)+(t>e?.1:0)}))},clearPreloadQueue:function(){this._preloadQueue&&(this._preloadQueue.length=0)},processPreloadQueue:function(){var t,e;if(!this.get("isPreloading")){if(!this.rendered||s.isEmpty(this._preloadQueue))return void this.stopPreloadPoller();t=this._preloadQueue.shift(),e=this.getViewsAtPageIndex(t),this.set("isPreloading",!0),this.preloadSubviews(e)["finally"](s.bind(function(){this.set("isPreloading",!1)},this))["catch"](s.noop)}},startPreloadPoller:function(){this.stopPreloadPoller(),this._preloadTimer=setInterval(s.bind(this.processPreloadQueue,this),this.get("preloadPollInterval"))},stopPreloadPoller:function(){this._preloadTimer&&(clearInterval(this._preloadTimer),this._preloadTimer=null)},renderCollectionSubviews:function(t){if("searchResults"!==t)return o.renderCollectionSubviews.apply(this,arguments);var e=this.subviews[t],i=e.container||s.bind(function(){return this.$('[data-subview="'+t+'[]"]')},this),n=e.prepareView||function(i,s){var n=new e.constructor(s);return n.$el.attr("data-subview",t),i.append(n.$el),n},r=e.options||{},a=e.collection;if(s.isFunction(a)&&(a=a(this)),!a)return null;var l=this.get("renderBatchSize"),h=this.get("renderBatchDelay");this._deferredRenders=s(a.models).groupBy(function(t,e){return Math.floor(e/l)}).toArray().map(function(e,o){return s.delay(this.createCollectionSubviewRenderer(e,i,n,r,t,!!o),o*h)},this).value()},hideViews:function(t){s.each(t,function(t){t.rendered&&(t.set("isSelectable",!1),t.$el.css("opacity",0))})},animateShowViews:function(t){var e=0;s.each(t,function(t){this.animateShowView(t,100*e++)},this)},animateShowView:function(t,e,i,n){var o,r=!1;n=s.isNumber(n)?n:250,e=s.isNumber(e)?e:0,i=s.isNumber(i)?i:1e3,p(t.$el,"translateY","40px");var a=function(){r=!0,d(t.$el,"stop"),d(t.$el,{translateY:0,opacity:1},{duration:n,delay:e,complete:s.bind(function(){t.rendered&&(t.set("isSelectable",!0),t.$el.css({transform:"",opacity:""}))},this)})};i>0&&(o=setTimeout(a,i)),t.getLoadPromise().then(function(){o&&clearTimeout(o),r||a()})},beforeRender:function(){this.$el.css("visibility","hidden"),this.removeSubviews()},afterRender:function(){this.collection&&0!==this.collection.length&&(this.listenTo(this.eventBus,"image:full:loading",this.cancelPreloads),this.listenTo(this,"change:selectedView",this._onChangeSelectedView),this.listenTo(this,"change:isFocused",this._onChangeIsFocused),this._setIsFocusedDebounced=s.debounce(s.bind(this._setIsFocused,this),0),s.defer(s.bind(function(){if(this.rendered){this._deferredRenders||(this._deferredRenders=[]);var t=s.delay(s.bind(this.resetMasonry,this),this.get("renderBatchDelay")*this._deferredRenders.length);this._deferredRenders.push(t),this.scrollbar?this.scrollbar.update():this.scrollbar=new _(this.$el)}},this)))},removeSubviews:function(){return s.forEach(this._deferredRenders,clearTimeout),this._deferredRenders=[],delete this.masonry,o.removeSubviews.apply(this,arguments)},resetMasonry:function(){this.setupMasonary(),this.setupElementCaches(),this.get("enablePreloading")&&(this.populatePreloadQueue(),this.startPreloadPoller()),this.setSelectedImage(),this.setupVirtualization();var t=this.getSubviewsInBounds();this.hideViews(t),this.$el.css("visibility",""),this.animateShowViews(t)},getViewBounds:function(t){return s.result(this._elementPositionCache,t.cid)?this._elementPositionCache[t.cid]:m(t.$el)},getSubviewsInBounds:function(t){return t=t||b(this.$el),s.filter(this.searchResults,function(e){return f(this.getViewBounds(e),t)},this)},setupMasonary:function(){this.masonry?this.masonry.reload():this.masonry=new c(this.$(".results-scroller").get(0),{transitionDuration:0,isFitWidth:!0,gutter:10},this)},setupElementCaches:function(){var t=this.$el;this._pageIndexCache={},this._elementPositionCache={},s.each(this.searchResults,function(e){var i=y(t,e.$el);s.isArray(this._pageIndexCache[i])||(this._pageIndexCache[i]=[]),this._pageIndexCache[i].push(e),this._elementPositionCache[e.cid]=m(e.$el)},this)},getViewsAtPageIndex:function(t){return this._pageIndexCache[t]||[]},setupVirtualization:function(){var t=s.bind(function(){this.rendered&&(this.sortPreloadQueue(),this.virtualizeSubviews())},this),e=s.debounce(t,250);this.$el.off(".image-search-virtualization").on("scroll.image-search-virtualization",e),this.virtualizeSubviews()},setSelectedImage:function(){var t,e;if(this.get("selectedImageUrl")&&(e=s.find(this.searchResults,function(t,e){return t.model.get("mediaUrl")===this.get("selectedImageUrl")},this))){if(e.set("isPreselected",!0),t=e.$el.offset().top-this.$el.offset().top,0===t)return;t-=(this.$el.height()-e.$el.height())/2,this.$el.scrollTop(t)}},cancelPreloads:function(){this.stopPreloadPoller(),this.clearPreloadQueue()},cancelFullImageLoads:function(){this.eventBus.trigger("image:full:cancelLoad")},preloadSubviews:function(t,e){return g.all(s.map(t,function(t){return t.loadImage()}))},_virtualizeSubviews:function(t,e,i){s.forEach(this.searchResults,function(n,o){if(n&&n.$el){var r=this.getViewBounds(n);f(r,t)?s.isFunction(e)&&e.call(this,n,v(r,t)):s.isFunction(i)&&i.call(this,n)}},this)},virtualizeSubviews:function(){var t=this.$el,e={top:t.scrollTop(),bottom:t.scrollTop()+t.height()};this._virtualizeSubviews(e,function(t,e){t.set({isVirtualized:!1}),e&&t.get("isImpressionLogged")===!1&&(this.eventBus.trigger("image:impression",t),t.set("isImpressionLogged",!0))},function(t){t.set({isVirtualized:!0})})},beforeRemove:function(){this.$el.off(),this.cancelPreloads(),this.cancelFullImageLoads(),this.keyboardManager.remove(this.keyboardNamespace),this.scrollbar&&this.scrollbar.destroy()},_setIsFocused:function(t){this.rendered&&this.set("isFocused",t)},_onChangeSelectedView:function(t,e){var i=this.previous("selectedView");i&&i.setSelected(!1),e&&e.setSelected(!0)},_onChangeIsFocused:function(t,e){e?(this.keyboardManager.add(this.keyboardNamespace,this),this.trigger("focus",this)):(this.set("selectedView",null),this.keyboardManager.remove(this.keyboardNamespace),this.trigger("blur",this))},_onSubviewSelect:function(t){this.get("isFocused")||this._setIsFocused(!0),this.setSelectedIndex(this.keyboardViewName,s.indexOf(this.searchResults,t)),this.set("selectedView",this.getSelectedView(this.keyboardViewName))},_onSubviewClear:function(){this.set("selectedView",null),this.deselect(this.keyboardViewName)},focus:function(){var t=this.get("selectedView"),e=!s.isEmpty(t);this._setIsFocused(!0),e?this.setSelectedIndex(this.keyboardViewName,s.indexOf(this.searchResults,t)):this.set("selectedView",this.selectFirst(this.keyboardViewName))},isLastViewSelected:function(){return this.isLastSelected(this.keyboardViewName)},isFirstViewSelected:function(){return this.isFirstSelected(this.keyboardViewName)},_onKeyPressDown:function(t){var e;t.preventDefault(),e=this.isLastViewSelected()?this.selectFirst(this.keyboardViewName):this.selectNext(this.keyboardViewName),this.set("selectedView",e)},_onKeyPressUp:function(t){var e;t.preventDefault(),e=this.isFirstViewSelected()?this.selectLast(this.keyboardViewName):this.selectPrevious(this.keyboardViewName),this.set("selectedView",e)},_onKeyPressEnter:function(t){var e=this.get("selectedView");t.preventDefault(),e&&e.select(t)}});t.exports=C},function(t,e,i){"use strict";var s=i(3),n=i(115),o=new n({defaults:{hasSelection:function(t){return this._validateParams(t)?s.has(this._selectedIndexes,t):null},getSelectedIndex:function(t){return this._validateParams(t)?s.get(this._selectedIndexes,t,0):null},deselect:function(t){this._validateParams(t)&&this.hasSelection(t)&&delete this._selectedIndexes[t]},resetSelected:function(t){this._validateParams(t)&&this.setSelectedIndex(t,0)},setSelectedIndex:function(t,e){var i;return this._validateParams(t)?(i=s.get(this,t,[]),e=Math.max(0,Math.min(e,i.length-1)),s.set(this._selectedIndexes,t,e),e):null},getSelectedView:function(t){var e;return this._validateParams(t)?(e=s.get(this,t,[]),s.get(e,this.getSelectedIndex(t))):null},isFirstSelected:function(t){return this._validateParams(t)?0===this.getSelectedIndex(t):null},isLastSelected:function(t){var e;return this._validateParams(t)?(e=s.get(this,t,[]),this.getSelectedIndex(t)===e.length-1):null},selectFirst:function(t){var e;if(!this._validateParams(t))return null;e=s.get(this,t,[]);var i=this.setSelectedIndex(t,0);return s.get(e,i)},selectLast:function(t){var e;if(!this._validateParams(t))return null;e=s.get(this,t,[]);var i=this.setSelectedIndex(t,e.length-1);return s.get(e,i)},selectNext:function(t){var e,i;return this._validateParams(t)?this.hasSelection(t)?(e=s.get(this,t,[]),i=this._increaseSelectedIndex(t),s.get(e,i)):this.selectFirst(t):null},selectPrevious:function(t){var e,i;return this._validateParams(t)?(e=s.get(this,t,[]),i=this._decreaseSelectedIndex(t),s.get(e,i)):null},_validateParams:function(t){return!!t},_increaseSelectedIndex:function(t){return this._validateParams(t)?this.setSelectedIndex(t,this.getSelectedIndex(t)+1):null},_decreaseSelectedIndex:function(t){return this._validateParams(t)?this.setSelectedIndex(t,this.getSelectedIndex(t)-1):null}},before:{initialize:function(){this._selectedIndexes={}}}});t.exports=o},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="results-scroller" data-subview="searchResults[]"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(155),r=i(378),a=i(188),l=i(206),h=i(259),c=i(120),u=o.extend({className:"gif-search-result",tagName:"a",attributes:{href:"#",tabIndex:1},template:r,events:{"click [data-js-select]":"_onClickSelect","click [data-js-tag]":"_onClickTag",mouseenter:"_onMouseEnter",mouseleave:"_onMouseLeave"},mixins:[l],defaults:{skipTags:["gif","gifs"],imageWidth:null,isVirtualized:!0,hasStillImage:!0,isPreselected:!1,unloadImageOnVirtualize:!1,isLoaded:!1,isSelectable:!0,loadFullImageBeforeSelect:!0,loadingFullImage:!1,containerWidth:150,isImpressionLogged:!1,isSelected:!1},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","onSelect","onClear")),this._loadDefer=c.defer()},afterRender:function(){this.listenTo(this,"change:isPreselected",this._onChangeIsPreselected),this.listenTo(this,"change:isVirtualized",this._onChangeIsVirtualized),this.listenTo(this,"change:hasStillImage",this._onChangeHasStillImage),this.listenTo(this,"change:isSelectable",this._onChangeIsSelectable),this.listenTo(this,"change:isLoaded",this._onChangeIsLoaded),this.listenTo(this,"change:isSelected",this._onChangeIsSelected),this.listenTo(this.eventBus,"image:full:cancelLoad",this._onCancelAllFullImageLoads),this._onChangeIsVirtualized(this,this.get("isVirtualized")),this._onChangeHasStillImage(this,this.get("hasStillImage")),this._onChangeIsPreselected(this,this.get("isPreselected")),this._onChangeIsSelectable(this,this.get("isSelectable")),this._onChangeIsLoaded(this,this.get("isLoaded"))},getTemplateData:function(){var t=this.model.toJSON(),e=t.popularSearchTag?[t.popularSearchTag]:t.postTags,i=this.get("skipTags"),n=this.get("containerWidth"),o=Math.round(this.model.get("height")*(n/this.model.get("width")));return e=s.reject(e,function(t){return s.contains(i,t.toLowerCase())}),s.extend(t,{tags:e.slice(0,3),width:n,height:o}),this.get("imageWidth")&&s.extend(t,{mediaUrl:t.mediaUrl.replace(/_\d+\./,"_"+this.get("imageWidth")+".")}),t},loadImage:function(){var t=this.js$("img"),e=t.attr("data-img-src");return this.get("isLoaded")||(t.attr("src",e),a.load(e,100).then(s.bind(function(){this.rendered&&this.set("isLoaded",!0),this._loadDefer.resolve()},this))),this._loadDefer.promise},unloadImage:function(){this.js$("img").removeAttr("src")},refreshStillImage:function(){this._onChangeHasStillImage(this,this.get("hasStillImage"))},getLoadPromise:function(){return this._loadDefer.promise},_onCancelAllFullImageLoads:function(){this._cancelLoadFullImage()},_onClickSelect:function(t){t.preventDefault(),s.isFunction(this.onSelect)&&this.onSelect(this,this.model);var e=this.model.get("mediaUrl"),i=this.js$("img").attr("src"),n=function(){this.$el.addClass("gif-search-result--selected"),this.eventBus.trigger("image:select",this.model,this)};this.get("loadFullImageBeforeSelect")&&e!==i?this._loadFullImage(e,n):n.call(this)},select:function(t){this._onClickSelect(t)},_loadFullImage:function(t,e){this.eventBus.trigger("image:full:cancelLoad"),this.set("loadingFullImage",!0),this.eventBus.trigger("image:full:loading"),this.loader=new h({variation:"centered small",loading:!0}),this.$el.addClass("loading-full").append(this.loader.render().$el),a.load(t).then(s.bind(function(){this.get("loadingFullImage")&&s.isFunction(e)&&e.call(this)},this))["finally"](s.bind(this._cancelLoadFullImage,this))},_cancelLoadFullImage:function(){this.rendered&&this.get("loadingFullImage")&&(this.loader&&(this.loader.remove(),this.loader=null),this.$el.removeClass("loading-full"),this.set("loadingFullImage",!1))},_onClickTag:function(t){var e=n(t.target).attr("data-js-tag");this.eventBus.trigger("image:tag",e,this.model),t.preventDefault(),t.stopPropagation()},_onChangeIsPreselected:function(t,e){this.$el.toggleClass("gif-search-result--preselected",e)},_onChangeIsVirtualized:function(t,e){this.$el.toggleClass("off",e),e&&this.get("unloadImageOnVirtualize")?this.unloadImage():e||this.loadImage()},_onChangeHasStillImage:function(t,e){this._removeStillCanvas(),e&&this._prepareCreateStillCanvas()},_onChangeIsSelectable:function(t,e){this.$el.toggleClass("gif-search-result--selectable",e)},_onChangeIsLoaded:function(t,e){this.$el.toggleClass("loaded",e)},_createStillCanvas:function(){if(this.rendered){var t,e=this.js$("img"),i=e.parent(),s=parseInt(e.width(),10),o=parseInt(e.height(),10),r=n("<canvas />").attr({width:s,height:o});this.$("canvas").remove(),i.append(r),t=r.get(0).getContext("2d"),t.drawImage(e.get(0),0,0,s,o),this.$el.addClass("show-still")}},_prepareCreateStillCanvas:function(){this.getLoadPromise().then(s.bind(this._createStillCanvas,this))["catch"](s.noop)},_removeStillCanvas:function(){this.$("canvas").remove(),this.$el.removeClass("show-still")},setSelected:function(t){this.rendered&&this.set("isSelected",t)},_onChangeIsSelected:function(t,e){this.$el.toggleClass("selected",e),this.$el.focus()},_onMouseEnter:function(t){s.isFunction(this.onSelect)&&this.onSelect(this)},_onMouseLeave:function(t){s.isFunction(this.onClear)&&this.onClear(this)}});t.exports=u},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<figure data-js-select style="width: '+__e(width)+"px; height: "+__e(height)+'px"><img data-js-img data-img-src="'+__e(mediaUrl)+'" width="'+__e(width)+'" height="'+__e(height)+'"></figure><footer><nav class="tags"> ',_.each(tags,function(t){__p+=" ",_.isEmpty(t)||(__p+=' <a href="#" data-js-tag="'+__e(t)+'">#'+__e(t)+"</a> "),__p+=" "}),__p+=' </nav><a class="attribution" href="http://tmblr.co/'+__e(rootPostUrlHash)+'" target="_blank">'+__e(__("Originally posted by %1$s",rootBlog))+"</a></footer>";return __p}.toString()).apply(void 0,_values(_imports))},,,,,,,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(391),r=i(109),a=i(148),l=i(159),h=a.extend({mixins:[l],tplScrollbarWrapper:'<div class="tx-scroll"></div>',tplScrollbarTrackVertical:'<div data-js-track-vertical class="tx-scrollbar-track tx-scrollbar-track--vertical"><div data-js-thumb-vertical class="tx-scrollbar-thumb"></div></div>',tplScrollbarTrackHorizontal:'<div data-js-track-horizontal class="tx-scrollbar-track tx-scrollbar-track--horizontal"><div data-js-thumb-horizontal class="tx-scrollbar-thumb"></div></div>',defaults:{trackActiveClass:"tx-scrollbar-track--active",scrollingClass:"tx-scroll--scrolling",containerClass:"tx-scroll-container",containerClassVertical:"tx-scroll-container--vertical",containerClassHorizontal:"tx-scroll-container--horizontal",infiniteScrollPercent:.9,isScrollable:!1,isScrollableHorizontal:!1,isScrollableVertical:!1,isScrolling:!1,nativeScrollbarSize:20},events:{"mousedown [data-js-thumb-vertical]":"_onVerticalThumbMousedown","mousedown [data-js-thumb-horizontal]":"_onHorizontalThumbMousedown"},destroyed:!1,constructor:function(t){var e=this._getElementFromOptions(t);return null===e?null:(this.container=e,this.$container=n(e),s.extend(t,{el:this._getWrappedElement(e)}),a.prototype.constructor.call(this,t))},initialize:function(t){this.$window=n(window),this._onScrollStopDebounced=s.debounce(s.bind(this._onScrollStop,this),150),this._onResizeDebounced=s.debounce(s.bind(this._onResize,this),150),this.render()},render:function(){return this.rendered&&!this.destroyed?this:(this.listenTo(r,"DOMEventor:flatresize",this._onResizeDebounced),this.listenTo(this,"change:isScrollableVertical",this._onChangeIsScrollableVertical),this.listenTo(this,"change:isScrollableHorizontal",this._onChangeIsScrollableHorizontal),this.listenTo(this,"change:isScrollable",this._onChangeIsScrollable),this.update(),this.destroyed=!1,a.prototype.render.apply(this,arguments))},getVerticalTrack:function(){return this.$verticalTrack},getHorizontalTrack:function(){return this.$horizontalTrack},getVerticalThumb:function(){return this.$verticalThumb},getHorizontalThumb:function(){return this.$horizontalThumb},getScrollContainer:function(){return this.container},isScrollable:function(){return this.get("isScrollable")},isScrollableVertical:function(){return this.get("isScrollableVertical")},isScrollableHorizontal:function(){return this.get("isScrollableHorizontal")},update:function(){var t,e,i;this.destroyed||(t=this._isScrollableVertical(),e=this._isScrollableHorizontal(),i=t||e,this.set({isScrollableVertical:t,isScrollableHorizontal:e,isScrollable:i}),this._updateScrollConstants(),t&&(this._updateVerticalThumbHeight(),this._positionVerticalThumb()),e&&(this._updateHorizontalThumbWidth(),this._positionHorizontalThumb()))},remove:function(){return this.destroy()},destroy:function(){this.$container.off(".txScroll"),this.$window.off(".txScroll"),this.set({isScrollable:!1,isScrollableHorizontal:!1,isScrollableVertical:!1}),this.undelegateEvents(),this.stopListening(),this._unwrapContainer(),this.destroyed=!0},_getElementFromOptions:function(t){var e;return e=t instanceof n?t.get(0):t instanceof window.Element?t:s.get(t,"el",null)},_getWrappedElement:function(t){var e=t instanceof n?t:n(t),i=n(this.tplScrollbarWrapper);return e.wrap(i),i=e.parent(),i.get(0)},_unwrapContainer:function(){this.$container.unwrap()},_appendVerticalTrack:function(){var t=n(this.tplScrollbarTrackVertical);this.$verticalTrack=t,this.$verticalThumb=t.find("[data-js-thumb-vertical]"),this.$el.append(t)},_removeVerticalTrack:function(){var t=this.getVerticalTrack();t&&(t.remove(),delete this.$verticalTrack,delete this.$verticalThumb)},_appendHorizontalTrack:function(){var t=n(this.tplScrollbarTrackHorizontal);this.$horizontalTrack=t,this.$horizontalThumb=t.find("[data-js-thumb-horizontal]"),this.$el.append(t)},_removeHorizontalTrack:function(){var t=this.getHorizontalTrack(!0);t&&(t.remove(),delete this.$horizontalTrack,delete this.$horizontalThumb)},_onChangeIsScrollable:function(t,e){var i;this.destroyed||(i="ontouchstart"in document.documentElement,i||this.$container.off("wheel.txScroll"),this.$container.off("scroll.txScroll"),this.$container.toggleClass(this.get("containerClass"),e),e&&(this.$container.on("scroll",s.bind(this._onScroll,this)),i||this.$container.on("wheel.txScroll",s.bind(this._stealScroll,this))))},_onChangeIsScrollableVertical:function(t,e){this.destroyed||(this.$container.toggleClass(this.get("containerClassVertical"),e),e?this._appendVerticalTrack():this._removeVerticalTrack())},_onChangeIsScrollableHorizontal:function(t,e){this.destroyed||(this.$container.toggleClass(this.get("containerClassHorizontal"),e),e?this._appendHorizontalTrack():this._removeHorizontalTrack())},_updateScrollConstants:function(){var t=this.getVerticalTrack(),e=this.getHorizontalTrack(),i=this.getVerticalThumb(),s=this.getHorizontalThumb();this.currentScrollTop=this.$container.scrollTop(),this.currentScrollLeft=this.$container.scrollLeft(),this.get("isScrollableVertical")&&t&&i&&(this.percentageDifferenceVertical=(this.container.scrollHeight-this.$container.height())/(t.height()-i.height())),this.get("isScrollableHorizontal")&&e&&s&&(this.percentageDifferenceHorizontal=(this.container.scrollWidth-this.$container.width())/(e.width()-s.width()))},_onResize:function(){this.trigger("resize"),this.update()},_getAddedScrollbarHeight:function(){return this.get("isScrollableHorizontal")?this.get("nativeScrollbarSize"):0},_getAddedScrollbarWidth:function(){return this.get("isScrollableVertical")?this.get("nativeScrollbarSize"):0},_isScrollableVertical:function(){return this.container&&this.container.scrollHeight>this.$container.height()+this._getAddedScrollbarHeight()},_isScrollableHorizontal:function(){return this.container&&this.container.scrollWidth>this.$container.width()+this._getAddedScrollbarWidth()},_getScrollTop:function(t,e){return t.pageY-e.offset().top},_getScrollLeft:function(t,e){return t.pageX-e.offset().left},_onVerticalThumbMousedown:function(t){var e=this.getVerticalTrack();t.preventDefault(),e&&(e.addClass(this.get("trackActiveClass")),this.$window.on("mousemove.txScroll",s.bind(this._onVerticalThumbMousemove,this)),this.$window.on("mouseup.txScroll",s.bind(this._onVerticalThumbMouseup,this)),this.mouseDownOriginalOffsetY=this._getScrollTop(t,e),this._updateScrollConstants())},_onHorizontalThumbMousedown:function(t){var e=this.getHorizontalTrack();t.preventDefault(),e&&(e.addClass(this.get("trackActiveClass")),this.$window.on("mousemove.txScroll",s.bind(this._onHorizontalThumbMousemove,this)),this.$window.on("mouseup.txScroll",s.bind(this._onHorizontalThumbMouseup,this)),this.mouseDownOriginalOffsetX=this._getScrollLeft(t,e),this._updateScrollConstants())},_onVerticalThumbMousemove:function(t){var e,i=this.getVerticalTrack();i&&o.read(function(){this.destroyed||(e=this._getScrollTop(t,i)-this.mouseDownOriginalOffsetY,o.write(function(){this.destroyed||this.$container.scrollTop(this.currentScrollTop+e*this.percentageDifferenceVertical)},this))},this)},_onVerticalThumbMouseup:function(t){var e=this.getVerticalTrack();t.preventDefault(),e&&e.removeClass(this.get("trackActiveClass")),this.$window.off(".txScroll")},_onHorizontalThumbMousemove:function(t){var e,i=this.getHorizontalTrack();i&&o.read(function(){this.destroyed||(e=this._getScrollLeft(t,i)-this.mouseDownOriginalOffsetX,o.write(function(){this.destroyed||this.$container.scrollLeft(this.currentScrollLeft+e*this.percentageDifferenceHorizontal)},this))},this)},_onHorizontalThumbMouseup:function(t){var e=this.getHorizontalTrack();t.preventDefault(),e&&e.removeClass(this.get("trackActiveClass")),this.$window.off(".txScroll")},_updateVerticalThumbHeight:function(){var t,e=this.getVerticalThumb(),i=this.getVerticalTrack();i&&e&&(t=this.$container.height()/this.container.scrollHeight,e.height(i.height()*t))},_updateHorizontalThumbWidth:function(){var t,e=this.getHorizontalThumb(),i=this.getHorizontalTrack();i&&e&&(t=this.$container.width()/this.container.scrollWidth,e.width(i.width()*t))},_positionVerticalThumb:function(){var t,e,i,s=this.getVerticalTrack(),n=this.getVerticalThumb();!this.destroyed&&s&&n&&(i=this.container.scrollTop,t=i/(this.container.scrollHeight-this.$container.height()),e=s.height()-n.height(),o.write(function(){this.destroyed||(n.css("transform","translate3d(0, "+e*t+"px, 0)"),this.trigger("scroll:vertical",i,t),this.trigger("scroll",i,t),t>this.get("infiniteScrollPercent")&&this.trigger("infinitescroll",i,t))},this))},_positionHorizontalThumb:function(){var t,e,i,s=this.getHorizontalTrack(),n=this.getHorizontalThumb();!this.destroyed&&s&&n&&(i=this.container.scrollLeft,t=i/(this.container.scrollWidth-this.$container.width()),e=s.width()-n.width(),o.write(function(){this.destroyed||(n.css("transform","translate3d("+e*t+"px, 0, 0)"),this.trigger("scroll:horizontal",i,t))},this))},_onScroll:function(){this.get("isScrolling")||(this.trigger("scrollstart"),this.$el.addClass(this.get("scrollingClass"))),this.set("isScrolling",!0),this._onScrollStopDebounced(),this.get("isScrollableVertical")&&o.read(s.bind(this._positionVerticalThumb,this)),this.get("isScrollableHorizontal")&&o.read(s.bind(this._positionHorizontalThumb,this))},_onScrollStop:function(){this.destroyed||(this.trigger("scrollstop"),this.set("isScrolling",!1),this.$el.removeClass(this.get("scrollingClass")))},_stealScroll:function(t){var e=t.currentTarget,i=t.originalEvent.deltaX,s=t.originalEvent.deltaY,o=Math.abs(i)>0,r=Math.abs(s)>0;this.get("isScrollableHorizontal")&&o&&(0>i&&e.scrollLeft<=0&&t.preventDefault(),i>0&&e.scrollLeft>=e.scrollWidth-n(e).width()-this._getAddedScrollbarWidth()&&t.preventDefault()),this.get("isScrollableVertical")&&r&&(0>s&&e.scrollTop<=0&&t.preventDefault(),s>0&&e.scrollTop>=e.scrollHeight-n(e).height()-this._getAddedScrollbarHeight()&&t.preventDefault())}});t.exports=h},function(t,e){!function(e){"use strict";function i(){this.frames=[],this.lastId=0,this.raf=s,this.batch={hash:{},read:[],write:[],mode:null}}var s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)};window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||function(t){window.clearTimeout(t)};i.prototype.read=function(t,e){var i=this.add("read",t,e),s=i.id;this.batch.read.push(i.id);var n="reading"===this.batch.mode||this.batch.scheduled;return n?s:(this.scheduleBatch(),s)},i.prototype.write=function(t,e){var i=this.add("write",t,e),s=this.batch.mode,n=i.id;this.batch.write.push(i.id);var o="writing"===s||"reading"===s||this.batch.scheduled;return o?n:(this.scheduleBatch(),n)},i.prototype.defer=function(t,e,i){"function"==typeof t&&(i=e,e=t,t=1);var s=this,n=t-1;return this.schedule(n,function(){s.run({fn:e,ctx:i})})},i.prototype.clear=function(t){if("function"==typeof t)return this.clearFrame(t);var e=this.batch.hash[t];if(e){var i=this.batch[e.type],s=i.indexOf(t);delete this.batch.hash[t],~s&&i.splice(s,1)}},i.prototype.clearFrame=function(t){var e=this.frames.indexOf(t);~e&&this.frames.splice(e,1)},i.prototype.scheduleBatch=function(){var t=this;this.schedule(0,function(){t.batch.scheduled=!1,t.runBatch()}),this.batch.scheduled=!0},i.prototype.uniqueId=function(){return++this.lastId},i.prototype.flush=function(t){for(var e;e=t.shift();)this.run(this.batch.hash[e])},i.prototype.runBatch=function(){try{this.batch.mode="reading",this.flush(this.batch.read),this.batch.mode="writing",this.flush(this.batch.write),this.batch.mode=null}catch(t){throw this.runBatch(),t}},i.prototype.add=function(t,e,i){var s=this.uniqueId();return this.batch.hash[s]={id:s,fn:e,ctx:i,type:t}},i.prototype.run=function(t){var e=t.ctx||this,i=t.fn;if(delete this.batch.hash[t.id],!this.onError)return i.call(e);try{i.call(e)}catch(s){this.onError(s)}},i.prototype.loop=function(){var t=this,e=this.raf;this.looping||(e(function i(){var s=t.frames.shift();t.frames.length?e(i):t.looping=!1,s&&s()}),this.looping=!0)},i.prototype.schedule=function(t,e){return this.frames[t]?this.schedule(t+1,e):(this.loop(),this.frames[t]=e)},e=e||new i,"undefined"!=typeof t&&t.exports?t.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):window.fastdom=e}(window.fastdom)},function(t,e,i){"use strict";var s=i(3),n=i(393),o=i(155),r=i(394),a=o.extend({className:"gif-search-message",template:r,defaults:{header:"",body:"",hasResults:!1},events:{"click [data-js-showResults]":"_onClickShowResults"},initialize:function(t){s.extend(this,s.pick(t,"eventBus"))},_onClickShowResults:function(){this.eventBus.trigger("showHiddenResults")},_filterMessageHtml:function(t,e){
  e.find("script, link").remove(),e.find("a[onerror]").removeAttr("onerror")},getTemplateData:function(){var t=o.prototype.getTemplateData.apply(this,arguments);return t.body=n(t.body||"",this._filterMessageHtml),t},afterRender:function(){this.rendered||this.listenTo(this,"change",this.render),this.$el.toggleClass("gif-search-message--hidden",!(this.get("header")||this.get("message")))},setMessage:function(t,e,i){s.isString(e)||(e=t,t=""),s.isBoolean(i)||(i=this.get("hasResults")),this.set({header:t,body:e,hasResults:i}),e||t?this.show():this.hide()},show:function(){this.$el.removeClass("gif-search-message--hidden")},hide:function(){this.$el.addClass("gif-search-message--hidden")}});t.exports=a},function(t,e,i){"use strict";function s(t,e){var i=r.nodeFromString(t),s=o(i);return n.isFunction(e)&&(e=n.rest(arguments)),n.each(e,function(t){t(i,s)}),s.html()}var n=i(3),o=i(8),r=i(284);t.exports=s},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="gif-search-message-container"> ',header&&(__p+=' <h2 class="gif-search-message-header">'+(null==(__t=header)?"":__t)+"</h2> "),__p+=' <div class="gif-search-message-body">'+(null==(__t=body)?"":__t)+"</div> ",hasResults&&(__p+=' <p><span class="gif-search-show-results" data-js-showresults>'+__e(__("View results anyway"))+"</span></p> "),__p+=" </div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(396);t.exports=s},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(397),r=i(399),a=n.extend({className:"loader-container",template:r,defaults:{type:"",classModifiers:"",loading:!1},initialize:function(t){this.options=s.extend({},this.defaults,t),this.$container=t.$container,"bar"===this.get("type")&&this.createBarLoader(),this.listenTo(this,"change:loading",this._onChangeLoading),this.attach()},createBarLoader:function(){this.subviews.loaderType=new o(this.options)},_onChangeLoading:function(t,e){this.subviews.loaderType.toggleLoading(e)},attach:function(){this.render(),this.$el.attr("data-subview=loader"),this.$container.find("[data-subview=loader]").replaceWith(this.$el)}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(398),r=n.extend({className:"loader-bar",template:o,defaults:{classModifiers:"",loading:!1},initialize:function(t){this.options=s.extend({},this.defaults,t),this.$el.addClass(this.get("classModifiers")),this.interval=null,this.timeout=null},afterRender:function(){this.$bars=this.$el.find(".bar"),this.get("loading")===!0&&this.toggleLoading(this.get("loading"))},toggleLoading:function(t){this.currentBar=0,this.counter=0,t===!0?(clearTimeout(this.timeout),this.$el.addClass("loading"),this.$bars.addClass("animating"),this.startAnimating()):(this.$el.removeClass("loading"),this.stopAnimating(),this.timeout=setTimeout(s.bind(function(){this.$bars.removeClass("animating")},this),300))},showBar:function(t){this.$bars.eq(t).addClass("active")},hideBar:function(t){this.$bars.eq(t).removeClass("active")},loop:function(){var t=this.$bars.eq(this.currentBar);t.remove(),this.$el.append(t),this.currentBar+=1,this.currentBar>=this.$bars.length&&(this.currentBar=0),this.counter++},startAnimating:function(){this.stopAnimating(),this.loop(),this.interval=setInterval(s.bind(function(){this.loop()},this),300)},stopAnimating:function(){clearInterval(this.interval)},beforeRemove:function(){clearInterval(this.interval),clearTimeout(this.timeout)}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="bar white"></div><div class="bar red"></div><div class="bar orange"></div><div class="bar green"></div><div class="bar purple"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="loader-type" data-subview="loaderType"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="searchInput"></div><div data-subview="loader"></div><div data-subview="searchResults"></div><div data-subview="searchMessage"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(120),o=i(118),r=i(402),a=3e5,l=o.extend({model:r,resultCountForQuery:function(t){t=(t||"").toLowerCase().trim();var e=this.get(t);return e?e.media.length:0},fetchGifs:function(t,e,i,o){var l,h=n.defer();t=(t||"").toLowerCase().trim();var c=this.get(t);return c||(c=new r({query:t,limit:e,loggingContext:i}),this.add(c)),!o&&s.now()-c.get("ts")<a?(this.trigger("search",t,!0),h.resolve(c)):(this.trigger("search",t,!1),l=c.fetch({success:function(){l=null,h.resolve(c)},error:function(t){l=null,h.reject(t)}})),h.promise["catch"](function(){l&&l.abort()}),h},clearCache:function(t){this.remove(t)}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(113),o=n.prototype,r=i(403),a=function(t,e,i){this.name="EmbedError",this.message=t,this.input=e,this.data=i,this.stack=(new Error).stack},l=n.extend({idAttribute:"query",url:"/svc/search/inline_gif",defaults:{query:"",limit:200,loggingContext:null},initialize:function(t,e){this.media=new r},fetch:function(t){var e=this.get("loggingContext"),i={q:this.get("query"),limit:this.get("limit")};return s.isEmpty(e)||s.extend(i,{context:e}),t=s.extend({type:"POST",withFormKey:!0,data:i},t),o.fetch.call(this,t)},parse:function(t,e){if(e&&e.xhr&&(t=(t||{}).response),s.isEmpty(t))throw new a("Invalid GIF search response",this.get("query"),t);return this.media.reset(t.media),delete t.media,t.ts=s.now(),t},toJSON:function(){var t=o.toJSON.apply(this,arguments);return t.media=this.media?this.media.toJSON():[],t}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(118),o=i(404),r=n.extend({model:o,previousFrom:function(t){return this.rotateFrom(t,-1)},nextFrom:function(t){return this.rotateFrom(t,1)},rotateFrom:function(t,e){for(var i=(s.isNumber(t)?this.at(t):this.findWhere({mediaUrl:t}))||this.sample(),n=this.indexOf(i)+e;0>n;)n+=this.length;return this.at(n%this.length)}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(113),o=i(187),r=n.extend({defaults:{mediaUrl:"",postUrl:"",rootPostUrl:"",rootPostUrlHash:"",rootBlog:"",rootBlogUrl:"",rootBlogKey:"",postTags:[],popularSearchTag:"",width:0,height:0},initialize:function(t,e){this.attributes={},this.set(s.defaults(o(t||{}),this.defaults))}});t.exports=r},,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(143),o=i(430),r=i(202),a=(i(203),n.extend({name:"Upload",initialize:function(t){t=s.extend({},t),this.collection=t.collection||(t.collection=new r),this.indexView=new o(t),this.listenTo(this.collection,"all",this._relayCollectionEvent)},_relayCollectionEvent:function(){this.trigger.apply(this,arguments)},addFiles:function(t){return this.indexView.add({files:t})},promise:function(){return this.indexView.promise()},teardown:function(){return this.remove()},remove:function(){return this.indexView.remove(),this.stopListening(),this},render:function(){return this.indexView.render(),this},getElement:function(){return this.indexView.$el},getCurrentRequest:function(){return this.indexView.jqXHR}}));t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(6).sprintf,o=i(148),r=i(115),a=i(120),l=i(109),h=i(100),c=i(202),u=i(203),d=i(431),p=["add","submit","send","done","fail","always","progress","progressall","start","stop","change","paste","drop","dragover","chunksend","chunkdone","chunkfail","chunkalways"],g=["add","send","progress","active","enable","disable"],_=o.extend({tagName:"input",attributes:{type:"file"},defaults:{name:"photo",maxUploadSize:!1,uploadPattern:!1,mediaType:"image",message:{cancel:"Canceled upload",error:"Upload error",filesize:"The file is too big. Squish it down, and try again!",filetype:"This is not valid %1$s file."},fileUpload:{singleFileUploads:!0,limitConcurrentUploads:1,sequentialUploads:!1,autoUpload:!0,formData:[],dataType:"json",dropZone:null,pasteZone:null}},_createUploadModel:function(t,e){var i=new u(t);return this.collection.add(i,e||{}),i},_createUploadModelForFile:function(t,e,i){e=s.extend({file:t},e);var n=this._createUploadModel(e,i);return t._uploadModel=n,n},initialize:function(t){if(this.options=s.merge({},this.defaults,t),this.options.url&&(this.options.fileUpload.url=this.options.url),this.options.collection?this.collection=this.options.collection:this.collection=new c,!this.options.fileUpload.url)throw new Error("Upload requires an endpoint URL");this.$el.prop("tabindex",-1),this.options.fileUpload.multiple&&this.$el.prop("multiple",!0),this.options.accept&&this.$el.prop("accept",this.options.accept);var e=s.merge({},this._fileUploadWrap);s.forEach(p,function(t){s.isFunction(e.defaults[t])||(e.defaults[t]=s.noop)},this);var i=new r(e);i.applyTo(this.options.fileUpload),s.forEach(p,function(t){this.options.fileUpload[t]=d(this.options.fileUpload[t],this)},this),this.$el.attr("name",this.options.name).fileupload(this.options.fileUpload),this._fileUpload=this.$el.data("blueimp-fileupload"),s.forEach(g,function(t){this[t]=function(){var e=s.toArray(arguments);e.unshift(t),this._fileUploadInvoke.apply(this,e)}},this)},_fileUploadInvoke:function(t){return this._fileUpload[t].apply(this._fileUpload,s.rest(arguments))},validateFile:function(t,e){e||(e=this.options);var i=[];return e.maxUploadSize&&t.size>e.maxUploadSize&&(l.trigger("postform-interaction:upload-limit-hit",{loggingData:{fileSize:t.size,fileType:t.type}}),i.push({type:"filesize",message:n(e.message.filesize,e.maxUploadSize)})),e.uploadPattern&&t.type&&!e.uploadPattern.test(t.type)&&i.push({type:"filetype",message:n(e.message.filetype,e.mediaType)}),i},upload:function(t){this.add({files:[t]})},cancel:function(){var t;return this.jqXHR?(t=this.jqXHR.abort(),this.jqXHR=null):t=a.reject(this.options.message.cancel),t},_forMatchingFiles:function(t,e){var i=s.rest(arguments);this.collection.forEach(function(n){if(s.contains(t,n.get("file"))){var o=s.clone(i);o[0]=n,e.apply(this,o)}},this)},promise:function(){return this.collection.promise()},_fileUploadWrap:{defaults:{change:function(t,e,i){this._fileUpload.options.replaceFileInput&&this.setElement(t)},add:function(t,e,i){var n=i.files[0],o=this.validateFile(n),r={},a={};if(!s.isEmpty(o)){r.error=s.pluck(o,"message"),r.file=n;var l={errorType:"validation",messages:o,file:n};this.collection.trigger("invalid",this.collection,new this.collection.model(r)),this.trigger("error",l),a.silent=!0}return this._createUploadModelForFile(n,r,a),s.isEmpty(o)},send:function(t,e,i){return!0}},before:{},after:{done:function(t,e,i){var n,o=s.get(i,"result.meta.status"),r=s.get(i,"result.response"),a=s.get(i,"result.errors");if(200!==o||s.isEmpty(r)){var l=function(){return r&&r.msg?r.msg:s.isArray(a)?s.isEmpty(a)?h("Woops :("):a:a.join(" ")}();n={error:l,uploading:!1}}else s.isArray(r)&&(r=r[0]),n=s.extend({complete:!0,uploading:!1},r);this._forMatchingFiles(i.files,function(t,e){t.set(e)},n)},fail:function(t,e,i){var n;n="abort"===i.errorThrown?{uploading:!1}:{error:this.options.message.error,uploading:!1},n.responseJSON=s.get(i,"jqXHR.responseJSON"),this._forMatchingFiles(i.files,function(t,e){t.set(e)},n)},progress:function(t,e,i){this._forMatchingFiles(i.files,function(t,e){t.set(e)},{bytesLoaded:i.loaded,bytesTotal:i.total})}},around:{add:function(t,e,i,n){var o=t.apply(this,s.rest(arguments));return o===!1||i.isDefaultPrevented()?!1:((n.autoUpload||n.autoUpload!==!1&&this._fileUpload.options.autoUpload)&&n.process().done(s.bind(function(){this.jqXHR=n.submit()},this)),o)},send:function(t,e,i,n){n.withFormKey=!0;var o=t.apply(this,s.rest(arguments));if(o){this._forMatchingFiles(n.files,function(t,e){t.set(e)},{uploading:!0});var r={files:n.files};this.collection.trigger("send",this.collection,r),this.trigger("send",r)}return o}}}});t.exports=_},function(t,e,i){"use strict";var s=function(t,e){return e||(e=this),function(){var i=Array.prototype.slice.call(arguments);return i.unshift(this),t.apply(e,i)}};t.exports=s},,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";function s(){return o||(o=new r),o}function n(){return!!o}var o,r=i(451);t.exports={getInstance:s,hasInstance:n}},function(t,e,i){"use strict";function s(t,e){t instanceof o&&(t=t.get(0)),e instanceof o&&(e=e.get(0)),t&&e&&n.forEach(c,function(i){t.hasAttribute(i)&&e.setAttribute(i,t.getAttribute(i))})}var n=i(3),o=i(8),r=i(143),a=r.prototype,l=i(452),h=i(452).LivePhoto,c=["width","height","data-pin-url","data-pin-description"],u=r.extend({name:"LivePhotos",autoAppend:!0,initialize:function(){this.instances=[]},create:function(t){var e=t instanceof o?t:o(t);if(e.length){var i=e.closest("a, [data-lightbox]");if(i.length){var n,r;i.on("mousedown.livephoto touchstart.livephoto",function(){n=!1,i.prop("livePhotoSneezeguard",!0),r=setTimeout(function(){i.prop("livePhotoSneezeguard",!1),n=!0},750)}),i.on("click.livephoto",function(t){clearTimeout(r),n&&t.preventDefault()})}var a=new h(e.get(0));return this.instances.push(a),s(e,a.img),a}return null},remove:function(){return l.cleanup(),a.remove.call(this)},append:function(){return l.addStyles(),a.append.call(this)}});t.exports=u},function(t,e,i){!function(e,i){t.exports=i()}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){function s(t,e){if(c){d&&n(),"object"==typeof t&&"[object Object]"===t.toString()&&(e=t,t=e.elements,delete e.elements),t||(t="img[data-live-photo]"),"string"==typeof t&&(t=document.querySelectorAll(t)),t instanceof HTMLElement&&(t=[t]);var i=[];return Array.prototype.forEach.call(t,function(t){if("string"==typeof t&&(t=document.querySelector(t)),t){var s=new l(t,e);i.push(s)}}),i}}function n(){h.use(),u++}function o(){d=!1}function r(){for(;u>0;)h.unuse(),u--}function a(t,e){return s(t,e)}var l=i(1),h=i(4),c=!0,u=0,d=!0;a.initialize=s,a.addStyles=n,a.noStyles=o,a.cleanup=r,a.LivePhoto=l,t.exports=a},function(t,e,i){function s(t,e,i,s){var n=document.createElement("video");return n.src=t+(i?"#"+i:""),n.controls=!1,n.muted=s||!1,n.preload="auto",e&&(n.className=e),h(n,!s),n}function n(t,e){if(t.paused){var i=t.muted,s=t.currentTime,n=function(){t.removeEventListener("loadedmetadata",n),t.currentTime=s,e&&e(t)};t.muted=!0,t.play(),t.pause(),t.muted=i,t.duration>=0?n():t.addEventListener("loadedmetadata",n)}}function o(t,e,i){var n=document.createElement("div");n.className="live-photo",n.setAttribute("data-live-photo","");var o=document.createElement("img");o.className="live-photo-keyframe",o.src=t;var r=s(e,"live-photo-postroll",i,!0),a=s(e,"live-photo-video"),l=document.createElement("i");return l.className="live-photo-icon",n.appendChild(o),n.appendChild(r),n.appendChild(a),n.appendChild(l),{container:n,img:o,postroll:r,video:a,icon:l}}function r(){var t=["mousedown"];return c&&t.push("touchstart"),t}function a(){var t=["mouseup","mouseout"];return c&&t.push("touchend"),t}function l(t,e,i,s){if(!(this instanceof l))return new l(t,e,i,s);var n,r;if(t instanceof HTMLElement&&(s=e,r=t,e=r.getAttribute("data-live-photo"),i=parseFloat(r.getAttribute("data-live-photo-still-image-time")),t=r.src),s||(s={}),this.postrollMs=s.postrollMs||375,this.deactivateMs=s.deactivateMs||500,this.previewMs=s.previewMs||500,this.stillImageTime=i||NaN,!t&&!s.noErrors)throw new Error("LivePhoto Error: Missing keyframeUrl");if(!e&&!s.noErrors)throw new Error("LivePhoto Error: Missing videoUrl");n=o(t,e,i),r&&(r.parentNode.insertBefore(n.container,r),r.parentNode.removeChild(r)),this.container=n.container,this.img=n.img,this.video=n.video,this.postroll=n.postroll,this.icon=n.icon,this.__onVideoCanPlayThrough=this._onVideoCanPlayThrough.bind(this),this.__onVideoLoadededMetadata=this._onVideoLoadededMetadata.bind(this),this.__onPostrollTimeUpdate=this._onPostrollTimeUpdate.bind(this),this.__startVideoPlayback=this._startVideoPlayback.bind(this),this.__startPostrollPlayback=this._startPostrollPlayback.bind(this),this.__resetPlayback=this._resetPlayback.bind(this),this.__resetPreview=this._resetPreview.bind(this),this.video.addEventListener("canplaythrough",this.__onVideoCanPlayThrough),this.video.duration?(this._setDuration(this.video.duration),this._resetPostroll()):(this._setDuration(0),this.video.addEventListener("loadedmetadata",this.__onVideoLoadededMetadata)),this._playing=!1,this._canPlayThrough=!1,this._playWhenReady=!1,s.useEventHandlers!==!1&&this._addEventHandlers(s.playEvents,s.stopEvents)}var h=i(2),c="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints;l.prototype={_addEventHandlers:function(t,e){var i=this.container,s=!1,o=this.play.bind(this),l=this.video,h=this.postroll,c=function(t){if(t.preventDefault(),s)o();else{var e=!1,i=!1;n(l,function(){e=!0,i&&o()}),n(h,function(){i=!0,e&&o()}),s=!0}};t&&t!==!1||(t=r),"function"==typeof t&&(t=t(this)),"string"==typeof t&&(t=t.split(/[,\s]+/)),t.forEach(function(t){t&&i.addEventListener(t,c)});var u=this.stop.bind(this),d=function(t){t.preventDefault(),u()};e&&e!==!1||(e=a),"function"==typeof e&&(e=e(this)),"string"==typeof e&&(e=e.split(/[,\s]+/)),e.forEach(function(t){t&&i.addEventListener(t,d)})},_onVideoCanPlayThrough:function(){this._canPlayThrough=!0,this._playWhenReady&&(this._playWhenReady=!1,this.play()),this.container.classList.remove("loading"),this.video.removeEventListener("canplaythrough",this.__onVideoCanPlayThrough)},_onVideoLoadededMetadata:function(){this._setDuration(this.video.duration||0),this._resetPostroll(),this.video.removeEventListener("loadedmetadata",this.__onVideoLoadededMetadata)},_onPostrollTimeUpdate:function(t){this.postroll.currentTime>=this.stillImageTime-.1&&this._resetPreview()},_clearTimeouts:function(){clearTimeout(this._resetVideoTimeout),clearTimeout(this._resetPostrollTimeout),clearTimeout(this._resetPreviewTimeout),this.postroll.removeEventListener("timeupdate",this.__onPostrollTimeUpdate)},_setDuration:function(t){this.duration=t,("number"!=typeof this.stillImageTime||isNaN(this.stillImageTime))&&(this.stillImageTime=.5*t),this.previewStart=Math.max(0,this.stillImageTime-this.previewMs/1e3)},_resetPostroll:function(){this.postroll.pause(),this.postroll.currentTime=this.stillImageTime},_resetVideo:function(){this.video.pause(),this.video.currentTime=0,this.video.muted=!1},_startVideoPlayback:function(){this.video.play(),this._resetPostroll()},_startPostrollPlayback:function(){this._resetPostroll(),this.postroll.play()},_resetPlayback:function(){this._playing=!1,this._resetVideo(),this._resetPostroll()},_resetPreview:function(){this.postroll.removeEventListener("timeupdate",this.__onPostrollTimeUpdate),this._resetPostroll(),this.container.classList.remove("preview")},load:function(){this.video.load(),this.postroll.load()},play:function(){if(!this._playing){if(!this._canPlayThrough)return this._playWhenReady=!0,this._clearTimeouts(),this.load(),void this.container.classList.add("loading");this._playing=!0,this._clearTimeouts(),this._startPostrollPlayback(),this.video.currentTime=0,this._resetPostrollTimeout=setTimeout(this.__startVideoPlayback,this.postrollMs),this.container.classList.add("active")}},stop:function(){this._playing&&(this.video.muted=!0,this._clearTimeouts(),this.container.classList.remove("active"),this._resetVideoTimeout=setTimeout(this.__resetPlayback,this.deactivateMs))},preview:function(){this._playing||(this._clearTimeouts(),this.postroll.currentTime=this.previewStart,this.postroll.play(),this.container.classList.add("preview"),this._previewCompleteTimeout=setTimeout(this.__resetPreview,1e3*(this.stillImageTime-this.previewStart)),this.postroll.addEventListener("timeupdate",this.__onPostrollTimeUpdate))}},t.exports=l},function(t,e,i){/*! npm.im/iphone-inline-video */
  "use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t["default"]:t}function n(t){function e(n){i=requestAnimationFrame(e),t(n-(s||n)),s=n}var i,s;this.start=function(){i||e(0)},this.stop=function(){cancelAnimationFrame(i),i=null,s=0}}function o(t,e,i,s){function n(e){Boolean(t[i])===Boolean(s)&&e.stopImmediatePropagation(),delete t[i]}return t.addEventListener(e,n,!1),n}function r(t,e,i,s){function n(){return i[e]}function o(t){i[e]=t}s&&o(t[e]),Object.defineProperty(t,e,{get:n,set:o})}function a(t,e,i){i.addEventListener(e,function(){return t.dispatchEvent(new Event(e))})}function l(t,e){Promise.resolve().then(function(){t.dispatchEvent(new Event(e))})}function h(t){var e=new Audio;return a(t,"play",e),a(t,"playing",e),a(t,"pause",e),e.crossOrigin=t.crossOrigin,e.src=t.src||t.currentSrc||"data:",e}function c(t,e,i){(v||0)+200<Date.now()&&(t[k]=!0,v=Date.now()),i||(t.currentTime=e),S[++T%3]=100*e|0}function u(t){return t.driver.currentTime>=t.video.duration}function d(t){var e=this;e.video.readyState>=e.video.HAVE_FUTURE_DATA?(e.hasAudio||(e.driver.currentTime=e.video.currentTime+t*e.video.playbackRate/1e3,e.video.loop&&u(e)&&(e.driver.currentTime=0)),c(e.video,e.driver.currentTime)):e.video.networkState!==e.video.NETWORK_IDLE||e.video.buffered.length||e.video.load(),e.video.ended&&(delete e.video[k],e.video.pause(!0))}function p(){var t=this,e=t[w];return t.webkitDisplayingFullscreen?void t[C]():("data:"!==e.driver.src&&e.driver.src!==t.src&&(c(t,0,!0),e.driver.src=t.src),void(t.paused&&(e.paused=!1,t.buffered.length||t.load(),e.driver.play(),e.updater.start(),e.hasAudio||(l(t,"play"),e.video.readyState>=e.video.HAVE_ENOUGH_DATA&&l(t,"playing")))))}function g(t){var e=this,i=e[w];i.driver.pause(),i.updater.stop(),e.webkitDisplayingFullscreen&&e[x](),i.paused&&!t||(i.paused=!0,i.hasAudio||l(e,"pause"),e.ended&&(e[k]=!0,l(e,"ended")))}function _(t,e){var i=t[w]={};i.paused=!0,i.hasAudio=e,i.video=t,i.updater=new n(d.bind(i)),e?i.driver=h(t):(t.addEventListener("canplay",function(){t.paused||l(t,"playing")}),i.driver={src:t.src||t.currentSrc||"data:",muted:!0,paused:!0,pause:function(){i.driver.paused=!0},play:function(){i.driver.paused=!1,u(i)&&c(t,0)},get ended(){return u(i)}}),t.addEventListener("emptied",function(){var e=!i.driver.src||"data:"===i.driver.src;i.driver.src&&i.driver.src!==t.src&&(c(t,0,!0),i.driver.src=t.src,e?i.driver.play():i.updater.stop())},!1),t.addEventListener("webkitbeginfullscreen",function(){t.paused?e&&!i.driver.buffered.length&&i.driver.load():(t.pause(),t[C]())}),e&&(t.addEventListener("webkitendfullscreen",function(){i.driver.currentTime=t.currentTime}),t.addEventListener("seeking",function(){S.indexOf(100*t.currentTime|0)<0&&(i.driver.currentTime=t.currentTime)}))}function m(t){var e=t[w];t[C]=t.play,t[x]=t.pause,t.play=p,t.pause=g,r(t,"paused",e.driver),r(t,"muted",e.driver,!0),r(t,"playbackRate",e.driver,!0),r(t,"ended",e.driver),r(t,"loop",e.driver,!0),o(t,"seeking"),o(t,"seeked"),o(t,"timeupdate",k,!1),o(t,"ended",k,!1)}function f(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0),i&&!y||t[w]||(_(t,e),m(t),t.classList.add("IIV"),!e&&t.autoplay&&t.play(),"MacIntel"!==navigator.platform&&"Windows"!==navigator.platform||console.warn("iphone-inline-video is not guaranteed to work in emulated environments"))}var v,b=s(i(3)),y=/iPhone|iPod/i.test(navigator.userAgent)&&void 0===document.head.style.grid,w=b(),k=b(),C=b("nativeplay"),x=b("nativepause"),S=[],T=0;f.isWhitelisted=y,t.exports=f},function(t,e){"use strict";var i="undefined"==typeof Symbol?function(t){return"@"+(t||"@")+Math.random()}:Symbol;t.exports=i},function(t,e,i){var s,n=0,o=i(5);"string"==typeof o&&(o=[[t.id,o,""]]),e.use=e.ref=function(){return n++||(e.locals=o.locals,s=i(7)(o,{})),e},e.unuse=e.unref=function(){--n||(s(),s=null)}},function(t,e,i){e=t.exports=i(6)(),e.push([t.id,".live-photo {\n  position: relative;\n  overflow: hidden;\n  cursor: pointer; }\n  .live-photo video,\n  .live-photo img {\n    display: block;\n    max-width: 100%;\n    pointer-events: none;\n    -ms-touch-action: none;\n        touch-action: none; }\n  .live-photo video {\n    position: absolute;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n    width: 100%;\n    height: 100%; }\n    .live-photo video::-webkit-media-controls-start-playback-button {\n      display: none; }\n  .live-photo .live-photo-icon {\n    display: block;\n    position: absolute;\n    top: 12px;\n    left: 12px;\n    width: 24px;\n    height: 24px;\n    background: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='48' height='48' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Ctitle%3ELive Photo%3C/title%3E%3Cg fill-rule='evenodd'%3E%3Cpath d='M24 36c6.627 0 12-5.373 12-12s-5.373-12-12-12-12 5.373-12 12 5.373 12 12 12zm0-2c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z'/%3E%3Cpath d='M24 29a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0-3a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0-19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm4.788.63a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm4.462 1.85a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm3.831 2.94a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm2.94 3.831a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm1.849 4.462a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm.63 4.788a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-.63 4.788a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-1.85 4.461a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-2.94 3.831a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-3.831 2.94a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-4.462 1.849a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM24 44a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-4.788-.63a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-4.462-1.85a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-3.831-2.94a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-2.94-3.831a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM6.13 30.288a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM5.5 25.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm.63-4.788a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm1.85-4.462a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm2.94-3.831a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm3.831-2.94a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm4.462-1.849a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/%3E%3C/g%3E%3C/svg%3E\") center center;\n    background-size: contain;\n    -webkit-filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));\n            filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));\n    pointer-events: none; }\n  .live-photo .live-photo-postroll,\n  .live-photo .live-photo-video {\n    opacity: 0; }\n  .live-photo .live-photo-video {\n    -webkit-filter: blur(7.5px);\n            filter: blur(7.5px); }\n  .live-photo .live-photo-keyframe,\n  .live-photo .live-photo-postroll,\n  .live-photo .live-photo-video {\n    will-change: transform, filter, opacity;\n    transition: opacity 0.5s linear, -webkit-transform 0.5s ease-out, -webkit-filter 0.5s linear;\n    transition: transform 0.5s ease-out, filter 0.5s linear, opacity 0.5s linear;\n    transition: transform 0.5s ease-out, filter 0.5s linear, opacity 0.5s linear, -webkit-transform 0.5s ease-out, -webkit-filter 0.5s linear; }\n  .live-photo.loading .live-photo-icon {\n    -webkit-animation: live-photo-icon-loading 0.5s linear alternate infinite both;\n            animation: live-photo-icon-loading 0.5s linear alternate infinite both; }\n  .live-photo.preview .live-photo-postroll {\n    opacity: 1;\n    transition-duration: 0s; }\n  .live-photo.active video,\n  .live-photo.active img {\n    -webkit-transform: scale(1.075, 1.075);\n        -ms-transform: scale(1.075, 1.075);\n            transform: scale(1.075, 1.075); }\n  .live-photo.active .live-photo-postroll {\n    -webkit-animation: live-photo-post-roll 1s both;\n            animation: live-photo-post-roll 1s both; }\n  .live-photo.active .live-photo-video {\n    opacity: 1;\n    -webkit-filter: none;\n            filter: none;\n    transition-delay: 0.375s;\n    transition-duration: 0.625s; }\n\n@-webkit-keyframes live-photo-icon-loading {\n  0% {\n    opacity: 1; }\n  100% {\n    opacity: 0.75; } }\n\n@keyframes live-photo-icon-loading {\n  0% {\n    opacity: 1; }\n  100% {\n    opacity: 0.75; } }\n\n@-webkit-keyframes live-photo-post-roll {\n  0% {\n    opacity: 0;\n    -webkit-filter: blur(0);\n            filter: blur(0); }\n  2% {\n    opacity: 1; }\n  37.5% {\n    opacity: 1;\n    -webkit-filter: blur(7.5px);\n            filter: blur(7.5px); }\n  100% {\n    opacity: 0; } }\n\n@keyframes live-photo-post-roll {\n  0% {\n    opacity: 0;\n    -webkit-filter: blur(0);\n            filter: blur(0); }\n  2% {\n    opacity: 1; }\n  37.5% {\n    opacity: 1;\n    -webkit-filter: blur(7.5px);\n            filter: blur(7.5px); }\n  100% {\n    opacity: 0; } }\n",""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var i=this[e];i[2]?t.push("@media "+i[2]+"{"+i[1]+"}"):t.push(i[1])}return t.join("")},t.i=function(e,i){"string"==typeof e&&(e=[[null,e,""]]);for(var s={},n=0;n<this.length;n++){var o=this[n][0];"number"==typeof o&&(s[o]=!0)}for(n=0;n<e.length;n++){var r=e[n];"number"==typeof r[0]&&s[r[0]]||(i&&!r[2]?r[2]=i:i&&(r[2]="("+r[2]+") and ("+i+")"),t.push(r))}},t}},function(t,e,i){function s(t,e){for(var i=0;i<t.length;i++){var s=t[i],n=p[s.id];if(n){n.refs++;for(var o=0;o<n.parts.length;o++)n.parts[o](s.parts[o]);for(;o<s.parts.length;o++)n.parts.push(h(s.parts[o],e))}else{for(var r=[],o=0;o<s.parts.length;o++)r.push(h(s.parts[o],e));p[s.id]={id:s.id,refs:1,parts:r}}}}function n(t){for(var e=[],i={},s=0;s<t.length;s++){var n=t[s],o=n[0],r=n[1],a=n[2],l=n[3],h={css:r,media:a,sourceMap:l};i[o]?i[o].parts.push(h):e.push(i[o]={id:o,parts:[h]})}return e}function o(t,e){var i=m(),s=b[b.length-1];if("top"===t.insertAt)s?s.nextSibling?i.insertBefore(e,s.nextSibling):i.appendChild(e):i.insertBefore(e,i.firstChild),b.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");i.appendChild(e)}}function r(t){t.parentNode.removeChild(t);var e=b.indexOf(t);e>=0&&b.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function l(t){var e=document.createElement("link");return e.rel="stylesheet",o(t,e),e}function h(t,e){var i,s,n;if(e.singleton){var o=v++;i=f||(f=a(e)),s=c.bind(null,i,o,!1),n=c.bind(null,i,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=l(e),s=d.bind(null,i),n=function(){r(i),i.href&&URL.revokeObjectURL(i.href)}):(i=a(e),s=u.bind(null,i),n=function(){r(i)});return s(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;s(t=e)}else n()}}function c(t,e,i,s){var n=i?"":s.css;if(t.styleSheet)t.styleSheet.cssText=y(e,n);else{var o=document.createTextNode(n),r=t.childNodes;r[e]&&t.removeChild(r[e]),r.length?t.insertBefore(o,r[e]):t.appendChild(o)}}function u(t,e){var i=e.css,s=e.media;if(s&&t.setAttribute("media",s),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}function d(t,e){var i=e.css,s=e.sourceMap;s&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */");var n=new Blob([i],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(n),o&&URL.revokeObjectURL(o)}var p={},g=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},_=g(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),m=g(function(){return document.head||document.getElementsByTagName("head")[0]}),f=null,v=0,b=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=_()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var i=n(t);return s(i,e),function(t){for(var o=[],r=0;r<i.length;r++){var a=i[r],l=p[a.id];l.refs--,o.push(l)}if(t){var h=n(t);s(h,e)}for(var r=0;r<o.length;r++){var l=o[r];if(0===l.refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete p[l.id]}}}};var y=function(){var t=[];return function(e,i){return t[e]=i,t.filter(Boolean).join("\n")}}()}])})},,,,,,,,,,,,function(t,e){"use strict";var i=(window.URL||window.webkitURL||window.mozURL||window.msURL||{}).createObjectURL;t.exports=i},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(510),r=i(391),a=i(144),l=i(159),h=i(107),c=i(109),u=i(511),d=i(512),p=a.extend({mixins:[l],defaults:{loaded:!1,paused:!0,muted:!0,autoplay:!1,_preload:!1,_preloadThreshold:10,loop:!0,autoheight:!1,watch:!0,duration:0,hideFullscreen:!1,_elapsed:0,_position:0,_startSeekJumpTime:null,minLoopDuration:1,isAd:!1,isInPeepr:!1,isFullscreen:!1},classNames:{base:"crt-video crt-skin-default",autoplay:"crt-state-autoplaying",autoheight:"crt-autoheight",hideFullscreen:"crt-hide-fullscreen-toggle"},constructor:function(t,e){this._id=s.uniqueId("crtplayer"),this.initialize(t,e)},initialize:function(t,e){e||(e={}),s.isObject(e.attributes)&&this.set(e.attributes),this.video=t,this.$video=n(this.video);var i=this.$video.data("crt-options")||{};this.$video.removeAttr("data-crt-options"),this.vjsOptions=s.defaults({crt:this,crtOptions:i},e.vjsOptions||{}),i&&i.duration&&this.set("duration",i.duration),this.vjsOptions.crtOptions.livestream&&(this.set("autoplay",!0),this.set("minLoopDuration",60)),r.write(function(){this.$video.addClass(this.classNames.base)},this)},render:function(){return r.write(function(){d(this.video,this.vjsOptions).then(s.bind(this.ready,this))},this),this},ready:function(t){this.player=t,this.player.muted(this.get("muted")),this.el=t.player_.el(),this.$el=n(this.el),this.$post=this.$el.closest(".post, .video-ad"),this.playerID=this.player.id_,this.hasLooped=!1,this._bindEvents(),this.setLoopState(!0),this.setAutoheightState(s.get(this.vjsOptions,"crtOptions.autoheight")),this.setFullscreenControl(!u.prop("requestFullscreen")),this.shouldForceHD()&&this.player.src({src:this.vjsOptions.crtOptions.hdUrl,type:"video/mp4"}),this.get("watch")&&this.setupWatcher(),this.get("loaded")===!0||this.vjsOptions.crtOptions.livestream||this.player.load()},_bindEvents:function(){this.listenTo(c,"peepr:open",this.pause),this.listenTo(c,"post:form:show",this.pause),this.listenTo(c,"post:docked:afterRender",this.onDockedAfterRender),this.on("change:autoplay",this.onChangeAutoplay,this),this.on("change:autoheight",this.onChangeAutoheight,this),this.on("change:duration",this.onChangeDuration,this),this.on("change:loop",this.onChangeLoop,this),this.on("change:muted",this.onChangeMuted,this),this.player.one("loadedmetadata",s.bind(this.onLoadedMetadata,this)),this.player.on("durationchange",s.bind(this.onUpdateDuration,this)),this.player.on("play",s.bind(this.onPlay,this)),this.player.on("pause",s.bind(this.onPause,this)),this.player.on("ended",s.bind(this.onEnded,this)),this.player.on("fullscreenchange",s.bind(this.onFullscreenChange,this)),this.player.on("error",s.bind(this.onError,this))},setupWatcher:function(){this.watcher=o.create(this.el,-100),this.watcher.fullyEnterViewport(s.bind(function(){this.trigger("fullyEnterViewport")},this)),this.watcher.partiallyExitViewport(s.bind(function(){this.trigger("partiallyExitViewport")},this)),this.watcher.exitViewport(s.bind(function(){this.trigger("exitViewport"),this.shouldAutoplay()&&this.pause()},this))},onClickPlayer:function(t){n(t.target).closest(".vjs-mute-control").length||n(t.target).closest(".vjs-fullscreen-control").length||this.pause(),this.set("autoplay",!1),this.set("muted",!1),this.$el.off("click.crtAutoPlay touchend.crtAutoPlay")},restart:function(){this.get("autoplay")&&(this.set("autoplay",!1),this.set("muted",!1),this.onTimeUpdate(),this.player.trigger({type:"restart",start:this.player.currentTime(),end:0}),this.player.currentTime(0))},pollTimeUpdate:function(){this.get("paused")||"undefined"==typeof this.player||null==this.player||(this.onTimeUpdate(),setTimeout(s.bind(this.pollTimeUpdate,this),150))},shouldAutoplay:function(){return!(!this.get("autoplay")||h.bool("is_mobile")||!this.$el.is(":visible")||!(this.get("duration")>this.get("minLoopDuration")||0===this.get("duration")||this.vjsOptions.crtOptions.livestream))},shouldForceHD:function(){return!(!this.vjsOptions.forceHD||!this.vjsOptions.crtOptions.hdUrl)},play:function(t){t||(t={}),this.player.paused()&&(this.player.play(),t.skipLog||(t.type="userPlay",this.player.trigger(t)))},pause:function(t){t||(t={}),this.player.paused()||(this.player.pause(),t.skipLog||this.player.trigger("pause"))},onPlay:function(){this.set("paused",!1),this.pollTimeUpdate()},onPause:function(){this.set("paused",!0)},onUpdateDuration:function(t){this.set("duration",this.player.duration())},onLoadedMetadata:function(t){var e=this.shouldAutoplay();this.setMutedState(e),this.setAutoplayState(e),e&&this.$el.on("click.crtAutoPlay touchend.crtAutoPlay",s.bind(this.onClickPlayer,this)),c.trigger("CrtPlayer:ready",this),this.trigger("playerReady",this),this.trigger("ready",this),this.set("loaded",!0)},onEnded:function(t){this.get("loop")===!0?(this.play({skipLog:!0}),this.player.trigger("loop"),this.get("autoplay")||this.hasLooped||(this.hasLooped=!0)):(this.pause({skipLog:!0}),this.player.trigger("end"))},onError:function(t){this.set("paused",!0),this.set("loop",!1),this.set("autoplay",!1),this.trigger("error",t)},onChangeAutoplay:function(t,e,i){this.setAutoplayState(e,i)},onChangeAutoheight:function(t,e){this.setAutoheightState(e)},onChangeDuration:function(t,e){this.setLoopState(!0)},onChangeLoop:function(t,e){this.setLoopState(e)},onChangeMuted:function(t,e){this.player.muted(e)},onFullscreenChange:function(){this.$post.hasClass("docked")&&(this.player.isFullscreen()?(this.cached_top=this.$el.position().top,this.$el.css("top",0)):this.$el.css("top",this.cached_top))},onDockedAfterRender:function(t){s.isEmpty(t.embedID)||this.playerID===t.embedID&&this.player.trigger("CRTPlayer:updateDimensions")},setLoopState:function(t){s.isUndefined(t)&&(t=this.get("loop")),this.set("loop",t),"undefined"!=typeof this.get("duration")&&this.get("duration")<=this.get("minLoopDuration")&&this.set("loop",!1)},setMutedState:function(t){s.isUndefined(t)&&(t=this.get("muted")),this.set("muted",t)},setAutoplayState:function(t){s.isUndefined(t)&&(t=this.get("autoplay")),this.set("autoplay",t),this.toggleAttrClass("autoplay",t),!t&&this.get("duration")&&this.setLoopState(!0)},setAutoheightState:function(t){(s.isUndefined(t)||s.isNull(t))&&(t=this.get("autoheight")),this.set("autoheight",t),this.toggleAttrClass("autoheight",t)},setFullscreenControl:function(t){s.isUndefined(t)&&(t=this.get("hideFullscreen")),this.set("hideFullscreen",t),this.toggleAttrClass("hideFullscreen",t)},onTimeUpdate:function(){var t=.3,e=this.get("_position"),i=this.player.currentTime(),s=Math.abs(e-i);t>s&&this.set("_elapsed",this.get("_elapsed")+s),this.set("_position",i),this.set("_startSeekJumpTime",i)},getStartSeekJumpPosition:function(){return this.get("_startSeekJumpTime")},getPosition:function(){return Math.floor(this.get("_position"))},getElapsed:function(){return Math.floor(this.get("_elapsed"))},toggleAttrClass:function(t,e){this.classNames[t]&&r.write(function(){this.$el.toggleClass(this.classNames[t],e)},this)},teardown:function(){this.trigger("teardown",this),this.off(),this.stopListening(),this.watcher&&(this.watcher.destroy(),this.watcher=null),this.player&&(this.player.dispose(),this.player=null)}});t.exports=p},,function(t,e,i){"use strict";var s=i(3),n=i(144),o={requestFullscreen:["requestFullScreen"]},r=n.extend({vendors:["moz","webkit","ms","o","khtml"],cssPrefixes:["-moz-","-webkit-","-ms-","-o-","",""],el:document.body||document.documentElement,get:s.memoize(function(t){var e=this._getProp(t);return!e&&o[t]&&s.each(o[t],function(t){var i=this._getProp(t);i&&(e=i)},this),e}),prop:function(t){return!!this.get(t)},cssFilters:s.memoize(function(){var t=document.createElement("div");return t.style.cssText=this.cssPrefixes.join("filter:blur(5px); "),!!t.style.length}),_getProp:function(t){var e=!1;return"string"==typeof this.el[t]?t:"string"==typeof this._styles()[t]?t:(t=t.charAt(0).toUpperCase()+t.substr(1),s.forEach(this.vendors,function(i){var s=i+t;s in this.el&&(e=s),s in this._styles()&&(e=s)},this),e)},_styles:s.memoize(function(){return this.el.style})});t.exports=new r},function(t,e,i){"use strict";function s(t,e){var i=n.merge({},g(),e);e.crtOptions.techOrder&&(i.techOrder=e.crtOptions.techOrder);var s=r.defer(),a=function(){var t;e.src&&e.type?(this.src(e),s.resolve(this)):e.file?(t=e.file.type||"video/mp4",this.src({src:l(e.file),type:t}),s.resolve(this),delete e.file):s.resolve(this)},h=o(t,i,a);return"function"==typeof h.skippy&&h.skippy(),s.promise}var n=i(3),o=i(513);window.videojs=o;var r=i(120),a=i(99),l=i(464),h=i(514),c=i(519),u=i(520);o.registerComponent("BigPlayToggle",i(521)),o.registerComponent("AnimatingMuteToggle",i(522)),o.registerComponent("CrtSeekBar",i(524)),o.registerComponent("LoadingSpinner",i(525)),o.registerComponent("HDToggle",i(526)),o.registerComponent("CrtDurationDisplay",i(527)),o.log=n.noop,o.log.error=n.noop,o.log.warn=n.noop,o.log.history=[];var d=function(t){this.crt=this.options_.crt,this.options_.crt=null,this.hoverSlider=new h(this,t),this.detectBuffering=new c(this,t),this.eventDispatcher=new u(this,t)};o.plugin("crt",d);var p,g=function(){var t=a.get("Context/hosts");return p||(p={children:["mediaLoader","posterImage","bigPlayToggle","loadingSpinner",{name:"controlBar",children:["playToggle","timeDivider","crtDurationDisplay",{name:"progressControl",children:["crtSeekBar"]},"fullscreenToggle","hDToggle","animatingMuteToggle"]},"errorDisplay"],hls:{withCredentials:!1},plugins:{crt:{}},crtOptions:{filmstrip:!1,hdUrl:!1,duration:null,livestream:!1},controls:!0,autoplay:!1,volume:.8,muted:!0,flash:{swf:t.assets_host+"/assets/scripts/vendor/video-js/video-js-swf-5.10.4.swf"},techOrder:["html5","flash"]}),p};t.exports=s},,function(t,e,i){"use strict";var s=i(3),n=i(513),o=i(515),r=i(516),a=i(517),l=i(518),h=n.extend(o,{elSelector:".vjs-progress-holder",initialize:function(t,e){this.children={},this.$el=this.$$(this.elSelector),this.createChildren(),this.$player.on("mousemove.sliderHover",this.elSelector,s.bind(this.onMouseMove,this)),this.$player.on("mouseenter.sliderHover",this.elSelector,s.bind(this.onMouseEnter,this)),this.$player.on("mouseout.sliderHover",this.elSelector,s.bind(this.onMouseOut,this)),this.player.on("dispose",s.bind(this.dispose,this))},createChildren:function(){this.children.hoverSliderHandle=new r(this.player),this.children.hoverSliderTime=new a(this.player),this.player.options_.crtOptions.filmstrip&&(this.$el.addClass("with-filmstrip"),this.children.progressBarTooltip=new l(this.player)),this.appendChildren()},appendChildren:function(){s.each(this.children,s.bind(function(t){this.$el.append(t.render().$el)},this))},updateChildren:function(t){s.each(this.children,function(e){e.update(t)})},onMouseMove:function(t){this.$el.removeClass("auto-hide");var e=this.$el.offset(),i=this.$el.width(),s=t.pageX-e.left,n=Math.max(0,Math.min(1,(t.pageX-e.left)/i)),o=n*this.player.player().duration(),r=o/this.player.player().duration();0>s?s=0:s>i&&(s=i),this.updateChildren({hoverX:s,hoverTime:o,hoverPercent:r})},onMouseOut:function(t){this.$el.addClass("auto-hide")},onMouseEnter:function(t){this.$el.removeClass("auto-hide")},dispose:function(){s.each(this.children,function(t){s.result(t,"dispose")}),o.prototype.dispose.apply(this,arguments)}});t.exports=h},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(513),r=o.getComponent("Component"),a=o.extend(r,{constructor:function(t,e){this.options=e||{},this.player=t,this.$player=n(this.player.el()),this._selectorCache(),this.player.on("dispose",s.bind(this.dispose,this)),this.player.ready(s.bind(function(){this.initialize.apply(this,arguments)},this))},_selectorCache:function(){this.$$=s.memoize(function(t){return this.$player.find(t)},s.identity),this.$$.remove=s.bind(function(t){this.$$.cache["delete"](t)},this),this.$$.clear=s.bind(function(){this.$$.cache=new s.memoize.Cache},this)},initialize:function(){},dispose:function(){this.$$.clear(),this.$player.off()}});t.exports=a},function(t,e,i){"use strict";var s=i(8),n=i(513),o=i(515),r=n.extend(o,{seeking:!1,render:function(){return this.$el=s('<div class="vjs-hover-handle vjs-slider-handle" aria-live="off"><span class="vjs-control-text"></span></div>'),this},update:function(t){t||(t={}),this.$time_el=this.$time_el||this.$el.find(".vjs-hover-handle-time");var e=t.hoverX||0,i=t.hoverTime||"0:00",s=n.formatTime(i);this.$time_el.html(s),this.$el.css("left",e+"px")}});t.exports=r},function(t,e,i){"use strict";var s=i(8),n=i(513),o=i(515),r=n.extend(o,{render:function(){return this.$el=s('<div class="vjs-hover-slider-time" aria-live="off"></div>'),this},update:function(t){t||(t={});var e=t.hoverX||0,i=t.hoverTime||"0:00",s=n.formatTime(i);this.$el.html(s),this.$el.css("left",e+"px")}});t.exports=r},function(t,e,i){"use strict";var s=i(8),n=i(513),o=i(515),r=n.extend(o,{filmstrip_thumbnail_count:10,render:function(){var t=this.player.options_.crtOptions.filmstrip,e=t.url,i=.5*t.width,n=.5*t.height,o=6;return this.$el=s('<div class="crt-progress-tooltip"></div>'),this.$thumbnail=s('<div class="crt-progress-tooltip-thumbnail"></div>'),this.$el.css({transform:"translateX(-50%)",width:i+o+"px",height:n+o+"px"}),this.$thumbnail.css({width:i+"px",height:n+"px","background-image":"url("+e+")","background-size":i*this.filmstrip_thumbnail_count+"px "+n+"px"}),this.$el.append(this.$thumbnail),this},update:function(t){t||(t={});var e=t.hoverX||0;this.$el.css("left",e+"px");var i=isNaN(t.hoverPercent)?0:100*t.hoverPercent,s=100/(this.filmstrip_thumbnail_count-1),n=Math.floor(i/this.filmstrip_thumbnail_count)*s;this.$thumbnail.css("background-position",n+"% 0%")}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(513),o=i(515),r=n.extend(o,{elSelector:".vjs-progress-holder",lastPlayPosition:0,currentPlayPosition:0,lastWaitedTime:0,buffering:!1,polling:!1,interval:100,initialize:function(t,e){this.player.on("play",s.bind(this.startPolling,this)),this.player.on("ended",s.bind(this.stopPolling,this)),this.player.on("pause",s.bind(this.stopPolling,this)),this.player.one("dispose",s.bind(this.stopPolling,this))},checkBuffering:function(){this.currentPlayPosition=this.player.currentTime();var t=1/this.interval;if(!this.buffering&&this.currentPlayPosition<this.lastPlayPosition+t&&!this.player.paused()&&(this.lastWaitedTime=s.now(),this.$player.trigger("waiting"),this.buffering=!0),this.buffering&&this.currentPlayPosition>this.lastPlayPosition+t&&!this.player.paused()){var e=s.now()-this.lastWaitedTime;this.$player.trigger("stopwaiting",{timeWaited:e}),this.buffering=!1}this.lastPlayPosition=this.currentPlayPosition},tick:function(){this.polling&&(this.checkBuffering(),s.delay(s.bind(this.tick,this),this.interval))},startPolling:function(t){this.polling||(this.polling=!0,this.tick())},stopPolling:function(t){this.polling=!1}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(513),r=i(109),a=i(107),l=i(515),h=o.extend(l,{videoConversionLogged:!1,loggingInProgress:!1,startSeekTime:null,loadStartTime:0,triggerElement:n(),initialize:function(t,e){this.player.crt.on("playerReady",s.bind(function(){this.setPlayerData(),this.bindEvents(),this.cacheUnloadData(),this.playerData.duration=this.player.duration(),this.player.options_.crtOptions["hls-service"]&&(s.isFinite(this.playerData.duration)?this.playerData.type="replay":this.playerData.type="live")},this)),this.$doc=n(document)},setPlayerData:function(){var t=this.player.crt.$post.data("json");if(this.playerData={postData:t,platform:"web",app_version:null,type:"video",post_id:null,root_post_id:null,blog_uuid:null,vendor:null,duration:this.player.crt.get("duration"),time_elapsed:null},"undefined"!=typeof t)this.playerData.post_id=t["post-id"],this.playerData.root_post_id=t.root_id,this.playerData.blog_uuid=t.tumblelog;else{var e=this.player.options_.crtOptions;"undefined"!=typeof e["iframe-post-data"]&&(this.playerData.post_id=e["iframe-post-data"].post_id,this.playerData.blog_uuid=e["iframe-post-data"].blog);var i=e["hls-service"];i&&(this.playerData.type="live",this.playerData.vendor=i)}},bindEvents:function(){this.$player.on("mousedown touchstart",s.bind(this.setTriggerElement,this)),this.player.on("userPlay",s.bind(this.onUserPlay,this)),this.player.on("play",s.bind(this.onVJSPlay,this)),this.player.on("pause",s.bind(this.onVJSPause,this)),this.player.on("loop",s.bind(this.onLooped,this)),this.player.on("end",s.bind(this.onVideoEnded,this)),this.player.on("restart",s.bind(this.onRestart,this)),this.player.on("muteClicked",s.bind(this.onMuteClicked,this)),this.player.on("fullscreenchange",s.bind(this.onFullscreenChange,this)),this.player.on("error",s.bind(this.onError,this)),this.player.on("seeking",s.bind(this.onSeeking,this)),this.player.on("resolutionchange",s.bind(this.onResolutionChange,this)),this.player.on("timeupdate",s.bind(this.onTimeUpdate,this)),this.$player.on("stopwaiting",s.bind(this.onStopWaiting,this)),this.player.on("firstplay",s.bind(this.onLoadStart,this)),this.player.on("loadeddata",s.bind(this.onLoadedData,this))},triggerEvent:function(t,e){e=this._buildLoggingData(e),r.trigger("VideoPlayer:"+t,{loggingData:e})},_buildLoggingData:function(t){return t=s.extend({},this.playerData,t),t.time_elapsed=this.player.crt.getElapsed(),t.position=this.player.crt.getPosition(),t},setTriggerElement:function(t){this.triggerElement=n(t.target)},onLogComplete:function(){this.triggerElement=n()},cacheUnloadData:function(){this.triggerEvent("cacheUnload")},onError:function(t){var e=this.player.error(),i="MEDIA_ERR_CUSTOM";if(e){switch(e.code){case 1:i="MEDIA_ERR_ABORTED";break;case 2:i="MEDIA_ERR_NETWORK";break;case 3:i="MEDIA_ERR_DECODE";break;case 4:i="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:i="MEDIA_ERR_ENCRYPTED"}this.triggerEvent("failed",{code:e.code,name:i})}},onUserPlay:function(t){this.onPlay(!0,t)},onVJSPlay:function(t){this.onPlay(!1,t)},onPlay:function(t,e){if(t||0!==this.triggerElement.closest(".vjs-big-play-button").length||0!==this.triggerElement.closest(".vjs-play-control").length){var i=this.player.crt.get("autoplay"),s={};e.onDock&&(s.onDock=!0),this.logConversion({name:"CONVERSION_ACTION_HTML5_VIDEO",extra:{player:this.player.techName,player_version:2}}),this.triggerEvent(i?"auto_play":"play",s),this.onLogComplete()}},onVJSPause:function(){this.onPause(!1)},onPause:function(t){(t||0!==this.triggerElement.closest(".vjs-big-play-button").length||0!==this.triggerElement.closest(".vjs-play-control").length)&&(this.triggerEvent("pause",this.playerData),this.onLogComplete())},onLooped:function(){this.triggerEvent("loop")},onVideoEnded:function(){this.triggerEvent("end")},onRestart:function(t){var e=s.pick(t,["start","end"]);this.triggerEvent("restart",e)},onFullscreenChange:function(){var t=this.player.isFullscreen();this.triggerEvent("fullscreen",{fullscreen:t}),this.player.crt.set("isFullscreen",t),this.onLogComplete()},onMuteClicked:function(){var t=this.player.muted()?"mute":"unmute";this.triggerEvent(t),this.player.crt.set("muted","mute"===t),this.onLogComplete()},onSeeking:function(){if(0!==this.triggerElement.closest(".vjs-progress-control").length){this.startSeekTime||(this.startSeekTime=this.player.crt.getStartSeekJumpPosition());var t={start:this.startSeekTime};this.triggerEvent("scrub_start",t),this.$doc.one("mouseup.crtEvents touchend.crtEvents",s.bind(this.onSeeked,this))}},onSeeked:function(){if(this.startSeekTime){var t={start:this.startSeekTime,end:this.player.currentTime()};this.triggerEvent("scrub_stop",t),this.startSeekTime=null}},onTimeUpdate:function(){this.triggerEvent("timeupdate")},onResolutionChange:function(t){var e=s.pick(t,"resolution");this.triggerEvent("resolutionchange",e)},onStopWaiting:function(t,e){!e.timeWaited||e.timeWaited<2e3||this.triggerEvent("waiting",e);
  },onLoadStart:function(){this.loadStartTime=s.now()},onLoadedData:function(){var t=s.now()-this.loadStartTime;this.triggerEvent("initialLoad",{loadTime:t})},logConversion:function(t){if(!this.videoConversionLogged&&a.bool("is_logged_in")&&!this.loggingInProgress){this.loggingInProgress=!0;var e=n.ajax({url:"/svc/log/conversion",type:"POST",contentType:"application/x-www-form-urlencoded",withFormKey:!0,data:"log="+JSON.stringify(t)});e.done(s.bind(this.onConversionSuccess,this)),e.fail(s.bind(this.onConversionFail,this))}},onConversionSuccess:function(){this.videoConversionLogged=!0,this.loggingInProgress=!1},onConversionFail:function(){this.loggingInProgress=!1}});t.exports=h},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(513),r=i(149).animation,a=o.getComponent("ClickableComponent"),l=o.extend(a,{constructor:function(){a.prototype.constructor.apply(this,arguments),this.player().usingNativeControls()&&this.player().controls(!1)},createEl:function(){return a.prototype.createEl.call(this,"div",{className:"vjs-big-play-button",innerHTML:'<span class="vjs-big-play-button-icon"></span><span class="vjs-big-pause-button-icon"></span></span><span aria-hidden="true"></span>'},{"aria-label":"play video"})},handleClick:function(){this.$el=this.$el||s(this.el()),this.player_.userActive(!0),this.player().usingNativeControls()?this.player().paused()&&(this.player().play(),this.player().controls(!0)):this.togglePlay()},togglePlay:function(){r(this.$el,n.bind(function(t){this.$el.removeClass("poof-play poof-pause")},this)),this.player().paused()?(this.player().play(),this.$el.removeClass("poof-pause").addClass("poof-play")):(this.player().pause(),this.$el.removeClass("poof-play").addClass("poof-pause"))},ready:function(){"Flash"===this.player().techName_&&this.hide()}});t.exports=l},function(t,e,i){"use strict";var s=i(513),n=i(523),o=s.getComponent("MuteToggle"),r=s.getComponent("ClickableComponent"),a=s.extend(o,{constructor:function(t,e){o.prototype.constructor.call(this,t,e),this.addListeners(t)},addListeners:function(t){this.on("click",this.onMuteClick)},onMuteClick:function(){this.player_.trigger("muteClicked")},createEl:function(){var t="vjs-mute-control vjs-control";return this.player_.options_.muted&&(t+=" vjs-vol-0"),r.prototype.createEl.call(this,"div",{className:t,innerHTML:n()},{})},update:function(){var t=this.player_.volume(),e=3;0===t||this.player_.muted()?e=0:.33>t?e=1:.67>t&&(e=2),this.controlText(this.player_.muted()?"Unmute":"Mute");for(var i=0;4>i;i++)s.removeClass(this.el_,"vjs-vol-"+i);s.addClass(this.el_,"vjs-vol-"+e)}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="mute-icon"><div class="speaker"></div><div class="unmuted"></div><div class="muted"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(513),n=i(3),o=s.getComponent("SeekBar"),r=s.extend(o,{constructor:function(){o.prototype.constructor.apply(this,arguments),this.handle=document.createElement("div"),this.handle.className="vjs-seek-handle vjs-slider-handle",this.handle.setAttribute("aria-live","off"),this.el_.appendChild(this.handle),this.boundDetectDuration=n.bind(this.detectDuration,this),this.player().on("loadedmetadata",this.boundDetectDuration)},handleMouseMove:function(t){o.prototype.handleMouseMove.apply(this,arguments),this.update()},detectDuration:function(){n.isFinite(this.player().duration())||null==this.el_||this.dispose()},update:function(){if(this.el_){var t=this.getPercent();isNaN(t)&&(t=0);var e=(100*t).toFixed(2)+"%";this.handle.style.left=e,this.bar.el().style.width=e}},dispose:function(){this.player().off("loadedmetadata",this.boundDetectDuration),o.prototype.dispose.apply(this,arguments)}});t.exports=r},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(513),r=o.getComponent("Component"),a=o.extend(r,{isHidden:!0,constructor:function(t,e){r.call(this,t,e),t.ready(n.bind(this.onReady,this))},onReady:function(){this.$player=s(this.player().el_),this.$el=s(this.el()),this.$loader=this.$el.find(".Knight-Rider-loader");var t=n.bind(this.hideLoader,this),e=n.bind(this.showLoader,this);this.player().on("waiting",e),this.player().on("canplay",t),this.player().on("canplaythrough",t),this.player().on("playing",t),this.player().on("seeking",e),this.player().on("seeked",t),this.player().on("ended",t),this.player().on("resolutionchange",e)},createEl:function(){return r.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",innerHTML:'<div class="Knight-Rider-loader centered"><div class="Knight-Rider-bar"></div><div class="Knight-Rider-bar"></div><div class="Knight-Rider-bar"></div></div>'},{"aria-label":"loading"})},hideLoader:function(t){return this.isHidden?this:(this.$loader.removeClass("animate"),this.$player.removeClass("vjs-loading"),this.isHidden=!0,this)},showLoader:function(t){return this.isHidden?(this.$loader.addClass("animate"),this.$player.addClass("vjs-loading"),this.isHidden=!1,this):this},dispose:function(){r.prototype.dispose.apply(this,arguments),this.$player=null,this.$el=null}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(513),o=n.getComponent("Component"),r=n.extend(o,{sdURL:null,hdURL:null,forceHD:null,isUsingSD:!0,timeIntervalBinding:null,constructor:function(t,e){o.prototype.constructor.call(this,t,e),this.addListeners(t)},addListeners:function(t){this.on("click",this.toggleHDState)},createEl:function(){if(this.hdURL=this.player_.options_.crtOptions.hdUrl,this.forceHD=this.player_.options_.forceHD,!this.hdURL||this.forceHD)return o.prototype.createEl.call(this,"div",{},{});this.player_.addClass("vjs-has-hd-toggle");var t=o.prototype.createEl.call(this,"div",{className:"vjs-hd-toggle vjs-sd vjs-menu-button vjs-control",innerHTML:"<span>HD</span>"},{});return t},currentSource:function(){return this.player_.currentSrc()},toggleSrc:function(){var t;this.isUsingSD?(this.sdURL=this.currentSource(),t=this.hdURL,n.removeClass(this.el_,"vjs-sd"),n.addClass(this.el_,"vjs-hd")):(t=this.sdURL,n.removeClass(this.el_,"vjs-hd"),n.addClass(this.el_,"vjs-sd")),this.isUsingSD=!this.isUsingSD,this.player_.src({src:t,type:"video/mp4"})},toggleHDState:function(){var t=this.player_.currentTime(),e=this.player_.paused(),i=this.player_.muted();this.player_.addClass("vjs-quality-toggling"),this.player_.trigger({type:"resolutionchange",resolution:this.isUsingSD?"hd":"sd"}),s.delay(s.bind(function(){this.player_.pause(),this.toggleSrc(),this.player_.ready(function(){this.player_.one("loadedmetadata",s.bind(function(){this.player_.currentTime(t)},this)),this.timeIntervalBinding=s.bind(function(){this.player_.currentTime()-t>.1&&(this.player_.removeClass("vjs-quality-toggling"),this.player_.off("timeupdate",this.timeIntervalBinding),e&&(this.player_.pause(),this.player_.muted(i)))},this),this.player_.on("timeupdate",this.timeIntervalBinding),s.defer(s.bind(function(){this.player_.load(),i===!1&&e===!0&&this.player_.muted(!0),this.player_.play()},this))})},this),300)}});t.exports=r},function(t,e,i){"use strict";var s=i(513),n=i(3),o=s.getComponent("DurationDisplay"),r=s.extend(o,{constructor:function(){o.prototype.constructor.apply(this,arguments),this.boundDetectDuration=n.bind(this.detectDuration,this),this.player().on("loadedmetadata",this.boundDetectDuration)},detectDuration:function(){n.isFinite(this.player().duration())||null==this.el_||this.dispose()},dispose:function(){this.player().off("loadedmetadata",this.boundDetectDuration),o.prototype.dispose.apply(this,arguments)}});t.exports=r},,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(164).animate,o=i(148),r=i(170),a=i(205),l=i(206),h=i(159),c=o.extend({className:"post-forms-glass",mixins:[a,l,h],initialize:function(t){this.options=t=s.extend({active:!1,visible:!1},t),this.set({active:!!t.active,visible:!!t.visible}),this.get("visible")?this.$el.css({opacity:1,display:"block"}):this.$el.css({opacity:0,display:this.get("active")?"block":"none"}),this.listenTo(this,{"change:active":this._changeActive,"change:visible":this._changeVisible})},show:function(t){return this.set("active",!(null!=t&&!t)),this.attributes.visible&&this._showing?this._showing:(this.attributes.visible=!0,this._show())},hide:function(t){return this.set("active",!(null==t&&!t)),!this.attributes.visible&&this._hiding?this._hiding:(this.attributes.visible=!1,this._hide())},_show:function(){var t=this._showing=n(this.$el,{opacity:1},{duration:r(150),display:"block"});return t},_hide:function(){var t=this._hiding=n(this.$el,{opacity:0},{duration:r(150),display:this.get("active")?"block":"none"});return t},_changeActive:function(t,e){e?this.$el.addClass(this.className+"_active active"):(this.$el.removeClass(this.className+"_active active"),!this._changing||s.has(this.changed,"visible")||this.get("visible")||this.$el.css("display","none"))},_changeVisible:function(t,e){e?(this.$el.addClass(this.className+"_visible visible"),this._show()):(this.$el.removeClass(this.className+"_visible visible"),this._hide())},render:function(){return this}});t.exports=c},function(t,e,i){"use strict";var s=i(8),n=i(164).animate,o=i(148),r=i(170),a=i(205),l=i(206),h=i(159),c=i(542),u=o.extend({className:"post-forms-modal",mixins:[a,l,h],template:c,initialize:function(t){this.set("visible",t&&t.visible),this.get("visible")?this.$el.css({opacity:1,display:"block"}):this.$el.css({opacity:0,display:"none"}),this.$body=s("body"),this.listenTo(this,"change:visible",this._toggleVisible)},show:function(){return this.attributes.visible=!0,this._show()},hide:function(){return this.attributes.visible=!1,this._hide()},setContentSubView:function(t){return this.subViews.content&&(this.stopListening(this.subViews.content),this.subViews.content.remove()),this.subViews.content=t,this.listenTo(t,"prepared",this._onSubViewPrepare),this.listenTo(t,"torndown",this._onSubViewTeardown),this.isRendered()&&this.attachSubView("content"),this},_onSubViewPrepare:function(t){this.show()},_onSubViewTeardown:function(t){this.hide()},_show:function(){this._disableBodyScroll(),this.$el.css("display","block");var t=n(this.$el,{opacity:1},{duration:r(100),display:"block"});return t},_hide:function(){this._enableBodyScroll();var t=n(this.$el,{opacity:0},{duration:r(100),display:"none"});return t},_toggleVisible:function(t,e){e?(this.$el.addClass(this.className+"_visible visible"),this._show()):(this.$el.removeClass(this.className+"_visible visible"),this._hide())},_disableBodyScroll:function(){this.$body.css("overflow","hidden")},_enableBodyScroll:function(){this.$body.css("overflow","")},render:function(){return this.$el.html(this.template(this.attributes)),this.attachSubViews(),this}});t.exports=u},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="v-center-outer"><div class="v-center-inner"><div class="v-center-content"><div data-subview="content"></div></div></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(120),o=i(164).animate,r=i(167),a=i(170),l=i(169),h=i(148),c=(i(102),i(205)),u=i(206),d=i(159),p=i(544),g=i(545),_=i(547),m=h.extend({mixins:[c,u,d,l],template:_,defaultOptions:{animateDuringPrepare:!0,animateHeightWithContent:!1,startHeight:null,useLoader:!0,loaderDelay:250,transitionBackground:!1},defaults:{minHeight:!1,pretransition:!1,midtransition:!1},initialize:function(t){t instanceof h&&(t={postForm:t}),this.options=t=s.extend({},this.defaultOptions,t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),t.postForm&&this.setPostForm(t.postForm),this.listenTo(this,"change:minHeight",this._onChangeMinHeight),this.listenTo(this,"change:pretransition",this._onChangePretransition),this.listenTo(this,"change:midtransition",this._onChangeMidtransition)},_onChangeMinHeight:function(t,e){o(this.$el,"stop"),e||s.isNumber(e)?o(this.$el,{"min-height":e},{duration:a(Math.min(Math.max(250,e),750))}):(e=s.parseInt(this.$el.css("min-height"),10)||0,o(this.$el,{"min-height":[0,e]},{duration:a(Math.min(Math.max(250,e),750))}).then(s.bind(function(){this.$el.css("min-height","")},this)))},_onChangePretransition:function(t,e){e?this.$el.addClass("post-form-container-pretransition"):this.$el.removeClass("post-form-container-pretransition")},_onChangeMidtransition:function(t,e){e?this.$el.addClass("post-form-container-transition"):this.$el.removeClass("post-form-container-transition")},setPostFormComponent:function(t){return this._postFormComponent!==t?(this._postFormComponent&&this.stopListening(this._postFormComponent),this._postFormComponent=t,this.postForm=t.postForm,this):void 0},prepare:function(t){return this.isRendered()||this.render(),this.trigger("prepared",this),this.loadingDelay=s.delay(s.bind(function(){this.loader&&this.options.useLoader&&this.loader.set("loading",!0)},this),this.options.loadingDelay),this.options.animateDuringPrepare&&(this._hideOriginalContent=this.hideOriginalContent(t).then(s.bind(function(){return this._hideOriginalContent=!1,this},this))),n.resolve(this)},attach:function(t){return this.loader&&(clearTimeout(this.loadingDelay),this.loader.set("loading",!1)),this.set("pretransition",!0),this.postForm.forceHidden(),this.attachSubView(this.postForm,"postForm"),n.resolve(this)},hideOriginalContent:function(t){var e=this.options.startHeight||this.originalContent.measureHeight(),i=this.postForm.measureHeight();return e||this.options.originalContent||(e=i),r([function(){null!=e&&this.$el.css("height",e),this.set("midtransition",!0),this.originalContent.set("enabled",!1)},function(){return n.join(t(),this.originalContent.animateHide(a(100)))}],this)},showPostForm:function(t){var e=this.options.startHeight||this.originalContent.measureHeight(),i=this.postForm.measureHeight();return e||this.options.originalContent||(e=i),r([function(){return this.options.animateHeightWithContent||this.originalContent.get("hidden")?void 0:this._hideOriginalContent||this.hideOriginalContent(t)},function(){var s=[];return this.options.animateHeightWithContent&&!this.originalContent.get("hidden")&&s.push(this._hideOriginalContent||this.hideOriginalContent(t)),null==i||null==e||(i===e?this.$el.height(i):s.push(o(this.$el,{height:[i,e]},{duration:a(150),easing:[.4,1.3,.7,1]}))),n.all(s)},function(){return this.set("placeholder",!1),this.postForm.animateShow(a(100))},function(){this.set("pretransition",!1),this.set("midtransition",!1),this.$el.css("height","")}],this)},hidePostForm:function(t){var e=this.postForm.measureHeight(),i=this.originalContent.measureHeight();return i||this.options.originalContent||(i=e),r([function(){this.$el.css("height",e),this.set("midtransition",!0)},function(){return this.postForm.animateHide(a(100))},function(){if(this.set("pretransition",!0),null==i||null==e);else{if(i!==e)return o(this.$el,{height:[i,e]},{duration:a(100),easing:[0,0,.6,1]});this.$el.height(i)}},function(){return n.join(t(),this.originalContent.animateShow(a(50)))},function(){this.set("midtransition",!1),this.set("pretransition",!1),this.$el.css("height",""),this.originalContent.set("enabled",!0)}],this)},serialize:function(){return{originalContent:!!this.options.originalContent,transitionBackground:this.options.transitionBackground}},beforeRender:function(){this.loader||(this.loader=new g),this.originalContent||(this.options.originalContent instanceof p?this.originalContent=this.options.originalContent:this.originalContent=new p({el:this.options.originalContent})),this.originalContent.$el.detach()},render:function(){return this.$el.html(this.template(this.serialize())),this.subViews.originalContent=this.originalContent,this.subViews.loader=this.loader,this.subViews.postForm=this.postForm,this.attachSubViews(),this},afterRender:function(){return this.$el.addClass("post-forms-above-glass is_persistent"),this.renderSubViews()},beforeTeardown:function(){return this.subViews.loader=null,this},afterTeardown:function(){return this.$el.removeClass("post-forms-above-glass post-form-container-pretransition post-form-container-transition is_persistent"),this.loader&&(this.loader.remove(),this.loader=null),this.$el.children(".post-transition-background").remove(),delete this.postForm,this.trigger("torndown",this),this.teardownSubViews()}});t.exports=m},function(t,e,i){"use strict";var s=i(3),n=i(164).animate,o=i(148),r=i(205),a=i(159),l=o.extend({defaults:{hidden:!1,enabled:!0},mixins:[r,a],initialize:function(t){this.set("hasContent",t&&t.el),this.originalCSS=this._getCSS(["opacity"]),this.listenTo(this,"change:enabled",this._onChangeEnabled),this.listenTo(this,"change:hidden",this._onChangeHidden)},_getCSS:function(t){var e={};return s.forEach(t,function(t){e[t]=this.$el.css(t)},this),e},_onChangeEnabled:function(t,e){this.$el.toggleClass("no-pointer-events",!e)},_onChangeHidden:function(t,e){this.$el.toggleClass("collapse",e)},measureHeight:function(){if(!this.get("hasContent"))return null;var t=this.get("hidden");this.set("hidden",!1);var e=this.$el.outerHeight();return this.set("hidden",t),e},animateShow:function(t,e){return t||(t=0),e||(e=0),n(this.$el,{opacity:1},{duration:t,delay:e,begin:s.bind(function(){this.set("hidden",!1)},this)})},animateHide:function(t,e){return t||(t=0),e||(e=0),n(this.$el,{opacity:0},{duration:t,delay:e}).then(s.bind(function(){this.set("hidden",!0)},this))},render:function(){return this},teardown:function(){return this.$el.css(this.originalCSS),this}});t.exports=l},function(t,e,i){"use strict";var s=i(148),n=i(205),o=i(206),r=i(159),a=i(546),l=s.extend({className:"post-forms-loader",mixins:[n,o,r],template:a,initialize:function(t){this.listenTo(this,"change:loading",this._onChangeLoading),this.set("loading",t&&t.loading)},_onChangeLoading:function(t,e){this.isRendered()&&(e?(this.$el.addClass("loading"),this.$$(".Knight-Rider-loader").addClass("animate")):(this.$el.removeClass("loading"),this.$$(".Knight-Rider-loader").removeClass("animate")))},render:function(){return this.$el.html(this.template(this.attributes)),this}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";Array.prototype.join;with(obj)__p+='<div class="Knight-Rider-loader ',loading&&(__p+="animate"),__p+='"><div class="Knight-Rider-bar"></div><div class="Knight-Rider-bar"></div><div class="Knight-Rider-bar"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";Array.prototype.join;with(obj)transitionBackground&&(__p+=' <div class="post-transition-background"></div> '),__p+=" ",originalContent&&(__p+=' <div data-subview="originalContent"></div> '),__p+=' <div data-subview="loader"></div><div data-subview="postForm"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(120),o=i(164).animate,r=i(544),a=i(206),l=i(159),h=i(109),c=i(175),u=r.extend({mixins:[a,l],events:{"click [data-js-text]":"_onClickNewPost","click [data-js-photo]":"_onClickNewPost","click [data-js-quote]":"_onClickNewPost","click [data-js-link]":"_onClickNewPost","click [data-js-chat]":"_onClickNewPost","click [data-js-audio]":"_onClickNewPost","click [data-js-video]":"_onClickNewPost"},setPostType:function(t){this.postType=t},animateShow:function(t,e){return t||(t=0),e||(e=0),this.$el.css({display:"block",opacity:1}),function(i){var s=this.js$(i),r=s.children("i"),a=s.children(".new_post_label_text"),l=this.$(".new_post_label").not(s),h=l.children("i"),c=l.children(".new_post_label_text"),u=[o(h,{scale:1,translateY:[0,10],opacity:1},{duration:t,delay:e}),o(c,{translateY:[0,10],opacity:1},{duration:t,delay:e})];return s.length&&r.length&&u.push(o(r,{scale:[1,1.5],translateY:[0,0],opacity:1},{duration:t,delay:e}),o(a,{translateY:[0,0],opacity:1},{duration:t,delay:e})),n.all(u)}.call(this,this.postType)},animateHide:function(t,e){t||(t=0),e||(e=0),function(i){var s=this.js$(i),r=s.children("i"),a=s.children(".new_post_label_text"),l=this.$(".new_post_label").not(s),h=l.children("i"),c=l.children(".new_post_label_text"),u=[o(h,{scale:[1,1],translateY:[10,0],opacity:0},{duration:t,delay:e}),o(c,{translateY:[10,0],opacity:0},{duration:t,delay:e})];return s.length&&r.length&&u.push(o(r,{scale:[1.5,1],translateY:[0,0],opacity:0},{duration:t,delay:.5*t+e}),o(a,{translateY:[0,0],opacity:0},{duration:t,delay:e})),n.all(u)}.call(this,this.postType).then(s.bind(function(){this.$el.css({display:"none",opacity:0})},this))},_onClickNewPost:function(t){if(t.stopPropagation(),t.preventDefault(),this.get("enabled")){var e=t.currentTarget.getAttribute("data-post-endpoint")||t.currentTarget.getAttribute("data-post-type");h.trigger("postForms:open",{postType:e,postFormType:c.inline})}}});t.exports=u},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="post-tab-switching"><div class="tab-post-types count-'+__e(icons.length)+'"> ',_.forEach(icons,function(t,e){__p+=' <div class="tab-post-type item" data-index="'+__e(e)+'" data-post-type="'+__e(t.name)+'"><div class="post-type-icon icon-'+__e(t.name)+'"><i class="post-type-icon-overlay"></i></div><div class="post-type-name"><span class="post-type-name-span">'+__e(t.label)+"</span></div></div> "}),__p+=" </div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(155),n=i(99),o=i(3),r=i(8),a=s.extend({events:{mouseleave:"onMouseLeave",mouseenter:"onMouseEnter"},defaults:{totalImages:5,changeOnHover:!0,image:!1},initialize:function(){this.assetsHost=n.get("Context/hosts/assets_host"),this.isRetina=window.devicePixelRatio&&window.devicePixelRatio>1,this.$imageContainer=this.$(".preload-container"),this.generateImageIds(),this.get("image")||(this.applyRandomImage(),this.addImageToContainer()),this.setBackgroundImage(this.get("image")),this.listenTo(this,"change:image",function(t,e){this.addImageToContainer(),this.setBackgroundImage(e)})},generateImageIds:function(){this.imageIds=o.shuffle(o.range(1,this.get("totalImages")+1))},onMouseEnter:function(t){var e=this,i=this.getCurrentImageObject();i.get(0).complete?this.$el.addClass("opacity-switch"):i.on("load",function(){e.$el.is(":hover")&&e.get("image")===i.data("imgId")&&e.onMouseEnter()})},onMouseLeave:function(t){var e=this;this.$el.removeClass("opacity-switch"),this.get("changeOnHover")&&setTimeout(function(){e.applyRandomImage()},200)},addImageToContainer:function(){if(!this.getCurrentImageObject().get(0)){var t=this.isRetina?"@2x":"";r('<img data-img-id="'+this.get("image")+'">').attr("src",this.assetsHost+"/images/logo/hover-animations/"+this.get("image")+t+".png").appendTo(this.$imageContainer)}},applyRandomImage:function(){0===this.imageIds.length&&this.generateImageIds(),this.set("image",this.imageIds[0]),this.imageIds.shift()},getCurrentImageObject:function(){return this.$imageContainer.find('[data-img-id="'+this.get("image")+'"]')},setBackgroundImage:function(t){this.$imageContainer.css("background-image","url("+this.getCurrentImageObject().attr("src")+")")}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(110),r=i(552),a=i(561),l=n.extend({events:{click:"openPopover"},addUnreadCount:function(){this.$el.append(a({value:this.user.getUnreadCount()}))},initialize:function(){this.popover=null,this.user=o(),this.addUnreadCount(),this.popoverOptions={container:this.$el,viewOptions:{}}},openPopover:function(t){if(t.preventDefault(),this.popover)this.popover.show();else{var e=this.$el.closest(".l-header-container");e.length&&(this.popoverOptions.viewOptions.isFixedPosition="fixed"===e.css("position")),r(s.bind(function(t){this.popover=new t(this.popoverOptions).render()},this))}}});t.exports=l},function(t,e,i){"use strict";var s=i(177),n=i(553),o=new n("account-popover"),r=function(t){o.start(),i.e(2,function(e){try{t(i(554))}catch(n){s(n,"account-popover")}finally{o.end()}})};t.exports=r},function(t,e,i){"use strict";function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,i,s){return i&&t(e.prototype,i),s&&t(e,s),e}}(),o=i(3),r=i(109),a=function(){function t(e){if(s(this,t),o.isString(e)?e={chunkName:e}:e||(e={}),!e.chunkName,!1)throw new Error("Async latency logger requires a chunkName");this.chunkName=e.chunkName||""}return n(t,[{key:"start",value:function(){this.startTime=Date.now()}},{key:"end",value:function(){this.startTime&&r.trigger("async-loading:complete:"+this.chunkName,{loggingData:{chunkName:this.chunkName,latency:Date.now()-this.startTime,userAgent:o.get(window,"navigator.userAgent",""),path:o.get(document,"location.pathname")}})}}]),t}();t.exports=a},,,,,,,,function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<span class="tab_notice tab-notice--outlined ',value>0&&(__p+="tab-notice--active"),__p+='"><span class="tab_notice_value">'+__e(value)+"</span></span>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(148),n=i(109),o=i(563),r=i(110),a=s.extend({events:{click:"openPopover"},addUnreadCount:function(){},initialize:function(){this.popover=null,this.user=r(),this.addUnreadCount(),this.popoverOptions={container:this.$el,viewOptions:{}}},openPopover:function(t){if(t.preventDefault(),this.popover)this.popover.show();else{var e=this.$el.closest(".l-header-container");e.length&&(this.popoverOptions.viewOptions.isFixedPosition="fixed"===e.css("position")),this.popover=new o(this.popoverOptions).render()}n.trigger("activityLinks:click",{loggingData:{source:"app-header"}})}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(143),o=i(564),r=i(110),a=n.extend({name:"ActivityPopover",view:function(t){return t=s.extend({},{model:r(),pinnedTarget:this.container,isFixedPosition:!0,autoTeardown:!1,teardownOnEscape:!1},t),new o(t)},show:function(){this.view.show()},render:function(){return this.view.render(),this.trigger("append"),this}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(100),r=i(155),a=i(565),l=i(109),h=i(194),c=i(212),u=i(213),d=i(149).transition,p=i(120),g=i(566),_=i(570),m=i(572),f=i(142),v=i(395),b=r.extend({defaults:{popoverData:{},preventInteraction:!0,currentTumblelog:!1},className:"popover--activity-popover",mixins:[c],template:a,initialize:function(t){if(this.options=s.extend({},this.defaults,t),!this.get("currentTumblelog")){var e=this.model.channels.findWhere({is_current:!0});this.set("currentTumblelog",e)}},render:function(){return this.$el.html(this.template()),this.$pinned.addClass("active"),this.$activityNotifications=this.$(".activity-popover-notifications"),this.$activityHeader=this.$(".activity-popover-header"),this.$activityPopoverMenu=this.$(".popover_menu"),s.delay(s.bind(function(){this.$activityPopoverMenu.addClass("popover--active"),this.bindClickOutside(),this.addTumblelogPopoverZIndex()},this),1),this.subviews.tumblelogSelect=new g({className:"activity-popover-tumblelog-select-container",collection:this.model.channels,dropdownClass:"popover--activity-popover-tumblelog-select-dropdown",popoverOptions:{popoverContainer:".popover--activity-popover"}}),this.prepareActivityNotifications(),this.listenTo(this.subviews.tumblelogSelect,"change:currentTumblelog",this.updateSubviews),this},addTumblelogPopoverZIndex:function(){this.$el.attr("data-tumblelog-popover-zindex",this.$el.css("z-index"))},bindClickOutside:function(){var t={preventInteraction:!0,ignoreSelectors:[".popover_content_wrapper",".tumblelog_popover",".ui_peepr_glass",".drawer"]};this.clickOutside=new u(this.el,t),this.clickOutside.on("click:outside",this.hide,this),this.clickOutside.on("click:inside",this.hideActivityPopover,this),this.listenTo(l,"DOMEventor:keyup:escape",this.hide)},unbindClickOutside:function(){this.clickOutside.remove(),this.clickOutside=null,this.stopListening(l,"DOMEventor:keyup:escape")},createSubviews:function(){this.removeSubviews(),this.toggleLoader(!1),this.subviews.sparkline=new _({model:this.get("currentTumblelog")}),this.subviews.activityNotifications=new m({model:this.get("currentTumblelog")}),this.rendered&&(this.appendSubview(this.subviews.sparkline,this.$activityHeader),this.appendSubview(this.subviews.activityNotifications,this.$activityNotifications))},hasNecessaryData:function(){return this.get("currentTumblelog").has("activity_notifications")},loadData:function(){return this.get("currentTumblelog").fetch_activity_notifications()},prepareActivityNotifications:function(){return p.promise(s.bind(function(t,e){this.hasNecessaryData()?t(this.createSubviews()):(this.toggleLoader(!0),this.loadData().then(s.bind(function(){t(this.createSubviews())},this))["catch"](function(t){e(t)}))},this))["catch"](s.bind(function(t){this.toggleLoader(!1),f.alert(o("Woops :("))},this))},updateSubviews:function(t,e){this.set("currentTumblelog",e),this.prepareActivityNotifications()},removeSubviews:function(){this.subviews&&s.each(this.subviews,function(t){t.get("removable")&&t.remove()})},toggleLoader:function(t){t===!0?this.loader?this.loader.set("loading",!0):this.loader=new v({$container:this.$el,type:"bar",classModifiers:"bottom",loading:!0}):this.loader&&this.loader.set("loading",!1)},beforeTeardown:function(){return this.remove(),this.$pinned.removeClass("active"),this},hideActivityPopover:function(t){var e=n(t.target),i=e.closest(".tumblelog_popover"),o=e.closest("[href]");s.isEmpty(i)||s.isEmpty(o)||!h.isTumblelogUrl(o.attr("href"))||this.hide()},hide:function(){this.unbindClickOutside(),this.$pinned.removeClass("active"),this.$activityPopoverMenu.removeClass("popover--active"),d(this.$el,s.bind(function(){this.afterHide()},this))},afterHide:function(){this.$el.css({display:"none"})},show:function(){this.bindClickOutside(),this.$pinned.addClass("active"),this.$el.css({display:"block"}),s.delay(s.bind(function(){this.$activityPopoverMenu.addClass("popover--active")},this),1)}});t.exports=b},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<div class="popover popover_menu popover_gradient"><div class="popover_inner"><div class="activity-popover-header"> '+(null==(__t=_subview("tumblelogSelect"))?"":__t)+" "+(null==(__t=_subview("sparkline"))?"":__t)+" "+(null==(__t=_subview("loader"))?"":__t)+' </div><div class="activity-popover-notifications"> '+(null==(__t=_subview("activityNotifications"))?"":__t)+" </div></div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(567),r=i(568),a=i(206),l=i(179),h=n.extend({
  template:o,mixins:[a],defaults:{currentTumblelog:!1,isOpen:!1,requiresDropdown:!1,showCaret:!0,showName:!0,dropdownClass:null,popoverOptions:null,avatarSize:96,badgeCountField:null,showTotalBadge:!0,showNumberInBadge:!1,includeCurrentBlogInTotalBadge:!1,maxBadgeCount:99,badgeActiveClass:"has-badge"},events:{"click [data-js-button]":"toggleDropdown"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"collection")),this.get("currentTumblelog")||this.set("currentTumblelog",this.collection.findWhere({is_current:!0})),this.set("requiresDropdown",this.collection.length>1),!s.isEmpty(this.get("badgeCountField"))&&this.get("requiresDropdown")||this.set("showTotalBadge",!1)},getTemplateData:function(){var t=this.get("showTotalBadge"),e=t&&this.get("showNumberInBadge"),i=t?this.getBadgeCount():null;return{avatarUrl:l(this.getCurrentTumblelogProperty("avatar_url"),this.get("avatarSize")),displayName:this.getCurrentTumblelogProperty("name"),requiresDropdown:this.get("requiresDropdown"),hasBadge:t&&i>0,badgeCountString:e?this.getBadgeCountString(i):null}},createDropdown:function(){var t=s.extend({},this.get("popoverOptions"),{identifier:"blogSelector:dropdown",pinnedTarget:this.js$("avatar"),shift:{x:86,y:10},collection:this.collection,currentTumblelog:this.getCurrentTumblelog(),badgeCountField:this.get("badgeCountField"),maxBadgeCount:this.get("maxBadgeCount")});this.dropdown=new r(t),this.get("dropdownClass")&&this.dropdown.$el.addClass(this.get("dropdownClass")),this.listenTo(this.dropdown,"change:currentTumblelog",this.adjustCurrentTumblelog),this.listenTo(this.dropdown,"open",this._onDropdownOpen),this.listenTo(this.dropdown,"close",this._onDropdownClose)},_onDropdownOpen:function(){this.set("isOpen",!0)},_onDropdownClose:function(){this.set("isOpen",!1)},_onChangeIsOpen:function(t,e){this.js$("caret").toggleClass("is-open",e)},toggleDropdown:function(){this.get("requiresDropdown")&&(this.dropdown.isOrWasRecentlyRendered()||(this.createDropdown(),this.dropdown.render()))},afterRender:function(){return this.get("showTotalBadge")&&(this.listenTo(this.collection,"change:"+this.get("badgeCountField"),this._onBadgeCountChange),this._onBadgeCountChange()),this.get("requiresDropdown")&&(this.createDropdown(),this.js$("button").addClass("has-dropdown"),this.listenTo(this,"change:isOpen",this._onChangeIsOpen),this.listenTo(this,"change:showCaret",this._onChangeShowCaret),this._onChangeIsOpen(this,this.get("isOpen")),this._onChangeShowCaret(this,this.get("showCaret"))),this.listenTo(this,"change:showName",this._onChangeShowName),this._onChangeShowName(this,this.get("showName")),this},getCurrentTumblelog:function(){return this.get("currentTumblelog")},getCurrentTumblelogProperty:function(t){var e=this.getCurrentTumblelog();return e&&e.has(t)&&s.isString(t)?e.get(t):void 0},adjustCurrentTumblelog:function(){var t;this.set("currentTumblelog",this.dropdown.get("currentTumblelog")),this.rendered&&(t=l(this.getCurrentTumblelogProperty("avatar_url"),this.get("avatarSize")),this.js$("avatar").attr("src",t),this.js$("label").text(this.getCurrentTumblelogProperty("name")),this.get("showTotalBadge")&&!this.get("includeCurrentBlogInTotalBadge")&&this._onBadgeCountChange())},teardown:function(){return this.remove(),this},getBadgeCount:function(){var t,e=this.get("currentTumblelog");return this.get("badgeCountField")?(t=s.sum(this.collection.pluck(this.get("badgeCountField"))),e&&!this.get("includeCurrentBlogInTotalBadge")&&(t-=e.get(this.get("badgeCountField"))),Math.max(0,t)):null},getBadgeCountString:function(t){var e=this.get("maxBadgeCount");return t>e?e+"+":t>0?t:""},updateBadge:function(t){var e=this.js$("badge");e.toggleClass(this.get("badgeActiveClass"),t>0),this.get("showNumberInBadge")&&e.text(this.getBadgeCountString(t))},_onBadgeCountChange:function(){this.updateBadge(this.getBadgeCount())},_onChangeShowCaret:function(t,e){this.js$("caret").toggle(e)},_onChangeShowName:function(t,e){this.js$("label").toggle(e)}});t.exports=h},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="blog-selector-container"><div class="selected-blog" data-js-button><img class="avatar" src="'+__e(avatarUrl)+'" alt="'+(null==(__t=displayName)?"":__t)+'" data-js-avatar> <span class="name" data-js-label>'+(null==(__t=displayName)?"":__t)+"</span> ",requiresDropdown&&(__p+=' <span class="caret '+__e(hasBadge?"has-badge":"")+'" data-js-caret data-js-badge>',badgeCountString&&(__p+=__e(badgeCountString)),__p+="</span> "),__p+=" </div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(569),r=i(212),a=i(206),l=i(179),h=i(390),c=n.extend({className:"popover--blog-selector-dropdown",events:{"click [data-js-tumblelog]":"selectBlog"},mixins:[a,r],template:o,defaults:{currentTumblelog:!1,avatarSize:96,badgeCountField:null,maxBadgeCount:99,badgeActiveClass:"tab-notice--active"},initialize:function(t){if(t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"collection")),!this.get("currentTumblelog")){var e=this.collection.findWhere({is_current:!0});this.set("currentTumblelog",e)}},selectBlog:function(t){var e=this.$(t.currentTarget).index();this.set("currentTumblelog",this.collection.at(e)),this.teardown()},createScrollbar:function(){this.scrollbar||(this.scrollbar=new h(this.js$("scrollbar")))},afterRender:function(){return this.js$("scrollbar").addClass("popover-sublist popover-sublist--scrollable"),s.defer(s.bind(this.createScrollbar,this)),this.delegateEvents(),this.isShowBadges()&&this.listenTo(this.collection,"change:"+this.get("badgeCountField"),this._onBadgeCountChange),this},isShowBadges:function(){return!s.isEmpty(this.get("badgeCountField"))},getBadgeCount:function(t){return this.get("badgeCountField")&&t?t.get(this.get("badgeCountField")):null},getBadgeCountString:function(t){var e=this.get("maxBadgeCount");return 0>=t?"":t>e?e+"+":t},getTemplateData:function(){var t,e=this.toJSON(),i=this.get("currentTumblelog");return i&&s.extend(e,{currentTumblelog:i.get("name")}),t=this.collection.map(function(t){return s.extend({avatarUrl:l(t.get("avatar_url"),this.get("avatarSize")),displayName:t.getDisplayName(),badgeCountString:this.getBadgeCountString(this.getBadgeCount(t))},t.toJSON())},this),s.extend(e,{channels:t,isShowBadges:this.isShowBadges()}),e},beforeTeardown:function(){this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null),this.stopListening()},teardown:function(){return this.remove()},updateBadge:function(t){var e,i=this.$$("[data-js-channel-badge="+t.get("name")+"]");0!==i.length&&(e=this.getBadgeCount(t),i.toggleClass(this.get("badgeActiveClass"),e>0),e>0&&i.find("[data-js-channel-badge-text]").text(this.getBadgeCountString(e)))},_onBadgeCountChange:function(t){return this.updateBadge(t)}});t.exports=c},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="pop-menu"><ul class="inner select-right" data-js-scrollbar> ',_.forEach(channels,function(t){__p+=' <li class="item-option '+__e(t.name===currentTumblelog?"selected":"")+'" data-js-tumblelog><div class="avatar"><img src="'+__e(t.avatarUrl)+'" alt="'+__e(t.name)+'"> ',isShowBadges&&(__p+=' <span class="unread-indicator tab_notice tab-notice--outlined on-light ',t.badgeCountString&&(__p+="tab-notice--active "),__p+='" data-js-channel-badge="'+__e(t.name)+'"><span class="tab_notice_value" data-js-channel-badge-text>'+__e(t.badgeCountString)+"</span></span> "),__p+=' </div><div class="info-container"><p class="name">'+__e(t.displayName)+'</p><p class="title">'+(null==(__t=t.directory_safe_title)?"":__t)+"</p></div></li> "}),__p+=" </ul></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(571),r=n.extend({template:o,className:"activity-popover-sparkline-container",defaults:{removable:!0,sparklineFormatting:{type:"line",lineColor:"#7f7f7f",fillColor:!1,lineWidth:4,spotColor:!1,minSpotColor:!1,maxSpotColor:!1,disableInteraction:!0,width:"72px",height:"30px"}},getTemplateData:function(){return{activityPageUrl:"/blog/"+this.model.get("name")+"/activity"}},addSparkline:function(){var t=this.$el.find(".sparkline"),e=JSON.parse(this.model.get("activity_data").sparkline);e&&0!==s.max(e)&&s.isFunction(t.sparkline)&&(t.sparkline(e,this.get("sparklineFormatting")),t.find("canvas").css({height:"15px",width:"36px"}))},afterRender:function(){s.defer(s.bind(this.addSparkline,this))},teardown:function(){return this.remove(),this}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<a class="activity-popover-sparkline-link" href="'+(null==(__t=activityPageUrl)?"":__t)+'" title="Activity"><div class="sparkline"></div></a>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(573),r=i(206),a=i(390),l=i(574),h=i(588),c=i(590),u=i(9),d=n.extend({className:"blog-activity",template:o,mixins:[r],defaults:{removable:!0},initialize:function(){},addChannelScrollbar:function(){this.notificationScrollBar=new a(this.js$("blog-activity-notification-list"))},afterRender:function(){this.model.get("activity_notifications").length>1&&(s.defer(s.bind(this.addChannelScrollbar,this)),this.js$("blog-activity-notification-list").addClass("popover_sublist popover_sublist--scrollable"),this.createSubviews())},beforeTeardown:function(){this.notificationScrollBar&&this.notificationScrollBar.destroy()},createSubviews:function(){for(var t,e=this.model.get("activity_notifications"),i=0;i<e.length;i++){var s=!1,n=u.unix(e[i].timestamp).startOf("day");if(t&&n.fromNow()===t.fromNow()||(s=n),s){e[i].dateHeader=s;var o=new h({model:new c(e[i])});this.appendSubview(o,"ul[data-js-blog-activity-notification-list]")}var r=new l({model:new c(e[i])});this.appendSubview(r,"ul[data-js-blog-activity-notification-list]"),t=u.unix(e[i].timestamp).startOf("day")}},teardown:function(){return this.remove(),this}});t.exports=d},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+=model.activity_notifications.length>1?' <div class="blog-activity-content"><ul data-js-blog-activity-notification-list class="ui_notes"></ul></div><a href="/blog/'+__e(model.name)+'/activity" class="blog-activity-more">'+__e(__("See everything"))+"</a> ":' <div class="blog-activity--empty"><i class="icon_activity"></i><p class="blog-activity--empty-text">'+__e(__("Check out this tab when you make a post to see Likes, Reblogs, and new followers."))+"</p></div> ";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(575),r=i(119),a=i(576),l=i(149).animation,h=n.extend({tagName:"li",className:"blog-activity-notification",template:o,events:{"click .plus-follow-button":"onClickFollow"},defaults:{tumblelogToFollow:!1,followSource:"FOLLOW_SOURCE_ACTIVITY_POPOVER"},initialize:function(t){if(this.options=s.defaults(t,this.defaults),!this.model.get("is_friend")&&!this.get("tumblelogToFollow")){var e=this.model.get("from_tumblelog");e&&(this.set("tumblelogToFollow",new r({name:e.name})),this.listenTo(this.get("tumblelogToFollow"),"change:following",this.onFollow))}},beforeRender:function(){var t="",e={};this.model.get("new_post")&&this.model.get("new_post").url?(t=this.model.get("new_post").url,e={tumblelog:this.model.get("from_tumblelog").name,postId:this.model.get("new_post").id}):this.model.get("post")&&this.model.get("post").url?(t=this.model.get("post").url,e={tumblelog:this.model.get("post").tumblelog,postId:this.model.get("post").id}):this.model.get("from_tumblelog")&&this.model.get("from_tumblelog").tumblr_url&&(t=this.model.get("from_tumblelog").tumblr_url,e={tumblelog:this.model.get("from_tumblelog").name}),this.model.set("peepr_json",JSON.stringify(e)),this.model.set("clickthrough_url",t)},afterRender:function(){this.$tumblelogLink=this.$(".notification-tumblelog-link"),this.$followButton=this.$(".plus-follow-button"),this.$ui_post_badge=this.$(".ui_post_badge");var t=this.model.get("post"),e={},i="",n=t?t.type:"regular";switch(n){case"photo":case"photoset":e.backgroundImage="url('"+t.media_url+"')";break;case"video":t.video_thumbnail_url&&(e.backgroundImage="url('"+t.video_thumbnail_url+"')",i="has_video_thumbnail");break;case"note":t.is_ask?i="ask":t.is_answer&&(i="ask_answer");break;case"postcard":i="fanmail"}this.$tumblelogLink&&(this.$tumblelogLink.addClass("js-hover-trigger-TumblelogPopover"),this.$(".notification-tumblelog-link, .avatar").hoverIntent({over:s.bind(this.showBlogCardPopover,this),out:s.noop,sensitivity:3})),this.$ui_post_badge.css(e).addClass(i)},onClickFollow:function(t){t.preventDefault(),this.$followButton.closest(".ui_note").addClass("is_friend"),this.get("tumblelogToFollow").follow({tumblelog:this.get("tumblelogToFollow").name})},onFollow:function(t,e){l(this.$followButton,s.bind(function(){this.hideFollowButton()},this)),this.$followButton.toggleClass("follow_poof",e)},hideFollowButton:function(){this.$followButton.css({display:"none"})},showBlogCardPopover:function(){this.popover&&(this.popover.teardown(),this.popover=null),this.popover=new a({model:this.get("tumblelogToFollow"),pinnedTarget:this.$el}),this.popover.$el.css("z-index",this.$el.closest(".popover").css("z-index")),this.popover.openPopover()},teardown:function(){return this.remove(),this}});t.exports=h},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="ui_note '+__e(model.type)+" "+__e(model.from_tumblelog&&model.from_tumblelog.is_friend?" is_friend":"")+'" data-timestamp="'+__e(model.timestamp)+'" data-tumblelog-name="'+__e(model.from_tumblelog?model.from_tumblelog.name:"")+'"><div class="stage"><div class="part_activity"><div class="part_main"><span class="activity"> '+(null==(__t=model.message)?"":__t)+" ",model.post&&model.post.summary&&(__p+=' <span class="summary">&#8220;'+__e(model.post.summary)+"&#8221;</span> "),__p+=' </span></div></div><a class="part_glass" target="_blank" href="'+__e(model.clickthrough_url)+'" data-peepr="'+__e(model.peepr_json)+'"></a><div class="part_avatar"> ',__p+=model.from_tumblelog?' <div class="ui_avatar"><div data-avatar-url="'+__e(model.from_tumblelog.avatar_url_128)+'" target="_blank" class="ui_avatar_link frame '+__e(model.type)+'" title="'+__e(model.from_tumblelog.name)+'"><a href="'+__e(model.from_tumblelog.tumblr_url)+'" class="avatar" style="background-image: url(\''+__e(model.from_tumblelog.avatar_url_48)+'\')"><div class="inner_frame"></div><div class="avatar_glass"></div><span class="ui_avatar_tumblelog_name">'+__e(model.from_tumblelog.name)+"</span></a></div></div> ":' <div class="ui_avatar"><div data-avatar-url="/images/anonymous_avatar_64.gif" target="_blank" class="ui_avatar_link frame '+__e(model.type)+'" title="Anonymous"><div class="avatar" style="background-image: url(\'/images/anonymous_avatar_64.gif\')"><div class="inner_frame"></div><div class="avatar_glass"></div><span class="ui_avatar_tumblelog_name"></span></div></div></div> ',__p+=' </div><div class="part_icon"> ',!model.from_tumblelog||model.from_tumblelog.is_friend||"follower"!==model.type&&"user_mention"!==model.type?model.post&&(__p+=' <a href="'+__e(model.post.url)+'" target="_blank" class="ui_post_badge '+__e(model.post.type)+'"><div class="inner_frame"></div></a> '):__p+=' <a class="note_follow plus-follow-button blue" href="/follow/'+__e(model.from_tumblelog.name)+'" data-tumblelog-name="'+__e(model.from_tumblelog.name)+'" title="'+__e(__("Follow"))+'"><span class="icon_plus follow_icon"></span> </a> ',__p+=" </div> ",model.note_meta&&(model.note_meta.answer_text||model.note_meta.reply_text)?__p+=' <div class="part_response '+__e(model.note_meta.answer_text?"is_part_answer":"")+" "+__e(model.note_meta.reply_text?"is_part_reply":"")+'"><blockquote> '+__e(model.note_meta.answer_text?model.note_meta.answer_text:"")+" "+__e(model.note_meta.reply_text?model.note_meta.reply_text:"")+" </blockquote></div> ":"reblog"===model.type&&model.new_post&&model.new_post.diff?__p+=' <div class="part_response is_part_reblog"><blockquote> '+__e(model.new_post.diff)+" </blockquote></div> ":"user_mention"==model.type&&model.new_post&&model.new_post.quote&&(__p+=' <div class="part_response is_part_user_mention"><blockquote> '+(null==(__t=model.new_post.quote)?"":__t)+" </blockquote></div> "),__p+=" </div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(148),r=i(109),a=i(205),l=i(212),h=i(577),c=o.extend({mixins:[a,l],className:"tumblelog_popover popover popover--blog-card",blogCardView:null,initialize:function(t){t||(t={}),t.identifier="TumblelogPopover",this.$targetPost=n(t.pinnedTarget).closest(".post"),o.prototype.initialize.call(this,t)},openPopover:function(){return this.blogCardView?(this.render(),this):(this.blogCardView=new h({model:this.model,targetPost:this.$targetPost}),void this.listenToOnce(this.blogCardView,"ready",this.render))},closePopover:function(){this.animateOut(),s.delay(s.bind(this.teardown,this),250)},onMouseMove:function(t){this.overElement(t,this.$el)||this.overElement(t,this.$pinned)?this.teardownTimer&&(clearTimeout(this.teardownTimer),this.teardownTimer=null):this.teardownTimer||(this.teardownTimer=s.delay(s.bind(this.closePopover,this),300))},overElement:function(t,e){var i=e.offset();return t.pageX>i.left&&t.pageY>i.top&&t.pageX<i.left+e.outerWidth()&&t.pageY<i.top+e.outerHeight()},render:function(){return this.blogCardView.render(),this.$el.html(this.blogCardView.el),s.defer(s.bind(this.animateIn,this)),this.boundMouseMove=s.bind(this.onMouseMove,this),n("body").on("mousemove",this.boundMouseMove),this._logOpen(),this},animateIn:function(){return this.$el.css("opacity",1),this},animateOut:function(){return this.$el.css("opacity",0),this},_logOpen:function(){r.trigger("popover:blogcard:open",{loggingData:{blog:this.model.get("name")}})},teardown:function(){return n("body").off("mousemove",this.boundMouseMove),this.$el.remove(),this}});t.exports=c},function(t,e,i){"use strict";t.exports=i(578)},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(579),r=i(586),a=n.extend({defaults:{include_info_popover:!0,disableUnfollowConfirm:!1},className:"poptica_header",initialize:function(t){this.options=s.extend({},this.defaults,t);var e=s.extend({model:this.model},s.pick(this.options,"targetPost","include_info_popover","disableUnfollowConfirm"));this.header=new o(e),this.posts=new r({model:this.model}),this.bindEvents()},bindEvents:function(){this.listenToOnce(this.header,"ready",this._triggerReady)},_triggerReady:function(){this.trigger("ready")},render:function(){return this.$el.append(this.header.render().el,this.posts.render().el),this}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(107),r=i(99),a=i(148),l=i(109),h=i(580),c=i(194),u=i(100),d=i(581),p=i(582),g=i(583),_=a.extend({className:"indash_tumblelog_compact",template:d,defaults:{current_data:{},unfollow_data:{},follow_data:{},template_data:{},hide_posts_on_unfollow:!1,stripDescriptionLineBreaks:!1,include_info_popover:!0},events:{"click .description a":"_descriptionLinkClicked","click .info_popover_button":"_infoPopoverButtonClicked","click .follow":"_onFollowClick","click .unfollow":"_onFollowClick"},initialize:function(t){if(this.options=s.extend({},this.defaults,t||{}),this.bindEvents(),this.is_rendered=!1,this.assets_host=r.get("Context/hosts/assets_host")||"",this.$description=null,this.$description_inner=null,!s.isEmpty(this.current_data)){var e=s.extend({},this.current_data,this.model.toJSON());this.model.set(e,{silent:!0})}this.model.get("global_theme_params")&&s.delay(s.bind(this.render,this),1)},bindEvents:function(){this.listenTo(this.model,"change:following",this._renderFollowButton),this.listenTo(this.model,"change:global_theme_params",this.render)},render:function(){var t=this.model.toJSON();if(t.following||(t.following=!1),this.is_rendered||!t.global_theme_params)return this;var e=s.result(p,t.global_theme_params.title_font),i=h.hexToRgb(t.global_theme_params.title_color);return this.$el.html(this.template(s.merge({},t,{hide_headers_flag:o.bool("hide_default_headers_blog_cards"),blog_card_compact:!0,show_navigation:!0,show_share_controls:!1,show_user_controls:this.options.include_info_popover,show_follow_button:!0,show_dismiss_controls:!1,title_font_family:e?e.family:!1,title_color_rgb:String(s.values(i).join(",")),followText:u("Follow"),unfollowText:u("Unfollow")},this.options.template_data))),this.$description=this.$(".description"),this.$description_inner=this.$description.find(".description_inner"),this._renderFontStyles(),this._renderInlineStyles(),this.__addSnowMan(),this.is_rendered=!0,this.$description.length&&(s.delay(s.bind(this.truncateDescription,this),100),this.options.stripDescriptionLineBreaks&&this.stripDescriptionLineBreaks()),this.trigger("ready"),this},stripDescriptionLineBreaks:function(){this.$description_inner.find("br").remove();var t=this.$description_inner.html(),e=t.replace(/[\n\r]/g," ");this.$description_inner.html(e)},truncateDescription:function(){var t=this.$description_inner.get(0);if(!(t.scrollHeight<=t.clientHeight)){var e=this.model.get("global_theme_params"),i=e.background_color,n=h.hexToRgb(i);this.$description.append(this.description_gradient_template({background_color:String(s.values(n).join(","))}))}},__addSnowMan:function(){var t={el:this.$("[data-snowman-container]"),tumblelogName:this.model.get("name")};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.options.targetPost}),this.snowman=new g(t)},_onFollowClick:function(t){if(t.preventDefault(),!o.bool("is_logged_in"))return void window.open("/follow/"+this.model.get("name"),"_self");var e={follow_data:this.options.follow_data};this.model.get("following")?this._confirm_unfollow(e):(l.trigger("tumblelog:log_follow"),this.model.follow(e))},_confirm_unfollow:function(t){var e={tumblelog:this.model.get("name")},i=this.model.requestUnfollow();if(this.options.disableUnfollowConfirm)i.resolve(),l.trigger("tumblelog:log_unfollow",{loggingData:e});else{var s=u("Are you sure you want to unfollow %1$s?").replace("%1$s","<strong>"+this.model.get("name")+"</strong>"),n={text:s,text_ok:u("Ok"),text_cancel:u("Nevermind")};i.promise.then(function(){l.trigger("tumblelog:log_unfollow",{loggingData:e})}),l.trigger("dialog:confirm:promise",i,n)}},_infoPopoverButtonClicked:function(t){t.preventDefault(),t.stopPropagation(),l.trigger("popticainfopopover:show")},_descriptionLinkClicked:function(t){t.preventDefault();var e=n(t.currentTarget).attr("href");try{if(c&&c.hasAllowedProtocol(e)){if(!c.isAbsoluteUrl(e)){var i="http://"+this.model.get("name")+".tumblr.com/";e="/"===e.charAt(0)?e.substr(1):e,e=i+e}window.open(e,"_blank")}}catch(s){}},_renderFollowButton:function(){var t=this.model.get("following");this.$el.find(".follow").toggle(!t),this.$el.find(".unfollow").toggle(t)},_hidePosts:function(){},_open_dialog:function(t,e){function i(t,e){t.is_disabled=t.is_menu_open,e&&e()}this.is_disabled=!0,t.fail(s.bind(i,null,this)),t.done(s.bind(i,null,this,e))},_renderInlineStyles:function(){var t=this.model.get("global_theme_params"),e=this.model.get("has_default_header")&&o.bool("hide_default_headers_blog_cards"),i=!(!(t.header_image_focused&&t.header_stretch&&t.show_header_image)||e),s=h.hexToHsv(t.background_color),n=h.hexToHsv(t.link_color),r=t.link_color;return h.compare(n,s)&&(r=h.readable(s)),i||(this.$(".navigation .nav_icon").css("color",r),this.$(".navigation .blog_name").css("color",r),this.$(".navigation button").css({color:t.background_color,"background-color":r})),this.$(".description a").css("color",t.link_color),this},_renderFontStyles:function(){if(p){var t=this.model.get("global_theme_params");if(s.has(p,t.title_font)){var e=s.result(p,t.title_font),i="webfont_"+e.path;if(e.path&&!n("head #"+i).length){var o=this.assets_host+"/fonts/"+e.path+"/stylesheet.css";o+=s.has(e,"_v")?"?v="+e._v:"",n("<link>",{id:i,rel:"stylesheet",type:"text/css",href:o}).appendTo(n("head"))}}}},description_gradient_template:s.template('<div class="description_gradient" style="background: -moz-linear-gradient(top,  rgba(<%= background_color %>,0) 0%, rgba(<%= background_color %>,0.75) 50%, rgba(<%= background_color %>,1) 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(<%= background_color %>,0)), color-stop(50%,rgba(<%= background_color %>,0.75)), color-stop(100%,rgba(<%= background_color %>,1)));background: -webkit-linear-gradient(top,  rgba(<%= background_color %>,0) 0%,rgba(<%= background_color %>,0.75) 50%,rgba(<%= background_color %>,1) 100%);background: -o-linear-gradient(top,  rgba(<%= background_color %>,0) 0%,rgba(<%= background_color %>,0.75) 50%,rgba(<%= background_color %>,1) 100%);background: -ms-linear-gradient(top,  rgba(<%= background_color %>,0) 0%,rgba(<%= background_color %>,0.75) 50%,rgba(<%= background_color %>,1) 100%);background: linear-gradient(to bottom, rgba(<%= background_color %>,0) 0%,rgba(<%= background_color %>,0.75) 50%,rgba(<%= background_color %>,1) 100%);"></div>')});t.exports=_},function(t,e,i){"use strict";function s(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}function n(t){t=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}function o(t,e,i){var s=Math.min(Math.min(t,e),i),n=Math.max(Math.max(t,e),i),o=n-s,r={h:6,s:n?(n-s)/n:0,v:n/255};return o?n===t?r.h+=(e-i)/o:n===e?r.h+=2+(i-t)/o:r.h+=4+(t-e)/o:r.h=0,r.h=60*r.h%360,r}function r(t,e,i){var s,n,o;if(e){s=n=o=0;var r=(t+360)%360/60,a=i*e,l=i-a,h=a*(1-Math.abs(r%2-1));1>r?(s=a,n=h):2>r?(s=h,n=a):3>r?(n=a,o=h):4>r?(n=h,o=a):5>r?(o=a,s=h):(o=h,s=a),s+=l,n+=l,o+=l}else s=n=o=i;return{r:Math.round(255*s),g:Math.round(255*n),b:Math.round(255*o)}}function a(t){t=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=n(t),i=o(e.r,e.g,e.b);return i}function l(t,e,i){var n=r(t,e,i),o=s(n.r,n.g,n.b);return o}function h(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,s,n,o=parseInt(t,16),r=0>e?0:255,a=0>e?-e:e,l=o>>16,h=o>>8&255,c=255&o;return i=Math.round((r-l)*a)+l,s=Math.round((r-h)*a)+h,n=Math.round((r-c)*a)+c,"#"+(16777216+65536*i+256*s+n).toString(16).slice(1)}function c(t,e,i){return"string"==typeof t&&(t=a(t)),e||(e=.2),i||(i=.8),t.s<e&&t.v>i}function u(t){return"string"==typeof t&&(t=a(t)),c(t)?"#444":"#FFF"}function d(t,e,i){var s={upperBound:.8,lowerBound:.2,diffBound:.1,hueBound:15};p.extend(s,i),"string"==typeof t&&(t=a(t)),"string"==typeof e&&(e=a(e));var n=s.upperBound,o=s.lowerBound,r=s.diffBound,l=s.hueBound,h=Math.abs(t.h-e.h),c=Math.abs(t.s-e.s),u=Math.abs(t.v-e.v);return r>=h&&r>=c&&r>=u?!0:r>=c&&r>=u&&(c>=n||o>=c&&u>=n||o>=u&&l>=h)}var p=i(3);t.exports={rgbToHex:s,hexToRgb:n,rgbToHsv:o,hsvToRgb:r,hexToHsv:a,hsvToHex:l,brighten:h,readable:u,compare:d,isLight:c}},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj){var is_blog_card_compact="boolean"==typeof blog_card_compact?blog_card_compact:!1,has_avatar=avatar_url&&global_theme_params.show_avatar,has_bg_img=global_theme_params.header_image_focused&&global_theme_params.show_header_image,has_title=title&&global_theme_params.show_title,has_description=description_sanitized&&global_theme_params.show_description,hide_default_header=is_blog_card_compact?has_default_header&&hide_headers_flag:!1,expanded_name=cname?cname:name+".tumblr.com",description_color=title_color_rgb?"rgba("+title_color_rgb+",0.7)":global_theme_params.title_color,header_class=global_theme_params.header_stretch?"":" no_stretch_header";header_class+=has_bg_img&&!hide_default_header?"":" no_header_image",header_class+=has_avatar?"":" no_avatar",header_class+=!has_bg_img||hide_default_header||has_avatar||has_title||has_description?"":" header_image_only",header_class+=has_title||has_description?" has_info":" no_info",__p+=' <div class="indash_header_wrapper '+(null==(__t=header_class)?"":__t)+" tumblelog_name_"+__e(name)+'" style="background-color:'+(null==(__t=global_theme_params.background_color)?"":__t)+"; color:"+(null==(__t=global_theme_params.title_color)?"":__t)+'"> ',show_navigation&&(__p+=' <div class="navigation"><div class="navigation_bg" style="background-color: '+(null==(__t=global_theme_params.background_color)?"":__t)+'"></div><div class="navigation_inner"> ',"undefined"!==name&&(__p+=' <h3><a href="'+__e(url)+'" target="_blank" class="blog_name" data-peepr=\'{"tumblelog": "'+__e(name)+'"}\'><span class="name"> '+__e(name)+' </span><span class="full_url">'+__e(expanded_name)+"</span></a></h3> "),__p+=" ",show_share_controls&&(__p+=' <a class="open_blog_button nav_icon icon_export"></a> '),__p+=" ",!customizable&&show_user_controls&&(__p+=' <a data-snowman-container class="info_popover_button nav_icon user_dropdown_lockup"><i class="user_dropdown_icon user_dropdown_icon_user icon_user_settings"></i> </a> '),__p+=" ",!customizable&&show_follow_button&&(__p+=" ",__p+=following?' <button class="chrome unfollow" type="button">'+__e(unfollowText)+'</button> <button class="chrome follow" type="button" style="display:none">'+__e(followText)+"</button> ":' <button class="chrome unfollow" type="button" style="display:none">'+__e(unfollowText)+'</button> <button class="chrome follow" type="button">'+__e(followText)+"</button> ",__p+=" "),__p+=" </div></div> "),__p+=" ",global_theme_params.header_image_focused&&global_theme_params.show_header_image&&!hide_default_header&&(__p+=' <div class="header_image_wrapper',has_avatar&&(__p+=" has_avatar"),__p+='"><div class="header_image" style="background-image:url('+__e(global_theme_params.header_image_focused)+')"> ',__p+=is_blog_card_compact||!customizable?' <a href="'+(null==(__t=url)?"":__t)+'" target="_blank"><img src="'+__e(global_theme_params.header_image_focused)+'" data-peepr=\'{"tumblelog": "'+__e(name)+'"}\' alt="'+__e(title)+'"> </a> ':' <img src="'+__e(global_theme_params.header_image_focused)+'" alt=""> ',__p+=" </div></div> "),__p+=" ",avatar_url&&global_theme_params.show_avatar&&(__p+=' <div class="avatar '+(null==(__t=global_theme_params.avatar_shape)?"":__t)+'" style="background-color:'+(null==(__t=global_theme_params.background_color)?"":__t)+"; background-image:url("+(null==(__t=avatar_url)?"":__t)+"); color:"+(null==(__t=global_theme_params.background_color)?"":__t)+'"> ',
  __p+=is_blog_card_compact||!customizable?' <a href="'+(null==(__t=url)?"":__t)+'" target="_blank"><img src="'+(null==(__t=avatar_url)?"":__t)+'" data-peepr=\'{"tumblelog": "'+__e(name)+'"}\' alt="'+__e(title)+'"></a> ':' <img src="'+(null==(__t=avatar_url)?"":__t)+'" alt=""> ',__p+=" </div> "),__p+=" ",(has_title||has_description)&&(__p+=' <div class="info_wrapper"><div class="info"> ',has_title&&(__p+=' <h1 class="title" style="font-family:'+(null==(__t=title_font_family||"inherit")?"":__t)+"; font-weight:"+(null==(__t=global_theme_params.title_font_weight)?"":__t)+'">'+__e(title)+"</h1> "),__p+=" ",has_description&&(__p+=' <div class="description" style="color:'+(null==(__t=description_color)?"":__t)+'"><div class="description_inner">'+(null==(__t=description_sanitized)?"":__t)+"</div></div> "),__p+=" </div></div> "),__p+=" </div>"}return __p}.toString()).apply(void 0,_values(_imports))},function(t,e){"use strict";var i={"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"},FangSong:{display_name:"Fang Song",family:"'FangSong', 'STFangsong', 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"},Kaiti:{display_name:"Kaiti",family:"'Kaiti TC', 'KaiTi', 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"},SimHei:{display_name:"Sim Hei",family:"'SimHei', 'STHeiti', sans-serif"},"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"}};t.exports=i},function(t,e,i){"use strict";var s=i(143),n=i(584),o=s.extend({name:"Snowman",autoAppend:!0,initialize:function(t){this.view=new n(t)}});t.exports=o},function(t,e,i){"use strict";var s=i(155),n=i(585),o=i(119),r=s.extend({template:n,defaults:{canSubscribe:!1},events:{click:"__toggleInfoPopover"},initialize:function(t){return this.options=t,this.model||(this.model=new o({name:this.options.tumblelogName})),this.set({canSubscribe:this.model.get("can_subscribe"),isSubscribed:this.model.get("is_subscribed")}),this.listenTo(this.model,"change:is_subscribed",this.__subscribeActionSuccess),t.infoPopoverOnDemand||this.__createInfoPopover(),this},__subscribeActionSuccess:function(t){if(t.id===this.model.get("name")){var e=this.model.get("is_subscribed");this.$("[data-subscription-indicator]").toggleClass("is-subscribed",e)}},__toggleInfoPopover:function(t){t.preventDefault(),t.stopPropagation(),this.options.infoPopoverOnDemand&&!this.infoPopover&&this.__createInfoPopover(),this.infoPopover.toggle()},__createInfoPopover:function(){this.options.infoPopover&&(this.options.infoPopover.model=this.model,this.options.infoPopover.url=this.model.get("url"),this.options.infoPopover.useRecipient&&(this.options.infoPopover.recipient=this.model.get("name")),this.options.infoPopover.showAsks&&(this.options.infoPopover.asks=this.model.get("asks")),this.options.infoPopover.showAnonymousAsks&&(this.options.infoPopover.anonymous_asks=this.model.get("anonymous_asks")),this.infoPopover=new Tumblr.TumblelogPopover.PopticaInfoPopover(this.options.infoPopover))}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<span class="snowman-container"><i data-subscription-indicator class="subscribe-activity '+(null==(__t=canSubscribe&&isSubscribed?"is-subscribed":"")?"":__t)+'"></i> <i class="snowman-icon"></i> </span>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(148),r=i(109),a=i(587),l=o.extend({className:"recent_posts",template:a,events:{"click a":"onPostClick",mouseenter:"onMouseEnter"},defaults:{on_bottom:!0,blog_bg_color:!0,$popover:n(),min_load_time:500,model:{},dashboard_post:{}},initialize:function(t){s.extend(this,this.defaults,t),this.model&&(this.renderLoader(),this.renderInlineStyles(),this.posts=this.model.get("highlighted_posts"),s.isUndefined(this.posts)&&this.fetchPosts(),this.bindEvents())},bindEvents:function(){this.listenTo(this.model,"change:highlighted_posts",this.render),this.listenTo(this.model,"change:global_theme_params",this.renderInlineStyles)},fetchPosts:function(){this.model.fetch_popover_data({is_tumblelog_popover:!0})},updatePosts:function(t){this.model=t,this.posts=this.model.get("highlighted_posts"),s.isUndefined(this.posts)?this.fetchPosts():this.render(!0)},renderLoader:function(){var t=this.model.toJSON();this.$el.html(this.template({loader_color:t.global_theme_params?t.global_theme_params.title_color:"#D9D9D9"}))},renderInlineStyles:function(){var t=this.model.get("global_theme_params");t&&this.blog_bg_color&&this.$el.css("background-color",t.background_color)},render:function(t){var e=this.posts||this.model.get("highlighted_posts");if(!s.isArray(e))return this;var i=e.join("");return e.length<2?(setTimeout(s.bind(function(){this.$popover.addClass("is_empty"),this.$el.html("")},this),this.min_load_time),this):(this.$el.addClass("has_"+e.length+"_posts"),t===!0?this.$el.addClass("is_cached").html(i):setTimeout(s.bind(function(){this.$el.addClass("is_loaded").html(i)},this),this.min_load_time),this)},onPostClick:function(t){},onMouseEnter:function(t){r.trigger("TumblelogPopover:mouseenter_posts")}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";Array.prototype.join;with(obj){var color="undefined"!=typeof loader_color?loader_color:"#D9D9D9";__p+=' <div class="Knight-Rider-loader centered animate"><div class="Knight-Rider-bar" style="background-color:'+(null==(__t=color)?"":__t)+'"></div><div class="Knight-Rider-bar" style="background-color:'+(null==(__t=color)?"":__t)+'"></div><div class="Knight-Rider-bar" style="background-color:'+(null==(__t=color)?"":__t)+'"></div></div>'}return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(155),n=i(589),o=i(9),r=i(100),a=s.extend({tagName:"li",className:"blog-activity-date",template:n,events:{},defaults:{},beforeRender:function(){var t=o();this.model.set("relativeDate",this.getRelativeDate(t))},getRelativeDate:function(t){var e=t.diff(this.model.attributes.dateHeader),i=o.duration(e).asHours(),s=Math.floor(i/24);return 0>=s?r("Today"):1>=s?r("Yesterday"):r("%d days ago",s)},teardown:function(){return this.remove(),this}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<div class="date_header clearfix"><div class="part_relative_date">'+(null==(__t=model.relativeDate)?"":__t)+'</div><div class="part_full_date">'+(null==(__t=model.dateHeader.format("dddd, MMMM D"))?"":__t)+"</div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(113),n=s.extend({});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(107),r=i(143),a=i(109),l=i(110),h=i(141),c=i(142),u=i(119),d=i(592),p=i(593),g=i(594),_=i(596),m=i(597),f=i(600),v=i(606),b=i(368),y=i(621),w=i(622),k=i(627),C=i(628),x=i(630),S=i(657),T=i(721),E=i(619),P=i(607),F=i(722),I=i(723),M=i(649),N=i(401),$=new _,A={CONVERSATION_OPEN_TUMBLELOGS:"messaging:conversation:open:tumblelogs",CONVERSATION_OPEN_MODEL:"messaging:conversation:open:model",CONVERSATION_OPEN_ID:"messaging:conversation:open:id",CONVERSATION_OPEN_NAME:"messaging:conversation:open:name"},D=r.extend({name:"Messaging",defaults:{resetPollingTypingDebounceRate:3e4},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"inboxAnchorEl","inboxPopoverOptions")),this.eventBus=$,this.user=l(),this.channels=this._getChannelsEnabledForMessagingAsCollection(),this.activeWindow=new d,this.inboxCollection=new F,this.currentBlogModel=new T({channel:this._getInitiallySelectedChannel()}),this.favoritesCollection=new M,this.emptyInboxCollection=new M,this.unreadManager=new m({channels:this.channels}),this.inboxBadge=new k({el:this.inboxAnchorEl,channels:this.channels}).render(),this.messagingLogger=new p,this.messagingNotifier=new y({isEnabled:this.isDesktopNotificationEnabled(),notificationIcon:this.getMessagingNotificationIcon()}),this.keyboardManager=new b,this.windowPersistenceManager=new v({user:this.user,isSyncEnabled:!1}),this.notificationSoundManager=new w,this.searchImageQueries=new N,this.windowManager=new f({eventBus:this.eventBus,user:this.user,channels:this.channels,currentBlogModel:this.currentBlogModel,keyboardManager:this.keyboardManager,isMinimizeEnabled:this.isMinimizeEnabled(),isPersistenceEnabled:this.isPersistenceEnabled(),persistenceManager:this.windowPersistenceManager,inboxConfig:{constructor:x,options:{favoritesCollection:this.favoritesCollection,emptyInboxCollection:this.emptyInboxCollection,appendFavoritesToInboxLimit:this.getAppendFavoritesToInboxLimit(),isAutoFetch:!1},popoverOptions:s.extend({autoTeardown:!0,pinnedSide:"bottom",isFixedPosition:!0,pinnedTarget:this.inboxAnchorEl},this.inboxPopoverOptions)},conversationConfig:{constructor:S,options:{isAutoFetch:!1,isMinimizeEnabled:this.isMinimizeEnabled(),isGifSearchEnabled:this.isGifSearchEnabled(),isStickersEnabled:this.isStickersEnabled(),isIcebreakersEnabled:this.isIcebreakersEnabled(),isSendPhotosEnabled:this.isSendPhotosEnabled(),collection:this.searchImageQueries,imageUploadMaxBytes:this.getImageUploadMaxBytes(),isSafeModeEnabled:o.bool("safe_mode")&&this.user.get("safe_mode")}}}),this._onConversationMessageInputThrottled=s.throttle(this._onConversationMessageInput,this.get("resetPollingTypingDebounceRate"),{leading:!0,trailing:!1}),this.listenTo(a,A.CONVERSATION_OPEN_TUMBLELOGS,this._onEventBusOpenConversationUsingTumblelogModels),this.listenTo(a,A.CONVERSATION_OPEN_MODEL,this._onEventBusOpenConversationUsingModel),this.listenTo(a,A.CONVERSATION_OPEN_ID,this._onEventBusOpenConversationUsingIdAndParticipant),this.listenTo(a,A.CONVERSATION_OPEN_NAME,this._onEventBusOpenConversationUsingBlogName),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_OPEN_CONVERSATION_MODEL,this._onOpenConversationUsingConversationModel),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_OPEN_PARTICIPANT_MODELS,this._onOpenConversationUsingParticipantModels),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_OPEN_TUMBLR_URL,this._onConversationClickBlog),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_OPEN_MESSAGING_URL,this._onConversationClickMessagingBlog),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_DELETE_MODEL,this._onConversationDelete),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_FETCHING,this._onConversationFetching),this.listenTo(this.eventBus,this.eventBus.BLOCK,this._onBlock),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_MESSAGES_SEND_REQUESTED,this._onConversationMessagesSendRequested),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_MESSAGE_SENT,this._onConversationMessageSent),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_MESSAGE_FAILED,this._onConversationMessageFailed),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_MESSAGE_INPUT,this._onConversationMessageInputThrottled),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_MESSAGES_UNREAD_FETCHED,this._playConversationSounds),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_MARK_AS_SPAM,this._onConversationMarkAsSpam),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_IMAGE_PREVIEW_ADD,this._onConversationImagePreviewAdd),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_IMAGE_PREVIEW_DISMISS,this._onConversationImagePreviewDismiss),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_IMAGE_PREVIEW_EDIT,this._onConversationImagePreviewEdit),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_IMAGE_LIGHTBOX,this._onConversationImageLightbox),this.listenTo(this.eventBus,this.eventBus.CONVERSATION_COMPOSE_PLUGIN_CLICK,this._onConversationComposePluginClick),this.listenTo(a,"toaster:updateMessagingUnreadCounts",this._onPollUpdate),this.listenTo(a,"logout",this._onEventBusLogout),this.listenTo(this.currentBlogModel,"change",this._onCurrentBlogModelChange),this.listenTo(this.windowManager,"change",this._onWindowManagerChange),this.listenTo(this.unreadManager,"change:channel",this._onUnreadManagerChannelChange),this.listenTo(this.unreadManager,"change:conversation",this._onUnreadManagerConversationChange),this.listenTo(this.windowManager,"inbox:added",this._onWindowManagerInboxAdded),this.listenTo(this.windowManager,"inbox:removed",this._onWindowManagerInboxRemoved),this.listenTo(this.windowManager,"conversation:added",this._onWindowManagerConversationAdded),this.listenTo(this.windowManager,"conversation:removed",this._onWindowManagerConversationRemoved),this.listenTo(this.windowManager,"conversations:loaded",this._onWindowManagerConversationsLoaded),this.listenTo(this.windowManager,"conversation:minimized",this._onWindowManagerConversationMinimized),this.listenTo(this.windowManager,"conversation:unminimized",this._onWindowManagerConversationUnminimized),this.listenTo(this.messagingNotifier,"notification:display",this._onDesktopNotificationDisplayed),this.listenTo(this.messagingNotifier,"notification:permission:change",this._onDesktopNotificationPermissionChange),this.listenTo(this.channels,"change:unread_messages_count_sum",s.debounce(s.bind(this._onChannelsUnreadMessageCountChange,this),0)),this.messagingPoller=new g({channels:this.channels,user:this.user,callback:s.bind(this._onPollUpdate,this),frequency:this.getPollingFrequencyInbox()}),this.hasTutorial()&&this.openTutorialPopover(),this._onWindowManagerChange(this.windowManager)},render:function(){return this.inboxAnchorEl&&this.inboxAnchorEl.on("click.messaging",s.bind(this._onClickInboxAnchor,this)),this.windowManager.loadConversationsState(),this},openInboxPopover:function(){this.inboxPopover||(this.inboxPopover=this.windowManager.addInbox(this.inboxCollection),this.tutorialPopover&&this.tutorialPopover.hideTutorial())},openConversationPopover:function R(t,e){var R;return s.isEmpty(t.get("participantUuid"))&&t.set("participantUuid",this.getCurrentBlogId()),R=this.windowManager.getConversationPopover(t),this.windowManager.removeInbox(this.inboxCollection),R?void R.refresh(t):(this.windowManager.addConversation(t,{context:e}),void(this.tutorialPopover&&this.tutorialPopover.hideTutorial()))},openTutorialPopover:function(){return this.tutorialPopover?this.tutorialPopover:(this.tutorialPopover=new C({eventBus:this.eventBus,viewOptions:{title:n("Talk to a Tumblr"),content:n("Just tap this balloon, type the Tumblr's name, and start a conversation."),ok_text:n("Send a message"),pinnedTarget:this.inboxAnchorEl,fixed_position:s.get(this.inboxPopoverOptions,"isFixedPosition",!0)}}),this.listenToOnce(this.tutorialPopover,"dismiss",s.bind(function(){s.delay(s.bind(function(){this.openInboxPopover()},this),250)},this)),this.listenToOnce(this.tutorialPopover,"hide",s.bind(function(){this.stopListening(this.tutorialPopover),this.tutorialPopover=null},this)),this.tutorialPopover.render(),this.tutorialPopover)},fetchInbox:function(){var t=this.getCurrentBlogId();if(this._pendingInboxRequest&&this._pendingInboxBlog){if(t===this._pendingInboxBlog)return;this._pendingInboxRequest.abort()}this._pendingInboxBlog=t,this._pendingInboxRequest=this.inboxCollection.fetchInbox(t).always(s.bind(function(){this._pendingInboxRequest=null,this._pendingInboxBlog=null},this))},getCurrentChannel:function(){return this.currentBlogModel.getChannel()},getCurrentBlogId:function(){return this.currentBlogModel.getId()},getPollingFrequencyInbox:function(){return s.get(this.data,"polling_frequency_inbox")},getPollingFrequencyConversation:function(){return s.get(this.data,"polling_frequency_conversation")},hasTutorial:function(){return s.get(this.data,"has_tutorial")},getAppendFavoritesToInboxLimit:function(){return s.get(this.data,"append_favorites_to_inbox_limit")},isMinimizeEnabled:function(){return s.get(this.data,"is_minimize_enabled",!1)},isIcebreakersEnabled:function(){return s.get(this.data,"is_icebreakers_enabled",!1)},isPersistenceEnabled:function(){return s.get(this.data,"is_persistence_enabled",!1)&&this.user.isVerifiedEmail()},isDesktopNotificationEnabled:function(){return s.get(this.data,"is_desktop_notifications_enabled",!1)},isGifSearchEnabled:function(){return s.get(this.data,"is_messaging_gif_search_enabled",!1)},isStickersEnabled:function(){return s.get(this.data,"is_stickers_enabled",!1)},isSendPhotosEnabled:function(){return s.get(this.data,"is_messaging_send_photos_enabled",!1)},isNewEmptyInboxEnabled:function(){return s.get(this.data,"is_new_empty_inbox_enabled",!1)},getBackoffRatesInbox:function(){return[1,1,2,2,4]},getBackoffRatesConversation:function(){return[1,1,1,1,2,2,2,2,4,4,4,4,8,8,8,8,16]},getMessagingNotificationIcon:function(){return s.get(this.data,"messaging_notification_icon","")},getImageUploadMaxBytes:function(){return s.get(this.data,"image_upload_max_bytes",10485760)},_onWindowManagerInboxAdded:function(t,e){this.fetchInbox(),this.messagingLogger.logInboxOpened()},_onWindowManagerInboxRemoved:function(t,e){delete this.inboxPopover,this.messagingLogger.logInboxClosed()},_onWindowManagerConversationAdded:function(t,e,i){var n=s.get(i,"isFromPersistence",!1);e.isMinimized()||(e.fetch().always(s.bind(function(){n||this.messagingLogger.logConversationOpened(t,s.get(i,"context"))},this)),e.focus())},_onWindowManagerConversationRemoved:function(t,e,i){this.messagingLogger.logConversationClosed(t,s.get(i,"context"))},_onWindowManagerConversationsLoaded:function(t,e){0===t.length&&0===e.length||this.messagingLogger.logConversationWindowsLoaded(t,e)},_onWindowManagerConversationMinimized:function(t,e){this.messagingLogger.logConversationMinimized(t)},_onWindowManagerConversationUnminimized:function(t,e){this.messagingLogger.logConversationUnminimized(t)},_getChannelsEnabledForMessagingAsCollection:function(){return new I(s.invoke(this.user.getChannelsEnabledForMessaging(),"toJSON"))},_getInitiallySelectedChannel:function(){return this.channels.get(this.user.getCurrentMessagingChannelUuid())||s.first(this.channels.models)},_onClickInboxAnchor:function(t){t.preventDefault(),this.openInboxPopover()},_onEventBusOpenConversationUsingIdAndParticipant:function(t,e,i){this._openConversationUsingIdAndParticipant(t,e,i)},_onEventBusOpenConversationUsingTumblelogModels:function(t,e){this._openConversationUsingTumblelogModels(t,e)},_onEventBusOpenConversationUsingModel:function(t,e){this.openConversationPopover(t,e)},_onEventBusOpenConversationUsingBlogName:function(t,e){this._openConversationFromBlogName(t,e)},_onOpenConversationUsingConversationModel:function(t,e){this.openConversationPopover(t,e)},_openConversationUsingIdAndParticipant:function(t,e,i){var n=new P({id:t,participantUuid:e});n.fetchConversation().then(s.bind(function(){this.openConversationPopover(n,i)},this))},_openConversationUsingTumblelogModels:function(t,e){var i=s.map(t,function(t){return new E(t.toJSON(),{parse:!0})});this._onOpenConversationUsingParticipantModels(i,e)},_onOpenConversationUsingParticipantModels:function(t,e){var i=new E(this.getCurrentChannel().toJSON()),n=s.find(t,function(t){return t.get("name")===i.get("name")});if(s.isEmpty(n)){var o=new P({participants:[i].concat(t),participantUuid:this.getCurrentBlogId()});this.openConversationPopover(o,e)}},_onPollUpdate:function(t){t=s.get(t,"unread_messages"),s.get(t,"error")!==!0&&this.unreadManager.setData(t)},_onConversationClickBlog:function(t){var e=s.get(t,"url"),i=s.get(t,"blogName"),n=s.get(t,"postId"),o=s.get(t,"searchTagTerm"),r=s.get(t,"originalEvent");r&&r.preventDefault(),a.trigger("peepr-open-request",{url:e,tumblelog_name:i,post_id:n,searchTagTerm:o}),this.messagingLogger.logPeeprOpen(e,i,n,o)},_onConversationClickMessagingBlog:function(t){var e=s.get(t,"blogName"),i=s.get(t,"originalEvent");i&&i.preventDefault(),this._openConversationFromBlogName(e,"conversation-permalink"),this.messagingLogger.logMessagingPermalinkOpen(e)},_onDesktopNotificationDisplayed:function(t){this.messagingLogger.logNotification(t)},_onDesktopNotificationPermissionChange:function(t){t?this.messagingLogger.logNotificationPermissionGranted():this.messagingLogger.logNotificationPermissionDenied()},_onConversationMarkAsSpam:function(t,e){var i;t&&e&&(i=n("%1$s will be blocked and reported. And any trace of this conversation will disappear from your inbox.",e.get("name")),c.confirm(i,s.bind(function(){this.messagingLogger.logConversationSpamIntent(t),this._removeConversation(t),t.markAsSpam().then(s.bind(function(){this.messagingLogger.logConversationSpamSuccess(t)},this)).fail(s.bind(function(){this.messagingLogger.logConversationSpamFail(t)},this))},this),null,n("Mark it spam"),n("Nevermind")))},_onConversationImagePreviewAdd:function(t,e){this.messagingLogger.logImagePreviewAdd(t,e)},_onConversationImagePreviewDismiss:function(t,e){this.messagingLogger.logImagePreviewDismiss(t,e)},_onConversationImagePreviewEdit:function(t,e){this.messagingLogger.logImagePreviewEdit(t,e)},_onConversationImageLightbox:function(t){var e=s.get(t,"lightBoxImageData"),i=s.get(t,"lightBoxIndex",0);a.trigger("lightbox-open-request",e,i)},_onConversationComposePluginClick:function(t,e){this.messagingLogger.logComposePluginClick(t,e)},_onBlock:function(t,e){s.isEmpty(t)||h.confirmBlock(t).then(s.bind(function(){h.block(t).then(s.bind(function(){this._onBlockSuccess(t,e)},this))},this))},_onBlockSuccess:function(t,e){s.isEmpty(t)||(e&&this._removeConversation(e),a.trigger("blocks:block_added",{loggingData:{from:"messaging"}}),this.messagingLogger.logBlock(t))},_removeConversation:function(t){this.windowManager.removeConversation(t),this.inboxCollection.remove(t)},_copyCollectionData:function(t,e){e.reset(t.models),e.setNextLink(t.getNextLink())},_onCurrentBlogModelChange:function(){var t=this.currentBlogModel.getPrevChannel(),e=this.currentBlogModel.getChannel();t&&this._copyCollectionData(this.inboxCollection,t.get("conversations")),e&&(this._copyCollectionData(e.get("conversations"),this.inboxCollection),this.user.setCurrentMessagingChannelUuid(e.get("uuid"))),this.fetchInbox()},_onConversationDelete:function(t){c.confirm(n("Permanently delete this conversation?"),s.bind(function(){this.messagingLogger.logConversationDeleted(t),t.destroy(),this.windowManager.removeConversation(t),this.inboxCollection.remove(t.get("id"))},this),null,n("Delete"),n("Nevermind"))},_onConversationFetching:function(t){this.unreadManager.setConversationModelCount(t,0)},_onUnreadManagerChannelChange:function(t,e){var i=this.getCurrentChannel(),n=s.sum(e);this.windowManager.isInboxOpen()&&i===t&&this.fetchInbox(),t.set("unread_messages_count_sum",n)},_onUnreadManagerConversationChange:function(t,e,i){this._generateBrowserNotification(t,e,i),this._setConversationUnreadCount(t,e,i)},_onChannelsUnreadMessageCountChange:function(t,e){var i=t.previous("unread_messages_count_sum");e>i&&this._playSoundName("notification-sound")},_playConversationSounds:function(){this._playSoundName("receive-sound")},_playSoundName:function(t){this.user.isSoundsEnabled()&&this.notificationSoundManager.playSoundName(t)},_setConversationUnreadCount:function(t,e,i){var s=this.windowManager.getConversationModelByIdAndParticipant(t,i.get("uuid"));s&&s.set("unreadCount",e)},_generateBrowserNotification:function(t,e,i){var s,n=!1;0>=e||(this.activeWindow.isActive&&this.windowManager.get("isConversationOpen")?(s=this.windowManager.getConversationModelByIdAndParticipant(t,i.get("uuid")),s&&this.windowManager.isConversationMinimized(s)&&(n=!0)):n=!0,n&&this.messagingNotifier.notifyOnUnread(t,i))},_showErrorMessage:function(t){c.alert(t)},_onWindowManagerChange:function(t){var e,i,s=t.isInboxOpen(),n=t.isConversationOpen(),o=s||n;return this.user.isVerifiedEmail()&&o?(n?(e=this.getPollingFrequencyConversation(),i=this.getBackoffRatesConversation()):(e=this.getPollingFrequencyInbox(),i=this.getBackoffRatesInbox()),this.messagingPoller.setFrequency(e),this.messagingPoller.setBackoffRates(i),void this.messagingPoller.start()):void this.messagingPoller.stop()},_onConversationMessagesSendRequested:function(){this._playSoundName("send-sound")},_onConversationMessageSent:function(t,e){this.messagingLogger.logMessageSent(t,e)},_onConversationMessageFailed:function(t,e){this.messagingLogger.logMessageFailed(t,e)},_onConversationMessageInput:function(t,e){this.messagingPoller.resetPollingFrequency(),this.messagingPoller.poll()},_openConversationFromBlogName:function(t,e){var i=new u({name:t});return i.fetch_popover_data().then(s.bind(function(){return s.isEmpty(i.get("uuid"))?void this._showErrorMessage(n("Could not load conversation.")):i.get("can_receive_messages")?void this._openConversationUsingTumblelogModels([i],e):void this._showErrorMessage(n("This Tumblr can't receive messages."))},this))},_onEventBusLogout:function(){this.isPersistenceEnabled()&&this.windowPersistenceManager.clear()}});t.exports=D},function(t,e,i){"use strict";var s=i(3),n=function(){window.onfocus=s.bind(this.onFocus,this),window.onblur=s.bind(this.onBlur,this)};n.prototype.onFocus=function(t){this.isActive=!0},n.prototype.onBlur=function(t){this.isActive=!1},n.prototype.isActive=!0;var o,r=function(){return null==o&&(o=new n),o};t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(143),o=i(109),r=n.extend({name:"MessagingLogger",defaults:{namespace:"messaging-interaction",isDebugEnabled:!1,platform:"web"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults)))},logInboxOpened:function(){this._logIt("inbox:open")},logInboxClosed:function(){this._logIt("inbox:closed")},logConversationOpened:function(t,e){this._logIt("conversation:open",{conversationId:t.get("id"),context:e})},logConversationClosed:function(t,e){this._logIt("conversation:closed",{conversationId:t.get("id"),context:e})},logConversationDeleted:function(t){this._logIt("conversation:deleted",{conversationId:t.get("id")})},logConversationStarted:function(t,e){this._logIt("conversation:started",{context:e})},logMessageSent:function(t,e){!s.isEmpty(e)&&e.isNew()&&this.logConversationStarted(e),this._logIt("message:sent",this._getMessageLoggingData(t,e))},logMessageFailed:function(t,e){this._logIt("message:failure",this._getMessageLoggingData(t,e))},logFollow:function(t){this._logIt("conversation:follow",{blogName:t})},logBlock:function(t){this._logIt("block",{blockingBlog:t.currentTumblelog,blockedBlog:t.blockedTumblelog})},logNotification:function(t){this._logIt("notification:display",{conversationId:t})},logNotificationPermissionGranted:function(){this._logIt("notification:permission:granted")},logNotificationPermissionDenied:function(){this._logIt("notification:permission:denied")},logConversationWindowsLoaded:function(t,e){this._logIt("conversation:windows:loaded",{numOpen:t.length,numMinimized:e.length})},logConversationMinimized:function(t){this._logIt("conversation:minimized",{conversationId:t.get("id")})},logConversationUnminimized:function(t){this._logIt("conversation:unminimized",{conversationId:t.get("id")})},logConversationSpamIntent:function(t){this._logIt("conversation:spam:intent",{conversationId:t.get("id")})},logConversationSpamSuccess:function(t){this._logIt("conversation:spam:success",{conversationId:t.get("id")})},logConversationSpamFail:function(t){this._logIt("conversation:spam:fail",{conversationId:t.get("id")})},logImagePreviewAdd:function(t,e){this._logImagePreviewAction("add",t,e)},logImagePreviewDismiss:function(t,e){this._logImagePreviewAction("dismiss",t,e)},logImagePreviewEdit:function(t,e){this._logImagePreviewAction("edit",t,e)},logComposePluginClick:function(t,e){var i,n=e.getName();s.isEmpty(n)||(i=n+":intent",this._logIt(i,{conversationId:t.get("id")}))},logPeeprOpen:function(t,e,i,n){var o={url:t,blogName:e};s.isEmpty(i)||s.extend(o,{postId:i}),s.isEmpty(n)||s.extend(o,{searchTagTerm:n}),this._logIt("peepr:open",o)},logMessagingPermalinkOpen:function(t){var e={blogName:t};this._logIt("conversation-permalink:open",e)},_logImagePreviewAction:function(t,e,i){var n,o,r,a=i.get("context");s.isEmpty(a)||(n=i.get("loggingData"),o=a+":"+t,r=s.extend({},n,{conversationId:e.get("id")}),this._logIt(o,r))},_getMessageLoggingData:function(t,e){var i,n,o,r,a,l,h,c,u;return s.isEmpty(t)?null:(l=t.isPost(),i=l?0:(t.getMessage()||"").length,n=t.get("type"),o=t.get("context"),a=t.get("loggingData"),u=t.get("creationUserAction"),r=s.extend({},a,{conversationId:e?e.get("id"):null,messageLength:i,messageType:n}),s.isEmpty(u)||s.extend(r,{creationUserAction:u}),l&&(h=t.get("post").toJSON(),c=s.get(h,"blog.uuid")||s.get(h,"blog"),s.extend(r,{postBlogUuid:c,postId:s.get(h,"id")})),s.isEmpty(o)||s.extend(r,{context:o}),r)},_logIt:function(t,e){e=e||{},s.extend(e,{platform:this.get("platform")}),o.trigger(this.get("namespace")+":"+t,{loggingData:e
  })}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(595),o=n.extend({name:"MessagingPoller",defaults:s.defaults({url:"/services/poll",frequency:15e3},n.prototype.defaults),initialize:function(t){var e;return t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"channels","user")),e=s.pluck(s.where(this.channels.toJSON(),{is_messaging_bot:!1}),"mention_key"),this._requestData={token:this.user.get("polling_token"),unread_messages:!0,mention_keys:e.join(",")},n.prototype.initialize.apply(this,arguments)},getRequestData:function(){return this._requestData},hasResponseChanged:function(t){return!s.isEmpty(s.get(t,"unread_messages"))}});t.exports=o},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(143),r=o.extend({name:"BasePoller",defaults:{url:null,requestType:"GET",dataType:"JSON",cache:!1,frequency:6e4,backoffRates:[],stopAfterNumErrors:3,isPolling:!1,hasPolled:!1,isDebugEnabled:!1},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"callback")),this.currentErrorCount=0,this.currentUnchangedCount=0},start:function(t){this.set("isPolling",!0),t?this.scheduleNextPoll():this.poll()},stop:function(){this.set("isPolling",!1),this.cancel()},cancel:function(){this.cancelCurrent(),this.cancelNext()},cancelCurrent:function(){this._currentRequest&&(s.result(this._currentRequest,"abort"),this._currentRequest=null)},cancelNext:function(){this._nextPollToken&&(clearTimeout(this._nextPollToken),this._nextPollToken=null)},beforeRemove:function(){this.stop()},setFrequency:function(t){this.set("frequency",t),this.resetPollingFrequency()},setBackoffRates:function(t){this.set("backoffRates",t),this.resetPollingFrequency()},resetPollingFrequency:function(){this.currentUnchangedCount=0,this.set("hasPolled",!1)},poll:function(){this.cancel(),this._lastPollTime=(new Date).getTime();var t=this.makeRequest.call(this);return t.done(s.bind(this._onRequestSuccess,this)).fail(s.bind(this._onRequestFail,this)).always(s.bind(this._onRequestAlways,this)),this._currentRequest=t,t},getRequestData:function(){return{}},hasResponseChanged:function(){return!0},resetErrorCount:function(){this.currentErrorCount=0,this.start()},parse:function(t){return t},getBackoffRate:function(){var t,e=this.get("backoffRates");return s.isEmpty(e)||!s.isArray(e)||0===this.currentUnchangedCount?1:(t=Math.min(this.currentUnchangedCount,e.length)-1,Math.max(1,s.get(e,t,1)))},getPollingFrequency:function(){return this.get("frequency")*this.getBackoffRate()},makeRequest:function(){var t=this.getRequestData(),e={url:this.get("url"),type:this.get("requestType"),dataType:this.get("dataType"),cache:this.get("cache"),data:t};return n.ajax(e)},scheduleNextPoll:function(){var t=this.getPollingFrequency();return this.set("hasPolled",!0),this.get("isPolling")?void(!s.isFinite(t)||0>=t||(this.currentErrorCount<=this.get("stopAfterNumErrors")?(this.cancelNext(),this._nextPollToken=setTimeout(s.bind(this.poll,this),t)):this.stop())):!1},_onRequestSuccess:function(t){this.currentErrorCount=0,t=this.parse(t),this.callback&&this.callback(t,this._lastPollTime),this.hasResponseChanged(t)||!this.get("hasPolled")?this.currentUnchangedCount=0:this.currentUnchangedCount++},_onRequestFail:function(){this.currentErrorCount++},_onRequestAlways:function(){this.scheduleNextPoll()}});t.exports=r},function(t,e,i){"use strict";var s=i(7),n=i(3),o={CONVERSATION_FETCHING:"conversation:fetching",CONVERSATION_OPEN_CONVERSATION_MODEL:"conversation:open:model:conversation",CONVERSATION_OPEN_PARTICIPANT_MODELS:"conversation:open:model:partipants",CONVERSATION_OPEN_TUMBLR_URL:"conversation:open:tumblr:url",CONVERSATION_OPEN_MESSAGING_URL:"conversation:open:messaging:url",CONVERSATION_DELETE_MODEL:"conversation:delete:model",CONVERSATION_MESSAGE_SENT:"conversation:message:sent",CONVERSATION_MESSAGE_SENDING:"conversation:message:sending",CONVERSATION_MESSAGE_FAILED:"conversation:message:failed",CONVERSATION_MESSAGE_INPUT:"conversation:message:input",CONVERSATION_MESSAGES_SEND_REQUESTED:"conversation:messages:send:requested",CONVERSATION_MESSAGES_SENDING:"conversation:messages:sending",CONVERSATION_MESSAGES_UNREAD_FETCHED:"conversation:messages:unread:fetched",CONVERSATION_MARK_AS_SPAM:"conversation:spam",CONVERSATION_IMAGE_PREVIEW_ADD:"conversation:image:preview:add",CONVERSATION_IMAGE_PREVIEW_DISMISS:"conversation:image:preview:dismiss",CONVERSATION_IMAGE_PREVIEW_EDIT:"conversation:image:preview:edit",CONVERSATION_IMAGE_LIGHTBOX:"conversation:image:lightbox",CONVERSATION_COMPOSE_PLUGIN_CLICK:"conversation:compose:plugin:click",BLOCK:"block"},r=function(){};r.extend=s.Model.extend,n.extend(r.prototype,s.Events),n.extend(r.prototype,o),t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(143),o=i(598),r=n.extend({name:"MessagingUnreadManager",defaults:{dataChannelKey:"mention_key",overridesExpirationInMs:500},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"channels"));var e=this.channels.map(function(t){return{channelId:t.get("uuid")}});this.unreadCollection=new o(e),this.unreadCollectionOverrides=new o(e),this.listenTo(this.unreadCollection,"change:data",this._onUnreadCollectionChange)},setData:function(t){this._pruneOverrides(),this._updateUnreadCollection(t),this.unreadData=t},setConversationModelCount:function(t,e){var i,s=t.get("id"),n=t.get("participantUuid"),o=this.unreadCollectionOverrides.findWhere({channelId:n});o&&(i=o.get("data")||{},i[s]=e,o.set({data:i,updateDate:new Date}),this._updateUnreadCollection(this.unreadData))},_getOverridesData:function(){var t=this.get("dataChannelKey");return this.unreadCollectionOverrides.reduce(function(e,i){var n=i.get("data"),o=this.channels.get(i.get("channelId")),r=o.get(t);return s.isEmpty(n)||(e[r]=n),e},{},this)},_pruneOverrides:function(){var t=new Date,e=this.get("overridesExpirationInMs");this.unreadCollectionOverrides.each(function(i){var n=i.get("updateDate");s.isDate(n)&&t-n>e&&i.set({updateDate:null,data:null})})},_updateUnreadCollection:function(t,e){var i=this._getOverridesData();this.unreadCollection.each(function(e){var n=this.channels.get(e.get("channelId")),o=n.get(this.get("dataChannelKey")),r=s.get(t,o),a=s.get(i,o);s.isEmpty(a)||(r=s.merge({},r,a)),e.set("data",r)},this)},_onUnreadCollectionChange:function(t){var e,i=t.get("data")||null,n=t.previous("data")||null,o=this.channels.get(t.get("channelId"));this.trigger("change:channel",o,i),s.each(i,function(t,i){e=s.get(n,i),e!==t&&this.trigger("change:conversation",i,t,o)},this)}});t.exports=r},function(t,e,i){"use strict";var s=i(118),n=i(599),o=s.extend({model:n});t.exports=o},function(t,e,i){"use strict";var s=i(113),n=s.extend({idAttribute:"channelId",defaults:{channelId:null,data:null}});t.exports=n},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(120),r=i(143),a=i(601),l=i(603),h=i(604),c=i(605),u=r.extend({name:"MessagingWindowManager",defaults:{isInboxOpen:!1,isConversationOpen:!1,inboxAnimationSpeed:100,conversationAnimationSpeed:250,isMinimizeEnabled:!1,isPersistenceEnabled:!1,isMultipleOpenWindowsEnabled:!1,conversationPopoversContainerClass:"messaging-conversation-popovers",containerClass:"messaging-conversations-container",openConversationsContainerClass:"messaging-open-conversations",minimizedConversationsContainerClass:"messaging-minimized-conversations",bodyClassConversationsHasOpen:"messaging-conversations-open",bodyClassConversationsHasMinimized:"messaging-conversations-minimized",containerClassConversationsHasOpen:"has-open",containerClassConversationsHasMinimized:"has-minimized",persistenceKeyOpen:"open",persistenceKeyMinimized:"minimized"},initialize:function(t){t=n.extend({},t),n.extend(this.attributes,n.pick(t,n.keys(this.defaults))),n.extend(this,n.pick(t,"eventBus","user","channels","currentBlogModel","keyboardManager","inboxConfig","conversationConfig","persistenceManager")),this.openConversations=new a,this.minimizedConversations=new a,this.listenTo(this.openConversations,"add remove",this._onConversationsCollectionChange),this.listenTo(this.minimizedConversations,"add remove",this._onConversationsCollectionChange),this.listenTo(this.openConversations,"add remove",this._onOpenConversationsCollectionChange),this.listenTo(this.minimizedConversations,"add remove",this._onMinimizedConversationsCollectionChange),this.listenTo(this.openConversations,"add",this._onConversationAdd),this.listenTo(this.openConversations,"remove",this._onConversationRemove),this.listenTo(this.minimizedConversations,"add",this._onConversationAdd),this.listenTo(this.minimizedConversations,"remove",this._onConversationRemove),this.isPersistenceEnabled()&&this.listenTo(this.persistenceManager,"sync",this._onPersistenceManagerSync)},remove:function(t){this.isInboxOpen()&&this.removeInbox(),this.isConversationOpen()&&this.removeConversations(t)},saveConversationsState:function(t,e){this.isPersistenceEnabled()&&!this.get("isSyncing")&&this.persistenceManager.save(t.pluck("model"),e)},loadConversationsState:function(){var t,e;this.isPersistenceEnabled()&&(e=this.persistenceManager.load(this.get("persistenceKeyMinimized")),t=this.persistenceManager.load(this.get("persistenceKeyOpen")),e.then(n.bind(function(t){this._addLoadedConversationModels(t,this.minimizedConversations,{isMinimized:!0}),this.trigger("conversations:loaded:minimized",t)},this)),t.then(n.bind(function(t){this._addLoadedConversationModels(t,this.openConversations),this.trigger("conversations:loaded:open",t)},this)),o.join(t,e).spread(n.bind(function(t,e){this.trigger("conversations:loaded",t,e)},this)))},isPersistenceEnabled:function(){return!n.isEmpty(this.persistenceManager)&&this.get("isPersistenceEnabled")},_addLoadedConversationModels:function(t,e,i){n.each(t,function(t,s){n.delay(n.bind(function(){this._addLoadedConversationModel(t,e,i)},this),s)},this)},_addLoadedConversationModel:function(t,e,i){var s={skipAnimationOnRender:!0},n=this._createConversationPopover(t,s,i),o={isFromPersistence:!0,context:"persistence"};return e.add({model:t,popover:n,options:o},o)},addInbox:function(t,e){var i=this.get("inboxAnimationSpeed");return this.isInboxOpen()?this.inboxPopover:(this.inboxCollection=t,this.inboxPopover=this._createInboxPopover(t),this.trigger("inbox:adding",t,this.inboxPopover,e),i>0?setTimeout(n.bind(function(){this._afterInboxOpened(e)},this),i):this._afterInboxOpened(e),this.listenToOnce(this.inboxPopover,"close",function(){this._onInboxClose(e)}),this.set("isInboxOpen",!0),this.inboxPopover)},removeInbox:function(t){t||(t=this.inboxCollection),t===this.inboxCollection&&this.inboxPopover&&this.inboxPopover.teardown()},isInboxOpen:function(){return this.get("isInboxOpen")},addConversation:function(t,e){var i,s=this.get("isMinimizeEnabled"),n=this.get("isMultipleOpenWindowsEnabled");return n||(s?this.minimizeConversations(!0):this.removeConversations(!0)),i=this._createConversationPopover(t),t.set("lastOpenedDateTs",(new Date).getTime()),this.openConversations.add({model:t,popover:i,options:e}),i},removeConversation:function(t,e){var i=this._getWindowModel(t);this.openConversations.remove(i,{skipAnimation:e})},isConversationMinimized:function(t){var e,i=this.getConversationPopover(t);return i?(e=i.getView(),e&&e.isMinimized()):!1},removeConversations:function(t){this.openConversations.remove(this.openConversations.models,{skipAnimation:t})},isConversationOpen:function(){return this.get("isConversationOpen")},getConversationPopover:function(t){var e=this._getWindowModel(t);return e?e.getPopover():null},getConversationModelByIdAndParticipant:function(t,e){return this.openConversations.getByIdAndParticipant(t,e)||this.minimizedConversations.getByIdAndParticipant(t,e)},minimizeConversations:function(t){var e=n.clone(this.openConversations.models);n.each(e,function(e){e.getView().minimize(t)})},_createConversationPopover:function(t,e,i){var s,o=n.result(this.conversationConfig,"options"),r=n.get(this.conversationConfig,"constructor"),a=n.get(this.conversationConfig,"popoverOptions"),l=n.bind(function(e){return n.extend({},o,{eventBus:this.eventBus,user:this.user,channels:this.channels,model:t,popoverContainer:e.el,keyboardManager:this.keyboardManager},i)},this);return a=n.extend({},a,{viewConstructor:r,viewOptions:l},e),this.conversationsPopoversContainer||this._createConversationsPopoversContainer(),s=new h(a),s.render(),this._removeTimer&&clearTimeout(this._removeTimer),s},_createInboxPopover:function(t){var e,i=n.result(this.inboxConfig,"options"),s=n.get(this.inboxConfig,"constructor"),o=n.result(this.inboxConfig,"popoverOptions"),r=n.bind(function(e){return n.extend({},i,{eventBus:this.eventBus,collection:t,user:this.user,channels:this.channels,currentBlogModel:this.currentBlogModel,keyboardManager:this.keyboardManager,popoverContainer:e.el})},this);return o=n.extend({},o,{viewConstructor:s,animationSpeed:this.get("inboxAnimationSpeed"),viewOptions:r}),e=new l(o),e.render(),e},_removeConversationPopover:function(t,e){var i=this.get("conversationAnimationSpeed");e||0>=i?t.remove():t.teardown(),this._checkRemoveConversationPopoversContainer(e)},_checkRemoveConversationPopoversContainer:function(t){var e=this.get("conversationAnimationSpeed"),i=function(){var t=this.openConversations.length>0,e=this.minimizedConversations.length>0;t||e||this._removeConversationPopoversContainer()};this._removeTimer&&(clearTimeout(this._removeTimer),this._removeTimer=null),t||0>=e?i.call(this):this._removeTimer=setTimeout(n.bind(function(){i.call(this),this._removeTimer=null},this),e)},_focusNextConversationWindow:function(t){return this._incrementFocusConversationWindow(t,1)},_focusPreviousConversationWindow:function(t){return this._incrementFocusConversationWindow(t,-1)},_incrementFocusConversationWindow:function(t,e){var i,s,o,r,a,l=[];return l.push.apply(l,this.openConversations.models),l.push.apply(l,this.minimizedConversations.models),a=l.length,2>a?!1:(i=n.indexOf(l,t),s=i+=e,s>=a||0>s?!1:(o=n.get(l,s),n.isEmpty(o)?!1:(r=o.getPopover(),r.focus(),!0)))},_callAfterDelay:function(t,e){e>0?setTimeout(n.bind(t,this),e):t.call(this)},_onConversationAdd:function(t,e,i){var s=n.get(i,"isMoving",!1);s||this._afterConversationWindowModelAdded(t,i)},_onConversationRemove:function(t,e,i){var s=n.get(i,"skipAnimation",!1),o=n.get(i,"isMoving",!1);o||this._afterConversationWindowModelRemoved(t,s)},_onPersistenceManagerSync:function(t,e){this._syncFlushData||(this._syncFlushData={}),n.set(this._syncFlushData,t,e),this._syncFlushTimer||(this._syncFlushTimer=setTimeout(n.bind(function(){this._flushSync(this._syncFlushData),delete this._syncFlushTimer,delete this._syncFlushData},this),50))},_flushSync:function(t){var e=n.get(t,this.get("persistenceKeyOpen"),[]),i=n.get(t,this.get("persistenceKeyMinimized"),[]),s=this.openConversations.pluck("model"),o=this.minimizedConversations.pluck("model"),r=this._getConversationLookupCache(e),a=this._getConversationLookupCache(i),l=this._getConversationLookupCache(s),h=this._getConversationLookupCache(o),c=[],u=[],d=[],p=[];this.set("isSyncing",!0),n.each(l,n.bind(function(t,e){n.has(r,e)||(n.has(a,e)?u.push(t):c.push(t))},this)),d=n.reduce(h,n.bind(function(t,e,i){return!n.has(a,i)&&n.has(r,i)&&t.push(e),t},this),[]),p=n.reduce(r,n.bind(function(t,e,i){return n.has(l,i)||n.has(h,i)||t.push(e),t},this),[]),n.each(u,n.bind(function(t){var e=this.openConversations.getByConversationModel(t);e.getView().minimize(!0)},this)),n.each(d,n.bind(function(t){var e=this.minimizedConversations.getByConversationModel(t);e.getView().unminimize(!0)},this)),n.each(c,n.bind(function(t){this.removeConversation(t,!0)},this)),n.each(p,n.bind(function(t){this.addConversation(t)},this)),this.set("isSyncing",!1)},_getConversationLookupCacheKey:function(t){var e=[t.getParticipantId()].concat(t.getParticipantsIds());return e.join(":")},_getConversationLookupCache:function(t){return n.mapKeys(t,this._getConversationLookupCacheKey)},_insertElementAtIndex:function(t,e,i){var s=e.children();0===s.length||0===i?e.prepend(t):i>=s.length?e.append(t):t.insertBefore(n.get(s,i))},_onConversationWindowTab:function(t,e){this._focusNextConversationWindow(t)&&e.preventDefault()},_onConversationWindowShiftTab:function(t,e){this._focusPreviousConversationWindow(t)&&e.preventDefault()},_onMinimizedConversationsCollectionChange:function(t,e,i){n.get(i,"isFromPersistence")||this.saveConversationsState(this.minimizedConversations,this.get("persistenceKeyMinimized"))},_onOpenConversationsCollectionChange:function(t,e,i){n.get(i,"isFromPersistence")||this.saveConversationsState(this.openConversations,this.get("persistenceKeyOpen"))},_onConversationsCollectionChange:function(){var t=this.openConversations.length>0||this.minimizedConversations.length>0;this.set("isConversationOpen",t),this._addBodyClasses(),this._addContainerClasses()},_addBodyClasses:function(){var t=s("body");t.toggleClass(this.get("bodyClassConversationsHasOpen"),this.openConversations.length>0),t.toggleClass(this.get("bodyClassConversationsHasMinimized"),this.minimizedConversations.length>0)},_addContainerClasses:function(){var t=this.conversationsPopoversContainer;t&&(t.toggleClass(this.get("containerClassConversationsHasOpen"),this.openConversations.length>0),t.toggleClass(this.get("containerClassConversationsHasMinimized"),this.minimizedConversations.length>0))},_onInboxClose:function(t){var e=this.get("inboxAnimationSpeed");this.trigger("inbox:removing",this.inboxCollection,this.inboxPopover,t),this.set("isInboxOpen",!1),e>0?setTimeout(n.bind(function(){this._afterInboxClosed(t)},this),e):this._afterInboxClosed(t)},_onChangeConversationMinimized:function(t,e){var i=e?this.openConversations:this.minimizedConversations,s=e?this.minimizedConversations:this.openConversations,n=i.getByConversationModel(t),o=e?"conversation:minimized":"conversation:unminimized",r={isMoving:!0};e||this.get("isMultipleOpenWindowsEnabled")||this.minimizeConversations(!0),i.remove(n,r),s.add(n,r),this.trigger(o,n.getConversation(),n.getPopover())},_afterInboxOpened:function(t){this.trigger("inbox:added",this.inboxCollection,this.inboxPopover,t)},_afterInboxClosed:function(t){this.trigger("inbox:removed",this.inboxCollection,this.inboxPopover,t),this.inboxPopover=null,this.inboxCollection=null},_createConversationsPopoversContainer:function(){return this.conversationsPopoversContainer?this.conversationsPopoversContainer:(this.conversationsPopoversContainer=s("<div />").addClass(this.get("conversationPopoversContainerClass")),this.openConversationsContainer=new c({collection:this.openConversations,className:[this.get("containerClass"),this.get("openConversationsContainerClass")].join(" ")}).render(),this.minimizedConversationsContainer=new c({collection:this.minimizedConversations,className:[this.get("containerClass"),this.get("minimizedConversationsContainerClass")].join(" "),isScrollEnabled:!0,isAdjustToBrowserHeightEnabled:!0}).render(),this.conversationsPopoversContainer.append(this.openConversationsContainer.$el),this.conversationsPopoversContainer.append(this.minimizedConversationsContainer.$el),s("body").append(this.conversationsPopoversContainer),this._addContainerClasses(),this.conversationsPopoversContainer)},_removeConversationPopoversContainer:function(){this.conversationsPopoversContainer&&(this.conversationsPopoversContainer.remove(),this.conversationsPopoversContainer=null),this.openConversationsContainer&&(this.openConversationsContainer.remove(),this.openConversationsContainer=null),this.minimizedConversationsContainer&&(this.minimizedConversationsContainer.remove(),this.minimizedConversationsContainer=null)},_getWindowModel:function(t){return this.openConversations.getByConversationModel(t)||this.minimizedConversations.getByConversationModel(t)},_addConversationWindowEvents:function(t){var e=t.getView();this.listenTo(e,"keydown:tab",function(e){this._onConversationWindowTab(t,e)}),this.listenTo(e,"keydown:shift+tab",function(e){this._onConversationWindowShiftTab(t,e)}),this.listenToOnce(e,"close",function(){this.removeConversation(t.getConversation())}),this.listenTo(e,"change:isMinimized",function(e,i){this._onChangeConversationMinimized(t.getConversation(),i)})},_afterConversationWindowModelAdded:function(t){var e=t.getConversation(),i=t.getPopover(),s=t.getOptions(),n=this.get("conversationAnimationSpeed"),o=function(){this.trigger("conversation:added",e,i,s)};this.trigger("conversation:adding",e,i,s),this._addConversationWindowEvents(t),this._callAfterDelay(o,n)},_afterConversationWindowModelRemoved:function(t,e){var i=this.get("conversationAnimationSpeed"),s=t.getView(),o=t.getPopover(),r=t.getConversation(),a=t.getOptions(),l=function(){this.trigger("conversation:removed",r,o,a)};this.stopListening(o),this.stopListening(s),this._removeConversationPopover(o,e),this.trigger("conversation:removing",r,o,a),e||0>=i?l.call(this):setTimeout(n.bind(l,this),i)}});t.exports=u},function(t,e,i){"use strict";var s=i(3),n=i(118),o=i(602),r=n.extend({model:o,comparator:function(t){return t.getConversation().get("lastOpenedDateTs")},getByIdAndParticipant:function(t,e){var i=this.find(function(i){var s=i.getConversation();return s.get("id")===t&&s.get("participantUuid")===e});return i?i.getConversation():null},getByConversationModel:function(t){return this.find(function(e){var i=e.getConversation();return!s.isEmpty(i)&&i.isSameConversation(t)})}});t.exports=r},function(t,e,i){"use strict";var s=i(113),n=s.extend({defaults:{popover:null,model:null,options:null,skipAnimation:!1,isMinimizing:!1},getOptions:function(){return this.get("options")},getConversation:function(){return this.get("model")},getPopover:function(){return this.get("popover")},getView:function(){var t=this.getPopover();return t?t.getView():null}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(155),r=i(212),a=o.extend({className:"popover--inbox-popover",mixins:[r],defaults:{animationSpeed:100},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"viewOptions","viewConstructor"))},render:function(){return this.$wrapper=n("<div />").addClass("popover-inner").appendTo(this.$el),this.$wrapper.addClass("hide-popover"),this.$pinned.addClass("active"),this._createView(this.viewOptions),s.defer(s.bind(function(){this.$wrapper.removeClass("hide-popover")},this)),this},teardown:function(){var t=this.get("animationSpeed");return this.$wrapper.addClass("hide-popover"),this.$pinned.removeClass("active"),t>0?setTimeout(s.bind(this._afterHide,this),this.get("animationSpeed")):this._afterHide(),this},getView:function(){return this.inboxView},_createView:function(t){t=s.isFunction(t)?t.call(this,this):t,this.inboxView&&this.inboxView.remove(),this.inboxView=new this.viewConstructor(t),this.$wrapper.html(this.inboxView.render().$el)},_afterHide:function(){this.inboxView&&this.inboxView.remove(),this.$el.remove()}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(155),o=n.extend({className:"popover--conversation-popover",defaults:{animationSpeed:250,skipAnimationOnRender:!1,skipAnimationOnRemove:!1},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"viewOptions","viewConstructor")),s.isFunction(this.viewOptions)&&(this.viewOptions=this.viewOptions.call(this,this))},render:function(){return this.conversationView=new this.viewConstructor(this.viewOptions),this.$el.html(this.conversationView.render().$el),!this.get("skipAnimationOnRender")&&this.get("animationSpeed")>=0&&this._animateIn(),this},teardown:function(){var t=this.get("animationSpeed");return!this.get("skipAnimationOnRemove")&&t>=0?(this.$el.addClass("hide-popover"),setTimeout(s.bind(this.remove,this),t)):this.remove(),this},beforeRemove:function(){this.conversationView&&this.conversationView.remove()},getView:function(){return this.conversationView},poll:function(){var t=this.getView();return t?t.poll():void 0},refresh:function(t){var e=this.getView();return e?e.refresh(t):void 0},fetch:function(){var t=this.getView();return t?t.fetch():void 0},focus:function(){var t=this.getView();return t?t.focus():void 0},isMinimized:function(){var t=this.getView();return t?t.isMinimized():void 0},_animateIn:function(){this.$el.addClass("hide-popover"),s.defer(s.bind(function(){this.rendered&&this.$el.removeClass("hide-popover")},this))}});t.exports=o},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(155),r=i(390),a=o.extend({defaults:{isScrollEnabled:!1,isAdjustToBrowserHeightEnabled:!1},initialize:function(t){t=n.extend({},t),n.extend(this.attributes,n.pick(t,n.keys(this.defaults))),n.extend(this,n.pick(t,"collection"))},render:function(){return this.get("isScrollEnabled")?(this.$rootContainer=s("<div />").addClass("scroller").appendTo(this.$el),this.scrollBar=new r({el:this.$rootContainer.get(0)}),this.get("isAdjustToBrowserHeightEnabled")&&this.listenTo(this.scrollBar,"resize",this._onScrollResize)):this.$rootContainer=this.$el,this.listenTo(this.collection,"reset",this._onCollectionReset),this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this._renderAllPopovers(),this.scrollBar&&n.defer(n.bind(this._updateScroll,this)),this},remove:function(){this.scrollBar&&(this.stopListening(this.scrollBar),this.scrollBar.remove())},_renderAllPopovers:function(){var t=this.$rootContainer;this.rendered&&(t.empty(),this.collection.each(n.bind(function(e){var i=e.getPopover();this.rendered&&i&&t.append(i.$el)},this)))},_updateScroll:function(){this.rendered&&this.scrollBar&&(this.get("isAdjustToBrowserHeightEnabled")&&this._updateScrollHeight(),this.scrollBar.update())},_updateScrollHeight:function(){var t,e,i=89;this.scrollBar&&this.rendered&&(t=s(window).height(),e=this.$rootContainer.get(0).scrollHeight,this.$el.height(Math.min(t-i,e)),this.$rootContainer.scrollTop(e))},_onCollectionAdd:function(t,e,i){var s=t.getPopover(),o=s.$el,r=e.indexOf(t),a=this.$rootContainer,l=a.children();this.rendered&&(0===l.length||0===r?a.prepend(o):r>=l.length?a.append(o):o.insertBefore(n.get(l,r)),this.scrollBar&&this._updateScroll())},_onCollectionRemove:function(t,e,i){this.scrollBar&&n.defer(n.bind(this._updateScroll,this))},_onCollectionReset:function(t,e){this._renderAllPopovers()},_onScrollResize:function(){this._updateScrollHeight()}});t.exports=a},function(t,e,i){"use strict";var s=i(8),n=i(120),o=i(3),r=i(143),a=i(607),l=r.extend({name:"MessagingWindowPersistence",defaults:{storageKeyPrefix:"messaging",isSyncEnabled:!1},initialize:function(t){t=o.extend({},t),o.extend(this.attributes,o.pick(t,o.keys(this.defaults))),o.extend(this,o.pick(t,"user")),this.get("isSyncEnabled")&&this._addSyncListeners()},save:function(t,e){var i,s=n.defer(),r=this._getStorageKey(e);return i=o.map(t,this._getObjectFromModel),this._saveLocalStorage(r,i),s.resolve(),s.promise},load:function(t){var e=n.defer(),i=this._getStorageKey(t),s=this._loadLocalStorage(i),r=o.map(s,this._getModelFromObject);return e.resolve(r||[]),e.promise},clear:function(){var t,e=window.localStorage;if(e){t=this._getStorageKey();try{o.each(o.keys(e),function(i){o.startsWith(i,t+":")&&e.removeItem(i)})}catch(i){this._triggerError(i)}}},remove:function(){this.get("isSyncEnabled")&&this._removeSyncListeners()},_addSyncListeners:function(){s(window).on("storage.messaging-window-persistence",o.bind(this._onStorageChange,this))},_removeSyncListeners:function(){s(window).off(".messaging-window-persistence")},_onStorageChange:function(t){var e,i,s=o.get(t,"originalEvent.key"),n=o.get(t,"originalEvent.newValue"),r=this._getStorageKey(),a=s.substring(r.length+1);if(!o.isEmpty(s)&&!o.isEmpty(a)&&o.startsWith(s,r)&&!o.isEmpty(n))try{e=JSON.parse(n),i=o.map(e,this._getModelFromObject),this.trigger("sync",a,i),this.trigger("sync:"+a,i)}catch(l){this._triggerError(l)}},_getStorageKey:function(t){var e=[this.get("storageKeyPrefix"),this.user.get("name"),t];return o.compact(e).join(":")},_saveLocalStorage:function(t,e){if(window.localStorage)try{window.localStorage.setItem(t,JSON.stringify(e))}catch(i){this._triggerError(i)}},_loadLocalStorage:function(t){var e;if(!window.localStorage)return[];try{return e=window.localStorage.getItem(t),o.isEmpty(e)?[]:JSON.parse(e)}catch(i){return this._triggerError(i),[]}},_getObjectFromModel:function(t){var e=["uuid","url","name","avatar_url","theme"],i=t.get("participants").map(function(t){return t.pick(e)});return{id:t.get("id"),participantUuid:t.get("participantUuid"),participants:i,lastOpenedDateTs:t.get("lastOpenedDateTs")}},_getModelFromObject:function(t){return new a(t)},_triggerError:function(t){this.trigger("error",t)}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(608),r=i(609),a=i(113),l=i(610),h=i(616),c=i(618),u=a.extend({url:"/svc/conversations/messages",mixins:[o,r],relations:{messages:h,participants:c},relationsOrder:["participants","messages"],defaults:{id:null,status:null,last_modified_ts:null,last_read_ts:null,participants:null,messages:null,can_send:!0,is_possible_spam:!1,is_blurred_images:!1,lastOpenedDateTs:null,participantUuid:null,unreadCount:0},fetchNonErrorCodes:[404],fetchNoRetryOnErrorCodes:[403,429],isUnread:function(){return this.get("last_modified_ts")>this.get("last_read_ts")},flushMessageQueue:function(t){return this.flushQueue(this.sendMessage,t)},canRetryFetch:function(t){return s.isFinite(t)&&!s.contains(this.fetchNoRetryOnErrorCodes,t)},markAsRead:function(){var t=(new Date).getTime();this.set({last_read_ts:parseInt(t/1e3,10),unreadCount:0})},parse:function(t,e){var i=s.get(t,"response")||t;return s.get(e,"isFetchInbox")&&s.extend(i,this.pick("is_possible_spam","is_blurred_images")),i},destroy:function(t){var e={conversation_id:this.get("id"),participant:this.get("participantUuid")};return t=s.extend({},t,{url:this.url+"?"+n.param(e)}),a.prototype.destroy.call(this,t)},markAsSpam:function(t){t=t||"inline";var e={conversation_id:this.get("id"),participant:this.get("participantUuid"),context:t,type:"spam"};return n.ajax({url:"/svc/conversations/flag",method:"POST",withFormKey:!0,data:e})},fetchConversation:function(t){var e=new n.Deferred,i=function(){e.resolve.apply(this,arguments)},o=function(){e.reject.apply(this,arguments)};return this.fetch(this._getFullFetchOptions(t)).then(s.bind(i,this)).fail(s.bind(function(t,e){var n=s.get(t,"status");this.isNew()&&s.contains(this.fetchNonErrorCodes,n)?i.call(this,{},e):o.apply(this,arguments)},this)),e},poll:function(t,e){var i;return this.isNew()?(new n.Deferred).reject():(i={participant:this.get("participantUuid"),conversation_id:this.get("id")},e&&s.extend(i,{limit:e}),this.get("messages").poll({isPolling:!0,data:i}))},getConversationDataForMessage:function(){var t={participant:this.get("participantUuid")};return this.isNew()?s.extend(t,{participants:this.getParticipantsIds()}):s.extend(t,{conversation_id:this.get("id")}),t},addMessage:function(t,e){return e=e||{},t.set(this.getConversationDataForMessage()),this.get("messages").add(t),t},sendMessage:function(t,e){return e=e||{},t.set(this.getConversationDataForMessage()),t.save(null,e).then(s.bind(function(t){var i=this.parse(t,e);this.isNew()?this.set(s.omit(i,"messages")):this.set(s.pick(i,"is_possible_spam"))},this))},getParticipantModel:function(){return this.get("participants").get(this.get("participantUuid"))},getParticipantId:function(){return this.get("participantUuid")},getParticipantsIds:function(){return this.get("participants").pluck("uuid")},getOtherParticipant:function(){var t=this.get("participants").getWithout([this.getParticipantId()]);return s.first(t)},getInboxMessage:function(){var t=this.get("messages").where({isError:!1});return s.last(t)},isSameConversation:function(t){var e=t.getParticipantId(),i=t.getParticipantsIds(),n=this.getParticipantId(),o=this.getParticipantsIds();return n===e&&s.union(o,i).length===o.length},unblurImages:function(){
  this.set("is_blurred_images",!1);var t={conversation_id:this.get("id"),participant:this.get("participantUuid"),type:"unblur"};n.ajax({url:"/svc/conversations/flag",method:"POST",withFormKey:!0,data:t})},shouldBlurImageMessage:function(t){return this.get("is_blurred_images")&&t.isImage()?t.get("participant")!==this.getParticipantId():!1},_getFullFetchOptions:function(t){var e=this.isNew()?this._getDataForFetchByParticipants():this._getDataForFetchById();return e=s.extend({},e,{participant:this.get("participantUuid")}),s.extend({},t,{isFetching:!0,cache:!1,reset:!0,data:e})},_getDataForFetchById:function(t){return{conversation_id:this.get("id")}},_getDataForFetchByParticipants:function(t){return{participants:this.getParticipantsIds()}}},{createPostMessage:function(t,e,i){return i=s.extend({},i,{type:l.POST,post:{blog:e,id:t}}),new l(i)},createTextMessage:function(t,e){return e=s.extend({},e,{type:l.TEXT,message:t,content:{text:t}}),new l(e)},createImagePostMessage:function(t,e,i,s,n,o){var r=u.createPostMessage(t,e,o),a=r.getPost();return a.setType("photo"),a.addThumbnail(i,s,n),r},createImageMessage:function(t,e,i,n,o){return o=s.extend({},o,{type:l.IMAGE,file:e,image:{original_size:{width:i,height:n,url:t}}}),new l(o)},createStickerMessage:function(t,e,i,n){return n=s.extend({},n,{type:l.STICKER,sticker_id:t,sticker:{url:e,original_size_url:i}}),new l(n)}});t.exports=u},function(t,e,i){"use strict";var s=i(3),n=i(7),o=i(115),r=new o({defaults:{relationKeys:function(){return s.keys(this.relations)},getRelations:function(){return s.pick(this.attributes,this.relationKeys())}},before:{initialize:function(t,e){this._bootstrapRelations(t,e)}},extend:{_isModelOrCollection:function(t){return t instanceof n.Collection||t instanceof n.Model},_bootstrapRelations:function(t,e){this._isBootstrapped||(s.forEach(this.relations,function(i,n){var o=this.attributes[n];!s.isEmpty(o)&&o instanceof i||(this.attributes[n]=new i(t[n],e))},this),this._isBootstrapped=!0)}},around:{set:function(t,e,i,o){var r,a,l,h,c,u,d=this.attributes,p=this.relationKeys(),g=!this._isBootstrapped;return s.isObject(e)?(r=e,o=i):(r={})[e]=i,o=o||{},c=s.result(o,"relationalSetOptions")||{},this._bootstrapRelations(r,o),a=s.pick(r,p),s.isEmpty(a)?t.apply(this,s.rest(arguments)):(u=s.isEmpty(this.relationsOrder)?s.keys(a):this.relationsOrder,g||s.forEach(u,function(t){r[t]&&(h=a[t],l=d[t],this._isModelOrCollection(l)&&(o.unset?l instanceof n.Collection?l.reset():l instanceof n.Model&&l.clear():(this._isModelOrCollection(h)&&(h=h.toJSON()),o.reset&&l instanceof n.Collection?l.reset(h,s.extend({},o,c[t])):l.set(h,s.extend({},o,c[t])))))},this),t.call(this,s.omit(r,p),o))},toJSON:function(t){var e=t.apply(this,s.rest(arguments))||{};for(var i in this.relations)this.relations.hasOwnProperty(i)&&(e[i]=s.result(e[i],"toJSON")||e[i]);return e}}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(115),r=new o({extend:{getQueue:function(){return this.queue||(this.queue=[]),this.queue},getQueueItems:function(){return s.pluck(this.getQueue(),"item")},clearQueue:function(){this.getQueue().length=0},isFlushingQueue:function(){return this._isFlushingQueue===!0},hasQueue:function(){return this.getQueue().length>0},appendToQueue:function(t,e){var i=this.getQueue();return t=this._getItemsAsArray(t),i.push.apply(i,this._constructItemWrappers(t,e)),i},prependToQueue:function(t,e){var i=this.getQueue();return t=this._getItemsAsArray(t),i.unshift.apply(i,this._constructItemWrappers(t,e)),i},removeFromQueue:function(t){return t=this._getItemsAsArray(t),this.queue=s.reduce(this.getQueue(),function(e,i){var n=s.get(i,"item");return s.contains(t,n)?e:(e.push(i),e)},[]),this.queue},flushQueue:function(t,e){var i,o=this.getQueue();return this._isFlushingQueue?this._flushQueueDeferred:s.isFunction(t)?(this._isFlushingQueue=!0,this._flushQueueDeferred=new n.Deferred,i=function(){var n,r,a;if(this._isFlushingQueue){if(0===o.length)return this._isFlushingQueue=!1,void this._onQueueSuccess(e);n=o.shift(),r=s.get(n,"item"),a=s.get(n,"options"),this._onQueueItemStart(r,a,e),t.call(this,r,a,e).then(s.bind(function(){this._onQueueItemSuccess(r,a,e),i.call(this)},this)).fail(s.bind(function(){this._isFlushingQueue=!1,this._onQueueItemFail(r,a,e)},this))}},i.call(this),this._flushQueueDeferred):(new n.Deferred).reject()},abortFlush:function(){this._isFlushingQueue&&(this._isFlushingQueue=!1,this._flushQueueDeferred.reject())},_getItemsAsArray:function(t){return s.isArray(t)||(t=[t]),t},_constructItemWrappers:function(t,e){return s.map(t,function(t){return{item:t,options:e}})},_onQueueItemStart:function(t,e,i){this._flushQueueDeferred.notify(t,!1,e,i,this.getQueueItems())},_onQueueItemSuccess:function(t,e,i){this._flushQueueDeferred.notify(t,!0,e,i,this.getQueueItems())},_onQueueItemFail:function(t,e,i){this._flushQueueDeferred.reject(t,e,i,this.getQueueItems())},_onQueueSuccess:function(t){this._flushQueueDeferred.resolve(t)}}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(113),r=i(429),a=i(608),l=i(611),h=i(612),c=i(613),u={TEXT:"TEXT",POST:"POSTREF",IMAGE:"IMAGE",STICKER:"STICKER"},d=o.extend({mixins:[a],relations:{content:l,post:h,image:c},idAttribute:"ts",defaults:{conversation_id:null,type:u.TEXT,ts:null,participant:null,participants:null,content:null,message:null,post:null,image:null,file:null,sticker:null,sticker_id:null,collapseGroup:null,clientTs:null,tsHeader:null,isQueued:!1,isPending:!1,isError:!1,isCollapsed:!1,canRetry:!0,hasAnimation:!1,context:null,creationUserAction:null},persistedFields:["conversation_id","type","participant","participants","message","post","context","sticker_id"],saveNoRetryOnErrorCodes:[403,404],validSendMessageContexts:["post-chrome","messaging-gif","messaging-image-upload"],initialize:function(){return this.set("clientTs",Date.now()),o.prototype.initialize.apply(this,arguments)},parse:function(t,e){var i=s.get(t,"response.messages.data.0")||t,n=s.get(i,"images");return s.isArray(n)&&s.extend(i,{image:s.first(n)}),i},save:function(t,e){var i,a,l,h,c;return e=s.extend({validate:!0,parse:!0},e),t=t||{},t&&this.set(t),a=this.toJSON(),l=s.pick(a,this.persistedFields),h=this._getServerLoggingContext(),s.isEmpty(h)?delete l.context:s.extend(l,{context:h}),s.extend(e,{data:l,emulateJSON:!0}),this.isImage()?(c=this.get("file"),this.uploader=new r({name:"data",uploadPattern:/^image\/(?:.*)$/i,accept:"image/*",url:this.url(),fileUpload:{multiple:!1,formData:l}}),this.uploader.addFiles([c]),i=this.uploader.getCurrentRequest(),i?i.then(s.bind(function(t){e.parse&&(t=this.parse(t,e)),this.set(t,e)},this)):(i=new n.Deferred,i.reject())):i=o.prototype.save.call(this,t,e),this.set({isPending:!0,isQueued:!1}),i.then(s.bind(function(){this.set("isError",!1)},this)).fail(s.bind(function(t){this.set({isError:!0,canRetry:this._canRetryOnErrorCode(s.get(t,"status"))})},this)).always(s.bind(function(){this.set("isPending",!1)},this)),i},getActionMarkup:function(t,e,i){return e=e||"",i=i||"",this.isText()?s.isEmpty(t)?null:e+s.escape(t)+i:this.isPost()?this.getPost().getActionMarkup(t,e,i):this.isImage()?this.getImage().getActionMarkup(t,e,i):null},getPost:function(){return this.get("post")},getImage:function(){return this.get("image")},getTimestamp:function(){var t=this.get("ts");return t?parseInt(t,10):this.get("clientTs")},getMessage:function(){return this.isText()?this.get("content").get("text"):this.isPost()?this.getPost().getMessage():""},isError:function(){return this.get("isError")},isText:function(){return this.get("type")===u.TEXT},isPost:function(){return this.get("type")===u.POST},isImage:function(){return this.get("type")===u.IMAGE},isDisabledPost:function(){return this.isPost()&&this.get("post").isDisabled()},isPending:function(){return this.get("isPending")},canRetry:function(){return this.get("canRetry")},_canRetryOnErrorCode:function(t){return s.isFinite(t)&&!s.contains(this.saveNoRetryOnErrorCodes,t)},_getServerLoggingContext:function(){var t=this.get("context");return!s.isEmpty(t)&&(t=s.first(t.split(":")),s.contains(this.validSendMessageContexts,t))?t:null}},u);t.exports=d},function(t,e,i){"use strict";var s=i(113),n=s.extend({defaults:{text:null,formatting:[]}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(113),r=i(194),a=o.extend({defaults:{type:null,summary:null,state:null,photos:[]},setType:function(t){var e=["photo","link","quote","audio","video","chat"];s.contains(e,t)&&this.set("type",t)},getMessage:function(){return"gif"===this.getType()?null:this.get("summary")},getActionMarkup:function(t,e,i){var o,r,a,l,h;return e=e||"",i=i||"",t=s.escape(t),r=!s.isEmpty(t),l=r?n("%1$s%2$s%3$s sent a post that's no longer available",e,t,i):n("sent a post that's no longer available"),this.isDisabled()?l:(o=this.getType(),a=r?n("%1$s%2$s%3$s sent a post",e,t,i):n("sent a post"),h=r?{photo:n("%1$s%2$s%3$s sent a photo post",e,t,i),photoset:n("%1$s%2$s%3$s sent a photoset",e,t,i),gif:n("%1$s%2$s%3$s sent a GIF",e,t,i),link:n("%1$s%2$s%3$s sent a link",e,t,i),quote:n("%1$s%2$s%3$s sent a quote",e,t,i),audio:n("%1$s%2$s%3$s sent an audio post",e,t,i),video:n("%1$s%2$s%3$s sent a video",e,t,i),chat:n("%1$s%2$s%3$s sent a chat",e,t,i)}:{photo:n("sent a photo post"),photoset:n("sent a photoset"),gif:n("sent a GIF"),link:n("sent a link"),quote:n("sent a quote"),audio:n("sent an audio post"),video:n("sent a video"),chat:n("sent a chat")},s.has(h,o)?s.get(h,o):a)},getType:function(){var t;if("photo"===this.get("type")){if(this._isThumbnailGIF())return"gif";if(t=this.get("photos")||[],t.length>1)return"photoset"}return this.get("type")},getThumbnail:function(t){var e,i=this._getClientThumbnail();return s.isEmpty(i)?(e=this._getPostThumbnail(t),s.isEmpty(e)?null:e):i},hasThumbnail:function(t){return!s.isEmpty(this.getThumbnail(t))},getScaledDimensionsForWidth:function(t,e){var i;return s.has(t,"width")&&s.has(t,"height")?(i=Math.round(s.get(t,"height")/(s.get(t,"width")/e)),{width:e,height:i}):null},isDisabled:function(){return"disabled"===this.get("state")},addThumbnail:function(t,e,i){!s.isEmpty(t)&&s.isNumber(e)&&s.isNumber(i)&&this.set("clientThumbnail",{url:t,width:e,height:i})},_getClientThumbnail:function(){return this.get("clientThumbnail")},_getPostThumbnail:function(t){var e,i,n=this.get("thumbnail_url"),o=this.get("thumbnail_height"),r=this.get("thumbnail_width"),a=this.get("photos");return t=t||250,!s.isEmpty(a)||!s.isEmpty(n)&&s.isFinite(o)&&s.isFinite(r)?s.isEmpty(a)?{url:n,height:o,width:r}:(i=s.sortBy(s.get(s.first(a),"alt_sizes"),"width"),e=s.find(i,function(e){return s.get(e,"width",0)>=t}),s.isEmpty(e)?s.last(i):e):null},_isThumbnailGIF:function(){var t,e=s.get(this.getThumbnail(),"url");return s.isEmpty(e)?!1:(t=r.getExtension(e),"gif"===(t||"").toLowerCase())}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(113),r=i(608),a=i(614),l=i(615),h=o.extend({mixins:[r],relations:{alt_sizes:a,original_size:l},defaults:{alt_sizes:null,original_size:null},getActionMarkup:function(t,e,i){return t=s.escape(t),e=e||"",i=i||"",s.isEmpty(t)?n("sent a photo"):n("%1$s%2$s%3$s sent a photo",e,t,i)},getAltSizes:function(){return this.get("alt_sizes")},getHighResImageUrl:function(){var t=this.getAltSizes().sort().last();return s.isEmpty(t)?null:t.get("url")},getOriginalSize:function(){return this.get("original_size")},hasAltSizes:function(){return!this.getAltSizes().isEmpty()},getImageAtSize:function(t){var e,i=this.getAltSizes().sort();return t=t||250,i.isEmpty()?this.getOriginalSize():(e=i.find(function(e){return e.get("width")>=t}),s.isEmpty(e)&&(e=i.last()),e)}});t.exports=h},function(t,e,i){"use strict";var s=i(118),n=i(615),o=s.extend({model:n,comparator:function(t){return t.get("width")}});t.exports=o},function(t,e,i){"use strict";var s=i(113),n=s.extend({idAttribute:"url",defaults:{width:null,height:null,url:null}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(118),o=i(617),r=i(610),a=n.extend({url:"/svc/conversations/messages",mixins:[o],model:r,_getRoot:function(t){return s.has(t,"response")?s.get(t,"response.messages"):t},parse:function(t,e){return s.get(this._getRoot(t),"data")||[]},parsePreviousLink:function(t,e){return s.get(this._getRoot(t),"_links.previous")},parseNextLink:function(t,e){return s.get(this._getRoot(t),"_links.next")},poll:function(t){return t=t||{},s.extend(t,{cache:!1,remove:!1,skipParseLinks:!0}),this.fetch(t)}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(120),o=i(115),r=new o({extend:{setNextLink:function(t){var e,i=this.hasNextPage();this._nextLink=t,e=this.hasNextPage(),i!==e&&this.trigger("change:hasNextPage",this,e)},setPreviousLink:function(t){var e,i=this.hasPreviousPage();this._previousLink=t,e=this.hasPreviousPage(),i!==e&&this.trigger("change:hasPreviousPage",this,e)},getNextLink:function(){return this._nextLink},getPreviousLink:function(){return this._previousLink},hasNextPage:function(){return!s.isEmpty(this.getNextLink())},hasPreviousPage:function(){return!s.isEmpty(this.getPreviousLink())},fetchNextPage:function(t,e){return t=t||{},this.hasNextPage()?(t.isInfiniteScroll!==!1&&s.extend(t,{skipParsePreviousLink:!0,remove:!1}),this._fetchPage(this.getNextLink(),t)):n.reject()},fetchPreviousPage:function(t,e){return t=t||{},this.hasPreviousPage()?(t.isInfiniteScroll!==!1&&s.extend(t,{skipParseNextLink:!0,remove:!1}),this._fetchPage(this.getPreviousLink(),t)):n.reject()},_fetchPage:function(t,e){var i=s.isString(t)?t:t.href;return e=e||{},s.extend(e,{url:i}),this.fetch(e)}},defaults:{parsePreviousLink:function(t,e){return null},parseNextLink:function(t,e){return null}},before:{reset:function(t){this.setPreviousLink(null),this.setNextLink(null)},parse:function(t,e){e=e||{},e.skipParseLinks||(!e.skipParsePreviousLink&&s.isFunction(this.parsePreviousLink)&&this.setPreviousLink(this.parsePreviousLink(t,e)),!e.skipParseNextLink&&s.isFunction(this.parseNextLink)&&this.setNextLink(this.parseNextLink(t,e)))}}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(118),o=i(619),r=n.extend({model:o,getSortedByChannels:function(t,e){var i=this.clone(),n=e?-1:1,o=t.length;return i.sortBy(function(e){var i=s.indexOf(t,e.get("uuid")),r=i>-1,a=r?o-i:-1;return n*a})},getWithout:function(t){var e=this.clone();return e.filter(function(e){return!s.contains(t,e.get("uuid"))})}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(608),o=i(179),r=i(113),a=i(620),l=r.extend({url:"/svc/conversations/participant_info",mixins:[n],relations:{theme:a},defaults:{theme:null,is_blog_following_you:!1,is_following_blog:!1,duration_blog_following_you:null,duration_following_blog:null,blog_tags:[]},idAttribute:"uuid",parse:function(t){return!s.has(t,"theme")&&s.has(t,"global_theme_params")&&s.extend(t,{theme:s.get(t,"global_theme_params")}),s.get(t,"response",t)},getAvatarUrl:function(t){return t=t||96,o(this.get("avatar_url"),t)},getAvatarShape:function(){return this.get("theme").get("avatar_shape")},getBlogTags:function(){var t=this.get("blog_tags");return s.isArray(t)?t:[]},getDescription:function(){return this.get("theme").get("show_description")!==!0?"":this.get("description")},fetchAdditionalInfo:function(t,e){return e=s.extend({},e,{merge:!0,data:{q:this.get("uuid"),participant:t}}),this.fetch(e)},isFollowingYou:function(){return this.get("is_blog_following_you")===!0},isFollowing:function(){return this.get("is_following_blog")===!0},isMutuals:function(){return this.isFollowingYou()&&this.isFollowing()},getDurationFollowingYouSeconds:function(){var t=this.get("duration_blog_following_you");return this.isFollowingYou()&&s.isNumber(t)?t:null},getDurationFollowingSeconds:function(){var t=this.get("duration_following_blog");return this.isFollowing()&&s.isNumber(t)?t:null},getDurationMutualsSeconds:function(){var t,e;return this.isMutuals()?(t=this.getDurationFollowingSeconds(),e=this.getDurationFollowingYouSeconds(),Math.min(t,e)):null}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(580),o=i(113),r=o.extend({defaults:{background_color:null,link_color:null,avatar_shape:null,header_image_focused:null,show_header_image:!0,adjustBrightnessFactor:.3},getHeaderImage:function(){return this.get("show_header_image")===!0?this.get("header_image_focused"):null},getBackgroundTint:function(){return this.getTint(this.get("background_color"))},getAccentTint:function(){return this.getTint(this.get("link_color"))},getTint:function(t){var e;return this.get("tint"+t)?this.get("tint"+t):s.isEmpty(t)?null:(e=n.isLight(t,.5)?n.isLight(t,.05,.95)?r.TINT_WHITE:r.TINT_LIGHT:r.TINT_DARK,this.set("tint"+t,e),e)},isDark:function(t){return this.getTint(t)===r.TINT_DARK},isReadableOn:function(t,e){return t=n.hexToHsv(t),e=n.hexToHsv(e),!n.compare(t,e)},adjustColorForBackground:function(t,e){var i=this.get("adjustBrightnessFactor");return this.isReadableOn(t,e)?t:this.adjustBrightness(t,this.isDark(t)?i:-1*i)},getReadableColor:function(t,e){return this.isReadableOn(t,e)?t:n.readable(t)},adjustBrightness:function(t,e){return n.brighten(t,e)},getTintSuffix:function(t){return t===r.TINT_WHITE?"-white":t===r.TINT_LIGHT?"-light":t===r.TINT_DARK?"-dark":void 0}},{TINT_LIGHT:"light",TINT_DARK:"dark",TINT_WHITE:"white"});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(143),r=i(109),a=o.extend({name:"MessagingNotifier",defaults:{isEnabled:!1,notificationTimeout:5e3,notificationIcon:null},initialize:function(t){s.extend(this.attributes,s.pick(t,s.keys(this.defaults)))},notifyOnUnread:function(t,e){var i=n("New message for %1$s",e.get("name")),s={conversationId:t,channelUuid:e.get("uuid")};this._generateNotification(i,s)},_supportsNotifications:function(){return this.get("isEnabled")&&"Notification"in window},_needsNotificationPermission:function(){return this._supportsNotifications()&&"granted"!==window.Notification.permission&&"denied"!==window.Notification.permission},_isNotificationPermissionGranted:function(){return this._supportsNotifications()&&"granted"===window.Notification.permission},_requestPermission:function(t){window.Notification.requestPermission(t)},_generateNotification:function(t,e){var i,n;this._supportsNotifications()&&(n={icon:this.get("notificationIcon")},this._isNotificationPermissionGranted()?(i=new Notification(t,n),i instanceof Notification&&(i.addEventListener("click",s.bind(function(t){r.trigger("messaging:conversation:open:id",e.conversationId,e.channelUuid,"notification"),t.target.close()}),this),s.delay(s.bind(function(){this.close()},i),this.get("notificationTimeout")),this.trigger("notification:display",e.conversationId))):this._needsNotificationPermission()&&this._requestPermission(s.bind(function(i){this.trigger("notification:permission:change","granted"===i),this._generateNotification(t,e)},this)))}});t.exports=a},function(t,e,i){"use strict";var s,n=i(143),o=i(3),r=i(623),a=i(624),l=i(625),h=n.extend({name:"NotificationSoundManager",initialize:function(){var t=o.get(this.data,"sounds",[]),e=o.get(this.data,"soundpacks",{});this.soundCollection=new r(this._getSoundModels(t)),this.soundPackCollections=this._getSoundpackCollections(e)},playSoundName:function(t){var e=this.soundCollection.get(t);o.isEmpty(e)||this._playSoundModel(e)},playRandomFromSoundpack:function(t){var e=o.get(this.soundPackCollections,t);e&&this._playSoundModel(e.sample())},_playSoundModel:function(t){var e=new l({model:t}).render();this.listenToOnce(e,"ended",this._removeSoundView),e.play()},_removeSoundView:function(t){t.remove()},_getSoundModels:function(t){return o.map(t,function(t,e){return new a({name:e,filePath:t})})},_getSoundpackCollections:function(t){var e=this;return o.reduce(t,function(t,i,s){return t[s]=new r(e._getSoundModels(i)),t},{})}}),c=function(){return null==s&&(s=new h),s};t.exports=c},function(t,e,i){"use strict";var s=i(118),n=i(624),o=s.extend({model:n});t.exports=o},function(t,e,i){"use strict";var s=i(113),n=s.extend({idAttribute:"name",defaults:{name:null,filePath:null,fileType:"audio/mpeg"}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(626),r=n.extend({tagName:"audio",template:o,defaults:{filePath:null,fileType:null},events:{ended:"triggerRemove"},initialize:function(t){s.extend(this,s.pick(t,"model"))},getTemplateData:function(){return this.model.toJSON()},play:function(){this.el.play()},triggerRemove:function(){this.trigger("ended",this)}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<source src="'+__e(filePath)+'" type="'+__e(fileType)+'">';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=n.extend({renderWithTemplate:s.noop,initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"channels"))},afterRender:function(){this.listenTo(this.channels,"change:unread_messages_count_sum",this._onChangeChannelUnreadCount),this._onChangeChannelUnreadCount()},updateBadge:function(t){t>0&&this.$(".tab_notice_value").text(t>99?"99+":t),this.$(".tab_notice").toggleClass("tab-notice--active",t>0)},_onChangeChannelUnreadCount:function(){this.updateBadge(s.sum(this.channels.pluck("unread_messages_count_sum")))}});t.exports=o},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(143),r=i(270).FeatureHelpPopoverView,a=i(629),l=o.extend({name:"MessagingTutorial",initialize:function(t){t=n.extend({},t),n.extend(this.attributes,n.pick(t,n.keys(this.defaults))),n.extend(this,n.pick(t,"viewOptions")),this.viewOptions=n.extend({},this.viewOptions,{name:"messaging",template:"standard",className:"messaging-tutorial-popover",glass:!0,position:r.POSITION.BOTTOM,isFadeOnScroll:!1})},render:function(){var t;this.popover=this.createPopover(),this.confettiView=this.createConfetti(),t=s("<div />").addClass("messaging-tutorial-confetti"),t.append(this.confettiView.$el),this.popover.show(this.viewOptions),this.popover.getGlassElement().after(t),this.confettiView.render()},createConfetti:function(){var t=new a({autoParty:!0,amount:50});return t.$el.on("click",n.bind(this._onConfettiClick,this)),t},createPopover:function(){var t=new r;return this.listenTo(t,"dismiss",this._onPopoverDismiss),this.listenTo(t,"removed",this._onPopoverRemoved),t},setSeen:function(){s.ajax({url:"/svc/conversations/tutorial_seen",method:"POST",withFormKey:!0,dataType:"json"})},hideTutorial:function(){this.popover.hide()},_onConfettiClick:function(){this.popover.hide()},_onPopoverDismiss:function(){this.trigger("dismiss")},_onPopoverRemoved:function(){this.remove()},remove:function(){return this.confettiView&&this.confettiView.remove(),this.trigger("hide"),this.setSeen(),o.prototype.remove.apply(this,arguments)}});t.exports=l},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(148),r=i(109),a=o.extend({id:"milestone-confetti",tagName:"canvas",defaults:{amount:100,autoParty:!1,colors:["#D95E40","#F2992E","#56BC8A","#529ECC","#A77DC2","#748089"],size:40,speed:.5,onDone:s.noop},__resize:function(){this.$parent.length&&(this.el.width=this.$parent.width(),this.el.height=this.$parent.height())},_updateConfetti:function(t,e){this.confettiAngle+=.001,t.off||(t.tiltAngle+=t.tiltAngleIncrement,t.tilt=15*Math.sin(t.tiltAngle-e/3),t.y+=(Math.cos(this.confettiAngle+t.density)+.5*t.radius)*this.options.speed),t.y>this.el.height+20&&(this.isAnimating?(t.tilt=a.range(-10,10,!0),t.tileAngle=0,t.tiltAngleIncrement=a.range(.05,.1),t.x=Math.random()*this.el.width,t.y=-20):t.off||(t.off=!0,this.confettiOffscreen++))},_stopAnimating:function(){this.animationInterval&&(clearInterval(this.animationInterval),this.animationInterval=null),this.isAnimating=!1},_startAnimating:function(t){t=t||!1,this._stopAnimating(),this.animationInterval=setInterval(n.bind(this.draw,this),15),this.isAnimating=t?!0:this.isAnimating},initialize:function(t){this.options=n.extend({},this.defaults,t||{}),this.colors=this.options.colors,this.$win=s(window),this.$parent=s(),this.context=this.el.getContext("2d"),this.animationInterval=null,this.confetti=[],this.confettiAngle=0,this.confettiOffscreen=0,this.isAnimating=!1},render:function(){return n.defer(n.bind(this.setup,this)),this},setup:function(){this.$parent=this.$el.parent(),this.$parent.length&&(this.el.width=this.$parent.width(),this.el.height=this.$parent.height()),this.listenTo(r,"DOMEventor:flatresize",this.__resize);for(var t=this.options.size,e=.5*t,i=0,s=this.options.amount;s>i;i++)this.confetti.push({x:Math.random()*this.el.width,y:Math.random()*-this.el.height,radius:a.range(e,t),density:a.range(10,s),tilt:a.range(-10,10,!0),tiltAngle:0,tiltAngleIncrement:a.range(.05,.1),color:this.colors[a.range(0,this.colors.length-1,!0)],off:!1});this.options.autoParty&&this.party()},draw:function(){if(this.context.clearRect(0,0,this.el.width,this.el.height),this.confettiOffscreen===this.confetti.length)return void this.remove();for(var t=5,e=0;e<this.confetti.length;e++){var i=this.confetti[e];this.context.beginPath(),this.context.lineWidth=.5*i.radius,this.context.strokeStyle=i.color,this.context.moveTo(i.x+i.tilt+i.radius/t,i.y),this.context.lineTo(i.x+i.tilt,i.y+i.tilt+i.radius/t),this.context.stroke(),this._updateConfetti(i,e)}},party:function(){return this.confettiOffscreen=0,this._startAnimating(!0),this},stopPartying:function(){return this.isAnimating=!1,this},remove:function(){return this._stopAnimating(),this.options.onDone(),o.prototype.remove.call(this)}},{range:function(t,e,i){i=i||!1;var s=(e-t)*Math.random()+t;return i?Math.round(s):s}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(206),o=i(155),r=i(395),a=i(631),l=i(642),h=i(648),c=i(652),u=i(656),d=o.extend({className:"messaging-inbox",template:u,defaults:{isLoading:!1,isAutoFetch:!0,isEmpty:!1,isLoadingEmptyInboxFavorites:!1,numFavorites:5},mixins:[n],subviews:{headerView:{constructor:l,options:function(t){return{eventBus:t.eventBus,user:t.user,channels:t.channels,currentBlogModel:t.currentBlogModel,popoverContainer:t.popoverContainer}}},composeView:{constructor:h,options:function(t){return{eventBus:t.eventBus,favoritesCollection:t.favoritesCollection,currentBlogModel:t.currentBlogModel,keyboardManager:t.keyboardManager}}},conversationsView:{constructor:a,options:function(t){return{eventBus:t.eventBus,collection:t.collection,emptyInboxCollection:t.emptyInboxCollection,currentBlogModel:t.currentBlogModel,channels:t.channels,favoritesCollection:t.favoritesCollection,appendFavoritesToInboxLimit:t.appendFavoritesToInboxLimit}}},emptyView:{constructor:c,options:function(t){return{eventBus:t.eventBus,collection:t.emptyInboxCollection}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","collection","user","channels","favoritesCollection","emptyInboxCollection","popoverContainer","currentBlogModel","appendFavoritesToInboxLimit","keyboardManager"))},afterRenderSubviews:function(){this.loader=new r({$container:this.$el,type:"bar",classModifiers:"top",loading:!1}),this.set({isLoading:!this.getCurrentChannel().get("isInboxFetched"),isEmpty:0===this.collection.length}),this.listenTo(this,"change",this._setViewStates),this.listenTo(this.collection,"sync error",this._onSyncCollection),this.listenTo(this.collection,"update reset",this._onChangeCollection),this.listenTo(this.collection,"request",this._onRequestCollection),this.listenTo(this.composeView,"submit",this._onComposeSubmitRecipient),this.listenTo(this.headerView,"change:isComposing",this._setViewStates),this._setViewStates(),this.get("isAutoFetch")&&this.fetch(),this._fetchEmptyInboxFavorites()},beforeRemove:function(){this.keyboardManager.remove("inbox")},getCurrentChannel:function(){return this.currentBlogModel.getChannel()},fetch:function(t){this.collection.fetchInbox(this.currentBlogModel.getId(),t)},_onComposeSubmitRecipient:function(t){this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_PARTICIPANT_NAMES,t)},_setViewStates:function(){var t=this.get("isEmpty"),e=this.get("isLoading")||this.get("isLoadingEmptyInboxFavorites"),i=this.headerView.get("isComposing");this.loader.set("loading",e&&!i),this.conversationsView.toggle(!i&&!t&&!e),this.emptyView.toggle(t&&!i&&!e),this.composeView.$el.toggle(i),i&&this.composeView.focus()},_onChangeCollection:function(){this.set("isEmpty",0===this.collection.length)},_onSyncCollection:function(){this.set({isLoading:!1,isEmpty:0===this.collection.length}),this.getCurrentChannel().set("isInboxFetched",!0)},_onRequestCollection:function(t,e,i){this.set({isEmpty:0===this.collection.length,isLoading:!this.getCurrentChannel().get("isInboxFetched")})},_fetchEmptyInboxFavorites:function(){this.set("isLoadingEmptyInboxFavorites",!0),this.emptyInboxCollection.fetchFavorites().then(s.bind(function(){this.rendered&&this.favoritesCollection.reset(s.take(this.emptyInboxCollection.toJSON(),this.get("numFavorites")))},this)).always(s.bind(function(){this.rendered&&this.set("isLoadingEmptyInboxFavorites",!1)},this))}});t.exports=d},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(155),r=i(632),a=i(206),l=i(259),h=i(633),c=i(636),u=i(637),d=i(641),p=o.extend({className:"inbox-conversations",template:d,mixins:[a,r],defaults:{isPaginating:!1,showFavorites:!1,hasNextPage:!0,showLoadingContainer:!0,appendFavoritesToInboxLimit:3},subviews:{conversations:{constructor:h,enableBatchRendering:!0,options:function(t){return{eventBus:t.eventBus,channels:t.channels,currentBlogModel:t.currentBlogModel}},collection:function(t){return t.collection}},paginationLoaderView:{constructor:l,options:{variation:"small h-centered",loading:!1}},favoritesView:{constructor:u,options:function(t){return{showMessageOnEmpty:!1,eventBus:t.eventBus,collection:t.favoritesCollection,title:n("More Tumblrs to talk to"),context:"inbox:moretumblrs"}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","collection","channels","favoritesCollection","currentBlogModel"))},afterRenderSubviews:function(){this.scrollBar=new c({el:this.el}),this.listenTo(this,"change:isPaginating",this._onChangeIsPaginating),this.listenTo(this,"change:showFavorites",this._onChangeShowFavorites),this.listenTo(this,"change:hasNextPage",this._onChangeHasNextPage),this.listenTo(this,"change:showLoadingContainer",this._onChangeShowLoadingContainer),this.listenTo(this.collection,"sort",this._onCollectionSort),this.listenTo(this.collection,"update reset change",this._onCollectionChange),this.listenTo(this.favoritesCollection,"update reset",this._onFavoritesCollectionChange),this.listenTo(this.collection,"reset",this._onCollectionReset),this.listenTo(this,"batch:rendered:conversations",this._onConversationsBatchRendered),this.listenTo(this.collection,"sync",this._onCollectionSync),this.listenTo(this.collection,"change:hasNextPage",this._onChangeCollectionHasNextPage),this.listenTo(this.scrollBar,"scrollbottom",this._onScrollBottom),this._setViewStates(),this._onChangeCollectionHasNextPage(this.collection,this.collection.hasNextPage()),this._onChangeShowFavorites(this,this.get("showFavorites")),this._onChangeHasNextPage(this,this.get("hasNextPage")),this._onChangeShowLoadingContainer(this,this.get("showLoadingContainer")),s.defer(s.bind(this.updateScrollBar,this))},toggle:function(t){this.$el.toggle(t),this.updateScrollBar()},beforeRemove:function(){this.scrollBar&&this.scrollBar.destroy()},getNextPage:function(){this.rendered&&this.collection.hasNextPage()&&(this.set("isPaginating",!0),this.collection.fetchNextPage().always(s.bind(function(){this.rendered&&this.set("isPaginating",!1)},this)))},updateScrollBar:function(){this.scrollBar&&this.scrollBar.update()},_setViewStates:function(){var t=this.get("hasNextPage"),e=this.collection.length>0&&!t&&this.collection.length<=this.get("appendFavoritesToInboxLimit");this.set({showFavorites:e,
  showLoadingContainer:t}),this.updateScrollBar()},_saveModelOrder:function(){this.lastModelOrder=this._getModelOrderString()},_getModelOrderString:function(){return s.pluck(this.collection.models,"cid").join(" ")},_onCollectionSort:function(t){var e=this._getModelOrderString();this.lastModelOrder&&-1===e.indexOf(this.lastModelOrder)&&this.renderCollectionSubviews("conversations"),this._saveModelOrder()},_onCollectionChange:function(t,e){this._setViewStates(),this._saveModelOrder()},_onCollectionSync:function(){this._onChangeCollectionHasNextPage(this.collection,this.collection.hasNextPage())},_onCollectionReset:function(t){this.$el.scrollTop(0),this._saveModelOrder()},_onConversationsBatchRendered:function(){this.updateScrollBar()},_onChangeCollectionHasNextPage:function(t,e){this.set("hasNextPage",e&&t.length>=10)},_onChangeHasNextPage:function(t,e){this._setViewStates()},_onChangeIsPaginating:function(t,e){this.paginationLoaderView.set("loading",e)},_onScrollBottom:function(t){t&&this.getNextPage()},_onChangeShowFavorites:function(t,e){this.favoritesView.$el.toggle(e)},_onChangeShowLoadingContainer:function(t,e){this.js$("loader-container").toggle(e)},_onFavoritesCollectionChange:function(){this.updateScrollBar()}});t.exports=p},function(t,e,i){"use strict";var s=i(3),n=i(115),o=new n({defaults:{removeCollectionSubviews:function(t){var e=this[t];this.subviews[t]&&!s.isEmpty(e)&&(e=this[t],this._subviews=s.difference(this._subviews,e),s.invoke(e,"remove"),this[t].length=0)},removeCollectionSubview:function(t,e){var i,n=this[t];this.subviews[t]&&!s.isEmpty(n)&&(i=s.findWhere(n,{model:e}),i&&(this._subviews=s.without(this._subviews,i),i.remove(),this[t]=s.without(this[t],i)))},addNewCollectionSubview:function(t,e,i){var n=this.subviews[t];if(i||(i=this._getSubviewCollection(t)),n&&i){var o=n.container||this._createDefaultContainerFunction(t),r=n.prepareViewForAdd||this._createDefaultPrepareViewForAddFunction(t),a=n.options||{},l={insertionIndex:i.indexOf(e)},h=s.has(this,t),c=this.createCollectionSubviewRenderer([e],o,r,a,t,h,l);return this._isBatchRenderingInProgress(t)?void this.once("rendered:"+t,c,this):void(this.rendered?c():this.once("rendered",c,this))}},sortCollectionSubviews:function(t,e){var i,n=this.subviews[t];e||(e=this._getSubviewCollection(t)),n&&e&&this[t]&&(i=s.pluck(e.models,"cid"),i=s.zipObject(i,s.range(0,i.length)),this[t]=s.sortBy(this[t],function(t){return s.get(i,t.model.cid,0)}))},batchRenderCollectionSubviews:function(t){var e=this.subviews[t];if(e){var i=e.container||this._createDefaultContainerFunction(t),n=e.prepareView||this._createDefaultPrepareViewFunction(t),o=e.options||{},r=s.result(e,"batchSize")||5,a=s.result(e,"batchDelay")||100,l=this._getSubviewCollection(t),h=s.chunk(l.models,r),c=s.map(h,function(e,r){return s.bind(function(){var s=this.createCollectionSubviewRenderer(e,i,n,o,t,r>0);return s.call(this)},this)},this),u=s.bind(function(){this._scheduleBatchRenders(t,c,a)},this);this.rendered?u():this.once("rendered",u,this)}},_isBatchRenderingInProgress:function(t){return s.get(this._deferredRenders,t,[]).length>0},_scheduleBatchRenders:function(t,e,i){var n=e.length,o=function(){this._afterBatchRenderCollectionSubviews(t)},r=function(e){e.call(this,t),this._afterEachBatchRenderCollectionSubviews(t),n--,0===n&&o.call(this)};return this._deferredRenders||(this._deferredRenders={}),s.has(this._deferredRenders,t)||(this._deferredRenders[t]=[]),this._cancelBatchRenders(t),0===n?void o.call(this):void s.each(e,function(e,n){var o;return 0===n?void r.call(this,e):(o=setTimeout(s.bind(function(){r.call(this,e),this._deferredRenders[t]=s.without(this._deferredRenders[t],o)},this),i*(n+1)),void this._deferredRenders[t].push(o))},this)},_cancelBatchRenders:function(t){s.isEmpty(this._deferredRenders)||(s.isEmpty(t)||s.has(this._deferredRenders,t))&&(s.isEmpty(t)?(s.each(this._deferredRenders,function(t,e){s.each(t,function(t){clearTimeout(t)},this)},this),this._deferredRenders={}):(s.each(this._deferredRenders[t],function(t){clearTimeout(t)},this),this._deferredRenders[t].length=0))},_afterEachBatchRenderCollectionSubviews:function(t){this.trigger("batch:rendered:"+t)},_afterBatchRenderCollectionSubviews:function(t){this.trigger("rendered:"+t)},_attachCollectionListeners:function(t){var e=this._getSubviewCollection(t);e&&(this.listenTo(e,"add",s.partial(this.addNewCollectionSubview,t)),this.listenTo(e,"remove",s.partial(this.removeCollectionSubview,t)),this.listenTo(e,"reset",s.partial(this.renderCollectionSubviews,t)),this.listenTo(e,"update",s.partial(this.sortCollectionSubviews,t)))},_getSubviewCollection:function(t){var e=s.get(this.subviews[t],"collection");return e===!0?this.collection:s.isFunction(e)?e(this):e?e:null},_createDefaultPrepareViewForAddFunction:function(t){var e=this.subviews[t];return s.bind(function(i,n){var o=i.children(),r=new e.constructor(n),a=n.insertionIndex;return r.$el.attr("data-subview",t),s.isNumber(a)&&a<o.length?r.$el.insertBefore(o.get(a)):i.append(r.$el),r},this)}},before:{renderSubviews:function(){s.each(this.subviews,function(t,e){t.collection&&this._attachCollectionListeners(e)},this)},beforeRemove:function(){this._cancelBatchRenders()}},around:{renderCollectionSubviews:function(t,e){var i=this.subviews[e];if(i)return this.removeCollectionSubviews(e),s.result(i,"enableBatchRendering")===!0?this.batchRenderCollectionSubviews(e):t.apply(this,s.rest(arguments))}}});t.exports=o},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(634),r=i(635),a=i(206),l=n.extend({className:"inbox-conversation",template:o,mixins:[a],defaults:{maxInitialMessageLength:100,currentMessage:null},events:{"click [data-open-conversation]":"_onClickConversation"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","channels","currentBlogModel")),this.participants=this.model.get("participants"),this.sortedParticipants=this.participants.getSortedByChannels(this._getOwnSortedBlogIds()),this.otherParticipant=s.first(this.sortedParticipants),this.set("currentMessage",this.model.getInboxMessage())},afterRender:function(){this.listenTo(this.model,"change:last_read_ts change:last_modified_ts",this._onChangeTimestamps),this.listenTo(this,"change:currentMessage",this._onChangeCurrentMessage),this._onChangeCurrentMessage(this,this.get("currentMessage"))},openConversation:function(){this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_CONVERSATION_MODEL,this.model,"inbox")},getTemplateData:function(){return{name:this.otherParticipant.get("name"),avatarUrl:this.otherParticipant.getAvatarUrl(),message:this._getEscapedMessageMarkup(this.get("currentMessage"))}},getMessageParticipant:function(t){return this.participants.get(t.get("participant"))},_getEscapedMessageMarkup:function(t){var e,i=this._getAdditionalBlogName(t),n=s.escape(t.getMessage());return s.isEmpty(n)||(n=n.substring(0,this.get("maxInitialMessageLength"))),e=t.getActionMarkup(i,'<span class="name">',"</span>"),s.compact([e,n]).join(": ")},_safeTruncateMessage:function(t){var e=this.js$("message"),i=this.js$("message-text"),n=function(){r(e),s.isFunction(t)&&t.call(this,i.html())};e.height()?n.call(this):(this.$el.css("visibility","hidden"),s.defer(s.bind(function(){this.rendered&&(n.call(this),this.$el.css("visibility",""))},this)))},_isLastMessageFromSelf:function(t){return!s.isEmpty(t)&&!s.isEmpty(this.otherParticipant)&&this.otherParticipant.get("uuid")!==t.get("uuid")},_getAdditionalBlogName:function(t){var e;return s.isEmpty(t)?null:(e=this.getMessageParticipant(t),s.isEmpty(e)?null:this._isLastMessageFromSelf(e)?e.get("name"):null)},_onChangeTimestamps:function(t){this.set("currentMessage",this.model.getInboxMessage())},_onChangeCurrentMessage:function(t,e){var i=this.getMessageParticipant(e),n=e.get("truncatedText");this.$el.toggleClass("is-unread",this.model.isUnread()&&!this._isLastMessageFromSelf(i)),s.isEmpty(n)?(this.js$("message-text").html(this._getEscapedMessageMarkup(e)),this._safeTruncateMessage(function(t){e.set("truncatedText",t)})):this.js$("message-text").html(n)},_onClickConversation:function(t){t.preventDefault(),this.openConversation()},_getOwnSortedBlogIds:function(){return this.channels.getSortedIds(this.currentBlogModel.getId())}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<a data-open-conversation href="#" class="inbox-row"><img class="avatar" src="'+__e(avatarUrl)+'"><div class="info-container"><div class="name-container"><h3 class="name">'+__e(name)+'</h3></div><h4 class="message" data-js-message><span class="text" data-js-message-text>'+(null==(__t=message)?"":__t)+"</span></h4></div></a>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";function s(t,e){return t.scrollHeight-e.maxHeight<5}function n(t){return parseInt(h(t).css("max-height"),10)}function o(t,e,i){var n,o=t.nodeValue,r=l.get(e,"truncationString","..."),a="",h="",c=0,u=o.length;if(s(i,e))return!0;for(;u>=c;)n=c+u>>>1,a=l.trimRight(o.substring(0,n))+r,t.nodeValue=a,s(i,e)?(c=n+1,a.length>h.length&&(h=a)):u=n-1;return h.length>0?(t.nodeValue=h,!0):(t.nodeValue="",!1)}function r(t,e,i){var s=h(t).contents();l.each(s.get().reverse(),function(t){t.nodeType===Node.TEXT_NODE?o(t,e,i):r(t,e,i)})}function a(t,e){return e=e||{},l.defaults(e,{truncationString:"..."}),t instanceof h&&(t=t.get(0)),l.has(e,"maxHeight")||l.extend(e,{maxHeight:n(t)}),l.isFinite(l.get(e,"maxHeight"))&&!s(t,e)?r(t,e,t):void 0}var l=i(3),h=i(8);t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(390),o=n.extend({defaults:s.defaults({isDisabled:!1,isAtTop:!1,isAtBottom:!1,topThreshold:50,bottomThreshold:50},n.prototype.defaults),initialize:function(t){return this.options=t||{},n.prototype.initialize.call(this,this.options.el,this.options)},render:function(){return this.listenTo(this,"change:isAtTop",this._changeIsAtTop),this.listenTo(this,"change:isAtBottom",this._changeIsAtBottom),n.prototype.render.apply(this,arguments)},_stealScroll:function(t){return this.get("isDisabled")?(t.preventDefault(),void t.stopPropagation()):n.prototype._stealScroll.apply(this,arguments)},update:function(){return this._updateInfiniteScrollFlags(),n.prototype.update.apply(this,arguments)},_onScrollStop:function(){return this._updateInfiniteScrollFlags(),n.prototype._onScrollStop.apply(this,arguments)},getCurrentPositions:function(){return this._setCurrentPositions(),{height:this._currentHeight,scrollBottom:this._currentScrollBottom,scrollTop:this._currentScrollTop}},isAtTop:function(){return this.get("isAtTop")},isAtBottom:function(){return this.get("isAtBottom")},_isAtTop:function(t){return this._isUserScroll()&&!this.get("isDisabled")&&this._currentScrollTop<=t&&this._currentHeight>t},_isAtBottom:function(t){return this._isUserScroll()&&!this.get("isDisabled")&&this._currentScrollBottom<=t&&this._currentHeight>t},_isUserScroll:function(){var t,e=5;return s.isFinite(this._previousScrollHeight)?(t=Math.abs(this._currentScrollHeight-this._previousScrollHeight),e>=t):!1},setDisabled:function(t){this.set("isDisabled",t)},isDisabled:function(){return this.get("isDisabled")},_setCurrentPositions:function(){var t=this.container;this._previousScrollHeight=this._currentScrollHeight,this._currentScrollHeight=t.scrollHeight,this._currentHeight=t.clientHeight,this._currentScrollBottom=t.scrollHeight-t.scrollTop-this.container.clientHeight,this._currentScrollTop=t.scrollTop},_updateInfiniteScrollFlags:function(){return this.destroyed?!1:(this._setCurrentPositions(),void this.set({isAtTop:this._isAtTop(this.get("topThreshold")),isAtBottom:this._isAtBottom(this.get("bottomThreshold"))}))},_changeIsAtTop:function(t,e){this.trigger("scrolltop",e)},_changeIsAtBottom:function(t,e){this.trigger("scrollbottom",e)}});t.exports=o},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(632),r=i(206),a=i(161),l=i(375),h=i(638),c=i(640),u=n.extend({className:"inbox-recipients",template:c,mixins:[r,a,o,l],keycommands:{"keydown:down":"_onKeyPressDown","keydown:up":"_onKeyPressUp","keydown:enter":"_onKeyPressEnter"},defaults:{isEmpty:!0,showMessageOnEmpty:!0,selectedView:null,context:"inbox:recipients"},subviews:{recipients:{constructor:h,options:function(t){return{eventBus:t.eventBus,onSelect:s.bind(t._onSubviewSelect,t),onClear:s.bind(t._onSubviewClear,t),context:t.context}},collection:function(t){return t.collection}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","collection","title","context")),this.keyboardViewName="recipients",this.disableKeys()},afterRender:function(){this.listenTo(this.collection,"reset update",this._onCollectionChange),this.listenTo(this.collection,"sync",this._onCollectionSync),this.listenTo(this.collection,"sort",this._onCollectionSort),this.listenTo(this,"change:isEmpty",this._onChangeIsEmpty),this.listenTo(this,"change:selectedView",this._onChangeSelectedView),this._onCollectionChange(this.collection),this._onChangeIsEmpty(this,this.get("isEmpty"))},getTemplateData:function(){return{title:this.title,noResultsText:this.collection.getNoResultsFoundMessage()}},toggle:function(t){this.$el.toggle(t),t&&this.deselect(this.keyboardViewName)},_onChangeSelectedView:function(t,e){var i=this.previous("selectedView");i&&i.setSelected(!1),e&&e.setSelected(!0)},_onChangeIsEmpty:function(t,e){this.get("showMessageOnEmpty")?this.js$("no-results-container").toggle(e):(this.js$("container").toggle(!e),this.js$("no-results-container").hide())},_shuffleNoResultsText:function(){this.js$("no-results-text").text(this.collection.getNoResultsFoundMessage())},_onCollectionSort:function(){this.renderCollectionSubviews("recipients")},_onCollectionChange:function(t){this.set("isEmpty",0===t.length),this.deselect(this.keyboardViewName)},_onCollectionSync:function(t){0===t.length&&this.get("showMessageOnEmpty")&&this._shuffleNoResultsText()},_onSubviewSelect:function(t){this.set("selectedView",t),this.setSelectedIndex(this.keyboardViewName,s.indexOf(this.recipients,t))},_onSubviewClear:function(t){this.set("selectedView",null),this.deselect(this.keyboardViewName)},_onKeyPressDown:function(t){var e;t.preventDefault(),e=this.isLastSelected(this.keyboardViewName)?this.selectFirst(this.keyboardViewName):this.selectNext(this.keyboardViewName),this.set("selectedView",e)},_onKeyPressUp:function(t){var e;t.preventDefault(),e=this.isFirstSelected(this.keyboardViewName)?this.selectLast(this.keyboardViewName):this.selectPrevious(this.keyboardViewName),this.set("selectedView",e)},_onKeyPressEnter:function(t){var e,i=this.get("selectedView");t.preventDefault(),i?e=i.model:1===this.collection.length&&(e=this.collection.first()),e&&this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_PARTICIPANT_MODELS,[e],this.context)}});t.exports=u},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(639),r=n.extend({className:"inbox-recipient",template:o,defaults:{isSelected:!1,context:"inbox:recipients"},events:{"click [data-start-conversation]":"_onStartConversationClick",mouseenter:"_onRecipientHover",mouseleave:"_onRecipientLeave"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","onSelect","onClear","context"))},afterRender:function(){this.listenTo(this,"change:isSelected",this._onChangeIsSelected)},setSelected:function(t){this.rendered&&this.set("isSelected",t)},getTemplateData:function(){return{name:this.model.get("name"),title:this.model.get("title"),avatarUrl:this.model.getAvatarUrl()}},_onStartConversationClick:function(t){t.preventDefault(),this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_PARTICIPANT_MODELS,[this.model],this.get("context"))},_onChangeIsSelected:function(t,e){this.$el.toggleClass("selected",e)},_onRecipientHover:function(){s.isFunction(this.onSelect)&&this.onSelect(this,this.model)},_onRecipientLeave:function(){s.isFunction(this.onClear)&&this.onClear(this,this.model)}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<a data-start-conversation href="/conversation/new/'+__e(name)+'" class="inbox-row"><img class="avatar" src="'+__e(avatarUrl)+'"><div class="info-container"><h3>'+__e(name)+"</h3><h4>"+__e(title)+"</h4></div></a>";return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+="<div data-js-container> ",title&&(__p+=" <h2>"+__e(title)+"</h2> "),__p+=' <div data-subview="recipients[]"></div><div data-js-no-results-container class="no-results"><p data-js-no-results-text>'+__e(noResultsText)+"</p></div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-js-conversations-container><div data-subview="conversations[]"></div><div data-subview="favoritesView"></div></div><div class="inbox-pagination-loader" data-js-loader-container><div data-subview="paginationLoaderView"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(643),r=i(645),a=i(647),l=n.extend({className:"inbox-header",template:a,defaults:{isComposing:!1},subviews:{senderView:{constructor:o,options:function(t){return{eventBus:t.eventBus,user:t.user,channels:t.channels,popoverContainer:t.popoverContainer,currentBlogModel:t.currentBlogModel}}},composeToggleView:{constructor:r,options:function(t){return{eventBus:t.eventBus}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","user","channels","popoverContainer","currentBlogModel"))},afterRenderSubviews:function(){this.listenTo(this.composeToggleView,"change:isComposing",function(t,e){this.set("isComposing",e)}),this.listenTo(this,"change:isComposing",function(t,e){this.composeToggleView.set("isComposing",e)})}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(566),r=i(644),a=n.extend({className:"inbox-sender",template:r,subviews:{blogSelector:{constructor:o,options:function(t){return{className:"inbox-sender-blog-selector",collection:t.channels,popoverOptions:{popoverContainer:t.popoverContainer},currentTumblelog:t.channels.findWhere({uuid:t.currentBlogModel.getId()}),badgeCountField:"unread_messages_count_sum"}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","user","channels","currentBlogModel","popoverContainer"))},afterRenderSubviews:function(){this.listenTo(this.blogSelector,"change:currentTumblelog",this._onBlogSelectorChange)},_onBlogSelectorChange:function(t,e){this.currentBlogModel.setChannel(e)}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="blogSelector" class="blog-selector"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(646),r=n.extend({className:"inbox-compose-toggle",template:o,defaults:{isComposing:!1},events:{"click [data-js-compose-toggle]":"_onClickToggleCompose"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus"))},afterRender:function(){this.listenTo(this,"change:isComposing",this._onChangeIsComposing)},_onChangeIsComposing:function(t,e){this.$el.toggleClass("active",e)},_onClickToggleCompose:function(t){t.preventDefault(),this.set("isComposing",!this.get("isComposing"))}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<a href="#" class="compose-toggle compose-start" data-js-compose-toggle>'+__e(__("Compose message"))+'</a><a href="#" class="compose-toggle compose-cancel" data-js-compose-toggle>'+__e(__("Nevermind"))+"</a>";return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="senderView"></div><div data-subview="composeToggleView"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(100),r=i(155),a=i(206),l=i(649),h=i(637),c=i(395),u=i(651),d=r.extend({className:"inbox-compose",template:u,defaults:{isShowFavorites:!0,isLoading:!1,showLoadingAfterMs:250,hasEditorFocus:!1},events:{"input [data-js-textinput]":"_onTextInputChange","focus [data-js-textinput]":"_onTextInputFocus","blur [data-js-textinput]":"_onTextInputBlur"},mixins:[a],subviews:{favoritesView:{constructor:h,options:function(t){return{showMessageOnEmpty:!1,eventBus:t.eventBus,collection:t.favoritesCollection,title:o("Favorites"),context:"inbox:favorites"}}},searchResultView:{constructor:h,options:function(t){return{eventBus:t.eventBus,collection:t.collection,context:"inbox:typeahead"}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","favoritesCollection","currentBlogModel","keyboardManager")),this.collection=new l,this._debouncedSearch=s.bind(s.debounce(this._search,250),this)},afterRenderSubviews:function(){this.loader=new c({$container:this.$el,type:"bar",classModifiers:"top",loading:!1}),this.listenTo(this,"change:isShowFavorites",this._onChangeIsShowFavorites),this.listenTo(this,"change:isLoading",this._onChangeIsLoading),this.listenTo(this,"change:hasEditorFocus",this._onChangeHasEditorFocus),this._onChangeIsShowFavorites(this,this.get("isShowFavorites"))},_setKeyboardState:function(){this.keyboardManager.remove("inbox:compose"),this.get("hasEditorFocus")&&(this.get("isShowFavorites")?this.keyboardManager.add("inbox:compose:favorites",this.favoritesView):this.keyboardManager.add("inbox:compose:results",this.searchResultView))},_onChangeHasEditorFocus:function(t,e){this._setKeyboardState()},fetchResults:function(t){var e=this.currentBlogModel.getChannel().get("uuid");return this.set("isLoading",!0),this.collection.fetchByQuery(t,e).always(s.bind(function(){this.rendered&&this.set({isShowFavorites:!1,isLoading:!1})},this))},clear:function(){this.js$("textinput").val("")},focus:function(){this.js$("textinput").focus()},blur:function(){this.js$("textinput").blur()},beforeRemove:function(){this.keyboardManager.remove("inbox:compose")},_search:function(t){s.isEmpty(t)?this.set("isShowFavorites",!0):this.fetchResults(t)},_onTextInputChange:function(t){this._debouncedSearch(n(t.target).val())},_onTextInputBlur:function(t){this.set("hasEditorFocus",!1)},_onTextInputFocus:function(t){this.set("hasEditorFocus",!0)},_onChangeIsShowFavorites:function(t,e){this.favoritesView.toggle(e),this.searchResultView.toggle(!e),this._setKeyboardState()},_onChangeIsLoading:function(t,e){return this._loaderTimeout&&(clearTimeout(this._loaderTimeout),this._loaderTimeout=null),e?void(this._loaderTimeout=setTimeout(s.bind(function(){this.loader.set("loading",!0)},this),this.get("showLoadingAfterMs"))):this.loader.set("loading",!1)}});t.exports=d},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(100),r=i(118),a=i(619),l=i(650),h=r.extend({url:"/svc/conversations/participant_suggestions",model:a,resultCache:{},initialize:function(){return this.getNoResultsFoundMessage=l([o("That isn't anyone."),o("Uh, who?"),o("Huh what?"),o("Never heard of 'em."),o("???"),o("Eh?"),o("Whaaa?")]),r.prototype.initialize.apply(this,arguments)},parse:function(t,e){return n.get(t,"response.blogs")||t},fetchByQuery:function(t,e,i){return i=i||{},n.extend(i,{reset:!0,data:{q:t,participant:e}}),this.fetch(i)},fetchFavorites:function(t,e,i,s){return t=t||8,s=s||{},n.extend(s,{reset:!0,data:{limit:t,participant:e,include_recent:i}}),this.fetch(s)},fetch:function(t){var e=JSON.stringify(n.get(t,"data")),i=new s.Deferred,o=n.get(this.resultCache,e);return this.cancelFetch(),o?(this.reset(o),this.trigger("sync",this),i.resolve(),i):(this._request=r.prototype.fetch.apply(this,arguments),this._request.then(n.bind(function(t){n.set(this.resultCache,e,this.parse(t))},this)).always(n.bind(function(){this._request=null},this)),this._request)},cancelFetch:function(){this._request&&(this._request.abort(),this._request=null)}});t.exports=h},function(t,e,i){"use strict";function s(t){var e,i;return t=t||[],function(){return n.isEmpty(e)&&(e=n.shuffle(t),n.isEmpty(i)||(e=n.without(e,i))),i=e.pop()}}var n=i(3);t.exports=s},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="inbox-compose-input"><label class="label"><span class="label-text-container"> '+__e(__("To:"))+' </span><span class="input-container"><input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="input" data-js-textinput></span></label></div><div class="inbox-compose-main"><div data-subview="loader"></div><div data-subview="favoritesView"></div><div data-subview="searchResultView"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(206),r=i(155),a=i(653),l=i(655),h=r.extend({className:"inbox-empty",template:l,mixins:[o],subviews:{blogsView:{constructor:a,options:function(t){return{collection:t.collection,eventBus:t.eventBus}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","collection"))},getTemplateData:function(){return{header:n("Talk to a Tumblr")}},toggle:function(t){this.$el.toggle(t)}});t.exports=h},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(155),r=i(654),a=o.extend({className:"inbox-empty-blogs",template:r,defaults:{numItemsPerRow:4},events:{"click [data-js-start-conversation]":"_onStartConversation"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","collection"))},afterRender:function(){this.listenTo(this.collection,"update reset",this.render)},getTemplateData:function(){var t,e=this.get("numItemsPerRow"),i=s.map(this.collection.models,function(t){return s.extend(t.toJSON(),{avatarUrl:t.getAvatarUrl()})});return i.length>0&&(t=Math.max(1,Math.floor(i.length/e)),i=i.slice(0,t*e)),{blogs:i}},_onStartConversation:function(t){var e=n(t.currentTarget).attr("data-js-start-conversation"),i=this.collection.findWhere({name:e});this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_PARTICIPANT_MODELS,[i],"inbox:empty"),t.preventDefault()}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)_.isEmpty(blogs)||(__p+=' <div class="blogs"> ',_.each(blogs,function(t){__p+=' <a class="blog" href="/messaging/conversation/'+__e(t.name)+'" data-js-start-conversation="'+__e(t.name)+'"><img class="avatar" src="'+__e(t.avatarUrl)+'" alt="'+__e(t.name)+'" title="'+__e(t.name)+'" width="40" height="40"> </a> '}),__p+=" </div> ");return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="content"><div class="header-container"><h2 class="header" data-js-header>'+__e(header)+'</h2></div><div data-subview="blogsView"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="headerView"></div><div data-subview="composeView"></div><div class="inbox-main"><div data-subview="loader"></div><div data-subview="conversationsView"></div></div><div data-subview="emptyView"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(164),r=i(100),a=i(155),l=i(259),h=i(206),c=i(149).animation,u=i(511),d=i(109),p=i(658),g=i(660),_=i(683),m=i(685),f=i(689),v=i(692),b=i(694),y=i(672),w=i(607),k=i(696),C=i(699),x=i(664).html,S=i(650),T=i(701),E=i(706),P=i(708),F=i(720),I=a.extend({template:F,className:"messaging-conversation-wrapper",defaults:{isError:!1,canSend:!0,isPossibleSpam:!1,isLoading:!0,isHidePendingPost:!1,isFetching:!0,isFetched:!1,isFetchingIcebreakers:!1,isOffline:!1,isAutoFetch:!0,isMinimized:!1,isMinimizeEnabled:!1,isIcebreakersEnabled:!1,isGifSearchEnabled:!1,isStickersEnabled:!1,isSendPhotosEnabled:!1,isDropping:!1,isCurrentDropValid:!0,animateInMessageDuration:500,minimizeOpeningClass:"is-minimize-opening",minimizeClosingClass:"is-minimize-closing",droppingClassName:"is-dropping",noBlurSupportClass:"no-blur-support",imagePreviewAnimateInDurationMs:300,imagePreviewAnimateOutDurationMs:200,imagePreviewAnimateInEasing:[.22,.685,.03,.895],imagePreviewAnimateOutEasing:[.895,.03,.685,.22],imageUploadMaxBytes:null},events:{"click [data-js-tumblelog-name]":"_onBlogClick","click [data-js-messaging-tumblelog-name]":"_onMessagingBlogClick","click [data-js-lightbox-url]":"_onImageLightboxUrlClick","click [data-js-main]":"_onMainContainerClick",dragover:"_onDragOver",dragenter:"_onDragEnter",dragleave:"_onDragLeave",drop:"_onDragDrop",keydown:"_onKeyDown"},mixins:[h],subviews:{conversationLoaderView:{constructor:l,options:{variation:"small centered",loading:!1}},headerView:{constructor:p,options:function(t){return{eventBus:t.eventBus,participants:t.sortedParticipants,theme:t.theme,channels:t.channels,user:t.user,isMinimizeEnabled:t.isMinimizeEnabled()}}},messagesView:{constructor:g,options:function(t){return{eventBus:t.eventBus,collection:t.model.get("messages"),participants:t.model.get("participants"),conversation:t.model,isSafeModeEnabled:t.isSafeModeEnabled,messageFormatter:t.messageFormatter,animateInMessage:s.bind(t._animateInMessage,t)}}},previewView:{constructor:m,options:function(t){return{animateInDurationMs:t.get("imagePreviewAnimateInDurationMs"),animateOutDurationMs:t.get("imagePreviewAnimateOutDurationMs"),
  animateInEasing:t.get("imagePreviewAnimateInEasing"),animateOutEasing:t.get("imagePreviewAnimateOutEasing")}}},composeView:{constructor:f,options:function(t){return{eventBus:t.eventBus,keyboardManager:t.keyboardManager,keyboardNamespace:t.keyboardNamespace+":compose",pluginsArray:t.getPluginsArray(),pluginAnimateInDurationMs:t.get("imagePreviewAnimateOutDurationMs"),pluginAnimateOutDurationMs:t.get("imagePreviewAnimateInDurationMs"),pluginAnimateInEasing:t.get("imagePreviewAnimateOutEasing"),pluginAnimateOutEasing:t.get("imagePreviewAnimateInEasing")}}},minimizedView:{constructor:v,options:function(t){return{eventBus:t.eventBus,model:t.model}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","user","model","channels","messageFormatter","popoverContainer","keyboardManager","collection","isSafeModeEnabled")),this.keyboardNamespace="conversation:"+this.cid,this.model||(this.model=new w),this.messageFormatter||(this.messageFormatter=new x),this.conversation=this.model,this.sortedParticipants=this._getSortedParticipantsCopy(),this.otherParticipant=this.conversation.getOtherParticipant(),this.getGenericErrorMessage=S([r("Something went screwy."),r("Something's busted."),r("Something got snagged."),r("Something's acting up."),r("Something sucks!"),r("Internet is being dumb."),r("Computer weirdness."),r("The server is being foolish."),r("Something fizzled."),r("The internet evaporated."),r("The internet is being wiggly."),r("Something went splat."),r("Server turned to dust."),r("Something's wonky."),r("Something's not happening."),r("Something's not working."),r("Something got messed up."),r("Unknown, totally annoying error."),r("A nameless error mysteriously occurred."),r("Our computer is a loser."),r("Something pooped out."),r("Something fell into a volcano."),r("Something is all gummed up."),r("Something melted.")]),this.permanentPostErrorMessage=r("Can't send this post."),this.getRetryPostErrorMessage=S([r("Hrm. Post didn't send."),r("Blegh. Post didn't send."),r("Fffft. Post didn't send."),r("Welp. Post didn't send."),r("Sending machine broke.")]),this.customErrorMessages={403.7001:r("Please verify your email address before talking to a Tumblr."),403.7003:r("Sorry, %1$s only allows messages from Tumblrs they follow.",this.otherParticipant.get("name")),409:r("You can only send messages to Tumblrs you follow."),429:r("You've hit the daily limit on new conversations. Impressive.")},this.getSpamErrorMessage=S([r("Look sketchy?"),r("Look suspicious?"),r("Look fishy?"),r("Look shady?"),r("Seem fake?"),r("Is this spam?")]),this.easeOutExpo=[.19,1,.22,1],this.dragCount=0},render:function(){return this.isSendPhotosEnabled()&&(this.imageUploadPlugin=new E({imageUploadMaxBytes:this.getImageUploadMaxBytes()})),a.prototype.render.apply(this,arguments)},afterRenderSubviews:function(){this.listenTo(this,"change:isError change:isLoading",this._setOpenViewStates),this.listenTo(this,"change:isHidePendingPost change:isFetching change:isError change:isFetchingIcebreakers",this._setLoadingState),this.listenTo(this,"change:isOffline",this._onChangeIsOffline),this.listenTo(this,"change:canSend",this._onChangeCanSend),this.listenTo(this,"change:isPossibleSpam",this._onChangeIsPossibleSpam),this.listenTo(this,"change:isMinimized",this._onChangeIsMinimized),this.listenTo(this,"change:isDropping",this._onChangeIsDropping),this.listenTo(this,"change:isCurrentDropValid",this._onChangeIsCurrentDropValid),this.listenTo(d,"tumblr_lightbox:form:hide",this._onTumblrLightboxFormHide),this.listenTo(this.composeView,"submit",this._onComposeSubmit),this.listenTo(this.composeView,"resize",this._onComposeResize),this.listenTo(this.composeView,"input",this._onComposeInput),this.listenTo(this.composeView,"focus",this._onComposeFocus),this.listenTo(this.composeView,"blur",this._onComposeBlur),this.listenTo(this.composeView,"plugin:preview:add:image",this._onComposeViewPluginPreviewAddImage),this.listenTo(this.composeView,"plugin:click",this._onComposeViewPluginClick),this.listenTo(this.composeView,"pasteBlob",this._onComposePasteBlob),this.listenTo(this.headerView,"closeClick",this._onTriggeredClose),this.listenTo(this.headerView,"minimizeClick",this._onHeaderMinimizeClick),this.listenTo(this.headerView,"moreActionsClick",this._onHeaderMoreActions),this.listenTo(this.conversation,"change:id",this._onChangeId),this.listenTo(this.conversation,"change:unreadCount",this._onChangeUnreadCount),this.listenTo(this.conversation,"change:can_send",this._onChangeConversationCanSend),this.listenTo(this.conversation,"change:is_possible_spam",this._onChangeConversationIsPossibleSpam),this.listenTo(this.conversation.get("messages"),"change:hasNextPage",this._onChangeMessagesHasNextPage),this.listenTo(this.messagesView,"pillClick",this._onPillClick),this.listenTo(this.messagesView,"messageRetryClick",this._onMessageRetryClick),this.listenTo(this.messagesView,"messageImageUnblur",this._onMessageImageUnblur),this.listenTo(this.composeView,"close",this._onTriggeredClose),this.listenTo(this.minimizedView,"click",this._onMinimizedViewClick),this.listenTo(this.previewView,"close",this._onPreviewViewClose),this.listenTo(this.previewView,"closing",this._onPreviewViewClosing),this.listenTo(this.previewView,"dismiss",this._onPreviewViewDismiss),this.listenTo(this.previewView,"edit",this._onPreviewViewEdit),this._setLoadingState(),this._setMainViewStates(),this._setOpenViewStates(),this._onChangeConversationCanSend(this.conversation,this.conversation.get("can_send")),this._onChangeCanSend(this,this.get("canSend")),this._onChangeConversationIsPossibleSpam(this.conversation,this.conversation.get("is_possible_spam")),this._onChangeIsPossibleSpam(this,this.get("isPossibleSpam")),this.get("isAutoFetch")&&this.fetch(),this.mainTheme=this._applyTheme(this.el),this.isMinimizeEnabled()||(this.minimizedView.remove(),this.js$("conversation-minimized").remove()),this.js$("conversation-open").toggleClass(this.get("noBlurSupportClass"),!u.cssFilters())},beforeRemove:function(){this.conversation.get("messages").reset(this.conversation.getInboxMessage()),this.keyboardManager.remove(this.keyboardNamespace),this.trigger("close")},fetch:function(t){return t=t||{},s.extend(t,{error:s.bind(this._onFetchConversationFail,this)}),this.set("isFetching",!0),this.eventBus.trigger(this.eventBus.CONVERSATION_FETCHING,this.conversation),this._pendingQueueItems=this.conversation.getQueueItems(),this.conversation.clearQueue(),this.conversation.fetchConversation(t).then(s.bind(this._onFetchConversationSuccess,this)).always(s.bind(this._onFetchConversationAlways,this))},poll:function(t,e){return t=t||{},this.eventBus.trigger(this.eventBus.CONVERSATION_FETCHING,this.conversation),this.conversation.poll(t,e).then(s.bind(function(){this.messagesView.scrollToBottom()},this))},refresh:function(t){this._queueMessages(t.getQueueItems()),this.unminimize(),this.focus()},focus:function(){return this.isMinimized()?this.focusMinimized():this.focusCompose(),this},isGifSearchEnabled:function(){return this.get("isGifSearchEnabled")},isSendPhotosEnabled:function(){return this.get("isSendPhotosEnabled")},isStickersEnabled:function(){return this.get("isStickersEnabled")},getImageUploadMaxBytes:function(){return this.get("imageUploadMaxBytes")},getPluginsArray:function(){var t=[];return this.isGifSearchEnabled()&&t.push(new T({collection:this.collection})),this.isSendPhotosEnabled()&&!s.isEmpty(this.imageUploadPlugin)&&t.push(this.imageUploadPlugin),this.isStickersEnabled()&&t.push(new P),t},isMinimizeEnabled:function(){return this.get("isMinimizeEnabled")},isMinimized:function(){return this.get("isMinimized")},focusMinimized:function(){this.minimizedView&&this.minimizedView.focus()},focusCompose:function(){this.composeView&&this.composeView.focus()},toggleMinimize:function(t,e){var i,o,r,a=new n.Deferred,l=this.get("minimizeOpeningClass"),h=this.get("minimizeClosingClass"),c=this.js$("conversation-open"),u=this.js$("conversation-minimized"),d=[a];return this.isMinimizeEnabled()&&t!==this.isMinimized()?(i=function(){this.set("isMinimized",t)},o=function(){a.resolve()},e?(i.call(this),o.call(this)):t?this._addAnimationClass(c,h).then(s.bind(function(){i.call(this),this._addAnimationClass(u,l).then(s.bind(o,this))},this)):this._addAnimationClass(u,h).then(s.bind(function(){i.call(this),this._addAnimationClass(c,l).then(s.bind(o,this))},this)),t||this.get("isFetched")||(r=this.fetch(),d.push(r)),n.when.apply(n,d)):(new n.Deferred).resolve()},minimize:function(t){return this.toggleMinimize(!0,t)},unminimize:function(t){return this.toggleMinimize(!1,t)},_showError:function(t){var e,i;return this.conversationErrorView&&this.conversationErrorView.remove(),i=this.js$("main"),e=new b(t),i.append(e.render().$el),this.conversationErrorView=e,this.set({isError:!0,isOffline:!0}),this._applyTheme(e.el),e},_hideError:function(){this.conversationErrorView&&(this.conversationErrorView.remove(),this.conversationErrorView=null),this.set({isError:!1,isOffline:!1}),this.focus()},_onFetchConversationSuccess:function(){this.rendered&&(this.set("isFetched",!0),this._hideError(),this.conversation.markAsRead(),this.otherParticipant=this.conversation.getOtherParticipant(),this._queueMessages(this._pendingQueueItems),this._pendingQueueItems=null,this.conversation.get("messages").hasNextPage()||(this.set("isFetchingIcebreakers",!0),this._createIcebreakersView().always(s.bind(function(){this.set("isFetchingIcebreakers",!1),this.focus()},this))))},_flushMessageQueue:function(){var t;return this.conversation.hasQueue()?(t=this.conversation.getQueueItems(),this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGES_SEND_REQUESTED,t,this.conversation),this.conversation.isFlushingQueue()?this._flushDefer:(this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGES_SENDING,t,this.conversation),this._flushDefer=this.conversation.flushMessageQueue().progress(s.bind(this._onFlushProgress,this)).fail(s.bind(this._onFlushFail,this)).always(s.bind(this._onFlushAlways,this)),this._flushDefer)):(new n.Deferred).reject()},_onFlushProgress:function(t,e){this.rendered&&this.set("isHidePendingPost",!e&&!this._canRenderPendingMessage(t)),e?this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGE_SENT,t,this.conversation):this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGE_SENDING,t,this.conversation)},_onFlushFail:function(t){this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGE_FAILED,t,this.conversation),this.rendered&&(this._canRenderPendingMessage(t)||(this.conversation.get("messages").remove(t),this._showPostSendingError(t)),this._flushMessageQueue())},_onFlushAlways:function(){this.rendered&&(this.set("isHidePendingPost",!1),this.focus())},_onFetchConversationFail:function(t,e){var i,n=e.status,o=s.get(e,"responseJSON.errors.0.code");this.rendered&&(s.isFinite(o)&&o>0&&(i=this.customErrorMessages[n+"."+o]),s.isEmpty(i)&&(i=s.get(this.customErrorMessages,n,this.getGenericErrorMessage())),this._showError({message:i,buttonCallback:s.bind(this._onConversationErrorRetryClick,this),showButton:t.canRetryFetch(s.get(e,"status"))}))},_showPostSendingError:function(t){var e,i,n;this.rendered&&(t.canRetry()?(e=this.getRetryPostErrorMessage(),n=s.partial(this._onPostSendingErrorRetryClick,t)):(e=this.permanentPostErrorMessage,i=r("Close"),n=this._onPostSendingErrorCloseClick),this._showError({message:e,buttonCallback:s.bind(n,this),buttonText:i}))},_onPostSendingErrorCloseClick:function(){this._hideError()},_onPostSendingErrorRetryClick:function(t){this._resendMessage(t).then(s.bind(function(){this._hideError()},this))},_onFetchConversationAlways:function(){this.rendered&&this.set("isFetching",!1)},_onComposeSubmit:function(t,e){var i,n,o=this.previewView.getMessage(),r=!s.isEmpty(t),a=!s.isEmpty(o);r&&(i=w.createTextMessage(t,{hasAnimation:!0,creationUserAction:e})),a&&(o.set({isFromPreview:!0,hasAnimation:!0,creationUserAction:e}),r&&i.set({context:o.get("context")})),n=s.compact([o,i]),a?this.previewView.close().then(s.bind(function(){s.delay(s.bind(function(){this.rendered&&this._queueMessages(n)},this),150)},this)):this._queueMessages(n),this.messagesView.scrollToBottom()},_canRenderPendingMessage:function(t){return s.isEmpty(t)?!1:t.isPost()?t.getPost().hasThumbnail():!0},_queueMessages:function(t,e){return s.isEmpty(t)?(new n.Deferred).reject():(e=s.extend({},e,{isSendingMessage:!0}),s.isArray(t)||(t=[t]),s.each(t,s.bind(function(t){t.set("isQueued",!0),this.conversation.addMessage(t,e)},this)),this.conversation.appendToQueue(t,e),this._flushMessageQueue())},_resendMessage:function(t){var e=this.conversation.get("messages");return e.last()!==t&&e.remove(t),this._queueMessages(t)},_onComposeResize:function(){this.messagesView.updateScrollBar()},_onComposeInput:function(t,e){this.trigger("compose:input",t,e),this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGE_INPUT,this.conversation,t)},_onComposeFocus:function(t){this.trigger("compose:focus",t)},_onComposeBlur:function(t){this.trigger("compose:blur",t)},_onComposePasteBlob:function(t){this._isFileDropEnabled()&&this._addImageToFilePreview(t,"clipboard")},_onChangeId:function(t){t.isNew()||this.trigger("created",t)},_onChangeUnreadCount:function(t,e){0===e||this.isMinimized()||(this.messagesView.isAtBottom()?this._fetchUnreadMessages().then(s.bind(function(){this.eventBus.trigger(this.eventBus.CONVERSATION_MESSAGES_UNREAD_FETCHED)},this)):this.messagesView.showPill(e).then(s.bind(this._fetchUnreadMessages,this))["catch"](s.noop))},_fetchUnreadMessages:function(){var t=this.conversation.get("unreadCount"),e=Math.min(10,t+5);return 0===t?(new n.Deferred).reject():(this.conversation.markAsRead(),this.poll(null,e))},_getSortedParticipantsCopy:function(){var t=this.conversation.get("participants"),e=this.channels.getSortedIds(this.conversation.get("participantUuid")),i=t.getSortedByChannels(e,!0);return new t.constructor(i)},_setLoadingState:function(){var t=this.get("isFetching")||this.get("isHidePendingPost")||this.get("isFetchingIcebreakers");this.set("isLoading",!this.get("isError")&&t)},_setMainViewStates:function(){var t=this.get("isMinimized"),e=this.js$("conversation-open"),i=this.js$("conversation-minimized");e.toggle(!t),i.toggle(t),t?i.css("display",""):e.css("display","")},_setOpenViewStates:function(){var t=this.get("isError"),e=this.get("isLoading");this.messagesView.toggle(!t&&!e),this.composeView.set("isDisabled",t||e),this.conversationLoaderView.set("loading",e)},_setDragDropClasses:function(){var t=this.get("droppingClassName"),e=this.get("isCurrentDropValid"),i=this.get("isDropping"),s=this._isFileDropEnabled(),n=s&&i&&e;this.js$("conversation-open").toggleClass(t,n),this.js$("conversation-minimized").toggleClass(t,n)},_createIcebreakersView:function(){var t;return this.icebreakersView||!this.get("isIcebreakersEnabled")?(t=new n.Deferred,t.reject(),t):this.otherParticipant.fetchAdditionalInfo(this.conversation.getParticipantId()).then(s.bind(function(){var t;this.rendered&&(t=this.conversation.isNew(),this.icebreakersView=new C({participant:this.otherParticipant,isShowTags:t,isShowRelationship:!t,isShowDescription:!t}),this.messagesView.addHeaderView(this.icebreakersView))},this))},_onTriggeredClose:function(){this.trigger("close")},_onHeaderMoreActions:function(t){this.actionsPopover&&this.actionsPopover.isOrWasRecentlyRendered()||this._showMoreActionsPopover(t)},_onHeaderMinimizeClick:function(){this.minimize()},_onMinimizedViewClick:function(){this.unminimize()},_onPillClick:function(){this.focus()},_onBlogClick:function(t){var e=n(t.currentTarget);this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_TUMBLR_URL,{blogName:e.attr("data-js-tumblelog-name"),postId:e.attr("data-js-post-id"),searchTagTerm:e.attr("data-js-tumblelog-tag"),url:e.attr("href"),originalEvent:t})},_onMessagingBlogClick:function(t){var e=n(t.currentTarget);this.eventBus.trigger(this.eventBus.CONVERSATION_OPEN_MESSAGING_URL,{blogName:e.attr("data-js-messaging-tumblelog-name"),url:e.attr("href"),originalEvent:t})},_onImageLightboxUrlClick:function(t){t.preventDefault();var e,i=n(t.currentTarget),o=i.attr("data-js-lightbox-width"),r=i.attr("data-js-lightbox-height"),a=i.attr("data-js-lightbox-lowres-url"),l=i.attr("data-js-lightbox-url");s.isEmpty(a)||s.isEmpty(l)||(e={width:o,height:r,low_res:a,high_res:l},s.get(e,"low_res")&&(this.eventBus.trigger(this.eventBus.CONVERSATION_IMAGE_LIGHTBOX,{lightBoxImageData:[e]}),this.composeView.set("isLightboxOpen",!0)))},_onActionsBlock:function(t){var e=this.conversation.getParticipantModel();s.isEmpty(e)||this.eventBus.trigger(this.eventBus.BLOCK,{currentTumblelog:e.get("name"),blockedTumblelog:t,context:"messaging"},this.conversation)},_onActionsDelete:function(){this.eventBus.trigger(this.eventBus.CONVERSATION_DELETE_MODEL,this.conversation)},_applyTheme:function(t){var e;return s.isEmpty(this.otherParticipant)?null:(e=this.otherParticipant.get("theme"),s.isEmpty(e)?null:new y({el:t,theme:e}).render())},_showMoreActionsPopover:function(t){var e;this.actionsPopover&&this.actionsPopover.remove(),this.actionsPopover=new k({autoTeardown:!0,pinnedSide:"bottom",pinnedTarget:t,popoverContainer:this.popoverContainer,viewOptions:{participants:this.conversation.get("participants"),user:this.user}}),e=this.actionsPopover.getView(),this.listenTo(e,"block",this._onActionsBlock),this.listenTo(e,"delete",this._onActionsDelete),this.actionsPopover.render()},_animateInMessage:function(t,e,i){var n,r,a=t.$el,l=this.composeView.$el.offset(),h=a.offset(),c=Math.max(0,l.top-h.top)+a.height();i.get("isFromPreview")?n=0:(r=e.offset(),n=l.left-r.left),this.messagesView.setIsAnimating(!0),o.animate(a,{translateY:[0,c],translateX:[0,n],opacity:[1,1]},{duration:this.get("animateInMessageDuration"),easing:this.easeOutExpo,complete:s.bind(function(){this.messagesView.setIsAnimating(!1),i.set("hasAnimation",!1),a.css("transform","")},this)})},_addAnimationClass:function(t,e){var i=new n.Deferred;return t.removeClass(e),c(t,function(){t.removeClass(e),i.resolve()}),t.addClass(e),i},_addImageToFilePreview:function(t,e){var i=function(){this.imageUploadPlugin.addImageFile(t,e)};this.isMinimized()?this.unminimize().then(s.bind(i,this)):i.call(this)},_isFileDropEnabled:function(){return this.rendered&&this.isSendPhotosEnabled()&&!this.previewView.hasImage()&&this.get("canSend")&&!this.get("isError")},_onConversationErrorRetryClick:function(t){return this.fetch()},_onChangeIsOffline:function(t,e){this.composeView.set("isOffline",e)},_onMessageRetryClick:function(t){this._resendMessage(t)},_onMessageImageUnblur:function(t){this.conversation.unblurImages()},_onChangeConversationCanSend:function(t,e){this.set("canSend",e)},_onChangeConversationIsPossibleSpam:function(t,e){this.set("isPossibleSpam",e)},_onChangeCanSend:function(t,e){var i=r("This Tumblr can't receive messages.");this.composeView.toggle(e),!e&&this.canSendErrorView||e&&!this.canSendErrorView||(e?(this.messagesView.removeFooterView(this.canSendErrorView),delete this.canSendErrorView):(this.canSendErrorView=new _({message:i,showErrorIcon:!0}),this.messagesView.addFooterView(this.canSendErrorView)))},_onChangeIsPossibleSpam:function(t,e){e&&this.isPossibleSpamView||!e&&!this.isPossibleSpamView||(e?(this.isPossibleSpamView=new _({message:this.getSpamErrorMessage(),actionText:r("Mark as spam"),actionCallback:s.bind(this._onMarkAsSpamLinkClick,this)}),this.messagesView.addFooterView(this.isPossibleSpamView)):(this.messagesView.removeFooterView(this.isPossibleSpamView),delete this.isPossibleSpamView))},_onChangeIsMinimized:function(t,e){this._setMainViewStates(),e||s.defer(s.bind(function(){this.messagesView.updateScrollBar(),this.focus(),this.conversation.get("unreadCount")>0&&(this._fetchUnreadMessages(),this.messagesView.scrollToBottom())},this)),this.trigger(e?"minimized":"unminimized")},_onChangeIsDropping:function(t,e){this._setDragDropClasses()},_onChangeIsCurrentDropValid:function(t,e){this._setDragDropClasses()},_onMainContainerClick:function(){window.getSelection().isCollapsed&&this.focus()},_onKeyDown:function(t){var e=t.keyCode;9===e&&(t.shiftKey?this.trigger("keydown:shift+tab",t):this.trigger("keydown:tab",t))},_onDragOver:function(t){var e=s.get(t,"originalEvent.dataTransfer.types",[]),i=s.contains(e,"Files"),n=this._isFileDropEnabled();t.preventDefault(),this.set("isCurrentDropValid",i),s.set(t,"originalEvent.dataTransfer.dropEffect",i&&n?"copy":"none")},_onDragEnter:function(){this.dragCount++,this.set("isDropping",!0)},_onDragLeave:function(){this.dragCount--,this.set("isDropping",this.dragCount>0)},_onDragDrop:function(t){var e=s.get(t,"originalEvent.dataTransfer.files",[]);return t.preventDefault(),this.dragCount=0,this.set("isDropping",!1),0!==e.length?this.previewView.hasImage()?void(this.isMinimized()&&this.unminimize()):void(this._isFileDropEnabled()&&this._addImageToFilePreview(s.last(e),"drop")):void 0},_onComposeViewPluginPreviewAddImage:function(t){this.previewView.addImage(t),this.messagesView.updateScrollBar(),this.composeView.toggleAutoValidation(!1),this.isStickersEnabled()||this.composeView.hideComposePluginsView(),this.focus(),this.eventBus.trigger(this.eventBus.CONVERSATION_IMAGE_PREVIEW_ADD,this.conversation,t)},_onComposeViewPluginClick:function(t){this.eventBus.trigger(this.eventBus.CONVERSATION_COMPOSE_PLUGIN_CLICK,this.conversation,t)},_onPreviewViewClosing:function(t){this.isStickersEnabled()||this.composeView.showComposePluginsView(),this.focus()},_onPreviewViewClose:function(t){this.messagesView.updateScrollBar(),this.composeView.toggleAutoValidation(!0),this.focus()},_onPreviewViewDismiss:function(t){this.eventBus.trigger(this.eventBus.CONVERSATION_IMAGE_PREVIEW_DISMISS,this.conversation,t)},_onPreviewViewEdit:function(t){this.eventBus.trigger(this.eventBus.CONVERSATION_IMAGE_PREVIEW_EDIT,this.conversation,t)},_onMarkAsSpamLinkClick:function(){this.eventBus.trigger(this.eventBus.CONVERSATION_MARK_AS_SPAM,this.conversation,this.otherParticipant)},_onChangeMessagesHasNextPage:function(t,e){!this.rendered||this.conversation.isNew()||e||this._createIcebreakersView()},_onTumblrLightboxFormHide:function(){this.composeView.set("isLightboxOpen",!1)}});t.exports=I},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(206),r=i(659),a=n.extend({className:"conversation-header",template:r,mixins:[o],defaults:{separator:"+",isMinimizeEnabled:!1},attributes:{"data-js-theme-background-color-or-image-class":!0,"data-js-theme-accent-color-on-background":!0},events:{"click [data-js-close]":"_onClickCloseButton","click [data-js-more-actions]":"_onClickMoreActions","click [data-js-minimize]":"_onClickMinimizeButton"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","participants","user","channels"))},getTemplateData:function(){var t;return t=this.channels.length>1?this.participants.toJSON():s.invoke(this.participants.getWithout(this.channels.pluck("uuid")),"toJSON"),t=s.filter(t,function(t){return!s.isEmpty(s.get(t,"name"))}),{participants:t,separator:this.get("separator"),isMinimizeEnabled:this.get("isMinimizeEnabled")}},_onClickCloseButton:function(t){this.trigger("closeClick"),t.preventDefault()},_onClickMoreActions:function(t){var e=t.currentTarget;this.trigger("moreActionsClick",e),t.preventDefault()},_onClickMinimizeButton:function(t){this.trigger("minimizeClick"),t.preventDefault()}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj){__p+='<div class="conversation-header-image" data-js-theme-header-image></div><div class="conversation-header-main"><div data-js-title class="title"> ';var lastIndex=participants.length-2;__p+=" ",_.each(participants,function(t,e){__p+=' <a href="'+__e(t.url)+'" target="_blank" data-js-tumblelog-name="'+__e(t.name)+'">'+__e(t.name)+"</a> "+__e(e===lastIndex?" "+separator+" ":lastIndex>e?", ":"")+" "}),__p+=' </div><div class="controls" data-js-theme-accent-color-on-background><a href="#" data-js-more-actions class="more-actions">'+__e(__("Actions"))+"</a> ",isMinimizeEnabled&&(__p+=' <a href="#" data-js-minimize class="minimize">'+__e(__("Minimize"))+"</a> "),__p+=' <a href="#" data-js-close class="close">'+__e(__("Close"))+"</a></div></div>"}return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(9),o=i(120),r=i(155),a=i(632),l=i(206),h=i(259),c=i(636),u=i(661),d=i(680),p=i(682),g=r.extend({className:"conversation-messages",template:p,mixins:[l,a],defaults:{isVisible:!0,isPaginating:!1,tsHeaderThreshold:36e5,collapseMessagesThreshold:6e4,pillClickScrollSpeed:500,pillBottomThreshold:80},subviews:{paginationLoaderView:{constructor:h,options:{variation:"small h-centered",loading:!1}},messagesView:{constructor:u,options:function(t){return{eventBus:t.eventBus,participants:t.participants,conversation:t.conversation,formatter:t.messageFormatter,animateInMessage:t.animateInMessage,isSafeModeEnabled:t.isSafeModeEnabled,afterRetryClick:s.bind(t.afterRetryClick,t),afterImageUnblur:s.bind(t.afterImageUnblur,t)}},collection:function(t){return t.collection}},pillView:{constructor:d,options:function(t){return{eventBus:t.eventBus}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","collection","participants","conversation","messageFormatter","animateInMessage","isSafeModeEnabled"))},afterRenderSubviews:function(){this.scrollBar=new c({el:this.el,bottomThreshold:this.get("pillBottomThreshold")}),this.listenTo(this.collection,"update reset",this._onCollectionUpdate),this.listenTo(this.collection,"change:hasNextPage",this._onChangeHasNextPage),this.listenTo(this.collection,"change:isError",this._onChangeMessageIsError),this.listenTo(this.scrollBar,"scrolltop",this._onScrollChangeIsAtTop),this.listenTo(this.scrollBar,"scrollbottom",this._onScrollChangeIsAtBottom),this.listenTo(this.scrollBar,"scrollstop",this._createPositionSnapshot),this.listenTo(this.pillView,"click",this._onPillViewClick),this.listenTo(this,"change:isPaginating",this._onChangeIsPaginating),this.listenTo(this,"change:isVisible",this._onChangeIsVisible),this._onChangeHasNextPage(this.collection,this.collection.hasNextPage()),s.defer(s.bind(function(){this._processMessages(),this.updateScrollBar(),this.scrollToBottom()},this))},beforeRemove:function(){this.scrollBar&&this.scrollBar.destroy()},scrollToBottom:function(t){this._setScrollTop(this.el.scrollHeight,t)},getNextPage:function(){this.collection.hasNextPage()&&(this.set("isPaginating",!0),this.collection.fetchNextPage({at:0,isPaginating:!0,scrollBottom:this._getCurrentScrollBottom()}).always(s.bind(function(){this.set("isPaginating",!1)},this)))},updateScrollBar:function(){var t,e=this.scrollBar.isDisabled();this.scrollBar.setDisabled(!0),this.scrollBar&&this.scrollBar.update(),t=this._getPositionDiff(),t&&this._setScrollTop(this.$el.scrollTop()+t.height+t.scrollTop),this._createPositionSnapshot(),this.scrollBar.setDisabled(e)},afterRetryClick:function(t){this.trigger("messageRetryClick",t)},afterImageUnblur:function(t){this.trigger("messageImageUnblur",t)},toggle:function(t){this.set("isVisible",t)},isAtBottom:function(){return this._lastPosition&&this.scrollBar?this._lastPosition.scrollBottom<this.get("pillBottomThreshold"):!0},showPill:function(t){return this._pillDefer&&this._pillDefer.reject(),this._pillDefer=o.defer(),this.pillView.setCount(t),this._pillDefer.promise},addHeaderView:function(t){var e=this._getCurrentScrollBottom();return this.js$("header").append(t.render().$el),this._adjustScrollbarAfterNewElements(e),t},removeHeaderView:function(t){return t.remove()},addFooterView:function(t){return this.js$("footer").append(t.render().$el),t},removeFooterView:function(t){return t.remove()},setIsAnimating:function(t){this.$el.toggleClass("is-animating",t)},_onChangeIsVisible:function(t,e){this.$el.css("visibility",e?"":"hidden"),e&&(this.updateScrollBar(),this.scrollToBottom())},_setScrollTop:function(t,e){e?this.$el.animate({scrollTop:t},e):this.$el.scrollTop(t),this._createPositionSnapshot()},_getCurrentScrollBottom:function(){return this.el.scrollHeight-this.$el.scrollTop()},_onCollectionUpdate:function(t,e){this._processMessages(e),s.get(e,"isPaginating")&&this._adjustScrollbarAfterNewElements(s.get(e,"scrollBottom")),s.defer(s.bind(function(){this.rendered&&this._adjustScrollbarAfterFetch(e)},this))},_adjustScrollbarAfterFetch:function(t){this.scrollBar&&this.scrollBar.update(),s.get(t,"isPolling")||s.get(t,"isPaginating")||this.scrollToBottom(),this._createPositionSnapshot()},_adjustScrollbarAfterNewElements:function(t){s.isNumber(t)&&(this.scrollBar.setDisabled(!0),this._setScrollTop(this.el.scrollHeight-t),s.delay(s.bind(function(){this.scrollBar.setDisabled(!1)},this),500))},_onChangeIsPaginating:function(t,e){this.paginationLoaderView.set("loading",e)},_onChangeHasNextPage:function(t,e){this.js$("loader-container").toggle(e)},_processMessages:function(t){var e,i=this.get("tsHeaderThreshold"),n=this.get("collapseMessagesThreshold"),o=(new Date).getTime();s.get(t,"isPolling")&&(o="new"),this.collection.each(function(t){t.set({tsHeader:this._getTimestampHeader(t,e,i),isCollapsed:this._getIsCollapsed(t,e,n,o)}),e=t},this)},_getTimestampHeader:function(t,e,i){var s=t?t.getTimestamp():null,o=e?e.getTimestamp():null,r=!o||s-o>i;return r?n(s).calendar():null},_getIsCollapsed:function(t,e,i,s){return t.has("collapseGroup")||t.set("collapseGroup",t.isNew()?"new":s),e?t.get("collapseGroup")!==e.get("collapseGroup")?!1:t.get("participant")!==e.get("participant")?!1:t.getTimestamp()-e.getTimestamp()<i:!1},_getScrollPosition:function(){return this.scrollBar.getCurrentPositions()},_createPositionSnapshot:function(){this._lastPosition=this._getScrollPosition()},_getPositionDiff:function(){if(this._lastPosition){var t=this._getScrollPosition();return{scrollTop:this._lastPosition.scrollTop-t.scrollTop,scrollBottom:this._lastPosition.scrollBottom-t.scrollBottom,height:this._lastPosition.height-t.height}}},_onScrollChangeIsAtTop:function(t){t&&this.getNextPage()},_onScrollChangeIsAtBottom:function(t){t&&this._pillDefer&&(this._pillDefer.resolve(this.pillView.getCount()),this.pillView.setCount(0))},_onPillViewClick:function(){this.pillView.setCount(0),this.scrollToBottom(this.get("pillClickScrollSpeed")),this._pillDefer&&this._pillDefer.resolve()},_onChangeMessageIsError:function(){this.scrollToBottom()}});t.exports=g},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(155),r=i(206),a=i(610),l=i(662),h=i(663),c=i(669),u=i(671),d=i(674),p=i(676),g=i(678),_=o.extend({className:"conversation-message",template:l,mixins:[r],defaults:{pendingClassName:"is-pending"},events:{"click [data-js-retry-button]":"_onRetryClick"},messagesTypes:{},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","participants","conversation","afterRetryClick","formatter","animateInMessage","afterImageUnblur","isSafeModeEnabled")),this.addMessageType(a.STICKER,g,function(t){return{conversation:t.conversation}}),this.isSafeModeEnabled&&this.model.get("post").get("is_nsfw")?this.addMessageType(a.POST,u,function(t){return{conversation:t.conversation}}):this.addMessageType(a.POST,c),this.addMessageType(a.IMAGE,d,function(t){return{conversation:t.conversation,afterImageUnblur:s.bind(t.afterImageUnblur,t)}}),this.addMessageType(a.TEXT,h,function(t){return{formatter:t.formatter}})},afterRenderSubviews:function(){var t=this.createMessageView(this.model.get("type"));return t?(this.js$("message-container").html(t.render().$el),this.model.get("hasAnimation")&&s.isFunction(this.animateInMessage)&&this.animateInMessage(this,this.js$("message-bubble"),this.model),
  this.listenTo(this.model,"change:isPending",this._onChangeIsPending),this.listenTo(this.model,"change:isError",this._onChangeIsError),this.listenTo(this.model,"change:isCollapsed",this._onChangeIsCollapsed),this.listenTo(this.model,"change:isQueued",this._onChangeIsQueued),this.listenTo(this.model,"change:tsHeader",this._onChangeTsHeader),this.listenTo(this.model,"change:isPending change:isError change:canRetry change:id",this.setRetryButtonState),this._onChangeIsPending(this.model,this.model.get("isPending")),this._onChangeIsError(this.model,this.model.get("isError")),this._onChangeTsHeader(this.model,this.model.get("tsHeader")),this._onChangeIsCollapsed(this.model,this.model.get("isCollapsed")),this._onChangeIsQueued(this.model,this.model.get("isQueued")),void this.setRetryButtonState()):void this.remove()},addMessageType:function(t,e,i){this.messagesTypes[t]={constructor:e,options:i}},getMessageType:function(t){return s.get(this.messagesTypes,t)},createMessageView:function(t){var e,i=this.getMessageType(t);return s.isEmpty(i)||!s.has(i,"constructor")?null:(e=s.get(i,"options",{}),s.isFunction(e)&&(e=e.call(this,this)),s.extend(e,{model:this.model,participants:this.participants,eventBus:this.eventBus,setRetryButtonState:s.bind(this.setRetryButtonState,this)}),new i.constructor(e))},setRetryButtonState:function(){var t,e,i,s,o,r,a,l;this.rendered&&(t=this.js$("retry-button",!0),0!==t.length&&(o=this.model.isNew(),e=this.model.get("isPending"),i=this.model.get("canRetry"),s=this.model.get("isError"),r=n(i?"Retry":"Could not send"),a=e?n("Trying..."):r,l=s&&o,t.toggle(l),l&&(t.text(a).prop("disabled",e||!i),t.toggleClass(this.get("pendingClassName"),e))))},_onChangeTsHeader:function(t,e){this.timestampView&&this.timestampView.remove(),s.isEmpty(e)||(this.timestampView=new p({model:this.model}),this.$el.prepend(this.timestampView.render().$el))},_onChangeIsCollapsed:function(t,e){this.$el.toggleClass("collapsed",e)},_onChangeIsPending:function(t,e){this.$el.toggleClass("pending",e)},_onChangeIsError:function(t,e){this.$el.toggleClass("error",e)},_onChangeIsQueued:function(t,e){this.$el.toggleClass("queued",e)},_onRetryClick:function(t){t.preventDefault(),this.model.get("canRetry")&&(this.trigger("retryClick",this.model),s.isFunction(this.afterRetryClick)&&this.afterRetryClick(this.model))}});t.exports=_},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+="<div data-js-message-container></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(206),r=i(664).html,a=i(668),l=n.extend({className:"conversation-message-text message-container",mixins:[o],template:a,defaults:{fullWidthBubblePercentThreshold:60,fullWidthBubbleClass:"full-width-bubble"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","participants")),this.formatter=t.formatter||new r},afterRenderSubviews:function(){this.listenTo(this.model.get("content"),"change",this.render),this.$el.width()?this._setBubbleStyles():s.defer(s.bind(this._setBubbleStyles,this))},getTemplateData:function(){var t=this.participants.get(this.model.get("participant")),e=this.model.toJSON(),i=this.formatter.render(s.get(e,"content.text"),s.get(e,"content.formatting"));return{message:i,avatarUrl:t?t.getAvatarUrl():null,name:t?t.get("name"):null,url:t?t.get("url"):null}},_setBubbleStyles:function(){var t=this.get("fullWidthBubblePercentThreshold"),e=this.js$("message-bubble"),i=this.$el.width(),s=e.width();s>t/100*i&&e.addClass(this.get("fullWidthBubbleClass"))}});t.exports=l},function(t,e,i){"use strict";t.exports={html:i(665)}},function(t,e,i){"use strict";var s=i(3),n=i(666),o=i(667),r=n.extend({name:"html",formatters:{link:o},escape:function(t){return s.escape(t)},applyFormatting:function(t,e){var i=s.bind(this.escape,this),n=s.bind(this.getFormatter,this),o={};s.forEach(e,function(t){var e=n(t.type);if(e){var i=t.position,r=t.attributes,a=i[0],l=i[1];s.isEmpty(o[a])&&(o[a]=[]),s.isEmpty(o[l])&&(o[l]=[]),o[a].push(s.bind(e.open,this,r)),o[l].unshift(s.bind(e.close,this,r))}},this);var r,a,l=s.sortBy(s.keys(o),function(t){return s.parseInt(t)}),h="",c=0;return s.forEach(l,function(e){r=o[e],a=t.substr(c,e-c),h+=i(a),s.forEach(r,function(t){h+=t()}),c=e},this),a=t.substr(c),h+=i(a)}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(144),o=n.extend({name:"unknown",formatters:{},constructor:function(t){this.options=t||{},s.isFunction(this.formatters)?this.formatters=this.formatters():this.formatters=s.clone(this.formatters||{})},registerFormatter:function(t,e){this.formatters[t]=e},getFormatter:function(t){return s.result(this.formatters,t)},escape:function(t){return t},applyFormatting:function(t,e){return this.escape(t)},postFilter:function(t){return t},render:function(t,e){return this.postFilter(this.applyFormatting(t,e))}});t.exports=o},function(t,e,i){"use strict";function s(t){return n(t).omit(n.isUndefined).reduce(function(t,e,i){return(t?t+" ":"")+o('%s="%s"',n.escape(i),n.escape(e))},"")}var n=i(3),o=i(6).sprintf,r={open:function(t){var e=s({"data-js-tumblelog-name":t.blog_name,"data-js-post-id":t.post_id,"data-js-messaging-tumblelog-name":t.messaging_blog_name,target:"_blank",href:t.url});return"<a "+e+">"},close:function(t){return"</a>"}};t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<a class="avatar" href="'+__e(url)+'" target="_blank" data-js-tumblelog-name="'+__e(name)+'"><img src="'+__e(avatarUrl)+'"></a><div class="message-bubble" data-js-message-bubble><div class="message-bubble-header"><a href="'+__e(url)+'" class="name" target="_blank" data-js-tumblelog-name="'+__e(name)+'">'+__e(name)+'</a><button class="retry-button" data-js-retry-button>'+__e(__("Retry"))+'</button></div><div class="message">'+(null==(__t=message)?"":__t)+"</div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(206),r=i(635),a=i(670),l=n.extend({className:"conversation-message-post",mixins:[o],template:a,defaults:{thumbnailWidth:210},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","participants","model","setRetryButtonState"))},afterRenderSubviews:function(){this.listenTo(this.model,"change:isError change:isPending",this._onModelChange),this.listenTo(this.model.get("post"),"change:summary change:state",this._onModelChange),this._startTruncateSummary()},getThumbnailAtWidth:function(t){var e,i=this.model.get("post"),n=i.getThumbnail(t);return s.isEmpty(n)?null:(e=i.getScaledDimensionsForWidth(n,t),s.extend({},n,e))},getTemplateData:function(){var t=this.model.get("post"),e=this.participants.get(this.model.get("participant")),i=this.getThumbnailAtWidth(this.get("thumbnailWidth"));return{postType:t.getType(),isDisabled:t.isDisabled(),isError:this.model.get("isError"),isPending:this.model.get("isPending"),actionString:e?t.getActionMarkup(e.get("name")):null,message:t.getMessage(),thumbnail:i,avatarUrl:e?e.getAvatarUrl():null,name:e?e.get("name"):null,blogUrl:e?e.get("url"):null,url:t.get("post_url"),postBlogName:t.get("blog_name"),postId:t.get("id")}},_startTruncateSummary:function(){s.defer(s.bind(this._truncateSummary,this))},_truncateSummary:function(){r(this.js$("summary",!0))},_onModelChange:function(){this.renderWithTemplate(),this._startTruncateSummary(),s.isFunction(this.setRetryButtonState)&&this.setRetryButtonState()}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="message-container conversation-message-post--'+__e(postType)+" "+__e(_.isEmpty(thumbnail)?"no-thumbnail":"has-thumbnail")+__e(isDisabled?" is-disabled":"")+'"><div class="avatar"><a href="'+__e(blogUrl)+'" target="_blank" data-js-tumblelog-name="'+__e(name)+'"><img src="'+__e(avatarUrl)+'"></a></div> ',isDisabled?__p+=' <div class="message-bubble" data-js-message-bubble><div class="message-bubble-header">'+__e(actionString)+"</div></div> ":(__p+=' <div class="message-bubble" data-js-message-bubble> ',_.isEmpty(url)||(__p+=' <a href="'+__e(url)+'" data-js-tumblelog-name="'+__e(postBlogName)+'" data-js-post-id="'+__e(postId)+'"> '),__p+=' <div class="message-bubble-header" data-js-summary><span class="name">'+__e(actionString)+"</span> ",_.isEmpty(message)||(__p+=' <span class="text">'+__e(message)+"</span> "),__p+=" </div> ",_.isEmpty(url)||(__p+=" </a> "),__p+=' <button class="retry-button" data-js-retry-button>'+__e(__("Retry"))+"</button></div> ",_.isEmpty(url)||(__p+=' <a href="'+__e(url)+'" data-js-tumblelog-name="'+__e(postBlogName)+'" data-js-post-id="'+__e(postId)+'" class="icon"></a> '),__p+=" "),__p+=" </div> ",_.isEmpty(thumbnail)||(__p+=' <div class="thumbnail"> ',_.isEmpty(url)||(__p+=' <a href="'+__e(url)+'" data-js-tumblelog-name="'+__e(postBlogName)+'" data-js-post-id="'+__e(postId)+'"> '),__p+=' <img src="'+__e(_.get(thumbnail,"url"))+'" width="'+__e(_.get(thumbnail,"width"))+'" height="'+__e(_.get(thumbnail,"height"))+'"> ',_.isEmpty(url)||(__p+=" </a> "),__p+=" </div> ");return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(669),o=i(672),r=i(673),a=n.extend({className:"conversation-message-safemode-post",template:r,initialize:function(t){s.extend(this,s.pick(t,"conversation")),n.prototype.initialize.apply(this,arguments)},afterRenderSubviews:function(){this.theme=new o({el:this.el,theme:this.conversation.getOtherParticipant().get("theme")}).render()}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(206),r=i(159),a=n.extend({mixins:[o,r],defaults:{removeDataAttrAfterApplyingTheme:!0},configuration:{"theme-background-color":{themeField:"background_color",applyStyle:"background-color"},"theme-accent-color":{themeField:"link_color",applyStyle:"color"},"theme-accent-color-on-white":{themeField:"link_color",unsetMissingStyle:"color",applyStyle:function(t,e,i){t.css("color",i.adjustColorForBackground(e,"#ffffff"))}},"theme-accent-color-on-grey":{themeField:"link_color",unsetMissingStyle:"color",applyStyle:function(t,e,i){t.css("color",i.adjustColorForBackground(e,"#f2f2f2"))}},"theme-accent-color-on-background":{themeField:"link_color",unsetMissingStyle:"color",applyStyle:function(t,e,i){t.css("color",i.getReadableColor(e,i.get("background_color")))}},"theme-accent-color-as-background":{themeField:"link_color",unsetMissingStyle:"background-color",applyStyle:function(t,e,i){t.css("background-color",i.adjustColorForBackground(e,"#ffffff"))}},"theme-button":{themeField:function(t){var e=t.get("background_color"),i=t.get("link_color");return s.isEmpty(e)||s.isEmpty(i)?null:{text:e,background:t.getReadableColor(i,e)}},applyStyle:function(t,e,i){t.addClass("themed"),i.getHeaderImage()||t.css({"background-color":e.background,"border-color":e.background,color:e.text})}},"theme-header-image":{themeField:function(t){return t.getHeaderImage()},applyStyle:function(t,e){t.css("background-image","url("+e+")")}},"theme-background-tint":{themeField:function(t){return t.getTintSuffix(t.getBackgroundTint())},applyStyle:function(t,e,i){t.addClass("theme-background"+e)}},"theme-background-color-or-image-class":{themeField:"background_color",applyStyle:function(t,e,i){s.isEmpty(i.getHeaderImage())?t.css("background-color",e):t.addClass("has-image")}},"theme-avatar-shape-class":{themeField:"avatar_shape",applyStyle:function(t,e){t.addClass("avatar-shape--"+e)}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"theme"))},render:function(){this.theme&&s.each(this.configuration,function(t,e){var i,n,o=t.unsetMissingStyle,r=t.applyStyle;if(i=s.isFunction(t.themeField)?t.themeField.call(this,this.theme):this.theme.get(t.themeField),n=this.js$(e),0!==n.length){if(s.isEmpty(i))return void(s.isFunction(o)?o.call(this,n,i,this.theme):s.isEmpty(o)?s.isFunction(r)||n.css(r,""):n.css(o,""));s.isFunction(r)?r.call(this,n,i,this.theme):n.css(r,i),this.get("removeDataAttrAfterApplyingTheme")&&n.removeAttr("data-js-"+e)}},this)},setTheme:function(t){return this.theme=t,this.render()}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="message-container conversation-message-post--'+__e(postType)+" "+__e(_.isEmpty(thumbnail)?"no-thumbnail":"has-thumbnail")+__e(isDisabled?" is-disabled":"")+'"><div class="avatar"><a href="'+__e(blogUrl)+'" target="_blank" data-js-tumblelog-name="'+__e(name)+'"><img src="'+__e(avatarUrl)+'"></a></div> ',__p+=isDisabled?' <div class="message-bubble" data-js-message-bubble><div class="message-bubble-header">'+__e(actionString)+"</div></div> ":' <div class="message-bubble" data-js-message-bubble><div class="message-bubble-header" data-js-summary><span class="name">'+__e(actionString)+'</span></div><div class="post-content-inner"><p><span class="message">'+__e(__("This post may contain sensitive media"))+"</span><br> "+(null==(__t=__("%1$sSafe Mode is on%2$s",'<a class="link" href="/settings/account" target="_blank" data-js-theme-accent-color>',"</a>"))?"":__t)+' </p></div><button class="retry-button" data-js-retry-button>'+__e(__("Retry"))+"</button></div> ",__p+=" </div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(155),r=i(206),a=i(191),l=i(259),h=i(675),c=o.extend({className:"conversation-message-image",mixins:[r],template:h,defaults:{thumbnailWidth:210,isBlurred:!1,blurClassName:"is-blur",unblurringClassName:"is-unblurring",errorClassName:"is-error",pendingClassName:"is-pending",blurAnimationDurationMs:300,blurMessageString:null},events:{"click [data-js-overlay-container]":"_onOverlayContainerClick"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","participants","conversation","model","setRetryButtonState","afterImageUnblur")),this.set("blurMessageString",n("Blurred because you don't follow this Tumblr yet. Click to reveal.")),this.image=this.model.getImage()},afterRenderSubviews:function(){this.listenTo(this,"change:isBlurred",this._onChangeIsBlurred),this.listenTo(this.model,"change:isPending",this._onModelIsPendingChange),this.listenTo(this.model,"change:isError",this._onModelIsErrorChange),this.listenTo(this.conversation,"change:is_blurred_images",this._onChangeConversationIsBlurredImages),this.listenTo(this.image.getAltSizes(),"update reset",this._onModelImagesUpdate),this._onChangeConversationIsBlurredImages(this.conversation,this.conversation.get("is_blurred_images")),this._onChangeIsBlurred(this,this.get("isBlurred"))},getTemplateData:function(){var t=this.image.getImageAtSize(this.get("thumbnailWidth")),e=this.getThumbnailDimensions(t),i=s.get(e,"width"),n=s.get(e,"height"),o=this.participants.get(this.model.get("participant"));return this.thumbnailUrl=this.thumbnailUrl||t.get("url"),{name:o?o.get("name"):null,avatarUrl:o?o.getAvatarUrl():null,blogUrl:o?o.get("url"):null,highResUrl:this.image.hasAltSizes()?this.image.getHighResImageUrl():null,lowResUrl:this.thumbnailUrl,thumbnailImageUrl:this.thumbnailUrl,originalWidth:this.image.getOriginalSize().get("width"),originalHeight:this.image.getOriginalSize().get("height"),thumbnailWidth:i,thumbnailHeight:n}},getThumbnailDimensions:function(t){var e=this.get("thumbnailWidth"),i=a.heightForWidth(e,t.get("width"),t.get("height"));return s.extend({},{width:e,height:i})},_onModelIsPendingChange:function(t,e){e?(this.imageLoaderView=new l({variation:"small centered",loading:e}),this.js$("image-loader-container").append(this.imageLoaderView.render().$el)):this._removeImageLoader(),this.$el.toggleClass(this.get("pendingClassName"),e)},_onModelIsErrorChange:function(t,e){this.$el.toggleClass(this.get("errorClassName"),e)},_removeImageLoader:function(){this.imageLoaderView&&this.imageLoaderView.remove()},_onModelImagesUpdate:function(){this.renderWithTemplate(),this._toggleBlurred(this.get("isBlurred")),s.isFunction(this.setRetryButtonState)&&this.setRetryButtonState()},_toggleBlurred:function(t){var e=this.get("unblurringClassName"),i=this.js$("overlay-text",!0),n=!t&&this.previous("isBlurred"),o=this.get("blurClassName");this.$el.toggleClass(o,t).toggleClass(e,n),t?i.text(this.get("blurMessageString")):n||i.empty(),this._unblurTimer&&clearTimeout(this._unblurTimer),n&&(this._unblurTimer=s.delay(s.bind(function(){this.rendered&&(i.empty(),this.$el.removeClass(e),delete this._unblurTimer)},this),this.get("blurAnimationDurationMs")))},_onChangeIsBlurred:function(t,e){this._toggleBlurred(e)},_onChangeConversationIsBlurredImages:function(t,e){this.set("isBlurred",e&&t.shouldBlurImageMessage(this.model))},_onOverlayContainerClick:function(t){this.get("isBlurred")&&(t.preventDefault(),t.stopImmediatePropagation(),this.set("isBlurred",!1),s.isFunction(this.afterImageUnblur)&&this.afterImageUnblur(this.model))}});t.exports=c},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="message-container has-thumbnail"><div class="avatar"><a href="'+__e(blogUrl)+'" target="_blank" data-js-tumblelog-name="'+__e(name)+'"><img src="'+__e(avatarUrl)+'"></a></div><div class="message-bubble" data-js-message-bubble><button class="retry-button" data-js-retry-button>'+__e(__("Retry"))+"</button> ",_.isEmpty(highResUrl)||_.isEmpty(lowResUrl)||(__p+=' <a href="'+__e(highResUrl)+'" data-js-lightbox-url="'+__e(highResUrl)+'" data-js-lightbox-width="'+__e(originalWidth)+'" data-js-lightbox-height="'+__e(originalHeight)+'" data-js-lightbox-lowres-url="'+__e(lowResUrl)+'"> '),__p+=' <div class="thumbnail" data-js-thumbnail><div class="conversation-image-loader" data-js-image-loader-container></div><img data-js-message-image src="'+__e(thumbnailImageUrl)+'" width="'+__e(thumbnailWidth)+'" height="'+__e(thumbnailHeight)+'"><div class="overlay" data-js-overlay-container><p class="text" data-js-overlay-text></p></div></div> ',_.isEmpty(highResUrl)||_.isEmpty(lowResUrl)||(__p+=" </a> "),__p+=" </div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(677),r=n.extend({className:"conversation-message-timestamp",template:o,initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus"))},getTemplateData:function(){return{label:this.model.get("tsHeader")}}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div data-js-label class="inline-activity timestamp">'+__e(label)+"</div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(206),r=i(679),a=n.extend({className:"conversation-message-sticker message-container",mixins:[o],template:r,defaults:{thumbnailWidth:210,rawWidth:1280,errorClassName:"is-error"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","participants","conversation"))},afterRenderSubviews:function(){this.listenTo(this.model,"change:isError",this._onModelIsErrorChange)},getTemplateData:function(){var t=this.model.toJSON(),e=t.sticker.original_size_url,i=t.sticker.url,s=this.participants.get(this.model.get("participant"));return{name:s?s.get("name"):null,avatarUrl:s?s.getAvatarUrl():null,blogUrl:s?s.get("url"):null,rawUrl:e?e:null,url:i?i:null,thumbnailWidth:this.get("thumbnailWidth"),rawWidth:this.get("rawWidth")}},_onModelIsErrorChange:function(t){this.$el.toggleClass(this.get("errorClassName"),t)}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="message-container has-thumbnail"><div class="avatar"><a href="'+__e(blogUrl)+'" target="_blank" data-js-tumblelog-name="'+__e(name)+'"><img src="'+__e(avatarUrl)+'"></a></div><div class="message-bubble" data-js-message-bubble><button class="retry-button" data-js-retry-button>'+__e(__("Retry"))+"</button> ",_.isEmpty(rawUrl)||(__p+=' <a href="'+__e(rawUrl)+'" data-js-lightbox-url="'+__e(rawUrl)+'" data-js-lightbox-width="'+__e(rawWidth)+'" data-js-lightbox-height="'+__e(rawWidth)+'" data-js-lightbox-lowres-url="'+__e(url)+'"> '),__p+=' <div class="thumbnail" data-js-thumbnail><img data-js-message-image src="'+__e(url)+'" width="'+__e(thumbnailWidth)+'"></div> ',_.isEmpty(rawUrl)||(__p+=" </a> "),__p+=" </div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(155),r=i(206),a=i(681),l=o.extend({className:"conversation-pill hide-pill",template:a,mixins:[r],events:{"click [data-js-unread-button]":"_onClick"},defaults:{count:0,maxCount:99},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus"))},afterRender:function(){this.listenTo(this,"change:count",this._onChangeCount),this._onChangeCount(this,this.get("count"))},setCount:function(t){this.set("count",s.isFinite(t)?t:0)},getCount:function(){return this.get("count")},getTitle:function(t){var e,i;return s.isFinite(t)?(e=this.get("maxCount"),i=t>e?e+"+":t,t>1?n("%1$s unread messages",i):n("%1$s unread message",i)):null},getTemplateData:function(){return{title:this.getTitle(this.get("count"))}},_onChangeCount:function(t,e){var i=this.getTitle(e);this.$el.toggleClass("hide-pill",0===e||s.isEmpty(i)),e>0&&this.js$("unread-button").text(i)},_onClick:function(t){t.preventDefault(),this.trigger("click")}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<button tabindex="-1" data-js-theme-button data-js-unread-button class="unread-button">'+__e(title)+"</button>";return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="conversation-pagination-loader" data-js-loader-container><div data-subview="paginationLoaderView"></div></div><div data-js-header></div><div data-subview="messagesView[]" class="message-list"></div><div data-subview="pillView"></div><div data-js-footer></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(684),r=n.extend({className:"conversation-message-error",template:o,defaults:{message:null,showErrorIconClass:"show-icon",showErrorIcon:!1,actionText:null},events:{"click [data-js-action]":"_onClickAction"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","actionCallback"))},getTemplateData:function(){return{message:this.get("message"),actionText:this.get("actionText")}},afterRender:function(){this.$el.toggleClass(this.get("showErrorIconClass"),this.get("showErrorIcon"))},_onClickAction:function(t){t.preventDefault(),s.isFunction(this.actionCallback)&&this.actionCallback()}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="message"> '+__e(message)+" ",_.isEmpty(actionText)||(__p+=' <span class="action-container"><a href="#" data-js-action class="action">'+__e(actionText)+"</a></span> "),__p+=" </div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(155),r=i(206),a=i(191),l=i(686),h=i(164),c=i(687),u=o.extend({className:"conversation-preview",template:l,mixins:[r],events:{"click [data-js-image-container]":"_onImageContainerClick","click [data-js-preview-remove]":"_onClickPreviewRemove"},defaults:{isVisible:!1,isEditable:!1,maxHeight:150,maxWidth:210,animateInDurationMs:300,animateOutDurationMs:200,animateInEasing:[.22,.685,.03,.895],animateOutEasing:[.895,.03,.685,.22]},afterRender:function(){this.listenTo(this,"change:isVisible",this._onChangeIsVisible),this.listenTo(this,"change:isEditable",this._onChangeIsEditable),this._onChangeIsVisible(this,this.get("isVisible")),this._onChangeIsEditable(this,this.get("isEditable"))},hasImage:function(){return!n.isEmpty(this.previewImageModel)},addImage:function(t){var e=t.get("height"),i=t.get("width"),s=this.get("maxHeight"),o=this.get("maxWidth"),r=a.maxSize(i,e,o,s),l=this.js$("image-container");return this.previewImageView&&this.previewImageView.remove(),this.previewImageView=new c({src:t.get("url"),width:n.get(r,"width"),height:n.get(r,"height")}),l.append(this.previewImageView.render().$el),this.set("isVisible",!0),this.set("isEditable",n.isFunction(t.get("editCallback"))),this.previewImageModel=t,this._slideElement(l)},_slideElement:function(t,e){var i=new s.Deferred,o=t.height(),r=t.offset().top-this.$el.offset().top,a=o+r;return h.animate(t,{translateY:e?[a,0]:[0,a]},{duration:e?this.get("animateOutDurationMs"):this.get("animateInDurationMs"),easing:e?this.get("animateOutEasing"):this.get("animateInEasing"),complete:n.bind(function(){i.resolve(),t.css("transform","")},this)}),i},getMessage:function(){return n.isEmpty(this.previewImageModel)?null:this.previewImageModel.get("message")},close:function(){return this.trigger("closing",this.previewImageModel),this._slideElement(this.js$("image-container"),!0).then(n.bind(this._onAfterCloseAnimation,this))},_onAfterCloseAnimation:function(){var t=this.previewImageModel;this.previewImageView.remove(),delete this.previewImageModel,delete this.previewImageView,this.set("isVisible",!1),this.trigger("close",t)},_onImageContainerClick:function(t){var e,i=this.previewImageModel;this.get("isEditable")&&!n.isEmpty(i)&&(e=i.get("editCallback"),n.isFunction(e)&&(t.preventDefault(),e(t),this.trigger("edit",i)))},_onClickPreviewRemove:function(t){t.preventDefault(),t.stopPropagation(),this.trigger("dismiss",this.previewImageModel),this.close()},_onChangeIsVisible:function(t,e){this.$el.toggle(e)},_onChangeIsEditable:function(t,e){this.$el.toggleClass("editable",e)}});t.exports=u},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="conversation-preview-image-container" data-js-image-container><a href="#" class="conversation-preview-remove" data-js-preview-remove>'+__e(__("Remove"))+"</a></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(688),r=n.extend({className:"conversation-preview-image",template:o,defaults:{width:null,height:null,src:null,context:null,loggingData:null},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults)))}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<img src="'+__e(src)+'" width="'+__e(width)+'" height="'+__e(height)+'" alt="'+__e(__("GIF"))+'">';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(164),o=i(100),r=i(206),a=i(161),l=i(155),h=i(690),c=i(650),u=i(691),d=l.extend({className:"conversation-compose",template:u,mixins:[r,a],events:{"click [data-js-submit-button]":"_onSubmitButtonClick","input [data-js-text-input]":"_onTextInputChange","keydown [data-js-text-input]":"_onTextInputKeydown","focus [data-js-text-input]":"_onTextInputFocus","blur [data-js-text-input]":"_onTextInputBlur","paste [data-js-text-input]":"_onTextInputPaste"},keycommands:{"keydown:escape":"_onKeyPressEscape"},defaults:{isValid:!0,isDisabled:!1,isOffline:!1,placeholder:null,offlinePlaceholder:null,currentPlaceholder:null,currentText:null,hasEditorFocus:!1,isAutoValidationEnabled:!0,buttonSubmittedClass:"submitted",hideComposePluginsClass:"hide-compose-plugins-container",hidingComposePluginsClass:"hiding-compose-plugins-container",isShufflePlaceholder:!0,isPluginsVisible:!0,composeAnimationSpeed:200,pluginAnimateInDurationMs:200,pluginAnimateOutDurationMs:300,pluginAnimateInEasing:[.895,.03,.685,.22],pluginAnimateOutEasing:[.22,.685,.03,.895],isLightboxOpen:!1},subviews:{composePluginsView:{constructor:h,options:function(t){return{pluginsArray:t.pluginsArray,isStickersEnabled:t.isStickersEnabled}}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","keyboardManager","keyboardNamespace","pluginsArray","isGifSearchEnabled","isStickersEnabled")),this.getRandomPlaceholder=c([o("New message"),o("Your message here"),o("Write a message"),o("Say something"),o("Say your thing")]),s.isEmpty(this.pluginsArray)&&this.hideComposePluginsView(!0),this.set("isShufflePlaceholder",s.isEmpty(this.get("placeholder"))),s.isEmpty(this.get("placeholder"))&&this.set("placeholder",this.getRandomPlaceholder()),this.set("currentPlaceholder",this.get("placeholder")),s.isEmpty(this.get("offlinePlaceholder"))&&this.set("offlinePlaceholder",o("Currently offline")),this.keyboardManager&&this.disableKeys()},afterRenderSubviews:function(){this.listenTo(this,"change:isValid",this._onChangeIsValid),this.listenTo(this,"change:isDisabled",this._onChangeIsDisabled),this.listenTo(this,"change:isOffline",this._onChangeIsOffline),this.listenTo(this,"change:currentPlaceholder",this._onChangeCurrentPlaceholder),this.listenTo(this,"change:currentText",this._onChangeCurrentText),this.listenTo(this,"change:hasEditorFocus",this._onChangeHasEditorFocus),this.listenTo(this,"change:isAutoValidationEnabled",this._onChangeIsAutoValidationEnabled),this.listenTo(this.composePluginsView,"plugin:preview:add:image",this._onComposePluginPreviewAddImage),this.listenTo(this.composePluginsView,"plugin:click",this._onComposePluginClick),
  this._onChangeIsValid(this,this.get("isValid")),this._onChangeIsDisabled(this,this.get("isDisabled")),this._onChangeIsOffline(this,this.get("isOffline")),this._onChangeCurrentPlaceholder(this,this.get("currentPlaceholder")),this._onChangeCurrentText(this,this.get("currentText")),this._setValidState(),s.defer(s.bind(function(){this._resizeInput()},this))},getTemplateData:function(){return{placeholder:this.get("placeholder")}},hideComposePluginsView:function(t){var e,i=this.get("hideComposePluginsClass"),o=this.get("hidingComposePluginsClass");if(this.get("isPluginsVisible")){if(this.set("isPluginsVisible",!1),t)return void this.$el.addClass(i);this.$el.addClass(o),this._resizeInput(),e=this.composePluginsView.$el.outerWidth(),n.animate(this.$el,{marginLeft:[-e,0]},{duration:this.get("pluginAnimateOutDurationMs"),easing:this.get("pluginAnimateOutEasing"),complete:s.bind(function(){this._resizeInput(),this.$el.css("marginLeft","").addClass(i).removeClass(o)},this)})}},showComposePluginsView:function(t){var e,i=this.get("hideComposePluginsClass");if(!this.get("isPluginsVisible")){if(this.set("isPluginsVisible",!0),t)return void this.$el.removeClass(i);e=this.composePluginsView.$el.outerWidth(),this.$el.css("margin-left",-e).removeClass(i),this._resizeInput(),n.animate(this.$el,{marginLeft:[0,-e]},{duration:this.get("pluginAnimateInDurationMs"),easing:this.get("pluginAnimateInEasing"),complete:s.bind(function(){this._resizeInput(),this.$el.css("marginLeft","")},this)})}},toggle:function(t){this.$el.toggle(t),t&&this.$el.css("display","")},submit:function(t){var e=this.get("currentText");this.get("isValid")&&!this.get("isDisabled")&&(this.trigger("submit",e,t),this._startAnimation(s.bind(function(){this.trigger("submit:animated",e,t)},this)),this.clear())},escape:function(){this.get("isLightboxOpen")||(s.isEmpty(this.get("currentText"))?this.trigger("close"):this.clear())},clear:function(){this.js$("text-input").val(""),this.set("currentText",""),this.get("isShufflePlaceholder")&&this._setPlaceholderState(),this._resizeInput()},focus:function(){s.defer(s.bind(function(){this.rendered&&this.js$("text-input").focus()},this))},getMessage:function(){return this.js$("text-input").val()},setPlaceholder:function(t){this.set({placeholder:t,isShufflePlaceholder:!1}),this._setPlaceholderState()},beforeRemove:function(){this.keyboardManager&&this.keyboardManager.remove(this.keyboardNamespace)},toggleAutoValidation:function(t){this.set("isAutoValidationEnabled",t)},_onComposePluginPreviewAddImage:function(t){this.trigger("plugin:preview:add:image",t)},_onComposePluginClick:function(t){this.trigger("plugin:click",t)},_onKeyPressEscape:function(t){t.preventDefault(),this.escape()},_onTextInputChange:function(){var t=s.trim(this.js$("text-input").val());this._resizeInput(),this.set("currentText",t),this.trigger("input",t,this)},_setValidState:function(){return this.get("isAutoValidationEnabled")?void this.set("isValid",!s.isEmpty(this.get("currentText"))):void this.set("isValid",!0)},_resizeInput:function(){var t,e=this.js$("text-input"),i=e.get(0);this._originalInputHeight||(this._originalInputHeight=e.outerHeight()),this.$el.css("height",this.$el.height()),e.css("height","auto"),t=i.scrollHeight,Math.abs(t-this._originalInputHeight)<5&&(t=this._originalInputHeight),e.css("height",t),this.$el.css("height",""),this._detectResize()},_detectResize:function(){var t=this.$el.height();return this._previousHeight?void(t!==this._previousHeight&&(this.trigger("resize",t),this._previousHeight=t)):void(this._previousHeight=t)},_startAnimation:function(t){var e=this.js$("submit-button"),i=this.get("buttonSubmittedClass");return s.isEmpty(i)?void(s.isFunction(t)&&t.call(this)):(e.addClass(i),void s.delay(s.bind(function(){e.removeClass(i),s.isFunction(t)&&t.call(this)},this),this.get("composeAnimationSpeed")))},_setPlaceholderState:function(){this.set("currentPlaceholder",this.get("isShufflePlaceholder")?this.getRandomPlaceholder():this.get("placeholder"))},_onChangeCurrentText:function(t,e){this._setValidState()},_onChangeIsValid:function(t,e){this.js$("submit-button").prop("disabled",!e||this.get("isDisabled"))},_onSubmitButtonClick:function(t){t.preventDefault(),this.submit("button")},_onChangeIsDisabled:function(t,e){this.js$("text-input").prop("disabled",e),this.js$("submit-button").prop("disabled",e||!this.get("isValid")),this.composePluginsView.toggleDisabled(e)},_onChangeIsOffline:function(t,e){e?(this.set("previousPlaceholder",this.get("placeholder")),this.set("currentPlaceholder",this.get("offlinePlaceholder"))):this.set("currentPlaceholder",this.get("previousPlaceholder"))},_onChangeCurrentPlaceholder:function(t,e){this.js$("text-input").attr("placeholder",e)},_onTextInputFocus:function(){this.set("hasEditorFocus",!0),this.trigger("focus",this)},_onTextInputBlur:function(){this.set("hasEditorFocus",!1),this.trigger("blur",this)},_onTextInputPaste:function(t){var e,i,n=s.get(t,"originalEvent.clipboardData.items",[]),o=s.filter(n,{kind:"file"});this.get("isDisabled")||0!==o.length&&(e=s.last(o),e&&(i=s.result(e,"getAsFile"),this.trigger("pasteBlob",i)))},_onTextInputKeydown:function(t){13!==t.keyCode||t.shiftKey||(this.submit("keyboard"),t.preventDefault())},_onChangeHasEditorFocus:function(t,e){this.keyboardManager&&this.keyboardManager.toggle(this.keyboardNamespace,t,e)},_onChangeIsAutoValidationEnabled:function(t,e){this._setValidState()}});t.exports=d},function(t,e,i){"use strict";var s=i(3),n=i(155),o=n.extend({className:"conversation-compose-plugins-container",mixins:[],renderWithTemplate:s.noop,defaults:{isDisabled:!1},initialize:function(t){t=s.extend({},t),s.extend(this,s.pick(t,"pluginsArray"))},afterRender:function(){this.listenTo(this,"change:isDisabled",this._onChangeIsDisabled),s.each(this.pluginsArray,s.bind(this._addPluginView,this)),this._onChangeIsDisabled(this,this.get("isDisabled"))},toggleDisabled:function(t){this.set("isDisabled",t)},_addPluginView:function(t){t.render(),this.$el.append(t.el),this.listenTo(t,"preview:add:image",this._onPluginViewPreviewAddImage),this.listenTo(t,"click",this._onPluginViewClick)},_onPluginViewPreviewAddImage:function(t){this.trigger("plugin:preview:add:image",t)},_onPluginViewClick:function(t){this.trigger("plugin:click",t)},_onChangeIsDisabled:function(t,e){s.each(this.pluginsArray,s.bind(function(t){t.toggleDisabled(e)}),this)}});t.exports=o},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div data-subview="composePluginsView" class="compose-plugins-container"></div><div class="compose-text-input-container"><div class="text-input-container"><textarea class="text-input" placeholder="'+__e(placeholder)+'" rows="1" maxlength="4096" data-js-text-input></textarea></div><div class="submit-button"><button type="submit" data-js-submit-button data-js-theme-accent-color-on-white class="submit">'+__e(__("Send"))+"</button></div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(206),r=i(693),a=n.extend({className:"conversation-minimized",tagName:"a",attributes:{href:"#"},template:r,mixins:[o],events:{click:"_onClick"},defaults:{maxBadgeCount:99,activeBadgeClass:"tab-notice--active",newMessageClass:"new-message"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus"))},getTemplateData:function(){var t=this.model.getOtherParticipant();return{blogName:t?t.get("name"):null,avatarUrl:t?t.getAvatarUrl():null}},afterRender:function(){this.listenTo(this.model,"change:unreadCount",this._onChangeUnreadCount),this.listenTo(this.model,"sync",this._onConversationSync)},updateBadge:function(t){var e=this.get("maxBadgeCount"),i=this.get("activeBadgeClass");t>0&&this.js$("badge-value").text(t>e?e+"+":t),this.js$("badge").toggleClass(i,t>0)},animate:function(){var t=this.get("newMessageClass");this.$el.addClass(t),s.delay(s.bind(function(){this.$el.removeClass(t)},this),250)},focus:function(){this.$el.focus()},blur:function(){this.$el.blur()},_onChangeUnreadCount:function(t,e){this.updateBadge(e),e>0&&this.animate()},_onConversationSync:function(t){this.renderWithTemplate()},_onClick:function(t){t.preventDefault(),this.blur(),this.trigger("click")}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="avatar"><img src="'+__e(avatarUrl)+'" title="'+__e(blogName)+'"></div><div class="conversation-minimized-badge tab_notice tab-notice--outlined" data-js-badge><span class="tab_notice_value" data-js-badge-value>2</span></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(155),r=i(206),a=i(695),l=o.extend({className:"conversation-error",mixins:[r],template:a,defaults:{message:null,isLoading:!1,showButton:!0,buttonText:null,buttonTextLoading:null,buttonTextCurrent:null},events:{"click [data-js-button]":"_onClickButton"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","buttonCallback")),s.isEmpty(this.get("message"))&&this.set("message",n("Something went screwy.")),s.isEmpty(this.get("buttonText"))&&this.set("buttonText",n("Retry")),s.isEmpty(this.get("buttonTextLoading"))&&this.set("buttonTextLoading",n("Retrying...")),s.isEmpty(this.get("buttonTextCurrent"))&&this.set("buttonTextCurrent",this.get("buttonText"))},afterRender:function(){this.listenTo(this,"change:isLoading",this._onChangeIsLoading),this.listenTo(this,"change:buttonTextCurrent",this._onChangeButtonTextCurrent),this.listenTo(this,"change:showButton",this._onChangeShowButton),this._onChangeIsLoading(this,this.get("isLoading")),this._onChangeShowButton(this,this.get("showButton"))},getTemplateData:function(){return{message:this.get("message"),buttonText:this.get("buttonTextCurrent")}},_onClickButton:function(t){t.preventDefault(),this.get("isLoading")||(this.set("isLoading",!0),this.trigger("buttonClick"),s.isFunction(this.buttonCallback)&&this.buttonCallback.call(this,this))},_onChangeIsLoading:function(t,e){var i=e?this.get("buttonTextLoading"):this.get("buttonText");this.set("buttonTextCurrent",i),this.js$("button").toggleClass("disabled",e).prop("disabled",e)},_onChangeButtonTextCurrent:function(t,e){this.js$("button").text(e)},_onChangeShowButton:function(t,e){this.js$("button").toggle(e)}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="content"><label>'+__e(message)+'</label><button data-js-theme-button data-js-button class="chrome">'+__e(buttonText)+"</button></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(155),r=i(212),a=i(697),l=o.extend({className:"popover--conversation-actions info_popover popover_gradient popover",mixins:[r],initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"viewOptions")),this.view=new a(this.viewOptions)},render:function(){return this.$wrapper=n("<div />").addClass("popover-inner popover_inner").appendTo(this.$el),this.$wrapper.html(this.view.render().$el),this},teardown:function(){return this.remove()},getView:function(){return this.view}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(155),r=i(698),a=o.extend({className:"conversation-actions",tagName:"ul",template:r,events:{"click [data-js-block-blogname]":"_onBlockClick","click [data-js-delete-conversation]":"_onDeleteConversationClick"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","user","participants")),this.blockableParticipants=this.participants.getWithout(this.user.channels.pluck("uuid"))},getTemplateData:function(){return{blockableParticipants:s.invoke(this.blockableParticipants,"toJSON")}},_onBlockClick:function(t){var e=n(t.currentTarget),i=e.attr("data-js-block-blogname");t.preventDefault(),s.isEmpty(i)||this.trigger("block",i)},_onDeleteConversationClick:function(t){t.preventDefault(),this.trigger("delete")}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<li><a class="external-link" href="/settings/dashboard">'+__e(__("Sound settings"))+'</a></li><li><a href="#" data-js-delete-conversation>'+__e(__("Delete conversation"))+"</a></li> ",_.each(blockableParticipants,function(t){__p+=' <li><a href="#" data-js-block-blogname="'+__e(t.name)+'">'+__e(__("Block %1$s",t.name))+"</a></li> "});return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(9),r=i(155),a=i(206),l=i(284),h=i(635),c=i(672),u=i(700),d=s.template('<a href="<%- blogUrl %>/tagged/<%- tag %>" data-js-tumblelog-name="<%- blogName %>" data-js-tumblelog-tag="<%- tag %>">'),p=r.extend({className:"conversation-icebreakers",template:u,mixins:[a],defaults:{isShowTags:!0,isShowRelationship:!0,isShowDescription:!0},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"eventBus","participant"))},getTemplateData:function(){return{description:this.get("isShowDescription")?this._getCleanDescriptionString():null,relationship:this.get("isShowRelationship")?this._getRelationshipString():null,tagsMarkup:this.get("isShowTags")?this._getTagsDescriptionMarkup():null,name:this.participant.get("name"),avatarUrl:this.participant.getAvatarUrl(),url:this.participant.get("url")}},afterRender:function(){this.theme=new c({el:this.el,theme:this.participant.get("theme")}).render(),this.get("isShowDescription")&&s.defer(s.bind(function(){h(this.js$("description"))},this))},_getOpeningTagAnchor:function(t){var e=this.participant.get("name"),i=this.participant.get("url");return d({blogUrl:i,blogName:e,tag:t})},_getClosingTagAnchor:function(){return"</a>"},_getOpeningTagText:function(){return'<span class="text">'},_getClosingTagText:function(){return"</span>"},_getTagsDescriptionMarkup:function(){var t=this.participant.getBlogTags(),e=this._getOpeningTagText(),i=this._getClosingTagText(),o=this._getClosingTagAnchor();return t.length>1?n("%1$sPosts about%2$s %3$s#%4$s%5$s %6$sand%7$s %8$s#%9$s%10$s",e,i,this._getOpeningTagAnchor(t[0]),s.escape(t[0]),o,e,i,this._getOpeningTagAnchor(t[1]),s.escape(t[1]),o):1===t.length?n("%1$sPosts about%2$s %3$s#%4$s%5$s",e,i,this._getOpeningTagAnchor(t[0]),s.escape(t[0]),o):null},_getCleanDescriptionString:function(){return l.stripTags(this.participant.getDescription())},_getRelationshipString:function(){var t;if(this.participant.isMutuals()){if(t=this._getRelativeTimeString(this.participant.getDurationMutualsSeconds()),!s.isEmpty(t))return n("Mutuals for %1$s",t)}else if(this.participant.isFollowingYou()){if(t=this._getRelativeTimeString(this.participant.getDurationFollowingYouSeconds()),!s.isEmpty(t))return n("Followed you %1$s ago",t)}else if(this.participant.isFollowing()&&(t=this._getRelativeTimeString(this.participant.getDurationFollowingSeconds()),!s.isEmpty(t)))return n("Following for %1$s",t);return n("Not following each other")},_getRelativeTimeString:function(t){return s.isNumber(t)?o(Date.now()-1e3*t).fromNow(!0):null}});t.exports=p},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<a class="avatar" href="'+__e(url)+'" target="_blank" data-js-tumblelog-name="'+__e(name)+'" data-js-theme-avatar-shape-class><img src="'+__e(avatarUrl)+'"></a><div class="name"><a href="'+__e(url)+'" target="_blank" data-js-tumblelog-name="'+__e(name)+'">'+__e(name)+"</a></div> ",_.isEmpty(description)||(__p+=' <div class="description" data-js-description><a href="'+__e(url)+'" target="_blank" data-js-tumblelog-name="'+__e(name)+'"> '+__e(description)+" </a></div> "),__p+=" ",_.isEmpty(relationship)||(__p+=' <div class="relationship">'+__e(relationship)+"</div> "),__p+=" ",_.isEmpty(tagsMarkup)||(__p+=' <div class="tags">'+(null==(__t=tagsMarkup)?"":__t)+"</div> ");return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(365),r=i(702),a=i(704),l=i(607),h=i(705),c=r.extend({className:"conversation-compose-plugin conversation-compose-plugin--gif-search",template:h,defaults:n.defaults({selectedGif:null,query:"",resultLimit:200,resultImageWidth:250},r.prototype.defaults),events:{click:"_onClick"},initialize:function(t){t=n.extend({},t),n.extend(this,n.pick(t,"collection")),this.popoverOptions={collection:this.collection,query:this.get("query"),resultLimit:this.get("resultLimit"),imageWidth:this.get("resultImageWidth"),loggingContext:this.getName(),loadFullImageBeforeSelect:!1,autoTeardown:!0,teardownOnEscape:!0,pinnedTarget:this.$el,pinnedSide:"top",isFixedPosition:!0}},getName:function(){return"messaging-gif"},onEdit:function(t,e,i){var n,o,r;this.$el.is(":visible")||(o=s(i.currentTarget),r=o.height(),n={pinnedTarget:o,shift:{x:0,y:Math.ceil(r*-.8)}}),this._openGifSearchPopover(t,e,n)},_onClick:function(t){t.preventDefault(),this._openGifSearchPopover(this.get("query")),this.trigger("click",this)},_openGifSearchPopover:function(t,e,i){var s;this.gifSearchPopover&&this._closePopover(),s=n.extend({},this.popoverOptions,i,{query:t,selectedImageUrl:e}),this.gifSearchPopover=new o(s),this.gifSearchPopover.render(),this.toggleActive(!0),this.listenToOnce(this.gifSearchPopover,"close",this._onGifSearchPopoverClose),this.listenToOnce(this.gifSearchPopover,"selectImage",this._onGifSearchPopoverSelectImage),this.listenTo(this.collection,"search",function(t){this.set("query",t)})},_closePopover:function(){this.stopListening(this.gifSearchPopover),this.stopListening(this.collection),this.gifSearchPopover.teardown(),this.toggleActive(!1)},_onGifSearchPopoverSelectImage:function(t){var e,i,s,o,r,h,c,u=n.get(t,"postId"),d=n.get(t,"postBlogUuid"),p=this.get("resultImageWidth"),g=this.getName();n.isEmpty(u)||n.isEmpty(d)||(s=n.get(t,"mediaUrl",""),r=n.get(t,"width"),h=n.get(t,"height"),c=this.get("query"),o=s.replace(/_\d+\./,"_"+p+"."),e=l.createImagePostMessage(u,d,o,r,h,{context:g,loggingData:{query:c}}),i=new a({url:o,width:r,height:h,message:e,context:g,editCallback:n.bind(n.partial(this.onEdit,c,s),this),loggingData:{query:c,postId:u,postBlogUuid:d}}),this.addToImagePreview(i),this._closePopover())},_onGifSearchPopoverClose:function(){this._closePopover()}});t.exports=c},function(t,e,i){"use strict";var s=i(703),n=s.extend({tagName:"button",attributes:{"data-js-theme-accent-color-on-white":!0},afterRender:function(){this.listenTo(this,"change:isActive",this._onChangeIsActive),this.listenTo(this,"change:isDisabled",this._onChangeIsDisabled),this._onChangeIsActive(this,this.get("isActive")),this._onChangeIsDisabled(this,this.get("isDisabled"))},_onChangeIsActive:function(t,e){this.$el.toggleClass("active",e)},_onChangeIsDisabled:function(t,e){this.$el.prop("disabled",e)}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(155),o=n.extend({defaults:{isDisabled:!1,isActive:!1},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults)))},getName:function(){return null},addToImagePreview:function(t){this.trigger("preview:add:image",t)},toggleActive:function(t){this.set("isActive",t)},toggleDisabled:function(t){this.set("isDisabled",t)}});t.exports=o},function(t,e,i){"use strict";var s=i(113),n=s.extend({defaults:{message:null,url:null,width:null,height:null,editCallback:null}});t.exports=n},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+=__e(__("Add GIF"));return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(8),r=i(206),a=i(188),l=i(189),h=i(142),c=i(702),u=i(704),d=i(607),p=i(707),g=c.extend({className:"conversation-compose-plugin conversation-compose-plugin--image-upload",template:p,mixins:[r],defaults:s.defaults({isFilePickerOpen:!1},c.prototype.defaults),events:{click:"_onClick",focus:"_onFocus","change [data-js-file-picker]":"_onFilePickerChange","click [data-js-file-picker]":"_onFilePickerClick"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,"imageUploadMaxBytes"))},getName:function(){return"messaging-image-upload"},afterRender:function(){this.listenTo(this,"change:isFilePickerOpen",this._onChangeIsFilePickerOpen),c.prototype.afterRender.apply(this,arguments)},addImageFile:function(t,e){var i,o,r=this.get("imageUploadMaxBytes"),c=Math.floor(r/1048576);return t?s.get(t,"type","").match(/image\/(jpg|jpeg|png|gif)/i)?s.get(t,"size")>r?void h.alert(n("Image must be smaller than %1$sMB",c)):void l.read(t).then(s.bind(function(r){a.load(r.objectUrl||r.base64).then(s.bind(function(n){var r=s.get(n,"src"),a=s.get(n,"width"),l=s.get(n,"height");o=d.createImageMessage(r,t,a,l,{context:this.getName(),loggingData:{imageSource:e}}),i=new u({url:r,file:t,width:a,height:l,message:o,context:this.getName(),editCallback:s.bind(this.onEdit,this),loggingData:{imageSource:e}}),this.addToImagePreview(i)},this),s.bind(function(){h.alert(n("Something about that file is off. Try sending something else."))},this))},this)):void h.alert(n("Invalid file type.")):void 0},_openFilePicker:function(){this.$el.focus(),this.set("isFilePickerOpen",!0),this.js$("file-picker").click()},onEdit:function(){this._openFilePicker()},_onFilePickerChange:function(t){var e=s.first(o(t.target).prop("files"));this.set("isFilePickerOpen",!1),this.js$("file-picker").val(""),this.addImageFile(e,"filesystem")},_onFilePickerClick:function(t){t.stopPropagation()},_onClick:function(t){this._openFilePicker(),this.trigger("click",this)},_onFocus:function(){this.set("isFilePickerOpen",!1)},_onChangeIsFilePickerOpen:function(t,e){this.toggleActive(e)}});t.exports=g},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+=__e(__("Add Photo"))+' <input type="file" class="input-file-picker" data-js-file-picker name="messaging-photo" accept="image/*" tabindex="-1">';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(206),o=i(704),r=i(607),a=i(702),l=i(709),h=i(719),c=a.extend({className:"conversation-compose-plugin conversation-compose-plugin--stickers",template:h,mixins:[n],defaults:s.defaults({},a.prototype.defaults),events:{click:"_onClick"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t)),this.popoverOptions={autoTeardown:!0,teardownOnEscape:!0,pinnedTarget:this.$el,pinnedSide:"top",isFixedPosition:!0}},getName:function(){return"messaging-stickers"},onEdit:function(){this._openStickersPopover()},_openStickersPopover:function(){this.stickersPopover&&this._closePopover(),this.stickersPopover=new l(this.popoverOptions),this.stickersPopover.render(),this.toggleActive(!0),this.listenToOnce(this.stickersPopover,"close",this._onCloseStickersPopover),this.listenToOnce(this.stickersPopover,"stickers:select:sticker",this._onSelectStickersPopover)},_onClick:function(t){t.preventDefault(),this._openStickersPopover(),this.trigger("click",this)},_closePopover:function(){this.stopListening(this.stickersPopover),this.stickersPopover.teardown(),this.toggleActive(!1)},_onCloseStickersPopover:function(){this._closePopover()},_onSelectStickersPopover:function(t,e){var i=void 0,n=void 0,a=t.toJSON(),l=a.id,h=a.sticker_pack_id,c=a.url,u=a.original_size_url,d=250,p={stickerId:l,stickerPackId:h};i=r.createStickerMessage(l,c,u,{context:this.getName(),loggingData:p}),n=new o({url:c,width:d,height:d,message:i,context:this.getName(),editCallback:s.bind(this.onEdit,this),loggingData:p}),this.addToImagePreview(n),this._closePopover()}});t.exports=c},function(t,e,i){"use strict";var s=i(155),n=i(212),o=i(710),r=s.extend({className:"popover--stickers",mixins:[n],initialize:function(t){this.stickers=new o,this.listenTo(this.stickers,"all",this.trigger)},render:function(){this.stickers.render().$el.appendTo(this.$el)},teardown:function(){return this.$el.remove(),this}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(7),o=i(143),r=i(711),a=i(712),l=i(713),h=function(){};h.extend=n.Model.extend,s.extend(h.prototype,n.Events);var c=new h,u=o.extend({name:"Stickers",defaults:{selectedStickerPack:null},initialize:function(t){t=s.extend({},t);var e=s.get(this.data,"stickers",[]);this.stickers=new r(this._createStickerModels(e)),this.eventBus=c;var i=s.extend({eventBus:this.eventBus,stickers:this.stickers},t);this.view=new l(i),this.listenTo(this.eventBus,"select:sticker",this._onSelectSticker)},render:function(){return this.view.render(),this.trigger("append"),this.view},_onSelectSticker:function(t,e){this.trigger("stickers:select:sticker",t,e)},_createStickerModels:function(t){return s.map(t,function(t){return new a({description:t.description,id:t.id,media_key:t.media_key,sticker_pack_id:t.sticker_pack_id,url:t.url,original_size_url:t.original_size_url})})}});t.exports=u},function(t,e,i){"use strict";var s=i(118),n=i(712),o=s.extend({model:n});t.exports=o},function(t,e,i){"use strict";var s=i(113),n=s.extend({defaults:{description:null,id:null,media_key:null,sticker_pack_id:null,url:null,original_size_url:null}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(714),r=i(718),a=n.extend({className:"messaging-stickers-container",template:r,subviews:{stickerResultsView:{constructor:o,options:function(t){return{eventBus:t.eventBus,collection:t.stickers}}}},initialize:function(t){t=s.extend({},t),s.extend(this,s.pick(t,"eventBus","stickers"))}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(632),r=i(206),a=i(390),l=i(715),h=i(717),c=n.extend({className:"messaging-stickers-results",mixins:[r,o],template:h,subviews:{stickerResultView:{constructor:l,options:function(t){return{eventBus:t.eventBus}},collection:function(t){return t.collection}}},initialize:function(t){t=s.extend({},t),s.extend(this,s.pick(t,"eventBus","collection"))},afterRenderSubviews:function(){this.scrollbar=new a(this.$el.first()),this.updateScrollbar()},beforeRemove:function(){this.scrollbar&&this.scrollbar.destroy()},updateScrollbar:function(){this.rendered&&this.scrollbar&&s.defer(s.bind(this.scrollbar.update,this.scrollbar))}});t.exports=c},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(206),r=i(716),a=n.extend({className:"messaging-stickers-result",mixins:[o],template:r,events:{click:"_onClick"},initialize:function(t){t=s.extend({},t),s.extend(this,s.pick(t,"eventBus"))},getTemplateData:function(){var t=this.model.toJSON();return{stickerId:t.id,src:t.url}},_onClick:function(t){t.preventDefault(),this.eventBus.trigger("select:sticker",this.model,this)}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div data-js-sticker-result data-sticker-id="'+__e(stickerId)+'"><a href="#"><img src="'+__e(src)+'" width="100px"></a></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="messaging-stickers-results-wrapper" data-subview="stickerResultView[]"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="stickerResultsView"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+=__e(__("Add Sticker"));return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="messaging-conversation messaging-conversation--open" data-js-theme-background-tint data-js-conversation-open data-js-theme-accent-color-on-white><div data-subview="headerView"></div><div class="conversation-main" data-js-theme-background-color data-js-main><div data-subview="messagesView"></div><div data-subview="conversationLoaderView"></div></div><div data-subview="previewView"></div><div data-subview="composeView"></div></div><div class="messaging-conversation messaging-conversation--minimized" data-js-conversation-minimized data-js-theme-accent-color-on-white data-js-theme-avatar-shape-class><div data-subview="minimizedView"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(113),n=s.extend({defaults:{channel:null},getChannel:function(){return this.get("channel")},setChannel:function(t){return this.set("channel",t)},getId:function(){return this.get("channel").get("uuid")},getPrevChannel:function(){return this.previous("channel")},getPrevProperty:function(t){var e=this.getPrevChannel();return e?e.get(t):null},getPrevId:function(){return this.getPrevProperty("uuid")}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(118),o=i(617),r=i(607),a=n.extend({url:"/svc/conversations",mixins:[o],model:r,comparator:function(t){return-t.get("last_modified_ts")},_getRoot:function(t){return s.has(t,"response")?s.get(t,"response"):t},parse:function(t,e){return s.get(this._getRoot(t),"conversations")||[]},parsePreviousLink:function(t,e){return s.get(this._getRoot(t),"_links.previous")},parseNextLink:function(t,e){return s.get(this._getRoot(t),"_links.next")},fetchInbox:function(t,e){e=e||{};var i=s.extend({},e.data,{participant:t});return s.extend(e,{cache:!1,remove:!1,skipParseLinks:0!==this.length,data:i,isFetchInbox:!0}),this.fetch(e)},getUnreadCount:function(){return s.reduce(this.models,function(t,e){return e.isUnread()?t+1:t},0)}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(118),o=i(724),r=n.extend({
  model:o,getSortedModels:function(t){return this.sortBy(function(e){return e.get("uuid")===t?-1:0})},getSortedIds:function(t){var e=this.getSortedModels(t);return s.pluck(s.invoke(e,"toJSON"),"uuid")}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(113),o=i(608),r=i(722),a=i(119),l=n.extend({idAttribute:"uuid",mixins:[o],relations:{conversations:r},defaults:{conversations:null,unread_messages_count_sum:0}});s.defaults(l.prototype,a.prototype),t.exports=l},function(t,e,i){"use strict";var s,n=i(8),o=i(143),r=i(726),a=i(727),l=o.extend({name:"footer",initialize:function(){this.createFooter()},createFooter:function(){n(".l-footer").length&&(this.footerView=new r({el:".l-footer"})),n(".sidebar_nav").length&&(this.sidebarFooterView=new a({el:".pinned_sidebar_footer"}))}});t.exports=function(){return s||(s=new l),s}},function(t,e,i){"use strict";var s=i(155),n=s.extend({});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(109),r=i(149).transition,a=n.extend({defaults:{fadeScrollDistance:2e3,visible:!0},initialize:function(){this.listenTo(o,"DOMEventor:flatscroll",this.onScroll),this.on("change:visible",this.toggleVisibility),this.$nav=this.$el.find(".sidebar_nav")},onScroll:function(t){t&&(t.windowScrollY>=this.get("fadeScrollDistance")?this.set("visible",!1):this.set("visible",!0))},toggleVisibility:function(t,e){e===!0?(this.showElement(),s.defer(s.bind(function(){this.$nav.toggleClass("visible",e)},this))):(r(this.$nav,s.bind(function(){this.hideElement()},this)),this.$nav.toggleClass("visible",e)),o.trigger("toastr:canDisplayToggle",e)},hideElement:function(){this.$el.css("display","none")},showElement:function(){this.$el.css("display","block")}});t.exports=a},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(109),r=i(143),a=i(729),l=i(732),h=i(99),c=r.extend({name:"peepr",params:"",selector:"body",initialize:function(){var t=h.get("Components/Peepr")||{};this.params=t,t.blog_name&&(this.listenToOnce(o,"peepr:close",this.onPeeprClose),s(document).ready(n.bind(this.onPeeprRequestWithParams,this))),this.$container=s(this.container),this.bindEvents()},bindEvents:function(){this.listenTo(o,"peepr-open-request",this.onPeeprRequest),this.$container.on("click","[data-peepr]",n.bind(this.onPeeprTargetClicked,this))},onPeeprTargetClicked:function(t){if(!t.ctrlKey&&!t.metaKey){t.preventDefault();var e=s(t.currentTarget),i=e.data("peepr");if(i){var n=i.tumblelog,r=i.postId;o.trigger("peepr-open-request",{tumblelog_name:n,post_id:r})}else window.open(e.attr("href"))}},onPeeprClose:function(){window.Backbone.history.navigate("/dashboard")},onPeeprRequestWithParams:function(){o.trigger("peepr-open-request",{tumblelog_name:this.params.blog_name,post_id:this.params.post_id})},onPeeprRequest:function(t){t.tumblelog_name&&(t.editing_appearance="undefined"==typeof t.editing_appearance?!1:t.editing_appearance,this.open(t))},open:function(t){t.className="peepr-drawer",a().canOpen()&&a().open(l,t,"peepr-drawer-container")}});t.exports=c},function(t,e,i){"use strict";var s,n=i(8),o=i(3),r=i(100),a=i(143),l=i(109),h=i(161),c=i(142),u=i(730),d=a.extend({name:"drawer",selector:"body",mixins:[h],defaults:{suspended:!1,needsCloseConfirmation:!1},keycommands:{"keydown:escape":"initiateClose"},initialize:function(){this.$glass=null,this.$container=n(this.container),this.bindEvents()},bindEvents:function(){this.listenTo(l,"post:form:show",this.suspend),this.listenTo(l,"post:form:hide",this.resume),this.listenTo(l,"drawer:suspend",this.suspend),this.listenTo(l,"drawer:resume",this.resume),this.listenTo(l,"drawer:enableCloseConfirmation",this.enableCloseConfirmation),this.listenTo(l,"drawer:disableCloseConfirmation",this.disableCloseConfirmation),this.listenTo(l,"drawer:hideGlass",this.hideGlass),this.listenTo(l,"indashblog:post:photo_lightbox",this.disableKeys),this.listenTo(l,"tumblr_lightbox:form:hide",this.enableKeys),this.$container.on("click.drawerOpen keyup","[data-drawer-open]",o.bind(this.onClickOpen,this))},suspend:function(){this.set("suspended",!0)},resume:function(){this.set("suspended",!1)},enableCloseConfirmation:function(){this.set("needsCloseConfirmation",!0)},disableCloseConfirmation:function(){this.set("needsCloseConfirmation",!1)},canOpen:function(){return!this.get("suspended")&&!this.view},isSuspended:function(){return this.get("suspended")},isOpen:function(){return!!this.view},toggle:function(t,e){this.canOpen?this.open(t,e):this.close()},open:function(t,e,i,s){this.containerDrawerName=s,this.view=new u({subviews:{"drawer-content":{constructor:t,options:e||{}}}}),this.view.$el.addClass(i),this._toggleContainerDrawerClass(s,!0),this.showGlass(),l.trigger("keycommands:suspend"),this.append(),this.trigger("open"),l.trigger("drawer:open")},replace:function(t,e,i,s){this.view?(this._toggleContainerDrawerClass(this.containerDrawerName,!1),this._toggleContainerDrawerClass(s,!0),this.view.animateRemove(),this.view=null,this.containerDrawerName=s,o.delay(o.bind(function(){this.view=new u({subviews:{"drawer-content":{constructor:t,options:e||{}}}}),this.view.$el.addClass(i),this.append()},this),400)):this.open(t,e,i)},onClickOpen:function(t){if("keyup"!==o.get(t,"type")||13===o.get(t,"keyCode")){t.preventDefault();var e=n(t.currentTarget).attr("data-drawer-open");this.trigger("open:"+e),l.trigger("drawer:open:"+e)}},initiateClose:function(){this.view&&!this.get("suspended")&&(this.get("needsCloseConfirmation")===!0?c.confirm(r("Close without sending?"),o.bind(this.close,this),this.noop,r("OK"),r("Cancel")):this.close())},close:function(){this.view&&(this._toggleContainerDrawerClass(this.containerDrawerName,!1),this.view.animateRemove(),this.view=null,this.containerDrawerName=null,this.hideGlass(),l.trigger("keycommands:resume"),this.trigger("close"),l.trigger("drawer:close"))},remove:function(){return this.close(),this},showGlass:function(){this.$glass=n("<div>",{"class":"ui_peepr_glass"}).appendTo(this.$container);var t=o.bind(function(){this.$container.addClass("peepr")},this);this.animationDelay=o.delay(t,50),this.$glass.on("click",o.bind(this.initiateClose,this))},hideGlass:function(){var t=this.$glass;this.$glass=null,this.$container.removeClass("peepr"),this.animationDelay&&clearTimeout(this.animationDelay),o.delay(function(){t.remove()},150)},_getContainerClassNameForDrawerName:function(t){return o.isEmpty(t)?null:"peepr--"+t},_toggleContainerDrawerClass:function(t,e){var i=this._getContainerClassNameForDrawerName(t);o.isEmpty(this.$container)||o.isEmpty(i)||this.$container.toggleClass(i,e)}});t.exports=function(){return s||(s=new d),s}},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(109),r=i(155),a=i(731),l=r.extend({template:a,className:"drawer",defaults:{visible:!1},initialize:function(t){t.subviews&&(this.$body=s("body"),this.bindEvents())},bindEvents:function(){this.listenTo(o,"DOMEventor:keydown:tab",this.disableKey)},afterRender:function(){this.show()},disableKey:function(t){var e=s(t.target).is("input");e||t.preventDefault()},show:function(){this.get("visible")||(this.set("visible",!0),this.toggleAnimation("open",!0))},hide:function(t){this.get("visible")?(this.set("visible",!1),this.toggleAnimation("open",!1),n.delay(t,500)):t()},toggleAnimation:function(t,e){var i=n.bind(function(){this.$el.toggleClass(t,e)},this);window.requestAnimationFrame?window.requestAnimationFrame(i):n.defer(i)},animateRemove:function(){return this.hide(n.bind(function(){this.remove()},this)),this}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="";with(obj)__p+=null==(__t=_subview("drawer-content"))?"":__t;return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(109),r=i(155),a=i(107),l=i(733),h=i(734),c=i(735),u=i(736),d=i(739),p=i(740),g=i(742),_=i(743),m=i(119),f=i(744),v=r.extend({template:c,subviews:{posts:{constructor:u},header:{constructor:d},bigLoader:{constructor:g},timeline:{constructor:f}},initialize:function(t){this.$body=n("body"),this.options=t,this.loadCount=0,this.set("oneTruePost",a.bool("one_true_post_on_peepr")),this.setCollection(),this.postKeycommandsView=new _({el:this.$el}),this.bindEvents(),this.fetchPostsAndOrBlog(),o.trigger("peepr:open",{tumblelog_name:this.options.tumblelog_name,post_id:this.options.post_id,loggingData:{tumblelog_name:this.options.tumblelog_name,post_id:this.options.post_id}}),l.setup()},fetchPostsAndOrBlog:function(){var t=this;this.get("oneTruePost")?(this.collection.fetchBlog(),this.listenToOnce(o,"peepr:timeline:posts-fetched",function(){t.collection.trigger("peepr:postsAndBlogFetch")})):this.collection.fetchPostsAndBlog()},setCollection:function(){this.collection&&this.collection.stopListening();var t=new m({name:this.options.tumblelog_name});this.collection=new p([],{blogNameOrId:this.options.tumblelog_name,tumblelogData:t.toJSON(),postId:this.options.post_id}),this.listenTo(this.collection.tumblelog,"change:global_theme_params",this.setBkgColor),this.listenTo(this.collection,"error",this.onSyncError),this.listenTo(this.collection,"peepr:postsAndBlogFetch",this.onFirstSync),s.each(this.subviews,function(t){t.options=s.defaults({collection:this.collection,editing_appearance:this.options.editing_appearance,searchTagTerm:this.options.searchTagTerm||""},t.options||{})},this)},bindEvents:function(){this.$el.scroll(this.onBodyScroll),this.listenTo(o,"peepr-open-request",this.onPeeprOpenRequest),this.listenTo(o,"peepr:like_update",this.onPostLike),this.listenTo(o,"peepr:follow_update",this.onHeaderFollow),this.listenTo(o,"indashblog:post:reblog",this.onLegacyReblog),this.listenTo(o,"indashblog:search:start indashblog:search:clear",this.scrollToPosts)},afterRender:function(){this.autoPager&&(this.autoPager.close(),this.autoPager=null),document.activeElement.blur(),this.get("oneTruePost")||(this.autoPager=new h({$target:this.$(".peepr-body")}),this.listenTo(this.autoPager,"trigger",s.throttle(this.onAutopagerTrigger,500,{trailing:!1})))},onAutopagerTrigger:function(){this.collection.fetchMore(),this.log("paginate",{postCount:this.collection.length})},onBodyScroll:function(t){var e={windowScrollTop:n(t.currentTarget).scrollTop()};window.requestAnimationFrame?requestAnimationFrame(function(){o.trigger("peepr-body-scroll",e)}):o.trigger("peepr-body-scroll",e)},onLegacyReblog:function(t){var e="POST_CONTEXT_PEEPR";t.reblog_key||(t.reblog_key=this.collection.get(t.id).get("reblog_key")),o.trigger("postForms:reblog",{reblogSource:e,reblogId:t.id,reblogKey:t.reblog_key,pt:t.pt}),this.listenToOnce(o,"postForms:saved",this.onPostFormReblogSuccess),this.log("peepr_reblog",{postId:t.id})},onPostFormReblogSuccess:function(t,e){this.log("peepr_reblog_success",{postId:e.responseJSON.post.id})},onPostLike:function(t,e){this.log("peepr_like_update",{postId:e.id,liked:e.liked})},onHeaderFollow:function(t){this.log("peepr_follow",{following:t})},onFirstSync:function(){this.rendered&&(this.setBkgColor(),this.bigLoader.hide(),this.$(".indash_blog").addClass("intro"),s.delay(s.bind(function(){this.rendered&&this.$(".indash_blog").removeClass("intro")},this),1e3),this.log(this.loadCount?"reload":"load"),this.loadCount++)},onPeeprOpenRequest:function(t){t.tumblelog_name&&(this.options=t,this.setCollection(),this.reload())},reload:function(){this.autoPager&&this.stopListening(this.autoPager),this.removeSubviews(),this.render(),this.fetchPostsAndOrBlog()},setBkgColor:function(){var t=this.collection.tumblelog.get("global_theme_params")||{};s.has(t,"background_color")&&this.$(".peepr-body").css("background-color",t.background_color)},scrollToPosts:function(){this.headerScrollHeight=this.headerScrollHeight||this.$(".header_image_wrapper").height()-this.$(".navigation").height(),this.$el.scrollTop(this.headerScrollHeight)},onSyncError:function(){this.log("ajax-error",{offset:this.collection.length,path:window.location.href})},log:function(t,e){var i=s.defaults({blogname:this.options.tumblelog_name,postId:this.options.postId,loadCount:this.loadCount},e||{});o.trigger("peepr:log:"+t,{loggingData:{payload:i}})},remove:function(){this.log("close"),this.collection.stopListening(),this.postKeycommandsView&&this.postKeycommandsView.remove(),o.trigger("peepr:close",this.options.tumblelog_name,this.options.post_id),r.prototype.remove.call(this)}});t.exports=v},function(t,e,i){"use strict";var s,n=i(8),o=i(3),r=i(109),a=i(143),l=a.extend({name:"TrackingPixels",initialize:function(){this.listenTo(r,"component:TrackingPixels",this.initPixels)},initPixels:function(t){t.init&&o.each(t.init,function(t){t.script&&n("body").append(t.script)})}});t.exports={setup:function(){return s||(s=new l),s}}},function(t,e,i){"use strict";var s=i(109),n=i(3),o=i(7),r=i(144),a=i(108),l=r.extend({defaults:{offset:175,throttle:200,lockStep:!1,triggerCachingDelta:-1},constructor:function(t){this.options=n.extend({},this.defaults,t),this.handler=n.bind(this.options.$target?this.onTargetScroll:this.onWindowScroll,this),this.options.throttle&&(this.handler=n.throttle(this.handler,this.options.throttle)),this.locked=!1,this.bindEvents()},forceCheck:function(t){this.options.$target?this.handler(null,t):this.handler(a.rect(),t)},bindEvents:function(){this.options.$target?this.options.$target.parent().on("scroll",this.handler):(this.listenTo(s,"DOMEventor:flatscroll",this.handler),this.listenTo(s,"DOMEventor:flatresize",this.handler))},unlock:function(){this.locked=!1},onWindowScroll:function(t,e){if(!this.locked&&(this.buffer||(this.buffer=this.getBuffer(t)),this.nearBottom(t))){var i=n.clone(t);if(!e&&-1!==this.options.triggerCachingDelta&&this.triggerCache){var s=Math.abs(t.windowScrollTop-this.triggerCache.windowScrollTop);if(s<this.options.triggerCachingDelta)return}this.trigger("trigger"),this.options.lockStep&&(this.locked=!0),e||-1===this.options.triggerCachingDelta||(this.triggerCache=i)}},onTargetScroll:function(t,e){var i=this.options.$target.parent().height(),s=this.options.$target.outerHeight(),n=this.options.$target.position().top,o={windowScrollTop:-n,documentHeight:s,windowHeight:i};this.onWindowScroll(o,e)},getRemainingDocHeight:function(t){return t.documentHeight-t.windowScrollTop-t.windowHeight-this.buffer},getBuffer:function(t){var e=t.windowHeight;return n.isNull(e)?!1:Math.round(.666*e)},nearBottom:function(t){if(n.isNull(t.windowScrollTop))return!1;var e=this.options.offset,i=this.getRemainingDocHeight(t);return e>i},close:function(){this.options.$target&&this.options.$target.parent().off("scroll",this.handler)}});n.extend(l.prototype,o.Events),t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";Array.prototype.join;with(obj)__p+='<div class="peepr-body"><div class="indash_blog"><header data-subview="header" class="header"></header> ',__p+=oneTruePost?' <div data-subview="timeline" class="timeline"></div> ':' <main data-subview="posts" class="posts"></main> ',__p+=' </div></div><div data-subview="bigLoader"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(109),r=i(155),a=i(107),l=i(737),h=i(259),c=i(738),u=r.extend({className:"posts",template:c,initialize:function(){this.postViews=[],this.listenTo(o,"indashblog:post:photo_lightbox",this.onLightboxRequest),this.listenTo(this.collection,"sync",this.onCollectionSync),this.listenTo(this.collection,"reset",this.onCollectionReset),this.listenTo(this.collection,"request",this.onCollectionRequest),this.listenTo(this.collection,"add",this.renderPost),this.counter=1,this.adViews=[],this.listenTo(o,"indashblog:inject:ad",this.setupDarla),this.listenTo(o,"DOMEventor:flatresize",this.setMinHeight),this.listenTo(o,"indashblog:search:results-end",this.onSearchResultsEnd)},afterRender:function(){return this.loader=new h,this.$el.append(this.loader.render().$el),s.delay(this.setMinHeight.bind(this),2e3),this},setupDarla:function(t){this.darlaAd=t.ads},setMinHeight:function(){if(this.rendered){var t=n(window).height();this.navHeight=s.isUndefined(this.navHeight)?[".peepr-body .navigation",".peepr-body .info_wrapper",".peepr-body .blogless-advertiser"].reduce(function(t,e){return t+n(e).outerHeight()},0):this.navHeight,this.$el.css("min-height",t-this.navHeight+"px")}},renderPost:function(t){if(!a.bool("one_true_post")){var e=new window.Tumblr.IndashBlog.PostView({model:t});this.postViews.push(e);var i=this.$("[data-js-peepr-post-container]");if(i.append(e.render().el),this.postViews.length%10===2&&this.darlaAd){var n=this.collection.tumblelog.get("global_theme_params")||{};this.counter+=1,this.counter%=10;var o=new l({el:this.darlaAd,headerThemeParams:n,counter:this.counter});this.adViews.push(o),i.append(o.$el),o.render()}s.defer(s.bind(function(){this.make_tags_draggable()},e))}},onSearchResultsEnd:function(t){t&&(this.searchResultsEndView=t,this.$("[data-js-peepr-post-container]").append(this.searchResultsEndView.render().$el))},onCollectionReset:function(){this.searchResultsEndView&&this.searchResultsEndView.remove(),this.darlaAd&&(s.each(this.adViews,function(t){t.remove()}),this.adViews=[]),this.collection.length?this.collection.each(this.renderPost,this):(s.each(this.postViews,function(t){t.remove()}),this.postViews=[])},onCollectionRequest:function(){this.loader.set("loading",!0)},onCollectionSync:function(){this.loader.set("loading",!1)},onLightboxRequest:function(t){var e=t.post,i=e.get("photos"),n=t.photosetIndex||0,r=[];s.each(i,function(t){r.push({width:t.original_size.width,height:t.original_size.height,low_res:t.alt_sizes[0].url,high_res:t.original_size.url})}),o.trigger("lightbox-open-request",r,n)}});t.exports=u},function(t,e,i){"use strict";var s=i(155),n=s.extend({initialize:function(t){this.options=t||{},this.counter=this.options.counter},render:function(){if(window.DARLA){var t=this.$el.find(".ad-content").first().attr("data-yam-ad-id");window.DARLA.add({name:"LRECP",sp:"1197719223",ps:"LREC",ssl:!0}),window.DARLA.addPos({asz:"300x250",dest:"tgt-"+t,h:"250",id:t,pos:"LREC-"+this.counter,w:"300"}),window.DARLA.render.RenderMgr.nuke("LREC-"+this.counter),window.DARLA.event("LRECP",{ps:"LREC-"+this.counter});var e=this.options.headerThemeParams;e.title_color&&e.link_color&&(this.$(".section_header").css("color",e.title_color),this.$(".sponsored_badge .ring").css("color",e.title_color),this.$(".sponsored_badge .dollar_sign").css("color",e.title_color),this.$(".ad-link").css("color",e.link_color))}}});t.exports=n},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+="<div data-js-peepr-post-container></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(109),r=i(155),a=i(99),l=i(582),h=r.extend({renderWithTemplate:s.noop,className:"header",initialize:function(t){this.options=t,this.listenTo(this.collection,"peepr:postsAndBlogFetch",this.insertHeader)},insertHeader:function(){this.header=new window.Tumblr.IndashBlog.HeaderView({model:this.collection.tumblelog,el:this.$el,is_peepr:!0,show_share_controls:!0,show_follow_button:!0,show_user_controls:!0,show_dismiss_controls:!1,on_customize_open:s.bind(this.renderAllFontStyles,this)}).render(),this.setupHeader()},setupHeader:function(){var t=this.collection.tumblelog.get("global_theme_params").title_font;this.renderSingleFontStyle(t),this.$(".navigation").width(this.$el.width()||585),o.trigger("indashblog:ready-animation-start"),this.options.editing_appearance&&this.header.start_customizing(),this.options.searchTagTerm&&o.trigger("peeprsearch:change:term",{term:this.options.searchTagTerm})},renderAllFontStyles:function(){s.each(l,function(t){this.appendFontToHead(t)},this)},renderSingleFontStyle:function(t){var e=s.result(l,t);e&&this.appendFontToHead(e)},appendFontToHead:function(t){var e=a.get("Context/hosts/assets_host")||"",i="webfont_"+t.path;if(t.path&&!n("head #"+i).length){var o=e+"/fonts/"+t.path+"/stylesheet.css";o+=s.has(t,"_v")?"?v="+t._v:"",n("<link>",{id:i,rel:"stylesheet",type:"text/css",href:o}).appendTo(n("head"))}},remove:function(){this.header&&this.header.remove(),r.prototype.remove.call(this)}});t.exports=h},function(t,e,i){"use strict";var s=i(3),n=i(120),o=i(109),r=i(277),a=i(118),l=i(741),h=a.extend({model:r,url:"/svc/indash_blog/posts",blogNameOrId:"",_hasFetchedEverything:!1,initialize:function(t,e){this.loading=!1,this.tumblelog=new l,e=e||{},this.blogNameOrId=e.blogNameOrId,this.postId=e.postId,e.tumblelogData&&this.tumblelog.set(e.tumblelogData),e.url&&(this.url=e.url),this.listenTo(o,"indashblog:post:like",this.likePostbyId),this.bindBlogSearchEvents()},bindBlogSearchEvents:function(){this.listenTo(o,"indashblog:search:start",this.blogSearchStarted),this.listenTo(o,"indashblog:search:complete",this.blogSearchCompleted),this.listenTo(o,"indashblog:search:post-added",this.blogSearchPostAdded),this.listenTo(o,"indashblog:search:results-end",this.blogSearchResultsEnd),this.listenTo(o,"indashblog:search:clear",this.blogSearchClear)},blogSearchStarted:function(){this.searchMode=!0,this.reset(),this.trigger("request",this),this.loading=!0,o.trigger("indashblog:search:fetch-requested")},blogSearchPostAdded:function(t){this.add(t)},blogSearchCompleted:function(t){this.reset(t),this.trigger("sync",this),this.loading=!1},blogSearchResultsEnd:function(t){this._hasFetchedEverything=!0,this.loading=!1,this.trigger("sync",this)},blogSearchClear:function(){this.searchMode=!1,this.reset(),this.trigger("request",this),this.fetch()},fetchPostsAndBlog:function(t){var e=this,i=this.fetch(t),s=this.fetchBlog(t);n.all([i,s]).then(function(){e.trigger("peepr:postsAndBlogFetch")})},fetchBlog:function(t){return n(this.isTumblelogComplete()?null:this.tumblelog.fetch({tumblelog_name_or_id:this.blogNameOrId}))},fetch:function(t){return this.loading?void 0:this.searchMode?(this.trigger("request",this),void o.trigger("indashblog:search:fetch-requested",t)):(t=t||{},t.blogNameOrId&&(this.blogNameOrId=t.blogNameOrId),t.data={tumblelog_name_or_id:this.blogNameOrId,post_id:this.postId||null,limit:this.postId?1:t.limit||10,offset:t.offset||0},this.loading=!0,a.prototype.fetch.call(this,t))},fetchMore:function(t){if(t=t||{},!this.hasFetchedEverything()&&!this.loading){if(this.searchMode)return this.trigger("request",this),void o.trigger("indashblog:search:fetch-requested",t);var e=this.models.length;return this.postId&&(e-=1,this.postId=null),t=s.extend({offset:e,remove:!1},t),this.fetch(t)}},parse:function(t,e){return(!t.response.posts.length||t.response.posts.length<e.data.limit)&&(this._hasFetchedEverything=!0),t.response.tumblelog&&this.tumblelog.set(t.response.tumblelog),t.response.peepr_ad&&o.trigger("indashblog:inject:ad",{ads:t.response.peepr_ad}),t.response.tracking_html&&!s.isEmpty(t.response.tracking_html)&&o.trigger("component:TrackingPixels",{init:t.response.tracking_html}),this.loading=!1,t.response.posts},reset:function(){this._hasFetchedEverything=!1,a.prototype.reset.apply(this,arguments)},hasFetchedEverything:function(){return this._hasFetchedEverything},likePostbyId:function(t,e){var i=this.get(t);i&&(e=e||"mouse",i.like(e),o.trigger("peepr:like_update",i.get("tumblelog"),i.toJSON()))},isTumblelogComplete:function(){return this.tumblelog.has("global_theme_params")}});t.exports=h},function(t,e,i){"use strict";var s=i(3),n=i(119),o=i(109),r=i(113),a=i(582),l=r.extend({url:"/svc/indash_blog/header",initialize:function(t,e){e=e||{},this.listenTo(this,"change",this.onModelChange)},onModelChange:function(t){this.tumblelog=this.tumblelog||new n({name:this.get("name")}),this.tumblelog_name_or_id=this.get("name");var e=this.tumblelog.get("following");if(!s.isUndefined(e)&&this.get("following")!==e){var i={source:this.get("following")?"FOLLOW_SOURCE_PEEPR_HEADER":"UNFOLLOW_SOURCE_PEEPR_HEADER"};this.tumblelog.save_following({following:this.get("following")},i),o.trigger("peepr:follow_update",this.get("following"))}if(t.hasChanged("following")){var r={can_subscribe:t.get("following")};t.get("following")||(r.is_subscribed=!1),this.set(r)}this.tumblelog.set(this.toJSON())},get_theme_param:function(t){var e=this.get("global_theme_params")||{};return e[t]},set_theme_params:function(t){var e=s.clone(this.get("global_theme_params"));this.set("global_theme_params",s.extend({},e,t))},parse:function(t,e){return s.get(t,"response",t)},fetch:function(t){return t=t||{},t.data={tumblelog_name_or_id:t.tumblelog_name_or_id||this.get("name")},r.prototype.fetch.call(this,t)},save:function(t,e){var i=s.extend({},this.defaults,t);return i.global_theme_params=s.omit(i.global_theme_params,["header_image_dimens","header_image_focused"]),e=e||{},e.contentType="application/json",e.data=JSON.stringify({tumblelog_name_or_id:this.get("name"),tumblelog:i}),e.withFormKey=!0,r.prototype.save.call(this,t,e)},getAvailableFonts:function(){return a}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(259),r=n.extend({renderWithTemplate:s.noop,className:"peepr-big-loader",initialize:function(t){this.options=s.defaults({},t),this.loader=new o,this.loader.set("loading",this.options.loading)},render:function(){this.$el.append(this.loader.render().$el)},toggle:function(t){this.options.loading=t,this.loader.set("loading",t),this.$el.toggleClass("hidden",!t)},show:function(){this.toggle(!0)},hide:function(){this.toggle(!1)}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(109),r=i(161),a=i(148),l=a.extend({mixins:[r],keycommands:{"keydown:j":"scrollToNextItem","keydown:k":"scrollToPrevItem","keydown:l":"like","keydown:r":"reblog","keydown:s":"share","keydown:period":"ttt","keydown:enter":"openBlog"},defaults:{selector:".post",scrollOffset:60,speed:200},initialize:function(t){this.options=s.defaults(t||{},this.defaults),this.listenTo(o,"post:form:show indashblog:keycommands:suspend",this.disableKeys),this.listenTo(o,"post:form:hide indashblog:keycommands:resume",this.enableKeys),this.listenTo(o,"keycommands:resume",this.onDashboardKeycommandsResume),this.listenTo(o,"drawer:close",this.resumeDashboardKeycommands)},onDashboardKeycommandsResume:function(){o.trigger("keycommands:suspend")},resumeDashboardKeycommands:function(){this.stopListening(o,"keycommands:resume"),o.trigger("keycommands:resume")},indexPageableItems:function(){var t={};this.currentPosition=this.getScrollOffset(),this.goToPosition=0,this.$(this.options.selector).each(function(e){var i=n(this);t[e]=Math.round(i.position().top)}),this.positions=t},getScrollOffset:function(){return this.$el.scrollTop()},like:function(){var t=this.findPostId();t&&o.trigger("indashblog:post:like",t,"keyboard")},reblog:function(){var t=this.findPostId();t&&o.trigger("indashblog:post:reblog",{id:t},"keyboard")},share:function(){var t=this.$(".post[data-post-id="+this.findPostId()+"] [data-subview=share]");s.isEmpty(t)||1!==t.length||t.get(0).click()},ttt:function(){this.goToPosition=1,this.$el.stop().animate({scrollTop:0},this.options.speed,s.bind(function(){this.animating=!1},this))},openBlog:function(){var t=this.$("[data-post-id="+this.findPostId()+"] .reblog_info.post_info_link");t.length&&o.trigger("peepr-open-request",{url:t.attr("href"),tumblelog_name:t.data("tumblelog-name")})},scrollToNextItem:function(){this.indexPageableItems(),this.nextPosition(),o.trigger("keycommands:jk",{loggingData:{source:"peepr"}})},scrollToPrevItem:function(){this.indexPageableItems(),this.previousPosition(),o.trigger("keycommands:jk",{loggingData:{source:"peepr"}})},nextPosition:function(){for(var t in this.positions){var e=this.positions[t];e>this.currentPosition+this.options.scrollOffset&&(e<this.goToPosition||!this.goToPosition)&&(this.goToPosition=e)}this.animate()},previousPosition:function(){for(var t in this.positions){var e=this.positions[t];e<this.currentPosition-this.options.scrollOffset&&e>this.goToPosition&&(this.goToPosition=e)}this.animate()},animate:function(){this.goToPosition&&!this.animating&&(this.animating=!0,this.$el.stop().animate({scrollTop:this.goToPosition-this.options.scrollOffset},this.options.speed,s.bind(function(){this.animating=!1},this)))},findPostId:function(){if(this.goToPosition-this.options.scrollOffset===this.getScrollOffset()){var t=s.invert(this.positions)[this.goToPosition];if(t){var e=this.$(this.options.selector).get(t);if(e)return n(e).data("post-id")}}return!1}});t.exports=l},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(109),r=i(155),a=i(745),l=r.extend({className:"flag--one-true-post",initialize:function(){var t=this;a(function(e){t.component=new e({container:t.el,variant:"peepr",url:"/svc/tumblelog/"+t.collection.tumblelog.get("name")+"/peepr",fetch:!1}),t.shouldRenderImmediately&&t.render(),t.component.fetch().then(function(){o.trigger("peepr:timeline:posts-fetched")})}),this.listenTo(o,"DOMEventor:flatresize",this.setMinHeight)},render:n.noop,afterRender:function(){n.isEmpty(this.component)?this.shouldRenderImmediately=!0:(this.setMinHeight(),this.component.view.set("$scrollTarget",this.$el.closest(".peepr-body")),this.component.append())},setMinHeight:function(){if(this.rendered){var t=s(window).height();this.navHeight=n.isUndefined(this.navHeight)?[".peepr-body .navigation",".peepr-body .info_wrapper",".peepr-body .blogless-advertiser"].reduce(function(t,e){return t+s(e).outerHeight()},0):this.navHeight,this.$el.css("min-height",t-this.navHeight+"px")}}});t.exports=l},function(t,e,i){"use strict";var s=i(177),n=function(t){i.e(3,function(e){try{t(i(746))}catch(n){s(n,"timeline")}})};t.exports=n},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";function s(t){n||(n=r.get("Context/hosts"));var e=o.snakeCase(t);return o.endsWith(e,"_host")||(e+="_host"),o.get(n,e)}var n,o=i(3),r=i(99),a={get:o.memoize(s)};t.exports=a},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";function s(t){return"string"==typeof t||t&&"object"===("undefined"==typeof t?"undefined":l(t))&&"[object String]"===p.call(t)||!1}function n(){var t=new _;return t.cid=m,m+=1,f[t.cid]=t,t}function o(t,e){for(var i,s=v.length-1;s>=0;s--)v[s].message_callback(t,e);for(s=b.length-1;s>=0;s--)i=b[s],i&&i.shouldRespond&&i.shouldRespond(t,e)&&i.cb(t,e)}function r(t){if(t||(t={}),!(c&&c.stringify&&c.parse))throw"Must have JSON parsing and stringify";if(t.iframe&&(t.window=t.iframe.contentWindow,!t.origin)){var e=t.iframe.src,i=e.match(/^(http(?:s)?:\/\/[\w_\-\.]+(?::\d+)?)\/?/);i&&(t.origin=i[1])}this.namespace=t.namespace?t.namespace+":":"",this.origin=t.origin||"*",this.responders={_method_callback_responder:y,_syn:d(this._syn,this)},this._on_connected=new g,this._unanswered_calls={},this.on_connection(d(this.enable_sending_post_message,this)),v.push(this),t.window&&this.setWindow(t.window)}function a(t,e,i){i||(i=this.origin),t.postMessage(e,i)}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},h=i(98),c=h("JSON",function(t){return t&&t.stringify}),u=[].slice,d=function(t,e){return function(){return t.apply(e,arguments)}},p=Object.prototype.toString,g=i(831),_=i(832),m=1,f={},v=[],b=[];!function(){var t=window.addEventListener?"addEventListener":"attachEvent",e=window[t],i="attachEvent"===t?"onmessage":"message";e(i,function(t){var e;if("string"==typeof t.data){try{t.data&&"{"===t.data[0]&&(e=c.parse(t.data))}catch(i){}e&&e.method&&o(t,e)}},!1)}();var y=function(t){if(t.cid_response&&t.cid_response in f){var e=f[t.cid_response];e.resolve.call(null,this,t.response),delete f[t.cid_response];
  }};r.prototype.setWindow=function(t){if(t){this.window=t;var e=this.call("_syn");e.then(d(function(t,e){"ack"===e&&this._is_connected()},this))}},r.on=function(t,e){var i;i="*"===t?function(){return!0}:"*"===t[t.length-1]?function(e,i){return 0===i.method.indexOf(t.substring(0,t.length-2))}:function(e,i){return i.method===t},b.push({shouldRespond:i,cb:e})},r.off=function(t){for(var e,i=b.length-1;i>=0;i--)if(b[i].cb===t){e=i;break}return e&&e>-1?(b.splice(e,1),!0):!1},r.prototype.match_origin=function(t){return"*"===this.origin?!0:this.origin===t},r.prototype.message_callback=function(t,e){var i;if((!this.window||t.source===this.window)&&this.match_origin(t.origin)){if(e.method&&e.method.slice(0,this.namespace.length)===this.namespace&&(i=e.method.slice(this.namespace.length,e.method.length)),e.args&&s(e.args))try{e.args=c.parse(e.args)}catch(n){return}this.call_responder(i,t,e)}},r.prototype.call_responder=function(t,e,i){var s,n;if(t){if(i.args||(i.args=[]),n=this.responders[t],!n)return this._unanswered_calls[t]||(this._unanswered_calls[t]=[]),void this._unanswered_calls[t].push(arguments);s=n.apply(e,i.args),i.cid&&"_method_callback_responder"!==t&&this.send_to_window(e.source,"_method_callback_responder",{cid_response:i.cid,response:s})}},r.prototype._syn=function(){return this._is_connected(),"ack"},r.prototype._is_connected=function(){this.connected||(this.connected=!0,this._on_connected.trigger(this))},r.prototype.on_connection=function(t){return this._on_connected.push.apply(this._on_connected,arguments),this},r.prototype.method=function w(t){var e=this,w=function(){var i=1<=arguments.length?u.call(arguments,0):[];return i.unshift(t),e.send.apply(e,i)};return w},r.prototype.call=function(){var t=1<=arguments.length?u.call(arguments,0):[];return this.window?(t.unshift(this.window),this.call_on_window.apply(this,t)):void console.warn("no window specified on channel")},r.prototype.call_on_window=function(t,e){var i=3<=arguments.length?u.call(arguments,2):[],s=n();try{var o=c.stringify({method:this.namespace+e,args:i,cid:s.cid});"_syn"===e||"_method_callback_responder"===e?a.call(this,t,o):this.send_post_message(t,o)}catch(r){s.reject(r)}return s.promise()},r.prototype.send=function(){var t=1<=arguments.length?u.call(arguments,0):[];return this.window?(t.unshift(this.window),this.send_to_window.apply(this,t)):void console.warn("no window specified on channel")},r.prototype.send_to_window=function(t,e){var i=3<=arguments.length?u.call(arguments,2):[],s=c.stringify({method:this.namespace+e,args:i});"_syn"===e||"_method_callback_responder"===e?a.call(this,t,s):this.send_post_message(t,s)},r.prototype.send_post_message=function(){this._delayed_sent_messages||(this._delayed_sent_messages=[]),this._delayed_sent_messages.push(arguments)},r.prototype.enable_sending_post_message=function(){if(this.send_post_message=a,this._delayed_sent_messages){for(var t=0;t<this._delayed_sent_messages.length;t+=1)a.apply(this,this._delayed_sent_messages[t]);delete this._delayed_sent_messages}},r.prototype.listening_to=function(t){return t in this.responders},r.prototype.listen_to=function(t,e,i){if(s(t)){if(t in this.responders)return void console.warn("already listening to this method, turn it off first");if(i&&(e=d(e,i)),this.responders[t]=e,this._unanswered_calls[t]){var n,o=this._unanswered_calls[t];delete this._unanswered_calls[t];for(var r=0;r<o.length;r+=1)n=o[r],this.call_responder.apply(this,n)}}else{var a=t;for(t in a)a.hasOwnProperty(t)&&this.listen_to(t,a[t],i)}},r.prototype.stop_listen_to=function(t){return"_method_callback_responder"===t?void console.warn("cannot disable the method callback responder"):void delete this.responders[t]},r.prototype.ensureChannelConnection=function(t){this.send_to_window(t,"_syn")},t.exports=r},function(t,e){"use strict";function i(){this.length=0}var s=[].slice,n=[].push;i.prototype={slice:s,indexOf:Array.prototype.indexOf},i.prototype.push=function(){if(this.triggered_with)for(var t=1<=arguments.length?s.call(arguments,0):[],e=0;e<t.length;e+=1)t[e].apply(null,this.triggered_with);return n.apply(this,arguments)},i.prototype.trigger=function(){var t=1<=arguments.length?s.call(arguments,0):[],e=this.length;this.triggered_with=t;for(var i=0;e>i;i+=1)this[i].apply(null,this.triggered_with);return this},t.exports=i},function(t,e,i){"use strict";function s(){this._on_resolved=new r,this._on_rejected=new r,this.then=o(this.then,this),this.fail=o(this.fail,this),this.resolve=o(this.resolve,this),this.reject=o(this.reject,this)}var n=[].slice,o=function(t,e){return function(){return t.apply(e,arguments)}},r=i(831);s.prototype.then=function(){return this._on_resolved.push.apply(this._on_resolved,arguments),this},s.prototype.success=s.prototype.then,s.prototype.fail=function(){return this._on_resolved.push.apply(this._on_rejected,arguments),this},s.prototype.resolve=function(){return this.resolved||this.rejected?void 0:(this._on_resolved.trigger.apply(this._on_resolved,arguments),this.resolved=!0,this)},s.prototype.reject=function(){return this.resolved||this.rejected?void 0:(this._on_rejected.trigger.apply(this._on_rejected,arguments),this.rejected=!0,this)},s.prototype.reject_timeout=function(){var t=1<=arguments.length?n.call(arguments,0):[],e=t.shift();return setTimeout(o(function(){this.reject.apply(this,t)},this),e),this},s.prototype.promise=function(){function t(){var t=this;this.fail=function(){return e.fail.apply(e,arguments),t},this.then=function(){return e.then.apply(e,arguments),t},this.success=this.then,this.reject_timeout=function(){return e.reject_timeout.apply(e,arguments),t},this.cid=e.cid}var e=this;return new t},t.exports=s},,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(840),r=i(143),a=i(99),l=i(109),h=i(509),c=i(107),u=[],d=r.extend({name:"CrtControl",maxLoopTime:10,playerSelector:"[data-crt-video]",peeprOpen:!1,initialize:function(t){t=t||{},this.listenTo(l,"CrtControl:newPlayer",this.playerFactory,this),this.listenTo(l,"DOMEventor:flatscroll",s.throttle(this.onScroll,500),this),this.listenTo(l,"peepr:close",this.onPeeprClose,this),this.listenTo(l,"peepr:open",this.onPeeprOpen,this)},onPeeprOpen:function(){this.peeprOpen=!0},onPeeprClose:function(){this.peeprOpen=!1},findPlayers:function(t){var e=n(this.playerSelector);e.length&&this.playerFactory(e,t)},playerFactory:function(t,e){s.defer(s.bind(function(){s.each(t,function(t){this.newPlayer(t,e)},this)},this))},newPlayer:function(t,e){var i=this;if(t.player)return t.player;var s=new h(t,e);return u.push(s),s.render(),this.bindPlayerEvents(s),l.trigger("CrtControl:playerCreated",s),this.isThirdPartyTrackingEligible(e)&&o(function(t){var e={videoPlayer:s};i.beaconTracking=new t(e)}),s},isThirdPartyTrackingEligible:function(t){return c.bool("moat_viewability_beacons")&&s.get(t,"attributes.isAd",!1)&&!s.isEmpty(a.get("Components/BeaconTracking"))},bindPlayerEvents:function(t){this.listenTo(t,"ready",this.onPlayerReady),this.listenTo(t,"teardown",this.onPlayerTeardown)},onPlayerReady:function(){this.playInViewport()},onPlayerTeardown:function(t){if(t=s.where(u,{_id:t._id}),t.length){var e=s.indexOf(u,t[0]);e>-1&&(t=u.splice(e,1))}},onScroll:function(){this.playInViewport()},pauseAutoplaying:function(){s.each(u,function(t){t.get("autoplay")&&t.get("loaded")&&t.pause()})},getInViewport:function(){var t=this;return s.filter(u,function(e){return!e.watcher||t.peeprOpen&&!e.get("isInPeepr")?!1:e.watcher.isFullyInViewport&&e.$el.is(":visible")})},playInViewport:function(){var t=this.getInViewport();if(t.length){var e=t[0];e.get("paused")&&e.get("autoplay")&&(this.pauseAutoplaying(),e.play())}}});t.exports=new d},function(t,e,i){"use strict";var s=i(177),n=function(t){i.e(4,function(e){try{t(i(841))}catch(n){s(n,"beacon-tracking")}})};t.exports=n},,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(177),n=function(t){i.e(5,function(e){try{t(i(863))}catch(n){s(n,"post-activity")}})};t.exports=n},,,function(t,e,i){"use strict";function s(t){return(t||a())-a.realStartedAt}var n=i(3),o=i(99),r=n.once(function(){return o.get("Context/time")}),a=n.get(window,"Tumblr.getRealNow");if(!a){var l=window.performance,h=l&&l.timing&&l.timing.responseStart||Date.now();a=function(){return r()+(Date.now()-h)},a.startedAt=(new Date).getTime(),a.realStartedAt=a()}t.exports={getRealNow:a,startedAt:a.startedAt,realStartedAt:a.realStartedAt,getElapsed:s}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(3),n=i(7),o=i(143),r=i(110),a=i(119),l=i(109),h=i(909),c=i(910),u=i(649),d=i(619),p=i(952),g=new u,_=o.extend({name:"MessagingSharePost",initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),this.options=t,this.user=r(),this.channels=this._getChannelsEnabledForMessagingAsCollection(),this.messagingShareLogger=new h},render:function(){return this.openPopover(this.options),this},openPopover:function(t){var e,i,n=s.get(t,"postId"),o=s.get(t,"blogUuid"),r=s.get(t,"favoritesNames",[]),a=s.get(t,"popoverContainer"),l=s.get(t,"pinnedTarget"),h=s.get(t,"externalNetworksData",{}),u=new p(s.extend({post_id:n,tumblelog_name:o},h));return s.isEmpty(n)?null:s.isEmpty(o)?null:s.isEmpty(l)?null:(e={viewOptions:s.bind(function(t){return{shareData:{blogUuid:o,postId:n},popoverContainer:t.el,favoritesCollection:g,additionalFavorites:this._getAdditionalFavoritesAsParticipants(r),channels:this.channels,externalNetworksDataModel:u,isExternalSharingEnabled:this.isExternalSharingEnabled(),senderBlogUuid:this.user.getCurrentMessagingChannelUuid()}},this),autoTeardown:!0,teardownOnEscape:!1,pinnedSide:"bottom",isFixedPosition:!1,pinnedTarget:l,popoverContainer:a},this.messagingShareLogger.logShareIntent(n,o),i=new c(e).render(),this._afterPopoverOpen(i),i)},isExternalSharingEnabled:function(){return s.get(this.data,"is_external_sharing_enabled",!1)},_afterPopoverOpen:function(t){var e=t.getView();this.listenToOnce(t,"close",function(){this._onPopoverClose(t)}),this.listenTo(e,"external:click",this._onPopoverExternalNetworkShareClick),this.listenTo(e,"external:success",this._onPopoverExternalNetworkShareSuccess),this.listenTo(e,"external:fail",this._onPopoverExternalNetworkShareFail),l.trigger("keycommands:suspend")},_onPopoverClose:function(t){this.stopListening(t),this.stopListening(t.getView()),l.trigger("keycommands:resume")},_onPopoverExternalNetworkShareClick:function(t){this.messagingShareLogger.logExternalNetworkClicked(t)},_onPopoverExternalNetworkShareSuccess:function(t){this.messagingShareLogger.logExternalNetworkShareSuccess(t)},_onPopoverExternalNetworkShareFail:function(t){this.messagingShareLogger.logExternalNetworkShareFail(t)},_getChannelsEnabledForMessagingAsCollection:function(){return new n.Collection(this.user.getChannelsEnabledForMessaging())},_getAdditionalFavoritesAsParticipants:function(t){return s.reduce(t,function(t,e){var i=new a({name:e});return i.get("uuid")&&i.get("can_receive_messages")&&t.push(new d(i.toJSON(),{parse:!0})),t},[],this)}});t.exports=_},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(143),r=i(109),a=o.extend({name:"MessagingShareLogger",defaults:{namespace:"postchrome-interactions",platform:"web",isDebugEnabled:!1},initialize:function(t){t=n.extend({},t),n.extend(this.attributes,n.pick(t,n.keys(this.defaults)))},logShareIntent:function(t,e){this._logIt("share:intent",{postId:t,postBlogUuid:e})},logExternalNetworkClicked:function(t){var e=t.getName(),i=t.getPostModel(),o=n.extend({},this._getCommonExternalShareData(t),{viewType:t.getType()});this._logIt("share:external",o),r.trigger("dashboard-share:"+e),t.isTypePopup()&&!n.isEmpty(i)&&s.ajax({url:"/svc/share/"+e,method:"POST",withFormKey:!0,data:{post_id:i.get("post_id"),tumblelog_name:i.get("tumblelog_name"),share_fallback:!0}})},logExternalNetworkShareSuccess:function(t){this._logIt("share:external:success",this._getCommonExternalShareData(t))},logExternalNetworkShareFail:function(t){this._logIt("share:external:fail",this._getCommonExternalShareData(t))},_logIt:function(t,e){e=e||{},n.extend(e,{platform:this.get("platform")}),r.trigger(this.get("namespace")+":"+t,{loggingData:e})},_getCommonExternalShareData:function(t){var e=t.getPostModel(),i={network:t.getName()};return n.isEmpty(e)||n.extend(i,{postId:e.get("post_id"),tumblelogName:e.get("tumblelog_name")}),i}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(155),r=i(212),a=i(911),l=o.extend({className:"popover--messaging-share-post popover popover_menu popover_gradient",mixins:[r],initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"viewOptions"))},render:function(){var t=s.isFunction(this.viewOptions)?this.viewOptions(this):this.viewOptions;return this.$wrapper=n("<div />").addClass("popover-inner popover_inner").appendTo(this.$el),this.$pinned.addClass("active"),this.sharePostView&&(this.stopListening(this.sharePostView),this.sharePostView.remove()),this.sharePostView=new a(t),this.listenToOnce(this.sharePostView,"close",this.teardown),this.$wrapper.html(this.sharePostView.render().$el),this},teardown:function(){return this.sharePostView&&this.sharePostView.remove(),this.remove()},getView:function(){return this.sharePostView}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(109),r=i(206),a=i(161),l=i(155),h=i(395),c=i(912),u=i(259),d=i(913),p=i(915),g=i(919),_=i(946),m=i(948),f=i(950),v=i(368),b=i(607),y=i(672),w=i(689),k=i(649),C=i(951),x=l.extend({className:"messaging-share-post",template:c,defaults:{senderBlog:null,isSending:!1,isLoading:!1,isLoadingFavorites:!1,isDisabled:!1,isEmpty:!1,isShowFavorites:!0,isShowMessage:!1,isShowExternalNetworksRow:!0,isExternalSharingEnabled:!0,isShowingExternalNetworkSubview:!1,closeAfterExternalNetworkShareMs:3e3,showLoadingAfterMs:250,numFavorites:10,defaultPlaceholder:null,additionalFavoritesPlaceholder:null,sendingPlaceholder:null,currentPlaceholder:null,focusIndex:0,isResultContainerFocused:!1,isExternalNetworksContainerFocused:!1,loadingClass:"is-loading",baseLoggingContext:"post-chrome",tabbingView:null},mixins:[r,a],keycommands:{"keydown:up":"_onKeyPressUp","keydown:down":"_onKeyPressDown","keydown:tab":"_onKeyPressTab","keydown:shift+tab":"_onKeyPressShiftTab","keydown:escape":"_onKeyPressEscape"},subviews:{searchView:{constructor:d,options:function(t){return{collection:t.collection,selectedRecipientModel:t.selectedRecipientModel,keyboardManager:t.keyboardManager,keyboardNamespace:"messagingshare:search"}}},resultsView:{constructor:p,options:function(t){return{collection:t.collection,selectedRecipientModel:t.selectedRecipientModel,keyboardManager:t.keyboardManager,keyboardNamespace:"messagingshare:results"}}},messageView:{constructor:w,options:function(t){return{isAutoValidationEnabled:!1,className:"messaging-share-post-message",placeholder:t.get("currentPlaceholder"),keyboardManager:t.keyboardManager,keyboardNamespace:"messagingshare:message",buttonSubmittedClass:"submitted--send-a-post",animationSpeed:250,pluginsArray:t.pluginsArray}}},externalNetworksView:{constructor:g,options:function(t){return{isExternalSharingEnabled:t.get("isExternalSharingEnabled"),keyboardManager:t.keyboardManager,keyboardNamespace:"messagingshare:external",externalNetworksDataModel:t.externalNetworksDataModel}}},errorView:{constructor:m},favoritesLoaderView:{constructor:u,options:{className:"messaging-share-post-favorites-loader",variation:"small centered",loading:!1}}},initialize:function(t){var e;t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"favoritesCollection","shareData","channels","popoverContainer","additionalFavorites","externalNetworksDataModel")),this.collection=new k,e=this.channels.findWhere({uuid:s.get(t,"senderBlogUuid")})||this.channels.first(),this.keyboardManager=new v({allowMultipleActiveViews:!0}),s.isEmpty(this.get("defaultPlaceholder"))&&this.set("defaultPlaceholder",n("Say something if you like...")),s.isEmpty(this.get("additionalFavoritesPlaceholder"))&&this.set("additionalFavoritesPlaceholder",n("Discuss this post if you like...")),s.isEmpty(this.get("sendingPlaceholder"))&&this.set("sendingPlaceholder",n("Sending...")),this.set({currentPlaceholder:this.get("defaultPlaceholder"),senderBlog:e}),this.additionalFavoritesIds=s.pluck(s.invoke(this.additionalFavorites,"toJSON"),"uuid"),this.channelIds=this.channels.pluck("uuid"),this.selectedRecipientModel=new C,this.blogSelectorPlugin=new f({collection:this.channels,currentTumblelog:e,popoverOptions:{popoverContainer:this.popoverContainer}}),this.pluginsArray=[this.blogSelectorPlugin],this.disableKeys()},afterRenderSubviews:function(){this.loader=new h({$container:this.$el,type:"bar",classModifiers:"top",loading:!1}),this._onSearchInputDebounced=s.bind(s.debounce(function(){this._onSearchInput(this.searchView.getQuery())},250),this),this.listenTo(this.selectedRecipientModel,"change:participant",this._onChangeSelectedRecipient),this.listenTo(this,"change:isSending",this._onChangeIsSending),this.listenTo(this,"change:isDisabled",this._onChangeIsDisabled),this.listenTo(this,"change:isLoading",this._onChangeIsLoading),this.listenTo(this,"change:isLoadingFavorites",this._onChangeisLoadingFavorites),this.listenTo(this,"change:isEmpty",this._onChangeIsEmpty),this.listenTo(this,"change:isShowFavorites",this._onChangeIsShowFavorites),this.listenTo(this,"change:isShowExternalNetworksRow",this._onChangeIsShowExternalNetworksRow),this.listenTo(this,"change:isShowMessage",this._onChangeIsShowMessage),this.listenTo(this,"change:currentPlaceholder",this._onChangeCurrentPlaceholder),this.listenTo(this,"change:focusIndex",this._onChangeFocusIndex),this.listenTo(this.blogSelectorPlugin.getBlogSelector(),"change:currentTumblelog",this._onBlogSelectorChange),this.listenTo(this.messageView,"submit:animated",this._onMessageSubmit),this.listenTo(this.searchView,"search",this._onSearchInputDebounced),this.listenTo(this.searchView,"clear",this._onSearchClear),this.listenTo(this.searchView,"focus",this._onViewFocusChange),this.listenTo(this.searchView,"submit",this._onSearchSubmit),this.listenTo(this.messageView,"focus",this._onViewFocusChange),this.listenTo(this.resultsView,"focus",this._onViewFocusChange),this.listenTo(this.externalNetworksView,"focus",this._onViewFocusChange),this.listenTo(this.externalNetworksView,"share:subview:show",this._onExternalNetworkShowSubview),this.listenTo(this.externalNetworksView,"share:success",this._onExternalNetworkShareSuccess),this.listenTo(this.externalNetworksView,"share:fail",this._onExternalNetworkShareFail),this.listenTo(this.externalNetworksView,"share:click",this._onExternalNetworkClick),this.listenTo(this.collection,"sync",this._onCollectionSync),this._setViewStates(),this._fetchFavorites(),this._setCollectionState(),this.messageTheme=new y({removeDataAttrAfterApplyingTheme:!1,el:this.messageView.el}),this.searchTheme=new y({removeDataAttrAfterApplyingTheme:!1,el:this.searchView.el}),s.defer(s.bind(function(){this.rendered&&this.searchView.focus()},this)),this.keyboardManager.add("messagingshare:main",this),this.focusKeys()},beforeRemove:function(){this.keyboardManager.remove("messagingshare")},fetchByQuery:function(t){s.isEmpty(t)?this.set({isEmpty:!1,isShowFavorites:!0,isLoading:!1}):(this.set("isLoading",!0),this.collection.fetchByQuery(t,this.get("senderBlog").get("uuid")).always(s.bind(function(){this.rendered&&this.set("isLoading",!1)},this)))},getSelectedRecipient:function(){return this.selectedRecipientModel.get("participant")},clearSelectedRecipient:function(){this.selectedRecipientModel.set("participant",null)},sendPost:function(t,e){var i,n,r,a=this.shareData,l=s.get(this.shareData,"postId"),h=s.get(this.shareData,"blogUuid"),c=[],u=!s.isEmpty(t),d=this._getLoggingContext();this.get("isDisabled")||this.get("isSending")||s.isEmpty(a)||(n=b.createPostMessage(l,h,{context:d,creationUserAction:e}),c.push(n),u&&(r=b.createTextMessage(t,{context:d,creationUserAction:e}),c.push(r)),i=this._createConversation(),s.isEmpty(i)||(this.set("isSending",!0),i.appendToQueue(c),o.trigger("messaging:conversation:open:model",i,d),this.close()))},close:function(){this.trigger("close")},_createConversation:function(){var t=this.get("senderBlog"),e=this.getSelectedRecipient();if(s.isEmpty(t)||s.isEmpty(e))return null;var i=t.toJSON(),n=e.toJSON();return new b({participantUuid:t.get("uuid"),participants:[i,n]})},_onCollectionSync:function(t){var e;return!this.rendered||s.isEmpty(this.searchView.getQuery())?void this._setCollectionState():(this.clearSelectedRecipient(),e=0===this.collection.length,e&&this.errorView.setTitle(this.collection.getNoResultsFoundMessage()),this.set({isShowFavorites:!1,isEmpty:e}),void this._resetResultsScroll())},_resetResultsScroll:function(){this.resultsView.$el.scrollLeft(0)},_resetExternalNetworksScroll:function(){this.externalNetworksView.$el.scrollLeft(0)},_applyTheme:function(t){this.messageTheme.setTheme(t),this.searchTheme.setTheme(t)},_setViewStates:function(){var t=this.get("isShowMessage"),e=this.get("isEmpty"),i=this.get("isLoadingFavorites"),s=this.get("isShowExternalNetworksRow");this.js$("submission").toggleClass("show-submission",t),this.js$("external").toggle(s),this.errorView.$el.toggle(e),this.resultsView.toggle(!e),this.favoritesLoaderView.set("loading",i),this._setFocusViews()},_onSearchInput:function(t){this.rendered&&this.fetchByQuery(t)},_onSearchClear:function(){this.rendered&&(this.fetchByQuery(null),this.clearSelectedRecipient())},_onSearchSubmit:function(){this.get("isShowFavorites")||1===this.collection.length&&this.selectedRecipientModel.set("participant",this.collection.first())},_setPlaceholderState:function(){var t=this.getSelectedRecipient(),e=this.get("isSending"),i=!s.isEmpty(t)&&s.contains(this.additionalFavoritesIds,t.get("uuid"));return e?void this.set("currentPlaceholder",this.get("sendingPlaceholder")):void this.set("currentPlaceholder",i?this.get("additionalFavoritesPlaceholder"):this.get("defaultPlaceholder"))},_setButtonState:function(){var t=this.get("isSending"),e=this.get("isDisabled"),i=t||e;this.messageView.set("isDisabled",i)},_setDisabledState:function(){var t=this.getSelectedRecipient(),e=this.get("senderBlog"),i=!s.isEmpty(t)&&t.get("uuid")===e.get("uuid");this.set("isDisabled",i)},_setCollectionState:function(){this.get("isShowFavorites")&&this.collection.reset(this.favoritesCollection.toJSON())},_setFocusViews:function(){var t=[this.searchView],e=[];this.get("isEmpty")||this.get("isLoadingFavorites")||(t.push(this.resultsView),e.push(this.resultsView)),this.get("isShowExternalNetworksRow")&&(t.push(this.externalNetworksView),e.push(this.externalNetworksView)),this.get("isShowMessage")&&t.push(this.messageView),this._focusViews=t,this._tabbableViews=e},_getLoggingContext:function(){var t,e,i=this.get("baseLoggingContext"),n=this.getSelectedRecipient();return s.isEmpty(n)?i:(t=s.contains(this.additionalFavoritesIds,n.get("uuid")),e=t?"trail":this.get("isShowFavorites")?"favorites":"search",i+":"+e)},_onChangeIsSending:function(t,e){this._setButtonState(),this._setPlaceholderState()},_onChangeIsDisabled:function(t,e){this._setButtonState()},_onChangeSelectedRecipient:function(t,e){var i=!s.isEmpty(e);i?(this.messageView.focus(),this._applyTheme(e.get("theme"))):this.searchView.focus(),this.set("isShowMessage",i),this._setViewStates(),this._setDisabledState(),this._setPlaceholderState()},_onChangeIsEmpty:function(){this._setViewStates()},_onChangeIsShowFavorites:function(){this._setCollectionState(),this._resetResultsScroll()},_onChangeIsShowExternalNetworksRow:function(){this._setViewStates(),this._resetExternalNetworksScroll()},_onChangeIsShowMessage:function(t,e){this.set("isShowExternalNetworksRow",!e)},_onBlogSelectorChange:function(t,e){this.set("senderBlog",e),this.messageView.focus(),this._setDisabledState()},_onChangeIsLoading:function(t,e){return this._loaderTimeout&&(clearTimeout(this._loaderTimeout),this._loaderTimeout=null),e?void(this._loaderTimeout=setTimeout(s.bind(function(){this.rendered&&(this.loader.set("loading",!0),this.$el.addClass(this.get("loadingClass")))},this),this.get("showLoadingAfterMs"))):(this.$el.removeClass(this.get("loadingClass")),void this.loader.set("loading",!1))},_onChangeisLoadingFavorites:function(){this._setViewStates()},_onMessageSubmit:function(t,e){this.sendPost(t,e)},_onChangeCurrentPlaceholder:function(t,e){this.messageView.setPlaceholder(e)},_addAdditionalFavorites:function(){!s.isEmpty(this.additionalFavorites)&&s.isArray(this.additionalFavorites)&&s.each(this.additionalFavorites.reverse(),function(t){var e=t.get("uuid"),i=this.favoritesCollection.get(e);s.contains(this.channelIds,e)||(s.isEmpty(i)?this.favoritesCollection.unshift(t):(this.favoritesCollection.remove(e),this.favoritesCollection.unshift(i)))},this)},_fetchFavorites:function(){this.set("isLoadingFavorites",!0),this.favoritesCollection.fetchFavorites(this.get("numFavorites"),null,!0).always(s.bind(function(){this.rendered&&(this._addAdditionalFavorites(),this._setCollectionState(),this.set("isLoadingFavorites",!1))},this))},_getFocusViews:function(){return this._focusViews},_moveFocusUp:function(){this.set("focusIndex",Math.max(0,this.get("focusIndex")-1))},_moveFocusDown:function(){var t=this._getFocusViews()||[];this.set("focusIndex",Math.min(t.length-1,this.get("focusIndex")+1))},_onViewFocusChange:function(t){var e=this._getFocusViews(),i=s.indexOf(e,t);this.set("tabbingView",s.contains(this._tabbableViews,t)?t:null),this.set("focusIndex",i,{silent:!0})},_onChangeFocusIndex:function(t,e){var i=s.get(this._getFocusViews(),e);this.set("tabbingView",s.contains(this._tabbableViews,i)?i:null),s.result(i,"focus")},_onKeyPressTab:function(t){var e=this.get("tabbingView");t.preventDefault(),s.isEmpty(e)||e.isLastFocused()?this._moveFocusDown():e.focusNext()},_onKeyPressShiftTab:function(t){var e=this.get("tabbingView");t.preventDefault(),s.isEmpty(e)||e.isFirstFocused()?this._moveFocusUp():e.focusPrevious()},_onKeyPressEscape:function(t){this.close(),t.preventDefault()},_onKeyPressUp:function(t){t.preventDefault(),this._moveFocusUp()},_onKeyPressDown:function(t){t.preventDefault(),this._moveFocusDown()},_onExternalNetworkShowSubview:function(t){var e="messagingshare:externalnetwork",i=new _({externalNetworkSubview:t});i.render(),this.disableKeys(),this.keyboardManager.add(e,i),this.listenToOnce(i,"goBack",function(){this.stopListening(t),this.keyboardManager.remove(e,i),this.enableKeys(),i.remove(),this.set("isShowingExternalNetworkSubview",!1),this.searchView.focus()}),this.listenToOnce(i,"close",function(){this.close()}),this.js$("external-network-subview-wrapper").html(i.$el),this.set("isShowingExternalNetworkSubview",!0)},_onExternalNetworkShareSuccess:function(t){setTimeout(s.bind(function(){this.rendered&&this.close()},this),this.get("closeAfterExternalNetworkShareMs")),this.trigger("external:success",t)},_onExternalNetworkShareFail:function(t){this.trigger("external:fail",t)},_onExternalNetworkClick:function(t){this.trigger("external:click",t)}});t.exports=x},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="searchView"></div><div class="messaging-share-post-main"><div class="messaging-share-post-results-wrapper"><div data-subview="errorView"></div><div data-subview="resultsView"></div><div data-subview="favoritesLoaderView"></div></div><div data-subview="loader"></div></div><div data-js-external class="messaging-share-post-external-networks-wrapper"><div data-subview="externalNetworksView"></div></div><div data-js-submission class="messaging-share-post-submission"><div data-subview="messageView"></div></div><div data-js-external-network-subview-wrapper></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(155),r=i(206),a=i(161),l=i(914),h=o.extend({className:"messaging-share-post-search",template:l,mixins:[r,a],events:{"input [data-js-input]":"_onInputChange","focus [data-js-input]":"_onInputFocus","blur [data-js-input]":"_onInputBlur",click:"_onContainerClick"},defaults:{hasSelectedBlogNameClass:"has-selected-blog",isFocused:!1,currentQuery:""},keycommands:{"keydown:backspace":"_onKeyPressBackspace","keydown:enter":"_onKeyPressEnter"},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"selectedRecipientModel","keyboardManager","keyboardNamespace")),this.disableKeys()},afterRender:function(){this.listenTo(this.selectedRecipientModel,"change:participant",this._onChangeSelectedRecipient),this.listenTo(this,"change:isFocused",this._onChangeIsFocused),this.listenTo(this,"change:currentQuery",this._onChangeCurrentQuery),this.js$("selected-blog").hide()},focus:function(){this.js$("input").focus()},getQuery:function(){return this.get("currentQuery")},_clearInput:function(){this._setInputValue()},_setInputValue:function(t){t=t||"",this.js$("input").val(t),this._prevVal=t},_getSelectedRecipient:function(){return this.selectedRecipientModel.get("participant")},_hasSelectedRecipient:function(){return!s.isEmpty(this._getSelectedRecipient())},_onChangeSelectedRecipient:function(t,e){this._setBlogPillRecipient(e),s.isEmpty(e)?this._setInputValue(this.get("currentQuery")):this._clearInput()},_setBlogPillRecipient:function(t){var e=!s.isEmpty(t);this.js$("selected-blog").text(e?t.get("name"):"").toggle(e),this.$el.toggleClass(this.get("hasSelectedBlogNameClass"),e)},_setCurrentQuery:function(t,e){e&&this.unset("currentQuery",{silent:!0}),this.set("currentQuery",t)},_onInputChange:function(t){var e,i,s=n(t.currentTarget).val();this._prevVal!==s&&(e=this.get("currentQuery"),i=this._hasSelectedRecipient()&&s===e,this._setCurrentQuery(s,i),this._prevVal=s)},_onKeyPressBackspace:function(t){this._hasSelectedRecipient()&&(t.preventDefault(),this._setCurrentQuery("",!0))},_onKeyPressEnter:function(t){t.preventDefault(),this.trigger("submit",this)},_onContainerClick:function(){this.focus()},_onInputFocus:function(){this.set("isFocused",!0)},_onInputBlur:function(){this.set("isFocused",!1)},_onChangeIsFocused:function(t,e){e?(this.keyboardManager.add(this.keyboardNamespace,this),this.trigger("focus",this)):(this.keyboardManager.remove(this.keyboardNamespace),this.trigger("blur",this))},_onChangeCurrentQuery:function(t,e){e=e||"",this._hasSelectedRecipient()&&this._setBlogPillRecipient(null),s.isEmpty(e)?this.trigger("clear"):this.trigger("search",e)}});t.exports=h},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="search-input-wrapper" data-js-search-container><div class="search-input-container"><input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="search-input" placeholder="'+__e(__("Message to..."))+'" data-js-input> <button class="selected-blog" data-js-selected-blog data-js-theme-accent-color-as-background></button></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(632),r=i(161),a=i(390),l=i(375),h=i(916),c=i(918),u=n.extend({className:"messaging-share-post-results",template:c,defaults:{isFocused:!1,focusedView:null,selectedView:null},mixins:[r,o,l],keycommands:{"keydown:left":"_onKeyPressLeft","keydown:right":"_onKeyPressRight","keydown:backspace":"_onKeyPressBackspace","keydown:shift+backspace":"_onKeyPressBackspace"},subviews:{resultView:{constructor:h,options:function(t){return{onSelect:s.bind(t._onSubviewSelect,t),onFocus:s.bind(s.partial(t._setIsFocusedDebounced,!0),t),
  onBlur:s.bind(s.partial(t._setIsFocusedDebounced,!1),t)}},collection:function(t){return t.collection}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"collection","selectedRecipientModel","keyboardNamespace","keyboardManager")),this.keyboardViewName="resultView",this.disableKeys()},afterRenderSubviews:function(){this.listenTo(this.collection,"reset update",this._onCollectionChange),this.listenTo(this,"change:isFocused",this._onChangeIsFocused),this.listenTo(this,"change:focusedView",this._onChangeFocusedView),this.listenTo(this,"change:selectedView",this._onChangeSelectedView),this.listenTo(this.selectedRecipientModel,"change:participant",this._onChangeSelectedRecipientModel),this._setIsFocusedDebounced=s.debounce(s.bind(this._setIsFocused,this),0),this.scrollbar=new a(this.$el),this.updateScrollbar()},resetFocus:function(){this.set("focusedView",null),this.deselect(this.keyboardViewName)},toggle:function(t){this.$el.toggle(t),t||this.resetFocus()},focus:function(){var t=this.get("selectedView"),e=!s.isEmpty(t);e&&this.setSelectedIndex(this.keyboardViewName,s.indexOf(this.resultView,t)),e?this.set("focusedView",this.getSelectedView(this.keyboardViewName)):this.focusFirst()},focusFirst:function(){this.set("focusedView",this.selectFirst(this.keyboardViewName))},focusLast:function(){this.set("focusedView",this.selectLast(this.keyboardViewName))},focusNext:function(){this.set("focusedView",this.selectNext(this.keyboardViewName))},focusPrevious:function(){this.set("focusedView",this.selectPrevious(this.keyboardViewName))},isLastFocused:function(){return this.isLastSelected(this.keyboardViewName)},isFirstFocused:function(){return this.isFirstSelected(this.keyboardViewName)},updateScrollbar:function(t){this.rendered&&this.scrollbar&&s.defer(s.bind(this.scrollbar.update,this.scrollbar))},beforeRemove:function(){this.keyboardManager.remove(this.keyboardNamespace),this.scrollbar&&this.scrollbar.destroy()},_onKeyPressLeft:function(t){t.preventDefault(),this.focusPrevious()},_onKeyPressRight:function(t){t.preventDefault(),this.focusNext()},_onKeyPressBackspace:function(t){t.preventDefault()},_onChangeFocusedView:function(t,e){var i=this.previous("focusedView");i&&i.setFocused(!1),e&&e.setFocused(!0)},_onChangeSelectedView:function(t,e){var i=this.previous("selectedView");i&&i.setSelected(!1),e&&e.setSelected(!0)},_onSubviewSelect:function(t,e){var i=t!==this.get("selectedView")?t:null,n=s.isEmpty(i)?null:e;this.selectedRecipientModel.set("participant",n),this.set("selectedView",i)},_setIsFocused:function(t){this.rendered&&this.set("isFocused",t)},_onChangeIsFocused:function(t,e){e?(this.keyboardManager.add(this.keyboardNamespace,this),this.trigger("focus",this)):(this.set("focusedView",null),this.keyboardManager.remove(this.keyboardNamespace),this.trigger("blur",this))},_onCollectionChange:function(){this.resetFocus(),this.updateScrollbar()},_onChangeSelectedRecipientModel:function(t,e){var i;return s.isEmpty(e)?void this.set("selectedView",null):(i=s.find(this.resultView,function(t){return t.model.get("uuid")===e.get("uuid")}),void this.set("selectedView",i))}});t.exports=u},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(917),r=i(672),a=n.extend({className:"messaging-share-post-result",tagName:"a",attributes:{href:"#",tabIndex:1},events:{click:"_onSelect",focus:"_onFocus",blur:"_onBlur"},defaults:{isSelected:!1,isFocused:!1,selectedClass:"is-selected",focusedClass:"is-focused"},template:o,initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"onSelect","onFocus","onBlur"))},afterRender:function(){this.listenTo(this,"change:isSelected",this._onChangeIsSelected),this.listenTo(this,"change:isFocused",this._onChangeIsFocused),this.conversationTheme=new r({theme:this.model.get("theme"),el:this.el}).render()},getTemplateData:function(){return{name:this.model.get("name"),title:this.model.get("title"),avatarUrl:this.model.getAvatarUrl(),avatarShape:this.model.getAvatarShape()}},setSelected:function(t){this.rendered&&this.set("isSelected",t)},setFocused:function(t){this.rendered&&this.set("isFocused",t)},_onSelect:function(t){t.preventDefault(),s.isFunction(this.onSelect)&&this.onSelect(this,this.model)},_onFocus:function(t){t.preventDefault(),s.isFunction(this.onFocus)&&this.onFocus(this,this.model)},_onBlur:function(t){t.preventDefault(),s.isFunction(this.onBlur)&&this.onBlur(this,this.model)},_onChangeIsSelected:function(t,e){this.$el.toggleClass(this.get("selectedClass"),e)},_onChangeIsFocused:function(t,e){this.$el.toggleClass(this.get("focusedClass"),e),e&&this.$el.focus()}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="container" data-js-theme-accent-color-on-grey><div class="avatar" data-js-theme-avatar-shape-class><img src="'+__e(avatarUrl)+'" alt="'+__e(name)+'" title="'+__e(name)+'"></div><div class="name">'+__e(name)+'</div><div class="title">',__p+=_.isEmpty(title)?"&nbsp;":__e(title),__p+="</div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="resultView[]"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(632),r=i(161),a=i(390),l=i(277),h=i(259),c=i(375),u=i(920),d=i(922),p=i(924),g=i(945),_=n.extend({className:"messaging-share-post-external-networks",template:g,defaults:{isLoading:!1,isFocused:!1,focusedView:null,isExternalSharingEnabled:!0},mixins:[r,o,c],keycommands:{"keydown:left":"_onKeyPressLeft","keydown:right":"_onKeyPressRight","keydown:backspace":"_onKeyPressBackspace","keydown:shift+backspace":"_onKeyPressBackspace"},subviews:{networkView:{constructor:d,options:function(t){return{onFocus:s.bind(s.partial(t._setIsFocusedDebounced,!0),t),onBlur:s.bind(s.partial(t._setIsFocusedDebounced,!1),t),onShowSubview:s.bind(t._onShowSubview,t),onShareSuccess:s.bind(t._onShareSuccess,t),onShareFail:s.bind(t._onShareFail,t),onShareClick:s.bind(t._onShareClick,t)}},collection:function(t){return t.collection}},networksLoaderView:{constructor:h,options:{className:"messaging-share-post-favorites-loader",variation:"small centered",loading:!1}}},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"keyboardNamespace","keyboardManager","externalNetworksDataModel")),this._setIsFocusedDebounced=s.debounce(s.bind(this._setIsFocused,this),0),this.keyboardViewName="networkView",this.collection=new u,this.disableKeys()},afterRenderSubviews:function(){if(this.listenTo(this.collection,"reset update",this._onCollectionChange),this.listenTo(this,"change:isFocused",this._onChangeIsFocused),this.listenTo(this,"change:focusedView",this._onChangeFocusedView),this.listenTo(this,"change:isLoading",this._onChangeIsLoading),this.listenTo(this.externalNetworksDataModel,"request",this._externalNetworksDataModelRequest),this.listenTo(this.externalNetworksDataModel,"sync",this._externalNetworksDataModelSync),this.scrollbar=new a(this.$el),this.updateScrollbar(!0),this._onChangeIsLoading(this,this.get("isLoading")),this.externalNetworksDataModel.isPopulated())this.updateComponents();else{if(!this.externalNetworksDataModel.isValid())return;this.externalNetworksDataModel.fetch()}},beforeRemove:function(){this.keyboardManager.remove(this.keyboardNamespace),this.scrollbar&&this.scrollbar.destroy()},resetFocus:function(){this.set("focusedView",null),this.deselect(this.keyboardViewName)},toggle:function(t){this.$el.toggle(t),t||this.resetFocus()},focus:function(){this.focusFirst()},focusFirst:function(){this.set("focusedView",this.selectFirst(this.keyboardViewName))},focusLast:function(){this.set("focusedView",this.selectLast(this.keyboardViewName))},focusNext:function(){this.set("focusedView",this.selectNext(this.keyboardViewName))},focusPrevious:function(){this.set("focusedView",this.selectPrevious(this.keyboardViewName))},isLastFocused:function(){return this.isLastSelected(this.keyboardViewName)},isFirstFocused:function(){return this.isFirstSelected(this.keyboardViewName)},updateScrollbar:function(t){this.rendered&&this.scrollbar&&s.defer(s.bind(this.scrollbar.update,this.scrollbar))},updateComponents:function(){this.collection.reset(s.map(this._getExternalNetworks(),function(t){return{component:t}}))},_setIsFocused:function(t){this.rendered&&this.set("isFocused",t)},_getExternalNetworks:function(){var t=this.get("isExternalSharingEnabled"),e=[{Constructor:p.Permalink,options:this._getPermalinkOptions,isExternal:!1},{Constructor:p.Embed,options:this._getEmbedOptions,isExternal:!1},{Constructor:p.Email,options:this._getEmailOptions,isExternal:!0},{Constructor:p.Flag,options:this._getFlagOptions,isExternal:!1},{Constructor:p.Facebook,options:this._getFacebookOptions,isExternal:!0},{Constructor:p.Twitter,options:this._getTwitterOptions,isExternal:!0},{Constructor:p.Pinterest,options:this._getPinterestOptions,isIncluded:this._isShowPinterest,isExternal:!0},{Constructor:p.Reddit,options:this._getRedditOptions,isExternal:!0}];return s.reduce(e,s.bind(function(e,i){var n;return!t&&i.isExternal?e:s.isFunction(i.isIncluded)&&!i.isIncluded.call(this)?e:(n=new i.Constructor(this._getBaseAndNetworkOptions(i.options.call(this))),e.push(n),e)},this),[])},_getPermalinkOptions:function(){return{}},_getEmbedOptions:function(){return{}},_getEmailOptions:function(){return{}},_getTwitterOptions:function(){var t=this.externalNetworksDataModel.get("twitter_username");return{isPopup:s.isEmpty(t),username:t}},_getFacebookOptions:function(){return{isPopup:!this.externalNetworksDataModel.get("has_facebook")}},_getPinterestOptions:function(){var t=this.externalNetworksDataModel.get("pinterest_share_window"),e=s.get(t,"url"),i=s.get(t,"dimensions");return{popupOptions:i,popupUrl:e}},_isShowPinterest:function(){return this.externalNetworksDataModel.get("show_pinterest")},_getRedditOptions:function(){return{}},_getFlagOptions:function(){return{}},_getBaseExternalNetworkOptions:function(){var t=this.externalNetworksDataModel.toJSON(),e=s.extend({},t,{id:s.get(t,"post_id")}),i=new l(e);return{postModel:i}},_getBaseAndNetworkOptions:function(t){return this._baseExternalNetworkOptions||(this._baseExternalNetworkOptions=this._getBaseExternalNetworkOptions()),s.extend({},this._baseExternalNetworkOptions,t)},_onKeyPressLeft:function(t){t.preventDefault(),this.focusPrevious()},_onKeyPressRight:function(t){t.preventDefault(),this.focusNext()},_onKeyPressBackspace:function(t){t.preventDefault()},_onChangeFocusedView:function(t,e){var i=this.previous("focusedView");i&&i.setFocused(!1),e&&e.setFocused(!0)},_onChangeIsFocused:function(t,e){e?(this.keyboardManager.add(this.keyboardNamespace,this),this.trigger("focus",this)):(this.set("focusedView",null),this.keyboardManager.remove(this.keyboardNamespace),this.trigger("blur",this))},_onCollectionChange:function(){this.resetFocus(),this.updateScrollbar()},_onShowSubview:function(t){this.trigger("share:subview:show",t)},_onShareSuccess:function(t){this.trigger("share:success",t)},_onShareFail:function(t){this.trigger("share:fail",t)},_onShareClick:function(t){this.trigger("share:click",t)},_onChangeIsLoading:function(t,e){this.networksLoaderView.set("loading",e)},_externalNetworksDataModelRequest:function(t){this.set("isLoading",!0)},_externalNetworksDataModelSync:function(t){this.set("isLoading",!1),this.updateComponents()}});t.exports=_},function(t,e,i){"use strict";var s=i(118),n=i(921),o=s.extend({model:n});t.exports=o},function(t,e,i){"use strict";var s=i(113),n=s.extend({defaults:{component:null}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(923),r=n.extend({className:"messaging-share-post-external-network",tagName:"a",attributes:{href:"#",tabIndex:1},events:{focus:"_onFocus",blur:"_onBlur",click:"_onClick"},defaults:{isFocused:!1,focusedClass:"is-focused"},template:o,initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"onFocus","onBlur","onShareSuccess","onShareFail","onShareClick","onShowSubview")),this.component=this.model.get("component")},getTemplateData:function(){return{label:this.component.getLabel()}},afterRender:function(){this.listenTo(this,"change:isFocused",this._onChangeIsFocused),this.listenTo(this.component,"share:fail",this._onShareFail),this.listenToOnce(this.component,"share:success",this._onShareSuccess),this._setLinkClass(),this._setLinkHref()},remove:function(){this.stopListening(this.component)},setFocused:function(t){this.rendered&&this.set("isFocused",t)},_setLinkHref:function(){var t=this.component.getButtonHref();s.isEmpty(t)||this.$el.attr({href:t,target:"_blank"})},_setLinkClass:function(){this.$el.addClass("network--"+this.component.getName())},_onFocus:function(t){t.preventDefault(),s.isFunction(this.onFocus)&&this.onFocus(this,this.model)},_onBlur:function(t){t.preventDefault(),s.isFunction(this.onBlur)&&this.onBlur(this,this.model)},_onClick:function(t){this.onShareClick&&this.onShareClick(this.component),this.component.isTypeHref()||(t.preventDefault(),this.component.isTypeCallback()?this.component.onClickHandler(t):this.component.isTypePopup()?this._openShareWindow():this.component.isTypeSubview()&&this.component.getSubviewInstance().then(s.bind(function(t){s.isFunction(this.onShowSubview)&&this.onShowSubview(t)},this))["catch"](s.bind(function(t){},this)))},_openShareWindow:function(){var t=this.component.getPopupUrl(),e=this.component.getPopupOptions(),i=this.component.getName();s.isEmpty(t)||window.open(t,i+"-share-dialog",e)},_onChangeIsFocused:function(t,e){this.$el.toggleClass(this.get("focusedClass"),e),e&&this.$el.focus()},_onShareSuccess:function(){s.isFunction(this.onShareSuccess)&&this.onShareSuccess(this.component)},_onShareFail:function(){s.isFunction(this.onShareFail)&&this.onShareFail(this.component)}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+=__e(label);return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(925),n=i(931),o=i(932),r=i(933),a=i(934),l=i(935),h=i(938),c=i(942);t.exports={Facebook:s,Reddit:n,Pinterest:o,Permalink:r,Embed:l,Flag:a,Email:h,Twitter:c}},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(100),r=i(926),a=i(928),l=r.extend({defaults:{isPopup:!0,username:null,getUsernameUrl:"/svc/facebook_status"},getName:function(){return"facebook"},getLabel:function(){return o("Facebook")},getType:function(){return this.get("isPopup")?r.TYPE_POPUP:r.TYPE_SUBVIEW},getPopupOptions:function(){return"width=626,height=436"},getPopupUrl:function(){var t=this.getPostTinyUrl()||this.getPostUrl();return"https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t)},getSubviewConstructor:function(){return a},getSubviewOptions:function(){return{username:this.get("username")}},afterSubviewCreated:function(t){n.isEmpty(this.get("username"))&&this._getUsername().then(n.bind(function(e){this.set("username",e),t.set("username",e)},this))},_getUsername:function(){return s.ajax({url:this.get("getUsernameUrl"),method:"POST",withFormKey:!0})}});t.exports=l},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(120),r=i(143),a=i(927),l=r.extend({name:"BaseExternalNetwork",initialize:function(t){n.extend(this.attributes,n.pick(t,n.keys(this.defaults))),n.extend(this,n.pick(t,"postModel"))},getName:function(){return null},getLabel:function(){return null},getType:function(){return l.TYPE_POPUP},getPopupUrl:function(){return null},getPopupOptions:function(){return null},getSubviewConstructor:function(){return null},getSubviewOptions:function(){return null},getButtonHref:function(){return null},onClickHandler:function(t){},getPostModel:function(){return this.postModel},getPostUrl:function(){return this.postModel.get("post_url")},getPostTinyUrl:function(){return this.postModel.get("post_tiny_url")},getShareUrl:function(){return"/svc/share/"+this.getName()},isTypePopup:function(){return this.isTypeEqual(l.TYPE_POPUP)},isTypeSubview:function(){return this.isTypeEqual(l.TYPE_SUBVIEW)},isTypeCallback:function(){return this.isTypeEqual(l.TYPE_CALLBACK)},isTypeHref:function(){return this.isTypeEqual(l.TYPE_HREF)},isTypeEqual:function(t){return this.getType()===t},createSubviewInstance:function(t){var e,i,s;return e=this.getSubviewConstructor(),n.isEmpty(e)?null:e.prototype instanceof a?(i=n.extend({},this.getSubviewOptions(),t),s=new e(i),this.listenToOnce(s,"remove",function(t){this.stopListening(t),this.afterSubviewRemoved(t)}),this.listenTo(s,"share",function(t,e){this.onSubviewShare(t,e)}),this.afterSubviewCreated(s),s):null},getSubviewInstance:function(t){var e=o.defer(),i=this.createSubviewInstance(t);return n.isEmpty(i)?e.reject("Could not create external network subview (subview constructor must extend ExternalNetworkEmbedSubview)."):e.resolve(i),e.promise},getShareRequestDataFromSubviewData:function(t){return t},sendShareRequest:function(t){return s.ajax({url:this.getShareUrl(),method:"POST",withFormKey:!0,data:t})},onSubviewShare:function(t,e){var i=this.getShareRequestDataFromSubviewData(t),s=n.extend({},this._getBaseShareRequestData(),i);return this._beforeShare(e,t),this.sendShareRequest(s).then(n.bind(function(){this._afterShareSuccess(e,t),this._afterShare(e,t)},this)).fail(n.bind(function(){this._afterShareFail(e,t),this._afterShare(e,t)},this))},afterSubviewCreated:function(t){},afterSubviewRemoved:function(t){},_getBaseShareRequestData:function(){var t=this.getPostModel(),e={post_id:t.get("post_id"),tumblelog_name:t.get("tumblelog_name")};return this.isTypeSubview()||n.extend(e,{share_fallback:!0}),e},_beforeShare:function(t,e){t.set({isSharing:!0,isShareSuccess:!1,isShareFail:!1}),this.trigger("share:start")},_afterShareSuccess:function(t,e){t.set({isShareSuccess:!0,isShareFail:!1}),t.onShareSuccess(e),this.trigger("share:success")},_afterShareFail:function(t,e){t.set({isShareFail:!0,isShareSuccess:!1}),t.onShareFail(e),this.trigger("share:fail")},_afterShare:function(t,e){t.set("isSharing",!1),t.afterShare(e),this.trigger("share:finished")}},{TYPE_POPUP:"popup",TYPE_SUBVIEW:"subview",TYPE_CALLBACK:"callback",TYPE_HREF:"href"});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(155),o=n.extend({defaults:{isSharing:!1,isShareSuccess:!1,isShareFail:!1},initialize:function(t){s.extend(this.attributes,s.pick(t,s.keys(this.defaults)))},getTitle:function(){return null},onShareSuccess:function(t){},onShareFail:function(t){},afterShare:function(t){},isShareSuccess:function(){return this.get("isShareSuccess")},isShareFail:function(){return this.get("isShareFail")},share:function(t){this.trigger("share",t,this)},close:function(){this.trigger("close",this)},remove:function(){return this.trigger("remove",this),n.prototype.remove.apply(this,arguments)}});t.exports=o},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(929),r=i(930),a=i(206),l=o.extend({className:"external-network-facebook-subview external-network-form-subview",template:r,mixins:[a],defaults:s.defaults({username:null,characterLimit:255},o.prototype.defaults),getTitle:function(){var t=this.get("username");return s.isEmpty(t)?n("Facebook"):n("Facebook (%1$s)",t)},afterRender:function(){this.listenTo(this,"change:username",this._onChangeUsername),s.defer(s.bind(this.focus,this)),o.prototype.afterRender.apply(this,arguments)},getTemplateData:function(){return{characterLimit:this.get("characterLimit")}},focus:function(){this.js$("message").focus()},onFormSubmit:function(t){var e=this.js$("message").val();this.share({message:e})},_onChangeUsername:function(){this.trigger("changeTitle",this.getTitle())}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(927),r=i(629),a=i(206),l=o.extend({tagName:"form",mixins:[a],className:"external-network-form-subview",defaults:s.defaults({isFormValid:!1,isShowConfetti:!0},o.prototype.defaults),events:{"click [data-js-success-container]":"_onSuccessContainerClick",submit:"_onFormSubmit"},initialize:function(t){s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),o.prototype.initialize.apply(this,arguments)},afterRender:function(){var t=this.getSubmitButtonElement();this.listenTo(this,"change:isFormValid",this._onChangeIsFormValid),this.listenTo(this,"change:isSharing",this._onChangeIsSharing),s.isEmpty(t)||(this.submitTextDefault=t.text(),this.submitTextSending=t.attr("data-text-sending")||n("Sending...")),this.validateForm(),this._setSubmitButtonState(),this._toggleElement(this.getShareFailElement(),!1),this._toggleElement(this.getShareSuccessElement(),!1)},getSubmitButtonElement:function(){return this.js$("submit-button")},getShareSuccessElement:function(){return this.js$("success-container")},getShareFailElement:function(){return this.js$("fail-container")},onShareSuccess:function(t){var e,i=this.getShareSuccessElement();this._toggleElement(i,!0),this._toggleElement(this.getShareFailElement(),!1),i&&this.get("isShowConfetti")&&(e=this._createConfettiView(),i.append(e.render().$el))},onShareFail:function(t){this._toggleElement(this.getShareFailElement(),!0),this._toggleElement(this.getShareSuccessElement(),!1)},isFormFieldsValid:function(){return!0},validateForm:function(){this.set("isFormValid",this.isFormFieldsValid())},setFormIsValid:function(t){this.set("isFormValid",t)},isFormValid:function(){return this.get("isFormValid")},onFormSubmit:function(t){},_createConfettiView:function(){return new r({className:"external-network-form-subview-confetti",autoParty:!0,amount:30,speed:.2})},_setSubmitButtonState:function(){var t=this.getSubmitButtonElement(),e=this.get("isFormValid"),i=this.get("isSharing"),s=!e||i;t.prop("disabled",s),t.text(i?this.submitTextSending:this.submitTextDefault)},_onChangeIsSharing:function(t,e){this._setSubmitButtonState()},_onChangeIsFormValid:function(t,e){this._setSubmitButtonState()},_onSuccessContainerClick:function(t){this.close()},_toggleElement:function(t,e){s.isEmpty(t)||t.toggleClass("visible",e)},_onFormSubmit:function(t){t.preventDefault(),this.onFormSubmit(t)}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="form-main"><textarea data-js-message maxlength="'+__e(characterLimit)+'" placeholder="'+__e(__("Message (Optional)"))+'" class="message textarea" aria-label="'+__e(__("Optional Facebook message content"))+'"></textarea></div><div class="form-result form-result--fail" data-js-fail-container> '+__e(__("Something went screwy."))+' </div><footer class="footer"><button type="submit" class="button tx-button blue" data-js-submit-button data-js-text-sending="'+__e(__("Sending..."))+'">'+__e(__("Send"))+'</button></footer><div class="form-result form-result--success" data-js-success-container> '+__e(__("Post shared!"))+" </div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(100),n=i(926),o=n.extend({getName:function(){return"reddit"},getLabel:function(){return s("Reddit")},getPopupOptions:function(){return"scrollbars=1,width=860,height=600"},getPopupUrl:function(){return"https://reddit.com/submit?url="+encodeURIComponent(this.getPostUrl())}});t.exports=o},function(t,e,i){"use strict";var s=i(100),n=i(926),o=n.extend({defaults:{popupUrl:null,popupOptions:null},getName:function(){return"pinterest"},getLabel:function(){return s("Pinterest")},getPopupOptions:function(){return this.get("popupOptions")},getPopupUrl:function(){return this.get("popupUrl")}});t.exports=o},function(t,e,i){"use strict";var s=i(100),n=i(926),o=n.extend({getName:function(){return"permalink"},getLabel:function(){return s("Permalink")},getType:function(){return n.TYPE_HREF},getButtonHref:function(){return this.getPostUrl()}});t.exports=o},function(t,e,i){"use strict";var s=i(109),n=i(100),o=i(926),r=o.extend({getName:function(){return"flag"},getLabel:function(){return n("Report")},getType:function(){return o.TYPE_CALLBACK},onClickHandler:function(t){s.trigger("abuseform:open",{mode:"post",post:this.getPostModel()})}});t.exports=r},function(t,e,i){"use strict";var s=i(100),n=i(926),o=i(936),r=n.extend({getName:function(){return"embed"},getLabel:function(){return s("Embed")},getType:function(){return n.TYPE_SUBVIEW},getSubviewConstructor:function(){return o},getSubviewOptions:function(){return{embedCode:this.postModel.getEmbedCode()}}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(927),r=i(937),a=i(206),l=o.extend({tagName:"form",className:"external-network-embed-subview external-network-form-subview",defaults:{embedCode:null},mixins:[a],events:{"click [data-js-embed-code]":"_onEmbedCodeClick"},template:r,getTitle:function(){return n("Embed")},getTemplateData:function(){return{embedCode:this.get("embedCode")}},afterRender:function(){s.defer(s.bind(this.selectEmbedCode,this))},selectEmbedCode:function(){var t=this.js$("embed-code");t.focus(),t.select()},_onEmbedCodeClick:function(t){this.selectEmbedCode()}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="form-main"><textarea spellcheck="false" readonly="readonly" data-js-embed-code class="embed-code textarea" aria-label="'+__e(__("Embed code"))+'">'+__e(embedCode)+"</textarea></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(926),r=i(939),a=o.extend({getName:function(){return"email"},getLabel:function(){return n("Email")},getType:function(){return o.TYPE_SUBVIEW},getSubviewConstructor:function(){return r},getShareRequestDataFromSubviewData:function(t){var e={message:s.get(t,"message"),email_address:s.get(t,"email")};return s.get(t,"isAllowReply",!1)&&s.extend(e,{allow_reply_to:!0}),e}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(940),r=i(929),a=i(941),l=r.extend({className:"external-network-email-subview external-network-form-subview",template:a,events:s.defaults({"input [data-js-email]":"_onEmailInput"},r.prototype.events),getTitle:function(){return n("Email")},afterRender:function(){s.defer(s.bind(this.focus,this)),r.prototype.afterRender.apply(this,arguments)},focus:function(){this.js$("email").focus()},isFormFieldsValid:function(){return o.isEmail(this.js$("email").val())},onFormSubmit:function(t){var e,i,s;this.isFormValid()&&(e=this.js$("email").val(),i=this.js$("message").val(),s=this.js$("allow-reply-checkbox").is(":checked"),this.share({email:e,message:i,isAllowReply:s}))},_onEmailInput:function(t){this.validateForm()}});t.exports=l},function(t,e,i){"use strict";var s=i(8),n={isBlank:function(t){return""===s.trim(t)},minLength:function(t,e){return t.length>=e},maxLength:function(t,e){return t.length<=e},range:function(t,e,i){return t.length>=e&&t.length<=i},pattern:function(t,e){return!!new RegExp(e,"gi").test(t)},isEmail:function(t){return this.pattern(t,"^[a-zA-Z0-9._+-]+@[a-zA-Z0-9][a-zA-Z0-9.-]*[.]{1}[a-zA-Z]{2,20}$")},isUrl:function(t){return this.pattern(t,"^\\s*((https?:)?[/\\\\]+)?([a-z0-9_-]+\\.){1,}([a-z\\.]{2,6})(/[^\\s]*)?\\s*$")},equals:function(t,e){return t===e},isPhoneNumber:function(t){return t&&/^\d+$/.test(t)&&(10===t.length||11===t.length)},isPostalCode:function(t){return t&&/^\d+$/.test(t)&&(5===t.length||9===t.length)}};t.exports=n},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="form-main"><input type="email" data-js-email placeholder="'+__e(__("To email"))+'" class="email input" aria-label="'+__e(__("To email"))+'"><textarea maxlength="255" data-js-message placeholder="'+__e(__("Message (Optional)"))+'" class="message textarea" aria-label="'+__e(__("Optional email message content"))+'"></textarea><label class="reply-option"><span class="binary-switch reply-switch"><input type="checkbox" data-js-allow-reply-checkbox> <span class="binary-switch-track"></span> <span class="binary-switch-button"></span> </span> '+__e(__("Let them reply to my email address"))+' </label></div><div class="form-result form-result--fail" data-js-fail-container> '+__e(__("Something went screwy."))+' </div><footer class="footer"><button type="submit" class="button tx-button blue" data-js-submit-button data-js-text-sending="'+__e(__("Sending..."))+'">'+__e(__("Send"))+'</button></footer><div class="form-result form-result--success" data-js-success-container> '+__e(__("Post shared!"))+" </div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(100),n=i(926),o=i(943),r=n.extend({defaults:{isPopup:!0,username:null,urlToken:"[URL]"},getName:function(){return"twitter"},getLabel:function(){return s("Twitter")},getType:function(){return this.get("isPopup")?n.TYPE_POPUP:n.TYPE_SUBVIEW},getPopupUrl:function(){var t=this.getPostTinyUrl()||this.getPostUrl();return"https://twitter.com/intent/tweet?url="+encodeURIComponent(t)},getPopupOptions:function(){return"width=550,height=420"},getSubviewConstructor:function(){return o},getSubviewOptions:function(){return{username:this.get("username"),urlToken:this.get("urlToken")}}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(100),o=i(929),r=i(944),a=i(206),l=o.extend({className:"external-network-twitter-subview external-network-form-subview",template:r,mixins:[a],defaults:s.defaults({username:null,urlToken:"[URL]",shortUrlLength:23,characterLimit:140,characterCount:0,characterCountExceedsLenghClass:"exceeds-length"},o.prototype.defaults),events:s.defaults({"input [data-js-message]":"_onMessageInput"},o.prototype.events),getTitle:function(){var t=this.get("username");return s.isEmpty(t)?n("Twitter"):n("Twitter (@%1$s)",t)},getTemplateData:function(){return{urlToken:this.get("urlToken")}},afterRender:function(){this.listenTo(this,"change:characterCount",this._onChangeCharacterCount),this._updateCharacterCount(),this._onChangeCharacterCount(this,this.get("characterCount")),s.defer(s.bind(this.focus,this)),o.prototype.afterRender.apply(this,arguments)},isFormFieldsValid:function(){var t=this.get("characterCount");return t>0&&t<=this.get("characterLimit")},onFormSubmit:function(t){this.isFormValid()&&this.share({message:this._getMessage()})},focus:function(){this.js$("message").focus()},_getMessage:function(){return this.js$("message").val()},_updateCharacterCount:function(){var t=this._calculateCharacterCount(this._getMessage());this.set("characterCount",t)},_updateCharacterCountContainer:function(t){var e=this.js$("character-count"),i=this.get("characterCountExceedsLenghClass"),s=this.get("characterLimit")-t;e.text(s).toggleClass(i,0>s)},_getUrlTokenCountFromMessage:function(t){var e=this.get("urlToken"),i=new RegExp(s.escapeRegExp(e),"ig"),n=t.match(i);return s.isEmpty(n)?0:n.length;
  },_getAdditionalUrLengthFromMessage:function(t){var e=this.get("urlToken"),i=this.get("shortUrlLength"),s=this._getUrlTokenCountFromMessage(t);return 0===s?0:s*i-s*e.length},_calculateCharacterCount:function(t){return t.length+this._getAdditionalUrLengthFromMessage(t)},_onChangeCharacterCount:function(t,e){this._updateCharacterCountContainer(e)},_onMessageInput:function(t){this._updateCharacterCount(),this.validateForm()}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<form class="form-main"><textarea data-js-message placeholder="'+__e(__("Message (Optional)"))+'" class="message textarea" aria-label="'+__e(__("Optional Twitter message content"))+'"> '+__e(urlToken)+'</textarea></form><div class="form-result form-result--fail" data-js-fail-container> '+__e(__("Something went screwy."))+' </div><footer class="footer"><button type="submit" class="button tx-button blue" data-js-submit-button data-js-text-sending="'+__e(__("Sending..."))+'">'+__e(__("Send"))+'</button><div data-js-character-count class="character-count"></div></footer><div class="form-result form-result--success" data-js-success-container> '+__e(__("Post shared!"))+" </div>";return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="networkView[]"></div><div data-subview="networksLoaderView"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(947),r=i(206),a=i(161),l=n.extend({className:"messaging-share-post-external-network-subview-wrapper",template:o,mixins:[r,a],events:{"click [data-js-back-button]":"_onBackButtonClick"},keycommands:{"keydown:escape":"_onKeyPressEscape"},initialize:function(t){s.extend(this.attributes,s.pick(t,s.keys(this.defaults))),s.extend(this,s.pick(t,"externalNetworkSubview"))},getTemplateData:function(){return{title:this.externalNetworkSubview.getTitle()}},afterRender:function(){this.externalNetworkSubview.render(),this.listenTo(this.externalNetworkSubview,"changeTitle",this._onSubviewChangeTitle),this.listenToOnce(this.externalNetworkSubview,"close",this._onSubviewClose),this.js$("external-network-subview").html(this.externalNetworkSubview.$el)},goBack:function(){this.trigger("goBack")},close:function(){this.trigger("close")},remove:function(){return this.externalNetworkSubview.remove(),n.prototype.remove.apply(this,arguments)},_onSubviewChangeTitle:function(t){this.js$("title").text(t)},_onSubviewClose:function(){this.close()},_onBackButtonClick:function(t){t.preventDefault(),this.goBack()},_onKeyPressEscape:function(t){t.preventDefault(),this.externalNetworkSubview.isShareSuccess()?this.close():this.goBack()}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="header"><a href="#" data-js-back-button class="back-button">'+__e(__("Back"))+'</a><div data-js-title class="title">'+__e(title)+'</div></div><div class="external-network-subview" data-js-external-network-subview></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(206),r=i(949),a=n.extend({className:"messaging-share-post-error",mixins:[o],template:r,defaults:{title:null},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults)))},setTitle:function(t){this.set("title",t)},getTemplateData:function(){return{title:this.get("title")}},afterRender:function(){this.listenTo(this,"change:title",this._onChangeTitle)},_onChangeTitle:function(t,e){this.js$("title").text(e)}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+="<p data-js-title>"+__e(title)+"</p>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(703),o=i(566),r=n.extend({className:"conversation-compose-plugin conversation-compose-plugin--blog-selector",defaults:s.defaults({currentTumblelog:null},n.prototype.defaults),renderWithTemplate:s.noop,initialize:function(t){t=s.extend({},t),s.extend(this.attributes,s.pick(t,s.keys(this.defaults)));var e=s.extend({className:"conversation-compose-plugin-blog-selector",showName:!1,showCaret:!1},s.pick(t,"collection","currentTumblelog","popoverOptions"));this.blogSelectorView=new o(e)},afterRender:function(){this.blogSelectorView.render(),this.$el.html(this.blogSelectorView.el)},getName:function(){return"blog-selector"},getBlogSelector:function(){return this.blogSelectorView}});t.exports=r},function(t,e,i){"use strict";var s=i(113),n=s.extend({defaults:{participant:null}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(113),o=n.extend({url:function(){return"/svc/post/share/"+this.get("tumblelog_name")+"/"+this.get("post_id")},defaults:{post_id:null,tumblelog_name:null,twitter_username:null,has_facebook:null,pinterest_share_window:null,show_pinterest:null,post_url:null},parse:function(t){return s.get(t,"response.share_popover_data",t)},isValid:function(){return!s.isEmpty(this.get("post_id"))&&!s.isEmpty(this.get("tumblelog_name"))},isPopulated:function(){return!s.isEmpty(this.get("post_url"))}});t.exports=o},,,,,,,,,,,,,,function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(143),r=i(109),a=i(540),l=i(541),h=i(967),c=i(969),u=o.extend({name:"AskComponent",initialize:function(t){t=t||{},this.user=t.user,this.user&&(this.blog=this.user.getChannel(),this.question=new c({recipient:null,anonymous:!1,question:""}),this.listenTo(r,"ask:form:open",this.presentAskForm),this.listenTo(this.question,"save:success",this.onSaveSuccess))},presentAskForm:function(t){return this.askFormView?this:(this.question.set("recipient",t.recipient),s("body").addClass("postforms-open"),r.trigger("drawer:suspend"),r.trigger("keycommands:suspend"),this.glass=new a,this.modal=new l,this.askFormView=new h({model:this.question,characterLimit:500,recipient:{name:t.recipient,allowAnonymous:t.allow_anonymous},sender:this.blog}),this.askFormView.render(),this.modal.setContentSubView(this.askFormView),this.glass.render().$el.appendTo("body"),this.modal.render().$el.appendTo("body"),this.glass.show().then(n.bind(this.modal.show,this.modal)),this.listenTo(this.askFormView,"close",this.dismissAskForm),this.listenTo(this.askFormView,"submit",this.submit),this)},beforeRemove:function(){this.dismissAskForm()},dismissAskForm:function(){this.askFormView&&(this.stopListening(this.askFormView),this.modal.hide(),this.modal.remove(),this.modal=null,this.glass.hide(),this.glass.remove(),this.glass=null,this.askFormView.remove(),this.askFormView=null,r.trigger("keycommands:resume"),r.trigger("drawer:resume"),r.trigger("ask:form:hidden"),s("body").removeClass("postforms-open"))},submit:function(t){this.question.set("anonymous",!!t.anonymous),this.question.set("question",t.question),this.question.save()},onSaveSuccess:function(){r.trigger("ask:form:success"),this.dismissAskForm()}});t.exports=u},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(179),r=i(155),a=i(161),l=i(206),h=i(968),c=r.extend({className:"ask-form",template:h,mixins:[a,l],keycommands:{"keydown:enter":"preventNewlines","keydown:escape":"dismiss"},events:{"click button.close":"dismiss","change .ask-anonymously-switch":"toggleAnonymous","submit form":"submit","input .ask-question":"onTextAreaUpdate"},initialize:function(t){this.characterLimit=t.characterLimit,this.sender=t.sender,this.recipient=t.recipient,this.onTextAreaUpdate=n.throttle(n.bind(this.onTextAreaUpdate,this),100),this.listenTo(this.model,"change:isSaving",this.toggleSubmit),this.listenTo(this.model,"save:success",this.render),this.listenTo(this.model,"save:error",this.displayErrors)},getTemplateData:function(){var t={};return t.recipient=n.clone(this.recipient)||{},t.recipient.allow_anonymous=t.recipient.allowAnonymous,t.sender=this.sender.toJSON(),t.sender.avatar_url=o(this.sender.get("avatar_url"))(128),t.character_limit=this.characterLimit,t},dismiss:function(){this.trigger("close")},toggleSubmit:function(t,e){e?this.disableSubmit():this.enableSubmit()},toggleAnonymous:function(t){var e=this.$(t.target);this.isAnonymous=e.prop("checked");var i=this.$$(".post_avatar_link"),s=this.$$(".ask-from .tumblelog_name"),n=this.$$(".ask-from .anonymous");this.isAnonymous?(i.removeClass("use_blog_avatar"),s.hide(),n.show()):(i.addClass("use_blog_avatar"),s.show(),n.hide())},submit:function(t){t.preventDefault(),this.trigger("submit",{question:this.$$(".ask-question").val(),anonymous:this.isAnonymous})},preventNewlines:function(t){t.preventDefault()},onTextAreaUpdate:function(){var t=this.$$(".ask-question").val(),e=t;t.match(/\n/g)&&(t=t.replace(/\n/g,""));var i=n.trim(t).length;i>0&&i<=this.characterLimit?this.enableSubmit():this.disableSubmit(),t!==e&&this.$$(".ask-question").val(t);var s=this.characterLimit-t.length,o=this.$$(".ask-character-count");o.text(s),100>=s?(o.addClass("active"),o.removeClass("count-ok count-warning count-danger"),s>40?o.addClass("count-ok"):s>20?o.addClass("count-warning"):o.addClass("count-danger")):o.removeClass("active")},enableSubmit:function(){this.model.get("isSaving")||this.$$(".ask-button").prop("disabled",!1)},disableSubmit:function(){this.$$(".ask-button").prop("disabled",!0)},showMessages:function(t,e){var i=this.$$("."+t),o=i.get(0);o&&(i.removeClass("active").hide().empty(),"string"==typeof e&&(e=[e]),n.each(e,n.bind(function(t){var e=s("<li/>",{text:t});i.append(e)},this)),i.show(),n.defer(function(){i.addClass("active")}))},displayErrors:function(t){this.showMessages("errors-ask",t)}});t.exports=c},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj){__p+='<div class="post_form_wrapper v_center_el"><div class="post_avatar"><a class="post_avatar_link use_blog_avatar animating" data-user-avatar-url="'+__e(sender.avatar_url)+'" data-avatar-url="'+__e(sender.avatar_url)+'" data-blog-url="'+__e(sender.blog_url)+'"><span class="post_avatar_link blog_avatar anonymous" data-anonymous-avatar-url="/images/anonymous_avatar_64.gif" style="background-image: url(/images/anonymous_avatar_64.gif)"></span> <span class="post_avatar_link blog_avatar new" style="background-image: url('+__e(sender.avatar_url)+')"></span></a></div><div class="post-container"><form enctype="multipart/form-data" class="active"><div class="post-container-inner post post-form--asks"><div class="post-form--header"><div class="controls-container"> ';var senderMarkup='<span class="ask-from"><span class="tumblelog_name">'+sender.name+'</span><span class="anonymous">'+__("anonymous")+"</span></span>",recipientMarkup='<span class="ask-recipient-label">'+recipient.name+"</span>";if(__p+=" "+(null==(__t=__('%1$s <span class="ask-to-label">to</span> %2$s',senderMarkup,recipientMarkup))?"":__t)+' <span class="ask-character-count"></span></div></div><div class="post-form--form post-content-text"><textarea class="ask-question" name="question" placeholder="'+__e(__("Ask me anything"))+'" maxlength="'+__e(character_limit)+'" autofocus></textarea></div><div class="post-form--bottom"><div class="post-form--controls"><div class="controls-container"><div class="control left"><button type="button" class="chrome flat close">'+__e(__("Close"))+"</button></div> ",recipient.allow_anonymous){__p+=' <div class="control right"><div class="ask-anonymously"> ';var randId=Math.floor(1e6*Math.random());__p+=' <label class="binary_switch"><input id="ask_anonymously_switch_'+__e(randId)+'" class="ask-anonymously-switch" type="checkbox" name="anonymous" value="1"> <span class="binary_switch_track"></span> <span class="binary_switch_button"></span></label><label class="ask-anonymously-label" for="ask_anonymously_switch_'+__e(randId)+'">'+__e(__("Ask anonymously"))+"</label></div></div> "}__p+=' <div class="control right"><button class="chrome blue ask-button" type="submit" disabled="disabled">'+__e(__("Ask"))+'</button></div></div></div><ul class="post-form--error-bar messages errors-ask"></ul></div></div></form></div></div>'}return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(113),n=i(3),o=i(100),r=s.extend({urlRoot:"/svc/post/ask",validate:function(t){return n.trim(t.question)?this.isUrl(t.question)?{error:o("Sorry, but please don't include links in questions.")}:void 0:{error:o("You need to enter a question!")}},isUrl:function(t){return!!(t.match(/(http|https):\/\//i)||t.match(/www\./i)||t.match(/[a-zA-Z0-9]+(\.arpa|\.root|\.aero|\.biz|\.cat|\.com|\.coop|\.edu|\.gov|\.info|\.int|\.jobs|\.mil|\.mobi|\.museum|\.name|\.net|\.org|\.pro|\.travel|TLD|\.ac|\.ad|\.ae|\.af|\.ag|\.ai|\.al|\.am|\.an|\.ao|\.aq|\.ar|\.as|\.at|\.au|\.aw|\.ax|\.az|\.ba|\.bb|\.bd|\.be|\.bf|\.bg|\.bh|\.bi|\.bj|\.bm|\.bn|\.bo|\.br|\.bs|\.bt|\.bv|\.bw|\.by|\.bz|\.ca|\.cc|\.cd|\.cf|\.cg|\.ch|\.ci|\.ck|\.cl|\.cm|\.cn|\.co|\.cr|\.cu|\.cv|\.cx|\.cy|\.cz|\.de|\.dj|\.dk|\.dm|\.do|\.dz|\.ec|\.ee|\.eg|\.er|\.es|\.et|\.eu|\.fi|\.fj|\.fk|\.fm|\.fo|\.fr|\.ga|\.gb|\.gd|\.ge|\.gf|\.gg|\.gh|\.gi|\.gl|\.gm|\.gn|\.gp|\.gq|\.gr|\.gs|\.gt|\.gu|\.gw|\.gy|\.hk|\.hm|\.hn|\.hr|\.ht|\.hu|\.id|\.ie|\.il|\.im|\.in|\.io|\.iq|\.ir|\.is|\.it|\.je|\.jm|\.jo|\.jp|\.ke|\.kg|\.kh|\.ki|\.km|\.kn|\.kr|\.kw|\.ky|\.kz|\.la|\.lb|\.lc|\.li|\.lk|\.lr|\.ls|\.lt|\.lu|\.lv|\.ly|\.ma|\.mc|\.md|\.mg|\.mh|\.mk|\.ml|\.mm|\.mn|\.mo|\.mp|\.mq|\.mr|\.ms|\.mt|\.mu|\.mv|\.mw|\.mx|\.my|\.mz|\.na|\.nc|\.ne|\.nf|\.ng|\.ni|\.nl|\.no|\.np|\.nr|\.nu|\.nz|\.om|\.pa|\.pe|\.pf|\.pg|\.ph|\.pk|\.pl|\.pm|\.pn|\.pr|\.ps|\.pt|\.pw|\.py|\.qa|\.re|\.ro|\.ru|\.rw|\.sa|\.sb|\.sc|\.sd|\.se|\.sg|\.sh|\.si|\.sj|\.sk|\.sl|\.sm|\.sn|\.so|\.sr|\.st|\.su|\.sv|\.sy|\.sz|\.tc|\.td|\.tf|\.tg|\.th|\.tj|\.tk|\.tl|\.tm|\.tn|\.to|\.tp|\.tr|\.tt|\.tv|\.tw|\.tz|\.ua|\.ug|\.uk|\.um|\.us|\.uy|\.uz|\.va|\.vc|\.ve|\.vg|\.vi|\.vn|\.vu|\.wf|\.ws|\.ye|\.yt|\.yu|\.za|\.zm|\.zw)/i))},save:function(t,e){e=e||{};var i=e.success,o=e.error;e.success=n.bind(function(t,e){if(n.isEmpty(n.result(e.response,"errors")))this.trigger("save:success"),i&&i.call(null,t,e);else{var s=e.response.errors[0];this.trigger("save:error",s),o&&o.call(null,t,s)}this.set("isSaving",!1)},this),e.error=n.bind(function(t,e){this.trigger("save:error",e),o&&o.call(null,t,e)},this),this.set("isSaving",!0);var r=s.prototype.save.call(this,t,e);!r&&this.validationError&&(this.trigger("save:error",this.validationError.error),this.set("isSaving",!1))}});t.exports=r},function(t,e,i){"use strict";var s=i(143),n=i(971),o=s.extend({name:"MobileNav",autoAppend:!0,view:function(){return this.data?new n(this.data):void 0}});t.exports=o},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(148),r=i(109),a=i(108),l=i(107),h=i(205),c=i(159),u=i(972),d=i(973),p=i(981),g=i(991),_=o.extend({className:"mobile-header",mixins:[h,c],template:u,defaults:{logged_in:!1},initialize:function(t){t=n.extend({},t),n.extend(this.attributes,n.pick(t,n.keys(this.defaults))),this.subViews.logoTitle=new d(t),this.subViews.navMenu=new p(t),l.bool("mobile_web_sticky_header")&&this.setSticky(),this.subViews.search=new g(t)},render:function(){return this.$el.html(this.template()),this.attachSubViews(),this},setSticky:function(){s("body").addClass("sticky-header"),this.lastPosition=a.rect().windowScrollTop,this.listenTo(r,"DOMEventor:flatscroll",this.getScrollDirection)},getScrollDirection:function(t){t.windowScrollTop>45?n.delay(n.bind(function(){this.$el.addClass("sticky")},this),500):this.$el.removeClass("sticky"),this.lastPosition<t.windowScrollTop&&t.windowScrollTop>45?this.$el.addClass("hide-nav"):this.$el.removeClass("hide-nav"),this.lastPosition=t.windowScrollTop}});t.exports=_},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div data-subview="navMenu"></div><div data-subview="logoTitle"></div><div data-subview="search"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(107),r=i(205),a=i(159),l=i(974),h=i(975),c=i(977),u=i(979),d=n.extend({className:"nav-logo-title",mixins:[r,a],template:l,initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t),this.subViews.logo=new h,o.bool("mobile_web_page_titles")&&this.get("page_title")&&this.get("logged_in")&&!this.get("search_term")?(this.subViews.pageTitle=new c(t),this.set("show_page_title",!0)):this.set("show_page_title",!1),this.set("show_search_field",!!this.get("search_term")),this.subViews.searchField=new u(t)},render:function(){return this.$el.html(this.template(this.toJSON())),this.attachSubViews(),this}});t.exports=d},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";Array.prototype.join;with(obj)__p+='<div class="mobile-logo-wrapper',show_page_title&&(__p+=" show-page-title "),__p+=" ",!_.isUndefined(show_search_field)&&show_search_field&&(__p+=" show-search-field "),__p+='"><div data-subview="logo"></div><div data-subview="pageTitle"></div><div data-subview="searchField"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(148),n=i(976),o=s.extend({template:n,className:"mobile-logo",render:function(){return this.$el.html(this.template()),this}});t.exports=o},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<a href="/" class="logo-link"><svg class="svg-logo" width="29px" height="39px" viewBox="0 0 29 39" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path class="inner" d="M13.4404585,32.9978573 L13.1859215,33 C5.40091922,33 3.7112324,27.2768093 3.7112324,23.9359304 L3.7112324,14.6527709 L0.644574576,14.6527709 C0.288572835,14.6527709 0,14.3641866 0,14.0082147 L0,9.6266323 C0,9.1644545 0.291787135,8.7523442 0.72736069,8.5979279 C4.72423734,7.1880393 5.97738627,3.70267176 6.16328007,1.05159549 C6.21292323,0.34336573 6.58403216,0 7.20071368,0 L11.7729503,0 C12.1289164,0 12.4175249,0.28854863 12.4175249,0.64452051 L12.4175249,8.0664341 L17.7675867,8.0664341 C18.1235885,8.0664341 18.4121613,8.3550185 18.4121613,8.7109547 L18.4121613,13.9746459 C18.4121613,14.3306178 18.1235885,14.6191665 17.7675867,14.6191665 L12.3906676,14.6191665 L12.3906676,23.2008456 C12.3906676,25.3559968 13.8110674,25.9521997 14.6886074,25.9521997 C15.5299686,25.9319513 16.3586512,25.6757572 16.7738319,25.5090561 C17.0821548,25.3853159 17.3529775,25.3033938 17.595693,25.3640676 C17.8213012,25.420456 17.9700163,25.5802291 18.0701239,25.8719917 L19.4885237,30.0155572 C19.6024885,30.3446026 19.702489,30.70361 19.464595,30.9576614 C18.3476967,32.1504243 15.7600055,32.9595389 13.4404585,32.9978573 L13.4404585,32.9978573 Z"></path></svg> </a>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(159),r=i(978),a=n.extend({template:r,className:"page-title",mixins:[o],initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t)},render:function(){return this.$el.html(this.template(this.toJSON())),this}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+=__e(page_title);return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(109),r=i(159),a=i(980),l=i(395),h=n.extend({template:a,className:"search-field",mixins:[r],events:{"submit form":"__submitForm"},__submitForm:function(){this.toggleLoader(!0)},__handleSearchClick:function(){var t=this.$searchInput.val();this.$el.hasClass("search-term-exists")?t===this.get("search_term")?this.setFocus():this.$submitForm.trigger("submit"):!t&&this.$mobileLogoWrapper.hasClass("show-search-field")?this.hideSearchField():t&&this.$mobileLogoWrapper.hasClass("show-search-field")?this.$submitForm.trigger("submit"):this.showSearchField()},__handleNsfwFilterClick:function(t){this.$searchNsfwFilterInput.val(t),this.$submitForm.prop("action","/search/"+this.get("search_term")),this.$searchInput.prop("name",""),this.$submitForm.trigger("submit")},__handleFilterChange:function(t){var e="top";"CREATED_DESC"===t.get("sort")&&(e="recent");var i=t.get("post_type").toLowerCase();this.$searchFilterSortInput.val(e),this.$searchFilterPostTypeInput.val(i),this.$searchNsfwFilterInput.val(t.get("filter_nsfw")),this.$submitForm.prop("action","/search/"+this.get("search_term")),this.$searchInput.prop("name",""),this.$submitForm.trigger("submit")},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t),this.listenTo(o,"mobileHeader:search:click",this.__handleSearchClick),this.listenTo(o,"mobileHeader:nsfw:update",this.__handleNsfwFilterClick),this.listenTo(o,"mobileHeader:filter:update",this.__handleFilterChange),this.listenTo(o,"drawer:open",this.hideSearchField)},render:function(){return this.get("search_term")&&this.$el.addClass("search-term-exists"),this.$el.html(this.template(this.toJSON())),this.$searchInput=this.$(".search-input"),this.$searchNsfwFilterInput=this.$(".search-nsfw-filter-input"),this.$searchFilterSortInput=this.$(".filter-sort-input"),this.$searchFilterPostTypeInput=this.$(".filter-post-type-input"),this.$submitForm=this.$("form"),this.$mobileLogoWrapper=this.$el.parent(),this},toggleLoader:function(t){t?this.loader?this.loader.set("loading",!0):this.loader=new l({$container:this.$el,type:"bar",classModifiers:"top",loading:!0}):this.loader.set("loading",!1)},showSearchField:function(){this.$mobileLogoWrapper.addClass("show-search-field"),s.delay(s.bind(this.setFocus,this),250)},hideSearchField:function(){this.$searchInput.blur(),this.$mobileLogoWrapper.removeClass("show-search-field")},setFocus:function(){var t=2*this.$searchInput.val().length;this.$searchInput.focus(),this.$searchInput.get(0).setSelectionRange(t,t)}});t.exports=h},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<form action="/search" method="get"><input type="text" placeholder="'+__e(__("Search Tumblr"))+'" autocomplete="off" class="search-input" id="search-input" name="q" value="',search_term&&(__p+=__e(search_term)),__p+='"> <input type="hidden" class="search-nsfw-filter-input" name="filter_nsfw"> <input type="hidden" class="filter-sort-input" name="sort" value="top"> <input type="hidden" class="filter-post-type-input" name="filter_post_type" value="any"> '+(null==(__t=_subview("loader"))?"":__t)+" </form>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(148),r=i(205),a=i(159),l=i(109),h=i(982),c=i(983),u=i(989),d=o.extend({className:"nav-menu",template:h,mixins:[r,a],events:{"click .menu-burger":"__clickMenuBurger","click [data-subnav]":"__clickSubnav","click .sneeze-guard":"__clickSneezeGuard"},__clickSneezeGuard:function(t){t.preventDefault(),this.closeDrawer()},__clickSubnav:function(t){t.preventDefault(),this.openSubNav(n(t.currentTarget).data("subnav"))},__clickMenuBurger:function(t){t.preventDefault(),this.toggleDrawer()},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t),this.get("drawer_open")&&this.openDrawer(),this.get("logged_in")?this.subViews.drawer=new c(t):this.subViews.drawer=new u(t),this.listenTo(l,"mobileHeader:search:click",this.closeDrawer)},render:function(){return this.$el.html(this.template()),this.$body=n("body"),this.$html=n("html"),this.attachSubViews(),this},toggleDrawer:function(){this.$el.hasClass("subnav-active")?this.closeSubNav():this.get("drawer_open")?this.closeDrawer():this.openDrawer()},openDrawer:function(){this.set("drawer_open",!0),this.$body.addClass("nav-drawer-open"),this.$html.addClass("nav-drawer-open"),this.$el.addClass("active"),l.trigger("drawer:open")},closeDrawer:function(){this.set("drawer_open",!1),this.$body.removeClass("nav-drawer-open"),this.$html.removeClass("nav-drawer-open"),this.$el.removeClass("active subnav-active"),l.trigger("drawer:closed")},openSubNav:function(t){this.$el.addClass("subnav-active"),l.trigger("drawer:subnav:open",t)},closeSubNav:function(){this.$el.removeClass("subnav-active"),l.trigger("drawer:subnav:close")}});t.exports=d},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="menu-burger"><div class="burger bun top"></div><div class="burger patty"></div><div class="burger bun bottom"></div></div><div class="drawer" data-subview="drawer"></div><div class="sneeze-guard"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(159),r=i(205),a=i(984),l=i(985),h=i(987),c=n.extend({template:a,mixins:[r,o],className:"drawer logged-in",initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t),this.subViews.primaryNav=new l(t),this.subViews.secondaryNav=new h(t)},render:function(){return this.$el.html(this.template(this.toJSON())),this.attachSubViews(),this}});t.exports=c},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="nav-wrapper"><div data-subview="primaryNav"></div><div data-subview="secondaryNav"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(159),r=i(986),a=n.extend({template:r,mixins:[o],className:"primary-nav",initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t)},render:function(){return this.$el.html(this.template(this.toJSON())),this}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<nav class="nav-site-sections"><a href="/dashboard" class="nav-item with-icon"><span class="nav-text nav-item-dashboard">'+__e(__("Dashboard"))+'</span></a><a href="/likes" class="nav-item with-icon"><span class="nav-count">',parseInt(likes,10)>0&&(__p+=__e(likes)),__p+=' </span><span class="nav-text nav-item-likes">'+__e(__("Likes"))+'</span></a><a href="/following" class="nav-item with-icon"><span class="nav-count">'+__e(following)+'</span><span class="nav-text nav-item-following">'+__e(__("Following"))+'</span></a><a href="/settings" class="nav-item with-icon" data-subnav="settings"><span class="nav-text nav-item-settings has-subnav">'+__e(__("Settings"))+'</span></a><a href="'+__e(url_prefix)+'/new/text" class="nav-item with-icon"><span class="nav-text nav-item-create-post">'+__e(__("Create a post"))+'</span></a></nav><nav class="nav-blog-list"><span class="nav-section-title">'+__e(__("Blogs"))+"</span> ",_.each(blogs,function(t){__p+=' <a href="'+__e(t.url)+'" class="nav-item"><img src="'+__e(t.avatar)+'" class="blog-avatar"><div class="blog-name-wrapper"><span class="blog-name">'+__e(t.name)+'</span><span class="blog-title">'+(null==(__t=t.safe_title)?"":__t)+"</span></div></a> "}),__p+=" </nav>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(159),r=i(109),a=n.extend({mixins:[o],className:"secondary-nav",templates:{settings:i(988)},_getTemplate:function(t){return"settings"===t?this.templates.settings(this.toJSON()):void 0},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t),this.listenTo(r,"drawer:subnav:open",this.render)},render:function(t){return t&&this.$el.html(this._getTemplate(t)),this}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<nav class="nav-site-sections"><a href="/settings/password" class="nav-item"><span class="nav-text">'+__e(__("Change Password"))+'</span></a><a href="/settings/tfa" class="nav-item"><span class="nav-text">'+__e(__("Two Factor Authentication"))+'</span></a><a href="/help" class="nav-item"><span class="nav-text">'+__e(__("Help"))+'</span></a><a href="/settings/account" class="nav-item" target="_blank"><span class="nav-text desktop-view">'+__e(__("Account"))+'</span></a><a href="/settings/notifications" class="nav-item" target="_blank"><span class="nav-text desktop-view">'+__e(__("Notifications"))+'</span></a><a href="/settings/apps" class="nav-item" target="_blank"><span class="nav-text desktop-view">'+__e(__("Apps"))+"</span></a></nav>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(159),r=i(109),a=i(990),l=n.extend({template:a,mixins:[o],className:"drawer logged-out",initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t),this.listenToOnce(r,"drawer:open",this.downloadBackground)},downloadBackground:function(){var t=new Image,e=this.$splashBg.data("img-src");t.onload=s.bind(function(){this.$splashBg.css("background-image","url("+e+")"),this.$splashBg.addClass("loaded")},this),t.src=e},render:function(){return this.$el.html(this.template(this.toJSON())),this.$splashBg=this.$(".splash-bg"),this}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="splash-bg" data-img-src="'+__e(splash.image)+'"></div><div class="splash-sections"><div class="splash-section top"><a href="/login" class="splash-login">'+__e(__("Log in"))+'</a></div><div class="splash-section middle"><div class="middle-inner"><span class="splash-pitch">'+__e(__("Splash headline"))+'</span><a href="/register" class="signin tx-button blue" role="button">'+__e(__("Get started"))+"</a> ",
  has_app&&(__p+='<a href="'+__e(app_url)+'" class="tx-button get-the-app" role="button">'+__e(__("Get the app"))+"</a>"),__p+=' </div></div><div class="splash-section bottom"><a href="'+__e(splash.url)+'" target="_blank" rel="nofollow" class="splash-avatar" style="background-image:url('+__e(splash.avatar)+')"></a> <a href="'+__e(splash.url)+'" target="_blank" rel="nofollow" class="splash-name">'+__e(__("Posted by"))+"&nbsp;<strong>"+__e(splash.name)+"</strong></a></div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(109),o=i(148),r=i(205),a=i(159),l=i(992),h=i(993),c=i(995),u=i(1e3),d=o.extend({className:"nav-search",mixins:[r,a],template:l,events:{"click .search-label":"__searchLabelClick","click .filter-icon":"__filterIconClick"},__searchLabelClick:function(){n.trigger("mobileHeader:search:click")},togglePopover:function(){this.popover||(this.popover=new c({pinnedTarget:this.subViews.filterIcon.$el,model:this.model}),this.popover.render(),this.listenTo(this.popover,"close",this.onPopoverClose))},onPopoverClose:function(){s.defer(s.bind(function(){this.popover=null},this))},__filterIconClick:function(){this.togglePopover()},onFilterChange:function(t){n.trigger("mobileHeader:filter:update",t),this.popover.hide()},bindEvents:function(){this.model&&(this.listenTo(this.model,"change:sort",this.onFilterChange),this.listenTo(this.model,"change:post_type",this.onFilterChange),this.listenTo(this.model,"change:filter_nsfw",this.onFilterChange))},initialize:function(t){t=s.extend({},t),s.extend(this.attributes,t),this.get("logged_in")&&(this.subViews.filterIcon=new h,this.model=new u({showOriginalPostsSwitch:!1,showNsfwSwitch:!0,sort:this.get("filter_sort").toUpperCase(),post_type:this.get("filter_post_type").toUpperCase(),filter_nsfw:this.get("filter_nsfw")}),this.bindEvents())},render:function(){return this.$el.html(this.template(this.toJSON())),this.attachSubViews(),this},teardown:function(){this.popover&&this.popover.teardown()}});t.exports=d},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<span class="toggle-filter"><div data-subview="filterIcon"></div><div data-subview="filters"></div></span><span class="search-label" for="search-input"></span>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(155),n=i(994),o=s.extend({template:n,className:"filter-icon",render:function(){return this.$el.html(this.template()),this}});t.exports=o},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<i class="icon_filter"></i>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(996),n=i(998),o=s.extend({className:s.prototype.className+" blog-search-filters-popover",Subview:n});t.exports=o},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(149).transition,r=i(213),a=i(205),l=i(212),h=i(161),c=i(997),u=n.extend({className:"popover--blog-search",mixins:[a,l,h],template:c,keycommands:{"keydown:down":"targetNextLi","keydown:tab":"targetNextLi","keydown:up":"targetPrevLi","keydown:shift+tab":"targetPrevLi","keyup:enter":"selectLi"},defaults:{keycommands:!1,keyboardFocusClass:"keyboard_focus"},initialize:function(t){return this.options=s.defaults(t,this.defaults),this.Subview?(this.subview=new this.Subview(t),void this.bindEvents()):void this.remove()},render:function(){return this.$el.html(this.template()),this.$(".popover_inner").append(this.subview.render().$el),this.$main=this.$el.find(".popover"),s.delay(s.bind(function(){this.$main.addClass("popover--active"),this.bindClickOutside()},this),1),this},bindEvents:function(){this.listenTo(this.subview,"remove",this.hide),this.options.keycommands||this.disableKeys()},bindClickOutside:function(){this._popoverBase.autoTeardown&&(this.clickOutside=new r(this.el),this.clickOutside.on("click:outside",this.hide,this))},unbindClickOutside:function(){this.clickOutside&&(this.clickOutside.remove(),this.clickOutside=null)},targetNextLi:function(t){t.preventDefault(),this.$active?(this.$active.removeClass(this.options.keyboardFocusClass),this.$active=this.$active.next().length?this.$active.next():this.$(".popover_menu_item").first()):this.$active=this.$(".popover_menu_item").first(),this.$active.addClass(this.options.keyboardFocusClass),this.scrollToActive()},targetPrevLi:function(t){t.preventDefault(),this.$active?(this.$active.removeClass(this.options.keyboardFocusClass),this.$active=this.$active.prev().length?this.$active.prev():this.$(".popover_menu_item").last()):this.$active=this.$(".popover_menu_item").last(),this.$active.addClass(this.options.keyboardFocusClass),this.scrollToActive()},selectLi:function(){this.$active&&this.trigger("itemSelected",this.$active)},scrollToActive:function(){this.$scrollable=this.$scrollable||this.$(".popover_inner"),this.$scrollable.scrollTop(this.$scrollable.scrollTop()+this.$active.position().top-this.$scrollable.height()+this.$active.outerHeight())},hide:function(){this.$main.removeClass("popover--active"),this.unbindClickOutside(),o(this.$el,s.bind(function(){this.subview.remove(),this.remove(),this.teardown()},this))}});t.exports=u},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="popover popover_menu popover_gradient"><div class="popover_inner"></div></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(8),n=i(155),o=i(999),r=n.extend({template:o,events:{"click [data-filter]":"onFilterClick","click .sort_filter.toggle":"onToggleFilterClick","click .option-radio":"onCheckboxClick","change [type=checkbox]":"onCheckboxChange"},initialize:function(){this.bindEvents()},afterRender:function(){this.onPostTypeChange(),this.onSortChange(),this.onPostRoleChange(),this.onFilterNsfwChange()},bindEvents:function(){this.listenTo(this.model,"change:sort",this.onSortChange),this.listenTo(this.model,"change:post_type",this.onPostTypeChange),this.listenTo(this.model,"change:post_role",this.onPostRoleChange),this.listenTo(this.model,"change:filter_nsfw",this.onFilterNsfwChange)},onPostRoleChange:function(){this.$("#post_role").prop("checked",this.model.get("post_role")!==this.model.defaults.post_role)},onPostTypeChange:function(){this.$(".post_type_filter.active").removeClass("active"),this.$('[data-filter="post_type:'+this.model.get("post_type")+'"]').addClass("active")},onFilterNsfwChange:function(){this.$(".search-nsfw-filter-checkbox-input").prop("checked",this.model.get("filter_nsfw")!==this.model.defaults.filter_nsfw)},onSortChange:function(){this.$(".sort_filter.active").removeClass("active"),this.$('[data-filter="sort:'+this.model.get("sort")+'"]').addClass("active")},onFilterClick:function(t){var e=s(t.currentTarget).data("filter").split(":");this.model.set(e[0],e[1])},onCheckboxChange:function(t){var e=s(t.currentTarget),i=t.currentTarget.id,n=e.data("value"),o=e.prop("checked");this.model.set(i,o?n:this.model.defaults[i])},onCheckboxClick:function(t){t.stopPropagation()},onToggleFilterClick:function(t){var e=s(t.currentTarget).find("[type=checkbox]"),i=e.prop("checked");e.prop("checked",!i).trigger("change")}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<ul class="popover_inner_list search_filter_items"><li class="popover_menu_item sort_filter" data-filter="sort:POPULARITY_DESC"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> '+__e(__("Top Posts"))+' </span></li><li class="popover_menu_item sort_filter" data-filter="sort:CREATED_DESC"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> '+__e(__("Recent Posts"))+" </span></li></ul> ",model.showOriginalPostsSwitch&&(__p+=' <ul class="popover_inner_list search_filter_items"><li class="popover_menu_item sort_filter toggle"><span class="popover_menu_item_anchor"><div class="option-radio"><label class="binary_switch"><input type="checkbox" name="post_role" id="post_role" data-value="ORIGINAL"> <span class="binary_switch_track"></span> <span class="binary_switch_button"></span></label></div> '+__e(__("Original Posts"))+" </span></li></ul> "),__p+=' <ul class="popover_inner_list search_filter_items"><li class="popover_menu_item post_type_filter" data-filter="post_type:ANY"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> '+__e(__("All Types"))+' </span></li><li class="popover_menu_item post_type_filter post_text_filter" data-filter="post_type:TEXT"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> <i class="icon post_type_icon icon_post_text_small"></i> '+__e(__("Text"))+' </span></li><li class="popover_menu_item post_type_filter post_photo_filter" data-filter="post_type:PHOTO"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> <i class="icon post_type_icon icon_post_photo_small"></i> '+__e(__("Photo"))+' </span></li><li class="popover_menu_item post_type_filter post_quote_filter" data-filter="post_type:QUOTE"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> <i class="icon post_type_icon icon_post_quote_small"></i> '+__e(__("Quote"))+' </span></li><li class="popover_menu_item post_type_filter post_link_filter" data-filter="post_type:LINK"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> <i class="icon post_type_icon icon_post_link_small"></i> '+__e(__("Link"))+' </span></li><li class="popover_menu_item post_type_filter post_chat_filter" data-filter="post_type:CHAT"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> <i class="icon post_type_icon icon_post_chat_small"></i> '+__e(__("Chat"))+' </span></li><li class="popover_menu_item post_type_filter post_audio_filter" data-filter="post_type:AUDIO"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> <i class="icon post_type_icon icon_post_audio_small"></i> '+__e(__("Audio"))+' </span></li><li class="popover_menu_item post_type_filter post_video_filter" data-filter="post_type:VIDEO"><span class="popover_menu_item_anchor"><i class="icon icon_checkmark"></i> <i class="icon post_type_icon icon_post_video_small"></i> '+__e(__("Video"))+" </span></li></ul> ",model.showNsfwSwitch&&(__p+=' <ul class="popover_inner_list search_filter_items"><li class="popover_menu_item sort_filter toggle"><span class="popover_menu_item_anchor"><div class="option-radio"><label class="binary_switch"><input type="checkbox" name="filter_nsfw" id="filter_nsfw" data-value="true" class="search-nsfw-filter-checkbox-input"> <span class="binary_switch_track"></span> <span class="binary_switch_button"></span></label></div> '+__e(__("Safe search"))+" </span></li></ul> ");return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(109),o=i(113),r=i(118),a=o.extend({urlRoot:"/svc/search/blog_search",defaults:{next_offset:0,limit:10,sort:"CREATED_DESC",post_type:"ANY",term:"",unsetTerm:"",post_role:"ANY",filter_nsfw:!1,showOriginalPostsSwitch:!0,showNsfwSwitch:!1},initialize:function(){this.listenTo(this,"change:unsetTerm",this.onUnsetTermChange),this.listenTo(n,"peeprsearch:change:term",this.onTermSelect),this.listenTo(this,"change:term change:sort change:post_type change:post_role",this.resetSearch),this.posts=new r},resetSearch:function(){this.set(s.pick(this.defaults,["limit","next_offset"])),this.posts.reset(),this.trigger("search:reset")},reset:function(){this.posts.reset(),this.set(this.defaults),this.trigger("reset")},url:function(){return this.urlRoot+"/"+this.get("blogname")+"/"+this.get("term")},onTermSelect:function(t){this.search(t.term)},onUnsetTermChange:function(){n.trigger("peeprsearch:change:unsetTerm",{term:this.get("unsetTerm")})},search:function(t){t=t||this.get("unsetTerm"),t.length&&this.set("term",t)},fetch:function(){this.get("next_offset")<0||o.prototype.fetch.apply(this,arguments)},parse:function(t){return this.posts.length?s.each(t.response.posts,function(t){this.posts.add(t)},this):this.posts.reset(t.response.posts),delete t.response.posts,t.response},sync:function(t,e,i){"read"===t&&(i.data=this.pick("next_offset","limit","sort","post_type","post_role","filter_nsfw")),o.prototype.sync.apply(this,arguments)}});t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(143),r=i(109),a=i(102),l=i(1002),h=i(1003),c=o.extend({name:"YamPlusAd",counter:1,adConfiguration:{name:"LREC",sp:1197719223,ps:"LREC",ssl:1},initialize:function(t){this.listenTo(r,"darla:ready",this.setupFirstAd),this.listenTo(r,"darla:failure",this.checkAdexist),this.listenTo(r,"darla:success",this.checkAdexist),this.listenTo(r,"component:YamPlusAd",this.setupAd),window.DARLA_CONFIG||this.setupDarla()},$placeholderFor:function(t){return n("#yam-plus-ad-units-"+t)},canServeAds:function(){return window.DARLA},checkAdexist:function(t){if(this.canServeAds()&&t){var e=t[0].replace("LREC",""),i=this.$placeholderFor(e);0===i.find(".darla").length&&i.parents(".yamplus-unit-container").remove()}},setupDarla:function(){window.DARLA_CONFIG=l(this.setupFirstAd(!0)),h()},setupFirstAd:function(t){var e=n(".yam-plus-ad-container, .sidebar-ad-content").eq(0);if(!e.length)return null;var i=e.find(".yam-plus-ad-target"),s=i.attr("id"),o=e.attr("data-yam-ad-id"),r={dest:s,id:o};return t?r:this.setupAd(r)},setupAd:function(t){if(this.counter=this.counter+1,a.logSaw(this.name,"setupAd",window.DARLA),!this.canServeAds())return a.logSaw(this.name,"Cannot serve ads -- NO DARLA"),!1;t=s.defaults(t,{asz:"300x250",w:"300",h:"250",pos:"LREC-"+this.counter,id:!1,dest:!1,fdb:!0});var e="LRECP",i=s.defaults({name:e},this.adConfiguration);return a.logSaw(this.name,"DARLA.add",i),window.DARLA.add(i),window.DARLA.isAutoOn()||window.DARLA.startAuto(),window.DARLA.event("AUTO"),!0}});t.exports=c},function(t,e,i){"use strict";var s=i(3),n=i(109);t.exports=function(t){t=s.extend({dest:!1,id:!1},t);var e={positions:{DEFAULT:{w:"300",h:"250"},LREC:{dest:!1,id:!1}},events:{getEm:{ps:["LREC"],sp:1197719223},AUTO:{sp:1197719223,ps:{LREC:{autoRT:1e4,autoIV:1,autoMax:25,id:"LREC"}},autoStart:1,autoRT:1e4,autoDDG:1,ssl:!0,npv:!0}},onFailure:function(){n.trigger("darla:failure",arguments)},onSuccess:function(){n.trigger("darla:success",arguments)},onFinishParse:function(t,e){e.ps().forEach(function(t){""!==t.hasErr&&n.trigger("darla:failure",arguments)})}};return e.positions.LREC.dest=t.dest,e.positions.LREC.id=t.id,e}},function(t,e,i){"use strict";var s,n=("https:"===document.location.protocol?"https://":"http://")+"fc.yahoo.com/sdarla/php/client.php?f=1197719150",o=5,r=0,a=i(109),l=function h(){clearTimeout(s),s=null,window.DARLA&&!window.DARLA.inProgress()?a.trigger("darla:ready"):++r<o?s=setTimeout(h,1e3):a.trigger("darla:failure")};t.exports=function(){var t=document.createElement("script");t.async=!0;var e=document.getElementsByTagName("script")[0];t.src=n,e.parentNode.insertBefore(t,e),t.onload=l}},function(t,e,i){"use strict";var s=i(3),n=i(1005),o=n.extend({logKey:"dashboard_embed",logOptions:{init_event:!1},events:{"/^post:((?:un)?docked)$/":"handleEvent","post:embed:stateChange":"logStateChange"},handleEvent:function(t,e){var i=s.extend({},e);i.postData&&(i.post_id=i.postData.id,i.tumblelog=i.postData.tumblelog,delete i.postData),this.log(t,i)},logStateChange:function(t,e){if(!s.isEmpty(e)&&e.state&&e.postID&&e.service){if("tumblr"===e.service)return;this.log(e.state,{service:e.service,post_id:e.postID})}}});t.exports=o},function(t,e,i){"use strict";var s=i(7),n=i(3),o=i(144),r=i(109),a=i(102),l=[];l.push(i(1006));var h=/^\/(.+)\/([gimy]*)$/,c=o.extend({constructor:function(){this._eventHandlers=[],this.setupEndpoints(),this.initialize();var t=n.result(this,"events")||{};n.forEach(t,this._addEventHandlerByString,this);var e=n.result(this,"eventBus");this.listenTo(e,"all",this._handleEvent),a.log("LogLady","[instrument]",this.logKey)},logSpots:l,eventBus:r,_addEventHandlerByString:function(t,e){var i,s=e.match(h);if(s){var n=new RegExp(s[1],s[2]);i=function(t){var e=t.match(n);if(e){for(var i=new Array(e.length-1),s=0;s<e.length;s+=1)s>0&&(i[s-1]=e[s]);return i}}}else if("*"===e[e.length-1]){var o=e.substring(0,e.length-1);i=function(t){var e=t.indexOf(o);return 0===e?[t.substring(o.length,t.length)]:void 0}}else i=function(t){return t===e?[t]:null};this._addEventHandler(t,i)},_addEventHandler:function(t,e){this._eventHandlers.push({method:t,matcher:e})},_handleEvent:function(t,e){for(var i,s,o,r=this._eventHandlers.length-1;r>=0;r--)i=this._eventHandlers[r],o=i.callback||this[i.method],o&&(s=i.matcher.call(this,t,e),n.isArray(s)&&(e&&e.loggingData&&s.push(n.cloneDeep(e.loggingData)),o.apply(this,s)))},setupEndpoints:function(){var t=n.result(this,"logSpots");this.loggers=n(t).map(function(t){return t(this)},this).compact().value()},initialize:n.noop,log:function(){for(var t=this.loggers.length-1;t>=0;t--){var e=this.loggers[t];e.trigger.apply(e,arguments)}}},{start:function(){return this._setupInstance||(this._setupInstance=new this),this._setupInstance}});n.extend(c.prototype,s.Events),t.exports=c},function(t,e,i){"use strict";function s(t){var e=n.result(t,"logKey"),i=n.result(t,"logEnv");if(e){var s=n.result(t,"logOptions")||{};return i&&(s.env=i),o.log(e,s)}}var n=i(3),o=i(1007);t.exports=s},function(t,e,i){"use strict";var s=i(1008),n=i(1018),o=new s({EventClass:n,event_payload_name:"payload",event_filter:function(){return!0},endpoint:function(){return[window.location.protocol,"//",window.location.hostname,"/services/cslog"].join("")}});t.exports=o},function(t,e,i){"use strict";function s(t){this.watching={},this.pending_events=[],this.endpoint=t.endpoint,t.event_payload_name&&(this.event_payload_name=t.event_payload_name),t.event_filter&&(this.event_filter=t.event_filter),t.payload_formatter&&(this.payload_formatter=t.payload_formatter),n.bindAll(this,"_flush_from_timeout"),this._flush_from_timeout();var e=t.EventClass||m;this.Log=_.extend({EventClass:e}),o(window).on("beforeunload.log_lady",n.bind(this._flush_on_unload,this)),this.set_flush_rate()}var n=i(3),o=i(8),r=i(7),a=(i(102),i(107)),l=i(865),h=l.getRealNow,c=i(1009),u=i(1010),d=i(1011),p=[].slice,g=i(1012),_=i(1014),m=i(1017),f=1e3;n.extend(s.prototype,r.Events,{initialize:n.noop,defaults:{flush_rate:15*f},min_flush_rate:function(){var t=n.map(this.watching,function(t){return n.result(t,"flush_rate")});return t.push(this.defaults.flush_rate),n.min(t)},set_flush_rate:function(t){return t&&(this.defaults.flush_rate=t),this.flush_rate=this.min_flush_rate(),this.flush_is_overdue()&&this._flush_from_timeout(),this.flush_rate},flush:function(){var t=n.result(this,"endpoint"),e=this.build_payload();return!t||e[this.event_payload_name].length<1||!a.bool("log_lady")?void 0:(d(t,e,!this.unloading),this.last_flush_at=h(),!0)},_flush_on_unload:function(){this._flush_timeout&&clearTimeout(this._flush_timeout),this._trigger_unloads(),this.unloading=!0,this.flush()},_trigger_unloads:function(){var t;for(var e in this.watching)t=this.watching[e],"function"==typeof t.unloaded&&t.unloaded()},_flush_from_timeout:function(){this._flush_timeout&&clearTimeout(this._flush_timeout);var t=this.flush();t!==!1&&(this._flush_timeout=setTimeout(this._flush_from_timeout,this.flush_rate))},flush_is_overdue:function(){this.last_flush_at||(this.last_flush_at=h());var t=h()-this.last_flush_at;return t>this.flush_rate},watch:function(){var t,e,i,s=p.apply(arguments);for(i=0;i<s.length;i++)t=s[i],this.is_valid(t)&&(t.log_lady=this,this.watching[t.log_key]&&(e=this.watching[t.log_key],e&&n.isFunction(e.replaced)&&e.replaced(t)),this.watching[t.log_key]=t);return this.set_flush_rate(),this},unwatch:function(t){this.watching[t.log_key]&&t&&n.isFunction(t.replaced)&&t.replaced(),delete this.watching[t.log_key]},pending_log_events:function(){var t=this.pending_events;return this.pending_events=[],t},event_payload_name:"payload",payload_formatter:function(t){return t},event_filter:function(){return!0},build_payload:function(){var t=n.merge({},this.watching,[this]),e=n(t).collect(function(t){return t.pending_log_events()}).flatten().filter(this.event_filter).collect(n.bind(function(t){return t.json},this)).value(),i={};return i[this.event_payload_name]=this.payload_formatter(e),i},is_valid:function(t){var e=!!t;return e&&(e=n.result(t,"log_key")),e&&(e=n.result(t,"uuid")),e&&(e=n.isFunction(t.pending_log_events)),e},log:function(t,e){if(t){if(!(t in this.watching)){e&&e.log_key&&console.warn("log key gets overridden by log name");var i=g("keys",t);e=n.extend({},i,e,{log_key:t});var s=new this.Log(e);this.watch(s)}return this.watching[t]}},new_uuid:u}),s.extend=c,s.Log=_,t.exports=s},function(t,e,i){"use strict";function s(t,e){var i,s=this;i=t&&n.has(t,"constructor")?t.constructor:function(){return s.apply(this,arguments)},n.extend(i,s,e);var o=function(){this.constructor=i};return o.prototype=s.prototype,i.prototype=new o,t.defaults&&(n.extend(i.prototype.defaults,t.defaults),delete t.defaults),t&&n.extend(i.prototype,t),i.__super__=s.prototype,i}var n=i(3);t.exports=s},function(t,e){"use strict";function i(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,i="x"===t?e:3&e|8;return i.toString(16)})}t.exports=i},function(t,e,i){"use strict";function s(t,e,i){return!!r.ajax({url:t,type:"POST",data:JSON.stringify(e),contentType:"text/plain",async:i})}function n(t,e,i){var n=window.navigator.sendBeacon(t,JSON.stringify(e));return n||(n=s(t,e,i)),n}var o,r=i(8);o=window.navigator&&window.navigator.sendBeacon?n:s,t.exports=o},function(t,e,i){"use strict";function s(){for(var t,e=r.apply(arguments),i=o,s=0;s<e.length;s++){if(t=e[s],!i||!n.has(i,t))return null;i=i[t]}return i}var n=i(3),o=i(1013),r=[].slice;t.exports=s},function(t,e,i){"use strict";var s,n=i(99),o=function(){return s||(s=n.get("Components/LogLady")),s};t.exports=o()},function(t,e,i){"use strict";function s(t,e){t.uuid?(e=t,t=e.uuid):e||!t||n.isString(t)||(e=t,t=void 0),this.options=n.extend({},this.defaults,e),delete this.options.log_key,delete this.options.env,delete this.options.uuid,l(this,"uuid",t||this._generate_uuid()),e.env||(e.env={}),n.each(e.flags,function(t){e.env.flags||(e.env.flags={}),e.env.flags[t]=r.bool(t)}),l(this,"env",e.env),this.log_key=e.log_key||this.log_key,this.events=[],this.event_count=0,this.pending_events=[],this.event_counts={},this.started_at||(this.started_at=this.options.started_at||a.getRealNow()),delete this.options.started_at,this.initialize(e),this.options.init_event&&this.trigger("init")}var n=i(3),o=i(7),r=i(107),a=i(865),l=i(1015),h=i(1009),c=i(1010),u=i(1012),d=i(1017);n.extend(s.prototype,o.Events,{EventClass:d,initialize:n.noop,_generate_uuid:function(){return u("default_session")||c()},defaults:{init_event:!0,keep_counts:!1},pending_log_events:function(){var t=this.pending_events;return this.pending_events=[],t},generate_relative_id:function(){return this.event_count},unloaded:function(t){t||(t={}),t=this.before_unloaded(t)||{},this.options.keep_counts&&n.extend(t,{event_counts:this.event_counts}),n.isEmpty(t)||this.trigger("unload",t)},before_unloaded:function(t){return t},replaced:function(t){this.before_replaced(t);for(var e=this.pending_log_events();e.length;)this.log_lady.pending_events.push(e.shift())},before_replaced:n.noop,stop:function(){this.log_lady&&this.log_lady.unwatch(this)},trigger:function(t,e){var i=new this.EventClass(this,t,e);return this.options.keep_counts&&"init"!==t&&"unload"!==t&&(this.event_counts[t]||(this.event_counts[t]=0),this.event_counts[t]++),this.event_count+=1,this.pending_events.push(i),o.Events.trigger.call(this,t,i,this),this}}),s.extend=h,t.exports=s},function(t,e,i){"use strict";function s(t,e,i){n.isObject(i)&&o(i),Object.defineProperty(t,e,{value:i,writeable:!1,enumerable:!0,configurable:!1})}var n=i(3),o=i(1016);t.exports=s},function(t,e){"use strict";function i(t){var e,n;Object.freeze(t);for(n in t)e=t[n],t.hasOwnProperty(n)&&null!==e&&"object"===("undefined"==typeof e?"undefined":s(e))&&!Object.isFrozen(e)&&i(e)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};t.exports=i},function(t,e,i){"use strict";function s(t,e,i){this.name=e,this.log_key=n.result(t,"log_key"),this.data=i||null;var s=r(),o=n.result(t,"generate_relative_id"),l=n.result(t,"env"),h=t.uuid,c={};c.log_key=this.log_key,c.uuid=h,c.event=this.name,c.ts=s,o!==!1&&void 0!==o&&(c.rid=o),c.elapsed=c.ts-a,c.data=this.data,c.env=l,this.json=c}var n=i(3),o=i(865),r=o.getRealNow,a=o.realStartedAt;t.exports=s},function(t,e,i){"use strict";function s(t){return o.isString(t)?t:JSON.stringify(t)}function n(t,e,i){this.name=e,this.log_key=o.result(t,"log_key"),this.data=i||null;var n=l(),r=o.result(t,"generate_relative_id"),c=o.result(t,"env"),u=t.uuid,d={category:this.log_key},p=8,g=new Array(p);g[0]=s(n),g[1]=s(h),g[2]=s(u),g[3]=s(r),g[4]=s(a.getElapsed(n)),g[5]=s(e),g[6]=s(i),g[7]=s(c),d.fields=g,this.json=d}var o=i(3),r=i(272),a=i(865),l=a.getRealNow,h=r.get("tmgioct");t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"helpform",events:{"helpform:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"keycommands_trigger",events:{"keycommands:*":"handleEvent"},initialize:function(){this.hasLoggedJK=!1},handleEvent:function(t,e){if("jk"===t){if(this.hasLoggedJK)return;this.hasLoggedJK=!0}this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=i(107),o=s.extend({FLOW_VERSION_SINGLEFIELD:"singlefield",FLOW_VERSION_STANDARD:"standard",logKey:"loginregister",events:{"loginregister:*":"handleEvent"},initialize:function(){this.hasStartedFunnel=!1},logEnv:function(){return{actionType:"/login"===document.location.pathname?"login":"register",captchaType:"recaptcha",version:this._getFlowVersion()}},handleEvent:function(t,e){if("beginFlow"===t){if(this.hasStartedFunnel)return;this.hasStartedFunnel=!0}this.log(t,e)},_getFlowVersion:function(){return n.bool("oneid_force_newlandingpage")?this.FLOW_VERSION_SINGLEFIELD:this.FLOW_VERSION_STANDARD}});t.exports=o},function(t,e,i){"use strict";var s=i(3),n=i(1005),o=n.extend({logKey:"video_interactions",logEnv:{referrer:document.location.pathname},events:{"VideoPlayer:cacheUnload":"cacheUnloadLog","VideoPlayer:timeupdate":"updateLogCache","VideoPlayer:*":"handleEvent"},initialize:function(){this.excludedEvents=["cacheUnload","timeupdate"],this.unloadData={},s.each(this.loggers,function(t){t.before_unloaded=s.bind(this.beforeUnloaded,this)},this)},handleEvent:function(t,e){if(!s.contains(this.excludedEvents,t)){var i=s.extend({},e);i.postData&&(i.post_id=i.postData.id,delete i.postData),this.log(t,i)}},cacheUnloadLog:function(t,e){this.unloadData[e.id]=e},beforeUnloaded:function(t){s.each(this.unloadData,function(t){this.handleEvent("unload",t)},this)},updateLogCache:function(t,e){var i=["elapsed","position"];this.unloadData[e.id]=s.extend(this.unloadData[e.id],s.pick(e,i))}});t.exports=o},function(t,e,i){"use strict";var s=i(3),n=i(1005),o=n.extend({logKey:"vendorbutton",logEnv:{referrer:document.location.pathname},events:{"VendorButton:*":"handleEvent"},handleEvent:function(t,e){var i=s.extend({},e);i.post_id=e.postData.id,i.root_post_id=e.postData.root_id,i.tumblelog=e.postData.tumblelog,delete i.postData,this.log(t,i)}});t.exports=o},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"dashboard_sharing",events:{"dashboard-share:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){e=e||{},this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"related_recommendations",logOptions:{init_event:!1},events:{"rapid-recommendations:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"explore_trending",logOptions:{init_event:!1},events:{"explore-trending:*":"log"},logEnv:{location:document.location.pathname}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"roadblock",events:{"roadblock:*":"log"}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"linkpost_interactions",logOptions:{init_event:!1},events:{"linkpost:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(3),n=i(99),o=i(1006),r=i(1010),a=i(1005),l=a.extend({logKey:"peepr",logEnv:{baseSessionId:n.get("Components/LogLady/default_session"),context:n.get("Context/name")},events:{"peepr:message:*":"logMessage","peepr:open":"logOpen","peepr:close":"logClose","peepr:log:*":"logMessage"},logMessage:function(t,e){this.log(t,e.payload)},logOpen:function(){this.logger()},logClose:function(){this._logger.stop(),this._logger=null},setupEndpoints:s.noop,logOptions:function(){return{uuid:r()}},logger:function(){return this._logger||(this._logger=o(this)),this._logger},log:function(){var t=this.logger();t.trigger.apply(t,arguments)}});t.exports=l},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"abuseform",events:{"abuseform:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=i(99),o=s.extend({logKey:"recommended_blogs",logEnv:{context:n.get("Context/name"),location:document.location.pathname},logOptions:{init_event:!1},events:{"recommendedBlogs:*":"log"}});t.exports=o},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"tourguide_account",logEnv:{referrer:document.location.pathname},logOptions:{init_event:!1},events:{"TourGuideAccount:*":"log"}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"blocks",events:{"blocks:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"postform_interactions",logOptions:{init_event:!1},events:{"postform-interaction:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"header_search",logEnv:{referrer:document.location.pathname},events:{"header_search:*":"log"}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"gifsearch_interactions",logOptions:{init_event:!1},events:{"gifsearch:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){"unload"!==t&&this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=i(1038),o=i(107),r=s.extend({logKey:null,logSpots:[],events:function(){var t={};return o.bool("little_sister_kill_switch")||(t["LSLog:*"]="log"),t},log:function(t,e){if(e&&e.pt){var i={pt:e.pt,eventName:t};e.video_details&&(i.video_details=e.video_details),e.extraData&&(i.extraData=e.extraData),n.log(e.pt).trigger(t,i),
  e.is_ad&&n.flush()}}});t.exports=r},function(t,e,i){"use strict";function s(t){var e=[];return n.forEach(t,function(t){var i=n.find(e,{pt:t.pt});i||(i={pt:t.pt,events:[]},e.push(i)),i.events.push(t.event_data)}),e}var n=i(3),o=i(1008),r=i(1039),a=i(865),l=a.getRealNow,h=o.extend({build_payload:function(){var t=o.prototype.build_payload.call(this);return t.flushTime=l(),t}}),c=new h({EventClass:r,event_payload_name:"trackers",event_filter:function(t){return t.data&&t.data.pt},payload_formatter:s,endpoint:"https://ls.srvcs.tumblr.com/services/bblog"});t.exports=c},function(t,e,i){"use strict";function s(t,e,i){this.name=e,this.log_key=n.result(t,"log_key"),this.data=i||{};var s=r(),o={pt:this.data.pt,event_data:{timestamp:s,eventString:this.data.eventName}};this.data.video_details&&(o.event_data.data=this.data.video_details),this.data.extraData&&(o.event_data.data=o.event_data.data||{},n.extend(o.event_data.data,this.data.extraData)),this.json=o}var n=i(3),o=i(865),r=o.getRealNow;t.exports=s},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"messaging_interactions",logOptions:{init_event:!1},events:{"messaging-interaction:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=i(99),o=s.extend({logKey:"verified_onboarding_blogs",logEnv:{context:n.get("Context/name"),location:document.location.pathname},logOptions:{init_event:!1},events:{"verifiedBlogs:*":"log"}});t.exports=o},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"reactivation",logOptions:{init_event:!1},events:{"reactivation:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"activity_links",logOptions:{init_event:!1},logEnv:{location:document.location.pathname},events:{"activityLinks:*":"handleEvent"},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"notes_interactions",logOptions:{init_event:!1},logEnv:{location:document.location.pathname},events:{"notes-interactions:*":"log"}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"postchrome_interactions",logOptions:{init_event:!1},events:{"postchrome-interactions:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"toastlog",events:{"toastlog:*":"log"}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"async_loading",events:{"async-loading:*":"log"}});t.exports=n},function(t,e,i){"use strict";var s=i(1005),n=s.extend({logKey:"ads_interactions",logOptions:{init_event:!1},events:{"ads-interaction:*":"handleEvent"},logEnv:{location:document.location.pathname},handleEvent:function(t,e){this.log(t,e)}});t.exports=n},function(t,e,i){"use strict";var s=i(166);s({"Tumblr.Prima.Upload":i(429),"Tumblr.Prima.Ligature":i(222),"Tumblr.Events":i(109),"Tumblr.Prima.Events":i(109),"Tumblr.Prima.Dialog":i(142),"Tumblr.Dialog":i(142),"Tumblr.PostMessageChannel":i(830),"Tumblr.Prima.DOMEventor":i(108),"Tumblr.Prima.gutterMediaManager":i(1050),"Tumblr.Prima.Vendor.when":i(120),"Tumblr.Prima.Vendor.sequence":i(168),"Tumblr.log_lady":i(1051),"Tumblr.Prima.logLady":i(1051),"Tumblr.Prima.Models.Post":i(277),"Tumblr.Prima.Models.Tumblelog":i(119),"Tumblr.Prima.CrtPlayer":i(509),"Tumblr.Prima.CrtControl":i(839),"Tumblr.Prima.BlogCard":i(577),"Tumblr.Prima.Url":i(194),"Tumblr.Prima.ToolTip":i(1054),"Tumblr.Prima.SharePopover":i(271),"Tumblr.Prima.Messaging.SharePost":i(908),"Tumblr.Prima.utils.caniuse":i(511),"Tumblr.Prima.ConfettiView":i(629),"Tumblr.Prima.FlatSelect":i(1057),"Tumblr.Prima.Mixins.loggingData":i(278),"Tumblr.Prima.Scrollbar":i(390),"Tumblr.Prima.MessageControlsPopover":i(1059),"Tumblr.Prima.Block":i(141),"Tumblr.Prima.SafeMode":i(1061),"Tumblr.Prima.PeeprSearch":i(1062),"Tumblr.Prima.MessagingPopover":i(1076),"Tumblr.Prima.currentUser":i(110),"Tumblr.Prima.AdsPaginationHelper":i(1083),"Tumblr.Prima.SortableView":i(244),"Tumblr.Prima.getLoggingPayloadFromNote":i(1084),"Tumblr.Prima.Snowman":i(583),"Tumblr.Prima.postActivityLoader":i(862),"Tumblr.Prima.KnightRiderLoader":i(259),"Tumblr.Prima.Lib.hosts":i(783),"Tumblr.Prima.LivePhotos":i(450),"Tumblr.Prima.Carousel":i(1085),"Tumblr.Prima.ExpandableTags":i(1090),"Tumblr.Prima.Translate":i(100)}),t.exports=s},function(t,e,i){"use strict";var s=i(143),n=i(108),o=i(109),r=i(8),a=i(3),l=s.extend({name:"GutterMediaManager",gutteredView:null,gutterMargin:17,gutterWidth:300,maxViewWidth:300,viewportTransitionWidth:990,initialize:function(){this.layoutHasGutter=this.$right_column().length>0,this.layoutHasGutter||(this.gutterMargin=-65)},$right_column:function(){return this._$right_column||(this._$right_column=r(".right_column")),this._$right_column},toggleBackground:function(t){this.layoutHasGutter&&(t?(this.$right_column().addClass("has_docked_post"),this.$right_column().on("click.gutterManager",a.bind(this.handleGutterClick,this))):(this.$right_column().removeClass("has_docked_post"),this.$right_column().off("click.gutterManager")))},putViewInGutter:function(t,e){return e=a.defaults(e||{},{winRect:n.rect(),gutterPosition:this.gutterPosition(),animation:null,dimRadar:!0,removeOnGutterClick:!1,onDock:a.noop,onUndock:a.noop,dockLoggingName:"post:docked",dockLoggingData:null,undockLoggingName:"post:undocked",undockLoggingData:null}),this.isDockable(t,e)?(e.onDock=e.onDock||a.noop,this.gutteredView&&this.removeGutteredView(),this.gutteredView={view:t,options:e},e.onDock.call(t,e),e.dimRadar&&this.toggleBackground(!0),e.dockLoggingName&&e.dockLoggingData&&o.trigger(e.dockLoggingName,{loggingData:e.dockLoggingData}),this.gutteredView):!1},removeGutteredView:function(){if(this.gutteredView){var t=this.gutteredView.options,e=this.gutteredView.view;t.onUndock=t.onUndock||a.noop,t.onUndock.call(e,t),this.gutteredView=null,t.dimRadar&&this.toggleBackground(!1),t.undockLoggingName&&t.undockLoggingData&&o.trigger(t.undockLoggingName,{loggingData:t.undockLoggingData})}},isViewInGutter:function(t){return this.gutteredView&&this.gutteredView.view===t},isDockable:function(t,e){if(!this.gutteredView)return!0;var i=this.gutteredView?this.gutteredView.options.alwaysEvict:!0,s=e.alwaysEvict;return this.gutteredView.view!==t&&(!s||i)},handleGutterClick:function(t){this.gutteredView&&(t.preventDefault(),this.gutteredView.options.removeOnGutterClick&&this.removeGutteredView())},gutterPosition:function(){var t=n.rect(),e=this.viewportTransitionWidth/2-this.gutterMargin-this.gutterWidth,i={width:this.maxViewWidth,left:"50%",bottom:20,translateX:e},s=this.maxViewWidth-this.gutterWidth+this.viewportTransitionWidth;return t.windowWidth<s&&(i.width=s-t.windowWidth),i.width<this.gutterWidth&&(i.width=this.gutterWidth),i}});t.exports=new l},function(t,e,i){"use strict";var s=i(1052);t.exports=s},function(t,e,i){"use strict";var s=i(109),n=i(1008),o=i(1017),r=i(1053),a=new n({EventClass:o,event_payload_name:"events",event_filter:r,endpoint:"/svc/log/lady"});s.on("Capture:push",function(t,e,i){a.log(t,{init_event:!1}).trigger(e,i)}),t.exports=a},function(t,e,i){"use strict";var s=i(3),n=i(1012),o=s.keys(n("keys"));t.exports=function(t){return o.indexOf(t.log_key)>=0}},function(t,e,i){"use strict";var s=i(143),n=i(1055),o=s.extend({name:"ToolTip",class_name:"tumblr_tooltip",initialize:function(t){this.toolTipView=new n(t)}});t.exports=o},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(148),r=i(1056),a=o.extend({class_name:"tumblr_tooltip",template:r,defaults:{selector:"",class_name:"",offset:"50%",placement:"up"},initialize:function(t){this.options=t||{},this.options.selector=s.trim((t.selector||this.defaults.selector)+" "),this.options.class_name=t.class_name||this.defaults.class_name,this.options.offset=t.offset||this.defaults.offset,this.options.placement=t.placement||this.defaults.placement,this.tooltips=s(this.options.selector+"[data-tooltip]"),this.tooltips.on("remove",s.proxy(this.remove,this)),this.tooltips.on("mouseenter",n.bind(this.show,this)),this.tooltips.on("mouseleave",n.bind(this.hide,this))},show:function(t){var e=s(t.currentTarget);this.tooltip_template_data={tooltip:e.data("tooltip")};var i=s(this.tooltip(this.tooltip_template_data));e.append(i),this.setElement(i),this.delegateEvents(),i.removeClass("is_closed").addClass("is_open")},hide:function(t){var e=s(t.currentTarget),i=e.find("."+this.class_name);i.removeClass("is_open").addClass("is_closed"),i.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",n.bind(function(t){this.remove(t)},this))},remove:function(t){s(t.currentTarget).remove()},tooltip:function(t){return this.class_name="tooltip_wrapper",this.attributes={text:t.tooltip,placement:this.options.placement,class_name:this.options.class_name,left_css:this.options.offset},this.template(this.attributes)}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<div class="tooltip_wrapper '+__e(placement)+" "+__e(class_name)+'" style="left:'+__e(left_css)+'"><div class="tooltip"> '+(null==(__t=text)?"":__t)+" </div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(143),n=i(1058),o=s.extend({name:"FlatSelect",view:function(t){return new n(t)}});t.exports=o},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(148),r=o.extend({el:"body",defaults:{},events:{"change .flat_select select":"__selectChange"},__selectChange:function(t){var e=s(t.currentTarget);this.updateSelect(e)},initialize:function(t){this.options=n.extend({},this.defaults,t)},updateSelect:function(t){var e=t.siblings("label");e.text(t.find(":selected").text())}});t.exports=r},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(109),r=i(205),a=i(212),l=i(99),h=i(1060),c=n.extend({className:"popover--message-controls-popover",mixins:[r,a],template:h,events:{'click [data-action="delete"]':"_delete",'click [data-action="block"]':"_block",'click [data-action="flag"]':"_flag"},initialize:function(t){this.options=s.extend({},t),this.showFlagAndBlock=this.options.blockString&&this._notUsersOwnBlog(),this.post=t.post},_getSender:function(){return this.options.blockString&&-1===this.options.blockString.indexOf(":")?this.options.blockString:!1},_notUsersOwnBlog:function(){var t=this._getSender();if(t){var e=l.get("Context/userinfo/channels");return e=s.pluck(e,"name"),!s.includes(e,t)}return!0},_delete:function(t){t.preventDefault(),this.post["delete"](t)},_block:function(t){t.preventDefault(),this.post.block(t)},_flag:function(t){t.preventDefault();var e={mode:"message",post:this.post.model},i=this._getSender();i&&(e.sender=i),o.trigger("abuseform:open",e)},render:function(){return this.$el.html(this.template()),this},teardown:function(){return this.$el.remove(),this}});t.exports=c},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="popover popover_menu popover_gradient message-controls-popover"><div class="popover_inner"><ul> ',this.showFlagAndBlock&&(__p+=' <li class="popover_menu_item" data-action="block" data-block="'+__e(this.options.blockString)+'"><a class="popover_menu_item_anchor" href="#">'+__e(__("Block"))+'</a></li><li class="popover_menu_item" data-action="flag"><a class="popover_menu_item_anchor" href="#">'+__e(__("Report"))+"</a></li> "),__p+=' <li class="popover_menu_item" data-action="delete" data-confirm="'+(null==(__t=__("Are you sure you want to delete this?"))?"":__t)+'"><a class="popover_menu_item_anchor" href="#">'+__e(__("Delete"))+"</a></li></ul></div></div>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=[{id:"0",appeal:"OWNER_APPEAL_NSFW_NONE",readable:"none"},{id:"1",appeal:"OWNER_APPEAL_NSFW_AVAILABLE_PRIORITIZE",readable:"available_prioritize"},{id:"2",appeal:"OWNER_APPEAL_NSFW_AVAILABLE",readable:"available"},{id:"3",appeal:"OWNER_APPEAL_NSFW_IN_REVIEW",readable:"in_review"},{id:"4",appeal:"OWNER_APPEAL_NSFW_COMPLETE",readable:"complete"}],n=i(8),o=i(3),r=i(100),a=i(142),l=function(t){this.xhr&&this.xhr.abort();var e=o.has(this.model,"attributes.blog.name")?this.model.attributes.blog.name:this.model.tumblelog.id;return this.xhr=n.ajax({method:"POST",url:"/svc/appeal",data:{post_id:this.model.get("id"),blog_name:e,state:t},withFormKey:!0}),this.xhr},h=function(t){return parseInt(o.find(s,{appeal:t}).id,10)},c={dismiss:function(t){var e=n(t.target).closest(".own-post-banner");this._appealState=o.bind(l,this),this.xhr=this._appealState(h("OWNER_APPEAL_NSFW_AVAILABLE")),this.xhr.done(o.bind(function(){e.slideUp()},this))},request:function(t){var e=n(t.target).closest(".own-post-banner"),i=n(t.target).closest(".post_wrapper").find(".nsfw-eye");this._appealState=o.bind(l,this),this.xhr=this._appealState(h("OWNER_APPEAL_NSFW_IN_REVIEW")),this.xhr.done(o.bind(function(){i.attr("data-state",h("OWNER_APPEAL_NSFW_IN_REVIEW")),a.alert(r("Okay! We'll review the NSFW status of this and email you when we're done.")),e.slideUp()},this))},eyeTap:function(t){var e=n(t.currentTarget).attr("data-state"),i=n(t.target).closest(".post_wrapper").find(".own-post-banner"),s=n(t.target).closest(".post_wrapper").find(".nsfw-eye"),c={text:r("This is flagged NSFW. If that seems like a mistake, you can request a review."),text_ok:r("Request Review"),text_cancel:r("Nevermind"),callback_ok:o.bind(function(){this._appealState=o.bind(l,this),this.xhr=this._appealState(h("OWNER_APPEAL_NSFW_IN_REVIEW")),this.xhr.done(o.bind(function(){o.delay(function(){a.alert(r("Okay! We'll review the NSFW status of this and email you when we're done."))},300),s.attr("data-state",h("OWNER_APPEAL_NSFW_IN_REVIEW")),i.slideUp()},this))},this)};switch(parseInt(e,10)){case h("OWNER_APPEAL_NSFW_IN_REVIEW"):a.alert(r("This post is still flagged NSFW, but is currently being reviewed."));break;case h("OWNER_APPEAL_NSFW_COMPLETE"):a.alert(r("This post was reviewed by Tumblr and determined to be NSFW"));break;case h("OWNER_APPEAL_NSFW_AVAILABLE_PRIORITIZE"):case h("OWNER_APPEAL_NSFW_AVAILABLE"):a.confirm(c)}},openPeepr:function(t){a.alert(r("This will open Peepr soon"))},getAppealArray:function(){return s}};t.exports=c},function(t,e,i){"use strict";function s(t){return new n(t)}var n=i(1063);t.exports=s},function(t,e,i){"use strict";var s=i(3),n=i(8),o=i(155),r=i(109),a=i(1064),l=i(1065),h=i(1067),c=i(1074),u=i(1e3),d=o.extend({className:"peepr-blog-search",template:a,subviews:{filters:{constructor:l},input:{constructor:h}},events:{"submit .blog-search-form":"formSubmitHandler","click .blog-search-form":"onFormClick","click .clear-search":"clearSearch","click .toggle-search":"toggleSearch"},initialize:function(t){this.options=t,this.searchActive=!1,this.blog=t.blog,this.model=new u({blogname:this.blog.tumblelog_name_or_id,themeParams:this.blog.get("global_theme_params")}),s.each(this.subviews,function(t){t.options=t.options||{},t.options.model=this.model},this),this.bindEvents()},bindEvents:function(){this.listenTo(this.model.posts,"reset",this.onPostsReset),this.listenTo(this.model.posts,"add",this.onPostsAdd),this.listenTo(this.model,"search:reset",this.onSearchReset),this.listenTo(this.model,"change:next_offset",this.onOffsetChange),this.listenTo(this.model,"change:term",s.bind(this.log,this,"search-start",{})),this.listenTo(r,"indashblog:search:fetch-requested",this.onFetchRequested),this.listenTo(r,"indashblog:ready-animation-start",this.onPeeprReady)},onPeeprReady:function(){this.setWidth()},setWidth:function(){var t=this.$el.parents(".navigation_inner"),e=t.width(),i=t.find(".header_controls").outerWidth();this.$el.width(e-i)},onFetchRequested:function(t){this.model.fetch(t)},formSubmitHandler:function(t){t.preventDefault(),this.model.search()},onFormClick:function(t){t.stopPropagation()},toggleSearch:function(t){return t=s.defaults(t,{force:null,focus:!0}),this.model.get("term").length&&null===t.force?void this.clearSearch():(this.searchActive=s.isBoolean(t.force)?t.force:!this.searchActive,this.$el.toggleClass("show-search",this.searchActive),n(".indash_header_wrapper").toggleClass("search-active",this.searchActive),void(this.searchActive?t.focus&&s.delay(s.bind(this.input.focusInput,this.input),300):this.model.reset()))},clearSearch:function(){this.toggleSearch({force:!1}),r.trigger("indashblog:search:clear"),this.log("search-clear")},onSearchReset:function(){var t=this.model.get("term").length>0;this.$el.toggleClass("term-entered",t),t&&(r.trigger("indashblog:search:start"),this.searchActive||this.toggleSearch({focus:!1,force:!0}))},onPostsReset:function(t){t.length&&(r.trigger("indashblog:search:complete",t.toJSON()),this.log("search-complete"))},onOffsetChange:function(t,e){e>=0||(r.trigger("indashblog:search:results-end",this.model.posts.length?null:new c({model:this.model})),this.log("search-results-end"))},onPostsAdd:function(t){r.trigger("indashblog:search:post-added",t.toJSON())},log:function(t,e){var i={loggingData:s.defaults({blogname:this.blog.tumblelog_name_or_id,term:this.model.get("term"),sort:this.model.get("sort"),post_type:this.model.get("post_type"),post_role:this.model.get("post_role"),next_offset:this.model.get("next_offset")},e||{})};r.trigger("peepr-search:"+t,i)},remove:function(){this.model.stopListening(),o.prototype.remove.call(this)}});t.exports=d},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<form class="blog-search-form"><div data-subview="filters"></div><i class="icon_arrow_thin_left clear-search nav_icon"></i> <i class="icon_search toggle-search nav_icon"></i><div data-subview="input"></div></form>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(1066),r=i(995),a=n.extend({className:"search-filters",template:o,events:{"click .show-filter-popover":"showPopover"},initialize:function(){this.listenTo(this.model,"search:reset",this.hidePopover)},showPopover:function(){this.popover||(this.popover=new r({pinnedTarget:this.$el,model:this.model,preventInteraction:!0}),this.popover.render(),this.listenTo(this.popover,"close",this.onPopoverClose))},hidePopover:function(){this.popover&&this.popover.hide()},onPopoverClose:function(){s.defer(s.bind(function(){this.popover=null},this))}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<i class="icon_filter show-filter-popover nav_icon"></i>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(109),r=i(206),a=i(1068),l=i(1072),h=i(1073),c=n.extend({className:"search-input",template:h,mixins:[r],$$cacheKeys:{"blog-search-input":".blog-search-input"},initialize:function(){this.autocompletePopover=null,this.bindEvents(),this.blogSearchAutocompleteModel=new l({blogname:this.model.get("blogname")})},afterRender:function(){this.blogSearchAutocompleteHelper=new a({model:this.blogSearchAutocompleteModel,el:this.$$(".blog-search-input")})},events:{"focus .blog-search-input":"inputFocusHandler","keyup .blog-search-input":"inputKeyUpHandler","blur .blog-search-input":"inputBlurHandler"},bindEvents:function(){this.listenTo(this.model,"change:term",this.onTermChange),this.listenTo(this.model,"reset",this.onModelReset)},inputKeyUpHandler:function(){this.model.set("unsetTerm",this.getTerm()),this.blogSearchAutocompleteModel.set("matchTerm",this.getTerm())},focusInput:function(){this.$$(".blog-search-input").focus(),this.blogSearchAutocompleteHelper.showPopover()},getTerm:function(){return s.trim(this.$$(".blog-search-input").val())},setTerm:function(t){this.$$(".blog-search-input").val(t).blur()},onTermChange:function(t,e){this.setTerm(e)},onModelReset:function(){this.setTerm("")},inputFocusHandler:function(){o.trigger("indashblog:keycommands:suspend",!0)},inputBlurHandler:function(){o.trigger("indashblog:keycommands:resume")}});t.exports=c},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(1069),r=n.extend({events:{click:"showPopover",blur:"onInputBlur"},initialize:function(){this.popover=null,this.bindEvents()},bindEvents:function(){this.listenTo(this.model,"change:matchTerm",this.onMatchTermChange)},onMatchTermChange:function(){this.model.get("typeAheadMatches").length?this.showPopover():this.hidePopover()},showPopover:function(){this.model.getItems().then(s.bind(function(){!this.popover&&this.model.hasMatches()&&(this.popover=new o({pinnedTarget:this.$el,model:this.model,shift:{x:-this.getLeftOffset(),y:0},preventInteraction:!0,keycommands:!0}).render(),this.listenTo(this.popover,"close",this.onPopoverClose))},this))},getLeftOffset:function(){return this._leftOffset=this._leftOffset||this.$el.width()/2,this._leftOffset},onInputBlur:function(){s.delay(s.bind(this.hidePopover,this),100)},hidePopover:function(){this.popover&&this.popover.hide()},onPopoverClose:function(){s.defer(s.bind(function(){this.popover=null},this))}});t.exports=r},function(t,e,i){"use strict";var s=i(996),n=i(1070),o=s.extend({className:s.prototype.className+" blog-search-autocomplete-popover",bindEvents:function(){s.prototype.bindEvents.apply(this,arguments),this.listenTo(this,"itemSelected",this.subview.selectTerm)},Subview:n});t.exports=o},function(t,e,i){"use strict";var s=i(8),n=i(109),o=i(155),r=i(1071),a=o.extend({template:r,events:{"click [data-term]":"onTermClick"},initialize:function(){this.bindEvents()},bindEvents:function(){this.listenTo(this.model,"change:typeAheadMatches",this.render)},onTermClick:function(t){this.selectTerm(s(t.currentTarget))},selectTerm:function(t){n.trigger("peeprsearch:change:term",{term:t.attr("data-term")})}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj){__p+='<ul class="popover_inner_list search_filter_items"><li class="popover_header"> '+__e(__("Popular Tags:"))+" </li> ";for(var i=0;i<model.maxRender&&i<model.typeAheadMatches.length;i++)__p+=' <li class="popover_menu_item" data-term="'+__e(model.typeAheadMatches[i].tag)+'"><span class="popover_menu_item_anchor">#'+__e(model.typeAheadMatches[i].tag)+" </span></li> ";__p+=" </ul>"}return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(109),r=i(113),a=i(118),l=r.extend({defaults:{maxRender:20,matchTerm:"",typeAheadMatches:[]},urlRoot:"/svc/search/blog_search_typeahead",url:function(){return this.urlRoot+"/"+this.get("blogname")},initialize:function(){this.items=new a,this.fetched=!1,this.listenTo(o,"peeprsearch:change:unsetTerm",this.onUnsetTermChange),this.listenTo(this,"change:matchTerm sync",this.setMatches)},onUnsetTermChange:function(t){this.set("matchTerm",t.term)},hasMatches:function(){return this.items.length&&this.get("typeAheadMatches").length||!this.fetched},setMatches:function(){var t=this.get("matchTerm");if(!t.length)return void this.set("typeAheadMatches",this.items.toJSON());var e=this.items.filter(function(e){return e.get("tag").indexOf(t)>-1});this.set("typeAheadMatches",n.invoke(e,"toJSON"))},getItems:function(){if(this.items.length){var t=s.Deferred();return t.resolve(),t.promise()}return this.fetch(arguments)},parse:function(t){return this.items.reset(t.tags),this.fetched=!0,n.omit(t,"tags")}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<input type="text" class="blog-search-input" placeholder="'+__e(__("Search %s",model.blogname))+'">';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(8),n=i(3),o=i(109),r=i(155),a=i(1075),l=r.extend({className:"search-no-results",template:a,afterRender:function(){this.setHeight(),this.listenTo(o,"DOMEventor:flatresize",n.throttle(this.setHeight,300))},setHeight:function(){var t=s(".indash_blog .posts"),e=t.outerHeight()-t.height(),i=s(".indash_blog .header").height();this.$el.height(s(window).height()-i-e)}});t.exports=l},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<p class="no-results-text" style="color: '+__e(model.themeParams.title_color)+'">'+(null==(__t=__("Nothing here about<br/>%s.",_.escape(model.term)))?"":__t)+"</p>";return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";t.exports=i(1077)},function(t,e,i){"use strict";var s=i(3),n=i(109),o=i(155),r=i(1078),a=i(1082),l=o.extend({template:a,className:"messaging-popover-icon nav_icon",events:{click:"_onIconClick"},initialize:function(t){this.options=s.extend({},this.defaults,t),s.extend(this,s.pick(t,"model"))},showPopover:function(){this.popover||(this.popover=new r({pinnedTarget:this.$el,model:this.model,preventInteraction:!0}),this.popover.render(),this.listenTo(this.popover.getView(),"messagingSelected",this._onMessagingSelected),this.listenTo(this.popover.getView(),"askSelected",this._onAskSelected),this.listenTo(this.popover,"close",this._onPopoverClose))},openMessaging:function(){n.trigger("messaging:conversation:open:tumblelogs",[this.model],"peepr")},openAsk:function(){n.trigger("ask:form:open",{recipient:this.model.get("name"),allow_anonymous:this.model.get("anonymous_asks")})},_onIconClick:function(){this.model.get("asks")?this.showPopover():this.openMessaging()},_onMessagingSelected:function(){this.openMessaging()},_onAskSelected:function(){this.openAsk()},_onPopoverClose:function(){this.stopListening(this.popover),this.stopListening(this.popover.getView()),this.popover=null}});t.exports=l},function(t,e,i){"use strict";var s=i(3),n=i(148),o=i(1079),r=i(205),a=i(212),l=i(1081),h=n.extend({className:"popover--messaging-peepr popover info_popover popover_gradient",template:l,mixins:[r,a],initialize:function(t){this.options=s.extend({},this.defaults,t),this.view=new o({model:this.model})},render:function(){return this.$el.html(this.template),this.$(".popover_inner").append(this.view.render().$el),this.listenTo(this.view,"popoverClose",this.teardown),this},teardown:function(){this.view.remove(),this.remove()},getView:function(){return this.view}});t.exports=h},function(t,e,i){"use strict";var s=i(3),n=i(155),o=i(1080),r=n.extend({tagName:"ul",template:o,events:{"click [data-js-ask]":"_onClickAsk","click [data-js-message]":"_onClickMessage"},getTemplateData:function(){return{hasMessaging:this.model.get("can_receive_messages")===!0,hasAsks:this.model.get("asks")===!0,hasSubmissions:this.model.get("submissions")===!0,url:this.model.get("url")}},_onClickMessage:function(t){t.preventDefault(),this.trigger("messagingSelected"),this.trigger("popoverClose")},_onClickAsk:function(t){t.preventDefault(),this.trigger("askSelected"),s.delay(s.bind(function(){this.trigger("popoverClose")},this),1)}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)hasMessaging&&(__p+=' <li data-js-message><a href="#">'+__e(_("Send a message"))+"</a></li> "),__p+=" ",hasAsks&&(__p+=' <li data-js-ask><a class="ask" href="'+__e(url)+'/ask">'+__e(_("Ask a question"))+"</a></li> "),__p+=" ",hasSubmissions&&(__p+=' <li data-js-submit><a class="submit" target="_blank" href="'+__e(url)+'/submit">'+__e(_("Submit"))+"</a></li> ");return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="";with(obj)__p+='<div class="popover_inner"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+=__e(_("Send a message"));return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(143),n=s.extend({name:"AdsPaginationHelper",defaults:{nextAdPos:0},initialize:function(){this.set(this.data)},getNextAdPos:function(){return this.get("nextAdPos")}});t.exports=n},function(t,e,i){"use strict";function s(t){var e=t.filter(function(t){return o.includes(r,t)});return e.join("_")}function n(t){var e=t.closest(".post"),i=o.get(e.data("json"),"post-id")||e.attr("data-post-id"),n=e.find(".note_link_current").data("count"),r=s(t.attr("class").split(" "));return{postId:i,noteCount:n,noteType:r}}var o=i(3),r=["like","reblog","answer","reply","photo","with_commentary"];t.exports=n},function(t,e,i){"use strict";var s=i(1086);t.exports=s},function(t,e,i){"use strict";var s=i(155),n=i(1087),o=i(3),r=i(1089),a=i(510),l=i(109),h=i(149),c=i(278),u=s.extend({className:"carousel-container",template:r,hasPeeked:!1,mixins:[c],subviews:{carouselPositionView:{constructor:n,options:function(t){return{photoCount:t.model.get("photoset_photos").length}}}},events:{"click .carousel-item-container a":"contentLinkClick"},initialize:function(t){t=t||{},this.currentItem=0,this.carouselLinkUrl=t.carousel_link_url,this.setupWatcher(),this.model.set("is_carousel",!0),this.model.set("carousel_index",this.currentItem)},afterRenderSubviews:function(){var t=this;o.defer(function(){t.imageWidth=t.carouselPositionView.$el.width(),window.parent.postMessage("resize_photoset_iframe;"+t.model.get("id")+";"+t.imageWidth,"*")}),this.carouselItemContainer=this.$(".carousel-item-container"),this.listenTo(this.carouselPositionView,"switchCarouselItem",this.processCarouselItemSwitch),this.listenTo(this.carouselPositionView,"peekLeft",this.peekLeft),this.listenTo(this.carouselPositionView,"peekRight",this.peekRight),this.peekIfInViewport(),this.listenTo(l,"DOMEventor:flatscroll",o.throttle(this.peekIfInViewport,500),this)},render:function(){return this.$el.html(this.template({post:this.model,carousel_link_url:this.carouselLinkUrl})),this},peekIfInViewport:function(){var t=this;!this.hasPeeked&&this.watcher&&this.watcher.isFullyInViewport&&(this.carouselItemContainer.addClass("peek-animation"),h.animation(this.carouselItemContainer,function(){t.carouselItemContainer.removeClass("peek-animation")}),this.hasPeeked=!0,this.stopListening(l,"DOMEventor:flatscroll"),this.watcher=null)},peekLeft:function(){var t=this.$(".carousel-wrapper");
  t.addClass("peek-left-animation"),h.animation(t,function(){t.removeClass("peek-left-animation")})},peekRight:function(){var t=this.$(".carousel-wrapper");t.addClass("peek-right-animation"),h.animation(t,function(){t.removeClass("peek-right-animation")})},processCarouselItemSwitch:function(t){this.model.get("pt")&&l.trigger("carousel:slide",{loggingData:this.loggingData({userAction:"slide",extraData:{offset:this.currentItem,target_offset:t}})}),this.carouselItemContainer.css({transform:"translate3d("+t*-this.imageWidth+"px, 0, 0)"}),this.currentItem=t,this.model.set("carousel_index",t)},setupWatcher:function(){this.watcher=a.create(this.$el,-100)},contentLinkClick:function(){this.model.get("pt")&&l.trigger("carousel:click_thru",{loggingData:this.loggingData({userAction:"click_thru",extraData:{offset:this.currentItem}})})}});t.exports=u},function(t,e,i){"use strict";var s=i(8),n=i(155),o=i(1088),r=n.extend({autoAppend:!0,template:o,events:{"click .carousel-button":"onCarouselButtonClick","click .carousel-arrow-right":"goToNextItem","click .carousel-arrow-left":"goToPrevItem"},initialize:function(t){t=t||{},this.photoCount=t.photoCount||0,this.currentItem=0},switchCarouselItem:function(t){this.trigger("switchCarouselItem",t)},goToItem:function(t){t>=0&&t<=this.photoCount-1?(this.$(".carousel-button").removeClass("current"),this.$('.carousel-button[data-carousel-button-index="'+t+'"]').addClass("current"),this.currentItem=t,this.switchCarouselItem(this.currentItem)):0>t?this.trigger("peekLeft"):t>this.photoCount-1&&this.trigger("peekRight")},goToNextItem:function(t){this.goToItem(this.currentItem+1)},goToPrevItem:function(t){this.goToItem(this.currentItem-1)},onCarouselButtonClick:function(t){var e=s(t.target).data("carousel-button-index");this.goToItem(e)},render:function(){return this.$el.html(this.template({photoCount:this.photoCount})),this}});t.exports=r},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj){for(__p+='<div class="carousel-arrow carousel-arrow-left"></div><div class="carousel-arrow carousel-arrow-right"></div><div class="carousel-button-container"> ',i=0;i<photoCount;i++)__p+=' <span class="carousel-button'+__e(0===i?" current":"")+'" data-carousel-button-index="'+__e(i)+'">&#x25cf;</span> ';__p+=" </div>"}return __p}.toString()).apply(void 0,_values(_imports))},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<div class="carousel-wrapper"><div class="carousel-item-container"> ',_.forEach(post.get("photoset_photos"),function(t,e){__p+=" ",carousel_link_url&&(__p+=' <a target="_blank" href="'+__e(carousel_link_url)+'"> '),__p+=' <img class="carousel-item carousel-item-'+__e(e)+'" src="'+__e(t.high_res)+'" alt="'+__e(t.caption)+'"> ',carousel_link_url&&(__p+=" </a> "),__p+=" "}),__p+=' </div></div><div data-subview="carouselPositionView"></div>';return __p}.toString()).apply(void 0,_values(_imports))},function(t,e,i){"use strict";var s=i(1091);t.exports=s},function(t,e,i){"use strict";var s=i(155),n=i(1092),o=i(109),r=i(8),a=s.extend({events:{"click .see-all-tags":"_expandTags","click .post_tag":"_clickTag"},hasExpandedTags:!1,template:n,_expandTags:function(t){o.trigger("postchrome-interactions:expand-tags-click",{loggingData:{action:"expand-tags-click"}}),this.hasExpandedTags=!0,this.$el.removeClass("fadeable"),this.$(".see-all-tags").remove()},render:function(){this.$el.append(this.template())},_clickTag:function(t){var e=r(t.target);o.trigger("postchrome-interactions:tag-click",{loggingData:{action:"tag-click",tag:e.text(),hasExpandedTags:this.hasExpandedTags?"true":"false",wasHidden:this.hasExpandedTags&&e.position().top>81?"true":"false",postId:this.model.get("id"),tagIndex:e.index()}})}});t.exports=a},function(module,exports,__webpack_require__){var _=__webpack_require__(3),_imports="undefined"!=typeof _?_.templateSettings.imports:{},_keys=_.keys,_values=_.values;module.exports=Function(_keys(_imports),"return "+function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<div class="see-all-tags"><span class="ellipses">...</span> '+__e(__("See all"))+" </div>";return __p}.toString()).apply(void 0,_values(_imports))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){}]);